Added blob attack action
This commit is contained in:
@@ -36,7 +36,7 @@ _allyFighters = NodePath("AllyFighters")
|
|||||||
_enemyFighters = NodePath("EnemyFighters")
|
_enemyFighters = NodePath("EnemyFighters")
|
||||||
_blobFighterVisual = ExtResource("4_vp8s0")
|
_blobFighterVisual = ExtResource("4_vp8s0")
|
||||||
_vesnaFighterVisual = ExtResource("4_qo0gi")
|
_vesnaFighterVisual = ExtResource("4_qo0gi")
|
||||||
_positionDistanceFromCenter = PackedFloat32Array(200, 400, 600)
|
_positionDistanceFromCenter = PackedFloat32Array(300, 550, 800)
|
||||||
|
|
||||||
[node name="AllyFighters" type="Node2D" parent="FightVisuals"]
|
[node name="AllyFighters" type="Node2D" parent="FightVisuals"]
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Babushka.scripts.CSharp.Common.Util;
|
||||||
|
|
||||||
|
namespace Babushka.scripts.CSharp.Common.Fight.Actions;
|
||||||
|
|
||||||
|
public class BlobAttackAction : FighterAction
|
||||||
|
{
|
||||||
|
public override Variant<float, Func<bool>> GetAnimationEnd()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool NextDetail()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ExecuteAction()
|
||||||
|
{
|
||||||
|
FightWorld.Instance.allyFighters.vesnaFighter.AddHealth(-3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task AnimateAction(AllFightersVisual allFightersVisual)
|
||||||
|
{
|
||||||
|
var currentFighter = HappeningData.fighterStack.Current;
|
||||||
|
var targetFighter = FightWorld.Instance.allyFighters.vesnaFighter;
|
||||||
|
|
||||||
|
var currentFighterVisual = allFightersVisual.GetVisualForFighter(currentFighter);
|
||||||
|
var targetFighterVisual = allFightersVisual.GetVisualForFighter(targetFighter);
|
||||||
|
|
||||||
|
await currentFighterVisual.AnimatePosToTarget(targetFighterVisual);
|
||||||
|
_ = targetFighterVisual.AnimateHit();
|
||||||
|
await currentFighterVisual.AnimatePosToBase();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Babushka.scripts.CSharp.Common.Fight.Actions;
|
||||||
using Babushka.scripts.CSharp.Common.Util;
|
using Babushka.scripts.CSharp.Common.Util;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
@@ -180,7 +181,7 @@ public partial class FightWorld : Node
|
|||||||
maxHealth = 12,
|
maxHealth = 12,
|
||||||
availableActions =
|
availableActions =
|
||||||
[
|
[
|
||||||
new FighterAction.Skip()
|
new BlobAttackAction()
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user