// Weapon //

actor ScroogeBossWeapon : MegaBuster
{
tag "Old Cane"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 2
Obituary "$OB_SCROOGECANE"
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpChargeH"
weapon.ammotype2 "BossRageCharge"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
SXH4 O 0 ACS_NamedExecuteAlways("GiveExecution",0)
AKUN S 0 //ACS_ExecuteAlways(991,0,DYE_SCROOGE)
SXH4 O 1 A_WeaponReady
Goto Ready+1
Ready2:
TNT1 A 0 ACS_NamedExecute("StateChange",0,3)
SXH4 W 0 A_SpawnItemEX("CaneCrash",0,0,-10,0,0,momz)
SXH4 W 1 A_WeaponReady(WRF_NOSWITCH|WRF_NOprimary)
SXH4 W 0 A_JumpIfInventory("WeaponCharge",1,"Ready2")
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SXH4 O 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SXH4 O 1 A_Raise
Loop
Fire:
SXH4 O 0
SXH4 O 0 A_JumpIfInventory("WeaponCharge",1,"NoAmmo")
SXH4 O 0 A_PlaySoundEx("Scrooge/Attack","Weapon")
SXH4 X 0 A_GiveInventory("JumpChargeStop",1)
SXH4 O 0 A_JumpIfInventory("BossJumpChargeH",25,"FireCool")
SXH4 O 0 A_FireCustomMissile("CaneRock",0,0,0,0)
SXH4 O 0 A_FireCustomMissile("CaneSmack",0,0,0,0)
SXH4 PQRST 2
SXH4 U 15
SXH4 V 2
TNT1 A 1
SXH4 WX 1
SXH4 X 0 A_TakeInventory("JumpChargeStop",1)
SXH4 X 0 A_Refire
Goto Ready+1
FireCool:
SXH4 P 1 A_TakeInventory("BossJumpChargeH",25)
SXH4 O 0 A_FireCustomMissile("ScroogeMoneyBag",0,0,0,0)
SXH4 O 0 A_FireCustomMissile("CaneSmack",0,0,0,0)
SXH4 PQRST 2
SXH4 U 20
SXH4 V 3
TNT1 A 2
SXH4 WX 1
SXH4 X 0 A_TakeInventory("JumpChargeStop",1)
SXH4 X 0 A_Refire
Goto Ready+1
AltFire:
SXH4 O 0
SXH4 O 0 A_JumpIfInventory("WeaponCharge",1,"AirAltfire")
SXH4 O 0 A_JumpIfInventory("BossRageCharge",500,"Kill")
SXH4 O 1
Goto Jump
Jump:
SXH4 O 1 A_JumpIfInventory("BossJumpChargeH",25,1)
Goto Ready+1
SXH4 O 1 A_CheckFloor(1)
Goto AirAltfire
SXH4 W 1 A_TakeInventory("BossJumpChargeH",25)
SXH4 W 0 ThrustThingZ(0,75,0,1)
SXH4 W 0 A_GiveInventory("JumpChargeStop",1)
SXH4 W 0 A_PlaySoundEx("Scrooge/Jump","Item")
SXH4 X 0 A_GiveInventory("WeaponCharge",1)
SXH4 X 0 A_TakeInventory("JumpCancler",1)
SXH4 W 5 ACS_ExecuteAlways(191,0,APROP_Speed,215,100)
goto Ready2
AirAltfire:
SXH4 W 0 A_GiveInventory("JumpChargeStop",1)
SXH4 O 1 A_TakeInventory("BossJumpChargeH",25)
SXH4 W 0 A_GiveInventory("LadderDisable", 1)
SXH4 W 0 ThrustThingZ(0,55,0,0)
SXH4 O 4
SXH4 W 0 A_GiveInventory("WeaponCharge",1)
SXH4 W 2 ACS_NamedExecute("StateChange",0,3)
SXH4 W 0 A_PlaySoundEx("CHOZO/PAWNCH","Weapon")
SXH4 W 0 ThrustThingZ(0,75,1,0)
SXH4 W 0 A_TakeInventory("UnSolid",1)
SXH4 W 1 A_ChangeFlag("SOLID",0)

AirAltfireLoop:
SXH4 W 0 ThrustThingZ(0,25,1,1)
TNT1 A 0 ACS_NamedExecute("StateChange",0,3)
SXH4 W 0 A_SpawnItemEx("ScroogeJumpFX")
SXH4 W 1 A_SpawnItemEX("CaneCrash2",0,0,-10,0,0,momz)
SXH4 W 0 A_SpawnItemEx("ScroogeJumpFX")
SXH4 W 1 A_CheckFloor(1)
loop
SXHW WO 1
SXH4 W 0 A_GiveInventory("LadderEnable", 1)
SXH4 O 2 A_SpawnItemEx("Resolidifier")
SXH4 O 4
goto Ready+1

Kill:
SXH4 O 0
SXH4 O 0 A_TakeInventory("BossRageCharge",500)
SXH4 O 0 SetPlayerProperty(0,1,0)
SXH4 X 2
SXH4 W 2 A_PlaySoundEX("misc/door","Weapon")
SXH4 XOX 2
SXH4 W 2 A_PlaySoundEX("misc/door","Weapon")
SXH4 X 2
SXH4 O 0
SXH4 O 0 A_PlaySoundEX("item/refill","Weapon")
SXH4 O 5 A_SpawnItemEx("GizmoDuck", 0, -32, 96, 0, 0, -24, 0, SXF_NOCHECKPOSITION, 0)
SXH4 O 0
SXH4 O 0 A_PlaySoundEX("item/refill","Weapon")
SXH4 O 5 A_SpawnItemEx("GizmoDuck", 0, 32, 96, 0, 0, -24, 0, SXF_NOCHECKPOSITION, 0)
SXH4 O 0
SXH4 O 21
SXH4 O 0 SetPlayerProperty(0,0,0)
goto Ready+1
NoAmmo:
SXH4 O 1 ACS_Execute(979,0)
SXH4 O 0 A_Refire
goto Ready+1
}
}

