actor Searchman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_8E"
dropitem "HomingSniperWep"
Weapon.AmmoUse 4
Weapon.AmmoGive 28
Obituary "$OB_HOMINGSNIPER"
Inventory.Pickupmessage "Now you're searchman, ok?"
weapon.ammotype "WilyBanzaiAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_08 E 1
loop

Deselect:
HSN8 A 0
goto DeselectSwap
Select:
HSN8 A 0
goto SelectSwap

Ready:
HSN8 A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_SEARCHMAN)
HSN8 A 0 A_GunFlash("Flash",1)
goto Ready1
Ready1:
HSN8 A 2 A_WeaponReady
loop

Fire:
HSN8 B 1 A_JumpIfInventory("PlayerPropertyRage",1,"FireRedo3.a")
HSN8 B 0 A_Refire("FireRedo3.a")
goto FireTheMissiles0
FireHoldC:
HSN8 A 0 A_JumpIfInventory("WilyBanzaiAmmo",1,"FireHold")
goto FireTheMissiles0
FireHold:
HSN8 H 0 A_TakeInventory("WilyBanzaiAmmo",1,1)
HSN8 L 1 A_FireCustomMissile("SearchManTargeter",0,0,0,0)
HSN8 H 0 A_Refire("FireHoldC")
goto FireTheMissiles0
FireTheMissiles0:
HSN8 H 1
HSN8 H 0 A_JumpIfInventory("SearchTargetID1",1,"Fire1")
HSN8 H 0 A_JumpIfInventory("SearchTargetID2",1,"Fire2")
HSN8 H 0 A_JumpIfInventory("SearchTargetID3",1,"Fire3")
HSN8 H 0 A_JumpIfInventory("SearchTargetID4",1,"Fire4")
goto Fire0
FireTheMissiles:
HSN8 H 0 A_JumpIfInventory("SearchTargetID1",1,"Fire1")
HSN8 H 0 A_JumpIfInventory("SearchTargetID2",1,"Fire2")
HSN8 H 0 A_JumpIfInventory("SearchTargetID3",1,"Fire3")
HSN8 H 0 A_JumpIfInventory("SearchTargetID4",1,"Fire4")
HSN8 H 0
goto Fire0+4
Fire4:
HSN8 I 0 A_PlaySoundEx("wep_L/SearchMissile","Weapon")//weapon/coilexplode
HSN8 I 0 A_FireCustomMissile("HomingSniperB4",0,0,8,0)
HSN8 IJ 2
goto FireTheMissiles+4
Fire3:
HSN8 I 0 A_PlaySoundEx("wep_L/SearchMissile","Weapon")
HSN8 I 0 A_FireCustomMissile("HomingSniperB3",0,0,8,0)
HSN8 IJ 2
goto FireTheMissiles+3
Fire2:
HSN8 I 0 A_PlaySoundEx("wep_L/SearchMissile","Weapon")
HSN8 I 0 A_FireCustomMissile("HomingSniperB2",0,0,8,0)
HSN8 IJ 2
goto FireTheMissiles+2
Fire1:
HSN8 I 0 A_PlaySoundEx("wep_L/SearchMissile","Weapon")
HSN8 I 0 A_FireCustomMissile("HomingSniperB1",0,0,8,0)
HSN8 IJ 2
goto FireTheMissiles+1
Fire0:
HSN8 I 0 A_PlaySoundEx("wep_L/SearchMissile","Weapon")
HSN8 I 0 A_FireCustomMissile("HomingSniperB",0,0,8,0)
HSN8 IJ 2
HSN8 K 0 A_TakeInventory("SearchTargetID4",999)
HSN8 K 0 A_TakeInventory("SearchTargetID3",999)
HSN8 K 0 A_TakeInventory("SearchTargetID2",999)
HSN8 K 0 A_TakeInventory("SearchTargetID1",999)
HSN8 K 0 A_TakeInventory("SearchTargetID4CD",999)
HSN8 K 0 A_TakeInventory("SearchTargetID3CD",999)
HSN8 K 0 A_TakeInventory("SearchTargetID2CD",999)
HSN8 K 0 A_TakeInventory("SearchTargetID1CD",999)
HSN8 KHHHH 2 A_GiveInventory("WilyBanzaiAmmo",100)
HSN8 H 0 A_GiveInventory("WilyBanzaiAmmo",560)
goto FireRedoCheck
FireRedoCheck:
HSN8 H 0 A_Refire("FireRedo0.a")
HSN8 D 1
HSN8 D 0 A_Refire("FireRedo0")
HSN8 D 1
HSN8 C 0 A_Refire("FireRedo1.a")
HSN8 C 1
HSN8 C 0 A_Refire("FireRedo1")
HSN8 C 1
HSN8 B 0 A_Refire("FireRedo2.a")
HSN8 B 1
HSN8 B 0 A_Refire("FireRedo2")
HSN8 B 1
HSN8 A 0 A_Refire("FireRedo3.a")
HSN8 A 1
HSN8 A 0 A_Refire("FireRedo3")
HSN8 A 1
goto Ready1

