LordEntrails
July 5th, 2022, 06:08
In my ruleset I would like different types of items to have different attributes. This is similar to how in the D&D 5E ruleset Weapons, Armor, and Arcane Focus items have additional fields like AC, Damage, Bonus, etc that those types of items can have.
I believe I have worked out in 5E this is handled in the file "item_main.lua". That part that confuses me is here:
local bID = LibraryData.getIDState("item", nodeRecord);
wand
local bWeapon, sTypeLower, sSubtypeLower = ItemManager2.isWeapon(nodeRecord);
local bArmor = ItemManager2.isArmor(nodeRecord);
local bArcaneFocus = (sTypeLower == "rod") or (sTypeLower == "staff") or (sTypeLower == "wand");
First, what the heck is that second line "wand" doing? It that some remnant or typo?
To the important stuff: I understand how bArcaneFocus gets set, i.e. if the sTypeLower field equals rod, staff, wand then bArcaneFcus is true. And though I don't quite understand why the bWeapon and bArmor functins have a bunch of other stuff in them, I do see how they get set to True, but I don't understand why they are evaluated in manager_item2.lua.
Now my question; why would I want to use the bWeapon approach over the bArcaneFocus approach?
And, if I want some of my types to have sub-types with unique attributes, does that impact the approach above? i.e weapons that are ranged to have other attributes.
I believe I have worked out in 5E this is handled in the file "item_main.lua". That part that confuses me is here:
local bID = LibraryData.getIDState("item", nodeRecord);
wand
local bWeapon, sTypeLower, sSubtypeLower = ItemManager2.isWeapon(nodeRecord);
local bArmor = ItemManager2.isArmor(nodeRecord);
local bArcaneFocus = (sTypeLower == "rod") or (sTypeLower == "staff") or (sTypeLower == "wand");
First, what the heck is that second line "wand" doing? It that some remnant or typo?
To the important stuff: I understand how bArcaneFocus gets set, i.e. if the sTypeLower field equals rod, staff, wand then bArcaneFcus is true. And though I don't quite understand why the bWeapon and bArmor functins have a bunch of other stuff in them, I do see how they get set to True, but I don't understand why they are evaluated in manager_item2.lua.
Now my question; why would I want to use the bWeapon approach over the bArcaneFocus approach?
And, if I want some of my types to have sub-types with unique attributes, does that impact the approach above? i.e weapons that are ranged to have other attributes.