Ejemplo n.º 1
0
    /// Francium absorbs health from damage
    public override bool OnAttackedAbility(CellSlot mySlot, CellSlot targetSlot)
    {
        base.OnAttackedAbility(mySlot, targetSlot);

        bool bAttackThrough = true;

        CombatantCell targetCell = targetSlot.GetComponentInChildren <CombatantCell>();

        if (targetCell != null)
        {
            int targetCellDamage = targetCell.GetDamage();

            CombatantCell myCell = mySlot.GetCell();
            if (myCell != null)
            {
                if (!battleUI)
                {
                    battleUI = FindObjectOfType <BattleUI>();
                }
                battleUI.ToastInteraction(myCell.transform.position, targetCellDamage, 3, "hp +");

                myCell.ModifyHealth(targetCellDamage);

                bAttackThrough = false;
            }
        }

        return(bAttackThrough);
    }
Ejemplo n.º 2
0
    /// Caesium returns attacks back to the opponent
    public override bool OnAttackedAbility(CellSlot mySlot, CellSlot targetSlot)
    {
        base.OnAttackedAbility(mySlot, targetSlot);

        bool bAttackThrough = true;

        CombatantCell targetCell = targetSlot.GetComponentInChildren <CombatantCell>();

        if (targetCell != null)
        {
            int targetCellDamage = targetCell.GetDamage();

            CombatantCell myCell = mySlot.GetCell();
            if (myCell != null)
            {
                if (!battleUI)
                {
                    battleUI = FindObjectOfType <BattleUI>();
                }
                battleUI.ToastInteraction(myCell.transform.position, targetCellDamage, 2, "reflect ");
                bAttackThrough = false;
                myCell.SetDamage(targetCellDamage);
                myCell.GetComponent <CellArsenal>().StartHitAfterDelay(mySlot.transform, targetSlot.transform, myCell.GetDamage());
                myCell.SetDamage(0);
            }
        }

        return(bAttackThrough);
    }