Exemple #1
0
    private ActionResult ModifyHealth(int amount)
    {
        var actionResult = new ActionResult();

        hp += amount;

        if (hp > maxHp)
        {
            hp = maxHp;
        }

        if (hp <= 0)
        {
            actionResult.AppendEntityEvent("dead", owner);
        }

        return(actionResult);
    }