Opened 8 years ago

Last modified 7 years ago

#1403 confirmed task

Outstanding refactoring

Reported by: magnate Owned by: magnate
Milestone: v4 Keywords: cleanup


Finish moving the remaining monster spells from melee2.c to mon-spell.c (the latter is ready to deal with them, just needs testing).

Refactor the monster description code in monster1.c to use the monster spell and gf_ tables - this is the last place that uses the monster damage constants, so can then remove them.

Refactor the object description tables at the start of obj-desc to use the new table in obj-flag.c

Create a player_can_see_monster function, to avoid any inconsistencies with checking blindness/LOS. Propagate.

Add a mode bool to check_state so it can check for TMD_ or OF_ flags, and avoid the conflation in calcs.c. Propagate.

Change History (10)

comment:1 Changed 8 years ago by magnate

  • Status changed from new to confirmed

Refactor the arrays at the start of obj-make.c to use the new OFT_ types

comment:2 Changed 7 years ago by magnate

See also #1124 to check everything is done.

comment:3 Changed 7 years ago by magnate

Remove set_ego_xtra_* by using OFT_ masks in object_notice_ego()

comment:4 Changed 7 years ago by magnate

The obj-make and the object_notice_ego changes are in [r49de32e].

comment:5 Changed 7 years ago by magnate

check_state actually checks for OF_ flag first, and then the timed equivalent, from [refc672b]. It also takes a bitflag, so you can pass in flags from any hypothetical or not-fully-known state.

comment:6 Changed 7 years ago by magnate

Hmmm. Using takkaria's metric of not abstracting stuff which is only used in one place, obj-info.c's "big fat data tables" should probably stay where they are until they're needed by another compilation unit.

comment:7 Changed 7 years ago by magnate

The monster spell refactor is finally finished in [r25810b1]. That just leaves the horror of monster1.c to go ... (and the player_can_see_monster function, which is a lot easier).

comment:8 Changed 7 years ago by magnate

  • Milestone changed from 3.3.0 to 3.4.0

These aren't actually essential for 3.3 at all, so punting to 3.4

comment:9 Changed 7 years ago by magnate

Refactor the remaining project_ functions (_m, _o, _f) to use gf_table. Possibly also allow distinction between different effect sources (spell, device, trap, etc.) - see #1427.

comment:10 Changed 7 years ago by magnate

  • Milestone changed from 3.4.0 to 4.0

Initial assignment to v4 per

Note: See TracTickets for help on using tickets.