Changeset 973
- Timestamp:
- 07/01/08 14:11:06 (3 months ago)
- Files:
-
- trunk/src/obj-info.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/obj-info.c
r972 r973 331 331 const char *desc[16]; 332 332 int mult[16]; 333 int cnt, dam ;333 int cnt, dam, total_dam; 334 334 int xtra_dam = 0; 335 335 object_type *j_ptr = &inventory[INVEN_BOW]; … … 415 415 for (i = 0; i < cnt; i++) 416 416 { 417 text_out_c(TERM_L_GREEN, "%d", ((dam * mult[i]) + xtra_dam) / 10); 417 /* Include bonus damage and slay in stated average */ 418 total_dam = dam * mult[i] + xtra_dam; 419 420 if (total_dam <= 0) 421 text_out_c(TERM_L_RED, "%d", 0); 422 else if (total_dam % 10) 423 text_out_c(TERM_L_GREEN, "%d.%d", 424 total_dam / 10, total_dam % 10); 425 else 426 text_out_c(TERM_L_GREEN, "%d", total_dam / 10); 427 418 428 text_out(" against %s, ", desc[i]); 419 429 } … … 423 433 424 434 /* Include bonus damage in stated average */ 425 dam += xtra_dam; 426 if (dam <= 0) 435 total_dam = dam + xtra_dam; 436 437 if (total_dam <= 0) 427 438 text_out_c(TERM_L_RED, "%d", 0); 428 else if (dam % 10) 429 text_out_c(TERM_L_GREEN, "%d.%d", dam / 10, dam % 10); 439 else if (total_dam % 10) 440 text_out_c(TERM_L_GREEN, "%d.%d", 441 total_dam / 10, total_dam % 10); 430 442 else 431 text_out_c(TERM_L_GREEN, "%d", dam / 10);443 text_out_c(TERM_L_GREEN, "%d", total_dam / 10); 432 444 433 445 text_out(" against normal creatures.\n");
