Пример #1
0
        /// <summary>
        /// Updates the value of the statusEffect and then updates the display
        /// </summary>
        public void UpdateValue()
        {
            if (name == StatusEffectConstant.BURN)
            {
                value = preValue;

                if (afflicted.GetStatusEffect(StatusEffectConstant.BOSS) != -1)
                {
                    value = (int)(value * 0.5f);
                }
                if (afflicted.GetStatusEffect(StatusEffectConstant.ROOT) != -1)
                {
                    value *= 2;
                }
                value -= afflicted.MDEF;
            }
            if (name == StatusEffectConstant.FROSTBITE)
            {
                value = preValue;

                if (afflicted.GetStatusEffect(StatusEffectConstant.BOSS) != -1)
                {
                    value = (int)(value * 0.5f);
                }
                if (afflicted.GetStatusEffect(StatusEffectConstant.FREEZE) != -1)
                {
                    value *= 2;
                }
                value -= afflicted.MDEF;
            }
            else if (name == StatusEffectConstant.POISON)   // right now poison damage only needs to update for partyMembers
            {
                PartyMember pm = afflicted as PartyMember;
                if (pm != null)
                {
                    if (pm.className == ClassConstants.ARCHER && pm.skills[(int)SkillConstants.ArcherSkills.SURVIVALIST].skillEnabled == true)
                    {
                        value = 0;
                    }
                    else    // skill reducing poison damage was toggled off
                    {
                        value = preValue;
                    }
                }
            }
            else if (name == StatusEffectConstant.BLEED)
            {
                PartyMember pm = afflicted as PartyMember;
                if (pm != null && pm.className == ClassConstants.ARCHER && pm.skills[(int)SkillConstants.ArcherSkills.SURVIVALIST].skillEnabled == true)
                {
                    value = 0;
                }
                else if (afflicted.GetStatusEffect(StatusEffectConstant.BOSS) != -1)    // if not a partyMember, bleed damage can also be halved from being a boss
                {
                    value = (int)(preValue * 0.5f) - afflicted.PDEF;
                }
                else
                {
                    value = preValue - afflicted.PDEF;
                }
            }

            if (value < 0)
            {
                value = 0;
            }

            sed.UpdateValue();
        }
Пример #2
0
        /// <summary>
        /// Sets the value for a status effect (e.g. damage, defense buff amount)
        /// </summary>
        /// <param name="afflicter"> Character that caused the status effect </param>
        /// <param name="afflicted"> Character being affected by the status effect </param>
        public void SetValue(Character afflicter, Character afflicted)
        {
            this.afflicted = afflicted;

            if (name == StatusEffectConstant.BURN)
            {
                if (afflicter.burnPlus == true)
                {
                    plus     = true;
                    preValue = (int)(afflicter.MATK * 0.5f);
                }
                else
                {
                    preValue = (int)(afflicter.MATK * 0.3f);
                }
                value = preValue;

                if (afflicted.GetStatusEffect(StatusEffectConstant.BOSS) != -1)
                {
                    value = (int)(value * 0.5f);
                }
                if (afflicted.GetStatusEffect(StatusEffectConstant.ROOT) != -1)
                {
                    value *= 2;
                }
                value -= afflicted.MDEF;
            }
            if (name == StatusEffectConstant.FROSTBITE)
            {
                preValue = (int)(afflicter.PATK * 0.3f);
                value    = preValue;

                if (afflicted.GetStatusEffect(StatusEffectConstant.BOSS) != -1)
                {
                    value = (int)(value * 0.5f);
                }
                if (afflicted.GetStatusEffect(StatusEffectConstant.FREEZE) != -1)
                {
                    value *= 2;
                }
                value -= afflicted.MDEF;
            }
            else if (name == StatusEffectConstant.POISON)
            {
                if (afflicter != null && afflicter.poisonPlus == true)
                {
                    plus     = true;
                    preValue = (int)(afflicted.HP * 0.15f);
                }
                else
                {
                    preValue = (int)(afflicted.HP * 0.1f);
                }

                PartyMember pm = afflicted as PartyMember;
                if (pm != null && pm.className == ClassConstants.ARCHER && pm.skills[(int)SkillConstants.ArcherSkills.SURVIVALIST].skillEnabled == true)
                {
                    value = 0;
                }
                else
                {
                    if (afflicted.GetStatusEffect(StatusEffectConstant.BOSS) != -1)
                    {
                        value = (int)(preValue * 0.5f);
                    }
                    else
                    {
                        value = preValue;
                    }
                }
            }
            else if (name == StatusEffectConstant.TAUNT || name == StatusEffectConstant.MARIONETTE)
            {
                this.afflicter = afflicter;
            }
            else if (name == StatusEffectConstant.BLEED)
            {
                this.afflicter = afflicter;
                if (afflicter.bleedPlus == true)
                {
                    plus     = true;
                    preValue = (int)(afflicter.PATK * 0.6f);
                }
                else
                {
                    preValue = (int)(afflicter.PATK * 0.4f);
                }

                PartyMember pm = afflicted as PartyMember;
                if (pm != null && pm.className == ClassConstants.ARCHER && pm.skills[(int)SkillConstants.ArcherSkills.SURVIVALIST].skillEnabled == true)
                {
                    value = 0;
                }
                else
                {
                    if (afflicted.GetStatusEffect(StatusEffectConstant.BOSS) != -1)
                    {
                        value = (int)(preValue * 0.5f) - afflicted.PDEF;
                    }
                    else
                    {
                        value = preValue - afflicted.PDEF;
                    }
                }
            }
            else if (name == StatusEffectConstant.REGENERATE)
            {
                preValue = (int)(Mathf.Ceil((float)afflicted.HP * 0.05f));
                value    = preValue;
            }
            else if (name == StatusEffectConstant.CHAMPIONHP)
            {
                preValue = (int)(Mathf.Ceil((float)(afflicted.HP * 1.66) * 0.05f)); // the bonus hp is not calculated in initially for champion HP
                value    = preValue;
            }
            else if (name == StatusEffectConstant.FATALWOUND)
            {
                preValue = (int)(afflicted.HP * 0.33f);
                value    = preValue;
            }

            if (value < 0)
            {
                value = 0;
            }
        }