Started on Boom Bow Rule: Boom Decay

This commit is contained in:
alisolarflare 2016-11-05 05:50:39 -04:00
parent d18533f0f6
commit a925a7117f
5 changed files with 41 additions and 5 deletions

View file

@ -13,6 +13,6 @@ public class MagicModule extends Module{
public void register(JavaPlugin plugin) {
registerListener(plugin, new AliArrowListener(plugin));
registerListener(plugin, new BoomBowDeathListener());
registerListener(plugin, new BoomBowListener());
registerListener(plugin, new BoomBowListener(plugin));
}
}

View file

@ -10,9 +10,11 @@ public class BoomBowDeathListener implements Listener{
public void onBoomBowDeath(PlayerDeathEvent event){
Player player = event.getEntity();
if (player.getLastDamage() == 7.000042)
event.setDeathMessage(player.getCustomName() + player.getDisplayName() + player.getPlayerListName() + player.getName() + "got trigger happy with the Boom Bow");
player.sendMessage("42!");
event.setDeathMessage(player.getName() + "got trigger happy with the Boom Bow");
if (player.getLastDamage() < 7.000041 || player.getLastDamage() > 7.000043)
player.sendMessage("meaning of lyyyyyyfffe");
player.sendMessage(player.getCustomName() + player.getDisplayName() + player.getPlayerListName() + player.getName());
}
}

View file

@ -12,11 +12,15 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class BoomBowListener implements Listener {
JavaPlugin plugin;
public BoomBowListener(JavaPlugin plugin){
this.plugin = plugin;
}
@EventHandler
public void ClickEvent(PlayerInteractEvent event){
FlyBowBoost(event);
@ -74,7 +78,8 @@ public class BoomBowListener implements Listener {
//TODO: NERF - healthReduction
//TODO: NERF - localized
if(BoomBowRule.boomDecay);
if(BoomBowRule.boomDecay)
new BoomDecayTask(player).runTaskTimer(plugin, 1, 1);
if(BoomBowRule.endCrystal){
}
if(BoomBowRule.healthReduction){

View file

@ -23,7 +23,11 @@ public class BoomBowRule extends TBMCCommandBase{
}
if (args.length < 2){
player.sendMessage("Usage: /boomBowRule [rulename] [true/false]");
player.sendMessage("Rule settings: boomDecay, healthReduction, endCrystal, localized");
player.sendMessage("Rules:");
player.sendMessage("boomDecay" + boomDecay);
player.sendMessage("healthReduction" + healthReduction);
player.sendMessage("endCrystal" + endCrystal);
player.sendMessage("localized" + localized);
return false;
}
if(!(args[1].startsWith("t")|| args[1].startsWith("f"))){

View file

@ -0,0 +1,25 @@
package alisolarflare.magic.tricks;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
public class BoomDecayTask extends BukkitRunnable{
Player player;
private int ticksSinceStart = 0;
private final int effectLength = 20;
public BoomDecayTask(Player player){
this.player = player;
}
//runs every tick
@Override
public void run() {
if (ticksSinceStart > effectLength){
this.cancel();
}
player.sendMessage(player.getVelocity().toString());
ticksSinceStart++;
}
}