actor Dynamoman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_BA"
dropitem "DynamoTendrilWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 240
Weapon.AmmoGive2 0
Inventory.Pickupmessage "You get an incurable electricity leak :/"
Obituary "$OB_DYNAMODISH"//$OB_LIGHTNINGBOLT
weapon.ammotype "TeslaCoilAmmo"
weapon.ammotype2 "DynamoHealAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_0B A 1
loop

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

Ready:
DYHD A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_DYNAMOMAN)
DYHD A 0 A_GunFlash("Flash",1)
goto Ready1
Ready1:
DYHD A 0 A_JumpIfInventory("DynamoItemFlag",1,"ItemRecharge")
DYHD A 2 A_WeaponReady
DYHD A 0 A_GiveInventory("TeslaCoilAmmo",2)
loop

Fire:
DYHD A 0 A_JumpIfInventory("DynamoItemFlag",1,"EndCharge")
DYHD A 0 A_JumpIfInventory("IsBot",1,"BotFire")
DYHD A 0 A_GiveInventory("DynamoCoolDownFlag",1)
DYHD A 0 A_GiveInventory("DynamoIsScanning",1)
DYHD A 0 A_SpawnItemEx("DynamoM_TaggerTracker_H")
DYHD A 0 A_GiveInventory("VivifyDelay5",1)
DYHD A 0 A_Refire(1)
DYHD F 2 A_GunFlash("Flash.ChargeSnd",1)
DYHD G 2
DYHD G 0 A_SpawnItemEx("DynamoM_ScannerWarp")
DYHD G 0 A_GiveInventory("DynamomanScanningSlow",1)
DYHD G 0 A_JumpIfInventory("IsBot",1,"BotFire2")

FireHold:
DYHD G 0 A_JumpIfInventory("TeslaCoilAmmo",180,"FireHold2")
DYHD G 1 A_GiveInventory("TeslaCoilAmmo",3+CallACS("core_checkrune",RUNE_RAGE)*3)
DYHD G 0 A_Refire("FireHold")
goto FireLightning
FireHold2:
DYHD G 0 A_GiveInventory("TeslaCoilAmmo",3+CallACS("core_checkrune",RUNE_RAGE)*3)
DYHD G 0 A_TakeInventory("DynamoStaminaFlag",1)
DYHD G 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
DYHD G 0 A_JumpIfInventory("DynamoStaminaFlag",1,1)
goto FireLightning
DYHD G 0 A_Refire("FireHold2")
FireLightning:
DYHD G 0 A_GunFlash("Flash.Lightning",1)
DYHD G 10 A_GiveInventory("DynamoM_TagEnd_F")
DYHD G 0 A_FireCustomMissile("DynamoM_LBoltSpawner",random(-45,45),0,0,0)//A_FireCustomMissile("DynamoM_LBoltThrow",0,0,8,0)

DYHD G 0 ACS_NamedExecuteAlways("cbm_DynamoScannerMissile",0,1)//Fire the target LightningBolts
DYHD G 0 A_TakeInventory("DynamoIsScanning",99)
DYHD GF 2
DYHD A 2
DYHD A 4 A_TakeInventory("DynamomanScanningSlow")
DYHD AAAAAAA 2 A_GiveInventory("DynamoStaminaFlag",31)
DYHD A 0 A_GiveInventory("DynamoStaminaFlag",500)
DYHD A 0 A_TakeInventory("DynamoCoolDownFlag",99)
goto Ready1

Flash:
TNT1 A 8 A_RailWait
TNT1 AAAAAA 8
TNT1 A 8 A_GiveInventory("DynamoHealAmmo",1)
loop
Flash.ChargeSnd:
TNT1 A 74 A_PlaySoundEx("weapon/dynamocharge","Weapon")
TNT1 A 0 A_GiveInventory("DynamoHealAmmo",1)
loop
Flash.Lightning:
TNT1 A 0 A_PlaySoundEx("weapon/dynamoorbs","Weapon")
TNT1 A 2 A_SpawnItemEx("DynamoM_RisingOrbBall",4,0,32,0,0,28,0,1)
TNT1 A 0 A_PlaySoundEx("weapon/dynamoorbs","Weapon")
TNT1 A 2 A_SpawnItemEx("DynamoM_RisingOrbBall",4,0,32,0,0,28,0,1)
TNT1 A 0 A_PlaySoundEx("weapon/dynamoorbs","Weapon")
TNT1 A 2 A_SpawnItemEx("DynamoM_RisingOrbBall",4,0,32,0,0,28,0,1)
TNT1 A 0 A_PlaySoundEx("weapon/lightningbolt","Weapon")
TNT1 A 2 A_SpawnItemEx("DynamoM_LBoltStartFX1",4,0,48,0,0,0,0,1)
TNT1 A 2 A_SpawnItemEx("DynamoM_LBoltStartFX2",4,0,48,0,0,0,0,1)
goto Flash+1
Flash.Healing:
TNT1 A 2 A_PlaySound("weapon/thunderbolt",4,1.0)
loop

