195 lines
7.0 KiB
C#
195 lines
7.0 KiB
C#
using System.Collections.Generic;
|
|
using Cielonos.MainGame.Characters;
|
|
using SLSUtilities.FunctionalAnimation;
|
|
|
|
namespace Cielonos.MainGame.Inventory.Collections
|
|
{
|
|
public partial class Polychrome
|
|
{
|
|
public override void OnSwitchIn()
|
|
{
|
|
comboSm.main.Reset();
|
|
|
|
if (CombatManager.PassionSystem.LevelIndex >= 3)
|
|
{
|
|
Enemy target = CombatManager.EnemySm.Query(4f, TargetingScorePreset.MeleeAttack).PreferDisruptable().Best();
|
|
|
|
if (target != null) PlayDisruptionAttack(target, "B");
|
|
|
|
SetBlock(equipBlockData, true);
|
|
player.selfTimeSm.AddLocalTimer(0.4f, () => RemoveBlock(equipBlockData));
|
|
}
|
|
else
|
|
{
|
|
PlayTargetedAnimation("EquipBlock");
|
|
SetBlock(equipBlockData, false);
|
|
player.selfTimeSm.AddLocalTimer(0.4f, () =>
|
|
{
|
|
RemoveBlock(equipBlockData);
|
|
fullBodyFuncAnimSm.Stop("EquipBlock");
|
|
});
|
|
}
|
|
}
|
|
|
|
public override void OnPrimaryPress(List<PlayerInputModifierType> modifiers = null)
|
|
{
|
|
if (player.statusSm.HasStatus(StatusType.Stun) || player.reactionSc.blockSm.HaveBlockSource(blockData.blockName))
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (player.landMovementSc.isJumping)
|
|
{
|
|
if (_canAirLightAttack && functionSm["LightAttack"].IsAvailable())
|
|
{
|
|
string airNodeName = comboSm["AirLight"].GetNextNodeName("L");
|
|
if (PlayAirAttackL(airNodeName))
|
|
{
|
|
comboSm["AirLight"].NextCombo("L");
|
|
if (comboSm["AirLight"].GetCurrentNodeName() == "L1")
|
|
{
|
|
_canAirLightAttack = false;
|
|
}
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
if (modifiers.Has(PlayerInputModifierType.SpecialB))
|
|
{
|
|
if (functionSm["FarSlashes"].IsAvailable())
|
|
{
|
|
_farSlashTarget = CombatManager.EnemySm.Query(15f, TargetingScorePreset.RangedAttack).Best();
|
|
PlayFarSlashes(_farSlashTarget);
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
CharacterBase lightAttackTarget = CombatManager.EnemySm.Query(5f, TargetingScorePreset.MeleeAttack).Best();
|
|
|
|
if (player.landMovementSc.isSprinting && functionSm["LightAttack"].IsAvailable())
|
|
{
|
|
comboSm.main.Reset();
|
|
if (PlayRunAttack(lightAttackTarget))
|
|
{
|
|
comboSm.main.NextCombo("L");
|
|
}
|
|
return;
|
|
}
|
|
|
|
if (functionSm["LightAttack"].IsAvailable())
|
|
{
|
|
string nextNodeName = comboSm.main.GetNextNodeName("L");
|
|
if (PlayNormalAttackL(lightAttackTarget, nextNodeName))
|
|
{
|
|
comboSm.main.NextCombo("L");
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void OnSecondaryPress(List<PlayerInputModifierType> modifiers = null)
|
|
{
|
|
if (player.statusSm.HasStatus(StatusType.Stun))
|
|
{
|
|
return;
|
|
}
|
|
|
|
List<Enemy> nearbyEnemies = CombatManager.EnemySm.Query(2.5f, TargetingScorePreset.MeleeAttack).Candidates();
|
|
if (PlayParryAttack(nearbyEnemies)) return;
|
|
if (player.reactionSc.blockSm.HaveBlockSource(blockData.blockName)) return;
|
|
|
|
if (player.landMovementSc.isJumping)
|
|
{
|
|
if (_canAirHeavyAttack && functionSm["HeavyAttack"].IsAvailable())
|
|
{
|
|
comboSm.main.Reset();
|
|
if (PlayAirAttackR())
|
|
{
|
|
_canAirLightAttack = false;
|
|
_canAirHeavyAttack = false;
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
if (modifiers.Has(PlayerInputModifierType.SpecialB))
|
|
{
|
|
if (functionSm["DisruptionAttack"].IsAvailable())
|
|
{
|
|
comboSm.main.Reset();
|
|
bool isEnhanced = CombatManager.PassionSystem.LevelIndex >= 3;
|
|
string suffix = isEnhanced ? "B" : "A";
|
|
CombatManager.EnemySubmodule.TargetingQuery query =
|
|
CombatManager.EnemySm.Query(nearbyEnemies, TargetingScorePreset.MeleeAttack).PreferDisruptable();
|
|
Enemy target = query.Best();
|
|
PlayDisruptionAttack(target, suffix, query.AnyDisruptable());
|
|
}
|
|
return;
|
|
}
|
|
|
|
if (functionSm["HeavyAttack"].IsAvailable())
|
|
{
|
|
string suffix = comboSm.main.GetNextNodeName("R");
|
|
Enemy target = CombatManager.EnemySm.Query(nearbyEnemies, TargetingScorePreset.MeleeAttack).Best();
|
|
bool shouldWarp = false;
|
|
if (_hasPhotonWarper)
|
|
{
|
|
target = GetPhotonWarperAdjustedHeavyAttackTarget(suffix, out shouldWarp);
|
|
}
|
|
|
|
if (PlayNormalAttackR(target, suffix))
|
|
{
|
|
comboSm.main.NextCombo("R");
|
|
if (_hasPhotonWarper && shouldWarp)
|
|
{
|
|
ApplyPhotonWarperAfterHeavyAttack(target);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void OnSpecialAPress(List<PlayerInputModifierType> modifiers = null)
|
|
{
|
|
if (player.statusSm.HasStatus(StatusType.Stun))
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (functionSm["UltimateAttack"].IsAvailable())
|
|
{
|
|
comboSm.main.Reset();
|
|
PlayTargetedAnimation("UltimateAttack");
|
|
functionSm["UltimateAttack"].Execute();
|
|
if (_hasDisorderedPhotonCollector) ApplyUltimatePassionBoost();
|
|
}
|
|
}
|
|
|
|
public override void OnSpecialCPress(List<PlayerInputModifierType> modifiers = null)
|
|
{
|
|
if (player.statusSm.HasStatus(StatusType.Stun))
|
|
{
|
|
return;
|
|
}
|
|
|
|
comboSm.main.Reset();
|
|
SetBlock(blockData, true);
|
|
|
|
CharacterBase target = CombatManager.EnemySm.Query(5f, TargetingScorePreset.MeleeAttack).Best();
|
|
if (fullBodyFuncAnimSm.Stop(DisruptionType.ForcedAction))
|
|
{
|
|
PlayTargetedAnimation("Block", target, 2f, false, true, upperBodyFuncAnimSm, 1f, 0.1f, true);
|
|
}
|
|
}
|
|
|
|
public override void OnSpecialCRelease()
|
|
{
|
|
if (upperBodyFuncAnimSm.currentRuntimeFuncAnim is { animationName: "Block" })
|
|
{
|
|
upperBodyFuncAnimSm.Stop(DisruptionType.Must);
|
|
}
|
|
player.selfTimeSm.AddLocalTimer(0.04f, () => RemoveBlock());
|
|
}
|
|
}
|
|
}
|