FireRedo3:
HSN8 B 1 A_JumpIfInventory("PlayerPropertyRage",1,"FireRedo3.a")
HSN8 B 0 A_Refire("FireRedo3.a")
goto FireTheMissiles0
FireRedo3.a:
HSN8 B 1
HSN8 B 0 A_Refire("FireRedo2")
goto FireTheMissiles0
FireRedo2:
HSN8 C 1 A_JumpIfInventory("PlayerPropertyRage",1,"FireRedo2.a")
HSN8 C 0 A_Refire("FireRedo2.a")
goto FireTheMissiles0
FireRedo2.a:
HSN8 C 1
HSN8 C 0 A_Refire("FireRedo1")
goto FireTheMissiles0
FireRedo1:
HSN8 D 1 A_JumpIfInventory("PlayerPropertyRage",1,"FireRedo1.a")
HSN8 D 0 A_Refire("FireRedo1.a")
goto FireTheMissiles0
FireRedo1.a:
HSN8 D 1
HSN8 D 0 A_Refire("FireRedo0")
goto FireTheMissiles0
FireRedo0:
HSN8 H 1 A_JumpIfInventory("PlayerPropertyRage",1,"FireRedo0.a")
HSN8 H 0 A_Refire("FireRedo0.a")
goto FireTheMissiles0
FireRedo0.a:
HSN8 H 1
HSN8 H 0 A_Refire("FireHold")
goto FireTheMissiles0

Altfire:
HSN8 A 0 A_GiveInventory("VivifyDelay7",1)
HSN8 A 0 A_Refire(1)
HSN8 A 0 A_FireCustomMissile("SearchFrisbee",0,0,0,0)
HSN8 A 0 A_PlaySoundEx("weapon/dustbit","Weapon")
HSN8 BCEFGGGFECBA 2
goto Ready1


Flash:
TNT1 A 1 A_GiveInventory("SearchmanFlashState_P")
loop
}
}

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

actor SearchmanInvisAlphaGiver : PowerApropGiver {}
actor SearchmanInvisAlpha : Base_CBM_PropertyPower {}

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 : Powerup
{
+INVENTORY.ADDITIVETIME
powerup.duration 11
}

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

actor HomingLockedVision : Powerup
{
powerup.duration 10
}

actor SearchTargetID1CD_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 AA 0 A_GiveInventory("SearchTargetID1CD",1)
stop
}
}
actor SearchTargetID2CD_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 AA 0 A_GiveInventory("SearchTargetID2CD",1)
stop
}
}
actor SearchTargetID3CD_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 AA 0 A_GiveInventory("SearchTargetID3CD",1)
stop
}
}
actor SearchTargetID4CD_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 AA 0 A_GiveInventory("SearchTargetID4CD",1)
stop
}
}

actor SearchmanFlashState_P : CustomInventory
{
States
{
Pickup:
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
stop
Flash1:
TNT1 A 0 ACS_NamedExecuteAlways("cbm_Searchman_ACS",0,3,1)
goto Pickup+1
Flash2:
TNT1 A 0 ACS_NamedExecuteAlways("cbm_Searchman_ACS",0,3,2)
goto Pickup+2
Flash3:
TNT1 A 0 ACS_NamedExecuteAlways("cbm_Searchman_ACS",0,3,3)
goto Pickup+3
Flash4:
TNT1 A 0 ACS_NamedExecuteAlways("cbm_Searchman_ACS",0,3,4)
goto Pickup+4
}
}

