Tremorsense now takes priority over Illumination, IceSpear sphere now forms underwater (#575)

This commit is contained in:
Sobki 2016-09-12 07:14:02 +10:00 committed by OmniCypher
parent 69d7974160
commit 92d32bcb9a
6 changed files with 30 additions and 7 deletions

View file

@ -1625,7 +1625,12 @@ public class PKListener implements Listener {
new HeatControlExtinguish(player); new HeatControlExtinguish(player);
} }
if (abil.equalsIgnoreCase("Illumination")) { if (abil.equalsIgnoreCase("Illumination")) {
bPlayer.toggleIllumination(); if (ConfigManager.defaultConfig.get().getBoolean("Abilities.Fire.Illumination.Passive")) {
bPlayer.toggleIllumination();
} else {
new Illumination(player);
}
} }
if (abil.equalsIgnoreCase("FireBurst")) { if (abil.equalsIgnoreCase("FireBurst")) {
FireBurst.coneBurst(player); FireBurst.coneBurst(player);

View file

@ -1026,6 +1026,7 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.HeatControl.Cook.CookTime", 2000); config.addDefault("Abilities.Fire.HeatControl.Cook.CookTime", 2000);
config.addDefault("Abilities.Fire.Illumination.Enabled", true); config.addDefault("Abilities.Fire.Illumination.Enabled", true);
config.addDefault("Abilities.Fire.Illumination.Passive", true);
config.addDefault("Abilities.Fire.Illumination.Range", 5); config.addDefault("Abilities.Fire.Illumination.Range", 5);
config.addDefault("Abilities.Fire.Illumination.Cooldown", 500); config.addDefault("Abilities.Fire.Illumination.Cooldown", 500);
config.addDefault("Abilities.Fire.Illumination.LightThreshold", 7); config.addDefault("Abilities.Fire.Illumination.LightThreshold", 7);

View file

@ -131,15 +131,23 @@ public class Tremorsense extends EarthAbility {
public static void manage(Server server) { public static void manage(Server server) {
for (Player player : server.getOnlinePlayers()) { for (Player player : server.getOnlinePlayers()) {
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (bPlayer != null && !hasAbility(player, Tremorsense.class) if (canTremorSense(player) && !hasAbility(player, Tremorsense.class)) {
&& bPlayer.canBendIgnoreBinds(getAbility("Tremorsense"))) {
new Tremorsense(player); new Tremorsense(player);
} }
} }
} }
public static boolean canTremorSense(Player player) {
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (bPlayer != null && bPlayer.canBendIgnoreBindsCooldowns(getAbility("Tremorsense"))) {
return true;
}
return false;
}
public static Map<Block, Player> getBlocks() { public static Map<Block, Player> getBlocks() {
return BLOCKS; return BLOCKS;
} }

View file

@ -8,6 +8,7 @@ import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.command.Commands; import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.Tremorsense;
public class FirePassive { public class FirePassive {
@ -23,8 +24,10 @@ public class FirePassive {
} }
if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class) if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class)
&& bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination"))) { && bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination")) && ConfigManager.defaultConfig.get().getBoolean("Abilities.Fire.Illumination.Passive")) {
new Illumination(player); if (!Tremorsense.canTremorSense(player)) {
new Illumination(player);
}
} }
} }
} }

View file

@ -11,6 +11,7 @@ import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.earthbending.Tremorsense;
import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.TempBlock;
public class Illumination extends FireAbility { public class Illumination extends FireAbility {
@ -69,6 +70,11 @@ public class Illumination extends FireAbility {
return; return;
} }
if (Tremorsense.canTremorSense(player)) {
remove();
return;
}
if (oldLevel > this.lightThreshold) { if (oldLevel > this.lightThreshold) {
remove(); remove();
return; return;

View file

@ -35,7 +35,7 @@ public class WaterArms extends WaterAbility {
} }
private static final Map<Block, Long> BLOCK_REVERT_TIMES = new ConcurrentHashMap<Block, Long>(); private static final Map<Block, Long> BLOCK_REVERT_TIMES = new ConcurrentHashMap<Block, Long>();
private static final Integer[] UNBREAKABLES = { 7, 8, 9, 10, 11, 49, 54, 90, 119, 120, 130, 146 }; private static final Integer[] UNBREAKABLES = { 7, 10, 11, 49, 54, 90, 119, 120, 130, 146 };
private boolean cooldownLeft; private boolean cooldownLeft;
private boolean cooldownRight; private boolean cooldownRight;