actor Chillman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_10D"
dropitem "ChillSpikeWep"
Weapon.AmmoUse 16
Weapon.AmmoGive 28
Obituary "$OB_CHILLCLOSE"
weapon.ammotype "SpikesAndChillAmmo"
weapon.ammotype2 "ChillSlideAmmo"
Inventory.Pickupmessage "Whats cooler than being cool? ICE COLD! Alright alright alright alright alright alright alright alright alright alright alright alright alright alright alright alright!"
States
{
Spawn:
C_10 D 1
loop

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

Ready:
CHIB A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_CHILLMAN)
CHIB A 0 A_GunFlash("Flash",1)
goto Ready1

Ready1:
CHIB A 0 A_JumpIfInventory("SpikesAndChillAmmo",16,"Ready2a")
CHIB A 0 A_JumpIfInventory("ChillSliding",1,"Ready2b")
CHIB A 0 A_JumpIfInventory("ChillSlideAmmo",168,"Ready2b")
CHIB A 3 A_WeaponReady(12)
CHIB A 0 A_GiveInventory("ChillAmmoGiver_P",1)
loop
Ready2a:
CHIB A 0 A_JumpIfInventory("ChillSliding",1,"Ready3")
CHIB A 0 A_JumpIfInventory("ChillSlideAmmo",168,"Ready3")
CHIB A 3 A_WeaponReady(8)
CHIB A 0 A_GiveInventory("ChillAmmoGiver_P",1)
Loop
Ready2b:
CHIB A 0 A_JumpIfInventory("SpikesAndChillAmmo",16,"Ready3")
CHIB A 3 A_WeaponReady(4)
CHIB A 0 A_GiveInventory("ChillAmmoGiver_P",1)
Loop
Ready3:
CHIB A 3 A_WeaponReady
CHIB A 0 A_GiveInventory("ChillAmmoGiver_P",1)
loop

Fire:
CHIB B 0 A_JumpIfInventory("Chill_ItemFlag",1,"SuperMainfire")
CHIB B 2 A_GiveInventory("Chillman_Fire_P")
CHIB C 10
CHIB A 2
Goto Ready1
SuperMainfire:
CHIB A 0
CHIB A 0 A_GunFlash("Flash.ItemCancel",1)

CHIB A 1 OffSet(11,47)A_TakeInventory("Chill_ItemFlag",99)//A_TakeInventory("Chill_ItemCharge",99)
CHIB A 1 OffSet(23,66)A_TakeInventory("ChillSliding",9)
CHIB A 1 OffSet(37,89)
TNT1 A 3//1 tic sound delay is accurate, but 2 allows easy ragerune_st
CHIB C 2 OffSet(260,72)
CHIB C 0 A_PlaySoundEx("weapon/chillsalvo","Weapon")
CHIB C 2 OffSet(209,56)A_SpawnItemEx("ChillSpreadShotWarper5",0,64,32,0,0,0,0,1)
CHIB C 0 A_PlaySoundEx("weapon/chillsalvo","Weapon")
CHIB C 2 OffSet(143,30)A_SpawnItemEx("ChillSpreadShotWarper4",40,40,32,0,0,0,0,1)
CHIB C 0 A_PlaySoundEx("weapon/chillsalvo","Weapon")
CHIB C 2 OffSet(80,5)A_SpawnItemEx("ChillSpreadShotWarper3",64,0,32,0,0,0,0,1)
CHIB C 0 A_PlaySoundEx("weapon/chillsalvo","Weapon")
CHIB C 2 OffSet(21,22)A_SpawnItemEx("ChillSpreadShotWarper2",40,-40,32,0,0,0,0,1)
CHIB C 0 A_PlaySoundEx("weapon/chillsalvo","Weapon")
CHIB C 2 OffSet(-50,51)A_SpawnItemEx("ChillSpreadShotWarper1",0,-64,32,0,0,0,0,1)
CHIB C 2 OffSet(-88,78)
TNT1 A 1
TNT1 AA 3
TNT1 A 1
CHIB D 2 OffSet(-265,46)
CHIB D 2 OffSet(-225,16)
CHIB E 2 OffSet(-131,-18)
CHIB F 2 OffSet(-44,-17)
CHIB G 2 OffSet(24,19)
CHIB G 2 OffSet(72,30)
CHIB G 2 OffSet(120,56)
TNT1 A 0 A_GiveInventory("Chill_ItemCoolD",105)
TNT1 A 0 A_TakeInventory("Chill_ItemCharge")
TNT1 A 1 A_TakeInventory("Chill_ItemFlag",99)
TNT1 AA 2 A_TakeInventory("Chill_ItemFlag",99)
CHIB A 2 OffSet(-18,74)A_TakeInventory("Chill_ItemCharge")
CHIB A 2 OffSet(-10,58)
CHIB A 2 OffSet(-4,44)
goto Ready1

Altfire:
CHIB A 0 A_JumpIfInventory("Chill_ItemFlag",1,"SuperSlide")
CHIB A 0 A_JumpIfInventory("ChillSliding",1,"StopSlide")
CHIB A 0 A_JumpIfInventory("ChillSlideAmmo",168,"Altfire2")
CHIB A 1
Goto Ready1
Altfire2:
CHIB H 0
CHIB H 2 A_GiveInventory("ChillSliding",1)
CHIB A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEON)
CHIB A 2 A_SpawnItemEx("ChillmanSlideWatcher")
CHIB H 2
Goto Ready1
StopSlide:
CHIB HAH 2 A_TakeInventory("ChillSliding",99)
Goto Ready1
SuperSlide:

