Tried to fix up powerup

This commit is contained in:
alisolarflare 2016-11-06 17:12:24 -05:00
parent 45b88354e5
commit bbacdc3529
8 changed files with 29 additions and 21 deletions

View file

@ -29,6 +29,8 @@ commands:
description: List all fighters currently in a button minigame description: List all fighters currently in a button minigame
setcolourspawn: setcolourspawn:
description: sets the spawn points for each colour in a button minigame description: sets the spawn points for each colour in a button minigame
setmatchstate:
description: sets the current state of the ultrahardcore game.
addtouhc: addtouhc:
description: Adds a player to the UltraHardcore match description: Adds a player to the UltraHardcore match
joinuhc: joinuhc:

View file

@ -10,7 +10,6 @@ public class FlairDoorModule extends Module {
@Override @Override
public void register(JavaPlugin plugin) { public void register(JavaPlugin plugin) {
registerCommand(plugin, new FlairMe()); registerCommand(plugin, new FlairMe());
registerListener(plugin, new PortalListener(plugin)); registerListener(plugin, new PortalListener(plugin));
} }
} }

View file

@ -9,9 +9,8 @@ public class FlairMe extends TBMCCommandBase {
@Override @Override
public boolean OnCommand(CommandSender sender, String label, String[] args) { public boolean OnCommand(CommandSender sender, String label, String[] args) {
sender.sendMessage("Flairing..." + sender.getName());
PortalListener.playersToBeFlaired.add(sender.getName()); PortalListener.playersToBeFlaired.add(sender.getName());
sender.sendMessage("Finished Preparation! Walk through a portal to get your flair"); sender.sendMessage("Setup Successful! Walk through a portal to get your flair");
return false; return false;
} }

View file

@ -57,19 +57,15 @@ public class PortalListener implements Listener{
//RECOLOUR PLAYER //RECOLOUR PLAYER
if(HigherBlock.getType() == Material.STONE){ if(HigherBlock.getType() == Material.STONE){
player.sendMessage("STONE DETECTED");
recolourPlayer(player, DyeColor.GRAY); recolourPlayer(player, DyeColor.GRAY);
//TOP BLOCK IS WOOL? //TOP BLOCK IS WOOL?
}else if(HigherBlock.getType() == Material.WOOL){ }else if(HigherBlock.getType() == Material.WOOL){
player.sendMessage("WOOL DETECTED T");
Wool wool = (Wool) HigherBlock.getState().getData(); Wool wool = (Wool) HigherBlock.getState().getData();
recolourPlayer(player, wool.getColor()); recolourPlayer(player, wool.getColor());
//MIDDLE BLOCK IS WOOL? //MIDDLE BLOCK IS WOOL?
}else if(MiddleBlock.getType() == Material.WOOL){ }else if(MiddleBlock.getType() == Material.WOOL){
player.sendMessage("WOOL DETECTED M");
MaterialData mData = MiddleBlock.getState().getData(); MaterialData mData = MiddleBlock.getState().getData();
Wool wool = (Wool) mData; Wool wool = (Wool) mData;
@ -77,7 +73,6 @@ public class PortalListener implements Listener{
//BOTTOM BLOCK IS WOOL? //BOTTOM BLOCK IS WOOL?
}else if (BottomBlock.getType() == Material.WOOL){ }else if (BottomBlock.getType() == Material.WOOL){
player.sendMessage("WOOL DETECTED B");
Wool wool = (Wool) BottomBlock.getState().getData(); Wool wool = (Wool) BottomBlock.getState().getData();
recolourPlayer(player, wool.getColor()); recolourPlayer(player, wool.getColor());
} }
@ -86,60 +81,58 @@ public class PortalListener implements Listener{
public void recolourPlayer(Player player, DyeColor dyecolour){ public void recolourPlayer(Player player, DyeColor dyecolour){
User user = essentials.getUser(player); User user = essentials.getUser(player);
player.sendMessage("Recolouring Player as..." + dyecolour.toString());
String name = user._getNickname(); String name = user._getNickname();
player.sendMessage("name:" + name);
String tempName = ""; String tempName = "";
for(int i = 0; i < name.length(); i++){ for(int i = 0; i < name.length(); i++){
player.sendMessage("|"+name.charAt(i)+"|");
if (name.charAt(i) != '§'){ if (name.charAt(i) != '§'){
tempName += name.charAt(i); tempName += name.charAt(i);
}else{ }else{
i++; i++;
} }
} }
name = tempName; name = tempName;
player.sendMessage("Adjusted Name: " + name);
switch(dyecolour){ switch(dyecolour){
case GRAY: case GRAY:
player.sendMessage("Adding GRAY"); player.sendMessage("Adding §7GRAY!§f");
name = "§7" + name; name = "§7" + name;
break; break;
case RED: case RED:
player.sendMessage("Adding RED"); player.sendMessage("Adding §4RED!§f");
name = "§4" + name; name = "§4" + name;
break; break;
case ORANGE: case ORANGE:
player.sendMessage("Adding ORANGE"); player.sendMessage("Adding §6ORANGE!§f");
name = "§6" + name; name = "§6" + name;
break; break;
case YELLOW: case YELLOW:
player.sendMessage("Adding YELLOW"); player.sendMessage("Adding §eYELLOW!§f");
name = "§e" + name; name = "§e" + name;
break; break;
case LIME: case LIME:
case GREEN: case GREEN:
player.sendMessage("Adding GREEN"); player.sendMessage("Adding §aGREEN!§f");
name = "§a" + name; name = "§a" + name;
break; break;
case CYAN: case CYAN:
case LIGHT_BLUE: case LIGHT_BLUE:
case BLUE: case BLUE:
player.sendMessage("Adding BLUE"); player.sendMessage("Adding §9BLUE!§f");
name = "§9" + name; name = "§9" + name;
break; break;
case PURPLE: case PURPLE:
player.sendMessage("Adding PURPLE"); player.sendMessage("Adding §5PURPLE!§f");
name = "§5" + name; name = "§5" + name;
break; break;
case WHITE:
player.sendMessage("Adding §fWHITE!§f");
name = "§f" + name;
default: default:
player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK"); player.sendMessage("ERROR, PORTAL HAS INVALID UNDER-BLOCK");
break; break;
} }
user.setNickname(name); user.setNickname(name);
player.sendMessage("Your name is now: " + user.getNickname() +"! Removing you from playersToBeFlaired..."); player.sendMessage("Your name is now: " + user.getNickname() +"!");
playersToBeFlaired.remove(player.getName()); playersToBeFlaired.remove(player.getName());
} }
} }

View file

@ -13,17 +13,22 @@ public class GPowerMemory{
poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true)); poweredPlayerList.put(player.getUniqueId(), new poweredPlayer(player.getUniqueId(), colour, true));
} }
public void PowerUpPlayer(Player player){ public void PowerUpPlayer(Player player){
player.sendMessage("Powering up!");
if(poweredPlayerList.containsKey(player.getUniqueId())){ if(poweredPlayerList.containsKey(player.getUniqueId())){
poweredPlayerList.get(player.getUniqueId()).isPowersActive = true; poweredPlayerList.get(player.getUniqueId()).isPowersActive = true;
player.sendMessage("Powered up!");
}else{ }else{
player.sendMessage("You must instantiate your power settings using /GPower"); player.sendMessage("You must instantiate your power settings using /GPower");
} }
} }
public void PowerDownPlayer(Player player){ public void PowerDownPlayer(Player player){
player.sendMessage("Powering down!");
if (poweredPlayerList.containsKey(player.getUniqueId())){ if (poweredPlayerList.containsKey(player.getUniqueId())){
player.sendMessage("Powered down!");
poweredPlayerList.get(player.getUniqueId()).isPowersActive = false; poweredPlayerList.get(player.getUniqueId()).isPowersActive = false;
}else{ }else{
player.sendMessage("P down!");
return; return;
} }

View file

@ -18,6 +18,7 @@ public class PowerUp extends TBMCCommandBase {
public boolean OnCommand(CommandSender sender, String label, String[] args) { public boolean OnCommand(CommandSender sender, String label, String[] args) {
if (!(sender instanceof Player)) if (!(sender instanceof Player))
sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong"); sender.sendMessage("You must be a player to use this command! Contact a dev/ali if you think this is wrong");
Player player = (Player) sender; Player player = (Player) sender;
gPowerMemory.PowerUpPlayer(player); gPowerMemory.PowerUpPlayer(player);
return false; return false;

View file

@ -0,0 +1,5 @@
package alisolarflare.uhc.intro;
public class IntroductionCutscene {
//TODO: Teleport all players to the area.
}

View file

@ -23,6 +23,10 @@ public class UHCMatch {
public void setMatchState(MatchState newMS){ public void setMatchState(MatchState newMS){
matchState = newMS; matchState = newMS;
fileConfiguration.set("UHCMatchState", newMS.toString()); fileConfiguration.set("UHCMatchState", newMS.toString());
switch(newMS){
default:
break;
}
} }
} }