Initial commit

This commit is contained in:
Фёдор Веселов 2024-09-08 00:45:50 +05:00
commit c266d22f58
85 changed files with 1649 additions and 0 deletions

View file

@ -0,0 +1,41 @@
using Godot;
using System;
public partial class RuntimeZombieData : Node2D, IEntity
{
private int _hp;
[Export]
private int _maxHP;
[Export]
private int _line;
public int Hp => _hp;
public int MaxHp => _maxHP;
public int Line => _line;
public override void _Ready()
{
_hp = _maxHP;
}
public void Heal(int amount)
{
_hp += amount;
if (MaxHp > 0)
{
_hp = MaxHp;
}
}
public void TakeDamage(int amount)
{
_hp -= amount;
if (_hp <= 0)
{
QueueFree();
}
}
}