Initial commit

This commit is contained in:
2020-10-26 00:50:16 -04:00
commit e3358f6dd1
707 changed files with 12028 additions and 0 deletions

38
scripts/Stats/Health.cs Normal file
View File

@ -0,0 +1,38 @@
using System;
public class Health : IStat
{
public int value { get { return hp; }}
public int max { get { return 100; }}
public int min { get {return 0; }}
private int hp = 100;
public event StatUpdatedHandler statUpdated;
public void Heal(int heal_amount)
{
int new_val = hp - heal_amount;
if(new_val > max)
hp = max;
else
hp = new_val;
}
public void Damage(int damange_amount)
{
int new_val = hp - damange_amount;
if(new_val < min)
hp = min;
else
hp = new_val;
OnStatUpdated();
}
protected void OnStatUpdated()
{
if(statUpdated != null)
statUpdated(hp);
}
}