# Orbinaut Launcher by Chaobrother. Feel free to use this SOC as a template for
# launching Orbinauts with your own custom objects.
# This is Trapgoyle like hazard which fires Orbinauts every 2 seconds.
# The actual showcase is how to fire and color Orbinauts with SOC.
# Jawz cannot be properly fired with only SOC; they will be too slow.
# It is HIGHLY RECOMMENDED to use Lua and Kart related functions rather than SOC
# to fire Kart projectiles, if you are able to use Lua in your mod.
# Make sure to use unique state and object names if you want to create a custom
# orbinaut launcher.

Freeslot
MT_ORBILAUNCHER
S_ORBILAUNCHER1
S_ORBILAUNCHER2
#Remote Orbinaut Modification
S_LAUNCHEDORBICOLOR
S_LAUNCHEDORBISPEED1
S_LAUNCHEDORBISPEED2
#Launcher Orbinaut Modification
S_LAUNCHERORBIMOD1
S_LAUNCHERORBIMOD2
S_LAUNCHERORBIMOD3

#Remote Orbinaut Modification
State S_LAUNCHEDORBICOLOR
SpriteName = NULL
SpriteFrame = A
Var1 = 0
Var2 = SKINCOLOR_BLACK
Duration = 0
Next = S_NULL
Action = A_ChangeColorAbsolute

#Makes the orbinaut inert so its speed can be modified with A_Thrust rather than
#Setting its movecount.
State S_LAUNCHEDORBISPEED1
SpriteName = NULL
SpriteFrame = A
Var1 = MF2_AMBUSH
Var2 = 2
Duration = 0
Next = S_NULL
Action = A_SetObjectFlags2

State S_LAUNCHEDORBISPEED2
SpriteName = NULL
SpriteFrame = A
Var1 = 60
Var2 = 1
Duration = 0
Next = S_NULL
Action = A_Thrust
#End Remote Orbinaut modification

#Launcher Orbinaut modification
State S_LAUNCHERORBIMOD1
SpriteName = DECO
SpriteFrame = A
Var1 = MT_ORBINAUT
Var2 = S_LAUNCHEDORBICOLOR
Duration = 0
Next = S_LAUNCHERORBIMOD2
Action = A_RemoteAction

State S_LAUNCHERORBIMOD2
SpriteName = DECO
SpriteFrame = A
Var1 = MT_ORBINAUT
Var2 = S_LAUNCHEDORBISPEED1
Duration = 1
Next =  S_LAUNCHERORBIMOD3
Action = A_RemoteAction

State S_LAUNCHERORBIMOD3
SpriteName = DECO
SpriteFrame = A
Var1 = MT_ORBINAUT
Var2 = S_LAUNCHEDORBISPEED2
Duration = 0
Next =  S_ORBILAUNCHER1
Action = A_RemoteAction
#End Launcher Orbinaut modification


State S_ORBILAUNCHER1
SpriteName = DECO
SpriteFrame = A
Var1 = 1
Var2 = 0
Duration = 70
Next =  S_ORBILAUNCHER2
Action = none

State S_ORBILAUNCHER2
SpriteName = DECO
SpriteFrame = A
Var1 = MT_ORBINAUT + (16<<16)
Var2 = 0
Duration = 0
Next =  S_LAUNCHERORBIMOD1
Action = A_TrapShot

Object MT_ORBILAUNCHER
#$Name Orbinaut Launcher
#$Sprite DECOA1
#$Category Community Resources
MapThingNum = 2029
SpawnState = S_ORBILAUNCHER1
SpawnHealth = 1000
SeeState = S_ORBILAUNCHER2
SeeSound = sfx_None
ReactionTime = 0
AttackSound = sfx_trfire
PainState = S_NULL
PainChance = S_NULL
PainSound = sfx_None
MeleeState = S_NULL
MissileState = S_NULL
DeathState = S_NULL
XDeathState = S_NULL
DeathSound = sfx_None
Speed = 21*FRACUNIT
Radius = 21*FRACUNIT
Height = 40*FRACUNIT
DispOffset = 0
Mass = 1000
Damage = 0
ActiveSound = sfx_None
Flags = MF_SOLID
RaiseState = S_NULL