actor HomingSniperBoss : BaseMM8BDMWep_CBM
{
dropitem "HomingSniperWepCDropped"
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "$OB_HOMINGSNIPER"
Inventory.Pickupmessage "Now you're searchman, ok?"
weapon.ammotype "WilyBanzaiAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_08 E 1
loop
Ready:
HSNI L 0 ACS_ExecuteAlways(998,0,864)
HSNI L 0 A_GunFlash
HSNI L 2 A_WeaponReady
Goto Ready+2
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
HSNI L 1
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
HSNI L 1
Loop
Fire:
HSNI L 0 A_TakeInventory("StaminaFlag",1)
HSNI L 1 A_GiveInventory("SearchmanMain_CI",1)
HSNI L 0 A_JumpIfInventory("StaminaFlag",1,"FireHold")
goto FireTheMissiles0
FireHold:
HSNI L 0 A_Refire
FireTheMissiles0:
HSNI L 2
HSNI L 0 A_JumpIfInventory("SearchTargetID1",1,"Fire1")
HSNI L 0 A_JumpIfInventory("SearchTargetID2",1,"Fire2")
HSNI L 0 A_JumpIfInventory("SearchTargetID3",1,"Fire3")
HSNI L 0 A_JumpIfInventory("SearchTargetID4",1,"Fire4")
goto Fire0
FireTheMissiles:
HSNI L 0 A_JumpIfInventory("SearchTargetID1",1,"Fire1")
HSNI L 0 A_JumpIfInventory("SearchTargetID2",1,"Fire2")
HSNI L 0 A_JumpIfInventory("SearchTargetID3",1,"Fire3")
HSNI L 0 A_JumpIfInventory("SearchTargetID4",1,"Fire4")
HSNI L 0
goto coolDown
Fire4:
HSNI L 0 A_PlaySoundEx("weapon/coilexplode","Weapon")
HSNI L 0 A_GiveInventory("SearchmanMain4_CI",1)
HSNI MN 2
goto FireTheMissiles+4
Fire3:
HSNI L 0 A_PlaySoundEx("weapon/coilexplode","Weapon")
HSNI L 0 A_GiveInventory("SearchmanMain3_CI",1)
HSNI MN 2
goto FireTheMissiles+3
Fire2:
HSNI L 0 A_PlaySoundEx("weapon/coilexplode","Weapon")
HSNI L 0 A_GiveInventory("SearchmanMain2_CI",1)
HSNI MN 2
goto FireTheMissiles+2
Fire1:
HSNI L 0 A_PlaySoundEx("weapon/coilexplode","Weapon")
HSNI L 0 A_GiveInventory("SearchmanMain1_CI",1)
HSNI MN 2
goto FireTheMissiles+1
Fire0:
HSNI L 0 A_PlaySoundEx("weapon/coilexplode","Weapon")
HSNI L 0 A_GiveInventory("SearchmanMain0_CI",1)
HSNI MN 2
coolDown:
HSNI L 0 A_TakeInventory("SearchTargetID4",999)
HSNI L 0 A_TakeInventory("SearchTargetID3",999)
HSNI L 0 A_TakeInventory("SearchTargetID2",999)
HSNI L 0 A_TakeInventory("SearchTargetID1",999)
HSNI L 0 A_TakeInventory("SearchTargetID4CD",999)
HSNI L 0 A_TakeInventory("SearchTargetID3CD",999)
HSNI L 0 A_TakeInventory("SearchTargetID2CD",999)
HSNI L 0 A_TakeInventory("SearchTargetID1CD",999)
HSNI L 0 A_JumpIfInventory("StaminaFlag",1,"coolDown2")
goto coolDownX
coolDown2:
HSNI OLLLLLLLLLL 2 A_GiveInventory("StaminaFlag",21)
HSNI L 0 A_GiveInventory("StaminaFlag",500)
HSNI L 0 A_Refire
goto Ready+2
coolDownX:
HSNI O 2
HSNI L 18
HSNI LLLLLLLLLL 2 A_GiveInventory("StaminaFlag",23)
HSNI L 0 A_GiveInventory("StaminaFlag",500)
HSNI L 0 A_Refire
goto Ready+2

Altfire:
HSNI L 0 A_GiveInventory("SearchmanAlt_CI",1)
//HSNI L 0 A_PlaySoundEx("weapon/dustbit","Weapon")
HSNI PQR 3
HSNI QP 5
HSNI L 5
HSNI L 0 A_Refire
goto Ready+2
NoAmmo:
HSNI L 1 ACS_Execute(979,0)
HSNI L 0 A_Refire
Goto Ready+2

Flash:
TNT1 A 0 A_JumpIfInventory("BushInvis",1,"FlashB")
TNT1 A 0 A_SetTranslucent(1.0)
TNT1 A 0 A_ChangeFlag("CANTSEEK",0)
TNT1 A 0 A_JumpIfInventory("SearchTargetID1",1,"Flash1")
TNT1 A 0 A_JumpIfInventory("SearchTargetID2",1,"Flash2")
TNT1 A 0 A_JumpIfInventory("SearchTargetID3",1,"Flash3")
TNT1 A 0 A_JumpIfInventory("SearchTargetID4",1,"Flash4")
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 1
loop
FlashB:
TNT1 A 0 A_ChangeFlag("CANTSEEK",1)
TNT1 A 0 A_SetTranslucent(0.0)
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==0,"BlueMines")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==1,"RedMines")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==2,"OrangeMines")
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(143,0)==3,"PurpleMines")
goto Flash+3
BlueMines:
TNT1 A 0 A_SpawnItemEx("BushVisualBlue",0,0,60,momx,momy,momz,0,9,0)
goto Flash+3
RedMines:
TNT1 A 0 A_SpawnItemEx("BushVisualRed",0,0,60,momx,momy,momz,0,9,0)
goto Flash+3
OrangeMines:
TNT1 A 0 A_SpawnItemEx("BushVisualOrange",0,0,60,momx,momy,momz,0,9,0)
goto Flash+3
PurpleMines:
TNT1 A 0 A_SpawnItemEx("BushVisualPurple",0,0,60,momx,momy,momz,0,9,0)
goto Flash+3
Flash1:
TNT1 A 0 ACS_ExecuteAlways(801,0,3,1)
goto Flash+4
Flash2:
TNT1 A 0 ACS_ExecuteAlways(801,0,3,2)
goto Flash+5
Flash3:
TNT1 A 0 ACS_ExecuteAlways(801,0,3,3)
goto Flash+6
Flash4:
TNT1 A 0 ACS_ExecuteAlways(801,0,3,4)
goto Flash+7
}
}

