diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-05-29 04:01:42 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-05-29 04:01:42 +0200 |
commit | aff44e3dcf63bf0a5426c8d6998c8954bb44d26d (patch) | |
tree | 1708e320052e6631f93e85301ff6d2ad75ebb1ef /crawl-ref/source/areas.cc | |
parent | 30cd027a1c26d7375360584f5df8ec9f57a09c85 (diff) | |
parent | 1ef5305b68a6936247e5ee2a4aa7516222258490 (diff) | |
download | crawl-ref-aff44e3dcf63bf0a5426c8d6998c8954bb44d26d.tar.gz crawl-ref-aff44e3dcf63bf0a5426c8d6998c8954bb44d26d.zip |
Merge branch 'master' into lava_orcs
Diffstat (limited to 'crawl-ref/source/areas.cc')
-rw-r--r-- | crawl-ref/source/areas.cc | 57 |
1 files changed, 48 insertions, 9 deletions
diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc index 0fdf728e96..b96231a0f5 100644 --- a/crawl-ref/source/areas.cc +++ b/crawl-ref/source/areas.cc @@ -43,7 +43,8 @@ enum areaprop_flag APROP_SUPPRESSION = (1 << 8), APROP_QUAD = (1 << 9), APROP_DISJUNCTION = (1 << 10), - APROP_HOT = (1 << 11), + APROP_SOUL_AURA = (1 << 11), + APROP_HOT = (1 << 12), }; struct area_centre @@ -55,7 +56,6 @@ struct area_centre explicit area_centre (area_centre_type t, coord_def c, int r) : type(t), centre(c), radius(r) { } }; -// currently, only 4 of 32 bits are used, but meh... typedef FixedArray<uint32_t, GXM, GYM> propgrid_t; static vector<area_centre> _agrid_centres; @@ -87,7 +87,8 @@ void areas_actor_moved(const actor* act, const coord_def& oldpos) (you.entering_level || act->halo_radius2() > -1 || act->silence_radius2() > -1 || act->liquefying_radius2() > -1 || act->umbra_radius2() > -1 - || act->suppression_radius2() > -1 || act->heat_radius2() > -1)) + || act->suppression_radius2() > -1 || act->heat_radius2() > -1) + || act->soul_aura_radius2() > -1) { // Not necessarily new, but certainly potentially interesting. invalidate_agrid(true); @@ -171,6 +172,19 @@ static void _update_agrid() no_areas = false; } + + if ((r = ai->soul_aura_radius2()) >= 0) + { + _agrid_centres.push_back(area_centre(AREA_SOUL_AURA, ai->pos(), r)); + + for (radius_iterator ri(ai->pos(), r, C_CIRCLE, ai->get_los()); + ri; ++ri) + { + _set_agrid_flag(*ri, APROP_SOUL_AURA); + } + no_areas = false; + } + if ((r = ai->heat_radius2()) >= 0) { _agrid_centres.push_back(area_centre(AREA_HOT, ai->pos(), r)); @@ -182,12 +196,11 @@ static void _update_agrid() } no_areas = false; } - } - if (you.char_direction == GDT_ASCENDING && !you.duration[DUR_TIME_STEP]) + if (you.char_direction == GDT_ASCENDING && !you.pos().origin()) { - ASSERT(!env.orb_pos.origin()); + ASSERT(env.orb_pos == you.pos()); const int r = 5; _agrid_centres.push_back(area_centre(AREA_ORB, env.orb_pos, r)); @@ -802,6 +815,32 @@ int player::suppression_radius2() const } ///////////// +// Soul aura (currently just a marker for reference) + +bool soul_aura(const coord_def& p) +{ + if (!map_bounds(p)) + return false; + if (!_agrid_valid) + _update_agrid(); + + return _check_agrid_flag(p, APROP_SOUL_AURA); +} + +int monster::soul_aura_radius2() const +{ + if (type == MONS_LOST_SOUL) + return LOS_RADIUS_SQ; + else + return -1; +} + +int player::soul_aura_radius2() const +{ + return -1; +} + +///////////// // Heat aura (lava orcs). // Player radius @@ -819,7 +858,7 @@ int player::heat_radius2() const // Stub for monster radius int monster::heat_radius2() const { - return (-1); + return -1; } bool heated(const coord_def& p) @@ -830,10 +869,10 @@ bool heated(const coord_def& p) if (!_agrid_valid) _update_agrid(); - return (_check_agrid_flag(p, APROP_HOT)); + return _check_agrid_flag(p, APROP_HOT); } bool actor::heated() const { - return (::heated(pos())); + return ::heated(pos()); } |