Opened 5 years ago

Last modified 5 years ago

#1558 assigned task

Changes to tvals and svals

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

Description (last modified by magnate)

Following the affixes merge, there are some changes which could be made to tvals and svals:

  • DSM could be created through "<colour> dragon scale" affixes, and removed as tval/base items
  • Seeker arrows and bolts could likewise be created through affixes - this means that ammo could become a single tval, with three svals for arrows/bolts/shots
  • Crowns and helms could share the same tval (IIUC the only reason for the separation was for ego type legality)
  • Ultimately, all melee weapons could share the same tval ...

Following noz's add_kind and fixup_artifact_kinds functions, takkaria said something about possibly being able to get rid of svals altogether ...

Change History (3)

comment:1 Changed 5 years ago by magnate

  • Status changed from new to assigned

On the flipside, there are some familiar suffices that should be replaced with prefixes because they are only concerned with hit/dam: Accuracy, Power, Wounding, Slaying, Extra Might, Craftsmanship. All these can be provided using the make/material/quality prefixes. Extra Shots is left as a suffix because it is inherently magical (like Extra Blows).

comment:2 Changed 5 years ago by magnate

  • Description modified (diff)

So DSM has gone, and is now done with affixes. But no unification of headgear or weapons yet, seeker ammo are still separate base objects, and we still have svals.

comment:3 Changed 5 years ago by magnate

  • Keywords affixes removed

While fixing archery in v4 I decided to make slings and xbows into separate tvals from bows (exactly the opposite of unifying weapons into a single tval I know, but this is all to support a more sophisticated combat model where e.g. the damage mult from a crossbow uses a different calculation than for a drawn bow). Anyway, to add a new tval you currently have to do three things:

  1. Add an entry for it to lib/edit/object_base.txt
  1. Add a #define for it to src/object/tvalsval.h
  1. Add a pair linking the two above to the tval_names grouper in src/object/obj-util.c

This doesn't seem optimal. If we moved the hardcoded numbers from tvalsval.h into object_base.txt, using a traditional index number, I think steps 2 and 3 could go. Would anyone like to give me reasons not to do this?

(I know there has been talk of doing away with indices altogether, but IMO that's orthogonal - they can just as easily be removed from object_base.txt in future as they can from the current setup.)

(I also think that getting rid of svals completely is orthogonal to this change to tval handling. But I need to think about this some more.)

Note: See TracTickets for help on using tickets.