當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。