Tweak add-syndrome, create-item.

develop
expwnent 2014-07-03 16:30:28 -04:00
parent 7b057629dc
commit b817205fd6
2 changed files with 51 additions and 25 deletions

@ -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

@ -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,