AltFire:
DYHD A 0 A_JumpIfInventory("DynamoItemFlag",1,"EndCharge")
DYHD A 0 A_JumpIfInventory("DynamoIsScanning",1,"AltfireOrb")
DYHD A 0 A_GiveInventory("DynamoCoolDownFlag",1)
DYHD A 0 A_PlaySoundEx("weapon/magnetmissile","Weapon")
DYHD A 0 A_FireCustomMissile("DynamoM_Dish",0,1,8,0)
DYHD B 3 A_GiveInventory("TeslaCoilAmmo",21)
DYHD B 3 Offset(4,36)
DYHD D 3 A_WeaponReady(14)
DYHD E 6
DYHD A 10
DYHD A 0 A_TakeInventory("DynamoCoolDownFlag",99)
Goto Ready1
AltfireOrb:
DYHD G 0 A_GunFlash("Flash",1)
DYHD G 0 A_GiveInventory("DynamoM_TagEnd_F")
DYHD G 0 A_TakeInventory("DynamoIsScanning",99)
DYHD G 1 A_TakeInventory("DynamomanScanningSlow")
goto OrbFireTime
OrbFireTime:
DYHD G 0 A_PlaySoundEx("weapon/dynamoorbs","Weapon")
DYHD G 0 A_FireCustomMissile("DynamoM_HomingOrb",0,0,8,0)
DYHD G 0 A_TakeInventory("TeslaCoilAmmo",90)
DYHD G 5 A_TakeInventory("TeslaCoilAmmo",90,1)
DYHD G 0 A_JumpIfInventory("TeslaCoilAmmo",180,"OrbFireTime")
goto AltfireOrbE
AltfireOrbE:
DYHD GF 2
DYHD A 2
DYHD A 4
DYHD AAAAAAA 2 A_GiveInventory("DynamoStaminaFlag",31)
DYHD A 0 A_GiveInventory("DynamoStaminaFlag",500)
DYHD A 0 A_TakeInventory("DynamoCoolDownFlag",99)
goto Ready1

ItemRecharge:
DYHD A 0 A_GiveInventory("DynamoHealingWeakness",1)
DYHD A 0 A_GiveInventory("GuardDownFlag",1)
DYHD A 0 ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,true)
DYHD A 0 A_GiveInventory("DynamoCoolDownFlag",1)

DYHD A 0 A_GiveInventory("CBM_DisableJumpPowerGiver",1)
DYHD A 0 A_GiveInventory("DynamomanHealingSlow",1)
DYHD A 0 ACS_NamedExecuteWithResult("core_nogravityplayer",0,2)
DYHD A 0 A_SpawnItemEx("DynamoM_HealingStartFX",0,0,0,0,0,0,0,1)
DYHD A 2 Offset(5,46)
DYHD A 2 Offset(12,62)
DYHD A 2 Offset(21,80)
DYHD A 2 Offset(32,99)
DYHD A 2 Offset(45,119)
TNT1 A 1 A_GiveInventory("DynamoIsCharging",1)
TNT1 A 0 A_TakeInventory("DynamoCoolDownFlag")
TNT1 A 0 A_GunFlash("Flash.Healing",1)
Recharging:
TNT1 A 2 A_WeaponReady(WRF_NOSWITCH)
TNT1 A 0 A_JumpIfInventory("DynamoIsCharging",1,1)
goto EndCharge
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,3)
TNT1 A 1 A_WeaponReady(WRF_NOSWITCH)
TNT1 A 0 A_JumpIfInventory("DynamoIsCharging",1,1)
goto EndCharge
TNT1 A 0 A_GiveInventory("DynamoM_Healing_P")
//TNT1 A 0 A_JumpIf(Health>=1000,"EndCharge")
TNT1 A 0 A_JumpIfInventory("DynamoIsCharging",1,1)
goto EndCharge
TNT1 A 0 A_JumpIfInventory("DynamoHealAmmo",1,1)
goto EndCharge

TNT1 A 2 A_WeaponReady(WRF_NOSWITCH)
TNT1 A 0 A_JumpIfInventory("DynamoIsCharging",1,1)
goto EndCharge
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,3)
TNT1 A 1 A_WeaponReady(WRF_NOSWITCH)
TNT1 A 0 A_JumpIfInventory("DynamoIsCharging",1,1)
goto EndCharge
TNT1 A 0 A_GiveInventory("DynamoM_Healing_P2")
//TNT1 A 0 A_JumpIf(Health>=1000,"EndCharge")
TNT1 A 0 A_JumpIfInventory("DynamoIsCharging",1,1)
goto EndCharge
TNT1 A 0 A_JumpIfInventory("DynamoHealAmmo",1,"Recharging")
goto EndCharge

EndCharge:
TNT1 A 0 Offset(45,119)ACS_NamedExecuteWithResult("cbm_NoHitStunplayer",0,false)
TNT1 A 0 A_TakeInventory("DynamoHealingWeakness",99)
TNT1 A 0 A_TakeInventory("GuardDownFlag",99)

TNT1 A 0 A_TakeInventory("CBM_DisableJumpPower")
TNT1 A 0 A_TakeInventory("DynamomanHealingSlow")
TNT1 A 0 ACS_NamedExecuteWithResult("core_nogravityplayer",0,0)

//TNT1 A 0 //A_PlaySound("weapon/junkshield",1)
TNT1 A 0 A_SpawnItemEx("DynamoM_HealingEndFX",0,0,32,0,0,0,0,1)

TNT1 A 0 A_TakeInventory("DynamoItemFlag")
TNT1 A 0 A_TakeInventory("DynamoIsCharging")

DYHD A 0 A_GiveInventory("DynamoCoolDownFlag",1)
DYHD A 2 Offset(45,119)A_GunFlash("Flash",1)
DYHD A 2 Offset(40,105)
DYHD A 2 Offset(33,89)
DYHD A 2 Offset(24,71)
DYHD A 2 Offset(13,52)

DYHD A 0 A_TakeInventory("DynamoCoolDownFlag",99)
goto Ready1

BotFire:
TNT1 A 0 A_Jump(128,"AltFire")
goto Fire+2
BotFire2:
DYHD G 0 A_Jump(5,"FireLightning","AltfireOrb")
DYHD G 1 A_GiveInventory("TeslaCoilAmmo",4+CallACS("core_checkrune",RUNE_RAGE)*4)
DYHD G 0 A_TakeInventory("DynamoStaminaFlag",1)
DYHD G 0 A_JumpIfInventory("DynamoStaminaFlag",1,1)
goto FireLightning
DYHD G 0 A_ReFire("BotFire2")
goto FireLightning
}
}

actor TeslaCoilAmmo : Ammo
{
Inventory.Amount 1
Inventory.MaxAmount 720
+INVENTORY.IGNORESKILL
}

actor DynamoHealAmmo : Ammo
{
Inventory.Amount 1
Inventory.MaxAmount 50
+INVENTORY.IGNORESKILL
}

actor DynamoStaminaFlag : Inventory
{
inventory.amount 1
inventory.maxamount 500
}

actor DynamomanScanningSlow : PowerSpeed
{
Powerup.Duration 0x7FFFFFFC
Speed 0.75
+POWERSPEED.NOTRAIL
+INVENTORY.ALWAYSPICKUP
}
actor DynamomanHealingSlow : DynamomanScanningSlow
{
Speed 0.375
}

actor DynamoIsScanning :OnceC{}
actor DynamoItemFlag :OnceC{}
actor DynamoCoolDownFlag :OnceC{}
actor DynamoIsCharging :OnceC{}

actor DynamoM_TagEnd_F : Powerup
{
Powerup.Duration 8
}

actor DynamoHealingWeakness : BasePowerWeak
{
Powerup.Duration 0x7FFFFFFF
DamageFactor "Normal", 1.25
}

actor DynaTagCooldown : Powerup
{
Powerup.Duration 24
}

actor DynamoRecharger : BasicClassItem
{
inventory.icon "DYNCSI"
inventory.pickupmessage "Batteries not included."
Tag "Dynamo Recharger Trigger"
states
{
Spawn:
DYPJ [ 1
loop
UseCBM:
TNT1 A 0 A_JumpIfInventory("DynamoCoolDownFlag",1,"No")
TNT1 A 0 //A_JumpIfHealthLower(1000,"Use1")
TNT1 A 0 A_JumpIfInventory("DynamoHealAmmo",1,"Use2")
fail
Use1:
TNT1 A 0 A_JumpIfInventory("DynamoHealAmmo",1,"Use2")
fail
Use2:
TNT1 A 0 A_PlaySoundEX("item/ItemUseMM9","SoundSlot7")
TNT1 A 0 A_JumpIfInventory("DynamoIsCharging",1,"Use4")
TNT1 A 0 A_JumpIfInventory("DynamoHealAmmo",1,"Use3")
TNT1 A 0
fail
Use3:
TNT1 A 0 A_GiveInventory("DynamoItemFlag",1)
fail
Use4:
TNT1 A 0 A_TakeInventory("DynamoIsCharging")
TNT1 A 0 A_TakeInventory("DynamoItemFlag")
fail
}
}

actor DynamoM_Healing_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_TakeInventory("DynamoHealAmmo",1)
TNT1 A 0 A_GiveInventory("CBM_HealThing10_P")
TNT1 AAA 0 A_SpawnItemEx("DynamoM_HealFX",random(24,240),0,random(-64,16)+28,0,0,random(4,5),random(0,359),1)
TNT1 A 0 //A_JumpIfInventory("PlayerPropertyProsperity",1,2)
TNT1 A 0 A_RadiusGive("DynamoM_HealDischarge_P",240,2)//RGF_PLAYERS = 2|RGF_NOTARGET = 64
stop
TNT1 A 0 //A_RadiusGive("DynamoM_HealDischarge2_P",240,2)
stop
}
}
actor DynamoM_Healing_P2 : DynamoM_Healing_P
{
states
{
Pickup:
TNT1 A 0 A_TakeInventory("DynamoHealAmmo",1,1)
goto DynamoM_Healing_P::Pickup+1
}
}

actor DynamoM_HealDischarge_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("CBM_HealThing10_P")
stop
}
}

actor DynamoM_HealFX : BasicGraphicEffect
{
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_Jump(64,"Spawn3")
TNT1 A 0 A_Jump(128,"Spawn2")
goto Spawn1
Spawn1:
X_0C AAABBB 1 A_FadeOut(0.05)
loop
Spawn2:
X_0C CCCDDD 1 A_FadeOut(0.05)
loop
Spawn3:
X_0C EEEFFF 1 A_FadeOut(0.05)
loop
}
}

actor DynamoM_HealingStartFX : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_PlaySound("weapon/timestopper",4,1.0)
stop
}
}

actor DynamoM_HealingEndFX : BasicExplosion
{
Scale 3.5
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("BasicBoom5FX_4_210",0,0,0,0,0,0,0,1+16384)
stop
}
}

