new player art
This commit is contained in:
parent
562a33bd8e
commit
f774f8e8a4
65 changed files with 2953 additions and 276 deletions
|
|
@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Dancer;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
[Meta(typeof(IAutoNode)), Tool]
|
||||
public sealed partial class Hitbox : Area2D
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
|
@ -12,7 +12,8 @@ public sealed partial class Hitbox : Area2D
|
|||
|
||||
[Export(PropertyHint.None, "suffix:s")]
|
||||
private float LocalImmunity { get; set; }
|
||||
private int LocalCountLimit { get; set; } = 1000;
|
||||
[Export]
|
||||
private int LocalCountLimit { get; set; } = 1;
|
||||
|
||||
[Signal]
|
||||
public delegate void BodyHitEventHandler(Hitbox hitbox, Node2D body);
|
||||
|
|
@ -22,6 +23,7 @@ public sealed partial class Hitbox : Area2D
|
|||
|
||||
public void OnResolved()
|
||||
{
|
||||
ProcessMode = ProcessModeEnum.Disabled;
|
||||
BodyEntered += OnEntered;
|
||||
HitboxOwner.OnHitboxAdded(this);
|
||||
}
|
||||
|
|
@ -59,6 +61,20 @@ public sealed partial class Hitbox : Area2D
|
|||
entry.Immunity = Mathf.Max(0f, entry.Immunity);
|
||||
}
|
||||
|
||||
public void StartAttack()
|
||||
{
|
||||
if (Engine.IsEditorHint()) Visible = true;
|
||||
ProcessMode = ProcessModeEnum.Inherit;
|
||||
foreach (var immunityEntry in _immunityEntries.Values)
|
||||
immunityEntry.HitCount = 0;
|
||||
}
|
||||
|
||||
public void StopAttack()
|
||||
{
|
||||
if (Engine.IsEditorHint()) Visible = false;
|
||||
ProcessMode = ProcessModeEnum.Disabled;
|
||||
}
|
||||
|
||||
private sealed class ImmunityEntry
|
||||
{
|
||||
public float Immunity { get; set; }
|
||||
|
|
|
|||
12
src/combat/hitbox.tscn
Normal file
12
src/combat/hitbox.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene format=3 uid="uid://cva3ecq7vp3a4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b4k42r866lkut" path="res://src/combat/Hitbox.cs" id="1_cask4"]
|
||||
|
||||
[node name="Hitbox" type="Area2D" unique_id=1918418417]
|
||||
collision_layer = 8
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_cask4")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=2048987579]
|
||||
disabled = true
|
||||
debug_color = Color(0.99430805, 0, 0.2314094, 0.41960785)
|
||||
Loading…
Add table
Add a link
Reference in a new issue