scn ARTrapGasEmitter01SCRIPT
; spurt gas on activation
short init
float timer
short next
ref mySelf
ref myParent
float fTrapDamage
float fLevelledDamage
float fTrapPushBack
float fTrapMinVelocity
short bTrapContinuous
begin onActivate
if init == 0
set mySelf to getSelf
set myParent to getParentRef
set init to 1
endif
if isActionRef player == 0 && isActionRef mySelf == 0
set init to 2
; set up the damage values
set fTrapDamage to 10
set fTrapPushBack to 0
set fLevelledDamage to 0.125
set fTrapMinVelocity to 20
set bTrapContinuous to 1
set timer to 8
set next to 1
playgroup forward 1
endif
end
begin gameMode
;daisy-chain
if next == 1 && timer <= 7
set next to 0
myParent.activate mySelf 1
endif
if timer <= 0 && init == 2
playgroup forward 1
set timer to 10
endif
if timer > 0
set timer to timer - getSecondsPassed
endif
end
--Thanks
-MNPred