summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/arena.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-10-20 13:03:17 -0700
committerMatthew Cline <zelgadis@sourceforge.net>2009-10-20 13:03:17 -0700
commit7d6b9d881b71e0485b842994ee12541c3cc69afc (patch)
treee47bb894015edeb8f359105b80eb88d556a42957 /crawl-ref/source/arena.cc
parentbd3a484b40403e4c7f07e7f6c43e5a1331235461 (diff)
downloadcrawl-ref-7d6b9d881b71e0485b842994ee12541c3cc69afc.tar.gz
crawl-ref-7d6b9d881b71e0485b842994ee12541c3cc69afc.zip
arena: Respawn fix, "move_respawns" option, msgs
Give dgn_place_monster() the proper monster level when respawning. New "move_respawns" option teleports respawned monsters as soon as they're placed, so that monsters don't clump up together in a brawl at the center of the arena. Don't filter out monster death messages when dumping messages to arena.result
Diffstat (limited to 'crawl-ref/source/arena.cc')
-rw-r--r--crawl-ref/source/arena.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc
index b7c7461df8..a29292cd21 100644
--- a/crawl-ref/source/arena.cc
+++ b/crawl-ref/source/arena.cc
@@ -91,6 +91,7 @@ namespace arena
bool real_summons = false;
bool move_summons = false;
bool respawn = false;
+ bool move_respawns = false;
bool miscasts = false;
@@ -317,6 +318,7 @@ namespace arena
move_summons = strip_tag(spec, "move_summons");
miscasts = strip_tag(spec, "miscasts");
respawn = strip_tag(spec, "respawn");
+ move_respawns = strip_tag(spec, "move_respawns");
summon_throttle = strip_number_tag(spec, "summon_throttle:");
if (real_summons && respawn)
@@ -657,13 +659,20 @@ namespace arena
// Ignore messages generated while the user examines
// the arnea.
case MSGCH_PROMPT:
- case MSGCH_MONSTER_DAMAGE:
case MSGCH_MONSTER_TARGET:
case MSGCH_FLOOR_ITEMS:
case MSGCH_EXAMINE:
case MSGCH_EXAMINE_FILTER:
continue;
+ // If a monster-damage message ends with '!' it's a
+ // death message, otherwise it's an examination message
+ // and should be skipped.
+ case MSGCH_MONSTER_DAMAGE:
+ if (msg[msg.length() - 1] != '!')
+ continue;
+ break;
+
case MSGCH_ERROR: prefix = "ERROR: "; break;
case MSGCH_WARN: prefix = "WARN: "; break;
case MSGCH_DIAGNOSTICS: prefix = "DIAG: "; break;
@@ -777,7 +786,8 @@ namespace arena
if (fac.friendly)
spec.attitude = ATT_FRIENDLY;
- int idx = dgn_place_monster(spec, 0, pos, false, true);
+ int idx = dgn_place_monster(spec, you.your_level, pos, false,
+ true);
if (idx == -1 && fac.active_members == 0
&& mgrd(pos) != NON_MONSTER)
@@ -808,7 +818,8 @@ namespace arena
monster_teleport(other, true);
}
- idx = dgn_place_monster(spec, 0, pos, false, true);
+ idx = dgn_place_monster(spec, you.your_level, pos, false,
+ true);
}
if (idx != -1)
@@ -818,6 +829,9 @@ namespace arena
fac.respawn_pos.erase(fac.respawn_pos.begin() + i);
to_respawn[idx] = spec_idx;
+
+ if (move_respawns)
+ monster_teleport(&menv[idx], true, true);
}
else
{
@@ -1268,9 +1282,6 @@ void arena_monster_died(monsters *monster, killer_type killer,
fac->respawn_pos.push_back(monster->pos());
arena::to_respawn[midx] = -1;
-
- arena::faction_a.won = false;
- arena::faction_b.won = false;
}
}