Implement even more inventory/UI stuff
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user