actor HomingCrosshairB : ProjSpawnFuncActor//Uh oh
{
PainSound "weapon/SearchCross"
+NOGRAVITY
- SOLID
+DONTSPLASH
+DONTBLAST
+THRUGHOST
+THRUACTORS
//+CLIENTSIDEONLY
//+NONETID
+NOINTERACTION
Radius 2
Height 2
Scale 2.5
states
{
Spawn:
HSNC A 0
HSNC A 1 A_Pain
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_Pain
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_Pain
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_Pain
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_Pain
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_Pain
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 SearchmanLockonCrosshair : BasicGraphicEffect
{
//+NONETID
states
{
Spawn:
HSNC N 0
HSNC N 1
stop
}
}

actor SearchmanLockonGiver_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("HomingLockedVision",1)
TNT1 A 0 A_SpawnItemEx("SearchmanLockonCrosshair_H")
stop
}
}

actor SearchmanLockonGiver_P2 : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("HomingLockedVision",1)
TNT1 A 0 A_SpawnItemEx("SearchmanLockonCrosshair_H")
stop
}
}

actor SearchmanLockonCrosshair_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_SpawnItemEx("SearchmanLockonCrosshair",0,0,32,momx,momy,momz,0,8)
stop
}
}

actor SearchmanLockonCrosshair_H : BasicHelper
{
states
{
Spawn:
TNT1 A 0
TNT1 AAA 1 A_GiveToTarget("SearchmanLockonCrosshair_P",1)
stop
Death:
TNT1 A 1
stop
}
}


actor SearchManTargeterACS_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("cbm_istracerenemy")==1,"Target1")
stop
Target1:
TNT1 A 0 ACS_NamedExecuteAlways("cbm_Searchman_ACS",0,-1,CallACS("core_getptrtid",2),CallACS("core_getptrtid",8))
stop
}
}

actor SearchManCrossHairFrame_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("CrossHairFrame",18,"FrameReset")
TNT1 A 0 A_GiveInventory("CrossHairFrame",1)
TNT1 A 0 A_JumpIfInventory("CrossBlink",8,"WhiteReset")
TNT1 A 0 A_GiveInventory("CrossBlink",1)
stop
FrameReset:
TNT1 A 0 A_TakeInventory("CrossHairFrame",999)
goto Pickup+1
WhiteReset:
TNT1 A 0 A_TakeInventory("CrossBlink",999)
goto Pickup+3
}
}

actor SearchManTargeterFX_P : CustomInventory
{
States
{
Pickup:
CrossHair:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("SearchManCrossHairFrame_P",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_Jump(256,CountInv("CrossHairFrame"))
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB",8,0,8,0,0,0,0,1)
stop
CrossHair2:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB2",8,0,8,0,0,0,0,1)
stop
CrossHair3:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB3",8,0,8,0,0,0,0,1)
stop
CrossHair4:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB4",8,0,8,0,0,0,0,1)
stop
CrossHair5:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB5",8,0,8,0,0,0,0,1)
stop
CrossHair6:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB6",8,0,8,0,0,0,0,1)
stop
CrossHair7:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB7",8,0,8,0,0,0,0,1)
stop
CrossHair8:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB8",8,0,8,0,0,0,0,1)
stop
CrossHair9:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB9",8,0,8,0,0,0,0,1)
stop

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)
stop
CrossHair2W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB2W",8,0,8,0,0,0,0,1)
stop
CrossHair3W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB3W",8,0,8,0,0,0,0,1)
stop
CrossHair4W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB4W",8,0,8,0,0,0,0,1)
stop
CrossHair5W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB5W",8,0,8,0,0,0,0,1)
stop
CrossHair6W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB6W",8,0,8,0,0,0,0,1)
stop
CrossHair7W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB7W",8,0,8,0,0,0,0,1)
stop
CrossHair8W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB8W",8,0,8,0,0,0,0,1)
stop
CrossHair9W:
TNT1 A 0 A_SpawnItemEx("HomingCrosshairB9W",8,0,8,0,0,0,0,1)
stop

}
}

