From be23f9a14519c7b6a4891f3211c78890178f5950 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 19 Aug 2011 15:15:53 -0700 Subject: [PATCH] Ch-Ch-Ch-Changes! --- mcMMO/Changelog.txt | 7 ++++ mcMMO/com/gmail/nossr50/Combat.java | 32 +++++++++---------- mcMMO/com/gmail/nossr50/datatypes/HUDmmo.java | 19 ++++++++--- .../nossr50/datatypes/PlayerProfile.java | 9 ++---- mcMMO/com/gmail/nossr50/mcMMO.java | 2 +- .../com/gmail/nossr50/skills/Acrobatics.java | 8 ++--- mcMMO/com/gmail/nossr50/skills/Skills.java | 1 - 7 files changed, 45 insertions(+), 33 deletions(-) diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index 3a4164534..0407b1cf4 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -8,6 +8,13 @@ GigaDrillBreaker/Berserk doesn't drop clay blocks anymore Fixed bug where Herbalism didn't heal more for bread/stew when right clicking a block Fixed bug where Wheat did not use the values form the config file +TODO: + Fix the NPE with theType + Permission nodes for Spout elements + Small HUD style + HUD persistence + Maybe incorporate mmoParty + In order to streamline the configuration of how XP/Levels are gained, we rewrote the formulas, it is paramount to understand that from a game perspective that does NOT change how fast you level up, it just changes how easy it is to configure the system, current configuration files will be automatically updated maintaining your selected leveling speed diff --git a/mcMMO/com/gmail/nossr50/Combat.java b/mcMMO/com/gmail/nossr50/Combat.java index f4e3e7348..038766d60 100644 --- a/mcMMO/com/gmail/nossr50/Combat.java +++ b/mcMMO/com/gmail/nossr50/Combat.java @@ -89,11 +89,11 @@ public class Combat int xp = (int) (event.getDamage() * 2 * LoadProperties.pvpxprewardmodifier); if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)) - PPa.addXP(SkillType.AXES, xp); + PPa.addXP(SkillType.AXES, xp*10); if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) - PPa.addXP(SkillType.SWORDS, xp); + PPa.addXP(SkillType.SWORDS, xp*10); if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker)) - PPa.addXP(SkillType.UNARMED, xp); + PPa.addXP(SkillType.UNARMED, xp*10); } } } @@ -117,11 +117,11 @@ public class Combat xp = (event.getDamage() * 3); if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) - PPa.addXP(SkillType.SWORDS, xp); + PPa.addXP(SkillType.SWORDS, xp*10); else if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)) - PPa.addXP(SkillType.AXES, xp); + PPa.addXP(SkillType.AXES, xp*10); else if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker)) - PPa.addXP(SkillType.UNARMED, xp); + PPa.addXP(SkillType.UNARMED, xp*10); } Skills.XpCheckAll(attacker); @@ -206,12 +206,12 @@ public class Combat xp = (event.getDamage() * 4); if(event.getEntity() instanceof Ghast) xp = (event.getDamage() * 4); - Users.getProfile(master).addXP(SkillType.TAMING, xp); + Users.getProfile(master).addXP(SkillType.TAMING, xp*10); } if(event.getEntity() instanceof Player) { xp = (event.getDamage() * 2); - Users.getProfile(master).addXP(SkillType.TAMING, xp); + Users.getProfile(master).addXP(SkillType.TAMING, xp*10); } Skills.XpCheckSkill(SkillType.TAMING, master); } @@ -337,19 +337,19 @@ public class Combat { //XP if(x instanceof Creeper) - PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 4)); + PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 4)*10); if(x instanceof Spider) - PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)); + PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)*10); if(x instanceof Skeleton) - PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 2)); + PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 2)*10); if(x instanceof Zombie) - PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 2)); + PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 2)*10); if(x instanceof PigZombie) - PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)); + PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)*10); if(x instanceof Slime) - PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)); + PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)*10); if(x instanceof Ghast) - PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)); + PPa.addXP(SkillType.ARCHERY, (event.getDamage() * 3)*10); } /* * Attacker is Player @@ -374,7 +374,7 @@ public class Combat if(LoadProperties.pvpxp && !Party.getInstance().inSameParty(attacker, defender) && ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis()) { - int xp = (int) (event.getDamage() * 2 * LoadProperties.pvpxprewardmodifier); + int xp = (int) ((event.getDamage() * 2) * 10); PPa.addXP(SkillType.ARCHERY, xp); } /* diff --git a/mcMMO/com/gmail/nossr50/datatypes/HUDmmo.java b/mcMMO/com/gmail/nossr50/datatypes/HUDmmo.java index 78a18b240..13ae4f64c 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/HUDmmo.java +++ b/mcMMO/com/gmail/nossr50/datatypes/HUDmmo.java @@ -187,16 +187,27 @@ public class HUDmmo { SkillType theType = null; - if(PP.getXpBarLocked()) + if(PP.getXpBarLocked() && PP.getSkillLock() != null) theType=PP.getSkillLock(); else theType=PP.getLastGained(); - Color color = SpoutStuff.getRetroColor(theType); + Color color = new Color(0.3f, 0.3f, 0.75f, 1f); - ((GenericTexture) xpicon).setUrl(LoadProperties.web_url+"HUD/Retro/"+m.getCapitalized(theType.toString())+"_r.png"); + if(xpicon != null && theType != null) + xpicon.setUrl(LoadProperties.web_url+"HUD/Retro/"+m.getCapitalized(theType.toString())+"_r.png"); + else + { + if(xpicon == null) + System.out.println("xpicon was null!"); + if(theType == null) + System.out.println("theType was null!"); + } - xpfill.setBottomColor(color).setTopColor(color).setWidth(SpoutStuff.getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.RETRO)).setDirty(true); + if(theType != null) + xpfill.setBottomColor(color).setTopColor(color).setWidth(SpoutStuff.getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.RETRO)).setDirty(true); + else + System.out.println("theType was null!"); SpoutManager.getPlayer(player).getMainScreen().setDirty(true); } diff --git a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java index b9e0fc0f0..03c85a423 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -928,14 +928,9 @@ public class PlayerProfile xp=(int) (xp/LoadProperties.sorceryxpmodifier); break; } - + xp=xp*LoadProperties.xpGainMultiplier; skillsXp.put(skillType, skillsXp.get(skillType)+xp); - - if(LoadProperties.spoutEnabled) - { - lastgained = skillType; - //switch - } + lastgained = skillType; } //save(); } diff --git a/mcMMO/com/gmail/nossr50/mcMMO.java b/mcMMO/com/gmail/nossr50/mcMMO.java index e419f2f2e..2731510a4 100644 --- a/mcMMO/com/gmail/nossr50/mcMMO.java +++ b/mcMMO/com/gmail/nossr50/mcMMO.java @@ -131,7 +131,7 @@ public class mcMMO extends JavaPlugin //Entity Stuff pm.registerEvent(Event.Type.ENTITY_TARGET, entityListener, Priority.Normal, this); pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this); - pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Highest, this); + pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.High, this); pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this); //Spout Stuff diff --git a/mcMMO/com/gmail/nossr50/skills/Acrobatics.java b/mcMMO/com/gmail/nossr50/skills/Acrobatics.java index 795d988a5..6dafa9928 100644 --- a/mcMMO/com/gmail/nossr50/skills/Acrobatics.java +++ b/mcMMO/com/gmail/nossr50/skills/Acrobatics.java @@ -36,7 +36,7 @@ public class Acrobatics { */ if(player.getHealth() - newDamage >= 1){ if(!event.isCancelled()) - PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 8)); + PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 8)*10); Skills.XpCheckSkill(SkillType.ACROBATICS, player); event.setDamage(newDamage); if(event.getDamage() <= 0) @@ -49,7 +49,7 @@ public class Acrobatics { } } else if (!event.isCancelled()){ if(player.getHealth() - event.getDamage() >= 1){ - PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)); + PP.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)*10); Skills.XpCheckSkill(SkillType.ACROBATICS, player); } } @@ -64,7 +64,7 @@ public class Acrobatics { if(Math.random() * 4000 <= PPd.getSkillLevel(SkillType.ACROBATICS)){ defender.sendMessage(ChatColor.GREEN+"**DODGE**"); if(System.currentTimeMillis() >= 5000 + PPd.getRespawnATS() && defender.getHealth() >= 1){ - PPd.addXP(SkillType.ACROBATICS, event.getDamage() * 12); + PPd.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)*1); Skills.XpCheckSkill(SkillType.ACROBATICS, defender); } event.setDamage(event.getDamage() / 2); @@ -75,7 +75,7 @@ public class Acrobatics { } else if(Math.random() * 4000 <= 800) { defender.sendMessage(ChatColor.GREEN+"**DODGE**"); if(System.currentTimeMillis() >= 5000 + PPd.getRespawnATS() && defender.getHealth() >= 1){ - PPd.addXP(SkillType.ACROBATICS, event.getDamage() * 12); + PPd.addXP(SkillType.ACROBATICS, (event.getDamage() * 12)*10); Skills.XpCheckSkill(SkillType.ACROBATICS, defender); } event.setDamage(event.getDamage() / 2); diff --git a/mcMMO/com/gmail/nossr50/skills/Skills.java b/mcMMO/com/gmail/nossr50/skills/Skills.java index 22d9fb7ce..66221956b 100644 --- a/mcMMO/com/gmail/nossr50/skills/Skills.java +++ b/mcMMO/com/gmail/nossr50/skills/Skills.java @@ -316,7 +316,6 @@ public class Skills if(sPlayer.isSpoutCraftEnabled()) { SpoutStuff.levelUpNotification(skillType, sPlayer); - PP.setXpBarInc(0); } else { player.sendMessage(mcLocale.getString("Skills."+capitalized+"Up", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));