Sync weapon equip to hitbox damage

This commit is contained in:
2024-09-01 16:34:33 -07:00
parent 5b110845e9
commit dc3639ad6e
8 changed files with 49 additions and 27 deletions

View File

@@ -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());