mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Change combo display method, Add getAbilitySubElement()
• Combos now displayed in /bending display Fire/Water/Air/Earth/ChiCombos • Combo usage is now displayed in /bending help ComboName • Using /bending help <Element>Combo shows correct usage, just so people get used to the new method (still much easier). • GeneralMethods has 3 new methods • GeneralMethods.getComboColor(...) - Returns ChatColor • GeneralMethods.getComboElement(...) - Returns Element • GeneralMethods.getAbilitySubElement(...) - Returns the sub element of the ability specified if it has one
This commit is contained in:
parent
a1288b40e3
commit
5f66331fad
3 changed files with 275 additions and 107 deletions
|
@ -2,8 +2,7 @@ package com.projectkorra.projectkorra;
|
|||
|
||||
import com.projectkorra.projectkorra.ability.AbilityModuleManager;
|
||||
import com.projectkorra.projectkorra.ability.StockAbility;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboAbilityModule;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboModuleManager;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboManager;
|
||||
import com.projectkorra.projectkorra.ability.multiability.MultiAbilityManager;
|
||||
import com.projectkorra.projectkorra.airbending.AirMethods;
|
||||
import com.projectkorra.projectkorra.chiblocking.ChiMethods;
|
||||
|
@ -67,6 +66,15 @@ public class Commands {
|
|||
String[] earthaliases = { "earth", "e", "earthbending", "earthbender" };
|
||||
String[] firealiases = { "fire", "f", "firebending", "firebender" };
|
||||
String[] wateraliases = { "water", "w", "waterbending", "waterbender" };
|
||||
|
||||
/*
|
||||
* Combo Aliases
|
||||
*/
|
||||
String[] aircomboaliases = { "aircombo", "ac", "aircombos", "airbendingcombos"};
|
||||
String[] chicomboaliases = { "chicombo", "cc", "chicombos", "chiblockingcombos", "chiblockercombos"};
|
||||
String[] earthcomboaliases = { "earthcombo", "ec", "earthcombos", "earthbendingcombos" };
|
||||
String[] firecomboaliases = { "firecombo", "fc", "firecombos", "firebendingcombos" };
|
||||
String[] watercomboaliases = { "watercombo", "wc", "watercombos", "waterbendingcombos" };
|
||||
|
||||
/*
|
||||
* Subelement Aliases
|
||||
|
@ -932,7 +940,87 @@ public class Commands {
|
|||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
|
||||
if (Arrays.asList(aircomboaliases).contains(args[1]))
|
||||
{
|
||||
ArrayList<String> aircombos = ComboManager.getCombosForElement(Element.Air);
|
||||
if (aircombos.isEmpty()) {
|
||||
s.sendMessage(AirMethods.getAirColor() + "There are no airbending combos avaliable.");
|
||||
return true;
|
||||
}
|
||||
for (String combomove : aircombos) {
|
||||
if (!s.hasPermission("bending.ability." + combomove)) continue;
|
||||
ChatColor color = GeneralMethods.getComboColor(combomove);
|
||||
s.sendMessage(color + combomove);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Arrays.asList(firecomboaliases).contains(args[1]))
|
||||
{
|
||||
ArrayList<String> firecombos = ComboManager.getCombosForElement(Element.Fire);
|
||||
if (firecombos.isEmpty()) {
|
||||
s.sendMessage(FireMethods.getFireColor() + "There are no firebending combos avaliable.");
|
||||
return true;
|
||||
}
|
||||
|
||||
for (String combomove : firecombos) {
|
||||
if (!s.hasPermission("bending.ability." + combomove)) continue;
|
||||
ChatColor color = GeneralMethods.getComboColor(combomove);
|
||||
s.sendMessage(color + combomove);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Arrays.asList(earthcomboaliases).contains(args[1]))
|
||||
{
|
||||
ArrayList<String> earthcombos = ComboManager.getCombosForElement(Element.Earth);
|
||||
if (earthcombos.isEmpty()) {
|
||||
s.sendMessage(EarthMethods.getEarthColor() + "There are no earthbending combos avaliable.");
|
||||
return true;
|
||||
}
|
||||
|
||||
for (String combomove : earthcombos) {
|
||||
if (!s.hasPermission("bending.ability." + combomove)) continue;
|
||||
ChatColor color = GeneralMethods.getComboColor(combomove);
|
||||
s.sendMessage(color + combomove);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Arrays.asList(watercomboaliases).contains(args[1]))
|
||||
{
|
||||
ArrayList<String> watercombos = ComboManager.getCombosForElement(Element.Water);
|
||||
if (watercombos.isEmpty()) {
|
||||
s.sendMessage(WaterMethods.getWaterColor() + "There are no waterbending combos avaliable.");
|
||||
return true;
|
||||
}
|
||||
|
||||
for (String combomove : watercombos) {
|
||||
if (!s.hasPermission("bending.ability." + combomove)) continue;
|
||||
ChatColor color = GeneralMethods.getComboColor(combomove);
|
||||
s.sendMessage(color + combomove);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Arrays.asList(chicomboaliases).contains(args[1]))
|
||||
{
|
||||
ArrayList<String> chicombos = ComboManager.getCombosForElement(Element.Chi);
|
||||
if (chicombos.isEmpty()) {
|
||||
s.sendMessage(WaterMethods.getWaterColor() + "There are no chiblocking combos avaliable.");
|
||||
return true;
|
||||
}
|
||||
|
||||
for (String combomove : chicombos) {
|
||||
if (!s.hasPermission("bending.ability." + combomove)) continue;
|
||||
s.sendMessage(ChiMethods.getChiColor() + combomove);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
else {
|
||||
s.sendMessage(ChatColor.RED + "Not a valid Element." + ChatColor.WHITE + " Elements: " + AirMethods.getAirColor() + "Air" + ChatColor.WHITE + " | " + WaterMethods.getWaterColor() + "Water" + ChatColor.WHITE + " | " + EarthMethods.getEarthColor() + "Earth" + ChatColor.WHITE + " | " + FireMethods.getFireColor() + "Fire" + ChatColor.WHITE + " | " + ChiMethods.getChiColor() + "Chi");
|
||||
}
|
||||
}
|
||||
|
@ -1809,101 +1897,19 @@ public class Commands {
|
|||
}
|
||||
|
||||
if (args[1].equalsIgnoreCase("FireCombo")) {
|
||||
s.sendMessage(ChatColor.GOLD + "Fire Combos:");
|
||||
s.sendMessage(FireMethods.getFireColor() + "FireKick" + ChatColor.WHITE + ": A short ranged arc of fire launches from the player's feet dealing moderate damage to enemies.");
|
||||
s.sendMessage(ChatColor.GOLD + "FireBlast > FireBlast > (Hold Shift) > FireBlast. ");
|
||||
s.sendMessage(FireMethods.getFireColor() + "FireSpin" + ChatColor.WHITE + ": A circular array of fire that causes damage and massive knockback to nearby enemies.");
|
||||
s.sendMessage(ChatColor.GOLD + "FireBlast > FireBlast > FireShield > (Tap Shift). ");
|
||||
s.sendMessage(FireMethods.getFireColor() + "FireWheel" + ChatColor.WHITE + ": A high-speed wheel of fire that travels along the ground for long distances dealing high damage.");
|
||||
s.sendMessage(ChatColor.GOLD + "FireShield (Hold Shift) > Right Click a block in front of you twice > Switch to Blaze > Release Shift. ");
|
||||
s.sendMessage(FireMethods.getFireColor() + "JetBlast" + ChatColor.WHITE + ": Create an explosive blast that propels your FireJet at higher speeds.");
|
||||
s.sendMessage(ChatColor.GOLD + "FireJet (Tap Shift) > FireJet (Tap Shift) > FireShield (Tap Shift) > FireJet. ");
|
||||
s.sendMessage(FireMethods.getFireColor() + "JetBlaze" + ChatColor.WHITE + ": Damages and burns all enemies in the proximity of your FireJet.");
|
||||
s.sendMessage(ChatColor.GOLD + "FireJet (Tap Shift) > FireJet (Tap Shift) > Blaze (Tap Shift) > FireJet. ");
|
||||
for (ComboAbilityModule cam : ComboModuleManager.combo) {
|
||||
if (cam.getElement().equals(Element.Fire.toString())) {
|
||||
ChatColor color = GeneralMethods.getAvatarColor();
|
||||
if (cam.getSubElement() == null) {
|
||||
color = FireMethods.getFireColor();
|
||||
} else {
|
||||
color = GeneralMethods.getSubBendingColor(Element.Fire);
|
||||
}
|
||||
s.sendMessage(color + cam.getName() + ChatColor.WHITE + ": " + cam.getDescription());
|
||||
s.sendMessage(ChatColor.GOLD + cam.getInstructions());
|
||||
}
|
||||
}
|
||||
s.sendMessage(ChatColor.GOLD + "Proper Usage: " + ChatColor.RED + "/bending display FireCombos" + ChatColor.GOLD + " or " + ChatColor.RED + "/bending help <comboname>");
|
||||
}
|
||||
if (args[1].equalsIgnoreCase("AirCombo")) {
|
||||
s.sendMessage(ChatColor.GOLD + "AirCombo:");
|
||||
s.sendMessage(AirMethods.getAirColor() + "Twister" + ChatColor.WHITE + ": Create a cyclone of air that travels along the ground grabbing nearby entities.");
|
||||
s.sendMessage(ChatColor.GOLD + "AirShield (Tap Shift) > Tornado (Hold Shift) > AirBlast (Left Click)");
|
||||
s.sendMessage(AirMethods.getAirColor() + "AirStream" + ChatColor.WHITE + ": Control a large stream of air that grabs onto enemies allowing you to direct them temporarily.");
|
||||
s.sendMessage(ChatColor.GOLD + "AirShield (Hold Shift) > AirSuction (Left Click) > AirBlast (Left Click)");
|
||||
s.sendMessage(AirMethods.getAirColor() + "AirSweep" + ChatColor.WHITE + ": 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");
|
||||
s.sendMessage(ChatColor.GOLD + "AirSwipe (Left Click) > AirSwipe (Left Click) > AirBurst (Hold Shift) > AirBurst (Left Click)");
|
||||
for (ComboAbilityModule cam : ComboModuleManager.combo) {
|
||||
if (cam.getElement().equals(Element.Air.toString())) {
|
||||
ChatColor color = GeneralMethods.getAvatarColor();
|
||||
if (cam.getSubElement() == null) {
|
||||
color = AirMethods.getAirColor();
|
||||
} else {
|
||||
color = GeneralMethods.getSubBendingColor(Element.valueOf(cam.getElement()));
|
||||
}
|
||||
s.sendMessage(color + cam.getName() + ChatColor.WHITE + ": " + cam.getDescription());
|
||||
s.sendMessage(ChatColor.GOLD + cam.getInstructions());
|
||||
}
|
||||
}
|
||||
s.sendMessage(ChatColor.GOLD + "Proper Usage: " + ChatColor.RED + "/bending display AirCombos" + ChatColor.GOLD + " or " + ChatColor.RED + "/bending help <comboname>");
|
||||
}
|
||||
if (args[1].equalsIgnoreCase("WaterCombo")) {
|
||||
s.sendMessage(ChatColor.GOLD + "WaterCombos:");
|
||||
s.sendMessage(WaterMethods.getWaterColor() + "IceWave" + ChatColor.WHITE + ": PhaseChange your WaterWave into an IceWave that freezes and damages enemies.");
|
||||
s.sendMessage(ChatColor.GOLD + "Create a WaterSpout Wave > PhaseChange (Left Click)");
|
||||
s.sendMessage(WaterMethods.getWaterColor() + "IceBullet" + ChatColor.WHITE + ": 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.");
|
||||
s.sendMessage(ChatColor.GOLD + "WaterBubble (Tap Shift) > IceBlast (Hold Shift) > IceBlast (Left Click) > Wait for ice to Form > Then alternate between Left and Right click with IceBlast");
|
||||
for (ComboAbilityModule cam : ComboModuleManager.combo) {
|
||||
if (cam.getElement().equals(Element.Water.toString())) {
|
||||
ChatColor color = GeneralMethods.getAvatarColor();
|
||||
if (cam.getSubElement() == null) {
|
||||
color = WaterMethods.getWaterColor();
|
||||
} else {
|
||||
color = GeneralMethods.getSubBendingColor(Element.valueOf(cam.getElement()));
|
||||
}
|
||||
s.sendMessage(color + cam.getName() + ChatColor.WHITE + ": " + cam.getDescription());
|
||||
s.sendMessage(ChatColor.GOLD + cam.getInstructions());
|
||||
}
|
||||
}
|
||||
s.sendMessage(ChatColor.GOLD + "Proper Usage: " + ChatColor.RED + "/bending display WaterCombos" + ChatColor.GOLD + " or " + ChatColor.RED + "/bending help <comboname>");
|
||||
}
|
||||
if (args[1].equalsIgnoreCase("EarthCombo")) {
|
||||
s.sendMessage(ChatColor.GOLD + "EarthCombos:");
|
||||
for (ComboAbilityModule cam : ComboModuleManager.combo) {
|
||||
if (cam.getElement().equals(Element.Earth.toString())) {
|
||||
ChatColor color = GeneralMethods.getAvatarColor();
|
||||
if (cam.getSubElement() == null) {
|
||||
color = EarthMethods.getEarthColor();
|
||||
} else {
|
||||
color = GeneralMethods.getSubBendingColor(Element.valueOf(cam.getElement()));
|
||||
}
|
||||
s.sendMessage(color + cam.getName() + ChatColor.WHITE + ": " + cam.getDescription());
|
||||
s.sendMessage(ChatColor.GOLD + cam.getInstructions());
|
||||
}
|
||||
}
|
||||
s.sendMessage(ChatColor.GOLD + "Proper Usage: " + ChatColor.RED + "/bending display EarthCombos" + ChatColor.GOLD + " or " + ChatColor.RED + "/bending help <comboname>");
|
||||
}
|
||||
if (args[1].equalsIgnoreCase("ChiCombo")) {
|
||||
s.sendMessage(ChatColor.GOLD + "ChiCombos:");
|
||||
s.sendMessage(ChiMethods.getChiColor() + "Immobilize" + ChatColor.WHITE + ": Deliver a series of strikes to an enemy to temporarely immobilize them.");
|
||||
s.sendMessage(ChatColor.GOLD + "QuickStrike > SwiftKick > QuickStrike > QuickStrike");
|
||||
for (ComboAbilityModule cam : ComboModuleManager.combo) {
|
||||
if (cam.getElement().equals(Element.Chi.toString())) {
|
||||
ChatColor color = GeneralMethods.getAvatarColor();
|
||||
if (cam.getSubElement() == null) {
|
||||
color = ChiMethods.getChiColor();
|
||||
} else {
|
||||
color = GeneralMethods.getSubBendingColor(Element.valueOf(cam.getElement()));
|
||||
}
|
||||
s.sendMessage(color + cam.getName() + ChatColor.WHITE + ": " + cam.getDescription());
|
||||
s.sendMessage(ChatColor.GOLD + cam.getInstructions());
|
||||
}
|
||||
}
|
||||
s.sendMessage(ChatColor.GOLD + "Proper Usage: " + ChatColor.RED + "/bending display ChiCombos" + ChatColor.GOLD + " or " + ChatColor.RED + "/bending help <comboname>");
|
||||
}
|
||||
if (GeneralMethods.abilityExists(args[1])) {
|
||||
String ability = GeneralMethods.getAbility(args[1]);
|
||||
|
@ -1947,6 +1953,16 @@ public class Commands {
|
|||
s.sendMessage(GeneralMethods.getAvatarColor() + AbilityModuleManager.descriptions.get(ability));
|
||||
}
|
||||
}
|
||||
|
||||
//Combos
|
||||
for (String combo : ComboManager.descriptions.keySet()) {
|
||||
if (combo.equalsIgnoreCase(args[1])) {
|
||||
ChatColor cc = GeneralMethods.getComboColor(combo);
|
||||
s.sendMessage(cc + combo + " (Combo) - ");
|
||||
s.sendMessage(cc + ComboManager.descriptions.get(combo));
|
||||
s.sendMessage(ChatColor.GOLD + "Usage: " + ComboManager.instructions.get(combo));
|
||||
}
|
||||
}
|
||||
}
|
||||
//End of commands
|
||||
return true;
|
||||
|
|
|
@ -78,8 +78,9 @@ import com.projectkorra.projectkorra.ability.AbilityModule;
|
|||
import com.projectkorra.projectkorra.ability.AbilityModuleManager;
|
||||
import com.projectkorra.projectkorra.ability.StockAbility;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboAbilityModule;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboManager;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboManager;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboManager.AbilityInformation;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboManager.ComboAbility;
|
||||
import com.projectkorra.projectkorra.ability.combo.ComboModuleManager;
|
||||
import com.projectkorra.projectkorra.ability.multiability.MultiAbilityManager;
|
||||
import com.projectkorra.projectkorra.ability.multiability.MultiAbilityModuleManager;
|
||||
|
@ -110,6 +111,7 @@ import com.projectkorra.projectkorra.util.ParticleEffect;
|
|||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.waterbending.Bloodbending;
|
||||
import com.projectkorra.projectkorra.waterbending.FreezeMelt;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterCombo;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterMethods;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterSpout;
|
||||
|
@ -377,9 +379,12 @@ public class GeneralMethods {
|
|||
}
|
||||
|
||||
public static boolean comboExists(String string) {
|
||||
for (ComboAbilityModule c : ComboModuleManager.combo)
|
||||
if (string.equalsIgnoreCase(c.getName()))
|
||||
/*Previous method only returned non-stock combos. Reason we use descriptions is because that
|
||||
* contains all valid combos. Not technical ones like IceBulletLeftClick, etc.*/
|
||||
for (String s : ComboManager.descriptions.keySet()) {
|
||||
if (s.equalsIgnoreCase(string))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -719,6 +724,28 @@ public class GeneralMethods {
|
|||
return Element.Chi;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the subelement of the ability if applicable.
|
||||
*
|
||||
* @param ability
|
||||
* @return SubElement
|
||||
* */
|
||||
public static SubElement getAbilitySubElement(String ability) {
|
||||
if (AbilityModuleManager.bloodabilities.contains(ability)) return SubElement.Bloodbending;
|
||||
if (AbilityModuleManager.iceabilities.contains(ability)) return SubElement.Icebending;
|
||||
if (AbilityModuleManager.plantabilities.contains(ability)) return SubElement.Plantbending;
|
||||
if (AbilityModuleManager.healingabilities.contains(ability)) return SubElement.Healing;
|
||||
if (AbilityModuleManager.sandabilities.contains(ability)) return SubElement.Sandbending;
|
||||
if (AbilityModuleManager.metalabilities.contains(ability)) return SubElement.Metalbending;
|
||||
if (AbilityModuleManager.lavaabilities.contains(ability)) return SubElement.Lavabending;
|
||||
if (AbilityModuleManager.lightningabilities.contains(ability)) return SubElement.Lightning;
|
||||
if (AbilityModuleManager.combustionabilities.contains(ability)) return SubElement.Combustion;
|
||||
if (AbilityModuleManager.spiritualprojectionabilities.contains(ability)) return SubElement.SpiritualProjection;
|
||||
if (AbilityModuleManager.flightabilities.contains(ability)) return SubElement.Flight;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the AvatarColor from the config.
|
||||
|
@ -907,6 +934,99 @@ public class GeneralMethods {
|
|||
}
|
||||
return circleblocks;
|
||||
}
|
||||
|
||||
/**Returns the ChatColor that should be associated with the combo name.
|
||||
* @param combo
|
||||
* @return The ChatColor to be used*/
|
||||
public static ChatColor getComboColor(String combo) {
|
||||
for (ComboAbility comboability : ComboManager.comboAbilityList) {
|
||||
if (!comboability.getName().equalsIgnoreCase(combo)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!ComboManager.descriptions.containsKey(comboability.getName())) {
|
||||
return ChatColor.STRIKETHROUGH; //This is so we know it shouldn't be used. Should not come up anyway.
|
||||
}
|
||||
|
||||
if (comboability.getComboType() instanceof ComboAbilityModule){
|
||||
ComboAbilityModule module = (ComboAbilityModule) comboability.getComboType();
|
||||
if (module.getSubElement() != null) {
|
||||
if (module.getSubElement() == SubElement.Bloodbending || module.getSubElement() == SubElement.Icebending || module.getSubElement() == SubElement.Plantbending || module.getSubElement() == SubElement.Healing)
|
||||
return WaterMethods.getWaterSubColor();
|
||||
else if (module.getSubElement() == SubElement.Lightning || module.getSubElement() == SubElement.Combustion)
|
||||
return FireMethods.getFireSubColor();
|
||||
else if (module.getSubElement() == SubElement.Sandbending || module.getSubElement() == SubElement.Metalbending || module.getSubElement() == SubElement.Lavabending)
|
||||
return EarthMethods.getEarthSubColor();
|
||||
else if (module.getSubElement() == SubElement.Flight || module.getSubElement() == SubElement.SpiritualProjection)
|
||||
return AirMethods.getAirSubColor();
|
||||
}
|
||||
if (module.getElement().equalsIgnoreCase(Element.Water.toString())) return WaterMethods.getWaterColor();
|
||||
else if (module.getElement().equalsIgnoreCase(Element.Earth.toString())) return EarthMethods.getEarthColor();
|
||||
else if (module.getElement().equalsIgnoreCase(Element.Fire.toString())) return FireMethods.getFireColor();
|
||||
else if (module.getElement().equalsIgnoreCase(Element.Air.toString())) return AirMethods.getAirColor();
|
||||
else if (module.getElement().equalsIgnoreCase(Element.Chi.toString())) return ChiMethods.getChiColor();
|
||||
else return getAvatarColor();
|
||||
}
|
||||
else if (combo.equalsIgnoreCase("IceBullet") || combo.equalsIgnoreCase("IceWave")) {
|
||||
return WaterMethods.getWaterSubColor();
|
||||
}
|
||||
else if (comboability.getComboType().equals(WaterCombo.class)){
|
||||
return WaterMethods.getWaterColor();
|
||||
}
|
||||
else if (comboability.getComboType().equals(FireCombo.class)){
|
||||
return FireMethods.getFireColor();
|
||||
}
|
||||
else if (comboability.getComboType().equals(AirCombo.class)){
|
||||
return AirMethods.getAirColor();
|
||||
}
|
||||
else {
|
||||
Element element = null;
|
||||
for (AbilityInformation abilityinfo : comboability.getAbilities()) {
|
||||
Element currElement = getAbilityElement(abilityinfo.getAbilityName());
|
||||
if (currElement == null) return getAvatarColor();
|
||||
else if (element == null) element = currElement;
|
||||
if (getAbilitySubElement(abilityinfo.getAbilityName()) != null) {
|
||||
SubElement sub = getAbilitySubElement(abilityinfo.getAbilityName());
|
||||
if (sub == SubElement.Bloodbending || sub == SubElement.Icebending || sub == SubElement.Plantbending || sub == SubElement.Healing)
|
||||
return WaterMethods.getWaterSubColor();
|
||||
else if (sub == SubElement.Lightning || sub == SubElement.Combustion)
|
||||
return FireMethods.getFireSubColor();
|
||||
else if (sub == SubElement.Sandbending || sub == SubElement.Metalbending || sub == SubElement.Lavabending)
|
||||
return EarthMethods.getEarthSubColor();
|
||||
else if (sub == SubElement.Flight || sub == SubElement.SpiritualProjection)
|
||||
return AirMethods.getAirSubColor();
|
||||
}
|
||||
}
|
||||
if (element == Element.Air) return AirMethods.getAirColor();
|
||||
if (element == Element.Earth) return EarthMethods.getEarthColor();
|
||||
if (element == Element.Fire) return FireMethods.getFireColor();
|
||||
if (element == Element.Water) return WaterMethods.getWaterColor();
|
||||
if (element == Element.Chi) return ChiMethods.getChiColor();
|
||||
return getAvatarColor();
|
||||
}
|
||||
}
|
||||
return getAvatarColor();
|
||||
}
|
||||
/**Returns the correct element for the combo*/
|
||||
public static Element getComboElement(String combo) {
|
||||
Iterator<ComboAbility> it = ComboManager.comboAbilityList.iterator();
|
||||
Element element = null;
|
||||
while (it.hasNext()) {
|
||||
ComboAbility comboability = it.next();
|
||||
if (!comboability.getName().equalsIgnoreCase(combo)) {
|
||||
continue;
|
||||
}
|
||||
for (AbilityInformation abilityinfo : comboability.getAbilities())
|
||||
{
|
||||
Element abilityelement = getAbilityElement(abilityinfo.getAbilityName());
|
||||
if (abilityelement == null) return null;
|
||||
else if (element == null) element = abilityelement;
|
||||
else if (element != abilityelement) return null;
|
||||
}
|
||||
return element;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getCurrentDate() {
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
|
@ -1795,7 +1915,7 @@ public class GeneralMethods {
|
|||
ab.stop();
|
||||
}
|
||||
|
||||
ArrayList<ComboManager.ComboAbility> combos = ComboManager.comboAbilityList;
|
||||
HashSet<ComboManager.ComboAbility> combos = ComboManager.comboAbilityList;
|
||||
for (ComboManager.ComboAbility c : combos)
|
||||
if (c.getComboType() instanceof ComboAbilityModule)
|
||||
((ComboAbilityModule) c.getComboType()).stop();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.projectkorra.projectkorra.ability.combo;
|
||||
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.airbending.AirCombo;
|
||||
|
@ -11,14 +12,16 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class ComboManager {
|
||||
private static final long CLEANUP_DELAY = 10000;
|
||||
public static ConcurrentHashMap<String, ArrayList<AbilityInformation>> recentlyUsedAbilities = new ConcurrentHashMap<String, ArrayList<AbilityInformation>>();
|
||||
public static ArrayList<ComboAbility> comboAbilityList = new ArrayList<ComboAbility>();
|
||||
public static HashSet<ComboAbility> comboAbilityList = new HashSet<ComboAbility>();
|
||||
public static HashMap<String, String> authors = new HashMap<String, String>();
|
||||
public static HashMap<String, String> descriptions = new HashMap<String, String>();
|
||||
public static HashMap<String, String> instructions = new HashMap<String, String>();
|
||||
|
@ -30,7 +33,9 @@ public class ComboManager {
|
|||
fireKick.add(new AbilityInformation("FireBlast", ClickType.SHIFT_DOWN));
|
||||
fireKick.add(new AbilityInformation("FireBlast", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("FireKick", fireKick, FireCombo.class));
|
||||
|
||||
descriptions.put("FireKick", "A short ranged arc of fire launches from the player's feet dealing moderate damage to enemies.");
|
||||
instructions.put("FireKick", "FireBlast > FireBlast > (Hold Shift) > FireBlast.");
|
||||
|
||||
ArrayList<AbilityInformation> fireSpin = new ArrayList<AbilityInformation>();
|
||||
fireSpin.add(new AbilityInformation("FireBlast", ClickType.LEFT_CLICK));
|
||||
fireSpin.add(new AbilityInformation("FireBlast", ClickType.LEFT_CLICK));
|
||||
|
@ -38,7 +43,9 @@ public class ComboManager {
|
|||
fireSpin.add(new AbilityInformation("FireShield", ClickType.SHIFT_DOWN));
|
||||
fireSpin.add(new AbilityInformation("FireShield", ClickType.SHIFT_UP));
|
||||
comboAbilityList.add(new ComboAbility("FireSpin", fireSpin, FireCombo.class));
|
||||
|
||||
descriptions.put("FireSpin", "A circular array of fire that causes damage and massive knockback to nearby enemies.");
|
||||
instructions.put("FireSpin", "FireBlast > FireBlast > FireShield > (Tap Shift).");
|
||||
|
||||
ArrayList<AbilityInformation> jetBlast = new ArrayList<AbilityInformation>();
|
||||
jetBlast.add(new AbilityInformation("FireJet", ClickType.SHIFT_DOWN));
|
||||
jetBlast.add(new AbilityInformation("FireJet", ClickType.SHIFT_UP));
|
||||
|
@ -48,7 +55,9 @@ public class ComboManager {
|
|||
jetBlast.add(new AbilityInformation("FireShield", ClickType.SHIFT_UP));
|
||||
jetBlast.add(new AbilityInformation("FireJet", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("JetBlast", jetBlast, FireCombo.class));
|
||||
|
||||
descriptions.put("JetBlast", "Create an explosive blast that propels your FireJet at higher speeds.");
|
||||
instructions.put("JetBlast", "FireJet (Tap Shift) > FireJet (Tap Shift) > FireShield (Tap Shift) > FireJet.");
|
||||
|
||||
ArrayList<AbilityInformation> jetBlaze = new ArrayList<AbilityInformation>();
|
||||
jetBlaze.add(new AbilityInformation("FireJet", ClickType.SHIFT_DOWN));
|
||||
jetBlaze.add(new AbilityInformation("FireJet", ClickType.SHIFT_UP));
|
||||
|
@ -58,27 +67,35 @@ public class ComboManager {
|
|||
jetBlaze.add(new AbilityInformation("Blaze", ClickType.SHIFT_UP));
|
||||
jetBlaze.add(new AbilityInformation("FireJet", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("JetBlaze", jetBlaze, FireCombo.class));
|
||||
|
||||
descriptions.put("JetBlaze", "Damages and burns all enemies in the proximity of your FireJet.");
|
||||
instructions.put("JetBlaze", "FireJet (Tap Shift) > FireJet (Tap Shift) > Blaze (Tap Shift) > FireJet.");
|
||||
|
||||
ArrayList<AbilityInformation> fireWheel = new ArrayList<AbilityInformation>();
|
||||
fireWheel.add(new AbilityInformation("FireShield", ClickType.SHIFT_DOWN));
|
||||
fireWheel.add(new AbilityInformation("FireShield", ClickType.RIGHT_CLICK));
|
||||
fireWheel.add(new AbilityInformation("FireShield", ClickType.RIGHT_CLICK));
|
||||
fireWheel.add(new AbilityInformation("Blaze", ClickType.SHIFT_UP));
|
||||
comboAbilityList.add(new ComboAbility("FireWheel", fireWheel, FireCombo.class));
|
||||
|
||||
descriptions.put("FireWheel", "A high-speed wheel of fire that travels along the ground for long distances dealing high damage.");
|
||||
instructions.put("FireWheel", "FireShield (Hold Shift) > Right Click a block in front of you twice > Switch to Blaze > Release Shift.");
|
||||
|
||||
ArrayList<AbilityInformation> twister = new ArrayList<AbilityInformation>();
|
||||
twister.add(new AbilityInformation("AirShield", ClickType.SHIFT_DOWN));
|
||||
twister.add(new AbilityInformation("AirShield", ClickType.SHIFT_UP));
|
||||
twister.add(new AbilityInformation("Tornado", ClickType.SHIFT_DOWN));
|
||||
twister.add(new AbilityInformation("AirBlast", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("Twister", twister, AirCombo.class));
|
||||
|
||||
descriptions.put("Twister", "Create a cyclone of air that travels along the ground grabbing nearby entities.");
|
||||
instructions.put("Twister", "AirShield (Tap Shift) > Tornado (Hold Shift) > AirBlast (Left Click)");
|
||||
|
||||
ArrayList<AbilityInformation> airStream = new ArrayList<AbilityInformation>();
|
||||
airStream.add(new AbilityInformation("AirShield", ClickType.SHIFT_DOWN));
|
||||
airStream.add(new AbilityInformation("AirSuction", ClickType.LEFT_CLICK));
|
||||
airStream.add(new AbilityInformation("AirBlast", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("AirStream", airStream, AirCombo.class));
|
||||
|
||||
descriptions.put("AirStream", "Control a large stream of air that grabs onto enemies allowing you to direct them temporarily.");
|
||||
instructions.put("AirStream", "AirShield (Hold Shift) > AirSuction (Left Click) > AirBlast (Left Click)");
|
||||
|
||||
/*
|
||||
* ArrayList<AbilityInformation> airSlice = new
|
||||
* ArrayList<AbilityInformation>(); airSlice.add(new
|
||||
|
@ -96,17 +113,21 @@ public class ComboManager {
|
|||
airSweep.add(new AbilityInformation("AirBurst", ClickType.SHIFT_DOWN));
|
||||
airSweep.add(new AbilityInformation("AirBurst", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("AirSweep", airSweep, AirCombo.class));
|
||||
|
||||
descriptions.put("AirSweep", "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");
|
||||
instructions.put("AirSweep", "AirSwipe (Left Click) > AirSwipe (Left Click) > AirBurst (Hold Shift) > AirBurst (Left Click)");
|
||||
|
||||
ArrayList<AbilityInformation> iceWave = new ArrayList<AbilityInformation>();
|
||||
iceWave.add(new AbilityInformation("WaterSpout", ClickType.SHIFT_UP));
|
||||
iceWave.add(new AbilityInformation("PhaseChange", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("IceWave", iceWave, WaterCombo.class));
|
||||
|
||||
ArrayList<AbilityInformation> icePillar = new ArrayList<AbilityInformation>();
|
||||
descriptions.put("IceWave", "PhaseChange your WaterWave into an IceWave that freezes and damages enemies.");
|
||||
instructions.put("IceWave", "Create a WaterSpout Wave > PhaseChange (Left Click)");
|
||||
|
||||
/*ArrayList<AbilityInformation> icePillar = new ArrayList<AbilityInformation>();
|
||||
icePillar.add(new AbilityInformation("IceSpike", ClickType.LEFT_CLICK));
|
||||
icePillar.add(new AbilityInformation("IceSpike", ClickType.LEFT_CLICK));
|
||||
icePillar.add(new AbilityInformation("WaterSpout", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("IcePillar", icePillar, WaterCombo.class));
|
||||
comboAbilityList.add(new ComboAbility("IcePillar", icePillar, WaterCombo.class));*/
|
||||
|
||||
ArrayList<AbilityInformation> iceBullet = new ArrayList<AbilityInformation>();
|
||||
iceBullet.add(new AbilityInformation("WaterBubble", ClickType.SHIFT_DOWN));
|
||||
|
@ -114,7 +135,9 @@ public class ComboManager {
|
|||
iceBullet.add(new AbilityInformation("IceBlast", ClickType.SHIFT_DOWN));
|
||||
iceBullet.add(new AbilityInformation("IceBlast", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("IceBullet", iceBullet, WaterCombo.class));
|
||||
|
||||
descriptions.put("IceBullet", "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.");
|
||||
instructions.put("IceBullet", "WaterBubble (Tap Shift) > IceBlast (Hold Shift) > IceBlast (Left Click) > Wait for ice to Form > Then alternate between Left and Right click with IceBlast");
|
||||
|
||||
ArrayList<AbilityInformation> iceBulletLeft = new ArrayList<AbilityInformation>();
|
||||
iceBulletLeft.add(new AbilityInformation("IceBlast", ClickType.LEFT_CLICK));
|
||||
comboAbilityList.add(new ComboAbility("IceBulletLeftClick", iceBulletLeft, WaterCombo.class));
|
||||
|
@ -225,6 +248,15 @@ public class ComboManager {
|
|||
tempList.add(0, list.get(list.size() - 1 - i));
|
||||
return tempList;
|
||||
}
|
||||
|
||||
public static ArrayList<String> getCombosForElement(Element element) {
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
for (ComboAbility comboab : comboAbilityList) {
|
||||
if (GeneralMethods.getComboElement(comboab.getName()) == element && descriptions.containsKey(comboab.getName())) list.add(comboab.getName());
|
||||
}
|
||||
Collections.sort(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void startCleanupTask() {
|
||||
new BukkitRunnable() {
|
||||
|
|
Loading…
Reference in a new issue