actor HomingCrosshairB
{
+NOGRAVITY
- SOLID
+DONTSPLASH
+DONTBLAST
+THRUGHOST
//+CLIENTSIDEONLY
//+NONETID
+NOINTERACTION
Radius 1
Height 1
Scale 2.5
states
{
Spawn:
HSNC A 0
HSNC A 1 A_PlaySoundEx("weapon/SearchCross","Weapon")
stop
}
}
actor HomingCrosshairB2 : HomingCrosshairB
{
states
{
Spawn:
HSNC B 0
HSNC B 1
stop
}
}
actor HomingCrosshairB3 : HomingCrosshairB
{
states
{
Spawn:
HSNC C 0
HSNC C 1
stop
}
}
actor HomingCrosshairB4 : HomingCrosshairB
{
states
{
Spawn:
HSNC D 0
HSNC D 1 A_PlaySoundEx("weapon/SearchCross","Weapon")
stop
}
}
actor HomingCrosshairB5 : HomingCrosshairB
{
states
{
Spawn:
HSNC E 0
HSNC E 1
stop
}
}
actor HomingCrosshairB6 : HomingCrosshairB
{
states
{
Spawn:
HSNC F 0
HSNC F 1
stop
}
}
actor HomingCrosshairB7 : HomingCrosshairB
{
states
{
Spawn:
HSNC G 0
HSNC G 1 A_PlaySoundEx("weapon/SearchCross","Weapon")
stop
}
}
actor HomingCrosshairB8 : HomingCrosshairB
{
states
{
Spawn:
HSNC H 0
HSNC H 1
stop
}
}
actor HomingCrosshairB9 : HomingCrosshairB
{
states
{
Spawn:
HSNC I 0
HSNC I 1
stop
}
}

