Skip to content

Commit

Permalink
Axes gains bonus DMG every 50 levels like Unarmed now.
Browse files Browse the repository at this point in the history
  • Loading branch information
nossr50 committed Feb 29, 2012
1 parent 5d9ac61 commit 8d00468
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
20 changes: 13 additions & 7 deletions src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
percentage = String.valueOf((skillvalue / 1000) * 100);
else
percentage = "75";

int bonusDmg = Users.getProfile(player).getSkillLevel(SkillType.AXES)/50;
if(bonusDmg > 4)
bonusDmg = 4;

int ticks = 2;
short durDmg = 5;
durDmg+=Users.getProfile(player).getSkillLevel(SkillType.AXES)/30;
int x = PP.getSkillLevel(SkillType.AXES);
while (x >= 50) {
x -= 50;
Expand All @@ -47,15 +53,15 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes1_0"), mcLocale.getString("m.EffectsAxes1_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes2_0"), mcLocale.getString("m.EffectsAxes2_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes3_0"), mcLocale.getString("m.EffectsAxes3_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes4_0"), mcLocale.getString("m.EffectsAxes4_1") }));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsAxes5_0"), mcLocale.getString("m.EffectsAxes5_1") }));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
player.sendMessage(mcLocale.getString("m.AxesCritChance", new Object[] { percentage }));

if (PP.getSkillLevel(SkillType.AXES) < 500)
player.sendMessage(mcLocale.getString("m.AbilityLockTemplate", new Object[] { mcLocale.getString("m.AbilLockAxes1") }));
else
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes1_0"), mcLocale.getString("m.AbilBonusAxes1_1") }));

player.sendMessage(mcLocale.getString("m.AxesSkullLength", new Object[] { ticks }));

player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes1_0"), mcLocale.getString("m.AbilBonusAxes1_1", new Object[] {bonusDmg}) }));
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes2_0"), mcLocale.getString("m.AbilBonusAxes2_1", new Object[] {durDmg}) }));
player.sendMessage(mcLocale.getString("m.AbilityBonusTemplate", new Object[] { mcLocale.getString("m.AbilBonusAxes3_0"), mcLocale.getString("m.AbilBonusAxes3_1", new Object[] {1}) }));
player.sendMessage(mcLocale.getString("m.AxesSkullLength", new Object[] { ticks }));

return true;
}
Expand Down
20 changes: 18 additions & 2 deletions src/main/java/com/gmail/nossr50/skills/Axes.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,18 @@
import com.gmail.nossr50.party.Party;

public class Axes {

public static void axesBonus(Player attacker, EntityDamageByEntityEvent event)
{
int bonus = 0;

//Add 1 DMG for every 50 skill levels
bonus += Users.getProfile(attacker).getSkillLevel(SkillType.AXES)/50;

if(bonus > 4)
bonus = 4;

event.setDamage(event.getDamage() + bonus);
}
public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
{
Entity x = event.getEntity();
Expand Down Expand Up @@ -93,14 +104,19 @@ public static void impact(Player attacker, LivingEntity target)
{
Player targetPlayer = (Player) target;
int emptySlots = 0;
short durDmg = 5; //Start with 5 durability dmg

durDmg+=Users.getProfile(attacker).getSkillLevel(SkillType.AXES)/30; //Every 30 Skill Levels you gain 1 durability dmg

System.out.println(durDmg);

for(ItemStack x : targetPlayer.getInventory().getArmorContents())
{
if(x.getType() == Material.AIR)
{
emptySlots++;
} else {
x.setDurability((short) (x.getDurability()+30)); //Damage armor piece
x.setDurability((short) (x.getDurability()+durDmg)); //Damage armor piece
}
}

Expand Down
10 changes: 9 additions & 1 deletion src/main/resources/locale/locale_en_us.properties
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,17 @@ m.EffectsAxes2_0=Critical Strikes
m.EffectsAxes2_1=Double Damage
m.EffectsAxes3_0=Axe Mastery
m.EffectsAxes3_1=Modifies Damage
m.EffectsAxes4_0=Impact
m.EffectsAxes4_1=Strike with enough force to shatter armor
m.EffectsAxes5_0=Greater Impact
m.EffectsAxes5_1=Deal bonus damage to unarmored foes
m.AbilLockAxes1=LOCKED UNTIL 500+ SKILL (AXE MASTERY)
m.AbilBonusAxes1_0=Axe Mastery
m.AbilBonusAxes1_1=Bonus 4 damage
m.AbilBonusAxes1_1=Bonus {0} damage
m.AbilBonusAxes2_0=Impact
m.AbilBonusAxes2_1=Deal {0} DMG to armor
m.AbilBonusAxes3_0=Greater Impact
m.AbilBonusAxes3_1=Deal {0} Bonus DMG to the unarmored
m.AxesCritChance=[[RED]]Chance to critically strike: [[YELLOW]]{0}%
m.AxesSkullLength=[[RED]]Skull Splitter Length: [[YELLOW]]{0}s
m.SkillSwords=SWORDS
Expand Down

0 comments on commit 8d00468

Please sign in to comment.