mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Config AvatarState FireJet and AirShield
You can choose whether FireJet and AirShield are toggles
This commit is contained in:
parent
1909e0e764
commit
aaa20d6a58
7 changed files with 35 additions and 11 deletions
Binary file not shown.
|
@ -144,6 +144,7 @@ public class ConfigManager {
|
|||
+ "This wind will deflect all projectiles and will prevent any creature from "
|
||||
+ "entering it for as long as its maintained.");
|
||||
config.addDefault("Abilities.Air.AirShield.Radius", 7);
|
||||
config.addDefault("Abilities.Air.AirShield.IsAvatarStateToggle", true);
|
||||
|
||||
config.addDefault("Abilities.Air.AirSpout.Enabled", true);
|
||||
config.addDefault("Abilities.Air.AirSpout.Description", "This ability gives the airbender limited sustained levitation. It is a "
|
||||
|
@ -385,6 +386,7 @@ public class ConfigManager {
|
|||
config.addDefault("Abilities.Fire.FireJet.Speed", 0.7);
|
||||
config.addDefault("Abilities.Fire.FireJet.Duration", 1500);
|
||||
config.addDefault("Abilities.Fire.FireJet.Cooldown", 6000);
|
||||
config.addDefault("Abilities.Fire.FireJet.IsAvatarStateToggle", true);
|
||||
|
||||
config.addDefault("Abilities.Fire.FireShield.Enabled", true);
|
||||
config.addDefault("Abilities.Fire.FireShield.Description", "FireShield is a basic defensive ability. "
|
||||
|
|
|
@ -499,9 +499,7 @@ public class PKListener implements Listener {
|
|||
String abil = Methods.getBoundAbility(player);
|
||||
if (abil == null) return;
|
||||
if (Methods.canBend(player.getName(), abil)) {
|
||||
if (abil.equalsIgnoreCase("AvatarState")) {
|
||||
new AvatarState(player);
|
||||
}
|
||||
|
||||
|
||||
if (Methods.isAirAbility(abil)) {
|
||||
if (Methods.isWeapon(player.getItemInHand().getType()) && !plugin.getConfig().getBoolean("Properties.Air.CanBendWithWeapons")) {
|
||||
|
@ -635,6 +633,10 @@ public class PKListener implements Listener {
|
|||
//
|
||||
}
|
||||
}
|
||||
|
||||
if (abil.equalsIgnoreCase("AvatarState")) {
|
||||
new AvatarState(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ public class AirShield {
|
|||
|
||||
private static double maxradius = ProjectKorra.plugin.getConfig().getDouble("Abilities.Air.AirShield.Radius");
|
||||
private static int numberOfStreams = (int) (.75 * (double) maxradius);
|
||||
private static boolean isToggle = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Air.AirShield.IsAvatarStateToggle");
|
||||
|
||||
private double radius = 2;
|
||||
|
||||
|
@ -31,7 +32,7 @@ public class AirShield {
|
|||
|
||||
public AirShield(Player player) {
|
||||
if (AvatarState.isAvatarState(player)
|
||||
&& instances.containsKey(player.getEntityId())) {
|
||||
&& instances.containsKey(player.getEntityId()) && isToggle) {
|
||||
instances.remove(player.getEntityId());
|
||||
return;
|
||||
}
|
||||
|
@ -141,11 +142,27 @@ public class AirShield {
|
|||
instances.remove(player.getEntityId());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isToggle) {
|
||||
if (((!Methods.getBoundAbility(player).equalsIgnoreCase("AirShield")) || (!player
|
||||
.isSneaking())) && !AvatarState.isAvatarState(player)) {
|
||||
instances.remove(player.getEntityId());
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (((!Methods.getBoundAbility(player).equalsIgnoreCase("AirShield")) || (!player
|
||||
.isSneaking()))) {
|
||||
instances.remove(player.getEntityId());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// if (((!Methods.getBoundAbility(player).equalsIgnoreCase("AirShield")) || (!player
|
||||
// .isSneaking()))) {
|
||||
// instances.remove(player.getEntityId());
|
||||
// return false;
|
||||
// }
|
||||
rotateShield();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ public class FireJet {
|
|||
public static ConcurrentHashMap<String, Long> cooldowns = new ConcurrentHashMap<String, Long>();
|
||||
private static final double defaultfactor = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireJet.Speed");
|
||||
private static final long defaultduration = ProjectKorra.plugin.getConfig().getLong("Abilities.Fire.FireJet.Duration");
|
||||
private static boolean isToggle = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Fire.FireJet.IsAvatarStateToggle");
|
||||
// private static final long cooldown = ConfigManager.fireJetCooldown;
|
||||
|
||||
// private static ConcurrentHashMap<Player, Long> timers = new
|
||||
|
@ -88,14 +89,14 @@ public class FireJet {
|
|||
}
|
||||
if ((Methods.isWater(player.getLocation().getBlock()) || System
|
||||
.currentTimeMillis() > time + duration)
|
||||
&& !AvatarState.isAvatarState(player)) {
|
||||
&& (!AvatarState.isAvatarState(player) || !isToggle)) {
|
||||
// player.setAllowFlight(canfly);
|
||||
instances.remove(player);
|
||||
} else {
|
||||
player.getWorld().playEffect(player.getLocation(),
|
||||
Effect.MOBSPAWNER_FLAMES, 1);
|
||||
double timefactor;
|
||||
if (AvatarState.isAvatarState(player)) {
|
||||
if (AvatarState.isAvatarState(player) && isToggle) {
|
||||
timefactor = 1;
|
||||
} else {
|
||||
timefactor = 1 - ((double) (System.currentTimeMillis() - time))
|
||||
|
|
|
@ -99,6 +99,7 @@ Abilities:
|
|||
Enabled: true
|
||||
Description: "Air Shield is one of the most powerful defensive techniques in existence. To use, simply sneak (default: shift). This will create a whirlwind of air around the user, with a small pocket of safe space in the center. This wind will deflect all projectiles and will prevent any creature from entering it for as long as its maintained."
|
||||
Radius: 7
|
||||
IsAvatarStateToggle: true
|
||||
AirSpout:
|
||||
Enabled: true
|
||||
Description: "This ability gives the airbender limited sustained levitation. It is a toggle - click to activate and form a whirling spout of air beneath you, lifting you up. You can bend other abilities while using AirSpout. Click again to deactivate this ability."
|
||||
|
@ -276,6 +277,7 @@ Abilities:
|
|||
Speed: 0.7
|
||||
Duration: 1500
|
||||
Cooldown: 6000
|
||||
IsAvatarStateToggle: true
|
||||
FireShield:
|
||||
Enabled: true
|
||||
Description: "FireShield is a basic defensive ability. Clicking with this ability selected will create a small disc of fire in front of you, which will block most attacks and bending. Alternatively, pressing and holding sneak creates a very small shield of fire, blocking most attacks. Creatures that contact this fire are ignited."
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: ProjectKorra
|
||||
author: ProjectKorra
|
||||
version: 1.2.0 BETA 2
|
||||
version: 1.2.0 BETA 3
|
||||
main: com.projectkorra.ProjectKorra.ProjectKorra
|
||||
commands:
|
||||
projectkorra:
|
||||
|
|
Loading…
Reference in a new issue