annotate xrogue/effects.c @ 133:e6179860cb76

Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
author John "Elwin" Edwards
date Tue, 21 Apr 2015 08:55:20 -0400
parents
children ce0cf824c192
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
133
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
1 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
2 effects.c - functions for dealing with appllying effects to monsters
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
3
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
4 XRogue: Expeditions into the Dungeons of Doom
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
5 Copyright (C) 1991 Robert Pietkivitch
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
6 All rights reserved.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
7
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
8 Based on "Advanced Rogue"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
9 Copyright (C) 1984, 1985 Michael Morgan, Ken Dalka and AT&T
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
10 All rights reserved.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
11
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
12 Based on "Rogue: Exploring the Dungeons of Doom"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
13 Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
14 All rights reserved.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
15
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
16 See the file LICENSE.TXT for full copyright and licensing information.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
17 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
18
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
19 #include <curses.h>
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
20 #include "rogue.h"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
21
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
22 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
23 * effect:
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
24 * Check for effects of one thing hitting another thing. Return
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
25 * the reason code if the defender is killed. Otherwise return 0.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
26 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
27
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
28 effect(att, def, weap, thrown, see_att, see_def)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
29 register struct thing *att, *def;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
30 struct object *weap;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
31 bool thrown;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
32 register bool see_att, see_def;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
33 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
34 register bool att_player, def_player;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
35 char attname[LINELEN+1], defname[LINELEN+1];
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
36
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
37 /* See if the attacker or defender is the player */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
38 att_player = (att == &player);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
39 def_player = (def == &player);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
40
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
41 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
42 * If the player could see the attacker or defender, they can't
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
43 * surprise anymore (don't bother checking if they could).
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
44 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
45 if (see_att) turn_off(*att, CANSURPRISE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
46 if (see_def) turn_off(*def, CANSURPRISE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
47
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
48 /* What are the attacker and defender names? */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
49 if (att_player) strcpy(attname, "you");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
50 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
51 if (see_att) strcpy(attname, monster_name(att));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
52 else strcpy(attname, "something");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
53 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
54
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
55 if (def_player) strcpy(defname, "you");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
56 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
57 if (see_def) strcpy(defname, monster_name(def));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
58 else strcpy(defname, "something");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
59 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
60
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
61 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
62 * See what happens to the attacker first. We can skip this
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
63 * whole section, however, if the defender is the player.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
64 * Nothing happens (yet) to anyone just for hitting the player.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
65 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
66 if (!def_player) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
67 if (!thrown) { /* Some things require a direct hit. */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
68 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
69 * If the attacker hits a rusting monster, The weapon
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
70 * may be damaged
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
71 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
72 if (on(*def, CANRUST) && weap &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
73 weap->o_type != RELIC && (weap->o_flags & ISMETAL) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
74 !(weap->o_flags & ISPROT)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
75 if ((weap->o_hplus < 1 && weap->o_dplus < 1) ||
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
76 roll(1,20) < weap->o_hplus+weap->o_dplus+10) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
77 if (rnd(100) < 50) weap->o_hplus--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
78 else weap->o_dplus--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
79 if (att_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
80 msg(terse ? "Your %s weakens!"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
81 : "Your %s gets weaker!",
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
82 weaps[weap->o_which].w_name);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
83 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
84 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
85 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
86
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
87 /* If the attacker hit something that shrieks, wake the dungeon */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
88 if (on(*def, CANSHRIEK)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
89 if (see_def)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
90 msg("%s emits an ear piercing shriek! ", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
91 else
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
92 msg("You hear an ear piercing shriek!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
93
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
94 /* Friendly charactors should be immune */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
95 if (player.t_ctype == C_PALADIN ||
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
96 player.t_ctype == C_RANGER || player.t_ctype == C_MONK)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
97 aggravate(TRUE, FALSE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
98 else
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
99 aggravate(TRUE, TRUE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
100 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
101
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
102 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
103 * does the creature explode when hit?
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
104 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
105 if (on(*def, CANEXPLODE)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
106 if (see_def) msg("%s explodes!", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
107 else msg("You hear a tremendous explosion!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
108 explode(def);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
109 if (pstats.s_hpt < 1) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
110 pstats.s_hpt = -1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
111 death(def->t_index);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
112 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
113 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
114 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
115
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
116 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
117 * Now let's see what happens to the defender. Start out with
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
118 * the things that everyone can do. Then exit if the attacker
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
119 * is the player.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
120 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
121 if (!thrown) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
122 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
123 * Can the player confuse?
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
124 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
125 if (on(*att, CANHUH) && att_player) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
126 msg("Your hands return to normal. ");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
127 if (off(*def, ISCLEAR) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
128 (off(*def, ISUNIQUE) || !save(VS_MAGIC, def, 0))) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
129 if (see_def) msg("%s appears confused!", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
130 turn_on(*def, ISHUH);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
131 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
132 turn_off(*att, CANHUH);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
133 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
134
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
135 /* Return now if the attacker is the player. */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
136 if (att_player) return(0);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
137
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
138 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
139 * Some monsters may take half your hit points
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
140 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
141 if (on(*att, CANSUCK) && !save(VS_MAGIC, def, 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
142 if (def->t_stats.s_hpt == 1) return(att->t_index); /* Killed! */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
143 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
144 def->t_stats.s_hpt /= 2;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
145 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
146 msg("Your life force is being drained out of you.");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
147 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
148 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
149
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
150 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
151 * If a hugging monster hits, it may SQUEEEEEEEZE.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
152 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
153 if (on(*att, CANHUG)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
154 if (roll(1,20) >= 18 || roll(1,20) >= 18) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
155 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
156 msg("%s squeezes itself nastily against you!",
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
157 prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
158 else if (see_att)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
159 msg("%s squeezes real hard!", prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
160
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
161 if ((def->t_stats.s_hpt -= roll(2,8)) <= 0)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
162 return(att->t_index);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
163 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
164 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
165
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
166 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
167 * Some monsters have poisonous bites.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
168 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
169 if (on(*att, CANPOISON) && !save(VS_POISON, def, 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
170 if (def_player) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
171 if (ISWEARING(R_SUSABILITY))
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
172 msg(terse ? "Sting has no effect."
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
173 : "A sting momentarily weakens your arm.");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
174 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
175 chg_str(-1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
176 msg(terse ? "A sting has weakened you." :
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
177 "You get stung in the arm! You feel weaker. ");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
178 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
179 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
180 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
181 /* Subtract a strength point and see if it kills it */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
182 if (--def->t_stats.s_str <= 0) return(D_STRENGTH);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
183 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
184 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
185
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
186 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
187 * Turning to stone:
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
188 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
189 if (on(*att, TOUCHSTONE)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
190 if (def_player) turn_off(*att, TOUCHSTONE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
191 if (on(*def, CANINWALL)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
192 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
193 msg("%s's touch has no effect.", prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
194 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
195 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
196 if (!save(VS_PETRIFICATION, def, 0) && rnd(100) < 10) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
197 if (def_player) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
198 msg("Your body begins to solidify.. ");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
199 msg("You are transformed into stone!! --More--");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
200 wait_for(' ');
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
201 return(D_PETRIFY);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
202 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
203 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
204 /* The monster got stoned! */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
205 turn_on(*def, ISSTONE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
206 turn_off(*def, ISRUN);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
207 turn_off(*def, ISINVIS);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
208 turn_off(*def, ISDISGUISE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
209 if (def->t_stats.s_intel > 15)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
210 msg("%s staggers.. ", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
211 else if (see_def)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
212 msg("%s turns to stone! ", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
213 else if (cansee(unc(def->t_pos)))
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
214 msg("A statue appears out of nowhere! ");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
215 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
216 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
217 else if (def->t_action != A_FREEZE) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
218 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
219 msg("%s's touch stiffens your limbs.",
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
220 prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
221 else if (see_def)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
222 msg("%s appears to freeze over.", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
223
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
224 def->t_no_move += movement(def) * STONETIME;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
225 def->t_action = A_FREEZE;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
226 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
227 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
228 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
229
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
230 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
231 * Wraiths might drain energy levels
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
232 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
233 if ((on(*att, CANDRAIN) || on(*att, DOUBLEDRAIN)) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
234 !save(VS_POISON, def, 3-(att->t_stats.s_lvl/5))) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
235 if (def_player) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
236 lower_level(att->t_index);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
237 if (on(*att, DOUBLEDRAIN)) lower_level(att->t_index);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
238 turn_on(*att, DIDDRAIN);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
239 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
240 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
241 def->t_stats.s_hpt -= roll(1, 8);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
242 def->t_stats.s_lvl--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
243 if (on(*att, DOUBLEDRAIN)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
244 def->t_stats.s_hpt -= roll(1, 8);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
245 def->t_stats.s_lvl--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
246 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
247 if (see_def)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
248 msg("%s appears less skillful.", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
249
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
250 /* Did it kill it? */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
251 if (def->t_stats.s_hpt <= 0 ||
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
252 def->t_stats.s_lvl <= 0)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
253 return(att->t_index);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
254 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
255 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
256
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
257 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
258 * Paralyzation:
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
259 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
260 if (on(*att, CANPARALYZE) && def->t_action != A_FREEZE) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
261 if (def_player) turn_off(*att, CANPARALYZE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
262 if (!save(VS_PARALYZATION, def, 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
263 if (on(*def, CANINWALL)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
264 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
265 msg("%s's touch has no effect.", prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
266 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
267 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
268 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
269 msg("%s's touch paralyzes you.", prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
270 else if (see_def)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
271 msg("%s appears to freeze over!", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
272
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
273 def->t_no_move += movement(def) * FREEZETIME;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
274 def->t_action = A_FREEZE;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
275 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
276 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
277 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
278
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
279 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
280 * Painful wounds make the defendant faint
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
281 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
282 if (on(*att, CANPAIN) && def->t_action != A_FREEZE) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
283 if (def_player) turn_off(*att, CANPAIN);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
284 if (!ISWEARING(R_ALERT) && !save(VS_POISON, def, 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
285 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
286 msg("You faint from the painful wound!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
287 else if (see_def)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
288 msg("%s appears to faint!", prname(defname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
289
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
290 def->t_no_move += movement(def) * PAINTIME;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
291 def->t_action = A_FREEZE;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
292 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
293 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
294
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
295 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
296 * Some things currently affect only the player. Let's make
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
297 * a check here so we don't have to check for each thing.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
298 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
299 if (def_player) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
300 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
301 * Stinking monsters make the defender weaker (to hit). For now
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
302 * this will only affect the player. We may later add the HASSTINK
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
303 * effect to monsters, too.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
304 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
305 if (on(*att, CANSTINK)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
306 turn_off(*att, CANSTINK);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
307 if (!save(VS_POISON, def, 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
308 msg("The stench of %s sickens you. Blech!",
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
309 prname(attname, FALSE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
310 if (on(player, HASSTINK)) lengthen(unstink, STINKTIME);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
311 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
312 turn_on(player, HASSTINK);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
313 fuse(unstink, (VOID *)NULL, STINKTIME, AFTER);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
314 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
315 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
316 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
317
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
318 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
319 * Chilling monster reduces strength each time. This only
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
320 * affects the player for now because of its temporary nature.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
321 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
322 if (on(*att, CANCHILL)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
323 if (!ISWEARING(R_SUSABILITY) && !save(VS_POISON, def, 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
324 msg("You cringe at %s's chilling touch.",
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
325 prname(attname, FALSE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
326 chg_str(-1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
327 if (lost_str++ == 0)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
328 fuse(res_strength, (VOID *)NULL, CHILLTIME, AFTER);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
329 else lengthen(res_strength, CHILLTIME);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
330 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
331 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
332
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
333 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
334 * Itching monsters reduce dexterity (temporarily). This only
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
335 * affects the player for now because of its temporary nature.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
336 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
337 if (on(*att, CANITCH) && !save(VS_POISON, def, 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
338 msg("The claws of %s scratch you!", prname(attname, FALSE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
339 if (ISWEARING(R_SUSABILITY)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
340 msg("The scratch has no effect.");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
341 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
342 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
343 (*add_abil[A_DEXTERITY])(-1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
344 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
345 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
346
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
347 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
348 * If a disease-carrying monster hits, there is a chance the
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
349 * defender will catch the disease. This only applies to the
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
350 * player for now because of the temporary nature. Don't affect
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
351 * the Ranger or Paladin.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
352 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
353 if (on(*att, CANDISEASE) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
354 (rnd(def->t_stats.s_const) < att->t_stats.s_lvl) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
355 off(*def, HASDISEASE)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
356 if (ISWEARING(R_HEALTH) ||
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
357 player.t_ctype == C_PALADIN ||
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
358 player.t_ctype == C_RANGER) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
359 msg("The wound heals quickly.");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
360 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
361 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
362 turn_on(*def, HASDISEASE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
363 fuse(cure_disease, (VOID *)NULL, roll(HEALTIME,SICKTIME), AFTER);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
364 msg(terse ? "You have been diseased!"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
365 : "You have contracted an annoying disease!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
366 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
367 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
368
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
369 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
370 * If a rusting monster hits, you lose armor. This only applies to
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
371 * the player because monsters don't wear armor (for now).
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
372 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
373 if (on(*att, CANRUST)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
374 if (cur_armor != NULL &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
375 cur_armor->o_which != LEATHER &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
376 cur_armor->o_which != STUDDED_LEATHER &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
377 cur_armor->o_which != PADDED_ARMOR &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
378 !(cur_armor->o_flags & ISPROT) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
379 cur_armor->o_ac < def->t_stats.s_arm+1) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
380 msg(terse ? "Your armor weakens."
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
381 : "Your armor becomes weaker.");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
382 cur_armor->o_ac++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
383 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
384 if (cur_misc[WEAR_BRACERS] != NULL &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
385 cur_misc[WEAR_BRACERS]->o_ac > 0 &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
386 !(cur_misc[WEAR_BRACERS]->o_flags & ISPROT)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
387 cur_misc[WEAR_BRACERS]->o_ac--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
388 if (cur_misc[WEAR_BRACERS]->o_ac == 0) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
389 register struct linked_list *item;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
390
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
391 for (item=pack; item!=NULL; item=next(item)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
392 if (OBJPTR(item) == cur_misc[WEAR_BRACERS]) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
393 detach(pack, item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
394 o_discard(item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
395 break;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
396 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
397 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
398 msg ("Your bracers crumble apart!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
399 cur_misc[WEAR_BRACERS] = NULL;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
400 inpack--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
401 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
402 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
403 msg("Your bracers weaken!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
404 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
405 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
406 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
407
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
408 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
409 * If can dissolve and hero has leather type armor. This
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
410 * also only applies to the player for now because of the
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
411 * armor.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
412 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
413 if (on(*att, CANDISSOLVE) && cur_armor != NULL &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
414 (cur_armor->o_which == LEATHER ||
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
415 cur_armor->o_which == STUDDED_LEATHER ||
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
416 cur_armor->o_which == PADDED_ARMOR) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
417 !(cur_armor->o_flags & ISPROT) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
418 cur_armor->o_ac < def->t_stats.s_arm+1) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
419 msg(terse ? "Your armor dissolves!"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
420 : "Your armor appears to have dissolved!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
421 cur_armor->o_ac++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
422 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
423
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
424 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
425 * If an infesting monster hits you, you get a parasite or rot.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
426 * This will only affect the player until we figure out how to
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
427 * make it affect monsters. Don't affect the Monk.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
428 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
429 if (on(*att, CANINFEST) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
430 rnd(def->t_stats.s_const) < att->t_stats.s_lvl) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
431 if (ISWEARING(R_HEALTH) || player.t_ctype == C_MONK) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
432 msg("The wound heals quickly.");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
433 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
434 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
435 turn_off(*att, CANINFEST);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
436 msg(terse ? "You have been infested."
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
437 : "You have contracted a parasitic infestation!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
438 infest_dam++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
439 turn_on(*def, HASINFEST);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
440 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
441 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
442
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
443 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
444 * Does it take wisdom away? This currently affects only
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
445 * the player because of its temporary nature.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
446 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
447 if (on(*att, TAKEWISDOM) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
448 !save(VS_MAGIC, def, 0) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
449 !ISWEARING(R_SUSABILITY)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
450 (*add_abil[A_WISDOM])(-1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
451 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
452
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
453 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
454 * Does it take intelligence away? This currently affects
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
455 * only the player because of its temporary nature.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
456 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
457 if (on(*att, TAKEINTEL) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
458 !save(VS_MAGIC, &player, 0) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
459 !ISWEARING(R_SUSABILITY)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
460 (*add_abil[A_INTELLIGENCE])(-1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
461 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
462
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
463 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
464 * Cause fear by touching. This currently affects only
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
465 * the player until we figure out how we want it to
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
466 * affect monsters.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
467 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
468 if (on(*att, TOUCHFEAR)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
469 turn_off(*att, TOUCHFEAR);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
470 if (!ISWEARING(R_HEROISM) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
471 !save(VS_WAND, def, 0) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
472 !(on(*def, ISFLEE) && (def->t_dest == &att->t_pos))) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
473 turn_on(*def, ISFLEE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
474 def->t_dest = &att->t_pos;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
475 msg("%s's touch terrifies you!", prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
476
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
477 /* It is okay to turn tail */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
478 if (!def_player) def->t_oldpos = def->t_pos;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
479 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
480 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
481
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
482 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
483 * Make the hero dance (as in otto's irresistable dance)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
484 * This should be fairly easy to do to monsters, but
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
485 * we'll restrict it to players until we decide what to
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
486 * do about the temporary nature.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
487 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
488 if (on(*att, CANDANCE) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
489 !on(*def, ISDANCE) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
490 def->t_action != A_FREEZE &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
491 !save(VS_MAGIC, def, -4)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
492 turn_off(*att, CANDANCE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
493 turn_on(*def, ISDANCE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
494 msg("You begin to dance uncontrollably!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
495 fuse(undance, (VOID *)NULL, roll(2,4), AFTER);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
496 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
497
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
498 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
499 * Suffocating our hero. Monsters don't get suffocated.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
500 * That's too hard for now.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
501 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
502 if (on(*att, CANSUFFOCATE) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
503 !ISWEARING(R_FREEDOM) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
504 rnd(100) < 30 &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
505 (find_slot(suffocate) == 0)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
506 turn_on(*att, DIDSUFFOCATE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
507 msg("%s is beginning to suffocate you!", prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
508 fuse(suffocate, (VOID *)NULL, roll(9,3), AFTER);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
509 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
510
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
511 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
512 * some creatures stops the poor guy from moving.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
513 * How can we do this to a monster?
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
514 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
515 if (on(*att,CANHOLD) && off(*att,DIDHOLD) && !ISWEARING(R_FREEDOM)){
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
516 turn_on(*def, ISHELD);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
517 turn_on(*att, DIDHOLD);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
518 hold_count++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
519 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
520
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
521 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
522 * Sucker will suck blood and run. This
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
523 * should be easy to have happen to a monster,
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
524 * but we have to decide how to handle the fleeing.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
525 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
526 if (on(*att, CANDRAW)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
527 turn_off(*att, CANDRAW);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
528 turn_on(*att, ISFLEE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
529 msg("%s sates itself with your blood!", prname(attname, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
530 if ((def->t_stats.s_hpt -= 12) <= 0) return(att->t_index);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
531
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
532 /* It is okay to turn tail */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
533 att->t_oldpos = att->t_pos;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
534 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
535
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
536 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
537 * Bad smell will force a reduction in strength.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
538 * This will happen only to the player because of
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
539 * the temporary nature.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
540 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
541 if (on(*att, CANSMELL)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
542 turn_off(*att, CANSMELL);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
543 if (save(VS_MAGIC, def, 0) || ISWEARING(R_SUSABILITY)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
544 if (terse)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
545 msg("Pheww!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
546 else
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
547 msg("You smell an unpleasant odor. Phew!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
548 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
549
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
550 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
551 int odor_str = -(rnd(6)+1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
552
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
553 msg("You are overcome by a foul odor!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
554 if (lost_str == 0) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
555 chg_str(odor_str);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
556 fuse(res_strength, (VOID *)NULL, SMELLTIME, AFTER);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
557 lost_str -= odor_str;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
558 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
559 else lengthen(res_strength, SMELLTIME);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
560 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
561 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
562
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
563 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
564 * The monsters touch slows the defendant down.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
565 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
566 if (on(*att, TOUCHSLOW)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
567 turn_off(*att, TOUCHSLOW);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
568 if (!save(VS_PARALYZATION, def, 0))
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
569 add_slow();
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
570 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
571
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
572 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
573 * Rotting only affects the player. Don't affect the Monk,
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
574 * Paladin, or Ranger.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
575 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
576 if (on(*att, CANROT)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
577 if (!ISWEARING(R_HEALTH) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
578 player.t_ctype != C_MONK &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
579 player.t_ctype != C_RANGER &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
580 player.t_ctype != C_PALADIN &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
581 !save(VS_POISON, def, 0) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
582 off(*def, DOROT)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
583 turn_on(*def, DOROT);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
584 msg("You feel your skin starting to rot and peel away!");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
585 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
586 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
587
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
588 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
589 * Monsters should be able to steal gold from anyone,
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
590 * but until this is rewritten, they will only steal
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
591 * from the player (tough break).
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
592 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
593 if (on(*att, STEALGOLD)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
594 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
595 * steal some gold
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
596 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
597 register long lastpurse;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
598 register struct linked_list *item;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
599 register struct object *obj;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
600
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
601 lastpurse = purse;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
602 purse -= (GOLDCALC * 2);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
603 if (!save(VS_MAGIC, def, att->t_stats.s_lvl/10)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
604 if (on(*att, ISUNIQUE))
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
605 purse -= (GOLDCALC * 5);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
606 else
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
607 purse -= (GOLDCALC * 3);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
608 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
609 if (purse < 0)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
610 purse = 0;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
611 if (purse != lastpurse) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
612 msg("You lost some gold! ");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
613
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
614 /* Give the gold to the thief */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
615 for (item=att->t_pack; item != NULL; item=next(item)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
616 obj = OBJPTR(item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
617 if (obj->o_type == GOLD) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
618 obj->o_count += lastpurse - purse;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
619 break;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
620 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
621 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
622
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
623 /* Did we do it? */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
624 if (item == NULL) { /* Then make some */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
625 item = new_item(sizeof *obj);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
626 obj = OBJPTR(item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
627 obj->o_type = GOLD;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
628 obj->o_count = lastpurse - purse;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
629 obj->o_hplus = obj->o_dplus = 0;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
630 strcpy(obj->o_damage,"0d0");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
631 strcpy(obj->o_hurldmg,"0d0");
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
632 obj->o_ac = 11;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
633 obj->contents = NULL;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
634 obj->o_group = 0;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
635 obj->o_flags = 0;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
636 obj->o_mark[0] = '\0';
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
637 obj->o_pos = att->t_pos;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
638
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
639 attach(att->t_pack, item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
640 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
641 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
642
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
643 turn_on(*att, ISFLEE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
644 turn_on(*att, ISINVIS);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
645
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
646 /* It is okay to turn tail */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
647 att->t_oldpos = att->t_pos;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
648 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
649 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
650
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
651 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
652 * Stealing happens last since the monster disappears
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
653 * after the act.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
654 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
655 if (on(*att, STEALMAGIC)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
656 register struct linked_list *list, *steal;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
657 register struct object *obj;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
658 register int nobj;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
659
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
660 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
661 * steal a magic item, look through the pack
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
662 * and pick out one we like.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
663 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
664 steal = NULL;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
665 for (nobj = 0, list = def->t_pack; list != NULL; list = next(list))
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
666 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
667 obj = OBJPTR(list);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
668 if (!is_current(obj) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
669 list != def->t_using &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
670 obj->o_type != RELIC &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
671 is_magic(obj) &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
672 rnd(++nobj) == 0)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
673 steal = list;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
674 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
675 if (steal != NULL)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
676 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
677 register struct object *obj;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
678 struct linked_list *item;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
679
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
680 obj = OBJPTR(steal);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
681 if (on(*att, ISUNIQUE))
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
682 monsters[att->t_index].m_normal = TRUE;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
683 item = find_mons(att->t_pos.y, att->t_pos.x);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
684
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
685 killed(item, FALSE, FALSE, FALSE); /* Remove the attacker */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
686
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
687 if (obj->o_count > 1 && obj->o_group == 0) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
688 register int oc;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
689
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
690 oc = --(obj->o_count);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
691 obj->o_count = 1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
692 if (def_player)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
693 msg("%s stole %s!", prname(attname, TRUE),
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
694 inv_name(obj, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
695 obj->o_count = oc;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
696 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
697 else {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
698 if (def_player) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
699 msg("%s stole %s!", prname(attname, TRUE),
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
700 inv_name(obj, TRUE));
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
701
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
702 /* If this is a relic, clear its holding field */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
703 if (obj->o_type == RELIC)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
704 cur_relic[obj->o_which] = 0;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
705
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
706 inpack--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
707 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
708
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
709 detach(def->t_pack, steal);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
710 o_discard(steal);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
711 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
712
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
713 updpack(FALSE, def);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
714 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
715 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
716 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
717
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
718 /* Didn't kill the defender */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
719 return(0);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
720 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
721