diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-10-05 18:45:09 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-10-05 18:49:38 +0200 |
commit | cbafbc638c2e1d5bb40ee6bc419007062e9615e4 (patch) | |
tree | 0a4644c9c935a2a54d8b52613c67a09fc2fbf4be /src/q_fireprof.cc | |
parent | 551339813797a9b274ccf5f3f0c4f0d0b44cbf64 (diff) |
Remove traps
Credit goes mostly to "miramor" <danlev@norwoodlight.com> who did most
of the actual work. I just did a few minor tweaks and fixes + rebased
onto master.
Diffstat (limited to 'src/q_fireprof.cc')
-rw-r--r-- | src/q_fireprof.cc | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/q_fireprof.cc b/src/q_fireprof.cc index 03190889..693248e3 100644 --- a/src/q_fireprof.cc +++ b/src/q_fireprof.cc @@ -4,7 +4,6 @@ #include "dungeon_flag.hpp" #include "feature_flag.hpp" #include "feature_type.hpp" -#include "game.hpp" #include "hook_get_in.hpp" #include "hooks.hpp" #include "lua_bind.hpp" @@ -14,7 +13,6 @@ #include "object_type.hpp" #include "player_type.hpp" #include "tables.hpp" -#include "traps.hpp" #include "util.hpp" #include "variable.hpp" #include "z-rand.hpp" @@ -471,8 +469,6 @@ std::string quest_fireproof_describe() static bool_ fireproof_gen_hook(void *, void *, void *) { - auto const &f_info = game->edit_data.f_info; - fireproof_settings const *settings = fireproof_get_settings(); /* Only if player doing this quest */ @@ -483,8 +479,6 @@ static bool_ fireproof_gen_hook(void *, void *, void *) /* Go ahead */ { - int traps, trap_y, trap_x; - /* load the map */ { int x0 = 2; @@ -515,46 +509,6 @@ static bool_ fireproof_gen_hook(void *, void *, void *) drop_near(&forge, -1, y, x); } - /* how many traps to generate */ - traps = rand_range(10, 30); - - /* generate the traps */ - while (traps > 0) - { - int tries = 0, trap_level = 0; - - /* make sure it's a safe place */ - while (tries == 0) - { - /* get grid coordinates */ - trap_y = randint(19) + 2; - trap_x = randint(45) + 2; - cave_type *c_ptr = &cave[trap_y][trap_x]; - - /* are the coordinates on a stair, or a wall? */ - if (bool(f_info[c_ptr->feat].flags & FF_PERMANENT) || - (f_info[c_ptr->feat].flags & FF_FLOOR).empty()) - { - /* try again */ - tries = 0; - } - else - { - /* not a stair, then stop this 'while' */ - tries = 1; - } - } - - /* randomise level of trap */ - trap_level = rand_range(20, 40); - - /* put the trap there */ - place_trap_leveled(trap_y, trap_x, trap_level); - - /* that's one less trap to place */ - traps = traps - 1; - } - return TRUE; } } |