1 /* omega copyright (C) by Laurence Raphael Brothers, 1987,1988,1989 */
2 /* etc.c */
3 /* grab bag of random functions used in random places */
4
5 #include "glob.h"
6
7 /* there are various ways for the player to receive one of these hints */
hint()8 void hint()
9 {
10 switch(random_range(96)) {
11 case 0:mprint("There is an entrance to the sewers in the Garden.");break;
12 case 1:mprint("Statues can be dangerous.");break;
13 case 2:mprint("Unidentified Artifacts can be dangerous.");break;
14 case 3:mprint("The higher form of mercury is desirable.");break;
15 case 4:mprint("A sense of unease is a good thing to have.");break;
16 case 5:mprint("If you dig too much, you might cause a cave-in!");break;
17 case 6:mprint("Be Lawful: Live and Let Live.");break;
18 case 7:mprint("Be Chaotic: Live and Let Die."); break;
19 case 8:mprint("The world doesn't slow down; you speed up.");break;
20 case 9:mprint("Security is a sense of dislocation.");break;
21 case 10:mprint("Tullimore Dew is a panacea.");break;
22 case 11:mprint("Thieves hide behind closed doors.");break;
23 case 12:mprint("`No jail is escapeproof' -- John Dillinger.");break;
24 case 13:mprint("Oh, to have an apartment of your own!");break;
25 case 14:mprint("Some homes have money and treasure.");break;
26 case 15:mprint("Some homes are defended.");break;
27 case 16:mprint("Sometimes you could just wish for Death."); break;
28 case 17:mprint("A cursed wish can be fatal.");break;
29 case 18:mprint("The way you play, you should wish for Skill."); break;
30 case 19:mprint("A druid might wish for Balance."); break;
31 case 20:mprint("Mages always wish for Knowledge.");break;
32 case 21:mprint("Some fairies are good.");break;
33 case 22:mprint("An affair with a demon can be heartbreaking."); break;
34 case 23:mprint("The Explorer's Club knows a useful spell."); break;
35 case 24:mprint("They say some famous people live in mansions."); break;
36 case 25:mprint("Magic pools are totally random."); break;
37 case 26:mprint("There are five elements, including Void."); break;
38 case 27:mprint("Humans can be good or evil, lawful or chaotic."); break;
39 case 28:mprint("There are many kinds of wishes. Case counts, you know.");
40 break;
41 case 29:mprint("There are caves due south of Rampart"); break;
42 case 30:mprint("Donaldson's Giants can withstand lava.");break;
43 case 31:mprint("Ritual magic can have many different effects.");break;
44 case 32:mprint("The Mercenaries are the best equipped fighters."); break;
45 case 33:mprint("The Gladiators are the most skilled fighters."); break;
46 case 34:mprint("Rent a flat and lose any bad stati you may have."); break;
47 case 35:mprint("Some junk may be worth a fortune if identified."); break;
48 case 36:mprint("Identify humans by talking to them."); break;
49 case 37:mprint("They say the Duke has a treasure trove."); break;
50 case 38:mprint("If you yield, your opponent will gain experience."); break;
51 case 39:mprint("The Dragon Lord lives in the Waste of Time."); break;
52 case 40:mprint("A full moon bodes well for the followers of Law."); break;
53 case 41:mprint("A new moon omens evil for the Law-abiding."); break;
54 case 42:mprint("Druids revere the half-moon."); break;
55 case 43:mprint("Most grot is useless."); break;
56 case 44:mprint("Cash can sometimes be found in the walls."); break;
57 case 45:mprint("Pointy weapons break often but dig better."); break;
58 case 46:mprint("The DREADED AQUAE MORTIS is invulnerable."); break;
59 case 47:mprint("There must be *some* reason to worship Destiny!"); break;
60 case 48:mprint("Kill a trifid? A puzzle! Try a saline solution!"); break;
61 case 49:mprint("Beware! The Eater of Souls inhabits the abyss!"); break;
62 case 50:mprint("They say there's a red-light district in town."); break;
63 case 51:mprint("The House of the Eclipse is behind a closed door."); break;
64 case 52:mprint("The Orbs may be encountered on the Astral Plane."); break;
65 case 53:mprint("The Champion should never refuse a challenge."); break;
66 case 54:mprint("They say that the autoteller program is buggy."); break;
67 case 55:mprint("It's better not to sleep on the ground."); break;
68 case 56:mprint("Try ritual magic in different kinds of rooms."); break;
69 case 57:mprint("Breaking down a wall by bashing it is a bad idea!"); break;
70 case 58:mprint("Follow the Oracle's advice; she is all-wise."); break;
71 case 59:mprint("The ArchDruid lives in the northern forest.");break;
72 case 60:mprint("A search of the mountains may reveal a secret pass.");break;
73 case 61:mprint("Star Peak is to the far North-East."); break;
74 case 62:mprint("The Archmage lives in the far North-West beyond a pass.");
75 break;
76 case 63:mprint("There is a volcano in the southern marshes."); break;
77 case 64:mprint("The Demon Emperor resides in the Volcano."); break;
78 case 65:mprint("The Lawgiver can be found at Star Peak."); break;
79 case 66:mprint("The Temple of Athena is to the North-East."); break;
80 case 67:mprint("The Temple of Set can be found in a desert.");break;
81 case 68:mprint("The Temple of Hecate is in the swamp."); break;
82 case 69:mprint("The Temple of Odin is to the South in some mountains.");
83 break;
84 case 70:mprint("There is a curious island off a promontory of the swamp.");
85 break;
86 case 71:mprint("The Eater of Magic can be found on an island.");break;
87 case 72:mprint("The Temple of Destiny is practically inaccessible.");break;
88 case 73:mprint("Each sect has its own main temple outside the city.");break;
89 case 74:mprint("The aligned temples are dangerous to unbelievers.");break;
90 case 75:mprint("If you are poor, maybe you should wish for Wealth.");break;
91 case 76:mprint("Need mana? Wish for Power.");break;
92 case 77:mprint("Wishing for Law, Balance, or Chaos alters alignment.");break;
93 case 78:mprint("Feeling out of sorts? Wish for Health.");break;
94 case 79:mprint("Challenge the abyss at the Temple of Destiny.");break;
95 case 80:mprint("The Circle of Sorcerors has an Astral HQ");break;
96 case 81:mprint("The Star Gem is the only way back from the Astral Plane.");
97 break;
98 case 82:mprint("The Star Gem is guarded by the Circle of Sorcerors.");break;
99 case 83:mprint("The Star Gem is rightfully the property of the LawBringer.");
100 break;
101 case 84:mprint("They say the Demon Emperor owns the Amulet of the Planes.");
102 break;
103 case 85:mprint("An Amulet might get you to the Temple of Destiny.");break;
104 case 86:mprint("A wish for Location might help you become Adept.");break;
105 case 87:mprint("Some Artifacts may be used only once per day.");break;
106 case 88:mprint("Overusing Artifacts can be a bad move."); break;
107 case 89:mprint("You might starve in the Swamp or the Mountains!");break;
108 case 90:mprint("You would have to be very chaotic to attack a guard!");break;
109 case 91:mprint("You would have to be very foolhardy to attack a guard!");
110 break;
111 case 92:mprint("Only a master of chaos would kill all the city guards!");
112 break;
113 case 93:mprint("The Order depends on the force of the LawGiver.");break;
114 case 94:mprint("City Guards are employees of the Order.");break;
115 case 95:mprint("Disenchanted Artifacts can be restored."); break;
116 }
117 }
118
119 /* for when a deity teaches spells to a devotee */
learnclericalspells(deity,level)120 void learnclericalspells(deity,level)
121 int deity,level;
122 {
123 mprint("With your new clerical rank comes knowledge of magic...");
124 Player.pow+=level;
125 Player.maxpow+=level;
126 switch(level) {
127 case LAY:
128 if (deity==ODIN)
129 Spells[S_MISSILE].known = TRUE;
130 else if (deity==SET)
131 Spells[S_INVISIBLE].known = TRUE;
132 else if (deity==ATHENA)
133 Spells[S_IDENTIFY].known = TRUE;
134 else if (deity==HECATE)
135 Spells[S_DRAIN].known = TRUE;
136 else if (deity==DRUID) {
137 Spells[S_KNOWLEDGE].known = TRUE;
138 Spells[S_MON_DET].known = TRUE;
139 }
140 break;
141 case ACOLYTE:
142 if (deity==ODIN) {
143 Spells[S_LBALL].known = TRUE;
144 Spells[S_TRUESIGHT].known = TRUE;
145 }
146 else if (deity==SET) {
147 Spells[S_SUMMON].known = TRUE;
148 Spells[S_FIREBOLT].known = TRUE;
149 }
150 else if (deity==ATHENA) {
151 Spells[S_HEAL].known = TRUE;
152 Spells[S_SANCTUARY].known = TRUE;
153 }
154 else if (deity==HECATE) {
155 Spells[S_SLEEP].known = TRUE;
156 Spells[S_DISPEL].known = TRUE;
157 }
158 else if (deity==DRUID) {
159 Spells[S_HEAL].known = TRUE;
160 Spells[S_CURE].known = TRUE;
161 }
162 else if (deity==DESTINY)
163 mprint("An acolyte of the Lords of Destiny. Gee whiz.");
164 break;
165 case PRIEST:
166 Spells[S_SANCTIFY].known = TRUE;
167 if (deity==ODIN) {
168 Spells[S_HERO].known = TRUE;
169 Spells[S_HEAL].known = TRUE;
170 }
171 else if (deity==SET) {
172 Spells[S_INVISIBLE].known = TRUE;
173 Spells[S_DISPEL].known = TRUE;
174 }
175 else if (deity==ATHENA) {
176 Spells[S_REGENERATE].known = TRUE;
177 Spells[S_ACCURACY].known = TRUE;
178 }
179 else if (deity==HECATE) {
180 Spells[S_SHADOWFORM].known = TRUE;
181 Spells[S_CURE].known = TRUE;
182 }
183 else if (deity==DRUID) {
184 Spells[S_DISRUPT].known = TRUE;
185 Spells[S_ALERT].known = TRUE;
186 Spells[S_CLAIRVOYANCE].known = TRUE;
187 }
188 else if (deity==DESTINY)
189 mprint("How useless, a new priest of the Lords of Destiny.");
190 break;
191 case SPRIEST:
192 Spells[S_BLESS].known = TRUE;
193 if (deity == ODIN)
194 Spells[S_ACCURACY].known = TRUE;
195 else if (deity == SET)
196 Spells[S_SHADOWFORM].known = TRUE;
197 else if (deity == ATHENA)
198 Spells[S_HERO].known = TRUE;
199 else if (deity == HECATE)
200 Spells[S_POLYMORPH].known = TRUE;
201 else if (deity == DRUID) {
202 Spells[S_POLYMORPH].known = TRUE;
203 Spells[S_LEVITATE].known = TRUE;
204 }
205 else if (deity == DESTINY)
206 mprint("Wow, a new senior priest of the Lords of Destiny.");
207 break;
208 case HIGHPRIEST:
209 if (deity == ODIN)
210 Spells[S_RESTORE].known = TRUE;
211 else if (deity == SET)
212 Spells[S_HELLFIRE].known = TRUE;
213 else if (deity == ATHENA)
214 Spells[S_HELLFIRE].known = TRUE;
215 else if (deity == HECATE)
216 Spells[S_DESECRATE].known = TRUE;
217 else if (deity == DRUID) {
218 Spells[S_DISINTEGRATE].known = TRUE;
219 Spells[S_HERO].known = TRUE;
220 }
221 else if (deity == DESTINY) {
222 mprint("So you're now the high priest of the Lords of Destiny.");
223 mprint("You didn't think you were going to get anything, did you?");
224 }
225 }
226 }
227
228 /* for the use of the casino slot machine */
slotstr(num)229 char *slotstr(num)
230 int num;
231 {
232 switch(num) {
233 case 0:
234 return("<Slime Mold>");
235 case 1:
236 return("<Lemon>");
237 case 2:
238 return("<Copper>");
239 case 3:
240 return("<Nymph>");
241 case 4:
242 return("<Sword>");
243 case 5:
244 return("<Shield>");
245 case 6:
246 return("<Chest>");
247 case 7:
248 return("<Bar>");
249 case 8:
250 return("<Orb>");
251 case 9:
252 return("<Mithril Nugget>");
253 }
254 return "Error - you should never see this...";
255 }
256
257 /* random names for various uses */
nameprint()258 char *nameprint()
259 {
260 switch(random_range(40)) {
261 case 0:strcpy(Str3,"Orion Splash");break;
262 case 1:strcpy(Str3,"Gorgar");break;
263 case 2:strcpy(Str3,"Hieronymous");break;
264 case 3:strcpy(Str3,"Quantifor Quotron");break;
265 case 4:strcpy(Str3,"Leon");break;
266 case 5:strcpy(Str3,"Joyce");break;
267 case 6:strcpy(Str3,"Leticia Smiley");break;
268 case 7:strcpy(Str3,"Ogilvy the Grim");break;
269 case 8:strcpy(Str3,"Salara Storn");break;
270 case 9:strcpy(Str3,"Murgo");break;
271 case 10:strcpy(Str3,"Jonathan Atwilder");break;
272 case 11:strcpy(Str3,"Xylos the Tan");break;
273 case 12:strcpy(Str3,"Terence");break;
274 case 13:strcpy(Str3,"Toronado");break;
275 case 14:strcpy(Str3,"Kelly");break;
276 case 15:strcpy(Str3,"Cantinflas");break;
277 case 16:strcpy(Str3,"Ixel");break;
278 case 17:strcpy(Str3,"Toto");break;
279 case 18:strcpy(Str3,"Frost");break;
280 case 19:strcpy(Str3,"Aliera Erinyes");break;
281 case 20:strcpy(Str3,"Godel");break;
282 case 21:strcpy(Str3,"Kerst Blackblade");break;
283 case 22:strcpy(Str3,"Ebenezer");break;
284 case 23:strcpy(Str3,"Jeremiah");break;
285 case 24:strcpy(Str3,"Triskelion Shadow");break;
286 case 25:strcpy(Str3,"Eleskir Eremar");break;
287 case 26:strcpy(Str3,"Tyron");break;
288 case 27:strcpy(Str3,"Morgon");break;
289 case 28:strcpy(Str3,"Achmed");break;
290 case 29:strcpy(Str3,"Chin");break;
291 case 30:strcpy(Str3,"Fujimoto");break;
292 case 31:strcpy(Str3,"Dos Santos");break;
293 case 32:strcpy(Str3,"Federico");break;
294 case 33:strcpy(Str3,"Jaime");break;
295 case 34:strcpy(Str3,"Siobhan");break;
296 case 35:strcpy(Str3,"Hans");break;
297 case 36:strcpy(Str3,"Gurkov");break;
298 case 37:strcpy(Str3,"Krilos the Slayer");break;
299 case 38:strcpy(Str3,"Oxxblud");break;
300 case 39:strcpy(Str3,"Dorian");break;
301 }
302 return(Str3);
303 }
304
305
306 /* returns english string equivalent of number */
wordnum(num)307 char *wordnum(num)
308 int num;
309 {
310 switch(num) {
311 case 0: return("zero ");
312 case 1: return("one ");
313 case 2: return("two ");
314 case 3: return("three ");
315 case 4: return("four ");
316 case 5: return("five ");
317 case 6: return("six ");
318 case 7: return("seven ");
319 case 8: return("eight ");
320 case 9: return("nine ");
321 case 10: return("ten ");
322 default: return("");
323 }
324 }
325