Changeset 973

Show
Ignore:
Timestamp:
07/01/08 14:11:06 (3 months ago)
Author:
mikon
Message:

* this will really close ticket:612 forever

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/obj-info.c

    r972 r973  
    331331        const char *desc[16]; 
    332332        int mult[16]; 
    333         int cnt, dam
     333        int cnt, dam, total_dam
    334334        int xtra_dam = 0; 
    335335        object_type *j_ptr = &inventory[INVEN_BOW]; 
     
    415415                for (i = 0; i < cnt; i++) 
    416416                { 
    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 
    418428                        text_out(" against %s, ", desc[i]); 
    419429                } 
     
    423433 
    424434        /* 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) 
    427438                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); 
    430442    else 
    431                 text_out_c(TERM_L_GREEN, "%d", dam / 10); 
     443                text_out_c(TERM_L_GREEN, "%d", total_dam / 10); 
    432444 
    433445        text_out(" against normal creatures.\n");