actor SearchSnakeBoss : BaseMM8BDMWep_CBM
{
dropitem "SearchSnakeWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "$OB_SEARCHSNAKE"
weapon.ammotype "SnakeManAmmo"
States
{
Spawn:
C_03 F 1
loop
Ready:
SNAB A 0 ACS_ExecuteAlways(998,0,765)
SNAB A 0
SNAB A 0 A_GunFlash
SNAB A 0 A_JumpIfInventory("SnakeManAmmo",2,"Ready2")
SNAB A 5 A_WeaponReady(WRF_NOPRIMARY)
SNAB A 0 A_GiveInventory("SnakeManAmmo",2)
Goto Ready+3
Ready2:
SNAB A 5 A_WeaponReady
SNAB A 0 A_GiveInventory("SnakeManAmmo",2)
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SNAB A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SNAB A 1 A_Raise
Loop
Fire:
SNAB A 0 A_JumpIfInventory("SnakeManAmmo",2,1)
goto NoAmmo
SNAB A 0 A_playSoundEx("weapon/mbuster","Weapon")
SNAB A 0 A_TakeInventory("SnakeManAmmo",2)
SNAB A 0 A_GiveInventory("SnakemanMain_CI",1)
SNAB BC 3
SNAB A 4
SNAB A 0 A_Refire
Goto Ready+3
AltFire:
SNAA D 0 A_FireCustomMissile("MeleeSnake")
SNAA ABCD 2 A_GiveInventory("ClimbCheckerPickup",1)
SNAA D 0 A_FireCustomMissile("MeleeSnake")
SNAA GFED 2 A_GiveInventory("ClimbCheckerPickup",1)
Goto Ready+1
NoAmmo:
SNAB A 0
Goto Ready+1

Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("SnakeClimbing",1,1)
goto FlashRest
TNT1 A 0 A_GiveInventory("SnakeClimbCheckPickup",1)
goto FlashRest

FlashRest:
TNT1 A 0 A_JumpIf(z-floorz<1,1)
goto FlashLoop
Rest2:
TNT1 A 0 A_JumpIfInventory("StaminaFlag",500,2)
TNT1 A 0 A_GiveInventory("StaminaFlag",4)
TNT1 A 0
goto FlashLoop

FlashLoop:
TNT1 A 0 A_JumpIfInventory("SnakeOnWall",1,4)
TNT1 A 0 SetPlayerProperty(0,0,3)
TNT1 A 0 ACS_ExecuteAlways(191,0,0)//Normal speed
TNT1 A 1
goto Flash
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 0 SetPlayerProperty(0,1,3)
TNT1 A 0 ACS_ExecuteAlways(191,0,16)//80% speed
TNT1 A 1
goto Flash
}
}


actor SnakeManAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor Climbing : OnceC {}
actor SnakeClimbing : OnceC {}

actor SnakeOnWall : PowerUp
{
Powerup.Duration 2
}

actor SnakemanClimbingItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "SNAAZ"
inventory.pickupmessage "Metal Gear Sssssolid?!"
scale 2.0
+INVBAR
states
{
Spawn:
SNAA Z 1
loop
Use:
TNT1 A 0 A_PlaySoundEx("item/ItemUseMM9","SoundSlot6")
TNT1 A 0 A_JumpIfInventory("SnakeClimbing",1,"Use2")
TNT1 A 0 A_GiveInventory("SnakeClimbing",1)
fail
Use2:
TNT1 A 0 A_TakeInventory("SnakeClimbing",1)
fail
}
}

actor SnakeClimbCheckPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("StaminaFlag",1,"Success")
stop
Success:
TNT1 A 0 A_FireCustomMissile("SnakeClimbCheck",0,0,0,-12)
stop
}
}

actor ClimbCheckerPickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_FireBullets(0,0,1,0,"SnakeClimbBullet",0,44)
TNT1 A 0 A_FireBullets(0,-90,-1,0,"SnakeClimbBullet",12,48)
stop
}
}

actor SnakeClimbBullet : BulletPuff
{
+PUFFGETSOWNER
States
{
Spawn:
TNT1 A 1
stop
Crash:
TNT1 A 1
TNT1 A 0 A_GiveToTarget("SnakeClimbBoost",1)
stop
}
}

actor SnakeClimbBoost : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,"No")
TNT1 A 0 A_JumpIfInventory("StaminaFlag",1,"Success")
stop
Success:
TNT1 A 0 ThrustThingZ(0,40,0,0)
TNT1 A 0 A_JumpIfInventory("SnakeClimbing",1,"No")
goto TakeAmmo
TakeAmmo:
TNT1 A 0 A_TakeInventory("StaminaFlag",1)
stop

No:
TNT1 A 0
stop
}
}

actor SnakeClimbCheck
{
PROJECTILE
+DONTBLAST
+DONTSPLASH
+SKYEXPLODE
+THRUACTORS
+DONTREFLECT
Damage (0)
//radius 16
//height 56
radius 48//44
height 88//112
speed 0
States
{
Spawn:
TNT1 A 0
TNT1 A 0 //A_CheckFloor("Death")
TNT1 A 1
stop
Death:
//TNT1 A 0 A_CheckFloor("Death2")
TNT1 A 0 //A_JumpIf(floorz==z,"Death2")
TNT1 A 0 A_TakeFromTarget("StaminaFlag",1)
TNT1 A 0 A_GiveToTarget("SnakeOnWall",1)
stop
Death2:
TNT1 A 0
stop
}
}


