Ejemplo n.º 1
0
    public virtual float GetHitByMagic(Spell taken_spell)
    {
        float modifier = 1.0f;

        ApplyStatusOnHit(taken_spell);
        // Colour modifier
        if (ColourManager.getWeakness(taken_spell.SpellColour) == MainColour)
        {
            //The spell is weak against our colour
            modifier = ColourManager.WeaknessModifier;
        }
        //status modifier (ensnare)
        // Entity will be unable to move unless the ensare is destroyed by magic
        // The ensare hp is its power
        if (TickedStatus[(int)StatusType.Ensnare].Count > 0)
        {
            TickedStatus[(int)StatusType.Ensnare][0].Power -= taken_spell.Power;
            if (TickedStatus[(int)StatusType.Ensnare][0].Power < 0)
            {
                TickedStatus[(int)StatusType.Ensnare].RemoveAt(0);
            }
        }

        float dmg = taken_spell.Power * modifier;

        return(dmg);
    }
    public void GetHitByMagic(Spell taken_spell)
    {
        float modifier = 1.0f;

        if (Interaction == TileInteraction.Damage)
        {
            if (ColourManager.getWeakness(taken_spell.SpellColour) == MainColour)
            {
                //The spell is weak against our colour
                modifier = ColourManager.WeaknessModifier;
            }

            float dmg = taken_spell.Power * modifier;
            hp -= dmg;
            if (!IsDead())
            {
                ShowText("HP remaining: " + hp, ColourManager.toColor(MainColour), 0);
            }
        }
    }