summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2009-12-30 06:13:06 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2009-12-30 06:13:06 +0530
commitd6d6ba04b6d5b6b3d7170f0b49aafde0b9ca9bd6 (patch)
treebf8d62e5eaf78464c62f1d85cf7d6bd3fc92847c
parentb40563be508e08864722f026bb5154b39135b0c0 (diff)
downloadcrawl-ref-d6d6ba04b6d5b6b3d7170f0b49aafde0b9ca9bd6.tar.gz
crawl-ref-d6d6ba04b6d5b6b3d7170f0b49aafde0b9ca9bd6.zip
Give boss merfolk small bands of regular merfolk as lackeys.
-rw-r--r--crawl-ref/source/mgen_enum.h4
-rw-r--r--crawl-ref/source/mon-gear.cc18
-rw-r--r--crawl-ref/source/mon-place.cc37
-rw-r--r--crawl-ref/source/mon-place.h3
4 files changed, 57 insertions, 5 deletions
diff --git a/crawl-ref/source/mgen_enum.h b/crawl-ref/source/mgen_enum.h
index 0927e9ae65..d7aee96df8 100644
--- a/crawl-ref/source/mgen_enum.h
+++ b/crawl-ref/source/mgen_enum.h
@@ -57,6 +57,9 @@ enum band_type
BAND_KHUFU,
BAND_GOLDEN_EYE,
BAND_PIKEL,
+ BAND_MERFOLK_AQUAMANCER,
+ BAND_MERFOLK_IMPALER,
+ BAND_MERFOLK_JAVELINEER,
NUM_BANDS // always last
};
@@ -99,4 +102,3 @@ enum mgen_flag_type
};
#endif
-
diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc
index 8affc9587f..640a875051 100644
--- a/crawl-ref/source/mon-gear.cc
+++ b/crawl-ref/source/mon-gear.cc
@@ -18,6 +18,8 @@
#include "itemprop.h"
#include "items.h"
#include "makeitem.h"
+#include "mgen_enum.h"
+#include "mon-place.h"
#include "mon-util.h"
#include "random.h"
#include "spl-book.h"
@@ -630,6 +632,17 @@ static item_make_species_type _give_weapon(monsters *mon, int level,
break;
case MONS_MERFOLK:
+ if (active_monster_band == BAND_MERFOLK_IMPALER)
+ {
+ item_race = MAKE_ITEM_NO_RACE;
+ item.base_type = OBJ_WEAPONS;
+ item.sub_type = random_choose_weighted(10, WPN_SPEAR,
+ 10, WPN_TRIDENT,
+ 5, WPN_HALBERD,
+ 5, WPN_GLAIVE,
+ 0);
+ break;
+ }
if (one_chance_in(3))
{
item_race = MAKE_ITEM_NO_RACE;
@@ -1085,7 +1098,8 @@ static void _give_ammo(monsters *mon, int level,
break;
case MONS_MERFOLK:
- if (!one_chance_in(3))
+ if (!one_chance_in(3)
+ || active_monster_band == BAND_MERFOLK_JAVELINEER)
{
item_race = MAKE_ITEM_NO_RACE;
if (coinflip())
@@ -1099,6 +1113,8 @@ static void _give_ammo(monsters *mon, int level,
weap_type = MI_JAVELIN;
qty = 3 + random2(6);
}
+ if (active_monster_band == BAND_MERFOLK_JAVELINEER)
+ break;
}
if (one_chance_in(6) && !mons_summoned)
{
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index cb54b20982..63d6524a4c 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -42,6 +42,8 @@
#include "travel.h"
#include "view.h"
+band_type active_monster_band = BAND_NO_BAND;
+
static std::vector<int> vault_mon_types;
static std::vector<int> vault_mon_bases;
static std::vector<int> vault_mon_weights;
@@ -775,6 +777,7 @@ int place_monster(mgen_data mg, bool force_pos)
int band_size = 1;
bool leader = false;
monster_type band_monsters[BIG_BAND]; // band monster types
+ band_type band = BAND_NO_BAND;
band_monsters[0] = mg.cls;
// The (very) ugly thing band colour.
@@ -785,10 +788,8 @@ int place_monster(mgen_data mg, bool force_pos)
#ifdef DEBUG_MON_CREATION
mpr("Choose band members...", MSGCH_DIAGNOSTICS);
#endif
- const band_type band = _choose_band(mg.cls, mg.power, band_size,
- leader);
+ band = _choose_band(mg.cls, mg.power, band_size, leader);
band_size++;
-
for (int i = 1; i < band_size; ++i)
{
band_monsters[i] = _band_member(band, mg.power);
@@ -1006,6 +1007,7 @@ int place_monster(mgen_data mg, bool force_pos)
band_template.flags |= MG_BAND_MINION;
}
+ unwind_var<band_type> current_band(active_monster_band, band);
// (5) For each band monster, loop call to place_monster_aux().
for (int i = 1; i < band_size; i++)
{
@@ -2110,6 +2112,23 @@ static band_type _choose_band(int mon_type, int power, int &band_size,
band_size = 4;
break;
+ case MONS_MERFOLK_AQUAMANCER:
+ natural_leader = true;
+ band = BAND_MERFOLK_AQUAMANCER;
+ band_size = random_range(3, 6);
+ break;
+
+ case MONS_MERFOLK_JAVELINEER:
+ natural_leader = true;
+ band = BAND_MERFOLK_JAVELINEER;
+ band_size = random_range(3, 5);
+ break;
+
+ case MONS_MERFOLK_IMPALER:
+ natural_leader = true;
+ band = BAND_MERFOLK_IMPALER;
+ band_size = random_range(3, 5);
+ break;
} // end switch
if (band != BAND_NO_BAND && band_size == 0)
@@ -2429,6 +2448,18 @@ static monster_type _band_member(band_type band, int power)
mon_type = MONS_SLAVE;
break;
+ case BAND_MERFOLK_AQUAMANCER:
+ mon_type = static_cast<monster_type>(
+ random_choose_weighted(8, MONS_MERFOLK,
+ 10, MONS_ICE_BEAST,
+ 0));
+ break;
+
+ case BAND_MERFOLK_IMPALER:
+ case BAND_MERFOLK_JAVELINEER:
+ mon_type = MONS_MERFOLK;
+ break;
+
default:
break;
}
diff --git a/crawl-ref/source/mon-place.h b/crawl-ref/source/mon-place.h
index 3512639462..28dc5e413f 100644
--- a/crawl-ref/source/mon-place.h
+++ b/crawl-ref/source/mon-place.h
@@ -102,4 +102,7 @@ monsters* get_free_monster();
bool can_place_on_trap(int mon_type, trap_type trap);
bool mons_airborne(int mcls, int flies, bool paralysed);
+// Active monster band may influence gear generation on band followers.
+extern band_type active_monster_band;
+
#endif // MONPLACE_H