… | |
… | |
126 | |
126 | |
127 | |
127 | |
128 | #include <global.h> |
128 | #include <global.h> |
129 | #include <object.h> |
129 | #include <object.h> |
130 | #include <living.h> |
130 | #include <living.h> |
131 | #ifndef __CEXTRACT__ |
|
|
132 | # include <sproto.h> |
131 | #include <sproto.h> |
133 | #endif |
|
|
134 | #include <spells.h> |
132 | #include <spells.h> |
135 | #include <sounds.h> |
133 | #include <sounds.h> |
136 | #include <skills.h> |
134 | #include <skills.h> |
137 | |
135 | |
138 | /* IMPLEMENTATION NOTES |
136 | /* IMPLEMENTATION NOTES |
… | |
… | |
226 | |
224 | |
227 | symptom->destroy (); |
225 | symptom->destroy (); |
228 | } |
226 | } |
229 | |
227 | |
230 | if (victim) |
228 | if (victim) |
231 | fix_player (victim); |
229 | victim->update_stats (); |
232 | return 0; |
230 | return 0; |
233 | } |
231 | } |
234 | |
232 | |
235 | /* argument is a disease */ |
233 | /* argument is a disease */ |
236 | object * |
234 | object * |
… | |
… | |
276 | { |
274 | { |
277 | sint16 i2, j2; |
275 | sint16 i2, j2; |
278 | mflags = get_map_flags (map, &map2, i, j, &i2, &j2); |
276 | mflags = get_map_flags (map, &map2, i, j, &i2, &j2); |
279 | |
277 | |
280 | if (!(mflags & P_OUT_OF_MAP) && (mflags & P_IS_ALIVE)) |
278 | if (!(mflags & P_OUT_OF_MAP) && (mflags & P_IS_ALIVE)) |
281 | for (tmp = get_map_ob (map2, i2, j2); tmp; tmp = tmp->above) |
279 | for (tmp = GET_MAP_OB (map2, i2, j2); tmp; tmp = tmp->above) |
282 | infect_object (tmp, disease, 0); |
280 | infect_object (tmp, disease, 0); |
283 | } |
281 | } |
284 | |
282 | |
285 | return 1; |
283 | return 1; |
286 | } |
284 | } |
… | |
… | |
342 | |
340 | |
343 | /* Unfortunately, set_owner does the wrong thing to the skills pointers |
341 | /* Unfortunately, set_owner does the wrong thing to the skills pointers |
344 | * resulting in exp going into the owners *current* chosen skill. |
342 | * resulting in exp going into the owners *current* chosen skill. |
345 | */ |
343 | */ |
346 | |
344 | |
347 | if (get_owner (disease)) |
345 | if (disease->owner) |
348 | { |
346 | { |
349 | set_owner (new_disease, disease->owner); |
347 | new_disease->set_owner (disease->owner); |
350 | |
348 | |
351 | /* Only need to update skill if different */ |
349 | /* Only need to update skill if different */ |
352 | if (new_disease->skill != disease->skill) |
350 | if (new_disease->skill != disease->skill) |
353 | new_disease->skill = disease->skill; |
351 | new_disease->skill = disease->skill; |
354 | } |
352 | } |
… | |
… | |
356 | { /* for diseases which are passed by hitting, set owner and praying skill */ |
354 | { /* for diseases which are passed by hitting, set owner and praying skill */ |
357 | if (disease->env && disease->env->type == PLAYER) |
355 | if (disease->env && disease->env->type == PLAYER) |
358 | { |
356 | { |
359 | object *player = disease->env; |
357 | object *player = disease->env; |
360 | |
358 | |
361 | set_owner (new_disease, player); |
359 | new_disease->set_owner (player); |
362 | |
360 | |
363 | /* the skill pointer for these diseases should already be set up - |
361 | /* the skill pointer for these diseases should already be set up - |
364 | * hardcoding in 'praying' is not the right approach. |
362 | * hardcoding in 'praying' is not the right approach. |
365 | */ |
363 | */ |
366 | } |
364 | } |
… | |
… | |
484 | new_symptom->stats.hp = disease->stats.hp; |
482 | new_symptom->stats.hp = disease->stats.hp; |
485 | new_symptom->msg = disease->msg; |
483 | new_symptom->msg = disease->msg; |
486 | new_symptom->attacktype = disease->attacktype; |
484 | new_symptom->attacktype = disease->attacktype; |
487 | new_symptom->other_arch = disease->other_arch; |
485 | new_symptom->other_arch = disease->other_arch; |
488 | |
486 | |
489 | set_owner (new_symptom, disease->owner); |
487 | new_symptom->set_owner (disease->owner); |
490 | |
488 | |
491 | if (new_symptom->skill != disease->skill) |
489 | if (new_symptom->skill != disease->skill) |
492 | new_symptom->skill = disease->skill; |
490 | new_symptom->skill = disease->skill; |
493 | |
491 | |
494 | new_symptom->move_block = 0; |
492 | new_symptom->move_block = 0; |
… | |
… | |
524 | symptom->msg = disease->msg; |
522 | symptom->msg = disease->msg; |
525 | symptom->attacktype = disease->attacktype; |
523 | symptom->attacktype = disease->attacktype; |
526 | symptom->other_arch = disease->other_arch; |
524 | symptom->other_arch = disease->other_arch; |
527 | } |
525 | } |
528 | SET_FLAG (symptom, FLAG_APPLIED); |
526 | SET_FLAG (symptom, FLAG_APPLIED); |
529 | fix_player (victim); |
527 | victim->update_stats (); |
530 | return 1; |
528 | return 1; |
531 | } |
529 | } |
532 | |
530 | |
533 | |
531 | |
534 | /* grants immunity to plagues we've seen before. */ |
532 | /* grants immunity to plagues we've seen before. */ |