Fight rework premature merge #22
@@ -36,7 +36,7 @@ _allyFighters = NodePath("AllyFighters")
|
||||
_enemyFighters = NodePath("EnemyFighters")
|
||||
_blobFighterVisual = ExtResource("4_vp8s0")
|
||||
_vesnaFighterVisual = ExtResource("4_qo0gi")
|
||||
_positionDistanceFromCenter = PackedFloat32Array(200, 400, 600)
|
||||
_positionDistanceFromCenter = PackedFloat32Array(300, 550, 800)
|
||||
|
||||
[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
|
||||
|
Jonathan marked this conversation as resolved
Outdated
|
||||
{
|
||||
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 Babushka.scripts.CSharp.Common.Fight.Actions;
|
||||
using Babushka.scripts.CSharp.Common.Util;
|
||||
using Godot;
|
||||
|
||||
@@ -180,7 +181,7 @@ public partial class FightWorld : Node
|
||||
maxHealth = 12,
|
||||
availableActions =
|
||||
[
|
||||
new FighterAction.Skip()
|
||||
new BlobAttackAction()
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user
Verstehe ich das richtig, dass wir für jeden Gegner(typ) ne neue Klasse anlegen müssen? Falls ja: Wäre es vielleicht auch möglich, das über Config-Ressourcen ganz oder teilwese konfigurierbar zu machen?
Es braucht nicht jeder gegner type eine klasse, sondern jede action. Es können auch mehrere gegner typen die gleiche action haben.
Das irgendwie cool konfigurierbar zu machen fänd ich auch sinnvoll, aber erst später und nicht für den prototypen