actor HomingCrosshairBW : HomingCrosshairB{states{Spawn:HSNC O 0
HSNC O 1 A_PlaySoundEx("weapon/SearchCross","Weapon")
stop}}
actor HomingCrosshairB2W : HomingCrosshairB2{states{Spawn:HSNC P 0
HSNC P 1
stop}}
actor HomingCrosshairB3W : HomingCrosshairB3{states{Spawn:HSNC Q 0
HSNC Q 1
stop}}
actor HomingCrosshairB4W : HomingCrosshairB4{states{Spawn:HSNC R 0
HSNC R 1 A_PlaySoundEx("weapon/SearchCross","Weapon")
stop}}
actor HomingCrosshairB5W : HomingCrosshairB5{states{Spawn:HSNC S 0
HSNC S 1
stop}}
actor HomingCrosshairB6W : HomingCrosshairB6{states{Spawn:HSNC T 0
HSNC T 1
stop}}
actor HomingCrosshairB7W : HomingCrosshairB7{states{Spawn:HSNC U 0
HSNC U 1 A_PlaySoundEx("weapon/SearchCross","Weapon")
stop}}
actor HomingCrosshairB8W : HomingCrosshairB8{states{Spawn:HSNC V 0
HSNC V 1
stop}}
actor HomingCrosshairB9W : HomingCrosshairB9{states{Spawn:HSNC W 0
HSNC W 1
stop}}

actor HomingCrosshairLockedB : HomingCrosshair
{
states
{
Spawn:
//HSNC L 0
//HSNC L 1
HSNC N 0
HSNC N 1
stop
}
}

actor HomingCrosshairLockedB2 : HomingCrosshairLockedB
{
-CLIENTSIDEONLY
+NONETID
//RenderStyle "Translucent"
//Alpha 0.3
}

actor HomingLockGiverB : CustomInventory
{
states
{
Pickup:
//TNT1 A 0 A_JumpIfInventory("isDead",1,"No")
TNT1 A 0 A_JumpIf(!(health>0),"No")
TNT1 A 0 A_JumpIfHealthLower(1, "No")
TNT1 A 0 A_JumpIfInventory("HomingLockedVision",1,"No")
TNT1 A 0 A_SpawnItemEx("HomingCrosshairLockedB",0,0,32,momx,momy,momz,0,8)
TNT1 A 0 A_GiveInventory("HomingLockedVision",1)
TNT1 A 0 A_SpawnItemEx("HomingLockHelper")
stop
No:
TNT1 A 0
stop
}
}

actor HomingLockGiverB2 : HomingLockGiverB
{
states
{
Pickup:
//TNT1 A 0 A_JumpIfInventory("isDead",1,"No")
TNT1 A 0 A_JumpIf(!(health>0),"No")
TNT1 A 0 A_JumpIfHealthLower(1, "No")
TNT1 A 0 A_SpawnItemEx("HomingCrosshairLockedB2",0,0,32,momx,momy,momz,0,8)
TNT1 A 0 A_GiveInventory("HomingLockedVision",1)
stop
}
}

actor HomingLockGiverBX : HomingLockGiverB
{
states
{
Pickup:
//TNT1 A 0 A_JumpIfInventory("isDead",1,"No")
TNT1 A 0 A_JumpIf(!(health>0),"No")
TNT1 A 0 A_JumpIfHealthLower(1, "No")
TNT1 A 0 A_SpawnItemEx("HomingCrosshairLockedB2",0,0,32,momx,momy,momz,0,8)
stop
}
}

actor HomingLockHelper : BasicHelper
{
Reactiontime 7
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_CountDown
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 1 A_GiveToTarget("HomingLockGiverBX",1)
goto Spawn
Death:
TNT1 A 1
stop
}
}