actor SearchManTargeter : ProjSpawnFuncActorFast
{
+SKYEXPLODE
+EXPLODEONWATER
+DONTBLAST
+DONTREFLECT
+DONTSPLASH
//+BLOODLESSIMPACT
+HITTRACER
Reactiontime 1
Damage (0)
radius 16
height 16
Speed 1000
States
{
Spawn:
TNT1 A 0
TNT1 A 10
TNT1 A 1 A_CountDown
wait

XDeath:
TNT1 A 0 A_GiveInventory("SearchManTargeterACS_P",1)
TNT1 A 2 A_GiveInventory("SearchManTargeterFX_P",1)
stop

Death:
TNT1 A 0 A_GiveInventory("SearchManTargeterFX_P",1)
stop
}
}

actor HomingSniperB : ProjSpawnFuncActor
{
PROJECTILE
Damagetype "SearchM_Shot"
Obituary "$OB_HOMINGSNIPERYD"
+DONTSEEKINVISIBLE
+SEEKERMISSILE
+SCREENSEEKER
damage (110)
Radius 9
Height 9
speed 32
scale 2.5
States
{
Spawn:
HSNC XY 2
loop

Death:
NMFX ABCD 2 bright
stop
}
}

actor HomingSniperB1 : ProjSpawnFuncActor
{
var int user_B;
var int user_TID;
PROJECTILE
Damagetype "SearchM_LockShot"
Obituary "$OB_HOMINGSNIPERYD"
+DONTBLAST
+DONTREFLECT
+SEEKERMISSILE
Meleerange 1
damage (100+user_B*10)
Radius 5
Height 5
speed 28
scale 2.5
states
{
Spawn:
HSNC X 0
HSNC X 0 A_SetUserVar("user_TID",CallACS("cbm_Searchman_ACS",1,Meleerange))
Spawn2:
HSNC X 0 A_JumpIf(user_TID==0,"Unlock")
HSNC X 0 ACS_NamedExecuteWithResult("core_setpointer",AAPTR_TRACER,user_TID+999)
HSNC X 1
//HSNC B 0 A_FaceTracer(90,90)//Change to this when the flags exist
//HSNC B 0 A_ChangeVelocity(cos(pitch)*28,0,sin(pitch)*28,3)
Spawn3:
//Check if tracer is alive and give them locked on FX
HSNC X 0 A_JumpIf(CallACS("cbm_Searchman_ACS",2,user_TID)==0,"Unlock")
HSNC X 0 A_SeekerMissile(90,90,2)
HSNC X 1
HSNC Y 0 A_JumpIf(CallACS("cbm_Searchman_ACS",2,user_TID)==0,"Unlock")
HSNC Y 0 A_SeekerMissile(90,90,2)
HSNC Y 1 A_SpawnItemEx("SearchHomingSniperFX",0,0,0,0,0,0,0,1)
HSNC Y 0 A_JumpIf(CallACS("cbm_Searchman_ACS",2,user_TID)==0,"Unlock")
HSNC Y 0 A_SeekerMissile(90,90,2)
HSNC Y 1
HSNC X 0 A_JumpIf(CallACS("cbm_Searchman_ACS",2,user_TID)==0,"Unlock")
HSNC X 0 A_SeekerMissile(90,90,2)
HSNC X 1 A_SpawnItemEx("SearchHomingSniperFX",0,0,0,0,0,0,0,1)
HSNC X 0 A_JumpIf(user_B>=6,"Spawn3")
HSNC X 0 A_GiveInventory("WeaponCharge",1)
HSNC X 0 A_JumpIfInventory("WeaponCharge",5,"SpawnP")
loop
SpawnP:
HSNC X 0 A_SetUserVar("user_B",user_B+1)
HSNC X 0 A_TakeInventory("WeaponCharge",99)
goto Spawn3
Unlock:
HSNC XY 2
loop
Death:
NMFX ABCD 2 bright
stop
}
}

actor HomingSniperB2 : HomingSniperB1{Meleerange 2}
actor HomingSniperB3 : HomingSniperB1{Meleerange 3}
actor HomingSniperB4 : HomingSniperB1{Meleerange 4}

actor SearchHomingSniperFX : BasicGraphicEffect
{
var int user_TranslateWhiteColors;
states
{
SpawnFrame:
TNT1 A 0
TNT1 A 1
HSN8 NOP 2
stop
}
}

