From f247545fc428583b6a38b90dbca4c216e546b9d7 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Apr 2012 14:36:55 -0700 Subject: [PATCH] Added 'Skill Shot' to Archery. Updated Archery command. --- Changelog.txt | 3 +- src/main/java/com/gmail/nossr50/Combat.java | 6 +-- .../commands/skills/ArcheryCommand.java | 22 ++++----- .../com/gmail/nossr50/skills/Archery.java | 45 ------------------- .../resources/locale/locale_de.properties | 3 +- .../resources/locale/locale_en_us.properties | 5 ++- .../resources/locale/locale_es_es.properties | 3 +- .../resources/locale/locale_fi.properties | 3 +- .../resources/locale/locale_fr.properties | 3 +- .../resources/locale/locale_it.properties | 3 +- .../resources/locale/locale_nl.properties | 3 +- .../resources/locale/locale_pl.properties | 3 +- .../resources/locale/locale_pt_br.properties | 3 +- .../resources/locale/locale_ru.properties | 3 +- 14 files changed, 33 insertions(+), 75 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 48d0843a7..98c72f67e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -8,7 +8,7 @@ Key: - Removal Version 1.3.05-dev - + Added bonus damage to Archery, every 50 levels you gain 10% bonus damage + + Added Skill Shot to Archery which increases damage dealt by 10% every 50 skill levels (caps at 200%) + Added ExperienceAPI and PartyAPI classes for developer use + Added ability to cap overall power level + Added showing powerlevel below a persons name if you run Spout (optional) @@ -21,6 +21,7 @@ Version 1.3.05-dev = Fixed bug where API functions were set to static ! Changed Tree Feller to account for ability durability loss but not leaves. ! Changed bypass node for Arcane Forging to not default to true for OPs + - Removed Ignition from Archery - Removed McMMOPlayerRepairEvent - was basically a duplicate of McMMOPlayerRepairCheck but couldn't be cancelled. Version 1.3.04 diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index 49762cc32..297be521a 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -198,7 +198,7 @@ public class Combat { int skillLvl = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY); double dmgBonusPercent = ((skillLvl / 50) * 0.1D); - /* Cap maximum bonus at 100% */ + /* Cap maximum bonus at 200% */ if(dmgBonusPercent > 2) dmgBonusPercent = 2; @@ -213,10 +213,6 @@ public class Combat { Archery.trackArrows(pluginx, target, PPa); } - if (mcPermissions.getInstance().ignition(attacker)) { - Archery.ignitionCheck(target, attacker); - } - startGainXp(attacker, PPa, target, SkillType.ARCHERY, pluginx); if (target instanceof Player) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index eb632ddd6..11c5b9c04 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -25,18 +25,14 @@ public class ArcheryCommand implements CommandExecutor { float skillvalue = (float) PP.getSkillLevel(SkillType.ARCHERY); String percentage = String.valueOf((skillvalue / 1000) * 100); - - int ignition = 20; - if (PP.getSkillLevel(SkillType.ARCHERY) >= 200) - ignition += 20; - if (PP.getSkillLevel(SkillType.ARCHERY) >= 400) - ignition += 20; - if (PP.getSkillLevel(SkillType.ARCHERY) >= 600) - ignition += 20; - if (PP.getSkillLevel(SkillType.ARCHERY) >= 800) - ignition += 20; - if (PP.getSkillLevel(SkillType.ARCHERY) >= 1000) - ignition += 20; + + double dmgBonusPercent = ((PP.getSkillLevel(SkillType.ARCHERY) / 50) * 0.1D); + + /* Cap maximum bonus at 200% */ + if(dmgBonusPercent > 2) + dmgBonusPercent = 2; + + dmgBonusPercent = dmgBonusPercent * 100; //Convert to percentage String percentagedaze; if (PP.getSkillLevel(SkillType.ARCHERY) < 1000) @@ -55,9 +51,9 @@ public class ArcheryCommand implements CommandExecutor { player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsArchery2_0"), mcLocale.getString("m.EffectsArchery2_1") })); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsArchery4_0"), mcLocale.getString("m.EffectsArchery4_1") })); player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") })); + player.sendMessage(mcLocale.getString("m.ArcherySkillShot", new Object[] { dmgBonusPercent })); player.sendMessage(mcLocale.getString("m.ArcheryDazeChance", new Object[] { percentagedaze })); player.sendMessage(mcLocale.getString("m.ArcheryRetrieveChance", new Object[] { percentage })); - player.sendMessage(mcLocale.getString("m.ArcheryIgnitionLength", new Object[] { (ignition / 20) })); Page.grabGuidePageForSkill(SkillType.ARCHERY, player, args); diff --git a/src/main/java/com/gmail/nossr50/skills/Archery.java b/src/main/java/com/gmail/nossr50/skills/Archery.java index 057b2fa81..893e00a7e 100644 --- a/src/main/java/com/gmail/nossr50/skills/Archery.java +++ b/src/main/java/com/gmail/nossr50/skills/Archery.java @@ -15,7 +15,6 @@ import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.mcLocale; -import com.gmail.nossr50.party.Party; public class Archery { @@ -41,50 +40,6 @@ public class Archery { } } - /** - * Check for ignition on arrow hit. - * - * @param entity Entity damaged by the arrow - * @param attacker Player who fired the arrow - */ - public static void ignitionCheck(Entity entity, Player attacker) { - - //Check to see if PVP for this world is disabled before executing - if (!entity.getWorld().getPVP()) { - return; - } - - final int IGNITION_CHANCE = 25; - final int MAX_IGNITION_TICKS = 120; - - PlayerProfile PPa = Users.getProfile(attacker); - - if (random.nextInt(100) <= IGNITION_CHANCE) { - int ignition = 20; - - /* Add 20 ticks for every 200 skill levels */ - ignition += (PPa.getSkillLevel(SkillType.ARCHERY) / 200) * 20; - - if (ignition > MAX_IGNITION_TICKS) { - ignition = MAX_IGNITION_TICKS; - } - - if (entity instanceof Player) { - Player defender = (Player) entity; - - if (!Party.getInstance().inSameParty(attacker, defender)) { - defender.setFireTicks(defender.getFireTicks() + ignition); - attacker.sendMessage(mcLocale.getString("Combat.Ignition")); - defender.sendMessage(mcLocale.getString("Combat.BurningArrowHit")); - } - } - else { - entity.setFireTicks(entity.getFireTicks() + ignition); - attacker.sendMessage(mcLocale.getString("Combat.Ignition")); - } - } - } - /** * Check for Daze. * diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index 50cb7f422..e2d68d192 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -436,4 +436,5 @@ m.EffectsTaming7_1=Summon an animal to your side m.EffectsTaming7_2=[[GRAY]]COTW HOW-TO: Crouch and right click with {0} Bones/Fish in hand m.EffectsTaming1_1=Bone-whacking inspects wolves/ocelots Combat.BeastLoreHealth=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/{1}) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_en_us.properties b/src/main/resources/locale/locale_en_us.properties index ae03c515a..660b8f0ab 100644 --- a/src/main/resources/locale/locale_en_us.properties +++ b/src/main/resources/locale/locale_en_us.properties @@ -73,8 +73,8 @@ m.WoodCuttingDoubleDropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}% m.WoodCuttingTreeFellerLength=[[RED]]Tree Feller Length: [[YELLOW]]{0}s m.SkillArchery=ARCHERY m.XPGainArchery=Attacking Monsters -m.EffectsArchery1_0=Ignition -m.EffectsArchery1_1=25% Chance Enemies will ignite +m.EffectsArchery1_0=Skill Shot +m.EffectsArchery1_1=Increases damage done by Bows m.EffectsArchery2_0=Daze (Players) m.EffectsArchery2_1=Disorients foes m.EffectsArchery3_0=Damage+ @@ -440,3 +440,4 @@ Inspect.OfflineStats=mcMMO Stats for Offline Player [[YELLOW]]{0} Stats.GatheringHeader=[[GOLD]]-=GATHERING SKILLS=- Stats.CombatHeader=[[GOLD]]-=COMBAT SKILLS=- Stats.MiscHeader=[[GOLD]]-=MISC SKILLS=- +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_es_es.properties b/src/main/resources/locale/locale_es_es.properties index e112815c1..d5c9db2de 100644 --- a/src/main/resources/locale/locale_es_es.properties +++ b/src/main/resources/locale/locale_es_es.properties @@ -428,4 +428,5 @@ GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) XPRate.Event = [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! BlastMining.Boom = [[GRAY]]**BOOM** Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_fi.properties b/src/main/resources/locale/locale_fi.properties index 4cf5db238..dd5aaa7de 100644 --- a/src/main/resources/locale/locale_fi.properties +++ b/src/main/resources/locale/locale_fi.properties @@ -421,4 +421,5 @@ Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) Combat.BeastLore=[[GREEN]]**BEAST LORE** Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]]) Combat.BeastLoreHealth=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/{1}) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_fr.properties b/src/main/resources/locale/locale_fr.properties index 05cfcceb3..c1974f80b 100644 --- a/src/main/resources/locale/locale_fr.properties +++ b/src/main/resources/locale/locale_fr.properties @@ -428,4 +428,5 @@ GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) XPRate.Event = [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! BlastMining.Boom = [[GRAY]]**BOOM** Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_it.properties b/src/main/resources/locale/locale_it.properties index 24e6c8619..d16bba3de 100644 --- a/src/main/resources/locale/locale_it.properties +++ b/src/main/resources/locale/locale_it.properties @@ -430,4 +430,5 @@ GodMode.Forbidden=[mcMMO] La god mode non e permessa in questo mondo (Controlla XPRate.Event = [[GOLD]]mcMMO ha un'evento in corso -> XP aumentato! la XP Rate e {0}x! BlastMining.Boom = [[GRAY]]**BOOM** Party.Forbidden=[mcMMO] I party non sono permessi in questo mondo (Controlla i Permessi) -m.TamingSummonOcelotFailed=[[RED]]Hai troppi gattopardi con te per poterne chiamare altri. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]Hai troppi gattopardi con te per poterne chiamare altri. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_nl.properties b/src/main/resources/locale/locale_nl.properties index 706afee4e..b863b3b62 100644 --- a/src/main/resources/locale/locale_nl.properties +++ b/src/main/resources/locale/locale_nl.properties @@ -434,4 +434,5 @@ GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) XPRate.Event = [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! BlastMining.Boom = [[GRAY]]**BOOM** Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_pl.properties b/src/main/resources/locale/locale_pl.properties index 28bd3c3b2..28bf86253 100644 --- a/src/main/resources/locale/locale_pl.properties +++ b/src/main/resources/locale/locale_pl.properties @@ -428,4 +428,5 @@ GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) XPRate.Event = [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! BlastMining.Boom = [[GRAY]]**BOOM** Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_pt_br.properties b/src/main/resources/locale/locale_pt_br.properties index 5555d91cc..62e712b85 100644 --- a/src/main/resources/locale/locale_pt_br.properties +++ b/src/main/resources/locale/locale_pt_br.properties @@ -435,4 +435,5 @@ GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) XPRate.Event = [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! BlastMining.Boom = [[GRAY]]**BOOM** Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file diff --git a/src/main/resources/locale/locale_ru.properties b/src/main/resources/locale/locale_ru.properties index d9385e6a9..cb8098a03 100644 --- a/src/main/resources/locale/locale_ru.properties +++ b/src/main/resources/locale/locale_ru.properties @@ -419,4 +419,5 @@ GodMode.Forbidden=[mcMMO] God Mode not permitted on this world (See Permissions) XPRate.Event = [[GOLD]]mcMMO is currently in an XP rate event! XP rate is {0}x! BlastMining.Boom = [[GRAY]]**BOOM** Party.Forbidden=[mcMMO] Parties not permitted on this world (See Permissions) -m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. \ No newline at end of file +m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more. +m.ArcherySkillShot=[[RED]]Skill Shot Bonus Damage: [[YELLOW]]{0}% \ No newline at end of file