actor ScroogeJumpFX
{
+CLIENTSIDEONLY
+NOINTERACTION
-SOLID
scale 2.5
translation "0:255=4:4"
alpha 0.9
states
{
	Spawn:
	SXS2 H 2 A_FadeOut(0.1)
	loop
}
}

actor CaneSmack : SaxtonFist
{
Obituary "$OB_SCROOGECANE"
damagetype "Scrooge"
damage (15)
translation "192:192=80:80", "198:198=85:85"
Speed 90
}

actor CaneCrash2
{
PROJECTILE
damage (9)
damagetype "BossInstagib"
Obituary "$OB_SCROOGECANE"
Radius 30
Height 24
renderstyle none
States
{
Spawn:
TNT1 A 2
stop
XDeath:
TNT1 A 0
Stop
}
}

actor CaneRock
{
PROJECTILE
//Radius 38
-NOGRAVITY
gravity 1.6
Radius 16
Height 16
scale 2.5
damage (10)
damagetype "BossInstagib"
Obituary "$OB_MOONROCK"
speed 20
bouncecount 3
+HEXENBOUNCE
bouncefactor 0.9
wallbouncefactor 0.9
translation "46:46=92:92"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ThrustThingZ(0,20,0,1)
POWS B 0
Spawn2:
POWS B 1
loop
Death:
Death2:
NAPA A 0 A_Changeflag("NOGRAVITY",1)
NAPA A 0 A_Stop
NAPA A 0 A_PlaySoundEx("weapon/napalm", "Weapon")
MMFX BCDE 2 A_Stop
stop
}
}


actor ScroogeMoneyBag
{
PROJECTILE
//Radius 38
-NOGRAVITY
gravity 1.6
Radius 25
Height 10
scale 2.5
damage (10)
damagetype "BossInstagib"
Obituary "$OB_SCROOGEBAG"
speed 25
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ThrustThingZ(0,30,0,1)
009B A 0
Spawn2:
009B BBCC 1
loop
Death:
Death2:
009B A 0 A_Changeflag("NOGRAVITY",1)
009B A 2 A_Stop
NAPA A 0 A_PlaySoundEx("weapon/napalm", "Weapon")
NAPA DDDDDDDDDD 0 A_SpawnItemEx("ScroogeCoins",0,0,0,random(-6,6),random(-6,6),random(5,12),random(0,360))
NAPA D 0 A_Explode(15, 96, 0, 0, 24)
NAPA EFGHIJKLMNOPQRS 2 A_Stop
stop
}
}

actor ScroogeCoins
{
PROJECTILE
-NOGRAVITY
Radius 8
Height 8
scale 2.5
+THRUACTORS
damage (5)
damagetype "BossInstagib"
Obituary "$OB_SCROOGECOINS"
reactiontime 70
+HEXENBOUNCE
bouncefactor 0.9
wallbouncefactor 0.9
States
{
Spawn:
TNT1 A 0
009C A 0
009C A 0 A_Jump(256,"SpawnA","SpawnB","SpawnC","SpawnD")
SpawnA:
009C AAA 1 A_Countdown
009C A 0 A_ChangeFlag("THRUACTORS",0)
SpawnB:
009C BBB 1 A_Countdown
009C B 0 A_ChangeFlag("THRUACTORS",0)
SpawnC:
009C CCC 1 A_Countdown
009C C 0 A_ChangeFlag("THRUACTORS",0)
SpawnD:
009C DDD 1 A_Countdown
009C D 0 A_ChangeFlag("THRUACTORS",0)
goto SpawnA

Death:
Death2:
NAPA A 0 A_Changeflag("NOGRAVITY",1)
NAPA A 0 A_Stop
MMFX BCDE 2 A_Stop
stop
}
}

