diff options
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index c05e1bf18f..4067b00a24 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -55,6 +55,7 @@ REVISION("$Rev$"); #include "state.h" #include "stuff.h" #include "terrain.h" +#include "transfor.h" #include "traps.h" #include "tutorial.h" #include "view.h" @@ -3746,6 +3747,15 @@ void bolt::affect_player_enchantment() obvious_effect = true; break; + case BEAM_PORKALATOR: + if (!transform(ench_power, TRAN_PIG, true)) + { + mpr("You feel like a pig."); + break; + } + obvious_effect = true; + break; + default: // _All_ enchantments should be enumerated here! mpr("Software bugs nibble your toes!"); @@ -4528,6 +4538,8 @@ void bolt::affect_monster(monsters* mon) int beam_hit = hit; if (mon->invisible() && !this->can_see_invis) beam_hit /= 2; + if (mon->type == MONS_KIRKE) // deflect missiles + beam_hit = random2(beam_hit * 2) / 3; // FIXME We're randomising mon->evasion, which is further // randomised inside test_beam_hit. This is so we stay close to the 4.0 @@ -4687,6 +4699,13 @@ bool _ench_flavour_affects_monster(beam_type flavour, const monsters* mon) && mons_res_cold(mon) <= 0; // can't be hibernated break; + case BEAM_PORKALATOR: + rc = (mons_holiness(mon) == MH_NATURAL + && mon->type != MONS_HOG) || + (mons_holiness(mon) == MH_DEMONIC + && mon->type != MONS_HELL_HOG); + break; + default: break; } @@ -5003,6 +5022,12 @@ mon_resist_type bolt::apply_enchantment_to_monster(monsters* mon) } return (MON_AFFECTED); + case BEAM_PORKALATOR: + if (monster_polymorph(mon, (mons_holiness(mon)==MH_DEMONIC)? + MONS_HELL_HOG : MONS_HOG)) + obvious_effect = true; + return (MON_AFFECTED); + default: break; } @@ -5703,6 +5728,7 @@ std::string beam_type_name(beam_type type) case BEAM_PETRIFY: return("petrify"); case BEAM_BACKLIGHT: return("backlight"); case BEAM_SLEEP: return("sleep"); + case BEAM_PORKALATOR: return("porkalator"); case BEAM_POTION_BLACK_SMOKE: return("black smoke"); case BEAM_POTION_GREY_SMOKE: return("grey smoke"); case BEAM_POTION_BLUE_SMOKE: return("blue smoke"); @@ -5721,7 +5747,8 @@ std::string beam_type_name(beam_type type) void clear_zap_info_on_exit() { - for (unsigned int i = 0; i < NUM_BEAMS; ++i) + const unsigned int zap_size = sizeof(zap_data) / sizeof(zap_info); + for (unsigned int i = 0; i < zap_size; ++i) { delete zap_data[i].damage; delete zap_data[i].tohit; |