Changeset 402
- Timestamp:
- 07/28/07 17:56:48 (1 year ago)
- Files:
-
- trunk/src/attack.c (modified) (1 diff)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/obj-info.c (modified) (6 diffs)
- trunk/src/xtra1.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/attack.c
r400 r402 24 24 * Note that artifacts never break, see the "drop_near()" function. 25 25 */ 26 staticint breakage_chance(const object_type *o_ptr)26 int breakage_chance(const object_type *o_ptr) 27 27 { 28 28 /* Examine the item type */ trunk/src/externs.h
r400 r402 262 262 263 263 /* attack.c */ 264 extern int breakage_chance(const object_type *o_ptr); 264 265 extern void py_attack(int y, int x); 265 266 extern void do_cmd_fire(void); trunk/src/obj-info.c
r399 r402 189 189 cptr desc[15]; 190 190 int mult[15]; 191 int cnt, dam ;191 int cnt, dam, xtra_dam; 192 192 object_type *j_ptr = &inventory[INVEN_BOW]; 193 193 … … 199 199 if (!weapon && !ammo) return FALSE; 200 200 201 202 201 203 if (weapon) 202 204 { … … 204 206 205 207 dam = (o_ptr->ds * o_ptr->dd * 5); 206 if (object_known_p(o_ptr)) dam += (o_ptr->to_d * 10); 207 dam += (p_ptr->to_d * 10); 208 208 209 xtra_dam = (p_ptr->to_d * 10); 210 if (object_known_p(o_ptr)) 211 xtra_dam += (o_ptr->to_d * 10); 212 213 /* Warn about heavy weapons */ 214 if (adj_str_hold[p_ptr->stat_ind[A_STR]] < o_ptr->weight / 10) 215 { 216 if (new_paragraph) { text_out("\n\n"); new_paragraph = FALSE; } 217 text_out_c(TERM_L_RED, "You are too weak to use this weapon effectively! "); 218 blows = 1; 219 } 220 209 221 p_text_out("Using this weapon, in your current condition, you are able to score "); 210 222 text_out_c(TERM_L_GREEN, format("%d ", blows)); … … 219 231 220 232 /* Calculate damage */ 233 xtra_dam = 0; 221 234 dam = (o_ptr->ds * o_ptr->dd * 5); 222 235 if (object_known_p(o_ptr)) dam += (o_ptr->to_d * 10); … … 237 250 for (i = 0; i < cnt; i++) 238 251 { 239 text_out_c(TERM_L_GREEN, "%d", ( dam * mult[i]) / 10);252 text_out_c(TERM_L_GREEN, "%d", ((dam * mult[i]) + xtra_dam) / 10); 240 253 text_out(" against %s, ", desc[i]); 241 254 } … … 250 263 251 264 text_out(" against normal creatures. "); 265 266 /* Add breakage chance */ 267 if (ammo) 268 { 269 text_out("It has a "); 270 text_out_c(TERM_L_GREEN, "%d%%", breakage_chance(o_ptr)); 271 text_out(" chance of breaking upon contact."); 272 } 252 273 253 274 /* You always have something to say... */ trunk/src/xtra1.c
r399 r402 2377 2377 { 2378 2378 /* Calculate number of blows */ 2379 p_ptr->num_blow = calc_blows(o_ptr) + extra_blows; ;2379 p_ptr->num_blow = calc_blows(o_ptr) + extra_blows; 2380 2380 2381 2381 /* Boost digging skill by weapon weight */
