93 lines
3.3 KiB
C#
93 lines
3.3 KiB
C#
using System.Collections.Generic;
|
|
using Cielonos.MainGame.Buffs.Character;
|
|
using Cielonos.MainGame.Characters;
|
|
using Cielonos.MainGame.UI;
|
|
using SLSUtilities.FunctionalAnimation;
|
|
using SLSUtilities.WwiseAssistance;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Inventory.Collections
|
|
{
|
|
public partial class Frostfield : SupportEquipmentBase
|
|
{
|
|
private const string FrostfieldAnimationName = "FrostSlash";
|
|
private const float FrostfieldLifeTime = 5f;
|
|
private const float FrostfieldEnableTime = 0.04f;
|
|
private const float FreezeProgress = 100f;
|
|
|
|
public override void OnEquipped()
|
|
{
|
|
base.OnEquipped();
|
|
RegisterFuncAnims();
|
|
RegisterFunctionsToAnimSc();
|
|
}
|
|
|
|
public override void OnUnequipped()
|
|
{
|
|
if (fullBodyFuncAnimSm.currentRuntimeFuncAnim?.animationName == FrostfieldAnimationName)
|
|
{
|
|
fullBodyFuncAnimSm.Stop(DisruptionType.Must);
|
|
}
|
|
|
|
base.OnUnequipped();
|
|
}
|
|
|
|
public override void OnPress(List<PlayerInputModifierType> modifiers = null)
|
|
{
|
|
if (functionSm.mainFunction == null || !functionSm.mainFunction.IsAvailable() || !fullBodyFuncAnimSm.CheckPlayability())
|
|
{
|
|
PlayerCanvas.SupportEquipmentsUIArea[this].CanNotUseOutlineAnimation();
|
|
return;
|
|
}
|
|
|
|
Enemy target = CombatManager.EnemySm.Query(50f).LockonFirst();
|
|
|
|
if (!PlayTargetedAnimation(FrostfieldAnimationName, target, 3f, true))
|
|
{
|
|
return;
|
|
}
|
|
|
|
functionSm.mainFunction.Execute();
|
|
PlayerCanvas.SupportEquipmentsUIArea[this].UseOutlineAnimation();
|
|
}
|
|
}
|
|
|
|
public partial class Frostfield
|
|
{
|
|
private void FAPF_GenerateFrostSlash(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
CustomFunction.PC_StringString parameters =
|
|
rtFuncAnim.GetParams<CustomFunction.PC_StringString>();
|
|
|
|
GenerateFrostSlash(parameters.str0, attackData[parameters.str1]);
|
|
}
|
|
|
|
private void FAPF_GenerateFrostIndicator(RuntimeFuncAnim rtFuncAnim)
|
|
{
|
|
vfxData.SpawnMuzzleVFX("FrostSlash", player, player.bodyPartsSc.rightHand);
|
|
AudioManager.Post(AK.EVENTS.FROSTFIELD_HINT, player.gameObject);
|
|
}
|
|
|
|
private void GenerateFrostSlash(string vfxName, AttackUnit attackUnit)
|
|
{
|
|
vfxData.SpawnVFX("Slash", player);
|
|
AudioManager.Post(AK.EVENTS.FROSTFIELD_SLASH, player.gameObject);
|
|
|
|
NormalArea frostfield = vfxData.SpawnVFX(vfxName, player)
|
|
.GetComponentInChildren<NormalArea>();
|
|
|
|
frostfield.Initialize<NormalArea>(player, this, Fraction.Enemy)
|
|
.SetAttackSubmodule<NormalArea>(attackUnit)
|
|
.SetTimeSubmodule<NormalArea>(FrostfieldLifeTime, 0f, FrostfieldEnableTime)
|
|
.SetHitSubmodule<NormalArea>();
|
|
|
|
frostfield.eventSm.onHit.Add((target, _) =>
|
|
{
|
|
AudioManager.Post(AK.EVENTS.FROSTFIELD_HIT, target.gameObject);
|
|
new Freeze.Progress(FreezeProgress).Apply(target, player, this);
|
|
feedbackSc.PlayFeedback("Hit");
|
|
});
|
|
}
|
|
}
|
|
}
|