XaselmDarts01SCRIPT
Editor ID:XaselmDarts01SCRIPT
Form ID:00054B63
Type:Object
Script:scn XaselmDarts01SCRIPT
float timer
short next
short activated
ref mySelf
ref myParent
float fTrapDamage
float fTrapPushBack
float fTrapMinVelocity
float fLevelledDamage
short bTrapContinuous
begin onActivate
if activated == 0
set myParent to getParentRef
set mySelf to getSelf
set activated to 1
endif
if isActionRef player == 0 && isActionRef mySelf == 0
; set up the damage values
set fTrapDamage to 5
set fLevelledDamage to 1
set fTrapPushBack to 0
set fTrapMinVelocity to 20
set bTrapContinuous to 1
set timer to 5
set next to 1
playgroup forward 1
endif
end
begin gameMode
;daisy-chain
if next == 1 && timer <= 1.5
set mySelf to getSelf
set myParent to getParentRef
myParent.activate mySelf 1
set next to 0
endif
;reset for next time
if timer <= 0 && activated == 1
set fTrapDamage to 0
set fLevelledDamage to 0
set activated to 0
endif
if timer > 0
set timer to timer - getSecondsPassed
endif
end