goto Ready1

Flash:
TNT1 A 0 A_JumpIfInventory("Chill_ItemFlag",1,"Flash.Item")
TNT1 A 1 A_GiveInventory("ChillFlashInventory_P",1)
Loop
Flash.Item:
TNT1 A 0 A_GiveInventory("ChillSuperCountdownFX_P2",1)
TNT1 A 1 A_GiveInventory("ChillFlashInventory_P",1)
TNT1 A 0 A_JumpIfInventory("Chill_ItemCharge",35,"Flash.ItemTimeout")
TNT1 A 0 A_JumpIfInventory("Chill_ItemFlag",1,"Flash.Item2")
Goto Flash
Flash.Item2:
TNT1 A 0 A_GiveInventory("ChillSuperCountdownFX_P",1)
TNT1 A 1 A_GiveInventory("ChillFlashInventory_P",1)
TNT1 A 0 A_JumpIfInventory("Chill_ItemCharge",35,"Flash.ItemTimeout")
TNT1 A 0 A_JumpIfInventory("Chill_ItemFlag",1,"Flash.Item")
Goto Flash
Flash.ItemTimeout:
TNT1 A 0 A_GiveInventory("ChillSuperCountdownFire_P",1)
TNT1 A 0 A_GiveInventory("Chill_ItemCoolD",105)
TNT1 A 0 A_TakeInventory("Chill_ItemCharge")
TNT1 A 0 A_TakeInventory("Chill_ItemFlag",99)
TNT1 A 1 A_GiveInventory("ChillFlashInventory_P",1)
Goto Flash
Flash.ItemCancel:
TNT1 A 1 A_JumpIfInventory("Chill_ItemCoolD",1,"Flash")
loop
}
}

actor SpikesAndChillAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 112
+INVENTORY.IGNORESKILL
}
actor ChillSlideAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 168
+INVENTORY.IGNORESKILL
}

//actor ChillShield : Ammo//In the armor zone
//{
//inventory.amount 1
//inventory.maxamount 250
//+INVENTORY.IGNORESKILL
//}

actor ChillShieldCooldown : Inventory
{
inventory.amount 1
inventory.maxamount 210
}

actor ChillParkour : Powerup
{
Powerup.Duration 5
}
actor ChillSliding : OnceC {}
actor ChillSlideCount : Inventory
{
inventory.amount 1
inventory.maxamount 10
}
actor ChillSlideSpeed1 : PowerSpeed
{
+POWERSPEED.NOTRAIL
powerup.duration 3
speed 1.88
}
actor ChillSlideSpeed2 : ChillSlideSpeed1
{
speed 1.83
}
actor ChillSlideSpeed3 : ChillSlideSpeed1
{
speed 1.77
}
actor ChillSlideSpeed4 : ChillSlideSpeed1
{
speed 1.55
}
actor ChillPuddleDelay : Powerup
{
Powerup.Duration 3
}

actor ChillPuddleDelayACS_A : Powerup
{//duration between ally/enemy effects from ice trail
Powerup.Duration 2
}//Mainly so multiple trails don't do everything at the same time
actor ChillPuddleDelayACS_E : ChillPuddleDelayACS_A{}

actor ChillPuddleAllyHastenGiver : PowerApropGiver {}
actor ChillPuddleAllyHasten : PowerSpeed
{
Speed 1.0//Speed 1.5
powerup.duration 10
}

actor ChillM_ShotSlow1Giver : PowerApropGiver {}
actor ChillM_ShotSlow2Giver : PowerApropGiver {}
actor ChillM_ShotSlow3Giver : PowerApropGiver {}
actor ChillM_ShotSlow1 : PowerSpeed
{
Speed 1.0//Speed 0.70
powerup.duration 7
}
actor ChillM_ShotSlow2 : ChillM_ShotSlow1
{
powerup.duration 14
}
actor ChillM_ShotSlow3 : ChillM_ShotSlow1
{
powerup.duration 21
}

actor Chill_ItemCharge : Inventory
{
inventory.amount 1
inventory.maxamount 35
}
actor Chill_ItemCoolD : Inventory
{
inventory.amount 1
inventory.maxamount 105
}
actor Chill_ItemFlag : OnceC{}

actor ChillmanSuperItem : BasicClassItem
{
inventory.icon "ChilIcon"
inventory.pickupmessage "Chill Out."
Tag "Chill Super Trigger"
states
{
Spawn:
CHIB Z 1
loop
UseCBM:
TNT1 A 0 A_JumpIfInventory("Chill_ItemCoolD",1,"No")
TNT1 A 0 A_JumpIfInventory("ChillShield",1,1)
fail//Goto No//A_PlaySoundEx("weapon/adapterchargeloop","SoundSlot7")
TNT1 A 0 A_GiveInventory("Chill_ItemFlag",1)
fail
}
}

