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
{
2025-12-08 05:27:53 -05:00
public Dictionary<BreakthroughType, bool> originalBreakthroughResistances;
2026-02-13 09:22:11 -05:00
public Dictionary<BreakthroughType, 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
originalBreakthroughResistances = new Dictionary<BreakthroughType, bool>()
2025-11-25 08:19:33 -05:00
{
2025-12-08 05:27:53 -05:00
{ BreakthroughType.None, true },
{ BreakthroughType.Weak, true },
2026-01-03 18:19:39 -05:00
{ BreakthroughType.Medium, false },
{ BreakthroughType.Heavy, false },
2025-12-08 05:27:53 -05:00
{ BreakthroughType.Disruption, false },
{ BreakthroughType.Forced, false },
{ BreakthroughType.Unstoppable, false },
2025-11-25 08:19:33 -05:00
};
2025-12-08 05:27:53 -05:00
2026-02-13 09:22:11 -05:00
breakthroughResistances = new Dictionary<BreakthroughType, CompoundBool>()
2025-12-08 05:27:53 -05:00
{
2026-02-13 09:22:11 -05:00
{ 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) },
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)
{
originalBreakthroughResistances[BreakthroughType.Medium] = true;
originalBreakthroughResistances[BreakthroughType.Heavy] = true;
2026-02-13 09:22:11 -05:00
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);
2026-01-03 18:19:39 -05:00
}
}
2026-03-20 12:07:44 -04:00
public void ModifyResistances(bool isResistant, int priority, List<BreakthroughType> types)
{
foreach (BreakthroughType type in types)
{
breakthroughResistances[type].Modify(isResistant, priority);
}
}
2026-01-03 18:19:39 -05:00
}
2025-11-25 08:19:33 -05:00
}