Changeset 317
- Timestamp:
- 07/10/07 10:02:30 (2 years ago)
- Files:
-
- trunk/lib/edit/object.txt (modified) (27 diffs)
- trunk/src/Makefile.src (modified) (1 diff)
- trunk/src/effects.c (added)
- trunk/src/effects.h (added)
- trunk/src/init1.c (modified) (12 diffs)
- trunk/src/obj-info.c (modified) (2 diffs)
- trunk/src/types.h (modified) (1 diff)
- trunk/src/use-obj.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/edit/object.txt
r305 r317 98 98 A:5/1 99 99 F:EASY_KNOW 100 D:It causes blindness that lasts for 199+1d200 turns, unless you have 101 D: resistance to blindness. 102 D: Mushrooms provide nourishment for about 250 turns under normal 103 D: conditions. 100 E:BLIND 104 101 105 102 N:2:Paranoia … … 109 106 A:5/1 110 107 F:EASY_KNOW 111 D:It induces fear that lasts for 9+1d10 turns, unless you have 112 D: resistance to fear. 113 D: Mushrooms provide nourishment for about 250 turns under normal 114 D: conditions. 108 E:SCARE 115 109 116 110 N:3:Confusion … … 120 114 A:5/1 121 115 F:EASY_KNOW 122 D:It induces confusion that lasts for 9+1d10 turns, unless you have 123 D: resistance to confusion. 124 D: Mushrooms provide nourishment for about 250 turns under normal 125 D: conditions. 116 E:CONFUSE 126 117 127 118 N:4:Hallucination … … 131 122 A:10/1 132 123 F:EASY_KNOW 133 D:It causes you to hallucinate for 249+1d250 turns, unless you have 134 D: resistance to chaos. 135 D: Mushrooms provide nourishment for about 250 turns under normal 136 D: conditions. 124 E:HALLUC 137 125 138 126 N:5:Cure Poison … … 142 130 A:10/1 143 131 F:EASY_KNOW 144 D:It neutralizes poison. 145 D: Mushrooms provide nourishment for about 250 turns under normal 146 D: conditions. 132 E:CURE_POISON 147 133 148 134 N:6:Cure Blindness … … 152 138 A:10/1 153 139 F:EASY_KNOW 154 D:It cures blindness. 155 D: Mushrooms provide nourishment for about 250 turns under normal 156 D: conditions. 140 E:CURE_BLINDNESS 157 141 158 142 N:7:Cure Paranoia … … 162 146 A:10/1 163 147 F:EASY_KNOW 164 D:It removes your fear. 165 D: Mushrooms provide nourishment for about 250 turns under normal 166 D: conditions. 148 E:CURE_PARANOIA 167 149 168 150 N:8:Cure Confusion … … 172 154 A:10/1 173 155 F:EASY_KNOW 174 D:It cures confusion. 175 D: Mushrooms provide nourishment for about 250 turns under normal 176 D: conditions. 156 E:CURE_CONFUSION 177 157 178 158 N:9:Weakness … … 182 162 A:10/1 183 163 F:EASY_KNOW 184 D:It inflicts 6d6 points of damage, and also reduces strength unless you 185 D: have sustain strength. 186 D: Mushrooms provide nourishment for about 250 turns under normal 187 D: conditions. 164 E:LOSE_STR 188 165 189 166 N:10:Unhealth … … 194 171 P:0:10d10:0:0:0 195 172 F:EASY_KNOW 196 D:It inflicts 10d10 points of damage, and also reduces constitution 197 D: unless you have sustain constitution. 198 D: It may also be thrown to inflict 10d10 points of damage. 199 D: Mushrooms provide nourishment for about 250 turns under normal 200 D: conditions. 173 E:LOSE_CON2 174 D:It may also be thrown to inflict 10d10 points of damage. 201 175 202 176 N:11:Restore Constitution … … 206 180 A:20/1 207 181 F:EASY_KNOW 208 D:It restores constitution to maximum if it is currently below maximum. 209 D: Mushrooms provide nourishment for about 250 turns under normal 210 D: conditions. 182 E:RESTORE_CON 211 183 212 184 N:12:Restoring … … 216 188 A:20/8:30/4:40/1 217 189 F:EASY_KNOW 218 D:It restores to maximum all stats that are currently below maximum. 219 D: Mushrooms provide nourishment for about 250 turns under normal 220 D: conditions. 190 E:RESTORE_ALL 221 191 222 192 N:13:Stupidity … … 226 196 A:15/1 227 197 F:EASY_KNOW 228 D:It inflicts 8d8 points of damage, and also reduces intelligence unless 229 D: you have sustain intelligence. 230 D: Mushrooms provide nourishment for about 250 turns under normal 231 D: conditions. 198 E:LOSE_INT 232 199 233 200 N:14:Naivety … … 237 204 A:15/1 238 205 F:EASY_KNOW 239 D:It inflicts 8d8 points of damage, and also reduces wisdom unless you 240 D: have sustain wisdom. 241 D: Mushrooms provide nourishment for about 250 turns under normal 242 D: conditions. 206 E:LOSE_WIS 243 207 244 208 N:15:Poison … … 248 212 A:5/1:5/1 249 213 F:EASY_KNOW 250 D:It poisons you (adding 9+1d10 points to the poison counter), unless 251 D: you have resistance to poison. 252 D: Mushrooms provide nourishment for about 250 turns under normal 253 D: conditions. 214 E:POISON 254 215 255 216 N:16:Sickness … … 259 220 A:10/1 260 221 F:EASY_KNOW 261 D:It inflicts 6d6 points of damage, and also reduces constitution unless 262 D: you have sustain constitution. 263 D: Mushrooms provide nourishment for about 250 turns under normal 264 D: conditions. 222 E:LOSE_CON 265 223 266 224 N:17:Paralysis … … 270 228 A:20/1 271 229 F:EASY_KNOW 272 D:It induces paralysis that lasts for 9+1d10 turns, unless you have free 273 D: action. 274 D: Mushrooms provide nourishment for about 250 turns under normal 275 D: conditions. 230 E:PARALYZE 276 231 277 232 N:18:Restore Strength … … 281 236 A:20/1 282 237 F:EASY_KNOW 283 D:It restores strength to maximum if it is currently below maximum. 284 D: Mushrooms provide nourishment for about 250 turns under normal 285 D: conditions. 238 E:RESTORE_STR 286 239 287 240 N:19:Disease … … 292 245 P:0:10d10:0:0:0 293 246 F:EASY_KNOW 294 D:It inflicts 10d10 points of damage, and also reduces strength unless 295 D: you have sustain strength. 296 D: It may also be thrown to inflict 10d10 points of damage. 297 D: Mushrooms provide nourishment for about 250 turns under normal 298 D: conditions. 247 E:LOSE_STR2 248 D:It may also be thrown to inflict 10d10 points of damage. 299 249 300 250 N:20:Cure Serious Wounds … … 305 255 F:EASY_KNOW 306 256 D:It cures 4d8 points of damage. 307 D: Mushrooms provide nourishment for about 250 turns under normal308 D: conditions.309 257 310 258 ##### Normal Food ##### … … 316 264 A:0/1:5/1:10/1 317 265 F:EASY_KNOW 318 D:It provides nourishment for about 2500 turns under normal conditions. 266 E:FOOD_GOOD 319 267 320 268 N:22:& Hard Biscuit~ … … 323 271 W:0:0:2:1 324 272 F:EASY_KNOW 325 D:It provides nourishment for about 250 turns under normal conditions. 273 E:FOOD_GOOD 326 274 327 275 N:23:& Strip~ of Beef Jerky … … 330 278 W:0:0:2:2 331 279 F:EASY_KNOW 332 D:It provides nourishment for about 750 turns under normal conditions. 280 E:FOOD_GOOD 333 281 334 282 N:24:& Slime Mold~ … … 338 286 A:1/1 339 287 F:EASY_KNOW 340 D:It provides nourishment for about 1500 turns under normal conditions. 288 E:FOOD_GOOD 341 289 342 290 N:25:& Piece~ of Elvish Waybread … … 346 294 A:5/1:10/1:20/1 347 295 F:EASY_KNOW 348 D:It cures 4d8 points of damage and neutralizes poison. 349 D: It provides nourishment for about 3750 turns under normal 350 D: conditions. 296 E:FOOD_WAYBREAD 351 297 352 298 N:26:& Pint~ of Fine Ale … … 355 301 W:0:0:5:1 356 302 F:EASY_KNOW 357 D:It provides nourishment for about 250 turns under normal conditions. 303 E:FOOD_GOOD 358 304 359 305 N:27:& Pint~ of Fine Wine … … 362 308 W:0:0:10:2 363 309 F:EASY_KNOW 364 D:It provides nourishment for about 500 turns under normal conditions. 310 E:FOOD_GOOD 365 311 366 312 trunk/src/Makefile.src
r182 r317 29 29 cmd6.o \ 30 30 dungeon.o \ 31 effects.o \ 31 32 files.o \ 32 33 generate.o \ trunk/src/init1.c
r306 r317 8 8 * are included in all such copies. Other copyrights may also apply. 9 9 */ 10 11 10 #include "angband.h" 12 11 … … 474 473 "PERMA_CURSE" 475 474 }; 475 476 /* Use a slightly unusual include method to create effect_list[] */ 477 #define LIST_STRINGS 478 #include "effects.h" 479 #undef LIST_STRINGS 476 480 477 481 … … 1193 1197 1194 1198 1199 /* 1200 * Figure out what index an activation should have 1201 */ 1202 static u32b grab_one_effect(const char *what) 1203 { 1204 size_t i; 1205 1206 /* Scan activations */ 1207 for (i = 0; i < N_ELEMENTS(effect_list); i++) 1208 { 1209 if (streq(what, effect_list[i])) 1210 return i; 1211 } 1212 1213 /* Oops */ 1214 msg_format("Unknown effect '%s'.", what); 1215 1216 /* Error */ 1217 return 0; 1218 } 1219 1220 1195 1221 1196 1222 /* … … 1240 1266 if (!(k_ptr->name = add_name(head, s))) 1241 1267 return (PARSE_ERROR_OUT_OF_MEMORY); 1242 } 1268 1269 /* Success (return early) */ 1270 return (0); 1271 } 1272 1273 /* There better be a current k_ptr */ 1274 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER); 1243 1275 1244 1276 /* Process 'G' for "Graphics" (one line only) */ 1245 elseif (buf[0] == 'G')1277 if (buf[0] == 'G') 1246 1278 { 1247 1279 char d_char; 1248 1280 int d_attr; 1249 1250 /* There better be a current k_ptr */1251 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1252 1281 1253 1282 /* Paranoia */ … … 1287 1316 int tval, sval, pval; 1288 1317 1289 /* There better be a current k_ptr */1290 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1291 1292 1318 /* Scan for the values */ 1293 1319 if (3 != sscanf(buf+2, "%d:%d:%d", … … 1305 1331 int level, extra, wgt; 1306 1332 long cost; 1307 1308 /* There better be a current k_ptr */1309 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1310 1333 1311 1334 /* Scan for the values */ … … 1324 1347 { 1325 1348 int i; 1326 1327 /* There better be a current k_ptr */1328 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1329 1349 1330 1350 /* XXX Simply read each number following a colon */ … … 1360 1380 int ac, hd1, hd2, th, td, ta; 1361 1381 1362 /* There better be a current k_ptr */1363 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1364 1365 1382 /* Scan for the values */ 1366 1383 if (6 != sscanf(buf+2, "%d:%dd%d:%d:%d:%d", … … 1382 1399 int dd = 1; 1383 1400 1384 /* There better be a current k_ptr */1385 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1386 1387 1401 /* Assign base values */ 1388 1402 k_ptr->charge_base = 0; … … 1422 1436 int prob, dice, side; 1423 1437 1424 /* There better be a current k_ptr */1425 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1426 1427 1438 /* Scan for the values */ 1428 1439 if (3 != sscanf(buf+2, "%d:%dd%d", &prob, &dice, &side)) … … 1441 1452 else if (buf[0] == 'F') 1442 1453 { 1443 /* There better be a current k_ptr */1444 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1445 1446 1454 /* Parse every entry textually */ 1447 1455 for (s = buf + 2; *s; ) … … 1465 1473 } 1466 1474 1475 /* Process 'E' for effect */ 1476 else if (buf[0] == 'E') 1477 { 1478 /* Get the activation */ 1479 k_ptr->effect = grab_one_effect(buf + 2); 1480 1481 /* No luck */ 1482 if (!k_ptr->effect) 1483 return (PARSE_ERROR_GENERIC); 1484 } 1485 1467 1486 /* Process 'D' for "Description" */ 1468 1487 else if (buf[0] == 'D') 1469 1488 { 1470 /* There better be a current k_ptr */1471 if (!k_ptr) return (PARSE_ERROR_MISSING_RECORD_HEADER);1472 1473 /* Get the text */1474 s = buf+2;1475 1476 1489 /* Store the text */ 1477 if (!add_text(&(k_ptr->text), head, s))1490 if (!add_text(&(k_ptr->text), head, buf + 2)) 1478 1491 return (PARSE_ERROR_OUT_OF_MEMORY); 1479 1492 } trunk/src/obj-info.c
r314 r317 479 479 object_info_out_flags(o_ptr, &f1, &f2, &f3); 480 480 481 482 /* New para */ 483 new_paragraph = TRUE; 484 485 /* Describe boring bits */ 486 if (o_ptr->tval == TV_FOOD) 487 { 488 p_text_out("It provides nourishment for about "); 489 text_out_c(TERM_L_GREEN, "%d", o_ptr->pval / 2); 490 text_out(" turns under normal conditions."); 491 } 492 493 481 494 /* Describe the object */ 495 new_paragraph = TRUE; 482 496 if (describe_stats(o_ptr, f1)) something = TRUE; 483 497 if (describe_slay(o_ptr, f1)) something = TRUE; … … 573 587 574 588 /* Dump the info */ 575 new_paragraph = TRUE;576 589 has_info = object_info_out(o_ptr); 577 590 trunk/src/types.h
r316 r317 190 190 char x_char; /* Desired object character */ 191 191 192 u32b effect; /* Effect (defined in effects.h) */ 193 192 194 byte charge_base; /* Charge base */ 193 195 byte charge_dd, charge_ds; /* Charge dice/sides */ trunk/src/use-obj.c
r316 r317 11 11 #include "angband.h" 12 12 #include "script.h" 13 14 15 static bool eat_food(object_type *o_ptr, bool *ident) 16 { 17 /* Analyze the food */ 18 switch (o_ptr->sval) 19 { 20 case SV_FOOD_POISON: 21 { 22 if (!(p_ptr->resist_pois || p_ptr->timed[TMD_OPP_POIS])) 23 { 24 if (inc_timed(TMD_POISONED, rand_int(10) + 10)) 25 { 26 *ident = TRUE; 27 } 28 } 29 break; 30 } 31 32 case SV_FOOD_BLINDNESS: 33 { 34 if (!p_ptr->resist_blind) 35 { 36 if (inc_timed(TMD_BLIND, rand_int(200) + 200)) 37 { 38 *ident = TRUE; 39 } 40 } 41 break; 42 } 43 44 case SV_FOOD_PARANOIA: 45 { 46 if (!p_ptr->resist_fear) 47 { 48 if (inc_timed(TMD_AFRAID, rand_int(10) + 10)) 49 { 50 *ident = TRUE; 51 } 52 } 53 break; 54 } 55 56 case SV_FOOD_CONFUSION: 57 { 58 if (!p_ptr->resist_confu) 59 { 60 if (inc_timed(TMD_CONFUSED, rand_int(10) + 10)) 61 { 62 *ident = TRUE; 63 } 64 } 65 break; 66 } 67 68 case SV_FOOD_HALLUCINATION: 69 { 70 if (!p_ptr->resist_chaos) 71 { 72 if (inc_timed(TMD_IMAGE, rand_int(250) + 250)) 73 { 74 *ident = TRUE; 75 } 76 } 77 break; 78 } 79 80 case SV_FOOD_PARALYSIS: 81 { 82 if (!p_ptr->free_act) 83 { 84 if (inc_timed(TMD_PARALYZED, rand_int(10) + 10)) 85 { 86 *ident = TRUE; 87 } 88 } 89 break; 90 } 91 92 case SV_FOOD_WEAKNESS: 93 { 94 take_hit(damroll(6, 6), "poisonous food"); 95 (void)do_dec_stat(A_STR); 96 *ident = TRUE; 97 break; 98 } 99 100 case SV_FOOD_SICKNESS: 101 { 102 take_hit(damroll(6, 6), "poisonous food"); 103 (void)do_dec_stat(A_CON); 104 *ident = TRUE; 105 break; 106 } 107 108 case SV_FOOD_STUPIDITY: 109 { 110 take_hit(damroll(8, 8), "poisonous food"); 111 (void)do_dec_stat(A_INT); 112 *ident = TRUE; 113 break; 114 } 115 116 case SV_FOOD_NAIVETY: 117 { 118 take_hit(damroll(8, 8), "poisonous food"); 119 (void)do_dec_stat(A_WIS); 120 *ident = TRUE; 121 break; 122 } 123 124 case SV_FOOD_UNHEALTH: 125 { 126 take_hit(damroll(10, 10), "poisonous food"); 127 (void)do_dec_stat(A_CON); 128 *ident = TRUE; 129 break; 130 } 131 132 case SV_FOOD_DISEASE: 133 { 134 take_hit(damroll(10, 10), "poisonous food"); 135 (void)do_dec_stat(A_STR); 136 *ident = TRUE; 137 break; 138 } 139 140 case SV_FOOD_CURE_POISON: 141 { 142 if (clear_timed(TMD_POISONED)) *ident = TRUE; 143 break; 144 } 145 146 case SV_FOOD_CURE_BLINDNESS: 147 { 148 if (clear_timed(TMD_BLIND)) *ident = TRUE; 149 break; 150 } 151 152 case SV_FOOD_CURE_PARANOIA: 153 { 154 if (clear_timed(TMD_AFRAID)) *ident = TRUE; 155 break; 156 } 157 158 case SV_FOOD_CURE_CONFUSION: 159 { 160 if (clear_timed(TMD_CONFUSED)) *ident = TRUE; 161 break; 162 } 163 164 case SV_FOOD_CURE_SERIOUS: 165 { 166 if (hp_player(damroll(4, 8))) *ident = TRUE; 167 break; 168 } 169 170 case SV_FOOD_RESTORE_STR: 171 { 172 if (do_res_stat(A_STR)) *ident = TRUE; 173 break; 174 } 175 176 case SV_FOOD_RESTORE_CON: 177 { 178 if (do_res_stat(A_CON)) *ident = TRUE; 179 break; 180 } 181 182 case SV_FOOD_RESTORING: 183 { 184 if (do_res_stat(A_STR)) *ident = TRUE; 185 if (do_res_stat(A_INT)) *ident = TRUE; 186 if (do_res_stat(A_WIS)) *ident = TRUE; 187 if (do_res_stat(A_DEX)) *ident = TRUE; 188 if (do_res_stat(A_CON)) *ident = TRUE; 189 if (do_res_stat(A_CHR)) *ident = TRUE; 190 break; 191 } 192 193 194 case SV_FOOD_RATION: 195 case SV_FOOD_BISCUIT: 196 case SV_FOOD_JERKY: 197 case SV_FOOD_SLIME_MOLD: 198 { 199 msg_print("That tastes good."); 200 *ident = TRUE; 201 break; 202 } 203 204 case SV_FOOD_WAYBREAD: 205 { 206 msg_print("That tastes good."); 207 (void)clear_timed(TMD_POISONED); 208 (void)hp_player(damroll(4, 8)); 209 *ident = TRUE; 210 break; 211 } 212 213 case SV_FOOD_PINT_OF_ALE: 214 case SV_FOOD_PINT_OF_WINE: 215 { 216 msg_print("That tastes good."); 217 *ident = TRUE; 218 break; 219 } 220 } 221 222 /* Food can feed the player */ 223 (void)set_food(p_ptr->food + o_ptr->pval); 224 225 return (TRUE); 226 } 13 #include "effects.h" 227 14 228 15 … … 2419 2206 case TV_FOOD: 2420 2207 { 2421 used = eat_food(o_ptr, ident); 2208 /* Food can feed the player */ 2209 (void)set_food(p_ptr->food + o_ptr->pval); 2210 2211 /* Make it happen! */ 2212 used = do_effect(o_ptr, ident, dir); 2213 2422 2214 break; 2423 2215 }