//Rage New//
ACTOR GizmoDuck
{
  Health 650
  Radius 64
  Height 64
  Mass 99999
  Speed 5
  //PainChance 50 //N O P E
  Monster
species "SaxtonBoss"
+THRUSPECIES
+DONTHARMSPECIES
+MTHRUSPECIES
  +FLOORCLIP
  //+NODAMAGE
  damagefactor "BossInstagib", 0.0
  damagefactor "Scrooge", 0.0
  damagefactor "ScroogeX", 0.0
    damagefactor "CanePogo", 0.0
    damagefactor "HyperBomb", 0.5
// resistances against ripping attacks :
damagefactor "LaserBuster", 0.37
damagefactor "RollingCutter",0.3
damagefactor "IceSlasher", 0.37
damagefactor "ThunderBeam", 0.37
damagefactor "AtomicFire3", 0.377
damagefactor "MetalBlade", 0.37
damagefactor "ShadowBlade", 0.37
damagefactor "RingBoomerang", 0.37
damagefactor "WindStorm", 0.39
damagefactor "YamatoSpear", 0.37
damagefactor "MirrorBuster2", 0.37
damagefactor "SkullBarrier", 0.4
damagefactor "KnightCrush", 0.37
damagefactor "Beat", 0.57
damagefactor "TopSpin", 0.66
damagefactor "GravityHold", 1.35
damagefactor "FlashBomb", 0.40
//damagefactor "MegaBall", 0.50
damagefactor "Tango", 0.47
damagefactor "IceWall", 0.47
damagefactor "IceCircleThrow", 0.5
damagefactor "SpreadDrill", 0.228
damagefactor "SpreadDrill2", 0.38
damagefactor "SpreadDrill3", 0.38
damagefactor "FlameSword", 0.424
damagefactor "SparkChaser", 0.3
damagefactor "Sakugarne", 0.1
damagefactor "ProtoBash", 0.1
damagefactor "BlazingTorch", 0.2
damagefactor "BassCrescentKick", 0.1
  Scale 2.5
  translation "192:192=4:4", "198:198=93:93"
  States
  {
  Spawn:
    GIZM A 10
	GIZM A 5 ACS_NamedExecuteAlways("SH_enemystart3",0)
	GIZM A 0 A_GiveInventory("RoboDuckFlagSpawner",1)
	GIZM BBBB 1 A_Wander
	GIZM B 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM B 0 A_Look
	GIZM CCCC 1 A_Wander
	GIZM C 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM C 0 A_Look
	GIZM DDDD 1 A_Wander
	GIZM D 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM D 0 A_Look
	GIZM EEEE 1 A_Wander
	GIZM E 0 A_Look
	GIZM E 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM E 0 A_Jumpifinventory("WeaponCharge", 210, "Death")
	GIZM E 0 A_GiveInventory("WeaponCharge",1)
    Goto Spawn+2
  See:
    GIZM A 0 A_GiveInventory("RoboDuckFlagSpawner",1)
	GIZM BB 1 A_Chase("","")
	GIZM B 0 A_jumpiftargetinlos("Missile")
	GIZM BB 1 A_Chase("","")
	GIZM B 0 A_jumpiftargetinlos("Missile")
	GIZM B 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM CC 1 A_Chase("","")
	GIZM C 0 A_jumpiftargetinlos("Missile")
	GIZM CC 1 A_Chase("","")
	GIZM C 0 A_jumpiftargetinlos("Missile")
	GIZM C 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM DD 1 A_Chase("","")
	GIZM D 0 A_jumpiftargetinlos("Missile")
	GIZM D 1 A_Chase("","")
	GIZM D 0 A_jumpiftargetinlos("Missile")
	GIZM D 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM EE 1 A_Chase("","")
	GIZM E 0 A_jumpiftargetinlos("Missile")
	GIZM EE 1 A_Chase("","")
	GIZM E 0 A_jumpiftargetinlos("Missile")
	GIZM E 0 A_Jumpifinventory("CutterFlag", 200, "Death")
	GIZM E 0 A_Jumpifinventory("WeaponCharge", 210, "Death")
	GIZM E 0 A_GiveInventory("WeaponCharge",1)
    Loop
  Missile:
	GIZM A 0 A_GiveInventory("RoboDuckFlagSpawner",1)
	GIZM F 0 A_Jumpifinventory("Cutterflag", 200, "Death")
    GIZM F 0 A_FaceTarget
    //GIZM F 0 A_Jump(256, "MissileThrust", "MissileNoThrust")
	goto MissileNoThrust//Spawn+2
  MissileThrust:
	GIZM A 0 A_GiveInventory("RoboDuckFlagSpawner",1)
	GIZM F 0 A_recoil(-15)
	GIZM F 0 A_custommissile("GizmoDuckShot",30,-32)
	GIZM FFFFF 1
	GIZM A 0 A_PlaySoundEx("misc/devilfire","Voice")
	GIZM F 0 A_custommissile("GizmoDuckShot",30,32)
	GIZM GGGGGG 1
	GIZM F 0 A_jumpiftargetinlos("Missile")
	GIZM E 0 A_Jumpifinventory("WeaponCharge", 210, "Death")
	GIZM E 0 A_GiveInventory("WeaponCharge",1)
    Goto See
 MissileNoThrust:
	GIZM A 0 A_GiveInventory("RoboDuckFlagSpawner",1)
	GIZM F 0 A_custommissile("GizmoDuckShot",30,-32)
	GIZM FFFFF 1 A_Chase("","")
	GIZM F 0 A_FaceTarget
	GIZM F 0 A_PlaySoundEx("misc/devilfire","Voice")
	GIZM F 0 A_custommissile("GizmoDuckShot",30,32)
	GIZM GGGGGG 1 A_Chase("","")
	GIZM G 0 A_FaceTarget
	GIZM F 0 A_jumpiftargetinlos("Missile")
	GIZM E 0 A_Jumpifinventory("WeaponCharge", 210, "Death")
	GIZM E 0 A_GiveInventory("WeaponCharge",1)
    Goto See
  Pain:
    GIZM H 2
    GIZM H 2 A_Pain
    Goto See
	Death:
	TNT1 A 1
	TNT1 A 1 A_SpawnItemEx("GizmoDuckDeath",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 1
	stop
}
}

actor RoboDuckFlagSpawner : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("RoboDuckCutterFlagFeeder", 0, 0, 0, 0, 0, 0,0,SXF_NOCHECKPOSITION)
stop
}
}

