From e40e10da61fdcff6565e7ac0ef270d46ced80e3c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 2 Apr 2012 04:41:04 -0700 Subject: [PATCH] Some WIP work on Archery, most noteably a damage boost per 50 skill lvl --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/Combat.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index d7f1c5ce9..3f94fcbc2 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -8,6 +8,7 @@ Key: - Removal Version 1.3.05-dev + + Added bonus damage to Archery, every 50 levels you gain 10% bonus damage + Added ExperienceAPI and PartyAPI classes for developer use = Fixed errors when Spout would disable itself after start-up = Fixed XP bar not updating when XP was gained diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index 32da53462..49762cc32 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -193,6 +193,22 @@ public class Combat { int damage = event.getDamage(); if (mcPermissions.getInstance().archery(attacker) && damage > 0) { + + /*Archery needs a damage bonus to be viable in PVP*/ + int skillLvl = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY); + double dmgBonusPercent = ((skillLvl / 50) * 0.1D); + + /* Cap maximum bonus at 100% */ + if(dmgBonusPercent > 2) + dmgBonusPercent = 2; + + /* Every 100 skill levels Archery gains 20% damage bonus, set that here */ + //TODO: Work in progress for balancing out Archery, will work on it more later... + //System.out.println("DEBUG 0: "+event.getDamage()); + int archeryBonus = (int)(event.getDamage() * dmgBonusPercent); + event.setDamage(event.getDamage() + archeryBonus); + //System.out.println("DEBUG 1: "+event.getDamage()); + if (mcPermissions.getInstance().trackArrows(attacker)) { Archery.trackArrows(pluginx, target, PPa); }