mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 12:35:54 +00:00
Bullet data overhaul
This commit is contained in:
parent
3682de18d5
commit
76221ca7a6
9 changed files with 57 additions and 26 deletions
|
|
@ -426,7 +426,7 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
}
|
||||
}
|
||||
|
||||
public void Hit(float damage)
|
||||
public void Hit(float damage, DamageType type = DamageType.Neutral)
|
||||
{
|
||||
if (!_canMove) return;
|
||||
GD.Print($"Player damaged for {damage}");
|
||||
|
|
@ -446,10 +446,9 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
|
|||
private void _on_damage_hit_box_area_entered(Area2D area)
|
||||
{
|
||||
if (!_canMove) return;
|
||||
if (area is Bullet bullet)
|
||||
if (area is Bullet bullet && bullet.BulletOwner != BulletOwner.Player)
|
||||
{
|
||||
GD.Print("Received damage manually");
|
||||
this.Hit(bullet.Damage);
|
||||
this.Hit(bullet.Damage, bullet.DamageType);
|
||||
bullet.QueueFree();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue