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


C# Player.getAttackStyle方法代码示例

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


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

示例1: setButtonForAttackStyle

        public static void setButtonForAttackStyle(Player p, int interfaceId)
        {
            if (interfaceId == -1)
            {
                return;
            }
            AttackStyle av = p.getAttackStyle();
            AttackStyle.CombatSkill type = av.getSkill();
            AttackStyle.CombatStyle type2 = av.getStyle();
            int slot = av.getSlot();
            switch (interfaceId)
            {
                case 92: // Unarmed
                    if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0)
                    {
                        p.getPackets().sendConfig(43, 0);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1)
                    {
                        p.getPackets().sendConfig(43, 1);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3)
                    {
                        p.getPackets().sendConfig(43, 2);
                        av.setSlot(2);
                    }
                    break;

                case 93: // Whip attack interface.
                    if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0)
                    {
                        p.getPackets().sendConfig(43, 0);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.CONTROLLED) || slot == 1)
                    {
                        p.getPackets().sendConfig(43, 1);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3)
                    {
                        p.getPackets().sendConfig(43, 2);
                        av.setSlot(2);
                    }
                    break;

                case 89: // Dagger attack interface.
                    if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0)
                    {
                        p.getPackets().sendConfig(43, 0);
                    }
                    else if ((type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.STAB)) || slot == 1)
                    {
                        p.getPackets().sendConfig(43, 1);
                    }
                    else if ((type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.SLASH)))
                    {
                        p.getPackets().sendConfig(43, 2);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3)
                    {
                        p.getPackets().sendConfig(43, 3);
                        av.setSlot(3);
                    }
                    break;

                case 82: // Longsword/scimitar attack interface.
                    if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0)
                    {
                        p.getPackets().sendConfig(43, 0);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.SLASH) || slot == 1)
                    {
                        p.getPackets().sendConfig(43, 1);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.CRUSH))
                    {
                        p.getPackets().sendConfig(43, 2);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3)
                    {
                        p.getPackets().sendConfig(43, 3);
                        av.setSlot(3);
                    }
                    break;

                case 78: // Claw attack interface.
                    if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0)
                    {
                        p.getPackets().sendConfig(43, 0);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1)
                    {
                        p.getPackets().sendConfig(43, 1);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.CONTROLLED))
                    {
                        p.getPackets().sendConfig(43, 2);
                    }
                    else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3)
                    {
                        p.getPackets().sendConfig(43, 3);
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:AttackInterface.cs

示例2: getRangeMaxHit

 public static double getRangeMaxHit(Player p, int bow, int arrow)
 {
     double hit = 0;
     double a = p.getSkills().getCurLevel(Skills.SKILL.RANGE);
     double b = 1.00;
     double c = 0;
     int d = getRangeStrength(p);
     int prayer = p.getPrayers().getRangePrayer();
     if (prayer == 1) {
         b *= 1.05;
     } else if (prayer == 2) {
         b *= 1.10;
     } else if (prayer == 3) {
         b *= 1.15;
     }
     if (wearingRangeVoid(p)) {
         b *= 1.15;
     }
     c = (a * b);
     if (p.getAttackStyle().getStyle().Equals(AttackStyle.CombatStyle.RANGE_ACCURATE)) {
         c += 3.00;
     }
     hit = ((c + 8) * (d + 64) / 640);
     return Math.Floor(hit);
 }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:25,代码来源:CombatFormula.cs

示例3: configureButton

        public static void configureButton(Player p, int interfaceId, int button)
        {
            AttackStyle av = p.getAttackStyle();
            switch (interfaceId)
            {
                case 92: // Unarmed attack interface.
                    switch (button)
                    {
                        case 2: // Punch (Attack XP) - Crush
                            av.setSkill(AttackStyle.CombatSkill.ACCURATE);
                            av.setStyle(AttackStyle.CombatStyle.CRUSH);
                            av.setSlot(0);
                            break;

                        case 3: // Kick (Strength XP) - Crush
                            av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE);
                            av.setStyle(AttackStyle.CombatStyle.CRUSH);
                            av.setSlot(1);
                            break;

                        case 4: // Block (Defence XP) - Crush
                            av.setSkill(AttackStyle.CombatSkill.DEFENSIVE);
                            av.setStyle(AttackStyle.CombatStyle.CRUSH);
                            av.setSlot(2);
                            break;
                    }
                    break;

                case 93: // Whip attack interface.
                    switch (button)
                    {
                        case 2: // Flick (Attack XP) - Slash
                            av.setSkill(AttackStyle.CombatSkill.ACCURATE);
                            av.setStyle(AttackStyle.CombatStyle.SLASH);
                            av.setSlot(0);
                            break;

                        case 3: // Lash (Shared XP) - Slash
                            av.setSkill(AttackStyle.CombatSkill.CONTROLLED);
                            av.setStyle(AttackStyle.CombatStyle.SLASH);
                            av.setSlot(1);
                            break;

                        case 4: // Deflect (Defence XP) - Slash
                            av.setSkill(AttackStyle.CombatSkill.DEFENSIVE);
                            av.setStyle(AttackStyle.CombatStyle.SLASH);
                            av.setSlot(2);
                            break;
                    }
                    break;

                case 89: // Dagger attack interface.
                    switch (button)
                    {
                        case 2: // Stab (Attack XP) - Stab
                            av.setSkill(AttackStyle.CombatSkill.ACCURATE);
                            av.setStyle(AttackStyle.CombatStyle.STAB);
                            av.setSlot(0);
                            break;

                        case 3: // Lunge (Strength XP) - Stab
                            av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE);
                            av.setStyle(AttackStyle.CombatStyle.STAB);
                            av.setSlot(1);
                            break;

                        case 4: // Slash (Strength XP) - Slash
                            av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE);
                            av.setStyle(AttackStyle.CombatStyle.SLASH);
                            av.setSlot(2);
                            break;

                        case 5: // Block (Defence XP) - Stab
                            av.setSkill(AttackStyle.CombatSkill.DEFENSIVE);
                            av.setStyle(AttackStyle.CombatStyle.STAB);
                            av.setSlot(3);
                            break;
                    }
                    break;

                case 82: // Longsword/scimitar attack interface.
                    switch (button)
                    {
                        case 2: // Chop (Attack XP) - Slash
                            av.setSkill(AttackStyle.CombatSkill.ACCURATE);
                            av.setStyle(AttackStyle.CombatStyle.SLASH);
                            av.setSlot(0);
                            break;

                        case 3: // Slash (Strength XP) - Slash
                            av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE);
                            av.setStyle(AttackStyle.CombatStyle.SLASH);
                            av.setSlot(1);
                            break;

                        case 4: // Smash (Strength XP) - Crush
                            av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE);
                            av.setStyle(AttackStyle.CombatStyle.CRUSH);
                            av.setSlot(2);
                            break;
//.........这里部分代码省略.........
开发者ID:Krill156,项目名称:SharpEMU,代码行数:101,代码来源:AttackInterface.cs

示例4: getPlayerMaxHit

        public static double getPlayerMaxHit(Player player, int strBonusIncrease)
        {
            AttackStyle.CombatSkill fightType = player.getAttackStyle().getSkill();
            double myCurStrength = (double)player.getSkills().getCurLevel(Skills.SKILL.STRENGTH);
            double myEquipStrengthBonus = (double)(player.getEquipment().getBonus(Equipment.BONUS.STRENGTH) + strBonusIncrease);
            double fightingStyle = 0;
            double powerMultiplier = 1;
            double dharokModifier = 1;
            double damageMultiplier = 1;
            int strPrayer = player.getPrayers().getStrengthPrayer();
            if (strPrayer == 1)
            {
                powerMultiplier += 0.05;
            }
            else if (strPrayer == 2)
            {
                powerMultiplier += 0.1;
            }
            else if (strPrayer == 3)
            {
                powerMultiplier += 0.15;
            }
            else if (player.getPrayers().getSuperPrayer() == 1)
            {
                powerMultiplier += 0.18;
            }
            else if (player.getPrayers().getSuperPrayer() == 2)
            {
                powerMultiplier += 0.23;
            }

            if (wearingMeleeVoid(player))
            {
                damageMultiplier += 0.1;
            }
            else if (wearingDharok(player) && misc.random(3) == 0)
            {
                dharokModifier = misc.random((int)((player.getSkills().getGreaterLevel(Skills.SKILL.HITPOINTS) - player.getSkills().getCurLevel(Skills.SKILL.HITPOINTS)) * 0.1));
            }
            if (fightType.Equals(AttackStyle.CombatSkill.AGGRESSIVE))
            {
                fightingStyle = 3;
            } else if (fightType.Equals(AttackStyle.CombatSkill.CONTROLLED))
            {
                fightingStyle = 1;
            }

            double cumulativeStrength = ((myCurStrength) * (powerMultiplier) + fightingStyle) * dharokModifier;
            double maxHit = ((13 + (cumulativeStrength) + (myEquipStrengthBonus / 8) + ((cumulativeStrength * myEquipStrengthBonus) / 64)) * damageMultiplier); // NEW MAX HIT FORMULA
            maxHit = maxHit / 10; //this is temporary because I haven't yet fully implemented the huge damage system.
            return maxHit;
        }
开发者ID:Krill156,项目名称:SharpEMU,代码行数:52,代码来源:CombatFormula.cs


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