summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/fight.cc12
-rw-r--r--crawl-ref/source/monstuff.cc71
-rw-r--r--crawl-ref/source/spl-cast.cc4
-rw-r--r--crawl-ref/source/tilesdl.cc5
4 files changed, 77 insertions, 15 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index ae21356345..83e1c6a377 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -1852,7 +1852,7 @@ bool melee_attack::player_monattk_hit_effects(bool mondied)
void melee_attack::_monster_die(monsters* monster, killer_type killer,
int killer_index)
{
- const bool chaos = damage_brand == SPWPN_CHAOS;
+ const bool chaos = (damage_brand == SPWPN_CHAOS);
// Copy defender before it gets reset by monster_die()
monsters* def_copy = NULL;
@@ -2431,7 +2431,7 @@ int melee_attack::random_chaos_brand()
int brands[] = {SPWPN_FLAMING, SPWPN_FREEZING, SPWPN_ELECTROCUTION,
SPWPN_VENOM, SPWPN_DRAINING, SPWPN_VAMPIRICISM,
SPWPN_PAIN, SPWPN_DISTORTION, SPWPN_CONFUSE,
- SPWPN_CHAOS};
+ SPWPN_CHAOS, SPWPN_NORMAL};
return (RANDOM_ELEMENT(brands));
}
@@ -2448,11 +2448,12 @@ bool melee_attack::apply_damage_brand()
bool brand_was_known = false;
if (weapon)
+ {
if (is_random_artefact(*weapon))
brand_was_known = randart_known_wpn_property(*weapon, RAP_BRAND);
else
brand_was_known = item_type_known(*weapon);
-
+ }
bool ret = false;
// Monster resistance to the brand.
@@ -2467,6 +2468,8 @@ bool melee_attack::apply_damage_brand()
else
brand = damage_brand;
+ mprf(MSGCH_DIAGNOSTICS, "brand = %d", brand);
+
switch (brand)
{
case SPWPN_FLAMING:
@@ -2703,11 +2706,12 @@ bool melee_attack::apply_damage_brand()
}
if (attacker->atype() == ACT_PLAYER && damage_brand == SPWPN_CHAOS)
+ {
// If your god objects to using chaos then it makes the
// brand obvious.
if (did_god_conduct(DID_CHAOS, 2 + random2(3), brand_was_known))
obvious_effect = true;
-
+ }
if (!obvious_effect)
obvious_effect = !special_damage_message.empty();
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 259dfc95f6..a9cc692af0 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3020,7 +3020,7 @@ static bool _find_wall_target(monsters *mon)
ri; ++ri)
{
if (!grid_is_solid(*ri)
- || monster_habitable_grid(mon, grd(*ri)))
+ || !monster_habitable_grid(mon, grd(*ri)))
{
continue;
}
@@ -4148,14 +4148,15 @@ static void _handle_movement(monsters *monster)
if (mmov.origin())
return;
- // Reproduced here is some semi-legacy code that makes monsters
- // move somewhat randomly along oblique paths. It is an exceedingly
- // good idea, given crawl's unique line of sight properties.
- //
- // Added a check so that oblique movement paths aren't used when
- // close to the target square. -- bwr
if (delta.rdist() > 3)
{
+ // Reproduced here is some semi-legacy code that makes monsters
+ // move somewhat randomly along oblique paths. It is an exceedingly
+ // good idea, given crawl's unique line of sight properties.
+ //
+ // Added a check so that oblique movement paths aren't used when
+ // close to the target square. -- bwr
+
// Sometimes we'll just move parallel the x axis.
if (abs(delta.x) > abs(delta.y) && coinflip())
mmov.y = 0;
@@ -4185,6 +4186,62 @@ static void _handle_movement(monsters *monster)
_mon_can_move_to_pos(monster, coord_def(count_x-1, count_y-1));
}
+ if (mons_wall_shielded(monster))
+ {
+ if (mmov.x != 0 && mmov.y != 0)
+ {
+ bool updown = false;
+ bool leftright = false;
+
+ coord_def t = monster->pos() + coord_def(mmov.x, 0);
+ if (in_bounds(t) && grid_is_rock(grd(t)) && !grid_is_permarock(grd(t)))
+ updown = true;
+
+ t = monster->pos() + coord_def(0, mmov.y);
+ if (in_bounds(t) && grid_is_rock(grd(t)) && !grid_is_permarock(grd(t)))
+ leftright = true;
+
+ if (updown && (!leftright || coinflip()))
+ mmov.y = 0;
+ else if (leftright)
+ mmov.x = 0;
+ }
+ else if (mmov.x == 0 && monster->target.x == monster->pos().x)
+ {
+ bool left = false;
+ bool right = false;
+ coord_def t = monster->pos() + coord_def(-1, mmov.y);
+ if (in_bounds(t) && grid_is_rock(grd(t)) && !grid_is_permarock(grd(t)))
+ left = true;
+
+ t = monster->pos() + coord_def(1, mmov.y);
+ if (in_bounds(t) && grid_is_rock(grd(t)) && !grid_is_permarock(grd(t)))
+ right = true;
+
+ if (left && (!right || coinflip()))
+ mmov.x = -1;
+ else if (right)
+ mmov.x = 1;
+ }
+ else if (mmov.y == 0 && monster->target.y == monster->pos().y)
+ {
+ bool up = false;
+ bool down = false;
+ coord_def t = monster->pos() + coord_def(mmov.x, -1);
+ if (in_bounds(t) && grid_is_rock(grd(t)) && !grid_is_permarock(grd(t)))
+ up = true;
+
+ t = monster->pos() + coord_def(mmov.x, 1);
+ if (in_bounds(t) && grid_is_rock(grd(t)) && !grid_is_permarock(grd(t)))
+ down = true;
+
+ if (up && (!down || coinflip()))
+ mmov.y = -1;
+ else if (down)
+ mmov.y = 1;
+ }
+ }
+
// If the monster is moving in your direction, whether to attack or protect
// you, or towards a monster it intends to attack, check whether we first
// need to take a step to the side to make sure the reinforcement can
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index c1ac0e90ad..b78045eea0 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -2430,7 +2430,7 @@ void MiscastEffect::do_miscast()
sp_type = school;
if (sp_type == SPTYP_RANDOM)
{
- // XXX: Monsters currently have no divintation miscasts.
+ // XXX: Monsters currently have no divination miscasts.
do
{
int exp = (random2(SPTYP_LAST_EXPONENT));
@@ -2803,7 +2803,7 @@ void MiscastEffect::_conjuration(int severity)
break;
case 1:
you_msg = "You are caught in a violent explosion!";
- mon_msg_seen = "@The_monster@ is caugh in a violent explosion!";
+ mon_msg_seen = "@The_monster@ is caught in a violent explosion!";
mon_msg_unseen = "A violent explosion happens from "
"out of thin air!";
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index 26de585f68..039a542321 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -1049,9 +1049,7 @@ static void _fill_item_info(InventoryTile &desc, const item_def &item)
desc.quantity = item.plus;
}
else
- {
desc.quantity = -1;
- }
if (item.base_type == OBJ_WEAPONS)
{
@@ -1080,6 +1078,9 @@ static void _fill_item_info(InventoryTile &desc, const item_def &item)
case SPMSL_RETURNING:
desc.special = TILE_BRAND_RETURNING;
break;
+ case SPMSL_CHAOS:
+ desc.special = TILE_BRAND_CHAOS;
+ break;
default:
break;
}