actor Chillman_Fire_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/chillshot","Weapon")
TNT1 A 0 A_FireCustomMissile("ChillmanSpikeShot",0,1,-8,0)
TNT1 A 0 A_GiveInventory("ChillSlideAmmo",7)
stop
}
}

actor ChillAmmoGiver_P : CustomInventory
{//Move to ready states if ammo desync
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("ChillSliding",1,3)
TNT1 A 0 A_GiveInventory("ChillSlideAmmo",4)
TNT1 A 0 A_GiveInventory("SpikesAndChillAmmo",1)
TNT1 A 0 A_JumpIfInventory("Chill_ItemCoolD",1,2)
TNT1 AA 0 A_GiveInventory("SpikesAndChillAmmo",1)
Stop
}
}

actor ChillFlashInventory_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("ChillShield",1,1)
Stop
TNT1 A 0 A_JumpIfInventory("Chill_ItemCoolD",1,1)
Stop
TNT1 A 0 A_TakeInventory("Chill_ItemCoolD",1)
Stop
}
}

actor ChillSuperCountdownFX_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("Chill_ItemCharge",1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX_H")
Stop
}
}
actor ChillSuperCountdownFX_P2 : ChillSuperCountdownFX_P
{
states
{
Pickup:
TNT1 A 0 A_PlaySoundEx("KirbyNES/Beam","SoundSlot7")//weapon/StarMain
goto Super::Pickup
}
}

actor ChillSuperCountdownFire_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("Chill_ItemCharge",35,"Pickup2")
stop
Pickup2:
TNT1 A 0 A_SpawnItemEx("ChillItemFreezer",0,0,28,0,0,0,0,1)
TNT1 A 0 A_JumpIfInventory("PlayerPropertySpread",1,"Pickup2_S")
stop
Pickup2_S:
TNT1 A 0 A_SpawnItemEx("ChillItemFreezer",0,0,42,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezer",0,0,14,0,0,0,0,1)
stop
}
}

actor ChillShieldFX_H : BasicExplosion//BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 AA 0 A_SpawnItemEx("ChillShieldFX",Random(-40,40),Random(-40,40),Random(10,60),0,0,0,0,1)
stop
}
}

actor ChillShieldFX : BasicGraphicEffect
{
Alpha 0.8
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_Jump(256,"Spawn2","Spawn3","Spawn4","Spawn5")
Spawn2:
CHIB QQQQ 2 A_Fadeout
Stop
Spawn3:
CHIB RRRR 2 A_Fadeout
Stop
Spawn4:
CHIB SSSS 2 A_Fadeout
Stop
Spawn5:
CHIB TTTT 2 A_Fadeout
Stop
}
}


actor ChillmanSpawnStart_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ChillShieldWatcher")
stop
}
}
actor Chillman_ShieldOn_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("Chillman_W",1,1)
Stop
TNT1 A 0 A_PlaySound("weapon/ChillIceForm",4,0.8)

TNT1 A 0 A_TakeInventory("ChillShieldCooldown")

TNT1 A 0 A_GiveInventory("ChillShield",1)
TNT1 A 0 A_TakeInventory("GuarddownFlag")

TNT1 A 0 A_GiveInventory("ChillShield",250)
stop
}
}

actor Chillman_ShieldOff_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("Chillman_W",1,1)
Stop
TNT1 A 0 A_PlaySoundEx("weapon/ChillIceBrk","Body")

TNT1 A 0 A_SpawnItemEx("ChillShieldInvuln_H")
TNT1 A 0 A_TakeInventory("ChillShield")
TNT1 A 0 A_GiveInventory("GuardDownFlag",1)
stop
}
}

actor ChillShieldInvuln_H : BasicExplosion//BasicHelper
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("ChillShieldCooldown",1)
TNT1 A 0 //A_PlaySoundEx("KirbyNES/Beam","Weapon")
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,30,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,60,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,90,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,120,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,150,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,180,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,210,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,240,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,270,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,300,1)
TNT1 A 0 A_SpawnItemEx("ChillShieldFX",0,0,40,30,0,0,330,1)
TNT1 A 0 A_GiveToTarget("ChillShieldInvulnOn_P",1)
TNT1 A 0 A_TakeFromTarget("ChillShieldCooldown",999)
TNT1 AAAAAA 1 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 4 A_GiveToTarget("ChillShieldInvulnOff_P",1)
Stop
}
}
actor ChillShieldInvulnOn_P : CustomInventory{States{Pickup:TNT1 A 0 ACS_NamedExecuteWithResult("core_invulnerableplayer",0,1)stop}}
actor ChillShieldInvulnOff_P : CustomInventory{States{Pickup:TNT1 A 0 ACS_NamedExecuteWithResult("core_invulnerableplayer",0,0)stop}}



