scn MYAirSwimmingPlayerSCEffect
ref player
float xfactme
float yfactme
float zfactme
float height
float direc
float speedmod
short toggle
short toggle2
Begin ScriptEffectUpdate
set player to getself
if player.getDisabled == 1
return
endif
player.ResetFallDamageTimer
set toggle to 0
set toggle2 to 1
set speedmod to 4 * GetSecondsPassed
if speedmod > 4
set speedmod to 2
endif
set zfactme to player.GetPos Z
set height to (Player.GetAngle X) * speedmod
set zfactme to zfactme - height
set xfactme to player.GetPos x
set yfactme to player.GetPos y
set direc to player.GetAngle z
if direc < 90 && toggle == 0
set toggle to 1
set yfactme to yfactme + ( 90 - direc ) * speedmod
set xfactme to xfactme + ( direc - 0 ) * speedmod
endif
if direc < 180 && toggle == 0
set toggle to 1
set direc to direc - 90
set yfactme to yfactme + ( 0 - direc ) * speedmod
set xfactme to xfactme + ( 90 - direc ) * speedmod
endif
if direc < 270 && toggle == 0
set toggle to 1
set direc to direc - 180
set yfactme to yfactme + ( direc - 90 ) * speedmod
set xfactme to xfactme + ( 0 - direc ) * speedmod
endif
if toggle == 0
set toggle to 1
set direc to direc - 270
set yfactme to yfactme + ( direc - 0 ) * speedmod
set xfactme to xfactme + ( direc - 90 ) * speedmod
endif
player.SetPos y, yfactme
player.SetPos x, xfactme
player.SetPos z, zfactme
player.PlayGroup jumploop, 1
player.setscale 0.2
if player.IsRunning != 1 && toggle2 == 1
set toggle2 to 0
endif
end
Begin ScriptEffectFinish
End