NickMcConnell / NarSil

Unofficial rewrite of Sil 1.3.0
10 stars 2 forks source link

Non-instant artifact colors #563

Open backwardsEric opened 1 week ago

backwardsEric commented 1 week ago

obj-init.c's parse_artifact_color() sets the color on the artifact's kind. Object kinds that have artifacts will get the color of the last artifact from artefact.txt using that kind rather than the color from object.txt. Non-artifacts derived from such kinds and artifacts derived from such kinds which are not the last artifact of that kind in artefact.txt can get a color that differs from what object.txt or artefact.txt configured for them.

Sil 1.3 has a d_attr field in struct artefact_type so it's storing the color for an artifact separately from the base kind. To me, it seems better to implement that in NarSil than use the current behavior. It looks like that would require changes to:

  1. obj-init.c's parse_artifact_base_object() so that artifacts start out inheriting the color of the artifact's kind
  2. obj-init.c's parse_artifact_graphics() so that the color for an instant artifact agrees with the artifact's kind
  3. ui-object.c's object_attr() to use the artifact's color if the object is an artifact rather than the color from the object's kind
  4. ui-object.c's show_obj(): currently that is directly accessing the color from the object's kind; should it use object_attr() instead?

There's no provision for editing visuals for an artifact in the knowledge menus so the per-artifact color could not be adjusted. Given that NarSil and Vanilla Angband don't allow editing the visuals for the instant artifact kinds, perhaps that's acceptable.