Mercurial > hg > early-roguelike
comparison arogue5/sticks.c @ 63:0ed67132cf10
Import Advanced Rogue 5.8 from the Roguelike Restoration Project (r1490)
| author | elwin |
|---|---|
| date | Thu, 09 Aug 2012 22:58:48 +0000 |
| parents | |
| children | c49f7927b0fa |
comparison
equal
deleted
inserted
replaced
| 62:0ef99244acb8 | 63:0ed67132cf10 |
|---|---|
| 1 /* | |
| 2 * Functions to implement the various sticks one might find | |
| 3 * while wandering around the dungeon. | |
| 4 * | |
| 5 * Advanced Rogue | |
| 6 * Copyright (C) 1984, 1985 Michael Morgan, Ken Dalka and AT&T | |
| 7 * All rights reserved. | |
| 8 * | |
| 9 * Based on "Rogue: Exploring the Dungeons of Doom" | |
| 10 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman | |
| 11 * All rights reserved. | |
| 12 * | |
| 13 * See the file LICENSE.TXT for full copyright and licensing information. | |
| 14 */ | |
| 15 | |
| 16 #include "curses.h" | |
| 17 #include <ctype.h> | |
| 18 #include "rogue.h" | |
| 19 | |
| 20 | |
| 21 /* | |
| 22 * zap a stick and see what happens | |
| 23 */ | |
| 24 do_zap(gotdir, which, flag) | |
| 25 bool gotdir; | |
| 26 int which; | |
| 27 int flag; | |
| 28 { | |
| 29 register struct linked_list *item; | |
| 30 register struct object *obj = NULL; | |
| 31 register struct thing *tp; | |
| 32 register int y, x; | |
| 33 struct linked_list *nitem; | |
| 34 struct object *nobj; | |
| 35 bool cursed, blessed, is_stick; | |
| 36 | |
| 37 blessed = FALSE; | |
| 38 cursed = FALSE; | |
| 39 is_stick = FALSE; | |
| 40 | |
| 41 if (which == 0) { | |
| 42 if ((item = get_item(pack, "zap with", ZAPPABLE)) == NULL) | |
| 43 return(FALSE); | |
| 44 obj = OBJPTR(item); | |
| 45 | |
| 46 /* Handle relics specially here */ | |
| 47 if (obj->o_type == RELIC) { | |
| 48 switch (obj->o_which) { | |
| 49 case ORCUS_WAND: | |
| 50 msg(nothing); | |
| 51 return(TRUE); | |
| 52 when MING_STAFF: | |
| 53 which = WS_MISSILE; | |
| 54 when ASMO_ROD: | |
| 55 switch (rnd(3)) { | |
| 56 case 0: | |
| 57 which = WS_ELECT; | |
| 58 when 1: | |
| 59 which = WS_COLD; | |
| 60 otherwise: | |
| 61 which = WS_FIRE; | |
| 62 } | |
| 63 } | |
| 64 cursed = FALSE; | |
| 65 blessed = FALSE; | |
| 66 } | |
| 67 else { | |
| 68 which = obj->o_which; | |
| 69 ws_know[which] = TRUE; | |
| 70 cursed = (obj->o_flags & ISCURSED) != 0; | |
| 71 blessed = (obj->o_flags & ISBLESSED) != 0; | |
| 72 is_stick = TRUE; | |
| 73 } | |
| 74 } | |
| 75 else { | |
| 76 cursed = flag & ISCURSED; | |
| 77 blessed = flag & ISBLESSED; | |
