Implement even more inventory/UI stuff

This commit is contained in:
2024-09-10 01:22:34 -07:00
parent 911f75da14
commit 62a9f99b81
18 changed files with 79 additions and 51 deletions

View File

@@ -113,7 +113,6 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
{
Raycast.DebugShapeCustomColor = Color.FromString("Purple", Colors.Purple);
EnemyLogic.Input(new EnemyLogic.Input.Alerted());
}
}
}
@@ -139,6 +138,8 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
})
.Handle((in EnemyLogic.Output.HitByPlayer output) =>
{
if (GameRepo.EquippedWeapon.Value.WeaponInfo.WeaponTags.Contains(WeaponTag.SelfDamage))
GameRepo.PlayerStatInfo.Value.CurrentHP -= 5;
});
this.Provide();
@@ -183,7 +184,7 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
var roll = rng.Randf();
if (roll <= GameRepo.EquippedWeapon.Value.WeaponInfo.Luck)
isCriticalHit = true;
var damage = DamageCalculator.CalculatePlayerDamage(hitBox.Damage, hitBox.GetParent<IPlayer>().PlayerStatInfo, EnemyStatInfo, GameRepo.EquippedWeapon.Value.WeaponInfo, isCriticalHit);
var damage = DamageCalculator.CalculatePlayerDamage(hitBox.GetParent<IPlayer>().PlayerStatInfo, EnemyStatInfo, GameRepo.EquippedWeapon.Value.WeaponInfo, isCriticalHit);
GD.Print($"Enemy Hit for {damage} damage.");
EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer(damage));
}