diff options
author | Eronarn Palazzo <eronarn@gmail.com> | 2013-01-03 09:28:10 -0500 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-01-08 04:00:28 +0100 |
commit | fc37d1d730621de1de08400e438879b2f32679b6 (patch) | |
tree | dda129ec088e2c90604db4d7d7d8ee2ebd97300f /crawl-ref/source/areas.cc | |
parent | 8e5b3ad9df554166a3e51a62c8435372b25bdc27 (diff) | |
download | crawl-ref-fc37d1d730621de1de08400e438879b2f32679b6.tar.gz crawl-ref-fc37d1d730621de1de08400e438879b2f32679b6.zip |
Give lava orcs a heat halo that causes fire damage to nearby enemies.
Diffstat (limited to 'crawl-ref/source/areas.cc')
-rw-r--r-- | crawl-ref/source/areas.cc | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc index a2082aae38..0fdf728e96 100644 --- a/crawl-ref/source/areas.cc +++ b/crawl-ref/source/areas.cc @@ -43,6 +43,7 @@ enum areaprop_flag APROP_SUPPRESSION = (1 << 8), APROP_QUAD = (1 << 9), APROP_DISJUNCTION = (1 << 10), + APROP_HOT = (1 << 11), }; struct area_centre @@ -86,7 +87,7 @@ 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->suppression_radius2() > -1 || act->heat_radius2() > -1)) { // Not necessarily new, but certainly potentially interesting. invalidate_agrid(true); @@ -170,6 +171,18 @@ static void _update_agrid() no_areas = false; } + if ((r = ai->heat_radius2()) >= 0) + { + _agrid_centres.push_back(area_centre(AREA_HOT, ai->pos(), r)); + + for (radius_iterator ri(ai->pos(),r, C_CIRCLE, ai->get_los()); + ri; ++ri) + { + _set_agrid_flag(*ri, APROP_HOT); + } + no_areas = false; + } + } if (you.char_direction == GDT_ASCENDING && !you.duration[DUR_TIME_STEP]) @@ -232,6 +245,8 @@ static area_centre_type _get_first_area(const coord_def& f) return AREA_SANCTUARY; if (a & APROP_SILENCE) return AREA_SILENCE; + if (a & APROP_HOT) + return AREA_HOT; if (a & APROP_HALO) return AREA_HALO; if (a & APROP_UMBRA) @@ -785,3 +800,40 @@ int player::suppression_radius2() const { return -1; } + +///////////// +// Heat aura (lava orcs). + +// Player radius +int player::heat_radius2() const +{ + if (you.species != SP_LAVA_ORC) + return (-1); + + if (!temperature_effect(LORC_HEAT_AURA)) + return (-1); + + return (2); // Surrounds you to radius of 1. +} + +// Stub for monster radius +int monster::heat_radius2() const +{ + return (-1); +} + +bool heated(const coord_def& p) +{ + if (!map_bounds(p)) + return (false); + + if (!_agrid_valid) + _update_agrid(); + + return (_check_agrid_flag(p, APROP_HOT)); +} + +bool actor::heated() const +{ + return (::heated(pos())); +} |