From f112190d7210dfdc2244b3f24d8642fadaeb41dc Mon Sep 17 00:00:00 2001 From: StrangeOne101 Date: Sun, 28 Oct 2018 19:58:45 +1300 Subject: [PATCH] Make Combos Translatable (#984) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Moved all hardcoded combo instruction values to the language file config. • Changed default getInstructions() method to change the path if it's a combo in order to get the correct configuration value. --- .../projectkorra/ability/CoreAbility.java | 3 +++ .../projectkorra/airbending/combo/AirStream.java | 5 ----- .../projectkorra/airbending/combo/AirSweep.java | 5 ----- .../projectkorra/airbending/combo/Twister.java | 5 ----- .../projectkorra/chiblocking/combo/Immobilize.java | 5 ----- .../projectkorra/configuration/ConfigManager.java | 13 +++++++++++++ .../earthbending/combo/EarthDomeSelf.java | 5 ----- .../earthbending/combo/EarthPillars.java | 5 ----- .../projectkorra/firebending/combo/FireKick.java | 5 ----- .../projectkorra/firebending/combo/FireSpin.java | 5 ----- .../projectkorra/firebending/combo/FireWheel.java | 5 ----- .../projectkorra/firebending/combo/JetBlast.java | 6 ------ .../projectkorra/firebending/combo/JetBlaze.java | 5 ----- .../projectkorra/waterbending/combo/IceBullet.java | 5 ----- .../projectkorra/waterbending/combo/IceWave.java | 5 ----- 15 files changed, 16 insertions(+), 66 deletions(-) diff --git a/src/com/projectkorra/projectkorra/ability/CoreAbility.java b/src/com/projectkorra/projectkorra/ability/CoreAbility.java index 3a6340de..38c66fd5 100644 --- a/src/com/projectkorra/projectkorra/ability/CoreAbility.java +++ b/src/com/projectkorra/projectkorra/ability/CoreAbility.java @@ -796,6 +796,9 @@ public abstract class CoreAbility implements Ability { if (this.getElement() instanceof SubElement) { elementName = ((SubElement) this.getElement()).getParentElement().getName(); } + if (this instanceof ComboAbility) { + elementName = elementName + ".Combo"; + } return ConfigManager.languageConfig.get().contains("Abilities." + elementName + "." + this.getName() + ".Instructions") ? ConfigManager.languageConfig.get().getString("Abilities." + elementName + "." + this.getName() + ".Instructions") : ""; } diff --git a/src/com/projectkorra/projectkorra/airbending/combo/AirStream.java b/src/com/projectkorra/projectkorra/airbending/combo/AirStream.java index c0f49d34..b66c5028 100644 --- a/src/com/projectkorra/projectkorra/airbending/combo/AirStream.java +++ b/src/com/projectkorra/projectkorra/airbending/combo/AirStream.java @@ -313,9 +313,4 @@ public class AirStream extends AirAbility implements ComboAbility { public void setCooldown(final long cooldown) { this.cooldown = cooldown; } - - @Override - public String getInstructions() { - return "AirShield (Hold Shift) > AirSuction (Left Click) > AirBlast (Left Click)"; - } } diff --git a/src/com/projectkorra/projectkorra/airbending/combo/AirSweep.java b/src/com/projectkorra/projectkorra/airbending/combo/AirSweep.java index 35edbdc5..cf9f9390 100644 --- a/src/com/projectkorra/projectkorra/airbending/combo/AirSweep.java +++ b/src/com/projectkorra/projectkorra/airbending/combo/AirSweep.java @@ -333,9 +333,4 @@ public class AirSweep extends AirAbility implements ComboAbility { public void setTasks(final ArrayList tasks) { this.tasks = tasks; } - - @Override - public String getInstructions() { - return "AirSwipe (Left Click) > AirSwipe (Left Click) > AirBurst (Hold Shift) > AirBurst (Left Click)"; - } } diff --git a/src/com/projectkorra/projectkorra/airbending/combo/Twister.java b/src/com/projectkorra/projectkorra/airbending/combo/Twister.java index 36e13576..0c84fa89 100644 --- a/src/com/projectkorra/projectkorra/airbending/combo/Twister.java +++ b/src/com/projectkorra/projectkorra/airbending/combo/Twister.java @@ -194,9 +194,4 @@ public class Twister extends AirAbility implements ComboAbility { twister.add(new AbilityInformation("AirBlast", ClickType.LEFT_CLICK)); return twister; } - - @Override - public String getInstructions() { - return "AirShield (Tap Shift) > Tornado (Hold Shift) > AirBlast (Left Click)"; - } } diff --git a/src/com/projectkorra/projectkorra/chiblocking/combo/Immobilize.java b/src/com/projectkorra/projectkorra/chiblocking/combo/Immobilize.java index 19eab5f0..b3894dec 100644 --- a/src/com/projectkorra/projectkorra/chiblocking/combo/Immobilize.java +++ b/src/com/projectkorra/projectkorra/chiblocking/combo/Immobilize.java @@ -118,9 +118,4 @@ public class Immobilize extends ChiAbility implements ComboAbility { public void setCooldown(final long cooldown) { this.cooldown = cooldown; } - - @Override - public String getInstructions() { - return "QuickStrike > SwiftKick > QuickStrike > QuickStrike"; - } } diff --git a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java index c296b3f4..f3462e59 100644 --- a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java +++ b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java @@ -269,9 +269,12 @@ public class ConfigManager { config.addDefault("Abilities.Air.Suffocate.Instructions", "Hold sneak while looking at a target to begin suffocating them. If the target goes out of range, you get damaged, or you release sneak, the ability will cancel."); config.addDefault("Abilities.Air.Suffocate.DeathMessage", "{victim} was asphyxiated by {attacker}'s {ability}"); config.addDefault("Abilities.Air.Combo.Twister.Description", "Create a cyclone of air that travels along the ground grabbing nearby entities."); + config.addDefault("Abilities.Air.Combo.Twister.Instructions", "AirShield (Tap Shift) > Tornado (Hold Shift) > AirBlast (Left Click)"); config.addDefault("Abilities.Air.Combo.AirStream.Description", "Control a large stream of air that grabs onto enemies allowing you to direct them temporarily."); + config.addDefault("Abilities.Air.Combo.AirStream.Instructions", "AirShield (Hold Shift) > AirSuction (Left Click) > AirBlast (Left Click)"); config.addDefault("Abilities.Air.Combo.AirSweep.Description", "Sweep the air in front of you hitting multiple enemies, causing moderate damage and a large knockback. The radius and direction of AirSweep is controlled by moving your mouse in a sweeping motion. For example, if you want to AirSweep upward, then move your mouse upward right after you left click AirBurst"); config.addDefault("Abilities.Air.Combo.AirSweep.DeathMessage", "{victim} was swept away by {attacker}'s {ability}"); + config.addDefault("Abilities.Air.Combo.AirSweep.Instructions", "AirSwipe (Left Click) > AirSwipe (Left Click) > AirBurst (Hold Shift) > AirBurst (Left Click)"); config.addDefault("Abilities.Air.Passive.AirAgility.Description", "AirAgility is a passive ability which enables airbenders to run faster and jump higher."); config.addDefault("Abilities.Air.Passive.AirSaturation.Description", "AirSaturation is a passive ability which causes airbenders' hunger to deplete at a slower rate."); config.addDefault("Abilities.Air.Passive.GracefulDescent.Description", "GracefulDescent is a passive ability which allows airbenders to make a gentle landing, negating all fall damage on any surface."); @@ -314,8 +317,10 @@ public class ConfigManager { config.addDefault("Abilities.Water.WaterSpout.Instructions", "\n" + "(Spout) Left click to activate a spout beneath you and hold spacebar to go higher. If you wish to go lower, simply hold sneak. To disable this ability, left click once again." + "\n" + "(Wave) Left click a water source and hold sneak until water has formed around you. Then, release sneak to ride a water wave that transports you in the direction you're looking. To cancel this water wave, left click with WaterSpout."); config.addDefault("Abilities.Water.Combo.IceBullet.Description", "Using a large cavern of ice, you can punch ice shards at your opponent causing moderate damage. To rapid fire, you must alternate between Left clicking and right clicking with IceBlast."); config.addDefault("Abilities.Water.Combo.IceBullet.DeathMessage", "{victim}'s heart was frozen by {attacker}'s {ability}"); + config.addDefault("Abilities.Water.Combo.IceBullet.Instructions", "WaterBubble (Tap Shift) > IceBlast (Hold Shift) > Wait for ice to Form > Then alternate between Left and Right click with IceBlast"); config.addDefault("Abilities.Water.Combo.IceWave.Description", "PhaseChange your WaterWave into an IceWave that freezes and damages enemies."); config.addDefault("Abilities.Water.Combo.IceWave.DeathMessage", "{victim} was frozen solid by {attacker}'s {ability}"); + config.addDefault("Abilities.Water.Combo.IceWave.Instructions", "Create a WaterSpout Wave > PhaseChange (Left Click)"); config.addDefault("Abilities.Water.Passive.FastSwim.Description", "FastSwim is a passive ability for waterbenders allowing them to travel quickly through the water. Simple hold shift while underwater to propel yourself forward."); config.addDefault("Abilities.Water.Passive.HydroSink.Description", "Hydrosink is a passive ability for waterbenders enabling them to softly land on any waterbendable surface, cancelling all damage."); @@ -353,7 +358,9 @@ public class ConfigManager { config.addDefault("Abilities.Earth.Tremorsense.Description", "This is a pure utility ability for earthbenders. If you are in an area of low-light and are standing on top of an earthbendable block, this ability will automatically turn that block into glowstone, visible *only by you*. If you lose contact with a bendable block, the light will go out as you have lost contact with the earth and cannot 'see' until you can touch earth again. Additionally, if you click with this ability selected, smoke will appear above nearby earth with pockets of air beneath them."); config.addDefault("Abilities.Earth.Tremorsense.Instructions", "Simply left click while on an earthbendable block."); config.addDefault("Abilities.Earth.Combo.EarthDome.Description", "EarthDome allows earthbenders to surround themselves or another entity in earth, temporarily preventing anything from entering or escaping the dome."); + config.addDefault("Abilities.Earth.Combo.EarthDome.Instructions", "(Self) RaiseEarth (Right click) > Shockwave (Right click)\\n(Projection) RaiseEarth(Right click) > Shockwave (Left click)"); config.addDefault("Abilities.Earth.Combo.EarthPillars.Description", "Send players and entities flying into the air and possibly stunning them by raising pillars of earth under their feet, dealing damage initally as well. This combo can also be used by falling from high off the ground and landing while on the Catapult ability"); + config.addDefault("Abilities.Earth.Combo.EarthPillars.Instructions", "Shockwave (Tap sneak) > Shockwave (Hold sneak) > Catapult (Release sneak)"); config.addDefault("Abilities.Earth.Passive.DensityShift.Description", "DensityShift is a passive ability which allows earthbenders to make a firm landing negating all fall damage on any earthbendable surface."); config.addDefault("Abilities.Earth.Passive.FerroControl.Description", "FerroControl is a passive ability which allows metalbenders to simply open and close iron doors by sneaking."); @@ -390,13 +397,18 @@ public class ConfigManager { config.addDefault("Abilities.Fire.WallOfFire.DeathMessage", "{victim} ran into {attacker}'s {ability}"); config.addDefault("Abilities.Fire.Combo.FireKick.Description", "A short ranged arc of fire launches from the player's feet dealing moderate damage to enemies."); config.addDefault("Abilities.Fire.Combo.FireKick.DeathMessage", "{victim} was kicked to the floor, in flames, from {attacker}'s {ability}"); + config.addDefault("Abilities.Fire.Combo.FireKick.Instructions", "FireBlast > FireBlast > (Hold sneak) > FireBlast"); config.addDefault("Abilities.Fire.Combo.FireSpin.Description", "A circular array of fire that causes damage and massive knockback to nearby enemies."); config.addDefault("Abilities.Fire.Combo.FireSpin.DeathMessage", "{victim} was caught in {attacker}'s {ability} inferno"); + config.addDefault("Abilities.Fire.Combo.FireSpin.Instructions", "FireBlast > FireBlast > FireShield (Left Click) > FireShield (Tap Shift)"); config.addDefault("Abilities.Fire.Combo.JetBlaze.Description", "Damages and burns all enemies in the proximity of your FireJet."); config.addDefault("Abilities.Fire.Combo.JetBlaze.DeathMessage", "{victim} was lit ablaze by {attacker}'s {ability}"); + config.addDefault("Abilities.Fire.Combo.JetBlaze.Instructions", "FireJet (Tap Shift) > FireJet (Tap Shift) > Blaze (Tap Shift) > FireJet"); config.addDefault("Abilities.Fire.Combo.JetBlast.Description", "Create an explosive blast that propels your FireJet at higher speeds."); + config.addDefault("Abilities.Fire.Combo.JetBlast.Instructions", "FireJet (Tap Shift) > FireJet (Tap Shift) > FireShield (Tap Shift) > FireJet"); config.addDefault("Abilities.Fire.Combo.FireWheel.Description", "A high-speed wheel of fire that travels along the ground for long distances dealing high damage."); config.addDefault("Abilities.Fire.Combo.FireWheel.DeathMessage", "{victim} was incinerated by {attacker}'s {ability}"); + config.addDefault("Abilities.Fire.Combo.FireWheel.Instructions", "FireShield (Hold Shift) > Right Click a block in front of you twice > Switch to Blaze > Release Shift"); config.addDefault("Commands.Help.Elements.Chi", "Chiblockers focus on bare handed combat, utilizing their agility and speed to stop any bender right in their path. Although they lack the ability to bend any of the other elements, they are great in combat, and a serious threat to any bender. Chiblocking was first shown to be used by Ty Lee in Avatar: The Last Airbender, then later by members of the Equalists in The Legend of Korra.\nEnter /b display Chi for a list of the available chi abilities."); config.addDefault("Abilities.Chi.AcrobatStance.Description", "AcrobatStance gives a Chiblocker a higher probability of blocking a Bender's Chi while granting them a Speed and Jump Boost. It also increases the rate at which the hunger bar depletes."); @@ -419,6 +431,7 @@ public class ConfigManager { config.addDefault("Abilities.Chi.SwiftKick.Instructions", "Jump and left click on a player to swift kick them."); config.addDefault("Abilities.Chi.SwiftKick.DeathMessage", "{victim} was kicked to the floor by {attacker}'s {ability}"); config.addDefault("Abilities.Chi.Combo.Immobilize.Description", "Immobilizes the opponent for several seconds."); + config.addDefault("Abilities.Chi.Combo.Immobilize.Instructions", "QuickStrike > SwiftKick > QuickStrike > QuickStrike"); config.addDefault("Abilities.Chi.Passive.ChiAgility.Description", "ChiAgility is a passive ability which enables chiblockers to run faster and jump higher."); config.addDefault("Abilities.Chi.Passive.ChiSaturation.Description", "ChiSaturation is a passive ability which causes chiblockers' hunger to deplete at a slower rate."); config.addDefault("Abilities.Chi.Passive.Acrobatics.Description", "Acrobatics is a passive ability which negates all fall damage based on a percent chance."); diff --git a/src/com/projectkorra/projectkorra/earthbending/combo/EarthDomeSelf.java b/src/com/projectkorra/projectkorra/earthbending/combo/EarthDomeSelf.java index 34919871..1ef27124 100644 --- a/src/com/projectkorra/projectkorra/earthbending/combo/EarthDomeSelf.java +++ b/src/com/projectkorra/projectkorra/earthbending/combo/EarthDomeSelf.java @@ -60,9 +60,4 @@ public class EarthDomeSelf extends EarthAbility implements ComboAbility { combo.add(new AbilityInformation("Shockwave", ClickType.RIGHT_CLICK_BLOCK)); return combo; } - - @Override - public String getInstructions() { - return "\n(Self) RaiseEarth (Right click) > Shockwave (Right click)\n(Projection) RaiseEarth(Right click) > Shockwave (Left click)"; - } } diff --git a/src/com/projectkorra/projectkorra/earthbending/combo/EarthPillars.java b/src/com/projectkorra/projectkorra/earthbending/combo/EarthPillars.java index 2f4a88f6..c46eaf87 100644 --- a/src/com/projectkorra/projectkorra/earthbending/combo/EarthPillars.java +++ b/src/com/projectkorra/projectkorra/earthbending/combo/EarthPillars.java @@ -161,9 +161,4 @@ public class EarthPillars extends EarthAbility implements ComboAbility { earthPillars.add(new AbilityInformation("Catapult", ClickType.SHIFT_UP)); return earthPillars; } - - @Override - public String getInstructions() { - return "Shockwave (Tap sneak) > Shockwave (Hold sneak) > Catapult (Release sneak)"; - } } diff --git a/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java b/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java index bd56c1ec..eb055423 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java @@ -209,9 +209,4 @@ public class FireKick extends FireAbility implements ComboAbility { public void setTasks(final ArrayList tasks) { this.tasks = tasks; } - - @Override - public String getInstructions() { - return "FireBlast > FireBlast > (Hold sneak) > FireBlast"; - } } diff --git a/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java b/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java index 9483ff4d..dfaa488f 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java @@ -212,9 +212,4 @@ public class FireSpin extends FireAbility implements ComboAbility { public void setTasks(final ArrayList tasks) { this.tasks = tasks; } - - @Override - public String getInstructions() { - return "FireBlast > FireBlast > FireShield (Left Click) > FireShield (Tap Shift)"; - } } diff --git a/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java b/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java index ed7f0f3b..00bbf545 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java @@ -185,9 +185,4 @@ public class FireWheel extends FireAbility implements ComboAbility { public ArrayList getAffectedEntities() { return this.affectedEntities; } - - @Override - public String getInstructions() { - return "FireShield (Hold Shift) > Right Click a block in front of you twice > Switch to Blaze > Release Shift"; - } } diff --git a/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java b/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java index 9829e7f5..5cb56d08 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java @@ -124,10 +124,4 @@ public class JetBlast extends FireAbility implements ComboAbility { public boolean isHarmlessAbility() { return false; } - - @Override - public String getInstructions() { - return "FireJet (Tap Shift) > FireJet (Tap Shift) > FireShield (Tap Shift) > FireJet"; - } - } diff --git a/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java b/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java index 92657d56..849e9275 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java @@ -143,9 +143,4 @@ public class JetBlaze extends FireAbility implements ComboAbility { public ArrayList getAffectedEntities() { return this.affectedEntities; } - - @Override - public String getInstructions() { - return "FireJet (Tap Shift) > FireJet (Tap Shift) > Blaze (Tap Shift) > FireJet"; - } } diff --git a/src/com/projectkorra/projectkorra/waterbending/combo/IceBullet.java b/src/com/projectkorra/projectkorra/waterbending/combo/IceBullet.java index 6e13afa9..c780d6db 100644 --- a/src/com/projectkorra/projectkorra/waterbending/combo/IceBullet.java +++ b/src/com/projectkorra/projectkorra/waterbending/combo/IceBullet.java @@ -545,9 +545,4 @@ public class IceBullet extends IceAbility implements ComboAbility { public void setName(final String name) { this.name = name; } - - @Override - public String getInstructions() { - return "WaterBubble (Tap Shift) > IceBlast (Hold Shift) > Wait for ice to Form > Then alternate between Left and Right click with IceBlast"; - } } diff --git a/src/com/projectkorra/projectkorra/waterbending/combo/IceWave.java b/src/com/projectkorra/projectkorra/waterbending/combo/IceWave.java index d8e56ba7..ef29923d 100644 --- a/src/com/projectkorra/projectkorra/waterbending/combo/IceWave.java +++ b/src/com/projectkorra/projectkorra/waterbending/combo/IceWave.java @@ -125,9 +125,4 @@ public class IceWave extends IceAbility implements ComboAbility { iceWave.add(new AbilityInformation("PhaseChange", ClickType.LEFT_CLICK)); return iceWave; } - - @Override - public String getInstructions() { - return "Create a WaterSpout Wave > PhaseChange (Left Click)"; - } }