actor ChillShieldWatcher : BasicHelper
{
+SERVERSIDEONLY
Mass 1
states
{
Spawn:
TNT1 A 0
TNT1 A 5//Delay for if MaxHealth gets changed somehow
goto SpawnRestart
SpawnL:
TNT1 A 1 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
//TNT1 A 0 A_JumpIfInTargetInventory("ChillShield",CallACS("core_getarmorinfo",1,2),"SpawnL")//250
TNT1 A 0 A_JumpIfInTargetInventory("ChillShield",0,"SpawnL")//250
TNT1 A 0 A_JumpIfInTargetInventory("ChillShield",1,1)
goto SpawnBrokenStart
TNT1 A 0 A_GiveToTarget("ChillShieldCooldown",Mass)
TNT1 A 0 A_JumpIfInTargetInventory("ChillShieldCooldown",0,"SpawnRestart")
goto SpawnL
SpawnBrokenStart:
TNT1 A 0 A_JumpIf(CheckClass("BearerClass",AAPTR_TARGET),"Death")
TNT1 A 0 A_GiveToTarget("Chillman_ShieldOff_P",1)
goto SpawnBrokenL
SpawnBrokenL:
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ChillShieldCooldown",Mass)
TNT1 A 0 A_JumpIfInTargetInventory("ChillShieldCooldown",0,"SpawnRestart")
loop
SpawnRestart:
TNT1 A 1 A_GiveToTarget("Chillman_ShieldOn_P",1)
goto SpawnL
}
}

actor ChillmanSlideEnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEOFF_DAMAGE,CallACS("core_getmaxhealth")/10)
TNT1 A 0 A_TakeInventory("ChillSliding",999)
TNT1 A 0 A_TakeInventory("ChillSlideCount",99)
stop
}
}

actor ChillmanSlideWatcher : BasicHelper
{
states
{
Spawn:
TNT1 A 1
TNT1 A 1 A_TakeFromTarget("ChillSlideAmmo",12)
TNT1 A 1
goto SpawnL
SpawnL:
TNT1 A 0 A_JumpIfInTargetInventory("ChillSliding",1,1)
goto SpawnNo
TNT1 A 0 A_JumpIfInTargetInventory("Chill_ItemFlag",1,"SpawnNo")
TNT1 A 0 A_JumpIfInTargetInventory("ChillSlideAmmo",1,1)
goto SpawnNo
TNT1 A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")
TNT1 A 0 //A_TakeFromTarget("ChillSlideAmmo",1)
TNT1 A 1 A_GiveToTarget("ChillSlideInventory_P",1)
loop
SpawnNo:
TNT1 A 1 A_GiveToTarget("ChillmanSlideEnd_P",1)
stop
}
}

actor ChillSlideSnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("ChillSliding",1,1)
stop
TNT1 A 0 A_CheckFloor(1)
stop
TNT1 A 0 A_PlaySoundEx("weapon/ChillSkate","SoundSlot7")
stop
}
}

actor ChillSlideInventory_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_CheckFloor("MoveCheck")
TNT1 A 0 A_TakeInventory("ChillSlideCount",1)
Stop
MoveCheck:
TNT1 A 0 A_JumpIf(CallACS("cbm_IsInputingMovement"),2)
TNT1 A 0 A_JumpIfInventory("ChillSlideCount",1,"Sliding")
Goto Sliding
TNT1 A 0 A_Giveinventory("ChillSlideCount",1)
TNT1 A 0 A_JumpIfInventory("ChillSlideCount",7,"Speed3")
TNT1 A 0 //A_JumpIfInventory("GuardDownFlag",1,"Speed4")
TNT1 A 0 A_JumpIfInventory("ChillSlideCount",4,"Speed2")
TNT1 A 0 A_Giveinventory("ChillSlideSpeed1",1)
goto End
Speed2:
TNT1 A 0 A_Giveinventory("ChillSlideSpeed2",1)
goto End
Speed3:
TNT1 A 0 //A_JumpIfInventory("GuardDownFlag",1,"Speed4P")
TNT1 A 0 A_Giveinventory("ChillSlideSpeed3",1)
goto Puddle
Speed4:
TNT1 A 0 A_Giveinventory("ChillSlideSpeed4",1)
goto End
Speed4P:
TNT1 A 0 A_Giveinventory("ChillSlideSpeed4",1)
goto Puddle
Sliding:
TNT1 A 0 A_TakeInventory("ChillSlideCount",1)
TNT1 A 1 A_ChangeVelocity((momx)*1.0525,(momy)*1.0525,(momz),CVF_REPLACE)
TNT1 A 0 A_JumpIfInventory("ChillSlideCount",4,"Puddle")
Stop
Puddle:
TNT1 A 0 A_JumpIfInventory("ChillPuddleDelay",1,"No")
TNT1 A 0 A_GiveInventory("ChillPuddleDelay",1)
TNT1 A 0 A_SpawnItemEx("ChillIcePuddle")
goto End
End:
TNT1 A 0 A_TakeInventory("ChillSlideAmmo",2)
TNT1 A 0 A_TakeInventory("ChillSlideAmmo",1,1)//2
stop
No:
TNT1 A 0
stop
}
}

