diff --git a/src/main/java/com/comandante/creeper/Main.java b/src/main/java/com/comandante/creeper/Main.java index 71a9d5df48445ac7f19fe87a95262a6d15213169..7e264d5323d8ab728254909a3bebfb5f1d46c8c6 100644 --- a/src/main/java/com/comandante/creeper/Main.java +++ b/src/main/java/com/comandante/creeper/Main.java @@ -4,7 +4,10 @@ import com.comandante.creeper.Items.ItemType; import com.comandante.creeper.entity.EntityManager; import com.comandante.creeper.managers.GameManager; import com.comandante.creeper.managers.SessionManager; +import com.comandante.creeper.npc.BergOrc; import com.comandante.creeper.npc.StreetHustler; +import com.comandante.creeper.npc.SwampBerserker; +import com.comandante.creeper.npc.TreeBerserker; import com.comandante.creeper.player.PlayerManager; import com.comandante.creeper.player.PlayerMetadata; import com.comandante.creeper.server.CreeperCommandRegistry; @@ -42,6 +45,9 @@ public class Main { public static CreeperCommandRegistry creeperCommandRegistry; private static final Logger log = Logger.getLogger(Main.class); + private static final int PORT = 8080; + public static final String MUD_NAME = "creeper"; + public static void main(String[] args) throws Exception { checkAndCreateWorld(); @@ -69,17 +75,23 @@ public class Main { startUpMessage("Generating maps"); mapsManager.generateAllMaps(9, 9); startUpMessage("Adding Street Hustlers"); - entityManager.addEntity(new NpcSpawner(new StreetHustler(gameManager), Area.NEWBIE_ZONE, gameManager, new SpawnRule(10, 3, 4, 100))); - Iterator<Map.Entry<Integer, Room>> rooms = roomManager.getRooms(); - while (rooms.hasNext()) { - Map.Entry<Integer, Room> next = rooms.next(); - next.getValue().setAreas(Sets.newHashSet(Area.NEWBIE_ZONE)); - } + entityManager.addEntity(new NpcSpawner(new StreetHustler(gameManager), Area.NEWBIE_ZONE, gameManager, new SpawnRule(10, 30, 3, 25))); + entityManager.addEntity(new NpcSpawner(new StreetHustler(gameManager), Area.DEFAULT, gameManager, new SpawnRule(10, 3, 4, 25))); startUpMessage("Adding beer"); - ItemSpawner itemSpawner = new ItemSpawner(ItemType.BEER, Area.NEWBIE_ZONE, new SpawnRule(20, 1, 4, 100), gameManager); + ItemSpawner itemSpawner = new ItemSpawner(ItemType.BEER, Area.NEWBIE_ZONE, new SpawnRule(20, 20, 2, 25), gameManager); entityManager.addEntity(itemSpawner); + startUpMessage("Adding Tree Berserkers"); + entityManager.addEntity(new NpcSpawner(new TreeBerserker(gameManager), Area.NEWBIE_ZONE, gameManager, new SpawnRule(10, 6, 2, 100))); + entityManager.addEntity(new NpcSpawner(new TreeBerserker(gameManager), Area.NORTH1_ZONE, gameManager, new SpawnRule(10, 14, 2, 100))); + + startUpMessage("Adding Swamp Berserkers"); + entityManager.addEntity(new NpcSpawner(new SwampBerserker(gameManager), Area.NORTH2_ZONE, gameManager, new SpawnRule(10, 8, 2, 100))); + + startUpMessage("Adding Berg Orcs"); + entityManager.addEntity(new NpcSpawner(new BergOrc(gameManager), Area.BLOODRIDGE1_ZONE, gameManager, new SpawnRule(10, 8, 2, 100))); + startUpMessage("Configuring Creeper Commmands"); creeperCommandRegistry = new CreeperCommandRegistry(new UnknownCommand(gameManager)); creeperCommandRegistry.addCommand(new DropCommand(gameManager)); @@ -100,9 +112,10 @@ public class Main { creeperCommandRegistry.addCommand(new SaveWorldCommand(gameManager)); creeperCommandRegistry.addCommand(new BuildCommand(gameManager)); creeperCommandRegistry.addCommand(new MapCommand(gameManager)); + creeperCommandRegistry.addCommand(new AreaCommand(gameManager)); - CreeperServer creeperServer = new CreeperServer(8080, db); + CreeperServer creeperServer = new CreeperServer(PORT, db); startUpMessage("Creeper engine started"); creeperServer.run(gameManager); startUpMessage("Creeper online"); diff --git a/src/main/java/com/comandante/creeper/fight/FightRun.java b/src/main/java/com/comandante/creeper/fight/FightRun.java index b9caaea1c567e3ac33eac93f41ab53af776483ad..586371881cc8ad26bbaa65714d9b686c461a0334 100644 --- a/src/main/java/com/comandante/creeper/fight/FightRun.java +++ b/src/main/java/com/comandante/creeper/fight/FightRun.java @@ -55,8 +55,11 @@ public class FightRun implements Callable<FightResults> { } if (npcStats.getCurrentHealth() <= 0) { - gameManager.getChannelUtils().write(player.getPlayerId(), "You killed " + npc.getName(), true); + int experience = gameManager.getPlayerManager().getPlayerMetadata(player.getPlayerId()).getStats().getExperience(); + experience += npc.getStats().getExperience(); + gameManager.getChannelUtils().write(player.getPlayerId(), "You killed " + npc.getName() + " (" + npc.getStats().getExperience() + "exp)", true); gameManager.getChannelUtils().writeToRoom(player.getPlayerId(), npc.getDieMessage()); + gameManager.getPlayerManager().getPlayerMetadata(player.getPlayerId()).getStats().setExperience(experience); gameManager.getEntityManager().deleteNpcEntity(npc.getEntityId()); fightResults = new FightResultsBuilder().setNpcWon(false).setPlayerWon(true).createFightResults(); } diff --git a/src/main/java/com/comandante/creeper/managers/GameManager.java b/src/main/java/com/comandante/creeper/managers/GameManager.java index 3e88ae60a80186dab67c118718229d744e47045b..a45432d52801602f747566e77498d6f94009ea0d 100644 --- a/src/main/java/com/comandante/creeper/managers/GameManager.java +++ b/src/main/java/com/comandante/creeper/managers/GameManager.java @@ -13,10 +13,7 @@ import com.comandante.creeper.server.ChannelUtils; import com.comandante.creeper.server.Color; import com.comandante.creeper.server.CreeperSession; import com.comandante.creeper.server.MultiLineInputManager; -import com.comandante.creeper.world.FloorManager; -import com.comandante.creeper.world.MapsManager; -import com.comandante.creeper.world.Room; -import com.comandante.creeper.world.RoomManager; +import com.comandante.creeper.world.*; import com.google.common.base.Optional; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Interners; @@ -24,6 +21,7 @@ import org.apache.commons.lang3.text.WordUtils; import org.jboss.netty.channel.MessageEvent; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Set; @@ -226,6 +224,13 @@ public class GameManager { } numExits++; } + if (room.getEnterExits() != null && room.getEnterExits().size() > 0) { + List<RemoteExit> enters = room.getEnterExits(); + for (RemoteExit enter: enters) { + sb.append("e-" + enter.getExitDetail() + " "); + numExits++; + } + } String fin = null; if (numExits == 1) { fin = sb.toString().replace(BOLD_OFF, BOLD_ON); diff --git a/src/main/java/com/comandante/creeper/npc/BergOrc.java b/src/main/java/com/comandante/creeper/npc/BergOrc.java new file mode 100644 index 0000000000000000000000000000000000000000..a4e2eecce7fb2b07a20ef0fdef0f81ea466befe2 --- /dev/null +++ b/src/main/java/com/comandante/creeper/npc/BergOrc.java @@ -0,0 +1,34 @@ +package com.comandante.creeper.npc; + +import com.comandante.creeper.managers.GameManager; +import com.comandante.creeper.world.Area; +import com.comandante.creeper.server.Color; +import com.google.common.base.Optional; +import com.google.common.collect.Sets; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import static com.comandante.creeper.server.Color.BOLD_ON; +import static com.comandante.creeper.server.Color.RESET; + +public class BergOrc extends Npc { + private final static long phraseIntervalMs = 300000; + private final static String NAME = "berg orc"; + private final static Set<String> validTriggers = new HashSet<String>(Arrays.asList(new String[] + {"b", "berg", "orc", "o", NAME} + )); + + private final static String colorName = "berg" + BOLD_ON + Color.GREEN + " orc" + Color.RESET; + private final static String dieMessage = "a " + colorName + " breathes his last breath in a pool of " + BOLD_ON + Color.RED + "blood" + RESET + "."; + + public BergOrc(GameManager gameManager) { + super(gameManager, NAME, colorName, 0, NpcStats.BERG_ORC.createStats(), dieMessage, Optional.of(Sets.newHashSet(Area.BLOODRIDGE1_ZONE)), validTriggers); + } + + @Override + public BergOrc create(GameManager gameManager) { + return new BergOrc(gameManager); + } +} \ No newline at end of file diff --git a/src/main/java/com/comandante/creeper/npc/NpcStats.java b/src/main/java/com/comandante/creeper/npc/NpcStats.java index ee18b2f2069d9c76d52c9bbd65e9b7ea12c180d5..386e4e3f5f413920605bc6d33cf28d5aa4196512 100644 --- a/src/main/java/com/comandante/creeper/npc/NpcStats.java +++ b/src/main/java/com/comandante/creeper/npc/NpcStats.java @@ -15,7 +15,7 @@ public class NpcStats { .setWeaponRatingMin(5) .setWeaponRatingMax(10) .setNumberweaponOfRolls(1) - .setExperience(100); + .setExperience(3); public final static StatsBuilder DRUGGED_PIMP = new StatsBuilder() .setStrength(5) @@ -29,6 +29,49 @@ public class NpcStats { .setWeaponRatingMin(5) .setWeaponRatingMax(10) .setNumberweaponOfRolls(1) - .setExperience(100); + .setExperience(3); + + public final static StatsBuilder TREE_BERSERKER = new StatsBuilder() + .setStrength(8) + .setWillpower(1) + .setAim(1) + .setAgile(1) + .setArmorRating(8) + .setMeleSkill(6) + .setCurrentHealth(200) + .setMaxHealth(200) + .setWeaponRatingMin(8) + .setWeaponRatingMax(13) + .setNumberweaponOfRolls(1) + .setExperience(150); + + + public final static StatsBuilder SWAMP_BERSERKER = new StatsBuilder() + .setStrength(11) + .setWillpower(2) + .setAim(2) + .setAgile(1) + .setArmorRating(8) + .setMeleSkill(6) + .setCurrentHealth(230) + .setMaxHealth(230) + .setWeaponRatingMin(10) + .setWeaponRatingMax(13) + .setNumberweaponOfRolls(1) + .setExperience(190); + + public final static StatsBuilder BERG_ORC = new StatsBuilder() + .setStrength(11) + .setWillpower(2) + .setAim(2) + .setAgile(1) + .setArmorRating(8) + .setMeleSkill(6) + .setCurrentHealth(230) + .setMaxHealth(230) + .setWeaponRatingMin(10) + .setWeaponRatingMax(13) + .setNumberweaponOfRolls(1) + .setExperience(190); } diff --git a/src/main/java/com/comandante/creeper/npc/SwampBerserker.java b/src/main/java/com/comandante/creeper/npc/SwampBerserker.java new file mode 100644 index 0000000000000000000000000000000000000000..0ed76afee3c18921582bf1bf0b32426f3ff9e612 --- /dev/null +++ b/src/main/java/com/comandante/creeper/npc/SwampBerserker.java @@ -0,0 +1,34 @@ +package com.comandante.creeper.npc; + +import com.comandante.creeper.managers.GameManager; +import com.comandante.creeper.world.Area; +import com.comandante.creeper.server.Color; +import com.google.common.base.Optional; +import com.google.common.collect.Sets; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import static com.comandante.creeper.server.Color.BOLD_ON; +import static com.comandante.creeper.server.Color.RESET; + +public class SwampBerserker extends Npc { + private final static long phraseIntervalMs = 300000; + private final static String NAME = "swamp berserker"; + private final static Set<String> validTriggers = new HashSet<String>(Arrays.asList(new String[] + {"s", "swamp", "berserker","b", NAME} + )); + + private final static String colorName = "swamp" + BOLD_ON + Color.MAGENTA + " berserker" + Color.RESET ; + private final static String dieMessage = "a " + colorName + " breathes his last breath in a pool of " + BOLD_ON + Color.RED + "blood" + RESET + "."; + + public SwampBerserker(GameManager gameManager) { + super(gameManager, NAME, colorName, 0, NpcStats.SWAMP_BERSERKER.createStats(), dieMessage, Optional.of(Sets.newHashSet(Area.NORTH2_ZONE)), validTriggers); + } + + @Override + public SwampBerserker create(GameManager gameManager) { + return new SwampBerserker(gameManager); + } +} \ No newline at end of file diff --git a/src/main/java/com/comandante/creeper/npc/TreeBerserker.java b/src/main/java/com/comandante/creeper/npc/TreeBerserker.java new file mode 100644 index 0000000000000000000000000000000000000000..292f7e184b4c482d716c5de1825af4f358f98f31 --- /dev/null +++ b/src/main/java/com/comandante/creeper/npc/TreeBerserker.java @@ -0,0 +1,34 @@ +package com.comandante.creeper.npc; + +import com.comandante.creeper.managers.GameManager; +import com.comandante.creeper.world.Area; +import com.comandante.creeper.server.Color; +import com.google.common.base.Optional; +import com.google.common.collect.Sets; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import static com.comandante.creeper.server.Color.BOLD_ON; +import static com.comandante.creeper.server.Color.RESET; + +public class TreeBerserker extends Npc { + private final static long phraseIntervalMs = 300000; + private final static String NAME = "tree berserker"; + private final static Set<String> validTriggers = new HashSet<String>(Arrays.asList(new String[] + {"t", "tree", "berserker", "b", NAME} + )); + + private final static String colorName = "tree" + BOLD_ON + Color.MAGENTA + " berserker" + Color.RESET; + private final static String dieMessage = "a " + colorName + " breathes his last breath in a pool of " + BOLD_ON + Color.RED + "blood" + RESET + "."; + + public TreeBerserker(GameManager gameManager) { + super(gameManager, NAME, colorName, 0, NpcStats.TREE_BERSERKER.createStats(), dieMessage, Optional.of(Sets.newHashSet(Area.NEWBIE_ZONE)), validTriggers); + } + + @Override + public TreeBerserker create(GameManager gameManager) { + return new TreeBerserker(gameManager); + } +} \ No newline at end of file diff --git a/src/main/java/com/comandante/creeper/player/PlayerManager.java b/src/main/java/com/comandante/creeper/player/PlayerManager.java index 76b9549543bb8cb44f1af4a17e6fd9e4bd69aa60..21269983190ab58088dad2a2f018eefefc2215e8 100644 --- a/src/main/java/com/comandante/creeper/player/PlayerManager.java +++ b/src/main/java/com/comandante/creeper/player/PlayerManager.java @@ -1,6 +1,7 @@ package com.comandante.creeper.player; +import com.comandante.creeper.Main; import com.comandante.creeper.fight.FightManager; import com.comandante.creeper.managers.SessionManager; import com.comandante.creeper.server.Color; @@ -166,7 +167,9 @@ public class PlayerManager { StringBuilder sb = new StringBuilder() .append("[") .append(player.getPlayerName()) - .append("@creeper ") + .append("@") + .append(Main.MUD_NAME) + .append(" ") .append(currentHealth).append("/").append(maxHealth); if (isFight) { sb.append(Color.RED + " ! " + Color.RESET); diff --git a/src/main/java/com/comandante/creeper/server/command/AreaCommand.java b/src/main/java/com/comandante/creeper/server/command/AreaCommand.java new file mode 100644 index 0000000000000000000000000000000000000000..8c65106943ffd5783125b676c17be57f780e17bb --- /dev/null +++ b/src/main/java/com/comandante/creeper/server/command/AreaCommand.java @@ -0,0 +1,48 @@ +package com.comandante.creeper.server.command; + +import com.comandante.creeper.managers.GameManager; +import com.comandante.creeper.player.Player; +import com.comandante.creeper.world.Area; +import com.google.common.base.Joiner; +import com.google.common.collect.Sets; +import org.jboss.netty.channel.ChannelHandlerContext; +import org.jboss.netty.channel.MessageEvent; + +import java.util.Arrays; +import java.util.List; +import java.util.Set; + + +public class AreaCommand extends Command { + final static List<String> validTriggers = Arrays.asList("a", "area"); + final static String description = "Alter area settings for the current room."; + + public AreaCommand(GameManager gameManager) { + super(gameManager, validTriggers, description); + } + + @Override + public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { + configure(e); + try { + if (originalMessageParts.size() == 1) { + Set<Area> areas = currentRoom.getAreas(); + for (Area area: areas) { + write(area.getName() + "\r\n"); + } + return; + } + String s = originalMessageParts.get(1); + List<String> strings = Arrays.asList(s.split(",")); + Set<Area> newAreas = Sets.newConcurrentHashSet(); + for (String string: strings) { + String trim = string.trim(); + newAreas.add(Area.getByName(trim)); + write("Added: " + trim + "\r\n"); + } + currentRoom.setAreas(newAreas); + } finally { + super.messageReceived(ctx, e); + } + } +} diff --git a/src/main/java/com/comandante/creeper/server/command/InventoryCommand.java b/src/main/java/com/comandante/creeper/server/command/InventoryCommand.java index 5402b7c5ea6e0c7dc16651e7d077770dfc069c14..075a06d41fdeb2dbeceb79594f458a2b244a19ba 100644 --- a/src/main/java/com/comandante/creeper/server/command/InventoryCommand.java +++ b/src/main/java/com/comandante/creeper/server/command/InventoryCommand.java @@ -43,9 +43,9 @@ public class InventoryCommand extends Command { int remainingUses = maxUses - item.getNumberOfUses(); sb.append(" - ").append(remainingUses); if (remainingUses == 1) { - sb.append(" use left."); + sb.append(" use left.").append("\r\n"); } else { - sb.append(" uses left."); + sb.append(" uses left.").append("\r\n"); } } } diff --git a/src/main/java/com/comandante/creeper/server/command/LookCommand.java b/src/main/java/com/comandante/creeper/server/command/LookCommand.java index af16fa5eadbdaff3321e76ebc52458fbcde50977..02bb041d364021e6cc3fc5f38c36c1edbc790adf 100644 --- a/src/main/java/com/comandante/creeper/server/command/LookCommand.java +++ b/src/main/java/com/comandante/creeper/server/command/LookCommand.java @@ -35,7 +35,7 @@ public class LookCommand extends Command { for (String presentPlayerId : presentPlayerIds) { Player presentPlayer = gameManager.getPlayerManager().getPlayer(presentPlayerId); if (presentPlayer.getPlayerName().equals(target)) { - write(playerManager.getLookString(player)); + write(playerManager.getLookString(presentPlayer)); } } } finally { diff --git a/src/main/java/com/comandante/creeper/server/command/MovementCommand.java b/src/main/java/com/comandante/creeper/server/command/MovementCommand.java index c5926ebb38c973c775769ed3c590936271cecabb..b66720a5f0312d5b3e6a8561213c8723982d8fa6 100644 --- a/src/main/java/com/comandante/creeper/server/command/MovementCommand.java +++ b/src/main/java/com/comandante/creeper/server/command/MovementCommand.java @@ -3,6 +3,7 @@ package com.comandante.creeper.server.command; import com.comandante.creeper.fight.FightManager; import com.comandante.creeper.managers.GameManager; import com.comandante.creeper.player.PlayerMovement; +import com.comandante.creeper.world.RemoteExit; import com.comandante.creeper.world.Room; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; @@ -22,8 +23,9 @@ public class MovementCommand extends Command { public final static List<String> westTriggers = Arrays.asList("w", "west".toLowerCase()); public final static List<String> upTriggers = Arrays.asList("u", "up".toLowerCase()); public final static List<String> downTriggers = Arrays.asList("d", "down".toLowerCase()); + public final static List<String> enterTriggers = Arrays.asList("enter", "enter".toLowerCase()); - public final static ImmutableList validTriggers = new ImmutableList.Builder<String>().addAll(northTriggers).addAll(southTriggers).addAll(eastTriggers).addAll(westTriggers).addAll(upTriggers).addAll(downTriggers).build(); + public final static ImmutableList validTriggers = new ImmutableList.Builder<String>().addAll(northTriggers).addAll(southTriggers).addAll(eastTriggers).addAll(westTriggers).addAll(upTriggers).addAll(downTriggers).addAll(enterTriggers).build(); public MovementCommand(GameManager gameManager) { super(gameManager, validTriggers, description); @@ -59,6 +61,15 @@ public class MovementCommand extends Command { } else if (downTriggers.contains(command.toLowerCase()) && currentRoom.getDownId().isPresent()) { Room destinationRoom = roomManager.getRoom(currentRoom.getDownId().get()); playerMovement = new PlayerMovement(player, currentRoom.getRoomId(), destinationRoom.getRoomId(), this, "exited to the west.", "up"); + } else if (enterTriggers.contains(command.toLowerCase())) { + Optional<RemoteExit> remoteExitOptional = doesEnterExitExist(); + if (remoteExitOptional.isPresent()) { + Room destinationRoom = roomManager.getRoom(remoteExitOptional.get().getRoomId()); + playerMovement = new PlayerMovement(player, currentRoom.getRoomId(), destinationRoom.getRoomId(), this, "entered " + remoteExitOptional.get().getDirection() + ".", "N/A"); + } else { + write("There's no where to go with that name. (" + command + ")"); + return; + } } else { write("There's no exit in that direction. (" + command + ")"); return; @@ -72,4 +83,14 @@ public class MovementCommand extends Command { super.messageReceived(ctx, e); } } + + private Optional<RemoteExit> doesEnterExitExist() { + String enterExitName = originalMessageParts.get(1); + for (RemoteExit remoteExit : currentRoom.getEnterExits()) { + if (remoteExit.getExitDetail().equals(enterExitName)) { + return Optional.of(remoteExit); + } + } + return Optional.absent(); + } } diff --git a/src/main/java/com/comandante/creeper/server/command/admin/BuildCommand.java b/src/main/java/com/comandante/creeper/server/command/admin/BuildCommand.java index 62db4fea4fb6b51782244754647229beb214fcfb..cf6a3b581c0473866e527bf87ba955fd56d6c11c 100644 --- a/src/main/java/com/comandante/creeper/server/command/admin/BuildCommand.java +++ b/src/main/java/com/comandante/creeper/server/command/admin/BuildCommand.java @@ -14,6 +14,7 @@ import com.comandante.creeper.world.Room; import com.comandante.creeper.world.WorldExporter; import com.google.common.base.Optional; import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; import com.google.common.collect.Sets; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; @@ -63,8 +64,10 @@ public class BuildCommand extends Command { if (!currentRoom.getUpId().isPresent()) { Integer newRoomId = findUnusedRoomId(); Integer newFloorId = findUnusedFloorId(); - mapMatrix.addRemote(currentRoom.getRoomId(), new RemoteExit(RemoteExit.Direction.UP, newRoomId)); - FloorModel newFloorModel = newFloorModel(newFloorId, newRoomId, currentRoom.getRoomId(), RemoteExit.Direction.DOWN); + RemoteExit remoteExit = new RemoteExit(RemoteExit.Direction.UP, newRoomId, ""); + RemoteExit returnRemoteExit = new RemoteExit(RemoteExit.Direction.DOWN, currentRoom.getRoomId(), ""); + mapMatrix.addRemote(currentRoom.getRoomId(), remoteExit); + FloorModel newFloorModel = newFloorModel(newFloorId, newRoomId, currentRoom.getRoomId(), returnRemoteExit); BasicRoom basicRoom = newBasic() .setRoomId(newRoomId) .setFloorId(newFloorId) @@ -84,8 +87,10 @@ public class BuildCommand extends Command { if (!currentRoom.getDownId().isPresent()) { Integer newRoomId = findUnusedRoomId(); Integer newFloorId = findUnusedFloorId(); - mapMatrix.addRemote(currentRoom.getRoomId(), new RemoteExit(RemoteExit.Direction.DOWN, newRoomId)); - FloorModel newFloorModel = newFloorModel(newFloorId, newRoomId, currentRoom.getRoomId(), RemoteExit.Direction.UP); + RemoteExit remoteExit = new RemoteExit(RemoteExit.Direction.DOWN, newRoomId, ""); + RemoteExit returnRemoteExit = new RemoteExit(RemoteExit.Direction.UP, currentRoom.getRoomId(), ""); + mapMatrix.addRemote(currentRoom.getRoomId(), remoteExit); + FloorModel newFloorModel = newFloorModel(newFloorId, newRoomId, currentRoom.getRoomId(), returnRemoteExit); BasicRoom basicRoom = newBasic() .setRoomId(newRoomId) .setFloorId(newFloorId) @@ -101,6 +106,28 @@ public class BuildCommand extends Command { gameManager.currentRoomLogic(player.getPlayerId()); return; } + } else if (desiredBuildDirection.equalsIgnoreCase("enter")) { + String enterName = originalMessageParts.get(2); + Integer newRoomId = findUnusedRoomId(); + Integer newFloorId = findUnusedFloorId(); + RemoteExit remoteExit = new RemoteExit(RemoteExit.Direction.ENTER, newRoomId, enterName); + RemoteExit returnRemoteExit = new RemoteExit(RemoteExit.Direction.ENTER, currentRoom.getRoomId(), "Leave"); + mapMatrix.addRemote(currentRoom.getRoomId(),remoteExit ); + FloorModel newFloorModel = newFloorModel(newFloorId, newRoomId, currentRoom.getRoomId(), returnRemoteExit); + BasicRoom basicRoom = newBasic() + .setRoomId(newRoomId) + .setFloorId(newFloorId) + .addEnterExit(returnRemoteExit) + .createBasicRoom(); + currentRoom.addEnterExit(remoteExit); + entityManager.addEntity(basicRoom); + newFloorModel.setRoomModels(Sets.newHashSet(Iterators.transform(Sets.newHashSet(basicRoom).iterator(), WorldExporter.buildRoomModelsFromRooms()))); + floorManager.addFloor(newFloorModel.getId(), newFloorModel.getName()); + mapsManager.addFloorMatrix(newFloorModel.getId(), MapMatrix.createMatrixFromCsv(newFloorModel.getRawMatrixCsv())); + mapsManager.generateAllMaps(9, 9); + gameManager.movePlayer(new PlayerMovement(player, currentRoom.getRoomId(), basicRoom.getRoomId(), null, "", "")); + gameManager.currentRoomLogic(player.getPlayerId()); + return; } channelUtils.write(playerId, "Room already exists at that location."); } @@ -109,13 +136,16 @@ public class BuildCommand extends Command { } } - private FloorModel newFloorModel(Integer floorId, Integer newRoomId, Integer currentRoomId, RemoteExit.Direction returnDirection) { + private FloorModel newFloorModel(Integer floorId, Integer newRoomId, Integer currentRoomId, RemoteExit remoteExit) { FloorModel newFloorModel = new FloorModel(); + RemoteExit.Direction returnDirection = remoteExit.getDirection(); newFloorModel.setId(floorId); if (returnDirection.equals(RemoteExit.Direction.DOWN)) { - newFloorModel.setRawMatrixCsv(Integer.toString(newRoomId) + "d" + currentRoomId); + newFloorModel.setRawMatrixCsv(Integer.toString(newRoomId) + "d|" + currentRoomId); } else if (returnDirection.equals(RemoteExit.Direction.UP)) { - newFloorModel.setRawMatrixCsv(Integer.toString(newRoomId) + "u" + currentRoomId); + newFloorModel.setRawMatrixCsv(Integer.toString(newRoomId) + "u|" + currentRoomId); + } else if (returnDirection.equals(RemoteExit.Direction.ENTER)) { + newFloorModel.setRawMatrixCsv(Integer.toString(newRoomId)); } newFloorModel.setName(UUID.randomUUID().toString()); return newFloorModel; @@ -175,6 +205,7 @@ public class BuildCommand extends Command { if (mapMatrix.getWesternExit(room.getRoomId()) > 0) { room.setWestId(Optional.of(mapMatrix.getWesternExit(room.getRoomId()))); } + room.setEnterExits(Lists.<RemoteExit>newArrayList()); if (mapMatrix.getRemotes().containsKey(room.getRoomId())) { Set<RemoteExit> remoteExits = mapMatrix.getRemotes().get(room.getRoomId()); for (RemoteExit next : remoteExits) { @@ -182,6 +213,8 @@ public class BuildCommand extends Command { room.setUpId(Optional.of(next.getRoomId())); } else if (next.getDirection().equals(RemoteExit.Direction.DOWN)) { room.setDownId(Optional.of(next.getRoomId())); + } else if (next.getDirection().equals(RemoteExit.Direction.ENTER)) { + room.addEnterExit(next); } } } diff --git a/src/main/java/com/comandante/creeper/world/Area.java b/src/main/java/com/comandante/creeper/world/Area.java index 53fcaccaf520bafe9d1f38c89797c078de4ad5df..70508259a0ba18df0316542bea28745e6fb3d416 100644 --- a/src/main/java/com/comandante/creeper/world/Area.java +++ b/src/main/java/com/comandante/creeper/world/Area.java @@ -2,6 +2,13 @@ package com.comandante.creeper.world; public enum Area { DEFAULT("default"), + HOUSE_ZONE("house_zone"), + NORTH1_ZONE("north1_zone"), + NORTH2_ZONE("north2_zone"), + BLOODRIDGE1_ZONE("bloodridge1_zone"), + BLOODRIDGE2_ZONE("bloodridge2_zone"), + WESTERN1_ZONE("western1_zone"), + WESTERN2_ZONE("western2_zone"), NEWBIE_ZONE("newbie_zone"); private final String name; diff --git a/src/main/java/com/comandante/creeper/world/BasicRoom.java b/src/main/java/com/comandante/creeper/world/BasicRoom.java index fcc0e00c4b5678681a8e581c5d4380938cbf3cc7..faca5d81aefacb4c6b54f79d070fbae4b94894e8 100644 --- a/src/main/java/com/comandante/creeper/world/BasicRoom.java +++ b/src/main/java/com/comandante/creeper/world/BasicRoom.java @@ -2,6 +2,7 @@ package com.comandante.creeper.world; import com.google.common.base.Optional; +import java.util.List; import java.util.Set; public class BasicRoom extends Room { @@ -20,9 +21,10 @@ public class BasicRoom extends Room { Optional<Integer> westId, Optional<Integer> upId, Optional<Integer> downId, + List<RemoteExit> enterExits, String roomDescription, Set<String> roomTags, Set<Area> areas) { - super(roomId, roomTitle, floorId, northId, southId, eastId, westId, upId, downId, roomDescription, roomTags, areas); + super(roomId, roomTitle, floorId, northId, southId, eastId, westId, upId, downId, enterExits, roomDescription, roomTags, areas); } } diff --git a/src/main/java/com/comandante/creeper/world/BasicRoomBuilder.java b/src/main/java/com/comandante/creeper/world/BasicRoomBuilder.java index a038e11f3ddba9030c7cced03f872d6d2d5b5b03..b8097c73b55da360a737a41a8d52da65643f6bd3 100644 --- a/src/main/java/com/comandante/creeper/world/BasicRoomBuilder.java +++ b/src/main/java/com/comandante/creeper/world/BasicRoomBuilder.java @@ -1,8 +1,10 @@ package com.comandante.creeper.world; import com.google.common.base.Optional; +import com.google.common.collect.Lists; import com.google.common.collect.Sets; +import java.util.List; import java.util.Set; public class BasicRoomBuilder { @@ -15,6 +17,7 @@ public class BasicRoomBuilder { private Optional<Integer> westId = Optional.absent(); private Optional<Integer> upId = Optional.absent(); private Optional<Integer> downId = Optional.absent(); + private List<RemoteExit> enterExits = Lists.newArrayList(); private String roomDescription; private Set<String> roomTags = Sets.newConcurrentHashSet(); private Set<Area> areas = Sets.newConcurrentHashSet(); @@ -80,7 +83,12 @@ public class BasicRoomBuilder { return this; } + public BasicRoomBuilder addEnterExit(RemoteExit remoteExit) { + this.enterExits.add(remoteExit); + return this; + } + public BasicRoom createBasicRoom() { - return new BasicRoom(roomId, roomTitle, floorId, northId, southId, eastId, westId, upId, downId, roomDescription, roomTags, areas); + return new BasicRoom(roomId, roomTitle, floorId, northId, southId, eastId, westId, upId, downId, enterExits, roomDescription, roomTags, areas); } } \ No newline at end of file diff --git a/src/main/java/com/comandante/creeper/world/MapMatrix.java b/src/main/java/com/comandante/creeper/world/MapMatrix.java index 22d65247b0fd0d21be5f3f64867e7e493fce6a98..3ad8f3320c542fb2c33b759430c966835ce311ca 100644 --- a/src/main/java/com/comandante/creeper/world/MapMatrix.java +++ b/src/main/java/com/comandante/creeper/world/MapMatrix.java @@ -190,9 +190,9 @@ public class MapMatrix { if (remotes.containsKey(roomId)) { for (RemoteExit exit : remotes.get(roomId)) { if (exit.getDirection().equals(RemoteExit.Direction.UP)) { - sb.append("u").append(exit.getRoomId()); + sb.append("u|").append(exit.getRoomId()); } else if (exit.getDirection().equals(RemoteExit.Direction.DOWN)) { - sb.append("d").append(exit.getRoomId()); + sb.append("d|").append(exit.getRoomId()); } } } @@ -205,7 +205,7 @@ public class MapMatrix { } private static Integer getUp(String csvInputCell) { - String[] us = csvInputCell.split("u"); + String[] us = csvInputCell.split("u\\|"); if (us[1].matches(".*[a-zA-Z]+.*")) { return Integer.valueOf(us[1].split("[a-zA-Z]")[0]); } @@ -213,13 +213,26 @@ public class MapMatrix { } private static Integer getDown(String csvInputCell) { - String[] us = csvInputCell.split("d"); + String[] us = csvInputCell.split("d\\|"); if (us[1].matches(".*[a-zA-Z]+.*")) { return Integer.valueOf(us[1].split("[a-zA-Z]")[0]); } return Integer.valueOf(us[1]); } + private static Integer getEnter(String csvInputCell) { + String[] us = csvInputCell.split("e\\|"); + if (us[1].matches(".*\\|\\|.*")) { + return Integer.valueOf(us[1].split("\\|\\|")[0]); + } + return Integer.valueOf(us[1]); + } + + private static String getEnterDescription(String csvInputCell) { + String[] us = csvInputCell.split("\\|\\|"); + return us[1]; + } + public static MapMatrix createMatrixFromCsv(String mapCSV) { List<String> rows = Arrays.asList(mapCSV.split("\\r?\\n")); ArrayList<List<Integer>> rowsList = Lists.newArrayList(); @@ -230,13 +243,13 @@ public class MapMatrix { for (String string : strings) { if (!string.isEmpty()) { Integer roomId = Integer.parseInt(string.split("[a-zA-Z]")[0]); - if (string.contains("u")) { + if (string.contains("u|")) { Integer up = getUp(string); - addRemote(roomId, new RemoteExit(RemoteExit.Direction.UP, up), remotes); + addRemote(roomId, new RemoteExit(RemoteExit.Direction.UP, up, ""), remotes); } - if (string.contains("d")) { + if (string.contains("d|")) { Integer down = getDown(string); - addRemote(roomId, new RemoteExit(RemoteExit.Direction.DOWN, down), remotes); + addRemote(roomId, new RemoteExit(RemoteExit.Direction.DOWN, down, ""), remotes); } data.add(roomId); } else { diff --git a/src/main/java/com/comandante/creeper/world/RemoteExit.java b/src/main/java/com/comandante/creeper/world/RemoteExit.java index 8cc7b6edd70cd73357575eec6c7d4de4708f15c8..2516f84f4d226675d9ce0ff7a5bac0370cb163cf 100644 --- a/src/main/java/com/comandante/creeper/world/RemoteExit.java +++ b/src/main/java/com/comandante/creeper/world/RemoteExit.java @@ -3,15 +3,17 @@ package com.comandante.creeper.world; public class RemoteExit { public enum Direction { - UP, DOWN + UP, DOWN, ENTER } private final Direction direction; private final Integer roomId; + private final String exitDetail; - public RemoteExit(Direction direction, Integer roomId) { + public RemoteExit(Direction direction, Integer roomId, String exitDetail) { this.direction = direction; this.roomId = roomId; + this.exitDetail = exitDetail; } public Direction getDirection() { @@ -21,4 +23,8 @@ public class RemoteExit { public Integer getRoomId() { return roomId; } + + public String getExitDetail() { + return exitDetail; + } } diff --git a/src/main/java/com/comandante/creeper/world/Room.java b/src/main/java/com/comandante/creeper/world/Room.java index 78a8553ad5f8db695febc7b465effc1860dd8a30..87ce45cb7b615c9caa6b53918c567bf091ebcbd5 100644 --- a/src/main/java/com/comandante/creeper/world/Room.java +++ b/src/main/java/com/comandante/creeper/world/Room.java @@ -30,13 +30,14 @@ public abstract class Room extends CreeperEntity { private Optional<Integer> southId; private Optional<Integer> downId; private Optional<Integer> upId; + private List<RemoteExit> enterExits = Lists.newArrayList(); private String roomDescription; private final Set<String> presentPlayerIds = Sets.<String>newConcurrentHashSet(); private final Set<String> afkPlayerIds = Sets.<String>newConcurrentHashSet(); private final Set<String> npcIds = Sets.newConcurrentHashSet(); private final Set<String> itemIds = Sets.newConcurrentHashSet(); private List<ItemSpawner> itemSpawners = Lists.newArrayList(); - private Set<Area> areas = Sets.newHashSet(Area.DEFAULT); + private Set<Area> areas = Sets.newConcurrentHashSet(); private Optional<String> mapData = Optional.absent(); private final Set<String> roomTags; @@ -49,6 +50,7 @@ public abstract class Room extends CreeperEntity { Optional<Integer> westId, Optional<Integer> upId, Optional<Integer> downId, + List<RemoteExit> enterExits, String roomDescription, Set<String> roomTags, Set<Area> areas) { this.roomId = roomId; @@ -63,6 +65,7 @@ public abstract class Room extends CreeperEntity { this.roomDescription = roomDescription; this.roomTags = roomTags; this.areas = areas; + this.enterExits = enterExits; } public Set<String> getRoomTags() { @@ -201,10 +204,24 @@ public abstract class Room extends CreeperEntity { return downId; } + public List<RemoteExit> getEnterExits() { + return enterExits; + } + + public void addEnterExit(RemoteExit remoteExit) { + enterExits.add(remoteExit); + } + + public void setEnterExits(List<RemoteExit> enterExits) { + this.enterExits = enterExits; + } + public void addItemSpawner(ItemSpawner itemSpawner) { itemSpawners.add(itemSpawner); } + + @Override public void run() { Iterator<ItemSpawner> iterator = itemSpawners.iterator(); diff --git a/src/main/java/com/comandante/creeper/world/RoomModel.java b/src/main/java/com/comandante/creeper/world/RoomModel.java index f92b2b0cb76d750aa70c7c933f7a1220983a8f36..cb518b8a822248da7f244c62e3b598a766c7adf2 100644 --- a/src/main/java/com/comandante/creeper/world/RoomModel.java +++ b/src/main/java/com/comandante/creeper/world/RoomModel.java @@ -2,6 +2,7 @@ package com.comandante.creeper.world; import com.google.gson.GsonBuilder; +import java.util.Map; import java.util.Set; public class RoomModel { @@ -12,14 +13,16 @@ public class RoomModel { String roomTitle; Set<String> roomTags; Set<String> areaNames; + Map<String, String> enterExitNames; - public RoomModel(int roomId, int floorId, String roomDescription, String roomTitle, Set<String> roomTags, Set<String> areaNames) { + public RoomModel(int roomId, int floorId, String roomDescription, String roomTitle, Set<String> roomTags, Set<String> areaNames, Map<String, String> enterExitNames) { this.roomId = roomId; this.floorId = floorId; this.roomDescription = roomDescription; this.roomTitle = roomTitle; this.roomTags = roomTags; this.areaNames = areaNames; + this.enterExitNames = enterExitNames; } public Set<String> getAreaNames() { @@ -70,6 +73,14 @@ public class RoomModel { this.roomTitle = roomTitle; } + public Map<String, String> getEnterExitNames() { + return enterExitNames; + } + + public void setEnterExitNames(Map<String, String> enterExitNames) { + this.enterExitNames = enterExitNames; + } + public static void main(String[] args) { RoomModel roomModel = new RoomModelBuilder().build(); diff --git a/src/main/java/com/comandante/creeper/world/RoomModelBuilder.java b/src/main/java/com/comandante/creeper/world/RoomModelBuilder.java index cbb53aa2e3bbb5d98ba26d850c5278dcfebdcaaa..d7b3317cef788647291067c0d5ac935dbe1b16c8 100644 --- a/src/main/java/com/comandante/creeper/world/RoomModelBuilder.java +++ b/src/main/java/com/comandante/creeper/world/RoomModelBuilder.java @@ -1,7 +1,9 @@ package com.comandante.creeper.world; +import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import java.util.Map; import java.util.Set; public class RoomModelBuilder { @@ -11,6 +13,7 @@ public class RoomModelBuilder { private String roomTitle; private Set<String> roomTags = Sets.newHashSet(); private Set<String> areaNames = Sets.newHashSet(); + private Map<String, String> enterExitNames =Maps.newHashMap(); public RoomModelBuilder setRoomId(int roomId) { this.roomId = roomId; @@ -46,7 +49,12 @@ public class RoomModelBuilder { return this; } + public RoomModelBuilder addEnterExitName(Integer roomId, String enterExitName) { + enterExitNames.put(String.valueOf(roomId), enterExitName); + return this; + } + public RoomModel build() { - return new RoomModel(roomId, floorId, roomDescription, roomTitle, roomTags, areaNames); + return new RoomModel(roomId, floorId, roomDescription, roomTitle, roomTags, areaNames, enterExitNames); } } \ No newline at end of file diff --git a/src/main/java/com/comandante/creeper/world/WorldExporter.java b/src/main/java/com/comandante/creeper/world/WorldExporter.java index 8ac89b1d159c6d19a3b941208e7e0beb77d176a1..597b97e3fbd996ca9627d4a777ec2c02617670fd 100644 --- a/src/main/java/com/comandante/creeper/world/WorldExporter.java +++ b/src/main/java/com/comandante/creeper/world/WorldExporter.java @@ -4,6 +4,7 @@ import com.comandante.creeper.entity.EntityManager; import com.google.common.base.Function; import com.google.common.base.Optional; import com.google.common.collect.Iterators; +import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.common.io.Files; import com.google.gson.GsonBuilder; @@ -12,10 +13,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.charset.Charset; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; +import java.util.*; public class WorldExporter { @@ -62,7 +60,6 @@ public class WorldExporter { RoomModel next = roomModels.next(); floorModel.getRoomModels().add(next); } - return floorModel; } @@ -71,6 +68,9 @@ public class WorldExporter { @Override public RoomModel apply(Room room) { RoomModelBuilder roomModelBuilder = new RoomModelBuilder(); + for (RemoteExit remoteExit : room.getEnterExits()) { + roomModelBuilder.addEnterExitName(remoteExit.getRoomId(), remoteExit.getExitDetail()); + } roomModelBuilder.setRoomDescription(room.getRoomDescription()); roomModelBuilder.setRoomTitle(room.getRoomTitle()); roomModelBuilder.setRoomId(room.getRoomId()); @@ -100,6 +100,15 @@ public class WorldExporter { for (String areaName : roomModel.getAreaNames()) { basicRoomBuilder.addArea(Area.getByName(areaName)); } + Map<String, String> enterExitNames = roomModel.getEnterExitNames(); + if (enterExitNames != null) { + Iterator<Map.Entry<String, String>> iterator = enterExitNames.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry<String, String> next = iterator.next(); + RemoteExit remoteExit = new RemoteExit(RemoteExit.Direction.ENTER, Integer.parseInt(next.getKey()), next.getValue()); + basicRoomBuilder.addEnterExit(remoteExit); + } + } configureExits(basicRoomBuilder, mapMatrix, roomModel.getRoomId()); return basicRoomBuilder.createBasicRoom(); } diff --git a/world/world.json b/world/world.json index 7f8f6cdbb8600092570421df1844156c62ac9ee2..4bb9c7b4910dd58e66afcf88947414f6662059d6 100644 --- a/world/world.json +++ b/world/world.json @@ -3,295 +3,20 @@ { "name": "main", "id": 0, - "rawMatrixCsv": ",26,,,,,,,,\n,25,,,,,,,,\n,2u3d20,,,,,,,,\n23,1d19,24,,,,,,,\n,21,,,,,,,,\n,22,,,,,,,,\n", + "rawMatrixCsv": ",1,,\n", "roomModels": [ - { - "roomId": 25, - "floorId": 0, - "roomDescription": "Gates can be seen just to the north on this cobblestone street, barely wide enough for two carriages to pass in either direction. Well kept yet simple stone homes sit on either side of the lane, providing a place to live for members of the peasantry. To the south, a large square can be seen in the distance, and to the east, the high inner walls of the Manor House. The cobblestones are well worn from the continuous traffic of carriages leaving town and returning from the countryside.", - "roomTitle": "CRAIGAVON LANE NORTH", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 21, - "floorId": 0, - "roomDescription": "Outside the town square, you find yourself on a quiet, one carriage width lane. On the western side of the street sits the House of Lanfair, with large, marble columns on either side of its entrance, with several stately homes neighboring it. Next to the House of Lanfair is an alleyway, where there is just enough room for three carriages along with their horses. ", - "roomTitle": "CRAIGAVON LANE SOUTH", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 24, - "floorId": 0, - "roomDescription": "The bustling square gives way to a dead end side street, facing the giant cliffs and walls of the Manor House. On one side of the street, you see the Town Bank, and on the other, a stone storage house. ", - "roomTitle": "TORRIDON LANE", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 23, - "floorId": 0, - "roomDescription": "", - "roomTitle": "THE NEXUS", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, { "roomId": 1, "floorId": 0, - "roomDescription": "Before you is an immense town square, carefully paved with cobblestone and surrounded by ornate buildings. On the southern side of the square, space for merchants\u0027 tents is provided, and on the western side, a large open area suitable for large gatherings. To the east, the massive fortified walls of the Manor House are notable, standing above steep cliffs. Surrounding the square are a number of businesses, as well as homes of some of the wealthiest merchants in town.", - "roomTitle": "TOWN SQUARE", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 22, - "floorId": 0, - "roomDescription": "On this narrow lane, homes line both sides of the street. A small locksmith can be seen on the western side of the lane.", - "roomTitle": "CRAIGAVON LANE SOUTH", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 2, - "floorId": 0, - "roomDescription": "Flanking the town square on its northern side, this cobblestone lane is home to a small butcher shop and a blacksmith. The simple stone buildings are covered in a layer of soot from the constant burning of coal, needed to forge the tools and weaponry required by the townspeople. To the north, the town gates can be seen in the distance.", - "roomTitle": "CRAIGAVON LANE NORTH", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 26, - "floorId": 0, - "roomDescription": "A stone archway marks the entrance to the city. Two guards armed with pikes stand at either side of the gate. Behind them are thick stone walls made of granite. The guards vigilantly observe the countryside past the city walls, ready to defend the town against the dangers which lie outside. Above, you notice two guard towers on either side of the gate, with archers positioned in each.", - "roomTitle": "NORTH GATE", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - } - ] - }, - { - "name": "31146a6b-8e5c-4113-841c-c4d486de4556", - "id": 4, - "rawMatrixCsv": "20u2,,,,,,\n", - "roomModels": [ - { - "roomId": 20, - "floorId": 4, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - } - ] - }, - { - "name": "cdd3abb9-66b4-4310-a14c-b6ee5c0fbba2", - "id": 1, - "rawMatrixCsv": "9,8,7,6,,,,,,,,\n10,,,5,,,,,,,,\n11,12,3d2u13,4,,,,,,,,\n", - "roomModels": [ - { - "roomId": 7, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 9, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 11, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 4, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 10, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 3, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 6, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 8, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 5, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 12, - "floorId": 1, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - } - ] - }, - { - "name": "dd206ce6-18f7-47ad-a806-74a47181d04a", - "id": 3, - "rawMatrixCsv": "19u1,,,,,,\n", - "roomModels": [ - { - "roomId": 19, - "floorId": 3, - "roomDescription": "In a large underground area, goods for sale by local merchants are piled on all sides. A musty smell pervades the giant, poorly lit space, and crates are stacked along the walls on all sides.", - "roomTitle": "STOREHOUSE", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - } - ] - }, - { - "name": "25c32e75-8326-46c9-a203-f9c0b06a7b02", - "id": 2, - "rawMatrixCsv": "18,,,,,,,\n17,,,,,,,\n16,,,,,,,\n15,,,,,,,\n14,,,,,,,\n13d3,,,,,,,\n", - "roomModels": [ - { - "roomId": 15, - "floorId": 2, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 16, - "floorId": 2, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 14, - "floorId": 2, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 18, - "floorId": 2, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 13, - "floorId": 2, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", - "roomTags": [], - "areaNames": [ - "newbie_zone" - ] - }, - { - "roomId": 17, - "floorId": 2, - "roomDescription": "Newly created room. Set a new description with the desc command.", - "roomTitle": "Default Title, change with title command", + "roomDescription": "This is a blank Description.\nWords should go here, ideally.", + "roomTitle": "This is a blank title.", "roomTags": [], "areaNames": [ - "newbie_zone" - ] + "north2_zone", + "house_zone", + "north1_zone" + ], + "enterExitNames": {} } ] }