actor DynamoM_TaggerTracker_H : BasicHelper
{
var int user_Tagged[63];
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetArg(0,CallACS("core_gettarget")*-1)
TNT1 A 0 Thing_Remove(-6200+Args[0])
TNT1 A 0 Thing_ChangeTID(0,-6200+Args[0])
SpawnL:
TNT1 A 2 ACS_NamedExecuteAlways("cbm_DynamoScannerCheck",0)
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
//TNT1 A 0 A_JumpIfInTargetInventory("DynamoIsScanning",1,"SpawnL")
TNT1 A 0 A_JumpIfInTargetInventory("DynamoM_TagEnd_F",1,"SpawnL2")
loop
SpawnL2:
TNT1 A 10 ACS_NamedExecuteAlways("cbm_DynamoScannerCheck",0)
TNT1 A 2
TNT1 A 70//Delay for online??
stop
Death:
TNT1 A 4
stop
}
}

//TNT1 A 0 A_SpawnItemEx("LightningOrbTracer",0,0,0,(args[2]/62 + 1)*66,0,0,ACS_ExecuteWithResult(C_GET_USER_VAR,WEPANGLE_NUM)-angle+ACS_ExecuteWithResult(C_GET_USER_VAR,WEPANGLE2_NUM),1)
//TNT1 A 0 A_SpawnItemEx("LightningOrbTracer2",0,0,0,(args[2]/62 + 1)*33,0,0,ACS_ExecuteWithResult(C_GET_USER_VAR,WEPANGLE_NUM)-angle-ACS_ExecuteWithResult(C_GET_USER_VAR,WEPANGLE2_NUM)-4,1)
actor DynamoM_ScannerWarp : BasicHelper
{
+NOTIMEFREEZE
Radius 16
states
{
Spawn:
TNT1 A 0
//TNT1 A 0 A_SetArg(2,Args[2]+8)
TNT1 A 0 A_Warp(2,0,0,0,7+CallACS("core_checkrune",RUNE_RAGE,2)*2,4+8+256)
TNT1 A 0 A_SpawnItemEx("DynamoM_RealScanner",0,0,0,(CallACS("cbm_countinv_acs",802,2)/80 + 1)*66,0,0,angle,4)
TNT1 A 0 A_SpawnItemEx("DynamoM_RealScanner",0,0,0,(CallACS("cbm_countinv_acs",802,2)/80 + 1)*33,0,0,angle*-1-4,4)

TNT1 A 0 A_SpawnItemEx("DynamoM_ScannerLineStartFX",0,0,0,0,0,(CallACS("cbm_countinv_acs",802,2)/80 + 1)*2,angle,4)
TNT1 A 0 A_SpawnItemEx("DynamoM_ScannerLineStartFX",0,0,0,0,0,CallACS("cbm_countinv_acs",802,2)/80 + 1,angle*-1-4,4)

TNT1 A 1
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 A_JumpIfInTargetInventory("DynamoM_TagEnd_F",1,"Death")
loop
}
}

actor DynamoM_ScannerLineFX
{
+MISSILE
+NOBLOCKMAP
+NOGRAVITY
+NOTIMEFREEZE
+DONTSPLASH
+NOEXPLODEFLOOR
//+NOCLIP
+FORCEXYBILLBOARD
+THRUGHOST
+THRUACTORS//Can hit user
+FLOORHUGGER
+DONTBLAST
+DONTREFLECT
+CLIENTSIDEONLY
RenderStyle None
ReactionTime 1
Damage (0)
Radius 16
Height 48
Speed 100
Scale 2.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetPitch(pitch+1)
TNT1 A 0 A_JumpIf(pitch>=Args[0],2)//Death
TNT1 A 0 A_SpawnItemEx("DynamoM_ScannerLineFX",33,0,0,0,0,0,0,1+32+512+32768)
TNT1 A 0 A_SpawnItemEx("DynamoM_ScannerFX",0,0,z-floorz,0,0,0,0,1+32)
TNT1 A 1
stop
Death:
TNT1 A 0
TNT1 A 1 //A_SpawnItemEx("DynamoM_ScannerEndFX",0,0,12,0,0,0,0,1)
stop
}
}

actor DynamoM_ScannerLineStartFX : BasicExplosion//DynamoM_ScannerLineFX
{
RenderStyle None
//+THRUACTORS
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetArg(0,momz)
TNT1 A 2 A_SpawnItemEx("DynamoM_ScannerLineFX",40,0,0,0,0,0,0,1+32+32768)
stop
}
}

actor DynamoM_ScannerFX : BasicClientSide
{
+NOTIMEFREEZE
+FORCEXYBILLBOARD
+BRIGHT
RenderStyle Translucent
Alpha 0.90
States
{
Spawn:
DYHD K 0
DYHD K 0 A_Jump(256,1,2,3,4,5,6,7,8,9)
DYHD K 1
stop
DYHD L 1
stop
DYHD M 1
stop
DYHD N 1
stop
DYHD O 1
stop
DYHD P 1
stop
DYHD Q 1
stop
DYHD R 1
stop
DYHD S 1
stop
}
}

actor DynamoM_ScannerEndFX : BasicClientSide
{
+FORCEYBILLBOARD
+FORCEXYBILLBOARD
+BRIGHT
States
{
Spawn:
TNT1 A 0
//TNT1 A 1
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8)
DYPJ D 1
stop
DYPJ E 1
stop
DYPJ F 1
stop
DYPJ G 1
stop
DYPJ H 1
stop
DYPJ I 1
stop
DYPJ J 1
stop
DYPJ K 1
stop
}
}

