本文整理汇总了C#中EquipmentSlot类的典型用法代码示例。如果您正苦于以下问题:C# EquipmentSlot类的具体用法?C# EquipmentSlot怎么用?C# EquipmentSlot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EquipmentSlot类属于命名空间,在下文中一共展示了EquipmentSlot类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CanBeEquippedInSlot
/// <summary>
/// not used in this game
/// </summary>
/// <param name="slot"></param>
/// <returns></returns>
public bool CanBeEquippedInSlot(EquipmentSlot slot)
{
if (slot == EquipmentSlot.RightHand)
return true;
return false;
}
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:12,代码来源:Dagger.cs
示例2: SendSlotUpdate
/// <summary>
/// When overridden in the derived class, notifies the owner of this object instance
/// that an equipment slot has changed.
/// </summary>
/// <param name="slot">The slot that changed.</param>
/// <param name="graphicIndex">The new graphic index of the slot.</param>
protected override void SendSlotUpdate(EquipmentSlot slot, GrhIndex? graphicIndex)
{
using (var msg = ServerPacket.UpdateEquipmentSlot(slot, graphicIndex))
{
User.Send(msg, ServerMessageType.GUIItems);
}
}
开发者ID:wtfcolt,项目名称:game,代码行数:13,代码来源:UserEquipped.cs
示例3: CreateItemSlots
void CreateItemSlots(int row, int column, EquipmentSlot slot)
{
var loc = new Vector2(row, column);
var pos = _itemSize * loc;
new EquippedItemPB(this, pos, slot);
}
开发者ID:mateuscezar,项目名称:netgore,代码行数:7,代码来源:EquippedForm.cs
示例4: CanBeEquippedInSlot
/// <summary>
/// not used in this game
/// </summary>
/// <param name="slot"></param>
/// <returns></returns>
public bool CanBeEquippedInSlot(EquipmentSlot slot)
{
if (slot == EquipmentSlot.Weapon)
return true;
return false;
}
开发者ID:Sinellil,项目名称:roguelike-cs,代码行数:12,代码来源:HealingPotion.cs
示例5: ISWeapon
public ISWeapon()
{
_minDamage = 0;
_durability = 1;
_maxDurability = 100;
equipmentSlot = EquipmentSlot.Hands;
}
开发者ID:mnapier,项目名称:ItemSystem,代码行数:8,代码来源:ISWeapon.cs
示例6: ISArmor
public ISArmor()
{
_curArmor = 0;
_maxArmor = 100;
_durability = 1;
_maxDurability = 100;
equipmentSlot = EquipmentSlot.Torso;
}
开发者ID:mnapier,项目名称:ItemSystem,代码行数:9,代码来源:ISArmor.cs
示例7: ISWeapon
public ISWeapon()
{
_minDamage = 0;
_durability = 1;
_maxDurability = 1;
_prefab = null;
equipmentSlot = EquipmentSlot.Weapon;
}
开发者ID:darianwiccan,项目名称:UnityGame,代码行数:9,代码来源:ISWeapon.cs
示例8: EquipItem
private void EquipItem(EquipmentSlot part, int uid)
{
if (!IsEmpty(part))
// Uh oh we are confused about something! But it's better to just do what the server says
{
UnEquipItem(part);
}
EquippedEntities.Add(part, Owner.EntityManager.GetEntity(uid));
}
开发者ID:millpond,项目名称:space-station-14,代码行数:9,代码来源:EquipmentComponent.cs
示例9: ISArmor
public ISArmor()
{
_curArmor = 0;
_maxArmor = 0;
_durability = 1;
_maxDurability = 1;
equipmentSlot = EquipmentSlot.Chest;
}
开发者ID:darianwiccan,项目名称:UnityGame,代码行数:9,代码来源:ISArmor.cs
示例10: Get
// TODO: remove method
public Item Get(EquipmentSlot slot)
{
Item result;
if (TryGet(slot, out result))
{
return result;
}
return null;
}
开发者ID:ephe-meral,项目名称:gw-interface,代码行数:11,代码来源:Equipment.cs
示例11: SetParameter
public override void SetParameter(ComponentParameter parameter)
{
base.SetParameter(parameter);
switch (parameter.MemberName)
{
case "wearloc":
wearloc = (EquipmentSlot) Enum.Parse(typeof (EquipmentSlot), parameter.GetValue<string>());
break;
}
}
开发者ID:Gartley,项目名称:ss13remake,代码行数:11,代码来源:EquippableComponent.cs
示例12: GetDefault
/// <summary>
/// Returns a default item that can be equipped to the given slot
/// </summary>
public ItemTemplate GetDefault(EquipmentSlot slot)
{
var template = m_defaultItemTemplates[(int)slot];
if (template == null)
{
Setup.EnsureItemsLoaded();
foreach (var temp in ItemMgr.Templates)
{
if (temp != null && temp.EquipmentSlots.Contains(slot))
{
m_defaultItemTemplates[(int)slot] = template = temp;
}
}
}
Assert.IsNotNull(template);
return template;
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:21,代码来源:ItemPool.cs
示例13: SetCharacter
private void SetCharacter()
{
//are we looking for player or npc?
if (CharacterID == 0)
{
GameObject player = GameObject.Find("Player");
if (player != null)
{
Transform childPart = player.transform.FindChild(slotName);
if (childPart != null)
{
equipmentSlot = childPart.GetComponent<EquipmentSlot>();
}
}
}
//TODO (Jukki) NPC previews? Party members
}
开发者ID:thyjukki,项目名称:Rebelion,代码行数:19,代码来源:EquipmentPreview.cs
示例14: EquippedBy
private void EquippedBy(int uid, EquipmentSlot wearloc)
{
Owner.SendMessage(this, ComponentMessageType.ItemEquipped);
Owner.AddComponent(ComponentFamily.Mover,
Owner.EntityManager.ComponentFactory.GetComponent("SlaveMoverComponent"));
Owner.SendMessage(this, ComponentMessageType.SlaveAttach, uid);
switch (wearloc)
{
case EquipmentSlot.Back:
SendDrawDepth(DrawDepth.MobOverAccessoryLayer);
break;
case EquipmentSlot.Belt:
SendDrawDepth(DrawDepth.MobUnderAccessoryLayer);
break;
case EquipmentSlot.Ears:
SendDrawDepth(DrawDepth.MobUnderAccessoryLayer);
break;
case EquipmentSlot.Eyes:
SendDrawDepth(DrawDepth.MobUnderAccessoryLayer);
break;
case EquipmentSlot.Feet:
SendDrawDepth(DrawDepth.MobUnderClothingLayer);
break;
case EquipmentSlot.Hands:
SendDrawDepth(DrawDepth.MobOverAccessoryLayer);
break;
case EquipmentSlot.Head:
SendDrawDepth(DrawDepth.MobOverClothingLayer);
break;
case EquipmentSlot.Inner:
SendDrawDepth(DrawDepth.MobUnderClothingLayer);
break;
case EquipmentSlot.Mask:
SendDrawDepth(DrawDepth.MobUnderAccessoryLayer);
break;
case EquipmentSlot.Outer:
SendDrawDepth(DrawDepth.MobOverClothingLayer);
break;
}
}
开发者ID:Gartley,项目名称:ss13remake,代码行数:40,代码来源:EquippableComponent.cs
示例15: EquipmentSlotUi
public EquipmentSlotUi(EquipmentSlot slot, IPlayerManager playerManager, IResourceManager resourceManager,
IUserInterfaceManager userInterfaceManager)
{
_playerManager = playerManager;
_resourceManager = resourceManager;
_userInterfaceManager = userInterfaceManager;
_color = Color.White;
AssignedSlot = slot;
_buttonSprite = _resourceManager.GetSprite("slot");
_textSprite = new TextSprite(slot + "UIElementSlot", slot.ToString(),
_resourceManager.GetFont("CALIBRI"))
{
ShadowColor = Color.Black,
ShadowOffset = new Vector2D(1, 1),
Shadowed = true,
Color = Color.White
};
Update(0);
}
开发者ID:Gartley,项目名称:ss13remake,代码行数:22,代码来源:EquipmentSlotUi.cs
示例16: HandleHand
void HandleHand(EquipmentSlot slot, bool down, bool interact)
{
if (slot.occupied) {
var item = slot.item;
if (down && interact && item.CanUnequip(slot)) {
slot.Unequip();
item.OnDrop();
item.GetComponent<Rigidbody>().AddForce(
(Vector3.up + _camera.transform.forward) * 200.0f);
}
} else if (down) {
Item highlightedItem = null;
var pos = slot.attachment.transform.position;
var distance = pickupRange;
var colliders = Physics.OverlapSphere(pos, pickupRange);
foreach (var col in colliders) {
var item = col.GetComponentInParent<Item>();
if ((item == null) || item.equipped ||
!item.CanEquip(slot)) continue;
var dis = Vector3.Distance(pos, col.ClosestPointOnBounds(pos));
if (dis <= distance) {
highlightedItem = item;
distance = dis;
}
}
if (highlightedItem != null) {
highlightedItem.highlighted = true;
if (interact) {
highlightedItem.OnPickup();
slot.Equip(highlightedItem);
}
}
}
}
开发者ID:copygirl,项目名称:Immersion,代码行数:39,代码来源:PickupController.cs
示例17: CharacterEquippedTable
/// <summary>
/// Initializes a new instance of the <see cref="CharacterEquippedTable"/> class.
/// </summary>
/// <param name="characterID">The initial value for the corresponding property.</param>
/// <param name="itemID">The initial value for the corresponding property.</param>
/// <param name="slot">The initial value for the corresponding property.</param>
public CharacterEquippedTable(CharacterID @characterID, ItemID @itemID, EquipmentSlot @slot)
{
CharacterID = @characterID;
ItemID = @itemID;
Slot = @slot;
}
开发者ID:Vizzini,项目名称:netgore,代码行数:12,代码来源:CharacterEquippedTable.cs
示例18: Init2
/// <summary>
/// For all things that depend on info of all spells from first Init-round and other things
/// </summary>
internal void Init2()
{
if (inited)
{
return;
}
inited = true;
IsChanneled = AttributesEx.HasAnyFlag(SpellAttributesEx.Channeled_1 | SpellAttributesEx.Channeled_2) || // don't use Enum.HasFlag!
ChannelInterruptFlags > 0;
IsPassive = (!IsChanneled && Attributes.HasFlag(SpellAttributes.Passive)) ||
// tracking spells are also passive
HasEffectWith(effect => effect.AuraType == AuraType.TrackCreatures) ||
HasEffectWith(effect => effect.AuraType == AuraType.TrackResources) ||
HasEffectWith(effect => effect.AuraType == AuraType.TrackStealthed);
foreach (var effect in Effects)
{
effect.Init2();
if (effect.IsHealEffect)
{
IsHealSpell = true;
}
if (effect.EffectType == SpellEffectType.NormalizedWeaponDamagePlus)
{
IsDualWieldAbility = true;
}
}
InitAura();
if (IsChanneled)
{
if (Durations.Min == 0)
{
Durations.Min = Durations.Max = 1000;
}
foreach (var effect in Effects)
{
if (effect.IsPeriodic)
{
ChannelAmplitude = effect.Amplitude;
break;
}
}
}
IsOnNextStrike = Attributes.HasAnyFlag(SpellAttributes.OnNextMelee | SpellAttributes.OnNextMelee_2); // don't use Enum.HasFlag!
IsRangedAbility = !IsTriggeredSpell &&
(Attributes.HasAnyFlag(SpellAttributes.Ranged) ||
AttributesExC.HasFlag(SpellAttributesExC.ShootRangedWeapon));
IsStrikeSpell = HasEffectWith(effect => effect.IsStrikeEffect);
IsWeaponAbility = IsRangedAbility || IsOnNextStrike || IsStrikeSpell;
DamageIncreasedByAP = DamageIncreasedByAP || (PowerType == PowerType.Rage && SchoolMask == DamageSchoolMask.Physical);
IsFinishingMove =
AttributesEx.HasAnyFlag(SpellAttributesEx.FinishingMove) ||
HasEffectWith(effect => effect.PointsPerComboPoint > 0 && effect.EffectType != SpellEffectType.Dummy);
TotemEffect = GetFirstEffectWith(effect => effect.HasTarget(
ImplicitTargetType.TotemAir, ImplicitTargetType.TotemEarth, ImplicitTargetType.TotemFire, ImplicitTargetType.TotemWater));
// Required Item slot for weapon abilities
if (RequiredItemClass == ItemClass.Armor && RequiredItemSubClassMask == ItemSubClassMask.Shield)
{
EquipmentSlot = EquipmentSlot.OffHand;
}
else
{
EquipmentSlot =
(IsRangedAbility || AttributesExC.HasFlag(SpellAttributesExC.RequiresWand)) ? EquipmentSlot.ExtraWeapon :
(AttributesExC.HasFlag(SpellAttributesExC.RequiresOffHandWeapon) ? EquipmentSlot.OffHand :
(AttributesExC.HasFlag(SpellAttributesExC.RequiresMainHandWeapon) ? EquipmentSlot.MainHand : EquipmentSlot.End));
}
HasIndividualCooldown = CooldownTime > 0 ||
(IsWeaponAbility && !IsOnNextStrike && EquipmentSlot != EquipmentSlot.End);
//IsAoe = HasEffectWith((effect) => {
// if (effect.ImplicitTargetA == ImplicitTargetType.)
// effect.ImplicitTargetA = ImplicitTargetType.None;
// if (effect.ImplicitTargetB == ImplicitTargetType.Unused_EnemiesInAreaChanneledWithExceptions)
// effect.ImplicitTargetB = ImplicitTargetType.None;
// return false;
//});
var profEffect = GetEffect(SpellEffectType.SkillStep);
if (profEffect != null)
{
TeachesApprenticeAbility = profEffect.BasePoints == 0;
}
//.........这里部分代码省略.........
开发者ID:WCellFR,项目名称:WCellFR,代码行数:101,代码来源:Spell.cs
示例19: TryAdd
/// <summary>
/// Tries to add a single new item with the given template to the given slot.
/// Make sure the given targetSlot is valid before calling this method.
/// </summary>
public InventoryError TryAdd(ItemTemplate template, EquipmentSlot targetSlot)
{
var amount = 1;
return TryAdd(template, ref amount, (int)targetSlot, true);
}
开发者ID:NVN,项目名称:WCell,代码行数:9,代码来源:PlayerInventory.cs
示例20: EnsureEmpty
/// <summary>
/// Checks if the given slot is occupied and -if so- puts the item from that slot into a free
/// storage slot (within the backpack or any equipped bags).
/// </summary>
/// <returns>whether the given slot is now empty</returns>
public bool EnsureEmpty(EquipmentSlot slot)
{
var item = this[slot];
if (item == null)
{
return true;
}
var newSlotId = FindFreeSlot(item, item.Amount);
if (newSlotId.Slot == INVALID_SLOT)
{
// no space left
return false;
}
SwapUnchecked(this, (int)slot, newSlotId.Container, newSlotId.Slot);
return true;
}
开发者ID:NVN,项目名称:WCell,代码行数:23,代码来源:PlayerInventory.cs
注:本文中的EquipmentSlot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论