actor SearchManTargeter : FastProjectile
{
Translation "199:199=212:212", "202:202=4:4"
+SKYEXPLODE
+DONTBLAST
+DONTREFLECT
Speed 1000
//Speed 9001
Damage (0)
radius 16
height 16
+DONTSPLASH
States
{
Spawn:
TNT1 A 0
TNT1 A 1
goto Spawn+1
XDeath:
//TNT1 A 0 A_Stop
TNT1 A 0 A_JumpIfInTargetInventory("SearchTargetID1",1,"Target2")
TNT1 A 0 ACS_ExecuteAlways(801,0,0,1)
goto Crosshair
Target2:
TNT1 A 0 A_JumpIfInTargetInventory("SearchTargetID2",1,"Target3")
TNT1 A 0 ACS_ExecuteAlways(801,0,0,2)
goto Crosshair
Target3:
TNT1 A 0 A_JumpIfInTargetInventory("SearchTargetID3",1,"Target4")
TNT1 A 0 ACS_ExecuteAlways(801,0,0,3)
goto Crosshair
Target4:
TNT1 A 0 A_JumpIfInTargetInventory("SearchTargetID4",1,"Crosshair")
TNT1 A 0 ACS_ExecuteAlways(801,0,0,4)
goto Crosshair
Death:
//TNT1 A 0 A_Stop
CrossHair:
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",18,"FrameReset")
TNT1 A 0 A_GiveToTarget("CrossHairFrame",1)
TNT1 A 0 A_JumpIfInTargetInventory("CrossBlink",8,"WhiteReset")
TNT1 A 0 A_GiveToTarget("CrossBlink",1)
TNT1 A 0 A_JumpIfInTargetInventory("CrossBlink",4,"White")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",17,"CrossHair9")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",15,"CrossHair8")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",13,"CrossHair7")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",11,"CrossHair6")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",9,"CrossHair5")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",7,"CrossHair4")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",5,"CrossHair3")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",3,"CrossHair2")
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair2:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB2",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair3:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB3",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair4:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB4",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair5:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB5",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair6:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB6",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair7:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB7",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair8:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB8",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair9:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB9",8,0,8,0,0,0,0,1)
goto CrosshairEnd
FrameReset:
TNT1 A 0 A_TakeFromTarget("CrossHairFrame",999)
goto CrossHair+1
WhiteReset:
TNT1 A 0 A_TakeFromTarget("CrossBlink",999)
goto CrossHair+3

White:
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",17,"CrossHair9W")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",15,"CrossHair8W")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",13,"CrossHair7W")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",11,"CrossHair6W")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",9,"CrossHair5W")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",7,"CrossHair4W")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",5,"CrossHair3W")
TNT1 A 0 A_JumpIfInTargetInventory("CrossHairFrame",3,"CrossHair2W")
TNT1 A 0 A_SpawnItemEx("HomingCrosshairBW",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair2W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB2W",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair3W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB3W",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair4W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB4W",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair5W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB5W",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair6W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB6W",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair7W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB7W",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair8W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB8W",8,0,8,0,0,0,0,1)
goto CrosshairEnd
CrossHair9W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB9W",8,0,8,0,0,0,0,1)
goto CrosshairEnd

CrosshairEnd:
TNT1 A 2
stop
}
}


actor SearchManTargeterB : SearchManTargeter{translation "199:199=74:74","202:202=205:205"}
actor SearchManTargeterR : SearchManTargeter{translation "199:199=41:41","202:202=171:171"}
actor SearchManTargeterO : SearchManTargeter{translation "199:199=128:128","202:202=104:104"}
actor SearchManTargeterP : SearchManTargeter{translation "199:199=232:232","202:202=229:229"}

actor CrossHairFrame : Inventory
{
inventory.amount 1
inventory.maxamount 18
}
actor CrossBlink : Inventory
{
inventory.amount 1
inventory.maxamount 8
}


actor SearchTargetID : Inventory
{
inventory.amount 1
inventory.maxamount 64
}

actor SearchTargetID1 : SearchTargetID {}
actor SearchTargetID2 : SearchTargetID {}
actor SearchTargetID3 : SearchTargetID {}
actor SearchTargetID4 : SearchTargetID {}

