Esempio n. 1
0
        public override int CalcValue(GameLiving living, eProperty property)
        {
            int propertyIndex = (int)property;

            // Base stats/abilities/debuffs/death.

            int baseStat = living.GetBaseStat((eStat)property);
            int abilityBonus = living.AbilityBonus[propertyIndex];
            int debuff = living.DebuffCategory[propertyIndex];
			int deathConDebuff = 0;

            int itemBonus = CalcValueFromItems(living, property);
            int buffBonus = CalcValueFromBuffs(living, property);

			// Special cases:
			// 1) ManaStat (base stat + acuity, players only).
			// 2) As of patch 1.64: - Acuity - This bonus will increase your casting stat, 
			//    whatever your casting stat happens to be. If you're a druid, you should get an increase to empathy, 
			//    while a bard should get an increase to charisma.  http://support.darkageofcamelot.com/kb/article.php?id=540
			// 3) Constitution lost at death, only affects players.

			if (living is GamePlayer)
			{
				GamePlayer player = living as GamePlayer;
				if (property == (eProperty)(player.CharacterClass.ManaStat))
				{
					if (player.CharacterClass.ID != (int)eCharacterClass.Scout && player.CharacterClass.ID != (int)eCharacterClass.Hunter && player.CharacterClass.ID != (int)eCharacterClass.Ranger)
					{
						abilityBonus += player.AbilityBonus[(int)eProperty.Acuity];
					}
				}

				deathConDebuff = player.TotalConstitutionLostAtDeath;
			}

			// Apply debuffs, 100% effectiveness for player buffs, 50% effectiveness
			// for item and base stats

			int unbuffedBonus = baseStat + itemBonus;
			buffBonus -= Math.Abs(debuff);

			if (buffBonus < 0)
			{
				unbuffedBonus += buffBonus / 2;
				buffBonus = 0;
				if (unbuffedBonus < 0)
					unbuffedBonus = 0;
			}

			// Add up and apply any multiplicators.

			int stat = unbuffedBonus + buffBonus + abilityBonus;
			stat = (int)(stat * living.BuffBonusMultCategory1.Get((int)property));

			// Possibly apply constitution loss at death.

			stat -= (property == eProperty.Constitution)? deathConDebuff : 0;

			return Math.Max(1, stat);
        }
Esempio n. 2
0
        public override int CalcValue(GameLiving living, eProperty property)
        {
            int propertyIndex = (int)property;

            // Base stats/abilities/debuffs/death.

            int baseStat       = living.GetBaseStat((eStat)property);
            int abilityBonus   = living.AbilityBonus[propertyIndex];
            int debuff         = living.DebuffCategory[propertyIndex];
            int deathConDebuff = 0;

            int itemBonus = CalcValueFromItems(living, property);
            int buffBonus = CalcValueFromBuffs(living, property);

            // Special cases:
            // 1) ManaStat (base stat + acuity, players only).
            // 2) As of patch 1.64: - Acuity - This bonus will increase your casting stat,
            //    whatever your casting stat happens to be. If you're a druid, you should get an increase to empathy,
            //    while a bard should get an increase to charisma.  http://support.darkageofcamelot.com/kb/article.php?id=540
            // 3) Constitution lost at death, only affects players.

            if (living is GamePlayer)
            {
                GamePlayer player = living as GamePlayer;
                if (property == (eProperty)(player.CharacterClass.ManaStat))
                {
                    if (player.CharacterClass.ID != (int)eCharacterClass.Scout && player.CharacterClass.ID != (int)eCharacterClass.Hunter && player.CharacterClass.ID != (int)eCharacterClass.Ranger)
                    {
                        abilityBonus += player.AbilityBonus[(int)eProperty.Acuity];
                    }
                }

                deathConDebuff = player.TotalConstitutionLostAtDeath;
            }

            // Apply debuffs, 100% effectiveness for player buffs, 50% effectiveness
            // for item and base stats

            int unbuffedBonus = baseStat + itemBonus;

            buffBonus -= Math.Abs(debuff);

            if (living is GamePlayer && buffBonus < 0)
            {
                unbuffedBonus += buffBonus / 2;
                buffBonus      = 0;
            }

            // Add up and apply any multiplicators.

            int stat = unbuffedBonus + buffBonus + abilityBonus;

            stat = (int)(stat * living.BuffBonusMultCategory1.Get((int)property));

            // Possibly apply constitution loss at death.

            stat -= (property == eProperty.Constitution)? deathConDebuff : 0;

            return(Math.Max(1, stat));
        }