using System.Collections.Generic; using MoreMountains.Feedbacks; 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() { { BreakthroughType.None, true }, { BreakthroughType.Weak, true }, { BreakthroughType.Medium, false }, { BreakthroughType.Heavy, false }, { BreakthroughType.Disruption, false }, { BreakthroughType.Forced, false }, { BreakthroughType.Unstoppable, false }, }; breakthroughResistances = new Dictionary() { { BreakthroughType.None, new CompoundBool(true) }, { BreakthroughType.Weak, new CompoundBool(true) }, { BreakthroughType.Medium, new CompoundBool(false) }, { BreakthroughType.Heavy, new CompoundBool(false) }, { BreakthroughType.Disruption, new CompoundBool(false) }, { BreakthroughType.Forced, new CompoundBool(false) }, { BreakthroughType.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[BreakthroughType.Medium] = true; originalBreakthroughResistances[BreakthroughType.Heavy] = true; originalBreakthroughResistances[BreakthroughType.Disruption] = true; breakthroughResistances[BreakthroughType.Medium] = new CompoundBool(true); breakthroughResistances[BreakthroughType.Heavy] = new CompoundBool(true); breakthroughResistances[BreakthroughType.Disruption] = new CompoundBool(true); } } public void ModifyResistances(bool isResistant, int priority, params BreakthroughType[] types) { foreach (BreakthroughType type in types) { breakthroughResistances[type].Modify(isResistant, priority); } } } }