actor SearchTargetIDCD : PowerDamage
{
powerup.duration 22
damagefactor "normal", 1.0
}

actor SearchTargetID1CD : SearchTargetIDCD {}
actor SearchTargetID2CD : SearchTargetIDCD {}
actor SearchTargetID3CD : SearchTargetIDCD {}
actor SearchTargetID4CD : SearchTargetIDCD {}

actor SearchShotsFired : Inventory
{
inventory.amount 1
inventory.maxamount 4
}

actor HomingLockedVision : PowerDamage
{
powerup.duration 8
damagefactor "normal", 1.0
}

/*801,0,a,b

a
0: Lock on from crossheir
1: Give target from owner
2: Home on target

b
target number*/

actor HomingSniperB
{
Translation "192:192=105:105", "198:198=230:230"//"200:210=105:105"
PROJECTILE
+DONTSEEKINVISIBLE//
+SEEKERMISSILE
+SCREENSEEKER
Damagetype "HomingSniper"
Obituary "$OB_HOMINGSNIPERYD"
Radius 5
Height 5
scale 2.5
speed 20

damage (14)
States
{
Spawn:
HSNM TTUUTTUU 1 A_SeekerMissile(2,10,3,50,10)
Goto Primed
Primed:
HSNM T 1 A_SeekerMissile(2,10,3,50,10)
HSNM T 0 A_JumpIfTargetInLOS("See", 0, 1)
HSNM T 1 A_SeekerMissile(2,10,3,50,10)
HSNM T 0 A_JumpIfTargetInLOS("See", 0, 1)
HSNM U 1 A_SeekerMissile(2,10,3,50,10)
HSNM U 0 A_JumpIfTargetInLOS("See", 0, 1)
HSNM U 1 A_SeekerMissile(2,10,3,50,10)
HSNM U 0 A_JumpIfTargetInLOS("See", 0, 1)
loop
See:
HSNM TTTTT 0 A_SeekerMissile(2,10,3,50,10)
HSNM T 1
HSNM T 0 A_ScaleVelocity(2.0)
Goto FastMode
FastMode:
HSNM TU 2 
HSNM T 0 A_SpawnItemEx("HomingSniperLockon",0,0,0,momx*10,momy*10,momz*10,0,10)
HSNM TU 2 
HSNM T 0 A_SpawnItemEx("HomingSniperLockon",0,0,0,momx*10,momy*10,momz*10,0,10)
HSNM TU 2 
HSNM T 0 A_SpawnItemEx("HomingSniperLockon",0,0,0,momx*10,momy*10,momz*10,0,10)
Goto See+4
Death:
MMFX B 0
MMFX B 0 A_GiveToTarget("Clip", 1)
MMFX BCDE 2
stop
}
}

actor HomingSniperBB : HomingSniperB{translation "192:192=205:205", "198:198=74:74"}
actor HomingSniperBR : HomingSniperB{translation "192:192=171:171", "198:198=41:41"}
actor HomingSniperBO : HomingSniperB{translation "192:192=104:104", "198:198=128:128"}
actor HomingSniperBP : HomingSniperB{translation "192:192=229:229", "198:198=232:232"}

