actor DangerWrapBoss : BaseMM8BDMWep_CBM
{
dropitem "DangerWrapWepCDropped"
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "$OB_DANGERWRAP"
weapon.ammotype "BursterAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_07 C 1
loop
Ready:
BURX A 0 ACS_ExecuteAlways(998,0,842)
BURX A 0 A_GunFlash
BURX A 0 A_JumpIfInventory("BursterAmmo",2,"Ready2")
BURX A 0 A_JumpIfInventory("BurstTrigger",1,"ReadyN")
BURX A 7 A_WeaponReady(WRF_NOFIRE)
BURX A 0 A_GiveInventory("BursterAmmo",2)
Goto Ready+2
ReadyN:
BURX A 1 A_WeaponReady(WRF_NOPRIMARY)
goto Ready+2
Ready2:
BURX A 0 A_JumpIfInventory("BursterAmmo",7,"Ready3")
BURX A 0 A_JumpIfInventory("BurstTrigger",1,"Ready2N")
BURX A 7 A_WeaponReady(WRF_NOSECONDARY)
BURX A 0 A_GiveInventory("BursterAmmo",2)
loop
Ready2N:
BURX A 1 A_WeaponReady
goto Ready2
Ready3:
BURX A 0 A_JumpIfInventory("BurstTrigger",1,"Ready3N")
BURX A 7 A_WeaponReady
BURX A 0 A_GiveInventory("BursterAmmo",2)
loop
Ready3N:
BURX A 1 A_WeaponReady
goto Ready3
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
BURX A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
BURX A 1 A_Raise
Loop
Fire:
BURX A 0 A_JumpIfNoAmmo("NoAmmo")
BURX A 0 A_PlaySoundEx("weapon/wrapfire","Weapon")
BURX A 0 A_GiveInventory("BurstmanMain_CI",1)
BURX BC 6
BURX A 13
BURX A 0 A_Refire
Goto Ready+2
Altfire:
BURX A 0 A_JumpIfInventory("DangerFly",1,"Pop")
//BURX A 0 A_JumpIfInventory("SpawningMisfire",1,"Pop2")
BURX A 0 A_JumpIfInventory("BursterAmmo",7,"Bubbles2")
goto Ready+2
Bubbles2:
BURX A 0 A_TakeInventory("BursterAmmo",7)
BURX A 0 A_GiveInventory("BurstmanAlt_CI",1)
BURX A 2 offset(0,42)
BURX A 2 offset(0,52)
BURX A 2 offset(0,62)
BURX A 2 offset(0,72)
BURX A 2 offset(0,62)
BURX A 2 offset(0,52)
BURX A 2 offset(0,42)
goto Ready+2
/*Pop:
BURX A 0 A_TakeInventory("DangerFly",999)
BURX A 0 A_GiveInventory("SpawningMisfire",1)
Pop2:
BURX D 1
BURX A 0 A_Refire
BURX A 0 A_TakeInventory("SpawningMisfire",999)
goto Ready+2*/
Pop:
BURX D 10 A_TakeInventory("DangerFly",999)
goto Ready+2
NoAmmo:
BURX A 0
//BURX A 1 ACS_Execute(979,0)
Goto Ready+2
Flash:
TNT1 A 1 ACS_ExecuteAlways(191,0,0)
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("DangerFly", 1, "Fly")
loop
Fly:
TNT1 A 0 A_GiveInventory("BurstTrigger",1)
goto Fly2+1
Fly2:
TNT1 A 1 ACS_ExecuteAlways(191,0,9)
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 0 ThrustThingz(0,10,0,0)
TNT1 A 0 A_SpawnItemEx("DangerTrappedFX",0,0,0,momx,momy,momz,0,8,0)
TNT1 A 0 A_TakeInventory("DangerFly",1)
TNT1 A 0 A_JumpIfInventory("IsDead",1,2)
TNT1 A 0 A_JumpIfInventory("DangerFly", 1, "Fly2")
TNT1 A 0 A_SpawnItemEx("DangerTrappedFXPOP",0,0,-32,momx,momy,momz,0,8,0)
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
GetGround:
TNT1 A 1 ACS_ExecuteAlways(191,0,0)
TNT1 A 0 A_JumpIfInventory("DangerFly",1,"Fly")
TNT1 A 0 A_JumpIf(z-floorz==0, "CanFlyAgain")
TNT1 A 0 A_JumpIf(momz==0, "momzverify")
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
loop
momzverify:
TNT1 A 1 ACS_ExecuteAlways(191,0,0)
TNT1 A 0 A_JumpIfInventory("DangerFly",1,"Fly")
TNT1 A 0 A_JumpIf(z-floorz==0, "CanFlyAgain")
TNT1 A 0 A_JumpIf(momz==0, "CanFlyAgain")
goto GetGround
CanFlyAgain:
TNT1 A 0 A_TakeInventory("BurstTrigger",999)
goto Flash
NoFlash:
TNT1 A 0
stop
}
}

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

