Changeset 250
- Timestamp:
- 07/02/07 14:02:56 (1 year ago)
- Files:
-
- trunk/src/cmd4.c (modified) (2 diffs)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/spells2.c (modified) (7 diffs)
- trunk/src/use-obj.c (modified) (2 diffs)
- trunk/src/wizard2.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd4.c
r249 r250 4007 4007 4008 4008 4009 void do_cmd_self_knowledge(void *obj, const char *name) 4010 { 4011 /* display self knowledge we already know about. */ 4012 self_knowledge(FALSE); 4013 } 4014 4009 4015 /* 4010 4016 * Definition of the "player knowledge" menu. … … 4017 4023 {{0, "Display object knowledge", (action_f)do_cmd_knowledge_objects, 0}, '4'}, 4018 4024 {{0, "Display feature knowledge", (action_f)do_cmd_knowledge_features, 0}, '5'}, 4019 {{0, "Display self-knowledge", (action_f)self_knowledge, 0}, '6'},4025 {{0, "Display self-knowledge", do_cmd_self_knowledge, 0}, '6'}, 4020 4026 }; 4021 4027 trunk/src/externs.h
r232 r250 518 518 extern bool remove_all_curse(void); 519 519 extern bool restore_level(void); 520 extern void self_knowledge( void);520 extern void self_knowledge(bool spoil); 521 521 extern bool lose_all_info(void); 522 522 extern void set_recall(void); trunk/src/spells2.c
r163 r250 385 385 * 386 386 * List various information about the player and/or his current equipment. 387 * See also "identify_fully()". 387 388 * 388 * See also "identify_fully()". 389 * This tests the flags of the equipment being carried and the innate player 390 * flags, so any changes made in calc_bonuses need to be shadowed here. 389 391 * 390 392 * Use the "roff()" routines, perhaps. XXX XXX XXX … … 394 396 * This function cannot display more than 20 lines. XXX XXX XXX 395 397 */ 396 void self_knowledge( void)398 void self_knowledge(bool spoil) 397 399 { 398 400 int i = 0, j, k; 401 402 u32b t1, t2, t3; 399 403 400 404 u32b f1 = 0L, f2 = 0L, f3 = 0L; … … 408 412 for (k = INVEN_WIELD; k < INVEN_TOTAL; k++) 409 413 { 410 u32b t1, t2, t3;411 412 414 o_ptr = &inventory[k]; 413 415 … … 416 418 417 419 /* Extract the flags */ 418 object_flags(o_ptr, &t1, &t2, &t3); 420 if (spoil) 421 object_flags(o_ptr, &t1, &t2, &t3); 422 else 423 object_flags_known(o_ptr, &t1, &t2, &t3); 419 424 420 425 /* Extract flags */ … … 424 429 } 425 430 431 /* And flags from the player */ 432 player_flags(&t1, &t2, &t3); 433 434 /* Extract flags */ 435 f1 |= t1; 436 f2 |= t2; 437 f3 |= t3; 438 426 439 427 440 if (p_ptr->timed[TMD_BLIND]) … … 454 467 } 455 468 456 if ( p_ptr->aggravate)469 if (f3 & TR3_AGGRAVATE) 457 470 { 458 471 info[i++] = "You aggravate monsters."; 459 472 } 460 if ( p_ptr->teleport)473 if (f3 & TR3_TELEPORT) 461 474 { 462 475 info[i++] = "Your position is very uncertain."; … … 503 516 info[i++] = "You will soon be recalled."; 504 517 } 505 if ( p_ptr->see_infra)518 if (rp_ptr->infra || f1 & TR1_INFRA) 506 519 { 507 520 info[i++] = "Your eyes are sensitive to infrared light."; 508 521 } 509 522 510 if ( p_ptr->slow_digest)523 if (f3 & TR3_SLOW_DIGEST) 511 524 { 512 525 info[i++] = "Your appetite is small."; 513 526 } 514 if ( p_ptr->ffall)527 if (f3 & TR3_FEATHER) 515 528 { 516 529 info[i++] = "You land gently."; 517 530 } 518 if ( p_ptr->regenerate)531 if (f3 & TR3_REGEN) 519 532 { 520 533 info[i++] = "You regenerate quickly."; 521 534 } 522 if ( p_ptr->telepathy)535 if (f3 & TR3_TELEPATHY) 523 536 { 524 537 info[i++] = "You have ESP."; 525 538 } 526 if ( p_ptr->see_inv)539 if (f3 & TR3_SEE_INVIS) 527 540 { 528 541 info[i++] = "You can see invisible creatures."; 529 542 } 530 if ( p_ptr->free_act)543 if (f3 & TR3_FREE_ACT) 531 544 { 532 545 info[i++] = "You have free action."; 533 546 } 534 if ( p_ptr->hold_life)547 if (f3 & TR3_HOLD_LIFE) 535 548 { 536 549 info[i++] = "You have a firm hold on your life force."; 537 550 } 538 551 539 if ( p_ptr->immune_acid)552 if (f2 & TR2_IM_ACID) 540 553 { 541 554 info[i++] = "You are completely immune to acid."; 542 555 } 543 else if (( p_ptr->resist_acid) && (p_ptr->timed[TMD_OPP_ACID]))556 else if ((f2 & TR2_RES_ACID) && (p_ptr->timed[TMD_OPP_ACID])) 544 557 { 545 558 info[i++] = "You resist acid exceptionally well."; 546 559 } 547 else if (( p_ptr->resist_acid) || (p_ptr->timed[TMD_OPP_ACID]))560 else if ((f2 & TR2_RES_ACID) || (p_ptr->timed[TMD_OPP_ACID])) 548 561 { 549 562 info[i++] = "You are resistant to acid."; 550 563 } 551 564 552 if ( p_ptr->immune_elec)565 if (f2 & TR2_IM_ELEC) 553 566 { 554 567 info[i++] = "You are completely immune to lightning."; 555 568 } 556 else if (( p_ptr->resist_elec) && (p_ptr->timed[TMD_OPP_ELEC]))569 else if ((f2 & TR2_RES_ELEC) && (p_ptr->timed[TMD_OPP_ELEC])) 557 570 { 558 571 info[i++] = "You resist lightning exceptionally well."; 559 572 } 560 else if (( p_ptr->resist_elec) || (p_ptr->timed[TMD_OPP_ELEC]))573 else if ((f2 & TR2_RES_ELEC) || (p_ptr->timed[TMD_OPP_ELEC])) 561 574 { 562 575 info[i++] = "You are resistant to lightning."; 563 576 } 564 577 565 if ( p_ptr->immune_fire)578 if (f2 & TR2_IM_FIRE) 566 579 { 567 580 info[i++] = "You are completely immune to fire."; 568 581 } 569 else if (( p_ptr->resist_fire) && (p_ptr->timed[TMD_OPP_FIRE]))582 else if ((f2 & TR2_RES_FIRE) && (p_ptr->timed[TMD_OPP_FIRE])) 570 583 { 571 584 info[i++] = "You resist fire exceptionally well."; 572 585 } 573 else if (( p_ptr->resist_fire) || (p_ptr->timed[TMD_OPP_FIRE]))586 else if ((f2 & TR2_RES_FIRE) || (p_ptr->timed[TMD_OPP_FIRE])) 574 587 { 575 588 info[i++] = "You are resistant to fire."; 576 589 } 577 590 578 if ( p_ptr->immune_cold)591 if (f2 & TR2_IM_COLD) 579 592 { 580 593 info[i++] = "You are completely immune to cold."; 581 594 } 582 else if (( p_ptr->resist_cold) && (p_ptr->timed[TMD_OPP_COLD]))595 else if ((f2 & TR2_RES_COLD) && (p_ptr->timed[TMD_OPP_COLD])) 583 596 { 584 597 info[i++] = "You resist cold exceptionally well."; 585 598 } 586 else if (( p_ptr->resist_cold) || (p_ptr->timed[TMD_OPP_COLD]))599 else if ((f2 & TR2_RES_COLD) || (p_ptr->timed[TMD_OPP_COLD])) 587 600 { 588 601 info[i++] = "You are resistant to cold."; 589 602 } 590 603 591 if (( p_ptr->resist_pois) && (p_ptr->timed[TMD_OPP_POIS]))604 if ((f2 & TR2_RES_POIS) && (p_ptr->timed[TMD_OPP_POIS])) 592 605 { 593 606 info[i++] = "You resist poison exceptionally well."; 594 607 } 595 else if (( p_ptr->resist_pois) || (p_ptr->timed[TMD_OPP_POIS]))608 else if ((f2 & TR2_RES_POIS) || (p_ptr->timed[TMD_OPP_POIS])) 596 609 { 597 610 info[i++] = "You are resistant to poison."; 598 611 } 599 612 600 if ( p_ptr->resist_fear)613 if (f2 & TR2_RES_FEAR) 601 614 { 602 615 info[i++] = "You are completely fearless."; 603 616 } 604 617 605 if ( p_ptr->resist_lite)618 if (f2 & TR2_RES_LITE) 606 619 { 607 620 info[i++] = "You are resistant to bright light."; 608 621 } 609 if ( p_ptr->resist_dark)622 if (f2 & TR2_RES_DARK) 610 623 { 611 624 info[i++] = "You are resistant to darkness."; 612 625 } 613 if ( p_ptr->resist_blind)626 if (f2 & TR2_RES_DARK) 614 627 { 615 628 info[i++] = "Your eyes are resistant to blindness."; 616 629 } 617 if ( p_ptr->resist_confu)630 if (f2 & TR2_RES_CONFU) 618 631 { 619 632 info[i++] = "You are resistant to confusion."; 620 633 } 621 if ( p_ptr->resist_sound)634 if (f2 & TR2_RES_SOUND) 622 635 { 623 636 info[i++] = "You are resistant to sonic attacks."; 624 637 } 625 if ( p_ptr->resist_shard)638 if (f2 & TR2_RES_SHARD) 626 639 { 627 640 info[i++] = "You are resistant to blasts of shards."; 628 641 } 629 if ( p_ptr->resist_nexus)642 if (f2 & TR2_RES_NEXUS) 630 643 { 631 644 info[i++] = "You are resistant to nexus attacks."; 632 645 } 633 if ( p_ptr->resist_nethr)646 if (f2 & TR2_RES_NETHR) 634 647 { 635 648 info[i++] = "You are resistant to nether forces."; 636 649 } 637 if ( p_ptr->resist_chaos)650 if (f2 & TR2_RES_CHAOS) 638 651 { 639 652 info[i++] = "You are resistant to chaos."; 640 653 } 641 if ( p_ptr->resist_disen)654 if (f2 & TR2_RES_DISEN) 642 655 { 643 656 info[i++] = "You are resistant to disenchantment."; 644 657 } 645 658 646 if ( p_ptr->sustain_str)659 if (f2 & TR2_SUST_STR) 647 660 { 648 661 info[i++] = "Your strength is sustained."; 649 662 } 650 if ( p_ptr->sustain_int)663 if (f2 & TR2_SUST_INT) 651 664 { 652 665 info[i++] = "Your intelligence is sustained."; 653 666 } 654 if ( p_ptr->sustain_wis)667 if (f2 & TR2_SUST_WIS) 655 668 { 656 669 info[i++] = "Your wisdom is sustained."; 657 670 } 658 if ( p_ptr->sustain_dex)671 if (f2 & TR2_SUST_DEX) 659 672 { 660 673 info[i++] = "Your dexterity is sustained."; 661 674 } 662 if ( p_ptr->sustain_con)675 if (f2 & TR2_SUST_CON) 663 676 { 664 677 info[i++] = "Your constitution is sustained."; 665 678 } 666 if ( p_ptr->sustain_chr)679 if (f2 & TR2_SUST_CHR) 667 680 { 668 681 info[i++] = "Your charisma is sustained."; trunk/src/use-obj.c
r233 r250 672 672 (void)detect_objects_normal(); 673 673 identify_pack(); 674 self_knowledge( );674 self_knowledge(TRUE); 675 675 *ident = TRUE; 676 676 break; … … 681 681 msg_print("You begin to know yourself a little better..."); 682 682 message_flush(); 683 self_knowledge( );683 self_knowledge(TRUE); 684 684 *ident = TRUE; 685 685 break; trunk/src/wizard2.c
r189 r250 1613 1613 case 'k': 1614 1614 { 1615 self_knowledge( );1615 self_knowledge(TRUE); 1616 1616 break; 1617 1617 }
