From dc6da664d1b8aebf9c7baf96dc26513863affadb Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Wed, 30 Dec 2009 04:10:14 -0800 Subject: Implement fish corpses and kraken zombies. --- crawl-ref/source/mon-act.cc | 2 +- crawl-ref/source/mon-cast.cc | 10 ++++++++-- crawl-ref/source/mon-data.h | 24 ++++++++++++------------ crawl-ref/source/mon-place.cc | 4 +++- crawl-ref/source/mon-stuff.cc | 4 ++-- crawl-ref/source/mon-util.cc | 5 +++++ crawl-ref/source/mon-util.h | 1 + crawl-ref/source/monster.cc | 4 ++-- 8 files changed, 34 insertions(+), 20 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 6aca56ffa8..067d59d3a6 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -2793,7 +2793,7 @@ static bool _mon_can_move_to_pos(const monsters *monster, // The kraken is so large it cannot enter shallow water. // Its tentacles can, and will, though. - if (monster->type == MONS_KRAKEN && target_grid == DNGN_SHALLOW_WATER) + if (mons_base_type(monster) == MONS_KRAKEN && target_grid == DNGN_SHALLOW_WATER) return (false); // Effectively slows down monster movement across water. diff --git a/crawl-ref/source/mon-cast.cc b/crawl-ref/source/mon-cast.cc index fb9b5092d4..e1bca14d78 100644 --- a/crawl-ref/source/mon-cast.cc +++ b/crawl-ref/source/mon-cast.cc @@ -1818,15 +1818,21 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast, // Tentacles aren't really summoned (controlled by spell_cast // being passed to summon_type), so I'm not sure what the // abjuration value (3) is doing there. (jpeg) - if (create_monster( + int tentacle = create_monster( mgen_data(MONS_KRAKEN_TENTACLE, SAME_ATTITUDE(monster), monster, 3, spell_cast, monster->pos(), monster->foe, 0, god, MONS_NO_MONSTER, kraken_index, monster->colour, you.your_level, PROX_CLOSE_TO_PLAYER, - you.level_type)) == -1) + you.level_type)); + + if (tentacle < 0) { sumcount2--; } + else if (monster->holiness() == MH_UNDEAD) + { + menv[tentacle].flags |= MF_HONORARY_UNDEAD; + } } if (sumcount2 == 1) mpr("A tentacle rises from the water!"); diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index afecaf42fa..ac0bb050f1 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -3276,10 +3276,10 @@ static monsterentry mondata[] = { MONS_BIG_FISH, ';', LIGHTGREEN, "big fish", M_COLD_BLOOD, MR_NO_FLAGS, - 0, 10, MONS_BIG_FISH, MONS_BIG_FISH, MH_NATURAL, -3, + 300, 10, MONS_BIG_FISH, MONS_BIG_FISH, MH_NATURAL, -3, { {AT_BITE, AF_PLAIN, 8}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 4, 3, 5, 0 }, - 1, 12, MST_NO_SPELLS, CE_NOCORPSE, Z_SMALL, S_SILENT, + 1, 12, MST_NO_SPELLS, CE_CLEAN, Z_SMALL, S_SILENT, I_ANIMAL, HT_WATER, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_SMALL }, @@ -3288,10 +3288,10 @@ static monsterentry mondata[] = { MONS_GIANT_GOLDFISH, ';', LIGHTRED, "giant goldfish", M_COLD_BLOOD, MR_NO_FLAGS, - 0, 10, MONS_BIG_FISH, MONS_GIANT_GOLDFISH, MH_NATURAL, -3, + 500, 10, MONS_BIG_FISH, MONS_GIANT_GOLDFISH, MH_NATURAL, -3, { {AT_BITE, AF_PLAIN, 15}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 7, 3, 5, 0 }, - 5, 7, MST_NO_SPELLS, CE_NOCORPSE, Z_SMALL, S_SILENT, + 5, 7, MST_NO_SPELLS, CE_CLEAN, Z_SMALL, S_SILENT, I_ANIMAL, HT_WATER, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LITTLE }, @@ -3300,10 +3300,10 @@ static monsterentry mondata[] = { MONS_ELECTRIC_EEL, ';', LIGHTBLUE, "electric eel", M_COLD_BLOOD | M_SPECIAL_ABILITY, MR_RES_ELEC, - 0, 10, MONS_ELECTRIC_EEL, MONS_ELECTRIC_EEL, MH_NATURAL, -3, + 700, 10, MONS_ELECTRIC_EEL, MONS_ELECTRIC_EEL, MH_NATURAL, -3, { AT_NO_ATK, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 3, 3, 5, 0 }, - 1, 15, MST_NO_SPELLS, CE_NOCORPSE, Z_SMALL, S_SILENT, + 1, 15, MST_NO_SPELLS, CE_CLEAN, Z_SMALL, S_SILENT, I_ANIMAL, HT_WATER, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_SMALL }, @@ -3312,11 +3312,11 @@ static monsterentry mondata[] = { MONS_JELLYFISH, 'J', CYAN, "jellyfish", M_NO_FLAGS, MR_RES_POISON, - 0, 10, MONS_JELLYFISH, MONS_JELLYFISH, MH_NATURAL, -3, + 1000, 10, MONS_JELLYFISH, MONS_JELLYFISH, MH_NATURAL, -3, { {AT_STING, AF_POISON_STR, 1}, {AT_HIT, AF_PLAIN, 1}, AT_NO_ATK, AT_NO_ATK }, { 4, 3, 5, 0 }, - 0, 5, MST_NO_SPELLS, CE_NOCORPSE, Z_SMALL, S_SILENT, + 0, 5, MST_NO_SPELLS, CE_POISONOUS, Z_SMALL, S_SILENT, I_PLANT, HT_WATER, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LITTLE }, @@ -3326,10 +3326,10 @@ static monsterentry mondata[] = { MONS_SHARK, ';', WHITE, "shark", M_COLD_BLOOD | M_BLOOD_SCENT, MR_NO_FLAGS, - 0, 12, MONS_SHARK, MONS_SHARK, MH_NATURAL, -3, + 2000, 12, MONS_SHARK, MONS_SHARK, MH_NATURAL, -3, { {AT_BITE, AF_PLAIN, 15}, {AT_BITE, AF_PLAIN, 8}, AT_NO_ATK, AT_NO_ATK }, { 7, 3, 5, 0 }, - 9, 5, MST_NO_SPELLS, CE_NOCORPSE, Z_BIG, S_SILENT, + 9, 5, MST_NO_SPELLS, CE_CONTAMINATED, Z_BIG, S_SILENT, I_ANIMAL, HT_WATER, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_LARGE }, @@ -3339,10 +3339,10 @@ static monsterentry mondata[] = { MONS_KRAKEN, 'X', BLACK, "kraken", M_COLD_BLOOD | M_SPELLCASTER, MR_NO_FLAGS, - 1500, 20, MONS_KRAKEN, MONS_KRAKEN, MH_NATURAL, -3, + 3500, 20, MONS_KRAKEN, MONS_KRAKEN, MH_NATURAL, -3, { {AT_BITE, AF_PLAIN, 50}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK }, { 20, 10, 10, 0 }, - 20, 0, MST_KRAKEN, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, + 20, 0, MST_KRAKEN, CE_POISONOUS, Z_BIG, S_SILENT, I_ANIMAL, HT_WATER, FL_NONE, 10, DEFAULT_ENERGY, MONUSE_NOTHING, MONEAT_NOTHING, SIZE_HUGE }, diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc index dc5c47ba00..10dd3c615c 100644 --- a/crawl-ref/source/mon-place.cc +++ b/crawl-ref/source/mon-place.cc @@ -1681,7 +1681,9 @@ static void _define_zombie(int mid, monster_type ztype, monster_type cs, define_monster(mid); // Turn off all spellcasting flags. - menv[mid].flags &= ~MF_SPELLCASTER & ~MF_ACTUAL_SPELLS & ~MF_PRIEST; + // Hack - kraken get to keep their spell-like ability. + if (menv[mid].base_monster != MONS_KRAKEN) + menv[mid].flags &= ~MF_SPELLCASTER & ~MF_ACTUAL_SPELLS & ~MF_PRIEST; menv[mid].hit_points = hit_points(menv[mid].hit_dice, 6, 5); menv[mid].max_hit_points = menv[mid].hit_points; diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index cb14b67710..95a418b0a7 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -1306,7 +1306,7 @@ static int _tentacle_too_far(monsters *head, monsters *tentacle) void mons_relocated(monsters *monster) { - if (monster->type == MONS_KRAKEN) + if (mons_base_type(monster) == MONS_KRAKEN) { int headnum = monster->mindex(); @@ -2098,7 +2098,7 @@ int monster_die(monsters *monster, killer_type killer, // he goes away. pikel_band_neutralise(); } - else if (monster->type == MONS_KRAKEN) + else if (mons_base_type(monster) == MONS_KRAKEN) { if (_destroy_tentacles(monster) && !in_transit) { diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 5895a0c542..fa2ce2be15 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -922,6 +922,11 @@ bool mons_is_zombified(const monsters *mon) return (mons_class_is_zombified(mon->type)); } +monster_type mons_base_type(const monsters *mon) +{ + return mons_is_zombified(mon) ? mon->base_monster : mon->type; +} + bool mons_class_can_be_zombified(int mc) { int ms = mons_species(mc); diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index b9c5424aee..95a0ca5d55 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -557,6 +557,7 @@ bool mons_can_regenerate(const monsters *mon); int mons_zombie_size(int mc); monster_type mons_zombie_base(const monsters *mon); bool mons_class_is_zombified(int mc); +monster_type mons_base_type(const monsters *mon); bool mons_is_zombified(const monsters *monster); bool mons_class_can_be_zombified(int mc); bool mons_can_be_zombified(const monsters *mon); diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 8d0f02f428..1e88b10f33 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -188,7 +188,7 @@ static bool _player_near_water() bool monsters::wants_submerge() const { // Krakens never retreat when food (the player) is in range. - if (type == MONS_KRAKEN) + if (mons_base_type(this) == MONS_KRAKEN) if (_player_near_water()) return (false); @@ -5994,7 +5994,7 @@ void monsters::react_to_damage(int damage, beam_type flavour, kill_category whos else if (type == MONS_KRAKEN_TENTACLE && flavour != BEAM_TORMENT_DAMAGE) { if (!invalid_monster_index(number) - && menv[number].type == MONS_KRAKEN) + && mons_base_type(&menv[number]) == MONS_KRAKEN) { menv[number].hurt(&you, damage, flavour); -- cgit v1.2.3-54-g00ecf