From 4e03bfe81c154ada6a73873cbbf5776d440280ff Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 19 Jul 2009 14:15:30 +0000 Subject: Simplify the royal jelly effect for both players and monsters, and make sure that both spawn Jiyva-worshipping jellies. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10311 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mon-util.cc | 6 +++--- crawl-ref/source/mon-util.h | 1 + crawl-ref/source/ouch.cc | 7 +------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 00bd93cdb5..fc5de18c16 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -8082,7 +8082,7 @@ void monsters::lose_energy(energy_use_type et, int div, int mult) speed_increment -= energy_loss; } -static inline monster_type _royal_jelly_ejectable_monster() +monster_type royal_jelly_ejectable_monster() { return static_cast( random_choose(MONS_ACID_BLOB, @@ -8229,14 +8229,14 @@ void monsters::react_to_damage(int damage, beam_type flavour) int spawned = 0; for (int i = 0; i < tospawn; ++i) { - const monster_type jelly = _royal_jelly_ejectable_monster(); + const monster_type jelly = royal_jelly_ejectable_monster(); coord_def jpos = find_newmons_square_contiguous(jelly, pos()); if (!in_bounds(jpos)) continue; const int nmons = mons_place( mgen_data(jelly, beha, 0, 0, - jpos, foe)); + jpos, foe, 0, god)); if (nmons != -1 && nmons != NON_MONSTER) { diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index 38979e84fb..3c745e37db 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -682,6 +682,7 @@ int mons_colour(const monsters *mon); void mons_load_spells(monsters *mon, mon_spellbook_type book); +monster_type royal_jelly_ejectable_monster(); monster_type random_draconian_monster_species(); // last updated 12may2000 {dlb} diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 33eb7a1285..d288dd0d30 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -842,11 +842,7 @@ static void _maybe_spawn_jellies(int dam, const char* aux, if (death_source == NON_MONSTER) return; - monster_type mon; - const monster_type jellies[] = { - MONS_ACID_BLOB, MONS_AZURE_JELLY, - MONS_DEATH_OOZE - }; + monster_type mon = royal_jelly_ejectable_monster(); // Exclude torment damage. const char *ptr = strstr(aux, "torment"); @@ -872,7 +868,6 @@ static void _maybe_spawn_jellies(int dam, const char* aux, int count_created = 0; for (int i = 0; i < how_many; ++i) { - mon = RANDOM_ELEMENT(jellies); mgen_data mg(mon, BEH_STRICT_NEUTRAL, 0, 0, you.pos(), MHITNOT, 0, GOD_JIYVA); -- cgit v1.2.3-54-g00ecf