Compare commits
No commits in common. "62830e92a61164680ee83ec933042c0d6e18719d" and "d4db36c4183bd580d6c2577e35e368d6c31ac29f" have entirely different histories.
62830e92a6
...
d4db36c418
@ -998,17 +998,11 @@ exists or setup the property manually. For example like this:
|
||||
<target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
|
||||
<target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
|
||||
<copyfiles files="${libs.javaee-web-api-7.0.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
|
||||
<copyfiles files="${file.reference.jackson-annotations-2.9.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
|
||||
<copyfiles files="${file.reference.jackson-core-2.9.9.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
|
||||
<copyfiles files="${file.reference.jackson-databind-2.9.9.jar}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}/lib"/>
|
||||
<mkdir dir="${build.web.dir}/META-INF"/>
|
||||
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
|
||||
</target>
|
||||
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
|
||||
<copyfiles files="${libs.javaee-web-api-7.0.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copyfiles files="${file.reference.jackson-annotations-2.9.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copyfiles files="${file.reference.jackson-core-2.9.9.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
<copyfiles files="${file.reference.jackson-databind-2.9.9.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
|
||||
</target>
|
||||
<target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
|
||||
<delete dir="${build.web.dir}/WEB-INF/lib"/>
|
||||
|
@ -1,8 +1,8 @@
|
||||
build.xml.data.CRC32=20a1ec55
|
||||
build.xml.data.CRC32=b50c735c
|
||||
build.xml.script.CRC32=2d64e8d1
|
||||
build.xml.stylesheet.CRC32=651128d4@1.77.1.1
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
nbproject/build-impl.xml.data.CRC32=20a1ec55
|
||||
nbproject/build-impl.xml.script.CRC32=b4f5594b
|
||||
nbproject/build-impl.xml.data.CRC32=b50c735c
|
||||
nbproject/build-impl.xml.script.CRC32=74e621b3
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1
|
||||
|
@ -28,9 +28,6 @@ dist.war=${dist.dir}/${war.name}
|
||||
endorsed.classpath=\
|
||||
${libs.javaee-endorsed-api-7.0.classpath}
|
||||
excludes=
|
||||
file.reference.jackson-annotations-2.9.0.jar=C:\\Users\\Edi\\Desktop\\jackson-annotations-2.9.0.jar
|
||||
file.reference.jackson-core-2.9.9.jar=C:\\Users\\Edi\\Desktop\\jackson-core-2.9.9.jar
|
||||
file.reference.jackson-databind-2.9.9.jar=C:\\Users\\Edi\\Desktop\\jackson-databind-2.9.9.jar
|
||||
includes=**
|
||||
j2ee.compile.on.save=true
|
||||
j2ee.copy.static.files.on.save=true
|
||||
@ -45,10 +42,7 @@ j2ee.platform.wsit.classpath=
|
||||
j2ee.server.type=gfv3ee6
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${libs.javaee-web-api-7.0.classpath}:\
|
||||
${file.reference.jackson-annotations-2.9.0.jar}:\
|
||||
${file.reference.jackson-core-2.9.9.jar}:\
|
||||
${file.reference.jackson-databind-2.9.9.jar}
|
||||
${libs.javaee-web-api-7.0.classpath}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.debug=true
|
||||
|
@ -10,18 +10,6 @@
|
||||
<file>${libs.javaee-web-api-7.0.classpath}</file>
|
||||
<path-in-war>WEB-INF/lib</path-in-war>
|
||||
</library>
|
||||
<library dirs="200">
|
||||
<file>${file.reference.jackson-annotations-2.9.0.jar}</file>
|
||||
<path-in-war>WEB-INF/lib</path-in-war>
|
||||
</library>
|
||||
<library dirs="200">
|
||||
<file>${file.reference.jackson-core-2.9.9.jar}</file>
|
||||
<path-in-war>WEB-INF/lib</path-in-war>
|
||||
</library>
|
||||
<library dirs="200">
|
||||
<file>${file.reference.jackson-databind-2.9.9.jar}</file>
|
||||
<path-in-war>WEB-INF/lib</path-in-war>
|
||||
</library>
|
||||
</web-module-libraries>
|
||||
<web-module-additional-libraries/>
|
||||
<source-roots>
|
||||
|
@ -1,49 +1,36 @@
|
||||
|
||||
import com.fasterxml.jackson.core.JsonEncoding;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParseException;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.json.stream.JsonGenerationException;
|
||||
|
||||
public class Game {
|
||||
|
||||
private static ArrayList<Room> rooms = new ArrayList<Room>();
|
||||
private static ArrayList<Item> inventory = new ArrayList<Item>();
|
||||
private static ArrayList<String> story = new ArrayList<String>();
|
||||
private static ArrayList<Item> items = new ArrayList<Item>();
|
||||
private static ArrayList<Puzzle> puzzles = new ArrayList<Puzzle>();
|
||||
|
||||
|
||||
private boolean stoppFlag = false;
|
||||
private Map<String, Object> jsonMap = null;
|
||||
private String[] inputArray = null;
|
||||
|
||||
private String itemName = null;
|
||||
private String intentName = null;
|
||||
private String puzzleName = null;
|
||||
private String input = null;
|
||||
private Room currentRoom = null;
|
||||
String[] inputArray = null;
|
||||
String itemName = null;
|
||||
String intentName = null;
|
||||
String puzzleName = null;
|
||||
String input = null;
|
||||
Room currentRoom = null;
|
||||
|
||||
Room intro;
|
||||
Room keller;
|
||||
Puzzle durchgang;
|
||||
Puzzle schloss;
|
||||
Puzzle door;
|
||||
Item schluessel;
|
||||
Item stahlschluessel;
|
||||
|
||||
public Game() {
|
||||
|
||||
try {
|
||||
startGame();
|
||||
} catch (Exception ex) {
|
||||
@ -51,191 +38,88 @@ public class Game {
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> readJSON() throws IOException, Exception {
|
||||
public void setVariables() {
|
||||
|
||||
//TODO: Define path!
|
||||
File file = new File("game.JSON");
|
||||
if(!file.exists())
|
||||
{
|
||||
PrintWriter writer = new PrintWriter("game.JSON", "UTF-8");
|
||||
writer.println("{\\nroom\\n:[{\\nid\\n:0,\\nname\\n:\\nIntro\\n,\\ndescription\\n:\\nHier ist das Intro von Kidnappd\\n,\\ngameoverFlag\\n:false,\\nitems\\n:[],\\npuzzles\\n:[0]},{\\nid\\n:1,\\nname\\n:\\nKeller\\n,\\ndescription\\n:\\nder kleine Mondschein, der zuvor den unbekannten Raum schwach beleuchtet hat, leuchtet viel gr��er und viel heller und du erkennst nun den gesamten Raum. Er ist klein und d�ster. überall h�ngen Spinnennetze und Staub sammelt sich am Betonboden. Du erkennst am anderen Ende des Raumes eine T�r\\n,\\ngameoverFlag\\n:false,\\nitems\\n:[0,1],\\npuzzles\\n:[1,2]}],\\npuzzle\\n:[{\\nid\\n:0,\\nname\\n:\\nDurchgang\\n,\\nitems\\n:[],\\ndescription\\n:\\nAusgang Intro Level\\n,\\nsolved\\n:false,\\nsolvedText\\n:\\nHurra, du hast es geschafft\\n,\\ngameOverFlag\\n:false,\\nnextRoom\\n:null,\\ndependencyText\\n:null,\\ndependency\\n:null},{\\nid\\n:1,\\nname\\n:\\nTuer\\n,\\nitems\\n:[1],\\ndescription\\n:\\nAusgang aus dem Keller\\n,\\nsolved\\n:false,\\nsolvedText\\n:\\nGeschafft! Die Tuer ist offen. Das Intro ist nun beendet\\n,\\ngameOverFlag\\n:true,\\nnextRoom\\n:null,\\ndependencyText\\n:null,\\ndependency\\n:null},{\\nid\\n:2,\\nname\\n:\\nSchloss\\n,\\nitems\\n:[0],\\ndescription\\n:\\nEs ist ein altes Schloss aus Metall, dass eine Einkerbung f�r einen Schl�ssel hat\\n,\\nsolved\\n:false,\\nsolvedText\\n:\\nJa, es hat funktioniert! Mit einem Knacksen geht das Schloss auf und du kannst dich von deiner Beinfessel befreien. \\n,\\ngameOverFlag\\n:false,\\nnextRoom\\n:null,\\ndependencyText\\n:null,\\ndependency\\n:null}],\\nitem\\n:[{\\nid\\n:1,\\nname\\n:\\nStahlschluessel\\n,\\nportableFlag\\n:true,\\nhiddenFlag\\n:false,\\ndescription\\n:\\nEin Stahlschlüssel\\n},{\\nid\\n:0,\\nname\\n:\\nSchluessel\\n,\\nportableFlag\\n:true,\\nhiddenFlag\\n:false,\\ndescription\\n:\\nDer Schlüssel ist kalt und klein. Vielleicht hast du Glück und er passt ins Schloss. Versuche es zu öffnen!\\n}],\\nstory\\n:[\\nDein ganzer K�rper schmerzt, du liegst auf Betonboden. Du f�ngst laut an zu husten und Staubklumpen fliegen aus deinem Mund. Du �ffnest langsam und nur schwer die Augen, doch es ist fast gar nichts zu sehen. Die einzige Lichtquelle ist ein kleines Fenster �ber dir, durch die ein schwacher Mondschein f�llt. Es ist also Nachts... Langsam versuchst du dich an die fast komplette Dunkelheit zu gew�hnen und erkennst, dass du dich in einem kleinen dir unbekannten Raum befindest. Dich packt die Angst! Was ist passiert, wo bist du und wie bist du hier gelandet?Du nimmst die Stahlkette in die Hand. Sie ist schwer und verrostet. Mit den H�nden tastest du dich voran bis an die Heizung, wo du ein Schloss an der Kette entdeckst.Das Mondlicht ist nur sehr schwach, um den Raum zu begutachten. Du gehst in die Knie und tastest mit deinem H�nden wild und in Panik am Betonboden. Pl�tzlich st��t du auf einen kleinen Gegenstand, der sich tats�chlich anf�hlt wie ein Schl�ssel. Du solltest ihn aufheben\\n]}");
|
||||
writer.close();
|
||||
}
|
||||
// Intro Raum
|
||||
intro = new Room("Intro");
|
||||
intro.setDescription("Hier ist das Intro von Kidnappd");
|
||||
durchgang = new Puzzle("Durchgang");
|
||||
durchgang.setSolvedText("Hurra, du hast das Intro Level beendet");
|
||||
intro.puzzles.add(durchgang);
|
||||
|
||||
|
||||
try {
|
||||
FileReader fr = new FileReader(file);
|
||||
BufferedReader br = new BufferedReader(fr);
|
||||
String jsonObject = br.readLine();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
//Raum Object
|
||||
keller = new Room("Keller");
|
||||
|
||||
try {
|
||||
jsonMap = objectMapper.readValue(jsonObject,
|
||||
new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
} catch (JsonParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (JsonMappingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
log("Keyset:" + jsonMap.keySet().toString());
|
||||
return jsonMap;
|
||||
durchgang.setNextRoom(keller);
|
||||
keller.setDescription("der kleine Mondschein, der zuvor den unbekannten Raum schwach beleuchtet hat, leuchtet viel gr��er und viel heller und du erkennst nun den gesamten Raum. Er ist klein und d�ster. "
|
||||
+ "überall h�ngen Spinnennetze und Staub sammelt sich am Betonboden. Du erkennst am anderen Ende des Raumes eine T�r");
|
||||
|
||||
} catch (FileNotFoundException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
//Puzzle Object
|
||||
schloss = new Puzzle("Schloss");
|
||||
schloss.setDescription("Es ist ein altes Schloss aus Metall, dass eine Einkerbung f�r einen Schl�ssel hat");
|
||||
schloss.setSolvedText("Ja, es hat funktioniert! Mit einem Knacksen geht das Schloss auf und du kannst dich von deiner Beinfessel befreien. ");
|
||||
|
||||
return null;
|
||||
}
|
||||
keller.puzzles.add(schloss);
|
||||
|
||||
public static String writeJSON(File f) throws IOException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String s = "";
|
||||
try (
|
||||
JsonGenerator jGenerator
|
||||
= mapper.getFactory().createGenerator(f,JsonEncoding.UTF8)) {
|
||||
//Ausgang
|
||||
door = new Puzzle("Tuer");
|
||||
door.setDescription("Ausgang aus dem Keller");
|
||||
door.setGameOverFlag(true);
|
||||
door.setSolvedText("Geschafft! Die Tuer ist offen. Das Intro ist nun beendet");
|
||||
keller.puzzles.add(door);
|
||||
|
||||
jGenerator.writeStartObject();
|
||||
jGenerator.writeObjectField("room", rooms);
|
||||
jGenerator.writeObjectField("puzzle", puzzles);
|
||||
jGenerator.writeObjectField("item", items);
|
||||
jGenerator.writeObjectField("story", story);
|
||||
jGenerator.writeEndObject();
|
||||
jGenerator.close();
|
||||
//Item Object
|
||||
schluessel = new Item("Schluessel");
|
||||
schluessel.setHiddenFlag(false);
|
||||
schluessel.setPortableFlag(true);
|
||||
schluessel.setDescription("Der Schl�ssel ist kalt und klein. Vielleicht hast du Gl�ck und er passt ins Schloss. Versuche es zu �ffnen!");
|
||||
schloss.addItem(schluessel);
|
||||
keller.items.add(schluessel);
|
||||
|
||||
} catch (JsonGenerationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (JsonMappingException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
door.setDependency(schloss);
|
||||
door.setDependencyText("Du musst erst das Schloss der Kette knacken um die Tür öffnen zu können");
|
||||
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
reader = new BufferedReader(new FileReader("game.JSON"));
|
||||
} catch (FileNotFoundException ex) {
|
||||
Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String line;
|
||||
//Item Object
|
||||
stahlschluessel = new Item("Stahlschluessel");
|
||||
stahlschluessel.setHiddenFlag(false);
|
||||
stahlschluessel.setPortableFlag(false);
|
||||
stahlschluessel.setDescription("Ein Stahlschlüssel");
|
||||
intro.items.add(stahlschluessel);
|
||||
|
||||
while ((line = reader.readLine()) != null) {
|
||||
s = s + (line + "\n");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
rooms.add(intro);
|
||||
rooms.add(keller);
|
||||
story.add("Dein ganzer K�rper schmerzt, du liegst auf Betonboden. Du f�ngst laut an zu husten und Staubklumpen fliegen aus deinem Mund. Du �ffnest langsam und nur schwer die Augen, "
|
||||
+ "doch es ist fast gar nichts zu sehen. Die einzige Lichtquelle ist ein kleines Fenster �ber dir, durch die ein schwacher Mondschein f�llt. Es ist also Nachts... "
|
||||
+ "Langsam versuchst du dich an die fast komplette Dunkelheit zu gew�hnen und erkennst, dass du dich in einem kleinen dir unbekannten Raum befindest. Dich packt die Angst! "
|
||||
+ "Was ist passiert, wo bist du und wie bist du hier gelandet?"
|
||||
+ "Du nimmst die Stahlkette in die Hand. Sie ist schwer und verrostet. Mit den H�nden tastest du dich voran bis an die Heizung, wo du ein Schloss an der Kette entdeckst."
|
||||
+ "Das Mondlicht ist nur sehr schwach, um den Raum zu begutachten. Du gehst in die Knie und tastest mit deinem H�nden wild und in Panik am Betonboden. "
|
||||
+ "Pl�tzlich st��t du auf einen kleinen Gegenstand, der sich tats�chlich anf�hlt wie ein Schl�ssel. Du solltest ihn aufheben");
|
||||
|
||||
public Item getItem(String s) {
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
if (items.get(i).getName().toLowerCase().equals(s.toLowerCase())) {
|
||||
if (currentRoom.getItems().contains(items.get(i).getId())) {
|
||||
return items.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Puzzle getPuzzle(String s) {
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
if (items.get(i).getName().toLowerCase().equals(s.toLowerCase())) {
|
||||
if (currentRoom.getPuzzles().contains(puzzles.get(i).getId())) {
|
||||
return puzzles.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void setVariables() throws Exception {
|
||||
|
||||
readJSON();
|
||||
log(readJSON().toString());
|
||||
log("Readjson fertig");
|
||||
|
||||
currentRoom = rooms.get(0);
|
||||
|
||||
currentRoom = intro;
|
||||
stoppFlag = false;
|
||||
inventory = new ArrayList<>();
|
||||
inventory = new ArrayList<Item>();
|
||||
|
||||
//log("JSON: " + writeJSON());
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
|
||||
|
||||
String jsonStringRoom = objectMapper.writeValueAsString(jsonMap.get("room"));
|
||||
String jsonStringItem = objectMapper.writeValueAsString(jsonMap.get("item"));
|
||||
String jsonStringPuzzle = objectMapper.writeValueAsString(jsonMap.get("puzzle"));
|
||||
String jsonStringStory = objectMapper.writeValueAsString(jsonMap.get("story"));
|
||||
|
||||
log("Item: " + jsonStringItem);
|
||||
log("Room: " + jsonStringRoom);
|
||||
log("Story: " + jsonStringStory);
|
||||
log("Puzzle: " + jsonStringPuzzle);
|
||||
|
||||
String[] st = objectMapper.readValue(jsonStringStory, String[].class);
|
||||
log("Story Array OK");
|
||||
Item[] it = objectMapper.readValue(jsonStringItem, Item[].class);
|
||||
log("Item Array OK");
|
||||
Puzzle[] pu = objectMapper.readValue(jsonStringPuzzle, Puzzle[].class);
|
||||
log("Puzzle Array OK");
|
||||
Room[] ro = objectMapper.readValue(jsonStringRoom, Room[].class);
|
||||
log("Room Array OK");
|
||||
|
||||
for (Room ro1 : ro) {
|
||||
log("Room: " + ro1.getName());
|
||||
log("Description: " + ro1.getDescription());
|
||||
}
|
||||
|
||||
for (Item it1 : it) {
|
||||
log("Item: " + it1.getName());
|
||||
log("Description: " + it1.getDescription());
|
||||
}
|
||||
|
||||
for (Puzzle pu1 : pu) {
|
||||
log("Puzzle: " + pu1.getName());
|
||||
log("Description: " + pu1.getDescription());
|
||||
log("DependencyText: " + pu1.getDependencyText());
|
||||
}
|
||||
|
||||
for (String st1 : st) {
|
||||
log("Story: " + st1);
|
||||
}
|
||||
}
|
||||
|
||||
public void play() throws Exception {
|
||||
log("play()");
|
||||
log("Input: " + input);
|
||||
log("currentRoom: " + currentRoom.getName());
|
||||
|
||||
for (int i = 0; i < currentRoom.getPuzzles().size(); i++) {
|
||||
log("Puzzle im Raum: " + currentRoom.getPuzzles().get(i)); //getPuzzles().get(i).getName());
|
||||
}
|
||||
for (int i = 0; i < currentRoom.getItems().size(); i++) {
|
||||
log("Item im Raum: " + currentRoom.getItems().get(i)); //getItems().get(i).getName());
|
||||
}
|
||||
|
||||
|
||||
input = input.replace("ä", "ae");
|
||||
input = input.replace("ü", "ue");
|
||||
input = input.replace("ö", "oe");
|
||||
input = input.replace("ß", "ss");
|
||||
|
||||
|
||||
if (input.contains(" ")) {
|
||||
inputArray = input.split(" ");
|
||||
|
||||
for (String s : inputArray) {
|
||||
if (getItem(s) != null) {
|
||||
itemName = getItem(s).getName();
|
||||
if (currentRoom.getItem(s) != null) {
|
||||
itemName = currentRoom.getItem(s).getName();
|
||||
log("itemName: " + itemName);
|
||||
} else if (getPuzzle(s) != null) {
|
||||
puzzleName = getPuzzle(s).getName();
|
||||
} else if (currentRoom.getPuzzle(s) != null) {
|
||||
puzzleName = currentRoom.getPuzzle(s).getName();
|
||||
log("PuzzleName: " + puzzleName);
|
||||
} else {
|
||||
intentName = s;
|
||||
@ -250,22 +134,22 @@ public class Game {
|
||||
switch (intentName.toLowerCase()) {
|
||||
//intent
|
||||
case "lookaroundintent":
|
||||
log("Switch: LookAroundIntent");
|
||||
log("Switch: lookAroundIntent");
|
||||
if (itemName == null && puzzleName == null) {
|
||||
lookaround();
|
||||
}
|
||||
break;
|
||||
//intent
|
||||
case "inspectintent":
|
||||
log("Switch: InspectIntent");
|
||||
if (getItem(itemName) != null) {
|
||||
inspect(getItem(itemName));
|
||||
} else if (getPuzzle(puzzleName) != null) {
|
||||
inspect(getPuzzle(puzzleName));
|
||||
log("Switch: inspectintent");
|
||||
if (itemName != null) {
|
||||
inspect(itemName);
|
||||
} else if (puzzleName != null) {
|
||||
inspect(puzzleName);
|
||||
}
|
||||
break;
|
||||
|
||||
//intent
|
||||
break;
|
||||
//intent
|
||||
|
||||
case "examineintent":
|
||||
log("Switch: ExamineIntent");
|
||||
if (itemName == null && puzzleName == null) {
|
||||
@ -276,15 +160,15 @@ public class Game {
|
||||
//intent
|
||||
case "takeintent":
|
||||
log("Switch: TakeIntent");
|
||||
if (getItem(itemName) != null) {
|
||||
take(getItem(itemName));
|
||||
if (itemName != null) {
|
||||
take(currentRoom.getItem(itemName));
|
||||
}
|
||||
break;
|
||||
//intent
|
||||
case "openintent":
|
||||
log("Switch: OpenIntent");
|
||||
if (getPuzzle(puzzleName) != null) {
|
||||
open(getPuzzle(puzzleName));
|
||||
if (puzzleName != null) {
|
||||
open(currentRoom.getPuzzle(puzzleName));
|
||||
}
|
||||
break;
|
||||
//intent
|
||||
@ -301,60 +185,29 @@ public class Game {
|
||||
if (itemName == null && puzzleName == null) {
|
||||
resetGame();
|
||||
for (int i = 0; i < currentRoom.puzzles.size(); i++) {
|
||||
if (getPuzzleById(currentRoom.puzzles.get(i)).getNextRoom() != null) {
|
||||
setRoom(getRoomById(getPuzzleById(currentRoom.puzzles.get(i)).getNextRoom()));
|
||||
if (currentRoom.puzzles.get(i).getNextRoom() != null) {
|
||||
setRoom(currentRoom.puzzles.get(i).getNextRoom());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case "resumeintent":
|
||||
log("Switch: ResumeIntent");
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
itemName = null;
|
||||
intentName = null;
|
||||
puzzleName = null;
|
||||
|
||||
|
||||
log("stoppFlag: " + stoppFlag);
|
||||
|
||||
|
||||
if (stoppFlag == true) {
|
||||
endGame();
|
||||
}
|
||||
}
|
||||
|
||||
public Room getRoomById(int i) {
|
||||
for (int j = 0; j < rooms.size(); j++) {
|
||||
if (rooms.get(j).getId() == i) {
|
||||
return rooms.get(j);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Item getItemById(int i) {
|
||||
for (int j = 0; j < items.size(); j++) {
|
||||
if (items.get(j).getId() == i) {
|
||||
return items.get(j);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public Puzzle getPuzzleById(int i) {
|
||||
for (int j = 0; j < puzzles.size(); j++) {
|
||||
if (puzzles.get(j).getId() == i) {
|
||||
return puzzles.get(j);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void log(String s) throws Exception {
|
||||
|
||||
public void log(String s) throws Exception
|
||||
{
|
||||
String url = "https://medinf.efi.th-nuernberg.de/tomcat/WebAdventure/Log";
|
||||
URL obj = new URL(url);
|
||||
HttpURLConnection httpConn = (HttpURLConnection) obj.openConnection();
|
||||
@ -366,11 +219,11 @@ public class Game {
|
||||
|
||||
// Send post request
|
||||
httpConn.setDoOutput(true);
|
||||
try (DataOutputStream wr = new DataOutputStream(httpConn.getOutputStream())) {
|
||||
String urlParameters = "log=" + s;
|
||||
wr.writeBytes(urlParameters);
|
||||
wr.flush();
|
||||
}
|
||||
DataOutputStream wr = new DataOutputStream(httpConn.getOutputStream());
|
||||
String urlParameters = "log=" + s;
|
||||
wr.writeBytes(urlParameters);
|
||||
wr.flush();
|
||||
wr.close();
|
||||
|
||||
BufferedReader in = new BufferedReader(
|
||||
new InputStreamReader(httpConn.getInputStream()));
|
||||
@ -384,44 +237,43 @@ public class Game {
|
||||
}
|
||||
|
||||
public void lookaround() throws Exception {
|
||||
log("lookaround()");
|
||||
log("lookaround() ");
|
||||
say(currentRoom.getDescription());
|
||||
}
|
||||
|
||||
public void startGame() throws Exception {
|
||||
log("startGame()");
|
||||
log("startGame() ");
|
||||
for (int i = 0; i < story.size(); i++) {
|
||||
say(story.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public void resetGame() throws Exception {
|
||||
log("resetGame()");
|
||||
log("resetGame() ");
|
||||
startGame();
|
||||
}
|
||||
|
||||
public void inspect(Puzzle currentPuzzle) throws Exception {
|
||||
log("inspect(" + currentPuzzle.getName() + ")");
|
||||
|
||||
for (int i = 0; i < currentRoom.getItems().size(); i++) {
|
||||
if (Objects.equals(currentRoom.getPuzzles().get(i), currentPuzzle.getId())) {
|
||||
say(currentPuzzle.getDescription());
|
||||
}
|
||||
public void inspect(String s) throws Exception {
|
||||
log("inspect(" + s + ") ");
|
||||
Item currentItem=null;
|
||||
if(currentRoom.getItem(s) != null)
|
||||
{
|
||||
currentItem= currentRoom.getItem(s);
|
||||
log("currentItem: " + currentItem.getName());
|
||||
say(currentItem.getDescription());
|
||||
}
|
||||
}
|
||||
|
||||
public void inspect(Item currentItem) throws Exception {
|
||||
log("inspect(" + currentItem.getName() + ")");
|
||||
|
||||
for (int i = 0; i < currentRoom.getItems().size(); i++) {
|
||||
if (Objects.equals(currentRoom.getItems().get(i), currentItem.getId())) {
|
||||
say(currentItem.getDescription());
|
||||
}
|
||||
Puzzle currentPuzzle=null;
|
||||
|
||||
if(currentRoom.getPuzzle(s) != null)
|
||||
{
|
||||
currentPuzzle = currentRoom.getPuzzle(s);
|
||||
log("currentPuzzle " + currentPuzzle.getName());
|
||||
say(currentPuzzle.getDescription());
|
||||
}
|
||||
}
|
||||
|
||||
public void endGame() throws Exception {
|
||||
log("endGame()");
|
||||
log("endGame() ");
|
||||
say("Glückwunsch das Spiel ist beendet!");
|
||||
setVariables();
|
||||
}
|
||||
@ -457,7 +309,7 @@ public class Game {
|
||||
}
|
||||
|
||||
public void say(String s) throws Exception {
|
||||
log("say(" + s + ")");
|
||||
log("say(" + s + ") ");
|
||||
try {
|
||||
sendPost(s);
|
||||
} catch (Exception ex) {
|
||||
@ -466,12 +318,12 @@ public class Game {
|
||||
}
|
||||
|
||||
public void setInput(String s) throws Exception {
|
||||
log("setInput(" + s + ")");
|
||||
log("setInput(" + s + ") ");
|
||||
input = s;
|
||||
}
|
||||
|
||||
public void setRoom(Room nextRoom) throws Exception {
|
||||
log("setRoom(" + nextRoom.getName() + ")");
|
||||
log("setRoom(" + nextRoom.getName() + ") " );
|
||||
currentRoom = nextRoom;
|
||||
say(currentRoom.getDescription());
|
||||
}
|
||||
@ -496,19 +348,19 @@ public class Game {
|
||||
}
|
||||
|
||||
public void open(Puzzle currentPuzzle) throws Exception {
|
||||
log("open(" + currentPuzzle.getName() + ") ");
|
||||
log("open(" + currentPuzzle.getName() + ") ");
|
||||
if (currentPuzzle.isSolved()) // bereits gelöst
|
||||
{
|
||||
say("ist bereits geöffnet");
|
||||
if (currentPuzzle.getNextRoom() != null) // wenn es eine Tür ist die in den nächsten Raum führt
|
||||
{
|
||||
setRoom(getRoomById(currentPuzzle.getNextRoom())); // wechselt in den nächsten Raum
|
||||
setRoom(currentPuzzle.getNextRoom()); // wechselt in den nächsten Raum
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!currentPuzzle.hasDependency() || getPuzzleById(currentPuzzle.getDependency()).isSolved()) // ist keine Abhängigkeit vorhanden oder aber die Abhängigkeit ist gelöst
|
||||
if (!currentPuzzle.hasDependency() || currentPuzzle.getDependency().isSolved()) // ist keine Abhängigkeit vorhanden oder aber die Abhängigkeit ist gelöst
|
||||
{
|
||||
if (currentPuzzle.getItems().isEmpty() || checkPuzzleItemsInInventory(currentPuzzle.getId())) // keine Items zum lösen notwendig oder alle Items zum lösen befinden sich im Inventar
|
||||
if (currentPuzzle.getItems().isEmpty() || getInventory().containsAll(currentPuzzle.getItems())) // keine Items zum lösen notwendig oder alle Items zum lösen befinden sich im Inventar
|
||||
{
|
||||
currentPuzzle.setSolved(true); // auf gelöst setzen
|
||||
say(currentPuzzle.getSolvedText()); // Lösungstext
|
||||
@ -520,7 +372,7 @@ public class Game {
|
||||
|
||||
if (currentPuzzle.getNextRoom() != null) // wenn es eine Tür ist die in den nächsten Raum führt
|
||||
{
|
||||
setRoom(getRoomById(currentPuzzle.getNextRoom())); // wechselt in den nächsten Raum
|
||||
setRoom(currentPuzzle.getNextRoom()); // wechselt in den nächsten Raum
|
||||
}
|
||||
} else // Item zum lösen fehlt
|
||||
{
|
||||
@ -528,7 +380,7 @@ public class Game {
|
||||
}
|
||||
}
|
||||
|
||||
if (!getPuzzleById(currentPuzzle.getDependency()).isSolved()) // Abhängigkeit nicht gelöst
|
||||
if (!currentPuzzle.getDependency().isSolved()) // Abhängigkeit nicht gelöst
|
||||
{
|
||||
say(currentPuzzle.getDependencyText());
|
||||
}
|
||||
@ -548,19 +400,16 @@ public class Game {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkPuzzleItemsInInventory(int puzzleId) {
|
||||
Puzzle p = getPuzzleById(puzzleId);
|
||||
for (int i = 0; i < p.getItems().size(); i++) {
|
||||
if (inventory.contains(getItemById(p.getItems().get(i)))) {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
public ArrayList<Room> getRooms() {
|
||||
return rooms;
|
||||
}
|
||||
|
||||
public ArrayList<Item> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
public ArrayList<String> getStory() {
|
||||
return story;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,46 +1,46 @@
|
||||
|
||||
public class Item
|
||||
{
|
||||
private Integer id;
|
||||
private String name;
|
||||
private boolean portableFlag;
|
||||
private boolean hiddenFlag;
|
||||
private String description;
|
||||
|
||||
public Item(Integer i, String n, boolean portable, boolean hidden, String desc)
|
||||
{
|
||||
id = i;
|
||||
name = n;
|
||||
portableFlag = portable;
|
||||
hiddenFlag = hidden;
|
||||
description = desc;
|
||||
}
|
||||
|
||||
public Item()
|
||||
{
|
||||
|
||||
}
|
||||
public Item(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean isPortableFlag() {
|
||||
return portableFlag;
|
||||
}
|
||||
|
||||
public void setPortableFlag(boolean portableFlag) {
|
||||
this.portableFlag = portableFlag;
|
||||
}
|
||||
|
||||
public boolean isHiddenFlag() {
|
||||
return hiddenFlag;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
}
|
||||
public void setHiddenFlag(boolean hiddenFlag) {
|
||||
this.hiddenFlag = hiddenFlag;
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class Log extends HttpServlet {
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
response.setIntHeader("Refresh", 10);
|
||||
response.setIntHeader("Refresh", 2);
|
||||
try {
|
||||
processRequest(request, response);
|
||||
|
||||
@ -81,7 +81,7 @@ public class Log extends HttpServlet {
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
response.setIntHeader("Refresh", 10);
|
||||
response.setIntHeader("Refresh", 2);
|
||||
try {
|
||||
processRequest(request, response);
|
||||
} catch (Exception ex) {
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.servlet.ServletException;
|
||||
@ -22,7 +21,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
*/
|
||||
@WebServlet(urlPatterns = {"/IO"})
|
||||
public class Logic extends HttpServlet {
|
||||
private ArrayList<Game> games = new ArrayList<Game>();
|
||||
|
||||
/**
|
||||
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
|
||||
@ -37,14 +35,8 @@ public class Logic extends HttpServlet {
|
||||
String context = "";
|
||||
|
||||
public void init() {
|
||||
try {
|
||||
g.setVariables();
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(Logic.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
g.setVariables();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException, Exception {
|
||||
@ -58,7 +50,7 @@ public class Logic extends HttpServlet {
|
||||
|
||||
out.println(context);
|
||||
|
||||
//String deviceId = request.getParameter("deviceId"); // einzigartige DeviceID des Alexa Geräts
|
||||
|
||||
|
||||
String input = request.getParameter("intent");
|
||||
if (request.getParameter("slot") != null) {
|
||||
@ -70,17 +62,6 @@ public class Logic extends HttpServlet {
|
||||
g.setInput(input);
|
||||
g.play();
|
||||
}
|
||||
|
||||
/* Mehrere Spieler auf einem Server
|
||||
for(int i = 0; i < games.size(); i++)
|
||||
{
|
||||
if(games.get(i).getId().equals(deviceId))
|
||||
{
|
||||
games.get(i).setInput(input);
|
||||
games.get(i).play();
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2,43 +2,37 @@ import java.util.ArrayList;
|
||||
|
||||
public class Puzzle
|
||||
{
|
||||
private Integer id;
|
||||
private String name;
|
||||
private ArrayList<Integer> items = new ArrayList<>();
|
||||
private ArrayList<Item> items = new ArrayList<Item>();
|
||||
private String description="";
|
||||
private boolean solved = false;
|
||||
private String solvedText = "";
|
||||
private boolean gameOverFlag=false;
|
||||
private Integer nextRoom = null;
|
||||
private Room nextRoom = null;
|
||||
private String dependencyText = null;
|
||||
private Integer dependency= null;
|
||||
private Puzzle dependency= null;
|
||||
|
||||
public Puzzle()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Puzzle(Integer i, String n, ArrayList<Integer> itemList, String desc, boolean solvedFlag, String solvedTxt, boolean gameOver, Integer next, String dependencytxt, Integer dependentFrom)
|
||||
{
|
||||
id = i;
|
||||
name = n;
|
||||
items = itemList;
|
||||
description = desc;
|
||||
solved = solvedFlag;
|
||||
solvedText = solvedTxt;
|
||||
gameOverFlag = gameOver;
|
||||
nextRoom = next;
|
||||
dependencyText = dependencytxt;
|
||||
dependency = dependentFrom;
|
||||
}
|
||||
public Puzzle(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean hasDependency()
|
||||
{
|
||||
return dependency != null;
|
||||
}
|
||||
|
||||
public void setDependency(Puzzle p)
|
||||
{
|
||||
dependency = p;
|
||||
}
|
||||
|
||||
public Integer getDependency()
|
||||
public void setDependencyText(String s)
|
||||
{
|
||||
dependencyText = s;
|
||||
}
|
||||
|
||||
public Puzzle getDependency()
|
||||
{
|
||||
return dependency;
|
||||
}
|
||||
@ -48,47 +42,69 @@ public class Puzzle
|
||||
return dependencyText;
|
||||
}
|
||||
|
||||
public Integer getNextRoom()
|
||||
public Room getNextRoom()
|
||||
{
|
||||
return nextRoom;
|
||||
}
|
||||
|
||||
public void addItem(Item i)
|
||||
{
|
||||
items.add(i);
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getItems() {
|
||||
public ArrayList<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public void setItems(ArrayList<Item> items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getSolvedText() {
|
||||
return solvedText;
|
||||
}
|
||||
|
||||
public void setSolvedText(String solvedText) {
|
||||
this.solvedText = solvedText;
|
||||
}
|
||||
|
||||
public boolean isSolved() {
|
||||
return solved;
|
||||
}
|
||||
|
||||
public void setSolved(boolean s)
|
||||
{
|
||||
solved = s;
|
||||
}
|
||||
public void setSolved(boolean solved) {
|
||||
this.solved = solved;
|
||||
}
|
||||
|
||||
public void setGameOverFlag(boolean b) {
|
||||
// TODO Auto-generated method stub
|
||||
gameOverFlag = b;
|
||||
|
||||
}
|
||||
|
||||
public boolean getGameOverFlag() {
|
||||
// TODO Auto-generated method stub
|
||||
return gameOverFlag;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
public void setNextRoom(Room r)
|
||||
{
|
||||
return id;
|
||||
nextRoom = r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,51 +3,60 @@ import java.util.ArrayList;
|
||||
|
||||
public class Room
|
||||
{
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String description;
|
||||
private boolean gameoverFlag;
|
||||
ArrayList<Integer> items = new ArrayList<>();
|
||||
ArrayList<Integer> puzzles = new ArrayList<>();
|
||||
|
||||
public Room()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Room(Integer i, String n, String desc, boolean gameover, ArrayList<Integer> itemList, ArrayList<Integer> puzzleList)
|
||||
{
|
||||
id = i;
|
||||
name = n;
|
||||
description = desc;
|
||||
gameoverFlag = gameover;
|
||||
items = itemList;
|
||||
puzzles = puzzleList;
|
||||
}
|
||||
ArrayList<Item> items = new ArrayList<>();
|
||||
ArrayList<Puzzle> puzzles = new ArrayList<>();
|
||||
public Room(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Item getItem(String s)
|
||||
{
|
||||
for(Item i: items)
|
||||
{
|
||||
if(i.getName().equalsIgnoreCase(s))
|
||||
return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Puzzle getPuzzle(String s)
|
||||
{
|
||||
for(Puzzle p: puzzles)
|
||||
{
|
||||
if(p.getName().equalsIgnoreCase(s))
|
||||
return p;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public boolean getGameoverFlag() {
|
||||
return gameoverFlag;
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getItems() {
|
||||
public void setGameoverFlag(boolean gameOverFlag) {
|
||||
gameoverFlag = gameOverFlag;
|
||||
}
|
||||
public ArrayList<Item> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getPuzzles() {
|
||||
|
||||
public ArrayList<Puzzle> getPuzzles() {
|
||||
return puzzles;
|
||||
}
|
||||
|
||||
public Integer getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
{"room":[{"id":0,"name":"Intro","description":"Hier ist das Intro von Kidnappd","gameoverFlag":false,"items":[],"puzzles":[0]},{"id":1,"name":"Keller","description":"der kleine Mondschein, der zuvor den unbekannten Raum schwach beleuchtet hat, leuchtet viel gr��er und viel heller und du erkennst nun den gesamten Raum. Er ist klein und d�ster. überall h�ngen Spinnennetze und Staub sammelt sich am Betonboden. Du erkennst am anderen Ende des Raumes eine T�r","gameoverFlag":false,"items":[0,1],"puzzles":[1,2]}],"puzzle":[{"id":0,"name":"Durchgang","items":[],"description":"Ausgang Intro Level","solved":false,"solvedText":"Hurra, du hast es geschafft","gameOverFlag":false,"nextRoom":null,"dependencyText":null,"dependency":null},{"id":1,"name":"Tuer","items":[1],"description":"Ausgang aus dem Keller","solved":false,"solvedText":"Geschafft! Die Tuer ist offen. Das Intro ist nun beendet","gameOverFlag":true,"nextRoom":null,"dependencyText":null,"dependency":null},{"id":2,"name":"Schloss","items":[0],"description":"Es ist ein altes Schloss aus Metall, dass eine Einkerbung f�r einen Schl�ssel hat","solved":false,"solvedText":"Ja, es hat funktioniert! Mit einem Knacksen geht das Schloss auf und du kannst dich von deiner Beinfessel befreien. ","gameOverFlag":false,"nextRoom":null,"dependencyText":null,"dependency":null}],"item":[{"id":1,"name":"Stahlschluessel","portableFlag":true,"hiddenFlag":false,"description":"Ein Stahlschlüssel"},{"id":0,"name":"Schluessel","portableFlag":true,"hiddenFlag":false,"description":"Der Schlüssel ist kalt und klein. Vielleicht hast du Glück und er passt ins Schloss. Versuche es zu öffnen!"}],"story":["Dein ganzer K�rper schmerzt, du liegst auf Betonboden. Du f�ngst laut an zu husten und Staubklumpen fliegen aus deinem Mund. Du �ffnest langsam und nur schwer die Augen, doch es ist fast gar nichts zu sehen. Die einzige Lichtquelle ist ein kleines Fenster �ber dir, durch die ein schwacher Mondschein f�llt. Es ist also Nachts... Langsam versuchst du dich an die fast komplette Dunkelheit zu gew�hnen und erkennst, dass du dich in einem kleinen dir unbekannten Raum befindest. Dich packt die Angst! Was ist passiert, wo bist du und wie bist du hier gelandet?Du nimmst die Stahlkette in die Hand. Sie ist schwer und verrostet. Mit den H�nden tastest du dich voran bis an die Heizung, wo du ein Schloss an der Kette entdeckst.Das Mondlicht ist nur sehr schwach, um den Raum zu begutachten. Du gehst in die Knie und tastest mit deinem H�nden wild und in Panik am Betonboden. Pl�tzlich st��t du auf einen kleinen Gegenstand, der sich tats�chlich anf�hlt wie ein Schl�ssel. Du solltest ihn aufheben"]}
|
Loading…
x
Reference in New Issue
Block a user