actor Timeman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_1G"
dropitem "TimeSlowWep"
Weapon.AmmoUse 1
Weapon.AmmoGive 0
//Weapon.SlotNumber 1
Obituary "$OB_TIMEARROW"
weapon.ammotype "TimeToDefeatYouAmmo"
+WEAPON.NOAUTOAIM
inventory.icon "TimeIcon"
states
{
Spawn:
C_01 G 1
loop

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

Ready:
TIMA A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_TIMEMAN)
goto Ready1
Ready1:
TIMA A 0 A_JumpIfInventory("TimeToDefeatYouAmmo",42,"Ready2")
TIMA A 8 A_WeaponReady(WRF_NOSECONDARY)
TIMA A 0 A_JumpIfInventory("PowerTimeB",1,2)
TIMA A 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
TIMA A 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
loop
Ready2:
TIMA A 1 A_WeaponReady
loop

Fire:
TIMA B 0 A_PlaySoundEx("weapon/timeshot","Weapon")
TIMA B 0 A_FireCustomMissile("TimeManArrow",-7,0,8,0)
TIMA B 0 A_FireCustomMissile("TimeManArrow",7,0,8,0)
//TIMA B 0 A_TakeInventory("TimeCharge",999)
TIMA B 10
TIMA A 5
TIMA B 0 A_JumpIfInventory("PowerTimeB",1,2)
TIMA B 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
TIMA B 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
TIMA B 0 A_Refire
goto Ready1

AltFire:
TIMA B 0 A_JumpIfInventory("TimeToDefeatYouAmmo",42,"Slow")
goto Ready1
Slow:
TIMA C 1 A_GiveInventory("Timeman_AltStart_P")
//TIMA A 0 A_TakeInventory("TimeCharge",999)
TIMA DDDD 1
TIMA D 0 A_PlaySoundEx("weapon/slow","Body")
TIMA D 1 A_SetBlend(purple,0.85,5)
TIMA D 1 A_SpawnItemEx("TimeManSlow",0,0,48)
TIMA DDDD 1
TIMA C 5 A_GiveInventory("Timeman_AltEnd_P")
goto Ready1
}
}


actor Timeman_W2 : BaseMM8BDMWep_CBM
{
tag "$TAGC_1G2"
dropitem "TimeSlowWep"
Weapon.AmmoUse 1
Weapon.AmmoGive 0
//Weapon.SlotNumber 2
Obituary "$OB_TIMEARROW"
weapon.ammotype "TimeToDefeatYouAmmo"
inventory.icon "Tim2Icon"
states
{
Spawn:
C_01 G 1
loop

Deselect:
TIMA C 0
goto DeselectSwap
Select:
TIMA C 0
goto SelectSwap

Ready:
TIMA C 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_TIMEMAN)
goto Ready1
Ready1:
TIMA C 0 A_JumpIfInventory("TimeToDefeatYouAmmo",42,"Ready2")
TIMA C 8 A_WeaponReady(WRF_NOSECONDARY)
TIMA C 0 A_JumpIfInventory("PowerTimeB",1,2)
TIMA C 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
TIMA C 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
loop
Ready2:
TIMA C 1 A_WeaponReady
loop

Fire:
TIMA D 0 A_PlaySoundEx("weapon/timeshot","Weapon")
TIMA D 0 A_JumpIfInventory("TimeFlag",1,"Fire2")
TIMA D 0 A_GiveInventory("TimeFlag",1)
TIMA D 0 A_FireCustomMissile("TimeArrowSlow",0,0,-8,0)
goto FireEnd
Fire2:
TIMA D 0 A_TakeInventory("TimeFlag",9)
TIMA D 0 A_FireCustomMissile("TimeArrowFast",0,0,-8,0)
goto FireEnd
FireEnd:
TIMA D 10
TIMA C 5
TIMA C 0 A_JumpIfInventory("PowerTimeB",1,2)
TIMA C 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
TIMA C 0 A_GiveInventory("TimeToDefeatYouAmmo",1)
TIMA C 0 A_Refire
goto Ready1

AltFire:
TIMA B 0 A_JumpIfInventory("TimeToDefeatYouAmmo",42,"Slow")
goto Ready1
Slow:
TIMA A 1 A_GiveInventory("Timeman_AltStart_P")
TIMA BBBB 1
TIMA B 0 A_PlaySoundEx("weapon/slow","Body")
TIMA B 1 A_SetBlend(purple,0.85,5)
TIMA B 1 A_SpawnItemEx("TimeManSlow",0,0,48)
TIMA BBBB 1
TIMA A 5 A_GiveInventory("Timeman_AltEnd_P")
goto Ready1
}
}

actor TimeToDefeatYouAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 42
+INVENTORY.IGNORESKILL
}

actor TimeFlag : OnceC{}

actor Timeman_AltStart_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("TimeToDefeatYouAmmo",21)
TNT1 A 0 A_TakeInventory("TimeToDefeatYouAmmo",21,1)
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_noradiusdmgplayer",0,1)
TNT1 A 0 ACS_NamedExecuteWithResult("core_nonshootableplayer",0,1)
TNT1 A 0 A_GiveInventory("PowerTimeC",1)
TNT1 A 0 A_GiveInventory("PowerTimeB",1)
stop
}
}
actor Timeman_AltEnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_noradiusdmgplayer",0,0)
TNT1 A 0 ACS_NamedExecuteWithResult("core_nonshootableplayer",0,0)
stop
}
}

actor TimeManArrow : ProjSpawnFuncActor
{
PROJECTILE
Obituary "$OB_TIMEARROW"
damagetype "TimeM_Arrow"
+FORCEXYBILLBOARD
//+RIPPER
Damage (110)
Height 7
Radius 6
speed 40
Scale 2.5
States
{
Spawn:
TIMA S 6
TIMA R 3 bright
loop
}
}

actor TimeArrowSlow : TimeManArrow
{
damagetype "TimeM_ArrowSlow"
+RIPPER
Damage (70)
speed 15
}

actor TimeArrowFast : TimeManArrow
{
damagetype "TimeM_ArrowFast"
+RIPPER
Damage (90)
speed 64
}


actor TimeManSlow : BasicExplosion
{
damagetype "TimeM_Slow"
Obituary "$OB_TIMESLOW"
+FORCEXYBILLBOARD
+BRIGHT
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(140+CallACS("core_checkrune",RUNE_SPREAD,2)*280,512,0,0,32)
Q_1G EFGHIJKLMNEFGHIJKLMN 1
stop
}
}


actor PowerTimeC : PowerSpeed
{
powerup.duration 10
Speed 2.5
}

actor PowerTimeB : PowerFrightener
{
powerup.duration 215
//Inventory.Icon "TIMICON"
//Speed 1.0
}


actor Timeman_W_NormalBar : NormalBar {Args 65,61}//34,239
actor Timeman_W2_NormalBar : Timeman_W_NormalBar {}