actor HomingSniperB1
{
var int user_B;
Translation "192:192=105:105", "198:198=230:230"//"200:210=105:105"
PROJECTILE
+DONTBLAST
+DONTREFLECT
Radius 5
Height 5
scale 2.5
damage (11+user_B)
speed 35
Damagetype "HomingSniper"
Obituary "$OB_HOMINGSNIPERYD"
states
{
Spawn:
HSNM T 0
//HSNM T 0 A_GiveInventory("SearchTargetID",ACS_ExecuteWithResult(801,1,1))
HSNM T 0 Thing_ChangeTID(0,ACS_ExecuteWithResult(801,1,1)+1299)
Spawn2:
HSNM T 0
HSNM T 1
HSNM T 0 A_JumpIf(TID==1299,"Unlock")
Spawn3:
HSNM T 0 A_JumpIf(ACS_ExecuteWithResult(801,2,TID-1299)==0,"Unlock")
HSNM T 0 A_ChangeVelocity(cos(pitch)*35,0,-sin(pitch)*35,3)
HSNM T 1
HSNM T 0 A_JumpIf(ACS_ExecuteWithResult(801,2,TID-1299)==0,"Unlock")
HSNM T 0 A_ChangeVelocity(cos(pitch)*35,0,-sin(pitch)*35,3)
HSNM U 1
HSNM T 0 A_JumpIf(ACS_ExecuteWithResult(801,2,TID-1299)==0,"Unlock")
HSNM T 0 A_ChangeVelocity(cos(pitch)*35,0,-sin(pitch)*35,3)
HSNM U 1
HSNM T 0 A_JumpIf(ACS_ExecuteWithResult(801,2,TID-1299)==0,"Unlock")
HSNM T 0 A_ChangeVelocity(cos(pitch)*35,0,-sin(pitch)*35,3)
HSNM T 1
HSNM T 0 A_JumpIf(user_B>=4,"Spawn3")
HSNM T 0 A_GiveInventory("WeaponCharge",1)
HSNM T 0 A_JumpIfInventory("WeaponCharge",3,"SpawnP")
loop
SpawnP:
HSNM T 0 A_SetUserVar("user_B",user_B+1)
HSNM T 0 A_TakeInventory("WeaponCharge",99)
goto Spawn3
Unlock:
TNT1 A 0 A_SpawnItemEx("HomingSniperB",0,0,0,momx/2,momy/2,momz/2,0,9,0)
stop
Death:
MMFX BCDE 2
stop
}
}

actor HomingSniperB1B : HomingSniperB1{translation "192:192=205:205", "198:198=74:74"}
actor HomingSniperB1R : HomingSniperB1{translation "192:192=171:171", "198:198=41:41"}
actor HomingSniperB1O : HomingSniperB1{translation "192:192=104:104", "198:198=128:128"}
actor HomingSniperB1P : HomingSniperB1{translation "192:192=229:229", "198:198=232:232"}

actor HomingSniperB2 : HomingSniperB1
{
states
{
Spawn:
HSNM T 0
//HSNM T 0 A_GiveInventory("SearchTargetID",ACS_ExecuteWithResult(801,1,2))
HSNM T 0 Thing_ChangeTID(0,ACS_ExecuteWithResult(801,1,2)+1299)
goto Spawn2
}
}

actor HomingSniperB2B : HomingSniperB2{translation "192:192=205:205", "198:198=74:74"}
actor HomingSniperB2R : HomingSniperB2{translation "192:192=171:171", "198:198=41:41"}
actor HomingSniperB2O : HomingSniperB2{translation "192:192=104:104", "198:198=128:128"}
actor HomingSniperB2P : HomingSniperB2{translation "192:192=229:229", "198:198=232:232"}

actor HomingSniperB3 : HomingSniperB1
{
states
{
Spawn:
HSNM T 0
//HSNM T 0 A_GiveInventory("SearchTargetID",ACS_ExecuteWithResult(801,1,3))
HSNM T 0 Thing_ChangeTID(0,ACS_ExecuteWithResult(801,1,3)+1299)
goto Spawn2
}
}

actor HomingSniperB3B : HomingSniperB3{translation "192:192=205:205", "198:198=74:74"}
actor HomingSniperB3R : HomingSniperB3{translation "192:192=171:171", "198:198=41:41"}
actor HomingSniperB3O : HomingSniperB3{translation "192:192=104:104", "198:198=128:128"}
actor HomingSniperB3P : HomingSniperB3{translation "192:192=229:229", "198:198=232:232"}

actor HomingSniperB4 : HomingSniperB1
{
states
{
Spawn:
HSNM T 0
//HSNM T 0 A_GiveInventory("SearchTargetID",ACS_ExecuteWithResult(801,1,4))
HSNM T 0 Thing_ChangeTID(0,ACS_ExecuteWithResult(801,1,4)+1299)
goto Spawn2
}
}

