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