actor ChillIcePuddle : BasicExplosion//BasicHelper
{

var int user_A;
//+FLOORHUGGER
Reactiontime 72
RenderStyle "translucent"
Alpha 0.8
Scale 2.5
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_SetUserVar("user_A",CallACS("cbm_FetchVectorAngle",2))
TNT1 A 0 //ACS_NamedExecuteAlways("cbm_TellVectorAngle",0,user_A,16)
TNT1 A 0 A_JumpIf(user_A==-1,"Ending")
TNT1 A 0 A_PlaySound("weapon/ChillTrail",1,0.1)
goto SpawnL
SpawnL:
CHIL K 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Ending")
CHIL K 0 A_SpawnItemEx("ChillIcePuddleFX",frandom(-32,32),frandom(-32,32),frandom(0,8),0,0,frandom(1,3),0,1)
CHIL K 1 ACS_NamedExecuteWithResult("cbm_ChillSlipNSlide",user_A,16,36)//Angle|Thrust|Range
CHIL K 0 A_Countdown
Loop
Ending:
TNT1 A 2
Stop

Death:
TNT1 A 0
TNT1 A 2 A_PlaySound("weapon/ChillTrailEnd",1,0.1)
stop
}
}

actor ChillIcePuddleFX : BasicGraphicEffect
{
Alpha 0.75
Scale 1.25
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_SetScale(ScaleX+frandom(-0.25f,0.25f))
TNT1 A 0 A_Jump(256,"Spawn1","Spawn2","Spawn3","Spawn4","Spawn5","Spawn6","Spawn7","Spawn8")
Spawn1:
CHIB U 3
CHIB UUUU 1 A_Fadeout(0.125)
stop
Spawn2:
CHIB V 3
CHIB VVVV 1 A_Fadeout(0.125)
stop
Spawn3:
CHIB W 3
CHIB WWWW 1 A_Fadeout(0.125)
stop
Spawn4:
CHIB U 3
CHIB VVVW 1 A_Fadeout(0.125)
stop
Spawn5:
CHIB V 3
CHIB WWWU 1 A_Fadeout(0.125)
stop
Spawn6:
CHIB W 3
CHIB UUUV 1 A_Fadeout(0.125)
stop
Spawn7:
CHIB U 3
TNT1 A 1
CHIB V 3
TNT1 A 1
CHIB W 2
stop
Spawn8:
CHIB UVW 3
stop
}
}

actor ChillSpreadShotWarper1 : ProjSpawnFuncActor
{//19 frame delay between shots would be bad
+MISSILE
+NOINTERACTION
-SOLID
+THRUACTORS
+NOGRAVITY
+DONTBLAST
+DONTREFLECT

+NOTIMEFREEZE
RenderStyle "translucent"
Alpha 0.7

ReactionTime 7
Mass 0
Meleerange -64


Height 2
Radius 2
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0
goto SpawnL
SpawnL:
CHIB K 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"DeathNo")
CHIB K 0 A_CountDown
CHIB K 0 A_JumpIfInTargetInventory("PlayerPropertyRage",1,2)
CHIB KKK 1 A_Warp(AAPTR_TARGET,Mass,Meleerange,32,0,24)
CHIB L 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"DeathNo")
CHIB L 0 A_CountDown
CHIB L 0 A_JumpIfInTargetInventory("PlayerPropertyRage",1,2)
CHIB LLL 1 A_Warp(AAPTR_TARGET,Mass,Meleerange,32,0,24)
CHIB M 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"DeathNo")
CHIB M 0 A_CountDown
CHIB M 0 A_JumpIfInTargetInventory("PlayerPropertyRage",1,2)
CHIB MMM 1 A_Warp(AAPTR_TARGET,Mass,Meleerange,32,0,24)
Loop

Death:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ChillSpreadShot_P1",1)
TNT1 A 2
stop
DeathNo:
TNT1 A 2
stop
}
}
actor ChillSpreadShotWarper2 : ChillSpreadShotWarper1
{
ReactionTime 8
Mass 40
Meleerange -40
States
{
Death:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ChillSpreadShot_P2",1)
TNT1 A 2
stop
}
}
actor ChillSpreadShotWarper3 : ChillSpreadShotWarper1
{
ReactionTime 9
Mass 64
Meleerange 0
States
{
Death:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ChillSpreadShot_P3",1)
TNT1 A 2
stop
}
}
actor ChillSpreadShotWarper4 : ChillSpreadShotWarper1
{
ReactionTime 10
Mass 40
Meleerange 40
States
{
Death:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ChillSpreadShot_P4",1)
TNT1 A 2
stop
}
}
actor ChillSpreadShotWarper5 : ChillSpreadShotWarper1
{
ReactionTime 11
Mass 0
Meleerange 64
States
{
Death:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ChillSpreadShot_P5",1)
TNT1 A 2
stop
}
}


actor ChillSpreadShot_P1 : CustomInventory{States{Pickup:TNT1 A 0 A_FireCustomMissile("ChillmanSpikeShot2",15,0,-64,4,0,-2)stop}}
actor ChillSpreadShot_P2 : CustomInventory{States{Pickup:TNT1 A 0 A_FireCustomMissile("ChillmanSpikeShot2",7.5,0,-40,4,0,-1)stop}}
actor ChillSpreadShot_P3 : CustomInventory{States{Pickup:TNT1 A 0 A_FireCustomMissile("ChillmanSpikeShot2",0,0,0,4)stop}}
actor ChillSpreadShot_P4 : CustomInventory{States{Pickup:TNT1 A 0 A_FireCustomMissile("ChillmanSpikeShot2",-7.5,0,40,4,0,-1)stop}}
actor ChillSpreadShot_P5 : CustomInventory{States{Pickup:TNT1 A 0 A_FireCustomMissile("ChillmanSpikeShot2",-15,0,64,4,0,-2)stop}}


