diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/Block.java b/src/main/java/ruscz/game/gameOfProd/Cells/Block.java index 99b5966..91753f9 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/Block.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/Block.java @@ -1,6 +1,7 @@ package ruscz.game.gameOfProd.Cells; import ruscz.game.gameOfProd.Image.ImageCell; +import ruscz.game.gameOfProd.Map.Map; import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import java.awt.*; @@ -10,16 +11,16 @@ public class Block extends Cell { private boolean paint; private String partial; - public Block(int x, int y, ImageCell imageCell, boolean paint) { + public Block(int x, int y, Map map, boolean paint) { super(x, y, WindowOfFreeMove.CELL_SIZE, Color.BLUE); - this.imageCell = imageCell; + this.imageCell = map.getImageCell(); this.paint = paint; this.partial = ""; } - public Block(int x, int y, ImageCell imageCell, String partial, boolean paint) { + public Block(int x, int y, Map map, String partial, boolean paint) { super(x, y, WindowOfFreeMove.CELL_SIZE, Color.BLUE); - this.imageCell = imageCell; + this.imageCell = map.getImageCell(); this.partial = partial; this.paint = paint; } diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/ChestCell.java b/src/main/java/ruscz/game/gameOfProd/Cells/ChestCell.java index c871eae..a48592e 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/ChestCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/ChestCell.java @@ -1,9 +1,9 @@ package ruscz.game.gameOfProd.Cells; import ruscz.game.gameOfProd.Dialog.Dialog; -import ruscz.game.gameOfProd.Image.ImageCell; import ruscz.game.gameOfProd.Inventory.InventoryManager; import ruscz.game.gameOfProd.Inventory.Item; +import ruscz.game.gameOfProd.Map.Map; import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import java.awt.*; @@ -17,16 +17,16 @@ public class ChestCell extends InteractionCell { private boolean showItem; private boolean isActive; - public ChestCell(int x, int y, String inventory, Dialog dialog, ImageCell imageCell, WindowOfFreeMove window, boolean paint) { - super(x, y, null, dialog, imageCell, window, paint); + public ChestCell(int x, int y, String inventory, Dialog dialog, Map map, WindowOfFreeMove window, boolean paint) { + super(x, y, null, dialog, map, window, paint); this.showItem = false; this.chestInventory = new LinkedList<>(); this.isActive = true; fillChest(inventory); } - public ChestCell(int x, int y, String inventory, Dialog dialog, ImageCell imageCell, WindowOfFreeMove window) { - super(x, y, null, dialog, imageCell, window, false); + public ChestCell(int x, int y, String inventory, Dialog dialog, Map map, WindowOfFreeMove window) { + super(x, y, null, dialog, map, window, false); this.showItem = true; this.chestInventory = new LinkedList<>(); this.isActive = true; diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/DoorCell.java b/src/main/java/ruscz/game/gameOfProd/Cells/DoorCell.java index 3a6bcc5..b92a853 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/DoorCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/DoorCell.java @@ -1,8 +1,8 @@ package ruscz.game.gameOfProd.Cells; import ruscz.game.gameOfProd.Dialog.Dialog; -import ruscz.game.gameOfProd.Image.ImageCell; import ruscz.game.gameOfProd.Inventory.Item; +import ruscz.game.gameOfProd.Map.Map; import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import java.awt.*; @@ -12,18 +12,21 @@ public class DoorCell extends InteractionCell { private boolean isLocked; private boolean directionVert; private String sound; + private String soundOpen; + private String soundClose; + private String soundLocked; private float volume; - public DoorCell(int x, int y, boolean directionVert, String message, Dialog dialog, ImageCell imageCell, WindowOfFreeMove window) { - super(x, y, message, dialog, imageCell, window, true); + public DoorCell(int x, int y, boolean directionVert, String message, Dialog dialog, Map map, WindowOfFreeMove window) { + super(x, y, message, dialog, map, window, true); this.isOpen = false; this.isLocked = true; this.directionVert = directionVert; setSound(); } - public DoorCell(int x, int y, boolean directionVert, ImageCell imageCell, WindowOfFreeMove window) { - super(x, y, null, null, imageCell, window, true); + public DoorCell(int x, int y, boolean directionVert, Map map, WindowOfFreeMove window) { + super(x, y, null, null, map, window, true); this.isOpen = false; this.isLocked = false; this.directionVert = directionVert; @@ -47,19 +50,31 @@ public class DoorCell extends InteractionCell { private void setSound() { if (isOpen) { - sound = "qubodup-DoorOpen01-changed.wav"; + sound = super.getSoundManager().getSoundMap().get("doorOpen"); volume = -8.0f; } else if (!isOpen && !isLocked) { - sound = "qubodup-DoorClose02-changed.wav"; + sound = super.getSoundManager().getSoundMap().get("doorClose"); volume = -8.0f; } else if (isLocked) { - sound = "doorLocked.wav"; + sound = super.getSoundManager().getSoundMap().get("doorLocked"); volume = -10.0f; } } +// public void setSoundOpen(String soundOpen) { +// this.soundOpen = soundOpen; +// } +// +// public void setSoundClose(String soundClose) { +// this.soundClose = soundClose; +// } +// +// public void setSoundLocked(String soundLocked) { +// this.soundLocked = soundLocked; +// } + public boolean isOpen() { return isOpen; } diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java b/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java index f6726ad..d9f7fe8 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/InteractionCell.java @@ -6,6 +6,7 @@ import ruscz.game.gameOfProd.Image.ImageDialog; import ruscz.game.gameOfProd.Inventory.InventoryManager; import ruscz.game.gameOfProd.Inventory.Item; import ruscz.game.gameOfProd.Map.Map; +import ruscz.game.gameOfProd.Sounds.SoundManager; import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import javax.swing.*; @@ -19,29 +20,31 @@ public class InteractionCell extends Cell { protected ruscz.game.gameOfProd.Dialog.Dialog dialog; protected Scanner scanner; private ImageCell imageCell; + private SoundManager soundManager; private WindowOfFreeMove window; protected boolean paint; private Timer timer; - public InteractionCell(int x, int y, String message, Dialog dialog, ImageCell imageCell, WindowOfFreeMove window, boolean paint) { + public InteractionCell(int x, int y, String message, Dialog dialog, Map map, WindowOfFreeMove window, boolean paint) { super(x, y, WindowOfFreeMove.CELL_SIZE, Color.ORANGE); this.message = message; this.dialog = dialog; - this.imageCell = imageCell; + this.imageCell = map.getImageCell(); + this.soundManager = map.getSoundManager(); this.window = window; this.paint = paint; } public void startEvent() { if (message != null) { - if (message.equals("error")) { + if (message.contains("cutscene")) { final int[] i = {0}; timer = new Timer(1000, actionEvent -> { - errorEvent(i[0] +1); + playCustscene(message,i[0] +1); i[0]++; }); timer.start(); - readDialogFile(message); + readDialogFile("empty"); } else { window.setCanPersonMove(false); @@ -203,39 +206,48 @@ public class InteractionCell extends Cell { } } - private void errorEvent(int i) { - if (i == 1) { - WindowOfFreeMove.setCanPersonMove(false); - window.getForegroundPanel().setImageForeground("error"); - window.getForegroundPanel().setVisible(true); - window.repaintCanvas(); - } - else if (i == 3) { - Map openspace = Map.findMapByName("openspace", window); - window.getMapManager().setMap(openspace); - openspace.getPerson().set(openspace.getSpawnPoint()[0], openspace.getSpawnPoint()[1]); - openspace.getPerson().setDirectionSight(4); - openspace.setIdExit(0); - dialog.hideText(); - dialog.setText("Shit.."); - dialog.showText(); - } - else if (i == 5) { - window.getForegroundPanel().setVisible(false); - dialog.hideText(); - } - else if (i == 6) { - dialog.setText("I have to take a break. It's lunch time anyway."); - dialog.showText(); - } - else if (i == 10) { - dialog.hideText(); - WindowOfFreeMove.setCanPersonMove(true); - } - else if (i == 11) { - window.getMusicManager().playMusic(); - window.getMusicManager().fadeIn(10); - timer.stop(); + public void playCustscene(String name, int i) { + try { + File cutsceneFile = new File("src/main/resources/dialogs/cutscenes/" + name + ".txt"); + scanner = new Scanner(cutsceneFile); + while (scanner.hasNextLine()) { + String[] data = scanner.nextLine().split(" "); + if (data[0].contains("<" + i + ">")) { + if (data[1].contains("")) { + if (data[2].equals("null")) dialog.hideText(); + else { + dialog.setText(data[2].replaceAll("-", " ")); + dialog.showText(); + } + } + else if (data[1].contains("")) { + if (data[2].equals("null")) window.getForegroundPanel().setVisible(false); + else { + window.getForegroundPanel().setImageForeground(data[2]); + window.getForegroundPanel().setVisible(true); + } + } + else if (data[1].contains("")) { + Map map = Map.findMapByName(data[2], window); + window.getMapManager().setMap(map); + map.getPerson().set(map.getSpawnPoint()[0], map.getSpawnPoint()[1]); + map.getPerson().setDirectionSight(Integer.parseInt(data[3])); + map.setIdExit(0); + } + else if (data[1].equals("")) { + window.getMusicManager().playMusic(); + window.getMusicManager().fadeIn(10); + } + else if (data[1].equals("")) { + timer.stop(); + } + } + } + } catch (FileNotFoundException e) { + e.printStackTrace(); } } @@ -254,4 +266,6 @@ public class InteractionCell extends Cell { public ImageCell getImageCell() { return imageCell; } + + public SoundManager getSoundManager() { return soundManager; } } diff --git a/src/main/java/ruscz/game/gameOfProd/Cells/TriggerCell.java b/src/main/java/ruscz/game/gameOfProd/Cells/TriggerCell.java index 9a62280..815af13 100644 --- a/src/main/java/ruscz/game/gameOfProd/Cells/TriggerCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Cells/TriggerCell.java @@ -1,7 +1,7 @@ package ruscz.game.gameOfProd.Cells; import ruscz.game.gameOfProd.Dialog.Dialog; -import ruscz.game.gameOfProd.Image.ImageCell; +import ruscz.game.gameOfProd.Map.Map; import ruscz.game.gameOfProd.Windows.WindowOfFreeMove; import java.awt.*; @@ -9,8 +9,8 @@ import java.awt.*; public class TriggerCell extends InteractionCell { private boolean isActive; - public TriggerCell(int x, int y, String message, Dialog dialog, ImageCell imageCell, WindowOfFreeMove window) { - super(x, y, message, dialog, imageCell, window, false); + public TriggerCell(int x, int y, String message, Dialog dialog, Map map, WindowOfFreeMove window) { + super(x, y, message, dialog, map, window, false); this.isActive = true; } diff --git a/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java b/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java index 12771d7..f3183bb 100644 --- a/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java +++ b/src/main/java/ruscz/game/gameOfProd/Image/ImageCell.java @@ -38,7 +38,11 @@ public class ImageCell { String[] mapInfo = data.split(" "); imageItem(mapInfo); } - else { + else if (data.contains("")) { + String[] mapInfo = data.split(" "); + loadCellMap(mapInfo); + } + else if (!data.contains("")) { String[] mapColumn = data.split(" "); for (int i = 0; i < mapColumn.length; i++) { mapBackground[i][j] = Integer.parseInt(mapColumn[i]); @@ -46,7 +50,6 @@ public class ImageCell { j++; } } - loadCellMap(name); imageObjectset(name); } catch (FileNotFoundException e) { System.out.println("An error occurred."); @@ -103,32 +106,24 @@ public class ImageCell { } } - public void loadCellMap(String file) { - try { - File mapFile = new File("src/main/resources/maps/" + file + "-cellmap.txt"); - Scanner scanner = new Scanner(mapFile); + public void loadCellMap(String[] cellInfo) { + if (cellMap == null) cellMap = new HashMap(); - while (scanner.hasNextLine()) { - String data = scanner.nextLine(); - String[] cellInfo = data.split(" "); - if (cellInfo[0].equals("DOOR")) { - Rectangle[] rec = new Rectangle[12]; - int CELL_SIZE = WindowOfFreeMove.CELL_SIZE; - int count = 0; - for (int i = 0; i < rec.length / 4; i++) { - for (int j = 0; j < rec.length / 3; j++) { - rec[count] = new Rectangle(CELL_SIZE * i, CELL_SIZE * j, CELL_SIZE, CELL_SIZE); - count++; - } - } - imageDoor = new ImageDoor(cellInfo[1], rec); + + if (cellInfo[1].equals("DOOR")) { + Rectangle[] rec = new Rectangle[12]; + int CELL_SIZE = WindowOfFreeMove.CELL_SIZE; + int count = 0; + for (int i = 0; i < rec.length / 4; i++) { + for (int j = 0; j < rec.length / 3; j++) { + rec[count] = new Rectangle(CELL_SIZE * i, CELL_SIZE * j, CELL_SIZE, CELL_SIZE); + count++; } - else - cellMap.put(cellInfo[0], Integer.parseInt(cellInfo[1])); } - } catch (FileNotFoundException e) { - e.printStackTrace(); + imageDoor = new ImageDoor(cellInfo[2], rec); } + else + cellMap.put(cellInfo[1], Integer.parseInt(cellInfo[2])); } public void imageItem(String[] itemInfo) { diff --git a/src/main/java/ruscz/game/gameOfProd/Map/Map.java b/src/main/java/ruscz/game/gameOfProd/Map/Map.java index d49f4eb..ca9a1ed 100644 --- a/src/main/java/ruscz/game/gameOfProd/Map/Map.java +++ b/src/main/java/ruscz/game/gameOfProd/Map/Map.java @@ -56,8 +56,8 @@ public class Map { public static Map loadMapFromFile(String name, WindowOfFreeMove window) { try { - File dialogFile = new File("src/main/resources/maps/" + name + ".txt"); - scanner = new Scanner(dialogFile); + File file = new File("src/main/resources/maps/" + name + ".txt"); + scanner = new Scanner(file); String firstLine = scanner.nextLine(); String[] size = firstLine.split(" "); TypeOfCell[][] mapArray = new TypeOfCell[Integer.parseInt(size[0])][Integer.parseInt(size[1])]; @@ -65,6 +65,7 @@ public class Map { map.setName(name); map.npcs = new LinkedList<>(); map.getImageCell().readMapFile(name); + map.getSoundManager().loadSoundMap(name); map.canvasSize[0] = Integer.parseInt(size[0]); map.canvasSize[1] = Integer.parseInt(size[1]); int y = 0; @@ -90,13 +91,13 @@ public class Map { String[] block = line[x].split(","); if (block[0].equals("BLOCK")) if (block.length == 2) { - map.getBlocks().add(new Block(x, y, map.getImageCell(), block[1], true)); + map.getBlocks().add(new Block(x, y, map, block[1], true)); } else { - map.getBlocks().add(new Block(x, y, map.getImageCell(), true)); + map.getBlocks().add(new Block(x, y, map, true)); } else { - map.getBlocks().add(new Block(x, y, map.getImageCell(), false)); + map.getBlocks().add(new Block(x, y, map, false)); } } else if (line[x].equals("EMPTY")) { cellType = TypeOfCell.EMPTY; @@ -104,27 +105,27 @@ public class Map { } else if (line[x].contains("INTER") || line[x].contains("inter")) { String[] event = line[x].split(","); if (line[x].contains("INTER")) - map.addInteractionEvent(new InteractionCell(x, y, event[1], new Dialog(window.getDialogBar()), map.getImageCell(), window, true)); + map.addInteractionEvent(new InteractionCell(x, y, event[1], new Dialog(window.getDialogBar()), map, window, true)); else - map.addInteractionEvent(new InteractionCell(x, y, event[1], new Dialog(window.getDialogBar()), map.getImageCell(), window, false)); + map.addInteractionEvent(new InteractionCell(x, y, event[1], new Dialog(window.getDialogBar()), map, window, false)); } else if (line[x].contains("TRIGGER")) { String[] trigger = line[x].split(","); - map.addInteractionEvent(new TriggerCell(x, y, trigger[1], new Dialog(window.getDialogBar()), map.getImageCell(), window)); + map.addInteractionEvent(new TriggerCell(x, y, trigger[1], new Dialog(window.getDialogBar()), map, window)); } else if (line[x].equals("SPAWN")) { map.setIdExit(0); map.setSpawnPoint(x, y); } else if (line[x].contains("DOOR") && !line[x].contains("DOORTO")) { String[] door = line[x].split(","); if (door.length == 2) - map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(door[1]), map.getImageCell(), window)); + map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(door[1]), map, window)); else - map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(door[1]), door[2], new Dialog(window.getDialogBar()), map.getImageCell(), window)); + map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(door[1]), door[2], new Dialog(window.getDialogBar()), map, window)); } else if (line[x].contains("CHEST")) { String[] chest = line[x].split(","); if (chest.length == 3) - map.addInteractionEvent(new ChestCell(x, y, chest[1], new Dialog(window.getDialogBar()), map.getImageCell(), window, Boolean.parseBoolean(chest[2]))); + map.addInteractionEvent(new ChestCell(x, y, chest[1], new Dialog(window.getDialogBar()), map, window, Boolean.parseBoolean(chest[2]))); else - map.addInteractionEvent(new ChestCell(x, y, chest[1], new Dialog(window.getDialogBar()), map.getImageCell(), window)); + map.addInteractionEvent(new ChestCell(x, y, chest[1], new Dialog(window.getDialogBar()), map, window)); } } } @@ -151,11 +152,11 @@ public class Map { else if (line[x].contains("DOORTO")) { String[] doorTo = line[x].split(","); if (doorTo[1].equals("locked")) { - map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(doorTo[2]), doorTo[3], new Dialog(window.getDialogBar()), map.getImageCell(), window)); + map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(doorTo[2]), doorTo[3], new Dialog(window.getDialogBar()), map, window)); map.addMoveToEvent(new EventMoveToCell(Integer.parseInt(doorTo[4]), Integer.parseInt(doorTo[5]), x, y, findMapByName(doorTo[6], window), window, false)); } else { - map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(doorTo[1]), map.getImageCell(), window)); + map.addInteractionEvent(new DoorCell(x, y, Boolean.parseBoolean(doorTo[1]), map, window)); map.addMoveToEvent(new EventMoveToCell(Integer.parseInt(doorTo[2]), Integer.parseInt(doorTo[3]), x, y, findMapByName(doorTo[4], window), window, false)); } } diff --git a/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java b/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java index d1447ec..c2f310d 100644 --- a/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java +++ b/src/main/java/ruscz/game/gameOfProd/Map/MapManager.java @@ -55,7 +55,7 @@ public class MapManager { for (int i = 0; i < actualMap.getMapArray().length; i++) { for (int j = 0; j < actualMap.getMapArray()[0].length; j++) { if (actualMap.getMapArray()[i][j] == TypeOfCell.BLOCK && !actualMap.isBusyCell(i, j)) { - actualMap.getBlocks().add(new Block(i, j, actualMap.getImageCell(), true)); + actualMap.getBlocks().add(new Block(i, j, actualMap, true)); } if (actualMap.getMapArray()[i][j] == TypeOfCell.SPAWNPOINT && actualMap.getIdExit() == 0) { diff --git a/src/main/java/ruscz/game/gameOfProd/Sounds/SoundManager.java b/src/main/java/ruscz/game/gameOfProd/Sounds/SoundManager.java index 885a12a..9288601 100644 --- a/src/main/java/ruscz/game/gameOfProd/Sounds/SoundManager.java +++ b/src/main/java/ruscz/game/gameOfProd/Sounds/SoundManager.java @@ -2,17 +2,44 @@ package ruscz.game.gameOfProd.Sounds; import javax.sound.sampled.*; import java.io.File; +import java.io.FileNotFoundException; import java.io.IOException; +import java.util.HashMap; +import java.util.Scanner; public class SoundManager { private FloatControl gainControl; private Clip clip; private int delay; + private HashMap soundMap; public SoundManager() { this.delay = 0; } + public void loadSoundMap(String file) { + try { + File mapFile = new File("src/main/resources/maps/" + file + "-tileset.txt"); + Scanner scanner = new Scanner(mapFile); + soundMap = new HashMap<>(); + while (scanner.hasNextLine()) { + String[] data = scanner.nextLine().split(" "); + if (data[0].equals("")) { + if (data[1].equals("DOOR")) { + soundMap.put("doorOpen", data[2]); + soundMap.put("doorClose", data[3]); + soundMap.put("doorLocked", data[4]); + } + else if (data[1].contains("WALK")) { + soundMap.put("walk", data[2]); + } + } + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + } + } + public void playSound(String name, float volume){ AudioInputStream audioIn; try { @@ -46,8 +73,17 @@ public class SoundManager { } this.delay = 0; } + else if (this.delay == delay-1) { + if (clip != null) { + clip.stop(); + clip.flush(); + } + this.delay++; + } else { this.delay++; } } + + public HashMap getSoundMap() { return soundMap; } } diff --git a/src/main/resources/dialogs/cutscenes/cutscene-error.txt b/src/main/resources/dialogs/cutscenes/cutscene-error.txt new file mode 100644 index 0000000..c5efc6a --- /dev/null +++ b/src/main/resources/dialogs/cutscenes/cutscene-error.txt @@ -0,0 +1,11 @@ +<1> false +<1> error +<3> openspace 4 +<3> Shit.. +<5> null +<5> null +<6> I-have-to-take-a-break.-It's-lunch-time-anyway. +<10> null +<10> true +<11> +<11> \ No newline at end of file diff --git a/src/main/resources/dialogs/error.txt b/src/main/resources/dialogs/empty.txt similarity index 100% rename from src/main/resources/dialogs/error.txt rename to src/main/resources/dialogs/empty.txt diff --git a/src/main/resources/dialogs/horn.txt b/src/main/resources/dialogs/horn.txt new file mode 100644 index 0000000..8e13f1d --- /dev/null +++ b/src/main/resources/dialogs/horn.txt @@ -0,0 +1,2 @@ + horn.wav -15.0f + \ No newline at end of file diff --git a/src/main/resources/maps/boss-cellmap.txt b/src/main/resources/maps/boss-cellmap.txt deleted file mode 100644 index 2bf3640..0000000 --- a/src/main/resources/maps/boss-cellmap.txt +++ /dev/null @@ -1,5 +0,0 @@ -BLOCK 2 -MOVETO 1 -EVENT 3 -TRIGGER 4 -DOOR dark-door.png,32 \ No newline at end of file diff --git a/src/main/resources/maps/boss-tileset.txt b/src/main/resources/maps/boss-tileset.txt index 1f6f6a2..32732cf 100644 --- a/src/main/resources/maps/boss-tileset.txt +++ b/src/main/resources/maps/boss-tileset.txt @@ -2,6 +2,12 @@ Openspace1.png 512 512 32 Openspace2.png 512 512 32 D_Inside_House.png 512 512 32 + BLOCK 2 + MOVETO 1 + EVENT 0 + TRIGGER 4 + DOOR dark-door.png,32 + DOOR qubodup-DoorOpen01-changed.wav qubodup-DoorClose02-changed.wav doorLocked.wav 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 22 38 54 6 6 6 diff --git a/src/main/resources/maps/office-cellmap.txt b/src/main/resources/maps/office-cellmap.txt deleted file mode 100644 index 631a4e7..0000000 --- a/src/main/resources/maps/office-cellmap.txt +++ /dev/null @@ -1,6 +0,0 @@ -BLOCK 2 -MOVETO 1 -EVENT 3 -TRIGGER 4 -DOOR dark-door.png,32 -CHEST 390 \ No newline at end of file diff --git a/src/main/resources/maps/office-tileset.txt b/src/main/resources/maps/office-tileset.txt index d520e4f..e2882ae 100644 --- a/src/main/resources/maps/office-tileset.txt +++ b/src/main/resources/maps/office-tileset.txt @@ -2,6 +2,13 @@ Openspace1.png 512 512 32 Openspace2.png 512 512 32 D_Inside_House.png 512 512 32 + BLOCK 2 + MOVETO 1 + EVENT 3 + TRIGGER 4 + DOOR dark-door.png,32 + CHEST 390 + DOOR qubodup-DoorOpen01-changed.wav qubodup-DoorClose02-changed.wav doorLocked.wav 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 diff --git a/src/main/resources/maps/office.txt b/src/main/resources/maps/office.txt index 9027df0..f1fe249 100644 --- a/src/main/resources/maps/office.txt +++ b/src/main/resources/maps/office.txt @@ -6,9 +6,9 @@ BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EM BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,1,2,openspace EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK -BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,1,2,openspace EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK +BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,2,2,openspace EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK CHEST,trashcan,true EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK BLOCK,d EMPTY BLOCK,d BLOCK,d BLOCK,d BLOCK,d EMPTY BLOCK,d BLOCK,d BLOCK,d BLOCK,d EMPTY BLOCK,d BLOCK,d BLOCK,d BLOCK,d EMPTY BLOCK,d BLOCK -BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK BLOCK DOORTO,locked,true,white-key-card,2,1,treasure BLOCK BLOCK \ No newline at end of file +BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK BLOCK DOOR,true,locked BLOCK BLOCK BLOCK BLOCK DOORTO,locked,true,white-key-card,3,1,treasure BLOCK BLOCK \ No newline at end of file diff --git a/src/main/resources/maps/openspace-cellmap.txt b/src/main/resources/maps/openspace-cellmap.txt deleted file mode 100644 index f24a83d..0000000 --- a/src/main/resources/maps/openspace-cellmap.txt +++ /dev/null @@ -1,5 +0,0 @@ -BLOCK 2 -MOVETO 1 -EVENT 0 -TRIGGER 4 -DOOR dark-door.png,32 \ No newline at end of file diff --git a/src/main/resources/maps/openspace-tileset.txt b/src/main/resources/maps/openspace-tileset.txt index 71f89a8..2b4058e 100644 --- a/src/main/resources/maps/openspace-tileset.txt +++ b/src/main/resources/maps/openspace-tileset.txt @@ -3,6 +3,12 @@ Openspace2.png 512 512 32 D_Inside_House.png 512 512 32 TransparentIcons.png 512 640 32 + BLOCK 2 + MOVETO 1 + EVENT 0 + TRIGGER 4 + DOOR dark-door.png,32 + DOOR qubodup-DoorOpen01-changed.wav qubodup-DoorClose02-changed.wav doorLocked.wav 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 117 117 117 117 117 117 117 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 117 117 117 117 117 117 117 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 diff --git a/src/main/resources/maps/openspace.txt b/src/main/resources/maps/openspace.txt index 26612ea..3a2505e 100644 --- a/src/main/resources/maps/openspace.txt +++ b/src/main/resources/maps/openspace.txt @@ -15,7 +15,7 @@ BLOCK EMPTY block block inter,minecraft block block EMPTY BLOCK,u EMPTY EMPTY EM BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY DOOR,false EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY block block block BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,1,2,office EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,7,2,m1 EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY SPAWN block EMPTY block EMPTY BLOCK +BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY moveto,2,2,office EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY SPAWN block EMPTY block EMPTY BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY block block block BLOCK block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block diff --git a/src/main/resources/maps/treasure-cellmap.txt b/src/main/resources/maps/treasure-cellmap.txt deleted file mode 100644 index d8e7ba0..0000000 --- a/src/main/resources/maps/treasure-cellmap.txt +++ /dev/null @@ -1,5 +0,0 @@ -BLOCK 0 -MOVETO 0 -EVENT 0 -TRIGGER 0 -DOOR dark-door.png,32 \ No newline at end of file diff --git a/src/main/resources/maps/treasure-tileset.txt b/src/main/resources/maps/treasure-tileset.txt index fc40a91..c53908b 100644 --- a/src/main/resources/maps/treasure-tileset.txt +++ b/src/main/resources/maps/treasure-tileset.txt @@ -1,4 +1,9 @@ CertificateOfShame.png 650 500 50 + BLOCK 0 + MOVETO 0 + EVENT 0 + TRIGGER 0 + DOOR dark-door.png,32 0 10 20 30 40 50 60 70 80 90 100 110 120 1 11 21 31 41 51 61 71 81 91 101 111 121 2 12 22 32 42 52 62 72 82 92 102 112 122 diff --git a/src/main/resources/maps/treasure.txt b/src/main/resources/maps/treasure.txt index 026dc7f..e970743 100644 --- a/src/main/resources/maps/treasure.txt +++ b/src/main/resources/maps/treasure.txt @@ -1,6 +1,6 @@ 13 10 -block block block block block block moveto,2,3,office block block block block block block -block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block +block block block block block block moveto,3,3,office block block block block block block +block EMPTY EMPTY EMPTY EMPTY EMPTY TRIGGER,horn EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block block EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY block diff --git a/src/main/resources/maps/tutorial-cellmap.txt b/src/main/resources/maps/tutorial-cellmap.txt deleted file mode 100644 index 562ec79..0000000 --- a/src/main/resources/maps/tutorial-cellmap.txt +++ /dev/null @@ -1,4 +0,0 @@ -BLOCK 120 -MOVETO 277 -EVENT 334 -TRIGGER 147 \ No newline at end of file diff --git a/src/main/resources/maps/tutorial-tileset.txt b/src/main/resources/maps/tutorial-tileset.txt index 7867306..38dd70e 100644 --- a/src/main/resources/maps/tutorial-tileset.txt +++ b/src/main/resources/maps/tutorial-tileset.txt @@ -1,6 +1,10 @@ A2_Ground.png 512 384 32 192 D_OutDoor.png 512 512 32 256 tutorialtiles.png 288 96 32 448 + BLOCK 120 + MOVETO 277 + EVENT 334 + TRIGGER 147 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/src/main/resources/maps/tutorial.txt b/src/main/resources/maps/tutorial.txt index 65a039f..d898a03 100644 --- a/src/main/resources/maps/tutorial.txt +++ b/src/main/resources/maps/tutorial.txt @@ -5,7 +5,7 @@ BLOCK EMPTY EMPTY EMPTY EMPTY SPAWN EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK -BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY TRIGGER,error BLOCK +BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY TRIGGER,cutscene-error BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK diff --git a/src/main/resources/maps/m1-cellmap.txt b/src/main/resources/maps/unused/m1-cellmap.txt similarity index 100% rename from src/main/resources/maps/m1-cellmap.txt rename to src/main/resources/maps/unused/m1-cellmap.txt diff --git a/src/main/resources/maps/m1-objectset.txt b/src/main/resources/maps/unused/m1-objectset.txt similarity index 100% rename from src/main/resources/maps/m1-objectset.txt rename to src/main/resources/maps/unused/m1-objectset.txt diff --git a/src/main/resources/maps/m1-tileset.txt b/src/main/resources/maps/unused/m1-tileset.txt similarity index 100% rename from src/main/resources/maps/m1-tileset.txt rename to src/main/resources/maps/unused/m1-tileset.txt diff --git a/src/main/resources/maps/m1.txt b/src/main/resources/maps/unused/m1.txt similarity index 100% rename from src/main/resources/maps/m1.txt rename to src/main/resources/maps/unused/m1.txt diff --git a/src/main/resources/maps/m2-cellmap.txt b/src/main/resources/maps/unused/m2-cellmap.txt similarity index 100% rename from src/main/resources/maps/m2-cellmap.txt rename to src/main/resources/maps/unused/m2-cellmap.txt diff --git a/src/main/resources/maps/m2-objectset.txt b/src/main/resources/maps/unused/m2-objectset.txt similarity index 100% rename from src/main/resources/maps/m2-objectset.txt rename to src/main/resources/maps/unused/m2-objectset.txt diff --git a/src/main/resources/maps/m2-tileset.txt b/src/main/resources/maps/unused/m2-tileset.txt similarity index 100% rename from src/main/resources/maps/m2-tileset.txt rename to src/main/resources/maps/unused/m2-tileset.txt diff --git a/src/main/resources/maps/m2.txt b/src/main/resources/maps/unused/m2.txt similarity index 100% rename from src/main/resources/maps/m2.txt rename to src/main/resources/maps/unused/m2.txt diff --git a/src/main/resources/maps/m3-cellmap.txt b/src/main/resources/maps/unused/m3-cellmap.txt similarity index 100% rename from src/main/resources/maps/m3-cellmap.txt rename to src/main/resources/maps/unused/m3-cellmap.txt diff --git a/src/main/resources/maps/m3-objectset.txt b/src/main/resources/maps/unused/m3-objectset.txt similarity index 100% rename from src/main/resources/maps/m3-objectset.txt rename to src/main/resources/maps/unused/m3-objectset.txt diff --git a/src/main/resources/maps/m3-tileset.txt b/src/main/resources/maps/unused/m3-tileset.txt similarity index 100% rename from src/main/resources/maps/m3-tileset.txt rename to src/main/resources/maps/unused/m3-tileset.txt diff --git a/src/main/resources/maps/m3.txt b/src/main/resources/maps/unused/m3.txt similarity index 100% rename from src/main/resources/maps/m3.txt rename to src/main/resources/maps/unused/m3.txt diff --git a/src/main/resources/maps/m4-cellmap.txt b/src/main/resources/maps/unused/m4-cellmap.txt similarity index 100% rename from src/main/resources/maps/m4-cellmap.txt rename to src/main/resources/maps/unused/m4-cellmap.txt diff --git a/src/main/resources/maps/m4-objectset.txt b/src/main/resources/maps/unused/m4-objectset.txt similarity index 100% rename from src/main/resources/maps/m4-objectset.txt rename to src/main/resources/maps/unused/m4-objectset.txt diff --git a/src/main/resources/maps/m4-tileset.txt b/src/main/resources/maps/unused/m4-tileset.txt similarity index 100% rename from src/main/resources/maps/m4-tileset.txt rename to src/main/resources/maps/unused/m4-tileset.txt diff --git a/src/main/resources/maps/m4.txt b/src/main/resources/maps/unused/m4.txt similarity index 100% rename from src/main/resources/maps/m4.txt rename to src/main/resources/maps/unused/m4.txt diff --git a/src/main/resources/maps/m6-cellmap.txt b/src/main/resources/maps/unused/m6-cellmap.txt similarity index 100% rename from src/main/resources/maps/m6-cellmap.txt rename to src/main/resources/maps/unused/m6-cellmap.txt diff --git a/src/main/resources/maps/m6-objectset.txt b/src/main/resources/maps/unused/m6-objectset.txt similarity index 100% rename from src/main/resources/maps/m6-objectset.txt rename to src/main/resources/maps/unused/m6-objectset.txt diff --git a/src/main/resources/maps/m6-tileset.txt b/src/main/resources/maps/unused/m6-tileset.txt similarity index 100% rename from src/main/resources/maps/m6-tileset.txt rename to src/main/resources/maps/unused/m6-tileset.txt diff --git a/src/main/resources/maps/m6.txt b/src/main/resources/maps/unused/m6.txt similarity index 100% rename from src/main/resources/maps/m6.txt rename to src/main/resources/maps/unused/m6.txt diff --git a/src/main/resources/save/newGame/maps.txt b/src/main/resources/save/newGame/maps.txt index d26d6de..56d740f 100644 --- a/src/main/resources/save/newGame/maps.txt +++ b/src/main/resources/save/newGame/maps.txt @@ -1,8 +1,3 @@ -m1 -m2 -m3 -m4 -m6 tutorial openspace office diff --git a/src/main/resources/save/savedGame/events.txt b/src/main/resources/save/savedGame/events.txt index b0ed67f..576140a 100644 --- a/src/main/resources/save/savedGame/events.txt +++ b/src/main/resources/save/savedGame/events.txt @@ -1,48 +1,3 @@ - - m1 - - - - - m2 - - - 7 - 2 - true - - - - - m3 - - - 2 - 5 - true - - - - - m4 - - - 3 - 3 - true - - - - - m6 - - - 11 - 11 - true - - - tutorial @@ -59,12 +14,12 @@ 7 4 - false + true 15 7 - true + false @@ -74,7 +29,7 @@ 1 9 - true + false @@ -84,12 +39,17 @@ 4 18 - false + true treasure + + 6 + 1 + false + diff --git a/src/main/resources/save/savedGame/person.txt b/src/main/resources/save/savedGame/person.txt index f083d14..3cc0ef4 100644 --- a/src/main/resources/save/savedGame/person.txt +++ b/src/main/resources/save/savedGame/person.txt @@ -1,6 +1,6 @@ - openspace - 8 - 15 - 3 + office + 17 + 11 + 2 \ No newline at end of file diff --git a/src/main/resources/sounds/horn.wav b/src/main/resources/sounds/horn.wav new file mode 100644 index 0000000..84d550a Binary files /dev/null and b/src/main/resources/sounds/horn.wav differ