mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 04:25:54 +00:00
Mapping
This commit is contained in:
parent
ba2f6a97fc
commit
efd6283487
15 changed files with 177 additions and 35 deletions
|
|
@ -25,6 +25,7 @@ public partial class Enemy : CharacterBody2D
|
|||
[Export] public float AlarmReactRange = 200f;
|
||||
|
||||
[Export] public Weapon EquippedWeapon;
|
||||
[Export] public Node2D DefeatScript;
|
||||
|
||||
protected float _currentHealth = 0f;
|
||||
|
||||
|
|
@ -218,13 +219,30 @@ public partial class Enemy : CharacterBody2D
|
|||
|
||||
}
|
||||
|
||||
private void Explode()
|
||||
protected virtual void Explode()
|
||||
{
|
||||
Debug.WriteLine("Ded");
|
||||
if (DefeatScript is not null)
|
||||
{
|
||||
ActivateDefeatScript();
|
||||
}
|
||||
//CreateParticles();
|
||||
//CreateDebris();
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
protected void ActivateDefeatScript()
|
||||
{
|
||||
if (DefeatScript is not IActivable target)
|
||||
{
|
||||
GD.PrintErr($"Target {DefeatScript.Name} is not activable");
|
||||
return;
|
||||
}
|
||||
|
||||
target?.Activate();
|
||||
|
||||
GD.Print($"{DefeatScript.Name} activated");
|
||||
}
|
||||
|
||||
public void Hit(float damage)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue