本文整理汇总了C#中GameLiving.GetBaseStat方法的典型用法代码示例。如果您正苦于以下问题:C# GameLiving.GetBaseStat方法的具体用法?C# GameLiving.GetBaseStat怎么用?C# GameLiving.GetBaseStat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameLiving
的用法示例。
在下文中一共展示了GameLiving.GetBaseStat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalcValue
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);
}