actor DynamoM_RealScanner// : FastProjectile
{
PROJECTILE
Obituary "$OB_DYNAMOSCAN"
damagetype "DynamoM_Tag"
+DONTSPLASH
+NOTIMEFREEZE
+NOEXPLODEFLOOR
//+NOCLIP
+FORCEXYBILLBOARD
+THRUGHOST
+FLOORHUGGER
+DONTBLAST
+DONTREFLECT
//+NONETID
+HITTRACER
+SERVERSIDEONLY
RenderStyle None
ReactionTime 1
Damage (0)//1
Radius 16
Height 48//96
Speed 300
Scale 2.5
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_CountDown
wait

XDeathFX:
TNT1 A 0 A_GiveInventory("DynaTagCooldown",1,8)
TNT1 A 0 A_PlaySoundEx("classes/DynamoTag","Voice")
goto Death
XDeath:
TNT1 A 0 A_JumpIfInventory("DynaTagCooldown",1,"Death",8)
TNT1 A 0 A_JumpIf(CallACS("cbm_DynamoScannerHit")==1, "XDeathFX")
Death://cbm_DynamoScannerLineFX//cbm_drawdynamotrail
TNT1 A 0 //ACS_NamedExecuteAlways("cbm_DynamoScannerLineFX", 0, CallACS("core_gettarget"), CallACS("core_getptrteam",2))
TNT1 A 0 //A_SpawnItemEx("DynamoM_ScannerEndFX",0,0,16,0,0,0,0,1)
TNT1 A 3 A_SpawnItemEx("DynamoM_RealScannerFX")
stop
}
}
actor DynamoM_RealScannerFX : BasicExplosion//BasicHelper
{//Sync to clients
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("DynamoM_ScannerEndFX",0,0,16,0,0,0,0,1)
stop
}
}

actor DynamoM_ScannerKiller_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 Thing_Move(0,angle*256/360+1000,1)
TNT1 A 1 A_SpawnItemEx("DynamoM_ScannerKiller",0,0,20)
stop
}
}

actor DynamoM_ScannerKiller
{
PROJECTILE
Obituary "$OB_DYNAMOSCAN"
damagetype "DynamoM_Tag"
+DONTREFLECT
+DONTBLAST
RenderStyle None
damage (100)
speed 1
States
{
Spawn:
TNT1 A 1
stop
}
}

actor DynamoM_ScannerLBolt//Spawned via ACS
{
PROJECTILE
+DONTSPLASH
+NOEXPLODEFLOOR
//+FLOORHUGGER
+NOCLIP
+DONTBLAST
+DONTREFLECT
+THRUGHOST
+THRUACTORS
RenderStyle None
ReactionTime 1
Damage (0)
Speed 1
Radius 12//16
Height 16//56
Scale 2.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetArg(2,momz*8)//Player Num 1 to 64
TNT1 A 0 A_SetArg(1,angle*256/360-1)//Power
TNT1 A 0 A_Stop
TNT1 A 0 A_ChangeFlag("NOCLIP",0)
TNT1 A 0 A_ChangeFlag("FLOORHUGGER",1)
//Move actor at high speeds to Target Player
TNT1 AAAA 1 ACS_NamedExecuteWithResult("cbm_DynamoScannerMissile",0,Args[2]+1000)
TNT1 A 1 A_CountDown
wait

Death:
TNT1 A 0 //A_Log("DynamoM_ScannerLBolt IS DEAD!")
Crash:
XDeath:
TNT1 A 0 //Transfers the power, Args[1], to a new actor
TNT1 A 0 A_SpawnItemEx("DynamoM_SuperbLBolt",0,0,0,0,0,0,0,SXF_TRANSFERSPECIAL)//32768
stop
NoDeath:
TNT1 A 0
stop

}
}

actor DynamoM_HomingOrb : ProjSpawnFuncActor
{
PROJECTILE
damagetype "DynamoM_Orb"
Obituary "$OB_LIGHTNINGORB"
+DONTSEEKINVISIBLE
+SEEKERMISSILE
reactiontime 11
+FORCEXYBILLBOARD
+BRIGHT
damage (120)
Radius 8
Height 8
speed 24
scale 2.5
States
{
Spawn:
DYPJ DEFGHIJK 2 A_SeekerMissile(1,7,3,50,5)
DYPJ A 0 A_CountDown
loop
Death:
DYPJ L 0 A_SpawnItemEX("ElectrifyEffect")
DYPJ LMNOPQ 2 A_FadeOut(0.15)
stop
}
}

actor DynamoM_RisingOrbBall : ProjSpawnFuncActor
{
PROJECTILE
damagetype "DynamoM_Orb"
Obituary "%o learned that %k's balls are inert."
+DONTREFLECT
+FORCEXYBILLBOARD
+BRIGHT
reactiontime 2
damage (110+CallACS("core_checkrune",RUNE_SPREAD,2)*220)
Radius 8
Height 8
speed 0
scale 2.5
States
{
Spawn:
DYPJ DEFGHIJK 2
DYPJ A 0 A_CountDown
loop
Death:
TNT1 A 0 A_SpawnItemEX("ElectrifyEffect")
TNT1 A 0 A_Jump(256,1,2,3,4,5,6)
DYPJ LMNOPQLMNOPQ 2 A_FadeOut(0.2)
stop
}
}


actor DynamoM_LBoltThrow : ProjSpawnFuncActorFast
{
PROJECTILE
damagetype "DynamoM_Orb"
+RIPPER
+FORCEXYBILLBOARD
+BRIGHT
renderstyle translucent
alpha 0.8
reactiontime 20
damage (0)
Radius 8
Height 8
speed 96
scale 1.5
States
{
Spawn:
DYPJ DEFGHIJK 3
DYPJ D 0 A_CountDown
loop
Death:
TNT1 A 1 A_SpawnItemEx("DynamoM_LBoltSpawner",0,0,0,0,0,0,0,1)
stop
}
}