actor DangerWarp
{
Translation "192:192=218:218","198:198=73:73","202:202=210:210"
PROJECTILE
+SKYEXPLODE
Radius 16
Height 10
scale 2.5
Speed 20
States
{
Spawn:
DWAR A 0
DWAR AB 5
DWAR AC 5 ThrustThingZ(0,2,0,1)
DWAR ABAC 5 ThrustThingZ(0,2,0,1)
Goto Spawn+5


Death:
BMBU C 2 A_ChangeFlag("NOGRAVITY",0)
BMBU C 1 A_JumpIf(z-floorz==0,"SpawnMine")
NoMine:
DWAR GGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHHGGGHHH 1 A_JumpIf(z-floorz==0,"XXDeath")
Crash:
XDeath:
TNT1 A 0 A_Stop
TNT1 A 0 A_SpawnItemEx("WrapExplosionBoss",0,0,0,0,0,0,0,1)
BMBU C 2
stop
XXDeath:
TNT1 A 0 A_Stop
TNT1 A 0 A_SpawnItemEx("WrapExplosionBoss",0,0,0,0,0,0,0,1)
stop
SpawnMine:
TNT1 A 0 A_Stop
TNT1 A 1 A_SpawnItemEx("DangerWarpMine",0,0,0,0,0,0,0,1)
stop
}
}

actor DangerWarpB : DangerWarp{translation "192:192=205:205","198:198=74:74","202:202=205:205"}
actor DangerWarpR : DangerWarp{translation "192:192=171:171","198:198=41:41","202:202=171:171"}
actor DangerWarpO : DangerWarp{translation "192:192=104:104","198:198=128:128","202:202=104:104"}
actor DangerWarpP : DangerWarp{translation "192:192=229:229","198:198=232:232","202:202=229:229"}

//Copy of Vanilla
actor DangerWarpMine
{
PROJECTILE
+NOCLIP
-NOGRAVITY
Radius 32
Height 12
scale 2.5
damage (2)//1
damagetype "DangerWrap"
Obituary "$OB_DANGERWRAP"
speed 0
reactiontime 6//200
States
{
Spawn:
DWAR D 0
DWAR D 3
DWAR E 2 
DWAR E 1 A_ChangeFlag("NOCLIP",0)
Goto Mine
Mine:
DWAR G 0 A_CountDown
DWAR DDDEEE 1
loop
Death:
TNT1 A 0 A_Stop
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_PlaySoundEx("weapon/BurstExplode", "Weapon")
TNT1 D 0 A_Explode(33,128,0)
TN_B EFGHIJKLMNOPQRS 1
stop
}
}

actor WrapExplosionBoss : WrapExplosion
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/BurstExplode", "Weapon")
TNT1 D 0 A_Explode(30,128,0)
TN_B EFGHIJKLMNOPQRS 1
stop
}
}

actor DangerBubbleSpawner : FastProjectile
{
Translation "192:192=218:218"
//radius 8
//height 16
radius 32
height 32
speed 1000
//+RIPPER
+DONTBLAST
+THRUGHOST
+SKYEXPLODE
+DONTREFLECT
damage (0)
States
{
Spawn:
TNT1 A 1
loop
Death:
TNT1 A 0 A_JumpIf(z-floorz<31, "Floor")
TNT1 A 0 A_SpawnItemEx("DangerTrap",0,0,0,0,0,0,0,1)
stop
Floor:
TNT1 A 0 A_SpawnItemEx("DangerTrap",0,0,0,0,0,0,0,1)
stop
Crash:
XDeath:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("DangerTrap",24,0,0,0,0,0,0,1)
stop
}
}

actor DangerBubbleSpawnerB : DangerBubbleSpawner{translation "192:192=205:205","198:198=74:74"}
actor DangerBubbleSpawnerR : DangerBubbleSpawner{translation "192:192=171:171","198:198=41:41"}
actor DangerBubbleSpawnerO : DangerBubbleSpawner{translation "192:192=104:104","198:198=128:128"}
actor DangerBubbleSpawnerP : DangerBubbleSpawner{translation "192:192=229:229","198:198=232:232"}

actor DangerTrap
{
PROJECTILE
radius 32
height 32
scale 2.0
+FORCEYBILLBOARD
Obituary "$OB_DANGERTRAP"
damagetype "DangerTrap"
damage (0)

//+NOINTERACTION
+DONTBLAST
+RIPPER
+FLOORHUGGER
States
{
Spawn:
BMBU A 0
TNT1 A 0 A_PlaySound("weapon/BurstBubAppear",5,1.0)
TNT1 A 1 A_JumpIfCloser(16,"Fly")
BMBU AAAAAA 1 A_JumpIfCloser(16,"Fly")
TNT1 A 0 A_SpawnItemEx("DangerTrap0",0,0,0,0,0,0,0,1)
stop
Death:
BMBU C 3
stop
Fly:
TNT1 A 1 A_GiveToTarget("DangerFly",105)
stop
}
}