actor RoboDuckCutterFlagFeeder
{
PROJECTILE
+NOTARGETSWITCH
+NOINTERACTION
+DONTBLAST
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("CanBeGrabBustered",1)
TNT1 A 0 A_JumpIfInTargetInventory("SpawnedSpawner",1,"Death")
TNT1 A 0 A_FaceTarget
TNT1 A 2 A_JumpIfInTargetInventory("CutterFlag", 200, "Death")
TNT1 A 0 A_GiveToTarget("CutterFlag", 1)
TNT1 A 0 A_GiveToTarget("SpawnedSpawner", 1)
Goto Spawn+3
Death:
TNT1 A 0
stop}}

actor SpawnedSpawner : OnceC {}

actor GizmoDuckDeath : TrebleDeath
{
translation "192:192=4:4", "198:198=93:93"
States
{
Spawn:
TFOG B 0 A_PlaySoundEx("misc/portin", "Weapon", 0)
TFOG CB 1
TFOG A 0 A_ChangeFlag("NOGRAVITY",1)
TFOG A 1 ThrustThingZ(0,50,0,0)
TFOG A 0 A_Countdown
Goto Spawn+3
}
}

actor GizmoDuckShot : TrebleShot
{
species "SaxtonBoss" 
+THRUSPECIES
+MTHRUSPECIES
damage (6)
damagetype "BossInstagib"
Obituary "$OB_GIZMODUCK"
}

actor CanePogoProtect : PowerProtection
{
Powerup.Duration 5
DamageFactor "CanePogo", 0.0
}

actor XRayFlag : OnceC {}
actor XRayMarker
{
Height 0
Radius 0
+NOINTERACTION
+NOCLIP
PROJECTILE
scale 0.3125
RenderStyle "Translucent"
//Alpha 0.0625
//Alpha 0.75
//Alpha 0.125
Alpha 0.04875
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
states
{
Spawn:
LCKN A 0
LCKN A 1 A_Stop
stop
}
}

actor XRayMarker2 : XRayMarker
{
states
{
Spawn:
LCKN B 0
LCKN B 1 A_Stop
stop
}
}