using System.Collections.Generic; using SLSUtilities.General; using UnityEngine; namespace Cielonos.MainGame.Characters { public partial class ReactionSubcontroller : SubcontrollerBase { public Dictionary originalBreakthroughResistances; public Dictionary breakthroughResistances; public DodgeSubmodule dodgeSm; public BlockSubmodule blockSm; public ReflectionSubmodule reflectionSm; public override void Initialize() { base.Initialize(); originalBreakthroughResistances = new Dictionary() { { 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 }, }; breakthroughResistances = new Dictionary() { { 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) }, }; dodgeSm = new DodgeSubmodule(this); blockSm = new BlockSubmodule(this); reflectionSm = new ReflectionSubmodule(this); } public void Update() { if (owner.statusSm.isDead) { return; } dodgeSm.Update(); blockSm.Update(); reflectionSm.Update(); } } public partial class ReactionSubcontroller { public void InitializeResistances(EnemyRank enemyRank) { if (enemyRank == EnemyRank.Nexus || enemyRank == EnemyRank.Core) { 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); } } public void ModifyResistances(bool isResistant, int priority, params Breakthrough.Type[] types) { foreach (Breakthrough.Type type in types) { breakthroughResistances[type].Modify(isResistant, priority); } } public void ModifyResistances(bool isResistant, int priority, List types) { foreach (Breakthrough.Type type in types) { breakthroughResistances[type].Modify(isResistant, priority); } } } }