using Godot;
using Rokojori;
using System.Collections.Generic;

[Tool, GlobalClass]
public partial class WallHealth:Action
{
  [Export]
  public int health = 20;

  [Export]
  public Action onHit;

  [Export]
  public Action onFinalHit;

  protected override void _OnTrigger()
  {
    if ( health == 0 )
    {
      return;
    }


    health --;

    if ( health == 0 )
    {
      Action.Trigger( onFinalHit );
    }
    else
    {
      Action.Trigger( onHit );
    }
    
  }
}