No, I don't think so - at least, that's not why I originally created affixTypes. The idea of affixTypes is to make themed items and affix genera work better. So themes are flavourful (arcane, holy, etc.) rather than code-friendly. I think it could be dangerous to view affixType as the replacement for coupling item to item type.
Yes, this is a fair point. As you say, not impossible, but something to bear in mind during the testing of this approach.
You're right that that is odd - and worth thinking about. But the different rarities and depths are already catered for in the affix handling: for the same affix you can specify different allocator rules for different item categories.
Affixes provide one thing each, whether that's a mod (pval), a flag (binary) or an effect (activation). So the ring and amulet have the binary flag for uncontrolled random teleportation (one affix), and the scroll and staff have the activation for teleportation (a different affix). To be done neatly, these affixes would need different name (I'd go for "of Random Teleportation" for the first).
The ring would need two affixes to be generated - the random teleportation affix and the speed affix. This is already achievable via themes - if a ring gets teleportation, it automatically gets +2 speed. Theme names are independent of affix names, so that could solve the naming problem too (if we let teleportation amulets also get +2 speed ...).
Thanks for the thoughts - keep them coming.
and realized a change to make magic items purely affix-based introduces another problem: how do you associate them with a specific flavor?
The flavors are currently tied to the factory, and thus can always be put on the same item variant each time it's created since there's one factory per variant. However if you get rid of all the ring variants and only have a single ring object (and thus only a single ring factory), you now need to add an extra mapping between the affix chosen and the flavor that goes with it. Not difficult, but something to be aware of.
The flavors are currently tied to the factory, and thus can always be put on the same item variant each time it's created since there's one factory per variant. However if you get rid of all the ring variants and only have a single ring object (and thus only a single ring factory), you now need to add an extra mapping between the affix chosen and the flavor that goes with it. Not difficult, but something to be aware of.
Also, allocator rules:
{"index": 261,
"templates": "scroll",
"nameInfo": {"variantName": "Teleportation"},
"allocatorRules": [{"commonness": 40, "minDepth": 10, "maxDepth": -1, "piling": {"chance": 25, "pileSize": "2d1"}}]},
{"index": 420,
"templates": "staff",
"nameInfo": {"variantName": "Teleportation"},
"allocatorRules": [{"commonness": 50, "minDepth": 20, "maxDepth": -1}]},
{"index": 247,
"templates": "amulet",
"nameInfo": {"variantName": "Teleportation"},
"flags": ["TELEPORT", "EASY_KNOW"],
"allocatorRules": [{"commonness": 20, "minDepth": 10, "maxDepth": 40}]},
{"index": 216,
"templates": "ring",
"nameInfo": {"variantName": "Teleportation"},
"mods": [{"bonus": "2", "flags": ["SPEED"]}],
"flags": ["TELEPORT", "EASY_KNOW"],
"allocatorRules": [{"commonness": 20, "minDepth": 5, "maxDepth": 50}]},
For the same affix name, every one of them has different rarities and depth ranges, plus, scrolls need a piling value. Most of it is easy enough, since the same fields are available in item allocators and affix allocators, but you'd have to add piling rules into affix allocator rules, which seems a little odd, though necessary if you divorce the item allocation from the variants.
{"index": 261,
"templates": "scroll",
"nameInfo": {"variantName": "Teleportation"},
"allocatorRules": [{"commonness": 40, "minDepth": 10, "maxDepth": -1, "piling": {"chance": 25, "pileSize": "2d1"}}]},
{"index": 420,
"templates": "staff",
"nameInfo": {"variantName": "Teleportation"},
"allocatorRules": [{"commonness": 50, "minDepth": 20, "maxDepth": -1}]},
{"index": 247,
"templates": "amulet",
"nameInfo": {"variantName": "Teleportation"},
"flags": ["TELEPORT", "EASY_KNOW"],
"allocatorRules": [{"commonness": 20, "minDepth": 10, "maxDepth": 40}]},
{"index": 216,
"templates": "ring",
"nameInfo": {"variantName": "Teleportation"},
"mods": [{"bonus": "2", "flags": ["SPEED"]}],
"flags": ["TELEPORT", "EASY_KNOW"],
"allocatorRules": [{"commonness": 20, "minDepth": 5, "maxDepth": 50}]},
For the same affix name, every one of them has different rarities and depth ranges, plus, scrolls need a piling value. Most of it is easy enough, since the same fields are available in item allocators and affix allocators, but you'd have to add piling rules into affix allocator rules, which seems a little odd, though necessary if you divorce the item allocation from the variants.
The other issue is the mods and flags per item. I'm not sure those are easily translatable to the affix environment, since the affix is typically just a single effect that you can specify different rules for when it shows up on different items. The above, however, are two that are effects, and two that are flags, and one that has a secondary mod attached.
The ring would need two affixes to be generated - the random teleportation affix and the speed affix. This is already achievable via themes - if a ring gets teleportation, it automatically gets +2 speed. Theme names are independent of affix names, so that could solve the naming problem too (if we let teleportation amulets also get +2 speed ...).
Thanks for the thoughts - keep them coming.
Comment