mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
StockAbilities
Some abilities will be stored internally as they play off of each other, but can be enabled / disabled through the config.
This commit is contained in:
parent
65dd2c3c80
commit
d106eb513a
2 changed files with 113 additions and 0 deletions
|
@ -48,7 +48,48 @@ public class AbilityModuleManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fill() {
|
private void fill() {
|
||||||
|
|
||||||
|
for (StockAbilities a: StockAbilities.values()) {
|
||||||
|
if (StockAbilities.isAirbending(a)) {
|
||||||
|
if (ProjectKorra.plugin.getConfig().getBoolean("Abilities.Air." + a.name() + ".Enabled")) {
|
||||||
|
abilities.add(a.name());
|
||||||
|
airbendingabilities.add(a.name());
|
||||||
|
descriptions.put(a.name(), ProjectKorra.plugin.getConfig().getString("Abilities.Air." + a.name() + ".Description"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StockAbilities.isWaterbending(a)) {
|
||||||
|
if (ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water." + a.name() + ".Enabled")) {
|
||||||
|
abilities.add(a.name());
|
||||||
|
waterbendingabilities.add(a.name());
|
||||||
|
descriptions.put(a.name(), ProjectKorra.plugin.getConfig().getString("Abilities.Water." + a.name() + ".Description"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StockAbilities.isEarthbending(a)) {
|
||||||
|
if (ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth." + a.name() + ".Enabled")) {
|
||||||
|
abilities.add(a.name());
|
||||||
|
earthbendingabilities.add(a.name());
|
||||||
|
descriptions.put(a.name(), ProjectKorra.plugin.getConfig().getString("Abilities.Earth." + a.name() + ".Description"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StockAbilities.isFirebending(a)) {
|
||||||
|
if (ProjectKorra.plugin.getConfig().getBoolean("Abilities.Fire." + a.name() + ".Enabled")) {
|
||||||
|
abilities.add(a.name());
|
||||||
|
firebendingabilities.add(a.name());
|
||||||
|
descriptions.put(a.name(), ProjectKorra.plugin.getConfig().getString("Abilities.Fire." + a.name() + ".Description"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StockAbilities.isChiBlocking(a)) {
|
||||||
|
if (ProjectKorra.plugin.getConfig().getBoolean("Abilities.Chi." + a.name() + ".Enabled")) {
|
||||||
|
abilities.add(a.name());
|
||||||
|
chiabilities.add(a.name());
|
||||||
|
descriptions.put(a.name(), ProjectKorra.plugin.getConfig().getString("Abilities.Chi." + a.name() + ".Description"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (AbilityModule ab: ability) {
|
for (AbilityModule ab: ability) {
|
||||||
|
if (abilities.contains(ab.getName())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ab.onThisLoad();
|
ab.onThisLoad();
|
||||||
abilities.add(ab.getName());
|
abilities.add(ab.getName());
|
||||||
if (ab.getElement() == Element.Air.toString()) airbendingabilities.add(ab.getName());
|
if (ab.getElement() == Element.Air.toString()) airbendingabilities.add(ab.getName());
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.projectkorra.ProjectKorra.Ability;
|
||||||
|
|
||||||
|
public enum StockAbilities {
|
||||||
|
|
||||||
|
AirBlast, AirBubble, AirShield, AirSuction, AirSwipe, Tornado, AirScooter, AirSpout, AirBurst,
|
||||||
|
|
||||||
|
Catapult, RaiseEarth, EarthGrab, EarthTunnel, EarthBlast, Collapse, Tremorsense, EarthArmor, Shockwave,
|
||||||
|
|
||||||
|
HeatControl, Blaze, FireJet, Illumination, WallOfFire, FireBlast, Lightning, FireBurst, FireShield,
|
||||||
|
|
||||||
|
WaterBubble, PhaseChange, HealingWaters, WaterManipulation, Surge, Bloodbending, WaterSpout, IceSpike, OctopusForm, Torrent,
|
||||||
|
|
||||||
|
HighJump, RapidPunch, Paralyze,
|
||||||
|
|
||||||
|
AvatarState;
|
||||||
|
|
||||||
|
private enum AirbendingAbilities {
|
||||||
|
AirBlast, AirBubble, AirShield, AirSuction, AirSwipe, Tornado, AirScooter, AirSpout, AirBurst;
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum WaterbendingAbilities {
|
||||||
|
WaterBubble, PhaseChange, HealingWaters, WaterManipulation, Surge, Bloodbending, WaterSpout, IceSpike, OctopusForm, Torrent;
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum EarthbendingAbilities {
|
||||||
|
Catapult, RaiseEarth, EarthGrab, EarthTunnel, EarthBlast, Collapse, Tremorsense, EarthArmor, Shockwave;
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum FirebendingAbilities {
|
||||||
|
HeatControl, Blaze, FireJet, Illumination, WallOfFire, FireBlast, Lightning, FireBurst, FireShield;
|
||||||
|
}
|
||||||
|
|
||||||
|
private enum ChiblockingAbilities {
|
||||||
|
HighJump, RapidPunch, Paralyze;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isAirbending(StockAbilities ability) {
|
||||||
|
for (AirbendingAbilities a: AirbendingAbilities.values()) {
|
||||||
|
if (a.name().equalsIgnoreCase(ability.name())) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isWaterbending(StockAbilities ability) {
|
||||||
|
for (WaterbendingAbilities a: WaterbendingAbilities.values()) {
|
||||||
|
if (a.name().equalsIgnoreCase(ability.name())) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEarthbending(StockAbilities ability) {
|
||||||
|
for (EarthbendingAbilities a: EarthbendingAbilities.values()) {
|
||||||
|
if (a.name().equalsIgnoreCase(ability.name())) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isFirebending(StockAbilities ability) {
|
||||||
|
for (FirebendingAbilities a: FirebendingAbilities.values()) {
|
||||||
|
if (a.name().equalsIgnoreCase(ability.name())) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isChiBlocking(StockAbilities ability) {
|
||||||
|
for (ChiblockingAbilities a: ChiblockingAbilities.values()) {
|
||||||
|
if (a.name().equalsIgnoreCase(ability.name())) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue