diff options
-rw-r--r-- | lib/edit/r_info.txt | 6 | ||||
-rw-r--r-- | lib/mods/theme/edit/r_info.txt | 6 | ||||
-rw-r--r-- | src/defines.h | 6 | ||||
-rw-r--r-- | src/init1.cc | 19 | ||||
-rw-r--r-- | src/monster_race.hpp | 3 | ||||
-rw-r--r-- | src/xtra2.cc | 38 |
6 files changed, 37 insertions, 41 deletions
diff --git a/lib/edit/r_info.txt b/lib/edit/r_info.txt index 92fc173a..252c1f2d 100644 --- a/lib/edit/r_info.txt +++ b/lib/edit/r_info.txt @@ -129,6 +129,7 @@ # S: spell frequency | # S: spell type | spell type | etc # D: Description +# A: a_ptr_index : %chance # 'N' indicates the beginning of an entry. The serial number must # increase for each new item. Entry 0 is used for the player. @@ -17660,6 +17661,7 @@ I:130:80d30:20:100:60 W:49:2:1400:25000 E:1:1:1:2:1:1 O:10:40:40:10 +A:84:50 B:HIT:HURT:3d8 B:HIT:HURT:3d8 B:HIT:HURT:3d8 @@ -22144,6 +22146,7 @@ I:120:70d100:100:100:0 W:60:1:1600:35000 E:1:1:1:2:1:1 O:0:0:100:0 +A:202:30 B:HIT:UN_BONUS:6d8 B:HIT:UN_BONUS:6d8 B:HIT:HURT:5d5 @@ -22993,6 +22996,7 @@ I:130:100d85:100:100:50 W:75:6:420000:35000 E:1:1:1:2:1:1 O:50:50:0:0 +A:26:50 B:HIT:HURT:12d15 B:HIT:HURT:12d15 B:HIT:HURT:12d15 @@ -26067,6 +26071,7 @@ I:130:120d100:100:140:0 W:95:1:17000:43000 E:1:1:1:2:1:1 O:0:100:0:0 +A:123:50 B:HIT:FIRE:9d12 B:HIT:FIRE:9d12 B:CRUSH:HURT:8d12 @@ -26765,6 +26770,7 @@ I:130:30d100:20:100:80 W:50:3:13000:30000 E:1:1:1:2:1:1 O:0:50:50:0 +A:71:60 B:HIT:FIRE:6d12 B:HIT:FIRE:6d12 B:CRUSH:HURT:5d12 diff --git a/lib/mods/theme/edit/r_info.txt b/lib/mods/theme/edit/r_info.txt index 87294e8b..f238fec8 100644 --- a/lib/mods/theme/edit/r_info.txt +++ b/lib/mods/theme/edit/r_info.txt @@ -130,6 +130,7 @@ # S: spell frequency | # S: spell type | spell type | etc # D: Description +# A: a_ptr_index : %chance # 'N' indicates the beginning of an entry. The serial number must # increase for each new item. Entry 0 is used for the player. @@ -18728,6 +18729,7 @@ I:130:80d30:20:100:60 W:49:2:1400:25000 E:1:1:1:2:1:1 O:10:40:40:10 +A:84:50 B:HIT:HURT:3d8 B:HIT:HURT:3d8 B:HIT:HURT:3d8 @@ -22496,6 +22498,7 @@ I:120:70d100:100:100:0 W:60:1:1600:35000 E:1:1:1:2:1:1 O:0:0:100:0 +A:202:30 B:HIT:UN_BONUS:6d8 B:HIT:UN_BONUS:6d8 B:HIT:HURT:5d5 @@ -23298,6 +23301,7 @@ I:130:100d85:100:100:50 W:75:6:420000:35000 E:1:1:1:2:1:1 O:50:50:0:0 +A:26:50 B:HIT:HURT:12d15 B:HIT:HURT:12d15 B:HIT:HURT:12d15 @@ -25666,6 +25670,7 @@ I:130:120d100:100:140:0 W:95:1:17000:43000 E:1:1:1:2:1:1 O:0:100:0:0 +A:123:50 B:HIT:FIRE:9d12 B:HIT:FIRE:9d12 B:CRUSH:HURT:8d12 @@ -26265,6 +26270,7 @@ I:130:30d100:20:100:80 W:50:3:13000:30000 E:1:1:1:2:1:1 O:0:50:50:0 +A:71:60 B:HIT:FIRE:6d12 B:HIT:FIRE:6d12 B:CRUSH:HURT:5d12 diff --git a/src/defines.h b/src/defines.h index dc9dbfb8..519dc535 100644 --- a/src/defines.h +++ b/src/defines.h @@ -678,19 +678,13 @@ /*** Artifact indexes (see "lib/edit/a_info.txt") ***/ -#define ART_PALANTIR 202 #define ART_ANCHOR 14 #define ART_POWER 13 -#define ART_MARDA 26 #define ART_MORGOTH 34 #define ART_NARSIL 164 -#define ART_CALRIS 71 #define ART_GLAMDRING 73 #define ART_ANDURIL 83 -#define ART_ANGUIREL 84 -#define ART_NIMLOTH 99 #define ART_GROND 111 -#define ART_GOTHMOG 123 /* Spell for various object */ #define SPELL_ID_PLAIN 1 diff --git a/src/init1.cc b/src/init1.cc index 75a75d3a..10698d2d 100644 --- a/src/init1.cc +++ b/src/init1.cc @@ -5769,6 +5769,25 @@ errr init_r_info_txt(FILE *fp) continue; } + /* Process 'A' for standard artifact drop (one line only) */ + if (buf[0] == 'A') + { + int artifact_idx; + int artifact_chance; + + /* Scan for values */ + if (2 != sscanf(buf + 2, "%d:%d", + &artifact_idx, + &artifact_chance)) return (1); + + /* Save the values */ + r_ptr->artifact_idx = artifact_idx; + r_ptr->artifact_chance = artifact_chance; + + /* Next... */ + continue; + } + /* Process 'W' for "More Info" (one line only) */ if (buf[0] == 'W') { diff --git a/src/monster_race.hpp b/src/monster_race.hpp index 7e5d5082..f756d6ff 100644 --- a/src/monster_race.hpp +++ b/src/monster_race.hpp @@ -59,6 +59,9 @@ struct monster_race byte body_parts[BODY_MAX]; /* To help to decide what to use when body changing */ + byte artifact_idx; /* Artifact index of standard artifact dropped; 0 if none. */ + int artifact_chance; /* Percentage chance of dropping the artifact. */ + byte level; /* Level of creature */ byte rarity; /* Rarity of creature */ diff --git a/src/xtra2.cc b/src/xtra2.cc index 707005cd..d3e01b71 100644 --- a/src/xtra2.cc +++ b/src/xtra2.cc @@ -2771,40 +2771,8 @@ void monster_death(int m_idx) } else { - byte a_idx = 0; - int chance = 0; - int I_kind = 0; - - if (strstr(r_ptr->name, "Marda, rider of the Gold Laronth")) - { - a_idx = ART_MARDA; - chance = 50; - } - else if (strstr(r_ptr->name, "Saruman of Many Colours")) - { - a_idx = ART_PALANTIR; - chance = 30; - } - else if (strstr(r_ptr->name, "Hagen, son of Alberich")) - { - a_idx = ART_NIMLOTH; - chance = 66; - } - else if (strstr(r_ptr->name, "Durin's Bane")) - { - a_idx = ART_CALRIS; - chance = 60; - } - else if (strstr(r_ptr->name, "Gothmog, the High Captain of Balrogs")) - { - a_idx = ART_GOTHMOG; - chance = 50; - } - else if (strstr(r_ptr->name, "Eol, the Dark Elf")) - { - a_idx = ART_ANGUIREL; - chance = 50; - } + byte a_idx = r_ptr->artifact_idx; + int chance = r_ptr->artifact_chance; if ((a_idx > 0) && ((randint(99) < chance) || (wizard))) { @@ -2819,7 +2787,7 @@ void monster_death(int m_idx) object_wipe(q_ptr); /* Acquire the "kind" index */ - I_kind = lookup_kind(a_ptr->tval, a_ptr->sval); + int I_kind = lookup_kind(a_ptr->tval, a_ptr->sval); /* Create the artifact */ object_prep(q_ptr, I_kind); |