From a81f929851dd78e52d4748835ac33e082e945992 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 25 May 2008 22:36:55 +0000 Subject: Fix aborting unchivalric attacks costing a turn. Implement ordering your friends to stay where they are. To do this, I've added a new variable to the monster struct: patrol_point, that is set by the new t sub-command "Wait here!" Once this is set, monsters will spend their time wandering around within the LOS radius centred on the patrol point. If they are attacked, or the player or other friends are attacked, they'll stop wandering to fight, but once the foe is gone, they continue doing so. Currently, the only way to make them stop again is to issue another command, "Follow me!" that is basically the already existing "Come here!" command. I've also added a "Stop fighting!" command that for non-patrolling monsters has the same effect as "Follow me!" - patrolling monsters are supposed to take up their wanderings again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5247 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dungeon.cc | 64 +++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 34 deletions(-) (limited to 'crawl-ref/source/dungeon.cc') diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 9e7cbe1c76..c87f158c14 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -1789,8 +1789,8 @@ static bool _make_box(int room_x1, int room_y1, int room_x2, int room_y2, return true; } -// take care of labyrinth, abyss, pandemonium -// returns 1 if we should skip further generation, +// Take care of labyrinth, abyss, pandemonium. +// Returns 1 if we should skip further generation, // -1 if we should immediately quit, and 0 otherwise. static builder_rc_type _builder_by_type(int level_number, char level_type) { @@ -2874,9 +2874,9 @@ static int _place_monster_vector(std::vector montypes, int result = 0; mgen_data mg; - mg.power = level_number; + mg.power = level_number; mg.behaviour = BEH_SLEEP; - mg.flags |= MG_PERMIT_BANDS; + mg.flags |= MG_PERMIT_BANDS; mg.map_mask |= MMT_NO_MONS; for (int i = 0; i < num_to_place; i++) @@ -2962,8 +2962,8 @@ static void _builder_monsters(int level_number, char level_type, int mon_wanted) for (int i = 0; i < mon_wanted; i++) { mgen_data mg; - mg.power = level_number; - mg.flags |= MG_PERMIT_BANDS; + mg.power = level_number; + mg.flags |= MG_PERMIT_BANDS; mg.map_mask |= MMT_NO_MONS; place_monster(mg); @@ -3191,9 +3191,9 @@ static void _fill_monster_pit( spec_room &sr, FixedVector(mid)); - mg.power = monster_level; - mg.behaviour = m_generate_awake ? BEH_WANDER : BEH_SLEEP; + mg.power = monster_level; + mg.behaviour = (m_generate_awake ? BEH_WANDER : BEH_SLEEP); mg.base_type = mspec.monbase; - mg.number = mspec.number; - mg.colour = mspec.colour; - mg.pos = coord_def(vx, vy); + mg.number = mspec.number; + mg.colour = mspec.colour; + mg.pos = coord_def(vx, vy); const int mindex = place_monster(mg); if (mindex != -1) @@ -4878,8 +4877,8 @@ static int _vault_grid( vault_placement &place, if (vgrid == 'S' || vgrid == 'H') { - const monster_type mtype = - (vgrid == 'H') ? MONS_ORANGE_STATUE : MONS_SILVER_STATUE; + const monster_type mtype = ((vgrid == 'H') ? MONS_ORANGE_STATUE + : MONS_SILVER_STATUE); grd[vx][vy] = DNGN_FLOOR; @@ -6231,10 +6230,7 @@ static void _labyrinth_place_items(const coord_def &end) static void _labyrinth_place_exit(const coord_def &end) { _labyrinth_place_items(end); - mons_place( - mgen_data::sleeper_at( - MONS_MINOTAUR, - end)); + mons_place( mgen_data::sleeper_at(MONS_MINOTAUR, end, MG_PATROLLING) ); grd(end) = DNGN_ESCAPE_HATCH_UP; } -- cgit v1.2.3-54-g00ecf