|
|
@ -13,7 +13,8 @@ validArgs = validArgs or utils.invert({
|
|
|
|
'eraseOldest',
|
|
|
|
'eraseOldest',
|
|
|
|
'eraseAll',
|
|
|
|
'eraseAll',
|
|
|
|
'target',
|
|
|
|
'target',
|
|
|
|
'skipImmunities'
|
|
|
|
'skipImmunities',
|
|
|
|
|
|
|
|
'eraseClass'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
local args = utils.processArgs({...}, validArgs)
|
|
|
|
local args = utils.processArgs({...}, validArgs)
|
|
|
@ -39,6 +40,8 @@ arguments:
|
|
|
|
instead of adding an instance of the syndrome, erase one
|
|
|
|
instead of adding an instance of the syndrome, erase one
|
|
|
|
-eraseAll
|
|
|
|
-eraseAll
|
|
|
|
erase every instance of the syndrome
|
|
|
|
erase every instance of the syndrome
|
|
|
|
|
|
|
|
-eraseClass SYN_CLASS
|
|
|
|
|
|
|
|
erase every instance of every syndrome with the given SYN_CLASS
|
|
|
|
-target id
|
|
|
|
-target id
|
|
|
|
the unit id of the target unit
|
|
|
|
the unit id of the target unit
|
|
|
|
examples:
|
|
|
|
examples:
|
|
|
@ -50,6 +53,21 @@ arguments:
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if not args.target then
|
|
|
|
|
|
|
|
error 'Specify a target.'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
local targ = df.unit.find(tonumber(args.target))
|
|
|
|
|
|
|
|
if not targ then
|
|
|
|
|
|
|
|
error ('Could not find target: ' .. args.target)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
args.target = targ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.eraseClass then
|
|
|
|
|
|
|
|
local count = syndromeUtil.eraseSyndromeClass(args.target, args.eraseClass)
|
|
|
|
|
|
|
|
--print('deleted ' .. tostring(count) .. ' syndromes')
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
if args.resetPolicy then
|
|
|
|
if args.resetPolicy then
|
|
|
|
args.resetPolicy = syndromeUtil.ResetPolicy[args.resetPolicy]
|
|
|
|
args.resetPolicy = syndromeUtil.ResetPolicy[args.resetPolicy]
|
|
|
|
if not args.resetPolicy then
|
|
|
|
if not args.resetPolicy then
|
|
|
@ -73,15 +91,6 @@ if not syndrome then
|
|
|
|
end
|
|
|
|
end
|
|
|
|
args.syndrome = syndrome
|
|
|
|
args.syndrome = syndrome
|
|
|
|
|
|
|
|
|
|
|
|
if not args.target then
|
|
|
|
|
|
|
|
error 'Specify a target.'
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
local targ = df.unit.find(tonumber(args.target))
|
|
|
|
|
|
|
|
if not targ then
|
|
|
|
|
|
|
|
error ('Could not find target: ' .. args.target)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
args.target = targ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.erase then
|
|
|
|
if args.erase then
|
|
|
|
syndromeUtil.eraseSyndrome(args.target,args.syndrome.id,args.eraseOldest)
|
|
|
|
syndromeUtil.eraseSyndrome(args.target,args.syndrome.id,args.eraseOldest)
|
|
|
|
return
|
|
|
|
return
|
|
|
|