actor HomingSniperB4B : HomingSniperB4{translation "192:192=205:205", "198:198=74:74"}
actor HomingSniperB4R : HomingSniperB4{translation "192:192=171:171", "198:198=41:41"}
actor HomingSniperB4O : HomingSniperB4{translation "192:192=104:104", "198:198=128:128"}
actor HomingSniperB4P : HomingSniperB4{translation "192:192=229:229", "198:198=232:232"}

actor SearchFrisbee
{
Translation "195:195=73:73"
PROJECTILE
Scale 2.5
Height 8
Radius 8
Damage(18)
Bouncetype Doom
-ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
Damagetype "ClassPain"
Obituary "$OB_SEARCHDISC"
bouncefactor 1.0
wallbouncefactor 1.0
Bouncecount 40
speed 30
reactiontime 16
SeeSound "item/protoreflect"
States
{
Spawn:
HSNM D 0 A_CountDown
HSNM DE 4
loop
Death:
HSNM D 0
stop
}
}

actor SearchFrisbeeB : SearchFrisbee{Translation "195:195=74:74"}
actor SearchFrisbeeR : SearchFrisbee{Translation "195:195=41:41"}
actor SearchFrisbeeO : SearchFrisbee{Translation "195:195=128:128"}
actor SearchFrisbeeP : SearchFrisbee{Translation "195:195=232:232"}

actor BushVisual
{
scale 2.5
- SOLID
+NOGRAVITY
+NOINTERACTION
RenderStyle "Translucent"
Alpha 0.6
+CLIENTSIDEONLY
//+NONETID
states
{
Spawn:
SEAR I 0
SEAR I 1
stop
}
}

actor BushVisualBlue : BushVisual
{
VisibleToTeam 0
}

actor BushVisualRed : BushVisual
{
VisibleToTeam 1
}

actor BushVisualOrange : BushVisual
{
VisibleToTeam 2
}

actor BushVisualPurple : BushVisual
{
VisibleToTeam 3
}


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


