Files
Cielonos/Assets/Scripts/MainGame/Characters/Base/Subcontrollers/Reaction/ReactionSubcontroller.cs
SoulliesOfficial 33b1795c1f 更新
2026-01-03 18:19:39 -05:00

79 lines
2.6 KiB
C#

using System.Collections.Generic;
using MoreMountains.Feedbacks;
using SLSFramework.General;
using UnityEngine;
namespace Cielonos.MainGame.Characters
{
public partial class ReactionSubcontroller : SubcontrollerBase<CharacterBase>
{
public Dictionary<BreakthroughType, bool> originalBreakthroughResistances;
public Dictionary<BreakthroughType, bool> breakthroughResistances;
public DodgeSubmodule dodgeSm;
public BlockSubmodule blockSm;
public override void Initialize()
{
base.Initialize();
originalBreakthroughResistances = new Dictionary<BreakthroughType, bool>()
{
{ 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, bool>()
{
{ BreakthroughType.None, true },
{ BreakthroughType.Weak, true },
{ BreakthroughType.Medium, false },
{ BreakthroughType.Heavy, false },
{ BreakthroughType.Disruption, false },
{ BreakthroughType.Forced, false },
{ BreakthroughType.Unstoppable, false },
};
dodgeSm = new DodgeSubmodule(this);
blockSm = new BlockSubmodule(this);
}
public void Update()
{
if (owner.statusSm.isDead)
{
return;
}
dodgeSm.Update();
blockSm.Update();
}
public void ResetBreakthroughResistances()
{
foreach (var kvp in originalBreakthroughResistances)
{
breakthroughResistances[kvp.Key] = kvp.Value;
}
}
}
public partial class ReactionSubcontroller
{
public void InitializeResistances(EnemyRank enemyRank)
{
if (enemyRank == EnemyRank.Nexus || enemyRank == EnemyRank.Core)
{
originalBreakthroughResistances[BreakthroughType.Medium] = true;
originalBreakthroughResistances[BreakthroughType.Heavy] = true;
breakthroughResistances[BreakthroughType.Medium] = true;
breakthroughResistances[BreakthroughType.Heavy] = true;
}
}
}
}