Files
Cielonos/Assets/Scripts/MainGame/Characters/Base/Subcontrollers/Reaction/ReactionSubcontroller.cs

91 lines
3.4 KiB
C#
Raw Normal View History

2025-11-25 08:19:33 -05:00
using System.Collections.Generic;
2026-02-13 09:22:11 -05:00
using SLSUtilities.General;
2025-11-25 08:19:33 -05:00
using UnityEngine;
namespace Cielonos.MainGame.Characters
{
2026-01-03 18:19:39 -05:00
public partial class ReactionSubcontroller : SubcontrollerBase<CharacterBase>
2025-11-25 08:19:33 -05:00
{
2026-05-23 08:27:50 -04:00
public Dictionary<Breakthrough.Type, bool> originalBreakthroughResistances;
public Dictionary<Breakthrough.Type, CompoundBool> breakthroughResistances;
2025-11-25 08:19:33 -05:00
public DodgeSubmodule dodgeSm;
public BlockSubmodule blockSm;
2026-02-13 09:22:11 -05:00
public ReflectionSubmodule reflectionSm;
2025-11-25 08:19:33 -05:00
public override void Initialize()
{
base.Initialize();
2025-12-08 05:27:53 -05:00
2026-05-23 08:27:50 -04:00
originalBreakthroughResistances = new Dictionary<Breakthrough.Type, bool>()
2025-11-25 08:19:33 -05:00
{
2026-05-23 08:27:50 -04:00
{ Breakthrough.Type.None, true },
{ Breakthrough.Type.Weak, true },
{ Breakthrough.Type.Medium, false },
{ Breakthrough.Type.Heavy, false },
{ Breakthrough.Type.Disruption, false },
{ Breakthrough.Type.Forced, false },
{ Breakthrough.Type.Unstoppable, false },
2025-11-25 08:19:33 -05:00
};
2025-12-08 05:27:53 -05:00
2026-05-23 08:27:50 -04:00
breakthroughResistances = new Dictionary<Breakthrough.Type, CompoundBool>()
2025-12-08 05:27:53 -05:00
{
2026-05-23 08:27:50 -04:00
{ Breakthrough.Type.None, new CompoundBool(true) },
{ Breakthrough.Type.Weak, new CompoundBool(true) },
{ Breakthrough.Type.Medium, new CompoundBool(false) },
{ Breakthrough.Type.Heavy, new CompoundBool(false) },
{ Breakthrough.Type.Disruption, new CompoundBool(false) },
{ Breakthrough.Type.Forced, new CompoundBool(false) },
{ Breakthrough.Type.Unstoppable, new CompoundBool(false) },
2025-12-08 05:27:53 -05:00
};
2025-11-25 08:19:33 -05:00
dodgeSm = new DodgeSubmodule(this);
blockSm = new BlockSubmodule(this);
2026-02-13 09:22:11 -05:00
reflectionSm = new ReflectionSubmodule(this);
2025-11-25 08:19:33 -05:00
}
public void Update()
{
2025-12-08 05:27:53 -05:00
if (owner.statusSm.isDead)
{
return;
}
2025-11-25 08:19:33 -05:00
dodgeSm.Update();
blockSm.Update();
2026-02-13 09:22:11 -05:00
reflectionSm.Update();
2025-12-08 05:27:53 -05:00
}
2025-11-25 08:19:33 -05:00
}
2026-01-03 18:19:39 -05:00
public partial class ReactionSubcontroller
{
public void InitializeResistances(EnemyRank enemyRank)
{
if (enemyRank == EnemyRank.Nexus || enemyRank == EnemyRank.Core)
{
2026-05-23 08:27:50 -04:00
originalBreakthroughResistances[Breakthrough.Type.Medium] = true;
originalBreakthroughResistances[Breakthrough.Type.Heavy] = true;
originalBreakthroughResistances[Breakthrough.Type.Disruption] = true;
breakthroughResistances[Breakthrough.Type.Medium] = new CompoundBool(true);
breakthroughResistances[Breakthrough.Type.Heavy] = new CompoundBool(true);
breakthroughResistances[Breakthrough.Type.Disruption] = new CompoundBool(true);
2026-02-13 09:22:11 -05:00
}
}
2026-05-23 08:27:50 -04:00
public void ModifyResistances(bool isResistant, int priority, params Breakthrough.Type[] types)
2026-02-13 09:22:11 -05:00
{
2026-05-23 08:27:50 -04:00
foreach (Breakthrough.Type type in types)
2026-02-13 09:22:11 -05:00
{
breakthroughResistances[type].Modify(isResistant, priority);
2026-01-03 18:19:39 -05:00
}
}
2026-03-20 12:07:44 -04:00
2026-05-23 08:27:50 -04:00
public void ModifyResistances(bool isResistant, int priority, List<Breakthrough.Type> types)
2026-03-20 12:07:44 -04:00
{
2026-05-23 08:27:50 -04:00
foreach (Breakthrough.Type type in types)
2026-03-20 12:07:44 -04:00
{
breakthroughResistances[type].Modify(isResistant, priority);
}
}
2026-01-03 18:19:39 -05:00
}
2025-11-25 08:19:33 -05:00
}