From b817205fd65ed2c6f28d95edb5329695b1aa87d4 Mon Sep 17 00:00:00 2001 From: expwnent Date: Thu, 3 Jul 2014 16:30:28 -0400 Subject: [PATCH] Tweak add-syndrome, create-item. --- scripts/modtools/add-syndrome.lua | 50 +++++++++++++++++-------------- scripts/modtools/create-item.lua | 26 ++++++++++++++-- 2 files changed, 51 insertions(+), 25 deletions(-) diff --git a/scripts/modtools/add-syndrome.lua b/scripts/modtools/add-syndrome.lua index e0b78be64..3a4dc1ba5 100644 --- a/scripts/modtools/add-syndrome.lua +++ b/scripts/modtools/add-syndrome.lua @@ -19,28 +19,34 @@ validArgs = validArgs or utils.invert({ local args = utils.processArgs({...}, validArgs) if args.help then - print('add-syndrome usage:') - print(' -help') - print(' print this help message') - print(' -syndrome [name]') - print(' select a syndrome by name') - print(' -resetPolicy {default = NewInstance}') - print(' DoNothing') - print(' if the target already has an instance of the syndrome, do nothing') - print(' ResetDuration') - print(' if the target already has an instance of the syndrome, reset the duration to maximum') - print(' AddDuration') - print(' if the target already has an instance of the syndrome, add the maximum duration to the time remaining') - print(' NewInstance') - print(' if the target already has an instance of the syndrome, add a new instance of the syndrome') - print(' -erase') - print(' instead of adding a syndrome, erase one') - print(' -eraseAll') - print(' instead of adding a syndrome, erase every instance of it') - print(' -target [id]') - print(' set the target unit for infection or uninfection') - print(' -skipImmunities') - print(' don\'t check syn_class immune/affected stuff when adding the syndrome') + print([[scripts/modtools/add-syndrome usage: +arguments: + -help + print this help message + -syndrome name + the name of the syndrome to operate on + examples: + "gila monster bite" + -resetPolicy policy + specify a policy of what to do if the unit already has an instance of the syndrome + examples: + NewInstance + default behavior: create a new instance of the syndrome + DoNothing + ResetDuration + AddDuration + -erase + instead of adding an instance of the syndrome, erase one + -eraseAll + erase every instance of the syndrome + -target id + the unit id of the target unit + examples: + 0 + 28 + -skipImmunities + add the syndrome to the target regardless of whether it is immune to the syndrome +]]) return end diff --git a/scripts/modtools/create-item.lua b/scripts/modtools/create-item.lua index f0a9c8cc5..5b9a7e973 100644 --- a/scripts/modtools/create-item.lua +++ b/scripts/modtools/create-item.lua @@ -1,4 +1,4 @@ ---create-item.lua +--scripts/modtools/create-item.lua --author expwnent --creates an item of a given type and material @@ -18,7 +18,27 @@ validArgs = --[[validArgs or]] utils.invert({ local args = utils.processArgs({...}, validArgs) if args.help then - --TODO: help string + print( +[[scripts/modtools/create-item.lua +arguments: + -help + print this help message + -creator id + specify the id of the unit who will create the item + examples: + 0 + 2 + -material matstring + specify the material of the item to be created + examples: + INORGANIC:IRON + CREATURE_MAT:DWARF:BRAIN + PLANT_MAT:MUSHROOM_HELMET_PLUMP:DRINK + -item itemstr + specify the itemdef of the item to be created + examples: + WEAPON:ITEM_WEAPON_PICK + ]]) return end @@ -34,10 +54,10 @@ if not args.item then error 'Invalid item.' end local itemType = dfhack.items.findType(args.item) -local itemSubtype = dfhack.items.findSubtype(args.item) if itemType == -1 then error 'Invalid item.' end +local itemSubtype = dfhack.items.findSubtype(args.item) organicTypes = organicTypes or utils.invert({ df.item_type.REMAINS,