本文整理汇总了C#中Weapon.IsWeapon方法的典型用法代码示例。如果您正苦于以下问题:C# Weapon.IsWeapon方法的具体用法?C# Weapon.IsWeapon怎么用?C# Weapon.IsWeapon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weapon
的用法示例。
在下文中一共展示了Weapon.IsWeapon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
// Initializes structures.
public static void Initialize(SkillTree skillTree, ItemAttributes itemAttrs)
{
Items = itemAttrs.Equip.ToList();
MainHand = new Weapon(WeaponHand.Main, Items.Find(i => i.Class == ItemClass.MainHand));
OffHand = new Weapon(WeaponHand.Off, Items.Find(i => i.Class == ItemClass.OffHand));
// If main hand weapon has Counts as Dual Wielding modifier, then clone weapon to off hand.
// @see http://pathofexile.gamepedia.com/Wings_of_Entropy
if (MainHand.Attributes.ContainsKey("Counts as Dual Wielding"))
OffHand = MainHand.Clone(WeaponHand.Off);
IsDualWielding = MainHand.IsWeapon() && OffHand.IsWeapon();
if (IsDualWielding)
{
// Set dual wielded bit on weapons.
MainHand.Hand |= WeaponHand.DualWielded;
OffHand.Hand |= WeaponHand.DualWielded;
}
IsWieldingShield = MainHand.Is(WeaponType.Shield) || OffHand.Is(WeaponType.Shield);
IsWieldingStaff = MainHand.Is(WeaponType.Staff);
Level = skillTree.Level;
if (Level < 1) Level = 1;
else if (Level > 100) Level = 100;
Global = new AttributeSet();
Tree = new AttributeSet(skillTree.SelectedAttributesWithoutImplicit);
Global.Add(Tree);
// Keystones.
Acrobatics = Tree.ContainsKey("#% Chance to Dodge Attacks. #% less Armour and Energy Shield, #% less Chance to Block Spells and Attacks");
AvatarOfFire = Tree.ContainsKey("Deal no Non-Fire Damage");
BloodMagic = Tree.ContainsKey("Removes all mana. Spend Life instead of Mana for Skills");
ChaosInoculation = Tree.ContainsKey("Maximum Life becomes #, Immune to Chaos Damage");
IronGrip = Tree.ContainsKey("The increase to Physical Damage from Strength applies to Projectile Attacks as well as Melee Attacks");
IronReflexes = Tree.ContainsKey("Converts all Evasion Rating to Armour. Dexterity provides no bonus to Evasion Rating");
NecromanticAegis = Tree.ContainsKey("All bonuses from an equipped Shield apply to your Minions instead of you");
ResoluteTechnique = Tree.ContainsKey("Never deal Critical Strikes");
VaalPact = Tree.ContainsKey("Life Leech applies instantly at #% effectiveness. Life Regeneration has no effect.");
ZealotsOath = Tree.ContainsKey("Life Regeneration applies to Energy Shield instead of Life");
Equipment = new AttributeSet();
foreach (ItemAttributes.Attribute attr in itemAttrs.NonLocalMods)
Equipment.Add(attr.TextAttribute, new List<float>(attr.Value));
if (NecromanticAegis && OffHand.IsShield())
{
// Remove all bonuses of shield from equipment set.
// @see http://pathofexile.gamepedia.com/Necromantic_Aegis
foreach (var attr in OffHand.Attributes)
Equipment.Remove(attr);
// Remove all bonuses from shield itself.
OffHand.Attributes.Clear();
}
Global.Add(Equipment);
CoreAttributes();
Implicit = new AttributeSet(SkillTree.ImplicitAttributes(Global, Level));
Global.Add(Implicit);
// Innate dual wielding bonuses.
// @see http://pathofexile.gamepedia.com/Dual_wielding
if (IsDualWielding)
{
Global["#% more Attack Speed"] = new List<float>() { 10 };
Global["#% more Physical Damage with Weapons"] = new List<float>() { 20 };
}
}
示例2: CanUse
// Returns true if skill can be used with weapon.
public bool CanUse(Weapon weapon)
{
return (weapon.IsWeapon() || weapon.IsUnarmed()) && Nature.Is(weapon.Nature.WeaponType) && ItemDB.CanUse(Gem, weapon);
}