Added 'Skill Shot' to Archery. Updated Archery command.

This commit is contained in:
nossr50
2012-04-03 14:36:55 -07:00
parent e8817ec9ea
commit f247545fc4
14 changed files with 33 additions and 75 deletions

View File

@ -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.
*