本文整理汇总了C#中Character.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Character.Clone方法的具体用法?C# Character.Clone怎么用?C# Character.Clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character.Clone方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetCharacters
public void SetCharacters(Character[] value)
{
value = value ?? new Character[0];
if (m_Characters == null || !m_Characters.SequenceEqual(value, BackingFieldUtility<Character>.Comparer))
{
m_Characters = (Character[])value.Clone();
Debug.Log(
string.Format(
"SetCharacters: [{0}]",
string.Join(", ", (from element in m_Characters select element.ToString()).ToArray())
)
);
}
}
示例2: GetCustomChartData
public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName)
{
if (chartName == "Seals")
{
CalculationOptionsRetribution initOpts = character.CalculationOptions as CalculationOptionsRetribution;
Character baseChar = character.Clone();
CalculationOptionsRetribution baseOpts = initOpts.Clone();
baseChar.CalculationOptions = baseOpts;
baseOpts.Seal = SealOf.None;
CharacterCalculationsBase baseCalc = Calculations.GetCharacterCalculations(baseChar);
Character deltaChar = character.Clone();
CalculationOptionsRetribution deltaOpts = initOpts.Clone();
deltaChar.CalculationOptions = deltaOpts;
deltaOpts.Seal = SealOf.Righteousness;
ComparisonCalculationBase Righteousness = Calculations.GetCharacterComparisonCalculations(baseCalc, deltaChar, "Seal of Righteousness", initOpts.Seal == SealOf.Righteousness);
Righteousness.Item = null;
deltaOpts.Seal = SealOf.Truth;
ComparisonCalculationBase Truth = Calculations.GetCharacterComparisonCalculations(baseCalc, deltaChar, "Seal of Truth", initOpts.Seal == SealOf.Truth);
Truth.Item = null;
return new ComparisonCalculationBase[] { Righteousness, Truth };
}
if (chartName == "Weapon Speed")
{
if (character.MainHand == null)
return new ComparisonCalculationBase[] { };
return new ComparisonCalculationBase[]
{
GetWeaponSpeedComparison(character, 3.3f),
GetWeaponSpeedComparison(character, 3.4f),
GetWeaponSpeedComparison(character, 3.5f),
GetWeaponSpeedComparison(character, 3.6f),
GetWeaponSpeedComparison(character, 3.7f),
GetWeaponSpeedComparison(character, 3.8f)
};
}
if (chartName == "Inquisition Refresh below")
{
return new ComparisonCalculationBase[] {
GetInqRefreshComparison(character, 0f),
GetInqRefreshComparison(character, 1f),
GetInqRefreshComparison(character, 2f),
GetInqRefreshComparison(character, 3f),
GetInqRefreshComparison(character, 4f),
GetInqRefreshComparison(character, 5f),
GetInqRefreshComparison(character, 6f),
GetInqRefreshComparison(character, 7f),
GetInqRefreshComparison(character, 8f)
};
}
if (chartName == "Holy Power per Inq")
{
return new ComparisonCalculationBase[] {
GetInqHPComparison(character, 1),
GetInqHPComparison(character, 2),
GetInqHPComparison(character, 3)
};
}
if (chartName == "Wait for Crusader")
{
return new ComparisonCalculationBase[] {
GetWaitforCSComparison(character, .1f),
GetWaitforCSComparison(character, .2f),
GetWaitforCSComparison(character, .3f),
GetWaitforCSComparison(character, .4f),
GetWaitforCSComparison(character, .5f),
GetWaitforCSComparison(character, .6f),
GetWaitforCSComparison(character, .7f)
};
}
return new ComparisonCalculationBase[0];
}
示例3: CheckWeaponSpeedEffect
private ComparisonCalculationBase CheckWeaponSpeedEffect(Character character, float newSpeed, bool mainHand)
{
float baseSpeed = 0f;
int minDamage = 0;
int maxDamage = 0;
Item newWeapon;
CharacterCalculationsBase baseCalc = Calculations.GetCharacterCalculations(character);
Character deltaChar = character.Clone();
if (mainHand)
{
newWeapon = deltaChar.MainHand.Item.Clone();
baseSpeed = deltaChar.MainHand.Speed;
minDamage = deltaChar.MainHand.MinDamage;
maxDamage = deltaChar.MainHand.MaxDamage;
}
else
{
newWeapon = deltaChar.OffHand.Item.Clone();
baseSpeed = deltaChar.OffHand.Speed;
minDamage = deltaChar.OffHand.MinDamage;
maxDamage = deltaChar.OffHand.MaxDamage;
}
newWeapon.MinDamage = (int)Math.Round(minDamage / baseSpeed * newSpeed);
newWeapon.MaxDamage = (int)Math.Round(maxDamage / baseSpeed * newSpeed);
newWeapon.Speed = newSpeed;
String speed = newSpeed.ToString() + " Speed";
deltaChar.IsLoading = true; // forces item instance to avoid invalidating and reloading from cache
if (mainHand)
deltaChar.MainHand = new ItemInstance(newWeapon, character.MainHand.RandomSuffixId, character.MainHand.Gem1, character.MainHand.Gem2, character.MainHand.Gem3, character.MainHand.Enchant, character.MainHand.Reforging, character.MainHand.Tinkering);
else
deltaChar.OffHand = new ItemInstance(newWeapon, deltaChar.OffHand.RandomSuffixId, deltaChar.OffHand.Gem1, deltaChar.OffHand.Gem2, deltaChar.OffHand.Gem3, deltaChar.OffHand.Enchant, deltaChar.OffHand.Reforging, deltaChar.OffHand.Tinkering);
ComparisonCalculationBase result = Calculations.GetCharacterComparisonCalculations(baseCalc, deltaChar, speed, baseSpeed == newWeapon.Speed);
deltaChar.IsLoading = false;
result.Item = null;
return result;
}
示例4: GetInqHPComparison
private ComparisonCalculationBase GetInqHPComparison(Character character, int inqHP)
{
CalculationOptionsRetribution initOpts = character.CalculationOptions as CalculationOptionsRetribution;
CalculationOptionsRetribution deltaOpts = initOpts.Clone();
Character adjustedCharacter = character.Clone();
adjustedCharacter.CalculationOptions = deltaOpts;
((CalculationOptionsRetribution)adjustedCharacter.CalculationOptions).HPperInq = inqHP;
return Calculations.GetCharacterComparisonCalculations(Calculations.GetCharacterCalculations(character),
adjustedCharacter,
string.Format("Refresh at {0:0} HP", inqHP),
((CalculationOptionsRetribution)character.CalculationOptions).HPperInq == inqHP);
}
示例5: GetWeaponSpeedComparison
private ComparisonCalculationBase GetWeaponSpeedComparison(Character character, float speed)
{
Character adjustedCharacter = character.Clone();
adjustedCharacter.IsLoading = true;
adjustedCharacter.MainHand = new ItemInstance(
AdjustWeaponSpeed(character.MainHand.Item, speed),
character.MainHand.RandomSuffixId,
character.MainHand.Gem1,
character.MainHand.Gem2,
character.MainHand.Gem3,
character.MainHand.Enchant,
character.MainHand.Reforging,
character.MainHand.Tinkering);
var comparison = Calculations.GetCharacterComparisonCalculations(
Calculations.GetCharacterCalculations(character),
adjustedCharacter,
string.Format(
CultureInfo.InvariantCulture,
"{0:0.0} Speed",
speed),
character.MainHand.Item.Speed == speed);
comparison.Item = null;
return comparison;
}
示例6: GetWaitforCSComparison
private ComparisonCalculationBase GetWaitforCSComparison(Character character, float waitforCS)
{
CalculationOptionsRetribution initOpts = character.CalculationOptions as CalculationOptionsRetribution;
CalculationOptionsRetribution deltaOpts = initOpts.Clone();
Character adjustedCharacter = character.Clone();
adjustedCharacter.CalculationOptions = deltaOpts;
((CalculationOptionsRetribution)adjustedCharacter.CalculationOptions).SkipToCrusader = waitforCS;
return Calculations.GetCharacterComparisonCalculations(Calculations.GetCharacterCalculations(character),
adjustedCharacter,
string.Format("Wait for CS < {0:0.0} CD", waitforCS),
((CalculationOptionsRetribution)character.CalculationOptions).SkipToCrusader == waitforCS);
}
示例7: GetInqRefreshComparison
private ComparisonCalculationBase GetInqRefreshComparison(Character character, float inqRefresh)
{
CalculationOptionsRetribution initOpts = character.CalculationOptions as CalculationOptionsRetribution;
CalculationOptionsRetribution deltaOpts = initOpts.Clone();
Character adjustedCharacter = character.Clone();
adjustedCharacter.CalculationOptions = deltaOpts;
((CalculationOptionsRetribution)adjustedCharacter.CalculationOptions).InqRefresh = inqRefresh;
return Calculations.GetCharacterComparisonCalculations(Calculations.GetCharacterCalculations(character),
adjustedCharacter,
string.Format("Refresh below {0:0} sec", inqRefresh),
((CalculationOptionsRetribution)character.CalculationOptions).InqRefresh == inqRefresh);
}
示例8: foreach
/* public virtual List<ComparisonCalculationBase> GetPetBuffCalculations(Character character, CalculationOptionsHunter calcOpts, CharacterCalculationsBase currentCalcs, string filter)
{
//ClearCache();
List<ComparisonCalculationBase> buffCalcs = new List<ComparisonCalculationBase>();
CharacterCalculationsBase calcsOpposite = null;
//CharacterCalculationsBase calcsEquipped = null;
//CharacterCalculationsBase calcsUnequipped = null;
Character charAutoActivated = character.Clone();
foreach (Buff autoBuff in currentCalcs.AutoActivatedBuffs)
{
if (!charAutoActivated.ActiveBuffs.Contains(autoBuff))
{
charAutoActivated.ActiveBuffsAdd(autoBuff);
RemoveConflictingBuffs(charAutoActivated.ActiveBuffs, autoBuff);
}
}
charAutoActivated.DisableBuffAutoActivation = true;
string[] multiFilter = filter.Split('|');
List<Buff> relevantBuffs = new List<Buff>();
foreach (Buff buff in RelevantPetBuffs)
{
bool isinMultiFilter = false;
if (multiFilter.Length > 0)
{
foreach (string mFilter in multiFilter)
{
if (buff.Group.Equals(mFilter, StringComparison.CurrentCultureIgnoreCase))
{
isinMultiFilter = true;
break;
}
}
}
if (filter == null || filter == "All" || filter == "Current"
|| buff.Group.Equals(filter, StringComparison.CurrentCultureIgnoreCase)
|| isinMultiFilter)
{
relevantBuffs.Add(buff);
relevantBuffs.AddRange(buff.Improvements);
}
}
foreach (Buff buff in relevantBuffs)
{
if (!"Current".Equals(filter, StringComparison.CurrentCultureIgnoreCase) || (charAutoActivated.CalculationOptions as CalculationOptionsHunter).petActiveBuffs.Contains(buff))
{
Character charOpposite = charAutoActivated.Clone();
//Character charUnequipped = charAutoActivated.Clone();
//Character charEquipped = charAutoActivated.Clone();
CalculationOptionsHunter calcOptsOpposite = charOpposite.CalculationOptions as CalculationOptionsHunter;
//CalculationOptionsHunter calcOptsUnequipped = charUnequipped.CalculationOptions as CalculationOptionsHunter;
//CalculationOptionsHunter calcOptsEquipped = charEquipped.CalculationOptions as CalculationOptionsHunter;
bool which = (charAutoActivated.CalculationOptions as CalculationOptionsHunter).petActiveBuffs.Contains(buff);
charOpposite.DisableBuffAutoActivation = true;
//charUnequipped.DisableBuffAutoActivation = true;
//charEquipped.DisableBuffAutoActivation = true;
if (which) { calcOptsOpposite.petActiveBuffs.Remove(buff); } else { calcOptsOpposite.petActiveBuffs.Add(buff); }
//if (calcOptsUnequipped.petActiveBuffs.Contains(buff)) { calcOptsUnequipped.petActiveBuffs.Remove(buff); }
//if (!calcOptsEquipped.petActiveBuffs.Contains(buff)) { calcOptsEquipped.petActiveBuffs.Add(buff); }
RemoveConflictingBuffs(calcOptsOpposite.petActiveBuffs, buff);
//RemoveConflictingBuffs(calcOptsEquipped.petActiveBuffs, buff);
//RemoveConflictingBuffs(calcOptsUnequipped.petActiveBuffs, buff);
calcsOpposite = GetCharacterCalculations(charOpposite, null, false, false, false);
//calcsUnequipped = GetCharacterCalculations(charUnequipped, null, false, false, false);
//calcsEquipped = GetCharacterCalculations(charEquipped, null, false, false, false);
ComparisonCalculationBase buffCalc = CreateNewComparisonCalculation();
buffCalc.Name = buff.Name;
buffCalc.Item = new Item() { Name = buff.Name, Stats = buff.Stats, Quality = ItemQuality.Temp };
buffCalc.Equipped = which;//(charAutoActivated.CalculationOptions as CalculationOptionsHunter).petActiveBuffs.Contains(buff);
buffCalc.OverallPoints = (which ? currentCalcs.OverallPoints - calcsOpposite.OverallPoints
: calcsOpposite.OverallPoints - currentCalcs.OverallPoints);
//buffCalc.OverallPoints = currentCalcs.OverallPoints - (buffCalc.Equipped ? calcsEquipped.OverallPoints : calcsUnequipped.OverallPoints);
float[] subPoints = new float[calcsOpposite.SubPoints.Length];
//float[] subPoints = new float[calcsEquipped.SubPoints.Length];
for (int i = 0; i < calcsOpposite.SubPoints.Length; i++) {
subPoints[i] = (which ? currentCalcs.SubPoints[i] - calcsOpposite.SubPoints[i]
: calcsOpposite.SubPoints[i] - currentCalcs.SubPoints[i]);
}
//for (int i = 0; i < calcsEquipped.SubPoints.Length; i++) { subPoints[i] = calcsEquipped.SubPoints[i] - calcsUnequipped.SubPoints[i]; }
buffCalc.SubPoints = subPoints;
buffCalcs.Add(buffCalc);
// Revert, cuz it's evil
if (!which) { calcOptsOpposite.petActiveBuffs.Remove(buff); } else { calcOptsOpposite.petActiveBuffs.Add(buff); }
}
}
return buffCalcs;
}*/
private ComparisonCalculationHunter[] GetPetTalentChart(Character character, CharacterCalculationsHunter calcs)
{
List<ComparisonCalculationHunter> talentCalculations = new List<ComparisonCalculationHunter>();
Character baseChar = character.Clone(); CalculationOptionsHunter baseCalcOpts = baseChar.CalculationOptions as CalculationOptionsHunter;
Character newChar = character.Clone(); CalculationOptionsHunter newCalcOpts = newChar.CalculationOptions as CalculationOptionsHunter;
CharacterCalculationsHunter currentCalc;
CharacterCalculationsHunter newCalc;
//.........这里部分代码省略.........
示例9: GetCustomChartData
public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName)
{
int i = customChartNames.FindIndex(x => x == chartName);
if(i < 0)
return new ComparisonCalculationBase[0];
//if(i <= 4)
{
List<ComparisonCalculationBase> chart = new List<ComparisonCalculationBase>();
CharacterCalculationsTree calcsBase = GetCharacterCalculations(character) as CharacterCalculationsTree;
Character c2 = character.Clone();
bool curIsBreakpoint = false;
int[] hasteBreakpoints = GetHasteBreakpoints(character, 5000);
foreach(int hb in hasteBreakpoints)
{
float hasteDelta = hb - calcsBase.BasicStats.HasteRating;
float curHasteDelta;
Buff buff = new Buff();
buff.Name = "Haste adjustment to meet breakpoint";
buff.Stats.HasteRating += hasteDelta;
bool stop = false;
if(i == 6)
{
if (hasteDelta > calcsBase.BasicStats.Intellect)
stop = true;
buff.Stats.Intellect -= hasteDelta;
}
else
{
int[] ratings = new int[3];
int critPos = i >> 1;
ratings[critPos] = 0; // crit
ratings[critPos == 0 ? 1 : 0] = 1 + (i & 1);
ratings[critPos == 2 ? 1 : 2] = 2 - (i & 1);
for(int j = 0; j < 3; ++j)
{
switch(ratings[j])
{
case 0:
curHasteDelta = Math.Min(hasteDelta, calcsBase.BasicStats.CritRating);
buff.Stats.CritRating -= curHasteDelta;
hasteDelta -= curHasteDelta;
break;
case 1:
curHasteDelta = Math.Min(hasteDelta, calcsBase.BasicStats.MasteryRating);
buff.Stats.MasteryRating -= curHasteDelta;
hasteDelta -= curHasteDelta;
break;
case 2:
curHasteDelta = Math.Min(hasteDelta, calcsBase.BasicStats.Spirit);
buff.Stats.Spirit -= curHasteDelta;
hasteDelta -= curHasteDelta;
break;
}
}
if (hasteDelta > calcsBase.BasicStats.Intellect)
stop = true;
buff.Stats.Intellect -= hasteDelta;
}
if (stop)
break;
c2.ActiveBuffs.Add(buff);
CharacterCalculationsTree calcsCur = GetCharacterCalculations(c2) as CharacterCalculationsTree;
c2.ActiveBuffs.Remove(buff);
ComparisonCalculationBase comp = Calculations.GetCharacterComparisonCalculations(calcsBase, calcsCur, String.Format("{0,4:F0}", hb), false, false);
if (hb == calcsBase.BasicStats.HasteRating)
comp.Description = "Current Gear (and on a breakpoint)";
else
comp.Description = buff.ToString();
chart.Add(comp);
}
if (!curIsBreakpoint)
{
ComparisonCalculationBase comp = Calculations.GetCharacterComparisonCalculations(calcsBase, calcsBase, String.Format("{0,4:F0}" + (curIsBreakpoint ? "" : "(-)"), calcsBase.BasicStats.HasteRating), true, false);
comp.Description = "Current Gear (not on a breakpoint)";
chart.Add(comp);
}
return chart.ToArray();
}
}
示例10: GetCustomChartData
public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName)
{
switch (chartName)
{
case "Mana Gains By Source":
CharacterCalculationsMoonkin calcsManaBase = GetCharacterCalculations(character) as CharacterCalculationsMoonkin;
RotationData manaGainsRot = calcsManaBase.SelectedRotation;
Character c2 = character.Clone();
List<ComparisonCalculationMoonkin> manaGainsList = new List<ComparisonCalculationMoonkin>();
// Euphoria
int previousTalentValue = c2.DruidTalents.Euphoria;
c2.DruidTalents.Euphoria = 0;
CharacterCalculationsMoonkin calcsManaMoonkin = GetCharacterCalculations(c2) as CharacterCalculationsMoonkin;
c2.DruidTalents.Euphoria = previousTalentValue;
foreach (RotationData rot in calcsManaMoonkin.Rotations)
{
if (rot.Name == manaGainsRot.Name)
{
manaGainsList.Add(new ComparisonCalculationMoonkin()
{
Name = "Euphoria",
OverallPoints = (manaGainsRot.ManaGained - rot.ManaGained) / manaGainsRot.Duration * character.BossOptions.BerserkTimer * 60.0f,
BurstDamagePoints = (manaGainsRot.ManaGained - rot.ManaGained) / manaGainsRot.Duration * character.BossOptions.BerserkTimer * 60.0f,
ImageSource = "achievement_boss_valithradreamwalker"
});
}
}
// Replenishment
CalculationOptionsMoonkin calcOpts = c2.CalculationOptions as CalculationOptionsMoonkin;
calcOpts.Notify = false;
float oldReplenishmentUptime = calcOpts.ReplenishmentUptime;
calcOpts.ReplenishmentUptime = 0.0f;
CharacterCalculationsMoonkin calcsManaReplenishment = GetCharacterCalculations(c2) as CharacterCalculationsMoonkin;
calcOpts.ReplenishmentUptime = oldReplenishmentUptime;
foreach (RotationData rot in calcsManaReplenishment.Rotations)
{
if (rot.Name == manaGainsRot.Name)
{
manaGainsList.Add(new ComparisonCalculationMoonkin()
{
Name = "Replenishment",
OverallPoints = (manaGainsRot.ManaGained - rot.ManaGained) / manaGainsRot.Duration * character.BossOptions.BerserkTimer * 60.0f,
BurstDamagePoints = (manaGainsRot.ManaGained - rot.ManaGained) / manaGainsRot.Duration * character.BossOptions.BerserkTimer * 60.0f,
ImageSource = "spell_magic_managain"
});
}
}
// Innervate
bool innervate = calcOpts.Innervate;
calcOpts.Innervate = false;
CharacterCalculationsMoonkin calcsManaInnervate = GetCharacterCalculations(c2) as CharacterCalculationsMoonkin;
calcOpts.Innervate = innervate;
foreach (RotationData rot in calcsManaInnervate.Rotations)
{
if (rot.Name == manaGainsRot.Name)
{
manaGainsList.Add(new ComparisonCalculationMoonkin()
{
Name = "Innervate",
OverallPoints = (manaGainsRot.ManaGained - rot.ManaGained) / manaGainsRot.Duration * character.BossOptions.BerserkTimer * 60.0f,
BurstDamagePoints = (manaGainsRot.ManaGained - rot.ManaGained) / manaGainsRot.Duration * character.BossOptions.BerserkTimer * 60.0f,
ImageSource = "spell_nature_lightning"
});
}
}
calcOpts.Notify = true;
// mp5
manaGainsList.Add(new ComparisonCalculationMoonkin()
{
Name = "MP5",
OverallPoints = character.BossOptions.BerserkTimer * 60.0f * calcsManaBase.ManaRegen,
BurstDamagePoints = character.BossOptions.BerserkTimer * 60.0f * calcsManaBase.ManaRegen
});
return manaGainsList.ToArray();
case "Damage per Cast Time":
CharacterCalculationsMoonkin calcsBase = GetCharacterCalculations(character) as CharacterCalculationsMoonkin;
ComparisonCalculationMoonkin sf = new ComparisonCalculationMoonkin() { Name = "Starfire", ImageSource = "spell_arcane_starfire" };
ComparisonCalculationMoonkin mf = new ComparisonCalculationMoonkin() { Name = "Moonfire", ImageSource = "spell_nature_starfall" };
ComparisonCalculationMoonkin iSw = new ComparisonCalculationMoonkin() { Name = "Insect Swarm", ImageSource = "spell_nature_insectswarm" };
ComparisonCalculationMoonkin wr = new ComparisonCalculationMoonkin() { Name = "Wrath", ImageSource = "spell_nature_abolishmagic" };
ComparisonCalculationMoonkin ss = new ComparisonCalculationMoonkin() { Name = "Starsurge", ImageSource = "spell_arcane_arcane03" };
ComparisonCalculationMoonkin ssInst = new ComparisonCalculationMoonkin() { Name = "Shooting Stars Proc", ImageSource = "ability_mage_arcanebarrage" };
ComparisonCalculationMoonkin wm = new ComparisonCalculationMoonkin() { Name = "Wild Mushroom", ImageSource = "druid_ability_wildmushroom_b" };
ComparisonCalculationMoonkin sfa = new ComparisonCalculationMoonkin() { Name = "Starfall", ImageSource = "ability_druid_starfall" };
ComparisonCalculationMoonkin fon = new ComparisonCalculationMoonkin() { Name = "Force of Nature", ImageSource = "ability_druid_forceofnature" };
sf.BurstDamagePoints = calcsBase.SelectedRotation.StarfireAvgHit / calcsBase.SelectedRotation.StarfireAvgCast;
sf.OverallPoints = sf.BurstDamagePoints;
mf.BurstDamagePoints = calcsBase.SelectedRotation.MoonfireAvgHit / calcsBase.SelectedRotation.MoonfireAvgCast;
mf.OverallPoints = mf.BurstDamagePoints;
iSw.BurstDamagePoints = calcsBase.SelectedRotation.InsectSwarmAvgHit / calcsBase.SelectedRotation.InsectSwarmAvgCast;
iSw.OverallPoints = iSw.BurstDamagePoints;
wr.BurstDamagePoints = calcsBase.SelectedRotation.WrathAvgHit / calcsBase.SelectedRotation.WrathAvgCast;
wr.OverallPoints = wr.BurstDamagePoints;
//.........这里部分代码省略.........
示例11: GetCustomChartData
public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName) {
if (character == null) { return null;}
Character zeOriginal = character.Clone();
Character zeClone = character.Clone();
CharacterCalculationsDPSWarr calculations = GetCharacterCalculations(zeOriginal) as CharacterCalculationsDPSWarr;
CalculationOptionsDPSWarr calcOpts = zeOriginal.CalculationOptions as CalculationOptionsDPSWarr;
((CalculationOptionsPanelDPSWarr)CalculationOptionsPanel).IsLoadingCalculationOptions = true;
bool[] origMaints = (bool[])calcOpts.MaintenanceTree.Clone();
DPSWarrCharacter dpswarchar = new DPSWarrCharacter() {
Char = zeOriginal,
CalcOpts = (CalculationOptionsDPSWarr)zeOriginal.CalculationOptions,
BossOpts = zeOriginal.BossOptions,
CombatFactors = null,
Rot = null,
};
switch (chartName) {
#region Ability DPS
case "Ability DPS": {
List<ComparisonCalculationBase> comparisons = new List<ComparisonCalculationBase>();
foreach (AbilityWrapper aw in calculations.Rot.TheAbilityList)
{
if (aw.Ability.DamageOnUse == 0) { continue; }
ComparisonCalculationDPSWarr comparison = new ComparisonCalculationDPSWarr();
comparison.Name = aw.Ability.Name;
comparison.Description = aw.Ability.Desc;
if (aw.Ability is Skills.Rend) {
comparison.DPSPoints = (aw.Ability as Skills.Rend).GetDPS(aw.NumActivatesO20, calculations.Rot.GetWrapper<Skills.ThunderClap>().NumActivatesO20, calculations.Rot.TimeOver20Perc) * calculations.Rot.TimeOver20Perc
+ (aw.Ability as Skills.Rend).GetDPS(aw.NumActivatesU20, calculations.Rot.GetWrapper<Skills.ThunderClap>().NumActivatesU20, calculations.Rot.TimeUndr20Perc) * calculations.Rot.TimeUndr20Perc;
} else {
comparison.DPSPoints = aw.AllDPS;
}
comparison.SurvPoints = aw.AllHPS;
comparison.ImageSource = aw.Ability.Icon;
comparisons.Add(comparison);
}
foreach (ComparisonCalculationDPSWarr comp in comparisons) {
comp.OverallPoints = comp.DPSPoints + comp.SurvPoints;
}
calcOpts.MaintenanceTree = origMaints;
((CalculationOptionsPanelDPSWarr)CalculationOptionsPanel).IsLoadingCalculationOptions = false;
return comparisons.ToArray();
}
#endregion
#region Ability Damage per GCD
case "Ability Damage per GCD":
{
List<ComparisonCalculationBase> comparisons = new List<ComparisonCalculationBase>();
foreach (AbilityWrapper aw in calculations.Rot.TheAbilityList)
{
if (aw.Ability.DamageOnUse == 0) { continue; }
ComparisonCalculationDPSWarr comparison = new ComparisonCalculationDPSWarr();
comparison.Name = aw.Ability.Name;
comparison.Description = aw.Ability.Desc;
comparison.DPSPoints = (
((aw.Ability is Skills.Rend) ? ((aw.Ability as Skills.Rend).TickSize * (aw.Ability as Skills.Rend).NumTicks)
: aw.Ability.DamageOnUse)) / (aw.Ability.GCDTime == 0 ? 1f : (aw.Ability.GCDTime / calculations.Rot.LatentGCD));
comparison.SurvPoints = aw.Ability.GetAvgHealingOnUse(aw.AllNumActivates);
comparison.ImageSource = aw.Ability.Icon;
comparisons.Add(comparison);
}
foreach (ComparisonCalculationDPSWarr comp in comparisons)
{
comp.OverallPoints = comp.DPSPoints + comp.SurvPoints;
}
calcOpts.MaintenanceTree = origMaints;
((CalculationOptionsPanelDPSWarr)CalculationOptionsPanel).IsLoadingCalculationOptions = false;
return comparisons.ToArray();
}
#endregion
#region Ability Maintenance Changes
case "Ability Maintenance Changes": {
List<ComparisonCalculationBase> comparisons = new List<ComparisonCalculationBase>();
#region Rage Generators
comparisons.Add(getComp(dpswarchar, "Berserker Rage", (int)Maintenance.BerserkerRage));
comparisons.Add(getComp(dpswarchar, "Deadly Calm", (int)Maintenance.DeadlyCalm));
#endregion
#region Maintenance
comparisons.Add(getComp(dpswarchar, "Battle Shout", (int)Maintenance.BattleShout));
comparisons.Add(getComp(dpswarchar, "Commanding Shout", (int)Maintenance.CommandingShout));
comparisons.Add(getComp(dpswarchar, "Demoralizing Shout", (int)Maintenance.DemoralizingShout));
comparisons.Add(getComp(dpswarchar, "Sunder Armor", (int)Maintenance.SunderArmor));
comparisons.Add(getComp(dpswarchar, "Thunder Clap", (int)Maintenance.ThunderClap));
comparisons.Add(getComp(dpswarchar, "Hamstring", (int)Maintenance.Hamstring));
#endregion
#region Periodics
comparisons.Add(getComp(dpswarchar, "Shattering Throw", (int)Maintenance.ShatteringThrow));
comparisons.Add(getComp(dpswarchar, "Sweeping Strikes", (int)Maintenance.SweepingStrikes));
comparisons.Add(getComp(dpswarchar, "Death Wish", (int)Maintenance.DeathWish));
comparisons.Add(getComp(dpswarchar, "Recklessness", (int)Maintenance.Recklessness));
comparisons.Add(getComp(dpswarchar, "Enraged Regeneration", (int)Maintenance.EnragedRegeneration));
#endregion
#region Damage Dealers
if (calculations.Rot.GetType() == typeof(FuryRotation)) {
#region Fury
comparisons.Add(getComp(dpswarchar, "Bloodsurge", (int)Maintenance.Bloodsurge));
comparisons.Add(getComp(dpswarchar, "Bloodthirst", (int)Maintenance.Bloodthirst));
// comparisons.Add(getComp(dpswarchar, "Whirlwind", (int)Maintenance.Whirlwind));
comparisons.Add(getComp(dpswarchar, "Raging Blow", (int)Maintenance.RagingBlow));
#endregion
//.........这里部分代码省略.........
示例12: GetCustomChartData
public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName)
{
List<ComparisonCalculationBase> comparisonList = new List<ComparisonCalculationBase>();
CharacterCalculationsDPSDK baseCalc, calc;
ComparisonCalculationBase comparison;
float[] subPoints;
baseCalc = GetCharacterCalculations(character) as CharacterCalculationsDPSDK;
string[] statList = new string[]
{
"Strength",
"Agility",
"Attack Power",
"Crit Rating",
"Hit Rating",
"Expertise Rating",
"Haste Rating",
"Mastery Rating",
};
switch (chartName)
{
case "Presences":
{
string[] listPresence = EnumHelper.GetNames(typeof(Presence));
// Set this to have no presence enabled.
Character baseCharacter = character.Clone();
baseCharacter.IsLoading = true;
(baseCharacter.CalculationOptions as CalculationOptionsDPSDK).presence = Presence.None;
baseCharacter.IsLoading = false;
// replacing pre-factored base calc since this is different than the Item budget lists.
baseCalc = GetCharacterCalculations(baseCharacter, null, true, false, false) as CharacterCalculationsDPSDK;
// Set these to have the key presence enabled.
for (int index = 0; index < listPresence.Length; index++)
{
(character.CalculationOptions as CalculationOptionsDPSDK).presence = (Presence)index;
calc = GetCharacterCalculations(character, null, false, true, true) as CharacterCalculationsDPSDK;
comparison = CreateNewComparisonCalculation();
comparison.Name = listPresence[index];
comparison.Equipped = false;
comparison.OverallPoints = calc.OverallPoints - baseCalc.OverallPoints;
subPoints = new float[calc.SubPoints.Length];
for (int i = 0; i < calc.SubPoints.Length; i++)
{
subPoints[i] = calc.SubPoints[i] - baseCalc.SubPoints[i];
}
comparison.SubPoints = subPoints;
comparisonList.Add(comparison);
}
return comparisonList.ToArray();
}
default:
return new ComparisonCalculationBase[0];
}
}