Changeset 753

Show
Ignore:
Timestamp:
03/07/08 18:55:45 (5 months ago)
Author:
GabeCunningham
Message:

Partially fix #498: you should now get see the correct number of blows when looking at a weapon you don't have equipped. The average damage is still off. Fix #401: weapons that radiate light now say "Radius 1 Light" instead of just "Radius 1". Artifact weapons that radiate light now have the correct radius of 1 instead of 4.

Files:

Legend:

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

    r723 r753  
    341341        { 
    342342                int blows = calc_blows(o_ptr); 
    343  
    344                 dam = (o_ptr->ds * o_ptr->dd * 5); 
     343                int extra_blows = 0; 
     344                 
     345                if (f1 & (TR1_BLOWS)) extra_blows += o_ptr->pval; 
     346                blows += extra_blows; 
     347 
     348                dam = ((o_ptr->ds + 1) * o_ptr->dd * 5); 
    345349 
    346350                xtra_dam = (p_ptr->to_d * 10); 
     
    367371 
    368372                /* Calculate damage */ 
    369                 dam = (o_ptr->ds * o_ptr->dd * 5); 
     373                dam = ((o_ptr->ds + 1) * o_ptr->dd * 5); 
    370374                if (object_known_p(o_ptr)) xtra_dam += (o_ptr->to_d * 10); 
    371375                if (object_known_p(j_ptr)) xtra_dam += (j_ptr->to_d * 10); 
     
    434438 
    435439        /* Work out radius */ 
    436         if (artifact)      rad = 3; 
     440        if (artifact && is_lite) rad = 3; 
    437441        else if (is_lite)  rad = 2; 
    438442        if (f3 & TR3_LITE) rad++; 
     
    442446        text_out_c(TERM_L_GREEN, format("%d", rad)); 
    443447        if (no_fuel && !artifact) 
    444                 text_out(" light.  No fuel required."); 
     448                text_out(" light.  No fuel required"); 
    445449        else if (is_lite && o_ptr->sval == SV_LITE_TORCH) 
    446450                text_out(" light, reduced when running of out fuel"); 
     451        else 
     452                text_out (" light"); 
    447453        text_out("."); 
    448454 
  • trunk/src/xtra1.c

    r698 r753  
    564564{ 
    565565        int blows; 
    566         int str_index, dex_index
     566        int str_index1, str_index2, dex_index1, dex_index2
    567567        int div; 
     568         
     569        object_type *j_ptr = &inventory[INVEN_WIELD]; 
    568570 
    569571        /* Enforce a minimum "weight" (tenth pounds) */ 
    570572        div = ((o_ptr->weight < cp_ptr->min_weight) ? cp_ptr->min_weight : o_ptr->weight); 
    571573 
     574        /* If we're wielding this weapon, use the current stats */ 
     575        if (o_ptr == j_ptr) 
     576        { 
     577                str_index1 = p_ptr->stat_ind[A_STR]; 
     578                dex_index1 = p_ptr->stat_ind[A_DEX]; 
     579        } 
     580        else 
     581        { 
     582                /* Recalculate bonuses as if we were wielding this weapon */ 
     583                 
     584                int str_change = 0, dex_change = 0; 
     585                int new_str = p_ptr->stat_use[A_STR]; 
     586                int new_dex = p_ptr->stat_use[A_DEX]; 
     587                 
     588                /* object_type *j_ptr = &inventory[INVEN_WIELD]; */ 
     589                 
     590                u32b jf1, jf2, jf3; 
     591                u32b of1, of2, of3; 
     592                 
     593                /* Examine the wielded weapon */ 
     594                object_flags(j_ptr, &jf1, &jf2, &jf3); 
     595                if (jf1 & (TR1_STR)) str_change -= j_ptr->pval; 
     596                if (jf1 & (TR1_DEX)) dex_change -= j_ptr->pval; 
     597 
     598                /* Examine the weapon in the pack*/ 
     599                object_flags(o_ptr, &of1, &of2, &of3); 
     600                if (of1 & (TR1_STR)) str_change += o_ptr->pval; 
     601                if (of1 & (TR1_DEX)) dex_change += o_ptr->pval; 
     602 
     603                new_str = modify_stat_value(new_str, str_change); 
     604                new_dex = modify_stat_value(new_dex, dex_change); 
     605                 
     606                if (new_str <= 18) 
     607                        str_index1 = new_str - 3; 
     608                else if (new_str <= 18+219) 
     609                        str_index1 = (15 + (new_str - 18) / 10); 
     610                else 
     611                        str_index1 = 37; 
     612                         
     613                if (new_dex <= 18) 
     614                        dex_index1 = new_dex - 3; 
     615                else if (new_dex <= 18+219) 
     616                        dex_index1 = (15 + (new_dex - 18) / 10); 
     617                else 
     618                        dex_index1 = 37; 
     619        } 
     620         
     621 
    572622        /* Get the strength vs weight */ 
    573         str_index = (adj_str_blow[p_ptr->stat_ind[A_STR]] * cp_ptr->att_multiply / div); 
     623        str_index2 = (adj_str_blow[str_index1] * cp_ptr->att_multiply / div); 
    574624 
    575625        /* Maximal value */ 
    576         if (str_index > 11) str_index = 11; 
     626        if (str_index2 > 11) str_index2 = 11; 
    577627 
    578628        /* Index by dexterity */ 
    579         dex_index = MIN(adj_dex_blow[p_ptr->stat_ind[A_DEX]], 11); 
     629        dex_index2 = MIN(adj_dex_blow[dex_index1], 11); 
    580630 
    581631        /* Use the blows table */ 
    582         blows = MIN(blows_table[str_index][dex_index], cp_ptr->max_attacks); 
     632        blows = MIN(blows_table[str_index2][dex_index2], cp_ptr->max_attacks); 
    583633 
    584634        /* Require at least one blow */