mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Mapping
This commit is contained in:
parent
f9d8d37913
commit
538f4f215f
13 changed files with 105 additions and 17 deletions
|
|
@ -19,6 +19,9 @@ public partial class GenericDamageReceiver : Area2D, IHittable
|
|||
[Export] public Array<DamageResistance> DamageResistances { get; set; } = [];
|
||||
|
||||
[Export] public bool DeleteParentOnDeath { get; private set; } = true;
|
||||
|
||||
[Signal]
|
||||
public delegate void ShieldHitEventHandler();
|
||||
|
||||
//[Signal] public delegate void DeathEventHandler();
|
||||
|
||||
|
|
@ -41,8 +44,12 @@ public partial class GenericDamageReceiver : Area2D, IHittable
|
|||
private void _on_damage_hitbox_area_entered(Area2D area)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
if (Invulnerable) return;
|
||||
if (area is not Bullet bullet) return;
|
||||
if (Invulnerable)
|
||||
{
|
||||
EmitSignalShieldHit();
|
||||
return;
|
||||
};
|
||||
|
||||
if (BulletGroup is BulletOwner.None)
|
||||
{
|
||||
|
|
|
|||
13
Scripts/Components/Actors/HitShieldAnimation.cs
Normal file
13
Scripts/Components/Actors/HitShieldAnimation.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.Actors;
|
||||
|
||||
public partial class HitShieldAnimation : Node2D
|
||||
{
|
||||
[Export] public AnimatedSprite2D Sprite { get; private set; }
|
||||
|
||||
public void Play()
|
||||
{
|
||||
Sprite?.Play();
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/Actors/HitShieldAnimation.cs.uid
Normal file
1
Scripts/Components/Actors/HitShieldAnimation.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://br0nmxhstr5ag
|
||||
Loading…
Add table
Add a link
Reference in a new issue