diff --git a/src/main/java/com/comandante/creeper/Items/ItemType.java b/src/main/java/com/comandante/creeper/Items/ItemType.java index ae880049fe2f98e437eb1fefc70d9d2d5dfaf0c3..c5a7e8c43801153ccb627f11eaab1eab8a5b1198 100644 --- a/src/main/java/com/comandante/creeper/Items/ItemType.java +++ b/src/main/java/com/comandante/creeper/Items/ItemType.java @@ -17,7 +17,7 @@ public enum ItemType { 0, 60), - BEER(2, Arrays.asList("beer", "can of beer"), + BEER(2, Arrays.asList("beer", "can of beer", "b"), CYAN + "a dented can of beer" + RESET, CYAN + "a beer" + RESET + " lies on the ground, unopened", "This beer looks sketch but you'll probably drink it anyways.", diff --git a/src/main/java/com/comandante/creeper/entity/EntityManager.java b/src/main/java/com/comandante/creeper/entity/EntityManager.java index 98e1d87cf877b56be46b2c79f7724cc88d715a93..55d53a5d4841b8b97fad130fcd9c34f01a815cef 100644 --- a/src/main/java/com/comandante/creeper/entity/EntityManager.java +++ b/src/main/java/com/comandante/creeper/entity/EntityManager.java @@ -85,7 +85,6 @@ public class EntityManager { public void run() { while (true) { try { - Thread.sleep(10000); Iterator<Map.Entry<Integer, Room>> rooms = roomManager.getRooms(); while (rooms.hasNext()) { Map.Entry<Integer, Room> next = rooms.next(); @@ -104,6 +103,7 @@ public class EntityManager { Map.Entry<String, CreeperEntity> next = iterator.next(); ticketRunnerService.submit(next.getValue()); } + Thread.sleep(10000); } catch (InterruptedException ie) { throw new RuntimeException("Problem with ticker."); } diff --git a/src/main/java/com/comandante/creeper/fight/FightManager.java b/src/main/java/com/comandante/creeper/fight/FightManager.java index 24d2c22e31f5902ca6979ebcb7c50e6ae703d538..405b4780c86318be42700320c2ac24e40bc72a22 100644 --- a/src/main/java/com/comandante/creeper/fight/FightManager.java +++ b/src/main/java/com/comandante/creeper/fight/FightManager.java @@ -5,6 +5,7 @@ import com.comandante.creeper.npc.Npc; import com.comandante.creeper.player.Player; import com.comandante.creeper.player.PlayerManager; import com.comandante.creeper.server.ChannelUtils; +import com.comandante.creeper.server.Color; import com.comandante.creeper.server.CreeperSession; import com.comandante.creeper.stat.Stats; @@ -51,7 +52,7 @@ public class FightManager { } if (damageToVictim > 0) { doNpcDamage(npc.getEntityId(), damageToVictim); - channelUtils.writeNoPrompt(player.getPlayerId(), damageToVictim + " damage done to " + npc.getName()); + channelUtils.writeNoPrompt(player.getPlayerId(), damageToVictim + Color.BOLD_ON + Color.BRIGHT_RED + " damage" + Color.RESET + " done to " + npc.getColorName()); } else { channelUtils.writeNoPrompt(player.getPlayerId(), "You miss " + npc.getName()); } @@ -67,9 +68,9 @@ public class FightManager { int damageBack = getAttack(victim, challenger); if (randInt(0, 100) < chanceToHitBack) { doPlayerDamage(player.getPlayerId(), damageBack); - channelUtils.writeNoPrompt(player.getPlayerId(), npc.getName() + " damages you for " + damageBack); + channelUtils.writeNoPrompt(player.getPlayerId(), npc.getColorName() + Color.BOLD_ON + Color.BRIGHT_RED + " damages" + Color.RESET + " you for " + damageBack); } else { - channelUtils.writeNoPrompt(player.getPlayerId(), npc.getName() + " misses you"); + channelUtils.writeNoPrompt(player.getPlayerId(), npc.getColorName() + " misses you"); } try { Thread.sleep(600); diff --git a/src/main/java/com/comandante/creeper/npc/NpcMover.java b/src/main/java/com/comandante/creeper/npc/NpcMover.java index 350dddce9bda0affcb118626a1700f8ccc48cae1..7707e86cf3db194171366066080a5107f22af1bd 100644 --- a/src/main/java/com/comandante/creeper/npc/NpcMover.java +++ b/src/main/java/com/comandante/creeper/npc/NpcMover.java @@ -37,9 +37,9 @@ public class NpcMover { Integer destinationRoomId = canRoam.get(random.nextInt(canRoam.size())); String exitMessage = getExitMessage(npcCurrentRoom, destinationRoomId); npcCurrentRoom.getNpcIds().remove(npcId); - gameManager.roomSay(npcCurrentRoom.getRoomId(), npcEntity.getName() + " " + exitMessage, ""); + gameManager.roomSay(npcCurrentRoom.getRoomId(), npcEntity.getColorName() + " " + exitMessage, ""); gameManager.getRoomManager().getRoom(destinationRoomId).getNpcIds().add(npcId); - gameManager.roomSay(destinationRoomId, npcEntity.getName() + " has arrived.", ""); + gameManager.roomSay(destinationRoomId, npcEntity.getColorName() + " has arrived.", ""); } public String getExitMessage(Room room, Integer exitRoomId) { diff --git a/src/main/java/com/comandante/creeper/npc/StreetHustler.java b/src/main/java/com/comandante/creeper/npc/StreetHustler.java index 5196874fdc0e81f4e6acc8f54793046774818b81..4409f648ba1fa4be26fed75a0128a3e319ed28bb 100644 --- a/src/main/java/com/comandante/creeper/npc/StreetHustler.java +++ b/src/main/java/com/comandante/creeper/npc/StreetHustler.java @@ -11,7 +11,6 @@ import java.util.HashSet; import java.util.Set; import static com.comandante.creeper.server.Color.BRIGHT_RED; -import static com.comandante.creeper.server.Color.GREEN; import static com.comandante.creeper.server.Color.RESET; public class StreetHustler extends Npc { @@ -21,7 +20,8 @@ public class StreetHustler extends Npc { {"s", "street", "hustler", NAME} )); - private final static String colorName = GREEN + "s" + Color.YELLOW + "t" + Color.BLUE + "r" + Color.MAGENTA + "e" + Color.BRIGHT_WHITE + "e" + Color.RED + "t" + Color.BRIGHT_GREEN + " hustler" + RESET; + private final static String colorName = Color.BOLD_ON + Color.BRIGHT_MAGENTA + Color.BOLD_OFF + "s" + Color.YELLOW + "t" + Color.BLUE + "r" + Color.MAGENTA + "e" + Color.BRIGHT_WHITE + "e" + Color.RED + "t" + Color.BRIGHT_GREEN + " " + + Color.BRIGHT_YELLOW + "hustler" + RESET; private final static String dieMessage = "a " + colorName + " breathes his last breath in a pool of " + BRIGHT_RED + "blood" + RESET; public StreetHustler(GameManager gameManager) { diff --git a/src/main/java/com/comandante/creeper/room/RoomBuilders.java b/src/main/java/com/comandante/creeper/room/RoomBuilders.java index e8536e72846896c621bf600cd2884ce7290571d5..096ff9c6b3d3fb0bb0528f77f7cc0dbd816c0c71 100644 --- a/src/main/java/com/comandante/creeper/room/RoomBuilders.java +++ b/src/main/java/com/comandante/creeper/room/RoomBuilders.java @@ -343,5 +343,4 @@ public class RoomBuilders { "You arrive to the end of Terminal 4.\r\n")); } - }