You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
674 B
29 lines
674 B
10 months ago
|
using UnityEngine;
|
||
|
public class Entity : ScriptableObject
|
||
|
{
|
||
|
public string Name;
|
||
|
public int Age;
|
||
|
string Faction;
|
||
|
public string Occupation;
|
||
|
public int Level = 1;
|
||
|
public int Health = 2;
|
||
|
public int Strength = 1;
|
||
|
public int Magic = 0;
|
||
|
public int Defense = 0;
|
||
|
public int Speed = 1;
|
||
|
public int Damage = 1;
|
||
|
public int Armor = 0;
|
||
|
public int NoOfAttacks = 1;
|
||
|
public string Weapon;
|
||
|
public Vector2 Position;
|
||
|
|
||
|
public void TakeDamage(int Amount)
|
||
|
{
|
||
|
Health = Health - Mathf.Clamp((Amount - Armor), 0, int.MaxValue);
|
||
|
}
|
||
|
|
||
|
public void Attack(Entity Entity)
|
||
|
{
|
||
|
Entity.TakeDamage(Strength);
|
||
|
}
|
||
|
}
|