actor ChillmanSpikeShot : ProjSpawnFuncActor
{
PROJECTILE
damagetype "ChillM_Shot"
Obituary "$OB_CHILLMANSHOT"
-NOGRAVITY
+SKYEXPLODE
+EXPLODEONWATER
Damage (100)
Radius 24
Height 20
speed 32
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ChangeVelocity(0,0,1)
CHIL BCD 2
goto Spawn+2
Death:
TNT1 A 0 A_SpawnItemEX("IcePitFreeze")
TNT1 A 0 A_JumpIf(z-floorz<=5,"Death2")
TNT1 A 0 A_JumpIf(ceilingz-z<=25,"Death3")
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW_HelpStart",0,0,-(ceilingz-z < 32)*(32-(ceilingz-z)),0,0,0,0,1)
TNT1 A 0
stop
XDeath:
TNT1 A 0 A_SpawnItemEX("IcePitFreeze")
TNT1 A 0
Stop
Death2:
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeF")
TNT1 A 0
stop
Death3:
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeC")
TNT1 A 0
stop
}
}

Actor ChillmanSpikeShot2 : ChillmanSpikeShot{speed 50}

const int CHILLMAN_RAD = 20;

actor ChillM_SpikeProtect : PowerProtection
{
Powerup.Duration 5
damagefactor "ChillM_Spike", 0.3
}

actor ChillmanSpikeF : ProjSpawnFuncActor
{
PROJECTILE
damagetype "ChillM_Spike"
Obituary "$OB_CHILLMANSPIKE_F"
+DONTBLAST
+DONTREFLECT
+FLOORHUGGER
+SLIDESONWALLS
reactiontime 140
Damage (200)
Radius 24
Height 20
Speed 0
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetAngle(random(0,359))
CHIL E 0 A_PlaySoundEx("weapon/chillspike","Weapon")
CHIL E 0 A_SpawnItemEx("ChillmanSpikeFX_F1",CHILLMAN_RAD,0,0,0,0,0,0,1)
CHIL E 0 A_SpawnItemEx("ChillmanSpikeFX_F1",CHILLMAN_RAD,0,0,0,0,0,120,1)
CHIL E 0 A_SpawnItemEx("ChillmanSpikeFX_F1",CHILLMAN_RAD,0,0,0,0,0,240,1)
CHIL E 2
Spawn2:
CHIL F 0 A_SpawnItemEx("ChillmanSpikeFX_F2",CHILLMAN_RAD,0,0,0,0,0,0,1)
CHIL F 0 A_SpawnItemEx("ChillmanSpikeFX_F2",CHILLMAN_RAD,0,0,0,0,0,120,1)
CHIL F 0 A_SpawnItemEx("ChillmanSpikeFX_F2",CHILLMAN_RAD,0,0,0,0,0,240,1)
CHIL F 1 A_CountDown
loop
Death:
TNT1 A 0 A_PlaySoundEx("weapon/chillbreak","Weapon")
Goto XDeath
XDeath:
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",0,0,0,random(6,12),random(6,12),random(6,12), 0,1)
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",CHILLMAN_RAD,0,0,random(6,12),random(6,12),random(6,12),0,1)
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",CHILLMAN_RAD,0,0,random(6,12),random(6,12),random(6,12),120,1)
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",CHILLMAN_RAD,0,0,random(6,12),random(6,12),random(6,12),240,1)
TNT1 A 2
stop
}
}

actor ChillmanSpikeFX_F1 : BasicGraphicEffect
{
States
{
Spawn:
CHIL E 3
stop
}
}
actor ChillmanSpikeFX_F2 : BasicGraphicEffect
{
States
{
Spawn:
CHIL F 2
stop
}
}

actor ChillmanSpikeW_HelpStart
{
+SERVERSIDEONLY
PROJECTILE
+DONTBLAST
+DONTREFLECT
Renderstyle None
Damage (0)
Radius 10
Height 32
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW_HelpF")//Move it up
stop
ForceSpawn:
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW",0,0,0,0,0,0,0,32)
stop
Death:
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW_HelpB")//Back it up
stop
}
}
actor ChillmanSpikeW_HelpF : ChillmanSpikeW_HelpStart
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetPitch(pitch+1)
TNT1 A 0 A_JumpIf(pitch>=15,"ForceSpawn")
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW_HelpF",2,0,0,0,0,0,0,32+SXF_TRANSFERPITCH)//512
stop
FailSpawn://Couldn't hit a surface, place spikes back at start point
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW",-30,0,0,0,0,0,0,32)
stop
Death:
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW",-2,0,0,0,0,0,0,33)
stop
}
}
actor ChillmanSpikeW_HelpB : ChillmanSpikeW_HelpStart
{
States
{
Spawn:
TNT1 A 0
goto ForceSpawn
Death:
TNT1 A 0 A_SetPitch(pitch+1)
TNT1 A 0 A_JumpIf(pitch>=10,"ForceSpawn")
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeW_HelpB",-2,0,0,0,0,0,0,32+512)
stop
}
}

