2025-10-01 01:42:29 +02:00
|
|
|
using System;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Babushka.scripts.CSharp.Common.Util;
|
|
|
|
|
|
|
|
|
|
namespace Babushka.scripts.CSharp.Common.Fight.Actions;
|
|
|
|
|
|
2025-11-25 17:32:27 +01:00
|
|
|
public class BlobAttackAction(int damage = 3) : FighterAction
|
2025-10-01 01:42:29 +02:00
|
|
|
{
|
|
|
|
|
public override Variant<float, Func<bool>> GetAnimationEnd()
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool NextDetail()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ExecuteAction()
|
|
|
|
|
{
|
2025-12-11 17:13:28 +01:00
|
|
|
FightWorld.Instance.allyFighters.vesnaFighter.ChangeHealth(-damage);
|
2025-10-01 01:42:29 +02:00
|
|
|
}
|
|
|
|
|
|
2025-12-16 18:56:18 +01:00
|
|
|
public override async Task AnimateAction(AllFightersVisual allFightersVisual,
|
|
|
|
|
FightHappeningAnimationContext animationContext)
|
2025-10-01 01:42:29 +02:00
|
|
|
{
|
2025-10-07 18:08:53 +02:00
|
|
|
var currentFighter = HappeningData.fighterTurn.Current;
|
2025-10-01 01:42:29 +02:00
|
|
|
var targetFighter = FightWorld.Instance.allyFighters.vesnaFighter;
|
|
|
|
|
|
|
|
|
|
var currentFighterVisual = allFightersVisual.GetVisualForFighter(currentFighter);
|
|
|
|
|
var targetFighterVisual = allFightersVisual.GetVisualForFighter(targetFighter);
|
|
|
|
|
|
|
|
|
|
await currentFighterVisual.AnimatePosToTarget(targetFighterVisual);
|
|
|
|
|
_ = targetFighterVisual.AnimateHit();
|
2025-12-11 17:13:28 +01:00
|
|
|
targetFighterVisual.SpawnDamageIndicatorNumber($"-{damage}");
|
2025-10-01 01:42:29 +02:00
|
|
|
await currentFighterVisual.AnimatePosToBase();
|
|
|
|
|
}
|
|
|
|
|
}
|