diff options
-rw-r--r-- | src/birth.cc | 6 | ||||
-rw-r--r-- | src/bldg.cc | 261 | ||||
-rw-r--r-- | src/defines.h | 4 | ||||
-rw-r--r-- | src/dungeon.cc | 7 | ||||
-rw-r--r-- | src/externs.h | 3 | ||||
-rw-r--r-- | src/files.cc | 2 | ||||
-rw-r--r-- | src/loadsave.cc | 13 | ||||
-rw-r--r-- | src/variable.cc | 11 |
8 files changed, 8 insertions, 299 deletions
diff --git a/src/birth.cc b/src/birth.cc index 0191c9fc..a4ad1d3f 100644 --- a/src/birth.cc +++ b/src/birth.cc @@ -932,9 +932,6 @@ static void player_wipe(void) p_ptr->body_monster = 0; p_ptr->disembodied = FALSE; - /* Wipe the bounties */ - total_bounties = 0; - /* Wipe xtra hp */ p_ptr->hp_mod = 0; @@ -3361,9 +3358,6 @@ void player_birth(void) wild_map[j][i].known = FALSE; } } - - /* Select bounty monsters. */ - select_bounties(); } diff --git a/src/bldg.cc b/src/bldg.cc index a0724c33..f77efa4c 100644 --- a/src/bldg.cc +++ b/src/bldg.cc @@ -611,9 +611,6 @@ static bool_ inn_comm(int cmd) p_ptr->oldpx = p_ptr->px; p_ptr->oldpy = p_ptr->py; - /* Select new bounties. */ - select_bounties(); - break; } @@ -1080,251 +1077,6 @@ static bool_ research_item(void) } -/* - * Show the current quest monster. - */ -static void show_quest_monster(void) -{ - monster_race* r_ptr = &r_info[bounties[0][0]]; - - - msg_format("Quest monster: %s. " - "Need to turn in %d corpse%s to receive reward.", - r_ptr->name, bounties[0][1], - (bounties[0][1] > 1 ? "s" : "")); - msg_print(NULL); -} - - -/* Filter to match the quest monster's corpse. */ -static bool_ item_tester_hook_quest_monster(object_type* o_ptr) -{ - if ((o_ptr->tval == TV_CORPSE) && - (o_ptr->pval2 == bounties[0][0])) return (TRUE); - return (FALSE); -} - - -/* - * Hook for bounty monster selection. - */ -static bool_ mon_hook_bounty(int r_idx) -{ - monster_race* r_ptr = &r_info[r_idx]; - - - /* Reject uniques */ - if (r_ptr->flags1 & RF1_UNIQUE) return (FALSE); - - /* Reject those who cannot leave anything */ - if (!(r_ptr->flags9 & RF9_DROP_CORPSE) && - !(r_ptr->flags9 & RF9_DROP_SKELETON)) return (FALSE); - - /* Reject pets */ - if (r_ptr->flags7 & RF7_PET) return (FALSE); - - /* Reject friendly creatures */ - if (r_ptr->flags7 & RF7_FRIENDLY) return (FALSE); - - /* The rest are acceptable */ - return (TRUE); -} - - -static void select_quest_monster(void) -{ - monster_race* r_ptr; - - int amt; - - - /* - * Set up the hooks -- no bounties on uniques or monsters - * with no corpses - */ - get_mon_num_hook = mon_hook_bounty; - get_mon_num_prep(); - - /* Set up the quest monster. */ - bounties[0][0] = get_mon_num(p_ptr->lev); - - r_ptr = &r_info[bounties[0][0]]; - - /* - * Select the number of monsters needed to kill. Groups and - * breeders require more - */ - amt = randnor(5, 3); - - if (amt < 2) amt = 2; - - if (r_ptr->flags1 & RF1_FRIEND) amt *= 3; amt /= 2; - if (r_ptr->flags1 & RF1_FRIENDS) amt *= 2; - if (r_ptr->flags4 & RF4_MULTIPLY) amt *= 3; - - if (r_ptr->flags7 & RF7_AQUATIC) amt /= 2; - - bounties[0][1] = amt; - - /* Undo the filters */ - get_mon_num_hook = NULL; - get_mon_num_prep(); -} - - - -/* - * Sell a corpse for a reward. - */ -static void sell_quest_monster(void) -{ - object_type* o_ptr; - - int item; - - - /* Set the hook. */ - item_tester_hook = item_tester_hook_quest_monster; - - /* Select a corpse to sell. */ - if (!get_item(&item, "Sell which corpse", - "You have no corpses you can sell.", USE_INVEN)) return; - - o_ptr = &p_ptr->inventory[item]; - - bounties[0][1] -= o_ptr->number; - - /* Completed the quest. */ - if (bounties[0][1] <= 0) - { - int m; - monster_race *r_ptr; - - cmsg_print(TERM_YELLOW, "You have completed your quest!"); - msg_print(NULL); - - /* Give full knowledge */ - - /* Hack -- Maximal info */ - r_ptr = &r_info[bounties[0][0]]; - - msg_print(format("Well done! As a reward I'll teach you everything " - "about the %s, (check your recall)", - r_ptr->name)); - - r_ptr->r_wake = r_ptr->r_ignore = MAX_UCHAR; - - /* Observe "maximal" attacks */ - for (m = 0; m < 4; m++) - { - /* Examine "actual" blows */ - if (r_ptr->blow[m].effect || r_ptr->blow[m].method) - { - /* Hack -- maximal observations */ - r_ptr->r_blows[m] = MAX_UCHAR; - } - } - - /* Hack -- maximal drops */ - r_ptr->r_drop_gold = r_ptr->r_drop_item = - (((r_ptr->flags1 & (RF1_DROP_4D2)) ? 8 : 0) + - ((r_ptr->flags1 & (RF1_DROP_3D2)) ? 6 : 0) + - ((r_ptr->flags1 & (RF1_DROP_2D2)) ? 4 : 0) + - ((r_ptr->flags1 & (RF1_DROP_1D2)) ? 2 : 0) + - ((r_ptr->flags1 & (RF1_DROP_90)) ? 1 : 0) + - ((r_ptr->flags1 & (RF1_DROP_60)) ? 1 : 0)); - - /* Hack -- but only "valid" drops */ - if (r_ptr->flags1 & (RF1_ONLY_GOLD)) r_ptr->r_drop_item = 0; - if (r_ptr->flags1 & (RF1_ONLY_ITEM)) r_ptr->r_drop_gold = 0; - - /* Hack -- observe many spells */ - r_ptr->r_cast_inate = MAX_UCHAR; - r_ptr->r_cast_spell = MAX_UCHAR; - - /* Hack -- know all the flags */ - r_ptr->r_flags1 = r_ptr->flags1; - r_ptr->r_flags2 = r_ptr->flags2; - r_ptr->r_flags3 = r_ptr->flags3; - r_ptr->r_flags4 = r_ptr->flags4; - r_ptr->r_flags5 = r_ptr->flags5; - r_ptr->r_flags6 = r_ptr->flags6; - r_ptr->r_flags4 = r_ptr->flags7; - r_ptr->r_flags5 = r_ptr->flags8; - r_ptr->r_flags6 = r_ptr->flags9; - - msg_print(NULL); - - select_quest_monster(); - - } - else - { - msg_format("Well done, only %d more to go.", bounties[0][1]); - msg_print(NULL); - } - - inc_stack_size(item, -1); -} - - - -/* - * Fill the bounty list with monsters. - */ -void select_bounties(void) -{ - int i, j; - - - select_quest_monster(); - - /* - * Set up the hooks -- no bounties on uniques or monsters - * with no corpses - */ - get_mon_num_hook = mon_hook_bounty; - get_mon_num_prep(); - - for (i = 1; i < MAX_BOUNTIES; i++) - { - int lev = i * 5 + randnor(0, 2); - monster_race* r_ptr; - s16b r_idx; - s16b val; - - if (lev < 1) lev = 1; - - if (lev >= MAX_DEPTH) lev = MAX_DEPTH - 1; - - /* We don't want to duplicate entries in the list */ - while (TRUE) - { - r_idx = get_mon_num(lev); - - for (j = 0; j < i; j++) - { - if (bounties[j][0] == r_idx) continue; - } - - break; - } - - bounties[i][0] = r_idx; - - r_ptr = &r_info[r_idx]; - - val = r_ptr->mexp + r_ptr->level * 20 + randnor(0, r_ptr->level * 2); - - if (val < 1) val = 1; - - bounties[i][1] = val; - } - - /* Undo the filters. */ - get_mon_num_hook = NULL; - get_mon_num_prep(); -} /* * Execute a building command @@ -1578,18 +1330,6 @@ bool_ bldg_process_command(store_type *s_ptr, int i) break; } - case BACT_VIEW_QUEST_MON: - { - show_quest_monster(); - break; - } - - case BACT_SELL_QUEST_MON: - { - sell_quest_monster(); - break; - } - case BACT_DIVINATION: { int i, count = 0; @@ -1672,6 +1412,7 @@ bool_ bldg_process_command(store_type *s_ptr, int i) } default: + printf("Unknown building action %d\n", static_cast<int>(bact)); break; } diff --git a/src/defines.h b/src/defines.h index 05fb49f3..e29f47e1 100644 --- a/src/defines.h +++ b/src/defines.h @@ -121,8 +121,6 @@ #define CHANCE_TRAP_DOOR 500 /* in 10000 */ #define CHANCE_TRAP_FLOOR 4 /* in 10000 chance of placing a trap */ -#define MAX_BOUNTIES 24 - #define MAX_SPELLS 100 #define MAX_RUNES 100 @@ -3873,8 +3871,6 @@ #define BACT_RECALL 33 #define BACT_TELEPORT_LEVEL 34 #define BACT_MIMIC_NORMAL 37 -#define BACT_VIEW_QUEST_MON 40 -#define BACT_SELL_QUEST_MON 41 #define BACT_DIVINATION 42 #define BACT_SELL 43 #define BACT_BUY 44 diff --git a/src/dungeon.cc b/src/dungeon.cc index ce1e0c61..370e48c9 100644 --- a/src/dungeon.cc +++ b/src/dungeon.cc @@ -1346,13 +1346,6 @@ static void process_world(void) get_month_name(bst(DAY, turn), wizard, FALSE), buf); } - /* Set back the rewards once a day */ - if ((turn % (10L * STORE_TURNS)) == 0) - { - /* Select new bounties. */ - if (magik(20)) select_bounties(); - } - /*** Process the monsters ***/ /* Check for creature generation. */ diff --git a/src/externs.h b/src/externs.h index bd4e0bb6..318ae205 100644 --- a/src/externs.h +++ b/src/externs.h @@ -444,7 +444,6 @@ extern random_artifact random_artifacts[MAX_RANDARTS]; extern s32b RANDART_WEAPON; extern s32b RANDART_ARMOR; extern s32b RANDART_JEWEL; -extern s16b bounties[MAX_BOUNTIES][2]; extern random_spell random_spells[MAX_SPELLS]; extern s16b spell_num; extern rune_spell rune_spells[MAX_RUNES]; @@ -452,7 +451,6 @@ extern s16b rune_num; extern fate fates[MAX_FATES]; extern byte dungeon_type; extern s16b *max_dlv; -extern u32b total_bounties; extern s16b doppleganger; extern bool_ generate_encounter; extern bool_ autoroll; @@ -1362,7 +1360,6 @@ extern bool_ is_state(store_type *s_ptr, int state); extern void do_cmd_bldg(void); extern bool_ show_god_info(bool_ ext); extern void enter_quest(void); -extern void select_bounties(void); /* util.c */ extern s32b rescale(s32b x, s32b max, s32b new_max); diff --git a/src/files.cc b/src/files.cc index 39a0cdf2..f9d83539 100644 --- a/src/files.cc +++ b/src/files.cc @@ -4333,8 +4333,6 @@ long total_points(void) } temp += Total * 50; - temp += total_bounties * 100; - if (total_winner) temp += 1000000; diff --git a/src/loadsave.cc b/src/loadsave.cc index de217298..7c89bc45 100644 --- a/src/loadsave.cc +++ b/src/loadsave.cc @@ -677,13 +677,14 @@ static bool_ do_extra(int flag) /* The fate */ do_byte((byte*)&p_ptr->no_mortal, flag); - /* The bounties */ - for (i = 0; i < MAX_BOUNTIES; i++) - { - do_s16b(&bounties[i][0], flag); - do_s16b(&bounties[i][1], flag); + /* The bounties -- kept only for load-compatibility with old savefiles. */ + for (i = 0; i < 24; i++) { + tmp16s = 0; do_s16b(&tmp16s, flag); + tmp16s = 0; do_s16b(&tmp16s, flag); } - do_u32b(&total_bounties, flag); + tmp32u = 0; do_u32b(&tmp32u, flag); + + /* Spells */ do_s16b(&spell_num, flag); for (i = 0; i < MAX_SPELLS; i++) do_spells(i, flag); diff --git a/src/variable.cc b/src/variable.cc index 80b868e2..efb2dbaf 100644 --- a/src/variable.cc +++ b/src/variable.cc @@ -1046,12 +1046,6 @@ s32b RANDART_ARMOR; s32b RANDART_JEWEL; /* - * Current bounties. An array of tuples of two, with the first being the - * r_idx of the monster, and the second the monster's worth. - */ -s16b bounties[MAX_BOUNTIES][2]; - -/* * Spell description */ bool_ info_spell = FALSE; @@ -1088,11 +1082,6 @@ fate fates[MAX_FATES]; byte dungeon_type; s16b *max_dlv; -/* - * Number of total bounties the player had had. - */ -u32b total_bounties; - /* The Doppleganger index in m_list */ s16b doppleganger; |