actor SearchBusher : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "BushIcon"
inventory.pickupmessage "Power up! You can summon bushes, ok?"
scale 2.0
+INVBAR
states
{
Spawn:
HSNI U 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("SearchBushBusy",1,"No")
TNT1 A 0 A_GiveInventory("SearchBushBusy",1)
TNT1 A 0 A_PlaySoundEx("class/searchbush","SoundSlot6")
TNT1 A 0 A_JumpIfInventory("SearchBushFlag1",1,"Success2")
TNT1 A 0 A_JumpIfInventory("SearchBushFlag2",1,"Success3")
TNT1 A 0 A_JumpIfInventory("SearchBushFlag3",1,"Success4")
Success1:
TNT1 A 0 A_TakeInventory("SearchBushFlag4",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag1",1)
TNT1 A 0 A_SpawnItemEx("SearchBush1",0,0,150,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush1",100,0,150,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush1",200,0,150,0,0,0,0,1)
fail
Success2:
TNT1 A 0 A_TakeInventory("SearchBushFlag1",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag2",1)
TNT1 A 0 A_SpawnItemEx("SearchBush2",0,0,112,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush2",100,0,150,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush2",200,0,150,0,0,0,0,1)
fail
Success3:
TNT1 A 0 A_TakeInventory("SearchBushFlag2",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag3",1)
TNT1 A 0 A_SpawnItemEx("SearchBush3",0,0,150,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush3",100,0,150,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush3",200,0,150,0,0,0,0,1)
fail
Success4:
TNT1 A 0 A_TakeInventory("SearchBushFlag3",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag4",1)
TNT1 A 0 A_SpawnItemEx("SearchBush4",0,0,150,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush4",100,0,150,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("SearchBush4",200,0,150,0,0,0,0,1)
fail
No:
TNT1 A 0
fail
}
}

actor SearchBushBusy : PowerDamage
{
powerup.duration 60
damagefactor "normal", 1.0
}

/*
actor BushInvis : PowerupGiver
{
powerup.duration 5
//powerup.duration -1
Powerup.Type "PowerShadow"
Powerup.Mode "Translucent"
+INVENTORY.AUTOACTIVATE
}
*/

actor BushInvis : SearchBushBusy
{
powerup.duration 7
}

actor SearchBushFlag1 : OnceC{}
actor SearchBushFlag2 : OnceC{}
actor SearchBushFlag3 : OnceC{}
actor SearchBushFlag4 : OnceC{}

actor SearchBush1
{
Translation "192:192=105:105"
PROJECTILE
+NOCLIP
-NOGRAVITY
-MISSILE
Radius 32
Height 42//12
scale 2.5
speed 0
RenderStyle "Translucent"
Alpha 0.3
+MOVEWITHSECTOR
+DONTREFLECT
+DONTBLAST
states
{
Spawn:
HSNI S 0
HSNI T 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
HSNI T 1 A_JumpIfInTargetInventory("SearchBushFlag3",1,"Death")
HSNI T 0 A_JumpIfCloser(82,"GiveStealth")
goto Spawn+1
GiveStealth:
HSNI T 0 A_GiveToTarget("BushInvis",1)
goto Spawn+1
Death:
TNT1 A 0
stop
}
}

actor SearchBush2 : SearchBush1
{
states
{
Spawn:
HSNI S 0
HSNI T 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
HSNI T 1 A_JumpIfInTargetInventory("SearchBushFlag4",1,"Death")
HSNI T 0 A_JumpIfCloser(82,"GiveStealth")
goto Spawn+1
GiveStealth:
HSNI T 0 A_GiveToTarget("BushInvis",1)
goto Spawn+1
}
}

actor SearchBush3 : SearchBush1
{
states
{
Spawn:
HSNI S 0
HSNI T 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
HSNI T 1 A_JumpIfInTargetInventory("SearchBushFlag1",1,"Death")
HSNI T 0 A_JumpIfCloser(82,"GiveStealth")
goto Spawn+1
GiveStealth:
HSNI T 0 A_GiveToTarget("BushInvis",1)
goto Spawn+1
}
}

actor SearchBush4 : SearchBush1
{
states
{
Spawn:
HSNI S 0
HSNI T 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
HSNI T 1 A_JumpIfInTargetInventory("SearchBushFlag2",1,"Death")
HSNI T 0 A_JumpIfCloser(82,"GiveStealth")
goto Spawn+1
GiveStealth:
HSNI T 0 A_GiveToTarget("BushInvis",1)
goto Spawn+1
}
}

actor SearchBushDC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("HomingSniperBoss",1,"InGame")
TNT1 A 0 A_GiveInventory("SearchBushFlag1", 1)
TNT1 A 0 A_GiveInventory("SearchBushFlag2", 1)
TNT1 A 0 A_GiveInventory("SearchBushFlag3", 1)
TNT1 A 0 A_GiveInventory("SearchBushFlag4", 1)
stop
InGame:
TNT1 A 0
stop
}
}


actor SearchmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("SearchManTargeter",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("SearchManTargeterB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("SearchManTargeterR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("SearchManTargeterO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("SearchManTargeterP",0,0,8,0)
goto Done
}
}

actor SearchmanMain0_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HomingSniperB",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HomingSniperBB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HomingSniperBR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HomingSniperBO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HomingSniperBP",0,0,8,0)
goto Done
}
}

actor SearchmanMain1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HomingSniperB1",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HomingSniperB1B",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HomingSniperB1R",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HomingSniperB1O",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HomingSniperB1P",0,0,8,0)
goto Done
}
}

actor SearchmanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HomingSniperB2",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HomingSniperB2B",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HomingSniperB2R",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HomingSniperB2O",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HomingSniperB2P",0,0,8,0)
goto Done
}
}

actor SearchmanMain3_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HomingSniperB3",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HomingSniperB3B",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HomingSniperB3R",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HomingSniperB3O",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HomingSniperB3P",0,0,8,0)
goto Done
}
}

actor SearchmanMain4_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("HomingSniperB4",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("HomingSniperB4B",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("HomingSniperB4R",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("HomingSniperB4O",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("HomingSniperB4P",0,0,8,0)
goto Done
}
}


actor SearchmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("SearchFrisbee",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("SearchFrisbeeB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("SearchFrisbeeR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("SearchFrisbeeO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("SearchFrisbeeP",0,0,8,0)
goto Done
}
}


