本文整理汇总了C#中Item.IsEquipped方法的典型用法代码示例。如果您正苦于以下问题:C# Item.IsEquipped方法的具体用法?C# Item.IsEquipped怎么用?C# Item.IsEquipped使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.IsEquipped方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTarget
protected void OnTarget(Mobile m, Item item)
{
if (!this.CheckDoubleClick(m, true, false, 2, true) || item == null || item.Deleted || _Target == null ||
_Target.User != m)
{
return;
}
if (!_LayerableTypes.Any(t => item.TypeEquals(t)))
{
m.SendMessage(34, "You can not layer that item.");
return;
}
if (item.Layer == TargetLayer)
{
m.SendMessage(34, "That sash is already layered.");
return;
}
if (item.RootParent != m)
{
m.SendMessage(34, "That sash must be equipped or in your pack to layer it.");
return;
}
if (item.IsEquipped())
{
var otherItem = m.FindItemOnLayer(TargetLayer);
if (otherItem != null)
{
m.SendMessage(
34,
"You must unequip the {0} in your {1} slot before you can layer that sash.",
otherItem.ResolveName(m),
TargetLayer.ToString().ToLower());
return;
}
}
item.Layer = TargetLayer;
if (String.IsNullOrWhiteSpace(item.Name))
{
item.Name = "a body sash [Layered]";
}
else if (!item.Name.EndsWith(" [Layered]"))
{
item.Name += " [Layered]";
}
m.SendMessage(85, "You successfully layer the sash!");
Delete();
}
示例2: GetProperties
private static void GetProperties(Item item, Mobile viewer, ExtendedOPL list)
{
if (!CMOptions.ModuleEnabled || item == null || item.Deleted || !item.Layer.IsEquip() || list == null ||
World.Loading)
{
return;
}
if (viewer == null && item.Parent is Mobile)
{
viewer = (Mobile)item.Parent;
}
if (viewer == null || !viewer.Player)
{
return;
}
var itemType = item.GetType();
var equipped = item.IsEquipped();
var parent = item.Parent as Mobile;
var npc = parent != null && ((parent is BaseCreature || !parent.Player) && !parent.IsControlled<PlayerMobile>());
foreach (var set in
FindSetsFor(itemType)
.Where(s => s.Display && !s.Parts.Any(p => p.Valid && p.Display && p.IsTypeOf(itemType) && !p.DisplaySet)))
{
set.GetProperties(viewer, list, equipped);
if (npc)
{
continue;
}
if (set.DisplayParts)
{
foreach (var part in set.Parts.Where(p => p.Valid && p.Display))
{
part.GetProperties(viewer, list, equipped);
}
}
if (!set.DisplayMods)
{
continue;
}
foreach (var mod in set.Mods.Where(mod => mod.Valid && mod.Display))
{
mod.GetProperties(viewer, list, equipped);
}
}
}
示例3: GetProperties
private static void GetProperties(Item item, Mobile viewer, ExtendedOPL list)
{
if (!CMOptions.ModuleEnabled || item == null || item.Deleted || !item.Layer.IsEquip() || list == null)
{
return;
}
if (viewer == null && item.Parent is Mobile)
{
viewer = (Mobile)item.Parent;
}
if (viewer == null)
{
return;
}
Type itemType = item.GetType();
bool equipped = item.IsEquipped();
foreach (EquipmentSet set in
FindSetsFor(itemType)
.Where(s => s.Display && !s.Parts.Any(p => p.Valid && p.Display && p.IsTypeOf(itemType) && !p.DisplaySet)))
{
set.GetProperties(viewer, list, equipped);
if (set.DisplayParts)
{
foreach (EquipmentSetPart part in set.Parts.Where(p => p.Valid && p.Display))
{
part.GetProperties(viewer, list, equipped);
}
}
if (!set.DisplayMods)
{
continue;
}
foreach (EquipmentSetMod mod in set.Mods.Where(mod => mod.Valid && mod.Display))
{
mod.GetProperties(viewer, list, equipped);
}
}
}