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


C# Player.setCombatTurns方法代码示例

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


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

示例1: newMagicAttack


//.........这里部分代码省略.........
            if (target is Player) {
                mp = ((Player) target).getPrayers().getHeadIcon() == PrayerData.MAGIC;
            }
            if (magicProtect) {
                damage *= 0.60;
            }
            if (p.getEquipment().getItemInSlot(ItemData.EQUIP.WEAPON) == 8841) {
                damage *= 1.10; // void mace 10% hit increase.
            }
            if (damage == 0 && index != 41 && index != 42 && index != 43 && index != 44 && index != 45 && index != 46 && index != 47) {
                endGfx = 85;
            }
            if (!deleteRunes(p, RUNES[index], RUNE_AMOUNTS[index])) {
                p.setTarget(null);
                return;
            }
            p.getFollow().setFollowing(null);
            p.getWalkingQueue().resetWalkingQueue();
            p.getPackets().clearMapFlag();
            p.setFaceLocation(target.getLocation());
            if (HANDS_GFX[index] != -1) {
                p.setLastGraphics(new Graphics(HANDS_GFX[index], 0 , getStartingGraphicHeight(index)));
            }
            p.setLastAnimation(new Animation(SPELL_ANIM[index]));
            p.getPackets().closeInterfaces();
            if (target is Player) {
                ((Player) target).getPackets().closeInterfaces();
            }
            target.setAttacker(p);
            p.setTarget(target);
            target.setLastAttacked(Environment.TickCount);
            p.setLastAttack(Environment.TickCount);
            p.setLastMagicAttack(Environment.TickCount);
            p.setCombatTurns(p.getAttackSpeed());
            Combat.setSkull(p, target);
            if (damage > 0) {
                frozen = freezeTarget(index, target);
                if (!frozen && index == 31) {
                    endGfx = 1677;
                }
            }
            if (AIR_GFX[index] != -1 || ((index == 31 || index == 27) && target is Player && ((Player)target).getWalkingQueue().isRunning())) {
                sendProjectile(index, target, p);
            }
            if (damage > target.getHp()) {
                damage = target.getHp();
            }
            if (index == 47 && misc.random(2) == 0) {
                endGfx = 85;
            }
            Combat.checkIfWillDie(target, damage);
            Event doMagicAttackEvent = new Event(getSpellHitDelay(index));
            doMagicAttackEvent.setAction(() => {
                doMagicAttackEvent.stop();
                if (p == null || p.isDead() || !fakeNPC && (target.isDead() || target.isHidden() || target.isDestroyed())) {
                    return;
                }
                if (target.isAutoRetaliating() && target.getTarget() == null && damage > 0) {
                    if (target is Npc) {
                    } else {
                        if (((Player) target).getTemporaryAttribute("autoCastSpell") != null) {
                            int autoCastSpell = (int)((Player) target).getTemporaryAttribute("autoCastSpell");
                            ((Player) target).setTemporaryAttribute("autoCasting", true);
                            target.setTarget(p);
                            MagicCombat.newMagicAttack((Player) target, p, autoCastSpell, ((Player) target).getTemporaryAttribute("autoCastAncients") != null);
                        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:67,代码来源:MagicCombat.cs


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