Exemplo n.º 1
0
 public int Shield(int _value, HEALSOURCE _source)
 {
     absorb[absAmount++] = new Absorb(_value, _source);
     totalAbsorb        += _value;
     soldier.frame.GetComponent <scrUnitPanel>().RefreshHealthInfo();
     return(_value);
 }
Exemplo n.º 2
0
    private Healing ApplyHealingModifiersByBuff(HEALSOURCE source, Healing baseHeal, Caster _caster)
    {
        Healing newHealing = baseHeal;

        if (source == HEALSOURCE.WOK_LIGHT)
        {
            Buff _myb = soldier.effectSystem.FindBuff(BUFF.FAITH);
            if ((_myb != null))
            {
                SpellInfo spellInfo = GameCore.Core.spellRepository.Get(SPELL.WORD_OF_KINGS_FAITH);
                int       _dur      = spellInfo.ticksCount * spellInfo.HoTgap;
                int       _gap      = spellInfo.HoTgap;
                GameCore.Core.paladinSparkHandler.AddSparks(1);
                soldier.effectSystem.BuffMe(BUFF.WORD_OF_KINGS_FAITH, _dur, _caster, spellInfo, _gap);
            }

            CasterBuff _casterBuff = GameCore.Core.buffSystem.FindBuff(CASTERBUFF.DIVINE_INTERVENTION);
            if (baseHeal.isCrit)
            {
                if (_casterBuff != null)
                {
                    baseHeal.value = (int)((float)baseHeal.value * (1f + (float)_caster.GetFocus() / 100f));
                }
            }
        }



        return(newHealing);
    }
Exemplo n.º 3
0
 private void WoKLoyaltyBeaconHealing(Healing myHeal, HEALSOURCE source, HEALTYPE healtype)
 {
     if ((GameCore.chosenChampion == CHAMPION.PALADIN) && (source != HEALSOURCE.WOK_LOYALTY) && (source != HEALSOURCE.GUIDANCE_OF_RAELA))
     {
         float perc = VALUES.WORD_OF_KINGS_LOYALTY_TRANSFER + core.myCaster.myAura[(int)AURA.SPIRIT_BOND].stacks * VALUES.SPIRIT_BOND_INCREASE;
         if ((core.myCaster.AuraActive(AURA.SPIRIT_BOND)) && ((healtype == HEALTYPE.DIRECT_MULTI) || (healtype == HEALTYPE.PERIODIC_MULTI)))
         {
             perc *= 0.3f;
         }
         core.BeaconHeal((int)(myHeal.value * perc), 4, soldier);
     }
 }
Exemplo n.º 4
0
 public Healing Heal(Caster _caster, SpellInfo info, HEALSOURCE source, HEALTYPE healtype, int whichValue = 0)
 {
     try
     {
         return(ApplyHeal(_caster, info.baseValue + (int)(info.coeff * _caster.GetPower()), _caster.GetCritChance(), source, healtype));
     }
     catch
     {
         Debug.Log("Source: " + source);
         return(null);
     }
 }
Exemplo n.º 5
0
    private Healing ApplyHealingModifiersByBuff(HEALSOURCE source, Healing baseHeal)
    {
        Healing newHealing = baseHeal;
        Buff    _myb       = effectSystem.FindBuff((int)Buff.DB.FLASH_OF_FUTURE);

        if ((_myb != null) && (source == HEALSOURCE.WOK_LIGHT))
        {
            newHealing.value = (int)(newHealing.value * 1.5f);
            _myb.Remove();
            return(newHealing);
        }

        return(newHealing);
    }
Exemplo n.º 6
0
 private int ApplyOverhealingModifiers(int overheal_value, Caster _caster, HEALSOURCE source)
 {
     if (core.buffSystem.FindBuff(CASTERBUFF.DIVINE_INTERVENTION) != null)
     {
         if (_caster.AuraActive(AURA.GUIDANCE_OF_RAELA))
         {
             if ((source != HEALSOURCE.GUIDANCE_OF_RAELA) && (source != HEALSOURCE.WOK_LOYALTY))
             {
                 core.CastAutoSpell((int)SPELL.GUIDANCE_OF_RAELA, null, overheal_value, overheal_value);
                 return(0);
             }
         }
     }
     return(overheal_value);
 }
Exemplo n.º 7
0
    public void AddEntry(HEALSOURCE _name, int _value, int _overheal)
    {
        int _ent = FindEntry(GetNameBySource(_name));

        if (_ent == -1)
        {
            entry[amount] = new Entry(GetNameBySource(_name), _value, _overheal);
            amount++;
        }
        else
        {
            entry[_ent].healing     += _value;
            entry[_ent].overhealing += _overheal;
        }
        totalhealing += _value;
        SortEntries();
    }
Exemplo n.º 8
0
    private Healing ApplyHeal(Caster _caster, int val, float crit, HEALSOURCE source, HEALTYPE healtype)
    {
        if (!soldier.isDead)
        {
            Healing myHeal = new Healing(0, false, healtype);

            myHeal = CalculateHealing(val, crit, healtype);

            myHeal.value = (int)(myHeal.value * _caster.HealingMultiplier());
            myHeal.value = (int)(myHeal.value * soldier.healingTakenBoost);

            myHeal = ApplyHealingModifiersBySource(myHeal, _caster, source);

            WoKLoyaltyBeaconHealing(myHeal, source, healtype);

            myHeal = ApplyHealingModifiersByBuff(source, myHeal, _caster);

            float heal_value = Mathf.Min(myHeal.value, soldier.maxHealth - soldier.health);
            heal_value *= Random.Range(95f, 105f) / 100f;
            int overheal_value = 0;
            overheal_value = Mathf.Max(0, (int)((myHeal.value + soldier.health) - soldier.maxHealth));

            overheal_value     = ApplyOverhealingModifiers(overheal_value, _caster, source);
            myHeal.overhealing = overheal_value;

            soldier.health = soldier.health + heal_value;
            core.recount.AddEntry(source, (int)heal_value, overheal_value);

            ExecuteDebuffsTriggeredByHealing(myHeal);

            CriticalHealTrigger(myHeal);

            UpdateHealthBar();

            LogHealing((int)heal_value, myHeal.isCrit);
            return(myHeal);
        }
        return(null);
    }
