summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-27 17:04:31 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-27 17:04:31 +0000
commit1be101fd1fc43a252cdc4debf475edf0c6dba81b (patch)
tree13e5c780e21268c06bb28c48994f934e906ee62e /crawl-ref/source/beam.cc
parent39e1fb93fe8332c69e55c4364d28091a02d52ad5 (diff)
downloadcrawl-ref-1be101fd1fc43a252cdc4debf475edf0c6dba81b.tar.gz
crawl-ref-1be101fd1fc43a252cdc4debf475edf0c6dba81b.zip
Apply patch by Adam Borowski, introducing new unique enchantress Kirke.
This includes a new transformation TRAN_PIG that the player can not end at will but rather will have to time out. Pigs (or rather hogs) are fast but cannot use any equipment except amulets, or cast spells. If the transformation would cause death by stat loss (due to equipment loss) the player is paralysed instead. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10061 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc29
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;