Changeset 895
- Timestamp:
- 05/11/08 22:23:55 (4 months ago)
- Files:
-
- trunk/src/attack.c (modified) (6 diffs)
- trunk/src/birth.c (modified) (7 diffs)
- trunk/src/cave.c (modified) (4 diffs)
- trunk/src/cmd1.c (modified) (1 diff)
- trunk/src/cmd2.c (modified) (21 diffs)
- trunk/src/cmd5.c (modified) (4 diffs)
- trunk/src/cmd6.c (modified) (1 diff)
- trunk/src/dungeon.c (modified) (3 diffs)
- trunk/src/effects.c (modified) (39 diffs)
- trunk/src/generate.c (modified) (52 diffs)
- trunk/src/melee1.c (modified) (28 diffs)
- trunk/src/melee2.c (modified) (52 diffs)
- trunk/src/monster2.c (modified) (12 diffs)
- trunk/src/obj-make.c (modified) (34 diffs)
- trunk/src/obj-util.c (modified) (10 diffs)
- trunk/src/randart.c (modified) (18 diffs)
- trunk/src/randname.c (modified) (1 diff)
- trunk/src/snd-sdl.c (modified) (1 diff)
- trunk/src/spells1.c (modified) (61 diffs)
- trunk/src/spells2.c (modified) (33 diffs)
- trunk/src/store.c (modified) (13 diffs)
- trunk/src/trap.c (modified) (10 diffs)
- trunk/src/ui-birth.c (modified) (1 diff)
- trunk/src/wizard.c (modified) (1 diff)
- trunk/src/x-spell.c (modified) (22 diffs)
- trunk/src/xtra2.c (modified) (7 diffs)
- trunk/src/z-rand.c (modified) (6 diffs)
- trunk/src/z-rand.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/attack.c
r887 r895 79 79 80 80 /* Percentile dice */ 81 k = rand _int(100);81 k = randint0(100); 82 82 83 83 /* Hack -- Instant miss or hit */ … … 88 88 89 89 /* Power competes against armor */ 90 if ((chance > 0) && (rand _int(chance) >= (ac * 3 / 4))) return (TRUE);90 if ((chance > 0) && (randint0(chance) >= (ac * 3 / 4))) return (TRUE); 91 91 92 92 /* Assume miss */ … … 108 108 109 109 /* Critical hit */ 110 if (randint (5000) <= i)111 { 112 k = weight + randint (500);110 if (randint1(5000) <= i) 111 { 112 k = weight + randint1(500); 113 113 114 114 if (k < 500) … … 147 147 148 148 /* Chance */ 149 if (randint (5000) <= i)150 { 151 k = weight + randint (650);149 if (randint1(5000) <= i) 150 { 151 k = weight + randint1(650); 152 152 153 153 if (k < 400) … … 524 524 msg_format("%^s is unaffected.", m_name); 525 525 } 526 else if (rand _int(100) < r_ptr->level)526 else if (randint0(100) < r_ptr->level) 527 527 { 528 528 msg_format("%^s is unaffected.", m_name); … … 531 531 { 532 532 msg_format("%^s appears confused.", m_name); 533 m_ptr->confused += 10 + rand _int(p_ptr->lev) / 5;533 m_ptr->confused += 10 + randint0(p_ptr->lev) / 5; 534 534 } 535 535 } trunk/src/birth.c
r887 r895 191 191 else if (value < 18+70) 192 192 { 193 value += ((auto_roll ? 15 : randint (15)) + 5);193 value += ((auto_roll ? 15 : randint1(15)) + 5); 194 194 } 195 195 else if (value < 18+90) 196 196 { 197 value += ((auto_roll ? 6 : randint (6)) + 2);197 value += ((auto_roll ? 6 : randint1(6)) + 2); 198 198 } 199 199 else if (value < 18+100) … … 232 232 { 233 233 /* Roll the dice */ 234 dice[i] = randint (3 + i % 3);234 dice[i] = randint1(3 + i % 3); 235 235 236 236 /* Collect the maximum */ … … 315 315 for (i = 1; i < PY_MAX_LEVEL; i++) 316 316 { 317 j = randint (p_ptr->hitdie);317 j = randint1(p_ptr->hitdie); 318 318 p_ptr->player_hp[i] = p_ptr->player_hp[i-1] + j; 319 319 } … … 360 360 361 361 /* Initial social class */ 362 social_class = randint (4);362 social_class = randint1(4); 363 363 364 364 /* Starting place */ … … 373 373 374 374 /* Roll for nobility */ 375 roll = randint (100);375 roll = randint1(100); 376 376 377 377 /* Get the proper entry in the table */ … … 405 405 { 406 406 /* Calculate the age */ 407 p_ptr->age = rp_ptr->b_age + randint (rp_ptr->m_age);407 p_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age); 408 408 409 409 /* Calculate the height/weight for males */ … … 435 435 436 436 /* Social Class determines starting gold */ 437 gold = (p_ptr->sc * 6) + randint (100) + 300;437 gold = (p_ptr->sc * 6) + randint1(100) + 300; 438 438 439 439 /* Process the stats */ trunk/src/cave.c
r887 r895 352 352 { 353 353 /* Select a random monster */ 354 r_ptr = &r_info[rand _int(z_info->r_max)];354 r_ptr = &r_info[randint0(z_info->r_max)]; 355 355 356 356 /* Skip non-entries */ … … 380 380 { 381 381 /* Select a random object */ 382 k_ptr = &k_info[rand _int(z_info->k_max - 1) + 1];382 k_ptr = &k_info[randint0(z_info->k_max - 1) + 1]; 383 383 384 384 /* Skip non-entries */ … … 726 726 { 727 727 /* Multi-hued attr */ 728 a = randint (15);728 a = randint1(15); 729 729 730 730 /* Normal char */ … … 976 976 { 977 977 /* Normally, make an imaginary monster */ 978 if (rand _int(100) < 75)978 if (randint0(100) < 75) 979 979 { 980 980 g->m_idx = 1; trunk/src/cmd1.c
r889 r895 50 50 { 51 51 /* Sometimes, notice things */ 52 if (rand _int(100) < chance)52 if (randint0(100) < chance) 53 53 { 54 54 /* Invisible trap */ trunk/src/cmd2.c
r889 r895 229 229 230 230 /* Small chests often drop gold */ 231 if (tiny && (rand _int(100) < 75))231 if (tiny && (randint0(100) < 75)) 232 232 make_gold(i_ptr, value); 233 233 … … 295 295 if (!(p_ptr->resist_pois || p_ptr->timed[TMD_OPP_POIS])) 296 296 { 297 (void)inc_timed(TMD_POISONED, 10 + randint (20));297 (void)inc_timed(TMD_POISONED, 10 + randint1(20)); 298 298 } 299 299 } … … 305 305 if (!p_ptr->free_act) 306 306 { 307 (void)inc_timed(TMD_PARALYZED, 10 + randint (20));307 (void)inc_timed(TMD_PARALYZED, 10 + randint1(20)); 308 308 } 309 309 } … … 312 312 if (trap & (CHEST_SUMMON)) 313 313 { 314 int num = 2 + randint (3);314 int num = 2 + randint1(3); 315 315 msg_print("You are enveloped in a cloud of smoke!"); 316 316 sound(MSG_SUM_MONSTER); … … 370 370 371 371 /* Success -- May still have traps */ 372 if (rand _int(100) < j)372 if (randint0(100) < j) 373 373 { 374 374 message(MSG_LOCKPICK, 0, "You have picked the lock."); … … 456 456 457 457 /* Success (get a lot of experience) */ 458 else if (rand _int(100) < j)458 else if (randint0(100) < j) 459 459 { 460 460 message(MSG_DISARM, 0, "You have disarmed the chest."); … … 464 464 465 465 /* Failure -- Keep trying */ 466 else if ((i > 5) && (randint (i) > 5))466 else if ((i > 5) && (randint1(i) > 5)) 467 467 { 468 468 /* We may keep trying */ … … 691 691 692 692 /* Success */ 693 if (rand _int(100) < j)693 if (randint0(100) < j) 694 694 { 695 695 /* Message */ … … 1091 1091 { 1092 1092 /* Tunnel */ 1093 if ((p_ptr->skills[SKILL_DIGGING] > 40 + rand _int(1600)) && twall(y, x))1093 if ((p_ptr->skills[SKILL_DIGGING] > 40 + randint0(1600)) && twall(y, x)) 1094 1094 { 1095 1095 msg_print("You have finished the tunnel."); … … 1127 1127 if (hard) 1128 1128 { 1129 okay = (p_ptr->skills[SKILL_DIGGING] > 20 + rand _int(800));1129 okay = (p_ptr->skills[SKILL_DIGGING] > 20 + randint0(800)); 1130 1130 } 1131 1131 … … 1133 1133 else 1134 1134 { 1135 okay = (p_ptr->skills[SKILL_DIGGING] > 10 + rand _int(400));1135 okay = (p_ptr->skills[SKILL_DIGGING] > 10 + randint0(400)); 1136 1136 } 1137 1137 … … 1178 1178 { 1179 1179 /* Remove the rubble */ 1180 if ((p_ptr->skills[SKILL_DIGGING] > rand _int(200)) && twall(y, x))1180 if ((p_ptr->skills[SKILL_DIGGING] > randint0(200)) && twall(y, x)) 1181 1181 { 1182 1182 /* Message */ … … 1184 1184 1185 1185 /* Hack -- place an object */ 1186 if (rand _int(100) < 10)1186 if (randint0(100) < 10) 1187 1187 { 1188 1188 /* Create a simple object */ … … 1210 1210 { 1211 1211 /* Tunnel */ 1212 if ((p_ptr->skills[SKILL_DIGGING] > 30 + rand _int(1200)) && twall(y, x))1212 if ((p_ptr->skills[SKILL_DIGGING] > 30 + randint0(1200)) && twall(y, x)) 1213 1213 { 1214 1214 msg_print("You have finished the tunnel."); … … 1223 1223 1224 1224 /* Occasional Search XXX XXX */ 1225 if (rand _int(100) < 25) search();1225 if (randint0(100) < 25) search(); 1226 1226 } 1227 1227 } … … 1231 1231 { 1232 1232 /* Tunnel */ 1233 if ((p_ptr->skills[SKILL_DIGGING] > 30 + rand _int(1200)) && twall(y, x))1233 if ((p_ptr->skills[SKILL_DIGGING] > 30 + randint0(1200)) && twall(y, x)) 1234 1234 { 1235 1235 msg_print("You have finished the tunnel."); … … 1395 1395 1396 1396 /* Success */ 1397 if (rand _int(100) < j)1397 if (randint0(100) < j) 1398 1398 { 1399 1399 /* Message */ … … 1411 1411 1412 1412 /* Failure -- Keep trying */ 1413 else if ((i > 5) && (randint (i) > 5))1413 else if ((i > 5) && (randint1(i) > 5)) 1414 1414 { 1415 1415 /* Failure */ … … 1607 1607 1608 1608 /* Hack -- attempt to bash down the door */ 1609 if (rand _int(100) < temp)1609 if (randint0(100) < temp) 1610 1610 { 1611 1611 /* Break down the door */ 1612 if (rand _int(100) < 50)1612 if (randint0(100) < 50) 1613 1613 { 1614 1614 cave_set_feat(y, x, FEAT_BROKEN); … … 1629 1629 1630 1630 /* Saving throw against stun */ 1631 else if (rand _int(100) < adj_dex_safe[p_ptr->stat_ind[A_DEX]] +1631 else if (randint0(100) < adj_dex_safe[p_ptr->stat_ind[A_DEX]] + 1632 1632 p_ptr->lev) 1633 1633 { … … 1646 1646 1647 1647 /* Hack -- Lose balance ala paralysis */ 1648 (void)inc_timed(TMD_PARALYZED, 2 + rand _int(2));1648 (void)inc_timed(TMD_PARALYZED, 2 + randint0(2)); 1649 1649 } 1650 1650 trunk/src/cmd5.c
r887 r895 541 541 542 542 /* Apply the randomizer */ 543 if ((++k > 1) && (rand _int(k) != 0)) continue;543 if ((++k > 1) && (randint0(k) != 0)) continue; 544 544 545 545 /* Track it */ … … 628 628 629 629 /* Failed spell */ 630 if (rand _int(100) < chance)630 if (randint0(100) < chance) 631 631 { 632 632 if (flush_failure) flush(); … … 677 677 678 678 /* Hack -- Bypass free action */ 679 (void)inc_timed(TMD_PARALYZED, randint (5 * oops + 1));679 (void)inc_timed(TMD_PARALYZED, randint1(5 * oops + 1)); 680 680 681 681 /* Damage CON (possibly permanently) */ 682 if (rand _int(100) < 50)683 { 684 bool perm = (rand _int(100) < 25);682 if (randint0(100) < 50) 683 { 684 bool perm = (randint0(100) < 25); 685 685 686 686 /* Message */ … … 688 688 689 689 /* Reduce constitution */ 690 (void)dec_stat(A_CON, 15 + randint (10), perm);690 (void)dec_stat(A_CON, 15 + randint1(10), perm); 691 691 } 692 692 } trunk/src/cmd6.c
r887 r895 65 65 66 66 /* Roll for usage */ 67 if ((chance < USE_DEVICE) || (randint (chance) < USE_DEVICE))67 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE)) 68 68 { 69 69 if (flush_failure) flush(); trunk/src/dungeon.c
r887 r895 656 656 while (1) 657 657 { 658 n = rand _int(MAX_STORES);658 n = randint0(MAX_STORES); 659 659 if (n != STORE_HOME) break; 660 660 } … … 785 785 786 786 /* Hack -- faint (bypass free action) */ 787 (void)inc_timed(TMD_PARALYZED, 1 + rand _int(5));787 (void)inc_timed(TMD_PARALYZED, 1 + randint0(5)); 788 788 } 789 789 } … … 1803 1803 1804 1804 /* Hack -- seed for flavors */ 1805 seed_flavor = rand _int(0x10000000);1805 seed_flavor = randint0(0x10000000); 1806 1806 1807 1807 /* Hack -- seed for town layout */ 1808 seed_town = rand _int(0x10000000);1808 seed_town = randint0(0x10000000); 1809 1809 1810 1810 /* Hack -- seed for random artifacts */ 1811 seed_randart = rand _int(0x10000000);1811 seed_randart = randint0(0x10000000); 1812 1812 1813 1813 /* Roll up a new character. Quickstart is allowed if ht_birth is set */ trunk/src/effects.c
r761 r895 178 178 case EF_SCARE: 179 179 { 180 if (!p_ptr->resist_fear && inc_timed(TMD_AFRAID, rand _int(10) + 10))180 if (!p_ptr->resist_fear && inc_timed(TMD_AFRAID, randint0(10) + 10)) 181 181 *ident = TRUE; 182 182 … … 194 194 case EF_HALLUC: 195 195 { 196 if (!p_ptr->resist_chaos && inc_timed(TMD_IMAGE, rand _int(250) + 250))196 if (!p_ptr->resist_chaos && inc_timed(TMD_IMAGE, randint0(250) + 250)) 197 197 *ident = TRUE; 198 198 … … 202 202 case EF_PARALYZE: 203 203 { 204 if (!p_ptr->free_act && inc_timed(TMD_PARALYZED, rand _int(5) + 5))204 if (!p_ptr->free_act && inc_timed(TMD_PARALYZED, randint0(5) + 5)) 205 205 *ident = TRUE; 206 206 … … 210 210 case EF_SLOW: 211 211 { 212 if (inc_timed(TMD_SLOW, randint (25) + 15)) *ident = TRUE;212 if (inc_timed(TMD_SLOW, randint1(25) + 15)) *ident = TRUE; 213 213 return TRUE; 214 214 } … … 414 414 { 415 415 /* Pick a random stat to decrease other than strength */ 416 int stat = rand _int(A_MAX-1) + 1;416 int stat = randint0(A_MAX-1) + 1; 417 417 418 418 if (!do_dec_stat(stat, TRUE)) return FALSE; … … 424 424 { 425 425 /* Pick a random stat to decrease other than intelligence */ 426 int stat = rand _int(A_MAX-1);426 int stat = randint0(A_MAX-1); 427 427 if (stat >= A_INT) stat++; 428 428 … … 435 435 { 436 436 /* Pick a random stat to decrease other than wisdom */ 437 int stat = rand _int(A_MAX-1);437 int stat = randint0(A_MAX-1); 438 438 if (stat >= A_WIS) stat++; 439 439 … … 446 446 { 447 447 /* Pick a random stat to decrease other than constitution */ 448 int stat = rand _int(A_MAX-1);448 int stat = randint0(A_MAX-1); 449 449 if (stat >= A_CON) stat++; 450 450 … … 457 457 { 458 458 /* Pick a random stat to decrease other than dexterity */ 459 int stat = rand _int(A_MAX-1);459 int stat = randint0(A_MAX-1); 460 460 if (stat >= A_DEX) stat++; 461 461 … … 468 468 { 469 469 /* Pick a random stat to decrease other than charisma */ 470 int stat = rand _int(A_MAX-1);470 int stat = randint0(A_MAX-1); 471 471 472 472 if (!do_dec_stat(stat, TRUE)) return FALSE; … … 618 618 if (hp_player(10)) *ident = TRUE; 619 619 if (clear_timed(TMD_AFRAID)) *ident = TRUE; 620 if (inc_timed(TMD_HERO, randint (25) + 25)) *ident = TRUE;620 if (inc_timed(TMD_HERO, randint1(25) + 25)) *ident = TRUE; 621 621 return TRUE; 622 622 } … … 626 626 if (hp_player(30)) *ident = TRUE; 627 627 if (clear_timed(TMD_AFRAID)) *ident = TRUE; 628 if (inc_timed(TMD_SHERO, randint (25) + 25)) *ident = TRUE;628 if (inc_timed(TMD_SHERO, randint1(25) + 25)) *ident = TRUE; 629 629 return TRUE; 630 630 } … … 668 668 case EF_RESIST_ALL: 669 669 { 670 if (inc_timed(TMD_OPP_ACID, randint (20) + 20)) *ident = TRUE;671 if (inc_timed(TMD_OPP_ELEC, randint (20) + 20)) *ident = TRUE;672 if (inc_timed(TMD_OPP_FIRE, randint (20) + 20)) *ident = TRUE;673 if (inc_timed(TMD_OPP_COLD, randint (20) + 20)) *ident = TRUE;674 if (inc_timed(TMD_OPP_POIS, randint (20) + 20)) *ident = TRUE;670 if (inc_timed(TMD_OPP_ACID, randint1(20) + 20)) *ident = TRUE; 671 if (inc_timed(TMD_OPP_ELEC, randint1(20) + 20)) *ident = TRUE; 672 if (inc_timed(TMD_OPP_FIRE, randint1(20) + 20)) *ident = TRUE; 673 if (inc_timed(TMD_OPP_COLD, randint1(20) + 20)) *ident = TRUE; 674 if (inc_timed(TMD_OPP_POIS, randint1(20) + 20)) *ident = TRUE; 675 675 return TRUE; 676 676 } … … 730 730 { 731 731 *ident = TRUE; 732 if (!enchant_spell(randint (3), randint(3), 0)) return FALSE;732 if (!enchant_spell(randint1(3), randint1(3), 0)) return FALSE; 733 733 return TRUE; 734 734 } … … 744 744 { 745 745 *ident = TRUE; 746 if (!enchant_spell(0, 0, randint (3) + 2)) return FALSE;746 if (!enchant_spell(0, 0, randint1(3) + 2)) return FALSE; 747 747 return TRUE; 748 748 } … … 787 787 sound(MSG_SUM_MONSTER); 788 788 789 for (i = 0; i < randint (3); i++)789 for (i = 0; i < randint1(3); i++) 790 790 { 791 791 if (summon_specific(py, px, p_ptr->depth, 0)) … … 800 800 sound(MSG_SUM_UNDEAD); 801 801 802 for (i = 0; i < randint (3); i++)802 for (i = 0; i < randint1(3); i++) 803 803 { 804 804 if (summon_specific(py, px, p_ptr->depth, SUMMON_UNDEAD)) … … 863 863 case EF_ACQUIRE2: 864 864 { 865 acquirement(py, px, p_ptr->depth, randint (2) + 1, TRUE);865 acquirement(py, px, p_ptr->depth, randint1(2) + 1, TRUE); 866 866 *ident = TRUE; 867 867 return TRUE; … … 906 906 if (!p_ptr->resist_blind) 907 907 { 908 (void)inc_timed(TMD_BLIND, 3 + randint (5));908 (void)inc_timed(TMD_BLIND, 3 + randint1(5)); 909 909 } 910 910 if (unlite_area(10, 3)) *ident = TRUE; … … 914 914 case EF_PROTEVIL: 915 915 { 916 if (inc_timed(TMD_PROTEVIL, randint (25) + 3 * p_ptr->lev)) *ident = TRUE;916 if (inc_timed(TMD_PROTEVIL, randint1(25) + 3 * p_ptr->lev)) *ident = TRUE; 917 917 return TRUE; 918 918 } … … 938 938 case EF_BLESSING: 939 939 { 940 if (inc_timed(TMD_BLESSED, randint (12) + 6)) *ident = TRUE;940 if (inc_timed(TMD_BLESSED, randint1(12) + 6)) *ident = TRUE; 941 941 return TRUE; 942 942 } … … 944 944 case EF_BLESSING2: 945 945 { 946 if (inc_timed(TMD_BLESSED, randint (24) + 12)) *ident = TRUE;946 if (inc_timed(TMD_BLESSED, randint1(24) + 12)) *ident = TRUE; 947 947 return TRUE; 948 948 } … … 950 950 case EF_BLESSING3: 951 951 { 952 if (inc_timed(TMD_BLESSED, randint (48) + 24)) *ident = TRUE;952 if (inc_timed(TMD_BLESSED, randint1(48) + 24)) *ident = TRUE; 953 953 return TRUE; 954 954 } … … 1058 1058 (void)hp_player(30); 1059 1059 (void)clear_timed(TMD_AFRAID); 1060 (void)inc_timed(TMD_SHERO, randint (50) + 50);1061 (void)inc_timed(TMD_BLESSED, randint (50) + 50);1062 (void)inc_timed(TMD_OPP_ACID, randint (50) + 50);1063 (void)inc_timed(TMD_OPP_ELEC, randint (50) + 50);1064 (void)inc_timed(TMD_OPP_FIRE, randint (50) + 50);1065 (void)inc_timed(TMD_OPP_COLD, randint (50) + 50);1066 (void)inc_timed(TMD_OPP_POIS, randint (50) + 50);1060 (void)inc_timed(TMD_SHERO, randint1(50) + 50); 1061 (void)inc_timed(TMD_BLESSED, randint1(50) + 50); 1062 (void)inc_timed(TMD_OPP_ACID, randint1(50) + 50); 1063 (void)inc_timed(TMD_OPP_ELEC, randint1(50) + 50); 1064 (void)inc_timed(TMD_OPP_FIRE, randint1(50) + 50); 1065 (void)inc_timed(TMD_OPP_COLD, randint1(50) + 50); 1066 (void)inc_timed(TMD_OPP_POIS, randint1(50) + 50); 1067 1067 return TRUE; 1068 1068 } … … 1132 1132 if (!p_ptr->timed[TMD_FAST]) 1133 1133 { 1134 if (set_timed(TMD_FAST, randint (20) + 20)) *ident = TRUE;1134 if (set_timed(TMD_FAST, randint1(20) + 20)) *ident = TRUE; 1135 1135 } 1136 1136 else … … 1146 1146 if (!p_ptr->timed[TMD_FAST]) 1147 1147 { 1148 if (set_timed(TMD_FAST, randint (75) + 75)) *ident = TRUE;1148 if (set_timed(TMD_FAST, randint1(75) + 75)) *ident = TRUE; 1149 1149 } 1150 1150 else … … 1454 1454 case EF_BERSERKER: 1455 1455 { 1456 if (inc_timed(TMD_SHERO, randint (50) + 50)) *ident = TRUE;1456 if (inc_timed(TMD_SHERO, randint1(50) + 50)) *ident = TRUE; 1457 1457 return TRUE; 1458 1458 } … … 1461 1461 case EF_WONDER: 1462 1462 { 1463 if (spell_wonder(dir, randint (100) + p_ptr->lev / 5, beam)) *ident = TRUE;1463 if (spell_wonder(dir, randint1(100) + p_ptr->lev / 5, beam)) *ident = TRUE; 1464 1464 return TRUE; 1465 1465 } … … 1478 1478 }; 1479 1479 /* pick a random (type, damage) tuple in the table */ 1480 int which = 2 * rand _int(sizeof(breath_types) / (2 * sizeof(int)));1480 int which = 2 * randint0(sizeof(breath_types) / (2 * sizeof(int))); 1481 1481 if (fire_ball(breath_types[which], dir, breath_types[which + 1], 3)) 1482 1482 *ident = TRUE; … … 1501 1501 { 1502 1502 if (dispel_evil(120)) *ident = TRUE; 1503 if (inc_timed(TMD_PROTEVIL, randint (25) + 3 * p_ptr->lev)) *ident = TRUE;1503 if (inc_timed(TMD_PROTEVIL, randint1(25) + 3 * p_ptr->lev)) *ident = TRUE; 1504 1504 if (clear_timed(TMD_POISONED)) *ident = TRUE; 1505 1505 if (clear_timed(TMD_AFRAID)) *ident = TRUE; … … 1579 1579 *ident = TRUE; 1580 1580 fire_ball(GF_ACID, dir, 70, 2); 1581 inc_timed(TMD_OPP_ACID, randint (20) + 20);1581 inc_timed(TMD_OPP_ACID, randint1(20) + 20); 1582 1582 return TRUE; 1583 1583 } … … 1587 1587 *ident = TRUE; 1588 1588 fire_ball(GF_FIRE, dir, 80, 2); 1589 inc_timed(TMD_OPP_FIRE, randint (20) + 20);1589 inc_timed(TMD_OPP_FIRE, randint1(20) + 20); 1590 1590 return TRUE; 1591 1591 } … … 1595 1595 *ident = TRUE; 1596 1596 fire_ball(GF_COLD, dir, 75, 2); 1597 inc_timed(TMD_OPP_COLD, randint (20) + 20);1597 inc_timed(TMD_OPP_COLD, randint1(20) + 20); 1598 1598 return TRUE; 1599 1599 } … … 1603 1603 *ident = TRUE; 1604 1604 fire_ball(GF_ELEC, dir, 85, 2); 1605 inc_timed(TMD_OPP_ELEC, randint (20) + 20);1605 inc_timed(TMD_OPP_ELEC, randint1(20) + 20); 1606 1606 return TRUE; 1607 1607 } … … 1647 1647 }; 1648 1648 1649 int chance = randint (5);1649 int chance = randint0(5); 1650 1650 sound(mh[chance].sound); 1651 1651 msg_format("You breathe %s.", mh[chance].msg); … … 1672 1672 case EF_DRAGON_CHAOS: 1673 1673 { 1674 int chance = rand _int(2);1674 int chance = randint0(2); 1675 1675 sound(((chance == 1 ? MSG_BR_CHAOS : MSG_BR_DISENCHANT))); 1676 1676 msg_format("You breathe %s.", … … 1683 1683 case EF_DRAGON_LAW: 1684 1684 { 1685 int chance = rand _int(2);1685 int chance = randint0(2); 1686 1686 sound(((chance == 1 ? MSG_BR_SOUND : MSG_BR_SHARDS))); 1687 1687 msg_format("You breathe %s.", … … 1694 1694 case EF_DRAGON_BALANCE: 1695 1695 { 1696 int chance = rand _int(4);1696 int chance = randint0(4); 1697 1697 msg_format("You breathe %s.", 1698 1698 ((chance == 1) ? "chaos" : … … 1708 1708 case EF_DRAGON_SHINING: 1709 1709 { 1710 int chance = rand _int(2);1710 int chance = randint0(2); 1711 1711 sound(((chance == 0 ? MSG_BR_LIGHT : MSG_BR_DARK))); 1712 1712 msg_format("You breathe %s.", trunk/src/generate.c
r849 r895 283 283 if (*rdir && *cdir) 284 284 { 285 if (rand _int(100) < 50)285 if (randint0(100) < 50) 286 286 { 287 287 *rdir = 0; … … 301 301 { 302 302 /* Pick a random direction */ 303 int i = rand _int(4);303 int i = randint0(4); 304 304 305 305 /* Extract the dy/dx components */ … … 419 419 place_up_stairs(y, x); 420 420 } 421 else if (rand _int(100) < 50)421 else if (randint0(100) < 50) 422 422 { 423 423 place_down_stairs(y, x); … … 448 448 { 449 449 /* Pick a random grid */ 450 y = rand _int(DUNGEON_HGT);451 x = rand _int(DUNGEON_WID); <
