summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-27 12:06:29 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-27 12:06:29 +0000
commitbd28b58f3c777e91dfd7ef36360717c5ca40d9cc (patch)
tree33455503ce989712fca89fe5941f96e80916463c
parent2ceda1a01b8662c4adea1c30025302ad094ba367 (diff)
downloadcrawl-ref-bd28b58f3c777e91dfd7ef36360717c5ca40d9cc.tar.gz
crawl-ref-bd28b58f3c777e91dfd7ef36360717c5ca40d9cc.zip
Added the arena tag "miscasts", which causes each monster to randomly miscast
each turn. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8817 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/docs/arena.txt6
-rw-r--r--crawl-ref/source/arena.cc22
2 files changed, 27 insertions, 1 deletions
diff --git a/crawl-ref/docs/arena.txt b/crawl-ref/docs/arena.txt
index 72050361ec..5fbd93d078 100644
--- a/crawl-ref/docs/arena.txt
+++ b/crawl-ref/docs/arena.txt
@@ -93,7 +93,8 @@ There are four arena parameters that you can set in your crawl options file:
then diagnostic messages will be dumped as well as other messages.
Defaults to false.
-* arena_list_eq: (?) Defaults to false.
+* arena_list_eq: Dump to the file arena.result the equipment of the
+ monsters placed at the begining of each round.
The are also a number a parameters you can use by putting them in the
@@ -155,3 +156,6 @@ The parameters include:
* "delay:N" allows the delay between turns to be specified on the command
line instead of in the options file.
+
+* miscasts: Every turn each monster (besides test spawners) will have a
+ random miscast happen to it.
diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc
index 45a76e1d7b..eddd2775e4 100644
--- a/crawl-ref/source/arena.cc
+++ b/crawl-ref/source/arena.cc
@@ -30,6 +30,7 @@ REVISION("$Rev$");
#include "output.h"
#include "randart.h"
#include "skills2.h"
+#include "spl-mis.h"
#include "spl-util.h"
#include "state.h"
#include "version.h"
@@ -92,6 +93,8 @@ namespace arena
bool real_summons = false;
bool move_summons = false;
+ bool miscasts = false;
+
int summon_throttle = INT_MAX;
std::vector<int> uniques_list;
@@ -311,6 +314,7 @@ namespace arena
allow_zero_xp = strip_tag(spec, "allow_zero_xp");
real_summons = strip_tag(spec, "real_summons");
move_summons = strip_tag(spec, "move_summons");
+ miscasts = strip_tag(spec, "miscasts");
summon_throttle = strip_number_tag(spec, "summon_throttle:");
if (summon_throttle <= 0)
@@ -673,6 +677,23 @@ namespace arena
}
}
+ void do_miscasts()
+ {
+ if (!miscasts)
+ return;
+
+ for (int i = 0; i < MAX_MONSTERS; i++)
+ {
+ monsters* mon = &menv[i];
+
+ if (!mon->alive() || mon->type == MONS_TEST_SPAWNER)
+ continue;
+
+ MiscastEffect(mon, i, SPTYP_RANDOM, random_range(1, 3),
+ "arena miscast", NH_NEVER);
+ }
+ }
+
void handle_keypress(int ch)
{
if (ch == ESCAPE || tolower(ch) == 'q' || ch == CONTROL('G'))
@@ -744,6 +765,7 @@ namespace arena
you.hunger = 10999;
//report_foes();
world_reacts();
+ do_miscasts();
balance_spawners();
delay(Options.arena_delay);
mesclr();