diff options
-rw-r--r-- | crawl-ref/source/beam.cc | 33 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 22 |
4 files changed, 43 insertions, 18 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index d431817532..af3977afa0 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -70,7 +70,7 @@ static FixedArray < bool, 19, 19 > explode_map; // helper functions (some of these, esp. affect(), should probably // be public): static void sticky_flame_monster( int mn, bool source, int hurt_final ); -static bool affectsWalls(struct bolt &beam); +static bool affectsWall(const bolt &beam, int wall_feature); static bool isBouncy(struct bolt &beam, unsigned char gridtype); static void beam_drop_object( struct bolt &beam, item_def *item, int x, int y ); static bool beam_term_on_target(struct bolt &beam, int x, int y); @@ -1276,7 +1276,7 @@ void fire_beam( struct bolt &pbolt, item_def *item ) if (grid_is_solid(grd[tx][ty])) { // first, check to see if this beam affects walls. - if (affectsWalls(pbolt)) + if (affectsWall(pbolt, grd[tx][ty])) { // should we ever get a tracer with a wall-affecting // beam (possible I suppose), we'll quit tracing now. @@ -2436,7 +2436,7 @@ int affect(struct bolt &beam, int x, int y) if (beam.is_tracer) // tracers always stop on walls. return (BEAM_STOP); - if (affectsWalls(beam)) + if (affectsWall(beam, grd[x][y])) { rangeUsed += affect_wall(beam, x, y); } @@ -2487,7 +2487,7 @@ int affect(struct bolt &beam, int x, int y) return (rangeUsed); } -static bool affectsWalls(struct bolt &beam) +static bool affectsWall(const bolt &beam, int wall) { // don't know of any explosion that affects walls. But change it here // if there is. @@ -2503,6 +2503,11 @@ static bool affectsWalls(struct bolt &beam) if (beam.flavour == BEAM_DISINTEGRATION && beam.damage.num >= 3) return (true); + if (beam.flavour == BEAM_FIRE + && wall == DNGN_WAX_WALL + && beam.name == "bolt of fire") + return (true); + // eye of devastation? if (beam.flavour == BEAM_NUKE) return (true); @@ -2546,6 +2551,26 @@ static int affect_wall(struct bolt &beam, int x, int y) return (rangeUsed); } // END DIGGING EFFECT + + // FIRE effect + if (beam.flavour == BEAM_FIRE && beam.name == "bolt of fire") + { + const int wgrd = grd[x][y]; + if (wgrd != DNGN_WAX_WALL) + return (0); + + grd[x][y] = DNGN_FLOOR; + if (see_grid(x, y)) + mprf("The wax bubbles and burns!"); + else if (player_can_smell()) + mprf("You smell burning wax."); + + place_cloud( + YOU_KILL(beam.thrower)? CLOUD_FIRE : CLOUD_FIRE_MON, + x, y, random2(10) + 15 ); + + return (BEAM_STOP); + } // NUKE / DISRUPT if (beam.flavour == BEAM_DISINTEGRATION || beam.flavour == BEAM_NUKE) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 702c480f30..b6ef053e0d 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -871,6 +871,10 @@ int player_res_steam(bool calc_unid) return (res + player_res_fire(calc_unid) / 2); } +bool player_can_smell() +{ + return (you.species != SP_MUMMY); +} int player_res_fire(bool calc_unid) { diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index 656a7b1faf..8cfc165ee2 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -157,6 +157,8 @@ bool player_res_corrosion(bool calc_unid = true); bool player_item_conserve(bool calc_unid = true); int player_mental_clarity(bool calc_unid = true); +bool player_can_smell(); + /* *********************************************************************** * called from: fight - files - ouch diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index cc46f82a10..c492abf60e 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2107,10 +2107,9 @@ bool miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail, canned_msg(MSG_NOTHING_HAPPENS); break; case 9: - // josh declares mummies cannot smell {dlb} - if (you.species != SP_MUMMY) + if (player_can_smell()) mpr("You smell something strange."); - else + else if (you.species == SP_MUMMY) mpr("Your bandages flutter."); } break; @@ -2713,8 +2712,7 @@ bool miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail, switch (random2(10)) { case 0: - // mummies cannot smell {dlb} - if (you.species != SP_MUMMY) + if (player_can_smell()) mpr("You smell decay."); break; case 1: @@ -2768,7 +2766,7 @@ bool miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail, break; case 2: // josh declares mummies cannot smell {dlb} - if (you.species != SP_MUMMY) + if (player_can_smell()) { mpr("You smell decay."); // identical to a harmless message you.rotting++; @@ -2910,8 +2908,7 @@ bool miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail, canned_msg(MSG_NOTHING_HAPPENS); break; case 9: - // mummies cannot smell - if (you.species != SP_MUMMY) + if (player_can_smell()) mpr("You smell something strange."); break; } @@ -3003,8 +3000,7 @@ bool miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail, mpr("You feel a strange surge of energy!"); break; case 4: - // mummies cannot smell - if (you.species != SP_MUMMY) + if (player_can_smell()) mpr("You smell smoke."); break; case 5: @@ -3390,20 +3386,18 @@ bool miscast_effect( unsigned int sp_type, int mag_pow, int mag_fail, mpr("You are blasted with air!"); break; case 7: - // mummies cannot smell if (!silenced(you.x_pos, you.y_pos)) mpr("You hear a whooshing sound.", MSGCH_SOUND); - else if (you.species != SP_MUMMY) + else if (player_can_smell()) mpr("You smell ozone."); break; case 8: canned_msg(MSG_NOTHING_HAPPENS); break; case 9: - // mummies cannot smell if (!silenced(you.x_pos, you.y_pos)) mpr("You hear a crackling sound.", MSGCH_SOUND); - else if (you.species != SP_MUMMY) + else if (player_can_smell()) mpr("You smell something musty."); break; } |