本文整理汇总了C#中eProperty类的典型用法代码示例。如果您正苦于以下问题:C# eProperty类的具体用法?C# eProperty怎么用?C# eProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
eProperty类属于命名空间,在下文中一共展示了eProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
int percent = 100
+living.BaseBuffBonusCategory[(int)property];
return percent;
}
示例2: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
if (living is GamePlayer)
{
GamePlayer player = living as GamePlayer;
if (player.CharacterClass.ManaStat == eStat.UNDEFINED)
return 1000000;
int concBase = (int)((player.Level * 4) * 2.2);
int stat = player.GetModified((eProperty)player.CharacterClass.ManaStat);
int factor = (stat > 50) ? (stat - 50) / 2 : (stat - 50);
int conc = (concBase + concBase * factor / 100) / 2;
conc = (int)(player.Effectiveness * (double)conc);
if (conc < 0)
{
if (log.IsWarnEnabled)
log.WarnFormat(living.Name+": concentration is less than zerro (conc:{0} eff:{1:R} concBase:{2} stat:{3} factor:{4})", conc, player.Effectiveness, concBase, stat, factor);
conc = 0;
}
if (player.GetSpellLine("Perfecter") != null
&& player.MLLevel >= 4)
conc += (20 * conc / 100);
return conc;
}
else
{
return 1000000; // default
}
}
示例3: 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);
}
示例4: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
// DOLConsole.WriteSystem("calc skill prop "+property+":");
if (living is GamePlayer)
{
GamePlayer player = (GamePlayer)living;
int itemCap = player.Level/5+1;
int itemBonus = player.ItemBonus[(int)property];
if (SkillBase.CheckPropertyType(property, ePropertyType.SkillMeleeWeapon))
itemBonus += player.ItemBonus[(int)eProperty.AllMeleeWeaponSkills];
if (SkillBase.CheckPropertyType(property, ePropertyType.SkillMagical))
itemBonus += player.ItemBonus[(int)eProperty.AllMagicSkills];
if (SkillBase.CheckPropertyType(property, ePropertyType.SkillDualWield))
itemBonus += player.ItemBonus[(int)eProperty.AllDualWieldingSkills];
if (SkillBase.CheckPropertyType(property, ePropertyType.SkillArchery))
itemBonus += player.ItemBonus[(int)eProperty.AllArcherySkills];
itemBonus += player.ItemBonus[(int)eProperty.AllSkills];
if (itemBonus > itemCap)
itemBonus = itemCap;
int buffs = player.BaseBuffBonusCategory[(int)property]; // one buff category just in case..
// DOLConsole.WriteLine("item bonus="+itemBonus+"; buffs="+buffs+"; realm="+player.RealmLevel/10);
return itemBonus + buffs + player.RealmLevel/10;
}
else
{
// TODO other living types
}
return 0;
}
示例5: CalcValue
/// <summary>
/// Calculate the actual resist amount for the given living and the given
/// resist type, applying all possible caps and cap increases.
/// </summary>
/// <param name="living">The living the resist amount is to be determined for.</param>
/// <param name="property">The resist type.</param>
/// <returns>The actual resist amount.</returns>
public override int CalcValue(GameLiving living, eProperty property)
{
int propertyIndex = (int)property;
// Abilities/racials/debuffs.
int debuff = living.DebuffCategory[propertyIndex];
int abilityBonus = living.AbilityBonus[propertyIndex];
int racialBonus = SkillBase.GetRaceResist( living.Race, (eResist)property );
// Items and buffs.
int itemBonus = CalcValueFromItems(living, property);
int buffBonus = CalcValueFromBuffs(living, property);
// Apply debuffs. 100% Effectiveness for player buffs, but only 50%
// effectiveness for item bonuses.
buffBonus -= Math.Abs(debuff);
if (buffBonus < 0)
{
itemBonus += buffBonus / 2;
buffBonus = 0;
if (itemBonus < 0)
itemBonus = 0;
}
// Add up and apply hardcap.
return Math.Min(itemBonus + buffBonus + abilityBonus + racialBonus, HardCap);
}
示例6: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
/* PATCH 1.87 COMBAT AND REGENERATION
- While in combat, health and power regeneration ticks will happen twice as often.
- Each tick of health and power is now twice as effective.
- All health and power regeneration aids are now twice as effective.
*/
double regen = 5 + (living.Level / 2.75);
if (living is GameNPC && living.InCombat)
regen /= 2.0;
// tolakram - there is no difference per tic between combat and non combat
if (regen != 0 && ServerProperties.Properties.MANA_REGEN_RATE != 1)
regen *= ServerProperties.Properties.MANA_REGEN_RATE;
double decimals = regen - (int)regen;
if (Util.ChanceDouble(decimals))
{
regen += 1; // compensate int rounding error
}
int debuff = living.SpecBuffBonusCategory[(int)property];
if (debuff < 0)
debuff = -debuff;
regen += living.BaseBuffBonusCategory[(int)property] + living.AbilityBonus[(int)property] + living.ItemBonus[(int)property] - debuff;
if (regen < 1)
regen = 1;
return (int)regen;
}
示例7: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
return Math.Max(1, 100
- living.BaseBuffBonusCategory[(int)property] // less is faster = buff
+ living.DebuffCategory[(int)property] // more is slower = debuff
- Math.Min(10, living.ItemBonus[(int)property])); // ?
}
示例8: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
if (living is GamePlayer)
{
return living.ItemBonus[(int)property];
}
return 0;
}
示例9: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
return (int)(
+living.BaseBuffBonusCategory[(int)property]
+ living.SpecBuffBonusCategory[(int)property]
- living.DebuffCategory[(int)property]
+ living.BuffBonusCategory4[(int)property]);
}
示例10: PropertyCalculatorAttribute
/// <summary>
/// Constructs a new calculator attribute for range of properties
/// </summary>
/// <param name="min">The lowest property in range</param>
/// <param name="max">The highest property in range</param>
public PropertyCalculatorAttribute(eProperty min, eProperty max)
{
if (min > max)
throw new ArgumentException("min property is higher than max (min=" + (int)min + " max=" + (int)max + ")");
if (min < 0 || max > eProperty.MaxProperty)
throw new ArgumentOutOfRangeException("max", (int)max, "property must be in 0 .. eProperty.MaxProperty range");
m_min = min;
m_max = max;
}
示例11: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
// Hardcap 10%
int percent = Math.Min(10, living.BaseBuffBonusCategory[(int)property]
-living.DebuffCategory[(int)property]
+living.ItemBonus[(int)property]);
return percent;
}
示例12: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
GamePlayer player = living as GamePlayer;
if(player == null)
{
return 0;
}
return Math.Min(living.ItemBonus[(int) property], 25);
}
示例13: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
double percent = 100
+ living.BaseBuffBonusCategory[(int)property] // enchance the weaponskill
+ living.SpecBuffBonusCategory[(int)property] // enchance the weaponskill
//hotfix for poisons where both debuff components have same value
- (int)(living.DebuffCategory[(int)property] / 5.4) // reduce
+ living.ItemBonus[(int)property];
return (int)Math.Max(1, percent);
}
示例14: CalcValue
public override int CalcValue(GameLiving living, eProperty property)
{
return (int)(
+living.BaseBuffBonusCategory[(int)property]
+ living.SpecBuffBonusCategory[(int)property]
- living.DebuffCategory[(int)property]
+ living.BuffBonusCategory4[(int)property]
+ living.AbilityBonus[(int)property]
+ Math.Min(10, living.ItemBonus[(int)property]));
}
示例15: CalcValue
/// <summary>
/// calculates the final property value
/// </summary>
/// <param name="living"></param>
/// <param name="property"></param>
/// <returns></returns>
public override int CalcValue(GameLiving living, eProperty property)
{
if (living.IsDiseased)
return 0; // no HP regen if diseased
if (living is GameKeepDoor)
return (int)(living.MaxHealth * 0.05); //5% each time for keep door
double regen = 1;
/* PATCH 1.87 COMBAT AND REGENERATION
- While in combat, health and power regeneration ticks will happen twice as often.
- Each tick of health and power is now twice as effective.
- All health and power regeneration aids are now twice as effective.
*/
if (living.Level < 26)
{
regen = 10 + (living.Level * 0.2);
}
else
{
regen = living.Level * 0.6;
}
// assumes NPC regen is now half as effective as GamePlayer (as noted above) - tolakram
// http://www.dolserver.net/viewtopic.php?f=16&t=13197
if (living is GameNPC)
{
if (living.InCombat)
regen /= 2.0;
}
if (regen != 0 && ServerProperties.Properties.HEALTH_REGEN_RATE != 1)
regen *= ServerProperties.Properties.HEALTH_REGEN_RATE;
double decimals = regen - (int)regen;
if (Util.ChanceDouble(decimals))
{
regen += 1; // compensate int rounding error
}
regen += living.ItemBonus[(int)property];
int debuff = living.SpecBuffBonusCategory[(int)property];
if (debuff < 0)
debuff = -debuff;
regen += living.BaseBuffBonusCategory[(int)property] - debuff;
if (regen < 1)
regen = 1;
return (int)regen;
}