actor DynamoM_LBoltSpawner : BasicHelper
{
ReactionTime 12
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetArg(2,60-CallACS("core_checkrune",RUNE_SPREAD,2)*40)
goto SpawnFire
SpawnFire:
TNT1 A 1 A_SpawnItemEx("DynamoM_LBoltTracer1",cos(-pitch)*4,8,28+(sin(-pitch)*4),cos(-pitch)*60,0,sin(-pitch)*60,(12-ReactionTime)*30)
TNT1 A 0 A_SpawnItemEx("DynamoM_LBoltTracer2",cos(-pitch)*4,8,28+(sin(-pitch)*4),cos(-pitch)*60,0,sin(-pitch)*60,345-(12-ReactionTime)*30)
TNT1 A 0 A_TakeFromTarget("TeslaCoilAmmo",Args[2]/2)
TNT1 A 0 A_TakeFromTarget("TeslaCoilAmmo",Args[2]/2,1)
TNT1 A 0 A_CountDown
TNT1 A 0 A_JumpIfInTargetInventory("TeslaCoilAmmo",1,"SpawnFire")
TNT1 A 0
stop
}
}

actor DynamoM_LBoltStartFX1 : BasicGraphicEffect
{
+FORCEYBILLBOARD
+BRIGHT
States
{
SpawnFrame:
Q_BC BCD 3
stop
}
}

actor DynamoM_LBoltStartFX2 : BasicGraphicEffect
{
+BRIGHT
States
{
SpawnFrame:
Q_BC EFGHIJ 3
stop
}
}

actor DynamoM_LBoltTracer1
{
PROJECTILE
+DONTSPLASH
+NOEXPLODEFLOOR
+NOCLIP
+DONTBLAST
+DONTREFLECT
+FLOORHUGGER
Damage (0)
Radius 16
Height 96
Speed 60
Scale 2.5
states
{
Spawn:
TNT1 A 0
TNT1 A 0 //A_ChangeFlag("FLOORHUGGER",1)
TNT1 A 8 A_Changeflag("NOCLIP",0)
Goto XDeath
Death:
TNT1 A 0
stop
Crash:
XDeath:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("DynamoM_LBolt")
stop
}
}

actor DynamoM_LBoltTracer2 : DynamoM_LBoltTracer1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 //A_ChangeFlag("FLOORHUGGER",1)
TNT1 A 4 A_Changeflag("NOCLIP",0)
Goto XDeath
}
}

actor DynamoM_LBolt : ProjSpawnFuncActor
{
PROJECTILE
DamageType "DynamoM_Bolt"
Obituary "$OB_LIGHTNINGBOLT"
+THRUACTORS
+NOEXPLODEFLOOR
+FORCEYBILLBOARD
+FLOORHUGGER
+DONTBLAST
+BRIGHT
ReactionTime 1
Damage (0)
height 32
radius 16
scale 2.5
states
{
Spawn:
Q_BC N 0
Q_BC N 1 A_SpawnItemEx("DynamoM_LightningFX",0,0,355,0,0,0,0,1)
Q_BC N 0 A_PlaySoundEx("weapon/lightningbolt","Weapon")
Q_BC N 0 A_SpawnItemEX("ElectrifyEffect")
Q_BC N 0 A_Explode(100,128,0,0,8)
goto Spawn3
Spawn3:
Q_BC O 1
Q_BC P 0 A_SpawnItemEx("DynamoM_LBoltSpasmFX",Random(32,96),Random(32,96),32,0,0,0,0,1)
Q_BC P 0 A_SpawnItemEx("DynamoM_LBoltSpasmFX",Random(-32,-96),Random(-32,-96),64,0,0,0,0,1)
Q_BC P 0 A_SpawnItemEx("DynamoM_LBoltSpasmFX",Random(32,96),Random(32,96),96,0,0,0,0,1)
Q_BC P 0 A_SpawnItemEx("DynamoM_LBoltSpasmFX",Random(-32,-96),Random(-32,-96),128,0,0,0,0,1)
Q_BC P 0 A_SpawnItemEx("DynamoM_LBoltSpasmFX",Random(32,96),Random(32,96),160,0,0,0,0,1)
Q_BC P 0 A_SpawnItemEx("DynamoM_LBoltSpasmFX",Random(-32,-96),Random(-32,-96),192,0,0,0,0,1)
Q_BC PQR 1
stop
//Q_BC O 0 A_CountDown
//Q_BC N 1 A_SpawnItemEx("DynamoM_LightningFX",0,0,355,0,0,0,0,1)
//goto Spawn+3
}
}

actor DynamoM_LBoltSpasmFX : BasicGraphicEffect
{
+FORCEXYBILLBOARD
+BRIGHT
States
{
SpawnFrame:
Q_BC K 0
Q_BC K 0 A_ChangeVelocity(Random(-2,2),Random(-2,2),Random(-2,2),CVF_REPLACE)
Q_BC KLM 1
stop
}
}

