Navigation Menu

Skip to content

Commit

Permalink
Remove M_SENSE_INVIS (and into, minmay)
Browse files Browse the repository at this point in the history
Having two different levels of monsters being "resistant" to
invisibility was odd and didn't add much to the game. In addition,
SENSE_INVIS had a couple minor, spoilery effects such as making
SENSE_INVIS monsters more likely to resist player stealth. All monsters
which formerly had M_SENSE_INVIS now have M_SEE_INVIS.
  • Loading branch information
SeveMonahan committed Oct 25, 2014
1 parent 03c6cb7 commit 90d2633
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 56 deletions.
2 changes: 1 addition & 1 deletion crawl-ref/source/attack.cc
Expand Up @@ -2015,7 +2015,7 @@ void attack::player_stab_check()
const bool roll_needed = (st != STAB_SLEEPING && st != STAB_PARALYSED);

int roll = 100;
if (st == STAB_INVISIBLE && !mons_sense_invis(defender->as_monster()))
if (st == STAB_INVISIBLE)
roll -= 10;

switch (st)
Expand Down
6 changes: 0 additions & 6 deletions crawl-ref/source/beam.cc
Expand Up @@ -2989,12 +2989,6 @@ bool bolt::fuzz_invis_tracer()
return false;

const actor *beam_src = beam_source_as_target();
if (beam_src && beam_src->is_monster()
&& mons_sense_invis(beam_src->as_monster()))
{
// Monsters that can sense invisible
return dist == 0;
}

// Apply fuzz now.
coord_def fuzz(random_range(-2, 2), random_range(-2, 2));
Expand Down
2 changes: 0 additions & 2 deletions crawl-ref/source/describe.cc
Expand Up @@ -3482,8 +3482,6 @@ static string _monster_stat_description(const monster_info& mi)
{
result << uppercase_first(pronoun) << " can see invisible.\n";
}
else if (mons_class_flag(mi.type, M_SENSE_INVIS))
result << uppercase_first(pronoun) << " can sense the presence of invisible creatures.\n";

