Made the fight world completable #33

Merged
kziolkowski merged 3 commits from feature/night_to_day into develop 2025-11-26 15:11:14 +01:00
3 changed files with 8 additions and 11 deletions
Showing only changes of commit 073a74bb22 - Show all commits
@@ -4,11 +4,8 @@ using Babushka.scripts.CSharp.Common.Util;
namespace Babushka.scripts.CSharp.Common.Fight.Actions;
public class BlobAttackAction : FighterAction
public class BlobAttackAction(int damage = 3) : FighterAction
{
// settings
private const int Damage = 3;
public override Variant<float, Func<bool>> GetAnimationEnd()
{
return 1;
@@ -21,7 +18,7 @@ public class BlobAttackAction : FighterAction
public override void ExecuteAction()
{
FightWorld.Instance.allyFighters.vesnaFighter.AddHealth(-Damage);
FightWorld.Instance.allyFighters.vesnaFighter.AddHealth(-damage);
}
public override async Task AnimateAction(AllFightersVisual allFightersVisual)
@@ -34,7 +31,7 @@ public class BlobAttackAction : FighterAction
await currentFighterVisual.AnimatePosToTarget(targetFighterVisual);
_ = targetFighterVisual.AnimateHit();
targetFighterVisual.SpawnDamageIndicatorNumber(Damage);
targetFighterVisual.SpawnDamageIndicatorNumber(damage);
await currentFighterVisual.AnimatePosToBase();
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ public class AllyFighters
public FightWorld.Fighter vesnaFighter = new()
{
type = FightWorld.Fighter.Type.Vesna,
maxHealth = 20,
maxHealth = 60,
availableActions =
[
new AllyAttackAction()
+4 -4
View File
@@ -133,7 +133,7 @@ public partial class FightWorld : Node
{
var enemyGroups = new List<FighterGroup>();
var enemyGroupCount = GD.RandRange(1, 3);
var enemyGroupCount = GD.RandRange(1, 2);
for (var i = 0; i < enemyGroupCount; i++)
{
@@ -150,7 +150,7 @@ public partial class FightWorld : Node
fighters = []
};
var enemyCount = GD.RandRange(1, 3);
var enemyCount = GD.RandRange(2, 3);
for (var i = 0; i < enemyCount; i++)
{
@@ -178,10 +178,10 @@ public partial class FightWorld : Node
{
type = type,
health = null,
maxHealth = 12,
maxHealth = GD.RandRange(8, 20),
availableActions =
[
new BlobAttackAction()
new BlobAttackAction(GD.RandRange(2, 5))
]
};