actor SearchFrisbee : ProjSpawnFuncActor
{
PROJECTILE
Damagetype "SearchM_Disc"
Obituary "$OB_SEARCHDISC"
BounceSound "wep_L/SearchDiscBounce"//item/protoreflect
+SKYEXPLODE
+BOUNCEONFLOORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+CANBOUNCEWATER
bouncefactor 1.0
wallbouncefactor 1.0
Bouncecount 4
reactiontime 20
Damage (180)
Height 12
Radius 12
speed 44
Scale 2.5
States
{
Spawn:
HSN8 Q 0 A_CountDown
HSN8 QR 3
loop
Death:
NMFX MOOMMBBEE 1 bright
stop
}
}



actor SearchBusher : BasicClassItem
{
inventory.icon "BushIcon"
inventory.pickupmessage "Power up! You can summon bushes, ok?"
Tag "Summon Search Bushes"
states
{
Spawn:
HSN8 Z 1
loop
UseCBM:
TNT1 A 0 A_JumpIfInventory("SearchBushBusy",1,"No")
TNT1 A 0 A_GiveInventory("SearchBushBusy_RC",1)
TNT1 A 0 A_PlaySoundEx("class/searchbush","SoundSlot7")
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("TrimSearchBush1",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag1",1)
TNT1 A 0 A_SpawnItemEx("SearchBush1",0,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush1",120,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush1",240,0,150,0,0,-2)
fail
Success2:
TNT1 A 0 A_TakeInventory("SearchBushFlag1",1)
TNT1 A 0 A_GiveInventory("TrimSearchBush2",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag2",1)
TNT1 A 0 A_SpawnItemEx("SearchBush2",0,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush2",120,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush2",240,0,150,0,0,-2)
fail
Success3:
TNT1 A 0 A_TakeInventory("SearchBushFlag2",1)
TNT1 A 0 A_GiveInventory("TrimSearchBush3",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag3",1)
TNT1 A 0 A_SpawnItemEx("SearchBush3",0,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush3",120,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush3",240,0,150,0,0,-2)
fail
Success4:
TNT1 A 0 A_TakeInventory("SearchBushFlag3",1)
TNT1 A 0 A_GiveInventory("TrimSearchBush4",1)
TNT1 A 0 A_GiveInventory("SearchBushFlag4",1)
TNT1 A 0 A_SpawnItemEx("SearchBush4",0,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush4",120,0,150,0,0,-2)
TNT1 A 0 A_SpawnItemEx("SearchBush4",240,0,150,0,0,-2)
fail
}
}

actor SearchBushBusy : Powerup
{
powerup.duration 30
+INVENTORY.ADDITIVETIME
}

actor SearchBushBusy_RC : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 AA 0 A_GiveInventory("SearchBushBusy",1)
stop
}
}


actor InSearchBush_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("BushInvis",1,"Pickup2")
TNT1 A 0 A_GiveInventory("SearchBushEnter_P")
TNT1 A 0 A_SpawnItemEx("SearchBushExitWatcher")
Pickup2:
TNT1 A 0 A_GiveInventory("BushInvis")
stop
}
}
actor SearchBushExitWatcher : BasicHelper
{
+SERVERSIDEONLY
states
{
Spawn:
TNT1 A 0
Spawn2:
TNT1 A 1
TNT1 A 0 A_JumpIfInTargetInventory("BushInvis",1,"Spawn2")
TNT1 A 0 A_GiveToTarget("SearchBushExit_P")
stop
}
}

actor SearchBushEnter_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("SearchmanInvisAlphaGiver",1)
TNT1 A 0 ACS_NamedExecuteWithResult("core_dontidentifytargetplayer",0,true)
TNT1 A 0 ACS_NamedExecuteWithResult("core_cantseekplayer",0,true)
stop
}
}
actor SearchBushExit_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("SearchmanInvisAlpha")
TNT1 A 0 ACS_NamedExecuteWithResult("core_dontidentifytargetplayer",0,false)
TNT1 A 0 ACS_NamedExecuteWithResult("core_cantseekplayer",0,false)
stop
}
}

actor BushInvis : Powerup
{
powerup.duration 7
}

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

actor TrimSearchBush1 : Powerup
{
Powerup.Duration 20
}
actor TrimSearchBush2 : TrimSearchBush1{}
actor TrimSearchBush3 : TrimSearchBush1{}
actor TrimSearchBush4 : TrimSearchBush1{}

