diff options
author | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-02 07:54:30 -0700 |
---|---|---|
committer | Nicholas Feinberg <pleasingfung@gmail.com> | 2014-07-02 07:54:30 -0700 |
commit | 981af8bb92e8360cca9ec788720c04f06900da93 (patch) | |
tree | 21daf5473ada8d6eef2249dbafc649e19837fc22 /crawl-ref/source/misc.cc | |
parent | 886d980933ff95be25921ebadfea48feb1f37d17 (diff) | |
download | crawl-ref-981af8bb92e8360cca9ec788720c04f06900da93.tar.gz crawl-ref-981af8bb92e8360cca9ec788720c04f06900da93.zip |
Move a little more code out of misc.cc
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 134 |
1 files changed, 0 insertions, 134 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 62d96cc00b..c45dd0e60d 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -97,99 +97,6 @@ string get_desc_quantity(const int quant, const int total, string whose) return "Some of " + whose; } -void search_around() -{ - ASSERT(!crawl_state.game_is_arena()); - - int base_skill = you.experience_level * 100 / 3; - int skill = (2/(1+exp(-(base_skill+120)/325.0))-1) * 225 - + (base_skill/200.0) + 15; - - if (you_worship(GOD_ASHENZARI) && !player_under_penance()) - skill += you.piety * 2; - - int max_dist = div_rand_round(skill, 32); - if (max_dist > 5) - max_dist = 5; - if (max_dist < 1) - max_dist = 1; - - for (radius_iterator ri(you.pos(), max_dist, C_ROUND, LOS_NO_TRANS); ri; ++ri) - { - if (grd(*ri) != DNGN_UNDISCOVERED_TRAP) - continue; - - int dist = ri->range(you.pos()); - - // Own square is not excluded; may be flying. - // XXX: Currently, flying over a trap will always detect it. - - int effective = (dist <= 1) ? skill : skill / (dist * 2 - 1); - - trap_def* ptrap = find_trap(*ri); - if (!ptrap) - { - // Maybe we shouldn't kill the trap for debugging - // purposes - oh well. - grd(*ri) = DNGN_FLOOR; - dprf("You found a buggy trap! It vanishes!"); - continue; - } - - if (effective > ptrap->skill_rnd) - { - ptrap->reveal(); - mprf("You found %s!", - ptrap->name(DESC_A).c_str()); - learned_something_new(HINT_SEEN_TRAP, *ri); - } - } -} - -void emergency_untransform() -{ - mpr("You quickly transform back into your natural form."); - untransform(false, true); // We're already entering the water. - - if (you.species == SP_MERFOLK) - merfolk_start_swimming(false); -} - -void merfolk_start_swimming(bool stepped) -{ - if (you.fishtail) - return; - - if (stepped) - mpr("Your legs become a tail as you enter the water."); - else - mpr("Your legs become a tail as you dive into the water."); - - if (you.invisible()) - mpr("...but don't expect to remain undetected."); - - you.fishtail = true; - remove_one_equip(EQ_BOOTS); - you.redraw_evasion = true; - -#ifdef USE_TILE - init_player_doll(); -#endif -} - -void merfolk_stop_swimming() -{ - if (!you.fishtail) - return; - you.fishtail = false; - unmeld_one_equip(EQ_BOOTS); - you.redraw_evasion = true; - -#ifdef USE_TILE - init_player_doll(); -#endif -} - // Update the trackers after the player changed level. void trackers_init_new_level(bool transit) { @@ -466,47 +373,6 @@ bool there_are_monsters_nearby(bool dangerous_only, bool require_visible, require_visible).empty(); } -static const char *shop_types[] = -{ - "weapon", - "armour", - "antique weapon", - "antique armour", - "antiques", - "jewellery", - "gadget", - "book", - "food", - "distillery", - "scroll", - "general", -}; - -int str_to_shoptype(const string &s) -{ - if (s == "random" || s == "any") - return SHOP_RANDOM; - - for (unsigned i = 0; i < ARRAYSZ(shop_types); ++i) - { - if (s == shop_types[i]) - return i; - } - return -1; -} - -const char *shoptype_to_str(shop_type type) -{ - return shop_types[type]; -} - -void list_shop_types() -{ - mpr_nojoin(MSGCH_PLAIN, "Available shop types: "); - for (unsigned i = 0; i < ARRAYSZ(shop_types); ++i) - mprf_nocap("%s", shop_types[i]); -} - // General threat = sum_of_logexpervalues_of_nearby_unfriendly_monsters. // Highest threat = highest_logexpervalue_of_nearby_unfriendly_monsters. static void monster_threat_values(double *general, double *highest, |