proto_turn_based_rpg/Assets/Scripts/Player.cs

29 lines
654 B
C#

using System;
public class Player
{
public int health;
public int damage;
public float damageReduction = 1.0f;
public float damageModification = 1.0f;
public bool isBloodCounter;
public bool isCounter;
public bool isStunned;
public bool isHumanControlled;
public Action<int> updateHealth;
public Action<Player> startTurnEffects;
public void TakeDamage(int incomingDamage)
{
var modifiedDamage = (int) (incomingDamage * damageReduction);
// Not sure if blood counter should negate damage or not...
if (isBloodCounter)
{
damageModification += (modifiedDamage * 0.15F);
}
health -= modifiedDamage;
updateHealth(health);
}
}