本文整理汇总了C#中Character.ActiveBuffsContains方法的典型用法代码示例。如果您正苦于以下问题:C# Character.ActiveBuffsContains方法的具体用法?C# Character.ActiveBuffsContains怎么用?C# Character.ActiveBuffsContains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character.ActiveBuffsContains方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCharacterStats
/// <summary>
/// Gets the total Stats of the Character
/// </summary>
/// <param name="character">The Character to get the total Stats of</param>
/// <param name="additionalItem">An additional item to grant the Character the stats of (as if it were worn)</param>
/// <returns>The total stats for the Character</returns>
public override Stats GetCharacterStats(Character character, Item additionalItem)
{
CalculationOptionsBear calcOpts = character.CalculationOptions as CalculationOptionsBear ?? new CalculationOptionsBear();
DruidTalents talents = character.DruidTalents;
bool hasCritBuff = false;
foreach (Buff buff in character.ActiveBuffs) {
if (buff.Group == "Critical Strike Chance") {
hasCritBuff = true;
break;
}
}
StatsBear statsTotal = new StatsBear()
{
BonusAttackPowerMultiplier = 0.25f,
BonusBleedDamageMultiplier = (character.ActiveBuffsContains("Mangle") || character.ActiveBuffsContains("Trauma") ? 0f : 0.3f),
Dodge = 0.02f * talents.FeralSwiftness + 0.03f * talents.NaturalReaction,
FurySwipesChance = 0.05f * talents.FurySwipes,
BonusEnrageDamageMultiplier = 0.05f * talents.KingOfTheJungle,
HasteOnFeralCharge = 0.15f * talents.Stampede,
BaseArmorMultiplier = 2.2f * (1f + 0.10f * talents.ThickHide / 3f) * (1f + 0.26f * talents.ThickHide) - 1f,
CritChanceReduction = 0.02f * talents.ThickHide,
PhysicalCrit = (hasCritBuff ? 0f : 0.05f * talents.LeaderOfThePack) + (talents.Pulverize > 0 ? 0.09f: 0f),
SpellCrit = (hasCritBuff ? 0f : 0.05f * talents.LeaderOfThePack),
BonusPulverizeDuration = 4f * talents.EndlessCarnage,
DamageTakenReductionMultiplier = 0.09f * talents.NaturalReaction,
BonusMaulDamageMultiplier = 0.04f * talents.RendAndTear,
BonusStaminaMultiplier = (1f + 0.02f * talents.HeartOfTheWild) * (Character.ValidateArmorSpecialization(character, ItemType.Leather) ? 1.05f : 1f) - 1f,
BonusPhysicalDamageMultiplier = 0.04f * talents.MasterShapeshifter,
BonusMangleDamageMultiplier = talents.GlyphOfMangle ? 0.1f : 0f,
BonusLacerateCritChance = talents.GlyphOfLacerate ? 0.05f : 0f,
BonusFaerieFireStacks = talents.FeralAggression,
BerserkDuration = (talents.GlyphOfBerserk ? 10f : 0f),
};
#region Set Bonuses
int PvPCount;
character.SetBonusCount.TryGetValue("Gladiator's Sanctuary", out PvPCount);
if (PvPCount >= 2)
{
statsTotal.Agility += 70f;
statsTotal.Resilience += 400f;
}
if (PvPCount >= 4)
{
// the 15% movement speed is only outdoors which most dungeons are not
statsTotal.Agility += 90f;
}
int T11Count;
character.SetBonusCount.TryGetValue("Stormrider's Battlegarb", out T11Count);
if (T11Count >= 2) {
//statsTotal.BonusDamageMultiplierRakeTick = (1f + statsTotal.BonusDamageMultiplierRakeTick) * (1f + 0.10f) - 1f;
statsTotal.BonusDamageMultiplierLacerate = (1f + statsTotal.BonusDamageMultiplierLacerate) * (1f + 0.10f) - 1f;
}
if (T11Count >= 4)
{
/*statsBuffs.AddSpecialEffect(new SpecialEffect(Trigger.MangleCatHit,
new Stats() { BonusAttackPowerMultiplier = 0.01f, },
30, 0, 1f, 3));*/
statsTotal.BonusSurvivalInstinctsDurationMultiplier = 0.5f;
}
int T12Count;
character.SetBonusCount.TryGetValue("Obsidian Arborweave Battlegarb", out T12Count);
if (T12Count >= 2)
{
statsTotal.BonusMangleDamageMultiplier = (1f + statsTotal.BonusMangleDamageMultiplier) * (1f + 0.10f) - 1f;
statsTotal.BonusMaulDamageMultiplier = (1f + statsTotal.BonusMaulDamageMultiplier) * (1f + 0.10f) - 1f;
}
if (T12Count >= 4)
{
statsTotal.AddSpecialEffect(SpecialEffect4T12);
}
int T13Count;
character.SetBonusCount.TryGetValue("Deep Earth Battlegarb", out T13Count);
if (T13Count >= 2)
{
statsTotal.Tier_13_2_piece = true;
}
if (T13Count >= 4)
{
statsTotal.Tier_13_4_piece = (10f + 25f)/2;
}
#endregion
// Leader of the Pack self-heal
statsTotal.AddSpecialEffect(LeaderOfThePackSpecialEffect);
// Survival Instincts
SpecialEffect SurvivalInstinctsSpecialEffect = new SpecialEffect(Trigger.Use, new Stats() { DamageTakenReductionMultiplier = 0.50f, }, 12f * (1f + statsTotal.BonusSurvivalInstinctsDurationMultiplier), 180f, 1f);
//.........这里部分代码省略.........
示例2: Minion
/// <summary>
/// Default constructor
/// </summary>
/// <param name="name">The minion's type name [imp, succy, felguard, etc]</param>
/// <param name="master">A reference to the minion owner's character sheet - required because there are talents / buffs that apply to the minion too.</param>
/// <param name="stats">A reference to the minion owner's cumulative stats - required because many stats are inherited by the minion.</param>
protected Minion( String name, Character master, Stats stats )
{
Name = name;
Master = master;
OwnerStats = stats;
HealthModifier = 1;
MaxHealthModifier = 1;
PowerModifier = 1;
InheritedCriticalStrikeChance = (master.WarlockTalents.ImprovedDemonicTactics * 0.10f);
#region minion buffs
//A minion will inherit nearly all the buffs applied to its master,
//so (to keep things simple), we copy all buffs on the master and remove the ones that dont apply
CalculationsWarlock calcs = new CalculationsWarlock();
Stats buffs = calcs.GetBuffsStats(master.ActiveBuffs);
//focus magic cannot be applied to minions
if (master.ActiveBuffsContains("Focus Magic"))
{
buffs -= Buff.GetBuffByName("Focus Magic").Stats;
}
//food and flask/elixir/potions consumed by the master do not apply to minions
foreach (Buff buff in master.ActiveBuffs)
{
if (buff.Group == "Elixirs and Flasks")
{
buffs -= buff.Stats;
//TODO: Remove any buff improvements
//foreach (Buff ImpBuff in buff.Improvements) buffs -= ImpBuff.Stats; ;
}
if (buff.Group == "Food") buffs -= buff.Stats;
}
//however, minions do eat food (e.g. Kibler's), so we'll assume that if the master has food, then the minion does too.
//TODO: minion food buffs
MinionStats = buffs;
#endregion
}
示例3: GetCharacterStats
//.........这里部分代码省略.........
AccumulateBuffsStats(statsTotal, character.ActiveBuffs);
statsTotal.Stamina = (float)Math.Floor(statsTotal.Stamina * (1f + statsTotal.BonusStaminaMultiplier));
statsTotal.Strength = (float)Math.Floor(statsTotal.Strength * (1f + statsTotal.BonusStrengthMultiplier));
statsTotal.Agility = (float)Math.Floor(statsTotal.Agility * (1f + statsTotal.BonusAgilityMultiplier));
statsTotal.AttackPower += statsTotal.Strength * 1f + (statsTotal.Agility * 2f - 20f); //-20 to account for the first 20 str and first 20 agi only giving 1ap each
statsTotal.AttackPower = (float)Math.Floor(statsTotal.AttackPower * (1f + statsTotal.BonusAttackPowerMultiplier));
statsTotal.Health += (float)Math.Floor((statsTotal.Stamina - 20f) * 14f + 20f);
statsTotal.Health = (float)Math.Floor(statsTotal.Health * (1f + statsTotal.BonusHealthMultiplier));
statsTotal.Armor = (float)Math.Floor(statsTotal.Armor * (1f + statsTotal.BonusArmorMultiplier));
statsTotal.NatureResistance += statsTotal.NatureResistanceBuff;
statsTotal.FireResistance += statsTotal.FireResistanceBuff;
statsTotal.FrostResistance += statsTotal.FrostResistanceBuff;
statsTotal.ShadowResistance += statsTotal.ShadowResistanceBuff;
statsTotal.ArcaneResistance += statsTotal.ArcaneResistanceBuff;
int targetLevel = bossOpts.Level;
float hasteBonus = StatConversion.GetPhysicalHasteFromRating(statsTotal.HasteRating, CharacterClass.Druid);
hasteBonus = (1f + hasteBonus) * (1f + statsTotal.PhysicalHaste) - 1f;
float meleeHitInterval = 1f / ((1f + hasteBonus) + 1f / (3.5f / hasteBonus));
float hitBonus = StatConversion.GetPhysicalHitFromRating(statsTotal.HitRating) + statsTotal.PhysicalHit;
float expertiseBonus = StatConversion.GetDodgeParryReducFromExpertise(StatConversion.GetExpertiseFromRating(statsTotal.ExpertiseRating, CharacterClass.Druid) + statsTotal.Expertise, CharacterClass.Druid);
float chanceDodge = Math.Max(0f, StatConversion.WHITE_DODGE_CHANCE_CAP[targetLevel - 85] - expertiseBonus);
float chanceParry = 0f;
float chanceMiss = Math.Max(0f, StatConversion.WHITE_MISS_CHANCE_CAP[targetLevel - 85] - hitBonus);
float chanceAvoided = chanceMiss + chanceDodge + chanceParry;
float rawChanceCrit = StatConversion.GetPhysicalCritFromRating(statsTotal.CritRating)
+ StatConversion.GetPhysicalCritFromAgility(statsTotal.Agility, CharacterClass.Druid)
+ statsTotal.PhysicalCrit
+ StatConversion.NPC_LEVEL_CRIT_MOD[targetLevel - 85];
float chanceCrit = rawChanceCrit * (1f - chanceAvoided);
float chanceHit = 1f - chanceAvoided;
bool usesMangle = (!character.ActiveBuffsContains("Mangle") && !character.ActiveBuffsContains("Trauma"));
Dictionary<Trigger, float> triggerIntervals = new Dictionary<Trigger, float>();
Dictionary<Trigger, float> triggerChances = new Dictionary<Trigger, float>();
triggerIntervals[Trigger.Use] = 0f;
triggerIntervals[Trigger.MeleeAttack] = meleeHitInterval;
triggerIntervals[Trigger.MeleeHit] = meleeHitInterval;
triggerIntervals[Trigger.PhysicalHit] = meleeHitInterval;
triggerIntervals[Trigger.PhysicalAttack] = meleeHitInterval;
triggerIntervals[Trigger.MeleeCrit] = meleeHitInterval;
triggerIntervals[Trigger.PhysicalCrit] = meleeHitInterval;
triggerIntervals[Trigger.DoTTick] = 1.5f;
triggerIntervals[Trigger.DamageDone] = meleeHitInterval / 2f;
triggerIntervals[Trigger.DamageOrHealingDone] = meleeHitInterval / 2f; // Need to Add Self-Heals
triggerIntervals[Trigger.RakeTick] = 3f;
if (usesMangle) {
triggerIntervals[Trigger.MangleCatHit] = 60f;
triggerIntervals[Trigger.MangleCatAttack] = 60f;
}
triggerIntervals[Trigger.MangleCatOrShredHit] = usesMangle ? 3.76f : 3.87f;
triggerIntervals[Trigger.MangleCatOrShredOrInfectedWoundsHit] = triggerIntervals[Trigger.MangleCatOrShredHit] / ((talents.InfectedWounds > 0) ? 2f : 1f);
triggerIntervals[Trigger.EnergyOrFocusDropsBelow20PercentOfMax] = 4f; // doing 80% chance every 4 seconds per Astry
triggerIntervals[Trigger.FinishingMove] = 9f; // Assume it takes 9 seconds between to perform a finishing move
triggerIntervals[Trigger.Berserk] = 180f;
triggerChances[Trigger.Use] = 1f;
triggerChances[Trigger.MeleeAttack] = 1f;
triggerChances[Trigger.MeleeHit] = Math.Max(0f, chanceHit);
triggerChances[Trigger.PhysicalHit] = Math.Max(0f, chanceHit);
triggerChances[Trigger.PhysicalAttack] = 1f;
triggerChances[Trigger.MeleeCrit] = Math.Max(0f, chanceCrit);
triggerChances[Trigger.PhysicalCrit] = Math.Max(0f, chanceCrit);
triggerChances[Trigger.DoTTick] = 1f;
triggerChances[Trigger.DamageDone] = 1f - chanceAvoided / 2f;
示例4: GetCharacterCalculations
public override CharacterCalculationsBase GetCharacterCalculations(Character character, Item additionalItem, bool referenceCalculation, bool significantChange, bool needsDisplayCalculations)
{
// First things first, we need to ensure that we aren't using bad data
CharacterCalculationsEnhance calc = new CharacterCalculationsEnhance();
if (character == null) { return calc; }
CalculationOptionsEnhance calcOpts = character.CalculationOptions as CalculationOptionsEnhance;
if (calcOpts == null) { return calc; }
BossOptions bossOpts = character.BossOptions;
if (bossOpts == null) { bossOpts = new BossOptions(); }
#region Applied Stats
Stats stats = GetCharacterStats(character, additionalItem);
//StatsEnhance stats = GetCharacterStats(character, additionalItem) as StatsEnhance;
calc.BasicStats = stats;
calc.BuffStats = GetBuffsStats(character.ActiveBuffs, character.SetBonusCount);
Item noBuffs = RemoveAddedBuffs(calc.BuffStats);
calc.EnhSimStats = GetCharacterStats(character, noBuffs);
calc.TargetLevel = bossOpts.Level;
calc.ActiveBuffs = new List<Buff>(character.ActiveBuffs);
float initialAP = stats.AttackPower;
// deal with Special Effects - for now add into stats regardless of effect later need to be more precise
StatsSpecialEffects se = new StatsSpecialEffects(character, stats, calcOpts, bossOpts);
stats.Accumulate(se.getSpecialEffects());
//Set up some talent variables
float concussionMultiplier = 1f + .02f * character.ShamanTalents.Concussion; //
float shieldBonus = 1f + .05f * character.ShamanTalents.ImprovedShields; //
float callofFlameBonus = 1f + .1f * character.ShamanTalents.CallOfFlame; //
float mentalQuickness = .5f; //AP -> SP conversion
float windfuryWeaponBonus = 4430f; //WFAP (Check)
float windfuryDamageBonus = 1f; //
switch (character.ShamanTalents.ElementalWeapons)
{
case 1: windfuryDamageBonus = 1.20f; break;
case 2: windfuryDamageBonus = 1.40f; break;
}
float focusedStrikes = 1f; //
switch (character.ShamanTalents.FocusedStrikes)
{
case 1: focusedStrikes = 1.15f; break;
case 2: focusedStrikes = 1.30f; break;
case 3: focusedStrikes = 1.45f; break;
}
float unleashedRage = 0f;
switch (character.ShamanTalents.UnleashedRage)
{
case 1: unleashedRage = .05f; break;
case 2: unleashedRage = .10f; break;
}
// Tier Bonuses
int setCount;
float enhance2T11 = 0f;
character.SetBonusCount.TryGetValue("Battlegear of the Raging Elements", out setCount);
if (setCount >= 2)
{
enhance2T11 = 0.1f;
}
float enhance2T12 = 0f;
float enhance4T12 = 0f;
character.SetBonusCount.TryGetValue("Volcanic Battlegear", out setCount);
if (setCount >= 2)
{
enhance2T12 = 0.05f;
}
if (setCount >= 4)
{
if (calcOpts.PriorityInUse(EnhanceAbility.StormStrike))
{
enhance4T12 = 0.06f;
//enhance4T12 = 0.16f;
}
}
//
float FTspellpower = (float)Math.Floor((float)(748f * (1 + character.ShamanTalents.ElementalWeapons * .2f)));
if (calcOpts.MainhandImbue == "Flametongue")
stats.SpellPower += FTspellpower;
if (calcOpts.OffhandImbue == "Flametongue")
stats.SpellPower += FTspellpower;
float addedAttackPower = stats.AttackPower - initialAP;
float MQSpellPower = mentalQuickness * addedAttackPower * (1 + stats.BonusAttackPowerMultiplier);
// make sure to add in the spellpower from MQ gained from all the bonus AP added in this section
stats.SpellPower += MQSpellPower * (1 + stats.BonusSpellPowerMultiplier);
// also add in bonus attack power
stats.AttackPower += addedAttackPower * stats.BonusAttackPowerMultiplier;
//
#endregion
#region Damage Model
////////////////////////////
// Main calculation Block //
////////////////////////////
CombatStats cs = new CombatStats(character, stats, calcOpts, bossOpts); // calculate the combat stats using modified stats
// only apply unleashed rage talent if not already applied Unleashed Rage buff.
if (!character.ActiveBuffsContains("Unleashed Rage") &&
!character.ActiveBuffsContains("Trueshot Aura") &&
!character.ActiveBuffsContains("Abomination's Might"))
//.........这里部分代码省略.........
示例5: AccumulateTalents
//.........这里部分代码省略.........
}
// Hand of Doom
// Reduces the CD for Strangulate by 30/60 sec.
if (r == Rotation.Type.Blood)
{
// Blood-Caked Blade
// 10% chance per point to cause Blood-Caked strike
// Implmented in WhiteDamage ability file.
// Bone Shield
// 6 Bones
// Takes 20% less damage from all sources
// Does 2% more damage to target
// Each damaging attack consumes a bone.
// Lasts 5 mins
// Toughness
// Increases Armor Value from items by 3% per point.
if (character.DeathKnightTalents.Toughness > 0)
{
FullCharacterStats.BaseArmorMultiplier = AddStatMultiplierStat(FullCharacterStats.BaseArmorMultiplier, (.03f * character.DeathKnightTalents.Toughness));
}
// Abominations Might
// increase AP by 5%/10% of raid.
// 1% per point increase to str.
if (character.DeathKnightTalents.AbominationsMight > 0)
{
// This happens no matter what:
FullCharacterStats.BonusStrengthMultiplier += (0.01f * character.DeathKnightTalents.AbominationsMight);
// This happens only if there isn't Trueshot Aura/Unleashed Rage/Abom's might available:
if (!(character.ActiveBuffsContains("Trueshot Aura") || character.ActiveBuffsContains("Unleashed Rage") || character.ActiveBuffsContains("Abomination's Might")))
{
FullCharacterStats.BonusAttackPowerMultiplier += (.05f * character.DeathKnightTalents.AbominationsMight);
}
}
// Sanguine Fortitude
// Buff's IBF:
// While Active, your IBF reduces Dam taken by 15/30% and costs 50/100% less RP to activate.
// CD duration? 3min suggested on pwnwear.
// Cost? This is a CD stacker.
// TODO: look into CD stacking code./max v average values.
// Blood Parasite
// Melee Attacks have 5% * PTS chance of spawning a blood worm.
// Blood worm attacks your enemies, gorging itself on blood
// until it bursts to heal nearby allies. Lasts 20 sec.
if (character.DeathKnightTalents.BloodParasite > 0)
{
float fDamageDone = 200f; // TODO: Put this in a way to increase DPS.
float fBWAttackSpeed = 1.4f; // TODO: Validate this speed.
float fBWDuration = 20f;
float avgstacks = 5; // TODO: Figure out the best way to determine avg Stacks of BloodGorged
float WormHealth = (FullCharacterStats.Health * 0.35f);
_SE_Bloodworms = new SpecialEffect[] {
null,
new SpecialEffect(Trigger.MeleeAttack, new Stats() { Healed = ((avgstacks * WormHealth * .05f) / fBWDuration), PhysicalDamage = (fDamageDone/fBWAttackSpeed) }, fBWDuration, 0, .05f * 1),
new SpecialEffect(Trigger.MeleeAttack, new Stats() { Healed = ((avgstacks * WormHealth * .05f) / fBWDuration), PhysicalDamage = (fDamageDone/fBWAttackSpeed) }, fBWDuration, 0, .05f * 2),
};
FullCharacterStats.AddSpecialEffect(_SE_Bloodworms[character.DeathKnightTalents.BloodParasite]);
}
// Improved Blood Presence