actor ChillmanSpikeW : ChillmanSpikeF
{
var int user_angle;
Obituary "$OB_CHILLMANSPIKE_W"
-FLOORHUGGER
+BOUNCEONCEILINGS
Radius 10
Height 32
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetUserVar(user_angle,random(1,120))
CHIL G 0 A_PlaySoundEx("weapon/chillspike","Weapon")
CHIL G 0 A_SpawnItemEx("ChillmanSpikeFX_W1",0,cos(user_angle)*CHILLMAN_RAD,sin(user_angle)*CHILLMAN_RAD,0,0,0,0,1)
CHIL G 0 A_SpawnItemEx("ChillmanSpikeFX_W1",0,cos(user_angle+120)*CHILLMAN_RAD,sin(user_angle+120)*CHILLMAN_RAD,0,0,0,0,1)
CHIL G 0 A_SpawnItemEx("ChillmanSpikeFX_W1",0,cos(user_angle+240)*CHILLMAN_RAD,sin(user_angle+240)*CHILLMAN_RAD,0,0,0,0,1)
CHIL G 2
Spawn2:
CHIL H 0 A_SpawnItemEx("ChillmanSpikeFX_W2",0,cos(user_angle)*CHILLMAN_RAD,sin(user_angle)*CHILLMAN_RAD,0,0,0,0,1)
CHIL H 0 A_SpawnItemEx("ChillmanSpikeFX_W2",0,cos(user_angle+120)*CHILLMAN_RAD,sin(user_angle+120)*CHILLMAN_RAD,0,0,0,0,1)
CHIL H 0 A_SpawnItemEx("ChillmanSpikeFX_W2",0,cos(user_angle+240)*CHILLMAN_RAD,sin(user_angle+240)*CHILLMAN_RAD,0,0,0,0,1)
CHIL H 0 A_JumpIfInTargetInventory("ChillParkour",1,2)
CHIL H 0 A_JumpIfCloser(64,"Parkour")
CHIL H 1 A_CountDown
loop
Parkour:
CHIL H 0 A_GiveToTarget("ChillParkour",1)
CHIL H 1 A_CountDown
Goto Spawn2
Death:
TNT1 A 0 A_PlaySoundEx("weapon/chillbreak","Weapon")
Goto XDeath
XDeath:
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",0,0,28,-random(6,12),0,random(2,6),random(-6,6),1)
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",0,cos(user_angle)*CHILLMAN_RAD,sin(user_angle)*CHILLMAN_RAD+28,-random(6,12),0,random(2,6),random(-6, 6),1)
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",0,cos(user_angle+120)*CHILLMAN_RAD,sin(user_angle+120)*CHILLMAN_RAD+28,-random(6,12),0,random(2,6),random(-6, 6),1)
TNT1 A 0 A_SpawnItemEx("ChillmanSpikeDebris",0,cos(user_angle+240)*CHILLMAN_RAD,sin(user_angle+240)*CHILLMAN_RAD+28,-random(6,12),0,random(2,6),random(-6, 6),1)
TNT1 A 1
stop
}
}

actor ChillmanSpikeFX_W1 : BasicGraphicEffect
{
States
{
Spawn:
CHIL G 3
stop
}
}
actor ChillmanSpikeFX_W2 : BasicGraphicEffect
{
States
{
Spawn:
CHIL H 2
stop
}
}

actor ChillmanSpikeC : ChillmanSpikeF
{
Obituary "$OB_CHILLMANSPIKE_C"
-FLOORHUGGER
+CEILINGHUGGER
Height 22
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetAngle(random(0,359))
CHIL I 0 A_PlaySoundEx("weapon/chillspike","Weapon")
CHIL I 0 A_SpawnItemEx("ChillmanSpikeFX_C1",CHILLMAN_RAD,0,0,0,0,0,0,1)
CHIL I 0 A_SpawnItemEx("ChillmanSpikeFX_C1",CHILLMAN_RAD,0,0,0,0,0,120,1)
CHIL I 0 A_SpawnItemEx("ChillmanSpikeFX_C1",CHILLMAN_RAD,0,0,0,0,0,240,1)
CHIL I 2
Spawn2:
CHIL J 0 A_SpawnItemEx("ChillmanSpikeFX_C2",CHILLMAN_RAD,0,0,0,0,0,0,1)
CHIL J 0 A_SpawnItemEx("ChillmanSpikeFX_C2",CHILLMAN_RAD,0,0,0,0,0,120,1)
CHIL J 0 A_SpawnItemEx("ChillmanSpikeFX_C2",CHILLMAN_RAD,0,0,0,0,0,240,1)
CHIL J 1 A_CountDown
loop
}
}

actor ChillmanSpikeFX_C1 : BasicGraphicEffect
{
States
{
Spawn:
CHIL I 3
stop
}
}
actor ChillmanSpikeFX_C2 : BasicGraphicEffect
{
States
{
Spawn:
CHIL J 2
stop
}
}

actor ChillItemFreezer : BasicExplosion
{
//maybe spawns some mini spikes on the ground
var int user_TranslateWhiteColors;
Damagetype "ChillM_Freeze"
Obituary "$OB_CHILLMANFREEZE"
RenderStyle None
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,30,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,60,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,90,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,120,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,150,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,180,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,210,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,240,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,270,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,300,1)
TNT1 A 0 A_SpawnItemEx("ChillItemFreezerFX",0,0,-14,60,0,0,330,1)
TNT1 A 0 A_SpawnItemEX("IcePitFreeze")

