… | |
… | |
224 | "You feel stupid!", |
224 | "You feel stupid!", |
225 | "You feel less potent!" |
225 | "You feel less potent!" |
226 | }; |
226 | }; |
227 | |
227 | |
228 | const char *const statname[NUM_STATS] = { |
228 | const char *const statname[NUM_STATS] = { |
229 | "strength", "dexterity", "constitution", "wisdom", "charisma", "intelligence", "power" |
229 | "strength", "dexterity", "constitution", "intelligence", "wisdom", "power", "charisma" |
230 | }; |
230 | }; |
231 | |
231 | |
232 | const char *const short_stat_name[NUM_STATS] = { |
232 | const char *const short_stat_name[NUM_STATS] = { |
233 | "Str", "Dex", "Con", "Wis", "Cha", "Int", "Pow" |
233 | "Str", "Dex", "Con", "Int", "Wis", "Pow", "Cha" |
234 | }; |
234 | }; |
235 | |
235 | |
236 | /* |
236 | /* |
237 | * sets Str/Dex/con/Wis/Cha/Int/Pow in stats to value, depending on |
237 | * sets Str/Dex/con/Wis/Cha/Int/Pow in stats to value, depending on |
238 | * what attr is (STR to POW). |
238 | * what attr is (STR to POW). |
… | |
… | |
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 |
… | |
… | |
1018 | if (tmp->type != POTION) |
1028 | if (tmp->type != POTION) |
1019 | { |
1029 | { |
1020 | for (i = 0; i < NROFATTACKS; i++) |
1030 | for (i = 0; i < NROFATTACKS; i++) |
1021 | { |
1031 | { |
1022 | /* Potential for cursed potions, in which case we just can use |
1032 | /* Potential for cursed potions, in which case we just can use |
1023 | * a straight MAX, as potion_resist is initialized to zero. |
1033 | * a straight MAX, as potion_resist is initialised to zero. |
1024 | */ |
1034 | */ |
1025 | if (tmp->type == POTION_EFFECT) |
1035 | if (tmp->type == POTION_EFFECT) |
1026 | { |
1036 | { |
1027 | if (potion_resist[i]) |
1037 | if (potion_resist[i]) |
1028 | potion_resist[i] = MAX (potion_resist[i], tmp->resist[i]); |
1038 | potion_resist[i] = MAX (potion_resist[i], tmp->resist[i]); |
… | |
… | |
1492 | if (move_type == 0) |
1502 | if (move_type == 0) |
1493 | move_type = MOVE_WALK; |
1503 | move_type = MOVE_WALK; |
1494 | else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) |
1504 | else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) |
1495 | move_type &= ~MOVE_WALK; |
1505 | move_type &= ~MOVE_WALK; |
1496 | |
1506 | |
1497 | update_ob_speed (this); |
1507 | set_speed (speed); |
1498 | |
1508 | |
1499 | /* It is quite possible that a player's spell costing might have changed, |
1509 | /* It is quite possible that a player's spell costing might have changed, |
1500 | * so we will check that now. |
1510 | * so we will check that now. |
1501 | */ |
1511 | */ |
1502 | if (type == PLAYER) |
1512 | if (type == PLAYER) |