Sync weapon equip to hitbox damage
This commit is contained in:
@@ -10,11 +10,11 @@ namespace GameJamDungeon
|
||||
[Meta, Id("enemy_logic_state_alive")]
|
||||
public abstract partial record Alive : State, IGet<Input.HitByPlayer>
|
||||
{
|
||||
public Transition On(in Input.HitByPlayer _)
|
||||
public Transition On(in Input.HitByPlayer input)
|
||||
{
|
||||
var enemy = Get<IEnemy>();
|
||||
var gameRepo = Get<IGameRepo>();
|
||||
enemy.CurrentHP -= gameRepo.EquippedWeapon.InventoryInfo.Damage;
|
||||
enemy.CurrentHP -= input.Damage;
|
||||
GD.Print("Current HP: " + enemy.CurrentHP);
|
||||
GD.Print($"Hit by {gameRepo.EquippedWeapon.Name}");
|
||||
Output(new Output.HitByPlayer());
|
||||
|
||||
Reference in New Issue
Block a user