当前位置: 首页>>代码示例>>C#>>正文


C# Player.getEquipment方法代码示例

本文整理汇总了C#中Player.getEquipment方法的典型用法代码示例。如果您正苦于以下问题:C# Player.getEquipment方法的具体用法?C# Player.getEquipment怎么用?C# Player.getEquipment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.getEquipment方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: hasPickaxe

 public static bool hasPickaxe(Player p)
 {
     for (int i = 0; i < PICKAXES.Length; i++) {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == PICKAXES[i] || p.getInventory().hasItem(PICKAXES[i]))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:10,代码来源:Mining.cs

示例2: wearingForgingRing

 private static bool wearingForgingRing(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.RING) == 2568;
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:4,代码来源:Smelting.cs

示例3: lowerForgingRing

 private static void lowerForgingRing(Player p)
 {
     p.setForgeCharge(p.getForgeCharge() - 1);
     if (p.getForgeCharge() <= 0) {
         p.setForgeCharge(40);
         p.getPackets().sendMessage("Your Ring of forging has shattered!");
         p.getEquipment().getSlot(ItemData.EQUIP.RING).setItemId(-1);
         p.getEquipment().getSlot(ItemData.EQUIP.RING).setItemAmount(0);
         p.getPackets().refreshEquipment();
     }
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:11,代码来源:Smelting.cs

示例4: getUsedAxe

 public static int getUsedAxe(Player p)
 {
     int index = -1;
     for (int i = 0; i < AXES.Length; i++) {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == AXES[i] || p.getInventory().hasItem(AXES[i])) {
             index = i;
         }
     }
     return index;
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:10,代码来源:Woodcutting.cs

示例5: setAutoCastSpell

 public static void setAutoCastSpell(Player p, int spell, int spellIndex, bool ancients)
 {
     p.getPackets().modifyText(AUTOCAST_NAME[spell], 90, 11);
     p.getPackets().showChildInterface(90, 83, false);
     p.getPackets().showChildInterface(90, AUTOCAST_CONFIG[spell], true);
     p.getPackets().sendConfig(43, 3);
     p.getPackets().sendTab(83, 90);
     p.getPackets().modifyText(p.getEquipment().getSlot(ItemData.EQUIP.WEAPON).getDefinition().getName(), 90, 0);
     p.setTemporaryAttribute("autoCastSpell", spellIndex);
     p.setTemporaryAttribute("autoCastSpell2", spell);
     if (ancients)
     {
         p.setTemporaryAttribute("autoCastAncients", ancients);
     }
     else
     {
         p.removeTemporaryAttribute("autoCastAncients");
     }
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:19,代码来源:MagicData.cs

示例6: configureSelectSpellInterface

 public static void configureSelectSpellInterface(Player p)
 {
     p.removeTemporaryAttribute("autoCasting");
     if (p.getMagicType() == 1)
     {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4170)
         { // Slayer staff.
             p.getPackets().sendTab(83, 310);
             return;
         }
         else if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 8841)
         { // Void knight mace.
             p.getPackets().sendTab(83, 406);
             return;
         }
         else
         {
             p.getPackets().sendTab(83, 319);
         }
     }
     else if (p.getMagicType() == 2)
     {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 4675)
         { // Ancient staff.
             p.getPackets().sendTab(83, 388);
         }
         else
         {
             p.getPackets().sendMessage("You cannot autocast Ancient Magic with this staff.");
         }
     }
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:32,代码来源:MagicData.cs

示例7: checkForStaffs

 public static int checkForStaffs(Player p, int rune)
 {
     for (int i = 0; i < RUNE_REPLACER.Length; i++)
     {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == RUNE_REPLACER[i])
         {
             if (rune == REPLACABLE_RUNES[i])
             {
                 rune = -1;
                 break;
             }
         }
     }
     return rune;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:15,代码来源:MagicData.cs

示例8: cancelAutoCast

 public static void cancelAutoCast(Player p, bool cancelCast)
 {
     if (cancelCast)
     {
         p.getEquipment().setWeapon();
         //p.getPackets().sendConfig(43, 0);
         resetSpellIcon(p);
         p.removeTemporaryAttribute("autoCastSpell");
         p.removeTemporaryAttribute("autoCastAncients");
         p.getPackets().showChildInterface(90, 83, true);
         p.getPackets().modifyText("Spell", 90, 11);
         return;
     }
     if (p.getTemporaryAttribute("autoCastSpell") != null)
     {
         setAutoCastSpell(p, (int)p.getTemporaryAttribute("autoCastSpell2"), (int)p.getTemporaryAttribute("autoCastSpell"), (bool)(p.getTemporaryAttribute("autoCastAncients") != null ? true : false));
     }
     else
     {
         //p.getPackets().sendConfig(43, 0);
         resetSpellIcon(p);
         p.getEquipment().setWeapon();
         p.getPackets().showChildInterface(90, 83, true);
         p.getPackets().modifyText("Spell", 90, 11);
         p.removeTemporaryAttribute("autoCastSpell");
         p.removeTemporaryAttribute("autoCastAncients");
         p.removeTemporaryAttribute("autoCastSpell2");
     }
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:29,代码来源:MagicData.cs

示例9: getUsedPickaxe

 private static int getUsedPickaxe(Player p)
 {
     int index = -1;
     for (int i = 0; i < PICKAXES.Length; i++)
     {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == PICKAXES[i] || p.getInventory().hasItem(PICKAXES[i]))
         {
             index = i;
         }
     }
     return index;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:12,代码来源:Mining.cs

示例10: getGemChance

 private static int getGemChance(Player p)
 {
     for (int i = 0; i < GLORY_AMULETS.Length; i++)
     {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.AMULET) == GLORY_AMULETS[i])
         {
             return 30;
         }
     }
     return 40;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:11,代码来源:Mining.cs

示例11: startPrayerDrainEvent

 public static void startPrayerDrainEvent(Player p)
 {
     Event prayerDrainEvent = new Event(600);
     prayerDrainEvent.setAction(() => {
         if (p == null || p.isDead() || !isPrayerActive(p)) {
             prayerDrainEvent.stop();
             return;
         }
         double amountDrain = 0.0;
         foreach (Prayer prayer in Enum.GetValues(typeof(Prayer)))
         {
             if(p.getPrayers().isPrayerActive(prayer)) {
                 double drain = DRAIN_RATE[(int)prayer];
                 double bonus = (0.035 * p.getEquipment().getBonus(Equipment.BONUS.PRAYER));
                 drain = drain * (1 + bonus);
                 drain = 0.6 / drain;
                 amountDrain += drain;
             }
         }
         p.decreasePrayerPoints(amountDrain);
         if(p.getSkills().getCurLevel(Skills.SKILL.PRAYER) <= 0)
             prayerDrainEvent.stop();
     });
     Server.registerEvent(prayerDrainEvent);
 }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:25,代码来源:Prayer.cs

示例12: wearingCookingGauntlets

 private static bool wearingCookingGauntlets(Player p)
 {
     return p.getEquipment().getItemInSlot(ItemData.EQUIP.HANDS) == COOKING_GAUNTLETS;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:4,代码来源:Cooking.cs

示例13: wearingTiara

 public static bool wearingTiara(Player p)
 {
     for (int i = 0; i < TIARAS.Length; i++)
     {
         if (p.getEquipment().getItemInSlot(ItemData.EQUIP.HAT) == TIARAS[i])
         {
             return true;
         }
     }
     return false;
 }
开发者ID:ramatronics,项目名称:rsps,代码行数:11,代码来源:RuneCraft.cs


注:本文中的Player.getEquipment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。