本文整理匯總了C#中AIHeroClient.GetItemDamage方法的典型用法代碼示例。如果您正苦於以下問題:C# AIHeroClient.GetItemDamage方法的具體用法?C# AIHeroClient.GetItemDamage怎麽用?C# AIHeroClient.GetItemDamage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.GetItemDamage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetHeroAvgDamage
/// <summary>
/// Gets the hero average damage to the opposing team.
/// </summary>
/// <param name="player">The player.</param>
/// <param name="Enemies">The enemies.</param>
/// <returns></returns>
public static float GetHeroAvgDamage(AIHeroClient player, List<AIHeroClient> Enemies)
{
var totalEnemies = Enemies.Count();
if (totalEnemies == 0)
{
return -1;
}
var AADamage = Enemies.Aggregate(0, (current, s) => (int) (current + player.LSGetAutoAttackDamage(s) * 2));
var QDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.Q).IsReady() ? player.LSGetSpellDamage(s, SpellSlot.Q) : 0f)));
var WDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.W).IsReady() ? player.LSGetSpellDamage(s, SpellSlot.W) : 0f)));
var EDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.E).IsReady() ? player.LSGetSpellDamage(s, SpellSlot.E) : 0f)));
var RDamage = Enemies.Aggregate(0, (current, s) => (int)(current + (player.GetSpell(SpellSlot.R).IsReady() ? player.LSGetSpellDamage(s, SpellSlot.R) : 0f)));
var itemsDamage = 0f;
foreach (var item in player.InventoryItems)
{
foreach (var hero in Enemies)
{
var itemID = item.Id;
switch (itemID)
{
case ItemId.Bilgewater_Cutlass:
itemsDamage +=
(float) player.GetItemDamage(hero, Damage.DamageItems.Bilgewater);
break;
case ItemId.Blade_of_the_Ruined_King:
itemsDamage += (float) player.GetItemDamage(hero, Damage.DamageItems.Botrk);
break;
case ItemId.Hextech_Gunblade:
itemsDamage += (float) player.GetItemDamage(hero, Damage.DamageItems.Hexgun);
break;
case ItemId.Frost_Queens_Claim:
itemsDamage +=
(float) player.GetItemDamage(hero, Damage.DamageItems.FrostQueenClaim);
break;
case ItemId.Tiamat_Melee_Only:
itemsDamage += player.IsMelee
? (float) player.GetItemDamage(hero, Damage.DamageItems.Tiamat)
: 0f;
break;
case ItemId.Ravenous_Hydra_Melee_Only:
itemsDamage += player.IsMelee
? (float) player.GetItemDamage(hero, Damage.DamageItems.Hydra)
: 0f;
break;
case ItemId.Liandrys_Torment:
itemsDamage +=
(float) player.GetItemDamage(hero, Damage.DamageItems.LiandrysTorment);
break;
}
}
}
var totalDamage = AADamage + QDamage + WDamage + EDamage + RDamage + itemsDamage;
return (float) totalDamage / totalEnemies;
}