actor DynamoM_SuperbLBolt : DynamoM_LBolt
{
DamageType "DynamoM_TaggedBolt"
Obituary "$OB_LIGHTNINGBOLTB"
+OLDRADIUSDMG
+DONTREFLECT
ReactionTime 1
states
{
Spawn:
Q_BC N 0
Q_BC N 1 A_SpawnItemEx("DynamoM_LightningFX",0,0,355,0,0,0,0,1)
Q_BC N 0 A_PlaySoundEx("weapon/lightningbolt","Weapon")
Q_BC N 0 A_SpawnItemEx("DynamoM_LBoltBoutadeFX_H",0,0,0,0,0,0,random(0,40),1+32768)//512
Q_BC N 0 A_SpawnItemEX("ElectrifyEffect")
//Damage is as follows: 150>300>450>600>650>700>750 and so on.
Q_BC N 0 A_Explode(((150+Args[1]*150)*(Args[1]<=3)+(Args[1]>3)*450+(Args[1]>3)*Args[1]*50)*(1+2*CallACS("core_checkrune",RUNE_SPREAD,2)),128+Args[1]*8,0,0,64+Args[1]*4)
Q_BC N 0 A_SpawnItemEx("DynamoM_LBoltStrikeFX",0,0,16,0,0,0,0,1)
goto Spawn3
}
}

Actor DynamoM_LightningFX : BasicGraphicEffect
{
+FORCEYBILLBOARD
+BRIGHT
States
{
SpawnFrame:
Q_BC S 0
Q_BC S 0 A_JumpIf(ceilingz-z <= 32,"Death")
Q_BC S 0 A_SpawnItemEx("DynamoM_LightningFX",0,0,160,0,0,0,0,1)
Q_BC SSTUV 1
stop
Death:
TNT1 A 0
stop
}
}

actor DynamoM_LBoltStrikeFX : BasicGraphicEffect
{
+FORCEXYBILLBOARD
+BRIGHT
States
{
SpawnFrame:
Q_BC DEFGHIJ 2
stop
}
}

actor DynamoM_LBoltBoutadeFX : BasicGraphicEffect
{
+FORCEXYBILLBOARD
+BRIGHT
Scale 2.0
States
{
SpawnFrame:
Q_BC K 0
Q_BC KKLLMM 1 A_ScaleVelocity(frandom(1.025,1.100))
stop
}
}

actor DynamoM_LBoltBoutadeFX_H : BasicClientSide
{
reactiontime 9
States
{
Spawn:
TNT1 A 0
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("DynamoM_LBoltBoutadeFX",random(20,40),0,random(-6,6),random(8,12),0,random(-4,4),ReactionTime*40+random(-9,9),1+4+32)
TNT1 A 0 A_JumpIf(Args[1]>1,2)//Pitch
TNT1 A 0 A_Countdown
loop
TNT1 A 0 A_SpawnItemEx("DynamoM_LBoltBoutadeFX",random(20,40),0,random(-6,6),random(8,12)+40,0,random(-4,4),ReactionTime*40+random(-9,9)+5,1+4+32)
TNT1 A 0 A_JumpIf(Args[1]>2,1)
goto Spawn+4
TNT1 A 0 A_SpawnItemEx("DynamoM_LBoltBoutadeFX",random(20,40),0,random(-6,6),random(8,12)+80,0,random(-4,4),ReactionTime*40+random(-9,9)+10,1+4+32)
TNT1 A 0 A_JumpIf(Args[1]>3,1)
goto Spawn+4
TNT1 A 0 A_SpawnItemEx("DynamoM_LBoltBoutadeFX",random(20,40),0,random(-6,6),random(8,12)+120,0,random(-4,4),ReactionTime*40+random(-9,9)+15,1+4+32)
goto Spawn+4
Death:
TNT1 A 0
stop
}
}


actor DynamoM_Dish : ProjSpawnFuncActor
{
PROJECTILE
damagetype "DynamoM_Dish"
Obituary "$OB_DYNAMODISH"
damage (100)
Radius 12
Height 8
speed 24
scale 2.5
States
{
Spawn:
DYPJ AB 6
Flying:
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZap"   ,0,0,0,momx/2+33*-sin(angle)    ,momy/2+33*cos(angle)    ,momz/2,-90,8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXC",0,0,0,momx/2+33*-sin(angle)    ,momy/2+33*cos(angle)    ,momz/2,-90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXB",0,0,0,momx/2+33*-sin(angle)*2/3,momy/2+33*cos(angle)*2/3,momz/2,-90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXA",0,0,0,momx/2+33*-sin(angle)/3  ,momy/2+33*cos(angle)/3  ,momz/2,-90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZap"   ,0,0,0,momx/2-33*-sin(angle)    ,momy/2-33*cos(angle)    ,momz/2,90,8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXC",0,0,0,momx/2-33*-sin(angle)    ,momy/2-33*cos(angle)    ,momz/2,90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXB",0,0,0,momx/2-33*-sin(angle)*2/3,momy/2-33*cos(angle)*2/3,momz/2,90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXA",0,0,0,momx/2-33*-sin(angle)/3  ,momy/2-33*cos(angle)/3  ,momz/2,90,1+8)
DYPJ C 1
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZap"   ,0,0,0,momx/2+33*-sin(angle)    ,momy/2+33*cos(angle)    ,momz/2,-90,8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXF",0,0,0,momx/2+33*-sin(angle)    ,momy/2+33*cos(angle)    ,momz/2,-90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXE",0,0,0,momx/2+33*-sin(angle)*2/3,momy/2+33*cos(angle)*2/3,momz/2,-90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXD",0,0,0,momx/2+33*-sin(angle)/3  ,momy/2+33*cos(angle)/3  ,momz/2,-90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZap"   ,0,0,0,momx/2-33*-sin(angle)    ,momy/2-33*cos(angle)    ,momz/2,90,8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXF",0,0,0,momx/2-33*-sin(angle)    ,momy/2-33*cos(angle)    ,momz/2,90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXE",0,0,0,momx/2-33*-sin(angle)*2/3,momy/2-33*cos(angle)*2/3,momz/2,90,1+8)
DYPJ C 0 A_SpawnItemEx("DynamoM_DishZapFXD",0,0,0,momx/2-33*-sin(angle)/3  ,momy/2-33*cos(angle)/3  ,momz/2,90,1+8)
DYPJ C 1
loop
Crash:
TNT1 A 1 A_SpawnItemEX("ElectrifyEffect")
stop
Death:
NMFX ABCD 3
stop
}
}

