Skip to content
Snippets Groups Projects
Commit 0dd92091 authored by Chris Kearney's avatar Chris Kearney
Browse files

mostly color improvements

parent 04194e70
No related branches found
No related tags found
No related merge requests found
......@@ -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.",
......
......@@ -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.");
}
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -343,5 +343,4 @@ public class RoomBuilders {
"You arrive to the end of Terminal 4.\r\n"));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment