Added get and set Methods to Earth abilities

This commit is contained in:
Nathan Braun 2015-01-02 00:24:36 -08:00
parent 35ec8565b2
commit ce49625c2b
7 changed files with 266 additions and 25 deletions

View file

@ -20,11 +20,11 @@ public class Catapult {
public static ConcurrentHashMap<Integer, Catapult> instances = new ConcurrentHashMap<Integer, Catapult>();
private static int length = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.Catapult.Length");
private static double speed = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Speed");
private static double push = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Push");
private static int LENGTH = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.Catapult.Length");
private static double SPEED = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Speed");
private static double PUSH = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Push");
private static long interval = (long) (1000. / speed);
private static long interval = (long) (1000. / SPEED);
private Player player;
private Location origin;
@ -34,6 +34,9 @@ public class Catapult {
private boolean catapult = false;
private boolean moving = false;
private boolean flying = false;
private int length = LENGTH;
private double speed = SPEED;
private double push = PUSH;
private long time;
private long starttime;
private int ticks = 0;
@ -228,4 +231,32 @@ public class Catapult {
+ "death of certain gung-ho earthbenders. If you plan to use this ability, be sure "
+ "you've read about your passive ability you innately have as an earthbender.";
}
public Player getPlayer() {
return player;
}
public int getLength() {
return length;
}
public void setLength(int length) {
this.length = length;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public double getPush() {
return push;
}
public void setPush(double push) {
this.push = push;
}
}

View file

@ -25,7 +25,7 @@ public class EarthArmor {
private static long interval = 2000;
private static long cooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Earth.EarthArmor.Cooldown");
private static long duration = ProjectKorra.plugin.getConfig().getLong("Abilities.Earth.EarthArmor.Duration");
private static int strength = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.EarthArmor.Strength");
private static int STRENGTH = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.EarthArmor.Strength");
private static int range = 7;
private Player player;
@ -36,6 +36,7 @@ public class EarthArmor {
private long time, starttime;
private boolean formed = false;
private boolean complete = false;
private int strength = STRENGTH;
public ItemStack[] oldarmor;
public EarthArmor(Player player) {
@ -259,4 +260,16 @@ public class EarthArmor {
}
return true;
}
public Player getPlayer() {
return player;
}
public int getStrength() {
return strength;
}
public void setStrength(int strength) {
this.strength = strength;
}
}

View file

@ -25,13 +25,13 @@ public class EarthBlast {
private static boolean hitself = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthBlast.CanHitSelf");
private static double preparerange = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.PrepareRange");
private static double range = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.Range");
private static double damage = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.Damage");
private static double RANGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.Range");
private static double DAMAGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.Damage");
private static double speed = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.Speed");
private static final double deflectrange = 3;
private static boolean revert = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthBlast.Revert");
private static double pushfactor = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.Push");
private static double PUSH_FACTOR = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthBlast.Push");
private static long interval = (long) (1000. / speed);
@ -50,6 +50,9 @@ public class EarthBlast {
private boolean falling = false;
private long time;
private boolean settingup = true;
private double range = RANGE;
private double damage = DAMAGE;
private double pushfactor = PUSH_FACTOR;
public EarthBlast(Player player) {
this.player = player;
@ -76,10 +79,10 @@ public class EarthBlast {
}
private static Location getTargetLocation(Player player) {
Entity target = Methods.getTargetedEntity(player, range, new ArrayList<Entity>());
Entity target = Methods.getTargetedEntity(player, RANGE, new ArrayList<Entity>());
Location location;
if (target == null) {
location = Methods.getTargetedLocation(player, range);
location = Methods.getTargetedLocation(player, RANGE);
} else {
location = ((LivingEntity) target).getEyeLocation();
}
@ -269,7 +272,7 @@ public class EarthBlast {
location = location.clone().add(direction);
Methods.removeSpouts(location, player);
double radius = FireBlast.affectingradius;
double radius = FireBlast.AFFECTING_RADIUS;
Player source = player;
if (EarthBlast.annihilateBlasts(location, radius, source)
|| WaterManipulation.annihilateBlasts(location,
@ -298,7 +301,7 @@ public class EarthBlast {
}
for (Entity entity : Methods.getEntitiesAroundPoint(location,
FireBlast.affectingradius)) {
FireBlast.AFFECTING_RADIUS)) {
if (Methods.isRegionProtectedFromBuild(player,
"EarthBlast", entity.getLocation()))
continue;
@ -418,7 +421,7 @@ public class EarthBlast {
Location location = player.getEyeLocation();
Vector vector = location.getDirection();
Location mloc = blast.location;
if (mloc.distance(location) <= range
if (mloc.distance(location) <= RANGE
&& Methods.getDistanceFromLine(vector, location,
blast.location) < deflectrange
&& mloc.distance(location.clone().add(vector)) < mloc
@ -461,7 +464,7 @@ public class EarthBlast {
Location location = player.getEyeLocation();
Vector vector = location.getDirection();
Location mloc = blast.location;
if (mloc.distance(location) <= range
if (mloc.distance(location) <= RANGE
&& Methods.getDistanceFromLine(vector, location,
blast.location) < deflectrange
&& mloc.distance(location.clone().add(vector)) < mloc
@ -519,4 +522,32 @@ public class EarthBlast {
return broke;
}
public Player getPlayer() {
return player;
}
public double getRange() {
return range;
}
public void setRange(double range) {
this.range = range;
}
public double getDamage() {
return damage;
}
public void setDamage(double damage) {
this.damage = damage;
}
public double getPushfactor() {
return pushfactor;
}
public void setPushfactor(double pushfactor) {
this.pushfactor = pushfactor;
}
}

View file

@ -36,6 +36,7 @@ public class EarthSmash {
public static double GRAB_RANGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.GrabRange");
public static double TRAVEL_RANGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.ShotRange");
public static double SHOOTING_DAMAGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.Damage");
public static double KNOCKBACK_POWER = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.Knockback");
public static double KNOCKUP_POWER = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.Knockup");
public static double FLYING_PLAYER_SPEED = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.FlightSpeed");
@ -153,7 +154,7 @@ public class EarthSmash {
}
else if(state == State.START) {
String ability = Methods.getBoundAbility(player);
if(ability == null || !ability.equalsIgnoreCase("EarthSmash") || bplayer.isOnCooldown("earthsmashmain")) {
if(ability == null || !ability.equalsIgnoreCase("EarthSmash") || bplayer.isOnCooldown("EarthSmash")) {
remove();
return;
}
@ -173,7 +174,7 @@ public class EarthSmash {
remove();
return;
}
bplayer.addCooldown("earthsmashmain", cooldown);
bplayer.addCooldown("EarthSmash", cooldown);
loc = origin.getLocation();
state = State.LIFTING;
}
@ -660,4 +661,86 @@ public class EarthSmash {
return second;
}
}
public Player getPlayer() {
return player;
}
public void setPlayer(Player player) {
this.player = player;
}
public long getCooldown() {
return cooldown;
}
public void setCooldown(long cooldown) {
this.cooldown = cooldown;
if(player != null)
bplayer.addCooldown("EarthSmash", cooldown);
}
public double getGrabRange() {
return grabRange;
}
public void setGrabRange(double grabRange) {
this.grabRange = grabRange;
}
public double getChargeTime() {
return chargeTime;
}
public void setChargeTime(double chargeTime) {
this.chargeTime = chargeTime;
}
public double getDamage() {
return damage;
}
public void setDamage(double damage) {
this.damage = damage;
}
public double getKnockback() {
return knockback;
}
public void setKnockback(double knockback) {
this.knockback = knockback;
}
public double getKnockup() {
return knockup;
}
public void setKnockup(double knockup) {
this.knockup = knockup;
}
public double getFlySpeed() {
return flySpeed;
}
public void setFlySpeed(double flySpeed) {
this.flySpeed = flySpeed;
}
public double getShootRange() {
return shootRange;
}
public void setShootRange(double shootRange) {
this.shootRange = shootRange;
}
public long getFlightRemove() {
return flightRemove;
}
public void setFlightRemove(long flightRemove) {
this.flightRemove = flightRemove;
}
}

View file

@ -14,18 +14,22 @@ public class EarthTunnel {
public static ConcurrentHashMap<Player, EarthTunnel> instances = new ConcurrentHashMap<Player, EarthTunnel>();
private static final double maxradius = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthTunnel.MaxRadius");
private static final double range = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthTunnel.Range");
private static final double radiusinc = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthTunnel.Radius");
private static final double MAX_RADIUS = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthTunnel.MaxRadius");
private static final double RANGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthTunnel.Range");
private static final double RADIUS = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthTunnel.Radius");
private static boolean revert = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthTunnel.Revert");
private static final long interval = ProjectKorra.plugin.getConfig().getLong("Abilities.Earth.EarthTunnel.Interval");
private static final long INTERVAL = ProjectKorra.plugin.getConfig().getLong("Abilities.Earth.EarthTunnel.Interval");
private Player player;
private Block block;
private Location origin, location;
private Vector direction;
private double depth, radius, angle;
private double maxradius = MAX_RADIUS;
private double range = RANGE;
private double radiusinc = RADIUS;
private long interval = INTERVAL;
private long time;
public EarthTunnel(Player player) {
@ -112,4 +116,40 @@ public class EarthTunnel {
+ "if it hits a block that cannot be earthbent.";
}
public Player getPlayer() {
return player;
}
public double getMaxradius() {
return maxradius;
}
public void setMaxradius(double maxradius) {
this.maxradius = maxradius;
}
public double getRange() {
return range;
}
public void setRange(double range) {
this.range = range;
}
public double getRadiusinc() {
return radiusinc;
}
public void setRadiusinc(double radiusinc) {
this.radiusinc = radiusinc;
}
public long getInterval() {
return interval;
}
public void setInterval(long interval) {
this.interval = interval;
}
}

View file

@ -21,10 +21,10 @@ public class Ripple {
private static ConcurrentHashMap<Integer, Ripple> instances = new ConcurrentHashMap<Integer, Ripple>();
private static ConcurrentHashMap<Integer[], Block> blocks = new ConcurrentHashMap<Integer[], Block>();
static final double radius = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Shockwave.Range");
private static final double damage = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Shockwave.Damage");
static final double RADIUS = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Shockwave.Range");
private static final double DAMAGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Shockwave.Damage");
private static int ID = Integer.MIN_VALUE;
private static double knockback = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Shockwave.Knockback");
private static double KNOCKBACK = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Shockwave.Knockback");
private Player player;
private Vector direction;
@ -33,6 +33,9 @@ public class Ripple {
private int id;
private int step = 0;
private int maxstep;
private double radius = RADIUS;
private double damage = DAMAGE;
private double knockback = KNOCKBACK;
private ArrayList<Location> locations = new ArrayList<Location>();
private ArrayList<Entity> entities = new ArrayList<Entity>();
@ -295,4 +298,32 @@ public class Ripple {
}
public Player getPlayer() {
return player;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
public double getDamage() {
return damage;
}
public void setDamage(double damage) {
this.damage = damage;
}
public double getKnockback() {
return knockback;
}
public void setKnockback(double knockback) {
this.knockback = knockback;
}
}

View file

@ -89,7 +89,7 @@ public class Shockwave {
}
private static void areaShockwave(Player player) {
double dtheta = 360. / (2 * Math.PI * Ripple.radius) - 1;
double dtheta = 360. / (2 * Math.PI * Ripple.RADIUS) - 1;
for (double theta = 0; theta < 360; theta += dtheta) {
double rtheta = Math.toRadians(theta);
Vector vector = new Vector(Math.cos(rtheta), 0, Math.sin(rtheta));
@ -100,7 +100,7 @@ public class Shockwave {
public static void coneShockwave(Player player) {
if (instances.containsKey(player)) {
if (instances.get(player).charged) {
double dtheta = 360. / (2 * Math.PI * Ripple.radius) - 1;
double dtheta = 360. / (2 * Math.PI * Ripple.RADIUS) - 1;
for (double theta = 0; theta < 360; theta += dtheta) {
double rtheta = Math.toRadians(theta);
Vector vector = new Vector(Math.cos(rtheta), 0,
@ -129,4 +129,16 @@ public class Shockwave {
}
public Player getPlayer() {
return player;
}
public long getChargetime() {
return chargetime;
}
public void setChargetime(long chargetime) {
this.chargetime = chargetime;
}
}