From e9017206fd30a9cb7981d42ee6f8f1809f2f2933 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Tue, 29 Dec 2009 00:01:37 +0530 Subject: Experimental kraken adjustments. Boost kraken and tentacle damage. Force the tentacles to stay close to the body of the kraken to make the creature look more like a unit. Tentacles are now amphibious and can reach out onto land, although they cannot stray too far from the main body. --- crawl-ref/source/mon-act.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/mon-act.cc') diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 16c025e217..3fc1cea5a0 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -332,6 +332,24 @@ static void _maybe_set_patrol_route(monsters *monster) } } +// Keep kraken tentacles from wandering too far away from the boss monster. +static void _kraken_tentacle_movement_clamp(monsters *tentacle) +{ + if (tentacle->type != MONS_KRAKEN_TENTACLE) + return; + + const int kraken_idx = tentacle->number; + ASSERT(!invalid_monster_index(kraken_idx)); + + monsters *kraken = &menv[kraken_idx]; + const int distance_to_head = + grid_distance(tentacle->pos(), kraken->pos()); + // Beyond max distance, the only move the tentacle can make is + // back towards the head. + if (distance_to_head >= KRAKEN_TENTACLE_RANGE) + mmov = (kraken->pos() - tentacle->pos()).sgn(); +} + //--------------------------------------------------------------- // // handle_movement @@ -378,8 +396,7 @@ static void _handle_movement(monsters *monster) delta = monster->target - monster->pos(); // Move the monster. - mmov.x = (delta.x > 0) ? 1 : ((delta.x < 0) ? -1 : 0); - mmov.y = (delta.y > 0) ? 1 : ((delta.y < 0) ? -1 : 0); + mmov = delta.sgn(); if (mons_is_fleeing(monster) && monster->travel_target != MTRAV_WALL && (!monster->friendly() @@ -1849,6 +1866,7 @@ static void _handle_monster_move(monsters *monster) { // Calculates mmov based on monster target. _handle_movement(monster); + _kraken_tentacle_movement_clamp(monster); if (mons_is_confused(monster) || monster->type == MONS_AIR_ELEMENTAL -- cgit v1.2.3-54-g00ecf