Exemple #1
0
    public MinionPreHealEvent OnMinionPreHeal(Minion minion, int healAmount)
    {
        MinionPreHealEvent minionPreHealEvent = new MinionPreHealEvent()
        {
            Minion     = minion,
            HealAmount = healAmount
        };

        MinionPreHealHandler.OnNext(minionPreHealEvent);

        foreach (Minion battlefieldMinion in GameManager.Instance.GetAllMinions())
        {
            battlefieldMinion.Buffs.OnMinionPreHeal.OnNext(minionPreHealEvent);
        }

        return(minionPreHealEvent);
    }
Exemple #2
0
    public override void Heal(int healAmount)
    {
        // Firing OnMinionPreHeal events
        MinionPreHealEvent minionPreHealEvent = EventManager.Instance.OnMinionPreHeal(this, healAmount);

        // TODO : Check if heal is transformed to damage and if so, call Damage instead

        Debugger.LogMinion(this, "healing for " + minionPreHealEvent.HealAmount);

        // Healing the minion
        CurrentHealth = Mathf.Min(CurrentHealth + minionPreHealEvent.HealAmount, MaxHealth);

        // Firing OnMinionHealed events
        EventManager.Instance.OnMinionHealed(this, minionPreHealEvent.HealAmount);

        // TODO : Heal animation
        // TODO : Show heal sprite + healed amount

        Controller.UpdateNumbers();
    }