actor SearchBushLeafFX1 : BasicGraphicEffectM
{
+THRUACTORS
Alpha 0.3
Mass 1
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_Jump(256,2,3,4,5,6)
TNT1 A 0 A_Jump(256,5,6,7,8,9)
HSN8 S 4 A_ChangeVelocity(0,2,-2,3)
HSN8 T 3 A_ChangeVelocity(0,3,-2,3)
HSN8 U 4 A_ChangeVelocity(0,4,-2,3)
HSN8 V 3 A_ChangeVelocity(0,3,-2,3)
HSN8 W 4 A_ChangeVelocity(0,2,-2,3)
HSN8 S 4 A_ChangeVelocity(0,-2,-2,3)
HSN8 T 3 A_ChangeVelocity(0,-3,-2,3)
HSN8 U 4 A_ChangeVelocity(0,-4,-2,3)
HSN8 V 3 A_ChangeVelocity(0,-3,-2,3)
HSN8 W 4 A_ChangeVelocity(0,-2,-2,3)
goto Spawn+3
}
}
actor SearchBushLeafFX2 : SearchBushLeafFX1
{
States
{
Spawn:
TNT1 A 0
goto SearchBushLeafFX1::Spawn+2
}
}

actor SearchBush1 : ProjSpawnFuncActor
{
PROJECTILE
+NOCLIP
-NOGRAVITY
-MISSILE

+MOVEWITHSECTOR
+DONTREFLECT
+DONTBLAST
RenderStyle "Translucent"
Alpha 0.3
Radius 16//32
Height 12//42
speed 0
scale 2.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("cbm_SearchmanBushWatcher",0,90,CallACS("core_gettarget"))
TNT1 A 0
HSN8 X 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 X 0 A_JumpIfInTargetInventory("TrimSearchBush3",1,"Death")
HSN8 X 1
HSN8 X 0 A_JumpIf(momz==0,"SpawnLand")
goto Spawn+3

SpawnLand:
HSN8 Y 0 A_SpawnItemEx("SearchBushLeafFX1",random(1,9)*7,0,70+random(0,16),0,0,-2,random(0,17)*10,1)
HSN8 Y 0 A_SpawnItemEx("SearchBushLeafFX2",random(1,9)*7,0,70+random(0,16),0,0,-2,random(18,35)*10,1)
HSN8 YX 3
HSN8 Y 1 A_Jump(256,"SpawnWait")
wait

SpawnWait:
HSN8 Y 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 Y 0 A_JumpIfInTargetInventory("TrimSearchBush3",1,"Death")
HSN8 Y 3
loop

Death:
TNT1 A 1
stop
}
}

actor SearchBush2 : SearchBush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("cbm_SearchmanBushWatcher",0,90,CallACS("core_gettarget"))
TNT1 A 0
HSN8 X 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 X 1 A_JumpIfInTargetInventory("TrimSearchBush4",1,"Death")
HSN8 X 0 A_JumpIf(momz==0,"SpawnLand")
goto Spawn+3

SpawnWait:
HSN8 Y 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 Y 0 A_JumpIfInTargetInventory("TrimSearchBush4",1,"Death")
HSN8 Y 3
loop
}
}

actor SearchBush3 : SearchBush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("cbm_SearchmanBushWatcher",0,90,CallACS("core_gettarget"))
TNT1 A 0
HSN8 X 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 X 1 A_JumpIfInTargetInventory("TrimSearchBush1",1,"Death")
HSN8 X 0 A_JumpIf(momz==0,"SpawnLand")
goto Spawn+3

SpawnWait:
HSN8 Y 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 Y 0 A_JumpIfInTargetInventory("TrimSearchBush1",1,"Death")
HSN8 Y 3
loop
}
}

actor SearchBush4 : SearchBush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("cbm_SearchmanBushWatcher",0,90,CallACS("core_gettarget"))
TNT1 A 0
HSN8 X 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 X 1 A_JumpIfInTargetInventory("TrimSearchBush2",1,"Death")
HSN8 X 0 A_JumpIf(momz==0,"SpawnLand")
goto Spawn+3

SpawnWait:
HSN8 Y 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
HSN8 Y 0 A_JumpIfInTargetInventory("TrimSearchBush2",1,"Death")
HSN8 Y 3
loop
}
}


//actor Searchman_W_NormalBar : NormalBar {Args 192,230}
actor Searchman_W_ScriptBar : ScriptBar {}