Blindfold removal fix
[slashemextended.git] / src / artifact.c
blob35a0cb7a93567ba96296063017ae3433a006172f
1 /* SCCS Id: @(#)artifact.c 3.4 2003/08/11 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 #include "hack.h"
6 #include "artifact.h"
7 #ifdef OVLB
8 #include "artilist.h"
9 struct artifact artilist[SIZE(artilist_pre)]; /* the master list of artifacts */
10 #else
11 STATIC_DCL struct artifact artilist_pre[];
12 struct artifact artilist[SIZE(artilist_pre)]; /* the master list of artifacts */
13 #endif
15 * Note: both artilist_pre[] and artiexist[] have a dummy element #0,
16 * so loops over them should normally start at #1. The primary
17 * exception is the save & restore code, which doesn't care about
18 * the contents, just the total size.
20 * Amy note: artifact_exists() is the function called when creating an artifact, strangely enough. If we want to add
21 * special code that runs upon the artifact's generation, such as extra-high charge counts for a lightsaber artifact,
22 * that is where we need to put it.
25 static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
26 static const char allowall[] = { ALL_CLASSES, 0 };
27 static const char allnoncount[] = { ALL_CLASSES, 0 };
29 extern boolean notonhead; /* for long worms */
31 #define get_artifact(o) \
32 (((o)&&(o)->oartifact) ? &artilist[(int) ((unsigned int) (o)->oartifact)] : 0)
33 /* big thanks to Chris, I'd never have found out that the "unsigned char" part would fix the bug where
34 * any artifacts after #127 were segfaulting and giving random effects instead of the desired ones... --Amy */
36 STATIC_DCL int spec_applies(const struct artifact *,struct monst *);
37 STATIC_DCL int spec_applies_number(const struct artifact *,struct monst *, struct obj *);
38 STATIC_DCL int arti_invoke(struct obj*);
39 STATIC_DCL boolean Mb_hit(struct monst *magr,struct monst *mdef,
40 struct obj *,int *,int,BOOLEAN_P,char *, int);
42 /* The amount added to the victim's total hit points to insure that the
43 victim will be killed even after damage bonus/penalty adjustments.
44 Most such penalties are small, and 200 is plenty; the exception is
45 half physical damage. 3.3.1 and previous versions tried to use a very
46 large number to account for this case; now, we just compute the fatal
47 damage by adding it to 2 times the total hit points instead of 1 time.
48 Note: this will still break if they have more than about half the number
49 of hit points that will fit in a 15 bit integer. */
50 #define FATAL_DAMAGE_MODIFIER 200
52 #ifndef OVLB
53 STATIC_DCL int spec_dbon_applies;
54 STATIC_DCL int artidisco[NROFARTIFACTS];
55 #else /* OVLB */
56 /* coordinate effects from spec_dbon() with messages in artifact_hit() */
57 STATIC_OVL int spec_dbon_applies = 0;
59 /* flags including which artifacts have already been created */
60 static boolean artiexist[1+NROFARTIFACTS+1];
61 /* and a discovery list for them (no dummy first entry here) */
63 STATIC_OVL int artidisco[NROFARTIFACTS];
65 STATIC_DCL void hack_artifacts(void);
66 STATIC_DCL boolean attacks(int,struct obj *);
69 STATIC_PTR void
70 do_terrainfloodP(x, y, poolcnt)
71 int x, y;
72 void * poolcnt;
74 register struct monst *mtmp;
75 register struct trap *ttmp;
76 int randomamount = 0;
77 int randomx, randomy;
78 if (!rn2(25)) randomamount += rnz(2);
79 if (!rn2(125)) randomamount += rnz(5);
80 if (!rn2(625)) randomamount += rnz(20);
81 if (!rn2(3125)) randomamount += rnz(50);
82 if (isaquarian) {
83 if (!rn2(25)) randomamount += rnz(2);
84 if (!rn2(125)) randomamount += rnz(5);
85 if (!rn2(625)) randomamount += rnz(20);
86 if (!rn2(3125)) randomamount += rnz(50);
89 if (In_sokoban(&u.uz) && rn2(5)) return;
91 while (randomamount) {
92 randomamount--;
93 randomx = rn1(COLNO-3,2);
94 randomy = rn2(ROWNO);
95 if (isok(randomx, randomy) && (levl[randomx][randomy].typ == ROOM || levl[randomx][randomy].typ == CORR) ) {
96 levl[randomx][randomy].typ = randomwalltype();
97 blockorunblock_point(randomx,randomy);
98 if (!(levl[randomx][randomy].wall_info & W_EASYGROWTH)) levl[randomx][randomy].wall_info |= W_HARDGROWTH;
99 del_engr_at(randomx, randomy);
101 if ((mtmp = m_at(randomx, randomy)) != 0) {
102 (void) minliquid(mtmp);
103 } else {
104 newsym(randomx,randomy);
110 if ((rn2(1 + distmin(u.ux, u.uy, x, y))) ||
111 (sobj_at(BOULDER, x, y)) || (levl[x][y].typ != ROOM && levl[x][y].typ != CORR))
112 return;
114 (*(int *)poolcnt)++;
116 if (!((*(int *)poolcnt) && (x == u.ux) && (y == u.uy))) {
117 /* Put a pool at x, y */
118 levl[x][y].typ = randomwalltype();
119 blockorunblock_point(x,y);
120 if (!(levl[x][y].wall_info & W_EASYGROWTH)) levl[x][y].wall_info |= W_HARDGROWTH;
121 del_engr_at(x, y);
123 if ((mtmp = m_at(x, y)) != 0) {
124 (void) minliquid(mtmp);
125 } else {
126 newsym(x,y);
128 } else if ((x == u.ux) && (y == u.uy)) {
129 (*(int *)poolcnt)--;
134 /** Remove water tile at x,y. */
135 STATIC_PTR void
136 undo_floodM(x, y, roomcnt)
137 int x, y;
138 void * roomcnt;
140 if ((levl[x][y].typ != POOL) &&
141 (levl[x][y].typ != MOAT) &&
142 (levl[x][y].typ != WATER) &&
143 (levl[x][y].typ != FOUNTAIN))
144 return;
146 (*(int *)roomcnt)++;
148 /* Get rid of a pool at x, y */
149 levl[x][y].typ = ROOM;
150 newsym(x,y);
153 void
154 elemental_imbue(elemtype)
155 int elemtype;
157 if (!uwep) return; /* bug */
159 switch (elemtype) {
160 case 1:
161 artilist[ART_FIRE_SWING].otyp = uwep->otyp;
162 break;
163 case 2:
164 artilist[ART_FROST_SWING].otyp = uwep->otyp;
165 break;
166 case 3:
167 artilist[ART_SHOCK_SWING].otyp = uwep->otyp;
168 break;
172 /* Amy change: reaching certain milestones allows specific artifacts to randomly generate from that point on
173 * this is done by removing the NOGEN flag from them; that change is saved into the savegame file */
174 void
175 de_energise_artifact(artinum)
176 int artinum;
178 artilist[artinum].spfx &= ~SPFX_NOGEN;
181 /* handle some special cases; must be called after role_init() */
182 STATIC_OVL void
183 hack_artifacts()
185 struct artifact *art;
186 int alignmnt = aligns[flags.initalign].value;
188 memcpy(artilist, artilist_pre, sizeof(artilist));
190 /* Fix up the alignments of "gift" artifacts */
191 for (art = artilist+1; art->otyp; art++) {
192 if (art->role == Role_switch && art->alignment != A_NONE)
193 art->alignment = alignmnt;
195 if (art->attk.adtyp > AD_PHYS && !(art->spfx & (SPFX_DBONUS | SPFX_ATTK)) ) {
196 impossible("BUG! artifact %s lacks SPFX_ATTK flag", art->name);
201 /* Excalibur can be used by any lawful character, not just knights */
202 if (!Role_if(PM_KNIGHT))
203 artilist[ART_EXCALIBUR].role = NON_PM;
205 init_randarts();
207 #if 0
208 /* Fix up the gifts */
209 if (urole.gift1arti) {
210 artilist[urole.gift1arti].alignment = alignmnt;
211 artilist[urole.gift1arti].role = Role_switch;
213 if (urole.gift2arti) {
214 artilist[urole.gift2arti].alignment = alignmnt;
215 artilist[urole.gift2arti].role = Role_switch;
217 #endif
218 /* Fix up the quest artifact */
219 if (urole.questarti) {
220 artilist[urole.questarti].alignment = alignmnt;
221 artilist[urole.questarti].role = Role_switch;
223 return;
226 void
227 init_randarts()
229 /* randarts - the code in this file is from dnethack (thanks Chris) with adaptations --Amy */
230 /* base item: LONG_SWORD = melee weapon, BOW = launcher, DART = missile, LEATHER_ARMOR = suit,
231 * VICTORIAN_UNDERWEAR = shirt, ORCISH_CLOAK = cloak, HELMET = helm, REGULAR_GLOVES = gloves,
232 * SHIELD = shield, LOW_BOOTS = boots, RIN_AGGRAVATE_MONSTER = ring, AMULET_OF_STRANGULATION = amulet,
233 * WAN_MAKE_INVISIBLE = wand, SPE_MAGICTORCH = spellbook */
235 artilist[ART_SOULCALIBUR].otyp = randartmeleeweapon();
236 artilist[ART_MOURNBLADE].otyp = randartmeleeweapon();
237 artilist[ART_NERF_BRAND].otyp = randartmeleeweapon();
238 artilist[ART_GRISGREN].otyp = randartmeleeweapon();
239 artilist[ART_POSTSCHEME_M].otyp = randartmeleeweapon();
240 artilist[ART_WINTERHOLD_S_KEEP].otyp = randartmeleeweapon();
241 artilist[ART_DAT_S_GOD].otyp = randartmeleeweapon();
242 artilist[ART_HER_UNREACHABLE_BROOK].otyp = randartmeleeweapon();
243 artilist[ART_KOPKILLER].otyp = randartmeleeweapon();
244 artilist[ART_THIS_TRENCH_WAR_HAS_BEEN_F].otyp = randartmeleeweapon();
245 artilist[ART_SKOGLO].otyp = randartmeleeweapon();
246 artilist[ART_UNDEADBANE].otyp = randartmeleeweapon();
247 artilist[ART_RAINBOWSWANDIR].otyp = randartmeleeweapon();
248 artilist[ART_MAGDALENA_S_CUDDLEWEAPON].otyp = randartmeleeweapon();
249 artilist[ART_WIZARDBANE].otyp = randartmeleeweapon();
250 artilist[ART_VORPAL_EDGE].otyp = randartmeleeweapon();
251 artilist[ART_FINAL_CONSEQUENCE].otyp = randartmeleeweapon();
252 artilist[ART_DARK_MAGIC].otyp = randartsuit();
253 artilist[ART_ENCHANTED__OF_DEFUSING].otyp = randartsuit();
254 artilist[ART_COMPLETE_ARMORING].otyp = randartsuit();
255 artilist[ART_RAND_ARM].otyp = randartsuit();
256 artilist[ART_HEART_INFACT].otyp = randartsuit();
257 artilist[ART_AMMY_S_WAIL].otyp = randartsuit();
258 artilist[ART_STAND_YOU_FORWARDS__THERE_].otyp = randartsuit();
259 artilist[ART_BEAM_CONTROL].otyp = randartmeleeweapon();
260 artilist[ART_SANDRA_S_SECRET_WEAPON].otyp = randartmeleeweapon();
261 artilist[ART_FINAL_DOOR_SOLUTION].otyp = randartmeleeweapon();
262 artilist[ART_DUMBOAK_S_HEW].otyp = randartmeleeweapon();
263 artilist[ART_POWER_AMMO].otyp = randartmissile();
264 artilist[ART_DARTHADART].otyp = randartmissile();
265 artilist[ART_MAGISTUS].otyp = randartmissile();
266 artilist[ART_PAUERED_BY_THE_CAP].otyp = randartmissile();
267 artilist[ART_DESSINTERGRATE].otyp = randartmissile();
268 artilist[ART_BLOBLOBLOBLOBLO].otyp = randartlauncher();
269 artilist[ART_SHENA_S_PANTY].otyp = randartlauncher();
270 artilist[ART_BUCK_SHOT].otyp = randartlauncher();
271 artilist[ART_PSCHIUDITT].otyp = randartlauncher();
272 artilist[ART_RATTATTATTATTATT].otyp = randartlauncher();
273 artilist[ART_FLAM_R].otyp = randartlauncher();
274 artilist[ART_SURESHOT].otyp = randartlauncher();
275 artilist[ART_STINGWING].otyp = randartmissile();
276 artilist[ART_PLEINLY].otyp = randartshirt();
277 artilist[ART_NOBILE_MOBILITY].otyp = randartshirt();
278 artilist[ART_ALL_IN_ONE_EFF].otyp = randartshirt();
279 artilist[ART_TILLMANN_S_TARGET].otyp = randartshirt();
280 artilist[ART_THEY_ALL_FEEL_FLEECY].otyp = randartshirt();
281 artilist[ART_ANTIMAGIC_FIELD].otyp = randartshirt();
282 artilist[ART_NATALIA_IS_LOVELY_BUT_DANG].otyp = randartshirt();
283 artilist[ART_TAPE_ARMAMENT].otyp = randartsuit();
284 artilist[ART_NARYA].otyp = randartring();
285 artilist[ART_SHARD_FROM_MORGOTH_S_CROWN].otyp = randartring();
286 artilist[ART_CATHAN_S_SIGIL].otyp = randartring();
287 artilist[ART_XANATHAR_S_RING_OF_PROOF].otyp = randartring();
288 artilist[ART_RING_OF_EVERYTHING_RESISTA].otyp = randartring();
289 artilist[ART_VERSION_CONTROL].otyp = randartring();
290 artilist[ART_FLEEING_MINE_MAIL].otyp = randartsuit();
291 artilist[ART_GREY_FUCKERY].otyp = randartsuit();
292 artilist[ART_LITTLE_PENIS_WANKER].otyp = randartsuit();
293 artilist[ART_D_TYPE_EQUIPMENT].otyp = randartsuit();
294 artilist[ART_INCREDIBLE_SWEETNESS].otyp = randartsuit();
295 artilist[ART_QUEEN_ARTICUNO_S_HULL].otyp = randartsuit();
296 artilist[ART_IT_POWER_KNOEPP].otyp = randartsuit();
297 artilist[ART_DON_SUICUNE_USED_SELFDESTR].otyp = randartsuit();
298 artilist[ART_WONDERCLOAK].otyp = randartcloak();
299 artilist[ART_WHISPERWIND_CLOAK].otyp = randartcloak();
300 artilist[ART_GLAE].otyp = randartmeleeweapon();
301 artilist[ART_FIRM_TOP].otyp = randartcloak();
302 artilist[ART_SHROUD].otyp = randartcloak();
303 artilist[ART_PREIM_OH].otyp = randartcloak();
304 artilist[ART_LIBRARY_HIDING].otyp = randartcloak();
305 artilist[ART_BAMSEL_IN_THE_WAY].otyp = randartcloak();
306 artilist[ART_EVELINE_S_CIVIL_MANTLE].otyp = randartcloak();
307 artilist[ART_INA_S_OVERCOAT].otyp = randartcloak();
308 artilist[ART_GROUNDBUMMER].otyp = randartcloak();
309 artilist[ART_RITA_S_LOVELY_OVERGARMENT].otyp = randartcloak();
310 artilist[ART_LUNAR_ECLIPSE_TONIGHT].otyp = randartcloak();
311 artilist[ART_FONEUZIK].otyp = randarthelm();
312 artilist[ART_TEJUS__VACANCY].otyp = randarthelm();
313 artilist[ART_SAGE_S_HELM].otyp = randarthelm();
314 artilist[ART_LORSKEL_S_SPEED].otyp = randarthelm();
315 artilist[ART_HEAD_W].otyp = randarthelm();
316 artilist[ART_EFFICIENT_SHARING].otyp = randarthelm();
317 artilist[ART_NUTRITION_AND_DIETETICS].otyp = randarthelm();
318 artilist[ART_COMPLETE_SIGHT].otyp = randarthelm();
319 artilist[ART_SUK_ME_HAHAHAHAHAH].otyp = randarthelm();
320 artilist[ART_TEN_MINUTES_COLDER].otyp = randarthelm();
321 artilist[ART_KAWA_JUR_FES].otyp = randarthelm();
322 artilist[ART____DOT__ALIEN_RADIO].otyp = randarthelm();
323 artilist[ART_NADJA_S_DARKNESS_GENERATOR].otyp = randarthelm();
324 artilist[ART_THA_WALL].otyp = randartsuit();
325 artilist[ART_LLLLLLLLLLLLLM].otyp = randarthelm();
326 artilist[ART_SPELLSNIPE].otyp = randartgloves();
327 artilist[ART_REAL_FORCE].otyp = randartgloves();
328 artilist[ART_RED_CORDS_OF_ILMATER].otyp = randartgloves();
329 artilist[ART_MELUGAS_ROCKET].otyp = randartgloves();
330 artilist[ART_ARABELLA_S_GREAT_BANISHER].otyp = randartgloves();
331 artilist[ART_KROL_GR].otyp = randartgloves();
332 artilist[ART_A_LITTLE_SUGAR].otyp = randartgloves();
333 artilist[ART_TARTSCH].otyp = randartshield();
334 artilist[ART_SHIELD_OF_THORN].otyp = randartshield();
335 artilist[ART_NO_FUTURE_BUT_AGONY].otyp = randartshield();
336 artilist[ART_OF_VOIDING].otyp = randartshield();
337 artilist[ART_THERMO_NUCLEAR_CHAMBER].otyp = randartshield();
338 artilist[ART_FLUIDSHIELD].otyp = randartshield();
339 artilist[ART_BONUS_HOLD].otyp = randartshield();
340 artilist[ART_GREXIT_IS_NEAR].otyp = randartshield();
341 artilist[ART_REAL_MEN_WEAR_PSYCHOS].otyp = randartshield();
342 artilist[ART_AMYBSOD_S_NEW_FOOTWEAR].otyp = randartboots();
343 artilist[ART_FLYGEL_BOOTS].otyp = randartboots();
344 artilist[ART_HIGHWAY_HUNTER].otyp = randartboots();
345 artilist[ART_MANUELA_S_UNKNOWN_HEELS].otyp = randartboots();
346 artilist[ART_HADES_THE_MEANIE].otyp = randartboots();
347 artilist[ART_AMY_LOVES_AUTOCURSING_ITEM].otyp = randartboots();
348 artilist[ART_BS_____].otyp = randartboots();
349 artilist[ART_ALLYNONE].otyp = randartboots();
350 artilist[ART_KHOR_S_REQUIRED_IDEA].otyp = randartboots();
351 artilist[ART_ERROR_IN_PLAY_ENCHANTMENT].otyp = randartboots();
352 artilist[ART_WHOA_HOLD_ON_DUDE].otyp = randartring();
353 artilist[ART_PALMIA_PRIDE].otyp = randartring();
354 artilist[ART_MAXIMUM_SHUTLOCK].otyp = randartring();
355 artilist[ART_ACHROMANTIC_RING].otyp = randartring();
356 artilist[ART_GOLDENIVY_S_ENGAGEMENT_RIN].otyp = randartring();
357 artilist[ART_TYRANITAR_S_OWN_GAME].otyp = randartamulet();
358 artilist[ART_PURPLE_ARBALEST].otyp = randartamulet();
359 artilist[ART_BEGGER_S_PENDANT].otyp = randartamulet();
360 artilist[ART_ONE_MOMENT_IN_TIME].otyp = randartamulet();
361 artilist[ART_BUEING].otyp = randartamulet();
362 artilist[ART_NAZGUL_S_REVENGE].otyp = randartamulet();
363 artilist[ART_HARRY_S_BLACKTHORN_WAND].otyp = randartwand();
364 artilist[ART_VIVARIUM_STICK].otyp = randartwand();
365 artilist[ART_PROFESSOR_SNAPE_S_DILDO].otyp = randartwand();
366 artilist[ART_FRENCH_MAGICAL_DEVICE].otyp = randartwand();
367 artilist[ART_SAGGITTII].otyp = randartmissile();
368 artilist[ART_BENTSHOT].otyp = randartlauncher();
369 artilist[ART_JELLYWHACK].otyp = randartmeleeweapon();
370 artilist[ART_SKODIT].otyp = randartmeleeweapon();
371 artilist[ART_ONE_THROUGH_FOUR_SCEPTER].otyp = randartmeleeweapon();
372 artilist[ART_AL_CANONE].otyp = randartlauncher();
373 artilist[ART_VEIL_OF_MINISTRY].otyp = randartcloak();
374 artilist[ART_ZANKAI_HUNG_ZE_TUNG_DO_HAI].otyp = randartmeleeweapon();
375 artilist[ART_AWKWARDNESS].otyp = randartmeleeweapon();
376 artilist[ART_SCHWANZUS_LANGUS].otyp = randartmeleeweapon();
377 artilist[ART_TRAP_DUNGEON_OF_SHAMBHALA].otyp = randartshirt();
378 artilist[ART_ZERO_PERCENT_FAILURE].otyp = randarthelm();
379 artilist[ART_RULE_CONFORMING_SCHWANZLUT].otyp = randarthelm();
380 artilist[ART_HENRIETTA_S_HEAVY_CASTER].otyp = randartcloak();
381 artilist[ART_ROFLCOPTER_WEB].otyp = randartsuit();
382 artilist[ART_SHIVANHUNTER_S_UNUSED_PRIZ].otyp = randartsuit();
383 artilist[ART_ARABELLA_S_ARTIFACT_CREATI].otyp = randartmeleeweapon();
384 artilist[ART_VERSUS_ELECTRICALLY_BASED_].otyp = randartmeleeweapon();
385 artilist[ART_ULTRA_ANNOYANCE].otyp = randartpolearm();
386 artilist[ART_CHATGPT_S_FREEZE].otyp = randartpolearm();
387 artilist[ART_THUNDERING_GLAIVE].otyp = randartpolearm();
388 artilist[ART_FROSTBITE_PIKE].otyp = randartpolearm();
389 artilist[ART_FINALLY__A_USABLE_POLEARM_].otyp = randartpolearm();
390 artilist[ART_TOTAL_GAUCHE].otyp = randartdagger();
391 artilist[ART_ETHER_DAGGER].otyp = randartdagger();
392 artilist[ART_HELICOPTER_TWIRL].otyp = randartquarterstaff();
393 artilist[ART_SHIVERING_STAFF].otyp = randartquarterstaff();
394 artilist[ART_HYSTERESIS_X].otyp = randartquarterstaff();
395 artilist[ART_CASTOR_BOOST].otyp = randartquarterstaff();
396 artilist[ART_GARBAGE_STAFF].otyp = randartquarterstaff();
397 artilist[ART_WHY_DOES_THE_GAME_GENERATE].otyp = randartquarterstaff();
398 artilist[ART_CUTRELEASE].otyp = randartknife();
399 artilist[ART_KNIFE_EM].otyp = randartknife();
400 artilist[ART_GIVE_CRAP_A_BAD_NAME].otyp = randartknife();
401 artilist[ART_TIARA_OF_AMNESIA].otyp = randarthelm();
402 artilist[ART_FLUE_FLUE_FLUEFLUE_FLUE].otyp = randarthelm();
403 artilist[ART_LIXERTYPIE].otyp = randartmeleeweapon();
404 artilist[ART_SAMENESS_OF_CHRIS].otyp = randartmeleeweapon();
405 artilist[ART_DONALD_TRUMP_S_RAGE].otyp = randartmeleeweapon();
406 artilist[ART_PRICK_PASS].otyp = randartmeleeweapon();
407 artilist[ART_THRANDUIL_LOSSEHELIN].otyp = randartmeleeweapon();
408 artilist[ART_FEANARO_SINGOLLO].otyp = randartmeleeweapon();
409 artilist[ART_WINSETT_S_BIG_DADDY].otyp = randartlauncher();
410 artilist[ART_FEMINIST_GIRL_S_PURPLE_WEA].otyp = randartshirt();
411 artilist[ART_LEA_S_SPOKESWOMAN_UNIFORM].otyp = randartcloak();
412 artilist[ART_HERETICAL_FIGURE].otyp = randartcloak();
413 artilist[ART_JANA_S_SECRET_CAR].otyp = randartcloak();
414 artilist[ART_UNIMPLEMENTED_FEATURE].otyp = randarthelm();
415 artilist[ART_FLAT_INSANITY].otyp = randarthelm();
416 artilist[ART_FREEZE_OR_YES].otyp = randartgloves();
417 artilist[ART_PRINCESS_BITCH].otyp = randartgloves();
418 artilist[ART_WOULD_YOU_RAIGHT_THAT].otyp = randartgloves();
419 artilist[ART_DIFFICULTY__].otyp = randartgloves();
420 artilist[ART_SWARM_SOFT_HIGH_HEELS].otyp = randartboots();
421 artilist[ART_WEAK_FROM_HUNGER].otyp = randartboots();
422 artilist[ART_ARABELLA_S_RESIST_COLD].otyp = randartring();
423 artilist[ART_RATSCH_WATSCH].otyp = randartamulet();
424 artilist[ART_ARABELLA_S_PRECIOUS_GADGET].otyp = randartamulet();
425 artilist[ART_ARABELLA_S_WARDING_HOE].otyp = randartmeleeweapon();
426 artilist[ART_SHAPETAKE_NUMBER_FIVE].otyp = randartcloak();
427 artilist[ART_ARABELLA_S_WAND_BOOSTER].otyp = randartcloak();
428 artilist[ART_INTELLIGENT_POPE].otyp = randartlauncher();
429 artilist[ART_RNG_S_PRIDE].otyp = randartsuit();
430 artilist[ART_RNG_S_JOY].otyp = randartgloves();
431 artilist[ART_RNG_S_SEXINESS].otyp = randartboots();
432 artilist[ART_RNG_S_EMBRACE].otyp = randartcloak();
433 artilist[ART_RNG_S_GRIMACE].otyp = randarthelm();
434 artilist[ART_COMPLETE_MON_DIEU].otyp = randartspellbook();
435 artilist[ART_AGATHE_BAUER].otyp = randartspellbook();
436 artilist[ART_ANNELIESE_BROWN].otyp = randartspellbook();
437 artilist[ART_I_WILL_THINK_ABOUT_YOU].otyp = randartspellbook();
438 artilist[ART_DEL_OLELONG].otyp = randartspellbook();
439 artilist[ART_JUBELJUBIJEEAH].otyp = randartspellbook();
440 artilist[ART_DUEDELDUEDELDUEDELDUEDELDU].otyp = randartspellbook();
441 artilist[ART_CAUSE_I_M_A_CHEATER].otyp = randartspellbook();
442 artilist[ART_BATMAN_NIGHT].otyp = randartspellbook();
443 artilist[ART_NIKKENIKKENIK].otyp = randartspellbook();
444 artilist[ART_POLITICAL_CORRECTNESS_FOR_].otyp = randartspellbook();
445 artilist[ART_DOWNDRIVE].otyp = randartimplant();
446 artilist[ART_CORTEX_COPROCESSOR].otyp = randartimplant();
447 artilist[ART_ND___NND_D___NDMD__DM_D_D_].otyp = randartimplant();
448 artilist[ART_ARABELLA_S_EXCHANGER].otyp = randartimplant();
449 artilist[ART_SYMPLANT].otyp = randartimplant();
450 artilist[ART_MAXHIT_BOOST].otyp = randartimplant();
451 artilist[ART_AMULET_OF_SPLENDOR].otyp = randartamulet();
452 artilist[ART_FASTPLANT].otyp = randartimplant();
453 artilist[ART_IRON_OF_INNERMOST_JOY].otyp = randartimplant();
454 artilist[ART_UPSIDE_DOWN_PLAYING_CARD].otyp = randartscroll();
455 artilist[ART_BERRYBREW].otyp = randartpotion();
456 artilist[ART_CURSED_WITH_THE_WORST].otyp = randartbadgraystone();
457 artilist[ART_ONE_IN_FOUR].otyp = randartbadgraystone();
458 artilist[ART_HAVE_IT_ALL_BUT_NOT_GET].otyp = randartbadgraystone();
459 artilist[ART_DOUBLESHELL].otyp = randartfeminismjewel();
460 artilist[ART_HOW_LONG_LASTS_IT_].otyp = randartfeminismjewel();
461 artilist[ART_FEMITY_SOLVE].otyp = randartfeminismjewel();
462 artilist[ART_MINIMAL_MINI_ME].otyp = randartfeminismjewel();
463 artilist[ART_NOT_GONNA_CONTAMINATE].otyp = randartfeminismjewel();
464 artilist[ART_JYL__NOT_XLATED_CALL_KEN].otyp = randartfeminismjewel();
465 artilist[ART_QUE_TANGHERISONJA].otyp = randartfeminismjewel();
466 artilist[ART_PHILOSOPHER_S_STONE].otyp = randartfeminismjewel();
467 artilist[ART_VAPER_BAPER].otyp = randartball();
468 artilist[ART_ICED_OUT_COMPUTER_ON_A_CHA].otyp = randartball();
469 artilist[ART_DOCKEM_GOOD].otyp = randartball();
470 artilist[ART_ARABELLA_S_THINNER].otyp = randartball();
471 artilist[ART_YES_OCCIFER].otyp = randartchain();
472 artilist[ART_STREEEEEAM].otyp = randartchain();
473 artilist[ART_DON_T_GO_AWAY].otyp = randartchain();
474 artilist[ART_TSCHEND_FOR_ETERNITY].otyp = randartchain();
475 artilist[ART_CHAINS_OF_MALCANTHET].otyp = randartchain();
476 artilist[ART_MACHINE_THAT_GOES_PLING].otyp = randartgem();
477 artilist[ART_COCKBANGER_ARMOR].otyp = randartsuit();
478 artilist[ART_TAVION_S_CHARGE].otyp = randartlightsaber();
479 artilist[ART_LORD_SIDIOUS__SECRET_WEAPO].otyp = randartlightsaber();
480 artilist[ART_FOR_STYGWYR_].otyp = randartlightsaber();
481 artilist[ART_LIGHT_____STATED_].otyp = randartlightsaber();
482 artilist[ART_OWENER].otyp = randartlightsaber();
483 artilist[ART_CHARGING_MADE_EASY].otyp = randartlightsaber();
484 artilist[ART_THAIFORCE].otyp = randartlightsaber();
485 artilist[ART_HALF_SUPER_ENCHANTMENT].otyp = randartlightsaber();
486 artilist[ART_WEDIFORCE].otyp = randartvenom();
487 artilist[ART_RIDGET_PHASTO].otyp = randartvenom();
488 artilist[ART_ACIDFALL].otyp = randartlongsword();
489 artilist[ART_FLYING_DRAGON_SWORD].otyp = randartlongsword();
490 artilist[ART_SILVER_SKY].otyp = randartlongsword();
491 artilist[ART_AVENGER].otyp = randartlongsword();
492 artilist[ART_SINGING_SWORD].otyp = randartlongsword();
493 artilist[ART_ACIDIRGE].otyp = randartlongsword();
494 artilist[ART_ITAK_HONE].otyp = randartlongsword();
495 artilist[ART_AVALON].otyp = randartscimitar();
496 artilist[ART_PIRATTERY].otyp = randartscimitar();
497 artilist[ART_WORSE_CARNWENNAN].otyp = randartknife();
498 artilist[ART_SEAFOAM].otyp = randarttrident();
499 artilist[ART_UNLIMITED_MOON].otyp = randartflail();
500 artilist[ART_DISMOUNTER].otyp = randartlance();
501 artilist[ART_PHOENIX_LANCE].otyp = randartlance();
502 artilist[ART_FINAL_DEATH].otyp = randartwhip();
503 artilist[ART_MANEATER].otyp = randartshortsword();
504 artilist[ART_DIABLO_S_COLD_SMACKAGE].otyp = randartshortsword();
505 artilist[ART_SKULL_SWORD].otyp = randartshortsword();
506 artilist[ART_UNATTAINABLE_NINETEEN].otyp = randartshortsword();
507 artilist[ART_GNOLLBANE].otyp = randarthammer();
508 artilist[ART_HAMMA_HAMMA].otyp = randarthammer();
509 artilist[ART_EMMA_S_SYMPATHY].otyp = randarthammer();
510 artilist[ART_EMERALD_SWORD].otyp = randarttwohandedsword();
511 artilist[ART_BRUTISH_CLAYMORE].otyp = randarttwohandedsword();
512 artilist[ART_AMALGAMATED_SKIES].otyp = randarttwohandedsword();
513 artilist[ART_ATLANTEAN_ROYAL_SWORD].otyp = randarttwohandedsword();
514 artilist[ART_CELESTIAL_SCEPTRE].otyp = randartmace();
515 artilist[ART_SMASHIN].otyp = randartmace();
516 artilist[ART_INDOBURDENIA_VIRII].otyp = randartmace();
517 artilist[ART_KLOEB].otyp = randartclub();
518 artilist[ART_BLOOD_MOON].otyp = randartclub();
519 artilist[ART_NOOBY_BONUS_STYLE].otyp = randartaxe();
520 artilist[ART_SEA_ANGERANCHOR].otyp = randartaxe();
521 artilist[ART_HAKUNA_MAALUM].otyp = randartspear();
522 artilist[ART_HOLYBASHER].otyp = randartflail();
523 artilist[ART_RAISING_HEART].otyp = randartquarterstaff();
524 artilist[ART_PSI_STAFF].otyp = randartquarterstaff();
525 artilist[ART_LANCE_ARMSTRONG].otyp = randartlance();
526 artilist[ART_GOLIATHBANE].otyp = randartsling();
527 artilist[ART_VITRIOL_FROM_THE_LAB].otyp = randartsling();
528 artilist[ART_FIREBIRD].otyp = randartboomerang();
529 artilist[ART_STEAMBRINGER].otyp = randartbroadsword();
530 artilist[ART_SKY_REFLECTED].otyp = randartbroadsword();
531 artilist[ART_PENDULUM_OF_BALANCE].otyp = randartmace();
532 artilist[ART_BLOODY_MACE].otyp = randartmace();
533 artilist[ART_POLAR_STAR].otyp = randartmorningstar();
534 artilist[ART_PARRYINGSTAFF].otyp = randartquarterstaff();
535 artilist[ART_STONEBITER].otyp = randartpickaxe();
536 artilist[ART_Y_SWORD].otyp = randartpickaxe();
537 artilist[ART_HIBERNIA_SKIRIMI].otyp = randartpickaxe();
538 artilist[ART_TSCHUEUU].otyp = randartcrossbow();
539 artilist[ART_PIN_EM_ONCE].otyp = randartcrossbow();
540 artilist[ART_SOUTHERN_CROSS].otyp = randartcrossbow();
541 artilist[ART_SNATCHER].otyp = randartshortsword();
542 artilist[ART_LUX_REGINA].otyp = randartflail();
543 artilist[ART_REGINA_LUX].otyp = randartmorningstar();
544 artilist[ART_HARPOON_OF_TRITON].otyp = randarttrident();
545 artilist[ART_MERCILESS_MARE].otyp = randartunihorn();
546 artilist[ART_CURE_GOOD].otyp = randartunihorn();
547 artilist[ART_ENRAI].otyp = randartpolearm();
548 artilist[ART_PRINCIPIUM_INCERTI].otyp = randartpolearm();
549 artilist[ART_BOW_OF_HERCULES].otyp = randartbow();
550 artilist[ART_BIBLICAL_PLAGUE].otyp = randartbow();
551 artilist[ART_DOLORES__WINNING_STRAT].otyp = randartbow();
552 artilist[ART_GRADIUS].otyp = randartshortsword();
553 artilist[ART_U_TSCHELLI].otyp = randartpaddle();
554 artilist[ART_ZURA_S_DRESSCODE].otyp = randartrobe();
555 artilist[ART_ALTADOON_HERMA_MORA].otyp = randartrobe();
556 artilist[ART_ETERNAL_BAMMELING].otyp = randartrobe();
557 artilist[ART_VIHAT_BAGUETTEN_BUS_STOP].otyp = randartclaw();
558 artilist[ART_UT_RULER].otyp = randartsaber();
559 artilist[ART_BREAD_FOR_THE_WORLD].otyp = randartgrinder();
560 artilist[ART_MANABOOST].otyp = randartorb();
561 artilist[ART_STEEL_ON_STEEL].otyp = randartknuckles();
562 artilist[ART_FIVEONPIN].otyp = randartcrossbowbolt();
563 artilist[ART_D____].otyp = randartarrow();
564 artilist[ART_BE_CONSERVED].otyp = randartdart();
565 artilist[ART_COB_AUTO].otyp = randartdart();
566 artilist[ART_AMHIMITL].otyp = randartjavelin();
567 artilist[ART_REGROWN_RESOURCE].otyp = randartjavelin();
568 artilist[ART_NINJINGY].otyp = randartshuriken();
569 artilist[ART_LET_IT_STAY].otyp = randartdragonscales();
570 artilist[ART_KRAH_HOOOOO].otyp = randartdragonscales();
571 artilist[ART_ICE_FROM_THE_NORTH].otyp = randartdragonscales();
572 artilist[ART_PROTPOW].otyp = randartdragonscalemail();
573 artilist[ART_HA_MONK].otyp = randartdragonscalemail();
574 artilist[ART_CUDDLE_CHALLENGE].otyp = randartdragonscalemail();
575 artilist[ART_PRISMATIC_DRAGON_PLATE].otyp = randartdragonscalemail();
576 artilist[ART_POFFGO].otyp = randartdragonscaleshield();
577 artilist[ART_IT_IS_COMPLETE_NOW].otyp = randartdragonscaleshield();
578 artilist[ART_FROM_MASHHAD_TO_AHVAZ].otyp = randartdragonscaleshield();
579 artilist[ART_DIG__OF_COURSE].otyp = randartmattock();
580 artilist[ART_ZIN_BA].otyp = randartsaddle();
581 artilist[ART_INFINITE_RANGE].otyp = randartleash();
583 artilist[ART_JANA_S_GRAVE_WALL].otyp = randartcloakX();
584 artilist[ART_CLOAK_OF_THE_UNHELD_POTATO].otyp = randartcloakX();
585 artilist[ART_UNBINDALL_CHEAT].otyp = randartcloakX();
586 artilist[ART_FIND_ME_NEVERTHELESS].otyp = randartcloakX();
587 artilist[ART_OLD_PERSON_TALK].otyp = randartcloakX();
588 artilist[ART_HENRIETTA_S_DOGSHIT_BOOTS].otyp = randartbootsX();
589 artilist[ART_GRAVE_ROUSE].otyp = randartbootsX();
590 artilist[ART_FANNY_S_BROOK_THAT_YOU_MIS].otyp = randartbootsX();
591 artilist[ART_IDEAL_BASE].otyp = randartbootsX();
592 artilist[ART_DAT_NIGGA_S_GOT_DA_BLING].otyp = randartbootsX();
593 artilist[ART_BUGBOOTS_OF_ERRORNESS].otyp = randartbootsX();
594 artilist[ART_I_DON_T_PARTICULARLY_LIKE_].otyp = randartbootsX();
595 artilist[ART_HOHO_DINGO].otyp = randartbootsX();
596 artilist[ART_HIGHWAY_FIGHTER].otyp = randartbootsX();
597 artilist[ART_SESDERIRO].otyp = randartmeleeweaponX();
598 artilist[ART_ABSURD_OVERPOWEREDNESS].otyp = randartmeleeweaponX();
599 artilist[ART_CHRISTIAN_SKY].otyp = randartmeleeweaponX();
600 artilist[ART_POTATO_SKY].otyp = randartmeleeweaponX();
601 artilist[ART_IGTOS_CORP__INC_].otyp = randartmeleeweaponX();
602 artilist[ART_FOOTPRINTS_IN_THE_LABYRINT].otyp = randartmeleeweaponX();
603 artilist[ART_GLELDRERAL].otyp = randartmeleeweaponX();
604 artilist[ART_FIREPROOF_WALL].otyp = randartmeleeweaponX();
605 artilist[ART_KHALIM_S_FEMUR].otyp = randartmeleeweaponX();
606 artilist[ART_SPEARBLADE].otyp = randartmeleeweaponX();
607 artilist[ART_EWW_THAT_S_DISGUSTING].otyp = randartmeleeweaponX();
608 artilist[ART_GENDERGENDERGENDER].otyp = randartmeleeweaponX();
609 artilist[ART_GALLOW_DIGS].otyp = randartmeleeweaponX();
610 artilist[ART_RADIATOR_AREA].otyp = randartmeleeweaponX();
611 artilist[ART_JESSICA_S_WINNING_STRIKE].otyp = randartmeleeweaponX();
612 artilist[ART_MARKUS_S_JUSTICE].otyp = randartmeleeweaponX();
613 artilist[ART_KATHARINA_S_MELEE_PROWESS].otyp = randartmeleeweaponX();
614 artilist[ART_LICHBANE].otyp = randartmeleeweaponX();
615 artilist[ART_FORKED_TONGUE].otyp = randartmeleeweaponX();
616 artilist[ART_PROOFINGNESS_POOFS].otyp = randartmeleeweaponX();
617 artilist[ART_ALL_SERIOUSNESS].otyp = randartmeleeweaponX();
618 artilist[ART_KRONSCH_ZADROER_WOFF].otyp = randartmeleeweaponX();
619 artilist[ART_SPECIAL_LACK].otyp = randartmeleeweaponX();
620 artilist[ART_WING_WING].otyp = randartmeleeweaponX();
621 artilist[ART_CARMOUFALSCH].otyp = randartspellbookX();
622 artilist[ART_WIE_ES_AUCH_SEI].otyp = randartspellbookX();
623 artilist[ART_MORTON_THEIRS_OF_RAVEL_RAD].otyp = randartspellbookX();
624 artilist[ART_DEEP_FRIENDS].otyp = randartspellbookX();
625 artilist[ART_HAE_HAE_HIIII].otyp = randartspellbookX();
626 artilist[ART_FOR_MOMMY_EVER_FORSELESSAU].otyp = randartspellbookX();
627 artilist[ART_LAWFIRE].otyp = randartspellbookX();
628 artilist[ART_WAE_WAE_WAE_DAEDELDAEDELDA].otyp = randartspellbookX();
629 artilist[ART_PRESIDENT_SCHIESSKANISTA].otyp = randartspellbookX();
630 artilist[ART_KNBLOELOELOELODRIO].otyp = randartspellbookX();
631 artilist[ART_DESERT_MAID].otyp = randartmeleeweaponX();
632 artilist[ART_CYGNISWAN].otyp = randartmeleeweaponX();
633 artilist[ART_TALKATOR].otyp = randartmeleeweaponX();
634 artilist[ART_TRISMAGISTUS].otyp = randartmissileX();
635 artilist[ART_MAGESOOZE].otyp = randartmeleeweaponX();
636 artilist[ART_RESISTANT_RESISTOR].otyp = randartmeleeweaponX();
637 artilist[ART_VERNON_S_POTTERBASHER].otyp = randartmeleeweaponX();
638 artilist[ART_SCHWOINGELOINGELOING_OOOAR].otyp = randartmeleeweaponX();
639 artilist[ART_GONDOLIN_S_HIDDEN_PASSAGE].otyp = randartmeleeweaponX();
640 artilist[ART_FEMMY_S_LASH].otyp = randartmeleeweaponX();
641 artilist[ART_CASQUE_OUTLOOK].otyp = randartmeleeweaponX();
642 artilist[ART_UNFAIR_PEE].otyp = randartmeleeweaponX();
643 artilist[ART_SEA_CAPTAIN_PIERCER].otyp = randartmeleeweaponX();
644 artilist[ART_END_OF_LOOK_WORSE].otyp = randartmeleeweaponX();
645 artilist[ART_SPACE_BEGINS_AFTER_HERE].otyp = randartmeleeweaponX();
646 artilist[ART_CORINA_S_THUNDER].otyp = randartmeleeweaponX();
647 artilist[ART_INNER_TUBE].otyp = randartmeleeweaponX();
648 artilist[ART_SOLO_SLACKER].otyp = randartlauncherX();
649 artilist[ART_SCENTFUL_PANTY].otyp = randartlauncherX();
650 artilist[ART_AMMO_OF_THE_MACHINE].otyp = randartmissileX();
651 artilist[ART_STREW_ANYWHERE].otyp = randartmissileX();
652 artilist[ART_PIERCETHROUGH].otyp = randartmissileX();
653 artilist[ART_DAE_OE_OE_OE_OE_OE].otyp = randartlauncherX();
654 artilist[ART_CANNONEER].otyp = randartlauncherX();
655 artilist[ART_SPEEDHACK].otyp = randartlauncherX();
656 artilist[ART_RAYSWANDIR].otyp = randartquarterstaffX();
657 artilist[ART_STAFF_OF_INSANITY].otyp = randartquarterstaffX();
658 artilist[ART_ELEMENTAL_STAFF].otyp = randartquarterstaffX();
659 artilist[ART_FRISIA_S_TAIL].otyp = randartquarterstaffX();
660 artilist[ART_MAGE_STAFF_OF_ETERNITY].otyp = randartquarterstaffX();
661 artilist[ART_STAFF_OF_WILD_MAGIC].otyp = randartquarterstaffX();
662 artilist[ART_CELL].otyp = randartquarterstaffX();
663 artilist[ART_LYST_ERG].otyp = randartquarterstaffX();
664 artilist[ART_DROWSING_ROD].otyp = randartquarterstaffX();
665 artilist[ART_PAINBOWSWANDIR].otyp = randartbowX();
666 artilist[ART_KRASCHEEP].otyp = randartbowX();
667 artilist[ART_ARROW_RAIN].otyp = randartbowX();
668 artilist[ART_EARTH_GAS_GUN].otyp = randartlauncherX();
669 artilist[ART_FIRE_ALREADY].otyp = randartmissileX();
670 artilist[ART_HUMAN_WIPEOUT].otyp = randartmeleeweaponX();
671 artilist[ART_ESPECIALLYRANDARM].otyp = randartsuitX();
672 artilist[ART_GO_MIEFTLY_THEN_QUEUE__DAE].otyp = randartsuitX();
673 artilist[ART_SPLINTER_ARMAMENT].otyp = randartsuitX();
674 artilist[ART_BELLY_W].otyp = randartsuitX();
675 artilist[ART_GENDERGENDERGENDERGENDERGE].otyp = randartsuitX();
676 artilist[ART_CHIP_INFACT].otyp = randartsuitX();
677 artilist[ART_AMMY_S_RNG_CHANGER].otyp = randartsuitX();
678 artilist[ART_ADD_THE_MISSING_STAIRCASE].otyp = randartsuitX();
679 artilist[ART_THERE_GOES_SHE_TO].otyp = randartsuitX();
680 artilist[ART_HUNKSTERMAN].otyp = randartsuitX();
681 artilist[ART_DUH_BEWEGEO_ZISCH].otyp = randartsuitX();
682 artilist[ART_SEVEBREAKYOU__SEVEBREAK_].otyp = randartsuitX();
683 artilist[ART_PLANTOPLIM].otyp = randartsuitX();
684 artilist[ART_ELMHERE].otyp = randartsuitX();
685 artilist[ART_LU_NONNAME].otyp = randartsuitX();
686 artilist[ART_ALPHA_TAURI].otyp = randartsuitX();
687 artilist[ART_ABSOLUTE_MONSTER_MAIL].otyp = randartsuitX();
688 artilist[ART_RITA_S_TENDER_STILETTOS].otyp = randartbootsX();
689 artilist[ART_EROTIC_STAT_TRAIN].otyp = randartbootsX();
690 artilist[ART_SPECIAL_ROBUNG].otyp = randartrobeX();
691 artilist[ART_UPPERWEAVER_S_THREAD].otyp = randartrobeX();
692 artilist[ART_CHAOSWEAVER_ROBES].otyp = randartrobeX();
693 artilist[ART_COPE_OF_THE_ELDRITCH_KNIGH].otyp = randartrobeX();
694 artilist[ART_ROBE_OF_CLOSED_EYES].otyp = randartrobeX();
695 artilist[ART_HALF_MOON_TONIGHT].otyp = randartcloakX();
696 artilist[ART_PANTAP].otyp = randartcloakX();
697 artilist[ART_RUTH_S_DARK_FORCE].otyp = randarthelmX();
698 artilist[ART_FIVE_HORNED_HELM].otyp = randarthelmX();
699 artilist[ART_PEOPLE_DUMBING].otyp = randarthelmX();
700 artilist[ART_HELM_OF_THE_ARCANE_ARCHER].otyp = randarthelmX();
701 artilist[ART_MASK_OF_TLALOC].otyp = randarthelmX();
702 artilist[ART_HOW_CAN_ONE_PLEASE_LOOK_LI].otyp = randarthelmX();
703 artilist[ART_WEAR_OFF_THE_DAMN_RNG].otyp = randarthelmX();
704 artilist[ART_REJU_GLUCK_GLUCK_GLUCK_BUG].otyp = randarthelmX();
705 artilist[ART_HAMBURG_ONE].otyp = randarthelmX();
706 artilist[ART_ARABELLA_S_MELEE_POWER].otyp = randartmeleeweaponX();
707 artilist[ART_ASBESTOS_MATERIAL].otyp = randartmeleeweaponX();
708 artilist[ART_DO_NOT_DISPLAY_THE_CHARGES].otyp = randartmeleeweaponX();
709 artilist[ART_TANKS_A_LOT].otyp = randartglovesX();
710 artilist[ART_GHAND].otyp = randartglovesX();
711 artilist[ART_GAUNTLETS_OF_YIN_AND_YANG].otyp = randartglovesX();
712 artilist[ART_DIMVISION].otyp = randartglovesX();
713 artilist[ART_AL_UD].otyp = randartshieldX();
714 artilist[ART_I_M_GETTING_HUNGRY].otyp = randartshieldX();
715 artilist[ART_DNETHACKC_NOONISHNESS].otyp = randartshieldX();
716 artilist[ART_SHIELD_OF_THE_PALADIN].otyp = randartshieldX();
717 artilist[ART_PROTECTION_SET].otyp = randartshieldX();
718 artilist[ART_ALTERNATE_SPELLWEAVE].otyp = randartshieldX();
719 artilist[ART_THATS_ENOUGH_RIGHT_THERE].otyp = randartshieldX();
720 artilist[ART_CASTLE_CRUSH_GLITCH].otyp = randartshieldX();
721 artilist[ART_FETTIS_SLOT].otyp = randartshieldX();
722 artilist[ART_RONDITSCH].otyp = randartshieldX();
723 artilist[ART_OF_NULLING].otyp = randartshieldX();
724 artilist[ART_SUPER_ENERGY_LINES].otyp = randartshieldX();
725 artilist[ART_CCC_CCC_CCCCCCC].otyp = randartshieldX();
726 artilist[ART_FIVE_STAR_PARTY].otyp = randartshieldX();
727 artilist[ART_GUDRUN_S_STOMPING].otyp = randartbootsX();
728 artilist[ART_GOEFFELBOEFFEL].otyp = randartbootsX();
729 artilist[ART_TEMPERATOR].otyp = randartbootsX();
730 artilist[ART_PEWWWWWWW].otyp = randartjavelinX();
731 artilist[ART_VILYA].otyp = randartringX();
732 artilist[ART_RING_OF_STEEL_DRAGON].otyp = randartringX();
733 artilist[ART_MARK_OF_THE_RIGHTFUL_SCION].otyp = randartringX();
734 artilist[ART_STAR_EMPEROR_S_RING].otyp = randartringX();
735 artilist[ART_LOMYA].otyp = randartringX();
736 artilist[ART_GREEN_COLOR].otyp = randartringX();
737 artilist[ART_SCARAB_OF_ADORNMENT].otyp = randartringX();
738 artilist[ART_SCHWUEU].otyp = randartamuletX();
739 artilist[ART_TWIN_EDGE].otyp = randartamuletX();
740 artilist[ART_UNKNOWN_SHELL].otyp = randartamuletX();
741 artilist[ART_CURSE_THE_TIME_SHIFT].otyp = randartamuletX();
742 artilist[ART_YOUR_LUCKY_DAY].otyp = randartwandX();
743 artilist[ART_DIFFUSION_WAVE].otyp = randartwandX();
744 artilist[ART_FULLY_THE_LONG_PENIS].otyp = randartwandX();
745 artilist[ART_WORLD_OF_COQ].otyp = randartwandX();
746 artilist[ART_GIVE_IT_ME_YOUR_WILL].otyp = randartimplantX();
747 artilist[ART_ND_D___N_NDMNN_ND___NDMN_N].otyp = randartimplantX();
748 artilist[ART_WHOOSHZAP].otyp = randartwandX();
749 artilist[ART_CLOUDYBAND].otyp = randartshirtX();
750 artilist[ART_CRIMSON_PLATE].otyp = randartshirtX();
751 artilist[ART_LISE_S_UNDERWEAR].otyp = randartshirtX();
752 artilist[ART_FIRST_THERE_WE_WERE].otyp = randartshirtX();
753 artilist[ART_MENSTRUATION_HURTS].otyp = randartshirtX();
754 artilist[ART_NOW_YOU_MADE_HER_SAD].otyp = randartshirtX();
755 artilist[ART_HA_HA_HA_HA___].otyp = randartshirtX();
756 artilist[ART_GREENTOP].otyp = randartshirtX();
757 artilist[ART_ZANTETSU].otyp = randartmeleeweaponX();
758 artilist[ART_NADJA_S_SILENCE].otyp = randartmeleeweaponX();
759 artilist[ART_A_SWORD_NAMED_SWORD].otyp = randartmeleeweaponX();
760 artilist[ART_HERITAGE_IGNORER].otyp = randartmeleeweaponX();
761 artilist[ART_MIMICBANE].otyp = randartmeleeweaponX();
762 artilist[ART_HAHAHAHAHAHAHAAAAAAAAAAAA].otyp = randartmeleeweaponX();
763 artilist[ART_POISON_PEN_LETTER].otyp = randartmeleeweaponX();
764 artilist[ART_SUNALI_S_SUMMONING_STORM].otyp = randartbootsX();
765 artilist[ART_LIGHT_DAL_I_THALION].otyp = randartbootsX();
766 artilist[ART_FILTHY_PRESS].otyp = randartlauncherX();
767 artilist[ART_MUB_PUH_MUB_DIT_DIT].otyp = randartmeleeweaponX();
768 artilist[ART_DONNNNNNNNNNNNG].otyp = randartmeleeweaponX();
769 artilist[ART_PROVOCATEUR].otyp = randartmeleeweaponX();
770 artilist[ART_FOEOEOEOEOEOEOE].otyp = randartlauncherX();
771 artilist[ART_NEVER_WILL_THIS_BE_USEFUL].otyp = randartmeleeweaponX();
772 artilist[ART_QUARRY].otyp = randartsuitX();
773 artilist[ART_KUSE_MUSE].otyp = randartsuitX();
774 artilist[ART_NOTHING_BUT_FILLER].otyp = randartsuitX();
775 artilist[ART_CONNY_S_COMBAT_COAT].otyp = randartcloakX();
776 artilist[ART_ACIDSHOCK_CASTLECRUSHER].otyp = randartcloakX();
777 artilist[ART_LAURA_S_SWIMSUIT].otyp = randartcloakX();
778 artilist[ART_PROTECT_WHAT_CANNOT_BE_PRO].otyp = randartcloakX();
779 artilist[ART_DOEDOEDOEDOEDOEDOEDOE_TEST].otyp = randartcloakX();
780 artilist[ART_GIRLFUL_FARTING_NOISES].otyp = randarthelmX();
781 artilist[ART_YOU_SEE_HERE_AN_ARTIFACT].otyp = randarthelmX();
782 artilist[ART_NUMB_OR_MAYBE].otyp = randartglovesX();
783 artilist[ART_GLOVES_OF_VESDA].otyp = randartglovesX();
784 artilist[ART_DEAD_SLAM_THE_TIME_SHUT].otyp = randartglovesX();
785 artilist[ART_ANASTASIA_S_UNEXPECTED_ABI].otyp = randartbootsX();
786 artilist[ART_FORMO____].otyp = randartbootsX();
787 artilist[ART_ELIANE_S_SHIN_SMASH].otyp = randartbootsX();
788 artilist[ART_MYSTERIOUS_MAGIC].otyp = randartamuletX();
789 artilist[ART_BAKURETU_KEN].otyp = randartamuletX();
790 artilist[ART_BANGCOCK].otyp = randartlauncherX();
791 artilist[ART_RNG_S_COMPLETION].otyp = randartsuitX();
792 artilist[ART_WEGEO_ACQUA_DE_EISU_FORTE].otyp = randartsuitX();
793 artilist[ART_RNG_S_BEAUTY].otyp = randartbootsX();
794 artilist[ART_RNG_S_SAFEGUARD].otyp = randartshieldX();
795 artilist[ART_CREMATED].otyp = randartshieldX();
796 artilist[ART_BLACK_DARKNESS].otyp = randartamuletX();
797 artilist[ART_FLEECY_GREEN].otyp = randartamuletX();
798 artilist[ART_PEEK].otyp = randartmeleeweaponX();
799 artilist[ART_TAILCUTTER].otyp = randartmeleeweaponX();
800 artilist[ART_WONDER_WATERING_PLACE].otyp = randartpotionX();
801 artilist[ART_MULTIPOT].otyp = randartpotionX();
802 artilist[ART_SECRET_RECIPE].otyp = randartscrollX();
803 artilist[ART_MAPS_TO_PLAY].otyp = randartscrollX();
804 artilist[ART_DESIGN_YOUR_OWN].otyp = randartscrollX();
805 artilist[ART_ULTRALASER].otyp = randartscrollX();
806 artilist[ART_HEAVY_HEAVY_BABE].otyp = randartballX();
807 artilist[ART_KLONG_RIGHT].otyp = randartballX();
808 artilist[ART_GORMALER].otyp = randartballX();
809 artilist[ART_SIYID].otyp = randartchainX();
810 artilist[ART_AXELLE_S_CHAIN].otyp = randartchainX();
811 artilist[ART_JIN_GANG_ZUO].otyp = randartchainX();
812 artilist[ART_HAMSTRUNG_FOUR_SURE].otyp = randartchainX();
813 artilist[ART_RACE_ALONG_THE_HIGHWAY].otyp = randartchainX();
814 artilist[ART_PAWNERMASTER].otyp = randartgemX();
815 artilist[ART_SHINING_ROCK].otyp = randartgemX();
816 artilist[ART_GANTULETS_OF_MISPEALING].otyp = randartglovesX();
817 artilist[ART_SECRET_BOOK_OF_VENOM].otyp = randartspellbookX();
818 artilist[ART_ENCYCLOPEDIA_GALACTICA].otyp = randartspellbookX();
819 artilist[ART_HENRIETTENFORCE].otyp = randartlightsaberX();
820 artilist[ART_RISE_OF_VENTRESS].otyp = randartlightsaberX();
821 artilist[ART_DESANN_S_WRATH].otyp = randartlightsaberX();
822 artilist[ART_DONGOR].otyp = randartvenomX();
823 artilist[ART_STAB_ALL_OVER].otyp = randartunihornX();
824 artilist[ART_HOL_ON_MAN].otyp = randartvenomX();
825 artilist[ART_CHOCKERSHOCKER].otyp = randartpolearmX();
826 artilist[ART_CAT_S_TAIL].otyp = randartpolearmX();
827 artilist[ART_POWER_POLE].otyp = randartpolearmX();
828 artilist[ART_BALANCE_PSEUDOSHIELD].otyp = randartquarterstaffX();
829 artilist[ART_STAFF_OF_ROT].otyp = randartquarterstaffX();
830 artilist[ART_STAFF_OF_THE_ARCHMAGIGI].otyp = randartquarterstaffX();
831 artilist[ART_BLU_TOE].otyp = randartorbX();
832 artilist[ART_GIGANTIC_SUN].otyp = randartorbX();
833 artilist[ART_POSSO_CONTINUARE_LATERALE].otyp = randartorbX();
834 artilist[ART_SCHWI_SCHWI].otyp = randartorbX();
835 artilist[ART_MR__AHLBLOW_S_SIGNAGE].otyp = randartorbX();
836 artilist[ART_UNSTOPPABLE].otyp = randartcrossbowX();
837 artilist[ART_EVERCONSUMING_HELLFIRE].otyp = randartcrossbowX();
838 artilist[ART_HEAVY_CROSSBOW_OF_ETERNITY].otyp = randartcrossbowX();
839 artilist[ART_CROSSBOW_OF_THE_GNOLL_LORD].otyp = randartcrossbowX();
840 artilist[ART_HOWLING_FLAIL].otyp = randartflailX();
841 artilist[ART_MACE_OF_ORCUS].otyp = randartmaceX();
842 artilist[ART_MACE_OF_THE_EVANGELIST].otyp = randartmaceX();
843 artilist[ART_UNWIELDYTINE].otyp = randarttridentX();
844 artilist[ART_LOGGERS_S_OVERKILL].otyp = randarttridentX();
845 artilist[ART_POSEIDON_S_TRIDENT].otyp = randarttridentX();
846 artilist[ART_TURVANG_S_THUNDER].otyp = randarthammerX();
847 artilist[ART_GAIA_HAMMER].otyp = randarthammerX();
848 artilist[ART_FORGE_HAMMER_OF_THE_ARTIFI].otyp = randarthammerX();
849 artilist[ART_HAVING_HAMMA].otyp = randarthammerX();
850 artilist[ART_SLAM_SHUT_AND_BE_DONE].otyp = randarthammerX();
851 artilist[ART_OGRE_POWER].otyp = randarthammerX();
852 artilist[ART_MORTALITY_DIAL].otyp = randartmaceX();
853 artilist[ART_ARK_OF_THE_COVENANT].otyp = randartpickaxeX();
854 artilist[ART_MFFAP].otyp = randartpickaxeX();
855 artilist[ART_NOTHING_FOR_IT].otyp = randartpickaxeX();
856 artilist[ART_REPAIR_YOUR_BRAIN].otyp = randartpickaxeX();
857 artilist[ART_FAMOUS_LANCE].otyp = randartlanceX();
858 artilist[ART_HOLY_RANCE].otyp = randartlanceX();
859 artilist[ART_SERPENT_RING_OF_SET].otyp = randartringX();
860 artilist[ART_HOLY_GRAIL].otyp = randartquarterstaffX();
861 artilist[ART_LIBRA_OF_JUSTICE].otyp = randartflailX();
862 artilist[ART_TENRAI].otyp = randartspearX();
863 artilist[ART_QUIXOTIC_SPIRIT].otyp = randartlanceX();
864 artilist[ART_GODAWFUL_ENCHANTMENT].otyp = randartclubX();
865 artilist[ART_LOG_OF_THE_CURATOR].otyp = randartclubX();
866 artilist[ART_FULLY_ON_IT].otyp = randartclubX();
867 artilist[ART_PULVERIZE_EM].otyp = randartclubX();
868 artilist[ART_AQUARHAPSODY].otyp = randartbowX();
869 artilist[ART_FIRE_SOUL].otyp = randartshortswordX();
870 artilist[ART_DIABLO_S_LBOD].otyp = randartshortswordX();
871 artilist[ART_TERROR_DROP].otyp = randartshortswordX();
872 artilist[ART_DAEFAROTH].otyp = randartdaggerX();
873 artilist[ART_DAGGER_SURROUNDED_BY_WIND].otyp = randartdaggerX();
874 artilist[ART_THIN_DAGGER].otyp = randartdaggerX();
875 artilist[ART_FERRUM_D].otyp = randartdaggerX();
876 artilist[ART_GEB_ME_ALL_YOUR_MONEY].otyp = randartdaggerX();
877 artilist[ART_NOCLAF].otyp = randartscimitarX();
878 artilist[ART_BLUE_CORSAR_SWIMMING].otyp = randartscimitarX();
879 artilist[ART_FONLAUSCHI].otyp = randartpolearmX();
880 artilist[ART_RANKIS].otyp = randartpolearmX();
881 artilist[ART_SOUL_REAPER].otyp = randartpolearmX();
882 artilist[ART_DOOMSDAY_HALBERD].otyp = randartpolearmX();
883 artilist[ART_VOID_SCYTHE].otyp = randartpolearmX();
884 artilist[ART_AVAL_N].otyp = randartscimitarX();
885 artilist[ART_EUTATS_ENOTS].otyp = randartaxeX();
886 artilist[ART_AXE_OF_DESTRUCTION].otyp = randartaxeX();
887 artilist[ART_FUNE_NO_IKARI].otyp = randartaxeX();
888 artilist[ART_BRAINSTORM].otyp = randartflailX();
889 artilist[ART_NO_MOON_AT_ALL].otyp = randartflailX();
890 artilist[ART_POLARIS].otyp = randartmorningstarX();
891 artilist[ART_HAXORTROLL].otyp = randartmorningstarX();
892 artilist[ART_SONICBOOM_BABY__LET_S_DO_T].otyp = randartmorningstarX();
893 artilist[ART_GO_FULLY_OFF].otyp = randartmorningstarX();
894 artilist[ART_FLAMESNIPER].otyp = randartbowX();
895 artilist[ART_SHAKING_BOW].otyp = randartbowX();
896 artilist[ART_BOW_SURROUNDED_BY_WIND].otyp = randartbowX();
897 artilist[ART_THUNDERBIRD].otyp = randartboomerangX();
898 artilist[ART_STELLARIS_MATERIA].otyp = randartshortswordX();
899 artilist[ART_ATLACH_NACHA].otyp = randartscimitarX();
900 artilist[ART_KEMONONOYARI].otyp = randartspearX();
901 artilist[ART_MONS_INFERNALIS_X_].otyp = randartspearX();
902 artilist[ART_NIUR_KRAD].otyp = randartpolearmX();
903 artilist[ART_ARM_OF_OLYMPIA].otyp = randartspearX();
904 artilist[ART_KAZAANA].otyp = randartglovesX();
905 artilist[ART_GAUNTLETS_OF_THE_HEALING_H].otyp = randartglovesX();
906 artilist[ART_GAUNTLETS_OF_THE_BERSERKER].otyp = randartglovesX();
907 artilist[ART_UNKNOWINGNESS_AS_A_WEAPON].otyp = randartglovesX();
908 artilist[ART_VIOLENT_SKULL_SWORD].otyp = randartlongswordX();
909 artilist[ART_SWORD_THAT_ENDS_ALL].otyp = randartlongswordX();
910 artilist[ART_PURE_BLACK_DIABLO].otyp = randartlongswordX();
911 artilist[ART_LONG_SWORD_OF_ETERNITY].otyp = randartlongswordX();
912 artilist[ART_HOLY_MOONLIGHT_SWORD].otyp = randartlongswordX();
913 artilist[ART_GAUGE_REDUCE].otyp = randartlongswordX();
914 artilist[ART_GLAMDRING__CHINESE_BOOTLEG].otyp = randartlongswordX();
915 artilist[ART_GIANTCRUSHER].otyp = randartlongswordX();
916 artilist[ART_M__M__M_].otyp = randartpaddleX();
917 artilist[ART_ASS_ASS_IN_ASS].otyp = randartclawX();
918 artilist[ART_VILEA_S_SECRET].otyp = randartclawX();
919 artilist[ART_SUPERSTAB].otyp = randartclawX();
920 artilist[ART_VORPAL_RULER].otyp = randartsaberX();
921 artilist[ART_VENERATION_SABRE].otyp = randartsaberX();
922 artilist[ART_BLOOD_SMEARED_SAW].otyp = randartgrinderX();
923 artilist[ART_NAIL_IMPACT].otyp = randartknucklesX();
924 artilist[ART_SIGMUND_S_SMALL_LOAD].otyp = randartcrossbowboltX();
925 artilist[ART_FLAI_AWEI].otyp = randartarrowX();
926 artilist[ART_CREAMRES].otyp = randartslingX();
927 artilist[ART_FLIUFLIUFLIUUUUUUU_].otyp = randartdartX();
928 artilist[ART_DART_OF_THE_ASSASSIN].otyp = randartdartX();
929 artilist[ART_CAPAUER].otyp = randartshurikenX();
930 artilist[ART_ETERNALE_DELAY].otyp = randartmattockX();
931 artilist[ART_TWISTED_TURN].otyp = randartknifeX();
932 artilist[ART_MCCAULEY_S_INTELLIGENCE].otyp = randartbroadswordX();
933 artilist[ART_SUPERDRAGONBANE].otyp = randartbroadswordX();
934 artilist[ART_MCCAULEY_S_ARGUMENT].otyp = randartshortswordX();
935 artilist[ART_SWORD_OF_THE_KLEPTOMANIAC].otyp = randartshortswordX();
936 artilist[ART_ASHIKAGA_S_REVENGE].otyp = randarttwohandedswordX();
937 artilist[ART_TWO_EDGED_GREAT_SWORD].otyp = randarttwohandedswordX();
938 artilist[ART_DARK_CLAYMORE].otyp = randarttwohandedswordX();
939 artilist[ART_TSCHAPSNAP].otyp = randartwhipX();
940 artilist[ART_MAGYAR_IDEA].otyp = randartwhipX();
941 artilist[ART_TRUSTY_ADVENTURER_S_WHIP].otyp = randartwhipX();
942 artilist[ART_NEEDLESSLY_MEAN].otyp = randartwhipX();
943 artilist[ART_MOUNT_BOND].otyp = randartsaddleX();
944 artilist[ART_SADDLE_OF_BRYNHILDR].otyp = randartsaddleX();
945 artilist[ART_ANNOYING_PET_MONITOR].otyp = randartleashX();
947 artilist[ART_ELLI_S_PSEUDOBAND_OF_POS].otyp = randartmeleeweaponX();
949 artilist[ART_IGTOS_CORP__INC_].attk.adtyp = randartiattacktype();
950 artilist[ART_IGTOS_CORP__INC_].attk.damn = rnd(8);
951 artilist[ART_IGTOS_CORP__INC_].attk.damd = rnd(8);
953 artilist[ART_POSTSCHEME_M].attk.adtyp = randartiattacktype();
954 artilist[ART_POSTSCHEME_M].attk.damn = rnd(11);
955 artilist[ART_POSTSCHEME_M].attk.damd = rnd(15);
957 init_appearance_randarts();
961 /* "appearance randarts" are those supposed to have a specific randomized appearance, usually armor pieces, by Amy
962 * these will need to be reset if amnesia or appearance shuffling causes the appearances of such items to be re-randomized,
963 * otherwise none of them will have the proper random appearance for the rest of the game as soon as one such shuffling
964 * incident happens! */
965 void
966 init_appearance_randarts()
969 artilist[ART_HIGHEST_FEELING].otyp = find_fetish_heels();
970 artilist[ART_VORPAL_HEELS].otyp = find_fetish_heels();
971 artilist[ART_LORSKEL_S_INTEGRITY].otyp = find_lolita_boots();
973 artilist[ART_PHANTOM_OF_THE_OPERA].otyp = find_opera_cloak();
974 artilist[ART_HIGH_DESIRE_OF_FATALITY].otyp = find_explosive_boots();
975 artilist[ART_CHOICE_OF_MATTER].otyp = find_irregular_boots();
976 artilist[ART_MELISSA_S_BEAUTY].otyp = find_wedge_boots();
977 artilist[ART_CORINA_S_SNOWY_TREAD].otyp = find_skates3();
978 artilist[ART_NUMBER___].otyp = find_aluminium_helmet();
979 artilist[ART_HAUNTNIGHT].otyp = find_ghostly_cloak();
980 artilist[ART_LORSKEL_S_SPECIAL_PROTECTI].otyp = find_polnish_gloves();
981 artilist[ART_VULTUREHANDLER].otyp = find_falconry_gloves();
982 artilist[ART_MOUNTAIN_FISTS].otyp = find_fencing_gloves();
983 artilist[ART_STORMING_FISTS].otyp = find_critical_gloves();
984 artilist[ART_TECH_OF_X].otyp = find_latex_gloves();
985 artilist[ART_ROBBERY_GONE_RIGHT].otyp = find_polnish_gloves();
986 artilist[ART_JOSEFINE_S_EVILNESS].otyp = find_velcro_boots();
987 artilist[ART_WHINY_MARY].otyp = find_clumsy_gloves();
988 artilist[ART_WARP_SPEED].otyp = find_fin_boots();
989 artilist[ART_LOIS_S_CHILL].otyp = find_winter_boots();
990 artilist[ART_ISHITA_S_OVERWHELMING].otyp = find_petrified_cloak();
991 artilist[ART_PECTORAL_HEEL].otyp = find_fin_boots();
992 artilist[ART_GRENEUVENIA_S_HUG].otyp = find_profiled_boots();
993 artilist[ART_SHELLY].otyp = find_void_cloak();
994 artilist[ART_SPREAD_YOUR_LEGS_WIDE].otyp = find_grey_shaded_gloves();
995 artilist[ART_GREEB].otyp = find_weeb_cloak();
996 artilist[ART_PRINCE_OF_PERSIA].otyp = find_persian_boots();
997 artilist[ART_SHE_S_NOT_FORGOTTEN].otyp = find_terrible_boots();
998 artilist[ART_ANASTASIA_S_PLAYFULNESS].otyp = find_hugging_boots();
999 artilist[ART_KATIE_MELUA_S_FEMALE_WEAPO].otyp = find_fleecy_boots();
1000 artilist[ART_LISSIE_S_SHEAGENTUR].otyp = find_fleecy_boots();
1001 artilist[ART_COCKUETRY].otyp = find_fingerless_gloves();
1002 artilist[ART_PERCENTIOEOEPSPERCENTD_THI].otyp = find_mantle_of_coat();
1003 artilist[ART_PEEPING_GROOVE].otyp = find_fatal_gloves();
1004 artilist[ART_TURN_INTO_THE_NORM].otyp = find_leather_gloves();
1005 artilist[ART_RARE_ASIAN_LADY].otyp = find_beautiful_heels();
1006 artilist[ART_JANA_S_FAIRNESS_CUP].otyp = find_homicidal_cloak();
1007 artilist[ART_OUT_OF_TIME].otyp = find_castlevania_boots();
1008 artilist[ART_KATHERINE_S_BEACHWEAR].otyp = find_tankini();
1009 artilist[ART_PALEOLITHIC_ELBOW_CONTRACT].otyp = find_greek_cloak();
1010 artilist[ART_NUCLEAR_BOMB].otyp = find_celtic_helmet();
1011 artilist[ART_HABIBA_S_MATRONAGE].otyp = find_hardcore_cloth();
1012 artilist[ART_BEEEEEEEANPOLE].otyp = find_english_gloves();
1013 artilist[ART_LEGMA].otyp = find_korean_sandals();
1014 artilist[ART_BRITTA_S_MURDER_STORY].otyp = find_sling_pumps();
1015 artilist[ART_TERRY_PRATCHETT_S_INGENUIT].otyp = find_octarine_robe();
1016 artilist[ART_DERANDERGRAAA].otyp = find_faceless_robe();
1017 artilist[ART_ARABELLA_S_SEXY_GIRL_BUTT].otyp = find_chinese_cloak();
1018 artilist[ART_LONG_LASTING_JOY].otyp = find_polyform_cloak();
1019 artilist[ART_LIGHT_ABSORPTION].otyp = find_absorbing_cloak();
1020 artilist[ART_CATHERINE_S_SEXUALITY].otyp = find_birthcloth();
1021 artilist[ART_POKEWALKER].otyp = find_poke_mongo_cloak();
1022 artilist[ART_WINDS_OF_CHANGE].otyp = find_levuntation_cloak();
1023 artilist[ART_LIGHTSPEED_TRAVEL].otyp = find_quicktravel_cloak();
1024 artilist[ART_T_O_M_E].otyp = find_angband_cloak();
1025 artilist[ART_FEMMY_FATALE].otyp = find_anorexia_cloak();
1026 artilist[ART_ARTIFICIAL_FAKE_DIFFICULTY].otyp = find_dnethack_cloak();
1027 artilist[ART_JUNETHACK______WINNER].otyp = find_team_splat_cloak();
1028 artilist[ART_YOG_SOTHOTH_HELP_ME].otyp = find_eldritch_cloak();
1029 artilist[ART_TOMORROW_WENDY_S_CHOICENA].otyp = find_deadly_cloak();
1030 artilist[ART_LUISA_S_IRRESISTIBLE_CHARM].otyp = find_erotic_boots();
1031 artilist[ART_JANA_S_DECEPTIVE_MASK].otyp = find_secret_helmet();
1032 artilist[ART_NOW_IT_BECOMES_DIFFERENT].otyp = find_difficult_cloak();
1033 artilist[ART_NATASCHA_S_STROKING_UNITS].otyp = find_velvet_gloves();
1034 artilist[ART_SPEAK_TO_OJ].otyp = find_sputa_boots();
1035 artilist[ART_DUE_DUE_DUE_DUE_BRMMMMMMM].otyp = find_formula_one_helmet();
1036 artilist[ART_TOILET_NOISES].otyp = find_excrement_cloak();
1037 artilist[ART_LINE_CAN_PLAY_BY_YOURSELF].otyp = find_racer_gloves();
1038 artilist[ART_TOO_FAST__TOO_FURIOUS].otyp = find_turbo_boots();
1039 artilist[ART_NOUROFIBROMA].otyp = find_guild_cloak();
1040 artilist[ART_MADELINE_S_STUPID_GIRL].otyp = find_shitty_gloves();
1041 artilist[ART_ELARA_S_AGILITY].otyp = find_dextrous_gloves();
1042 artilist[ART_GET_THE_BUC_K_].otyp = find_buckloak();
1043 artilist[ART_ARVOGENIA_S_BIKER_HEELS].otyp = find_stone_carved_heels();
1044 artilist[ART_EI_KEN_WOOK_WIF_DIS].otyp = find_stupid_stilettos();
1045 artilist[ART_PRECURSOR_TO_THE___].otyp = find_homo_shoes();
1046 artilist[ART_HEELMARJI].otyp = find_devil_lettuce_shoes();
1047 artilist[ART_SHE_S_STILL_AN_ANASTASIA].otyp = find_loafers();
1048 artilist[ART_KILLCAP].otyp = find_sweaty_shoes();
1049 artilist[ART_KATHARINA_S_SIGH].otyp = find_white_buffalo_boots();
1050 artilist[ART_THICK_PLATFORM_CRAZE].otyp = find_white_buffalo_boots();
1051 artilist[ART_SASSY_JULIA].otyp = find_sister_shoes();
1052 artilist[ART_POCAHONTAS_HOME].otyp = find_sister_shoes();
1053 artilist[ART_SOFT_ON_THE_CLOUD].otyp = find_sister_shoes();
1054 artilist[ART_WIDEFORCE_GRIP].otyp = find_hooked_gloves();
1055 artilist[ART_HEME_FLOW].otyp = find_bladed_disks();
1056 artilist[ART_CRUSH_THE_OPPOSITION].otyp = find_atlas_gloves();
1057 artilist[ART_JURE_DE_LO].otyp = find_speedy_gloves();
1058 artilist[ART_CHEATER_S_PROSPERING].otyp = find_air_cloak();
1059 artilist[ART_EREA_S_HERITAGE].otyp = find_vindale_cloak();
1060 artilist[ART_ALIEN_MINDWAVE].otyp = find_23_helmet();
1061 artilist[ART_REVELATION____VERSE__].otyp = find_a_heels();
1062 artilist[ART_GLENCHECK_EATING].otyp = find_alligator_pumps();
1063 artilist[ART_KLOCKING_NOISE].otyp = find_hammer_shoes();
1064 artilist[ART_SABRINA_S_FREEDOM].otyp = find_platform_fleecies();
1065 artilist[ART_EVIL_HAIRTEAR].otyp = find_platform_fleecies();
1066 artilist[ART_SANDRA_S_MEGAPOWER].otyp = find_retractable_block_heels();
1067 artilist[ART_WELL__MIGHT_AS_WELL_WEAR_T].otyp = find_instafeminism_shoes();
1069 artilist[ART_IRIS_S_HIDDEN_ALLERGY].otyp = find_silver_stilettos();
1070 artilist[ART_IRIS_S_SECRET_VULNERABILIT].otyp = find_echo_helmet();
1071 artilist[ART_IRIS_S_UNREVEALED_LOVE].otyp = find_demonic_cloak();
1072 artilist[ART_IRIS_S_FAVORED_MATERIAL].otyp = find_spiky_gloves();
1074 artilist[ART_IRMA_S_CHOICE].otyp = find_copper_stilettos();
1075 artilist[ART_EVERLASTING_HEELS].otyp = find_diamond_stilettos();
1076 artilist[ART_HEIKE_S_BIGOTRY].otyp = find_heeled_hugging_boots();
1077 artilist[ART_ADORNING_BUNDLE].otyp = find_cosmetic_helmet();
1078 artilist[ART_GO_ON_A_SURVEY_RECREATION].otyp = find_warning_coat();
1079 artilist[ART_GIVE_US_TODAY_OUR_DAILY_GA].otyp = find_bamboo_cloak();
1080 artilist[ART_JANA_S_ROULETTE_OF_LIFE].otyp = find_foundry_cloak();
1081 artilist[ART_MAGIC_JUGGULATE].otyp = find_spellsucking_cloak();
1082 artilist[ART_HIGH_KING_OF_SKIRIM].otyp = find_storm_coat();
1083 artilist[ART_ALLCOLOR_PRISM].otyp = find_fleeceling_cloak();
1084 artilist[ART_MARY_INSCRIPTION].otyp = find_princess_gloves();
1085 artilist[ART_FATHIEN_ELDER_S_SECRET_POW].otyp = find_uncanny_gloves();
1086 artilist[ART_SI_OH_WEE].otyp = find_slaying_gloves();
1087 artilist[ART_JOHANETTA_S_ROUGH_GENTLENE].otyp = find_blue_sneakers();
1088 artilist[ART_JANA_S_VAGINAL_FUN].otyp = find_blue_sneakers();
1089 artilist[ART_VERY_NICE_PERSON].otyp = find_femmy_boots();
1090 artilist[ART_JULIA_S_REAL_LOVE].otyp = find_red_sneakers();
1091 artilist[ART_ELIANE_S_COMBAT_SNEAKERS].otyp = find_yellow_sneakers();
1092 artilist[ART_MAILIE_S_CHALLENGE].otyp = find_pink_sneakers();
1093 artilist[ART_MERLOT_FUTURE].otyp = find_skates4();
1094 artilist[ART_MADELEINE_S_GIRL_FOOTSTEPS].otyp = find_calf_leather_sandals();
1095 artilist[ART_RUTH_S_MORTAL_ENEMY].otyp = find_velcro_sandals();
1096 artilist[ART_LARISSA_S_ANGER].otyp = find_buffalo_boots();
1097 artilist[ART_PRETTY_ROOMMAID].otyp = find_heroine_mocassins();
1098 artilist[ART_ALISEH_S_RED_COLOR].otyp = find_lolita_boots();
1099 artilist[ART_KATIE_MELUA_S_FLEECINESS].otyp = find_weapon_light_boots();
1100 artilist[ART_SHARP_EDGED_AND_DANGEROUS].otyp = find_weapon_light_boots();
1101 artilist[ART_ELONA_S_SNAIL_TRAIL].otyp = find_rubynus_helmet();
1102 artilist[ART_LORENZI_S_CLEANING_RESIDUE].otyp = find_everlasting_boots();
1104 artilist[ART_ARABELLA_S_WEAPON_STORAGE].otyp = find_cursed_called_cloak();
1105 artilist[ART_KYS_YOURSELF].otyp = find_fourchan_cloak();
1106 artilist[ART_INA_S_SORROW].otyp = find_inalish_cloak();
1107 artilist[ART_WHY_NOT_DO_THE_REAL_THING].otyp = find_grunter_helmet();
1108 artilist[ART_CLAUDIA_S_SEXY_SCENT].otyp = find_cloudy_helmet();
1109 artilist[ART_VACUUM_CLEANER_DEATH].otyp = find_breath_control_helmet();
1110 artilist[ART_NYPHERISBANE].otyp = find_gas_mask();
1111 artilist[ART_CHRISTMAS_MEDAL].otyp = find_sages_helmet();
1112 artilist[ART_LONGEST_RAY].otyp = find_rayductnay_gloves();
1113 artilist[ART_ENDORPHIC_SCRATCHING].otyp = find_orgasm_pumps();
1114 artilist[ART_SONJA_S_TORN_SOUL].otyp = find_worn_out_sneakers();
1115 artilist[ART_RUEA_S_FAILED_CONVERSION].otyp = find_noble_sandals();
1116 artilist[ART_HAWAIIAN_KAMEHAMEHA].otyp = find_doctor_claw_boots();
1117 artilist[ART_LARISSA_S_GENTLE_SLEEP].otyp = find_feelgood_heels();
1118 artilist[ART_STEFANJE_S_PROBLEM].otyp = find_plof_heels();
1119 artilist[ART_MALENA_S_LADYNESS].otyp = find_princess_pumps();
1120 artilist[ART_ELEVECULT].otyp = find_ballet_heels();
1121 artilist[ART_SHIT_KICKERS].otyp = find_steel_toed_boots();
1122 artilist[ART_SARAH_S_GRANNY_WEAR].otyp = find_marji_shoes();
1123 artilist[ART_CLICHE_WEAR].otyp = find_mary_janes();
1124 artilist[ART_YVONNE_S_MODEL_AMBITION].otyp = find_velvet_pumps();
1125 artilist[ART_BRIGHT_AURORA].otyp = find_not_slowing_down_boots();
1127 artilist[ART_BOWSER_S_FUN_ARENA].otyp = find_volcanic_cloak();
1128 artilist[ART_BILLS_PAID].otyp = find_fuel_cloak();
1129 artilist[ART_FINDING_THYSELF].otyp = find_cloister_cloak();
1130 artilist[ART_GUNNEM_DOWN].otyp = find_quantity_cloak();
1131 artilist[ART_GOODFOOD].otyp = find_quantity_cloak();
1132 artilist[ART_SALADIN_S_DESERT_FOX].otyp = find_shemagh();
1133 artilist[ART_JAMILA_S_BELIEF].otyp = find_shemagh();
1134 artilist[ART_SLIPPING_SUCKING].otyp = find_serrated_helmet();
1135 artilist[ART_INERT_GREAVES].otyp = find_thick_boots();
1136 artilist[ART_DESERT_MEDITATION].otyp = find_sand_als();
1137 artilist[ART_GORGEOUS_VEIL_MODEL].otyp = find_shadowy_heels();
1138 artilist[ART_SUBLEVEL_FLOODING].otyp = find_weight_attachment_boots();
1139 artilist[ART_USE_THE_NORMALNESS_TURNS].otyp = find_fungal_sandals();
1140 artilist[ART_UNFELLABLE_TREE].otyp = find_standing_footwear();
1142 artilist[ART_CARMARK].otyp = find_business_shoes();
1143 artilist[ART_ANITA_S_RASHLUST].otyp = find_filigree_stilettos();
1144 artilist[ART_JONADAB_S_EVERYDAY_WEAR].otyp = find_ugly_boots();
1145 artilist[ART_AMATEURSPORTS].otyp = find_unisex_pumps();
1146 artilist[ART_RONJA_S_FEMALE_PUSHING].otyp = find_cuddle_cloth_boots();
1147 artilist[ART_SNAILHUNT].otyp = find_garden_slippers();
1148 artilist[ART_ANTJE_S_POWERSTRIDE].otyp = find_dyke_boots();
1149 artilist[ART_NADINE_S_CUTENESS].otyp = find_ankle_strap_sandals();
1150 artilist[ART_MARJI_JANA].otyp = find_ankle_boots();
1152 artilist[ART_AMPERSAND_HAREM].otyp = find_demonologist_boots();
1153 artilist[ART_DIP_DIVE].otyp = find_mud_boots();
1154 artilist[ART_MANDY_S_RAIDWEAR].otyp = find_failed_shoes();
1155 artilist[ART_PHANTO_S_RETARDEDNESS].otyp = find_opera_pumps();
1156 artilist[ART_CLAUDIA_S_SELF_WILL].otyp = find_wooden_clogs();
1157 artilist[ART_FASTER_THAN_ALL_OTHERS_INT].otyp = find_regular_sneakers();
1158 artilist[ART_RUTH_S_UNDEAD_INLAY].otyp = find_elite_sneakers();
1159 artilist[ART_KRAWASAKI_STEERER].otyp = find_biker_boots();
1160 artilist[ART_UPWARD_HEELS].otyp = find_zero_drop_shoes();
1161 artilist[ART_LUDGERA_S_SECRET_COURSE].otyp = find_hiking_boots();
1162 artilist[ART_THERE_ARE_SEVERAL_OF_THEM].otyp = find_pope_hat();
1163 artilist[ART_FOOTBALL_MASK].otyp = find_corona_mask();
1164 artilist[ART_FFP___MASK].otyp = find_corona_mask();
1165 artilist[ART_ACU_BECOME_HAVE].otyp = find_anachro_helmet();
1166 artilist[ART_PRIESTEST_BLESS].otyp = find_ornamental_cope();
1167 artilist[ART_SATAN_S_SUGGESTION].otyp = find_wetsuit();
1168 artilist[ART_EGASSO_S_GIBBERISH].otyp = find_multilinguitis_gloves();
1169 artilist[ART_SANDALS_OF_JESUS_CHRIST].otyp = find_throwaway_sandals();
1170 artilist[ART_ARTHUR_S_HIGH_HEELED_PLATF].otyp = find_sharp_edged_sandals();
1171 artilist[ART_GREEN_THUMB].otyp = find_nondescript_gloves();
1172 artilist[ART_GEAVY_GREAVES].otyp = find_lead_boots();
1173 artilist[ART_PERMINANT_INCREASE].otyp = find_machinery_boots();
1174 artilist[ART_WHINY_TEACHER_INSIDE_WOMAN].otyp = find_christmas_child_mode_boots();
1175 artilist[ART_NOW_YOU_LOOK_LIKE_A_BEGGAR].otyp = find_sandals_with_socks();
1176 artilist[ART_ANJA_S_WIDE_FIELD].otyp = find_wedge_sneakers();
1177 artilist[ART_U_BE_CURRY].otyp = find_barefoot_shoes();
1178 artilist[ART_H__S_GANGSTER_KICKS].otyp = find_exceptional_sneakers();
1179 artilist[ART_TOO_OLD_MODEL].otyp = find_blockchoc_boots();
1180 artilist[ART_ELENA_S_COMPETITION].otyp = find_block_heeled_boots();
1181 artilist[ART_DAMPENER].otyp = find_platform_sneakers();
1182 artilist[ART_MAY_BRITT_S_ADULTHOOD].otyp = find_iceblock_heels();
1183 artilist[ART_LYDIA_S_SEXYROOM].otyp = find_paragraph_shoes();
1184 artilist[ART_SHARPSPIKE].otyp = find_paragraph_sandals();
1185 artilist[ART_WEDDING_CHALLENGE].otyp = find_bridal_shoes();
1186 artilist[ART_ANACONDA_HEELS].otyp = find_pistol_boots();
1187 artilist[ART_JANA_S_DEVIOUSNESS].otyp = find_ng_shoes();
1188 artilist[ART_PLAYING_ANASTASIA].otyp = find_chelsea_boots();
1189 artilist[ART_JASIEEN_S_FEAR].otyp = find_wedge_espadrilles();
1190 artilist[ART_SHE_REALLY_LIKES_IT].otyp = find_treaded_heels();
1191 artilist[ART_SOARUP].otyp = find_higher_helmet();
1192 artilist[ART_GODLY_POSTMAN].otyp = find_winged_sandals();
1193 artilist[ART_SUCH_A_LOVELY_SHARK].otyp = find_remora_heels();
1194 artilist[ART_SPFLOTCH__HAHAHAHAHA_].otyp = find_heeled_chelsea_boots();
1195 artilist[ART_CLAUDIA_S_BEAUTY].otyp = find_superhard_sandals();
1196 artilist[ART_MAX_THE_SECRET_AGENT].otyp = find_telescope();
1197 artilist[ART_KATI_S_ANTAGONISM].otyp = find_telescope();
1198 artilist[ART_NOW_YOUR_ABLE_TO_POLY].otyp = find_osfa_cloak();
1199 artilist[ART_PINEAPPLE_TYCOON_S_FINISH].otyp = find_tarpaulin_cloak();
1200 artilist[ART_SAFARI_ROCKZ].otyp = find_missys();
1201 artilist[ART_SMILE_Z].otyp = find_missys();
1202 artilist[ART_SECRET_RAINBOW].otyp = find_missys();
1203 artilist[ART_YELLY].otyp = find_missys();
1204 artilist[ART_DEATHHEAD].otyp = find_missys();
1205 artilist[ART_MASK_OFF].otyp = find_missys();
1206 artilist[ART_SPARKLING_GOLD].otyp = find_missys();
1207 artilist[ART_PURPLE_SANDSTORM].otyp = find_missys();
1208 artilist[ART_SQUARE_ZONE].otyp = find_missys();
1209 artilist[ART_CUTE_JEANS].otyp = find_missys();
1210 artilist[ART_LOVELY_CORNFLOWER].otyp = find_missys();
1211 artilist[ART_GHETTO_ROCKZ].otyp = find_missys();
1212 artilist[ART_LAST_UNICORN].otyp = find_missys();
1213 artilist[ART_JUNGLE_LOVE].otyp = find_missys();
1214 artilist[ART_FRESH_PINK].otyp = find_missys();
1215 artilist[ART_BLUE_BLOSSOM].otyp = find_missys();
1216 artilist[ART_SIXX_PAXX].otyp = find_missys();
1217 artilist[ART_NEXT_LEVEL].otyp = find_missys();
1218 artilist[ART_PATCHWORK].otyp = find_missys();
1219 artilist[ART_MAGIC_BUTTERFLY].otyp = find_missys();
1220 artilist[ART_TOXIC_PINK].otyp = find_missys();
1221 artilist[ART_SPACE_SHUTTLE].otyp = find_missys();
1222 artilist[ART_ART_ROCKZ].otyp = find_missys();
1223 artilist[ART_COVER_UP].otyp = find_missys();
1224 artilist[ART_SPIRIT_ROCKZ].otyp = find_missys();
1225 artilist[ART_PURPLE_JUNGLE].otyp = find_missys();
1226 artilist[ART_EAZY_GOING].otyp = find_missys();
1227 artilist[ART_SIMPLY_WHITE].otyp = find_missys();
1228 artilist[ART_SIMPLY_BLACK].otyp = find_missys();
1229 artilist[ART_WOOD_FEELING].otyp = find_missys();
1230 artilist[ART_COLLEGE_ROCKZ].otyp = find_missys();
1231 artilist[ART_WELCOME_ON_BOARD].otyp = find_missys();
1232 artilist[ART_WONDERFUL_LOTUS].otyp = find_missys();
1233 artilist[ART_UNDERWATER_LOVE].otyp = find_missys();
1234 artilist[ART_SWEET_CHERRY].otyp = find_missys();
1235 artilist[ART_TIRE_ROCKZ].otyp = find_missys();
1236 artilist[ART_HAPPY_CLOUD].otyp = find_missys();
1237 artilist[ART_DELFI_ROCKZ].otyp = find_missys();
1238 artilist[ART_ALL_TIME_FAVZ].otyp = find_missys();
1239 artilist[ART_ROCKZ_ARMY].otyp = find_missys();
1240 artilist[ART_SKETCH_IT].otyp = find_missys();
1241 artilist[ART_POKERFACE].otyp = find_missys();
1242 artilist[ART_WHITE_KARMA].otyp = find_missys();
1243 artilist[ART_STREET_ROCKZ].otyp = find_missys();
1244 artilist[ART_BLACK_MANDALA].otyp = find_missys();
1245 artilist[ART_MY_LOVE].otyp = find_missys();
1246 artilist[ART_YES_I_ROCKZ].otyp = find_missys();
1247 artilist[ART_BUNNY_ROCKZ].otyp = find_missys();
1248 artilist[ART_CAT_ROCKZ].otyp = find_missys();
1249 artilist[ART_SCAN_ME].otyp = find_missys();
1250 artilist[ART_BACTERIA].otyp = find_missys();
1251 artilist[ART_JULIA_S_SLIPPERS].otyp = find_house_slippers();
1254 int tryct = 0;
1255 multiplymeagain:
1256 tryct++;
1257 int multiplyme = randartspellbook();
1258 while (objects[multiplyme].oc_skill != P_OCCULT_SPELL && tryct < 10000) goto multiplymeagain;
1259 artilist[ART_MULTIPLY_ME].otyp = multiplyme;
1264 /* zero out the artifact existence list */
1265 void
1266 init_artifacts()
1268 (void) memset((void *) artiexist, 0, sizeof artiexist);
1269 (void) memset((void *) artidisco, 0, sizeof artidisco);
1270 hack_artifacts();
1272 if (Race_if(PM_DE_ENERGISER) && !u.deenergisedone) {
1274 int quartinum = ART_ORB_OF_DETECTION;
1275 while (quartinum <= ART_PENUMBRAL_LASSO) {
1276 de_energise_artifact(quartinum);
1277 quartinum++;
1280 de_energise_artifact(ART_MOTHERFUCKER_TROPHY);
1281 de_energise_artifact(ART_ARKENSTONE_OF_THRAIN);
1282 de_energise_artifact(ART_NIGHTHORN);
1283 de_energise_artifact(ART_EYE_OF_THE_BEHOLDER);
1284 de_energise_artifact(ART_HAND_OF_VECNA);
1285 de_energise_artifact(ART_HELM_OF_KNOWLEDGE);
1286 de_energise_artifact(ART_BOOTS_OF_THE_MACHINE);
1287 de_energise_artifact(ART_KAL);
1288 de_energise_artifact(ART_BIZARRO_ORGASMATRON);
1289 de_energise_artifact(ART_KATIA_S_SOFT_COTTON);
1290 de_energise_artifact(ART_STAHNGNIR_S_BASHHUNK);
1291 de_energise_artifact(ART_PROCOMFORT_SUPER);
1292 u.deenergisedone = TRUE;
1297 /* Post u_init() initialization */
1298 void
1299 init_artifacts1()
1301 /* KMH -- Should be expert in quest artifact */
1302 if (urole.questarti && !isamerican && !Role_if(PM_ANACHRONOUNBINDER) &&
1303 (objects[artilist[urole.questarti].otyp].oc_class == WEAPON_CLASS ||
1304 objects[artilist[urole.questarti].otyp].oc_class == TOOL_CLASS)) {
1305 int skill = objects[artilist[urole.questarti].otyp].oc_skill;
1307 if (!isamerican && !Race_if(PM_BASTARD) && !(Race_if(PM_GREURO) && (skill == P_BOW || skill == P_CROSSBOW))) {
1309 if (skill > P_NONE && P_SKILL(skill) < P_UNSKILLED)
1310 P_SKILL(skill) = P_UNSKILLED;
1311 if (skill > P_NONE && P_MAX_SKILL(skill) < P_EXPERT) {
1312 if (wizard) pline("Warning: %s should be at least expert. Fixing...",
1313 artilist[urole.questarti].name);
1314 P_MAX_SKILL(skill) = P_EXPERT;
1320 void
1321 save_artifacts(fd)
1322 int fd;
1324 bwrite(fd, (void *) artiexist, sizeof artiexist);
1325 bwrite(fd, (void *) artidisco, sizeof artidisco);
1326 bwrite(fd, (void *) artilist, sizeof artilist);
1328 int articursor = (ART_FIREWALL - 1); /* gotta save them, goddammit! --Amy */
1329 while (articursor <= NROFARTIFACTS) {
1330 bwrite(fd, (void *) &artilist[articursor], sizeof(struct artifact));
1331 articursor++;
1337 void
1338 restore_artifacts(fd)
1339 int fd;
1341 const char *tname; /* bugfix by Chris_ANG */
1343 mread(fd, (void *) artiexist, sizeof artiexist);
1344 mread(fd, (void *) artidisco, sizeof artidisco);
1345 mread(fd, (void *) artilist, sizeof artilist);
1347 int articursor = (ART_FIREWALL - 1);
1348 while (articursor <= NROFARTIFACTS) {
1349 tname = artilist_pre[articursor].name;
1350 mread(fd, (void *) &artilist[articursor], sizeof(struct artifact));
1351 artilist[articursor].name = tname;
1352 articursor++;
1355 /*hack_artifacts();*/ /* redo non-saved special cases */
1358 const char *
1359 artiname(artinum)
1360 int artinum;
1362 if (artinum <= 0 || artinum > NROFARTIFACTS) return("");
1363 return(artilist[artinum].name);
1367 Make an artifact. If a specific alignment is specified, then an object of
1368 the appropriate alignment is created from scratch, or 0 is returned if
1369 none is available. (If at least one aligned artifact has already been
1370 given, then unaligned ones also become eligible for this.)
1371 If no alignment is given, then 'otmp' is converted
1372 into an artifact of matching type, or returned as-is if that's not possible.
1373 For the 2nd case, caller should use ``obj = mk_artifact(obj, A_NONE);''
1374 for the 1st, ``obj = mk_artifact((struct obj *)0, some_alignment);''.
1376 struct obj *
1377 mk_artifact(otmp, alignment, existingagain)
1378 struct obj *otmp; /* existing object; ignored if alignment specified */
1379 aligntyp alignment; /* target alignment, or A_NONE */
1380 boolean existingagain; /* if TRUE, existing ones can be generated again */
1382 const struct artifact *a;
1383 int n, m;
1384 boolean by_align = (alignment != A_NONE);
1385 /*short*/int o_typ = (by_align || !otmp) ? 0 : otmp->otyp;
1386 boolean unique = !by_align && otmp && objects[o_typ].oc_unique;
1387 /*short*/int eligible[NROFARTIFACTS];
1390 #if 0
1391 /* KMH, role patch -- Try first or second gift */
1392 m = urole.gift1arti;
1393 if (by_align && m && !artiexist[m]) {
1394 a = (struct artifact *)&artilist[m];
1395 goto make_artif;
1397 m = urole.gift2arti;
1398 if (by_align && m && !artiexist[m]) {
1399 a = (struct artifact *)&artilist[m];
1400 goto make_artif;
1402 #endif
1404 /* gather eligible artifacts */
1405 for (n = 0, a = artilist+1, m = 1; a->otyp; a++, m++)
1406 if ((!by_align ? a->otyp == o_typ :
1407 (a->alignment == alignment ||
1408 (a->alignment == A_NONE && u.ugifts > 0))) &&
1409 (!(a->spfx & SPFX_NOGEN) || unique) && !(a->otyp == ROCK && artiexist[m]) && !(a->otyp == WAN_DESLEXIFICATION && !issoviet) && (!artiexist[m] && !(a->spfx & SPFX_GIFTAGAIN) || (existingagain && !(a->spfx & SPFX_ONLYONE) ) )) {
1411 * [ALI] The determination of whether an artifact is
1412 * hostile to the player is a little more complex in
1413 * Slash'EM than Vanilla since there are artifacts
1414 * which are hostile to humans (eg., Deathsword) which
1415 * aren't aligned to any race.
1416 * Nevertheless, the rule remains the same: Gods don't
1417 * grant artifacts which would be hostile to the player
1418 * _in their normal form_.
1419 * Amy addition: wand of deslexification cannot be gifted to non-soviet, since that thing is supposed to
1420 * not exist outside of soviet mode.
1422 boolean hostile = FALSE;
1423 if (by_align) {
1424 if (a->race != NON_PM && race_hostile(&mons[a->race]))
1425 hostile = TRUE; /* enemies' equipment */
1426 else if (a->spfx & SPFX_DBONUS) {
1427 struct artifact tmp;
1429 tmp = *a;
1430 tmp.spfx &= SPFX_DBONUS;
1431 if (Upolyd)
1432 set_mon_data(&youmonst, &upermonst, 0);
1433 if (spec_applies(&tmp, &youmonst))
1434 hostile = TRUE; /* can blast unpolyd player */
1435 if (Upolyd)
1436 set_mon_data(&youmonst, &mons[u.umonnum], 0);
1439 if (hostile && rn2(10)) /* don't just make it not spawn at all, that's boring --Amy */
1440 continue;
1441 /* Amy evil patch change: remove guaranteed sacrifice gifts because we want variety. */
1442 if (by_align && !rn2(issoviet ? 2 : 5) && Role_if(a->role) && !artiexist[m])
1443 /* Now, you're still more likely than usual to get artifacts that are aligned with your role, but they are
1444 * by no means guaranteed. Instead, you're supposed to use whatever you get now. --Amy */
1445 goto make_artif; /* 'a' points to the desired one */
1446 else if(by_align && Role_if(PM_PIRATE)) continue; /* pirates are not gifted artifacts */
1447 else
1448 eligible[n++] = m;
1451 if (n) { /* found at least one candidate */
1452 m = eligible[rn2(n)]; /* [0..n-1] */
1453 a = &artilist[m];
1455 /* make an appropriate object if necessary, then christen it */
1456 make_artif: if (by_align) otmp = mksobj((int)a->otyp, TRUE, FALSE, FALSE);
1458 if ( (existingagain || (a->spfx & SPFX_GIFTAGAIN)) && !(a->spfx & SPFX_ONLYONE)) otmp = onameX(otmp, a->name);
1459 else otmp = oname(otmp, a->name);
1461 otmp->oartifact = m;
1463 /* usually mark artifact as existing... but not always :D --Amy */
1464 if (rn2(100)) artiexist[m] = TRUE;
1465 } else {
1466 /* nothing appropriate could be found; return the original object */
1467 if (by_align) otmp = 0; /* (there was no original object) */
1469 return otmp;
1472 /* Make an evil artifact and automatically equip it for the player --Amy
1473 * This can also always spawn another copy of an existing one (not a bug)
1474 * there are a few failsafes, e.g. it cannot be an amulet of strangulation (too deadly) and the item cannot weigh more
1475 * than 2x your weight cap because if you were to get instantly overloaded by the item, it might result in your death
1476 * without anything that you could do about it, which isn't fun at all */
1477 void
1478 bad_artifact()
1480 const struct artifact *a;
1481 int n, m;
1482 int eligible[NROFARTIFACTS];
1483 register struct obj *otmp;
1485 /* gather eligible artifacts */
1486 for (n = 0, a = artilist+1, m = 1; a->otyp; a++, m++)
1487 if (!(a->spfx & SPFX_NOGEN) && (a->spfx & SPFX_EVIL) && (objects[a->otyp].oc_weight < (weight_cap() * 2) ) && !(a->otyp == AMULET_OF_STRANGULATION) && !(a->otyp == WAN_DESLEXIFICATION && !issoviet) && !(a->otyp == ROCK && artiexist[m]) && (!(artiexist[m] && (a->spfx & SPFX_ONLYONE)) ) ) {
1489 eligible[n++] = m;
1492 if (n) { /* found at least one candidate */
1493 m = eligible[rn2(n)]; /* [0..n-1] */
1494 a = &artilist[m];
1496 /* make an appropriate object if necessary, then christen it */
1497 otmp = mksobj((int)a->otyp, TRUE, FALSE, FALSE);
1499 if (!otmp) return;
1501 otmp = onameX(otmp, a->name);
1503 if (!otmp) return;
1505 otmp->oartifact = m;
1506 if (otmp->otyp == LOADSTONE || otmp->otyp == STARLIGHTSTONE || otmp->otyp == LOADBOULDER) {
1507 otmp->quan = 1;
1508 otmp->owt = weight(otmp);
1511 if (rn2(100)) artiexist[m] = TRUE;
1512 } else {
1513 return; /* aww, there are no evil artifacts left... so don't make one. Bummer. */
1516 if (otmp) {
1517 (void) pickup_object(otmp, otmp->quan, TRUE, TRUE);
1520 /* try to equip it! */
1522 if (otmp) {
1524 u.cnd_badarticount++;
1526 if (otmp->oclass == WEAPON_CLASS || otmp->oclass == GEM_CLASS || otmp->oclass == BALL_CLASS || otmp->oclass == CHAIN_CLASS || otmp->oclass == VENOM_CLASS || is_weptool(otmp)) {
1527 if (uwep) setnotworn(uwep);
1528 if (bimanual(otmp)) {
1529 if (uswapwep) uswapwepgone();
1530 if (uarms) remove_worn_item(uarms, TRUE);
1532 if (!uwep) setuwep(otmp, FALSE, TRUE);
1533 if (otmp) curse(otmp);
1536 else if (is_blindfold_slot(otmp)) {
1537 if (ublindf) remove_worn_item(ublindf, TRUE);
1538 Blindf_on(otmp);
1539 if (otmp) curse(otmp);
1542 else if (otmp->oclass == RING_CLASS) {
1543 boolean righthand = rn2(2);
1544 if (righthand) {
1545 if (uright) remove_worn_item(uright, TRUE);
1546 setworn(otmp, RIGHT_RING);
1547 Ring_on(otmp);
1548 if (otmp) curse(otmp);
1549 } else {
1550 if (uleft) remove_worn_item(uleft, TRUE);
1551 setworn(otmp, LEFT_RING);
1552 Ring_on(otmp);
1553 if (otmp) curse(otmp);
1557 else if (otmp->oclass == AMULET_CLASS) {
1558 if (uamul) remove_worn_item(uamul, TRUE);
1559 setworn(otmp, W_AMUL);
1560 Amulet_on();
1561 if (otmp) curse(otmp);
1564 else if (otmp->oclass == IMPLANT_CLASS) {
1565 if (uimplant) remove_worn_item(uimplant, TRUE);
1566 setworn(otmp, W_IMPLANT);
1567 Implant_on();
1568 if (otmp) curse(otmp);
1571 else if (is_boots(otmp) && !(Race_if(PM_ELONA_SNAIL) && !ishighheeled(otmp))) {
1572 if (uarmf) remove_worn_item(uarmf, TRUE);
1573 setworn(otmp, W_ARMF);
1574 Boots_on();
1575 if (otmp) curse(otmp);
1578 else if (is_gloves(otmp)) {
1579 if (uarmg) remove_worn_item(uarmg, TRUE);
1580 setworn(otmp, W_ARMG);
1581 Gloves_on();
1582 if (otmp) curse(otmp);
1585 else if (is_helmet(otmp)) {
1586 if (uarmh) remove_worn_item(uarmh, TRUE);
1587 setworn(otmp, W_ARMH);
1588 Helmet_on();
1589 if (otmp) curse(otmp);
1592 else if (is_cloak(otmp)) {
1593 if (uarmc) remove_worn_item(uarmc, TRUE);
1594 setworn(otmp, W_ARMC);
1595 Cloak_on();
1596 if (otmp) curse(otmp);
1599 else if (is_shield(otmp)) {
1600 if (uarms) remove_worn_item(uarms, TRUE);
1601 setworn(otmp, W_ARMS);
1602 Shield_on();
1603 if (otmp) curse(otmp);
1606 else if (is_shirt(otmp)) {
1607 if (uarmu) remove_worn_item(uarmu, TRUE);
1608 setworn(otmp, W_ARMU);
1609 Shirt_on();
1610 if (otmp) curse(otmp);
1613 else if (is_suit(otmp)) {
1614 if (uskin) skinback(FALSE);
1615 if (uarm) remove_worn_item(uarm, TRUE);
1616 setworn(otmp, W_ARM);
1617 Armor_on();
1618 if (otmp) curse(otmp);
1621 if ( (is_nastygraystone(otmp) || is_feminismstone(otmp)) ) {
1622 if (!rn2(3)) otmp->cursed = otmp->hvycurse = TRUE;
1623 if (!rn2(3)) otmp->cursed = otmp->stckcurse = TRUE;
1626 if (ArtificialXtra) {
1627 if (!rn2(2)) {
1628 otmp->cursed = otmp->hvycurse = TRUE;
1629 if (!rn2(5)) otmp->prmcurse = TRUE;
1631 if (!rn2(2)) {
1632 otmp->cursed = otmp->stckcurse = TRUE;
1640 /* The same bad artifact effect, but if there is a skill for the generated item, have a chance of learning it --Amy
1641 * Again, this can create a copy of an already existing one */
1642 void
1643 bad_artifact_xtra()
1645 const struct artifact *a;
1646 int n, m;
1647 int eligible[NROFARTIFACTS];
1648 register struct obj *otmp;
1650 /* gather eligible artifacts */
1651 for (n = 0, a = artilist+1, m = 1; a->otyp; a++, m++)
1652 if (!(a->spfx & SPFX_NOGEN) && (a->spfx & SPFX_EVIL) && (objects[a->otyp].oc_weight < (weight_cap() * 2) ) && !(a->otyp == AMULET_OF_STRANGULATION) && !(a->otyp == WAN_DESLEXIFICATION && !issoviet) && !(a->otyp == ROCK && artiexist[m]) && (!(artiexist[m] && (a->spfx & SPFX_ONLYONE)) ) ) {
1654 eligible[n++] = m;
1657 if (n) { /* found at least one candidate */
1658 m = eligible[rn2(n)]; /* [0..n-1] */
1659 a = &artilist[m];
1661 /* make an appropriate object if necessary, then christen it */
1662 otmp = mksobj((int)a->otyp, TRUE, FALSE, FALSE);
1664 if (!otmp) return;
1666 otmp = onameX(otmp, a->name);
1668 if (!otmp) return;
1670 otmp->oartifact = m;
1672 if (otmp->otyp == LOADSTONE || otmp->otyp == STARLIGHTSTONE || otmp->otyp == LOADBOULDER) {
1673 otmp->quan = 1;
1674 otmp->owt = weight(otmp);
1677 if (rn2(100)) artiexist[m] = TRUE;
1678 } else {
1679 return; /* aww, there are no evil artifacts left... so don't make one. Bummer. */
1682 if (otmp) {
1683 int evfskill = get_obj_skill(otmp, TRUE);
1685 if (P_MAX_SKILL(evfskill) == P_ISRESTRICTED) {
1686 unrestrict_weapon_skill(evfskill);
1687 } else if (P_MAX_SKILL(evfskill) == P_UNSKILLED) {
1688 unrestrict_weapon_skill(evfskill);
1689 P_MAX_SKILL(evfskill) = P_BASIC;
1690 } else if (rn2(2) && P_MAX_SKILL(evfskill) == P_BASIC) {
1691 P_MAX_SKILL(evfskill) = P_SKILLED;
1692 } else if (!rn2(4) && P_MAX_SKILL(evfskill) == P_SKILLED) {
1693 P_MAX_SKILL(evfskill) = P_EXPERT;
1694 } else if (!rn2(10) && P_MAX_SKILL(evfskill) == P_EXPERT) {
1695 P_MAX_SKILL(evfskill) = P_MASTER;
1696 } else if (!rn2(100) && P_MAX_SKILL(evfskill) == P_MASTER) {
1697 P_MAX_SKILL(evfskill) = P_GRAND_MASTER;
1698 } else if (!rn2(200) && P_MAX_SKILL(evfskill) == P_GRAND_MASTER) {
1699 P_MAX_SKILL(evfskill) = P_SUPREME_MASTER;
1702 if (Race_if(PM_RUSMOT)) {
1703 if (P_MAX_SKILL(evfskill) == P_ISRESTRICTED) {
1704 unrestrict_weapon_skill(evfskill);
1705 } else if (P_MAX_SKILL(evfskill) == P_UNSKILLED) {
1706 unrestrict_weapon_skill(evfskill);
1707 P_MAX_SKILL(evfskill) = P_BASIC;
1708 } else if (rn2(2) && P_MAX_SKILL(evfskill) == P_BASIC) {
1709 P_MAX_SKILL(evfskill) = P_SKILLED;
1710 } else if (!rn2(4) && P_MAX_SKILL(evfskill) == P_SKILLED) {
1711 P_MAX_SKILL(evfskill) = P_EXPERT;
1712 } else if (!rn2(10) && P_MAX_SKILL(evfskill) == P_EXPERT) {
1713 P_MAX_SKILL(evfskill) = P_MASTER;
1714 } else if (!rn2(100) && P_MAX_SKILL(evfskill) == P_MASTER) {
1715 P_MAX_SKILL(evfskill) = P_GRAND_MASTER;
1716 } else if (!rn2(200) && P_MAX_SKILL(evfskill) == P_GRAND_MASTER) {
1717 P_MAX_SKILL(evfskill) = P_SUPREME_MASTER;
1721 (void) pickup_object(otmp, otmp->quan, TRUE, TRUE);
1725 /* try to equip it! */
1727 if (otmp) {
1729 u.cnd_badarticount++;
1731 if (otmp->oclass == WEAPON_CLASS || otmp->oclass == GEM_CLASS || otmp->oclass == BALL_CLASS || otmp->oclass == CHAIN_CLASS || otmp->oclass == VENOM_CLASS || is_weptool(otmp)) {
1732 if (uwep) setnotworn(uwep);
1733 if (bimanual(otmp)) {
1734 if (uswapwep) uswapwepgone();
1735 if (uarms) remove_worn_item(uarms, TRUE);
1737 if (!uwep) setuwep(otmp, FALSE, TRUE);
1738 if (otmp) curse(otmp);
1741 else if (is_blindfold_slot(otmp)) {
1742 if (ublindf) remove_worn_item(ublindf, TRUE);
1743 Blindf_on(otmp);
1744 if (otmp) curse(otmp);
1747 else if (otmp->oclass == RING_CLASS) {
1748 boolean righthand = rn2(2);
1749 if (righthand) {
1750 if (uright) remove_worn_item(uright, TRUE);
1751 setworn(otmp, RIGHT_RING);
1752 Ring_on(otmp);
1753 if (otmp) curse(otmp);
1754 } else {
1755 if (uleft) remove_worn_item(uleft, TRUE);
1756 setworn(otmp, LEFT_RING);
1757 Ring_on(otmp);
1758 if (otmp) curse(otmp);
1762 else if (otmp->oclass == AMULET_CLASS) {
1763 if (uamul) remove_worn_item(uamul, TRUE);
1764 setworn(otmp, W_AMUL);
1765 Amulet_on();
1766 if (otmp) curse(otmp);
1769 else if (otmp->oclass == IMPLANT_CLASS) {
1770 if (uimplant) remove_worn_item(uimplant, TRUE);
1771 setworn(otmp, W_IMPLANT);
1772 Implant_on();
1773 if (otmp) curse(otmp);
1776 else if (is_boots(otmp) && !(Race_if(PM_ELONA_SNAIL) && !ishighheeled(otmp))) {
1777 if (uarmf) remove_worn_item(uarmf, TRUE);
1778 setworn(otmp, W_ARMF);
1779 Boots_on();
1780 if (otmp) curse(otmp);
1783 else if (is_gloves(otmp)) {
1784 if (uarmg) remove_worn_item(uarmg, TRUE);
1785 setworn(otmp, W_ARMG);
1786 Gloves_on();
1787 if (otmp) curse(otmp);
1790 else if (is_helmet(otmp)) {
1791 if (uarmh) remove_worn_item(uarmh, TRUE);
1792 setworn(otmp, W_ARMH);
1793 Helmet_on();
1794 if (otmp) curse(otmp);
1797 else if (is_cloak(otmp)) {
1798 if (uarmc) remove_worn_item(uarmc, TRUE);
1799 setworn(otmp, W_ARMC);
1800 Cloak_on();
1801 if (otmp) curse(otmp);
1804 else if (is_shield(otmp)) {
1805 if (uarms) remove_worn_item(uarms, TRUE);
1806 setworn(otmp, W_ARMS);
1807 Shield_on();
1808 if (otmp) curse(otmp);
1811 else if (is_shirt(otmp)) {
1812 if (uarmu) remove_worn_item(uarmu, TRUE);
1813 setworn(otmp, W_ARMU);
1814 Shirt_on();
1815 if (otmp) curse(otmp);
1818 else if (is_suit(otmp)) {
1819 if (uskin) skinback(FALSE);
1820 if (uarm) remove_worn_item(uarm, TRUE);
1821 setworn(otmp, W_ARM);
1822 Armor_on();
1823 if (otmp) curse(otmp);
1826 if ( (is_nastygraystone(otmp) || is_feminismstone(otmp)) ) {
1827 if (!rn2(3)) otmp->cursed = otmp->hvycurse = TRUE;
1828 if (!rn2(3)) otmp->cursed = otmp->stckcurse = TRUE;
1831 if (ArtificialXtra) {
1832 if (!rn2(2)) {
1833 otmp->cursed = otmp->hvycurse = TRUE;
1834 if (!rn2(5)) otmp->prmcurse = TRUE;
1836 if (!rn2(2)) {
1837 otmp->cursed = otmp->stckcurse = TRUE;
1846 * Returns the full name (with articles and correct capitalization) of an
1847 * artifact named "name" if one exists, or NULL, it not.
1848 * The given name must be rather close to the real name for it to match.
1849 * The object type of the artifact is returned in otyp if the return value
1850 * is non-NULL.
1852 const char*
1853 artifact_name(name, otyp)
1854 const char *name;
1855 int *otyp;
1857 register const struct artifact *a;
1858 register const char *aname;
1860 if(!strncmpi(name, "the ", 4)) name += 4;
1861 if(!strncmpi(name, "poisoned ", 9)) name += 9;
1863 for (a = artilist+1; a->otyp; a++) {
1864 aname = a->name;
1865 if(!strncmpi(aname, "the ", 4)) aname += 4;
1866 if(!strcmpi(name, aname)) {
1867 *otyp = a->otyp;
1868 return a->name;
1872 return (char *)0;
1875 boolean
1876 exist_artifact(otyp, name)
1877 register int otyp;
1878 register const char *name;
1880 register const struct artifact *a;
1881 register boolean *arex;
1883 if (otyp && *name)
1884 for (a = artilist+1,arex = artiexist+1; a->otyp; a++,arex++)
1885 if ((int) a->otyp == otyp && !strcmp(a->name, name))
1886 return *arex;
1887 return FALSE;
1890 void
1891 artifact_exists(otmp, name, mod)
1892 register struct obj *otmp;
1893 register const char *name;
1894 register boolean mod;
1896 register const struct artifact *a;
1898 boolean artimatch = FALSE;
1900 if (otmp && *name)
1901 for (a = artilist+1; a->otyp; a++) {
1903 artimatch = FALSE;
1904 if (a->otyp == otmp->otyp) artimatch = TRUE;
1905 if (a->otyp == WORM_TOOTH && otmp->otyp == CRYSKNIFE) artimatch = TRUE;
1906 if (a->otyp == CRYSKNIFE && otmp->otyp == WORM_TOOTH) artimatch = TRUE;
1908 if (artimatch && !strcmp(a->name, name)) {
1909 register int m = a - artilist;
1910 otmp->oartifact = (/*char*/int)(mod ? m : 0);
1912 if (otmp && otmp->oartifact == ART_NOOBNOOBNOOB && Role_if(PM_NOOB_MODE_BARB)) {
1913 FemaleTrapCharlotte |= FROMOUTSIDE;
1914 if (!FemtrapActiveRuth) {
1915 pline("The feminism power compels you because you're such a noob...");
1916 pline("Watch out, the Bang Gang is considering you a target. They're coming for you, and they have some tricks and traps ready.");
1920 if (otmp && otmp->oartifact == ART_VADER_S_CHARGE) otmp->age += rnz(5000);
1921 if (otmp && otmp->oartifact == ART_TAVION_S_CHARGE) otmp->age += rnz(5000);
1922 if (otmp && otmp->oartifact == ART_DURATEX) otmp->age += 4000;
1923 if (otmp && otmp->oartifact == ART_BURNER_DREAM) otmp->age += 2000;
1924 if (otmp && otmp->oartifact == ART_OWENER) otmp->age = 0;
1925 if (otmp && otmp->oartifact == ART_OUT_OILED) otmp->age = 0;
1926 if (otmp && otmp->oartifact == ART_PSEUDO_MAGIC_LAMP) {
1927 otmp->age *= 10;
1928 otmp->age += rnz(10000);
1930 if (otmp && otmp->oartifact == ART_MYSTERIOUS_SPIKES) {
1931 otmp->quan = 1;
1932 otmp->owt = weight(otmp);
1934 if (otmp && otmp->oartifact == ART_BUS_ERROR) {
1935 otmp->quan = 1;
1936 otmp->owt = weight(otmp);
1938 if (otmp && otmp->oartifact == ART_HOL_ON_MAN) {
1939 otmp->quan = 1;
1940 otmp->owt = weight(otmp);
1942 if (otmp && otmp->oartifact == ART_RIDGET_PHASTO) {
1943 otmp->quan = 1;
1944 otmp->owt = weight(otmp);
1946 if (otmp && otmp->oartifact == ART_RAGGO_S_ROCK) {
1947 otmp->quan = 1;
1948 otmp->owt = weight(otmp);
1950 if (otmp && otmp->oartifact == ART_SIEGFRIED_S_DEATHBOLT) {
1951 otmp->quan = 1;
1952 otmp->owt = weight(otmp);
1954 if (otmp && otmp->oartifact == ART_SIGMUND_S_SMALL_LOAD) {
1955 otmp->quan = 1;
1956 otmp->owt = weight(otmp);
1958 if (otmp && otmp->oartifact == ART_WORTH_CHECKING_OUT && otmp->spe == 0) {
1959 if (rn2(2)) otmp->spe = -rne(Race_if(PM_LISTENER) ? 3 : 2);
1960 else otmp->spe = rne(Race_if(PM_LISTENER) ? 3 : 2);
1962 if (otmp && otmp->oartifact == ART_NINER) {
1963 otmp->spe += 9;
1965 if (otmp && otmp->oartifact == ART_SAVOS__SAGERY) {
1966 otmp->spe += 2;
1968 if (otmp && otmp->oartifact == ART_PWNZORCHANT) {
1969 if (otmp->spe > 0) otmp->spe *= 2;
1970 otmp->spe += 3;
1972 if (otmp && otmp->oartifact == ART_WELL__MIGHT_AS_WELL_WEAR_T) {
1973 FemaleTrapJette += 50000;
1975 if (otmp && otmp->oartifact == ART_WHOA_DOUBLE___) {
1976 otmp->spe += rnd(10);
1979 if (otmp && otmp->oartifact == ART_FIGHTEBOSSIT) {
1980 (void) makemon(specialtensmon(165), 0, 0, MM_ADJACENTOK); /* G_UNIQ */
1983 if (otmp && otmp->oartifact == ART_LEGENDARY_BATTLE) {
1984 int tryct = 0;
1985 int x, y;
1986 for (tryct = 0; tryct < 2000; tryct++) {
1987 x = rn1(COLNO-3,2);
1988 y = rn2(ROWNO);
1990 if (isok(x, y) && (levl[x][y].typ > DBWALL) && !(t_at(x, y)) ) {
1991 (void) maketrap(x, y, BOSS_SPAWNER, 0, FALSE);
1992 if (wizard) pline("boss spawner at %d,%d", x, y);
1993 break;
1998 if (otmp && otmp->oartifact == ART_PITCH_HAD_) {
1999 NastinessProblem += 1000; /* no message, this is intentional --Amy */
2002 if (otmp && otmp->oartifact == ART_LUCKY_GENERATION) {
2003 pline("Luck smiles upon you...");
2005 if (P_MAX_SKILL(P_FLAIL) == P_ISRESTRICTED) {
2006 unrestrict_weapon_skill(P_FLAIL);
2007 pline("You can now learn the flail skill!");
2008 } else if (P_MAX_SKILL(P_FLAIL) == P_UNSKILLED) {
2009 unrestrict_weapon_skill(P_FLAIL);
2010 pline("You can now learn the flail skill!");
2011 P_MAX_SKILL(P_FLAIL) = P_BASIC;
2012 } else if (P_MAX_SKILL(P_FLAIL) == P_BASIC) {
2013 P_MAX_SKILL(P_FLAIL) = P_SKILLED;
2014 pline("You can now become skilled with flails!");
2015 } else if (P_MAX_SKILL(P_FLAIL) == P_SKILLED) {
2016 P_MAX_SKILL(P_FLAIL) = P_EXPERT;
2017 pline("You can now become expert with flails!");
2018 } else if (P_MAX_SKILL(P_FLAIL) == P_EXPERT) {
2019 P_MAX_SKILL(P_FLAIL) = P_MASTER;
2020 pline("You can now become master with flails!");
2021 } else if (P_MAX_SKILL(P_FLAIL) == P_MASTER) {
2022 P_MAX_SKILL(P_FLAIL) = P_GRAND_MASTER;
2023 pline("You can now become grand master with flails!");
2024 } else if (P_MAX_SKILL(P_FLAIL) == P_GRAND_MASTER) {
2025 P_MAX_SKILL(P_FLAIL) = P_SUPREME_MASTER;
2026 pline("You can now become supreme master with flails!");
2027 } else pline("Sadly your knowledge of the flail skill is already maxed.");
2031 if (otmp && otmp->oartifact == ART_MAIN_CONTAINER) {
2032 int maincontainerclass = WEAPON_CLASS;
2033 int maincontaineramount = 10;
2035 register struct obj *ocont;
2037 if (!rn2(1000)) maincontainerclass = BALL_CLASS;
2038 else if (!rn2(2000)) maincontainerclass = CHAIN_CLASS;
2039 else if (!rn2(1000)) maincontainerclass = VENOM_CLASS;
2040 else if (!rn2(1000)) maincontainerclass = ROCK_CLASS;
2041 else if (!rn2(1000)) maincontainerclass = IMPLANT_CLASS;
2042 else switch (rnd(11)) {
2043 case 1: maincontainerclass = WEAPON_CLASS; break;
2044 case 2: maincontainerclass = ARMOR_CLASS; break;
2045 case 3: maincontainerclass = RING_CLASS; break;
2046 case 4: maincontainerclass = AMULET_CLASS; break;
2047 case 5: maincontainerclass = WAND_CLASS; break;
2048 case 6: maincontainerclass = SPBOOK_CLASS; break;
2049 case 7: maincontainerclass = SCROLL_CLASS; break;
2050 case 8: maincontainerclass = POTION_CLASS; break;
2051 case 9: maincontainerclass = TOOL_CLASS; break;
2052 case 10: maincontainerclass = FOOD_CLASS; break;
2053 case 11: maincontainerclass = GEM_CLASS; break;
2056 while (maincontaineramount > 0) {
2057 maincontaineramount--;
2058 ocont = mkobj(maincontainerclass, FALSE, FALSE);
2059 if (ocont) {
2060 ocont->owt = weight(ocont);
2061 (void) add_to_container(otmp, ocont, TRUE);
2067 if (otmp && otmp->oartifact == ART_FAILPRIZE) {
2068 if (Has_contents(otmp)) delete_contents(otmp);
2071 if (otmp && otmp->oartifact == ART_EQUIFRIEND) {
2072 register struct obj *ocont;
2073 ocont = mkobj(WEAPON_CLASS, FALSE, FALSE);
2074 if (ocont) {
2075 ocont->owt = weight(ocont);
2076 (void) add_to_container(otmp, ocont, TRUE);
2078 ocont = mkobj(ARMOR_CLASS, FALSE, FALSE);
2079 if (ocont) {
2080 ocont->owt = weight(ocont);
2081 (void) add_to_container(otmp, ocont, TRUE);
2086 if (otmp && otmp->oartifact == ART_TOOLBOX) {
2087 int maincontaineramount = 3;
2089 register struct obj *ocont;
2091 while (maincontaineramount > 0) {
2092 maincontaineramount--;
2093 ocont = mkobj(TOOL_CLASS, FALSE, FALSE);
2094 if (ocont) {
2095 ocont->owt = weight(ocont);
2096 (void) add_to_container(otmp, ocont, TRUE);
2102 if (otmp && otmp->oartifact == ART_IMPLANTOLOGY) {
2103 int maincontaineramount = rnd(3);
2105 register struct obj *ocont;
2107 while (maincontaineramount > 0) {
2108 maincontaineramount--;
2109 ocont = mkobj(IMPLANT_CLASS, FALSE, FALSE);
2110 if (ocont) {
2111 ocont->owt = weight(ocont);
2112 (void) add_to_container(otmp, ocont, TRUE);
2118 if (otmp && otmp->oartifact == ART_SPELLIBRARY) {
2119 int maincontaineramount = rnd(3);
2121 register struct obj *ocont;
2123 while (maincontaineramount > 0) {
2124 maincontaineramount--;
2125 ocont = mkobj(SPBOOK_CLASS, FALSE, FALSE);
2126 if (ocont) {
2127 ocont->owt = weight(ocont);
2128 (void) add_to_container(otmp, ocont, TRUE);
2134 if (otmp && otmp->oartifact == ART_VENOSTASH) {
2135 int maincontaineramount = rnd(5);
2137 register struct obj *ocont;
2139 while (maincontaineramount > 0) {
2140 maincontaineramount--;
2141 ocont = mkobj(VENOM_CLASS, FALSE, FALSE);
2142 if (ocont) {
2143 ocont->owt = weight(ocont);
2144 (void) add_to_container(otmp, ocont, TRUE);
2150 if (otmp && otmp->oartifact == ART_DEMONSEAL) {
2151 int maincontainerclass = WEAPON_CLASS;
2152 int maincontaineramount = 50;
2154 register struct obj *ocont;
2156 if (!rn2(1000)) maincontainerclass = BALL_CLASS;
2157 else if (!rn2(2000)) maincontainerclass = CHAIN_CLASS;
2158 else if (!rn2(1000)) maincontainerclass = VENOM_CLASS;
2159 else if (!rn2(1000)) maincontainerclass = ROCK_CLASS;
2160 else if (!rn2(1000)) maincontainerclass = IMPLANT_CLASS;
2161 else switch (rnd(11)) {
2162 case 1: maincontainerclass = WEAPON_CLASS; break;
2163 case 2: maincontainerclass = ARMOR_CLASS; break;
2164 case 3: maincontainerclass = RING_CLASS; break;
2165 case 4: maincontainerclass = AMULET_CLASS; break;
2166 case 5: maincontainerclass = WAND_CLASS; break;
2167 case 6: maincontainerclass = SPBOOK_CLASS; break;
2168 case 7: maincontainerclass = SCROLL_CLASS; break;
2169 case 8: maincontainerclass = POTION_CLASS; break;
2170 case 9: maincontainerclass = TOOL_CLASS; break;
2171 case 10: maincontainerclass = FOOD_CLASS; break;
2172 case 11: maincontainerclass = GEM_CLASS; break;
2175 while (maincontaineramount > 0) {
2176 maincontaineramount--;
2177 ocont = mkobj(maincontainerclass, FALSE, FALSE);
2178 if (ocont) {
2179 ocont->owt = weight(ocont);
2180 (void) add_to_container(otmp, ocont, TRUE);
2186 if (otmp && otmp->oartifact == ART_HOARDS_OF_TREASURE) {
2188 int maincontaineramount = 50;
2190 register struct obj *ocont;
2192 while (maincontaineramount > 0) {
2193 maincontaineramount--;
2194 ocont = mkobj(RANDOM_CLASS, FALSE, FALSE);
2195 if (ocont) {
2196 ocont->owt = weight(ocont);
2197 (void) add_to_container(otmp, ocont, TRUE);
2203 if (otmp && otmp->oartifact == ART_BOOTY_CASE) {
2205 int maincontaineramount = rnd(3);
2207 register struct obj *ocont;
2209 while (maincontaineramount > 0) {
2210 maincontaineramount--;
2211 ocont = mkobj(RANDOM_CLASS, FALSE, FALSE);
2212 if (ocont) {
2213 ocont->owt = weight(ocont);
2214 (void) add_to_container(otmp, ocont, TRUE);
2220 if (otmp && otmp->oartifact == ART_PIRATE_TREASURE) {
2222 int maincontaineramount = rnd(6);
2224 register struct obj *ocont;
2226 while (maincontaineramount > 0) {
2227 maincontaineramount--;
2228 ocont = mkobj(RANDOM_CLASS, FALSE, FALSE);
2229 if (ocont) {
2230 ocont->owt = weight(ocont);
2231 (void) add_to_container(otmp, ocont, TRUE);
2237 if (otmp && otmp->oartifact == ART_HOLDYMANY) {
2239 int maincontaineramount = 5;
2241 register struct obj *ocont;
2243 while (maincontaineramount > 0) {
2244 maincontaineramount--;
2245 ocont = mkobj(RANDOM_CLASS, FALSE, FALSE);
2246 if (ocont) {
2247 ocont->owt = weight(ocont);
2248 (void) add_to_container(otmp, ocont, TRUE);
2254 if (otmp && otmp->oartifact == ART_KILILILILI_KILI) {
2255 register struct obj *ocont;
2257 ocont = mksobj(SCR_WISHING, TRUE, FALSE, FALSE);
2258 if (ocont) {
2259 curse(ocont);
2260 ocont->hvycurse = TRUE;
2261 ocont->owt = weight(ocont);
2262 (void) add_to_container(otmp, ocont, TRUE);
2267 if (otmp && otmp->oartifact == ART_MEGAKITROOFTM) {
2268 register struct obj *ocont;
2270 ocont = mksobj(SCR_RELOCATION, TRUE, FALSE, FALSE);
2271 if (ocont) {
2272 ocont->quan = 2;
2273 ocont->owt = weight(ocont);
2274 (void) add_to_container(otmp, ocont, TRUE);
2277 ocont = mksobj(SCR_RETURN, TRUE, FALSE, FALSE);
2278 if (ocont) {
2279 ocont->quan = 5;
2280 ocont->owt = weight(ocont);
2281 (void) add_to_container(otmp, ocont, TRUE);
2284 ocont = mksobj(POT_DOWN_LEVEL, TRUE, FALSE, FALSE);
2285 if (ocont) {
2286 ocont->quan = 1;
2287 ocont->owt = weight(ocont);
2288 (void) add_to_container(otmp, ocont, TRUE);
2291 ocont = mksobj(POT_GAIN_LEVEL, TRUE, FALSE, FALSE);
2292 if (ocont) {
2293 ocont->quan = 3;
2294 ocont->owt = weight(ocont);
2295 (void) add_to_container(otmp, ocont, TRUE);
2298 ocont = mksobj(WAN_TRAP_DISARMING, TRUE, FALSE, FALSE);
2299 if (ocont) {
2300 ocont->owt = weight(ocont);
2301 (void) add_to_container(otmp, ocont, TRUE);
2306 if (otmp && otmp->oartifact == ART_ASSLOAD_OF_LOOT) {
2308 int maincontaineramount = rn1(100, 100);
2310 register struct obj *ocont;
2312 while (maincontaineramount > 0) {
2313 maincontaineramount--;
2314 ocont = mkobj(RANDOM_CLASS, FALSE, FALSE);
2315 if (ocont) {
2316 ocont->owt = weight(ocont);
2317 (void) add_to_container(otmp, ocont, TRUE);
2323 if (otmp && otmp->oartifact == ART_CORONA_S_TOLL) {
2324 int maincontaineramount = rnd(120);
2326 register struct obj *ocont;
2328 while (maincontaineramount > 0) {
2329 maincontaineramount--;
2330 ocont = mksobj(!rn2(3) ? PILL : rn2(2) ? BANDAGE : PHIAL, TRUE, FALSE, FALSE);
2331 if (ocont) {
2332 ocont->owt = weight(ocont);
2333 (void) add_to_container(otmp, ocont, TRUE);
2339 if (otmp && otmp->oartifact == ART_SYKES_S_INFINITY) {
2340 int maincontaineramount = rnd(180);
2342 register struct obj *ocont;
2344 while (maincontaineramount > 0) {
2345 maincontaineramount--;
2346 ocont = mksobj(BANDAGE, TRUE, FALSE, FALSE);
2347 if (ocont) {
2348 ocont->owt = weight(ocont);
2349 (void) add_to_container(otmp, ocont, TRUE);
2355 if (otmp && otmp->oartifact == ART_FORTY_FOUR_IS_LUCK) {
2357 register struct obj *ocont;
2359 int extraboxitems = 5;
2360 while (extraboxitems > 0) {
2361 extraboxitems--;
2362 ocont = mksobj(makemusableitem(), TRUE, TRUE, FALSE);
2363 if (ocont) {
2364 ocont->owt = weight(ocont);
2365 (void) add_to_container(otmp, ocont, TRUE);
2371 if (otmp && otmp->oartifact == ART_EATBONANZA) {
2373 register struct obj *ocont;
2375 int maincontaineramount = rnd(100);
2377 while (maincontaineramount > 0) {
2378 maincontaineramount--;
2379 register struct obj *ocont;
2380 ocont = mksobj(CORPSE, TRUE, FALSE, FALSE);
2381 if (ocont) {
2383 ocont->age = 0L;
2384 ocont->icedobject = TRUE;
2385 if (ocont->timed) {
2386 (void) stop_timer(ROT_CORPSE, (void *)ocont);
2387 (void) stop_timer(MOLDY_CORPSE, (void *)ocont);
2388 (void) stop_timer(REVIVE_MON, (void *)ocont);
2391 ocont->owt = weight(ocont);
2392 (void) add_to_container(otmp, ocont, TRUE);
2398 if (otmp && otmp->oartifact == ART_WEAPONMEMORY) {
2400 int maincontaineramount = 10;
2402 register struct obj *ocont;
2404 while (maincontaineramount > 0) {
2405 maincontaineramount--;
2406 ocont = mkobj(WEAPON_CLASS, FALSE, FALSE);
2407 if (ocont) {
2408 ocont->owt = weight(ocont);
2409 (void) add_to_container(otmp, ocont, TRUE);
2415 if (otmp && otmp->oartifact == ART_ARMORMEMORY) {
2417 int maincontaineramount = 10;
2419 register struct obj *ocont;
2421 while (maincontaineramount > 0) {
2422 maincontaineramount--;
2423 ocont = mkobj(ARMOR_CLASS, FALSE, FALSE);
2424 if (ocont) {
2425 ocont->owt = weight(ocont);
2426 (void) add_to_container(otmp, ocont, TRUE);
2432 if (otmp && otmp->oartifact == ART_EMERGENCY_CASH) {
2434 register struct obj *ocont;
2435 ocont = mksobj(GOLD_PIECE, FALSE, FALSE, FALSE);
2436 ocont->quan = rn1(10000,10000);
2437 if (ocont) {
2438 ocont->owt = weight(ocont);
2439 (void) add_to_container(otmp, ocont, TRUE);
2443 if (otmp && otmp->oartifact == ART_DOLLAR_DEPOSIT) {
2445 register struct obj *ocont;
2446 ocont = mksobj(GOLD_PIECE, FALSE, FALSE, FALSE);
2447 ocont->quan = 10000;
2448 if (ocont) {
2449 ocont->owt = weight(ocont);
2450 (void) add_to_container(otmp, ocont, TRUE);
2454 if (otmp && otmp->oartifact == ART_OORTOCASH) {
2456 register struct obj *ocont;
2457 ocont = mksobj(GOLD_PIECE, FALSE, FALSE, FALSE);
2458 ocont->quan = rnz(2000);
2459 if (ocont) {
2460 ocont->owt = weight(ocont);
2461 (void) add_to_container(otmp, ocont, TRUE);
2465 if (otmp && otmp->oartifact == ART_ARTI_LOCKBOX) {
2466 register struct obj *ocont;
2468 boolean havegifts = u.ugifts;
2470 if (!havegifts) u.ugifts++;
2472 ocont = mk_artifact((struct obj *)0, !rn2(3) ? A_CHAOTIC : rn2(2) ? A_NEUTRAL : A_LAWFUL, TRUE);
2473 if (ocont) {
2474 ocont->owt = weight(ocont);
2475 (void) add_to_container(otmp, ocont, TRUE);
2478 if (!havegifts) u.ugifts--;
2482 if (otmp && otmp->oartifact == ART_RURIHUNT) {
2483 register struct obj *ocont;
2485 int ruricount = rnd(3);
2486 while (ruricount > 0) {
2488 ruricount--;
2489 boolean havegifts = u.ugifts;
2491 if (!havegifts) u.ugifts++;
2493 ocont = mk_artifact((struct obj *)0, !rn2(3) ? A_CHAOTIC : rn2(2) ? A_NEUTRAL : A_LAWFUL, TRUE);
2494 if (ocont) {
2495 ocont->owt = weight(ocont);
2496 (void) add_to_container(otmp, ocont, TRUE);
2499 if (!havegifts) u.ugifts--;
2504 if (otmp && otmp->oartifact == ART_BAEAU) {
2505 otmp->spe += rnd(10);
2507 if (otmp && otmp->oartifact == ART_YOUR_LUCKY_DAY) {
2508 switch (otmp->otyp) {
2509 case WAN_WISHING:
2510 case WAN_CHARGING:
2511 case WAN_ACQUIREMENT:
2512 case WAN_GAIN_LEVEL:
2513 case WAN_INCREASE_MAX_HITPOINTS:
2514 otmp->spe += Role_if(PM_WANDKEEPER) ? 3 : 1;
2515 break;
2516 default:
2517 otmp->spe += Role_if(PM_WANDKEEPER) ? 50 : 20;
2518 break;
2521 if (otmp && otmp->oartifact == ART_TADA) {
2522 otmp->spe += 10;
2524 if (otmp && otmp->oartifact == ART_LIBRARY_HIDING) {
2525 otmp->oinvis = TRUE;
2527 if (otmp && otmp->oartifact == ART_DAT_S_GOD) {
2528 otmp->oerodeproof = TRUE;
2530 if (otmp && otmp->oartifact == ART_DON_T_GO_AWAY) {
2531 otmp->oerodeproof = TRUE;
2533 if (otmp && otmp->oartifact == ART_SUK_ME_HAHAHAHAHAH) {
2534 otmp->greased = rnd(3);
2536 if (otmp && otmp->oartifact == ART_START_WITH_EVERYTHING) {
2537 otmp->greased = 3;
2538 otmp->oerodeproof = TRUE;
2539 otmp->enchantment = randenchantment();
2541 if (otmp && otmp->oartifact == ART_WEAR_OFF_THE_DAMN_RNG) {
2542 otmp->greased = 3;
2544 if (otmp && otmp->oartifact == ART_IDEAL_BASE) {
2545 if (rn2(2)) {
2546 otmp->oeroded = rnd(3);
2547 if (!rn2(3)) otmp->oeroded2 = rnd(3);
2548 } else {
2549 otmp->oeroded2 = rnd(3);
2550 if (!rn2(3)) otmp->oeroded = rnd(3);
2553 if (otmp && otmp->oartifact == ART_WHO_CARES_ABOUT_A_LITTLE_R) {
2554 if (otmp->oeroded < 1) otmp->oeroded = 1;
2556 if (otmp && otmp->oartifact == ART_NOTHING_BUT_FILLER) {
2557 otmp->oerodeproof = TRUE;
2558 if (rn2(2)) {
2559 otmp->oeroded = rnd(3);
2560 if (!rn2(3)) otmp->oeroded2 = rnd(3);
2561 } else {
2562 otmp->oeroded2 = rnd(3);
2563 if (!rn2(3)) otmp->oeroded = rnd(3);
2566 if (otmp && otmp->oartifact == ART_FIND_ME_NEVERTHELESS) {
2567 otmp->oinvis = otmp->oinvisreal = TRUE;
2569 if (otmp && otmp->oartifact == ART_STRONG_) {
2570 otmp->spe += rn1(7,7);
2573 if (otmp->oartifact == ART_PECULIAR_MARKINGS) otmp->spe = 2;
2575 if (otmp && otmp->oartifact == ART_MODERN_DIGICAM) {
2576 otmp->spe *= 10;
2578 if (otmp && otmp->oartifact == ART_DON_T_RUN_OUT_OF_HALLOWEEN) {
2579 otmp->spe *= 3;
2581 if (otmp && otmp->oartifact == ART_BEH__TOO_EASY) {
2582 otmp->spe *= 2;
2584 if (otmp && otmp->oartifact == ART_NUTRIROLL) {
2585 otmp->spe *= 3;
2587 if (otmp && otmp->oartifact == ART_SING_S_STOCK) {
2588 otmp->spe *= 3;
2590 if (otmp && otmp->oartifact == ART_SING_S_LAST_LAUGH) {
2591 otmp->spe *= 10;
2594 if (otmp && otmp->oartifact == ART_BOAH_WHAT_A_STACK) {
2595 otmp->quan += 200;
2596 otmp->owt = weight(otmp);
2598 if (otmp && otmp->oartifact == ART_ITAK_HONE) {
2599 otmp->quan += 4;
2600 otmp->owt = weight(otmp);
2602 if (otmp && otmp->oartifact == ART_MULTIPOT) {
2603 otmp->quan += rn1(6,6);
2604 otmp->owt = weight(otmp);
2606 if (otmp && otmp->oartifact == ART_WIUNEW) {
2607 otmp->quan += rn1(4,4);
2608 otmp->owt = weight(otmp);
2610 if (otmp && otmp->oartifact == ART_HEAP_FROM_THE_YARD) {
2611 otmp->quan += rn1(500,500);
2612 otmp->owt = weight(otmp);
2614 if (otmp && otmp->oartifact == ART_PEWWWWWWW) {
2615 otmp->quan += rn1(9,9);
2616 otmp->owt = weight(otmp);
2618 if (otmp && otmp->oartifact == ART_LITTLE_BOY) {
2619 otmp->quan += rnz(10);
2620 otmp->owt = weight(otmp);
2622 if (otmp && otmp->oartifact == ART_DOHLOW) {
2623 otmp->quan += 4;
2624 otmp->owt = weight(otmp);
2626 if (otmp && otmp->oartifact == ART_TROPICAL_WOOD_SELECTION) {
2627 otmp->quan += 4;
2628 otmp->owt = weight(otmp);
2630 if (otmp && otmp->oartifact == ART_REGROWN_RESOURCE) {
2631 otmp->oerodeproof = TRUE;
2632 otmp->quan += 9;
2633 otmp->owt = weight(otmp);
2635 if (otmp && otmp->oartifact == ART_JUMPING_FLAMING_HE_TIE_CLI) {
2636 otmp->quan += rnz(50);
2637 otmp->owt = weight(otmp);
2639 if (otmp && otmp->oartifact == ART_SUNSET_SASAPARILLA) {
2640 otmp->quan += rn1(10,10);
2641 otmp->owt = weight(otmp);
2643 if (otmp && otmp->oartifact == ART_POINTED_JAVELIN) {
2644 otmp->quan += rn1(5, 5);
2645 otmp->owt = weight(otmp);
2647 if (otmp && otmp->oartifact == ART______STOCKPILE) {
2648 otmp->quan += 400;
2649 otmp->owt = weight(otmp);
2651 if (otmp && otmp->oartifact == ART_WU_TSCHI_) {
2652 otmp->quan += rnd(10);
2653 otmp->owt = weight(otmp);
2655 if (otmp && otmp->oartifact == ART_POEPOEPOEPOEOEU_) {
2656 otmp->quan += 5;
2657 otmp->owt = weight(otmp);
2659 if (otmp && otmp->oartifact == ART_WELLDER_GRANT) {
2660 otmp->quan += rn1(3, 2);
2661 otmp->owt = weight(otmp);
2663 if (otmp && otmp->oartifact == ART_KSSCHL__KSSCHL_) {
2664 otmp->quan += 400;
2665 otmp->owt = weight(otmp);
2667 if (otmp && otmp->oartifact == ART_ZIEIEIE_) {
2668 otmp->quan += 400;
2669 otmp->owt = weight(otmp);
2671 if (otmp && otmp->oartifact == ART_LOROFEM) {
2672 otmp->quan += rn1(7, 3);
2673 otmp->owt = weight(otmp);
2675 if (otmp && otmp->oartifact == ART_THEO_S_BOX) {
2676 otmp->quan += rnd(otmp->quan * 4);
2677 otmp->owt = weight(otmp);
2679 if (otmp && otmp->oartifact == ART_MUHISH) {
2680 otmp->quan *= 3;
2681 otmp->owt = weight(otmp);
2683 if (otmp && otmp->oartifact == ART_SENSHI_NO_BICHIKU) {
2684 otmp->quan *= 3;
2685 otmp->owt = weight(otmp);
2687 if (otmp && otmp->oartifact == ART_LARGE_MAGAZINE) {
2688 otmp->quan *= 3;
2689 otmp->owt = weight(otmp);
2691 if (otmp && otmp->oartifact == ART_COUPLE_IN_THE_BOX) {
2692 otmp->quan *= 3;
2693 otmp->owt = weight(otmp);
2695 if (otmp && otmp->oartifact == ART_HUGESTOCK) {
2696 otmp->quan *= 5;
2697 otmp->owt = weight(otmp);
2699 if (otmp && otmp->oartifact == ART_FLIUFLIUFLIUUUUUUU_) {
2700 otmp->quan *= 3;
2701 otmp->owt = weight(otmp);
2703 if (otmp && otmp->oartifact == ART_KLARNIGUR) {
2704 otmp->quan *= 2;
2705 otmp->owt = weight(otmp);
2707 if (otmp && otmp->oartifact == ART_COMPLETE_BUGNOSE) {
2708 pline("Lol, you have encountered a nose!");
2710 if (otmp && otmp->oartifact == ART_FIELD_INITED__SORRY) {
2711 int fieldtrapamount = rn1(11,11);
2712 while (fieldtrapamount > 0) {
2713 fieldtrapamount--;
2714 makerandomtrap(TRUE);
2717 if (otmp && otmp->oartifact == ART_COB_AUTO) {
2718 otmp->quan *= rn1(3,3);
2719 otmp->owt = weight(otmp);
2720 if (objects[otmp->otyp].oc_material != MT_COBALT) objects[otmp->otyp].oc_material = MT_COBALT;
2722 if (otmp && otmp->oartifact == ART_ETHER_DAGGER) {
2723 if (objects[otmp->otyp].oc_material != MT_ETHER) objects[otmp->otyp].oc_material = MT_ETHER;
2725 if (otmp && otmp->oartifact == ART_DAGGER_SURROUNDED_BY_WIND) {
2726 if (objects[otmp->otyp].oc_material != MT_ETHER) objects[otmp->otyp].oc_material = MT_ETHER;
2728 if (otmp && otmp->oartifact == ART_BOW_SURROUNDED_BY_WIND) {
2729 if (objects[otmp->otyp].oc_material != MT_ETHER) objects[otmp->otyp].oc_material = MT_ETHER;
2731 if (otmp && otmp->oartifact == ART_FLIUMILL) {
2732 otmp->quan *= 2;
2733 otmp->owt = weight(otmp);
2735 if (otmp && otmp->oartifact == ART_VENOREAL && Role_if(PM_POISON_MAGE)) {
2736 otmp->quan *= 3;
2737 otmp->quan += 25;
2738 otmp->owt = weight(otmp);
2740 if (otmp && otmp->oartifact == ART_MUCHO_TALCUM) otmp->age *= 3;
2741 if (otmp && otmp->oartifact == ART_HALLOWEEN_FUEL) otmp->age *= 2;
2742 if (otmp && otmp->oartifact == ART_QUASIMAGICAL_SHINE) {
2743 otmp->age *= 3;
2745 if (otmp && otmp->oartifact == ART_ALL_WASTED) {
2746 otmp->quan /= 3;
2747 if (otmp->quan < 1) otmp->quan = 1;
2748 otmp->owt = weight(otmp);
2750 if (mod) {
2751 /* Light up Candle of Eternal Flame and
2752 * Holy Spear of Light on creation.
2754 if (!artiexist[m] && artifact_light(otmp) &&
2755 otmp->oartifact != ART_SUNSWORD && otmp->oartifact != ART_SUNSCREEN && otmp->oartifact != ART_SUNTINOPENER && otmp->oartifact != ART_SUNRUBBERHOSE)
2756 begin_burn(otmp, FALSE);
2757 /*otmp->quan = 1;*/ /* guarantee only one of this artifact */ /* Amy edit: artifact ammo should not suck... */
2758 /* Artifacts are immune to unpolypile --ALI */
2759 if (is_hazy(otmp)) {
2760 (void) stop_timer(UNPOLY_OBJ, (void *) otmp);
2761 otmp->oldtyp = STRANGE_OBJECT;
2764 /* the age field is used both for lightsaber power and the invoke timer... ugh --Amy
2765 * but thankfully we can fix that BS, now we use otmp->invoketimer */
2766 /* if (a->inv_prop || otmp->oartifact == ART_LIGHTSABER_PROTOTYPE || otmp->oartifact == ART_DEFINITE_LIGHTSABER) */
2767 otmp->invoketimer = 0;
2768 if ((mod == FALSE) || rn2(100)) artiexist[m] = mod;
2769 break;
2770 } /* if artimatch */
2771 } /* for artilist */
2772 return;
2776 nartifact_exist()
2778 int a = 0;
2779 int n = SIZE(artiexist);
2781 while(n > 1)
2782 if(artiexist[--n]) a++;
2784 return a;
2786 #endif /* OVLB */
2787 #ifdef OVL0
2789 boolean
2790 spec_ability(otmp, abil)
2791 struct obj *otmp;
2792 unsigned long abil;
2794 const struct artifact *arti = get_artifact(otmp);
2796 return((boolean)(arti && (arti->spfx & abil)));
2799 boolean
2800 cspec_ability(otmp, abil)
2801 struct obj *otmp;
2802 unsigned long abil;
2804 const struct artifact *arti = get_artifact(otmp);
2806 return((boolean)(arti && (arti->cspfx & abil)));
2809 /* determine if a given artifact is "evil" (used in pickup.c) --Amy */
2810 boolean
2811 arti_is_evil(obj)
2812 struct obj *obj;
2814 return (obj->oartifact && spec_ability(obj, SPFX_EVIL));
2817 /* determine if a given artifact is nonwishable --Amy */
2818 boolean
2819 arti_nonwishable(obj)
2820 struct obj *obj;
2822 return (obj->oartifact && spec_ability(obj, SPFX_NOWISH));
2825 /* used so that callers don't need to known about SPFX_ codes
2826 * Amy edit: gaaaaaaaaah idiotic vanilla programmers, why don't you differ between "confers luck when equipped" and
2827 * "confers luck when carried"??? that's, like, SO stupid, why even have those flags in the first place if you can't be
2828 * bothered to make them work? */
2829 boolean
2830 confers_luck(obj)
2831 struct obj *obj;
2833 boolean invokenotworn = FALSE;
2834 /* might as well check for this too */
2835 if (obj->otyp == LUCKSTONE) return TRUE;
2837 if (obj->otyp == FEDORA && obj == uarmh) return TRUE;
2839 if (obj->oartifact && spec_ability(obj, SPFX_LUCK)) {
2841 if (obj->oclass == ARMOR_CLASS && !(obj->owornmask & W_ARMOR) ) invokenotworn = TRUE;
2842 if (obj->oclass == WEAPON_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
2843 if (obj->oclass == RING_CLASS && !(obj->owornmask & W_RING) ) invokenotworn = TRUE;
2844 if (obj->oclass == AMULET_CLASS && !(obj->owornmask & W_AMUL) ) invokenotworn = TRUE;
2845 if (obj->oclass == IMPLANT_CLASS && !(obj->owornmask & W_IMPLANT) ) invokenotworn = TRUE;
2846 if (obj->oclass == BALL_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
2847 if (obj->oclass == CHAIN_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
2848 if (obj->oclass == VENOM_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
2849 if (obj->oclass == GEM_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
2850 if (is_weptool(obj) && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
2851 if (is_blindfold_slot(obj) && !(obj->owornmask & W_TOOL) ) invokenotworn = TRUE;
2853 if (obj->oclass != ARMOR_CLASS && obj->oclass != RING_CLASS && obj->oclass != AMULET_CLASS && obj->oclass != IMPLANT_CLASS && !(is_blindfold_slot(obj)) && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
2855 if (!invokenotworn) return TRUE;
2858 if (obj->oartifact && cspec_ability(obj, SPFX_LUCK)) return TRUE;
2860 return FALSE;
2863 /* used to check whether a monster is getting reflection from an artifact */
2864 boolean
2865 arti_reflects(obj)
2866 struct obj *obj;
2868 const struct artifact *arti = get_artifact(obj);
2870 if (arti) {
2871 /* while being worn */
2872 if ((obj->owornmask & ~W_ART) && (arti->spfx & SPFX_REFLECT))
2873 return TRUE;
2874 /* just being carried */
2875 if (arti->cspfx & SPFX_REFLECT) return TRUE;
2877 return FALSE;
2880 #endif /* OVL0 */
2881 #ifdef OVLB
2883 boolean
2884 restrict_name(otmp, name) /* returns 1 if name is restricted for otmp->otyp */
2885 register struct obj *otmp;
2886 register const char *name;
2888 register const struct artifact *a;
2889 register const char *aname;
2891 if (!*name) return FALSE;
2892 if (!strncmpi(name, "the ", 4)) name += 4;
2894 /* Since almost every artifact is SPFX_RESTR, it doesn't cost
2895 us much to do the string comparison before the spfx check.
2896 Bug fix: don't name multiple elven daggers "Sting".
2898 for (a = artilist+1; a->otyp; a++) {
2899 /*if (a->otyp != otmp->otyp) continue;*/ /* artifact naming bug --Amy */
2900 aname = a->name;
2901 if (!strncmpi(aname, "the ", 4)) aname += 4;
2902 if (!strcmp(aname, name))
2903 return ((boolean)((a->spfx & (SPFX_NOGEN|SPFX_RESTR)) != 0 ||
2904 otmp->quan > 1L));
2907 return FALSE;
2910 STATIC_OVL boolean
2911 attacks(adtyp, otmp)
2912 register int adtyp;
2913 register struct obj *otmp;
2915 register const struct artifact *weap;
2917 if ((weap = get_artifact(otmp)) != 0)
2918 return((boolean)(weap->attk.adtyp == adtyp));
2919 return FALSE;
2922 boolean
2923 defends(adtyp, otmp)
2924 register int adtyp;
2925 register struct obj *otmp;
2927 register const struct artifact *weap;
2929 if ((weap = get_artifact(otmp)) != 0)
2930 return((boolean)(weap->defn.adtyp == adtyp));
2931 return FALSE;
2934 /* used for monsters */
2935 boolean
2936 protects(adtyp, otmp)
2937 int adtyp;
2938 struct obj *otmp;
2940 register const struct artifact *weap;
2942 if ((weap = get_artifact(otmp)) != 0)
2943 return (boolean)(weap->cary.adtyp == adtyp);
2944 return FALSE;
2948 * a potential artifact has just been worn/wielded/picked-up or
2949 * unworn/unwielded/dropped. Pickup/drop only set/reset the W_ART mask.
2951 void
2952 set_artifact_intrinsic(otmp,on,wp_mask)
2953 register struct obj *otmp;
2954 boolean on;
2955 long wp_mask;
2957 long *mask = 0;
2958 register const struct artifact *oart = get_artifact(otmp);
2959 uchar dtyp;
2960 long spfx;
2962 if (!oart) return;
2964 /* effects from the defn field */
2965 dtyp = (wp_mask != W_ART) ? oart->defn.adtyp : oart->cary.adtyp;
2967 if (dtyp == AD_FIRE)
2968 mask = &EFire_resistance;
2969 else if (dtyp == AD_COLD)
2970 mask = &ECold_resistance;
2971 else if (dtyp == AD_ACID)
2972 mask = &EAcid_resistance;
2973 else if (dtyp == AD_ELEC)
2974 mask = &EShock_resistance;
2975 else if (dtyp == AD_MAGM)
2976 mask = &EAntimagic;
2977 else if (dtyp == AD_DISN)
2978 mask = &EDisint_resistance;
2979 else if (dtyp == AD_DRST)
2980 mask = &EPoison_resistance;
2981 else if (dtyp == AD_STUN)
2982 mask = &EStun_resist;
2983 else if (dtyp == AD_DRLI)
2984 mask = &EDrain_resistance;
2986 if (mask && wp_mask == W_ART && !on) {
2987 /* find out if some other artifact also confers this intrinsic */
2988 /* if so, leave the mask alone */
2989 register struct obj* obj;
2990 for(obj = invent; obj; obj = obj->nobj)
2991 if(obj != otmp && obj->oartifact) {
2992 register const struct artifact *art = get_artifact(obj);
2993 if(art->cary.adtyp == dtyp) {
2994 mask = (long *) 0;
2995 break;
2999 if(mask) {
3000 if (on) *mask |= wp_mask;
3001 else *mask &= ~wp_mask;
3004 /* intrinsics from the spfx field; there could be more than one */
3005 spfx = (wp_mask != W_ART) ? oart->spfx : oart->cspfx;
3006 if(spfx && wp_mask == W_ART && !on) {
3007 /* don't change any spfx also conferred by other artifacts */
3008 register struct obj* obj;
3009 for(obj = invent; obj; obj = obj->nobj)
3010 if(obj != otmp && obj->oartifact) {
3011 register const struct artifact *art = get_artifact(obj);
3012 spfx &= ~art->cspfx;
3016 if (spfx & SPFX_SEARCH) {
3017 if(on) ESearching |= wp_mask;
3018 else ESearching &= ~wp_mask;
3020 if (spfx & SPFX_SEEK) {
3021 if(on) ESearching |= wp_mask;
3022 else ESearching &= ~wp_mask;
3024 if (spfx & SPFX_HALRES) {
3025 /* make_hallucinated must (re)set the mask itself to get
3026 * the display right */
3027 /* restoring needed because this is the only artifact intrinsic
3028 * that can print a message--need to guard against being printed
3029 * when restoring a game
3031 (void) make_hallucinated((long)!on, restoring ? FALSE : TRUE, wp_mask);
3033 if (spfx & SPFX_ESP) {
3034 if(on) ETelepat |= wp_mask;
3035 else ETelepat &= ~wp_mask;
3036 see_monsters();
3038 if (spfx & SPFX_STLTH) {
3039 if (on) EStealth |= wp_mask;
3040 else EStealth &= ~wp_mask;
3042 if (spfx & SPFX_REGEN) {
3043 if (on) ERegeneration |= wp_mask;
3044 else ERegeneration &= ~wp_mask;
3046 if (spfx & SPFX_TCTRL) {
3047 if (on) ETeleport_control |= wp_mask;
3048 else ETeleport_control &= ~wp_mask;
3050 /* weapon warning is specially handled in mon.c */
3051 if (spfx & SPFX_WARN) {
3052 if (spec_m2(otmp)) {
3053 if (on) {
3054 EWarn_of_mon |= wp_mask;
3055 flags.warntype |= spec_m2(otmp);
3056 } else {
3057 EWarn_of_mon &= ~wp_mask;
3058 flags.warntype &= ~spec_m2(otmp);
3060 see_monsters();
3061 } else {
3062 if (on) EWarning |= wp_mask;
3063 else EWarning &= ~wp_mask;
3066 if (spfx & SPFX_EREGEN) {
3067 if (on) EEnergy_regeneration |= wp_mask;
3068 else EEnergy_regeneration &= ~wp_mask;
3070 if (spfx & SPFX_HSPDAM) {
3071 if (on) EHalf_spell_damage |= wp_mask;
3072 else EHalf_spell_damage &= ~wp_mask;
3074 if (spfx & SPFX_HPHDAM) {
3075 if (on) EHalf_physical_damage |= wp_mask;
3076 else EHalf_physical_damage &= ~wp_mask;
3078 if (spfx & SPFX_PROTEC) {
3079 if (on) {
3080 /*u.ublessed += 2;
3081 HProtection |= FROMOUTSIDE;*/
3082 u.artifactprotection = 1;
3083 } else {
3084 /*u.ublessed -= 2;
3085 if (u.ublessed <= 0) HProtection &= ~FROMOUTSIDE;*/
3086 u.artifactprotection = 0;
3089 if (spfx & SPFX_XRAY) {
3090 if (on) EAstral_vision |= wp_mask;
3091 else EAstral_vision &= ~wp_mask;
3092 /* xray_range is now modified in allmain.c --Amy */
3094 /* KMH -- Reflection when wielded */
3095 if ((spfx & SPFX_REFLECT)) { /* fix by Chris_ANG - why the heck was this on being wielded only??? */
3096 if (on) EReflecting |= wp_mask;
3097 else EReflecting &= ~wp_mask;
3100 if(wp_mask == W_ART && !on && oart->inv_prop) {
3101 /* might have to turn off invoked power too */
3102 if (oart->inv_prop <= LAST_PROP &&
3103 (u.uprops[oart->inv_prop].extrinsic & W_ARTI))
3104 (void) arti_invoke(otmp);
3109 * creature (usually player) tries to touch (pick up or wield) an artifact obj.
3110 * Returns 0 if the object refuses to be touched.
3111 * This routine does not change any object chains.
3112 * Ignores such things as gauntlets, assuming the artifact is not
3113 * fooled by such trappings.
3116 touch_artifact(obj,mon)
3117 struct obj *obj;
3118 struct monst *mon;
3120 register const struct artifact *oart = get_artifact(obj);
3121 boolean badclass, badalign, self_willed, yours;
3123 if(!oart) return 1;
3125 /* [ALI] Thiefbane has a special affinity with shopkeepers */
3126 if (mon->isshk && obj->oartifact == ART_THIEFBANE) return 1;
3128 yours = (mon == &youmonst);
3129 /* all quest artifacts are self-willed; it this ever changes, `badclass'
3130 will have to be extended to explicitly include quest artifacts */
3131 self_willed = ((oart->spfx & SPFX_INTEL) != 0);
3132 if (yours) {
3133 badclass = self_willed &&
3134 ((oart->role != NON_PM && !Role_if(oart->role)) ||
3135 (oart->race != NON_PM && !Race_if(oart->race)));
3136 badalign = (oart->spfx & SPFX_RESTR) && oart->alignment != A_NONE &&
3137 (oart->alignment != u.ualign.type || u.ualign.record < 0);
3138 } else if (!is_covetous(mon->data) && !is_mplayer(mon->data)) {
3139 badclass = self_willed &&
3140 oart->role != NON_PM && oart != &artilist[ART_EXCALIBUR];
3141 badalign = (oart->spfx & SPFX_RESTR) && oart->alignment != A_NONE &&
3142 (oart->alignment != sgn(mon->data->maligntyp));
3143 } else { /* an M3_WANTSxxx monster or a fake player */
3144 /* special monsters trying to take the Amulet, invocation tools or
3145 quest item can touch anything except for `spec_applies' artifacts */
3146 badclass = badalign = FALSE;
3148 /* weapons which attack specific categories of monsters are
3149 bad for them even if their alignments happen to match */
3150 if (!badalign && (oart->spfx & SPFX_DBONUS) != 0) {
3151 struct artifact tmp;
3153 tmp = *oart;
3154 tmp.spfx &= SPFX_DBONUS;
3155 badalign = !!spec_applies(&tmp, mon);
3158 if (((((badclass || badalign) && self_willed) || (badalign && (!yours || !rn2(4)))) && !RngeBlastShielding) || (ArtiblastEffect || u.uprops[ARTIBLAST_EFFECT].extrinsic || autismweaponcheck(ART_ULTRA_ANNOYANCE) || have_blaststone()) ) {
3159 int dmg;
3160 char buf[BUFSZ];
3162 /* Amy change: allowing monsters to just use artifacts anyway, because it's a silly restriction anyway */
3163 /* In Soviet Russia, none of the Kreml's troops may use weapons that have been forged by the enemy, because doing so
3164 * counts as defecting - after all, who knows whose side they're really on if they're not using Russian weapons? */
3165 if (!yours) {
3166 if (issoviet) return 0;
3167 else return 1;
3169 You("are blasted by %s power!", s_suffix(the(xname(obj))));
3170 u.cnd_artiblastcount++;
3171 dmg = d((Race_if(PM_KUTAR) ? 8 : StrongAntimagic ? 3 : Antimagic ? 6 : 8), (self_willed ? 10 : 6));
3172 if (!issoviet && (u.ulevel < 10)) { /* picking up unknown artifacts should not be a crapshoot for low-level chars. --Amy */
3173 dmg *= u.ulevel;
3174 dmg /= 10;
3175 if (dmg < 1) dmg = 1;
3178 /* having the artiblast nastytrap means that blast shielding doesn't prevent artifact blasts, but since we don't
3179 * want the property to be completely useless in that case, it reduces the blast damage instead --Amy */
3181 if ((ArtiblastEffect || u.uprops[ARTIBLAST_EFFECT].extrinsic || autismweaponcheck(ART_ULTRA_ANNOYANCE) || have_blaststone()) && RngeBlastShielding) {
3182 dmg /= 2;
3183 if (dmg < 1) dmg = 1;
3186 /* the blasts are just too goddamn annoying, and all they really do is blow your symbiote to smithereens... so, I
3187 * decided that they deal much less damage, unless you have the nastytrap effect or soviet mode. --Amy */
3188 if (!(ArtiblastEffect || u.uprops[ARTIBLAST_EFFECT].extrinsic || autismweaponcheck(ART_ULTRA_ANNOYANCE) || have_blaststone()) && !issoviet) {
3189 dmg /= (self_willed ? 4 : 6);
3190 if (dmg < 1) dmg = 1;
3193 /* Yes, I know, this probably means you cannot instantly die by having an artifact spawn on your location while
3194 * having autopickup on, unless you're a DQ Slime or something, but still... */
3196 /* In Soviet Russia, artifacts are not meant to be used by little children. Parents who want to get rid of their kids place Excaliburs and Stormbringers in their house on purpose, hoping that their offspring will make the mistake of touching it and get killed instantly. --Amy */
3197 if (issoviet) pline("Bum, vy tol'ko chto vzorvali dlya massivnogo povrezhdeniya. Kha-kha-kha, tip bloka l'da smeyetsya nad vami.");
3199 /*if (wizard) pline("damage calc");*/
3200 sprintf(buf, "touching an artifact (%s)", oart->name);
3201 /*if (wizard) pline("sprintf");*/
3202 losehp(dmg, buf, KILLED_BY);
3203 /*if (wizard) pline("losehp done");*/
3204 exercise(A_WIS, FALSE);
3207 /* can pick it up unless you're totally non-synch'd with the artifact
3208 * Amy edit: spawning artifacts that you just cannot pick up is as stupid as role-specific gear in Diablo 2...
3209 * so now, you have a 1 in 4 chance of picking up the item anyway; constant blasts still make the item dangerous */
3210 if (badclass && badalign && self_willed && (rn2(4) || issoviet) ) {
3211 if (yours) {
3212 pline("%s your grasp!", Tobjnam(obj, "evade"));
3213 if (issoviet) pline("Muakhakha-kha-kha, ty ne budesh' ispol'zovat' etu shtuku. Zamedleniye.");
3215 return 0;
3217 /* This is a kludge, but I'm not sure where else to put it */
3218 if (oart == &artilist[ART_IRON_BALL_OF_LIBERATION]) {
3219 if (Role_if(PM_CONVICT) && (!obj->oerodeproof)) {
3220 obj->oerodeproof = TRUE;
3221 obj->owt = 900; /* Magically lightened, but still heavy */
3224 if (Punished && (obj != uball)) {
3225 unpunish(); /* Remove a mundane heavy iron ball */
3229 return 1;
3232 #endif /* OVLB */
3233 #ifdef OVL1
3235 /* decide whether an artifact's special attacks apply against mtmp
3236 * Amy edit: MAKE SURE you keep the other function below in line, too! This first one is just for touching artifacts,
3237 * and "wayne intressierts" if a player polyd into a vortex doesn't get blasted when trying to pick up that one artifact
3238 * which has damage bonuses against both elementals and vortices. The important part is that the artifact in question
3239 * actually deals bonus damage to both of those monster types when used in combat, which is now governed by the other
3240 * function while this one will be for stuff that doesn't require the artifact ID.
3241 * Still, why the heck did they make it so that the "artifact" structure doesn't store the artifact ID is beyond me. */
3242 STATIC_OVL int
3243 spec_applies(weap, mtmp)
3244 register const struct artifact *weap;
3245 struct monst *mtmp;
3247 int retval = TRUE;
3248 struct permonst *ptr;
3249 boolean yours;
3251 if(!(weap->spfx & (SPFX_DBONUS | SPFX_ATTK)))
3252 return(weap->attk.adtyp == AD_PHYS);
3254 yours = (mtmp == &youmonst);
3255 ptr = mtmp->data;
3257 /* [ALI] Modified to support multiple DBONUS and ATTK flags set.
3258 * Not all combinations are possible because many DBONUS flags
3259 * use mtype and would conflict. Where combinations are possible,
3260 * both checks must pass in order for the special attack to
3261 * apply against mtmp.
3263 if (weap->spfx & SPFX_DMONS) {
3264 retval &= (ptr == &mons[(int)weap->mtype]);
3265 } else if (weap->spfx & SPFX_DCLAS) {
3266 retval &= (weap->mtype == (unsigned long)ptr->mlet);
3267 } else if (weap->spfx & SPFX_DFLAG1) {
3268 retval &= ((ptr->mflags1 & weap->mtype) != 0L);
3269 } else if (weap->spfx & SPFX_DFLAG2) {
3270 retval &= ((ptr->mflags2 & weap->mtype) || (yours &&
3271 ((!Upolyd && (urace.selfmask & weap->mtype)) ||
3272 ((weap->mtype & M2_WERE) && u.ulycn >= LOW_PM))));
3274 if (weap->spfx & SPFX_DALIGN) {
3275 retval &= yours ? (u.ualign.type != weap->alignment) :
3276 (ptr->maligntyp == A_NONE ||
3277 sgn(ptr->maligntyp) != weap->alignment);
3279 if (weap->spfx & SPFX_ATTK) {
3280 struct obj *defending_weapon = (yours ? uwep : MON_WEP(mtmp));
3282 if (defending_weapon && defending_weapon->oartifact &&
3283 defends((int)weap->attk.adtyp, defending_weapon))
3284 return FALSE;
3285 switch(weap->attk.adtyp) {
3286 case AD_FIRE:
3287 if (yours ? Fire_resistance : (resists_fire(mtmp) && !player_will_pierce_resistance()) )
3288 retval = FALSE;
3289 break;
3290 case AD_ACID:
3291 if (yours ? Acid_resistance : (resists_acid(mtmp) && !player_will_pierce_resistance()) )
3292 retval = FALSE;
3293 break;
3294 case AD_COLD:
3295 if (yours ? Cold_resistance : (resists_cold(mtmp) && !player_will_pierce_resistance()) )
3296 retval = FALSE;
3297 break;
3298 case AD_ELEC:
3299 if (yours ? Shock_resistance : (resists_elec(mtmp) && !player_will_pierce_resistance()) )
3300 retval = FALSE;
3301 break;
3302 case AD_MAGM:
3303 if (yours ? Antimagic : resists_magm(mtmp))
3304 retval = FALSE;
3305 break;
3306 case AD_STUN:
3307 if (yours ? Antimagic : (rn2(100) < ptr->mr))
3308 retval = FALSE;
3309 break;
3310 case AD_DRST:
3311 if (yours ? Poison_resistance : (resists_poison(mtmp) && !player_will_pierce_resistance()) )
3312 retval = FALSE;
3313 break;
3314 case AD_DRLI:
3315 if (yours ? Drain_resistance : resists_drli(mtmp))
3316 retval = FALSE;
3317 break;
3318 case AD_STON:
3319 if (yours ? Stone_resistance : resists_ston(mtmp))
3320 retval = FALSE;
3321 break;
3322 case AD_PHYS:
3323 break;
3324 default: impossible("Weird weapon special attack.");
3327 return retval;
3330 /* same function but WE WANT TO BE ABLE TO GET THE BLOODY INDEX NUMBER OF THE BLOODY ARTIFACT GAAAAAH --Amy */
3331 STATIC_OVL int
3332 spec_applies_number(weap, mtmp, otmp)
3333 register const struct artifact *weap;
3334 struct monst *mtmp;
3335 struct obj *otmp;
3337 int retval = TRUE;
3338 struct permonst *ptr;
3339 boolean yours;
3341 if(!(weap->spfx & (SPFX_DBONUS | SPFX_ATTK)))
3342 return(weap->attk.adtyp == AD_PHYS);
3344 yours = (mtmp == &youmonst);
3345 ptr = mtmp->data;
3347 /* [ALI] Modified to support multiple DBONUS and ATTK flags set.
3348 * Not all combinations are possible because many DBONUS flags
3349 * use mtype and would conflict. Where combinations are possible,
3350 * both checks must pass in order for the special attack to
3351 * apply against mtmp.
3353 if (weap->spfx & SPFX_DMONS) {
3354 retval &= (ptr == &mons[(int)weap->mtype]);
3355 } else if (weap->spfx & SPFX_DCLAS) {
3356 retval &= (weap->mtype == (unsigned long)ptr->mlet);
3358 if (otmp && otmp->oartifact == ART_JONADAB_S_BRAINSTORMING) {
3359 if (S_DEMON == (unsigned long)ptr->mlet) retval = TRUE;
3361 if (otmp && otmp->oartifact == ART_SHUGO) {
3362 if (S_UNICORN == (unsigned long)ptr->mlet) retval = TRUE;
3364 if (otmp && otmp->oartifact == ART_STAFF_OF_MOON) {
3365 if (S_VORTEX == (unsigned long)ptr->mlet) retval = TRUE;
3367 if (otmp && otmp->oartifact == ART_POLE_OF_MOON) {
3368 if (S_VORTEX == (unsigned long)ptr->mlet) retval = TRUE;
3370 if (otmp && otmp->oartifact == ART_STAFF_OF_STAR) {
3371 if (S_VORTEX == (unsigned long)ptr->mlet) retval = TRUE;
3373 } else if (weap->spfx & SPFX_DFLAG1) {
3374 retval &= ((ptr->mflags1 & weap->mtype) != 0L);
3375 } else if (weap->spfx & SPFX_DFLAG2) {
3376 retval &= ((ptr->mflags2 & weap->mtype) || (yours &&
3377 ((!Upolyd && (urace.selfmask & weap->mtype)) ||
3378 ((weap->mtype & M2_WERE) && u.ulycn >= LOW_PM))));
3380 if (weap->spfx & SPFX_DALIGN) {
3381 retval &= yours ? (u.ualign.type != weap->alignment) :
3382 (ptr->maligntyp == A_NONE ||
3383 sgn(ptr->maligntyp) != weap->alignment);
3385 if (weap->spfx & SPFX_ATTK) {
3386 struct obj *defending_weapon = (yours ? uwep : MON_WEP(mtmp));
3388 if (defending_weapon && defending_weapon->oartifact &&
3389 defends((int)weap->attk.adtyp, defending_weapon))
3390 return FALSE;
3391 switch(weap->attk.adtyp) {
3392 case AD_FIRE:
3393 if (yours ? Fire_resistance : (resists_fire(mtmp) && !player_will_pierce_resistance()) )
3394 retval = FALSE;
3395 break;
3396 case AD_ACID:
3397 if (yours ? Acid_resistance : (resists_acid(mtmp) && !player_will_pierce_resistance()) )
3398 retval = FALSE;
3399 break;
3400 case AD_COLD:
3401 if (yours ? Cold_resistance : (resists_cold(mtmp) && !player_will_pierce_resistance()) )
3402 retval = FALSE;
3403 break;
3404 case AD_ELEC:
3405 if (yours ? Shock_resistance : (resists_elec(mtmp) && !player_will_pierce_resistance()) )
3406 retval = FALSE;
3407 break;
3408 case AD_MAGM:
3409 if (yours ? Antimagic : resists_magm(mtmp))
3410 retval = FALSE;
3411 break;
3412 case AD_STUN:
3413 if (yours ? Antimagic : (rn2(100) < ptr->mr))
3414 retval = FALSE;
3415 break;
3416 case AD_DRST:
3417 if (yours ? Poison_resistance : (resists_poison(mtmp) && !player_will_pierce_resistance()) )
3418 retval = FALSE;
3419 break;
3420 case AD_DRLI:
3421 if (yours ? Drain_resistance : resists_drli(mtmp))
3422 retval = FALSE;
3423 break;
3424 case AD_STON:
3425 if (yours ? Stone_resistance : resists_ston(mtmp))
3426 retval = FALSE;
3427 break;
3428 case AD_PHYS:
3429 break;
3430 default: impossible("Weird weapon special attack.");
3433 return retval;
3436 /* return the M2 flags of monster that an artifact's special attacks apply against */
3437 long
3438 spec_m2(otmp)
3439 struct obj *otmp;
3441 register const struct artifact *artifact = get_artifact(otmp);
3442 if (artifact)
3443 return artifact->mtype;
3444 return 0L;
3447 /* special attack bonus */
3449 spec_abon(otmp, mon)
3450 struct obj *otmp;
3451 struct monst *mon;
3453 register const struct artifact *weap = get_artifact(otmp);
3455 /* no need for an extra check for `NO_ATTK' because this will
3456 always return 0 for any artifact which has that attribute */
3458 /* to-hit h@ck by Amy because of the brain-dead programming where PHYS(1,0) gives double damage but PHYS(0,0)
3459 * does not; how the hell am I supposed to make an artifact that only gives double damage but no to-hit??? */
3461 if (otmp && otmp->oartifact) {
3462 switch (otmp->oartifact) {
3464 case ART_BIDETHANDER:
3465 case ART_MEAT_SCRAPER:
3466 case ART_DAMNBLAST:
3467 case ART_RITUAL_RINGED_SPEAR:
3468 case ART_SUPAHIT:
3469 case ART_SCALPEL_OF_LIFE_AND_DEATH:
3470 case ART_NADJA_S_BROKEN_NAIL:
3471 case ART_FAMOUS_LANCE:
3472 case ART_EMERALD_SWORD:
3473 case ART_NAMED_AFTER_ITSELF:
3474 case ART_PULVERIZE_EM:
3475 case ART_POST_OFFICE_COURSE:
3476 case ART_ROOMMATE_S_SPECIAL_IDEA:
3477 case ART_MR__AHLBLOW_S_SIGNAGE:
3478 case ART_DO_YOU_EVEN_LIFT:
3479 case ART_MARINE_THREAT_NEUTERED:
3480 case ART_WILD_HEAVY_SWINGS:
3481 case ART_COMPLETELY_OFF:
3482 return 0; /* no to-hit bonus */
3484 case ART_ANTILUCKBLADE:
3485 if (Luck < 0) return abs((int)Luck);
3486 break;
3488 default: break;
3492 if (weap && weap->attk.damn && spec_applies_number(weap, mon, otmp)) {
3493 return (int)weap->attk.damn;
3495 return 0;
3498 /* special damage bonus */
3500 spec_dbon(otmp, mon, tmp)
3501 struct obj *otmp;
3502 struct monst *mon;
3503 int tmp;
3505 register const struct artifact *weap = get_artifact(otmp);
3507 /* damage h@ck by Amy because of the brain-dead programming where PHYS(1,0) gives double damage in addition to
3508 * +1 to-hit; how the hell am I supposed to make an artifact that only gives to-hit but no damage bonus??? */
3509 if (otmp && otmp->oartifact) {
3510 switch (otmp->oartifact) {
3512 case ART_M__M__M_:
3513 case ART_MUHISH:
3514 case ART_FLIUMILL:
3515 case ART_BLOODLETTER:
3516 case ART_ZUSE_S_COMP:
3517 case ART_SKIN_DEGREE:
3518 case ART_WATERTROOPER:
3519 case ART_MISS_LAUNCHER:
3520 case ART_TSCHUEUU:
3521 case ART_BROWNING:
3522 case ART_WIUNEW:
3523 case ART_LONGBOW_OF_DIANA:
3524 case ART_HEFFER_S_BOW:
3525 case ART_GUNBOW:
3526 case ART_HOMING_BEAM:
3527 case ART_TONA_S_GAMES:
3528 case ART_VIHAT_BAGUETTEN_BUS_STOP:
3529 case ART_DIG__OF_COURSE:
3530 case ART_THEO_S_BOX:
3531 case ART_CRABBOMAT:
3532 case ART_ANNOYPRICK:
3533 case ART_MAUSER_C___CUSTOM:
3534 case ART_STRUCK_ON:
3535 case ART_WINNETOU_S_FRIEND:
3536 return 0; /* no damage bonus */
3538 case ART_ANTILUCKBLADE: /* h@ck for luck-dependant damage bonus --Amy */
3539 if (Luck < 0) {
3540 int boosteramount = abs((int)Luck);
3541 return rnd(boosteramount);
3543 break;
3546 case ART_POINT_DEXTER: /* h@ck for dexterity-dependant damage bonus --Amy */
3547 if (ACURR(A_DEX) < 1) return 1;
3548 else if (ACURR(A_DEX) > 25) return rnd(25);
3549 else return rnd(ACURR(A_DEX));
3551 default: break;
3555 if (!weap || (weap->attk.adtyp == AD_PHYS && /* check for `NO_ATTK' */
3556 weap->attk.damn == 0 && weap->attk.damd == 0)) {
3557 spec_dbon_applies = FALSE;
3558 } else {
3559 spec_dbon_applies = spec_applies_number(weap, mon, otmp);
3562 /* Amy edit: the fact that they always did max damage was fucked up, IMHO. */
3564 if (spec_dbon_applies) {
3566 if (otmp && otmp->oartifact == ART_PULVERIZE_EM) {
3567 return rnd(max(tmp * 2, 1)); /* triple damage!! */
3570 /* used to be that launchers wouldn't get double damage... but then how the hell am I supposed to make a
3571 * launcher artifact that deals double damage??? fucked-ass programmers who didn't simply make a SPFX_DBLDAMAGE
3572 * flag so that we can easily add double damage if we want it to be on an artifact... --Amy */
3573 return weap->attk.damd ? rnd((int)weap->attk.damd) : rnd(max(tmp,1)); /* double damage was too strong --Amy */
3577 return 0;
3580 /* add identified artifact to discoveries list */
3581 void
3582 discover_artifact(m)
3583 int m;
3585 int i;
3587 /* look for this artifact in the discoveries list;
3588 if we hit an empty slot then it's not present, so add it */
3589 for (i = 0; i < NROFARTIFACTS; i++)
3590 if (artidisco[i] == 0 || artidisco[i] == m) {
3591 artidisco[i] = m;
3592 return;
3594 /* there is one slot per artifact, so we should never reach the
3595 end without either finding the artifact or an empty slot... */
3596 impossible("couldn't discover artifact (%d)", (int)m);
3599 /* used to decide whether an artifact has been fully identified */
3600 boolean
3601 undiscovered_artifact(m)
3602 int m;
3604 int i;
3606 /* look for this artifact in the discoveries list;
3607 if we hit an empty slot then it's undiscovered */
3608 for (i = 0; i < NROFARTIFACTS; i++)
3609 if (artidisco[i] == m)
3610 return FALSE;
3611 else if (artidisco[i] == 0)
3612 break;
3613 return TRUE;
3616 /* display a list of discovered artifacts; return their count */
3618 disp_artifact_discoveries(tmpwin)
3619 winid tmpwin; /* supplied by dodiscover() */
3621 int i, m, otyp;
3622 char buf[BUFSZ];
3623 anything any;
3625 any.a_void = 0;
3626 for (i = 0; i < NROFARTIFACTS; i++) {
3627 if (artidisco[i] == 0) break; /* empty slot implies end of list */
3628 if (i == 0)
3629 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
3630 "Artifacts", MENU_UNSELECTED);
3631 m = artidisco[i];
3632 otyp = artilist[m].otyp;
3633 sprintf(buf, " %s [%s %s]", artiname(m),
3634 align_str(artilist[m].alignment), simple_typename(otyp));
3635 add_menu(tmpwin, objnum_to_glyph(otyp), &any, 0, 0, ATR_NONE,
3636 buf, MENU_UNSELECTED);
3638 return i;
3641 void
3642 dump_artifact_discoveries()
3644 int i, m, otyp;
3645 char buf[BUFSZ];
3647 for (i = 0; i < NROFARTIFACTS; i++) {
3648 if (artidisco[i] == 0) break; /* empty slot implies end of list */
3649 if (i == 0)
3650 dump("", " Artifacts");
3651 m = artidisco[i];
3652 otyp = artilist[m].otyp;
3653 sprintf(buf, " %s [%s %s]", artiname(m),
3654 align_str(artilist[m].alignment), simple_typename(otyp));
3655 dump(" ", buf);
3659 #endif /* OVL1 */
3661 #ifdef OVLB
3665 * Magicbane's intrinsic magic is incompatible with normal
3666 * enchantment magic. Thus, its effects have a negative
3667 * dependence on spe. Against low mr victims, it typically
3668 * does "double athame" damage, 2d4. Occasionally, it will
3669 * cast unbalancing magic which effectively averages out to
3670 * 4d4 damage (3d4 against high mr victims), for spe = 0.
3672 * Prior to 3.4.1, the cancel (aka purge) effect always
3673 * included the scare effect too; now it's one or the other.
3674 * Likewise, the stun effect won't be combined with either
3675 * of those two; it will be chosen separately or possibly
3676 * used as a fallback when scare or cancel fails.
3678 * [Historical note: a change to artifact_hit() for 3.4.0
3679 * unintentionally made all of Magicbane's special effects
3680 * be blocked if the defender successfully saved against a
3681 * stun attack. As of 3.4.1, those effects can occur but
3682 * will be slightly less likely than they were in 3.3.x.]
3684 #define MB_MAX_DIEROLL 8 /* rolls above this aren't magical */
3685 static const char * const mb_verb[2][4] = {
3686 { "probe", "stun", "scare", "cancel" },
3687 { "prod", "amaze", "tickle", "purge" },
3689 #define MB_INDEX_PROBE 0
3690 #define MB_INDEX_STUN 1
3691 #define MB_INDEX_SCARE 2
3692 #define MB_INDEX_CANCEL 3
3694 /* called when someone is being hit by Magicbane */
3695 STATIC_OVL boolean
3696 Mb_hit(magr, mdef, mb, dmgptr, dieroll, vis, hittee, specialtype)
3697 struct monst *magr, *mdef; /* attacker and defender */
3698 struct obj *mb; /* Magicbane */
3699 int *dmgptr; /* extra damage target will suffer */
3700 int dieroll; /* d20 that has already scored a hit */
3701 boolean vis; /* whether the action can be seen */
3702 char *hittee; /* target's name: "you" or mon_nam(mdef) */
3703 int specialtype; /* by Amy: additional effects for specific artifacts */
3705 /* special types:
3706 0 = nothing
3707 1 = the stun has 1 in 3 chance to also confuse the opponent
3711 struct permonst *old_uasmon;
3712 const char *verb;
3713 boolean youattack = (magr == &youmonst),
3714 youdefend = (mdef == &youmonst),
3715 resisted = FALSE, do_stun, do_confuse, result;
3716 int attack_indx, scare_dieroll = MB_MAX_DIEROLL / 2;
3718 result = FALSE; /* no message given yet */
3719 /* the most severe effects are less likely at higher enchantment */
3720 if (mb->spe >= 3)
3721 scare_dieroll /= (1 << (mb->spe / 3));
3722 /* if target successfully resisted the artifact damage bonus,
3723 reduce overall likelihood of the assorted special effects */
3724 if (!spec_dbon_applies) dieroll += 1;
3726 /* might stun even when attempting a more severe effect, but
3727 in that case it will only happen if the other effect fails;
3728 extra damage will apply regardless; 3.4.1: sometimes might
3729 just probe even when it hasn't been enchanted */
3730 do_stun = (max(mb->spe,0) < rn2(spec_dbon_applies ? 11 : 7));
3732 /* the special effects also boost physical damage; increments are
3733 generally cumulative, but since the stun effect is based on a
3734 different criterium its damage might not be included; the base
3735 damage is either 1d4 (athame) or 2d4 (athame+spec_dbon) depending
3736 on target's resistance check against AD_STUN (handled by caller)
3737 [note that a successful save against AD_STUN doesn't actually
3738 prevent the target from ending up stunned] */
3739 attack_indx = MB_INDEX_PROBE;
3740 *dmgptr += rnd(4); /* (2..3)d4 */
3741 if (do_stun) {
3742 attack_indx = MB_INDEX_STUN;
3743 *dmgptr += rnd(4); /* (3..4)d4 */
3745 if (dieroll <= scare_dieroll) {
3746 attack_indx = MB_INDEX_SCARE;
3747 *dmgptr += rnd(4); /* (3..5)d4 */
3749 if (dieroll <= (scare_dieroll / 2)) {
3750 attack_indx = MB_INDEX_CANCEL;
3751 *dmgptr += rnd(4); /* (4..6)d4 */
3754 /* give the hit message prior to inflicting the effects */
3755 verb = mb_verb[!!Hallucination][attack_indx];
3756 if (youattack || youdefend || vis) {
3757 result = TRUE;
3758 pline_The("magic-absorbing weapon %s %s!",
3759 vtense((const char *)0, verb), hittee);
3760 /* assume probing has some sort of noticeable feedback
3761 even if it is being done by one monster to another */
3762 if (attack_indx == MB_INDEX_PROBE && !canspotmon(mdef) && !(mdef->data->msound == MS_DEEPSTATE) && !(mdef->egotype_deepstatemember))
3763 map_invisible(mdef->mx, mdef->my);
3766 /* now perform special effects */
3767 switch (attack_indx) {
3768 case MB_INDEX_CANCEL:
3769 old_uasmon = youmonst.data;
3770 /* No mdef->mcan check: even a cancelled monster can be polymorphed
3771 * into a golem, and the "cancel" effect acts as if some magical
3772 * energy remains in spellcasting defenders to be absorbed later.
3774 boolean alreadycancel = (youattack && mdef && mdef->mcan);
3776 if (!cancel_monst(mdef, mb, youattack, FALSE, FALSE)) {
3777 resisted = TRUE;
3778 } else {
3779 do_stun = FALSE;
3780 if (youdefend) {
3781 if (youmonst.data != old_uasmon)
3782 *dmgptr = 0; /* rehumanized, so no more damage */
3783 if (u.uenmax > 0) {
3784 You("lose magical energy!");
3785 u.uenmax--;
3786 if (u.uen > 0) u.uen--;
3787 flags.botl = 1;
3789 } else {
3790 if (mdef->data == &mons[PM_CLAY_GOLEM])
3791 mdef->mhp = 1; /* cancelled clay golems will die */
3792 if (youattack && !alreadycancel && attacktype(mdef->data, AT_MAGC)) {
3793 You("absorb magical energy!");
3794 u.uenmax++;
3795 u.uen++;
3796 flags.botl = 1;
3800 break;
3802 case MB_INDEX_SCARE:
3803 if (youdefend) {
3804 if (Antimagic) {
3805 resisted = TRUE;
3806 } else {
3807 nomul(-3, "being scared stiff", TRUE);
3808 nomovemsg = "";
3809 if (magr && magr == u.ustuck && sticks(youmonst.data)) {
3810 setustuck((struct monst *)0);
3811 You("release %s!", mon_nam(magr));
3814 } else {
3815 if (rn2(2) && resist(mdef, WEAPON_CLASS, 0, NOTELL))
3816 resisted = TRUE;
3817 else
3818 monflee(mdef, 3, FALSE, (mdef->mhp > *dmgptr));
3820 if (!resisted) do_stun = FALSE;
3821 break;
3823 case MB_INDEX_STUN:
3824 do_stun = TRUE; /* (this is redundant...) */
3825 break;
3827 case MB_INDEX_PROBE:
3828 if (youattack && (mb->spe == 0 || !rn2(3 * abs(mb->spe)))) {
3829 pline_The("%s is insightful.", verb);
3830 /* pre-damage status */
3831 probe_monster(mdef);
3833 break;
3835 /* stun if that was selected and a worse effect didn't occur */
3836 if (do_stun) {
3837 if (youdefend) {
3838 make_stunned((HStun + 3), FALSE);
3839 if (specialtype == 1 && !rn2(3)) make_confused(HConfusion + 4, FALSE);
3840 } else {
3841 mdef->mstun = 1;
3842 if (specialtype == 1 && !rn2(3)) mdef->mconf = 1;
3844 /* avoid extra stun message below if we used mb_verb["stun"] above */
3845 if (attack_indx == MB_INDEX_STUN) do_stun = FALSE;
3847 /* lastly, all this magic can be confusing... */
3848 do_confuse = !rn2(12);
3849 if (do_confuse) {
3850 if (youdefend)
3851 make_confused(HConfusion + 4, FALSE);
3852 else
3853 mdef->mconf = 1;
3856 if (youattack || youdefend || vis) {
3857 (void) upstart(hittee); /* capitalize */
3858 if (resisted) {
3859 pline("%s %s!", hittee, vtense(hittee, "resist"));
3860 shieldeff(youdefend ? u.ux : mdef->mx,
3861 youdefend ? u.uy : mdef->my);
3863 if ((do_stun || do_confuse) && flags.verbose) {
3864 char buf[BUFSZ];
3866 buf[0] = '\0';
3867 if (do_stun) strcat(buf, "stunned");
3868 if (do_stun && do_confuse) strcat(buf, " and ");
3869 if (do_confuse) strcat(buf, "confused");
3870 pline("%s %s %s%c", hittee, vtense(hittee, "are"),
3871 buf, (do_stun && do_confuse) ? '!' : '.');
3875 return result;
3878 /* Function used when someone attacks someone else with an artifact
3879 * weapon. Only adds the special (artifact) damage, and returns a 1 if it
3880 * did something special (in which case the caller won't print the normal
3881 * hit message). This should be called once upon every artifact attack;
3882 * dmgval() no longer takes artifact bonuses into account. Possible
3883 * extension: change the killer so that when an orc kills you with
3884 * Stormbringer it's "killed by Stormbringer" instead of "killed by an orc".
3886 boolean
3887 artifact_hit(magr, mdef, otmp, dmgptr, dieroll)
3888 struct monst *magr, *mdef;
3889 struct obj *otmp;
3890 int *dmgptr;
3891 int dieroll; /* needed for Magicbane and vorpal blades */
3893 boolean youattack = (magr == &youmonst);
3894 boolean youdefend = (mdef == &youmonst);
3895 boolean vis = (!youattack && magr && cansee(magr->mx, magr->my))
3896 || (!youdefend && cansee(mdef->mx, mdef->my))
3897 || (youattack && u.uswallow && mdef == u.ustuck && !Blind);
3898 boolean realizes_damage;
3899 const char *wepdesc;
3900 static const char you[] = "you";
3901 char hittee[BUFSIZ];
3902 boolean special_applies;
3903 boolean willreturntrue = 0;
3904 int specialtype = 0; /* for magicbane-esque artifacts --Amy */
3906 /* monsters can smash you with e.g. Instant Death even though that's not a melee weapon, this is intentional --Amy
3907 * however, we can't allow the player's pets to smash enemies with such weapons as that would be way too OP! */
3908 if (magr && !youattack && magr->mtame && (is_launcher(otmp) || is_missile(otmp) || is_ammo(otmp) || (is_lightsaber(otmp) && !otmp->lamplit) || (is_pole(otmp)) ) ) return 0;
3910 strcpy(hittee, youdefend ? you : mon_nam(mdef));
3912 /* The following takes care of most of the damage, but not all--
3913 * the exception being for level draining, which is specially
3914 * handled. Messages are done in this function, however.
3916 *dmgptr += spec_dbon(otmp, mdef, *dmgptr);
3918 if (spec_dbon_applies)
3919 special_applies = TRUE;
3920 else {
3921 const struct artifact *weap = get_artifact(otmp);
3922 special_applies = weap && spec_applies_number(weap, mdef, otmp);
3925 if (youattack && youdefend) {
3926 impossible("attacking yourself with weapon?");
3927 return FALSE;
3930 realizes_damage = (youdefend || vis ||
3931 /* feel the effect even if not seen */
3932 (youattack && mdef == u.ustuck));
3934 /* the four basic attacks: fire, cold, shock and missiles */
3935 if (attacks(AD_FIRE, otmp)) {
3936 if (realizes_damage)
3937 pline_The("fiery weapon %s %s%c",
3938 !spec_dbon_applies ? "hits" :
3939 (mdef->data == &mons[PM_WATER_ELEMENTAL]) ?
3940 "vaporizes part of" : "burns",
3941 hittee, !spec_dbon_applies ? '.' : '!');
3942 if (!rn2(50)) (void) destroy_mitem(mdef, POTION_CLASS, AD_FIRE);
3943 if (!rn2(50)) (void) destroy_mitem(mdef, SCROLL_CLASS, AD_FIRE);
3944 if (!rn2(75)) (void) destroy_mitem(mdef, SPBOOK_CLASS, AD_FIRE);
3945 if (youdefend && Slimed) burn_away_slime();
3946 if (realizes_damage) willreturntrue = 1;
3948 if (attacks(AD_COLD, otmp)) {
3949 if (realizes_damage)
3950 pline_The("ice-cold weapon %s %s%c",
3951 !spec_dbon_applies ? "hits" : "freezes",
3952 hittee, !spec_dbon_applies ? '.' : '!');
3953 if (!rn2(100)) (void) destroy_mitem(mdef, POTION_CLASS, AD_COLD);
3954 if (realizes_damage) willreturntrue = 1;
3956 if (attacks(AD_ELEC, otmp)) {
3957 if (realizes_damage)
3958 pline_The("electrified weapon hits%s %s%c",
3959 !spec_dbon_applies ? "" : "! Lightning strikes",
3960 hittee, !spec_dbon_applies ? '.' : '!');
3961 if (!rn2(150)) (void) destroy_mitem(mdef, RING_CLASS, AD_ELEC);
3962 if (!rn2(150)) (void) destroy_mitem(mdef, WAND_CLASS, AD_ELEC);
3963 if (realizes_damage) willreturntrue = 1;
3965 if (attacks(AD_ACID, otmp)) {
3966 if (realizes_damage)
3967 pline_The("corrosive weapon %s %s%c",
3968 !spec_dbon_applies ? "hits" : "vitriolizes",
3969 hittee, !spec_dbon_applies ? '.' : '!');
3970 if (!rn2(30)) erode_armor(mdef, TRUE);
3971 if (realizes_damage) willreturntrue = 1;
3973 if (attacks(AD_MAGM, otmp)) {
3974 if (realizes_damage)
3975 pline_The("imaginary widget hits%s %s%c",
3976 !spec_dbon_applies ? "" :
3977 "! A hail of magic missiles strikes",
3978 hittee, !spec_dbon_applies ? '.' : '!');
3979 if (realizes_damage) willreturntrue = 1;
3982 if (attacks(AD_STUN, otmp) && dieroll <= MB_MAX_DIEROLL) {
3984 specialtype = 0;
3985 if (otmp->oartifact == ART_SCREAMOUT) specialtype = 1;
3987 /* Magicbane's special attacks (possibly modifies hittee[]) */
3988 if (Mb_hit(magr, mdef, otmp, dmgptr, dieroll, vis, hittee, specialtype)) willreturntrue = 1;
3991 if (!special_applies) {
3992 /* since damage bonus didn't apply, nothing more to do;
3993 no further attacks have side-effects on inventory */
3994 /* [ALI] The Tsurugi of Muramasa has no damage bonus but
3995 is handled below so avoid early exit if SPFX_BEHEAD set
3996 and the defender is vulnerable */
3997 /* Amy edit: way too many special cases, in the case of
3998 doubt we have to go through the remaining possibilities
3999 anyway to ensure none are missed
4000 * edit again: but we need to make sure only susceptible
4001 monsters are affected! */
4003 return FALSE;
4006 if(otmp->oartifact == ART_REAVER){
4007 if(youattack){
4008 if(mdef->minvent && (Role_if(PM_PIRATE) || !rn2(10) ) ){
4009 struct obj *otmp2, **minvent_ptr;
4010 long unwornmask;
4012 if((otmp2 = mdef->minvent) != 0) {
4013 /* take the object away from the monster */
4014 obj_extract_self(otmp2);
4015 if ((unwornmask = otmp2->owornmask) != 0L) {
4016 mdef->misc_worn_check &= ~unwornmask;
4017 if (otmp2->owornmask & W_WEP) {
4018 setmnotwielded(mdef,otmp2);
4019 MON_NOWEP(mdef);
4021 otmp2->owornmask = 0L;
4022 update_mon_intrinsics(mdef, otmp2, FALSE, FALSE);
4024 /* give the object to the character */
4025 otmp2 = (Role_if(PM_PIRATE) || Role_if(PM_KORSAIR) || PirateSpeakOn) ?
4026 hold_another_object(otmp2, "Ye snatched but dropped %s.",
4027 doname(otmp2), "Ye steal: ") :
4028 hold_another_object(otmp2, "You snatched but dropped %s.",
4029 doname(otmp2), "You steal: ");
4030 if (otmp2->otyp == CORPSE &&
4031 touch_petrifies(&mons[otmp2->corpsenm]) && (!uarmg || FingerlessGloves)) {
4032 static char kbuf[BUFSZ];
4034 sprintf(kbuf, "a stolen petrifying corpse");
4035 instapetrify(kbuf);
4037 if (otmp2->otyp == PETRIFYIUM_BAR && (!uarmg || FingerlessGloves)) {
4038 static char kbuf[BUFSZ];
4040 sprintf(kbuf, "a stolen petrifyium bar");
4041 instapetrify(kbuf);
4044 if (otmp2->otyp == PETRIFYIUM_BRA && (!uarmg || FingerlessGloves)) {
4045 static char kbuf[BUFSZ];
4047 sprintf(kbuf, "a stolen petrifyium bra");
4048 instapetrify(kbuf);
4051 /* more take-away handling, after theft message */
4052 if (unwornmask & W_WEP) { /* stole wielded weapon */
4053 possibly_unwield(mdef, FALSE);
4054 } else if (unwornmask & W_ARMG) { /* stole worn gloves */
4055 mselftouch(mdef, (const char *)0, TRUE);
4056 if (mdef->mhp <= 0) /* it's now a statue */
4057 return 1; /* monster is dead */
4062 else if(youdefend){
4063 char buf[BUFSZ];
4064 buf[0] = '\0';
4065 steal(magr, buf, FALSE, FALSE);
4067 else{
4068 struct obj *obj;
4069 /* find an object to steal, non-cursed if magr is tame */
4070 for (obj = mdef->minvent; obj; obj = obj->nobj)
4071 if (!magr->mtame || !obj->cursed)
4072 break;
4074 if (obj) {
4075 char buf[BUFSZ], onambuf[BUFSZ], mdefnambuf[BUFSZ];
4077 /* make a special x_monnam() call that never omits
4078 the saddle, and save it for later messages */
4079 strcpy(mdefnambuf, x_monnam(mdef, ARTICLE_THE, (char *)0, 0, FALSE));
4080 if (u.usteed == mdef &&
4081 obj == which_armor(mdef, W_SADDLE))
4082 /* "You can no longer ride <steed>." */
4083 dismount_steed(DISMOUNT_POLY);
4084 obj_extract_self(obj);
4085 if (obj->owornmask) {
4086 mdef->misc_worn_check &= ~obj->owornmask;
4087 if (obj->owornmask & W_WEP)
4088 setmnotwielded(mdef,obj);
4089 obj->owornmask = 0L;
4090 update_mon_intrinsics(mdef, obj, FALSE, FALSE);
4092 /* add_to_minv() might free obj [if it merges] */
4093 if (vis)
4094 strcpy(onambuf, doname(obj));
4095 (void) add_to_minv(magr, obj);
4096 if (vis) {
4097 strcpy(buf, Monnam(magr));
4098 pline("%s steals %s from %s!", buf,
4099 onambuf, mdefnambuf);
4101 possibly_unwield(mdef, FALSE);
4102 mdef->mstrategy &= ~STRAT_WAITFORU;
4103 mselftouch(mdef, (const char *)0, FALSE);
4104 if (mdef->mhp <= 0)
4105 return 1;
4110 /* STEPHEN WHITE'S NEW CODE */
4111 if (otmp->oartifact == ART_SERPENT_S_TONGUE || otmp->oartifact == ART_GIVE_US_A_NAME || otmp->oartifact == ART_DIRGE || otmp->oartifact == ART_TOXIC_PINK || otmp->oartifact == ART_BIBLICAL_PLAGUE || otmp->oartifact == ART_THORNS || otmp->oartifact == ART_DEVIOUS_DILJER || otmp->oartifact == ART_NECMEASURE || otmp->oartifact == ART_VENOREAL || otmp->oartifact == ART_TWISTED_TURN || otmp->oartifact == ART_VERYGRIMTOOTH || otmp->oartifact == ART_SHIZUGAMI_S_MIZUCHI || otmp->oartifact == ART_SCHOSCHO_BARBITUER || otmp->oartifact == ART_WONDERLIGHT || otmp->oartifact == ART_WAR_DECLARATION || otmp->oartifact == ART_GREENLINGS_LASH || otmp->oartifact == ART_EGRI_DUEU || otmp->oartifact == ART_POISON_BURST || otmp->oartifact == ART_THOSE_LAZY_PROGRAMMERS || otmp->oartifact == ART_HALLOW_MOONFALL || otmp->oartifact == ART_QUEUE_STAFF || otmp->oartifact == ART_SNAKELASH || otmp->oartifact == ART_SWORD_OF_BHELEU) {
4112 otmp->dknown = TRUE;
4113 pline_The("twisted weapon poisons %s!",
4114 youdefend ? "you" : mon_nam(mdef));
4115 if (!youdefend && otmp->oartifact == ART_SCHOSCHO_BARBITUER) adjalign(-1);
4117 if (youdefend ? (Poison_resistance && (StrongPoison_resistance || rn2(10)) ) : (resists_poison(mdef) && !player_will_pierce_resistance()) ) {
4118 if (youdefend)
4119 You("are not affected by the poison.");
4120 else
4121 pline("%s seems unaffected by the poison.", Monnam(mdef));
4122 willreturntrue = 1;
4124 switch (rnd(10)) {
4125 case 1:
4126 case 2:
4127 case 3:
4128 case 4:
4129 *dmgptr += d(1,6) + 2;
4130 break;
4131 case 5:
4132 case 6:
4133 case 7:
4134 *dmgptr += d(2,6) + 4;
4135 break;
4136 case 8:
4137 case 9:
4138 *dmgptr += d(3,6) + 6;
4139 break;
4140 case 10:
4141 if (!rn2(20) && !(!youdefend && resists_poison(mdef)) && !(youdefend && uarmf && uarmf->oartifact == ART_PURPLE_JUNGLE) && !(youdefend && uarms && uarms->oartifact == ART_ANTINSTANT_DEATH) ) {
4142 pline_The("poison was deadly...");
4143 *dmgptr = 2 *
4144 (youdefend ? Upolyd ? u.mh : u.uhp : mdef->mhp) +
4145 FATAL_DAMAGE_MODIFIER;
4147 else { *dmgptr += d(4,6) + 6; }
4148 break;
4150 willreturntrue = 1;
4153 if (otmp->oartifact == ART_DOOMBLADE && dieroll < 6) {
4154 if (youattack)
4155 You("plunge the Doomblade deeply into %s!",
4156 mon_nam(mdef));
4157 else
4158 pline("%s plunges the Doomblade deeply into %s!",
4159 Monnam(magr), hittee);
4160 if (youattack && (PlayerHearsSoundEffects)) pline(issoviet ? "Tak chto vy dumayete, vy mozhete bit' igru tol'ko potomu, chto vy nashli artefakt. Bednyy zabluzhdayutsya dusha." : "Doaaaaaai!");
4161 *dmgptr += rnd(4) * 5;
4162 willreturntrue = 1;
4165 if (otmp->oartifact == ART_FUHITSUYONA_HAMETSU_NO_GAR && dieroll < 6) {
4166 if (youattack)
4167 You("plunge the sword deeply into %s!",
4168 mon_nam(mdef));
4169 else
4170 pline("%s plunges the sword deeply into %s!",
4171 Monnam(magr), hittee);
4172 if (youattack && (PlayerHearsSoundEffects)) pline(issoviet ? "Tak chto vy dumayete, vy mozhete bit' igru tol'ko potomu, chto vy nashli artefakt. Bednyy zabluzhdayutsya dusha." : "Doaaaaaai!");
4173 *dmgptr += rnd(4) * 5;
4174 willreturntrue = 1;
4177 if (otmp->oartifact == ART_INRAM && !rn2(5)) {
4178 if (youattack)
4179 You("ram the heel into %s!", mon_nam(mdef));
4180 else
4181 pline("%s rams the heel into %s!", Monnam(magr), hittee);
4182 *dmgptr += rnd(20);
4183 willreturntrue = 1;
4186 if (otmp->oartifact == ART_WOEBLADE && dieroll < 6) {
4187 if (youattack)
4188 You("plunge the Woeblade deeply into %s!",
4189 mon_nam(mdef));
4190 else
4191 pline("%s plunges the Woeblade deeply into %s!",
4192 Monnam(magr), hittee);
4193 if (youattack && (PlayerHearsSoundEffects)) pline(issoviet ? "Tak chto vy dumayete, vy mozhete bit' igru tol'ko potomu, chto vy nashli artefakt. Bednyy zabluzhdayutsya dusha." : "Doaaaaaai!");
4194 *dmgptr += rnd(4) * 5;
4195 willreturntrue = 1;
4198 /* END OF STEPHEN WHITE'S NEW CODE */
4200 #if 0
4201 if (otmp->oartifact == ART_SCALPEL && dieroll < 5) {
4202 /* faster than a speeding bullet is the Gray Mouser... */
4203 pline("There is a flurry of blows!");
4204 /* I suppose this could theoretically continue forever... */
4205 while (dieroll < 5) {
4206 *dmgptr += rnd(8) + 1 + otmp->spe;
4207 dieroll = rn2(11);
4210 if (otmp->oartifact == ART_HEARTSEEKER && dieroll < 3) {
4211 /* this weapon just sounds nasty... yuck... */
4212 if (!youdefend) {
4213 You("plunge Heartseeker into %s!",mon_nam(mdef));
4214 } else {
4215 pline("%s plunges Heartseeker into you!",mon_nam(mdef));
4217 *dmgptr += rnd(6)+rnd(6)+rnd(6)+rnd(6)+4;
4219 #endif
4222 /* We really want "on a natural 20" but Nethack does it in */
4223 /* reverse from AD&D. */
4224 if (spec_ability(otmp, SPFX_BEHEAD)) {
4225 if ( (otmp->oartifact == ART_TSURUGI_OF_MURAMASA || otmp->oartifact == ART_HAHA_OWNED || otmp->oartifact == ART_GAYSECT || otmp->oartifact == ART_THOUSAND_FRAGMENTS || otmp->oartifact == ART_THEIR_DED || otmp->oartifact == ART_KAMI_SORI_NO_USUI_HA || otmp->oartifact == ART_ASHIKAGA_S_REVENGE || otmp->oartifact == ART_SIGMUND_S_SMALL_LOAD || otmp->oartifact == ART_KATANA_OF_MASAMUNE || otmp->oartifact == ART_GOOD_GAME_ZUANG_LI || otmp->oartifact == ART_MINOPOWER || otmp->oartifact == ART_LIGHTNING_STROKE || otmp->oartifact == ART_DRAGONCLAN_SWORD || otmp->oartifact == ART_KILLING_EDGE) && dieroll < 2) {
4226 wepdesc = "The razor-sharp blade";
4228 if (!youdefend && mdef->data->geno & G_UNIQ) {
4229 if (youattack) You("critically hit %s!", mon_nam(mdef));
4230 else if (vis) pline("%s critically hits %s!", Monnam(magr), hittee);
4231 *dmgptr += (GushLevel * 2);
4232 willreturntrue = 1;
4233 goto beheadingdone;
4236 /* not really beheading, but so close, why add another SPFX
4237 * Amy edit: that's like totally imba, man, why on earth does that work even on targets that would be
4238 * too large to bisect or lack a head to behead? let's just make it deal extra damage */
4239 if (youattack && u.uswallow && mdef == u.ustuck) {
4240 You("slice %s wide open!", mon_nam(mdef));
4241 *dmgptr += (GushLevel * 2);
4242 willreturntrue = 1;
4243 goto beheadingdone;
4245 if (!youdefend) {
4246 /* allow normal cutworm() call to add extra damage */
4247 if(notonhead) {
4248 goto beheadingdone;
4251 if (bigmonst(mdef->data)) {
4252 if (youattack)
4253 You("slice deeply into %s!",
4254 mon_nam(mdef));
4255 else if (vis)
4256 pline("%s cuts deeply into %s!",
4257 Monnam(magr), hittee);
4258 *dmgptr *= 2;
4259 willreturntrue = 1;
4260 goto beheadingdone;
4262 *dmgptr = 2 * mdef->mhp + FATAL_DAMAGE_MODIFIER;
4263 pline("%s cuts %s in half!", wepdesc, mon_nam(mdef));
4264 if (!youdefend && otmp->oartifact == ART_HAHA_OWNED && otmp->spe > -20) otmp->spe--;
4265 otmp->dknown = TRUE;
4266 willreturntrue = 1;
4267 goto beheadingdone;
4268 } else {
4269 /* Invulnerable player won't be bisected */
4270 if (bigmonst(youmonst.data) || (uwep && uwep->oartifact == ART_KATANA_OF_MASAMUNE) || StrongDiminishedBleeding || Invulnerable || ((PlayerInBlockHeels || PlayerInWedgeHeels) && tech_inuse(T_EXTREME_STURDINESS) && !rn2(2) ) || (Stoned_chiller && Stoned && !(u.stonedchilltimer) && !rn2(3)) ) {
4271 pline("%s cuts deeply into you!",
4272 magr ? Monnam(magr) : wepdesc);
4273 *dmgptr *= 2;
4274 willreturntrue = 1;
4275 goto beheadingdone;
4278 /* Players with negative AC's take less damage instead
4279 * of just not getting hit. We must add a large enough
4280 * value to the damage so that this reduction in
4281 * damage does not prevent death.
4283 *dmgptr = 2 * (Upolyd ? u.mh : u.uhp) + FATAL_DAMAGE_MODIFIER;
4284 pline("%s cuts you in half!", wepdesc);
4285 otmp->dknown = TRUE;
4286 willreturntrue = 1;
4287 goto beheadingdone;
4289 } else if (dieroll < 2 || (otmp->oartifact == ART_VORPAL_BLADE && mdef->data->mlet == S_JABBERWOCK)) {
4290 static const char * const behead_msg[2] = {
4291 "%s beheads %s!",
4292 "%s decapitates %s!"
4295 if (!youdefend && mdef->data->geno & G_UNIQ) {
4297 if (!has_head(mdef->data) || notonhead || u.uswallow || noncorporeal(mdef->data) || amorphous(mdef->data)) {
4298 goto beheadingdone;
4301 if (youattack) You("critically hit %s!", mon_nam(mdef));
4302 else if (vis) pline("%s critically hits %s!", Monnam(magr), hittee);
4303 *dmgptr += (GushLevel * 2);
4304 willreturntrue = 1;
4305 goto beheadingdone;
4308 if (youattack && u.uswallow && mdef == u.ustuck) {
4309 goto beheadingdone;
4311 wepdesc = artilist[otmp->oartifact].name;
4312 if (!youdefend) {
4313 if (!has_head(mdef->data) || notonhead || u.uswallow) {
4314 if (youattack)
4315 pline("Somehow, you miss %s wildly.",
4316 mon_nam(mdef));
4317 else if (vis)
4318 pline("Somehow, %s misses wildly.",
4319 mon_nam(magr));
4320 *dmgptr = 0;
4321 if (youattack || vis) willreturntrue = 1;
4322 goto beheadingdone;
4324 if (noncorporeal(mdef->data) || amorphous(mdef->data)) {
4325 pline("%s slices through %s %s.", wepdesc,
4326 s_suffix(mon_nam(mdef)),
4327 mbodypart(mdef,NECK));
4328 willreturntrue = 1;
4329 goto beheadingdone;
4331 *dmgptr = 2 * mdef->mhp + FATAL_DAMAGE_MODIFIER;
4332 pline(behead_msg[rn2(SIZE(behead_msg))],
4333 wepdesc, mon_nam(mdef));
4334 otmp->dknown = TRUE;
4335 willreturntrue = 1;
4336 goto beheadingdone;
4337 } else {
4339 if (!has_head(youmonst.data) || Role_if(PM_COURIER)) {
4340 pline("Somehow, %s misses you wildly.", magr ? mon_nam(magr) : wepdesc);
4341 *dmgptr = 0;
4342 willreturntrue = 1;
4343 goto beheadingdone;
4346 if (uamul && uamul->otyp == AMULET_OF_NECK_BRACE) {
4347 pline("Somehow, %s misses you wildly.", magr ? mon_nam(magr) : wepdesc);
4348 *dmgptr = 0;
4349 willreturntrue = 1;
4350 goto beheadingdone;
4353 if (powerfulimplants() && uimplant && uimplant->oartifact == ART_DECAPITATION_UP) {
4354 pline("Somehow, %s misses you wildly.", magr ? mon_nam(magr) : wepdesc);
4355 *dmgptr = 0;
4356 willreturntrue = 1;
4357 goto beheadingdone;
4361 if (uarmh && uarmh->oartifact == ART_REST_THE_CASE) {
4362 pline("Somehow, %s misses you wildly.", magr ? mon_nam(magr) : wepdesc);
4363 *dmgptr = 0;
4364 willreturntrue = 1;
4365 goto beheadingdone;
4369 if (uarmh && itemhasappearance(uarmh, APP_COMPLETE_HELMET) ) {
4370 pline("%s slices into your %s.", wepdesc, body_part(NECK));
4371 willreturntrue = 1;
4372 goto beheadingdone;
4375 if (RngeAntiBeheading) {
4376 pline("%s slices into your %s.", wepdesc, body_part(NECK));
4377 willreturntrue = 1;
4378 goto beheadingdone;
4382 if (noncorporeal(youmonst.data) || amorphous(youmonst.data)) {
4383 pline("%s slices through your %s.", wepdesc, body_part(NECK));
4384 willreturntrue = 1;
4385 goto beheadingdone;
4387 *dmgptr = 2 * (Upolyd ? u.mh : u.uhp) + FATAL_DAMAGE_MODIFIER;
4388 if (Invulnerable || ((PlayerInBlockHeels || PlayerInWedgeHeels) && tech_inuse(T_EXTREME_STURDINESS) && !rn2(2) ) || (Stoned_chiller && Stoned && !(u.stonedchilltimer) && !rn2(3)) ) {
4389 pline("%s slices into your %s.", wepdesc, body_part(NECK));
4390 willreturntrue = 1;
4391 goto beheadingdone;
4393 pline(behead_msg[rn2(SIZE(behead_msg))],
4394 wepdesc, "you");
4395 otmp->dknown = TRUE;
4396 /* Should amulets fall off? */
4397 willreturntrue = 1;
4398 goto beheadingdone;
4402 beheadingdone:
4403 if (spec_ability(otmp, SPFX_DRLI)) {
4405 if (!youdefend) {
4406 if (!resists_drli(mdef)) {
4407 if (vis) {
4408 if(otmp->oartifact == ART_STORMBRINGER)
4409 pline_The("%s blade draws the life from %s!",
4410 hcolor(NH_BLACK),
4411 mon_nam(mdef));
4412 #if 0 /* OBSOLETE */
4413 else if(otmp->oartifact == ART_TENTACLE_STAFF)
4414 pline("The writhing tentacles draw the life from %s!",
4415 mon_nam(mdef));
4416 #endif
4417 else
4418 pline("%s draws the life from %s!",
4419 The(distant_name(otmp, xname)),
4420 mon_nam(mdef));
4422 if (mdef->m_lev == 0) {
4423 *dmgptr = 2 * mdef->mhp + FATAL_DAMAGE_MODIFIER;
4424 } else {
4425 int drain = rnd(8);
4426 *dmgptr += drain;
4427 mdef->mhpmax -= drain;
4428 mdef->m_lev--;
4429 drain /= 2;
4430 if (drain && youattack) healup(drain, 0, FALSE, FALSE);
4431 else if (drain && magr) healup_mon(magr, drain, 0, FALSE, FALSE);
4433 if (vis) willreturntrue = 1;
4435 } else if (!Drain_resistance) { /* youdefend */
4436 int oldhpmax = u.uhpmax;
4438 if (Blind)
4439 You_feel("an %s drain your life!",
4440 otmp->oartifact == ART_STORMBRINGER ?
4441 "unholy blade" : "object");
4442 else if (otmp->oartifact == ART_STORMBRINGER)
4443 pline_The("%s blade drains your life!",
4444 hcolor(NH_BLACK));
4445 else
4446 pline("%s drains your life!",
4447 The(distant_name(otmp, xname)));
4448 losexp("life drainage", FALSE, TRUE);
4449 if (magr && magr->mhp < magr->mhpmax) {
4450 magr->mhp += (oldhpmax - u.uhpmax)/2;
4451 if (magr->mhp > magr->mhpmax) magr->mhp = magr->mhpmax;
4453 willreturntrue = 1;
4456 /* WAC -- 1/6 chance of cancellation with foobane weapons */
4457 if (otmp->oartifact == ART_GIANTKILLER ||
4458 otmp->oartifact == ART_ORCRIST ||
4459 otmp->oartifact == ART_DRAGONBANE ||
4460 otmp->oartifact == ART_DEMONBANE ||
4461 otmp->oartifact == ART_WEREBANE ||
4462 otmp->oartifact == ART_TROLLSBANE ||
4463 otmp->oartifact == ART_THIEFBANE ||
4464 otmp->oartifact == ART_OGRESMASHER ||
4465 otmp->oartifact == ART_ELFRIST) {
4466 if (dieroll < 4) {
4467 if (realizes_damage) {
4468 pline("%s %s!", The(distant_name(otmp, xname)), Blind ?
4469 "roars deafeningly" : "shines brilliantly");
4470 pline("It strikes %s!", hittee);
4472 cancel_monst(mdef, otmp, youattack, TRUE, magr == mdef);
4473 willreturntrue = 1;
4476 if (willreturntrue) return TRUE;
4478 return FALSE;
4481 static NEARDATA const char recharge_type[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
4482 static NEARDATA const char invoke_types[] = { ALL_CLASSES, 0 };
4483 /* #invoke: an "ugly check" filters out most objects */
4486 doinvoke()
4488 register struct obj *obj, *acqo;
4490 if (is_pentagram(u.ux, u.uy)) {
4491 if (yn("Invoke the magical pentagram?") == 'y') {
4493 You("attune yourself with the magical energy.");
4494 u.cnd_pentagramamount++;
4496 if (u.ualign.type == A_CHAOTIC) adjalign(1);
4498 if (rn2(3)) {
4499 pline("Your mana increases.");
4500 u.uenmax++;
4501 } else switch (rnd(30)) {
4503 case 1:
4504 HTeleport_control += 2;
4505 tele();
4506 break;
4507 case 2:
4509 acqo = mkobj_at(SPBOOK_CLASS, u.ux, u.uy, FALSE, FALSE);
4510 if (acqo) {
4511 acqo->bknown = acqo->known = TRUE;
4512 pline("A book appeared at your %s!", makeplural(body_part(FOOT)));
4513 } else {
4514 pline("Nothing happens...");
4515 if (FailureEffects || u.uprops[FAILURE_EFFECTS].extrinsic || have_failurestone()) {
4516 pline("Oh wait, actually something bad happens...");
4517 badeffect();
4521 break;
4522 case 3:
4523 (void) monster_detect((struct obj *)0, 0);
4524 exercise(A_WIS, TRUE);
4525 break;
4526 case 4:
4527 trap_detect((struct obj *)0);
4528 break;
4529 case 5:
4530 object_detect((struct obj *)0, 0);
4531 break;
4532 case 6:
4534 boolean havegifts = u.ugifts;
4536 if (!havegifts) u.ugifts++;
4538 acqo = mk_artifact((struct obj *)0, !rn2(3) ? A_CHAOTIC : rn2(2) ? A_NEUTRAL : A_LAWFUL, TRUE);
4539 if (acqo) {
4540 dropy(acqo);
4541 int acqoskill = get_obj_skill(acqo, TRUE);
4543 if (P_MAX_SKILL(acqoskill) == P_ISRESTRICTED) {
4544 unrestrict_weapon_skill(acqoskill);
4545 } else if (P_MAX_SKILL(acqoskill) == P_UNSKILLED) {
4546 unrestrict_weapon_skill(acqoskill);
4547 P_MAX_SKILL(acqoskill) = P_BASIC;
4548 } else if (rn2(2) && P_MAX_SKILL(acqoskill) == P_BASIC) {
4549 P_MAX_SKILL(acqoskill) = P_SKILLED;
4550 } else if (!rn2(4) && P_MAX_SKILL(acqoskill) == P_SKILLED) {
4551 P_MAX_SKILL(acqoskill) = P_EXPERT;
4552 } else if (!rn2(10) && P_MAX_SKILL(acqoskill) == P_EXPERT) {
4553 P_MAX_SKILL(acqoskill) = P_MASTER;
4554 } else if (!rn2(100) && P_MAX_SKILL(acqoskill) == P_MASTER) {
4555 P_MAX_SKILL(acqoskill) = P_GRAND_MASTER;
4556 } else if (!rn2(200) && P_MAX_SKILL(acqoskill) == P_GRAND_MASTER) {
4557 P_MAX_SKILL(acqoskill) = P_SUPREME_MASTER;
4560 if (Race_if(PM_RUSMOT)) {
4561 if (P_MAX_SKILL(acqoskill) == P_ISRESTRICTED) {
4562 unrestrict_weapon_skill(acqoskill);
4563 } else if (P_MAX_SKILL(acqoskill) == P_UNSKILLED) {
4564 unrestrict_weapon_skill(acqoskill);
4565 P_MAX_SKILL(acqoskill) = P_BASIC;
4566 } else if (rn2(2) && P_MAX_SKILL(acqoskill) == P_BASIC) {
4567 P_MAX_SKILL(acqoskill) = P_SKILLED;
4568 } else if (!rn2(4) && P_MAX_SKILL(acqoskill) == P_SKILLED) {
4569 P_MAX_SKILL(acqoskill) = P_EXPERT;
4570 } else if (!rn2(10) && P_MAX_SKILL(acqoskill) == P_EXPERT) {
4571 P_MAX_SKILL(acqoskill) = P_MASTER;
4572 } else if (!rn2(100) && P_MAX_SKILL(acqoskill) == P_MASTER) {
4573 P_MAX_SKILL(acqoskill) = P_GRAND_MASTER;
4574 } else if (!rn2(200) && P_MAX_SKILL(acqoskill) == P_GRAND_MASTER) {
4575 P_MAX_SKILL(acqoskill) = P_SUPREME_MASTER;
4579 discover_artifact(acqo->oartifact);
4581 if (!havegifts) u.ugifts--;
4582 pline("An artifact appeared beneath you!");
4586 else pline("Opportunity knocked, but nobody was home. Bummer.");
4590 break;
4591 case 7:
4592 pline("The RNG decides to curse-weld an item to you.");
4593 bad_artifact_xtra();
4594 break;
4595 case 8:
4597 int aggroamount = rnd(6);
4598 if (isfriday) aggroamount *= 2;
4599 u.aggravation = 1;
4600 reset_rndmonst(NON_PM);
4601 while (aggroamount) {
4602 u.cnd_aggravateamount++;
4603 makemon((struct permonst *)0, u.ux, u.uy, MM_ANGRY|MM_FRENZIED);
4604 aggroamount--;
4605 if (aggroamount < 0) aggroamount = 0;
4607 u.aggravation = 0;
4608 pline("Several monsters come out of a portal.");
4612 break;
4613 case 9:
4614 pline("Your body suddenly becomes all stiff!");
4615 if (isstunfish) nomul(-(rnz(15)), "paralyzed by a pentagram", TRUE);
4616 else nomul(-(rnd(15)), "paralyzed by a pentagram", TRUE);
4617 break;
4618 case 10:
4620 pline("The dungeon is getting more chaotic!");
4622 int madepool = 0;
4623 do_clear_areaX(u.ux, u.uy, 12, do_terrainfloodP, (void *)&madepool);
4626 break;
4627 case 11:
4628 You_feel("powered up!");
4629 u.uenmax += rnd(5);
4630 u.uen = u.uenmax;
4631 break;
4632 case 12:
4633 pline("Suddenly, you gain a new companion!");
4634 (void) make_familiar((struct obj *)0, u.ux, u.uy, FALSE, FALSE);
4635 break;
4636 case 13:
4639 if (Aggravate_monster) {
4640 u.aggravation = 1;
4641 reset_rndmonst(NON_PM);
4644 coord dd;
4645 coord cc;
4646 int cx,cy;
4647 int i;
4648 int randsp, randmnst, randmnsx;
4649 struct permonst *randmonstforspawn;
4650 int monstercolor;
4652 cx = rn2(COLNO);
4653 cy = rn2(ROWNO);
4655 if (!rn2(4)) {
4657 randsp = (rn2(14) + 2);
4658 if (!rn2(10)) randsp *= 2;
4659 if (!rn2(100)) randsp *= 3;
4660 if (!rn2(1000)) randsp *= 5;
4661 if (!rn2(10000)) randsp *= 10;
4662 randmnst = (rn2(187) + 1);
4663 randmnsx = (rn2(100) + 1);
4665 pline("You suddenly feel a surge of tension!");
4667 for (i = 0; i < randsp; i++) {
4668 /* This function will fill the map with a random amount of monsters of one class. --Amy */
4670 if (!enexto(&dd, u.ux, u.uy, (struct permonst *)0) ) continue;
4672 if (randmnst < 6)
4673 (void) makemon(mkclass(S_ANT,0), cx, cy, MM_ADJACENTOK);
4674 else if (randmnst < 9)
4675 (void) makemon(mkclass(S_BLOB,0), cx, cy, MM_ADJACENTOK);
4676 else if (randmnst < 11)
4677 (void) makemon(mkclass(S_COCKATRICE,0), cx, cy, MM_ADJACENTOK);
4678 else if (randmnst < 15)
4679 (void) makemon(mkclass(S_DOG,0), cx, cy, MM_ADJACENTOK);
4680 else if (randmnst < 18)
4681 (void) makemon(mkclass(S_EYE,0), cx, cy, MM_ADJACENTOK);
4682 else if (randmnst < 22)
4683 (void) makemon(mkclass(S_FELINE,0), cx, cy, MM_ADJACENTOK);
4684 else if (randmnst < 24)
4685 (void) makemon(mkclass(S_GREMLIN,0), cx, cy, MM_ADJACENTOK);
4686 else if (randmnst < 29)
4687 (void) makemon(mkclass(S_HUMANOID,0), cx, cy, MM_ADJACENTOK);
4688 else if (randmnst < 33)
4689 (void) makemon(mkclass(S_IMP,0), cx, cy, MM_ADJACENTOK);
4690 else if (randmnst < 36)
4691 (void) makemon(mkclass(S_JELLY,0), cx, cy, MM_ADJACENTOK);
4692 else if (randmnst < 41)
4693 (void) makemon(mkclass(S_KOBOLD,0), cx, cy, MM_ADJACENTOK);
4694 else if (randmnst < 44)
4695 (void) makemon(mkclass(S_LEPRECHAUN,0), cx, cy, MM_ADJACENTOK);
4696 else if (randmnst < 47)
4697 (void) makemon(mkclass(S_MIMIC,0), cx, cy, MM_ADJACENTOK);
4698 else if (randmnst < 50)
4699 (void) makemon(mkclass(S_NYMPH,0), cx, cy, MM_ADJACENTOK);
4700 else if (randmnst < 54)
4701 (void) makemon(mkclass(S_ORC,0), cx, cy, MM_ADJACENTOK);
4702 else if (randmnst < 55)
4703 (void) makemon(mkclass(S_PIERCER,0), cx, cy, MM_ADJACENTOK);
4704 else if (randmnst < 58)
4705 (void) makemon(mkclass(S_QUADRUPED,0), cx, cy, MM_ADJACENTOK);
4706 else if (randmnst < 62)
4707 (void) makemon(mkclass(S_RODENT,0), cx, cy, MM_ADJACENTOK);
4708 else if (randmnst < 65)
4709 (void) makemon(mkclass(S_SPIDER,0), cx, cy, MM_ADJACENTOK);
4710 else if (randmnst < 66)
4711 (void) makemon(mkclass(S_TRAPPER,0), cx, cy, MM_ADJACENTOK);
4712 else if (randmnst < 69)
4713 (void) makemon(mkclass(S_UNICORN,0), cx, cy, MM_ADJACENTOK);
4714 else if (randmnst < 71)
4715 (void) makemon(mkclass(S_VORTEX,0), cx, cy, MM_ADJACENTOK);
4716 else if (randmnst < 73)
4717 (void) makemon(mkclass(S_WORM,0), cx, cy, MM_ADJACENTOK);
4718 else if (randmnst < 75)
4719 (void) makemon(mkclass(S_XAN,0), cx, cy, MM_ADJACENTOK);
4720 else if (randmnst < 76)
4721 (void) makemon(mkclass(S_LIGHT,0), cx, cy, MM_ADJACENTOK);
4722 else if (randmnst < 77)
4723 (void) makemon(mkclass(S_ZOUTHERN,0), cx, cy, MM_ADJACENTOK);
4724 else if (randmnst < 78)
4725 (void) makemon(mkclass(S_ANGEL,0), cx, cy, MM_ADJACENTOK);
4726 else if (randmnst < 81)
4727 (void) makemon(mkclass(S_BAT,0), cx, cy, MM_ADJACENTOK);
4728 else if (randmnst < 83)
4729 (void) makemon(mkclass(S_CENTAUR,0), cx, cy, MM_ADJACENTOK);
4730 else if (randmnst < 86)
4731 (void) makemon(mkclass(S_DRAGON,0), cx, cy, MM_ADJACENTOK);
4732 else if (randmnst < 89)
4733 (void) makemon(mkclass(S_ELEMENTAL,0), cx, cy, MM_ADJACENTOK);
4734 else if (randmnst < 94)
4735 (void) makemon(mkclass(S_FUNGUS,0), cx, cy, MM_ADJACENTOK);
4736 else if (randmnst < 99)
4737 (void) makemon(mkclass(S_GNOME,0), cx, cy, MM_ADJACENTOK);
4738 else if (randmnst < 102)
4739 (void) makemon(mkclass(S_GIANT,0), cx, cy, MM_ADJACENTOK);
4740 else if (randmnst < 103)
4741 (void) makemon(mkclass(S_JABBERWOCK,0), cx, cy, MM_ADJACENTOK);
4742 else if (randmnst < 104)
4743 (void) makemon(mkclass(S_KOP,0), cx, cy, MM_ADJACENTOK);
4744 else if (randmnst < 105)
4745 (void) makemon(mkclass(S_LICH,0), cx, cy, MM_ADJACENTOK);
4746 else if (randmnst < 108)
4747 (void) makemon(mkclass(S_MUMMY,0), cx, cy, MM_ADJACENTOK);
4748 else if (randmnst < 110)
4749 (void) makemon(mkclass(S_NAGA,0), cx, cy, MM_ADJACENTOK);
4750 else if (randmnst < 113)
4751 (void) makemon(mkclass(S_OGRE,0), cx, cy, MM_ADJACENTOK);
4752 else if (randmnst < 115)
4753 (void) makemon(mkclass(S_PUDDING,0), cx, cy, MM_ADJACENTOK);
4754 else if (randmnst < 116)
4755 (void) makemon(mkclass(S_QUANTMECH,0), cx, cy, MM_ADJACENTOK);
4756 else if (randmnst < 118)
4757 (void) makemon(mkclass(S_RUSTMONST,0), cx, cy, MM_ADJACENTOK);
4758 else if (randmnst < 121)
4759 (void) makemon(mkclass(S_SNAKE,0), cx, cy, MM_ADJACENTOK);
4760 else if (randmnst < 123)
4761 (void) makemon(mkclass(S_TROLL,0), cx, cy, MM_ADJACENTOK);
4762 else if (randmnst < 124)
4763 (void) makemon(mkclass(S_UMBER,0), cx, cy, MM_ADJACENTOK);
4764 else if (randmnst < 125)
4765 (void) makemon(mkclass(S_VAMPIRE,0), cx, cy, MM_ADJACENTOK);
4766 else if (randmnst < 127)
4767 (void) makemon(mkclass(S_WRAITH,0), cx, cy, MM_ADJACENTOK);
4768 else if (randmnst < 128)
4769 (void) makemon(mkclass(S_XORN,0), cx, cy, MM_ADJACENTOK);
4770 else if (randmnst < 130)
4771 (void) makemon(mkclass(S_YETI,0), cx, cy, MM_ADJACENTOK);
4772 else if (randmnst < 135)
4773 (void) makemon(mkclass(S_ZOMBIE,0), cx, cy, MM_ADJACENTOK);
4774 else if (randmnst < 145)
4775 (void) makemon(mkclass(S_HUMAN,0), cx, cy, MM_ADJACENTOK);
4776 else if (randmnst < 147)
4777 (void) makemon(mkclass(S_GHOST,0), cx, cy, MM_ADJACENTOK);
4778 else if (randmnst < 149)
4779 (void) makemon(mkclass(S_GOLEM,0), cx, cy, MM_ADJACENTOK);
4780 else if (randmnst < 152)
4781 (void) makemon(mkclass(S_DEMON,0), cx, cy, MM_ADJACENTOK);
4782 else if (randmnst < 155)
4783 (void) makemon(mkclass(S_EEL,0), cx, cy, MM_ADJACENTOK);
4784 else if (randmnst < 160)
4785 (void) makemon(mkclass(S_LIZARD,0), cx, cy, MM_ADJACENTOK);
4786 else if (randmnst < 162)
4787 (void) makemon(mkclass(S_BAD_FOOD,0), cx, cy, MM_ADJACENTOK);
4788 else if (randmnst < 165)
4789 (void) makemon(mkclass(S_BAD_COINS,0), cx, cy, MM_ADJACENTOK);
4790 else if (randmnst < 166) {
4791 if (randmnsx < 96)
4792 (void) makemon(mkclass(S_HUMAN,0), cx, cy, MM_ADJACENTOK);
4793 else
4794 (void) makemon(mkclass(S_NEMESE,0), cx, cy, MM_ADJACENTOK);
4796 else if (randmnst < 171)
4797 (void) makemon(mkclass(S_GRUE,0), cx, cy, MM_ADJACENTOK);
4798 else if (randmnst < 176)
4799 (void) makemon(mkclass(S_WALLMONST,0), cx, cy, MM_ADJACENTOK);
4800 else if (randmnst < 180)
4801 (void) makemon(mkclass(S_RUBMONST,0), cx, cy, MM_ADJACENTOK);
4802 else if (randmnst < 181) {
4803 if (randmnsx < 99)
4804 (void) makemon(mkclass(S_HUMAN,0), cx, cy, MM_ADJACENTOK);
4805 else
4806 (void) makemon(mkclass(S_ARCHFIEND,0), cx, cy, MM_ADJACENTOK);
4808 else if (randmnst < 186)
4809 (void) makemon(mkclass(S_TURRET,0), cx, cy, MM_ADJACENTOK);
4810 else if (randmnst < 187)
4811 (void) makemon(mkclass(S_FLYFISH,0), cx, cy, MM_ADJACENTOK);
4812 else
4813 (void) makemon((struct permonst *)0, cx, cy, MM_ADJACENTOK);
4819 else if (!rn2(3)) {
4821 randsp = (rn2(14) + 2);
4822 if (!rn2(10)) randsp *= 2;
4823 if (!rn2(100)) randsp *= 3;
4824 if (!rn2(1000)) randsp *= 5;
4825 if (!rn2(10000)) randsp *= 10;
4826 randmonstforspawn = rndmonst();
4828 You_feel("the arrival of monsters!");
4830 for (i = 0; i < randsp; i++) {
4832 if (!enexto(&cc, u.ux, u.uy, (struct permonst *)0) ) continue;
4834 (void) makemon(randmonstforspawn, cx, cy, MM_ADJACENTOK);
4839 else if (!rn2(2)) {
4841 randsp = (rn2(14) + 2);
4842 if (!rn2(10)) randsp *= 2;
4843 if (!rn2(100)) randsp *= 3;
4844 if (!rn2(1000)) randsp *= 5;
4845 if (!rn2(10000)) randsp *= 10;
4846 monstercolor = rnd(15);
4848 You_feel("a colorful sensation!");
4850 for (i = 0; i < randsp; i++) {
4852 if (!enexto(&cc, u.ux, u.uy, (struct permonst *)0) ) continue;
4854 (void) makemon(colormon(monstercolor), cx, cy, MM_ADJACENTOK);
4859 else {
4861 randsp = (rn2(14) + 2);
4862 if (!rn2(10)) randsp *= 2;
4863 if (!rn2(100)) randsp *= 3;
4864 if (!rn2(1000)) randsp *= 5;
4865 if (!rn2(10000)) randsp *= 10;
4866 monstercolor = rnd(434);
4868 You_feel("that a group has arrived!");
4870 for (i = 0; i < randsp; i++) {
4872 if (!enexto(&cc, u.ux, u.uy, (struct permonst *)0) ) continue;
4874 (void) makemon(specialtensmon(monstercolor), cx, cy, MM_ADJACENTOK);
4879 u.aggravation = 0;
4882 break;
4883 case 14:
4885 if (u.uhunger < 1500) {
4886 pline("Your %s fills.", body_part(STOMACH));
4887 u.uhunger = 1500;
4888 u.uhs = 1; /* NOT_HUNGRY */
4889 flags.botl = 1;
4890 } else {
4891 pline("Nothing happens...");
4892 if (FailureEffects || u.uprops[FAILURE_EFFECTS].extrinsic || have_failurestone()) {
4893 pline("Oh wait, actually something bad happens...");
4894 badeffect();
4897 break;
4898 case 15:
4899 if (u.ualign.record < -1) {
4900 adjalign(-(u.ualign.record / 2));
4901 You_feel("partially absolved.");
4902 } else {
4903 u.alignlim++;
4904 adjalign(10);
4905 You_feel("appropriately %s.", align_str(u.ualign.type));
4907 break;
4908 case 16:
4911 /* occasionally get extremely lucky --Amy */
4912 if (!rn2(50)) {
4913 u.weapon_slots++;
4914 You("feel very skillful, and gain an extra skill slot!");
4915 break;
4918 int nastytrapdur = (Role_if(PM_GRADUATE) ? 6 : Role_if(PM_GEEK) ? 12 : 24);
4919 if (!nastytrapdur) nastytrapdur = 24; /* fail safe */
4920 int blackngdur = (Role_if(PM_GRADUATE) ? 2000 : Role_if(PM_GEEK) ? 1000 : 500);
4921 if (!blackngdur ) blackngdur = 500; /* fail safe */
4923 pline("Your mana increases.");
4924 u.uenmax++;
4925 /* nasty trap effect - no extra message because, well, nastiness! --Amy */
4926 randomnastytrapeffect(rnz(nastytrapdur * (monster_difficulty() + 1)), (blackngdur - (monster_difficulty() * 3)));
4929 break;
4930 case 17:
4932 int i = rn2(A_MAX);
4933 adjattrib(i, 1, 0, TRUE);
4934 adjattrib(i, 1, 0, TRUE);
4935 adjattrib(i, 1, 0, TRUE);
4936 adjattrib(i, 1, 0, TRUE);
4937 adjattrib(i, 1, 0, TRUE);
4939 break;
4940 case 18:
4941 Your("intrinsics change.");
4942 intrinsicgainorloss(0);
4943 break;
4944 case 19:
4946 struct obj *pseudo;
4947 pseudo = mksobj(SCR_ITEM_GENOCIDE, FALSE, 2, FALSE);
4948 if (!pseudo) {
4949 pline("Nothing happens...");
4950 if (FailureEffects || u.uprops[FAILURE_EFFECTS].extrinsic || have_failurestone()) {
4951 pline("Oh wait, actually something bad happens...");
4952 badeffect();
4954 break;
4956 if (pseudo->otyp == GOLD_PIECE) pseudo->otyp = SCR_ITEM_GENOCIDE;
4957 (void) seffects(pseudo);
4958 obfree(pseudo, (struct obj *)0); /* now, get rid of it */
4962 break;
4963 case 20:
4964 doubleskilltraining();
4965 break;
4966 case 21:
4967 if (!(HAggravate_monster & INTRINSIC) && !(HAggravate_monster & TIMEOUT)) {
4969 int maxtrainingamount = 0;
4970 int skillnumber = 0;
4971 int actualskillselection = 0;
4972 int amountofpossibleskills = 1;
4973 int i;
4975 for (i = 0; i < P_NUM_SKILLS; i++) {
4976 if (P_SKILL(i) != P_ISRESTRICTED) continue;
4978 if (P_ADVANCE(i) > 0 && P_ADVANCE(i) >= maxtrainingamount) {
4979 if (P_ADVANCE(i) > maxtrainingamount) {
4980 amountofpossibleskills = 1;
4981 skillnumber = i;
4982 maxtrainingamount = P_ADVANCE(i);
4983 } else if (!rn2(amountofpossibleskills + 1)) {
4984 amountofpossibleskills++;
4985 skillnumber = i;
4986 } else {
4987 amountofpossibleskills++;
4992 if (skillnumber > 0 && maxtrainingamount > 0) {
4993 unrestrict_weapon_skill(skillnumber);
4995 register int maxcap = P_BASIC;
4996 if (!rn2(2)) {
4997 maxcap = P_SKILLED;
4998 if (!rn2(2)) {
4999 maxcap = P_EXPERT;
5000 if (maxtrainingamount >= 20 && !rn2(2)) {
5001 maxcap = P_MASTER;
5002 if (maxtrainingamount >= 160 && !rn2(2)) {
5003 maxcap = P_GRAND_MASTER;
5004 if (maxtrainingamount >= 540 && !rn2(2)) {
5005 maxcap = P_SUPREME_MASTER;
5012 P_MAX_SKILL(skillnumber) = maxcap;
5013 pline("You can now learn the %s skill, with a new cap of %s.", wpskillname(skillnumber), maxcap == P_SUPREME_MASTER ? "supreme master" : maxcap == P_GRAND_MASTER ? "grand master" : maxcap == P_MASTER ? "master" : maxcap == P_EXPERT ? "expert" : maxcap == P_SKILLED ? "skilled" : "basic");
5014 } else {
5015 pline("Nothing happens...");
5016 if (FailureEffects || u.uprops[FAILURE_EFFECTS].extrinsic || have_failurestone()) {
5017 pline("Oh wait, actually something bad happens...");
5018 badeffect();
5024 if (HAggravate_monster & INTRINSIC) {
5025 HAggravate_monster &= ~INTRINSIC;
5026 You_feel("more acceptable!");
5028 if (HAggravate_monster & TIMEOUT) {
5029 HAggravate_monster &= ~TIMEOUT;
5030 You_feel("more acceptable!");
5032 break;
5033 case 22:
5035 u.aggravation = 1;
5036 reset_rndmonst(NON_PM);
5037 int attempts = 0;
5038 register struct permonst *ptrZ;
5039 newboss:
5040 do {
5042 ptrZ = rndmonst();
5043 attempts++;
5044 if (attempts && (attempts % 10000 == 0)) u.mondiffhack++;
5045 if (!rn2(2000)) reset_rndmonst(NON_PM);
5047 } while ( (!ptrZ || (ptrZ && !(ptrZ->geno & G_UNIQ))) && attempts < 50000);
5049 if (ptrZ && ptrZ->geno & G_UNIQ) {
5050 if (wizard) pline("monster generation: %s", ptrZ->mname);
5051 (void) makemon(ptrZ, u.ux, u.uy, MM_ANGRY);
5053 else if (rn2(50)) {
5054 attempts = 0;
5055 goto newboss;
5058 u.mondiffhack = 0;
5060 if (!rn2(10) ) {
5061 attempts = 0;
5062 goto newboss;
5064 pline("Boss monsters appear from nowhere!");
5067 u.aggravation = 0;
5069 break;
5070 case 23:
5071 if (!rn2(6400)) {
5072 ragnarok(TRUE);
5073 if (evilfriday) evilragnarok(TRUE,level_difficulty());
5077 u.aggravation = 1;
5078 u.heavyaggravation = 1;
5079 DifficultyIncreased += 1;
5080 HighlevelStatus += 1;
5081 EntireLevelMode += 1;
5083 (void) makemon(mkclass(S_NEMESE,0), u.ux, u.uy, MM_ANGRY|MM_FRENZIED);
5085 u.aggravation = 0;
5086 u.heavyaggravation = 0;
5088 break;
5089 case 24:
5090 wonderspell(-1);
5091 break;
5092 case 25:
5095 int tryct = 0;
5096 int x, y;
5097 boolean canbeinawall = FALSE;
5098 if (!rn2(Passes_walls ? 5 : 25)) canbeinawall = TRUE;
5099 register struct trap *ttmp;
5100 for (tryct = 0; tryct < 2000; tryct++) {
5101 x = rn1(COLNO-3,2);
5102 y = rn2(ROWNO);
5104 if (isok(x, y) && ((levl[x][y].typ > DBWALL) || canbeinawall) && !(t_at(x, y)) ) {
5105 ttmp = maketrap(x, y, rndtrap(), 0, TRUE);
5106 if (ttmp) {
5107 ttmp->tseen = 0;
5108 ttmp->hiddentrap = 1;
5110 if (!rn2(5)) break;
5114 You_feel("in grave danger...");
5116 break;
5117 case 26:
5118 badeffect();
5119 break;
5120 case 27:
5121 if (!uinsymbiosis) {
5122 getrandomsymbiote(FALSE, FALSE);
5123 pline("Suddenly you have a symbiote!");
5124 } else {
5125 u.usymbiote.mhpmax += rnd(10);
5126 maybe_evolve_symbiote();
5127 if (u.usymbiote.mhpmax > 500) u.usymbiote.mhpmax = 500;
5128 flags.botl = TRUE;
5129 Your("symbiote seems much stronger now.");
5131 break;
5132 case 28:
5133 decontaminate(100);
5134 You_feel("decontaminated.");
5135 break;
5136 case 29:
5137 pline("Wow! This makes you feel good!");
5139 int i, ii, lim;
5140 i = rn2(A_MAX);
5141 for (ii = 0; ii < A_MAX; ii++) {
5142 lim = AMAX(i);
5143 if (i == A_STR && u.uhs >= 3) --lim; /* WEAK */
5144 if (ABASE(i) < lim) {
5145 ABASE(i) = lim;
5146 flags.botl = 1;
5147 break;
5149 if(++i >= A_MAX) i = 0;
5153 break;
5154 case 30:
5155 boostknownskillcap();
5156 break;
5157 default:
5158 impossible("undefined pentagram effect");
5159 break;
5163 if (!rn2(6) && IS_PENTAGRAM(levl[u.ux][u.uy].typ)) {
5165 if (wizard) {
5166 if (yn("Make the pentagram fade?") == 'n')
5167 return 1;
5170 levl[u.ux][u.uy].typ = ROOM;
5171 pline_The("pentagram fades away completely.");
5172 newsym(u.ux,u.uy);
5175 return 1;
5179 obj = getobj(invoke_types, "invoke");
5180 if (!obj) return 0;
5181 if (obj->oartifact && !touch_artifact(obj, &youmonst)) return 1;
5182 return arti_invoke(obj);
5185 STATIC_OVL int
5186 arti_invoke(obj)
5187 register struct obj *obj;
5189 register const struct artifact *oart = get_artifact(obj);
5190 register struct monst *mtmp;
5191 register struct monst *mtmp2;
5192 register struct permonst *pm;
5194 int summon_loop;
5195 int unseen;
5197 int kill_loop;
5200 /* highly randomized timeout; squeaking skill helps --Amy */
5201 int artitimeout = rnz(2000);
5202 if (!rn2(5)) artitimeout = rnz(20000);
5203 if (!PlayerCannotUseSkills) {
5204 switch (P_SKILL(P_SQUEAKING)) {
5205 case P_BASIC: artitimeout *= 9; artitimeout /= 10; break;
5206 case P_SKILLED: artitimeout *= 8; artitimeout /= 10; break;
5207 case P_EXPERT: artitimeout *= 7; artitimeout /= 10; break;
5208 case P_MASTER: artitimeout *= 6; artitimeout /= 10; break;
5209 case P_GRAND_MASTER: artitimeout *= 5; artitimeout /= 10; break;
5210 case P_SUPREME_MASTER: artitimeout *= 4; artitimeout /= 10; break;
5211 default: break;
5214 if (artitimeout < 1) artitimeout = 1; /* fail safe */
5216 if (obj->oartifact == ART_FUEL_NAIL) {
5217 if (u.roxannemode) {
5218 pline("You can only summon Roxanne once.");
5219 return 1;
5221 u.roxannemode = TRUE;
5222 use_skill(P_SQUEAKING, 20);
5224 register struct monst *roxannesummon;
5225 roxannesummon = makemon(&mons[PM_ROXANNE], u.ux, u.uy, NO_MM_FLAGS);
5226 if (roxannesummon) {
5228 /* she's traitorious, and anyway you could get unlucky to have her be untamed by something, so we
5229 * specifically change her permonst struct permanently to allow you to tame her with food */
5230 struct permonst* poisonroxanne = &mons[PM_ROXANNE];
5231 poisonroxanne->mflags2 |= M2_DOMESTIC;
5233 tamedog(roxannesummon, (struct obj *) 0, TRUE);
5234 verbalize("You've summoned me! I'll fight on your side. If you want to power me up, chat to me and give me a few crossbow bolts, then I'll turn on my poison enchantment that will poison our enemies.");
5237 return 1;
5240 if (obj->oartifact == ART_RE_POISON) {
5242 if (!obj->opoisoned) {
5243 obj->opoisoned = TRUE;
5244 pline("The arrows have been poisoned.");
5245 } else pline("These arrows are already poisoned.");
5246 return 1;
5249 if (obj->oartifact == ART_ATARU_ONE) {
5250 if (!u.ataruinvoked && !exist_artifact(ETERNIUM_BLADE, artiname(ART_ATARU_TWO))) {
5251 register struct obj *trophy;
5252 u.ataruinvoked = TRUE;
5253 trophy = mksobj(ETERNIUM_BLADE, TRUE, FALSE, FALSE);
5254 if (trophy) {
5255 trophy = oname(trophy, artiname(ART_ATARU_TWO));
5256 dropy(trophy);
5258 pline("Ataru Two was dropped on the floor.");
5259 } else pline("It seems that Ataru Two has been generated already.");
5260 return 1;
5263 if (obj->oartifact == ART_ATAR_ATAR) {
5264 if (!u.ataratarinvoked) {
5265 register struct obj *trophy;
5266 u.ataratarinvoked = TRUE;
5267 trophy = mksobj(GREEN_LIGHTSABER, TRUE, FALSE, FALSE);
5268 if (trophy) {
5269 trophy = onameX(trophy, artiname(ART_ATAR_ATAR));
5270 dropy(trophy);
5272 pline("Another copy of this artifact was dropped on the floor.");
5273 } else pline("Since this invocation has already been done, it cannot be performed again.");
5274 return 1;
5277 if (obj->oartifact == ART_ONE_CATHLETTE) {
5278 if (!u.cathletteinvoked) {
5279 register struct obj *trophy;
5280 u.cathletteinvoked = TRUE;
5281 trophy = mksobj(KITTEN_HEEL_PUMP, TRUE, FALSE, FALSE);
5282 if (trophy) {
5283 trophy = onameX(trophy, artiname(ART_ONE_CATHLETTE));
5284 dropy(trophy);
5286 pline("Another copy of this artifact was dropped on the floor.");
5287 } else pline("Since this invocation has already been done, it cannot be performed again.");
5288 return 1;
5291 if (obj->oartifact == ART_ATARU_TWO) {
5292 if (!u.ataruinvoked && !exist_artifact(CRYSTAL_SWORD, artiname(ART_ATARU_ONE))) {
5293 register struct obj *trophy;
5294 u.ataruinvoked = TRUE;
5295 trophy = mksobj(CRYSTAL_SWORD, TRUE, FALSE, FALSE);
5296 if (trophy) {
5297 trophy = oname(trophy, artiname(ART_ATARU_ONE));
5298 dropy(trophy);
5300 pline("Ataru One was dropped on the floor.");
5301 } else pline("It seems that Ataru One has been generated already.");
5302 return 1;
5305 if(!oart || !oart->inv_prop) {
5306 if(obj->otyp == CRYSTAL_BALL)
5307 use_crystal_ball(obj);
5308 else {
5309 pline("%s", nothing_happens);
5310 if (FailureEffects || u.uprops[FAILURE_EFFECTS].extrinsic || have_failurestone()) {
5311 pline("Oh wait, actually something bad happens...");
5312 badeffect();
5315 return 1;
5318 /* all actual invokes require you to actually have the item equipped if it has a slot it "fits" in --Amy
5319 * only the "special" invokes that aren't actually using something in the invocation field in artilist.h are exempt,
5320 * because those also don't use invoke timeouts */
5322 if (oart) {
5323 boolean invokenotworn = FALSE;
5324 if (obj->oclass == ARMOR_CLASS && !(obj->owornmask & W_ARMOR) ) invokenotworn = TRUE;
5325 if (obj->oclass == WEAPON_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
5326 if (obj->oclass == RING_CLASS && !(obj->owornmask & W_RING) ) invokenotworn = TRUE;
5327 if (obj->oclass == AMULET_CLASS && !(obj->owornmask & W_AMUL) ) invokenotworn = TRUE;
5328 if (obj->oclass == IMPLANT_CLASS && !(obj->owornmask & W_IMPLANT) ) invokenotworn = TRUE;
5329 if (obj->oclass == BALL_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
5330 if (obj->oclass == CHAIN_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
5331 if (obj->oclass == VENOM_CLASS && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
5332 if (is_weptool(obj) && !(obj->owornmask & W_WEP) ) invokenotworn = TRUE;
5333 if (is_blindfold_slot(obj) && !(obj->owornmask & W_TOOL) ) invokenotworn = TRUE;
5334 if (invokenotworn) {
5335 pline("That artifact cannot be invoked unless you wear it first.");
5336 return 1;
5340 if(oart->inv_prop > LAST_PROP) {
5341 /* It's a special power, not "just" a property */
5343 if (obj->oartifact >= ART_ORB_OF_DETECTION && !is_quest_artifact(obj)) {
5344 pline("Tapping into the powers of artifacts that don't belong to you is dangerous.");
5345 contaminate(rnz(100), TRUE);
5346 increasesanity(rnz(100));
5347 adjalign(-rnz(100));
5350 if(obj->invoketimer > monstermoves) {
5351 /* the artifact is tired :-) */
5352 You_feel("that %s %s ignoring you.",
5353 the(xname(obj)), otense(obj, "are"));
5354 /* and just got more so; patience is essential... */
5355 obj->invoketimer += (long) d(3,10);
5356 if (!rn2(5)) obj->invoketimer += (long) rnz(100);
5357 return 1;
5359 obj->invoketimer = monstermoves + artitimeout;
5360 use_skill(P_SQUEAKING, rnd(10));
5362 u.cnd_invokecount++;
5364 switch(oart->inv_prop) {
5365 case TAMING: {
5366 struct obj pseudo;
5368 pseudo = zeroobj; /* neither cursed nor blessed */
5369 pseudo.otyp = SCR_TAMING;
5370 (void) seffects(&pseudo);
5371 break;
5373 case IDENTIFY:
5375 /* Amy edit: why on earth was there a kludge where a pseudo spellbook of id was created??? */
5376 int cval = rn2(4);
5378 if (invent) identify_pack(cval, 0, FALSE); /* like, the identify_pack function has already been invented! */
5380 if (obj && obj->oartifact == ART_ARKENSTONE_OF_THRAIN) {
5381 curse(obj);
5382 pline("The power of the Arkenstone is uncontrollable, but you knew that.");
5383 badeffect(); badeffect(); badeffect(); badeffect(); badeffect(); badeffect(); badeffect(); badeffect(); badeffect(); badeffect();
5386 break;
5388 case HEALING: {
5389 int healamt = (u.uhpmax + 1 - u.uhp) / 2;
5390 long creamed = (long)u.ucreamed;
5392 if (Upolyd) healamt = (u.mhmax + 1 - u.mh) / 2;
5393 if (healamt || Sick || Slimed || Blinded > creamed)
5394 You_feel("better.");
5395 else
5396 goto nothing_special;
5397 if (healamt > 0) {
5398 if (Upolyd) u.mh += healamt;
5399 else u.uhp += healamt;
5401 if(Sick) make_sick(0L,(char *)0,FALSE,SICK_ALL);
5402 if(Slimed) Slimed = 0L;
5403 if (Blinded > creamed) make_blinded(creamed, FALSE);
5404 flags.botl = 1;
5405 break;
5407 case ENERGY_BOOST: {
5408 int epboost = (u.uenmax + 1 - u.uen) / 2;
5409 if (epboost > 120) epboost = 120; /* arbitrary */
5410 else if (epboost < 12) epboost = u.uenmax - u.uen;
5411 if(epboost) {
5412 You_feel("re-energized.");
5413 u.uen += epboost;
5414 flags.botl = 1;
5415 } else
5416 goto nothing_special;
5417 break;
5419 case UNTRAP: {
5420 if(!untrap(TRUE)) {
5421 obj->invoketimer = 0; /* don't charge for changing their mind */
5422 return 0;
5424 break;
5426 case CHARGE_OBJ:
5427 chargingchoice:
5429 if (CannotSelectItemsInPrompts) return 0;
5430 struct obj *otmp = getobj(recharge_type, "charge");
5431 boolean b_effect;
5433 if (!otmp) {
5434 if (yn("Really exit with no object selected?") == 'y')
5435 pline("You just wasted the opportunity to charge your items.");
5436 else goto chargingchoice;
5437 obj->invoketimer = 0;
5438 return 0;
5440 b_effect = (obj->blessed && (Role_switch == oart->role));
5441 if (obj->oartifact == ART_CHARGE_O_MANIA && powerfulimplants()) b_effect = TRUE;
5442 recharge(otmp, b_effect ? 1 : obj->cursed ? -1 : 0);
5443 update_inventory();
5444 break;
5446 case LEV_TELE:
5447 if (!playerlevelportdisabled()) level_tele();
5448 else pline("You are disallowed to use this ability.");
5449 break;
5450 case DRAGON_BREATH:
5451 getdir(NULL);
5452 buzz(20+AD_FIRE-1,6,u.ux,u.uy,u.dx,u.dy);
5453 /* ^^^^^^^^^^^^ - see zap.c / ZT_* defines */
5454 break;
5455 case LIGHT_AREA:
5456 if (!Blind)
5457 pline("%s shines brightly for an instant!", The(xname(obj)));
5458 else
5459 pline("%s grows warm for a second!", The(xname(obj)));
5460 litroom(TRUE, obj);
5461 vision_recalc(0);
5462 if (is_undead(youmonst.data)) {
5463 You("burn in the radiance!");
5464 /* This is ground zero. Not good news ... */
5465 u.uhp /= 100;
5466 if (u.uhp < 1) {
5467 u.youaredead = 1;
5468 u.uhp = 0;
5469 killer_format = KILLED_BY;
5470 killer = "the Holy Spear of Light";
5471 done(DIED);
5472 u.youaredead = 0;
5475 /* Undead and Demonics can't stand the light */
5476 unseen = 0;
5477 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
5478 if (DEADMONSTER(mtmp)) continue;
5479 if (distu(mtmp->mx, mtmp->my) > 9*9) continue;
5480 if (couldsee(mtmp->mx, mtmp->my) &&
5481 (is_undead(mtmp->data) || is_demon(mtmp->data)) &&
5482 !resist(mtmp, '\0', 0, TELL)) {
5483 if (canseemon(mtmp))
5484 pline("%s burns in the radiance!", Monnam(mtmp));
5485 else
5486 unseen++;
5487 /* damage depends on distance, divisor ranges from 10 to 2 */
5488 mtmp->mhp /= (10 - (distu(mtmp->mx, mtmp->my) / 10));
5489 if (mtmp->mhp < 1) mtmp->mhp = 1;
5492 if (unseen)
5493 You_hear("%s of intense pain!", unseen > 1 ? "cries" : "a cry");
5494 break;
5495 case DEATH_GAZE:
5496 if (u.uluck < -9) {
5497 u.youaredead = 1;
5498 pline_The("Eye turns on you!");
5499 u.uhp = 0;
5500 killer_format = KILLED_BY;
5501 killer = "the Eye of the Beholder";
5502 done(DIED);
5503 u.youaredead = 0;
5505 pline_The("Eye looks around with its icy gaze!");
5506 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
5507 if (DEADMONSTER(mtmp)) continue;
5508 /* The eye is never blind ... */
5509 if (couldsee(mtmp->mx, mtmp->my) && !is_undead(mtmp->data)) {
5510 pline("%s screams in agony!", Monnam(mtmp));
5511 mtmp->mhp -= (mtmp->mhp / 3); /* nerf by Amy :P */
5512 if (mtmp->mhp < 1) mtmp->mhp = 1;
5515 /* Tsk,tsk.. */
5516 adjalign(-3);
5517 u.uluck -= 3;
5518 break;
5519 case BOSS_NUKE:
5520 if (!Role_if(PM_PREVERSIONER)) {
5521 pline("Since you're not a preversioner, you cannot use the power of this artifact. So sorry.");
5522 break;
5524 pline("Downsizing nuke initiated.");
5525 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
5526 if (DEADMONSTER(mtmp)) continue;
5527 if (mtmp->data->geno & G_UNIQ) {
5528 pline("%s's health is cut down by the nuke!", Monnam(mtmp));
5529 mtmp->mhp -= (mtmp->mhp / 2); /* nerf by Amy :P */
5530 if (mtmp->mhp < 1) mtmp->mhp = 1;
5533 break;
5534 case SPECIAL_INVOKE:
5536 /* dummy entry for Amy's copypasting
5537 if (obj->oartifact == ART_) {
5538 break;
5543 if (obj->oartifact == ART_HOW_LONG_LASTS_IT_) {
5544 if (TurbodullBug & FROMOUTSIDE) {
5545 pline_The("invoke failed because the conditions are not met.");
5546 break;
5548 TurbodullBug |= FROMOUTSIDE;
5549 if (uarm && uarm->spe < 7) uarm->spe++;
5550 if (uarmc && uarmc->spe < 7) uarm->spe++;
5551 if (uarms && uarms->spe < 7) uarm->spe++;
5552 if (uarmf && uarmf->spe < 7) uarm->spe++;
5553 if (uarmu && uarmu->spe < 7) uarm->spe++;
5554 if (uarmg && uarmg->spe < 7) uarm->spe++;
5555 if (uarmh && uarmh->spe < 7) uarm->spe++;
5556 Your("armor pieces have been enchanted, but now your equipment will dull quickly.");
5558 break;
5561 if (obj->oartifact == ART_CATALIN_S_ROBBERY) {
5563 if (uinsymbiosis) {
5564 pline("Because you already have a symbiote, nothing happens.");
5565 break;
5568 u.usymbiote.active = 1;
5569 u.usymbiote.mnum = (u.ulevel < 10) ? PM_SUCKER_FUNGUS : PM_TAKER_FUNGUS;
5570 u.usymbiote.mhpmax = (u.ulevel < 10) ? 16 : 128;
5571 u.usymbiote.mhp = (u.ulevel < 10) ? 16 : 128;
5572 u.usymbiote.cursed = u.usymbiote.hvycurse = u.usymbiote.prmcurse = u.usymbiote.bbcurse = u.usymbiote.morgcurse = u.usymbiote.evilcurse = u.usymbiote.stckcurse = 0;
5574 pline("Suddenly you have a symbiote!");
5575 pline("Use #monster to manage your symbiote.");
5576 if (flags.showsymbiotehp) flags.botl = TRUE;
5578 break;
5581 if (obj->oartifact == ART_KIM_S_COLOR) {
5583 int objtomodify;
5584 objtomodify = -1;
5585 /* we roll until we get an item that can be randomly generated and is not a gold piece or other weird thing --Amy */
5586 while ( (objtomodify == -1) || (objtomodify == GOLD_PIECE) || (objtomodify == STRANGE_OBJECT) || (objtomodify == AMULET_OF_YENDOR) || (objtomodify == CANDELABRUM_OF_INVOCATION) || (objtomodify == BELL_OF_OPENING) || (objtomodify == SPE_BOOK_OF_THE_DEAD) || (objects[objtomodify].oc_prob < 1) ) objtomodify = rn2(NUM_OBJECTS);
5587 objects[objtomodify].oc_material = MT_SILVER;
5588 pline("%s (%s) is made of silver now.", obj_descr[objtomodify].oc_name, objtypenames[objects[objtomodify].oc_class]);
5590 break;
5593 if (obj->oartifact == ART_EVIL_HAIRTEAR) {
5594 curse(obj);
5595 obj->hvycurse = TRUE;
5597 make_familiar((struct obj *)0, u.ux, u.uy, FALSE, FALSE);
5599 break;
5602 if (obj->oartifact == ART_ENIRHS_MOD) {
5604 char aliasbuf[2048]; /* Buffer for alias name */
5606 if (u.uhp < 2) {
5607 You("lack the health required to do that.");
5608 break;
5610 u.uhp /= 2;
5611 if (Upolyd) {
5612 u.mh /= 2;
5613 if (u.mh < 1) u.mh = 1;
5615 flags.botl = TRUE;
5617 (void) strncpy(aliasbuf, playeraliasname, sizeof(aliasbuf));
5618 reversestring(aliasbuf);
5619 strcpy(plalias, aliasbuf);
5620 (void) strncpy(u.aliasname, aliasbuf, sizeof(u.aliasname));
5622 make_inverted((HInvertedState & TIMEOUT) + 10000);
5624 You("don't feel like yourself.");
5626 for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
5627 if (DEADMONSTER(mtmp)) continue;
5628 /* The eye is never blind ... */
5629 if (couldsee(mtmp->mx, mtmp->my) && !is_undead(mtmp->data)) {
5630 pline("%s screams in agony!", Monnam(mtmp));
5631 mtmp->mhp -= (mtmp->mhp / 2);
5632 if (mtmp->mhp < 1) mtmp->mhp = 1;
5636 break;
5639 if (obj->oartifact == ART_SCUDDER) {
5641 struct obj *dynamite;
5642 coord cc;
5643 int tunguskas = 8;
5645 pline_The("multi-round missiles have been launched.");
5647 tunguskaagain:
5648 cc.x = rn1(COLNO-3,2);
5649 cc.y = rn2(ROWNO);
5650 dynamite = mksobj_at(STICK_OF_DYNAMITE, cc.x, cc.y, TRUE, FALSE, FALSE);
5652 if (dynamite) {
5653 u.dynamitehack = TRUE;
5654 if (dynamite->otyp != STICK_OF_DYNAMITE) delobj(dynamite);
5655 else {
5656 dynamite->dynamitekaboom = 1;
5657 dynamite->quan = 1;
5658 dynamite->owt = weight(dynamite);
5659 attach_bomb_blow_timeout(dynamite, 0, 0);
5660 run_timers();
5662 u.dynamitehack = FALSE;
5664 if (tunguskas > 0) {
5665 tunguskas--;
5666 goto tunguskaagain;
5670 break;
5673 if (obj->oartifact == ART_WEAVING_WARD) {
5675 incr_itimeout(&Invulnerable, rn1(3,3));
5676 You_feel(FunnyHallu ? "like a super-duper hero!" : "invulnerable!");
5677 break;
5680 if (obj->oartifact == ART_HERACLES_PRIZE) {
5682 incr_itimeout(&Invulnerable, rn1(3,3));
5683 You_feel(FunnyHallu ? "like a super-duper hero!" : "invulnerable!");
5684 break;
5687 if (obj->oartifact == ART_FANNY_S_ANNOYANCE) {
5689 randommartialstyle();
5691 break;
5694 if (obj->oartifact == ART_TSUNAMI_FISTS) {
5696 randommartialstyle();
5698 break;
5701 if (obj->oartifact == ART_IRIS_S_THUNDER) {
5703 getdir(NULL);
5704 buzz(15,10,u.ux,u.uy,u.dx,u.dy); /* 15 = lightning */
5706 break;
5709 if (obj->oartifact == ART__K_FCJZ_OEAL_I_NE___P_OAMB) {
5711 if (u.alla < 101) {
5712 break;
5715 u.alla -= 100; /* not "drain_alla" */
5716 You("only have %d alla remaining!", u.alla);
5718 getdir(NULL);
5719 buzz(24,6,u.ux,u.uy,u.dx,u.dy); /* 24 = disintegration beam */
5721 break;
5724 if (obj->oartifact == ART_TURN_INTO_LEATHER) {
5726 if (find_leather_gloves() == -1) {
5727 pline("Oops, something went wrong! Sorry!");
5728 break;
5731 long savewornmask;
5733 savewornmask = obj->owornmask;
5734 setworn((struct obj *)0, obj->owornmask);
5736 obj->otyp = find_leather_gloves();
5738 setworn(obj, savewornmask);
5740 Your("gloves turned into leather!");
5742 break;
5745 if (obj->oartifact == ART_MINIMAL_MINI_ME) {
5747 u.enchantrecskill++;
5748 if (u.enchantrecskill > 250) u.enchantrecskill = 250;
5749 u.weapchantrecskill++;
5750 if (u.weapchantrecskill > 250) u.weapchantrecskill = 250;
5751 u.bucskill++;
5752 if (u.bucskill > 250) u.bucskill = 250;
5753 You_feel("more knowledgable about equipment!");
5755 break;
5758 if (obj->oartifact == ART_EYES_OF_THE_ORACLE) {
5759 You("gain a bit of the Oracle's secret knowledge...");
5760 wiz_timeout_queue(); /* yes, this is a wizard mode command, I know --Amy */
5761 break;
5764 if (obj->oartifact == ART_RITA_S_DIAMOGIGGLING) {
5765 stardigging();
5766 break;
5769 if (obj->oartifact == ART_____SUICIDE) {
5771 int i, j, bd = 5;
5772 struct monst *mtmp;
5774 u.youaredead = 1;
5775 pline("%s used EXPLOSION!", playeraliasname);
5777 for(i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++) {
5778 if (!isok(u.ux + i, u.uy + j)) continue;
5779 if ((mtmp = m_at(u.ux + i, u.uy + j)) != 0) {
5780 mtmp->mhp -= rnd(u.uhpmax * 10);
5781 pline("%s is hit by the explosion!", Monnam(mtmp));
5782 if (mtmp->mhp <= 0) {
5783 pline("%s is killed!", Monnam(mtmp));
5784 xkilled(mtmp, 0);
5785 } else wakeup(mtmp); /* monster becomes hostile */
5790 killer = "exploding";
5791 killer_format = KILLED_BY;
5792 done(DIED);
5793 u.youaredead = 0;
5794 /* No, being polymorphed does not save you. If it did, this arti would be rendered overpowered. --Amy */
5796 break;
5799 if (obj->oartifact == ART_GLAE) {
5801 long savewornmask;
5803 savewornmask = obj->owornmask;
5804 setworn((struct obj *)0, obj->owornmask);
5806 obj->otyp = randartmeleeweapon();
5808 setworn(obj, savewornmask);
5810 Your("weapon morphs...");
5812 break;
5815 if (obj->oartifact == ART_NEXTMISSION) {
5817 if (u.returntimer) {
5818 u.returntimer = 0;
5819 pline_The("air around you gradually loses power.");
5820 } else {
5821 setupreturn(0);
5824 break;
5828 if (obj->oartifact == ART_RANOFRIT) {
5830 if (!rn2(10)) useupall(obj);
5832 if (u.returntimer) {
5833 u.returntimer = 0;
5834 pline_The("air around you gradually loses power.");
5835 } else {
5836 setupreturn(0);
5839 break;
5842 if (obj->oartifact == ART_DO_STAY_A_WHILE_) {
5844 if (!rn2(10)) {
5845 useupall(obj);
5846 } else {
5847 curse(obj);
5848 obj->hvycurse = TRUE;
5849 if (obj->spe < 20) obj->spe++;
5852 if (u.returntimer) {
5853 u.returntimer = 0;
5854 pline_The("air around you gradually loses power.");
5855 } else {
5856 setupreturn(0);
5859 break;
5862 if (obj->oartifact == ART_HAMMA_HAMMA) {
5863 register struct obj *otmp;
5864 if (obj->cursed || obj->spe < 0) {
5865 pline("Nothing happens, probably because this hammer isn't good enough.");
5866 break;
5869 artilist[ART_HAVING_HAMMA].otyp = randarthammerX();
5870 curse(obj);
5871 obj->hvycurse = TRUE;
5872 obj->spe = -5;
5874 otmp = mksobj(artilist[ART_HAVING_HAMMA].otyp, TRUE, FALSE, FALSE);
5876 if (otmp) {
5878 otmp = oname(otmp, artiname(ART_HAVING_HAMMA));
5880 otmp->quan = 1;
5881 otmp->owt = weight(otmp);
5882 dropy(otmp);
5883 stackobj(otmp);
5884 You("created a new hammer.");
5888 break;
5891 if (obj->oartifact == ART_UTE_S_GREENCHANGE) {
5892 long savewornmask;
5894 savewornmask = obj->owornmask;
5895 setworn((struct obj *)0, obj->owornmask);
5897 obj->enchantment = randenchantment();
5899 setworn(obj, savewornmask);
5901 Your("peep-toes' enchantment was randomized.");
5903 break;
5906 if (obj->oartifact == ART_REAL_FORCE) {
5908 coord cc;
5909 struct monst *psychmonst;
5910 pline("Select a monster to use psycho force");
5911 cc.x = u.ux;
5912 cc.y = u.uy;
5913 getpos(&cc, TRUE, "the spot to attack");
5914 if (cc.x == -10) return (0); /* user pressed esc */
5915 psychmonst = m_at(cc.x, cc.y);
5917 if (!psychmonst || (!canseemon(psychmonst) && !canspotmon(psychmonst))) {
5918 You("don't see a monster there!");
5919 return (0);
5922 if (psychmonst) {
5923 psychmonst->mcanmove = 0;
5924 psychmonst->mstrategy &= ~STRAT_WAITFORU;
5925 psychmonst->mfrozen = rn1(3, 3);
5927 pline("%s sputters at the forced hold!", Monnam(psychmonst));
5928 psychmonst->mhp -= rnz(50);
5929 if (psychmonst->mhp < 1) {
5930 pline("%s dies!", Monnam(psychmonst));
5931 xkilled(psychmonst,0);
5932 } else wakeup(psychmonst); /* monster becomes hostile */
5935 break;
5938 if (obj->oartifact == ART_WIDEFORCE_GRIP) {
5939 coord cc;
5940 register struct obj *otmp;
5941 pline("Where do you want to pick up an item?");
5942 if (getpos(&cc, TRUE, "pick up item at which location") < 0) {
5943 return(0);
5946 if ((otmp = level.objects[cc.x][cc.y]) != 0) {
5947 if (costly_spot(cc.x, cc.y)) {
5948 pline("This item is inside a grip-proof shop. Your attempt to pick it up fails.");
5949 break;
5952 You("pick up an object from the %s.", surface(cc.x,cc.y));
5953 (void) pickup_object(otmp, otmp->quan, TRUE, FALSE);
5954 newsym(cc.x, cc.y);
5956 } else {
5957 pline("Too bad! There's no item at that location.");
5960 break;
5963 if (obj->oartifact == ART_NOW_ASCEND_ALREADY) {
5965 enchantarmor_prompt();
5967 break;
5970 if (obj->oartifact == ART_CRAWL_INTO_LIFE) {
5972 if (uinsymbiosis) {
5973 pline("Because you already have a symbiote, nothing happens.");
5974 break;
5977 getrandomsymbiote(FALSE, FALSE);
5978 pline("Suddenly you have a symbiote!");
5980 break;
5983 if (obj->oartifact == ART_A_MAGE_DID_IT) {
5984 if (obj->greased < 3) {
5985 pline("Applied a layer of grease.");
5986 obj->greased++;
5987 } else pline("There's already the maximum amount of grease on your bag.");
5988 break;
5991 if (obj->oartifact == ART_LEO_IS_ALWAYS_HIGH) {
5992 u.copwantedlevel += 2000;
5993 gold_detect(obj);
5994 pline("Uh-oh, the kops must have gotten wind of your actions.");
5995 break;
5998 if (obj->oartifact == ART_STRANGE_LILCHEN) {
5999 if (obj->obrittle || obj->obrittle2) {
6000 /* be lenient if you don't have the required cash out in the open --Amy */
6001 addplayerdebt(10000, TRUE); /* cannot resist, cannot get the money back */
6002 obj->obrittle = obj->obrittle2 = 0;
6003 Your("credit card is repaired, but that costs 10000 zorkmids.");
6005 break;
6008 if (obj->oartifact == ART_DOWNDRIVE) {
6010 if (!uinsymbiosis) {
6011 pline("%s", nothing_happens);
6012 if (FailureEffects || u.uprops[FAILURE_EFFECTS].extrinsic || have_failurestone()) {
6013 pline("Oh wait, actually something bad happens...");
6014 badeffect();
6016 break;
6019 if (powerfulimplants()) {
6020 char buf[BUFSZ];
6021 int sleeptime;
6022 do {
6023 getlin("How many moves do you wish to shutdown your symbiote for? [1-10000]", buf);
6024 sleeptime = (!*buf || *buf=='\033') ? 0 : atoi(buf);
6025 } while (sleeptime < 1 || sleeptime > 10000);
6026 u.shutdowntime += sleeptime;
6027 } else {
6028 u.shutdowntime += 1000;
6030 pline("Shutdown initiated.");
6032 break;
6035 if (obj->oartifact == ART_WELL_FUCK) {
6037 if (u.uspellprot < 4) {
6038 u.uspellprot = 4;
6039 u.uspmtime = 10;
6040 if (!u.usptime) u.usptime = u.uspmtime;
6041 find_ac();
6043 flags.botl = TRUE;
6045 incr_itimeout(&HLevitation, rnz(250));
6046 HLevitation |= I_SPECIAL;
6048 You_feel("protected!");
6049 You("float into the air!");
6051 break;
6054 if (obj->oartifact == ART_RES_CIRCLE) {
6056 incr_itimeout(&HResistancePiercing, 1000);
6057 You("can pierce enemy resistances!");
6059 break;
6062 if (obj->oartifact == ART_LARISSA_S_LAUGHTER) {
6063 objects[obj->otyp].oc_material = MT_INKA;
6064 pline_The("boot is made of inka leather now.");
6065 break;
6068 if (obj->oartifact == ART_MOIST_CHERRY) {
6070 if (!Role_if(PM_BLEEDER)) {
6071 u.usanity += PlayerBleeds; /* cannot resist */
6072 u.contamination += PlayerBleeds;
6075 if (PlayerBleeds) {
6076 PlayerBleeds = 0;
6077 Your("bleeding stops.");
6078 } else pline("There was no bleeding to cure.");
6080 break;
6083 if (obj->oartifact == ART_EVERYTHING_PROOF) {
6085 register struct obj *steeling;
6086 if (CannotSelectItemsInPrompts) goto protectwhatdone;
6087 pline("You may erodeproof an item.");
6088 protectwhatchoice:
6089 steeling = getobj(allowall, "erosionproof");
6090 if (!steeling) {
6091 if (yn("Really exit with no object selected?") == 'y')
6092 pline("You just wasted the opportunity to erosionproof an item.");
6093 else goto protectwhatchoice;
6094 pline("Oh well, if you don't wanna...");
6095 } else {
6096 if (!stack_too_big(steeling)) {
6097 steeling->oerodeproof = 1;
6098 pline("Item erosionproofed.");
6099 if (steeling && objects[(steeling)->otyp].oc_material == MT_CELESTIUM && !stack_too_big(steeling)) {
6100 if (!steeling->cursed) bless(steeling);
6101 else uncurse(steeling, FALSE);
6103 } else pline("The stack was too big and therefore nothing happens...");
6105 protectwhatdone:
6106 break;
6109 if (obj->oartifact == ART_OCTOPODDY) {
6110 if (powerfulimplants()) bad_equipment(1);
6111 else bad_equipment(0);
6112 break;
6115 if (obj->oartifact == ART_REPAIR_YOUR_BRAIN) {
6116 if (obj->spe < -19) {
6117 pline_The("invocation failed.");
6118 break;
6120 curse(obj);
6121 obj->spe -= rnd(5);
6123 if (ABASE(A_INT) < AMAX(A_INT)) {
6124 ABASE(A_INT) = AMAX(A_INT);
6125 flags.botl = TRUE;
6126 You_feel("smarter!");
6127 } else {
6128 pline("It seems that your intelligence has not been drained yet.");
6131 break;
6134 if (obj->oartifact == ART_UNBINDALL_CHEAT) {
6136 int pickskill;
6138 for (pickskill = 0; pickskill < P_NUM_SKILLS; pickskill++) {
6139 if (pickskill > P_NONE) {
6140 if (P_SKILL(pickskill) != P_ISRESTRICTED) continue;
6141 P_ADVANCE(pickskill) = 0;
6144 pline("Training in restricted skills nullified.");
6146 break;
6149 if (obj->oartifact == ART_CHARGING_MADE_EASY) {
6150 deacrandomintrinsic(rnz(5000));
6151 AutomaticVulnerabilitiy += rnz(5000);
6152 obj->age += 500;
6153 pline("Lightsaber recharged.");
6156 if (obj->oartifact == ART_BENNY_S_CHIP) {
6157 if (Role_if(PM_COURIER)) {
6158 int n;
6159 pline("BANG! Benny shoots you in the head with his pistol.");
6161 if (u.uhpmax < 21) {
6162 u.youaredead = 1;
6163 killer_format = KILLED_BY;
6164 killer = "being shot in the head";
6165 done(DIED);
6166 u.youaredead = 0;
6168 } else {
6169 u.uhpmax -= 20;
6170 if (u.uhp > u.uhpmax) u.uhp = u.uhpmax;
6172 if(ABASE(A_INT) < 2) {
6173 u.youaredead = 1;
6174 u.youarereallydead = 1;
6175 Your("last thought fades away.");
6176 killer = "bullet to the brain";
6177 killer_format = KILLED_BY;
6178 done(DIED);
6180 /* player still alive somehow? kill them again :P */
6182 pline("Unfortunately your brain is still gone.");
6183 killer = "bullet to the brain";
6184 killer_format = KILLED_BY;
6185 done(DIED);
6187 if (!wizard) {
6188 pline("Unfortunately your brain is STILL gone. Your game ends here.");
6189 done(ESCAPED);
6192 u.youaredead = 0;
6193 u.youarereallydead = 0;
6195 ABASE(A_INT) = ATTRABSMIN(A_INT);
6196 You_feel("like a scarecrow.");
6197 AMAX(A_INT) = ABASE(A_INT);
6199 } else {
6200 ABASE(A_INT) -= 1;
6201 AMAX(A_INT) -= 1;
6206 for (n = 0; n < MAXSPELL && spellid(n) != NO_SPELL; n++) {
6207 spellid(n) = NO_SPELL;
6210 alter_reality(-1);
6212 flags.botl = 1;
6213 } else pline("Hmm... that didn't do anything.");
6214 break;
6217 if (obj->oartifact == ART_TILLMANN_S_TARGET) {
6218 pline("Suddenly, you gain a new companion!");
6219 (void) make_familiar((struct obj *)0, u.ux, u.uy, FALSE, FALSE);
6220 break;
6223 if (obj->oartifact == ART_INVUNI) {
6225 You("try to change the instrument.");
6227 if (obj->otyp == BUGLE) obj->otyp = UNICORN_HORN;
6228 else if (obj->otyp == UNICORN_HORN) obj->otyp = BUGLE;
6230 break;
6233 if (obj->oartifact == ART_CHANGE_THE_TUNE) {
6235 You("try to change the instrument.");
6237 if (obj->otyp == WOODEN_HARP) obj->otyp = WOODEN_FLUTE;
6238 else if (obj->otyp == WOODEN_FLUTE) obj->otyp = WOODEN_HARP;
6240 break;
6243 if (obj->oartifact == ART_THROUGH_THE_MOTIONS) {
6245 if (obj->otyp == PLATE_MAIL) {
6246 pline("This suit of armor can no longer be upgraded.");
6247 break;
6250 You("try to upgrade your suit of armor.");
6252 if (obj->otyp == LEATHER_ARMOR) obj->otyp = STUDDED_LEATHER_ARMOR;
6253 else if (obj->otyp == STUDDED_LEATHER_ARMOR) obj->otyp = RING_MAIL;
6254 else if (obj->otyp == RING_MAIL) obj->otyp = SCALE_MAIL;
6255 else if (obj->otyp == SCALE_MAIL) obj->otyp = CHAIN_MAIL;
6256 else if (obj->otyp == CHAIN_MAIL) obj->otyp = SPLINT_MAIL;
6257 else if (obj->otyp == SPLINT_MAIL) obj->otyp = PLATE_MAIL;
6258 break;
6261 if (obj->oartifact == ART_GIVE_IT_ME_YOUR_WILL) {
6262 curse(obj);
6263 obj->hvycurse = obj->prmcurse = obj->stckcurse = TRUE;
6265 if (!powerfulimplants()) {
6266 getnastytrapintrinsic();
6269 acquireitem();
6271 break;
6274 if (obj->oartifact == ART_VINTAGE_MEMORY) {
6275 if (!Teleport_control) HTeleport_control = 2;
6276 tele();
6277 break;
6280 if (obj->oartifact == ART_FIVEFOLDSWITCH_) {
6282 if (obj->spe < 1) {
6283 pline("You can read, right? If you had looked at the description of this artifact, you'd have known that the invocation only works if its enchantment value is at least +1! Or did you think I was somehow stupid and forgot to actually code that part? Silly player!");
6284 break;
6286 obj->spe = -20;
6287 obj->cursed = obj->hvycurse = obj->prmcurse = TRUE;
6288 cure_nasty_traps();
6289 pline("Switchswitchswitchswitchswitch!");
6290 break;
6293 if (obj->oartifact == ART_WON_STESCHAN) {
6294 incr_itimeout(&HCold_resistance, 500);
6295 incr_itimeout(&HFire_resistance, 500);
6296 incr_itimeout(&HShock_resistance, 500);
6297 You("become resistant to the elements.");
6298 break;
6301 if (obj->oartifact == ART_TSCHEINSCHFORM) {
6302 int tscheinschtype;
6303 long savewornmask;
6304 savewornmask = obj->owornmask;
6305 setworn((struct obj *)0, obj->owornmask);
6307 tscheinschroll:
6308 tscheinschtype = HAWAIIAN_SHIRT + rn2((LEVITATION_BOOTS + 1) - HAWAIIAN_SHIRT);
6309 if (!(objects[tscheinschtype].oc_armcat == ARM_BOOTS)) goto tscheinschroll;
6311 obj->otyp = tscheinschtype;
6312 obj->owt = weight(obj);
6314 setworn(obj, savewornmask);
6316 pline("Okay, the boots have had their base type changed.");
6317 break;
6320 if (obj->oartifact == ART_CREAMRES) {
6321 if (Glib) {
6322 pline("You clean your %s.", makeplural(body_part(HAND)));
6323 Glib = 0;
6325 break;
6328 if (obj->oartifact == ART_CANNOT_DO_IS_FROZEN) {
6329 make_frozen(0L,TRUE);
6330 break;
6333 if (obj->oartifact == ART_POSSO_CONTINUARE_LATERALE) {
6335 struct obj *asseignobj;
6337 if (CannotSelectItemsInPrompts) break;
6338 if ( !(asseignobj = getobj(allowall, "unequip"))) break;
6340 if (asseignobj->owornmask) {
6341 setnotworn(asseignobj);
6342 pline("Successfully unwore the item!");
6345 break;
6348 if (obj->oartifact == ART_GALLOW_DIGS) {
6349 getdir(NULL);
6350 zap_dig(TRUE); /* dig several tiles, like the wand */
6352 break;
6355 if (obj->oartifact == ART_BLASWON) {
6356 if (obj->spe < 1) {
6357 obj->spe++;
6358 pline("Plus one.");
6359 } else {
6360 pline("Limit has been reached already.");
6362 break;
6365 if (obj->oartifact == ART_IDEAL_BASE) {
6366 if (obj->spe < 3) {
6367 obj->spe++;
6368 pline("The ideal base has been put to good use.");
6369 } else {
6370 pline("You've maxxed out the ideal base already.");
6372 break;
6375 if (obj->oartifact == ART_WEAR_OFF_THE_DAMN_RNG) {
6376 if (obj->greased < 3) {
6377 obj->greased++;
6378 pline("Since the damn RNG always causes the grease to wear off, you applied another layer.");
6379 } else {
6380 pline("Currently, the amount of grease on this item is at the maximum.");
6382 break;
6385 if (obj->oartifact == ART_ASSEIGNMENT_CURSE_) {
6387 struct obj *asseignobj;
6389 if (CannotSelectItemsInPrompts) break;
6390 if ( !(asseignobj = getobj(allowall, "curse"))) break;
6391 asseignobj->bknown = TRUE;
6393 if (stack_too_big(asseignobj)) {
6394 pline("The stack was too big! Nothing happens.");
6395 break;
6398 curse(asseignobj);
6399 pline("Okay, that object is cursed now.");
6401 break;
6404 if (obj->oartifact == ART_ARABELLA_S_LIGHTSWITCH) {
6405 litroom(TRUE, obj);
6406 pline_The("light has been switched on!");
6407 break;
6410 if (obj->oartifact == ART_ASS_ASS_IN_ASS) {
6411 trap_detect((struct obj *)0);
6412 break;
6415 if (obj->oartifact == ART_WINNNNNG) {
6416 (void)object_detect(obj, 0);
6417 trap_detect((struct obj *)0);
6418 incr_itimeout(&HDetect_monsters, 20);
6419 see_monsters();
6420 break;
6423 if (obj->oartifact == ART_WHOA_LOOK_AT_THOSE) {
6424 intrinsicgainorloss(1);
6425 break;
6428 if (obj->oartifact == ART_FARTDETECTION) {
6430 u.aggravation = 1;
6431 u.heavyaggravation = 1;
6433 (void) makemon(specialtensmon(40), u.ux, u.uy, MM_ANGRY|MM_FRENZIED|MM_XFRENZIED|MM_ADJACENTOK);
6434 trap_detect((struct obj *)0);
6436 u.aggravation = 0;
6437 u.heavyaggravation = 0;
6439 break;
6442 if (obj->oartifact == ART_AJIHEI) {
6443 pline("An aura surrounds your weapon...");
6444 obj->oerodeproof = TRUE; /* doesn't repair damage */
6445 obj->rknown = TRUE;
6446 break;
6449 if (obj->oartifact == ART_MUSICAL_SNORKEL) {
6451 int maderoom = 0;
6452 do_clear_areaX(u.ux, u.uy, 3, undo_floodM, (void *)&maderoom);
6453 if (maderoom) {
6454 You("are suddenly very dry!");
6455 } else pline("It seems that there was no water nearby after all.");
6457 break;
6460 if (obj->oartifact == ART_PENUMBRAL_LASSO) {
6461 uncurse(obj, TRUE);
6462 if (obj->spe < 7) {
6463 obj->spe++;
6464 Your("lance seems sharper!");
6467 pline("Currently your steed has %d%% chance of being targetted by monsters.", u.steedhitchance);
6468 if (yn("Change it?") == 'y') {
6469 char buf[BUFSZ];
6470 long offer;
6472 getlin("Enter a percentage value between 0 and 100 (inclusive):", buf);
6473 if (sscanf(buf, "%ld", &offer) != 1) offer = 0L;
6474 if (offer < 0) {
6475 pline("Sorry, negative numbers are not allowed.");
6476 } else if (offer > 100) {
6477 pline("Sorry, the number can't exceed 100.");
6478 } else {
6479 u.steedhitchance = offer;
6480 pline("Your steed now has %d%% chance of being targetted by monsters.", u.steedhitchance);
6485 break;
6488 if (obj->oartifact == ART_PRAEFAME) {
6489 morehungry(500);
6490 You("feel much more hungry than before.");
6491 break;
6494 if (obj->oartifact == ART_SATELLITE_LINKER) {
6495 incr_itimeout(&HDetect_monsters, rn1(40, 40));
6496 see_monsters();
6497 You("can sense monsters.");
6498 break;
6501 if (obj->oartifact == ART_KAZAANA) {
6502 forget(3, FALSE);
6503 Your("memory is deleted.");
6504 break;
6507 if (obj->oartifact == ART_HOLYBASHER) {
6508 pline("An aura surrounds your weapon...");
6509 uncurse(obj, TRUE);
6510 break;
6513 if (obj->oartifact == ART_ARK_OF_THE_COVENANT) {
6514 pline("An aura surrounds your weapon...");
6515 uncurse(obj, TRUE);
6516 if (!obj->cursed) bless(obj);
6517 break;
6520 if (obj->oartifact == ART_KEEP_IT_WARM_INSIDE) {
6521 pline("An aura surrounds your sack...");
6522 if (!obj->cursed) bless(obj);
6523 else uncurse(obj, TRUE);
6524 break;
6527 if (obj->oartifact == ART_INCAPUTABLE) {
6528 obj->oeroded = obj->oeroded2 = 0;
6529 Your("armor looks shiny!");
6530 break;
6532 if (obj->oartifact == ART_BRINGS_WHICH) {
6534 u.uen += (d(8,8));
6535 if (u.uen > u.uenmax) u.uen = u.uenmax;
6536 You_feel("full of mystic power!");
6537 flags.botl = TRUE;
6539 break;
6542 if (obj->oartifact == ART_PAEAU_PAEAU_PAEAU_PAEAU_PA) {
6544 buzz(10, 1, u.ux, u.uy, -1, 0);
6545 buzz(10, 1, u.ux, u.uy, 1, 0);
6546 buzz(10, 1, u.ux, u.uy, -1, 1);
6547 buzz(10, 1, u.ux, u.uy, 1, 1);
6548 buzz(10, 1, u.ux, u.uy, 0, 1);
6549 buzz(10, 1, u.ux, u.uy, -1, -1);
6550 buzz(10, 1, u.ux, u.uy, 1, -1);
6551 buzz(10, 1, u.ux, u.uy, 0, -1);
6553 break;
6556 if (obj->oartifact == ART_LONGSPIKE) {
6558 buzz(10, 4, u.ux, u.uy, -1, 0);
6559 buzz(10, 4, u.ux, u.uy, 1, 0);
6560 buzz(10, 4, u.ux, u.uy, -1, 1);
6561 buzz(10, 4, u.ux, u.uy, 1, 1);
6562 buzz(10, 4, u.ux, u.uy, 0, 1);
6563 buzz(10, 4, u.ux, u.uy, -1, -1);
6564 buzz(10, 4, u.ux, u.uy, 1, -1);
6565 buzz(10, 4, u.ux, u.uy, 0, -1);
6567 break;
6570 if (obj->oartifact == ART_GO_UP_IN_FLAMESES) {
6571 useupall(obj);
6573 int flamexplosions = 10;
6574 while (flamexplosions > 0) {
6576 flamexplosions--;
6577 struct obj *dynamite;
6578 dynamite = mksobj_at(FRAG_GRENADE, u.ux, u.uy, TRUE, FALSE, FALSE);
6579 if (dynamite) {
6580 if (dynamite->otyp != FRAG_GRENADE) delobj(dynamite);
6581 else {
6582 dynamite->dynamitekaboom = 1;
6583 dynamite->quan = 1;
6584 dynamite->owt = weight(dynamite);
6585 attach_bomb_blow_timeout(dynamite, 0, 0);
6586 run_timers();
6591 if (!(HProtection & INTRINSIC)) {
6592 HProtection |= FROMOUTSIDE;
6594 u.ublessed += 2;
6595 Your("skin feels harder.");
6596 break;
6599 if (obj->oartifact == ART_EROTIC_STAT_TRAIN) {
6601 You_feel("revitalized.");
6602 make_sick(0L, (char *) 0, FALSE, SICK_ALL);
6603 make_blinded(0L,FALSE);
6604 make_stunned(0L,TRUE);
6605 make_confused(0L,TRUE);
6606 (void) make_hallucinated(0L,FALSE,0L);
6607 make_numbed(0L,TRUE);
6608 make_feared(0L,TRUE);
6609 make_frozen(0L,TRUE);
6610 make_burned(0L,TRUE);
6611 make_dimmed(0L,TRUE);
6613 break;
6616 if (obj->oartifact == ART_SPFLOTCH__HAHAHAHAHA_) {
6617 curse(obj);
6618 obj->hvycurse = TRUE;
6619 pline("Wow, a corona antidote!");
6620 upnivel(FALSE);
6621 break;
6624 if (obj->oartifact == ART_BACKGROUND_HOLDING) {
6625 if (HAggravate_monster & INTRINSIC) {
6626 HAggravate_monster &= ~INTRINSIC;
6627 You_feel("more acceptable!");
6628 } else {
6629 pline("Nothing happens...");
6630 if (FailureEffects || u.uprops[FAILURE_EFFECTS].extrinsic || have_failurestone()) {
6631 pline("Oh wait, actually something bad happens...");
6632 badeffect();
6635 break;
6638 if (obj->oartifact == ART_CRUEL_PARENTS) {
6639 if (flags.female) {
6640 int chaloss = rnd(5);
6642 strcpy(plalias, "Liselotte");
6643 (void) strncpy(u.aliasname, "Liselotte", sizeof(u.aliasname));
6644 pline("Ugh, did your parents really name you 'Liselotte'??? Why didn't they name you 'Ice-Angel Chantalle-Jacqueline' instead, that would have been similarly silly!");
6645 HCold_resistance |= FROMOUTSIDE;
6646 HShock_resistance |= FROMOUTSIDE;
6648 while (chaloss > 0) {
6649 if (ABASE(A_CHA) > 1) {
6650 ABASE(A_CHA) -= 1;
6651 AMAX(A_CHA) -= 1;
6652 u.cnd_permstatdamageamount++;
6653 } else {
6654 drain_alla(10);
6656 chaloss--;
6658 curse(obj);
6659 obj->hvycurse = TRUE;
6661 } else {
6662 make_confused(HConfusion + rn1(50, 50),FALSE);
6663 make_stunned(HStun + rn1(50, 50),FALSE);
6664 increasesanity(rnz(500));
6665 Your("mind spins as you realize what name your parents would have given to you if you had become female.");
6667 break;
6670 if (obj->oartifact == ART_SALLY_S_BAKING_MIXTURE) {
6672 struct obj *uchocitem;
6674 uchocitem = mksobj(FORTUNE_COOKIE, TRUE, FALSE, FALSE);
6675 if (uchocitem) {
6676 uchocitem->quan = 1;
6677 uchocitem->known = uchocitem->dknown = uchocitem->bknown = uchocitem->rknown = 1;
6678 uchocitem->owt = weight(uchocitem);
6679 dropy(uchocitem);
6680 stackobj(uchocitem);
6681 You("baked a fortune cookie.");
6682 } else pline("Somehow, your baking attempt failed.");
6684 break;
6687 if (obj->oartifact == ART_DIMENSION_FISHING) {
6689 register struct monst *nexusmon;
6690 int multiplegather = 0;
6692 You("start fishing.");
6693 for(nexusmon = fmon; nexusmon; nexusmon = nexusmon->nmon) {
6694 if (nexusmon && !nexusmon->mtame && !nexusmon->mpeaceful && !(u.usteed && (u.usteed == nexusmon)) ) {
6695 mnexto(nexusmon);
6696 pline("%s is drawn!", Monnam(nexusmon));
6697 multiplegather++;
6698 goto callingoutdone;
6701 callingoutdone:
6702 if (!multiplegather) pline("A waste of time...");
6704 break;
6707 if (obj->oartifact == ART_HOUZANHA) {
6709 int x, y;
6710 int houzanhaamount = 50;
6711 register struct rm *lev;
6712 while (houzanhaamount) {
6713 houzanhaamount--;
6714 if (houzanhaamount < 0) houzanhaamount = 0;
6715 x = rn1(COLNO-3,2);
6716 y = rn2(ROWNO);
6717 lev = &levl[x][y];
6718 if (isok(x,y) && !(lev->typ == ALTAR && (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)) ) && !(lev->wall_info & W_NONDIGGABLE) && lev->typ != STAIRS && lev->typ != LADDER) {
6719 lev->typ = CORR;
6722 pline("Haaaaaaaa!");
6724 break;
6727 if (obj->oartifact == ART_WRONG_RUNE) {
6728 if (((u.uhave.amulet) && !u.freeplaymode) || CannotTeleport || (u.usteed && mon_has_amulet(u.usteed))) {
6729 pline("The charge around you prevents you from using the rune!");
6730 break;
6733 if (playerlevelportdisabled()) {
6734 You("cannot levelport, and therefore the attempt fails!");
6735 break;
6739 d_level dtmp;
6740 dtmp.dnum = dname_to_dnum("Gehennom");
6741 dtmp.dlevel = 12; /* level 62, which is the 12th level of Gehennom */
6742 schedule_goto(&dtmp, FALSE, FALSE, 0, (char *)0, (char *)0);
6743 You_feel("yourself yanked in a direction you didn't know existed!");
6745 break;
6748 if (obj->oartifact == ART_MARK_AND_RECALL) {
6749 if (!u.levelmarked) {
6750 u.markedlevel.dnum = u.uz.dnum;
6751 u.markedlevel.dlevel = u.uz.dlevel;
6752 pline("The current level has been marked.");
6753 u.levelmarked = TRUE;
6754 } else {
6755 if (((u.uhave.amulet) && !u.freeplaymode) || CannotTeleport || (u.usteed && mon_has_amulet(u.usteed))) {
6756 pline("At this point, you're not capable of recalling!");
6757 break;
6760 if (playerlevelportdisabled()) {
6761 You("cannot levelport, and therefore the attempt fails!");
6762 break;
6765 d_level dtmp;
6766 dtmp.dnum = u.markedlevel.dnum;
6767 dtmp.dlevel = u.markedlevel.dlevel;
6768 schedule_goto(&dtmp, FALSE, FALSE, 0, (char *)0, (char *)0);
6769 You("warp back to the marked level.");
6771 u.levelmarked = FALSE;
6773 break;
6776 if (obj->oartifact == ART_DO_NOT_DISPLAY_THE_CHARGES) {
6777 You_feel("full of mystic power!");
6778 if (!obj->obrittle) {
6779 u.uen = u.uenmax;
6780 flags.botl = TRUE;
6781 if (!rn2(5)) obj->obrittle++;
6783 break;
6786 if (obj->oartifact == ART_DINGDOENG_ || obj->oartifact == ART_KRISTA_S_CLEAR_MIND) {
6787 You_feel("healthier!");
6788 if (powerfulimplants() || !obj->obrittle) {
6789 u.uhp = u.uhpmax;
6790 if (Upolyd) u.mh = u.mhmax;
6791 flags.botl = TRUE;
6792 if (!obj->obrittle && !rn2(5)) obj->obrittle++;
6794 break;
6797 if (obj->oartifact == ART_AIRSTRIKE_) {
6798 coord cc;
6799 pline("Select the target area for your airstrike!");
6800 cc.x = u.ux;
6801 cc.y = u.uy;
6802 getpos(&cc, TRUE, "airstrike target");
6803 if (cc.x == -10) return (0); /* user pressed esc */
6805 if (isok(cc.x, cc.y)) {
6806 struct obj *dynamite;
6807 dynamite = mksobj_at(STICK_OF_DYNAMITE, cc.x, cc.y, TRUE, FALSE, FALSE);
6808 if (dynamite) {
6809 You_hear("a sound that reminds you of fireworks.");
6810 if (dynamite->otyp != STICK_OF_DYNAMITE) delobj(dynamite);
6811 else {
6812 dynamite->dynamitekaboom = 1;
6813 dynamite->quan = 1;
6814 dynamite->owt = weight(dynamite);
6815 attach_bomb_blow_timeout(dynamite, 0, 0);
6816 run_timers();
6820 break;
6824 if (obj->oartifact == ART_RANDART_REROLL) {
6825 init_randarts();
6826 pline("All randarts have been re-initialized!");
6827 break;
6830 if (obj->oartifact == ART_SKILL_RESET) {
6831 int tryct, i;
6832 tryct = 50000;
6833 i = 0;
6835 while (u.skills_advanced && tryct) {
6836 lose_last_spent_skill();
6837 i++;
6838 tryct--;
6841 while (i) {
6842 u.weapon_slots++; /* because every skill up costs one slot --Amy */
6843 i--;
6846 Your("skills have been resetted.");
6847 break;
6850 if (obj->oartifact == ART_BUILD_A_WALL) {
6851 int x, y;
6852 for (x = 0; x < COLNO; x++)
6853 for (y = 0; y < ROWNO; y++) {
6854 register struct rm *lev;
6855 lev = &levl[x][y];
6856 if (!(lev->typ == ALTAR && (Is_astralevel(&u.uz) || Is_sanctum(&u.uz)) ) && !(lev->wall_info & W_NONDIGGABLE) && lev->typ != STAIRS && lev->typ != LADDER && ((x == u.ux) || (y == u.uy)) ) lev->typ = ROCKWALL;
6858 pline("Build a wall, build a wall...");
6859 break;
6862 if (obj->oartifact == ART_BLANKIT_NOW) {
6863 struct obj *otmp;
6864 if (CannotSelectItemsInPrompts) break;
6865 pline("You may remove the egotype from a piece of armor.");
6866 armorspecchoice:
6867 otmp = getobj(allnoncount, "de-egotype");
6868 if(!otmp) {
6869 if (yn("Really exit with no object selected?") == 'y')
6870 pline("You just wasted the opportunity to de-egotype your armor.");
6871 else goto armorspecchoice;
6872 pline("Oh well, if you don't wanna...");
6873 exercise(A_WIS, FALSE);
6874 break;
6876 if (otmp->oclass != ARMOR_CLASS) {
6877 pline("That's not a piece of armor, and therefore the attempt fails.");
6878 break;
6880 if (!otmp->enchantment) {
6881 pline("There was no enchantment on the item to begin with.");
6882 break;
6884 if (otmp) {
6885 long savewornmask;
6886 if (otmp->owornmask) setnotworn(otmp);
6887 otmp->enchantment = 0;
6888 pline("The item's egotype is gone. Be aware that if you were wearing it, the item has now been unequipped.");
6891 break;
6894 if (obj->oartifact == ART_ENTERTAINING_CLEAR) {
6895 int multiplegather = 0;
6896 register struct monst *nexusmon;
6897 for(nexusmon = fmon; nexusmon; nexusmon = nexusmon->nmon) {
6898 if (nexusmon && !nexusmon->mtame && !nexusmon->mpeaceful && !(u.usteed && (u.usteed == nexusmon) ) ) {
6899 mnexto(nexusmon);
6900 multiplegather++;
6903 if (multiplegather) pline("%d monsters were teleported to you!", multiplegather);
6904 else pline("Weird, nothing seems to have happened.");
6906 break;
6909 if (obj->oartifact == ART_FREE_SKILL_SLOTS) {
6911 useupall(obj);
6912 u.weapon_slots += rnd(5);
6913 You("feel very skillful, and now have %d skill slots!", u.weapon_slots);
6914 return 1;
6916 break;
6919 if (obj->oartifact == ART_MONEYSACK) {
6921 u.ugold += rnd(1000);
6922 Your("budget is extended!");
6923 break;
6926 if (obj->oartifact == ART_JYL__NOT_XLATED_CALL_KEN) {
6928 u.ugold += rnd(500);
6929 You("sold some jewels and gained money.");
6930 break;
6933 if (obj->oartifact == ART_KEY_TO_THE_GOLDEN_ITEMS) {
6935 register struct obj *goldenitem;
6936 if (CannotSelectItemsInPrompts) return 0;
6937 goldenchoice:
6938 goldenitem = getobj(allowall, "turn into an artifact");
6939 if (!goldenitem) {
6940 if (yn("Really exit with no object selected?") == 'y')
6941 pline("You just wasted the opportunity to turn an item into an artifact.");
6942 else goto goldenchoice;
6943 pline("Oh well, if you don't wanna...");
6944 break;
6945 } else {
6946 if (evades_destruction(goldenitem)) {
6947 pline("That item is unique, and therefore nothing happens!");
6948 break;
6950 if (goldenitem->oartifact || goldenitem->fakeartifact) {
6951 pline("That item is already an artifact, and therefore nothing happens!");
6952 break;
6954 long savewornmask;
6956 savewornmask = goldenitem->owornmask;
6957 setworn((struct obj *)0, goldenitem->owornmask);
6959 goldenitem = mk_artifact(goldenitem, (aligntyp)A_NONE, TRUE);
6960 if (goldenitem && goldenitem->oartifact) {
6961 useupall(obj);
6963 setworn(goldenitem, savewornmask);
6965 pline("Success!");
6966 return 1;
6967 } else if (goldenitem) {
6968 setworn(goldenitem, savewornmask);
6971 break;
6973 if (obj->oartifact == ART_KEY_TO_THE_GREEN_ITEMS) {
6975 register struct obj *greenitem;
6976 if (CannotSelectItemsInPrompts) return 0;
6977 greenchoice:
6978 greenitem = getobj(allowall, "turn into a fake artifact");
6979 if (!greenitem) {
6980 if (yn("Really exit with no object selected?") == 'y')
6981 pline("You just wasted the opportunity to turn an item into an artifact.");
6982 else goto greenchoice;
6983 pline("Oh well, if you don't wanna...");
6984 break;
6985 } else {
6986 if (evades_destruction(greenitem)) {
6987 pline("That item is unique, and therefore nothing happens!");
6988 break;
6990 if (greenitem->oartifact || greenitem->fakeartifact) {
6991 pline("That item is already an artifact, and therefore nothing happens!");
6992 break;
6994 greenitem = turnintofakeartifact(greenitem);
6995 if (greenitem && greenitem->fakeartifact) {
6996 useupall(obj);
6997 if (greenitem->oclass == WEAPON_CLASS || greenitem->oclass == ARMOR_CLASS || greenitem->oclass == BALL_CLASS || greenitem->oclass == GEM_CLASS || greenitem->oclass == CHAIN_CLASS || greenitem->oclass == VENOM_CLASS || is_weptool(greenitem)) {
6998 greenitem->spe = rne(2);
6999 if (!rn2(2)) greenitem->spe += rne(2);
7001 pline("Success!");
7002 return 1;
7006 break;
7009 if (obj->oartifact == ART_AUTOSWITCH) {
7010 useupall(obj);
7011 pline("You carefully pull the switch...");
7012 if (!Blind) pline("The red status light goes out while the green light starts shining brightly!");
7013 pline("The switcher dissolves in your hands...");
7014 cure_nasty_traps();
7015 return 1;
7016 break;
7019 if (obj->oartifact == ART_DEATH_TO_TRAPS) {
7021 register struct trap *ttmp;
7023 useupall(obj);
7025 int i, j;
7027 for (i = 0; i <= COLNO; i++) for(j = 0; j <= ROWNO; j++) {
7029 if (isok(i, j) && ((ttmp = t_at(i, j)) != 0) ) {
7030 if (ttmp->ttyp == MAGIC_PORTAL) continue;
7031 deltrap(ttmp);
7035 pline("Now the traps are dead.");
7037 return 1;
7038 break;
7041 if (obj->oartifact == ART_GOING_DISPLAY) {
7042 DisplayLoss = 0L;
7043 Your("display goes again.");
7044 break;
7047 if (obj->oartifact == ART_THIRD_NEXT_MISSION) {
7049 if (((u.uhave.amulet) && !u.freeplaymode) || CannotTeleport || (u.usteed && mon_has_amulet(u.usteed))) {
7050 pline("You shudder for a moment.");
7051 (void) safe_teleds_normalterrain(FALSE);
7052 break;
7054 if (playerlevelportdisabled()) {
7055 pline("For some reason you resist the banishment!");
7056 break;
7059 banishplayer();
7060 break;
7064 if (obj->oartifact == ART_DEMO_CASE) {
7066 if (t_at(u.ux, u.uy)) {
7067 You("fail to lay the mine, because there's a trap already!");
7068 break;
7071 struct trap *ttrap;
7072 ttrap = maketrap(u.ux, u.uy, LANDMINE, 0, FALSE);
7073 if (ttrap && !ttrap->hiddentrap) {
7074 ttrap->tseen = 1;
7075 ttrap->madeby_u = 1;
7077 You("drop something on the ground.");
7079 if (practicantterror) {
7080 pline("%s booms: 'Practicants are not allowed to lay mines! Now you pay 1000 zorkmids!'", noroelaname());
7081 fineforpracticant(1000, 0, 0);
7086 break;
7090 if (obj->oartifact == ART_SEE_THE_ENTIRE_MAP) {
7091 boolean willdisappear = FALSE;
7092 if (!rn2(5)) {
7093 useupall(obj);
7094 willdisappear = TRUE;
7096 if (level.flags.nommap) {
7097 Your("mind is filled with crazy lines!");
7098 if (FunnyHallu)
7099 pline("Wow! Modern art.");
7100 else
7101 Your("%s spins in bewilderment.", body_part(HEAD));
7102 make_confused(HConfusion + rnd(30), FALSE);
7103 if (!rn2(3)) badeffect();
7104 if (willdisappear) return 1;
7105 break;
7107 do_mapping();
7109 if (willdisappear) return 1;
7110 break;
7114 if (obj->oartifact == ART_BACKPACK_BOMBER) {
7115 struct obj *dynamite;
7116 dynamite = mksobj(STICK_OF_DYNAMITE, TRUE, FALSE, FALSE);
7117 if (dynamite) {
7118 if (dynamite->otyp != STICK_OF_DYNAMITE) delobj(dynamite);
7119 else {
7120 dynamite->dynamitekaboom = 1;
7121 dynamite->quan = 1;
7122 dynamite->owt = weight(dynamite);
7123 dropy(dynamite);
7124 attach_bomb_blow_timeout(dynamite, 0, 0);
7125 run_timers();
7129 break;
7133 if (obj->oartifact == ART_DETONATIONS_MANTLE) {
7134 struct obj *dynamite;
7135 dynamite = mksobj(STICK_OF_DYNAMITE, TRUE, FALSE, FALSE);
7136 if (dynamite) {
7137 if (dynamite->otyp != STICK_OF_DYNAMITE) delobj(dynamite);
7138 else {
7139 u.detonationhack = TRUE;
7140 dynamite->dynamitekaboom = 1;
7141 dynamite->quan = 1;
7142 dynamite->owt = weight(dynamite);
7143 dropy(dynamite);
7144 attach_bomb_blow_timeout(dynamite, 0, 0);
7145 run_timers();
7146 u.detonationhack = FALSE;
7150 break;
7154 if (obj->oartifact == ART_POPPY_S_STRIPED_TIGHTS) {
7155 struct obj *dynamite;
7156 dynamite = mksobj(STICK_OF_DYNAMITE, TRUE, FALSE, FALSE);
7157 if (dynamite) {
7158 if (dynamite->otyp != STICK_OF_DYNAMITE) delobj(dynamite);
7159 else {
7160 dynamite->dynamitekaboom = 1;
7161 dynamite->quan = 1;
7162 dynamite->owt = weight(dynamite);
7163 dropy(dynamite);
7164 attach_bomb_blow_timeout(dynamite, 0, 0);
7165 run_timers();
7169 break;
7173 if (obj->oartifact == ART_LASERSHIT) {
7175 if (t_at(u.ux, u.uy)) {
7176 pline("There is a trap at your location, and therefore the attempt fails!");
7177 break;
7180 struct trap *ttrap;
7181 ttrap = maketrap(u.ux, u.uy, S_PRESSING_TRAP, 0, FALSE);
7182 if (ttrap && !ttrap->hiddentrap) {
7183 ttrap->tseen = 1;
7184 ttrap->madeby_u = 1;
7186 You("laid a trap.");
7188 if (practicantterror) {
7189 pline("%s thunders: 'You shitty practicant lass! Your act of shitting up my laboratory will not be tolerated! Now you pay 5000 zorkmids and clean away your shit, got it?'", noroelaname());
7190 fineforpracticant(5000, 0, 0);
7195 break;
7199 if (obj->oartifact == ART_ASSSLASHER_KATANA) {
7201 if (!flags.female) {
7202 change_sex();
7203 You("neuter yourself... but unfortunately playing as a neuter character isn't supported in this version, and therefore the area where you just cut off your penis grows into a neovagina instead.");
7205 break;
7209 if (obj->oartifact == ART_TZ__GLGG__AIV_FM__) {
7211 getdir(NULL);
7212 buzz(24,6,u.ux,u.uy,u.dx,u.dy); /* 24 = disintegration beam */
7214 break;
7218 if (obj->oartifact == ART_MELUGAS_ROCKET) {
7220 getdir(NULL);
7221 buzz(20 + rn2(AD_SPC2),5,u.ux,u.uy,u.dx,u.dy); /* random breath */
7223 break;
7227 if (obj->oartifact == ART_DOUBTLY_POISON) {
7229 getdir(NULL);
7230 buzz(26,10,u.ux,u.uy,u.dx,u.dy); /* 26 = poison blast */
7232 break;
7236 if (obj->oartifact == ART_DENH_OBVIO) {
7238 getdir(NULL);
7239 buzz(16,6,u.ux,u.uy,u.dx,u.dy); /* 16 = poison gas */
7241 break;
7245 if (obj->oartifact == ART_DWEEEEEEEAUWEAUW) {
7246 int dweaustrength = (GushLevel / 4);
7247 if (dweaustrength < 1) dweaustrength = 1;
7249 getdir(NULL);
7250 buzz(28,dweaustrength,u.ux,u.uy,u.dx,u.dy); /* 28 = solar beam */
7252 break;
7256 if (obj->oartifact == ART_RAYSWANDIR) {
7258 getdir(NULL);
7259 buzz(20,6,u.ux,u.uy,u.dx,u.dy); /* 20 = magic missile */
7261 break;
7265 if (obj->oartifact == ART_STREEEEEAM) {
7267 getdir(NULL);
7268 buzz(20,6,u.ux,u.uy,u.dx,u.dy); /* 20 = magic missile */
7270 break;
7274 if (obj->oartifact == ART_GO_AWAY_TYPE_OF_ARMS) {
7275 register struct monst *typeofarms;
7277 useupall(obj);
7279 if (!getdir((char *)0)) break;
7280 if (!u.dx && !u.dy) {
7281 break;
7283 if (!isok(u.ux + u.dx, u.uy + u.dy)) {
7284 pline("Invalid target location.");
7285 break;
7287 typeofarms = m_at(u.ux + u.dx, u.uy + u.dy);
7288 if (typeofarms) {
7289 if (typeofarms->isshk) {
7290 useupall(obj);
7291 mongone(typeofarms);
7292 pline_The("shopkeeper was erased.");
7293 return 1;
7297 break;
7301 if (obj->oartifact == ART_AVENGER_APPEARANCE) {
7303 int attempts = 0;
7304 register struct permonst *ptrZ;
7305 register struct monst *bossmon;
7307 useupall(obj);
7309 newbossC:
7310 do {
7312 ptrZ = rndmonst();
7313 attempts++;
7314 if (attempts && (attempts % 10000 == 0)) u.mondiffhack++;
7315 if (!rn2(2000)) reset_rndmonst(NON_PM);
7317 } while ( (!ptrZ || (ptrZ && !( (ptrZ->geno & G_UNIQ) && (is_male(ptrZ)) ))) && attempts < 50000);
7319 if (ptrZ && ptrZ->geno & G_UNIQ && is_male(ptrZ)) {
7320 bossmon = makemon(ptrZ, u.ux, u.uy, NO_MM_FLAGS);
7322 else if (rn2(50)) {
7323 attempts = 0;
7324 goto newbossC;
7327 if (bossmon) {
7328 tamedog(bossmon, (struct obj *) 0, TRUE);
7331 u.mondiffhack = 0;
7333 newbossF:
7334 do {
7336 ptrZ = rndmonst();
7337 attempts++;
7338 if (attempts && (attempts % 10000 == 0)) u.mondiffhack++;
7339 if (!rn2(2000)) reset_rndmonst(NON_PM);
7341 } while ( (!ptrZ || (ptrZ && !( (ptrZ->geno & G_UNIQ) && (is_female(ptrZ)) ))) && attempts < 50000);
7343 if (ptrZ && ptrZ->geno & G_UNIQ && is_female(ptrZ)) {
7344 bossmon = makemon(ptrZ, u.ux, u.uy, NO_MM_FLAGS);
7346 else if (rn2(50)) {
7347 attempts = 0;
7348 goto newbossF;
7351 if (bossmon) {
7352 tamedog(bossmon, (struct obj *) 0, TRUE);
7355 u.mondiffhack = 0;
7357 pline_The("avenger and his woman have appeared!");
7359 return 1;
7360 break;
7364 if (obj->oartifact == ART_COMPLETE_RESET) {
7366 int wflvl = u.ulevel;
7367 if (wflvl < 1) wflvl = 1;
7368 register struct monst *mtmp, *mtmp2;
7369 int num = 0;
7370 int n;
7372 if (u.ulevel < 15) {
7373 pline("That doesn't work unless you're at least experience level 15.");
7374 break;
7376 if (u.urexp < 2000000) {
7377 pline("That doesn't work unless you have at least 2 million score.");
7378 break;
7380 /* uh-oh... */
7381 u.youaredead = 1;
7383 while (u.ulevel > 1) losexp("complete reset", TRUE, FALSE); /* set XL back to 1 */
7384 if (u.uhpmax < (urole.hpadv.infix + urace.hpadv.infix)) {
7385 u.uhpmax = urole.hpadv.infix + urace.hpadv.infix;
7386 if (Role_if(PM_DQ_SLIME) && Race_if(PM_PLAYER_SLIME)) u.uhpmax += 20;
7387 if (u.uhp < u.uhpmax) u.uhp = u.uhpmax;
7389 if (!tech_known(T_RESTORE_LIFE_LEVELS)) {
7390 learntech(T_RESTORE_LIFE_LEVELS, FROMOUTSIDE, 1);
7392 techdrainrll();
7393 dataskilldecrease(); /* set training of all skills back to 0 */
7394 for (n = 0; n < MAXSPELL && spellid(n) != NO_SPELL; n++) { /* lose all spells */
7395 spellid(n) = NO_SPELL;
7397 resettechs(); /* +rnz(100k) timeout for all techs */
7398 u.urexp = 0; /* reset score to 0 */
7400 /* game over, unless you have life saving */
7401 killer = "a complete reset";
7402 killer_format = KILLED_BY;
7403 done(DIED);
7404 u.youaredead = 0;
7406 /* world fall, but bosses aren't immune and higher-level monsters only have 50% chance of surviving */
7407 for (mtmp = fmon; mtmp; mtmp = mtmp2) {
7408 mtmp2 = mtmp->nmon;
7409 if ( ((mtmp->m_lev < wflvl) || (!rn2(2) && mtmp->m_lev < (2 * wflvl))) ) {
7410 mondead(mtmp);
7411 num++;
7414 pline("Eliminated %d monster%s.", num, plur(num));
7416 break;
7420 if (obj->oartifact == ART_CURSE_PURIFY) {
7422 useupall(obj);
7424 register struct obj *tbunc;
7426 for (tbunc = invent; tbunc; tbunc = tbunc->nobj) {
7427 #ifdef GOLDOBJ
7428 /* gold isn't subject to cursing and blessing */
7429 if (tbunc->oclass == COIN_CLASS) continue;
7430 #endif
7431 uncurse(tbunc, TRUE);
7434 Your("inventory has been purged from curses.");
7436 return 1;
7437 break;
7441 if (obj->oartifact == ART_ROTATE_ME) {
7442 play_blackjack(TRUE);
7443 break;
7447 if (obj->oartifact == ART_CASSERINO) {
7448 play_blackjack(TRUE);
7449 break;
7453 if (obj->oartifact == ART_YOHUALLI_TEZCATL) {
7454 make_sick(0L, (char *) 0, FALSE, SICK_ALL);
7455 make_blinded(0L,FALSE);
7456 make_stunned(0L,TRUE);
7457 make_confused(0L,TRUE);
7458 (void) make_hallucinated(0L,FALSE,0L);
7459 make_numbed(0L,TRUE);
7460 make_feared(0L,TRUE);
7461 make_frozen(0L,TRUE);
7462 make_burned(0L,TRUE);
7463 make_dimmed(0L,TRUE);
7464 break;
7468 if (obj->oartifact == ART_LILLY_S_SECRET_AGENCY) {
7470 if (In_endgame(&u.uz)) {
7471 pline("The documents are unavailable on the planes!");
7472 break;
7475 register struct monst *offmon;
7476 struct obj *rosafootwear;
7477 int mattries = 0;
7478 while (uarmf && mattries++ < 50000) {
7479 if ((offmon = makemon(&mons[PM_LILLY], 0, 0, NO_MM_FLAGS)) != 0) {
7480 offmon->mpeaceful = TRUE;
7481 offmon->mfrenzied = FALSE;
7482 rosafootwear = obj;
7483 setnotworn(rosafootwear);
7484 freeinv(rosafootwear);
7485 (void) mpickobj(offmon, rosafootwear, FALSE);
7486 u_teleport_monC(offmon, FALSE);
7487 mattries = 50001;
7490 rolerecursioneffect();
7492 pline("You've exchanged your documents with Lilly...");
7493 pline("...and apparently she was a %s, so that's what you are now!", (flags.female && urole.name.f) ? urole.name.f : urole.name.m);
7495 break;
7499 if (obj->oartifact == ART_GOT_THAT_STARWARS_ENTRANCE) {
7500 if (!u.greencrossopen) {
7501 u.greencrossopen = TRUE;
7502 pline("The Green Cross subdungeon is now open!");
7503 } else pline("The Green Cross subdungeon was already open.");
7504 break;
7507 if (obj->oartifact == ART_WAY_TOO_SOFT) {
7508 litroomlite(FALSE);
7510 int i, j, bd = 2;
7511 struct monst *mtmp;
7513 for(i = -bd; i <= bd; i++) for(j = -bd; j <= bd; j++) {
7514 if (!isok(u.ux + i, u.uy + j)) continue;
7515 if ((mtmp = m_at(u.ux + i, u.uy + j)) != 0) {
7516 wakeup(mtmp); /* monster becomes hostile */
7517 mtmp->mcansee = 0;
7518 mtmp->mblinded = rnd(20);
7519 pline("%s is blinded!", Monnam(mtmp));
7523 break;
7527 if (obj->oartifact == ART_CALLGIRL) {
7528 struct permonst *shoe = 0;
7529 int attempts = 0;
7530 struct monst *shoemonst;
7532 do {
7533 shoe = rndmonst();
7534 attempts++;
7535 if (attempts && (attempts % 10000 == 0)) u.mondiffhack++;
7536 if (!rn2(2000)) reset_rndmonst(NON_PM);
7538 } while ( (!shoe || (shoe && !(shoe->msound == MS_SHOE))) && attempts < 50000);
7540 if (shoe && (shoe->msound == MS_SHOE) ) {
7541 pline("A shoe appears from nowhere!");
7542 shoemonst = makemon(shoe, u.ux, u.uy, NO_MM_FLAGS);
7543 if (shoemonst) (void) tamedog(shoemonst, (struct obj *) 0, TRUE);
7544 } else if (shoe) {
7545 pline("Hmm... you expected a shoe, but some other monster appeared instead!");
7546 shoemonst = makemon(shoe, u.ux, u.uy, NO_MM_FLAGS);
7547 if (shoemonst) (void) tamedog(shoemonst, (struct obj *) 0, TRUE);
7548 } else pline("Somehow, it failed... :(");
7550 u.mondiffhack = 0;
7552 break;
7555 break;
7556 case CHOCOLATE_CREATION:
7559 if (obj->oartifact == ART_QUADRATIC_PRACTIC_BANG_BAG) {
7560 register struct obj *bangbag;
7561 if (CannotSelectItemsInPrompts) return 0;
7562 pline("You need to pick a scroll to use as raw material.");
7563 bangbagchoice:
7564 bangbag = getobj(allowall, "use as raw material");
7565 if (!bangbag) {
7566 if (yn("Really exit with no object selected?") == 'y')
7567 pline("You just wasted the opportunity to create chocolate.");
7568 else goto bangbagchoice;
7569 pline("Oh well, if you don't wanna...");
7570 break;
7571 } else {
7572 if (bangbag->oclass != SCROLL_CLASS) {
7573 pline("That isn't a scroll! The attempt fails.");
7574 break;
7576 #ifdef MAIL
7577 if (bangbag->otyp == SCR_MAIL) {
7578 pline("Cheater. Your mail goes up in flames.");
7579 delobj(bangbag);
7580 break;
7582 #endif
7583 if (evades_destruction(bangbag)) {
7584 pline("Yeah, you wish you could use a scroll that doesn't disappear.");
7585 break;
7588 if (bangbag->oclass == SCROLL_CLASS) {
7589 if (bangbag->quan > 1) {
7590 bangbag->quan -= 1;
7591 bangbag->owt = weight(bangbag);
7592 } else {
7593 useupall(bangbag);
7601 struct obj *uchocitem;
7603 uchocitem = mksobj(CHOCOLATE, TRUE, FALSE, FALSE);
7604 if (uchocitem) {
7605 uchocitem->quan = 1;
7606 uchocitem->known = uchocitem->dknown = uchocitem->bknown = uchocitem->rknown = 1;
7607 uchocitem->owt = weight(uchocitem);
7608 dropy(uchocitem);
7609 stackobj(uchocitem);
7611 uchocitem = mksobj(CHOCOEGG, TRUE, FALSE, FALSE);
7612 if (uchocitem) {
7613 uchocitem->quan = 1;
7614 uchocitem->known = uchocitem->dknown = uchocitem->bknown = uchocitem->rknown = 1;
7615 uchocitem->owt = weight(uchocitem);
7616 dropy(uchocitem);
7617 stackobj(uchocitem);
7619 pline("A christmas present may be waiting for you on the floor!");
7622 break;
7623 case SUMMON_UNDEAD:
7624 if (u.uluck < -9) {
7625 u.uhp -= rn2(20) + 5;
7626 pline_The("Hand claws you with its icy nails!");
7627 if (u.uhp <= 0) {
7628 u.youaredead = 1;
7629 killer_format = KILLED_BY;
7630 killer="the Hand of Vecna";
7631 done(DIED);
7632 u.youaredead = 0;
7635 summon_loop = rn2(4) + 4;
7636 pline("Creatures from the grave surround you!");
7638 if (Aggravate_monster) {
7639 u.aggravation = 1;
7640 reset_rndmonst(NON_PM);
7643 do {
7644 switch (rn2(6) + 1) {
7645 case 1:
7646 pm = mkclass(S_VAMPIRE, 0);
7647 break;
7648 case 2:
7649 case 3:
7650 pm = mkclass(S_ZOMBIE, 0);
7651 break;
7652 case 4:
7653 pm = mkclass(S_MUMMY, 0);
7654 break;
7655 case 5:
7656 pm = mkclass(S_GHOST, 0);
7657 break;
7658 default:
7659 pm = mkclass(S_WRAITH, 0);
7660 break;
7662 mtmp = makemon(pm, u.ux, u.uy, NO_MM_FLAGS);
7663 if ((mtmp2 = tamedog(mtmp, (struct obj *)0, FALSE)) != 0)
7664 mtmp = mtmp2;
7665 mtmp->mtame = 30;
7666 summon_loop--;
7667 } while (summon_loop);
7669 u.aggravation = 0;
7671 /* Tsk,tsk.. */
7672 adjalign(-3);
7673 u.uluck -= 3;
7674 break;
7675 case PROT_POLY:
7676 You_feel("more observant.");
7677 rescham();
7678 break;
7679 case SUMMON_FIRE_ELEMENTAL:
7680 pm = &mons[PM_FIRE_ELEMENTAL];
7681 mtmp = makemon(pm, u.ux, u.uy, NO_MM_FLAGS);
7683 pline("You summon an elemental.");
7685 if ((mtmp2 = tamedog(mtmp, (struct obj *)0, FALSE) ) != 0)
7686 mtmp = mtmp2;
7687 mtmp->mtame = 30;
7688 break;
7689 case SUMMON_WATER_ELEMENTAL:
7690 pm = &mons[PM_WATER_ELEMENTAL];
7691 mtmp = makemon(pm, u.ux, u.uy, NO_MM_FLAGS);
7693 pline("You summon an elemental.");
7695 if ((mtmp2 = tamedog(mtmp, (struct obj *)0, FALSE) ) != 0)
7696 mtmp = mtmp2;
7697 mtmp->mtame = 30;
7698 break;
7699 case OBJ_DETECTION:
7700 (void)object_detect(obj, 0);
7701 break;
7702 case CREATE_PORTAL:
7703 if (playerlevelportdisabled()) {
7704 You("can't branchport!");
7705 break;
7708 int i, num_ok_dungeons, last_ok_dungeon = 0;
7709 d_level newlev;
7710 extern int n_dgns; /* from dungeon.c */
7711 winid tmpwin = create_nhwindow(NHW_MENU);
7712 anything any;
7714 any.a_void = 0; /* set all bits to zero */
7715 if (Is_blackmarket(&u.uz) && *u.ushops) {
7716 You_feel("very disoriented for a moment.");
7717 destroy_nhwindow(tmpwin);
7718 break;
7720 start_menu(tmpwin);
7721 /* use index+1 (cant use 0) as identifier */
7722 for (i = num_ok_dungeons = 0; i < n_dgns; i++) {
7723 if (!dungeons[i].dunlev_ureached) continue;
7725 /* prevent player from ch3ating past the invocation ritual in wonderland mode --Amy */
7726 if (flags.wonderland && !achieve.perform_invocation) {
7727 if (!strcmp(dungeons[i].dname, "Yendorian Tower")) continue;
7728 if (!strcmp(dungeons[i].dname, "Forging Chamber")) continue;
7729 if (!strcmp(dungeons[i].dname, "Dead Grounds")) continue;
7730 if (!strcmp(dungeons[i].dname, "Ordered Chaos")) continue;
7731 if (!strcmp(dungeons[i].dname, "Resting Zone TA")) continue;
7732 if (!strcmp(dungeons[i].dname, "Resting Zone TB")) continue;
7733 if (!strcmp(dungeons[i].dname, "Resting Zone TC")) continue;
7734 if (!strcmp(dungeons[i].dname, "Resting Zone TD")) continue;
7735 if (!strcmp(dungeons[i].dname, "Resting Zone TE")) continue;
7736 if (!strcmp(dungeons[i].dname, "Resting Zone TF")) continue;
7737 if (!strcmp(dungeons[i].dname, "Resting Zone TG")) continue;
7738 if (!strcmp(dungeons[i].dname, "Resting Zone TH")) continue;
7739 if (!strcmp(dungeons[i].dname, "Resting Zone TI")) continue;
7740 if (!strcmp(dungeons[i].dname, "Resting Zone TJ")) continue;
7742 any.a_int = i+1;
7743 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE,
7744 dungeons[i].dname, MENU_UNSELECTED);
7745 num_ok_dungeons++;
7746 last_ok_dungeon = i;
7748 end_menu(tmpwin, "Open a portal to which dungeon?");
7749 if (num_ok_dungeons > 1) {
7750 /* more than one entry; display menu for choices */
7751 menu_item *selected;
7752 int n;
7754 n = select_menu(tmpwin, PICK_ONE, &selected);
7755 if (n <= 0) {
7756 destroy_nhwindow(tmpwin);
7757 goto nothing_special;
7759 i = selected[0].item.a_int - 1;
7760 free((void *)selected);
7761 } else
7762 i = last_ok_dungeon; /* also first & only OK dungeon */
7763 destroy_nhwindow(tmpwin);
7766 * i is now index into dungeon structure for the new dungeon.
7767 * Find the closest level in the given dungeon, open
7768 * a use-once portal to that dungeon and go there.
7769 * The closest level is either the entry or dunlev_ureached.
7771 newlev.dnum = i;
7772 if(dungeons[i].depth_start >= depth(&u.uz))
7773 newlev.dlevel = dungeons[i].entry_lev;
7774 else
7775 newlev.dlevel = dungeons[i].dunlev_ureached;
7776 if((u.uhave.amulet && !u.freeplaymode) || CannotTeleport || In_endgame(&u.uz) || (u.usteed && mon_has_amulet(u.usteed)) || In_endgame(&newlev) ||
7777 newlev.dnum == u.uz.dnum) {
7778 You_feel("very disoriented for a moment.");
7779 } else {
7780 if(!Blind) You("are surrounded by a shimmering sphere!");
7781 else You_feel("weightless for a moment.");
7782 if (practicantterror) {
7783 pline("%s thunders: 'That's not an allowed form of transportation! Are you really too lazy to take the elevator or the stairs? Well wait, I'll ground you for that offense. And additionally you also pay 10000 zorkmids to me!'", noroelaname());
7784 fineforpracticant(10000, 0, 0);
7785 NoReturnEffect += rnz(10000);
7788 u.cnd_branchportcount++;
7789 goto_level(&newlev, FALSE, FALSE, FALSE);
7791 if (obj && obj->oartifact == ART_BIZARRO_ORGASMATRON) {
7792 if ((u.bizarrotries > 2) && !inertiaprotection()) {
7793 u.uprops[DEAC_FAST].intrinsic += ((u.bizarrotries - 2) * 500);
7794 pline("Due to overexertion and too many orgasms, you feel very lethargic...");
7795 pline(u.inertia ? "You feel even slower." : "You slow down to a crawl.");
7796 u.inertia += ((u.bizarrotries - 2) * 500);
7799 u.bizarrotries++;
7801 break;
7803 case ENLIGHTENING:
7805 if (!powerfulimplants() && obj && obj->oartifact == ART_SAATUSPLEASE) curse(obj);
7807 enlightenment(0, 1);
7808 break;
7809 case CREATE_AMMO: {
7810 struct obj *otmp = mksobj(ARROW, TRUE, FALSE, FALSE);
7812 if (!otmp) goto nothing_special;
7813 otmp->blessed = obj->blessed;
7814 otmp->cursed = obj->cursed;
7815 otmp->bknown = obj->bknown;
7816 if (obj->blessed) {
7817 if (otmp->spe < 0) otmp->spe = 0;
7818 otmp->quan += rnd(10);
7819 } else if (obj->cursed) {
7820 if (otmp->spe > 0) otmp->spe = 0;
7821 } else
7822 otmp->quan += rnd(5);
7823 otmp->owt = weight(otmp);
7824 otmp = hold_another_object(otmp, "Suddenly %s out.",
7825 aobjnam(otmp, "fall"), (const char *)0);
7826 break;
7827 case OBJECT_DET:
7828 object_detect(obj, 0);
7829 artifact_detect(obj);
7830 break;
7831 case PHASING: /* Walk through walls and stone like a xorn */
7832 if (Passes_walls) goto nothing_special;
7833 if (oart == &artilist[ART_IRON_BALL_OF_LIBERATION]) {
7834 if (Punished && (obj != uball)) {
7835 unpunish(); /* Remove a mundane heavy iron ball */
7838 if (!Punished) {
7839 setworn(mkobj(CHAIN_CLASS, TRUE, FALSE), W_CHAIN);
7840 setworn(obj, W_BALL);
7841 /*uball->spe = 1;*/
7842 if (!u.uswallow) {
7843 placebc();
7844 if (Blind) set_bc(1); /* set up ball and chain variables */
7845 newsym(u.ux,u.uy); /* see ball&chain if can't see self */
7847 Your("%s chains itself to you!", xname(obj));
7850 if (!FunnyHallu) {
7851 Your("body begins to feel less solid.");
7852 } else {
7853 You_feel("one with the spirit world.");
7855 incr_itimeout(&Phasing, (50 + rnd(100)));
7856 obj->invoketimer += Phasing; /* Time begins after phasing ends */
7857 break;
7860 } else {
7861 long eprop = (u.uprops[oart->inv_prop].extrinsic ^= W_ARTI),
7862 iprop = u.uprops[oart->inv_prop].intrinsic;
7863 boolean on = (eprop & W_ARTI) != 0; /* true if invoked prop just set */
7865 if (obj->oartifact >= ART_ORB_OF_DETECTION && !is_quest_artifact(obj)) {
7866 pline("Tapping into the powers of artifacts that don't belong to you is dangerous.");
7867 contaminate(rnz(100), TRUE);
7868 increasesanity(rnz(100));
7869 adjalign(-rnz(100));
7872 if(on && obj->invoketimer > monstermoves) {
7873 /* the artifact is tired :-) */
7874 u.uprops[oart->inv_prop].extrinsic ^= W_ARTI;
7875 You_feel("that %s %s ignoring you.",
7876 the(xname(obj)), otense(obj, "are"));
7877 /* can't just keep repeatedly trying */
7878 obj->invoketimer += (long) d(3,10);
7879 if (!rn2(5)) obj->invoketimer += (long) rnz(100);
7880 return 1;
7881 } else if(!on) {
7882 /* when turning off property, determine downtime */
7883 /* arbitrary for now until we can tune this -dlc */
7884 obj->invoketimer = monstermoves + artitimeout;
7885 use_skill(P_SQUEAKING, rnd(10));
7888 if ((eprop & ~W_ARTI) || iprop) {
7889 nothing_special:
7890 /* you had the property from some other source too */
7891 if (carried(obj))
7892 You_feel("a surge of power, but nothing seems to happen.");
7893 return 1;
7895 switch(oart->inv_prop) {
7896 case CONFLICT:
7897 if(on) You_feel("like a rabble-rouser.");
7898 else You_feel("the tension decrease around you.");
7899 break;
7900 case LEVITATION:
7901 if(on) {
7902 float_up();
7903 spoteffects(FALSE);
7904 } else (void) float_down(I_SPECIAL|TIMEOUT, W_ARTI);
7905 break;
7906 case INVIS:
7907 if (BInvis || Blind) goto nothing_special;
7908 newsym(u.ux, u.uy);
7909 if (on)
7910 Your("body takes on a %s transparency...",
7911 FunnyHallu ? "normal" : "strange");
7912 else
7913 Your("body seems to unfade...");
7914 break;
7918 return 1;
7922 * Artifact is dipped into water
7923 * -1 not handled here (not used up here)
7924 * 0 no effect but used up
7925 * else return
7926 * AD_FIRE, etc.
7927 * Note caller should handle what happens to the medium in these cases.
7928 * This only prints messages about the actual artifact.
7932 artifact_wet(obj, silent)
7933 struct obj *obj;
7934 boolean silent;
7936 if (!obj->oartifact) return (-1);
7937 switch (artilist[(int) (obj)->oartifact].attk.adtyp) {
7938 case AD_FIRE:
7939 if (!silent) {
7940 pline("A cloud of steam rises.");
7941 pline("%s is untouched.", The(xname(obj)));
7943 return (AD_FIRE);
7944 case AD_COLD:
7945 if (!silent) {
7946 pline("Icicles form and fall from the freezing %s.",
7947 the(xname(obj)));
7949 return (AD_COLD);
7950 case AD_ELEC:
7951 if (!silent) {
7952 pline_The("humid air crackles with electricity from %s.",
7953 the(xname(obj)));
7955 return (AD_ELEC);
7956 case AD_DRLI:
7957 if (!silent) {
7958 pline("%s absorbs the water!", The(xname(obj)));
7960 return (AD_DRLI);
7961 default:
7962 break;
7964 return (-1);
7967 /* WAC return TRUE if artifact is always lit */
7968 boolean
7969 artifact_light(obj)
7970 struct obj *obj;
7972 return get_artifact(obj) && (obj->oartifact == ART_SUNSWORD ||
7973 obj->oartifact == ART_HOLY_SPEAR_OF_LIGHT ||
7974 obj->oartifact == ART_SUNSCREEN ||
7975 obj->oartifact == ART_SUNTINOPENER ||
7976 obj->oartifact == ART_SUNRUBBERHOSE ||
7977 obj->oartifact == ART_CANDLE_OF_ETERNAL_FLAME);
7980 /* KMH -- Talking artifacts are finally implemented */
7981 void
7982 arti_speak(obj)
7983 struct obj *obj;
7985 if (!obj) {
7986 impossible("arti_speak called with no valid object");
7987 return;
7990 register const struct artifact *oart = get_artifact(obj);
7991 const char *line;
7992 char buf[BUFSZ];
7995 /* Is this a speaking artifact? */
7996 if (!oart || !(oart->spfx & SPFX_SPEAK))
7997 return;
7999 line = getrumor(bcsign(obj), buf, TRUE);
8000 if (!*line)
8001 line = "Slash'EM rumors file closed for renovation.";
8002 pline("%s:", Tobjnam(obj, "whisper"));
8003 verbalize("%s", line);
8004 return;
8007 boolean
8008 artifact_has_invprop(otmp, inv_prop)
8009 struct obj *otmp;
8010 /*uchar*/int inv_prop;
8012 const struct artifact *arti = get_artifact(otmp);
8014 return((boolean)(arti && (arti->inv_prop == inv_prop)));
8017 /* Return the price sold to the hero of a given artifact or unique item */
8018 long
8019 arti_cost(otmp)
8020 struct obj *otmp;
8022 if (!otmp->oartifact)
8023 return ((long)objects[otmp->otyp].oc_cost);
8024 else if (artilist[(int) otmp->oartifact].cost)
8025 return (artilist[(int) otmp->oartifact].cost);
8026 else
8027 return (100L * (long)objects[otmp->otyp].oc_cost);
8030 static const char *random_seasound[] = {
8031 "distant waves",
8032 "distant surf",
8033 "the distant sea",
8034 "the call of the ocean",
8035 "waves against the shore",
8036 "flowing water",
8037 "the sighing of waves",
8038 "quarrelling gulls",
8039 "the song of the deep",
8040 "rumbling in the deeps",
8041 "the singing of Eidothea",
8042 "the laughter of the protean nymphs",
8043 "rushing tides",
8044 "the elusive sea change",
8045 "the silence of the sea",
8046 "the passage of the albatross",
8047 "dancing raindrops",
8048 "coins rolling on the seabed",
8049 "treasure galleons crumbling in the depths",
8050 "waves lapping against a hull"
8053 /* Polymorph obj contents */
8054 void
8055 arti_poly_contents(obj)
8056 struct obj *obj;
8058 struct obj *dobj = 0; /*object to be deleted*/
8059 struct obj *otmp;
8060 You_hear("%s.",random_seasound[rn2(SIZE(random_seasound))]);
8061 for (otmp = obj->cobj; otmp; otmp = otmp->nobj){
8062 if (dobj) {
8063 delobj(dobj);
8064 dobj = 0;
8066 if(!obj_resists(otmp, 5, 95) && !stack_too_big(otmp) ){
8067 /* KMH, conduct */
8068 u.uconduct.polypiles++;
8069 /* any saved lock context will be dangerously obsolete */
8070 if (Is_box(otmp)) (void) boxlock(otmp, obj);
8072 if (obj_shudders(otmp)) {
8073 dobj = otmp;
8075 else otmp = poly_obj(otmp, STRANGE_OBJECT, TRUE);
8078 if (dobj) {
8079 delobj(dobj);
8080 dobj = 0;
8085 find_wildtalentartifact()
8087 int artifactnumber = artilist[ART_ELLI_S_PSEUDOBAND_OF_POS].otyp;
8088 return artifactnumber;
8092 find_prostituteartifact()
8094 int artifactnumber = artilist[ART_HIGHEST_FEELING].otyp;
8095 return artifactnumber;
8099 find_kurwaartifact()
8101 int artifactnumber = artilist[ART_LORSKEL_S_INTEGRITY].otyp;
8102 return artifactnumber;
8105 /* Function that adds or removes a random intrinsic from the player. --Amy */
8106 void
8107 intrinsicgainorloss(inttype)
8108 int inttype; /* 0 = random, 1 = always gain an intrinsic, 2 = always lose an intrinsic */
8110 register boolean intloss = rn2(2);
8112 boolean hasmadeachange = 0;
8113 int tryct = 0;
8115 retrytrinsic:
8116 if (!rn2(5)) intloss = rn2(2);
8118 if (inttype == 1) intloss = FALSE;
8119 if (inttype == 2) intloss = TRUE;
8121 if (rn2(4)) { /* ones that can easily be gained by eating things */
8122 switch (rnd(16)) {
8124 case 1:
8125 if (intloss) {
8126 if (HFire_resistance & INTRINSIC) {
8127 HFire_resistance &= ~INTRINSIC;
8128 You_feel("warmer.");
8129 hasmadeachange = 1;
8131 if (HFire_resistance & TIMEOUT) {
8132 HFire_resistance &= ~TIMEOUT;
8133 You_feel("warmer.");
8134 hasmadeachange = 1;
8136 } else {
8137 if(!(HFire_resistance & FROMOUTSIDE)) {
8138 You(FunnyHallu ? "be chillin'." : "feel a momentary chill.");
8139 HFire_resistance |= FROMOUTSIDE;
8140 hasmadeachange = 1;
8143 break;
8144 case 2:
8145 if (intloss) {
8146 if (HTeleportation & INTRINSIC) {
8147 HTeleportation &= ~INTRINSIC;
8148 You_feel("less jumpy.");
8149 hasmadeachange = 1;
8151 if (HTeleportation & TIMEOUT) {
8152 HTeleportation &= ~TIMEOUT;
8153 You_feel("less jumpy.");
8154 hasmadeachange = 1;
8156 } else {
8157 if(!(HTeleportation & FROMOUTSIDE)) {
8158 You_feel(FunnyHallu ? "diffuse." : "very jumpy.");
8159 HTeleportation |= FROMOUTSIDE;
8160 hasmadeachange = 1;
8163 break;
8164 case 3:
8165 if (intloss) {
8166 if (HPoison_resistance & INTRINSIC) {
8167 HPoison_resistance &= ~INTRINSIC;
8168 You_feel("a little sick!");
8169 hasmadeachange = 1;
8171 if (HPoison_resistance & TIMEOUT) {
8172 HPoison_resistance &= ~TIMEOUT;
8173 You_feel("a little sick!");
8174 hasmadeachange = 1;
8176 } else {
8177 if(!(HPoison_resistance & FROMOUTSIDE)) {
8178 You_feel(Poison_resistance ? "especially healthy." : "healthy.");
8179 HPoison_resistance |= FROMOUTSIDE;
8180 hasmadeachange = 1;
8183 break;
8184 case 4:
8185 if (intloss) {
8186 if (HTelepat & INTRINSIC) {
8187 HTelepat &= ~INTRINSIC;
8188 Your("senses fail!");
8189 hasmadeachange = 1;
8191 if (HTelepat & TIMEOUT) {
8192 HTelepat &= ~TIMEOUT;
8193 Your("senses fail!");
8194 hasmadeachange = 1;
8196 } else {
8197 if(!(HTelepat & FROMOUTSIDE)) {
8198 You_feel(FunnyHallu ? "in touch with the cosmos." : "a strange mental acuity.");
8199 HTelepat |= FROMOUTSIDE;
8200 hasmadeachange = 1;
8203 break;
8204 case 5:
8205 if (intloss) {
8206 if (HCold_resistance & INTRINSIC) {
8207 HCold_resistance &= ~INTRINSIC;
8208 You_feel("cooler.");
8209 hasmadeachange = 1;
8211 if (HCold_resistance & TIMEOUT) {
8212 HCold_resistance &= ~TIMEOUT;
8213 You_feel("cooler.");
8214 hasmadeachange = 1;
8216 } else {
8217 if(!(HCold_resistance & FROMOUTSIDE)) {
8218 You_feel("full of hot air.");
8219 HCold_resistance |= FROMOUTSIDE;
8220 hasmadeachange = 1;
8223 break;
8224 case 6:
8225 if (intloss) {
8226 if (HInvis & INTRINSIC) {
8227 HInvis &= ~INTRINSIC;
8228 You_feel("paranoid.");
8229 hasmadeachange = 1;
8231 if (HInvis & TIMEOUT) {
8232 HInvis &= ~TIMEOUT;
8233 You_feel("paranoid.");
8234 hasmadeachange = 1;
8236 } else {
8237 if(!(HInvis & FROMOUTSIDE)) {
8238 You_feel("less visible.");
8239 HInvis |= FROMOUTSIDE;
8240 hasmadeachange = 1;
8243 break;
8244 case 7:
8245 if (intloss) {
8246 if (HSee_invisible & INTRINSIC) {
8247 HSee_invisible &= ~INTRINSIC;
8248 You("%s!", FunnyHallu ? "tawt you taw a puttie tat" : "thought you saw something");
8249 hasmadeachange = 1;
8251 if (HSee_invisible & TIMEOUT) {
8252 HSee_invisible &= ~TIMEOUT;
8253 You("%s!", FunnyHallu ? "tawt you taw a puttie tat" : "thought you saw something");
8254 hasmadeachange = 1;
8256 } else {
8257 if(!(HSee_invisible & FROMOUTSIDE)) {
8258 You_feel("your vision sharpen.");
8259 HSee_invisible |= FROMOUTSIDE;
8260 hasmadeachange = 1;
8263 break;
8264 case 8:
8265 if (intloss) {
8266 if (HFast & INTRINSIC) {
8267 HFast &= ~INTRINSIC;
8268 You_feel("slower.");
8269 hasmadeachange = 1;
8271 if (HFast & TIMEOUT) {
8272 HFast &= ~TIMEOUT;
8273 You_feel("slower.");
8274 hasmadeachange = 1;
8276 } else {
8277 if(!(HFast & FROMOUTSIDE)) {
8278 You_feel("faster.");
8279 HFast |= FROMOUTSIDE;
8280 hasmadeachange = 1;
8283 break;
8284 case 9:
8285 if (intloss) {
8286 if (HAggravate_monster & INTRINSIC) {
8287 HAggravate_monster &= ~INTRINSIC;
8288 You_feel("less attractive.");
8289 hasmadeachange = 1;
8291 if (HAggravate_monster & TIMEOUT) {
8292 HAggravate_monster &= ~TIMEOUT;
8293 You_feel("less attractive.");
8294 hasmadeachange = 1;
8296 } else {
8297 if(!(HAggravate_monster & FROMOUTSIDE)) {
8298 You_feel("monsters setting up portals.");
8299 HAggravate_monster |= FROMOUTSIDE;
8300 hasmadeachange = 1;
8303 break;
8304 case 10:
8305 if (intloss) {
8306 if (HSleep_resistance & INTRINSIC) {
8307 HSleep_resistance &= ~INTRINSIC;
8308 You_feel("tired all of a sudden.");
8309 hasmadeachange = 1;
8311 if (HSleep_resistance & TIMEOUT) {
8312 HSleep_resistance &= ~TIMEOUT;
8313 You_feel("tired all of a sudden.");
8314 hasmadeachange = 1;
8316 } else {
8317 if(!(HSleep_resistance & FROMOUTSIDE)) {
8318 You_feel("wide awake.");
8319 HSleep_resistance |= FROMOUTSIDE;
8320 hasmadeachange = 1;
8323 break;
8324 case 11:
8325 if (intloss) {
8326 if (HDisint_resistance & INTRINSIC) {
8327 HDisint_resistance &= ~INTRINSIC;
8328 You_feel("like you're going to break apart.");
8329 hasmadeachange = 1;
8331 if (HDisint_resistance & TIMEOUT) {
8332 HDisint_resistance &= ~TIMEOUT;
8333 You_feel("like you're going to break apart.");
8334 hasmadeachange = 1;
8336 } else {
8337 if(!(HDisint_resistance & FROMOUTSIDE)) {
8338 You_feel(FunnyHallu ? "totally together, man." : "very firm.");
8339 HDisint_resistance |= FROMOUTSIDE;
8340 hasmadeachange = 1;
8343 break;
8344 case 12:
8345 if (intloss) {
8346 if (HShock_resistance & INTRINSIC) {
8347 HShock_resistance &= ~INTRINSIC;
8348 You_feel("like someone has zapped you.");
8349 hasmadeachange = 1;
8351 if (HShock_resistance & TIMEOUT) {
8352 HShock_resistance &= ~TIMEOUT;
8353 You_feel("like someone has zapped you.");
8354 hasmadeachange = 1;
8356 } else {
8357 if(!(HShock_resistance & FROMOUTSIDE)) {
8358 if (FunnyHallu)
8359 You_feel("grounded in reality.");
8360 else
8361 Your("health currently feels amplified!");
8362 HShock_resistance |= FROMOUTSIDE;
8363 hasmadeachange = 1;
8366 break;
8367 case 13:
8368 if (intloss) {
8369 if (HTeleport_control & INTRINSIC) {
8370 HTeleport_control &= ~INTRINSIC;
8371 You_feel("unable to control where you're going.");
8372 hasmadeachange = 1;
8374 if (HTeleport_control & TIMEOUT) {
8375 HTeleport_control &= ~TIMEOUT;
8376 You_feel("unable to control where you're going.");
8377 hasmadeachange = 1;
8379 } else {
8380 if(!(HTeleport_control & FROMOUTSIDE)) {
8381 You_feel(FunnyHallu ? "centered in your personal space." : "in control of yourself.");
8382 HTeleport_control |= FROMOUTSIDE;
8383 hasmadeachange = 1;
8386 break;
8387 case 14:
8388 if (intloss) {
8389 if (HAcid_resistance & INTRINSIC) {
8390 HAcid_resistance &= ~INTRINSIC;
8391 You_feel("worried about corrosion!");
8392 hasmadeachange = 1;
8394 if (HAcid_resistance & TIMEOUT) {
8395 HAcid_resistance &= ~TIMEOUT;
8396 You_feel("worried about corrosion!");
8397 hasmadeachange = 1;
8399 } else {
8400 if(!(HAcid_resistance & FROMOUTSIDE)) {
8401 You(FunnyHallu ? "wanna do more acid!" : "feel less afraid of corrosives.");
8402 HAcid_resistance |= FROMOUTSIDE;
8403 hasmadeachange = 1;
8406 break;
8407 case 15:
8409 int foopathynumber = rnd(13);
8410 switch (foopathynumber) {
8412 case 1:
8414 if (intloss) {
8415 if (HHallu_party & INTRINSIC) {
8416 HHallu_party &= ~INTRINSIC;
8417 You_feel("that the party is over!");
8418 hasmadeachange = 1;
8420 if (HHallu_party & TIMEOUT) {
8421 HHallu_party &= ~TIMEOUT;
8422 You_feel("that the party is over!");
8423 hasmadeachange = 1;
8425 } else {
8426 if(!(HHallu_party & FROMOUTSIDE)) {
8427 You_feel(FunnyHallu ?
8428 "like throwing wild parties with lots of sexy girls! Yeah!" :
8429 "a strange desire to celebrate.");
8430 HHallu_party |= FROMOUTSIDE;
8431 hasmadeachange = 1;
8434 break;
8435 case 2:
8437 if (intloss) {
8438 if (HDrunken_boxing & INTRINSIC) {
8439 HDrunken_boxing &= ~INTRINSIC;
8440 You_feel("a little drunk!");
8441 hasmadeachange = 1;
8443 if (HDrunken_boxing & TIMEOUT) {
8444 HDrunken_boxing &= ~TIMEOUT;
8445 You_feel("a little drunk!");
8446 hasmadeachange = 1;
8448 } else {
8449 if(!(HDrunken_boxing & FROMOUTSIDE)) {
8450 You_feel(FunnyHallu ? "like Mike Tyson!" : "ready for a good brawl.");
8451 HDrunken_boxing |= FROMOUTSIDE;
8452 hasmadeachange = 1;
8455 break;
8456 case 3:
8458 if (intloss) {
8459 if (HStunnopathy & INTRINSIC) {
8460 HStunnopathy &= ~INTRINSIC;
8461 You_feel("an uncontrolled stunning!");
8462 hasmadeachange = 1;
8464 if (HStunnopathy & TIMEOUT) {
8465 HStunnopathy &= ~TIMEOUT;
8466 You_feel("an uncontrolled stunning!");
8467 hasmadeachange = 1;
8469 } else {
8470 if(!(HStunnopathy & FROMOUTSIDE)) {
8471 You_feel(FunnyHallu ? "a controlled wobbling! Feels like being on a bouncy ship!" : "steadily observant.");
8472 HStunnopathy |= FROMOUTSIDE;
8473 hasmadeachange = 1;
8476 break;
8477 case 4:
8479 if (intloss) {
8480 if (HNumbopathy & INTRINSIC) {
8481 HNumbopathy &= ~INTRINSIC;
8482 You_feel("numbness spreading through your body!");
8483 hasmadeachange = 1;
8485 if (HNumbopathy & TIMEOUT) {
8486 HNumbopathy &= ~TIMEOUT;
8487 You_feel("numbness spreading through your body!");
8488 hasmadeachange = 1;
8490 } else {
8491 if(!(HNumbopathy & FROMOUTSIDE)) {
8492 You_feel(FunnyHallu ?
8493 "as if a sweet woman were clamping your toes with a block-heeled combat boot!" :
8494 "a numb feeling spreading through your body. Somehow, it doesn't feel bad at all...");
8495 HNumbopathy |= FROMOUTSIDE;
8496 hasmadeachange = 1;
8499 break;
8500 case 5:
8502 if (intloss) {
8503 if (HDimmopathy & INTRINSIC) {
8504 HDimmopathy &= ~INTRINSIC;
8505 You_feel(FunnyHallu ? "that your marriage is no longer safe..." : "worried about the future!");
8506 hasmadeachange = 1;
8508 if (HDimmopathy & TIMEOUT) {
8509 HDimmopathy &= ~TIMEOUT;
8510 You_feel(FunnyHallu ? "that your marriage is no longer safe..." : "worried about the future!");
8511 hasmadeachange = 1;
8513 } else {
8514 if(!(HDimmopathy & FROMOUTSIDE)) {
8515 HDimmopathy |= FROMOUTSIDE;
8516 You_feel(FunnyHallu ?
8517 "like your wife was contemplating a breakup, but then you realize that she's gonna stay with you to the end of all time." :
8518 "a little down. But then, good feelings overcome you.");
8519 hasmadeachange = 1;
8522 break;
8523 case 6:
8525 if (intloss) {
8526 if (HFreezopathy & INTRINSIC) {
8527 HFreezopathy &= ~INTRINSIC;
8528 You_feel("ice-cold!");
8529 hasmadeachange = 1;
8531 if (HFreezopathy & TIMEOUT) {
8532 HFreezopathy &= ~TIMEOUT;
8533 You_feel("ice-cold!");
8534 hasmadeachange = 1;
8536 } else {
8537 if(!(HFreezopathy & FROMOUTSIDE)) {
8538 You_feel(FunnyHallu ? "like eating a big cone of ice-cream - mmmmmmmm!" : "icy.");
8539 HFreezopathy |= FROMOUTSIDE;
8540 hasmadeachange = 1;
8543 break;
8544 case 7:
8546 if (intloss) {
8547 if (HStoned_chiller & INTRINSIC) {
8548 HStoned_chiller &= ~INTRINSIC;
8549 You_feel("that you ain't gonna get time for relaxing anymore!");
8550 hasmadeachange = 1;
8552 if (HStoned_chiller & TIMEOUT) {
8553 HStoned_chiller &= ~TIMEOUT;
8554 You_feel("that you ain't gonna get time for relaxing anymore!");
8555 hasmadeachange = 1;
8557 } else {
8558 if(!(HStoned_chiller & FROMOUTSIDE)) {
8559 You_feel(FunnyHallu ? "that you're simply the best - yeah, no shit, man!" : "like relaxing on a couch.");
8560 HStoned_chiller |= FROMOUTSIDE;
8561 hasmadeachange = 1;
8564 break;
8565 case 8:
8567 if (intloss) {
8568 if (HCorrosivity & INTRINSIC) {
8569 HCorrosivity &= ~INTRINSIC;
8570 You_feel("the protective layer on your skin disappearing!");
8571 hasmadeachange = 1;
8573 if (HCorrosivity & TIMEOUT) {
8574 HCorrosivity &= ~TIMEOUT;
8575 You_feel("the protective layer on your skin disappearing!");
8576 hasmadeachange = 1;
8578 } else {
8579 if(!(HCorrosivity & FROMOUTSIDE)) {
8580 You_feel(FunnyHallu ? "like you just got splashed with gunks of acid!" : "an acidic burning.");
8581 HCorrosivity |= FROMOUTSIDE;
8582 hasmadeachange = 1;
8585 break;
8586 case 9:
8588 if (intloss) {
8589 if (HFear_factor & INTRINSIC) {
8590 HFear_factor &= ~INTRINSIC;
8591 You_feel("fearful!");
8592 hasmadeachange = 1;
8594 if (HFear_factor & TIMEOUT) {
8595 HFear_factor &= ~TIMEOUT;
8596 You_feel("fearful!");
8597 hasmadeachange = 1;
8599 } else {
8600 if(!(HFear_factor & FROMOUTSIDE)) {
8601 You_feel(FunnyHallu ? "like you're always running - from something! And the 'something' is a prostitute." : "ready to face your fears.");
8602 HFear_factor |= FROMOUTSIDE;
8603 hasmadeachange = 1;
8606 break;
8607 case 10:
8609 if (intloss) {
8610 if (HBurnopathy & INTRINSIC) {
8611 HBurnopathy &= ~INTRINSIC;
8612 You_feel("red-hot!");
8613 hasmadeachange = 1;
8615 if (HBurnopathy & TIMEOUT) {
8616 HBurnopathy &= ~TIMEOUT;
8617 You_feel("red-hot!");
8618 hasmadeachange = 1;
8620 } else {
8621 if(!(HBurnopathy & FROMOUTSIDE)) {
8622 You_feel(FunnyHallu ? "super burninated by enemy with very tired!" : "a burning inside. Strangely, it feels quite soothing.");
8623 HBurnopathy |= FROMOUTSIDE;
8624 hasmadeachange = 1;
8627 break;
8628 case 11:
8630 if (intloss) {
8631 if (HSickopathy & INTRINSIC) {
8632 HSickopathy &= ~INTRINSIC;
8633 You_feel("a loss of medical knowledge!");
8634 hasmadeachange = 1;
8636 if (HSickopathy & TIMEOUT) {
8637 HSickopathy &= ~TIMEOUT;
8638 You_feel("a loss of medical knowledge!");
8639 hasmadeachange = 1;
8641 } else {
8642 if(!(HSickopathy & FROMOUTSIDE)) {
8643 You_feel(FunnyHallu ?
8644 "that you just smoked some really wacky stuff! What the heck was in there?" :
8645 "ill for a moment, but get the feeling that you know more about diseases now.");
8646 HSickopathy |= FROMOUTSIDE;
8647 hasmadeachange = 1;
8650 break;
8651 case 12:
8653 if (intloss) {
8654 if (HWonderlegs & INTRINSIC) {
8655 HWonderlegs &= ~INTRINSIC;
8656 You_feel("that all girls and women will scratch bloody wounds on your legs with their high heels!");
8657 hasmadeachange = 1;
8659 if (HWonderlegs & TIMEOUT) {
8660 HWonderlegs &= ~TIMEOUT;
8661 You_feel("that all girls and women will scratch bloody wounds on your legs with their high heels!");
8662 hasmadeachange = 1;
8664 } else {
8665 if(!(HWonderlegs & FROMOUTSIDE)) {
8666 You_feel(FunnyHallu ?
8667 "a wonderful sensation in your shins, like they were just kicked by female hugging boots! How lovely!" :
8668 "like having your legs scratched up and down by sexy leather pumps.");
8669 HWonderlegs |= FROMOUTSIDE;
8670 hasmadeachange = 1;
8673 break;
8674 case 13:
8676 if (intloss) {
8677 if (HGlib_combat & INTRINSIC) {
8678 HGlib_combat &= ~INTRINSIC;
8679 You_feel("fliction in your %s!", makeplural(body_part(HAND)));
8680 hasmadeachange = 1;
8682 if (HGlib_combat & TIMEOUT) {
8683 HGlib_combat &= ~TIMEOUT;
8684 You_feel("fliction in your %s!", makeplural(body_part(HAND)));
8685 hasmadeachange = 1;
8687 } else {
8688 if(!(HGlib_combat & FROMOUTSIDE)) {
8689 You_feel(FunnyHallu ?
8690 "like an absolute marital arts champion, so you can start fighting off your spouse!" :
8691 "the fliction in your hands disappearing.");
8692 HGlib_combat |= FROMOUTSIDE;
8693 hasmadeachange = 1;
8696 break;
8699 break;
8700 case 16:
8701 if (intloss) {
8702 if (HStone_resistance & INTRINSIC) {
8703 HStone_resistance &= ~INTRINSIC;
8704 You_feel("less solid!");
8705 hasmadeachange = 1;
8707 if (HStone_resistance & TIMEOUT) {
8708 HStone_resistance &= ~TIMEOUT;
8709 You_feel("less solid!");
8710 hasmadeachange = 1;
8712 } else {
8713 if(!(HStone_resistance & FROMOUTSIDE)) {
8714 You(FunnyHallu ? "feel stony and groovy, man." : "feel rock solid.");
8715 HStone_resistance |= FROMOUTSIDE;
8716 hasmadeachange = 1;
8719 break;
8720 default: /* shouldn't happen */
8721 break;
8724 } else switch (rnd(56)) { /* ones that require eating jewelry or other weird actions */
8726 case 1:
8727 if (intloss) {
8728 if (HStealth & INTRINSIC) {
8729 HStealth &= ~INTRINSIC;
8730 You_feel("clumsy.");
8731 hasmadeachange = 1;
8733 if (HStealth & TIMEOUT) {
8734 HStealth &= ~TIMEOUT;
8735 You_feel("clumsy.");
8736 hasmadeachange = 1;
8738 } else {
8739 if(!(HStealth & FROMOUTSIDE)) {
8740 HStealth |= FROMOUTSIDE;
8741 You_feel("stealthy.");
8742 hasmadeachange = 1;
8746 break;
8747 case 2:
8748 if (intloss) {
8749 if (HProtection & INTRINSIC) {
8750 HProtection &= ~INTRINSIC;
8751 You_feel("vulnerable.");
8752 hasmadeachange = 1;
8754 if (HProtection & TIMEOUT) {
8755 HProtection &= ~TIMEOUT;
8756 You_feel("vulnerable.");
8757 hasmadeachange = 1;
8759 } else {
8760 if(!(HProtection & FROMOUTSIDE)) {
8761 HProtection |= FROMOUTSIDE;
8762 You_feel("protected.");
8763 hasmadeachange = 1;
8766 break;
8767 case 3:
8768 if (intloss) {
8769 if (HDrain_resistance & INTRINSIC) {
8770 HDrain_resistance &= ~INTRINSIC;
8771 You_feel("like someone is sucking out your life-force.");
8772 hasmadeachange = 1;
8774 if (HDrain_resistance & TIMEOUT) {
8775 HDrain_resistance &= ~TIMEOUT;
8776 You_feel("like someone is sucking out your life-force.");
8777 hasmadeachange = 1;
8779 } else {
8780 if(!(HDrain_resistance & FROMOUTSIDE)) {
8781 You_feel("that your life force is safe now.");
8782 HDrain_resistance |= FROMOUTSIDE;
8783 hasmadeachange = 1;
8786 break;
8787 case 4:
8788 if (intloss) {
8789 if (HSick_resistance & INTRINSIC) {
8790 HSick_resistance &= ~INTRINSIC;
8791 You_feel("no longer immune to diseases!");
8792 hasmadeachange = 1;
8794 if (HSick_resistance & TIMEOUT) {
8795 HSick_resistance &= ~TIMEOUT;
8796 You_feel("no longer immune to diseases!");
8797 hasmadeachange = 1;
8799 } else {
8800 if(!(HSick_resistance & FROMOUTSIDE)) {
8801 You_feel("immune to diseases.");
8802 HSick_resistance |= FROMOUTSIDE;
8803 hasmadeachange = 1;
8806 break;
8807 case 5:
8808 if (intloss) {
8809 if (HWarning & INTRINSIC) {
8810 HWarning &= ~INTRINSIC;
8811 You_feel("that your radar has just stopped working!");
8812 hasmadeachange = 1;
8814 if (HWarning & TIMEOUT) {
8815 HWarning &= ~TIMEOUT;
8816 You_feel("that your radar has just stopped working!");
8817 hasmadeachange = 1;
8819 } else {
8820 if(!(HWarning & FROMOUTSIDE)) {
8821 You_feel("that your radar was turned on.");
8822 HWarning |= FROMOUTSIDE;
8823 hasmadeachange = 1;
8826 break;
8827 case 6:
8828 if (intloss) {
8829 if (HSearching & INTRINSIC) {
8830 HSearching &= ~INTRINSIC;
8831 You_feel("unable to find something you lost!");
8832 hasmadeachange = 1;
8834 if (HSearching & TIMEOUT) {
8835 HSearching &= ~TIMEOUT;
8836 You_feel("unable to find something you lost!");
8837 hasmadeachange = 1;
8839 } else {
8840 if(!(HSearching & FROMOUTSIDE)) {
8841 You_feel("capable of finding hidden secrets.");
8842 HSearching |= FROMOUTSIDE;
8843 hasmadeachange = 1;
8846 break;
8847 case 7:
8848 if (intloss) {
8849 if (HClairvoyant & INTRINSIC) {
8850 HClairvoyant &= ~INTRINSIC;
8851 You_feel("a loss of mental capabilities!");
8852 hasmadeachange = 1;
8854 if (HClairvoyant & TIMEOUT) {
8855 HClairvoyant &= ~TIMEOUT;
8856 You_feel("a loss of mental capabilities!");
8857 hasmadeachange = 1;
8859 } else {
8860 if(!(HClairvoyant & FROMOUTSIDE)) {
8861 You_feel("your consciousness expand!");
8862 HClairvoyant |= FROMOUTSIDE;
8863 hasmadeachange = 1;
8866 break;
8867 case 8:
8868 if (intloss) {
8869 if (HInfravision & INTRINSIC) {
8870 HInfravision &= ~INTRINSIC;
8871 You_feel("shrouded in darkness.");
8872 hasmadeachange = 1;
8874 if (HInfravision & TIMEOUT) {
8875 HInfravision &= ~TIMEOUT;
8876 You_feel("shrouded in darkness.");
8877 hasmadeachange = 1;
8879 } else {
8880 if(!(HInfravision & FROMOUTSIDE)) {
8881 You_feel("capable of seeing in the dark.");
8882 HInfravision |= FROMOUTSIDE;
8883 hasmadeachange = 1;
8886 break;
8887 case 9:
8888 if (!rn2(200)) { /* detect monsters is the grand daddy and thus very rare --Amy */
8890 if (intloss) {
8891 if (HDetect_monsters & INTRINSIC) {
8892 HDetect_monsters &= ~INTRINSIC;
8893 You_feel("that you can no longer sense monsters.");
8894 hasmadeachange = 1;
8896 if (HDetect_monsters & TIMEOUT) {
8897 HDetect_monsters &= ~TIMEOUT;
8898 You_feel("that you can no longer sense monsters.");
8899 hasmadeachange = 1;
8901 } else {
8902 if(!(HDetect_monsters & FROMOUTSIDE)) {
8903 HDetect_monsters |= FROMOUTSIDE;
8904 You("sense monsters.");
8905 hasmadeachange = 1;
8909 } else {
8911 if (intloss) {
8912 if (HJumping & INTRINSIC) {
8913 HJumping &= ~INTRINSIC;
8914 You_feel("your legs shrinking.");
8915 hasmadeachange = 1;
8917 if (HJumping & TIMEOUT) {
8918 HJumping &= ~TIMEOUT;
8919 You_feel("your legs shrinking.");
8920 hasmadeachange = 1;
8922 } else {
8923 if(!(HJumping & FROMOUTSIDE)) {
8924 HJumping |= FROMOUTSIDE;
8925 You_feel("a sudden ability to jump.");
8926 hasmadeachange = 1;
8930 break;
8931 case 10:
8932 if (intloss) {
8933 if (HMagical_breathing & INTRINSIC) {
8934 HMagical_breathing &= ~INTRINSIC;
8935 You_feel("you suddenly need to breathe!");
8936 hasmadeachange = 1;
8938 if (HMagical_breathing & TIMEOUT) {
8939 HMagical_breathing &= ~TIMEOUT;
8940 You_feel("you suddenly need to breathe!");
8941 hasmadeachange = 1;
8943 } else {
8944 if(!(HMagical_breathing & FROMOUTSIDE)) {
8945 You_feel("that you don't need to breathe any longer.");
8946 HMagical_breathing |= FROMOUTSIDE;
8947 hasmadeachange = 1;
8950 break;
8951 case 11:
8952 if (intloss) {
8953 if (HRegeneration & INTRINSIC) {
8954 HRegeneration &= ~INTRINSIC;
8955 You_feel("your wounds are healing slower!");
8956 hasmadeachange = 1;
8958 if (HRegeneration & TIMEOUT) {
8959 HRegeneration &= ~TIMEOUT;
8960 You_feel("your wounds are healing slower!");
8961 hasmadeachange = 1;
8963 } else {
8964 if(!(HRegeneration & FROMOUTSIDE)) {
8965 You_feel("your wounds healing more quickly.");
8966 HRegeneration |= FROMOUTSIDE;
8967 hasmadeachange = 1;
8970 break;
8971 case 12:
8972 if (intloss) {
8973 if (HEnergy_regeneration & INTRINSIC) {
8974 HEnergy_regeneration &= ~INTRINSIC;
8975 You_feel("a loss of mystic power!");
8976 hasmadeachange = 1;
8978 if (HEnergy_regeneration & TIMEOUT) {
8979 HEnergy_regeneration &= ~TIMEOUT;
8980 You_feel("a loss of mystic power!");
8981 hasmadeachange = 1;
8983 } else {
8984 if(!(HEnergy_regeneration & FROMOUTSIDE)) {
8985 HEnergy_regeneration |= FROMOUTSIDE;
8986 You_feel("a surge of mystic power.");
8987 hasmadeachange = 1;
8990 break;
8991 case 13:
8992 if (intloss) {
8993 if (HPolymorph & INTRINSIC) {
8994 HPolymorph &= ~INTRINSIC;
8995 You_feel("unable to change form!");
8996 hasmadeachange = 1;
8998 if (HPolymorph & TIMEOUT) {
8999 HPolymorph &= ~TIMEOUT;
9000 You_feel("unable to change form!");
9001 hasmadeachange = 1;
9003 } else {
9004 if(!(HPolymorph & FROMOUTSIDE)) {
9005 HPolymorph |= FROMOUTSIDE;
9006 You_feel("unstable.");
9007 hasmadeachange = 1;
9010 break;
9011 case 14:
9012 if (intloss) {
9013 if (HPolymorph_control & INTRINSIC) {
9014 HPolymorph_control &= ~INTRINSIC;
9015 You_feel("less control over your own body.");
9016 hasmadeachange = 1;
9018 if (HPolymorph_control & TIMEOUT) {
9019 HPolymorph_control &= ~TIMEOUT;
9020 You_feel("less control over your own body.");
9021 hasmadeachange = 1;
9023 } else {
9024 if(!(HPolymorph_control & FROMOUTSIDE)) {
9025 HPolymorph_control |= FROMOUTSIDE;
9026 You_feel("more control over your own body.");
9027 hasmadeachange = 1;
9030 break;
9031 case 15:
9032 if (intloss) {
9033 if (HHunger & INTRINSIC) {
9034 HHunger &= ~INTRINSIC;
9035 You_feel("like you just ate a chunk of meat.");
9036 hasmadeachange = 1;
9038 if (HHunger & TIMEOUT) {
9039 HHunger &= ~TIMEOUT;
9040 You_feel("like you just ate a chunk of meat.");
9041 hasmadeachange = 1;
9043 } else {
9044 if(!(HHunger & FROMOUTSIDE)) {
9045 HHunger |= FROMOUTSIDE;
9046 You_feel("very hungry.");
9047 hasmadeachange = 1;
9050 break;
9051 case 16:
9052 if (intloss) {
9053 if (HConflict & INTRINSIC) {
9054 HConflict &= ~INTRINSIC;
9055 You_feel("more acceptable.");
9056 hasmadeachange = 1;
9058 if (HConflict & TIMEOUT) {
9059 HConflict &= ~TIMEOUT;
9060 You_feel("more acceptable.");
9061 hasmadeachange = 1;
9063 } else {
9064 if(!(HConflict & FROMOUTSIDE)) {
9065 HConflict |= FROMOUTSIDE;
9066 You_feel("like a rabble-rouser.");
9067 hasmadeachange = 1;
9070 break;
9071 case 17:
9072 if (intloss) {
9073 if (HSlow_digestion & INTRINSIC) {
9074 HSlow_digestion &= ~INTRINSIC;
9075 You_feel("like you're burning calories faster.");
9076 hasmadeachange = 1;
9078 if (HSlow_digestion & TIMEOUT) {
9079 HSlow_digestion &= ~TIMEOUT;
9080 You_feel("like you're burning calories faster.");
9081 hasmadeachange = 1;
9083 } else {
9084 if(!(HSlow_digestion & FROMOUTSIDE)) {
9085 You_feel("constipated.");
9086 HSlow_digestion |= FROMOUTSIDE;
9087 hasmadeachange = 1;
9090 break;
9091 case 18:
9092 if (intloss) {
9093 if (HFlying & INTRINSIC) {
9094 HFlying &= ~INTRINSIC;
9095 You_feel("like you just lost your wings!");
9096 hasmadeachange = 1;
9098 if (HFlying & TIMEOUT) {
9099 HFlying &= ~TIMEOUT;
9100 You_feel("like you just lost your wings!");
9101 hasmadeachange = 1;
9103 } else {
9104 if(!(HFlying & FROMOUTSIDE)) {
9105 You_feel("airborne.");
9106 HFlying |= FROMOUTSIDE;
9107 hasmadeachange = 1;
9110 break;
9111 case 19:
9113 if (!rn2(200)) { /* passwall is teh uber pwnz0r and therefore rare */
9115 if (intloss) {
9116 if (HPasses_walls & INTRINSIC) {
9117 HPasses_walls &= ~INTRINSIC;
9118 You_feel("less ethereal!");
9119 hasmadeachange = 1;
9121 if (HPasses_walls & TIMEOUT) {
9122 HPasses_walls &= ~TIMEOUT;
9123 You_feel("less ethereal!");
9124 hasmadeachange = 1;
9126 } else {
9127 if(!(HPasses_walls & FROMOUTSIDE)) {
9128 You_feel("ethereal.");
9129 HPasses_walls |= FROMOUTSIDE;
9130 hasmadeachange = 1;
9133 } else {
9135 if (intloss) {
9136 if (HAntimagic & INTRINSIC) {
9137 HAntimagic &= ~INTRINSIC;
9138 You_feel("less protected from magic!");
9139 hasmadeachange = 1;
9141 if (HAntimagic & TIMEOUT) {
9142 HAntimagic &= ~TIMEOUT;
9143 You_feel("less protected from magic!");
9144 hasmadeachange = 1;
9146 } else {
9147 if(!(HAntimagic & FROMOUTSIDE)) {
9148 You_feel("magic-protected.");
9149 HAntimagic |= FROMOUTSIDE;
9150 hasmadeachange = 1;
9156 break;
9157 case 20:
9158 if (intloss) {
9159 if (HReflecting & INTRINSIC) {
9160 HReflecting &= ~INTRINSIC;
9161 You_feel("less reflexive!");
9162 hasmadeachange = 1;
9164 if (HReflecting & TIMEOUT) {
9165 HReflecting &= ~TIMEOUT;
9166 You_feel("less reflexive!");
9167 hasmadeachange = 1;
9169 } else {
9170 if(!(HReflecting & FROMOUTSIDE)) {
9171 You_feel("reflexive.");
9172 HReflecting |= FROMOUTSIDE;
9173 hasmadeachange = 1;
9176 break;
9177 case 21:
9178 if (intloss) {
9179 if (HSwimming & INTRINSIC) {
9180 HSwimming &= ~INTRINSIC;
9181 You_feel("less aquatic!");
9182 hasmadeachange = 1;
9184 if (HSwimming & TIMEOUT) {
9185 HSwimming &= ~TIMEOUT;
9186 You_feel("less aquatic!");
9187 hasmadeachange = 1;
9189 } else {
9190 if(!(HSwimming & FROMOUTSIDE)) {
9191 You_feel("aquatic.");
9192 HSwimming |= FROMOUTSIDE;
9193 hasmadeachange = 1;
9196 break;
9197 case 22:
9198 if (intloss) {
9199 if (HFree_action & INTRINSIC) {
9200 HFree_action &= ~INTRINSIC;
9201 You_feel("a loss of freedom!");
9202 hasmadeachange = 1;
9204 if (HFree_action & TIMEOUT) {
9205 HFree_action &= ~TIMEOUT;
9206 You_feel("a loss of freedom!");
9207 hasmadeachange = 1;
9209 } else {
9210 if(!(HFree_action & FROMOUTSIDE)) {
9211 You_feel("free.");
9212 HFree_action |= FROMOUTSIDE;
9213 hasmadeachange = 1;
9216 break;
9217 case 23:
9218 if (intloss) {
9219 if (HFear_resistance & INTRINSIC) {
9220 HFear_resistance &= ~INTRINSIC;
9221 You_feel("a little anxious!");
9222 hasmadeachange = 1;
9224 if (HFear_resistance & TIMEOUT) {
9225 HFear_resistance &= ~TIMEOUT;
9226 You_feel("a little anxious!");
9227 hasmadeachange = 1;
9229 } else {
9230 if(!(HFear_resistance & FROMOUTSIDE)) {
9231 You_feel("unafraid.");
9232 HFear_resistance |= FROMOUTSIDE;
9233 hasmadeachange = 1;
9236 break;
9237 case 24:
9238 if (intloss) {
9239 if (HKeen_memory & INTRINSIC) {
9240 HKeen_memory &= ~INTRINSIC;
9241 You_feel("a case of selective amnesia...");
9242 hasmadeachange = 1;
9244 if (HKeen_memory & TIMEOUT) {
9245 HKeen_memory &= ~TIMEOUT;
9246 You_feel("a case of selective amnesia...");
9247 hasmadeachange = 1;
9249 } else {
9250 if(!(HKeen_memory & FROMOUTSIDE)) {
9251 You_feel("capable of remembering everything.");
9252 HKeen_memory |= FROMOUTSIDE;
9253 hasmadeachange = 1;
9256 break;
9257 case 25:
9258 if (intloss) {
9259 if (HVersus_curses & INTRINSIC) {
9260 HVersus_curses &= ~INTRINSIC;
9261 You_feel("cursed!");
9262 hasmadeachange = 1;
9264 if (HVersus_curses & TIMEOUT) {
9265 HVersus_curses &= ~TIMEOUT;
9266 You_feel("cursed!");
9267 hasmadeachange = 1;
9269 } else {
9270 if(!(HVersus_curses & FROMOUTSIDE)) {
9271 You_feel("protected from curse words.");
9272 HVersus_curses |= FROMOUTSIDE;
9273 hasmadeachange = 1;
9276 break;
9277 case 26:
9278 if (intloss) {
9279 if (HStun_resist & INTRINSIC) {
9280 HStun_resist &= ~INTRINSIC;
9281 You_feel("a little stunned!");
9282 hasmadeachange = 1;
9284 if (HStun_resist & TIMEOUT) {
9285 HStun_resist &= ~TIMEOUT;
9286 You_feel("a little stunned!");
9287 hasmadeachange = 1;
9289 } else {
9290 if(!(HStun_resist & FROMOUTSIDE)) {
9291 You_feel("the ability to control stunning.");
9292 HStun_resist |= FROMOUTSIDE;
9293 hasmadeachange = 1;
9296 break;
9297 case 27:
9298 if (intloss) {
9299 if (HConf_resist & INTRINSIC) {
9300 HConf_resist &= ~INTRINSIC;
9301 You_feel("a little confused!");
9302 hasmadeachange = 1;
9304 if (HConf_resist & TIMEOUT) {
9305 HConf_resist &= ~TIMEOUT;
9306 You_feel("a little confused!");
9307 hasmadeachange = 1;
9309 } else {
9310 if(!(HConf_resist & FROMOUTSIDE)) {
9311 You_feel("capable of concentrating even while confused.");
9312 HConf_resist |= FROMOUTSIDE;
9313 hasmadeachange = 1;
9316 break;
9317 case 28:
9318 if (intloss) {
9319 if (HExtra_wpn_practice & INTRINSIC) {
9320 HExtra_wpn_practice &= ~INTRINSIC;
9321 You_feel("less able to learn new stuff!");
9322 hasmadeachange = 1;
9324 if (HExtra_wpn_practice & TIMEOUT) {
9325 HExtra_wpn_practice &= ~TIMEOUT;
9326 You_feel("less able to learn new stuff!");
9327 hasmadeachange = 1;
9329 } else {
9330 if(!(HExtra_wpn_practice & FROMOUTSIDE)) {
9331 You_feel("like a quick learner.");
9332 HExtra_wpn_practice |= FROMOUTSIDE;
9333 hasmadeachange = 1;
9336 break;
9337 case 29:
9338 if (intloss) {
9339 if (HDisplaced & INTRINSIC) {
9340 HDisplaced &= ~INTRINSIC;
9341 You_feel("a little exposed!");
9342 hasmadeachange = 1;
9344 if (HDisplaced & TIMEOUT) {
9345 HDisplaced &= ~TIMEOUT;
9346 You_feel("a little exposed!");
9347 hasmadeachange = 1;
9349 } else {
9350 if(!(HDisplaced & FROMOUTSIDE)) {
9351 You_feel("less exposed.");
9352 HDisplaced |= FROMOUTSIDE;
9353 hasmadeachange = 1;
9356 break;
9357 case 30:
9358 if (intloss) {
9359 if (HPsi_resist & INTRINSIC) {
9360 HPsi_resist &= ~INTRINSIC;
9361 You_feel("empty-minded!");
9362 hasmadeachange = 1;
9364 if (HPsi_resist & TIMEOUT) {
9365 HPsi_resist &= ~TIMEOUT;
9366 You_feel("empty-minded!");
9367 hasmadeachange = 1;
9369 } else {
9370 if(!(HPsi_resist & FROMOUTSIDE)) {
9371 You_feel("mentally strong.");
9372 HPsi_resist |= FROMOUTSIDE;
9373 hasmadeachange = 1;
9376 break;
9377 case 31:
9378 if (intloss) {
9379 if (HSight_bonus & INTRINSIC) {
9380 HSight_bonus &= ~INTRINSIC;
9381 You_feel("less perceptive!");
9382 hasmadeachange = 1;
9384 if (HSight_bonus & TIMEOUT) {
9385 HSight_bonus &= ~TIMEOUT;
9386 You_feel("less perceptive!");
9387 hasmadeachange = 1;
9389 } else {
9390 if(!(HSight_bonus & FROMOUTSIDE)) {
9391 You_feel("the presence of a globe of light.");
9392 HSight_bonus |= FROMOUTSIDE;
9393 hasmadeachange = 1;
9396 break;
9397 case 32:
9398 if (intloss) {
9399 if (HManaleech & INTRINSIC) {
9400 HManaleech &= ~INTRINSIC;
9401 You_feel("less magically attuned!");
9402 hasmadeachange = 1;
9404 if (HManaleech & TIMEOUT) {
9405 HManaleech &= ~TIMEOUT;
9406 You_feel("less magically attuned!");
9407 hasmadeachange = 1;
9409 } else {
9410 if(!(HManaleech & FROMOUTSIDE)) {
9411 You_feel("magically attuned.");
9412 HManaleech |= FROMOUTSIDE;
9413 hasmadeachange = 1;
9416 break;
9417 case 33:
9418 if (intloss) {
9419 if (HMap_amnesia & INTRINSIC) {
9420 HMap_amnesia &= ~INTRINSIC;
9421 You_feel("less forgetful!");
9422 hasmadeachange = 1;
9424 if (HMap_amnesia & TIMEOUT) {
9425 HMap_amnesia &= ~TIMEOUT;
9426 You_feel("less forgetful!");
9427 hasmadeachange = 1;
9429 } else {
9430 if(!(HMap_amnesia & FROMOUTSIDE)) {
9431 You_feel("very forgetful!");
9432 HMap_amnesia |= FROMOUTSIDE;
9433 hasmadeachange = 1;
9436 break;
9437 case 34:
9438 if (intloss) {
9439 if (HPeacevision & INTRINSIC) {
9440 HPeacevision &= ~INTRINSIC;
9441 You_feel("less peaceful!");
9442 hasmadeachange = 1;
9444 if (HPeacevision & TIMEOUT) {
9445 HPeacevision &= ~TIMEOUT;
9446 You_feel("less peaceful!");
9447 hasmadeachange = 1;
9449 } else {
9450 if(!(HPeacevision & FROMOUTSIDE)) {
9451 You_feel("a sense of peace.");
9452 HPeacevision |= FROMOUTSIDE;
9453 hasmadeachange = 1;
9456 break;
9457 case 35:
9458 if (intloss) {
9459 if (HCont_resist & INTRINSIC) {
9460 HCont_resist &= ~INTRINSIC;
9461 You_feel("less resistant to contamination!");
9462 hasmadeachange = 1;
9464 if (HCont_resist & TIMEOUT) {
9465 HCont_resist &= ~TIMEOUT;
9466 You_feel("less resistant to contamination!");
9467 hasmadeachange = 1;
9469 } else {
9470 if(!(HCont_resist & FROMOUTSIDE)) {
9471 You_feel("protected from contamination.");
9472 HCont_resist |= FROMOUTSIDE;
9473 hasmadeachange = 1;
9476 break;
9477 case 36:
9478 if (intloss) {
9479 if (HDiscount_action & INTRINSIC) {
9480 HDiscount_action &= ~INTRINSIC;
9481 You_feel("less resistant to paralysis!");
9482 hasmadeachange = 1;
9484 if (HDiscount_action & TIMEOUT) {
9485 HDiscount_action &= ~TIMEOUT;
9486 You_feel("less resistant to paralysis!");
9487 hasmadeachange = 1;
9489 } else {
9490 if(!(HDiscount_action & FROMOUTSIDE)) {
9491 You_feel("more resistant to paralysis!");
9492 HDiscount_action |= FROMOUTSIDE;
9493 hasmadeachange = 1;
9496 break;
9497 case 37:
9498 if (intloss) {
9499 if (HFull_nutrient & INTRINSIC) {
9500 HFull_nutrient &= ~INTRINSIC;
9501 You_feel("a hole in your %s!", body_part(STOMACH));
9502 hasmadeachange = 1;
9504 if (HFull_nutrient & TIMEOUT) {
9505 HFull_nutrient &= ~TIMEOUT;
9506 You_feel("a hole in your %s!", body_part(STOMACH));
9507 hasmadeachange = 1;
9509 } else {
9510 if(!(HFull_nutrient & FROMOUTSIDE)) {
9511 You_feel("that your %s is now rather full.", body_part(STOMACH));
9512 HFull_nutrient |= FROMOUTSIDE;
9513 hasmadeachange = 1;
9516 break;
9517 case 38:
9518 if (intloss) {
9519 if (HTechnicality & INTRINSIC) {
9520 HTechnicality &= ~INTRINSIC;
9521 You_feel("less capable of using your techniques...");
9522 hasmadeachange = 1;
9524 if (HTechnicality & TIMEOUT) {
9525 HTechnicality &= ~TIMEOUT;
9526 You_feel("less capable of using your techniques...");
9527 hasmadeachange = 1;
9529 } else {
9530 if(!(HTechnicality & FROMOUTSIDE)) {
9531 You_feel("that your techniques are more powerful now!");
9532 HTechnicality |= FROMOUTSIDE;
9533 hasmadeachange = 1;
9536 break;
9537 case 39:
9538 if (intloss) {
9539 if (HHalf_spell_damage & INTRINSIC) {
9540 HHalf_spell_damage &= ~INTRINSIC;
9541 You_feel("vulnerable to spells!");
9542 hasmadeachange = 1;
9544 if (HHalf_spell_damage & TIMEOUT) {
9545 HHalf_spell_damage &= ~TIMEOUT;
9546 You_feel("vulnerable to spells!");
9547 hasmadeachange = 1;
9549 } else {
9550 if(!(HHalf_spell_damage & FROMOUTSIDE)) {
9551 You_feel("protected from spells.");
9552 HHalf_spell_damage |= FROMOUTSIDE;
9553 hasmadeachange = 1;
9556 break;
9557 case 40:
9558 if (intloss) {
9559 if (HHalf_physical_damage & INTRINSIC) {
9560 HHalf_physical_damage &= ~INTRINSIC;
9561 You_feel("vulnerable to damage!");
9562 hasmadeachange = 1;
9564 if (HHalf_physical_damage & TIMEOUT) {
9565 HHalf_physical_damage &= ~TIMEOUT;
9566 You_feel("vulnerable to damage!");
9567 hasmadeachange = 1;
9569 } else {
9570 if(!(HHalf_physical_damage & FROMOUTSIDE)) {
9571 You_feel("protected from damage.");
9572 HHalf_physical_damage |= FROMOUTSIDE;
9573 hasmadeachange = 1;
9576 break;
9577 case 41:
9578 if (intloss) {
9579 if (HUseTheForce & INTRINSIC) {
9580 HUseTheForce &= ~INTRINSIC;
9581 You_feel("that you lost your jedi powers!");
9582 hasmadeachange = 1;
9584 if (HUseTheForce & TIMEOUT) {
9585 HUseTheForce &= ~TIMEOUT;
9586 You_feel("that you lost your jedi powers!");
9587 hasmadeachange = 1;
9589 } else {
9590 if(!(HUseTheForce & FROMOUTSIDE)) {
9591 You_feel("able to use the force like a true jedi!");
9592 HUseTheForce |= FROMOUTSIDE;
9593 hasmadeachange = 1;
9596 break;
9597 case 42:
9598 if (intloss) {
9599 if (HScentView & INTRINSIC) {
9600 HScentView &= ~INTRINSIC;
9601 You_feel("unable to smell things!");
9602 hasmadeachange = 1;
9604 if (HScentView & TIMEOUT) {
9605 HScentView &= ~TIMEOUT;
9606 You_feel("unable to smell things!");
9607 hasmadeachange = 1;
9609 } else {
9610 if(!(HScentView & FROMOUTSIDE)) {
9611 You_feel("a tingling in your %s!", body_part(NOSE));
9612 HScentView |= FROMOUTSIDE;
9613 hasmadeachange = 1;
9616 break;
9617 case 43:
9618 if (intloss) {
9619 if (HDiminishedBleeding & INTRINSIC) {
9620 HDiminishedBleeding &= ~INTRINSIC;
9621 You_feel("your %s coagulants failing!", body_part(BLOOD));
9622 hasmadeachange = 1;
9624 if (HDiminishedBleeding & TIMEOUT) {
9625 HDiminishedBleeding &= ~TIMEOUT;
9626 You_feel("your %s coagulants failing!", body_part(BLOOD));
9627 hasmadeachange = 1;
9629 } else {
9630 if(!(HDiminishedBleeding & FROMOUTSIDE)) {
9631 You_feel("a %s coagulation factor being injected into your body!", body_part(BLOOD));
9632 HDiminishedBleeding |= FROMOUTSIDE;
9633 hasmadeachange = 1;
9636 break;
9637 case 44:
9638 if (intloss) {
9639 if (HControlMagic & INTRINSIC) {
9640 HControlMagic &= ~INTRINSIC;
9641 You_feel("unable to control your magic!");
9642 hasmadeachange = 1;
9644 if (HControlMagic & TIMEOUT) {
9645 HControlMagic &= ~TIMEOUT;
9646 You_feel("unable to control your magic!");
9647 hasmadeachange = 1;
9649 } else {
9650 if(!(HControlMagic & FROMOUTSIDE)) {
9651 You_feel("magic-controlled!");
9652 HControlMagic |= FROMOUTSIDE;
9653 hasmadeachange = 1;
9656 break;
9657 case 45:
9658 if (intloss) {
9659 if (HExpBoost & INTRINSIC) {
9660 HExpBoost &= ~INTRINSIC;
9661 You_feel("a loss of experience!");
9662 hasmadeachange = 1;
9664 if (HExpBoost & TIMEOUT) {
9665 HExpBoost &= ~TIMEOUT;
9666 You_feel("a loss of experience!");
9667 hasmadeachange = 1;
9669 } else {
9670 if(!(HExpBoost & FROMOUTSIDE)) {
9671 You_feel("a surge of experience!");
9672 HExpBoost |= FROMOUTSIDE;
9673 hasmadeachange = 1;
9676 break;
9677 case 46:
9678 if (intloss) {
9679 if (HPainSense & INTRINSIC) {
9680 HPainSense &= ~INTRINSIC;
9681 You_feel("unable to sense pain!");
9682 hasmadeachange = 1;
9684 if (HPainSense & TIMEOUT) {
9685 HPainSense &= ~TIMEOUT;
9686 You_feel("unable to sense pain!");
9687 hasmadeachange = 1;
9689 } else {
9690 if(!(HPainSense & FROMOUTSIDE)) {
9691 You_feel("empathic!");
9692 HPainSense |= FROMOUTSIDE;
9693 hasmadeachange = 1;
9696 break;
9697 case 47:
9698 if (intloss) {
9699 if (HInvertedState & INTRINSIC) {
9700 HInvertedState &= ~INTRINSIC;
9701 You_feel("back on your %s!", makeplural(body_part(FOOT)));
9702 hasmadeachange = 1;
9704 if (HInvertedState & TIMEOUT) {
9705 HInvertedState &= ~TIMEOUT;
9706 You_feel("back on your %s!", makeplural(body_part(FOOT)));
9707 hasmadeachange = 1;
9709 } else {
9710 if(!(HInvertedState & FROMOUTSIDE)) {
9711 You_feel("inverted!");
9712 HInvertedState |= FROMOUTSIDE;
9713 hasmadeachange = 1;
9716 break;
9717 case 48:
9718 if (intloss) {
9719 if (HWinceState & INTRINSIC) {
9720 HWinceState &= ~INTRINSIC;
9721 You_feel("relieved!");
9722 hasmadeachange = 1;
9724 if (HWinceState & TIMEOUT) {
9725 HWinceState &= ~TIMEOUT;
9726 You_feel("relieved!");
9727 hasmadeachange = 1;
9729 } else {
9730 if(!(HWinceState & FROMOUTSIDE)) {
9731 You_feel("wimpy!");
9732 HWinceState |= FROMOUTSIDE;
9733 hasmadeachange = 1;
9736 break;
9737 case 49:
9738 if (intloss) {
9739 if (HDefusing & INTRINSIC) {
9740 HDefusing &= ~INTRINSIC;
9741 You_feel("unable to defuse traps!");
9742 hasmadeachange = 1;
9744 if (HDefusing & TIMEOUT) {
9745 HDefusing &= ~TIMEOUT;
9746 You_feel("unable to defuse traps!");
9747 hasmadeachange = 1;
9749 } else {
9750 if(!(HDefusing & FROMOUTSIDE)) {
9751 You_feel("knowledgable about the art of defusing traps!");
9752 HDefusing |= FROMOUTSIDE;
9753 hasmadeachange = 1;
9756 break;
9757 case 50:
9758 if (intloss) {
9759 if (HBurdenedState & INTRINSIC) {
9760 HBurdenedState &= ~INTRINSIC;
9761 You_feel("lighter");
9762 hasmadeachange = 1;
9764 if (HBurdenedState & TIMEOUT) {
9765 HBurdenedState &= ~TIMEOUT;
9766 You_feel("lighter");
9767 hasmadeachange = 1;
9769 } else {
9770 if(!(HBurdenedState & FROMOUTSIDE)) {
9771 You_feel("burdened");
9772 HBurdenedState |= FROMOUTSIDE;
9773 hasmadeachange = 1;
9776 break;
9777 case 51:
9778 if (intloss) {
9779 if (HMagicVacuum & INTRINSIC) {
9780 HMagicVacuum &= ~INTRINSIC;
9781 You_feel("capable of casting magic effectively again!");
9782 hasmadeachange = 1;
9784 if (HMagicVacuum & TIMEOUT) {
9785 HMagicVacuum &= ~TIMEOUT;
9786 You_feel("capable of casting magic effectively again!");
9787 hasmadeachange = 1;
9789 } else {
9790 if(!(HMagicVacuum & FROMOUTSIDE)) {
9791 You_feel("less capable of casting magic!");
9792 HMagicVacuum |= FROMOUTSIDE;
9793 hasmadeachange = 1;
9796 break;
9797 case 52:
9798 if (intloss) {
9799 if (HResistancePiercing & INTRINSIC) {
9800 HResistancePiercing &= ~INTRINSIC;
9801 You_feel("unable to damage immune opponents!");
9802 hasmadeachange = 1;
9804 if (HResistancePiercing & TIMEOUT) {
9805 HResistancePiercing &= ~TIMEOUT;
9806 You_feel("unable to damage immune opponents!");
9807 hasmadeachange = 1;
9809 } else {
9810 if(!(HResistancePiercing & FROMOUTSIDE)) {
9811 You_feel("capable of damaging immune opponents!");
9812 HResistancePiercing |= FROMOUTSIDE;
9813 hasmadeachange = 1;
9816 break;
9817 case 53:
9818 if (intloss) {
9819 if (HFuckOverEffect & INTRINSIC) {
9820 HFuckOverEffect &= ~INTRINSIC;
9821 You_feel("that you're no longer being fucked over!");
9822 hasmadeachange = 1;
9824 if (HFuckOverEffect & TIMEOUT) {
9825 HFuckOverEffect &= ~TIMEOUT;
9826 You_feel("that you're no longer being fucked over!");
9827 hasmadeachange = 1;
9829 } else {
9830 if(!(HFuckOverEffect & FROMOUTSIDE)) {
9831 You_feel("that you're being fucked over.");
9832 HFuckOverEffect |= FROMOUTSIDE;
9833 hasmadeachange = 1;
9836 break;
9837 case 54:
9838 if (intloss) {
9839 if (HMysteryResist & INTRINSIC) {
9840 HMysteryResist &= ~INTRINSIC;
9841 You_feel("less resistant to mystery attacks!");
9842 hasmadeachange = 1;
9844 if (HMysteryResist & TIMEOUT) {
9845 HMysteryResist &= ~TIMEOUT;
9846 You_feel("less resistant to mystery attacks!");
9847 hasmadeachange = 1;
9849 } else {
9850 if(!(HMysteryResist & FROMOUTSIDE)) {
9851 You_feel("resistant to mystery attacks!");
9852 HMysteryResist |= FROMOUTSIDE;
9853 hasmadeachange = 1;
9856 break;
9857 case 55:
9858 if (intloss) {
9859 if (HMagicFindBonus & INTRINSIC) {
9860 HMagicFindBonus &= ~INTRINSIC;
9861 You_feel("less likely to find magical items!");
9862 hasmadeachange = 1;
9864 if (HMagicFindBonus & TIMEOUT) {
9865 HMagicFindBonus &= ~TIMEOUT;
9866 You_feel("less likely to find magical items!");
9867 hasmadeachange = 1;
9869 } else {
9870 if(!(HMagicFindBonus & FROMOUTSIDE)) {
9871 You_feel("more likely to find magical items!");
9872 HMagicFindBonus |= FROMOUTSIDE;
9873 hasmadeachange = 1;
9876 break;
9877 case 56:
9878 if (intloss) {
9879 if (HSpellboost & INTRINSIC) {
9880 HSpellboost &= ~INTRINSIC;
9881 You_feel("your spell power waning!");
9882 hasmadeachange = 1;
9884 if (HSpellboost & TIMEOUT) {
9885 HSpellboost &= ~TIMEOUT;
9886 You_feel("your spell power waning!");
9887 hasmadeachange = 1;
9889 } else {
9890 if(!(HSpellboost & FROMOUTSIDE)) {
9891 You_feel("able to cast spells more powerfully!");
9892 HSpellboost |= FROMOUTSIDE;
9893 hasmadeachange = 1;
9896 break;
9897 default: /* shouldn't happen */
9898 break;
9902 if (!hasmadeachange) {
9903 tryct++;
9904 if (tryct < 100 && rn2(intloss ? 10 : 2)) goto retrytrinsic;
9909 #endif /* OVLB */
9911 /*artifact.c*/