actor LeafShieldBoss : BaseMM8BDMWep_CBM
{
dropitem "LeafShieldWepCDropped"
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_LEAFSHIELD"
weapon.ammotype "IncredibleAmmo"
weapon.ammouse 1
States
{
Spawn:
C_02 H 1
loop
Ready:
WOOA A 0 ACS_ExecuteAlways(998,0,747)
WOOA A 0 A_ClearRefire
WOOA A 0 A_JumpIfInventory("IncredibleAmmo",21,"Ready2")
WOOA A 4 A_WeaponReady(WRF_NOPRIMARY)
WOOA A 0 A_GiveInventory("IncredibleAmmo",2)
Goto Ready+2
Ready2:
WOOA A 4 A_WeaponReady
WOOA A 0 A_GiveInventory("IncredibleAmmo",2)
loop
Deselect:
WOOA A 0 A_JumpIfInventory("ShieldCheck",1,24)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
WOOA A 1 A_Lower
Goto Deselect+1
WOOA A 0
WOOA A 0 A_ChangeFlag("INVULNERABLE",0)
WOOA A 0 A_TakeInventory("ShieldCheck",1)
WOOA A 0 A_FireCustomMissile("LeafShieldThrowBoss",0,0,0,0)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
Goto Deselect+1
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
WOOA A 1 A_Raise
Loop
Fire:
WOOA A 0 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
WOOA A 0 A_JumpIfInventory("IncredibleAmmo",21,"Fire2")
goto Ready+1
Fire2:
WOOA A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
WOOA A 0 A_GiveInventory("ShieldCheck",1)
WOOA BCDEF 2
WOOA GH 2
WOOA A 0 A_ChangeFlag("INVULNERABLE",1)
WOOA A 0 A_GiveInventory("IsInvunFlag",1)
WOOA A 0 A_PlaySound("weapon/leafshield",1,1.0)
WOOA AA 1 A_SpawnItemEx("LeafShield1Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA AA 1 A_SpawnItemEx("LeafShield2Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 0 A_PlaySound("weapon/leafshield",1,1.0)
WOOA AA 1 A_SpawnItemEx("LeafShield3Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA AA 1 A_SpawnItemEx("LeafShield4Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 0 A_GunFlash
Goto Shield
Hold:
WOOA A 1
goto Ready+1
Shield:
WOOA A 1 A_WeaponReady
WOOA A 0 A_PlaySound("weapon/leafshield",1,1.0)
WOOA A 0 A_SpawnItemEx("LeafShield1Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 1 A_WeaponReady
WOOA A 0 A_SpawnItemEx("LeafShield1Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 0 A_TakeInventory("IncredibleAmmo",1)
WOOA A 0 A_JumpIfNoAmmo("ShieldThrow")
WOOA A 1 A_WeaponReady
WOOA A 0 A_SpawnItemEx("LeafShield2Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 1 A_WeaponReady
WOOA A 0 A_SpawnItemEx("LeafShield2Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 0 A_TakeInventory("IncredibleAmmo",1)
WOOA A 0 A_JumpIfNoAmmo("ShieldThrow")
WOOA A 1 A_WeaponReady
WOOA A 0 A_PlaySound("weapon/leafshield",1,1.0)
WOOA A 0 A_SpawnItemEx("LeafShield3Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 1 A_WeaponReady
WOOA A 0 A_SpawnItemEx("LeafShield3Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 0 A_TakeInventory("IncredibleAmmo",1)
WOOA A 0 A_JumpIfNoAmmo("ShieldThrow")
WOOA A 1 A_WeaponReady
WOOA A 0 A_SpawnItemEx("LeafShield4Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 1 A_WeaponReady
WOOA A 0 A_SpawnItemEx("LeafShield4Boss",0,0,32,momx,momy,momz,0,9,0)
WOOA A 0 A_TakeInventory("IncredibleAmmo",1)
WOOA A 0 A_JumpIfNoAmmo("ShieldThrow")
loop
ShieldThrow:
WOOA A 0 A_TakeInventory("LeafCounter",999)
WOOA A 0 A_TakeInventory("ShieldCheck",999)
WOOA A 0 A_TakeInventory("IsInvunFlag",999)
WOOA A 0 A_ChangeFlag("INVULNERABLE",0)
//WOOA A 0 A_TakeInventory("INCREDIBLEAMMO",2)
WOOA A 0 A_GiveInventory("WoodmanMain_CI",1)
WOOA FEDCB 3
WOOA G 0 A_TakeInventory("LeafCounter",999)
WOOA GH 2
WOOA A 15
goto Ready+1
Altfire:
WOOA A 0 A_JumpIfInventory("WoodSlamFlag",1,1)
goto SlamEnd2
WOOA A 1 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
WOOA A 0
WOOA A 0 A_GiveInventory("StunArmor",1)
WOOA A 0 A_TakeInventory("WoodSlamFlag",999)
WOOA A 0 A_TakeInventory("WoodSlamTimer",999)
WOOA A 0 ACS_ExecuteAlways(648,0,1)
WOOA A 0 A_PlayWeaponSound("weapon/WoodLeap")
WOOA A 0 A_Recoil(-15)
WOOA A 0 ThrustThingZ(0,30,0,1)

Slam1:
WOOA B 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA B 0 A_JumpIf(z-floorz==0,"SlamEnd2")
WOOA B 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA B 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA B 0 A_JumpIf(z-floorz==0,"SlamEnd2")
WOOA B 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA C 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA C 0 A_JumpIf(z-floorz==0,"SlamEnd2")
WOOA C 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA C 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA C 0 A_JumpIf(z-floorz==0,"SlamEnd2")
WOOA C 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA D 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA D 0 A_JumpIf(z-floorz==0,"SlamEnd2")
WOOA D 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA D 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA D 0 A_JumpIf(z-floorz==0,"SlamEnd")
WOOA D 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA E 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA E 0 A_JumpIf(z-floorz==0,"SlamEnd")
WOOA E 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA E 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA E 0 A_JumpIf(z-floorz==0,"SlamEnd")
WOOA E 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA F 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA F 0 A_JumpIf(z-floorz==0,"SlamEnd")
WOOA F 0 A_JumpIfInventory ("WoodSlamFlag",1,"SlamEnd")
WOOA F 0
Slam2:
WOOA F 0 A_GiveInventory("WoodSlamTimer",1)
WOOA F 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA F 0 A_JumpIf(z-floorz==0,"SlamEnd")
WOOA F 0 A_JumpIfInventory("WoodSlamFlag",1,"SlamEnd")
WOOA F 0 A_JumpIf(momz<=0,"Slam3")
WOOA F 0 A_JumpIfInventory("WoodSlamTimer",50,"Slam2Cancel")
goto Slam2
Slam2Cancel:
WOOA F 0 A_WeaponReady(6)
goto Slam2
Slam3:
WOOA F 0 A_GiveInventory("WoodSlamTimer",1)
WOOA F 1 A_SpawnItemEX("WoodSlamCheck",0,0,-8,momx,momy,momz,0,8,0)
WOOA F 0 A_JumpIf(z-floorz==0,"SlamEnd")
WOOA F 0 A_JumpIfInventory("WoodSlamFlag",1,"SlamEnd")
WOOA F 0 A_JumpIf(momz>=0,"SlamEnd")
WOOA F 0 A_JumpIfInventory("WoodSlamTimer",50,"Slam3Cancel")
loop
Slam3Cancel:
WOOA F 0 A_WeaponReady(6)
goto Slam3
SlamEnd:
TNT1 A 0 A_TakeInventory("StunArmor",999)
TNT1 A 0 A_GiveInventory("WoodSlamFlag",1)
TNT1 A 0 SetPlayerProperty(0,1,0)
TNT1 A 0 A_PlaySoundEx("weapon/WoodSlam","Weapon")
TNT1 A 8 A_FireCustomMissile("WoodSlam",0,0,0,0)
TNT1 A 0 ACS_ExecuteAlways(648,0,0)
TNT1 A 0 SetPlayerProperty(0,0,0)
WOOA GGHHAAAA 2 A_GiveInventory("IncredibleAmmo",1)
goto Ready+1
SlamEnd2:
WOOA A 0 A_TakeInventory("StunArmor",999)
WOOA A 0 A_GiveInventory("WoodSlamFlag",1)
TNT1 AA 2 A_GiveInventory("IncredibleAmmo",1)
TNT1 A 0 ACS_ExecuteAlways(648,0,0)
TNT1 A 0
WOOA GHAAA 2 A_GiveInventory("IncredibleAmmo",1)
goto Ready+1
NoAmmo:
WOOA A 0 A_JumpIfInventory("ShieldCheck",1,"ShieldThrow")
goto Ready+1
Flash:
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_JumpIfInventory("LeafCounter",25,4)
TNT1 A 1 A_SpawnItemEx("LeafCounterDude",0,0,0,momx,momy,momz,0,8,0)
TNT1 A 0 A_JumpIfInventory("ShieldCheck",1,"Flash")
TNT1 A 0 A_TakeInventory("LeafCounter",99)
stop
TNT1 A 0 A_GiveInventory("LeafCounterX",1)
TNT1 A 0 A_PlaySound("weapon/leafcounter",7,1.0)
TNT1 A 5 A_SpawnItemEx("LeafRise",0,0,0,0,0,20,0,9,0)
TNT1 A 5 A_SpawnItemEx("LeafRise",0,0,0,0,0,20,0,9,0)
TNT1 A 5 A_SpawnItemEx("LeafRise",0,0,0,0,0,20,0,9,0)
TNT1 A 5 A_SpawnItemEx("LeafRise",0,0,0,0,0,20,0,9,0)
TNT1 A 0 A_TakeInventory("LeafCounterX",99)
TNT1 A 0 A_TakeInventory("LeafCounter",99999)
TNT1 A 0 A_GiveInventory("WoodmanOther_CI",1)
TNT1 A 0 A_JumpIfInventory("ShieldCheck",1,"Flash")
TNT1 A 0 A_TakeInventory("LeafCounter",99)
stop
}
}

actor IncredibleAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 84
+INVENTORY.IGNORESKILL
}


actor Leaf
{
PROJECTILE
Obituary "$OB_LEAFSHIELD"
damagetype "LeafShield"
+NOGRAVITY
Damage (20)
Radius 8
Height 8
speed 28
Scale 2.5
States
{
Spawn:
LEAF XYZWXYZW 5
loop
}
}

actor LeafShield1Boss
{
Translation "199:199=104:104"
-SOLID
+NOGRAVITY
//+DONTBLAST
+NOINTERACTION
//+CLIENTSIDEONLY
//+NONETID
+NOTIMEFREEZE
scale 2.5
States
{
Spawn:
LEAF P 0
LEAF P 1
stop
}
}
actor LeafShield2Boss : LeafShield1Boss
{
States
{
Spawn:
LEAF Q 0
LEAF Q 1
stop
}
}
actor LeafShield3Boss : LeafShield1Boss
{
States
{
Spawn:
LEAF R 0
LEAF R 1
stop
}
}
actor LeafShield4Boss : LeafShield1Boss
{
States
{
Spawn:
LEAF S 0
LEAF S 1
stop
}
}

actor LeafRise
{
Translation "199:199=104:104"
PROJECTILE
+CLIENTSIDEONLY
+DONTBLAST
Damage (0)
Height 7
Radius 7
Speed 0
scale 2.5
States
{
Spawn:
LEAF XYZW 3
stop
}
}

actor LeafRiseSound : LeafRise
{
States
{
Spawn:
LEAF X 0
LEAF X 3 A_PlaySoundEx("weapon/leafcounter","Weapon")
LEAF YZW 3
stop
}
}

actor LeafShieldThrowBoss : LeafShield
{
Translation "199:199=104:104"
+THRUGHOST
speed 28
damage (35)
-RIPPER
States
{
Spawn:
LEAF P 1
LEAF P 1 A_ChangeFlag("THRUGHOST",0)
LEAF QRSP 2
goto Spawn+2
}
}

actor LeafShieldThrowBossB : LeafShieldThrowBoss{translation "199:199=74:74"}
actor LeafShieldThrowBossR : LeafShieldThrowBoss{translation "199:199=41:41"}
actor LeafShieldThrowBossO : LeafShieldThrowBoss{translation "199:199=128:128"}
actor LeafShieldThrowBossP : LeafShieldThrowBoss{translation "199:199=232:232"}

actor LeafCounterDude
{
+SHOOTABLE
+NOTARGETSWITCH
-SOLID
+DONTRIP
+GHOST
renderstyle "none"
damagefactor "LeafFall", 0.0
painchance 256
health 99999
radius 40
height 58
scale 2.5
States
{
Spawn:
PLAY A 0
PLAY A 1
stop
Pain:
PLAY A 0 A_JumpIfInTargetInventory("LeafCounterX",1,2)
PLAY A 1 A_GiveToTarget("LeafCounter",99999-health)
PLAY A 1
stop
}
}

actor LeafCounterX : OnceC{}
actor LeafCounter : Inventory
{
inventory.amount 1
inventory.maxamount 25
}

actor WoodSlamFlag : OnceC{}
actor WoodSlamTimer : Inventory
{
inventory.amount 1
inventory.maxamount 999
}

actor LeafFallerSpawner
{
Translation "199:199=104:104"
PROJECTILE
+NOINTERACTION
height 1
radius 1
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("LeafFaller",0,25,0,13,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("LeafFaller",0,75,0,13,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("LeafFaller",0,-25,0,13,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("LeafFaller",0,-75,0,13,0,0,0,1)
stop
}
}

actor LeafFallerSpawnerB : LeafFallerSpawner{translation "199:199=74:74"}
actor LeafFallerSpawnerR : LeafFallerSpawner{translation "199:199=41:41"}
actor LeafFallerSpawnerO : LeafFallerSpawner{translation "199:199=128:128"}
actor LeafFallerSpawnerP : LeafFallerSpawner{translation "199:199=232:232"}

actor LeafFaller
{
PROJECTILE
+FLOORHUGGER
//+NOCLIP
+RIPPER
+THRUGHOST
//+NOINTERACTION
+DONTBLAST
+DONTREFLECT
//+NOTARGETSWITCH
//maxstepheight 0
Damage (0)
Height 8
Radius 8
speed 13
States
{
Spawn:
TNT1 A 0
TNT1 A 4 A_SpawnItemEx("LeafFall",0,0,100,0,0,-5,0,1)
loop
Death:
TNT1 A 0
Stop
}
}

actor LeafFall
{
PROJECTILE
Obituary "$OB_LEAFRAIN"
damagetype "LeafFall"
-NOGRAVITY
+DONTBLAST
+NOCLIP
Gravity 0.4
Damage (20)
Radius 8
Height 8
speed 0
Scale 2.5
States
{
Spawn:
LEAF X 0
LEAF X 5 A_ChangeFlag("NOCLIP", 0)
LEAF X 0 A_JumpIf(momz==0,"Death")
LEAF YZWX 5
goto spawn+2
Death:
TNT1 A 0
Stop
}
}

actor LeafFallProtect : PowerProtection
{
Powerup.Duration 12
DamageFactor "LeafFall", 0.25
}

actor WoodSlamCheck
{
PROJECTILE
Damagetype "ClassPain"
Obituary "$OB_WOODSLAM"
+NOGRAVITY
+SKYEXPLODE
+DONTSPLASH
+DONTBLAST
+THRUGHOST
+DONTREFLECT
damage (0)
Radius 62
Height 72
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 0
stop
XDeath:
TNT1 A 0 A_GiveToTarget("WoodSlamFlag",1)
TNT1 A 0
Stop
Death:
TNT1 A 0
Stop
}
}

actor WoodSlam : BasicExplosion
{
//damagetype "LeafShield"
Damagetype "ClassPain"
Obituary "$OB_WOODSLAM"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(35,168,0,0,8)
stop
}
}


actor WoodmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("LeafShieldThrowBoss",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("LeafShieldThrowBossB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("LeafShieldThrowBossR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("LeafShieldThrowBossO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("LeafShieldThrowBossP",0,0,0,0)
goto Done
Done:
TNT1 A 0 A_TakeInventory("INCREDIBLEAMMO",1)
stop
}
}

actor WoodmanOther_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("LeafFallerSpawner",0,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("LeafFallerSpawnerB",0,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("LeafFallerSpawnerR",0,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("LeafFallerSpawnerO",0,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("LeafFallerSpawnerP",0,0,0,0)
goto Done
}
}