// Unusual monster speed.
const int speed = mi.base_speed();
Expand Down
5 changes: 0 additions & 5 deletions crawl-ref/source/l_moninf.cc
Expand Up @@ -152,11 +152,6 @@ static bool cant_see_you(const monster_info *mi)
{
if (mons_class_flag(mi->type, M_SEE_INVIS))
return false;
if (mons_class_flag(mi->type, M_SENSE_INVIS)
&& (you.pos() - mi->pos).abs() <= 17)
{
return false;
}
if (you.in_water())
return false;
return you.invisible() || mi->is(MB_BLIND);
Expand Down
2 changes: 1 addition & 1 deletion crawl-ref/source/mon-behv.cc
Expand Up @@ -44,7 +44,7 @@
static void _guess_invis_foe_pos(monster* mon)
{
const actor* foe = mon->get_foe();
const int guess_radius = mons_sense_invis(mon) ? 3 : 2;
const int guess_radius = 2;

vector<coord_def> possibilities;

Expand Down
52 changes: 26 additions & 26 deletions crawl-ref/source/mon-data.h
Expand Up @@ -331,7 +331,7 @@ static monsterentry mondata[] =
// batty monsters ('b')
{
MONS_BAT, 'b', LIGHTGREY, "bat",
M_SENSE_INVIS | M_WARM_BLOOD | M_BATTY,
M_SEE_INVIS | M_WARM_BLOOD | M_BATTY,
MR_NO_FLAGS,
150, 4, MONS_BAT, MONS_BAT, MH_NATURAL, 0,
{ {AT_HIT, AF_PLAIN, 1}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -355,7 +355,7 @@ static monsterentry mondata[] =

{ // one vault + player transform (Vp ability)
MONS_VAMPIRE_BAT, 'b', MAGENTA, "vampire bat",
M_SENSE_INVIS | M_WARM_BLOOD | M_BATTY | M_NO_POLY_TO,
M_SEE_INVIS | M_WARM_BLOOD | M_BATTY | M_NO_POLY_TO,
MR_NO_FLAGS,
0, 8, MONS_BAT, MONS_VAMPIRE_BAT, MH_UNDEAD, 10,
{ {AT_BITE, AF_VAMPIRIC, 3}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -367,7 +367,7 @@ static monsterentry mondata[] =

{
MONS_FIRE_BAT, 'b', LIGHTRED, "fire bat",
M_SENSE_INVIS | M_WARM_BLOOD | M_BATTY,
M_SEE_INVIS | M_WARM_BLOOD | M_BATTY,
MR_RES_HELLFIRE | MR_VUL_COLD | MR_VUL_WATER,
0, 8, MONS_BAT, MONS_FIRE_BAT, MH_NATURAL, 10,
{ {AT_BITE, AF_FIRE, 6}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -379,7 +379,7 @@ static monsterentry mondata[] =

{
MONS_RAVEN, 'b', BLUE, "raven",
M_SENSE_INVIS | M_WARM_BLOOD,
M_SEE_INVIS | M_WARM_BLOOD,
MR_NO_FLAGS,
250, 9, MONS_RAVEN, MONS_RAVEN, MH_NATURAL, 20,
{ {AT_PECK, AF_PLAIN, 14}, {AT_CLAW, AF_PLAIN, 11}, AT_NO_ATK, AT_NO_ATK },
Expand Down Expand Up @@ -907,7 +907,7 @@ static monsterentry mondata[] =

{
MONS_THORN_HUNTER, 'f', WHITE, "thorn hunter",
M_SENSE_INVIS,
M_SEE_INVIS,
MR_RES_POISON | MR_VUL_FIRE,
0, 14, MONS_PLANT, MONS_THORN_HUNTER, MH_PLANT, MAG_IMMUNE,
{ {AT_HIT, AF_PLAIN, 27}, {AT_HIT, AF_PLAIN, 23}, AT_NO_ATK,
Expand Down Expand Up @@ -1055,7 +1055,7 @@ static monsterentry mondata[] =

{
MONS_HOUND, 'h', YELLOW, "hound",
M_SENSE_INVIS | M_WARM_BLOOD | M_BLOOD_SCENT,
M_SEE_INVIS | M_WARM_BLOOD | M_BLOOD_SCENT,
MR_NO_FLAGS,
300, 10, MONS_HOUND, MONS_HOUND, MH_NATURAL, 10,
{ {AT_BITE, AF_PLAIN, 6}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -1067,7 +1067,7 @@ static monsterentry mondata[] =

{
MONS_WARG, 'h', WHITE, "warg",
M_SENSE_INVIS | M_WARM_BLOOD | M_BLOOD_SCENT,
M_SEE_INVIS | M_WARM_BLOOD | M_BLOOD_SCENT,
MR_RES_POISON,
750, 12, MONS_HOUND, MONS_WARG, MH_NATURAL, 40,
{ {AT_BITE, AF_PLAIN, 18}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -1079,7 +1079,7 @@ static monsterentry mondata[] =

{
MONS_WOLF, 'h', LIGHTGREY, "wolf",
M_SENSE_INVIS | M_WARM_BLOOD | M_BLOOD_SCENT,
M_SEE_INVIS | M_WARM_BLOOD | M_BLOOD_SCENT,
MR_NO_FLAGS,
450, 19, MONS_HOUND, MONS_WOLF, MH_NATURAL, 20,
{ {AT_BITE, AF_PLAIN, 12}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -1103,7 +1103,7 @@ static monsterentry mondata[] =

{
MONS_HELL_HOUND, 'h', CYAN, "hell hound",
M_SENSE_INVIS | M_BLOOD_SCENT,
M_SEE_INVIS | M_BLOOD_SCENT,
MR_RES_POISON | MR_RES_HELLFIRE | MR_VUL_COLD,
450, 10, MONS_HOUND, MONS_HELL_HOUND, MH_DEMONIC, 20,
{ {AT_BITE, AF_PLAIN, 13}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -1115,7 +1115,7 @@ static monsterentry mondata[] =

{
MONS_RAIJU, 'h', LIGHTCYAN, "raiju",
M_SENSE_INVIS | M_BLOOD_SCENT,
M_SEE_INVIS | M_BLOOD_SCENT,
mrd(MR_RES_ELEC, 3),
450, 12, MONS_HOUND, MONS_RAIJU, MH_NATURAL, 20,
{ {AT_BITE, AF_ELEC, 11}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand Down Expand Up @@ -1954,7 +1954,7 @@ DUMMY(MONS_GIANT_LIZARD, 'l', LIGHTGREY, "giant lizard")

{
MONS_JUMPING_SPIDER, 's', LIGHTBLUE, "jumping spider",
M_NO_SKELETON | M_WEB_SENSE | M_SENSE_INVIS,
M_NO_SKELETON | M_WEB_SENSE | M_SEE_INVIS,
MR_VUL_POISON,
300, 8, MONS_SPIDER, MONS_JUMPING_SPIDER, MH_NATURAL, 20,
{ {AT_POUNCE, AF_ENSNARE, 20}, {AT_BITE, AF_POISON, 5}, AT_NO_ATK,
Expand Down Expand Up @@ -2363,7 +2363,7 @@ DUMMY(MONS_CRAB, 't', LIGHTGREY, "crab")

{
MONS_WORLDBINDER, 'x', CYAN, "worldbinder",
M_SENSE_INVIS,
M_SEE_INVIS,
MR_RES_POISON,
0, 13, MONS_WORLDBINDER, MONS_WORLDBINDER, MH_NONLIVING, 60,
{ {AT_HIT, AF_PLAIN, 8}, {AT_HIT, AF_PLAIN, 8},
Expand Down Expand Up @@ -2889,7 +2889,7 @@ DUMMY(MONS_DRAGON, 'D', GREEN, "dragon")

{
MONS_BONE_DRAGON, 'D', LIGHTGREY, "bone dragon",
M_SENSE_INVIS,
M_SEE_INVIS,
MR_RES_FIRE | MR_RES_COLD | MR_RES_ELEC,
0, 12, MONS_DRAGON, MONS_BONE_DRAGON, MH_UNDEAD, 100,
{ {AT_BITE, AF_PLAIN, 30}, {AT_CLAW, AF_PLAIN, 20},
Expand Down Expand Up @@ -3218,7 +3218,7 @@ DUMMY(MONS_ELEMENTAL, 'E', LIGHTGREY, "elemental")
// jellies ('J')
{
MONS_OOZE, 'J', LIGHTGREY, "ooze",
M_SENSE_INVIS,
M_SEE_INVIS,
MR_RES_POISON | MR_RES_ASPHYX | mrd(MR_RES_ACID, 3),
0, 3, MONS_JELLY, MONS_OOZE, MH_NATURAL, 20,
{ {AT_HIT, AF_PLAIN, 5}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand Down Expand Up @@ -3256,7 +3256,7 @@ DUMMY(MONS_MERGED_SLIME_CREATURE, 'J', LIGHTGREEN, "merged slime creature")

{
MONS_AZURE_JELLY, 'J', LIGHTBLUE, "azure jelly",
M_SENSE_INVIS,
M_SEE_INVIS,
MR_RES_POISON | MR_RES_ASPHYX | MR_RES_COLD | MR_VUL_FIRE | MR_RES_ELEC
| mrd(MR_RES_ACID, 3),
0, 14, MONS_JELLY, MONS_AZURE_JELLY, MH_NATURAL, 80,
Expand All @@ -3270,7 +3270,7 @@ DUMMY(MONS_MERGED_SLIME_CREATURE, 'J', LIGHTGREEN, "merged slime creature")

{
MONS_DEATH_OOZE, 'J', MAGENTA, "death ooze",
M_SENSE_INVIS,
M_SEE_INVIS,
MR_RES_COLD | mrd(MR_RES_ACID, 3),
0, 15, MONS_JELLY, MONS_DEATH_OOZE, MH_UNDEAD, 120,
{ {AT_HIT, AF_ROT, 32}, {AT_HIT, AF_PLAIN, 32}, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -3282,7 +3282,7 @@ DUMMY(MONS_MERGED_SLIME_CREATURE, 'J', LIGHTGREEN, "merged slime creature")

{
MONS_ACID_BLOB, 'J', LIGHTCYAN, "acid blob",
M_SENSE_INVIS | M_ACID_SPLASH,
M_SEE_INVIS | M_ACID_SPLASH,
MR_RES_POISON | MR_RES_ASPHYX | mrd(MR_RES_ACID, 3),
0, 12, MONS_JELLY, MONS_ACID_BLOB, MH_NATURAL, 160,
{ {AT_HIT, AF_ACID, 42}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand Down Expand Up @@ -3901,7 +3901,7 @@ DUMMY(MONS_SNAKE, 'S', LIGHTGREEN, "snake")

{
MONS_MANA_VIPER, 'S', MAGENTA, "mana viper",
M_COLD_BLOOD | M_SENSE_INVIS,
M_COLD_BLOOD | M_SEE_INVIS,
MR_RES_POISON,
0, 10, MONS_SNAKE, MONS_MANA_VIPER, MH_NATURAL, MAG_IMMUNE,
{ {AT_BITE, AF_ANTIMAGIC, 23}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand Down Expand Up @@ -3940,7 +3940,7 @@ DUMMY(MONS_SNAKE, 'S', LIGHTGREEN, "snake")

{
MONS_DEEP_TROLL, 'T', YELLOW, "deep troll",
M_WARM_BLOOD | M_SENSE_INVIS | M_SPEAKS | M_FAST_REGEN,
M_WARM_BLOOD | M_SEE_INVIS | M_SPEAKS | M_FAST_REGEN,
MR_NO_FLAGS,
1500, 9, MONS_TROLL, MONS_DEEP_TROLL, MH_NATURAL, 40,
{ {AT_BITE, AF_PLAIN, 27}, {AT_CLAW, AF_PLAIN, 20},
Expand All @@ -3953,7 +3953,7 @@ DUMMY(MONS_SNAKE, 'S', LIGHTGREEN, "snake")

{
MONS_DEEP_TROLL_EARTH_MAGE, 'T', MAGENTA, "deep troll earth mage",
M_ACTUAL_SPELLS | M_WARM_BLOOD | M_SENSE_INVIS | M_SPEAKS,
M_ACTUAL_SPELLS | M_WARM_BLOOD | M_SEE_INVIS | M_SPEAKS,
MR_NO_FLAGS,
1500, 12, MONS_TROLL, MONS_DEEP_TROLL, MH_NATURAL, 40,
{ {AT_BITE, AF_PLAIN, 27}, {AT_CLAW, AF_PLAIN, 20},
Expand All @@ -3967,7 +3967,7 @@ DUMMY(MONS_SNAKE, 'S', LIGHTGREEN, "snake")

{
MONS_DEEP_TROLL_SHAMAN, 'T', WHITE, "deep troll shaman",
M_PRIEST | M_WARM_BLOOD | M_SENSE_INVIS | M_SPEAKS,
M_PRIEST | M_WARM_BLOOD | M_SEE_INVIS | M_SPEAKS,
MR_NO_FLAGS,
1500, 12, MONS_TROLL, MONS_DEEP_TROLL, MH_NATURAL, 40,
{ {AT_BITE, AF_PLAIN, 27}, {AT_CLAW, AF_PLAIN, 20},
Expand Down Expand Up @@ -4023,7 +4023,7 @@ DUMMY(MONS_SNAKE, 'S', LIGHTGREEN, "snake")

{
MONS_JIANGSHI, 'V', YELLOW, "jiangshi",
M_SENSE_INVIS | M_BLOOD_SCENT | M_FIGHTER,
M_SEE_INVIS | M_BLOOD_SCENT | M_FIGHTER,
MR_RES_COLD,
0, 10, MONS_JIANGSHI, MONS_VAMPIRE, MH_UNDEAD, 80,
{ {AT_CLAW, AF_VAMPIRIC, 27}, {AT_CLAW, AF_VAMPIRIC, 27}, AT_NO_ATK,
Expand Down Expand Up @@ -4063,7 +4063,7 @@ DUMMY(MONS_SNAKE, 'S', LIGHTGREEN, "snake")

{
MONS_HUNGRY_GHOST, 'W', GREEN, "hungry ghost",
M_SENSE_INVIS | M_INSUBSTANTIAL | M_SPEAKS,
M_SEE_INVIS | M_INSUBSTANTIAL | M_SPEAKS,
mrd(MR_RES_COLD, 2),
0, 8, MONS_GHOST, MONS_HUNGRY_GHOST, MH_UNDEAD, 40,
{ {AT_HIT, AF_HUNGER, 5}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand Down Expand Up @@ -4126,7 +4126,7 @@ DUMMY(MONS_SNAKE, 'S', LIGHTGREEN, "snake")

{
MONS_DROWNED_SOUL, 'W', LIGHTCYAN, "drowned soul",
M_SENSE_INVIS | M_INSUBSTANTIAL | M_SPEAKS,
M_SEE_INVIS | M_INSUBSTANTIAL | M_SPEAKS,
mrd(MR_RES_COLD, 3),
0, 8, MONS_GHOST, MONS_DROWNED_SOUL, MH_UNDEAD, 60,
{ {AT_TOUCH, AF_DROWN, 0}, AT_NO_ATK, AT_NO_ATK, AT_NO_ATK },
Expand Down Expand Up @@ -6115,7 +6115,7 @@ DUMMY(MONS_GOLEM, '8', LIGHTGREY, "golem")
// "J"ellies.
{
MONS_ROYAL_JELLY, 'J', YELLOW, "the royal jelly",
M_SENSE_INVIS | M_ACID_SPLASH | M_UNIQUE,
M_SEE_INVIS | M_ACID_SPLASH | M_UNIQUE,
MR_RES_POISON | MR_RES_ASPHYX | mrd(MR_RES_ACID, 3),
0, 20, MONS_JELLY, MONS_JELLY, MH_NATURAL, 180,
{ {AT_HIT, AF_ACID, 50}, {AT_HIT, AF_ACID, 30}, AT_NO_ATK, AT_NO_ATK },
Expand All @@ -6127,7 +6127,7 @@ DUMMY(MONS_GOLEM, '8', LIGHTGREY, "golem")

{
MONS_DISSOLUTION, 'J', LIGHTMAGENTA, "Dissolution",
M_UNIQUE | M_SENSE_INVIS | M_ACID_SPLASH | M_BURROWS | M_PRIEST | M_SPEAKS
M_UNIQUE | M_SEE_INVIS | M_ACID_SPLASH | M_BURROWS | M_PRIEST | M_SPEAKS
| M_FAST_REGEN,
MR_RES_POISON | MR_RES_ASPHYX | mrd(MR_RES_ACID, 3),
0, 60, MONS_JELLY, MONS_JELLY, MH_NATURAL, 120,
Expand Down
3 changes: 1 addition & 2 deletions crawl-ref/source/mon-flags.h
Expand Up @@ -31,8 +31,7 @@ const uint64_t M_INVIS = 1<< 6;
// can see invis
const uint64_t M_SEE_INVIS = 1<< 7;

// can sense invisible things
const uint64_t M_SENSE_INVIS = 1<< 8;
//1<< 8;

// uses talking code
const uint64_t M_SPEAKS = 1<< 9;
Expand Down
5 changes: 0 additions & 5 deletions crawl-ref/source/mon-util.cc
Expand Up @@ -1303,11 +1303,6 @@ bool mons_is_unique(monster_type mc)
return mons_class_flag(mc, M_UNIQUE);
}

bool mons_sense_invis(const monster* mon)
{
return mons_class_flag(mon->type, M_SENSE_INVIS);
}

ucs_t mons_char(monster_type mc)
{
return monster_symbols[mc].glyph;
Expand Down
4 changes: 0 additions & 4 deletions crawl-ref/source/monster.cc
Expand Up @@ -5346,15 +5346,11 @@ bool monster::invisible() const

bool monster::visible_to(const actor *looker) const
{
bool sense_invis = looker->is_monster()
&& mons_sense_invis(looker->as_monster());

bool blind = looker->is_monster()
&& looker->as_monster()->has_ench(ENCH_BLIND);

bool vis = (looker->is_player() && (friendly()
|| you.duration[DUR_TELEPATHY]))
|| (sense_invis && adjacent(pos(), looker->pos()))
|| (!blind && (!invisible() || looker->can_see_invisible()));

return vis && (this == looker || !submerged());
Expand Down
1 change: 0 additions & 1 deletion crawl-ref/source/player.cc
Expand Up @@ -7567,7 +7567,6 @@ bool player::visible_to(const actor *looker) const

const monster* mon = looker->as_monster();
return mon->friendly()
|| (mons_sense_invis(mon) && distance2(pos(), mon->pos()) <= dist_range(4))
|| (!mon->has_ench(ENCH_BLIND)
&& (!invisible() || mon->can_see_invisible()));
}
Expand Down
4 changes: 1 addition & 3 deletions crawl-ref/source/shout.cc
Expand Up @@ -308,9 +308,7 @@ bool check_awaken(monster* mons)
return true;


// I assume that creatures who can sense invisible are very perceptive.
int mons_perc = 10 + (mons_intel(mons) * 4) + mons->get_hit_dice()
+ mons_sense_invis(mons) * 5;
int mons_perc = 10 + (mons_intel(mons) * 4) + mons->get_hit_dice();

bool unnatural_stealthy = false; // "stealthy" only because of invisibility?

Expand Down

0 comments on commit 90d2633

Please sign in to comment.