Tweak syndrome-trigger.

develop
expwnent 2014-07-03 20:09:23 -04:00
parent 8b2208f718
commit 120d8cc6f1
1 changed files with 23 additions and 2 deletions

@ -1,4 +1,4 @@
--modtools/syndrome-trigger.lua
--scripts/modtools/syndrome-trigger.lua
--author expwnent
--triggers scripts when units are infected with syndromes
@ -7,6 +7,11 @@ local utils = require 'utils'
onInfection = onInfection or {}
eventful.enableEvent(eventful.eventType.UNLOAD,1)
eventful.onUnload.syndromeTrigger = function()
onInfection = {}
end
eventful.enableEvent(eventful.eventType.SYNDROME,5) --requires iterating through every unit, so not cheap, but not slow either
local function processTrigger(args)
@ -61,7 +66,23 @@ validArgs = validArgs or utils.invert({
local args = utils.processArgs({...}, validArgs)
if args.help then
--print help string
print([[scripts/modtools/syndrome-trigger.lua
arguments
-help
print this help message
-clear
clear all triggers
-syndrome name
specify the name of a syndrome
-command [ commandStrs ]
specify the command to be executed after infection
args
\\SYNDROME_ID
\\UNIT_ID
\\LOCATION
\anything -> anything
anything -> anything
]])
return
end