TNT1 A 0 A_Explode(150,196,0,0,196)
TNT1 A 5
stop
}
}

actor ChillItemFreezerFX : BasicGraphicEffect
{
var int user_TranslateWhiteColors;
States
{
SpawnFrame:
CHIB N 0
CHIB NNNN 1 A_Fadeout
stop
}
}

actor ChillFreezeStoppered : BasicHelper
{
reactiontime 70
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("PlayerPropertyGroundedOn",1)
TNT1 A 1 A_GiveToTarget("ChillFreezeStoppered_P",1)
TNT1 A 0 A_TakeFromTarget("EternalPainFlag",1)
goto Spawn2
Spawn2:
TNT1 A 0 A_JumpIfInTargetInventory("EternalPainFlag",1,"Death")
TNT1 A 1 A_GiveToTarget("ChillFreezeStoppered_P",1)
TNT1 A 0 A_CountDown
loop
Death:
TNT1 A 0 A_GiveToTarget("PlayerPropertyGroundedOff",1)
stop
}
}

actor ChillFreezeStoppered_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_Stop
TNT1 A 0 A_GiveInventory("DashingStraitjacket_F",1)
TNT1 A 0 A_SpawnItemEx("ChillFreezeStopperedFX")
stop
}
}

actor ChillFreezeStopperedFX : BasicClientSide
{
Translation "192:192=208:208", "198:198=71:71"
States
{
Spawn:
MRFA F 0
MRFA F 1
stop
}
}


actor ChillmanSpikeDebris : BasicGraphicEffectM
{
-NOGRAVITY
+THRUACTORS
+BOUNCEONWALLS
+BOUNCEONCEILINGS
+BOUNCEAUTOOFF
+FORCEXYBILLBOARD
States
{
SpawnFrame:
CHID A 0
CHID A 1 A_Jump(256, "Spawn_K", "Spawn_L")
wait
Spawn_K:
CHID A 1
wait
Spawn_L:
CHID D 1
wait
Spawn2:
"----" "#" 2 A_JumpIf(momz==0, "Death")
wait
Death:
"----" "#" 1
stop
}
}

actor ChillParkourJump_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("ChillParkourJump_H")
stop
}
}
actor ChillParkourJump_P2 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 //A_SpawnItemEx("ChillParkourJump_H2",0,0,28,momx,momy,momz,0,9)
TNT1 A 0 A_SpawnItemEx("ChillParkourJump_H2",0,0,28,0,0,0,0,1)
stop
}
}

actor ChillParkourJump_H : BasicHelper
{
var int user_A;
States
{
Spawn:
TNT1 A 0
TNT1 A 2
TNT1 A 4 A_GiveToTarget("ChillParkourJump_P2",1)
stop
}
}

actor ChillParkourJump_H2 : BasicExplosion//BasicHelper
{
var int user_A;
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 0 A_FaceTarget(0,0)
TNT1 A 2 A_SpawnItemEx("ChillParkourJumpFX",0,0,0,0,0,0,0,1+512)
stop
}
}



actor ChillParkourJumpFX : BasicClientSide
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("ChillParkourJumpFX1",0,0,0,Cos(pitch)*25,0,-sin(pitch)*25,0,1)
TNT1 A 0 A_SpawnItemEx("ChillParkourJumpFX1",0,0,0,Cos(pitch)*28,0,-sin(pitch)*28,30,1)
TNT1 A 0 A_SpawnItemEx("ChillParkourJumpFX1",0,0,0,Cos(pitch)*28,0,-sin(pitch)*28,-30,1)
TNT1 A 0 A_SpawnItemEx("ChillParkourJumpFX1",0,0,0,Cos(pitch)*27,0,-sin(pitch)*27+13.5,15,1)
TNT1 A 0 A_SpawnItemEx("ChillParkourJumpFX1",0,0,0,Cos(pitch)*30,0,-sin(pitch)*27+13.5,-15,1)
TNT1 A 0 A_SpawnItemEx("ChillParkourJumpFX1",0,0,0,Cos(pitch)*27,0,-sin(pitch)*27-13.5,15,1)
TNT1 A 0 A_SpawnItemEx("ChillParkourJumpFX1",0,0,0,Cos(pitch)*27,0,-sin(pitch)*27-13.5,-15,1)

TNT1 A 0
stop
}
}

actor ChillParkourJumpFX1 : BasicClientSide
{
ReactionTime 5
States
{
Spawn:
TNT1 A 0 A_CountDown
TNT1 AAA 0 A_SpawnItemEx("ChillParkourJumpFX2",frandom(-24,24),frandom(-24,24),frandom(-12,12),frandom(-1,1),frandom(-1,1),frandom(-1,1),0,1)
TNT1 A 1
loop
}
}

actor ChillParkourJumpFX2 : ChillIcePuddleFX
{
RenderStyle "Translucent"
Alpha 0.95
Scale 1.75
}


//actor Chillman_W_NormalBar : NormalBar {Args 202,207}
//actor Chillman_W_SecondBar : SecondBar {Args 204,205}
actor Chillman_W_ScriptBar : ScriptBar {}