actor DynamoM_DishZap
{
PROJECTILE
damagetype "DynamoM_DishZap"
Obituary "$OB_DYNAMODISH"
+DONTREFLECT
+DONTBLAST
//+RIPPER
+SERVERSIDEONLY
damage (90)
Radius 6
Height 6
speed 24
States
{
Spawn:
TNT1 A 0
TNT1 A 1
stop
}
}

actor DynamoM_DishZapFX
{
damagetype "DynamoM_DishZap"
Obituary "$OB_DYNAMODISH"
+MISSILE
+NOGRAVITY
+THRUACTORS
+DONTREFLECT
+DONTBLAST
//+NONETID
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
+BRIGHT
damage 0
Radius 6
Height 6
speed 24
scale 1.5
}

actor DynamoM_DishZapFXA : DynamoM_DishZapFX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveInventory("MM8BDMProjSpawnFuncClient")
TNT1 A 0 A_SpawnItemEx("DynamoM_DishZapFXA2",0,0,0,0,0,0,0,1)
stop
}
}
actor DynamoM_DishZapFXA2 : DynamoM_DishZapFX
{
States
{
Spawn://DynamoTendril sprites
DYHD T 0
DYHD T 1
stop
}
}

actor DynamoM_DishZapFXB : DynamoM_DishZapFX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveInventory("MM8BDMProjSpawnFuncClient")
TNT1 A 0 A_SpawnItemEx("DynamoM_DishZapFXB2",0,0,0,0,0,0,0,1)
stop
}
}
actor DynamoM_DishZapFXB2 : DynamoM_DishZapFX
{
States
{
Spawn:
DYHD U 0
DYHD U 1
stop
}
}

actor DynamoM_DishZapFXC : DynamoM_DishZapFX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveInventory("MM8BDMProjSpawnFuncClient")
TNT1 A 0 A_SpawnItemEx("DynamoM_DishZapFXC2",0,0,0,0,0,0,0,1)
stop
}
}
actor DynamoM_DishZapFXC2 : DynamoM_DishZapFX
{
States
{
Spawn:
DYHD V 0
DYHD V 1
stop
}
}

actor DynamoM_DishZapFXD : DynamoM_DishZapFX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveInventory("MM8BDMProjSpawnFuncClient")
TNT1 A 0 A_SpawnItemEx("DynamoM_DishZapFXD2",0,0,0,0,0,0,0,1)
stop
}
}
actor DynamoM_DishZapFXD2 : DynamoM_DishZapFX
{
States
{
Spawn:
DYHD W 0
DYHD W 1
stop
}
}

actor DynamoM_DishZapFXE : DynamoM_DishZapFX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveInventory("MM8BDMProjSpawnFuncClient")
TNT1 A 0 A_SpawnItemEx("DynamoM_DishZapFXE2",0,0,0,0,0,0,0,1)
stop
}
}
actor DynamoM_DishZapFXE2 : DynamoM_DishZapFX
{
States
{
Spawn:
DYHD X 0
DYHD X 1
stop
}
}

actor DynamoM_DishZapFXF : DynamoM_DishZapFX
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveInventory("MM8BDMProjSpawnFuncClient")
TNT1 A 0 A_SpawnItemEx("DynamoM_DishZapFXF2",0,0,0,0,0,0,0,1)
stop
}
}
actor DynamoM_DishZapFXF2 : DynamoM_DishZapFX
{
States
{
Spawn:
DYHD Y 0
DYHD Y 1
stop
}
}




actor DynamoM_IsTagged : Powerup
{
Powerup.Duration 12
}
actor DynamoM_TagFXDelay : Powerup
{
Powerup.Duration 4
}

actor DynamoM_IsTagged_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("DynamoM_TagFXDelay",1,3)
TNT1 A 0 A_GiveInventory("DynamoM_TagFXDelay",1)
TNT1 A 0 A_GiveInventory("DynamoM_TagFX_P",1)
TNT1 A 0 A_GiveInventory("DynamoM_IsTagged",1)
stop
}
}
actor DynamoM_TagFX_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("DynamoM_TagFX",random(16,52),0,Random(16,48),0,0,0,random(0,359),0)
stop
}
}
actor DynamoM_TagFX : BasicGraphicEffect
{
Translation "192:192=96:96","198:198=240:240"
+FLOATBOB
Scale 1.0
States
{
Spawn:
DYPJ XYZ 2 bright A_Fadeout(0.1)
loop
}
}

actor Dynamoman_W_NormalBar : NormalBar {Args 93,229}
actor Dynamoman_W_SecondBar : SecondBar {Args 217,110}
actor Dynamoman_W_ScriptBar : ScriptBar {}