diff options
author | Pete Hurst <pete@streamuniverse.tv> | 2013-06-23 20:45:23 +0100 |
---|---|---|
committer | Pete Hurst <pete@streamuniverse.tv> | 2013-06-23 21:04:24 +0100 |
commit | 70a65ab34f31b0ff3323698f8d5489b781355f73 (patch) | |
tree | b7ca66930aeee0fc4f25aa9d4939fcd391cf444c /crawl-ref/source/mon-chimera.cc | |
parent | cb3ad291444d6a6d1d417a30d3ce1ac29458b52c (diff) | |
download | crawl-ref-70a65ab34f31b0ff3323698f8d5489b781355f73.tar.gz crawl-ref-70a65ab34f31b0ff3323698f8d5489b781355f73.zip |
Implement chimera legs
This allows the chimera to take the legs of one of their parts.
This can give them the base speed of the legs monster,
also enables clinging, and for jumping spiders, will flavour a
self-blink as a jump instead of a blink.
Diffstat (limited to 'crawl-ref/source/mon-chimera.cc')
-rw-r--r-- | crawl-ref/source/mon-chimera.cc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-chimera.cc b/crawl-ref/source/mon-chimera.cc index 56fea9de1e..6165e8825b 100644 --- a/crawl-ref/source/mon-chimera.cc +++ b/crawl-ref/source/mon-chimera.cc @@ -54,9 +54,16 @@ void define_chimera(monster* mon, monster_type parts[]) // If one part has wings, take an average of base speed and the // speed of the winged monster. monster_type wings = get_chimera_wings(mon); - if (wings != MONS_NO_MONSTER && wings != parts[0]) - mon->speed = (mons_class_base_speed(parts[0]) + monster_type legs = get_chimera_legs(mon); + if (legs == MONS_NO_MONSTER) + legs = parts[0]; + if (wings != MONS_NO_MONSTER && wings != legs) + { + mon->speed = (mons_class_base_speed(legs) + mons_class_base_speed(wings))/2; + } + else if (legs != parts[0]) + mon->speed = mons_class_base_speed(legs); } // Randomly pick depth-appropriate chimera parts @@ -74,7 +81,6 @@ bool define_chimera_for_place(monster *mon, level_id place, monster_type chimera is_bad_chimera_part); } if (part != MONS_0) - parts[n] = part; else return false; @@ -131,6 +137,14 @@ static void apply_chimera_part(monster* mon, monster_type part, int partnum) else if (mons_flies(&dummy)) mon->props["chimera_wings"].get_int() = partnum; + // Check for a legs part. Jumpy behaviour (jumping spiders) should + // override normal clinging. + if (dummy.is_jumpy() + || (dummy.can_cling_to_walls() && !mon->props.exists("chimera_legs"))) + { + mon->props["chimera_legs"].get_int() = partnum; + } + // Apply spells but only for 2nd and 3rd parts since 1st part is // already supported by the original define_monster call if (partnum == 1) @@ -201,6 +215,13 @@ monster_type get_chimera_wings(const monster* mon) return MONS_NO_MONSTER; } +monster_type get_chimera_legs(const monster* mon) +{ + if (mon->props.exists("chimera_legs")) + return get_chimera_part(mon, mon->props["chimera_legs"].get_int()); + return MONS_NO_MONSTER; +} + string monster_info::chimera_part_names() const { if (!props.exists("chimera_part_2") || !props.exists("chimera_part_3")) |