Exemplo n.º 9
0
    private string GetNameBySource(HEALSOURCE source)
    {
        switch (source)
        {
        case HEALSOURCE.DIVNITY_SHIELD: return("Divinity - Shield");

        case HEALSOURCE.FADING_LIGHT: return("Fading Light");

        case HEALSOURCE.SHADOWMEND: return("Shadowmend");

        case HEALSOURCE.TWILIGHT_BEAM: return("Twilight Beam");

        case HEALSOURCE.WOK_FAITH: return("Word of Kings: Faith");

        case HEALSOURCE.WOK_LOYALTY: return("Word of Kings: Loyalty");

        case HEALSOURCE.WOK_COURAGE: return("Word of Kings: Courage");

        case HEALSOURCE.WOK_LIGHT: return("Word of Kings: Light");

        case HEALSOURCE.SOOTHING_VOID: return("Soothing Void");

        case HEALSOURCE.EMPATHY: return("Empathy");

        case HEALSOURCE.DREAM: return("Dream");

        case HEALSOURCE.MOONLIGHT: return("Moonlight");

        case HEALSOURCE.SHADOWSURGE: return("Shadowsurge");

        case HEALSOURCE.ROYALTY: return("Royalty");

        case HEALSOURCE.GUIDANCE_OF_RAELA: return("Guidance of Raela");

        case HEALSOURCE.SCROLL_OF_ALAPHI: return("Scroll of Renew");

        default: return("_MISSING_");
        }
    }
Exemplo n.º 10
0
 public Healing Heal(Caster _caster, int val, float crit, HEALSOURCE source, HEALTYPE healtype)
 {
     return(healingHandler.Heal(_caster, val, crit, source, healtype));
 }
Exemplo n.º 11
0
 public Healing Heal(Caster _caster, SpellInfo info, HEALSOURCE source, HEALTYPE healtype, int whichValue = 0)
 {
     return(healingHandler.Heal(_caster, info, source, healtype, whichValue));
 }
Exemplo n.º 12
0
 public Absorb(float _val, HEALSOURCE _source)
 {
     value  = _val;
     source = _source;
 }
Exemplo n.º 13
0
    private Healing ApplyHealingModifiersBySource(Healing baseHealing, Caster caster, HEALSOURCE source)
    {
        Healing newHealing = baseHealing;

        return(newHealing);
    }
Exemplo n.º 14
0
 private int ApplyOverhealingModifiers(int overheal_value, Caster _caster, HEALSOURCE source)
 {
     return(overheal_value);
 }
Exemplo n.º 15
0
    public Healing Heal(int minh, int maxh, float critchance, Caster _caster, SpellInfo info, HEALSOURCE source, HEALTYPE healtype)
    {
        if (!isDead)
        {
            Healing myHeal = new Healing(0, false, healtype);

            myHeal       = CalculateHealing(minh, maxh, critchance, healtype);
            myHeal.value = (int)(myHeal.value * _caster.HealingMultiplier());
            myHeal.value = (int)(myHeal.value * healingTakenBoost);

            myHeal = ApplyHealingModifiersBySource(myHeal, _caster, source);

            LogHealing((int)myHeal.value, myHeal.isCrit);

            WoKLoyaltyBeaconHealing(myHeal, source, healtype);

            myHeal = ApplyHealingModifiersByBuff(source, myHeal);

            float heal_value     = Mathf.Min(myHeal.value, maxHealth - health);
            int   overheal_value = 0;
            overheal_value = Mathf.Max(0, (int)((myHeal.value + health) - maxHealth));

            overheal_value     = ApplyOverhealingModifiers(overheal_value, _caster, source);
            myHeal.overhealing = overheal_value;

            health = health + heal_value;
            core.recount.AddEntry(source, (int)heal_value, overheal_value);

            ExecuteDebuffsTriggeredByHealing(myHeal);

            CriticalHealTrigger(myHeal);

            UpdateHealthBar();
            return(myHeal);
        }
        return(null);
    }
Exemplo n.º 16
0
    private Healing ApplyHealingModifiersBySource(Healing baseHealing, Caster caster, HEALSOURCE source)
    {
        Healing newHealing = baseHealing;

        if (source == HEALSOURCE.SCROLL_OF_RENEW)
        {
            newHealing.value = (int)(maxHealth * 0.5f);
            return(newHealing);
        }

        if (source == HEALSOURCE.SHADOWSONG)
        {
            if (caster.myTalentTree.GetTalentByName("Shadowmend").Points > 0)
            {
                Buff myb = effectSystem.FindBuff((int)Buff.DB.SOOTHING_VOID);
                if (myb != null)
                {
                    newHealing.value = (int)(newHealing.value + newHealing.value * caster.myTalentTree.GetTalentByName("Shadowmend").Points * 0.2f);
                    return(newHealing);
                }
            }
        }

        return(newHealing);
    }