summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-22 21:35:56 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-09-22 21:35:56 +0000
commita4d7a2e926fd6cb93e044b7e35de6e86bc91ea36 (patch)
tree300fccd4e6dc8f5f56d104663d95db28dcef7d8b
parent144117715f73d273a97227592a303734e2b8e00a (diff)
downloadcrawl-ref-a4d7a2e926fd6cb93e044b7e35de6e86bc91ea36.tar.gz
crawl-ref-a4d7a2e926fd6cb93e044b7e35de6e86bc91ea36.zip
More draconian fun. Implemented Erik's idea of same-colour draconian packs,
upped band numbers slightly. I wouldn't care to meet a pack of yellow draconians though. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@79 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/monplace.cc51
1 files changed, 44 insertions, 7 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index dfb95ab1dc..804abb6f91 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -34,6 +34,7 @@
#define BIG_BAND 20
static int band_member(int band, int power);
+static bool base_coloured_draconian(monster_type mon);
static int choose_band( int mon_type, int power, int &band_size );
static int place_monster_aux(int mon_type, char behaviour, int target,
int px, int py, int power, int extra, bool first_band_member,
@@ -152,11 +153,28 @@ bool place_monster(int &id, int mon_type, int power, char behaviour,
if (allow_bands)
{
+ // [dshaligram] Draconian bands are homogeneous with respect to
+ // draconian colour. The first coloured draconian forces all others to
+ // be of the same colour. Idea courtesy Erik Piper.
+
int band = choose_band(mon_type, power, band_size);
+ int draconian_colour =
+ base_coloured_draconian(monster_type(mon_type))
+ ? mon_type : MONS_PROGRAM_BUG;
band_size ++;
for (i = 1; i < band_size; i++)
- band_monsters[i] = band_member( band, power );
+ {
+ int new_band_mons = band_member( band, power );
+ if (draconian_colour != MONS_PROGRAM_BUG
+ && base_coloured_draconian(monster_type(new_band_mons)))
+ new_band_mons = draconian_colour;
+
+ band_monsters[i] = new_band_mons;
+
+ if (base_coloured_draconian(monster_type(new_band_mons)))
+ draconian_colour = new_band_mons;
+ }
}
// Monsters that can't move shouldn't be taking the stairs -- bwr
@@ -783,11 +801,9 @@ static int choose_band( int mon_type, int power, int &band_size )
if (power > 18 && one_chance_in(3))
{
band = BAND_DRACONIAN;
- // [dshaligram] band_size == 0 implies just the original monster
- // without a band.
- band_size = random_range(0, 2);
- }
- break;
+ band_size = random_range(1, 2 + (power > 24));
+ }
+ break;
case MONS_DRACONIAN_CALLER:
case MONS_DRACONIAN_MONK:
case MONS_DRACONIAN_SCORCHER:
@@ -798,7 +814,7 @@ static int choose_band( int mon_type, int power, int &band_size )
if (power > 20)
{
band = BAND_DRACONIAN;
- band_size = random_range(1, 3);
+ band_size = random_range(2, 3 + (power > 26));
}
break;
} // end switch
@@ -812,6 +828,27 @@ static int choose_band( int mon_type, int power, int &band_size )
return (band);
}
+// Returns true if the monster is a draconian of any colour (not the base
+// unspecified draconian or a draconian with a job description). Used to keep
+// bands of draconians coherent.
+static bool base_coloured_draconian(monster_type mon)
+{
+ switch (mon)
+ {
+ case MONS_BLACK_DRACONIAN:
+ case MONS_MOTTLED_DRACONIAN:
+ case MONS_YELLOW_DRACONIAN:
+ case MONS_GREEN_DRACONIAN:
+ case MONS_PURPLE_DRACONIAN:
+ case MONS_RED_DRACONIAN:
+ case MONS_WHITE_DRACONIAN:
+ case MONS_PALE_DRACONIAN:
+ return (true);
+ default:
+ return (false);
+ }
+}
+
static int band_member(int band, int power)
{
int mon_type = -1;