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


C# Player.setAntifireCycles方法代码示例

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


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

示例1: resetVariables

	    private void resetVariables(Player p) {
		    p.setSkullCycles(0);
		    p.getSpecialAttack().resetSpecial();
		    p.setLastkiller(null);
		    p.setDead(false);
		    p.setEntityFocus(65535);
		    p.setPoisonAmount(0);
		    p.clearKillersHits();
		    p.setLastVengeanceTime(0);
		    p.setVengeance(false);
		    p.removeTemporaryAttribute("willDie");
		    p.setFrozen(false);
		    p.removeTemporaryAttribute("unmovable");
		    p.setAntifireCycles(0);
		    p.setSuperAntipoisonCycles(0);
		    p.setTeleblockTime(0);
		    p.removeTemporaryAttribute("teleblocked");
		    p.setTarget(null);
		    p.setAttacker(null);
            foreach (Skills.SKILL skill in Enum.GetValues(typeof(Skills.SKILL)))
                p.getSkills().setCurLevel(skill, p.getSkills().getMaxLevel(skill));
		    p.getPackets().sendSkillLevels();
		    Prayer.deactivateAllPrayers(p);
		    if (p.getTemporaryAttribute("cantDoAnything") != null) {
			    p.getAppearance().setInvisible(false);
			    p.getUpdateFlags().setAppearanceUpdateRequired(true);
			    p.removeTemporaryAttribute("cantDoAnything");
			    p.removeTemporaryAttribute("unmovable");
			    teleportToWaitingRoom(p, false);
			    p.getPackets().closeInterfaces();
			    p.getPackets().setMinimapStatus(0);
			    p.getPackets().clearMapFlag();
		    }
	    }
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:34,代码来源:FightPits.cs

示例2: drinkPotion


//.........这里部分代码省略.........
						
					case 6: //Agility potion [restores 2 or 3 agility points]
                        int newAgility = misc.random(2, 3) + p.getSkills().getCurLevel(Skills.SKILL.AGILITY);
                        if (newAgility < p.getSkills().getMaxLevel(Skills.SKILL.AGILITY))
                            p.getSkills().setCurLevel(Skills.SKILL.AGILITY, newAgility);
						break;
						
					case 7: //Combat potion [Should be 10% of attack+strength and +3 to each].
                        statBoost(p, Skills.SKILL.ATTACK, 0.10, 3, false);
                        statBoost(p, Skills.SKILL.STRENGTH, 0.10, 3, false);
						break;
						
					case 8: //Prayer potion, [heals 7-31, formula = 7+floor(prayerlevel/4)]
                        int newPrayer = 7 + (int)Math.Floor((double)(p.getSkills().getMaxLevel(Skills.SKILL.PRAYER) / 4)) + p.getSkills().getCurLevel(Skills.SKILL.PRAYER);
                        if (newPrayer < p.getSkills().getCurLevel(Skills.SKILL.PRAYER))
                            p.getSkills().setCurLevel(Skills.SKILL.PRAYER, newPrayer);
                        checkOverdose(p, Skills.SKILL.PRAYER);
						break;
						
					case 9: //Summoning potion [25% of players summoning + 7]
                        int newSummoning = (7 + (int)((double)p.getSkills().getMaxLevel(Skills.SKILL.SUMMONING) * 0.25)) + p.getSkills().getCurLevel(Skills.SKILL.SUMMONING);
                        if (newSummoning < p.getSkills().getCurLevel(Skills.SKILL.SUMMONING))
                            p.getSkills().setCurLevel(Skills.SKILL.SUMMONING, newSummoning);

                        statBoost(p, Skills.SKILL.STRENGTH, 0.10, 3, false);
						break;
						
					case 10: //Super attack potion [15% of players attack + 5]
                        statBoost(p, Skills.SKILL.ATTACK, 0.15, 5, false);
						break;
						
					case 11: // super antipoison
						p.setPoisonAmount(0);
						p.setSuperAntipoisonCycles(20);
						break;
						
					case 12: //Fishing potion [fishing +3]
                        if (p.getSkills().getCurLevel(Skills.SKILL.FISHING) < (p.getSkills().getMaxLevel(Skills.SKILL.FISHING) + 3))
                            p.getSkills().setCurLevel(Skills.SKILL.FISHING, p.getSkills().getCurLevel(Skills.SKILL.FISHING) + 3);
						break;
						
					case 13:
						p.setRunEnergy(p.getRunEnergy() + 20);
						if (p.getRunEnergy() >= 100) {
							p.setRunEnergy(100);
						}
						break;
						
					case 14: //Hunter potion [hunting + 3]
                        if (p.getSkills().getCurLevel(Skills.SKILL.HUNTER) < (p.getSkills().getMaxLevel(Skills.SKILL.HUNTER) + 3))
                            p.getSkills().setCurLevel(Skills.SKILL.HUNTER, p.getSkills().getCurLevel(Skills.SKILL.HUNTER) + 3);
						break;
						
					case 15: //Super strength [strength 15% +5]
						statBoost(p, Skills.SKILL.STRENGTH, 0.15, 5, false);
						break;
						
					case 16: //restores all skills by 33%.
                        foreach (Skills.SKILL skill in Enum.GetValues(typeof(Skills.SKILL)))
                            superRestorePotion(p, skill, 0.33);
						break;

                    case 17://Super defence [defence 15% +5]
						statBoost(p, Skills.SKILL.DEFENCE, 0.15, 5, false);
						break;
						
					case 18: // Antifire potion
						p.setAntifireCycles(20);
						break;

                    case 19: //Ranging potions
						statBoost(p, Skills.SKILL.RANGE, 0.10, 4, false);
						break;
						
					case 20: //Magic potion.
                        if (p.getSkills().getCurLevel(Skills.SKILL.MAGIC) < (p.getSkills().getMaxLevel(Skills.SKILL.MAGIC) + 4))
                            p.getSkills().setCurLevel(Skills.SKILL.MAGIC, p.getSkills().getCurLevel(Skills.SKILL.MAGIC) + 4);
						break;
						
					case 21: //Zamorak brew potion. [Attack %20+2][Strength %12 +2][Defense -10% + -2][hitpoints -10% + 20]
                        statBoost(p, Skills.SKILL.ATTACK, 0.20, 2, false);
                        statBoost(p, Skills.SKILL.STRENGTH, 0.12, 2, false);
                        statBoost(p, Skills.SKILL.DEFENCE, 0.10, 2, true);
                        statBoost(p, Skills.SKILL.HITPOINTS, 0.10, 20, true);
						break;

                    case 22: //Saradomin brew potion. [Hitpoints +%15][Defense +25%][Strength, Attack, Magic and Ranged -10%]
                        statBoost(p, Skills.SKILL.HITPOINTS, 0.15, 0, false);
                        statBoost(p, Skills.SKILL.DEFENCE, 0.25, 0, false);
                        statBoost(p, Skills.SKILL.STRENGTH, 0.10, 0, true);
                        statBoost(p, Skills.SKILL.ATTACK, 0.10, 0, true);
                        statBoost(p, Skills.SKILL.MAGIC, 0.10, 0, true);
                        statBoost(p, Skills.SKILL.RANGE, 0.10, 0, true);
						break;
				}
				p.setLastAnimation(new Animation(829));
				p.getPackets().sendSkillLevels();
		    });
            Server.registerEvent(drinkPotionEvent);
	    }		
开发者ID:slapglif,项目名称:runescape-server-csharp,代码行数:101,代码来源:Consumables.cs


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