From ef2f4d4224ecc3537663574258e7fd0bb1cb10ae Mon Sep 17 00:00:00 2001 From: Nathan Braun Date: Fri, 2 Jan 2015 00:31:15 -0800 Subject: [PATCH] Added get and set Methods to Fire abilities --- .../ProjectKorra/firebending/Cook.java | 23 +++- .../ProjectKorra/firebending/FireBlast.java | 57 +++++++- .../ProjectKorra/firebending/FireBurst.java | 28 ++++ .../ProjectKorra/firebending/FireJet.java | 20 +++ .../ProjectKorra/firebending/FireShield.java | 51 +++++++- .../ProjectKorra/firebending/FireStream.java | 12 ++ .../ProjectKorra/firebending/Fireball.java | 53 +++++++- .../ProjectKorra/firebending/Lightning.java | 123 +++++++++++++++++- .../ProjectKorra/firebending/WallOfFire.java | 83 +++++++++++- 9 files changed, 429 insertions(+), 21 deletions(-) diff --git a/src/com/projectkorra/ProjectKorra/firebending/Cook.java b/src/com/projectkorra/ProjectKorra/firebending/Cook.java index 555661e2..5f521ada 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/Cook.java +++ b/src/com/projectkorra/ProjectKorra/firebending/Cook.java @@ -15,7 +15,7 @@ public class Cook { private static ConcurrentHashMap instances = new ConcurrentHashMap(); - private static final long cooktime = 2000; + private static final long COOK_TIME = 2000; private static final Material[] cookables = { Material.RAW_BEEF, Material.RAW_CHICKEN, Material.RAW_FISH, Material.PORK, Material.POTATO_ITEM }; @@ -23,6 +23,7 @@ public class Cook { private Player player; private ItemStack items; private long time; + private long cooktime = COOK_TIME; public Cook(Player player) { this.player = player; @@ -135,4 +136,24 @@ public class Cook { instances.clear(); } + public Player getPlayer() { + return player; + } + + public long getTime() { + return time; + } + + public void setTime(long time) { + this.time = time; + } + + public long getCooktime() { + return cooktime; + } + + public void setCooktime(long cooktime) { + this.cooktime = cooktime; + } + } \ No newline at end of file diff --git a/src/com/projectkorra/ProjectKorra/firebending/FireBlast.java b/src/com/projectkorra/ProjectKorra/firebending/FireBlast.java index 4db59c84..ec48a688 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/FireBlast.java +++ b/src/com/projectkorra/ProjectKorra/firebending/FireBlast.java @@ -28,15 +28,15 @@ public class FireBlast { Random rand = new Random(); public static ConcurrentHashMap instances = new ConcurrentHashMap(); - private static double speed = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Speed"); - private static double pushfactor = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Push"); + private static double SPEED = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Speed"); + private static double PUSH_FACTOR = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Push"); private static double RANGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireBlast.Range"); static boolean dissipate = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate"); private static int DAMAGE = ProjectKorra.plugin.getConfig().getInt("Abilities.Fire.FireBlast.Damage"); long cooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Fire.FireBlast.Cooldown"); - public static double affectingradius = 2; + public static double AFFECTING_RADIUS = 2; // public static long interval = 2000; public static byte full = 0x0; private static int ID = Integer.MIN_VALUE; @@ -53,6 +53,9 @@ public class FireBlast { private int ticks = 0; private double range = RANGE; private double damage = DAMAGE; + private double speed = SPEED; + private double pushfactor = PUSH_FACTOR; + private double affectingradius = AFFECTING_RADIUS; private boolean showParticles = true; public FireBlast(Player player) { @@ -137,7 +140,7 @@ public class FireBlast { Methods.removeSpouts(location, player); - double radius = FireBlast.affectingradius; + double radius = affectingradius; Player source = player; if (EarthBlast.annihilateBlasts(location, radius, source) || WaterManipulation.annihilateBlasts(location, radius, source) @@ -288,4 +291,50 @@ public class FireBlast { + "fireball that explodes on contact."; } + public long getCooldown() { + return cooldown; + } + + public void setCooldown(long cooldown) { + this.cooldown = cooldown; + if(player != null) + Methods.getBendingPlayer(player.getName()).addCooldown("FireBlast", cooldown); + } + + public Player getPlayer() { + return player; + } + + public double getSpeed() { + return speed; + } + + public void setSpeed(double speed) { + this.speed = speed; + } + + public double getPushfactor() { + return pushfactor; + } + + public void setPushfactor(double pushfactor) { + this.pushfactor = pushfactor; + } + + public double getAffectingradius() { + return affectingradius; + } + + public void setAffectingradius(double affectingradius) { + this.affectingradius = affectingradius; + } + + public double getRange() { + return range; + } + + public double getDamage() { + return damage; + } + } \ No newline at end of file diff --git a/src/com/projectkorra/ProjectKorra/firebending/FireBurst.java b/src/com/projectkorra/ProjectKorra/firebending/FireBurst.java index 6daeded4..a4845a59 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/FireBurst.java +++ b/src/com/projectkorra/ProjectKorra/firebending/FireBurst.java @@ -177,4 +177,32 @@ public class FireBurst { instances.clear(); } + + public Player getPlayer() { + return player; + } + + public int getDamage() { + return damage; + } + + public void setDamage(int damage) { + this.damage = damage; + } + + public long getChargetime() { + return chargetime; + } + + public void setChargetime(long chargetime) { + this.chargetime = chargetime; + } + + public long getRange() { + return range; + } + + public void setRange(long range) { + this.range = range; + } } \ No newline at end of file diff --git a/src/com/projectkorra/ProjectKorra/firebending/FireJet.java b/src/com/projectkorra/ProjectKorra/firebending/FireJet.java index aba5e520..aee79dde 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/FireJet.java +++ b/src/com/projectkorra/ProjectKorra/firebending/FireJet.java @@ -106,4 +106,24 @@ public class FireJet { return players; } + public Player getPlayer() { + return player; + } + + public long getDuration() { + return duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + public double getFactor() { + return factor; + } + + public void setFactor(double factor) { + this.factor = factor; + } + } diff --git a/src/com/projectkorra/ProjectKorra/firebending/FireShield.java b/src/com/projectkorra/ProjectKorra/firebending/FireShield.java index 62839f2e..bc55e63a 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/FireShield.java +++ b/src/com/projectkorra/ProjectKorra/firebending/FireShield.java @@ -24,15 +24,18 @@ public class FireShield { private static ConcurrentHashMap instances = new ConcurrentHashMap(); private static long interval = 100; - private static long duration = ProjectKorra.plugin.getConfig().getLong("Abilities.Fire.FireShield.Duration"); - private static double radius = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireShield.Radius"); - private static double discradius = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireShield.DiscRadius"); + private static long DURATION = ProjectKorra.plugin.getConfig().getLong("Abilities.Fire.FireShield.Duration"); + private static double RADIUS = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireShield.Radius"); + private static double DISC_RADIUS = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireShield.DiscRadius"); private static boolean ignite = true; private Player player; private long time; private long starttime; private boolean shield = false; + private long duration = DURATION; + private double radius = RADIUS; + private double discradius = DISC_RADIUS; public FireShield(Player player) { this(player, false); @@ -183,12 +186,12 @@ public class FireShield { Location playerLoc = fshield.player.getLocation(); if(fshield.shield){ - if(playerLoc.distance(loc) <= FireShield.radius) + if(playerLoc.distance(loc) <= fshield.radius) return true; } else{ - Location tempLoc = playerLoc.clone().add(playerLoc.multiply(radius)); - if(tempLoc.distance(loc) <= FireShield.discradius) + Location tempLoc = playerLoc.clone().add(playerLoc.multiply(fshield.discradius)); + if(tempLoc.distance(loc) <= fshield.discradius) return true; } } @@ -212,4 +215,40 @@ public class FireShield { public static void removeAll() { instances.clear(); } + + public Player getPlayer() { + return player; + } + + public boolean isShield() { + return shield; + } + + public void setShield(boolean shield) { + this.shield = shield; + } + + public long getDuration() { + return duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + public double getRadius() { + return radius; + } + + public void setRadius(double radius) { + this.radius = radius; + } + + public double getDiscradius() { + return discradius; + } + + public void setDiscradius(double discradius) { + this.discradius = discradius; + } } diff --git a/src/com/projectkorra/ProjectKorra/firebending/FireStream.java b/src/com/projectkorra/ProjectKorra/firebending/FireStream.java index b0f56b8b..824f2c5b 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/FireStream.java +++ b/src/com/projectkorra/ProjectKorra/firebending/FireStream.java @@ -201,4 +201,16 @@ public class FireStream { } + public Player getPlayer() { + return player; + } + + public double getRange() { + return range; + } + + public void setRange(double range) { + this.range = range; + } + } diff --git a/src/com/projectkorra/ProjectKorra/firebending/Fireball.java b/src/com/projectkorra/ProjectKorra/firebending/Fireball.java index 7047bf8f..2ab757f6 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/Fireball.java +++ b/src/com/projectkorra/ProjectKorra/firebending/Fireball.java @@ -35,6 +35,7 @@ public class Fireball { private double maxdamage = MAX_DAMAGE; private double range = RANGE; private double explosionradius = DAMAGE_RADIUS; + private double power = POWER; private double innerradius = explosionradius / 2; private long starttime; private long time; @@ -211,7 +212,7 @@ public class Fireball { if (explode) { explosion = player.getWorld().spawn(location, TNTPrimed.class); explosion.setFuseTicks(0); - float yield = (float) POWER; + float yield = (float) power; if (!AvatarState.isAvatarState(player)) { if (Methods.isDay(player.getWorld())) { Methods.getFirebendingDayAugment(yield, player.getWorld()); @@ -246,7 +247,7 @@ public class Fireball { } private void ignite(Location location) { - for (Block block : Methods.getBlocksAroundPoint(location, FireBlast.affectingradius)) { + for (Block block : Methods.getBlocksAroundPoint(location, FireBlast.AFFECTING_RADIUS)) { if (FireStream.isIgnitable(player, block)) { block.setType(Material.FIRE); if (FireBlast.dissipate) { @@ -304,4 +305,52 @@ public class Fireball { return broke; } + + public double getMaxdamage() { + return maxdamage; + } + + public void setMaxdamage(double maxdamage) { + this.maxdamage = maxdamage; + } + + public double getRange() { + return range; + } + + public void setRange(double range) { + this.range = range; + } + + public double getExplosionradius() { + return explosionradius; + } + + public void setExplosionradius(double explosionradius) { + this.explosionradius = explosionradius; + } + + public double getPower() { + return power; + } + + public void setPower(double power) { + this.power = power; + } + + public double getInnerradius() { + return innerradius; + } + + public void setInnerradius(double innerradius) { + this.innerradius = innerradius; + } + + public long getChargetime() { + return chargetime; + } + + public void setChargetime(long chargetime) { + this.chargetime = chargetime; + } } \ No newline at end of file diff --git a/src/com/projectkorra/ProjectKorra/firebending/Lightning.java b/src/com/projectkorra/ProjectKorra/firebending/Lightning.java index bc9dce09..64875469 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/Lightning.java +++ b/src/com/projectkorra/ProjectKorra/firebending/Lightning.java @@ -193,7 +193,6 @@ public class Lightning { } return !Methods.isRegionProtectedFromBuild(player, "Lightning", block.getLocation()); - } public void electrocute(LivingEntity lent) { @@ -467,4 +466,126 @@ public class Lightning { } } } + + public Player getPlayer() { + return player; + } + + public void setPlayer(Player player) { + this.player = player; + } + + public double getRange() { + return range; + } + + public void setRange(double range) { + this.range = range; + } + + public double getChargeTime() { + return chargeTime; + } + + public void setChargeTime(double chargeTime) { + this.chargeTime = chargeTime; + } + + public double getCooldown() { + return cooldown; + } + + public void setCooldown(double cooldown) { + this.cooldown = cooldown; + if(player != null) + bplayer.addCooldown("Lightning", (long) cooldown); + } + + public double getSubArcChance() { + return subArcChance; + } + + public void setSubArcChance(double subArcChance) { + this.subArcChance = subArcChance; + } + + public double getDamage() { + return damage; + } + + public void setDamage(double damage) { + this.damage = damage; + } + + public double getChainArcs() { + return chainArcs; + } + + public void setChainArcs(double chainArcs) { + this.chainArcs = chainArcs; + } + + public double getChainRange() { + return chainRange; + } + + public void setChainRange(double chainRange) { + this.chainRange = chainRange; + } + + public double getWaterRange() { + return waterRange; + } + + public void setWaterRange(double waterRange) { + this.waterRange = waterRange; + } + + public double getChainArcChance() { + return chainArcChance; + } + + public void setChainArcChance(double chainArcChance) { + this.chainArcChance = chainArcChance; + } + + public double getStunChance() { + return stunChance; + } + + public void setStunChance(double stunChance) { + this.stunChance = stunChance; + } + + public double getStunDuration() { + return stunDuration; + } + + public void setStunDuration(double stunDuration) { + this.stunDuration = stunDuration; + } + + public boolean isCharged() { + return charged; + } + + public void setCharged(boolean charged) { + this.charged = charged; + } + + public boolean isHitWater() { + return hitWater; + } + + public void setHitWater(boolean hitWater) { + this.hitWater = hitWater; + } + + public boolean isHitIce() { + return hitIce; + } + + public void setHitIce(boolean hitIce) { + this.hitIce = hitIce; + } } \ No newline at end of file diff --git a/src/com/projectkorra/ProjectKorra/firebending/WallOfFire.java b/src/com/projectkorra/ProjectKorra/firebending/WallOfFire.java index dc57e64e..4ad9c726 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/WallOfFire.java +++ b/src/com/projectkorra/ProjectKorra/firebending/WallOfFire.java @@ -26,20 +26,27 @@ public class WallOfFire { private static double maxangle = 50; public static FileConfiguration config = ProjectKorra.plugin.getConfig(); - private static int range = config.getInt("Abilities.Fire.WallOfFire.Range"); - private int height = config.getInt("Abilities.Fire.WallOfFire.Height"); - private int width = config.getInt("Abilities.Fire.WallOfFire.Width"); - private long duration = config.getLong("Abilities.Fire.WallOfFire.Duration"); - private int damage = config.getInt("Abilities.Fire.WallOfFire.Damage"); + private static int RANGE = config.getInt("Abilities.Fire.WallOfFire.Range"); + private int HEIGHT = config.getInt("Abilities.Fire.WallOfFire.Height"); + private int WIDTH = config.getInt("Abilities.Fire.WallOfFire.Width"); + private long DURATION = config.getLong("Abilities.Fire.WallOfFire.Duration"); + private int DAMAGE = config.getInt("Abilities.Fire.WallOfFire.Damage"); private static long interval = 250; - private static long cooldown = config.getLong("Abilities.Fire.WallOfFire.Cooldown"); + private static long COOLDOWN = config.getLong("Abilities.Fire.WallOfFire.Cooldown"); public static ConcurrentHashMap instances = new ConcurrentHashMap(); - private static long damageinterval = config.getLong("Abilities.Fire.WallOfFire.Interval"); + private static long DAMAGE_INTERVAL = config.getLong("Abilities.Fire.WallOfFire.Interval"); private Location origin; private long time, starttime; private boolean active = true; private int damagetick = 0, intervaltick = 0; + private int range = RANGE; + private int height = HEIGHT; + private int width = WIDTH; + private long duration = DURATION; + private int damage = DAMAGE; + private long cooldown = COOLDOWN; + private long damageinterval = DAMAGE_INTERVAL; private List blocks = new ArrayList(); public WallOfFire(Player player) { @@ -192,4 +199,66 @@ public class WallOfFire { instances.get(player).progress(); } } + + public Player getPlayer() { + return player; + } + + public int getRange() { + return range; + } + + public void setRange(int range) { + this.range = range; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public long getDuration() { + return duration; + } + + public void setDuration(long duration) { + this.duration = duration; + } + + public int getDamage() { + return damage; + } + + public void setDamage(int damage) { + this.damage = damage; + } + + public long getCooldown() { + return cooldown; + } + + public void setCooldown(long cooldown) { + this.cooldown = cooldown; + if(player != null) + Methods.getBendingPlayer(player.getName()).addCooldown("WallOfFire", cooldown); + } + + public long getDamageinterval() { + return damageinterval; + } + + public void setDamageinterval(long damageinterval) { + this.damageinterval = damageinterval; + } }