Damage calculation including elemental buff/resistance

This commit is contained in:
2024-09-04 01:24:37 -07:00
parent 9a24ebf058
commit d7a49ba974
23 changed files with 311 additions and 70 deletions

View File

@@ -15,6 +15,8 @@ namespace GameJamDungeon
public readonly record struct Attack;
public readonly record struct AttackAnimationFinished;
public readonly record struct Killed;
}
}
}

View File

@@ -8,7 +8,7 @@ namespace GameJamDungeon
public partial record State
{
[Meta, Id("player_logic_alive")]
public abstract partial record Alive : State, IGet<Input.PhysicsTick>, IGet<Input.Moved>
public abstract partial record Alive : State, IGet<Input.PhysicsTick>, IGet<Input.Moved>, IGet<Input.Killed>
{
public virtual Transition On(in Input.PhysicsTick input)
{
@@ -36,9 +36,14 @@ namespace GameJamDungeon
{
var gameRepo = Get<IGameRepo>();
gameRepo.SetPlayerGlobalPosition(input.GlobalPosition);
GD.Print($"Current position: {input.GlobalPosition}");
return ToSelf();
}
public Transition On(in Input.Killed input)
{
GD.Print("Player died");
return To<Disabled>();
}
}
}
}