-
Notifications
You must be signed in to change notification settings - Fork 1
/
SAnna.java
141 lines (112 loc) · 4.24 KB
/
SAnna.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import java.util.*;
public class SAnna extends Scene {
public SAnna(Adventure host) {
super(host);
// TODO Auto-generated constructor stub
}
Action eisstand, eisstandInfo;
Action klappeInfo, klappeUntersuchen, pfoertner;
Action h0104konferenz, annaReturn;
boolean schluessel=false, eisDabei=false, pfoertnerAngesprochen=false;
@Override
public Scene run() {
host.tell(Messages.getString("SAnna.0")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.1")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.2")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.3")); //$NON-NLS-1$
host.delay();
host.tell(Messages.getString("SAnna.4")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.5")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.6")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.7")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.8")); //$NON-NLS-1$
host.map.resetActions();
// Mache Annas Zimmer begehbar
host.map.wohnheim.actions.add(new ActionWay(this, Messages.getString("SAnna.9"), host.map.vormensa)); //$NON-NLS-1$
host.map.vormensa.actions.add(new ActionWay(this, Messages.getString("SAnna.10"), host.map.wohnheim)); //$NON-NLS-1$
// Eisstand am Einsteinufer und vor der Mensa
eisstandInfo=new InfoAction(this, Messages.getString("SAnna.11")); //$NON-NLS-1$
eisstand=new Action(){
@Override
protected void play() {
host.tell(Messages.getString("SAnna.12")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.13")); //$NON-NLS-1$
host.delay();
if(pfoertnerAngesprochen && !eisDabei) {
List<String> aList=new ArrayList<String>();
aList.add(Messages.getString("SAnna.14")); //$NON-NLS-1$
aList.add(Messages.getString("SAnna.15")); //$NON-NLS-1$
if(host.ask(Messages.getString("SAnna.16"), aList)==0) { //$NON-NLS-1$
host.tell(Messages.getString("SAnna.17")); //$NON-NLS-1$
eisDabei=true;
}
}
}
@Override
public String getDescription() {
return Messages.getString("SAnna.18"); //$NON-NLS-1$
}
};
host.map.hardenbergstrassemensa.actions.add(eisstandInfo);
host.map.hardenbergstrassemensa.actions.add(eisstand);
host.map.einsteinufer.actions.add(eisstandInfo);
host.map.einsteinufer.actions.add(eisstand);
// Konferenz im H 0104
h0104konferenz=new InfoAction(this, Messages.getString("SAnna.19")); //$NON-NLS-1$
host.map.h0104.actions.add(h0104konferenz);
// Pförtner
pfoertner = new Action() {
@Override
protected void play() {
pfoertnerAngesprochen=true;
if(eisDabei) {
host.tell(Messages.getString("SAnna.20")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.21")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.22")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.23")); //$NON-NLS-1$
schluessel=true;
annaReturn.enable();
disable();
} else {
host.tell(Messages.getString("SAnna.24")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.25")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.26")); //$NON-NLS-1$
}
}
@Override
public String getDescription() {
return Messages.getString("SAnna.27"); //$NON-NLS-1$
}
};
pfoertner.disable();
host.map.hauptgebaeude.actions.add(pfoertner);
// Klappe über H 0104
klappeInfo = new InfoAction(this, Messages.getString("SAnna.28")); //$NON-NLS-1$
klappeUntersuchen=new Action() {
@Override
protected void play() {
klappeInfo.disable();
host.tell(Messages.getString("SAnna.29")); //$NON-NLS-1$
if(schluessel) {
host.tell(Messages.getString("SAnna.30")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.31")); //$NON-NLS-1$
} else {
host.tell(Messages.getString("SAnna.32")); //$NON-NLS-1$
host.tell(Messages.getString("SAnna.33")); //$NON-NLS-1$
pfoertner.enable();
}
}
@Override
public String getDescription() {
return Messages.getString("SAnna.34"); //$NON-NLS-1$
}
};
host.map.hersterstock.actions.add(klappeInfo);
host.map.hersterstock.actions.add(klappeUntersuchen);
// Zurück in Annas Zimmer
host.map.wohnheim.actions.add(annaReturn=new ReturnAction(this));
annaReturn.disable();
host.map.interact(true);
return new SKlausurRunning(host);
}
}