… | |
… | |
162 | } |
162 | } |
163 | |
163 | |
164 | int |
164 | int |
165 | move_disease (object *disease) |
165 | move_disease (object *disease) |
166 | { |
166 | { |
167 | /* first task is to determine if the disease is inside or outside of someone. |
167 | /* First task is to determine if the disease is inside or outside of someone. |
168 | * If outside, we decrement 'value' until we're gone. |
168 | * If outside, we decrement 'value' until we're gone. |
169 | */ |
169 | */ |
170 | |
170 | |
171 | if (!disease->env) |
171 | if (!disease->env) |
172 | { /* we're outside of someone */ |
172 | { /* we're outside of someone */ |
173 | if (disease->stats.maxhp > 0) |
173 | if (disease->stats.maxhp > 0) |
174 | disease->value--; |
174 | disease->value--; |
175 | |
175 | |
176 | if (!disease->value) |
176 | if (!disease->value) |
177 | { |
177 | { |
178 | disease->destroy (); |
178 | disease->destroy (true); |
179 | return 1; |
179 | return 1; |
180 | } |
180 | } |
181 | } |
181 | } |
182 | else |
182 | else |
183 | { |
183 | { |
… | |
… | |
189 | |
189 | |
190 | if (!disease->stats.food) |
190 | if (!disease->stats.food) |
191 | { |
191 | { |
192 | remove_symptoms (disease); /* remove the symptoms of this disease */ |
192 | remove_symptoms (disease); /* remove the symptoms of this disease */ |
193 | grant_immunity (disease); |
193 | grant_immunity (disease); |
194 | disease->destroy (); |
194 | disease->destroy (true); |
195 | return 1; |
195 | return 1; |
196 | } |
196 | } |
197 | } |
197 | } |
198 | } |
198 | } |
199 | |
199 | |
… | |
… | |
221 | while ((symptom = find_symptom (disease)) != NULL) |
221 | while ((symptom = find_symptom (disease)) != NULL) |
222 | { |
222 | { |
223 | if (!victim) |
223 | if (!victim) |
224 | victim = symptom->env; |
224 | victim = symptom->env; |
225 | |
225 | |
226 | symptom->destroy (); |
226 | symptom->destroy (true); |
227 | } |
227 | } |
228 | |
228 | |
229 | if (victim) |
229 | if (victim) |
230 | victim->update_stats (); |
230 | victim->update_stats (); |
231 | |
231 | |
… | |
… | |
535 | object *new_ob; |
535 | object *new_ob; |
536 | int sp_reduce; |
536 | int sp_reduce; |
537 | |
537 | |
538 | if (!victim || !victim->map) |
538 | if (!victim || !victim->map) |
539 | { /* outside a monster/player, die immediately */ |
539 | { /* outside a monster/player, die immediately */ |
540 | symptom->destroy (); |
540 | symptom->destroy (true); |
541 | return 0; |
541 | return 0; |
542 | } |
542 | } |
543 | |
543 | |
544 | if (symptom->stats.dam > 0) |
544 | if (symptom->stats.dam > 0) |
545 | hit_player (victim, symptom->stats.dam, symptom, symptom->attacktype, 1); |
545 | hit_player (victim, symptom->stats.dam, symptom, symptom->attacktype, 1); |
… | |
… | |
627 | cure = 1; |
627 | cure = 1; |
628 | |
628 | |
629 | if (caster && spell) |
629 | if (caster && spell) |
630 | change_exp (caster, disease->stats.exp, spell->skill, SK_EXP_SKILL_ONLY); |
630 | change_exp (caster, disease->stats.exp, spell->skill, SK_EXP_SKILL_ONLY); |
631 | |
631 | |
632 | disease->destroy (); |
632 | disease->destroy (true); |
633 | } |
633 | } |
634 | } |
634 | } |
635 | } |
635 | } |
636 | |
636 | |
637 | if (cure) |
637 | if (cure) |