1 /* omega copyright (C) 1987,1988,1989 by Laurence Raphael Brothers */
2 /* item.c */
3 
4 #include "glob.h"
5 
6 /* make a random new object, returning pointer */
create_object(itemlevel)7 pob create_object(itemlevel)
8 int itemlevel;
9 {
10   pob new;
11   int  r;
12   int ok = FALSE;
13 
14   while (! ok) {
15     new = ((pob) checkmalloc(sizeof(objtype)));
16     r= random_range(135);
17     if (r < 20) make_thing(new,-1);
18     else if (r < 40) make_food(new,-1);
19     else if (r < 50) make_scroll(new,-1);
20     else if (r < 60) make_potion(new,-1);
21     else if (r < 70) make_weapon(new,-1);
22     else if (r < 80) make_armor(new,-1);
23     else if (r < 90) make_shield(new,-1);
24     else if (r < 100) make_stick(new,-1);
25     else if (r < 110) make_boots(new,-1);
26     else if (r < 120) make_cloak(new,-1);
27     else if (r < 130) make_ring(new,-1);
28     else make_artifact(new,-1);
29     /* not ok if object is too good for level, or if unique and already made */
30     /* 1/100 chance of finding object if too good for level */
31     ok = ((new->uniqueness < UNIQUE_MADE) &&
32 	  ((new->level < itemlevel+random_range(3))
33 	   || (random_range(100)==23)));
34     if (!ok)
35     {
36 	free((char *) new);
37     }
38   }
39   if (new->uniqueness == UNIQUE_UNMADE)
40     Objects[new->id].uniqueness=UNIQUE_MADE;
41   return(new);
42 }
43 
make_cash(new,level)44 void make_cash(new,level)
45 pob new;
46 int level;
47 {
48   *new = Objects[CASHID];
49   new->basevalue = random_range(level*level+10)+1; /* aux is AU value */
50   new->objstr = cashstr();
51   new->cursestr = new->truename = new->objstr;
52 }
53 
make_food(new,id)54 void make_food(new,id)
55 pob new;
56 int id;
57 {
58   if (id == -1) id = random_range(NUMFOODS);
59   *new = Objects[FOODID+id];
60 }
61 
62 
make_corpse(new,m)63 void make_corpse(new,m)
64 pob new;
65 struct monster *m;
66 {
67   *new = Objects[CORPSEID];
68   new->charge = m->id;
69   new->weight = m->corpseweight;
70   new->basevalue = m->corpsevalue;
71   new->known = 2;
72   new->objstr = m->corpsestr;
73   new->truename = new->cursestr = new->objstr;
74 /* DG I_CANNIBAL not implemented... fall through to code in I_CORPSE */
75 #if 0 /* WDT HACK, of course -- we need to implement I_CANNIBAL. */
76   if ((m->monchar&0xff) == '@')
77     new->usef = I_CANNIBAL;
78   else
79 #endif
80   if (m_statusp(m,EDIBLE)) {
81     new->usef = I_FOOD;
82     new->aux = 6;
83   }
84   else if (m_statusp(m,POISONOUS))
85     new->usef = I_POISON_FOOD;
86   /* Special corpse-eating effects */
87   else switch(m->id) {
88   case TSETSE: /*tse tse fly */
89   case TORPOR: /*torpor beast */
90     new->usef = I_SLEEP_SELF;
91     break;
92   case NASTY:
93     new->usef = I_INVISIBLE;
94     break;
95   case BLIPPER:
96     new->usef = I_TELEPORT;
97     break;
98   case EYE: /* floating eye -- it's traditional.... */
99     new->usef = I_CLAIRVOYANCE;
100     break;
101   case FUZZY: /*astral fuzzy */
102     new->usef = I_DISPLACE;
103     break;
104   case SERV_LAW:
105     new->usef = I_CHAOS;
106     break;
107   case SERV_CHAOS:
108     new->usef = I_LAW;
109     break;
110   case ASTRAL_VAMP: /* astral vampire */
111     new->usef = I_ENCHANT;
112     break;
113   case MANABURST:
114     new->usef = I_SPELLS;
115     break;
116   case RAKSHASA:
117     new->usef = I_TRUESIGHT;
118     break;
119 /* DG fall through to code in I_CORPSE and special case there */
120 #if 0 /* WDT HACK? */
121   case BEHEMOTH:
122     new->usef = I_HEAL;
123     break;
124   case UNICORN:
125     new->usef = I_NEUTRALIZE_POISON;
126     break;
127 #endif
128   case COMA: /*coma beast */
129     new->usef = I_ALERT;
130     break;
131 /* DG I_INEDIBLE not implemented... fall through to code in I_CORPSE */
132 #if 0 /* WDT HACK: yawn. */
133   default:
134     new->usef = I_INEDIBLE;
135     break;
136 #endif
137   }
138 }
139 
140 
141 
142 
make_ring(new,id)143 void make_ring(new,id)
144 pob new;
145 int id;
146 {
147   if (id == -1) id = random_range(NUMRINGS);
148   *new = Objects[RINGID+id];
149   if (new->blessing == 0) new->blessing = itemblessing();
150   if (new->plus == 0) new->plus = itemplus()+1;
151   if (new->blessing < 0) new->plus = -1 - abs(new->plus);
152 }
153 
make_thing(new,id)154 void make_thing(new,id)
155 pob new;
156 int id;
157 {
158   if (id == -1) id = random_range(NUMTHINGS);
159   *new = Objects[THINGID+id];
160   if (strcmp(new->objstr,"grot") == 0) {
161     new->objstr = grotname();
162     new->truename = new->cursestr = new->objstr;
163   }
164 }
165 
166 
make_scroll(new,id)167 void make_scroll(new,id)
168 pob new;
169 int id;
170 {
171   if (id == -1) id = random_range(NUMSCROLLS);
172   *new = Objects[SCROLLID+id];
173   /* if a scroll of spells, aux is the spell id in Spells */
174   if (new->id == SCROLLID+1) {
175     new->aux = random_range(NUMSPELLS);
176   }
177 }
178 
make_potion(new,id)179 void make_potion(new,id)
180 pob new;
181 int id;
182 {
183   if (id == -1) id = random_range(NUMPOTIONS);
184   *new = Objects[POTIONID+id];
185   if (new->plus == 0) new->plus = itemplus();
186 }
187 
make_weapon(new,id)188 void make_weapon(new,id)
189 pob new;
190 int id;
191 {
192   if (id == -1) id = random_range(NUMWEAPONS);
193   *new = Objects[WEAPONID+id];
194   if ((id == 28) || (id == 29)) /* bolt or arrow */
195     new->number = random_range(20)+1;
196   if (new->blessing == 0) new->blessing = itemblessing();
197   if (new->plus == 0) {
198     new->plus = itemplus();
199     if (new->blessing < 0)
200       new->plus = -1 - abs(new->plus);
201     else if (new->blessing > 0)
202       new->plus = 1 + abs(new->plus);
203   }
204 }
205 
make_shield(new,id)206 void make_shield(new,id)
207 pob new;
208 int id;
209 {
210   if (id == -1) id = random_range(NUMSHIELDS);
211   *new = Objects[SHIELDID+id];
212   if (new->plus == 0)
213     new->plus = itemplus();
214   if (new->blessing == 0) new->blessing = itemblessing();
215   if (new->blessing < 0)
216     new->plus = -1 - abs(new->plus);
217   else if (new->blessing > 0)
218     new->plus = 1 + abs(new->plus);
219 }
220 
make_armor(new,id)221 void make_armor(new,id)
222 pob new;
223 int id;
224 {
225   if (id == -1) id = random_range(NUMARMOR);
226   *new = Objects[ARMORID+id];
227   if (new->plus == 0) new->plus = itemplus();
228   if (new->blessing == 0) new->blessing = itemblessing();
229   if (new->blessing < 0)
230     new->plus = -1 - abs(new->plus);
231   else if (new->blessing > 0)
232     new->plus = 1 + abs(new->plus);
233 }
234 
make_cloak(new,id)235 void make_cloak(new,id)
236 pob new;
237 int id;
238 {
239   if (id == -1) id = random_range(NUMCLOAKS);
240   Objects[CLOAKID+4].plus = 2;
241   *new = Objects[CLOAKID+id];
242   if (new->blessing == 0) new->blessing = itemblessing();
243 }
244 
make_boots(new,id)245 void make_boots(new,id)
246 pob new;
247 int id;
248 {
249   if (id == -1) id = random_range(NUMBOOTS);
250   *new = Objects[BOOTID+id];
251   if (new->blessing == 0) new->blessing = itemblessing();
252 }
253 
make_stick(new,id)254 void make_stick(new,id)
255 pob new;
256 int id;
257 {
258   if (id == -1) id = random_range(NUMSTICKS);
259   *new = Objects[STICKID+id];
260   new->charge = itemcharge();
261   if (new->blessing == 0) new->blessing = itemblessing();
262 }
263 
make_artifact(new,id)264 void make_artifact(new,id)
265 pob new;
266 int id;
267 {
268   if (id == -1)
269     do
270       id = random_range(NUMARTIFACTS);
271     while (Objects[id].uniqueness >= UNIQUE_MADE);
272   *new = Objects[ARTIFACTID+id];
273 }
274 
275 
276 /* this function is used to shuffle the id numbers of scrolls, potions, etc */
277 /* taken from Knuth 2 */
shuffle(ids,number)278 void shuffle(ids, number)
279 int ids[];
280 int number;
281 {
282   int top, swap, with;
283 
284   for (top = 0; top < number; top++)
285     ids[top] = top;
286   for (top = number - 1; top >= 0; top--) {
287     swap = ids[top];
288     with = random_range(top + 1);	/* from  0 to top, inclusive */
289     ids[top] = ids[with];
290     ids[with] = swap;
291   }
292 }
293 
294 /* item name functions */
295 
scrollname(id)296 char *scrollname(id)
297 int id;
298 {
299   switch(scroll_ids[id]) {
300       case 0: return "scroll-GRISTOGRUE";
301       case 1: return "scroll-Kho Reck Tighp";
302       case 2: return "scroll-E Z";
303       case 3: return "scroll-Kevitz";
304       case 4: return "scroll-Arcanum Prime";
305       case 5: return "scroll-NYARLATHOTEP";
306       case 6: return "scroll-Gilthoniel";
307       case 7: return "scroll-Zarathustra";
308       case 8: return "scroll-Ancient Lore";
309       case 9: return "scroll-Eyes Only";
310       case 10: return "scroll-Ambogar Empheltz";
311       case 11: return "scroll-Isengard";
312       case 12: return "scroll-Deosil Widdershins";
313       case 13: return "scroll-Magister Paracelsus";
314       case 14: return "scroll-Qlipphotic Summons";
315       case 15: return "scroll-Aratron Samael";
316       case 16: return "scroll-De Wormiis Mysterius";
317       case 17: return "scroll-Necronomicon";
318       case 18: return "scroll-Pnakotic Manuscript";
319       case 19: return "scroll-Codex of Xalimar";
320       case 20: return "scroll-The Mabinogion";
321       case 21: return "scroll-Ginseng Shiatsu";
322       case 22: return "scroll-Tome of Tromax";
323       case 23: return "scroll-Book of the Dead ";
324       case 24: return "scroll-The Flame Tongue";
325       case 25: return "scroll-Karst Khogar";
326       case 26: return "scroll-The Yellow Sign";
327       case 27: return "scroll-The Kevillist Manifesto";
328       case 28: return "scroll-Goshtar Script";
329       default:
330       case 29: return "scroll-Pendragon Encryption";
331     }
332 }
333 
grotname()334 char *grotname()
335 {
336   switch(random_range(20)) {
337     case 0: return "pot lid";
338     case 1: return "mound of offal";
339     case 2: return "sword that was broken";
340     case 3: return "salted snail";
341     case 4: return "key";
342     case 5: return "toadstool";
343     case 6: return "greenish spindle";
344     case 7: return "tin soldier";
345     case 8: return "broken yo-yo";
346     case 9: return "NYC subway map";
347     case 10: return "Nixon's the One! button";
348     case 11: return "beer can (empty)";
349     case 12: return "golden bejewelled falcon";
350     case 13: return "hamster cage";
351     case 14: return "wooden nickel";
352     case 15: return "three-dollar bill";
353     case 16: return "rosebud";
354     case 17: return "water pistol";
355     case 18: return "shattered skull";
356     default:
357     case 19: return "jawbone of an ass";
358   }
359 }
360 
361 
362 
363 
potionname(id)364 char *potionname(id)
365 int id;
366 {
367   switch (potion_ids[id]) {
368     case 0: return "vial of dewy liquid";
369     case 1: return "jug of tarry black substance";
370     case 2: return "flask of cold smoking froth";
371     case 3: return "phial of glowing fluid";
372     case 4: return "bottle of sickening slime";
373     case 5: return "sac of greenish gel";
374     case 6: return "wineskin of odorous goo";
375     case 7: return "canteen of sweet sap";
376     case 8: return "urn of clear fluid";
377     case 9: return "clotted grey ooze";
378     case 10: return "keg of bubbly golden fluid";
379     case 11: return "tube of minty paste";
380     case 12: return "pitcher of aromatic liquid";
381     case 13: return "pot of rancid grease";
382     case 14: return "thermos of hot black liquid";
383     case 15: return "magnum of deep red liquid";
384     case 16: return "vase full of ichor";
385     case 17: return "container of white cream";
386     case 18: return "syringe of clear fluid";
387     default:
388     case 19: return "can of volatile essence";
389   }
390 }
391 
392 
stickname(id)393 char *stickname(id)
394 int id;
395 {
396   switch (stick_ids[id]) {
397     case 0: return "oaken staff";
398     case 1: return "heavy metal rod";
399     case 2: return "shaft of congealed light";
400     case 3: return "slender ceramic wand";
401     case 4: return "rune-inscribed bone wand";
402     case 5: return "knurly staff";
403     case 6: return "steel knobbed rod";
404     case 7: return "lucite wand";
405     case 8: return "sturdy alpenstock";
406     case 9: return "gem-studded ebony staff";
407     case 10: return "chromed sequinned staff";
408     case 11: return "old peeling stick";
409     case 12: return "jointed metal rod";
410     case 13: return "wand with lead ferrules";
411     case 14: return "forked wooden stick";
412     case 15: return "cane with gold eagle handle";
413     case 16: return "crystalline wand";
414     case 17: return "metal stick with trigger";
415     case 18: return "leather-handled stone rod";
416     default:
417     case 19: return "tiny mithril wand";
418   }
419 }
420 
ringname(id)421 char *ringname(id)
422 int id;
423 {
424   switch (ring_ids[id]) {
425     case 0: return "gold ring with a blue gem";
426     case 1: return "brass ring";
427     case 2: return "mithril ring with a red gem";
428     case 3: return "platinum ring";  break;
429     case 4: return "gold dragon's head ring";
430     case 5: return "bronze ring";
431     case 6: return "aardvark seal ring";
432     case 7: return "grey metal ring";
433     case 8: return "silver skull ring";
434     case 9: return "onyx ring";
435     case 10: return "Collegium Magii class ring";
436     case 11: return "worn stone ring";
437     case 12: return "diorite ring";
438     case 13: return "ancient scarab ring";  break;
439     case 14: return "plastic charm ring";
440     case 15: return "soapy gypsum ring";
441     case 16: return "glass ring";
442     case 17: return "glowing bluestone ring";
443     case 18: return "ring with eye sigil";
444     default:
445     case 19: return "zirconium ring";
446   }
447 }
448 
449 
cloakname(id)450 char *cloakname(id)
451 int id;
452 {
453   switch (cloak_ids[id]) {
454     case 0: return "tattered piece of cloth";
455     case 1: return "fuligin cloak";
456     case 2: return "chintz cloak";
457     case 3: return "diaphanous cape";  break;
458     case 4: return "red half-cloak";
459     case 5: return "mouse-hide cloak";
460     case 6: return "kelly green cloak";
461     case 7: return "cloth-of-gold cloak";
462     case 8: return "dirty old cloak";
463     case 9: return "weightless cloak";
464     case 10: return "boat cloak";
465     case 11: return "greasy tarpaulin";
466     case 12: return "sable cloak";
467     case 13: return "soft velvet cloak";  break;
468     case 14: return "opera cape";
469     case 15: return "elegant brocade cloak";
470     case 16: return "cloak of many colors";
471     case 17: return "grey-green rag";
472     case 18: return "puce and chartreuse cloak";
473     default:
474     case 19: return "smoky cloak";
475   }
476 }
477 
bootname(id)478 char *bootname(id)
479 int id;
480 {
481   switch (boot_ids[id]) {
482     case 0: return "sturdy leather boots";
483     case 1: return "calf-length moccasins";
484     case 2: return "dark-colored tabi";
485     case 3: return "patent-leather shoes";  break;
486     case 4: return "beaten-up gumshoes";
487     case 5: return "alligator-hide boots";
488     case 6: return "comfortable sandals";
489     case 7: return "roller skates";
490     case 8: return "purple suede gaiters";
491     case 9: return "mirror-plated wingtips";
492     case 10: return "heavy workboots";
493     case 11: return "polyurethane-soled sneakers";
494     case 12: return "clodhoppers";
495     case 13: return "wooden shoes";  break;
496     case 14: return "ski boots";
497     case 15: return "hob-nailed boots";
498     case 16: return "elven boots";
499     case 17: return "cowboy boots";
500     case 18: return "flipflop slippers";
501     default:
502     case 19: return "riding boots";
503   }
504 }
505 
itemplus()506 int itemplus()
507 {
508   int p = 0;
509 
510   while (random_range(2) == 0)
511     p++;
512   return(p);
513 }
514 
515 
516 
itemcharge()517 int itemcharge()
518 {
519   return(random_range(20)+1);
520 }
521 
522 
523 
itemblessing()524 int itemblessing()
525 {
526   switch(random_range(10)) {
527     case 0:
528     case 1:return(-1-random_range(10));
529     case 8:
530     case 9:return(1+random_range(10));
531     default: return(0);
532   }
533 }
534 
535 
twohandedp(id)536 int twohandedp(id)
537 int id;
538 {
539   switch(id) {
540   case WEAPONID+5:
541   case WEAPONID+12:
542   case WEAPONID+18:
543   case WEAPONID+20:
544   case WEAPONID+26:
545   case WEAPONID+27:
546   case WEAPONID+32:
547   case WEAPONID+36:
548   case WEAPONID+38:
549   case WEAPONID+39:
550     return(TRUE);
551   default: return(FALSE);
552   }
553 }
554 
555 
item_use(o)556 void item_use(o)
557 struct object *o;
558 {
559   clearmsg();
560   switch(o->usef) {
561     case -1:i_no_op(o); break;
562     case 0:i_nothing(o); break;
563 
564     /* scrolls */
565     case I_SPELLS: i_spells(o); break;
566     case I_BLESS: i_bless(o); break;
567     case I_ACQUIRE: i_acquire(o); break;
568     case I_ENCHANT: i_enchant(o); break;
569     case I_TELEPORT: i_teleport(o); break;
570     case I_WISH: i_wish(o); break;
571     case I_CLAIRVOYANCE: i_clairvoyance(o); break;
572     case I_DISPLACE: i_displace(o); break;
573     case I_ID: i_id(o); break;
574     case I_JANE_T: i_jane_t(o); break;
575     case I_FLUX: i_flux(o); break;
576     case I_WARP: i_warp(o); break;
577     case I_ALERT: i_alert(o); break;
578     case I_CHARGE: i_charge(o); break;
579     case I_KNOWLEDGE: i_knowledge(o); break;
580     case I_LAW: i_law(o); break;
581     case I_HINT: hint(); break;
582     case I_HERO: i_hero(o); break;
583     case I_TRUESIGHT: i_truesight(o); break;
584     case I_ILLUMINATE: i_illuminate(o); break;
585     case I_DEFLECT: i_deflect(o); break;
586 
587     /* potion functions */
588     case I_HEAL: i_heal(o); break;
589     case I_OBJDET: i_objdet(o); break;
590     case I_MONDET: i_mondet(o); break;
591     case I_SLEEP_SELF: i_sleep_self(o); break;
592     case I_NEUTRALIZE_POISON: i_neutralize_poison(o); break;
593     case I_RESTORE: i_restore(o); break;
594     case I_SPEED: i_speed(o); break;
595     case I_AZOTH: i_azoth(o); break;
596     case I_AUGMENT: i_augment(o); break;
597     case I_REGENERATE: i_regenerate(o); break;
598     case I_INVISIBLE: i_invisible(o); break;
599     case I_BREATHING: i_breathing(o); break;
600     case I_FEAR_RESIST: i_fear_resist(o); break;
601     case I_CHAOS: i_chaos(o); break;
602     case I_ACCURACY: i_accuracy(o); break;
603     case I_LEVITATION: i_levitate(o); break;
604     case I_CURE: i_cure(o); break;
605 
606     /* stick functions */
607     case I_FIREBOLT: i_firebolt(o); break;
608     case I_LBOLT: i_lbolt(o); break;
609     case I_MISSILE: i_missile(o); break;
610     case I_SLEEP_OTHER: i_sleep_other(o); break;
611     case I_FIREBALL: i_fireball(o); break;
612     case I_LBALL: i_lball(o); break;
613     case I_SNOWBALL: i_snowball(o); break;
614     case I_SUMMON: i_summon(o); break;
615     case I_HIDE: i_hide(o); break;
616     case I_DISRUPT: i_disrupt(o); break;
617     case I_DISINTEGRATE: i_disintegrate(o); break;
618     case I_APPORT: i_apport(o); break;
619     case I_DISPEL: i_dispel(o); break;
620     case I_POLYMORPH: i_polymorph(o); break;
621     case I_FEAR:i_fear(o); break;
622 
623     /* food functions */
624     case I_FOOD: i_food(o); break;
625     case I_LEMBAS: i_lembas(o); break;
626     case I_STIM: i_stim(o); break;
627     case I_POW: i_pow(o); break;
628     case I_IMMUNE: i_immune(o); break;
629     case I_POISON_FOOD: i_poison_food(o); break;
630     case I_CORPSE: i_corpse(o); break;
631     case I_PEPPER_FOOD: i_pepper_food(o); break;
632 
633     /* boots functions */
634     case I_PERM_SPEED: i_perm_speed(o); break;
635     case I_PERM_HERO: i_perm_hero(o); break;
636     case I_PERM_LEVITATE: i_perm_levitate(o); break;
637     case I_PERM_AGILITY: i_perm_agility(o); break;
638 
639     /* artifact functions */
640     case I_SCEPTRE:i_sceptre(o);break;
641     case I_PLANES:i_planes(o);break;
642     case I_STARGEM:i_stargem(o);break;
643     case I_SYMBOL:i_symbol(o); break;
644     case I_ORBMASTERY: i_orbmastery(o); break;
645     case I_ORBFIRE: i_orbfire(o); break;
646     case I_ORBWATER: i_orbwater(o); break;
647     case I_ORBEARTH: i_orbearth(o); break;
648     case I_ORBAIR: i_orbair(o); break;
649     case I_ORBDEAD: i_orbdead(o); break;
650     case I_CRYSTAL: i_crystal(o); break;
651     case I_LIFE: i_life(o); break;
652     case I_DEATH: i_death(o); break;
653     case I_ANTIOCH: i_antioch(o); break;
654     case I_HELM: i_helm(o); break;
655     case I_KOLWYNIA: i_kolwynia(o); break;
656     case I_ENCHANTMENT: i_enchantment(o); break;
657     case I_JUGGERNAUT: i_juggernaut(o); break;
658 
659     /* cloak functions */
660     case I_PERM_DISPLACE: i_perm_displace(o); break;
661     case I_PERM_NEGIMMUNE: i_perm_negimmune(o); break;
662     case I_PERM_INVISIBLE: i_perm_invisible(o); break;
663     case I_PERM_PROTECTION: i_perm_protection(o);break;
664     case I_PERM_ACCURACY: i_perm_accuracy(o);break;
665     case I_PERM_TRUESIGHT: i_perm_truesight(o); break;
666 
667     /* ring functions */
668     case I_PERM_BURDEN: i_perm_burden(o); break;
669     case I_PERM_STRENGTH: i_perm_strength(o); break;
670     case I_PERM_GAZE_IMMUNE: i_perm_gaze_immune(o); break;
671     case I_PERM_FIRE_RESIST: i_perm_fire_resist(o); break;
672     case I_PERM_POISON_RESIST: i_perm_poison_resist(o); break;
673     case I_PERM_REGENERATE: i_perm_regenerate(o); break;
674     case I_PERM_KNOWLEDGE: i_perm_knowledge(o); break;
675 
676     /* armor functions */
677     case I_NORMAL_ARMOR: i_normal_armor(o); break;
678     case I_PERM_FEAR_RESIST: i_perm_fear_resist(o); break;
679     case I_PERM_ENERGY_RESIST: i_perm_energy_resist(o); break;
680     case I_PERM_BREATHING: i_perm_breathing(o); break;
681 
682     /* weapons functions */
683     case I_NORMAL_WEAPON: i_normal_weapon(o); break;
684     case I_LIGHTSABRE: i_lightsabre(o); break;
685     case I_DEMONBLADE: i_demonblade(o); break;
686     case I_DESECRATE: i_desecrate(o); break;
687     case I_MACE_DISRUPT: i_mace_disrupt(o); break;
688     case I_DEFEND: i_defend(o); break;
689     case I_VICTRIX: i_victrix(o); break;
690 
691     /* thing functions */
692     case I_PICK: i_pick(o); break;
693     case I_KEY: i_key(o); break;
694     case I_PERM_ILLUMINATE: i_perm_illuminate(o); break;
695     case I_TRAP: i_trap(o); break;
696     case I_RAISE_PORTCULLIS:i_raise_portcullis(o); break;
697 
698     /* shield functions */
699     case I_NORMAL_SHIELD: i_normal_shield(o); break;
700     case I_PERM_DEFLECT: i_perm_deflect(o); break;
701 #ifdef DEBUG /* WDT: good idea, DG.  I'll be using this often, I predict! */
702     /* looking for objects without, or with unimplemented, functions */
703     default:
704        fprintf(DG_debug_log, "tried to use a %s with o->usef %d\n",
705                itemid(o), o->usef);
706        break;
707 #endif
708   }
709 }
710 
711