1 /* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
2 /* movef.c */
3 /* the movefunctions switch functions, for player and monster*/
4 
5 #include "glob.h"
6 
7 
8 
p_movefunction(movef)9 void p_movefunction(movef)
10 int movef;
11 {
12   /* loc functs above traps should be activated whether levitating or not */
13   drawvision(Player.x,Player.y);
14   sign_print(Player.x,Player.y,FALSE);
15   if (Player.status[SHADOWFORM])
16     switch(movef) {	/* player in shadow form is unable to do most things */
17       case L_CHAOS:l_chaos(); break;
18       case L_ABYSS:l_abyss(); break;
19       case L_ARENA_EXIT:l_arena_exit(); break;
20       case L_ENTER_COURT:l_enter_court(); break;
21       case L_ESCALATOR:l_escalator(); break;
22       case L_COLLEGE:l_college(); break;
23       case L_SORCERORS:l_sorcerors(); break;
24       case L_ALTAR:l_altar(); break;
25       case L_TACTICAL_EXIT:l_tactical_exit(); break;
26       case L_HOUSE_EXIT:l_house_exit(); break;
27       case L_HOUSE: l_house(); break;
28       case L_HOVEL: l_hovel(); break;
29       case L_MANSION: l_mansion(); break;
30       case L_COUNTRYSIDE:l_countryside(); break;
31       case L_ORACLE:l_oracle(); break;
32       case L_TEMPLE_WARNING:l_temple_warning(); break;
33       case L_ENTER_CIRCLE:l_enter_circle(); break;
34       case L_CIRCLE_LIBRARY:l_circle_library(); break;
35       case L_TOME1: l_tome1(); break;
36       case L_TOME2: l_tome2(); break;
37       case L_ADEPT:l_adept(); break;
38       case L_VOICE1:l_voice1();break;
39       case L_VOICE2:l_voice2();break;
40       case L_VOICE3:l_voice3();break;
41       case L_VOID:l_void();break;
42       case L_FIRE_STATION:l_fire_station();break;
43       case L_EARTH_STATION:l_earth_station();break;
44       case L_WATER_STATION:l_water_station();break;
45       case L_AIR_STATION:l_air_station();break;
46       case L_VOID_STATION:l_void_station();break;
47     }
48   else if ((! Player.status[LEVITATING]) ||
49       gamestatusp(MOUNTED) ||
50       (Cmd == '@') || /* @ command activates all effects under player */
51       (movef < LEVITATION_AVOIDANCE)) {
52 
53     switch(movef) {
54 	/* miscellaneous */
55       case L_NO_OP:l_no_op(); break;
56       case L_HEDGE:l_hedge(); break;
57       case L_WATER:l_water(); break;
58       case L_LIFT:l_lift(); break;
59       case L_LAVA:l_lava(); break;
60       case L_FIRE:l_fire(); break;
61       case L_WHIRLWIND:l_whirlwind(); break;
62       case L_RUBBLE:l_rubble(); break;
63       case L_MAGIC_POOL:l_magic_pool(); break;
64       case L_CHAOS:l_chaos(); break;
65       case L_ABYSS:l_abyss(); break;
66 
67       case L_PORTCULLIS_TRAP:l_portcullis_trap(); break;
68       case L_RAISE_PORTCULLIS:l_raise_portcullis(); break;
69       case L_DROP_EVERY_PORTCULLIS:l_drop_every_portcullis(); break;
70       case L_ARENA_EXIT:l_arena_exit(); break;
71       case L_TRIFID:l_trifid(); break;
72       case L_ENTER_COURT:l_enter_court(); break;
73       case L_ESCALATOR:l_escalator(); break;
74       case L_THRONE:l_throne(); break;
75 
76       case L_TRAP_DART:l_trap_dart(); break;
77       case L_TRAP_SIREN:l_trap_siren(); break;
78       case L_TRAP_PIT:l_trap_pit(); break;
79       case L_TRAP_DOOR:l_trap_door(); break;
80       case L_TRAP_SNARE:l_trap_snare(); break;
81       case L_TRAP_BLADE:l_trap_blade(); break;
82       case L_TRAP_FIRE:l_trap_fire(); break;
83       case L_TRAP_TELEPORT:l_trap_teleport(); break;
84       case L_TRAP_DISINTEGRATE:l_trap_disintegrate(); break;
85       case L_TRAP_SLEEP_GAS:l_trap_sleepgas(); break;
86       case L_TRAP_MANADRAIN:l_trap_manadrain(); break;
87       case L_TRAP_ACID:l_trap_acid(); break;
88       case L_TRAP_ABYSS:l_trap_abyss(); break;
89 
90      /*door functions */
91       case L_BANK:l_bank(); break;
92       case L_ARMORER:l_armorer(); break;
93       case L_CLUB:l_club(); break;
94       case L_GYM:l_gym(); break;
95       case L_BROTHEL:l_brothel(); break;
96       case L_THIEVES_GUILD:l_thieves_guild(); break;
97       case L_COLLEGE:l_college(); break;
98       case L_HEALER:l_healer(); break;
99       case L_STATUE_WAKE:l_statue_wake(); break;
100       case L_CASINO:l_casino(); break;
101       case L_COMMANDANT:l_commandant(); break;
102       case L_DINER:l_diner(); break;
103       case L_CRAP:l_crap(); break;
104       case L_TAVERN:l_tavern(); break;
105       case L_MERC_GUILD:l_merc_guild(); break;
106       case L_ALCHEMIST:l_alchemist(); break;
107       case L_SORCERORS:l_sorcerors(); break;
108       case L_CASTLE:l_castle(); break;
109       case L_ARENA:l_arena(); break;
110       case L_VAULT:l_vault(); break;
111       case L_DPW:l_dpw(); break;
112       case L_LIBRARY:l_library(); break;
113       case L_PAWN_SHOP:l_pawn_shop(); break;
114       case L_CONDO:l_condo(); break;
115       case L_ALTAR:l_altar(); break;
116       case L_TACTICAL_EXIT:l_tactical_exit(); break;
117       case L_HOUSE_EXIT:l_house_exit(); break;
118       case L_SAFE: l_safe(); break;
119       case L_HOUSE: l_house(); break;
120       case L_HOVEL: l_hovel(); break;
121       case L_MANSION: l_mansion(); break;
122       case L_COUNTRYSIDE:l_countryside(); break;
123       case L_ORACLE:l_oracle(); break;
124       case L_ORDER:l_order(); break;
125       case L_CARTOGRAPHER:l_cartographer(); break;
126 
127       case L_TEMPLE_WARNING:l_temple_warning(); break;
128       case L_ENTER_CIRCLE:l_enter_circle(); break;
129       case L_CIRCLE_LIBRARY:l_circle_library(); break;
130       case L_TOME1: l_tome1(); break;
131       case L_TOME2: l_tome2(); break;
132 
133       case L_CHARITY: l_charity(); break;
134 
135       case L_CHAOSTONE:l_chaostone();break;
136       case L_VOIDSTONE:l_voidstone();break;
137       case L_BALANCESTONE:l_balancestone();break;
138       case L_LAWSTONE:l_lawstone();break;
139       case L_SACRIFICESTONE:l_sacrificestone(); break;
140       case L_MINDSTONE:l_mindstone(); break;
141 
142       /* challenge functions */
143       case L_ADEPT:l_adept(); break;
144       case L_VOICE1:l_voice1();break;
145       case L_VOICE2:l_voice2();break;
146       case L_VOICE3:l_voice3();break;
147       case L_VOID:l_void();break;
148       case L_FIRE_STATION:l_fire_station();break;
149       case L_EARTH_STATION:l_earth_station();break;
150       case L_WATER_STATION:l_water_station();break;
151       case L_AIR_STATION:l_air_station();break;
152       case L_VOID_STATION:l_void_station();break;
153     }
154     if (movef != L_NO_OP) {
155       resetgamestatus(FAST_MOVE);
156       dataprint();
157     }
158   }
159 }
160 
161 
162 
163 
164 
165 /* execute some move function for a monster */
m_movefunction(m,movef)166 void m_movefunction(m,movef)
167 struct monster *m;
168 int movef;
169 {
170   /* loc functs above traps should be activated whether levitating or not */
171   if (! m_statusp(m,FLYING) && ! m_statusp(m, INTANGIBLE))
172     switch(movef) {
173 
174     /* miscellaneous */
175     case L_NO_OP:m_no_op(m); break;
176     case L_WATER:m_water(m); break;
177     case L_LAVA:m_lava(m); break;
178     case L_FIRE:m_fire(m); break;
179     case L_MAGIC_POOL:m_water(m); break;
180     case L_ABYSS: m_abyss(m); break;
181 
182     case L_TRAP_DART:m_trap_dart(m); break;
183     case L_TRAP_PIT:m_trap_pit(m); break;
184     case L_TRAP_DOOR:m_trap_door(m); break;
185     case L_TRAP_SNARE:m_trap_snare(m); break;
186     case L_TRAP_BLADE:m_trap_blade(m); break;
187     case L_TRAP_FIRE:m_trap_fire(m); break;
188     case L_TRAP_TELEPORT:m_trap_teleport(m); break;
189     case L_TRAP_DISINTEGRATE:m_trap_disintegrate(m); break;
190     case L_TRAP_MANADRAIN:m_trap_manadrain(m); break;
191     case L_TRAP_SLEEP_GAS:m_trap_sleepgas(m); break;
192     case L_TRAP_ACID:m_trap_acid(m); break;
193     case L_TRAP_ABYSS:m_trap_abyss(m);break;
194 
195     case L_ALTAR:m_altar(m); break;
196     }
197 }
198 
199 #ifdef MSDOS_SUPPORTED_ANTIQUE
200 /* ****Moved here from another file**** */
201 /* if signp is true, always print message, otherwise do so only sometimes */
sign_print(x,y,signp)202 void sign_print(x,y,signp)
203 int x,y,signp;
204 {
205   if ((Level->site[x][y].p_locf >= CITYSITEBASE) &&
206       (Level->site[x][y].p_locf < CITYSITEBASE+NUMCITYSITES))
207     CitySiteList[Level->site[x][y].p_locf - CITYSITEBASE][0] = TRUE;
208   switch(Level->site[x][y].p_locf) {
209   case L_CHARITY:
210     print1("You notice a sign: The Rampart Orphanage And Hospice For The Needy.");
211     break;
212   case L_MANSION:
213     print1("You notice a sign:");
214     print2("This edifice protected by DeathWatch Devices, Ltd.");
215     morewait();
216     break;
217   case L_GRANARY:
218     print1("You notice a sign:");
219     print2("Public Granary: Entrance Strictly Forbidden.");
220     break;
221   case L_PORTCULLIS:
222     if (Level->site[x][y].locchar == FLOOR)
223       print1("You see a groove in the floor and slots above you.");
224     break;
225   case L_STABLES:
226     print1("You notice a sign:");
227     print2("Village Stables");
228     break;
229   case L_COMMONS:
230     print1("You notice a sign:");
231     print2("Village Commons: No wolves allowed.");
232     break;
233   case L_MAZE:
234     print1("You notice a sign:");
235     print2("Hedge maze closed for trifid extermination.");
236     break;
237   case L_BANK:
238     if (signp) {
239       print1("You notice a sign:");
240       print2("First Bank of Omega: Autoteller Carrel.");
241     }
242     break;
243   case L_TEMPLE:
244     print1("You see the ornate portico of the Rampart Pantheon");
245     break;
246   case L_ARMORER:
247     if (signp) {
248       print1("You notice a sign:");
249       print2("Julie's Armor of Proof and Weapons of Quality");
250     }
251     break;
252   case L_CLUB:
253     if (signp) {
254       print1("You notice a sign:");
255       print2("Rampart Explorers' Club.");
256     }
257     break;
258   case L_GYM:
259     if (signp) {
260       print1("You notice a sign:");
261       print2("The Rampart Gymnasium, (affil. Rampart Coliseum).");
262     }
263     break;
264   case L_HEALER:
265     if (signp) {
266       print1("You notice a sign:");
267       print2("Rampart Healers. Member RMA.");
268     }
269     break;
270   case L_CASINO:
271     if (signp) {
272       print1("You notice a sign:");
273       print2("Rampart Mithril Nugget Casino.");
274     }
275     break;
276   case L_SEWER:
277     print1("A sewer entrance. You don't want to go down THERE, do you?");
278     break;
279   case L_COMMANDANT:
280     if (signp) {
281       print1("You notice a sign:");
282       print2("Commandant Sonder's Rampart-fried Lyzzard partes. Open 24 hrs.");
283     }
284     break;
285   case L_DINER:
286     if (signp) {
287       print1("You notice a sign:");
288       print2("The Rampart Diner. All you can eat, 25Au.");
289     }
290     break;
291   case L_CRAP:
292     if (signp) {
293       print1("You notice a sign:");
294       print2("Les Crapeuleaux. (****)");
295     }
296     break;
297   case L_TAVERN:
298     if (signp) {
299       print1("You notice a sign:");
300       print2("The Centaur and Nymph -- J. Riley, prop.");
301     }
302     break;
303   case L_ALCHEMIST:
304     if (signp) {
305       print1("You notice a sign:");
306       print2("Ambrosias' Potions et cie.");
307     }
308     break;
309   case L_DPW:
310     if (signp) {
311       print1("You notice a sign:");
312       print2("Rampart Department of Public Works.");
313     }
314     break;
315   case L_LIBRARY:
316     if (signp) {
317       print1("You notice a sign:");
318       print2("Rampart Public Library.");
319     }
320     break;
321   case L_CONDO:
322     if (signp) {
323       print1("You notice a sign:");
324       if (gamestatusp(SOLD_CONDO))
325 	print2("Home Sweet Home");
326       else print2("Luxury Condominium For Sale; Inquire Within");
327     }
328     break;
329   case L_PAWN_SHOP:
330     if (signp) {
331       print1("You notice a sign:");
332       print2("Knight's Pawn Shop.");
333     }
334     break;
335   case L_CEMETARY:
336     print1("You notice a sign:");
337     print2("Rampart City Cemetary. Closed -- Full.");
338     break;
339   case L_GARDEN:
340     print1("You notice a sign:");
341     print2("Rampart Botanical Gardens---Do not deface statues.");
342     break;
343   case L_JAIL:
344     print1("You notice a sign:");
345     print2("Rampart City Gaol -- always room for more.");
346     break;
347   case L_ORACLE:
348     print1("You notice a sign:");
349     print2("The Oracle of the Cyan Flames");
350     morewait();
351     break;
352   }
353 }
354 #endif
355