actor MeleeSnake
{
PROJECTILE
Radius 7
Height 7
scale 2.5
//damagetype "Snake"
damage (8)//
Damagetype "ClassPainSemi"
Obituary "$OB_SNAKEPOKE"
speed 40
reactiontime 3
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_CountDown
loop
Death:
TNT1 A 0 A_Explode(6,48,0)
goto XDeath
XDeath:
TNT1 A 0 A_Stop
TNT1 A 2
stop
}
}


actor SearchSnakeStartB : SearchSnakeStart
{
translation "192:192=4:4","198:198=104:104"
damage (15)
speed 24
States
{
Spawn:
X_3F A 4
loop
Death:
TNT1 A 0 A_JumpIf(ceilingz-z < 48, "XDeath")
TNT1 A 0 A_JumpIf(z-floorz!=0,"Air")
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,0,18,0,0,0,1)
stop
Air:
TNT1 A 0 A_SpawnItemEx("UpSnake0B",-1,0,16,0,0,1,0,1)
stop
}
}

actor SearchSnakeStartBB : SearchSnakeStartB{translation "192:192=205:205", "198:198=74:74"}
actor SearchSnakeStartBR : SearchSnakeStartB{translation "192:192=171:171", "198:198=41:41"}
actor SearchSnakeStartBO : SearchSnakeStartB{translation "192:192=104:104", "198:198=128:128"}
actor SearchSnakeStartBP : SearchSnakeStartB{translation "192:192=229:229", "198:198=232:62"}


actor SearchSnakeB : SearchSnake
{
damage (23)
States
{
Spawn:
X_3F A 0
X_3F A 2
X_3F AABBBBAA 1 A_JumpIf(momz<0,"Down")
X_3F A 0 A_ChangeVelocity(18,0,0,3)
Goto Spawn+2
Down:
TNT1 A 0 A_SpawnItemEx("DownSnakeB",0,0,0,0,0,-18,0,1)
stop
Death:
TNT1 A 0 A_SpawnItemEx("UpSnake0B",-1,0,16,0,0,1,0,1)
stop
}
}


actor UpSnake0B : UpSnake0
{
Damage (23)
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ChangeVelocity(18,0,0,3)
X_3F C 1
TNT1 A 0 A_JumpIf(z-floorz < 48, "SpawnFloor")
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,0,18,0,0,0,1)
stop
SpawnFloor:
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,-(z-floorz),18,0,0,0,1)
stop
Continue:
TNT1 A 0 A_SpawnItemEx("UpSnake1B",0,0,4,0,0,18,0,1)
stop
}
}

actor UpSnake1B : UpSnake1
{
Damage (23)
States
{
Spawn:
X_3F C 2
TNT1 A 0 A_Stop
TNT1 A 0 A_ChangeVelocity(18,0,0,3)
X_3F C 1
TNT1 A 0 A_JumpIf(z-floorz < 48, "SpawnFloor")
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,0,18,0,0,0,1)
stop
SpawnFloor:
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,-(z-floorz),18,0,0,0,1)
stop
Continue:
TNT1 A 0 A_SpawnItemEx("UpSnake2B",0,0,4,0,0,18,0,1)
stop
}
}

actor UpSnake2B : UpSnake1B
{
States
{
Continue:
TNT1 A 0 A_SpawnItemEx("UpSnake3B",0,0,4,0,0,18,0,1)
stop
}
}

actor UpSnake3B : UpSnake1B
{
States
{
Spawn:
X_3F D 2
TNT1 A 0 A_Stop
TNT1 A 0 A_ChangeVelocity(18,0,0,3) //A_Recoil(-18)
X_3F D 1
TNT1 A 0 A_JumpIf(z-floorz < 48, "SpawnFloor")
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,0,18,0,0,0,1)
stop
SpawnFloor:
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,-(z-floorz),18,0,0,0,1)
stop
Continue:
TNT1 A 0 A_SpawnItemEx("UpSnake4B",0,0,4,0,0,18,0,1)
stop
}
}

actor UpSnake4B : UpSnake3B
{
States
{

Continue:
TNT1 A 0 A_SpawnItemEx("UpSnake1B",0,0,4,0,0,18,0,1)
stop
}
}

actor DownSnakeB : DownSnake
{
translation "192:192=4:4","198:198=104:104"
Damage (23)
States
{
Spawn:
X_3F EF 4
loop

Death:
TNT1 A 0 A_SpawnItemEx("SearchSnakeB",0,0,0,18,0,0,0,1)
stop
}
}


actor SnakemanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("SearchSnakeStartB",0,1,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("SearchSnakeStartBB",0,1,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("SearchSnakeStartBR",0,1,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("SearchSnakeStartBO",0,1,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("SearchSnakeStartBP",0,1,-8,0)
goto Done
}
}