actor DangerTrap0 : DangerTrap
{
-FLOORHUGGER

scale 2.5
radius 32
height 32
States
{
Spawn:
BMBU A 0
BMBU A 0 ThrustThingZ(0,11,0,0)
BMBU AAAAAA 1 A_JumpIfCloser(20,"Fly")
TNT1 A 0 A_SpawnItemEx("DangerTrap1",0,0,0,0,0,0,0,1)
stop
}
}

actor DangerTrap1 : DangerTrap0
{
//-NOINTERACTION
-RIPPER
damage (10)

scale 3.0
radius 32
height 32
States
{
Spawn:
BMBU A 0
BMBU A 0 ThrustThingZ(0,9,0,0)
BMBU AAAAAA 1 A_JumpIfCloser(24,"Fly")
TNT1 A 0 A_SpawnItemEx("DangerTrap2",0,0,0,0,0,0,0,1)
stop
}
}

actor DangerTrap2 : DangerTrap1
{
scale 3.5
radius 32
height 32
States
{
Spawn:
BMBU A 0
BMBU A 0 ThrustThingZ(0,7,0,0)
BMBU AAAAAA 1 A_JumpIfCloser(28,"Fly")
TNT1 A 0 A_SpawnItemEx("DangerTrap3",0,0,0,0,0,0,0,1)
stop
}
}

actor DangerTrap3 : DangerTrap2
{
scale 4.0
radius 32
height 32
States
{
Spawn:
BMBU A 0
BMBU A 0 ThrustThingZ(0,5,0,0)
BMBU AAAAAA 1 A_JumpIfCloser(32,"Fly")
TNT1 A 0 A_SpawnItemEx("DangerTrap4",0,0,0,0,0,0,0,1)
stop
}
}

actor DangerTrap4 : DangerTrap3
{
scale 4.5
radius 32
height 36
States
{
Spawn:
BMBU A 0
BMBU A 0 ThrustThingZ(0,3,0,0)
BMBU AAAAAA 1 A_JumpIfCloser(36,"Fly")
TNT1 A 0 A_SpawnItemEx("DangerTrap5",0,0,0,0,0,0,0,1)
stop
}
}

actor DangerTrap5 : DangerTrap4
{
scale 5.0
radius 32
height 40
States
{
Spawn:
BMBU A 0
Spawn2:
BMBU A 0 ThrustThingZ(0,1,0,1)
BMBU A 1 A_JumpIfCloser(40,"Fly")
loop
}
}

actor DangerTrapped
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
reactiontime 50
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("DangerTrapRecover",1,"Death")
TNT1 A 0 A_GiveToTarget("DangerTrapRecover",1)
TNT1 A 1 A_GiveToTarget("DangerTrappedRise",1)
TNT1 A 0 A_TakeFromTarget("EndBossFlashStoppered",1)
TNT1 A 0 A_CountDown
goto Spawn2
Spawn2:
TNT1 A 0 A_JumpIfInTargetInventory("EndBossFlashStoppered",1,"Death")
TNT1 A 1 A_GiveToTarget("DangerTrappedRise",1)
TNT1 A 0 A_CountDown
loop
Death:
TNT1 A 1 A_GiveToTarget("DangerTrappedPop",1)
stop
}
}

actor DangerTrappedRise : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_ChangeVelocity(0,0,2,CVF_REPLACE)
TNT1 A 0 A_SpawnItemEx("DangerTrappedFX", 0, 0, 0, momx, momy, momz, 0, 8, 0)
stop
}
}

actor DangerTrappedPop : DangerTrappedRise
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("DangerTrappedFXPOP", 0, 0, -32, momx, momy, momz, 0, 8, 0)
stop
}
}

actor DangerTrappedFX : BasicClientSide
{
+NOTIMEFREEZE
States
{
Spawn:
BMBU D 0
BMBU D 1
stop
}
}

actor DangerTrappedFXPop : DangerTrappedFX
{
scale 5.0
States
{
Spawn:
BMBU E 0
BMBU E 1 A_PlaySoundEx("classes/burstpop","Weapon")
stop
}
}

actor DangerTrapRecover : PowerDamage
{
powerup.duration 90
damagefactor "normal", 1.0
}
/*
actor DangerFly : PowerSpeed
{
Speed 1.5
Powerup.Duration 105
}
*/
actor BurstTrigger : OnceC{}

actor DangerFly : Inventory
{
inventory.amount 1
inventory.maxamount 105
}


actor BurstmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("DangerWarp",0,1,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("DangerWarpB",0,1,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("DangerWarpR",0,1,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("DangerWarpO",0,1,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("DangerWarpP",0,1,-8,0)
goto Done
}
}

actor BurstmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("DangerBubbleSpawner",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("DangerBubbleSpawnerB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("DangerBubbleSpawnerR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("DangerBubbleSpawnerO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("DangerBubbleSpawnerP",0,0,0,0)
goto Done
}
}
