Opened 10 years ago

Closed 9 years ago

#934 closed bug (fixed (in master))

Make flags set in monster lore data mean "know the presence or absence of this flag" a la objects

Reported by: takkaria Owned by: MarbleDice
Milestone: 3.1.2 beta Keywords: monster
Cc:

Description

This has got much nicer characteristics when monsters are changes in monster.txt-- should mean there's no faulty data kept, ever.

Attachments (1)

md_934_vs1714.patch (49.3 KB) - added by MarbleDice 9 years ago.
Fixes #934, see comments below. Includes an extra bug fix for the compiler warning.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by MarbleDice

  • Owner set to MarbleDice
  • Status changed from new to assigned

comment:2 Changed 9 years ago by MarbleDice

Due to its size, I am posting this patch here for review. This patch makes the following changes:

Monster lore flags (l_ptr->flags) are treated as knowledge of the presence or absence of the corresponding monster race flag (r_ptr->flags).

In general, flags are obvserved under conditions which would be obvious under careful examination by the player. RES_FIRE is learned when a visible monster is hit by a fire attack, PASS_WALL is learned when a visible monster steps into a wall or would ordinarily step into a wall if they could, OPEN_DOOR and BASH_DOOR are learned when a monster attempts (regardless of success) to interact with a door, NO_CONF is learned when a monster is hit with confusion, etc.

To provide "negative confirmation" on as many flags as possible, random movement and rapid breeding are checked for every monster, not only the ones that can do it. This should be removed if it becomes a performance issue, but I don't think it will.

Adds monster_flags_known(r_ptr, l_ptr, flags) to extract the known and present flags, to emulate the old behavior in the monster recall.

The player can learn about some breath attacks through exotic monster resistances: nether, chaos, shards, sound, confusion, force, inertia, time, gravity, light, and darkness. This will almost alway only come into play with hounds breathing on hounds, so it probably doesn't make a lot of difference.

Implements some apparently unused race flags:

RF2_RES_NETH - Resists nether damage by the standard amount

RF2_HURT_COLD - Takes 2x damage from cold effects and uses special messages (brands N/A)

RF2_HURT_FIRE - Takes 2x damage from fire effects and uses special messages (brands N/A)

RF2_NO_STUN - Prevents stunning

Includes a warning fix in object/obj-info.c

comment:3 Changed 9 years ago by magnate

So monsters with HURT_FIRE will take double damage from a fire spell, but not from a fire brand?? That's crazy. I can appreciate the need for balance, but there has to be a better way to do it. Now back to our regular programming ...

comment:4 Changed 9 years ago by MarbleDice

Well sure, I imagine the way to do it would be to make HURT_FIRE creatures take x5 instead of x3 from a fire brand. I was actually messing around with that, but that's a different ticket in my opinion. It's not like anyone actually has HURT_FIRE yet.

All (I think) you need to do is add a couple lines to the slay_table in object/obj-info.c and modify the I)nspect command so it doesn't output redundant information on the fire/cold brands.

comment:5 Changed 9 years ago by magnate

I'll create a new ticket for this and see if Takkaria likes the idea.

comment:6 Changed 9 years ago by magnate

On second thoughts, I'll wait until there are actually some monsters with these flags! At the moment only HURT_LITE and HURT_ROCK are used in monster.txt ...

comment:7 Changed 9 years ago by magnate

I've now tested the patch. Apart from one compiler warning (monster/monster2.c: In function ‘lore_treasure’: monster/monster2.c:1070: warning: unused variable ‘r_ptr’) it works fine. Nice job.

Changed 9 years ago by MarbleDice

Fixes #934, see comments below. Includes an extra bug fix for the compiler warning.

comment:8 Changed 9 years ago by MarbleDice

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [7119579] (SVN r1722).

Note: See TracTickets for help on using tickets.