… | |
… | |
371 | char message[MAX_BUF]; |
371 | char message[MAX_BUF]; |
372 | int potion_max = 0; |
372 | int potion_max = 0; |
373 | |
373 | |
374 | /* remember what object was like before it was changed. note that |
374 | /* remember what object was like before it was changed. note that |
375 | * refop is a local copy of op only to be used for detecting changes |
375 | * refop is a local copy of op only to be used for detecting changes |
376 | * found by fix_player. refop is not a real object |
376 | * found by update_stats. refop is not a real object |
377 | */ |
377 | */ |
378 | object_pod refop = *op; |
378 | object_copy refop = *op; |
379 | |
379 | |
380 | if (op->type == PLAYER) |
380 | if (op->type == PLAYER) |
381 | { |
381 | { |
382 | if (tmp->type == POTION) |
382 | if (tmp->type == POTION) |
383 | { |
383 | { |
… | |
… | |
401 | nstat = 1; |
401 | nstat = 1; |
402 | else if (nstat > 20 + get_attr_value (&(op->arch->clone.stats), j)) |
402 | else if (nstat > 20 + get_attr_value (&(op->arch->clone.stats), j)) |
403 | { |
403 | { |
404 | nstat = 20 + get_attr_value (&(op->arch->clone.stats), j); |
404 | nstat = 20 + get_attr_value (&(op->arch->clone.stats), j); |
405 | } |
405 | } |
|
|
406 | |
406 | if (nstat != ostat) |
407 | if (nstat != ostat) |
407 | { |
408 | { |
408 | set_attr_value (&(op->contr->orig_stats), j, nstat); |
409 | set_attr_value (&(op->contr->orig_stats), j, nstat); |
409 | potion_max = 0; |
410 | potion_max = 0; |
410 | } |
411 | } |
… | |
… | |
412 | { |
413 | { |
413 | /* potion is useless - player has already hit the natural maximum */ |
414 | /* potion is useless - player has already hit the natural maximum */ |
414 | potion_max = 1; |
415 | potion_max = 1; |
415 | } |
416 | } |
416 | } |
417 | } |
|
|
418 | |
417 | /* This section of code ups the characters normal stats also. I am not |
419 | /* This section of code ups the characters normal stats also. I am not |
418 | * sure if this is strictly necessary, being that fix_player probably |
420 | * sure if this is strictly necessary, being that fix_player probably |
419 | * recalculates this anyway. |
421 | * recalculates this anyway. |
420 | */ |
422 | */ |
421 | for (j = 0; j < NUM_STATS; j++) |
423 | for (j = 0; j < NUM_STATS; j++) |
422 | change_attr_value (&(op->stats), j, flag * get_attr_value (&(tmp->stats), j)); |
424 | change_attr_value (&(op->stats), j, flag * get_attr_value (&(tmp->stats), j)); |
|
|
425 | |
423 | check_stat_bounds (&(op->stats)); |
426 | check_stat_bounds (&(op->stats)); |
424 | } /* end of potion handling code */ |
427 | } /* end of potion handling code */ |
425 | } |
428 | } |
426 | |
429 | |
427 | /* reset attributes that fix_player doesn't reset since it doesn't search |
430 | /* reset attributes that fix_player doesn't reset since it doesn't search |
… | |
… | |
451 | if (tmp->attacktype & AT_CONFUSION && tmp->type != BOW) |
454 | if (tmp->attacktype & AT_CONFUSION && tmp->type != BOW) |
452 | { |
455 | { |
453 | success = 1; |
456 | success = 1; |
454 | DIFF_MSG (flag, "Your hands begin to glow red.", "Your hands stop glowing red."); |
457 | DIFF_MSG (flag, "Your hands begin to glow red.", "Your hands stop glowing red."); |
455 | } |
458 | } |
|
|
459 | |
456 | if (QUERY_FLAG (op, FLAG_LIFESAVE) != QUERY_FLAG (&refop, FLAG_LIFESAVE)) |
460 | if (QUERY_FLAG (op, FLAG_LIFESAVE) != QUERY_FLAG (&refop, FLAG_LIFESAVE)) |
457 | { |
461 | { |
458 | success = 1; |
462 | success = 1; |
459 | DIFF_MSG (flag, "You feel very protected.", "You don't feel protected anymore."); |
463 | DIFF_MSG (flag, "You feel very protected.", "You don't feel protected anymore."); |
460 | } |
464 | } |
|
|
465 | |
461 | if (QUERY_FLAG (op, FLAG_REFL_MISSILE) != QUERY_FLAG (&refop, FLAG_REFL_MISSILE)) |
466 | if (QUERY_FLAG (op, FLAG_REFL_MISSILE) != QUERY_FLAG (&refop, FLAG_REFL_MISSILE)) |
462 | { |
467 | { |
463 | success = 1; |
468 | success = 1; |
464 | DIFF_MSG (flag, "A magic force shimmers around you.", "The magic force fades away."); |
469 | DIFF_MSG (flag, "A magic force shimmers around you.", "The magic force fades away."); |
465 | } |
470 | } |
|
|
471 | |
466 | if (QUERY_FLAG (op, FLAG_REFL_SPELL) != QUERY_FLAG (&refop, FLAG_REFL_SPELL)) |
472 | if (QUERY_FLAG (op, FLAG_REFL_SPELL) != QUERY_FLAG (&refop, FLAG_REFL_SPELL)) |
467 | { |
473 | { |
468 | success = 1; |
474 | success = 1; |
469 | DIFF_MSG (flag, "You feel more safe now, somehow.", "Suddenly you feel less safe, somehow."); |
475 | DIFF_MSG (flag, "You feel more safe now, somehow.", "Suddenly you feel less safe, somehow."); |
470 | } |
476 | } |
|
|
477 | |
471 | /* movement type has changed. We don't care about cases where |
478 | /* movement type has changed. We don't care about cases where |
472 | * user has multiple items giving the same type appled like we |
479 | * user has multiple items giving the same type appled like we |
473 | * used to - that is more work than what we gain, plus messages |
480 | * used to - that is more work than what we gain, plus messages |
474 | * can be misleading (a little higher could be miscontrued from |
481 | * can be misleading (a little higher could be miscontrued from |
475 | * from fly high) |
482 | * from fly high) |
… | |
… | |
523 | if (QUERY_FLAG (op, FLAG_STEALTH) != QUERY_FLAG (&refop, FLAG_STEALTH)) |
530 | if (QUERY_FLAG (op, FLAG_STEALTH) != QUERY_FLAG (&refop, FLAG_STEALTH)) |
524 | { |
531 | { |
525 | success = 1; |
532 | success = 1; |
526 | DIFF_MSG (flag, "You walk more quietly.", "You walk more noisily."); |
533 | DIFF_MSG (flag, "You walk more quietly.", "You walk more noisily."); |
527 | } |
534 | } |
|
|
535 | |
528 | if (QUERY_FLAG (op, FLAG_MAKE_INVIS) != QUERY_FLAG (&refop, FLAG_MAKE_INVIS)) |
536 | if (QUERY_FLAG (op, FLAG_MAKE_INVIS) != QUERY_FLAG (&refop, FLAG_MAKE_INVIS)) |
529 | { |
537 | { |
530 | success = 1; |
538 | success = 1; |
531 | DIFF_MSG (flag, "You become transparent.", "You can see yourself."); |
539 | DIFF_MSG (flag, "You become transparent.", "You can see yourself."); |
532 | } |
540 | } |
|
|
541 | |
533 | /* blinded you can tell if more blinded since blinded player has minimal |
542 | /* blinded you can tell if more blinded since blinded player has minimal |
534 | * vision |
543 | * vision |
535 | */ |
544 | */ |
536 | if (QUERY_FLAG (tmp, FLAG_BLIND)) |
545 | if (QUERY_FLAG (tmp, FLAG_BLIND)) |
537 | { |
546 | { |
… | |
… | |
655 | success = 1; |
664 | success = 1; |
656 | DIFF_MSG (i * flag, gain_msg[j], lose_msg[j]); |
665 | DIFF_MSG (i * flag, gain_msg[j], lose_msg[j]); |
657 | } |
666 | } |
658 | } |
667 | } |
659 | } |
668 | } |
|
|
669 | |
660 | return success; |
670 | return success; |
661 | } |
671 | } |
662 | |
672 | |
663 | /* |
673 | /* |
664 | * Stat draining by Vick 930307 |
674 | * Stat draining by Vick 930307 |