//This is just a joke weapon. There is no way to obtain it in-game without cheat codes.
//I would strongly recommend to not have headphones when using this weapon.

// *** MODIFIED BY CHEBMASTER
// I mark most important places modified by me with //***Che -- unless I forget to.
//***Che Joke weapon...? JOKE WEAPON?!!
// This! Is! Awesome!
// Added to the second to last map of Chebskies-EDAY


//P.S. Rebalanced it to be much slower and impar huge side spin without berserk strength
//  also toned the CLANG! down, a lot.
//  also, the attacks aren't fired all at once now but gradually as the swing goes on
//  also, has alt fire now: keep swinging while alt is held down


ACTOR DSweap : BrutalWeapon
{
	Obituary "%o was choped down by %k's Dragonslayer."
    AttackSound "None"
    Inventory.PickupSound "AXEDRAW"
	Inventory.Pickupmessage "$GOTDSWEAP" // "You got something that looks too big to be called a sword!" / "Ты взял здоровенную дуру - её вообще мечом называть можно?"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOAUTOFIRE
    +FORCEXYBILLBOARD
	damagetype Saw
	+WEAPON.NOALERT
	+WEAPON.AXEBLOOD
	+WEAPON.CHEATNOTWEAPON
	VisibleToPlayerClass FBDoomer, FBDoomer2, TacticalFBDoomer, FBD_Doomgal, FBD_Doomgal2, FBD_TacticalDoomgal, FBD_Nostalgia, FBD_NostalgiaFem, FBD_Mortal, FBD_MortalFem
	//, Purist
	//***Che its useles, he only sees weapons inherited from ClassicWeapon
	// I made a clone, ClassicDSWeap
	Weapon.SelectionOrder 20
	Scale 0.9
	Tag "Dragonslayer"
	States
	{
//***Che disabling player weapons for cutscenes and for the evacuation center
		HoldFire:
			DSLA A 0 offset(32,52) A_JumpIfInventory("Taunting",1,"Taunt")
			DSLA A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			DSLA A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			DSLA A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
			DSLA A 1 offset(32,52) A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			DSLA A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire")
			Goto Ready	
	
		Ready3:
		Ready:
			DSLA A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
			TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			TNT1 A 0 A_Giveinventory("HasCutingWeapon",1)
			TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
			DSLA A 1 A_WeaponReady
			DSLA A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
			Loop
			
		Select:
			//TNT1 A 0 A_Giveinventory("GoSpecial",1)
			TNT1 A 0 A_Takeinventory("FistsSelected",1)
			TNT1 A 0 A_Takeinventory("sawSelected",1)
			TNT1 A 0 A_Takeinventory("ShotgunSelected",1)
			TNT1 A 0 A_Takeinventory("SSGSelected",1)
			TNT1 A 0 A_Takeinventory("MinigunSelected",1)
			TNT1 A 0 A_Takeinventory("PlasmaGunSelected",1)
			TNT1 A 0 A_Takeinventory("RocketLauncherSelected",1)
			TNT1 A 0 A_Takeinventory("GrenadeLauncherSelected",1)
			TNT1 A 0 A_Giveinventory("HasCutingWeapon",1)
			TNT1 A 0 A_Takeinventory("BFGSelected",1)
			TNT1 A 0 A_Takeinventory("BFG10kSelected",1)
			"----" A 0 A_Takeinventory("UnmakerSelected",1) //***Che	
			"----" A 0 A_Takeinventory("MG42Selected",1) //***Che			
			"----" A 0 A_Takeinventory("AxeSelected",1) //***Che
			
			"----" A 0 A_Giveinventory("DragonslayerSelected",1) //***Che
			TNT1 A 0 A_Takeinventory("RailGunSelected",1)
			TNT1 A 0 A_Takeinventory("SubMachineGunSelected",1)
			TNT1 A 0 A_Takeinventory("RevenantLauncherSelected",1)
			TNT1 A 0 A_Takeinventory("LostSoulSelected",1)
			TNT1 A 0 A_Takeinventory("FlameCannonSelected",1)
			TNT1 A 0 A_Takeinventory("HasBarrel",1)
			DSLA A 1
			DSLA A 0 A_GunFlash // start the background tasks layer
			DSLA AAAAAA 1 A_Raise
			Goto Ready

		Deselect:
			DSLA A 1 A_Lower
			Loop
			
		AltFire:
			DSLC A 0
			DSLC A 0 A_GiveInventory ("PlayerIsFighting", 150) //***Che encourages the follower NPCs to get da fug out of your line of fire
			DSLC A 0 A_JumpIfInventory("PowerStrength", 1, "AltFireProperly")
			DSLC ABCD 4 //the slooooow windup when you have no berserk
			Goto Attack // alt fire is constant swinging
			
		AltFireProperly:	
			DSLC ABCD 1
			Goto Attack 
			
		Fire:
			DSLC A 0
			DSLC A 0 A_GiveInventory ("PlayerIsFighting", 150) //***Che encourages the follower NPCs to get da fug out of your line of fire
			"----" A 0 A_GiveInventory ("MeleeHold", 1)
			"----" A 0 A_TakeInventory ("MeleeSlash", 1)			

			DSLC A 0 A_JumpIfInventory("PowerStrength", 1, "FireProperly")
			DSLC ABCD 4 //the slooooow windup when you have no berserk
			Goto Hold
		FireProperly:
			DSLC ABCD 1
			Goto Hold
		Hold:
			DSLA A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
			DSLA B 1 Offset(-32, 32)
			"----" A 0 A_GiveInventory ("PlayerIsFighting", 20) // because there is a script draining it constantly - we have to recharge it!
			TNT1 A 0 A_Refire
		Attack:	
			"----" A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire")
			"----" A 0 A_TakeInventory ("MeleeHold", 1)
			"----" A 0 A_GiveInventory ("MeleeSlash", 1)
			"----" A 0 A_TakeInventory ("MeleeReverseSlash", 1)

			"----" A 0 A_JumpIfInventory("QPowerQuadDamage", 1, 2)
				"----" A 0 A_JumpIf(true, 2)
				"----" A 0 A_PlaySound("quaddamage/echo", CHAN_7)
			"----" A 0 A_JumpIfInventory("PowerStrength", 1, "AttackBerserk")
		
		AttackWeak:
			"----" A 0 A_PlaySound("weapons/gswing", 6)
			"----" A 0 A_TakeInventory("DSHit", 10)
			"----" A 0 A_TakeInventory("DSClang", 1) // a token used to only make the CLANG! sound once per swing
			
			// the attack is as powerful as one with berserk but three times slower and with much more interface screw
		
			// also *every* projectile makes the Quad Damage roar if it hits something that bleeds!
			
			DSLA B 1 Offset(-50, 33) A_FireCustomMissile("DSAttack", -40, 0, 40, 0, 2)
				DSLA B 1 Offset(-65, 34) A_FireCustomMissile("DSAttack", -25, 0, 30, 0, 2)
				DSLA B 1 Offset(-90, 35) A_FireCustomMissile("DSAttack2", -15, 20, 0, 0, 2)
			DSLA B 1 Offset(-120, 36) A_FireCustomMissile("DSAttack", -10, 0, 15, 0, 2)
				DSLA C 1 Offset(-155, 37) A_FireCustomMissile("DSAttack2", -5, 0, -10, 0, 2)
				DSLA C 1 Offset(-200, 38) A_FireCustomMissile("DSAttack", 5, 0, 10, 0, 2)
			DSLA C 1 Offset(-260, 40) A_FireCustomMissile("DSAttack", 20, 0, -15, 0, 2)
			DSLA C 1 Offset(-320, 49) A_FireCustomMissile("DSAttack2", 25, 0, -20, 0, 2)
			DSLA C 1 Offset(-490, 59) A_FireCustomMissile("DSAttack", 35, 0, -30, 0, 2)
			DSLA C 1 Offset(-620, 72) A_FireCustomMissile("DSAttack", 50,0, -40, 0, 2)

			TNT1 A 0 ACS_NamedExecuteAlways("FBD_DS_NoBer", 0, 0 ,0, 0) // Need BERSERK strength\nto handle properly!
			// Thw recoil and spin scripts calculate based on how many DSHit you have 
			//  in your inventory (given to you by the DSAttack actors, one per monster and two per map geometry)
			TNT1 A 0 A_Recoil(-CallAcs("FBD_DS_Recoil", 3)) 
			TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
			TNT1 A 0 A_PlaySound("player/usefail", CHAN_VOICE)	
			TNT1 AA 1 A_SetAngle(angle+CallAcs("FBD_DS_Spin",3))
			TNT1 A 0 A_Recoil(-CallAcs("FBD_DS_Recoil", 1))
			TNT1 AA 1 A_SetAngle(angle+CallAcs("FBD_DS_Spin",2))
			TNT1 AA 1 A_SetAngle(angle+CallAcs("FBD_DS_Spin",1))
			TNT1 A 5 A_Recoil(-CallAcs("FBD_DS_Recoil", 1))
			TNT1 A 8 A_GiveInventory("UsedStamina", 60)
			DSLC D 1 Offset(-64, 128)
			DSLC D 1 Offset(-32, 64)
			DSLC DDCCBBAA 1 A_SetAngle(angle-CallAcs("FBD_DS_Spin",1))
			"----" A 0 A_TakeInventory("DSHit", 10)
			"----" A 0 A_TakeInventory("DSClang", 1)
			"----" A 0 A_JumpIfInventory("PressedPrimary", 1, "Fire") //A_JumpIf(CallAcs("FBD_BoolInputAlt"), "")				
			Goto Ready		

		AttackBerserk:	
			TNT1 A 0 A_PlaySound("weapons/gswing", 1)
			
			"----" A 0 A_TakeInventory("DSHit", 10)
			"----" A 0 A_TakeInventory("DSClang", 1)
			
			//action native A_FireCustomMissile(class<Actor> missiletype, float angle = 0, bool useammo = true, int spawnofs_xy = 0, float spawnheight = 0, bool aimatangle = false, float pitch = 0);
			
			
			//***Che there were typos and the parameters in general were weird.
			// the aimatangle in general is a *boolean* parameter,
			// there is no sense passing 2 to it. Zandronum only checks
			// that it is non-zero.
			// attack origin far to the right (+40) but most attacks
			// aimed left (positive angle)

			DSLA C 1 A_FireCustomMissile("DSAttack", -40, 0, 40, 0, 2)
			DSLA C 0 A_FireCustomMissile("DSAttack", -25, 0, 40, 0, 2)		
			DSLA C 1 Offset(-50, 33) A_FireCustomMissile("DSAttack2", -15, 40, 0, 0, 2)
			DSLA C 0 Offset(-90, 35) A_FireCustomMissile("DSAttack", -10, 0, 25, 0, 2)
			DSLA C 1 Offset(-120, 36) A_FireCustomMissile("DSAttack2", -5, 0, 10, 0, 2)
			DSLA C 0 Offset(-155, 37) A_FireCustomMissile("DSAttack", 5, 0, -10, 0, 2)
			DSLA C 0 Offset(-200, 38) A_FireCustomMissile("DSAttack", 20, 0, -15, 0, 2)
			DSLA C 1 Offset(-260, 40) A_FireCustomMissile("DSAttack2", 25, 0, -20, 0, 2)
			DSLA C 1 Offset(-320, 49) A_FireCustomMissile("DSAttack", 35, 0, -30, 0, 2) 
			DSLA C 1 Offset(-490, 59) A_FireCustomMissile("DSAttack", 50,0, -40, 0, 2)
			DSLA C 1 Offset(-620, 72) 
			TNT1 A 0 A_Recoil(-7)
			TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
			TNT1 AA 1 A_SetAngle(angle+8)
			TNT1 AA 1 A_SetAngle(angle+4)
			TNT1 AA 1 A_SetAngle(angle+2)
			TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
			TNT1 A 5
			TNT1 AAAAAAAA 1 A_JumpIfInventory("PressedPrimaryOrAlt", 1, "Attack2") //A_JumpIfInventory("FiredPrimary", 1, "Attack2")
			DSLC D 1 Offset(-64, 128)
			DSLC D 1 Offset(-32, 64)
			DSLC DCBA 1 A_SetAngle(angle-2)
			"----" A 0 A_TakeInventory("DSHit", 10)
			"----" A 0 A_TakeInventory("DSClang", 1)
			Goto Ready
			
		Attack2:
			DSLA A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
			"----" A 0 A_GiveInventory ("MeleeReverseSlash", 1)
			
			"----" A 0 A_TakeInventory("DSHit", 10)
			"----" A 0 A_TakeInventory("DSClang", 1)
			
				"----" A 0 A_JumpIfInventory("QPowerQuadDamage", 1, 2)
				"----" A 0 A_JumpIf(true, 2)
				"----" A 0 A_PlaySound("quaddamage/echo", CHAN_7)
				"----" A 0 A_GiveInventory ("PlayerIsFighting", 150) //***Che encourages the follower NPCs to get da fug out of your line of fire
			
			
			TNT1 A 0 A_PlaySound("weapons/gswing", 1)
			
			DSLA E 1 A_FireCustomMissile("DSAttack", 40,0, -40, 0, 2)
			DSLA E 0 A_FireCustomMissile("DSAttack", 25, 0,-40, 0, 2)
			DSLA E 1 Offset(50, 33) A_FireCustomMissile("DSAttack2", 15, 0, -40, 0, 2)
			DSLA E 1 Offset(120, 36) A_FireCustomMissile("DSAttack", 10, 0,-25, 0, 2)
			DSLA E 0 Offset(180, 37) A_FireCustomMissile("DSAttack", -5, 0, 10, 0, 2)
			DSLA E 0 Offset(220, 38) A_FireCustomMissile("DSAttack2", 5, 0, -10, 0, 2)
			DSLA E 1 Offset(260, 40) A_FireCustomMissile("DSAttack2", -22, 0, 15, 0, 2)
			DSLA E 1 Offset(320, 49) A_FireCustomMissile("DSAttack", -20, 0, 20, 0, 2)
			DSLA E 1 Offset(490, 59) A_FireCustomMissile("DSAttack", -35, 0, 30, 0, 2)
			DSLA E 1 Offset(620, 72) A_FireCustomMissile("DSAttack", -50, 0,  40, 0, 2)
			TNT1 A 0 A_Recoil(-7)
			TNT1 AA 1 A_SetAngle(angle-8)
			TNT1 AA 1 A_SetAngle(angle-4)
			TNT1 AA 1 A_SetAngle(angle-2)
			DSLC D 1 Offset(64, 128)
			DSLC D 1 Offset(32, 64)
			"----" A 0 A_TakeInventory ("MeleeReverseSlash", 1)
			DSLC DCBA 1 A_SetAngle(angle+2)
			"----" A 0 A_TakeInventory("DSHit", 10)
			"----" A 0 A_TakeInventory("DSClang", 1)
			"----" A 0 A_JumpIfInventory("PressedAlt", 1, "Attack")	
			//"----" A 0 A_JumpIf(CallAcs("FBD_BoolInputAlt"), "Attack")	
			"----" A 0 A_TakeInventory ("MeleeSlash", 1)
			Goto Ready
		
		//***Che cloned from axe
		CheckSprint:
			DSLC A 0
			DSLC A 1 A_WeaponReady(WRF_NOFIRE)
			DSLC A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
			DSLC A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
			Goto Ready
			
		StartSprint:
			DSLC A 1 A_WeaponReady(WRF_NOFIRE)
			DSLC A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
			
			
		Sprinting:	
			Sprinting:	
			DSLC A 0 offset(-9,32) 
			DSLC A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
			DSLC A 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
			PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
			DSLC A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
			DSLC A 0 offset(-9,32) A_GiveInventory("UsedStamina", 2)
			DSLC A 0 offset(-9,32)
			DSLC A 1 offset(-9,34) A_SetPitch(pitch -0.5)
			DSLC A 1 offset(-6,36) A_SetPitch(pitch -0.5)
			DSLC A 1 offset(-3,38) A_SetPitch(pitch -0.5)
			DSLC A 1 offset(0,38) A_SetPitch(pitch -0.5)
			DSLC A 1 offset(3,36) A_SetPitch(pitch -0.5)
			DSLC A 1 offset(6,34) A_SetPitch(pitch -0.5)
			DSLC A 1 offset(9,32) A_SetPitch(pitch -0.5)
			DSLC A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
			DSLC A 0 A_JumpIfInventory("Kicking",1,"DoKick")
			DSLC A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			DSLC A 0 offset(-9,32) A_GiveInventory("UsedStamina", 2)
			DSLC A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
			DSLC A 1 offset(9,34) A_SetPitch(pitch +0.5)
			DSLC A 1 offset(6,36) A_SetPitch(pitch +0.5)
			DSLC A 1 offset(3,38) A_SetPitch(pitch +0.5)
			DSLC A 1 offset(0,38) A_SetPitch(pitch +0.5)
			DSLC A 1 offset(-3,36) A_SetPitch(pitch +0.5)
			DSLC A 1 offset(-6,34) A_SetPitch(pitch +0.5)
			DSLC A 1 offset(-9,32) A_SetPitch(pitch +0.5)
			DSLC A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
			DSLC A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
			
			Goto StopSprint
		StopSprintTired:
			DSLC A 1
			DSLC A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
			DSLC A 0 A_PlaySound("Tired", 2)
			DSLC A 0 A_TakeInventory("UsedStamina", 2)
			DSLC A 5 A_WeaponReady
			DSLC A 0 A_TakeInventory("UsedStamina", 2)
			DSLC A 5 A_WeaponReady
			DSLC A 0 A_TakeInventory("UsedStamina", 2)
			DSLC A 5 A_WeaponReady
			DSLC A 0 A_TakeInventory("UsedStamina", 2)
			DSLC A 5 A_WeaponReady
			DSLC A 0 A_TakeInventory("UsedStamina", 2)
			DSLC A 5 A_WeaponReady
			Goto Ready
		StopSprint:
			DSLC A 1
			DSLC A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
			DSLC A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
			Goto Ready				
			
		Spawn:
			DSLC P 1
			DSLC P -1
			Stop
		
		
	
	}
}


//***Che: fast projectiles cannot read target's inventory
//  so I use ACS scripts to communicate with the player pawn
//  (weapons run in the context of the player pawn)

Actor DSClang : Inventory
{
	inventory.maxamount 1 
}

Actor DSHit : Inventory // slows the berserkless swing
// but prevents berserkless swing turning you around 
{
	inventory.maxamount 10 
}


ACTOR DSAttack: FastProjectile
{
	Radius 24
	Height 2
	DamageType Cut
	+MISSILE
	+FORCEXYBILLBOARD
	+FORCERADIUSDMG
	+BLOODSPLATTER
	RenderStyle Add
	Alpha 0.6
    Damage (random(200,200))
    Speed 60
	SeeSound "none"
	DeathSound "none"
	decal "SawHorizontal"
	Scale 0.01
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 1 BRIGHT
			Stop
			
		Death: // hit a wall
			TNT1 A 0
			//you can *give* just fine, you just can't check.
			TNT1 A 0 A_GiveInventory("DSHit", 2, AAPTR_TARGET)
			TNT1 A 0
			TNT1 A 0 Radius_Quake (4, 6, 0, 5, 0)//(intensity, duration, damrad, tremrad, tid)
			TNT1 A 0 A_SpawnItem ("Sparks", 0)
			TNT1 A 0 A_Explode(10, 24, 0)
			// Script adds target inventory (which DECORATE actor cannot do)
			//   and returns 1 if already had it. 
			// So, there will be only *one* big clang per swing!
			TNT1 A 0 A_JumpIf(CallACS("FBD_DS_Clang"), 3)
			TNT1 A 0 A_PlaySound("BRKCLANG", 6)
			TNT1 A 0 A_ALertMonsters(1200)
			TNT1 A 0 A_CustomMissile ("PlasmaSmoke", 2, 0, random (0, 360), 2, random (30, 170))
			TNT1 A 0 A_CheckFloor("SpawnFloor")
			TNT1 AAAAAAAAAAAAAAAA 0 A_CustomMissile ("SparkX", 2, 0, random (0, 360), 2, random (30, 170))
			//TNT1 A 0 A_JumpIfInTargetInventory("PowerStrength", 1, "Berserk")
			TNT1 A 10
			Stop
				
	
		SpawnFloor:
			TNT1 A 0
			AXEG A 0 Acs_namedexecuteWithResult("BDCheckFloorType")
			//TNT1 A 2
			TNT1 A 0 A_JumpIfInventory("IsOverWater", 1, "SpawnWater")
			TNT1 A 0 A_JumpIfInventory("IsOverNukage", 1, "SpawnNukage")
			TNT1 A 0 A_JumpIfInventory("IsOverSlime", 1, "SpawnSlime")
			TNT1 A 0 A_JumpIfInventory("IsOverBlood", 1, "SpawnBlood")
			TNT1 A 0 A_JumpIfInventory("IsOverLava", 1, "SpawnLava")
			TNT1 A 0 A_JumpIfInventory("IsOverGrass", 1, "SpawnDirt")
			TNT1 A 0 A_JumpIfInventory("IsOverSand", 1, "SpawnSand")
			
			PUFF A 0 bright A_PlaySound("ricochet/hit")
			TNT1 A 0 A_SpawnItem ("YellowFlareSmall", 0)
			TNT1 A 0 A_SetScale(-0.6)
			TNT1 A 0 A_Jump (132, 15)
			FX58 ABCD 1 BRIGHT 
			TNT1 A 0 A_CustomMissile("OldschoolRocketSmokeTrail2Bigger", 2, 0, random (0, 360), 2, random (0, 360))
			FX58 EFGHIJ 1 bright
			Stop
			TNT1 AAAAA 0
			FX57 ABCD 1 BRIGHT 
			TNT1 A 0 A_CustomMissile("OldschoolRocketSmokeTrail2Bigger", 2, 0, random (0, 360), 2, random (0, 360))
			FX57 EFGHIJ 1 bright
			stop
		
		SpawnWater:
			TNT1 A 0
			TNT1 AAAAA 0 A_CustomMissile ("WaterParticleXFAster", 8, 0, random (0, 360), 2, random (30, 160))
			TNT1 AAAAA 0 A_CustomMissile ("WaterParticleXSuperFast", 24, 0, random (0, 360), 2, random (30, 160))
			TNT1 A 0 A_SpawnItem("WaterSplashWaves")
			TNT1 A 0 A_SetScale(0.5, 0.5)
			SPHW ABCDE 3
			Stop
		
		SpawnSlime:
			TNT1 A 0
			TNT1 AAAAA 0 A_CustomMissile ("SLimeParticleXFAster", 8, 0, random (0, 360), 2, random (30, 160))
			TNT1 AAAAA 0 A_CustomMissile ("SlimeParticleXFAster", 24, 0, random (0, 360), 2, random (30, 160))
			TNT1 A 0 A_SpawnItem("SlimeSplashWaves")
			TNT1 A 0 A_SetScale(0.5, 0.5)
			SPHB ABCDE 3
			Stop
		
		
		SpawnNukage:
			TNT1 A 0
			TNT1 AAAAA 0 A_CustomMissile ("nukageParticleXFAster", 8, 0, random (0, 360), 2, random (30, 160))
			TNT1 AAAAA 0 A_CustomMissile ("nukageParticleXFAster", 24, 0, random (0, 360), 2, random (30, 160))
			TNT1 A 0 A_SpawnItem("NukageSplashWaves")
			TNT1 A 0 A_SetScale(0.5, 0.5)
			SPHG ABCDE 3
			Stop
		
		SpawnBlood:
			TNT1 A 0
			TNT1 AAAAA 0 A_CustomMissile ("BloodParticleXFAster", 8, 0, random (0, 360), 2, random (30, 160))
			TNT1 AAAAA 0 A_CustomMissile ("BloodParticleXFAster", 24, 0, random (0, 360), 2, random (30, 160))
			TNT1 A 0 A_SpawnItem("BloodSplashWaves")
			TNT1 A 0 A_SetScale(0.5, 0.5)
			SPHR ABCDE 3
			Stop
		
		SpawnLava:
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrailDarker", 12, 0, random (160, 210), 2, random (10, 90))
			TNT1 A 0 A_SpawnItemEx("TinyBurningPiece3", random (-5, 5), random (-5, 5))
			TNT1 AAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 10, 0, random (0, 180), 2, random (10, 90))
			TNT1 A 0 A_SetScale(0.5, 0.5)
			INFE ABCDEFGHIJKLMNOPQR 1 BRIGHT 
			INFE ST 1 BRIGHT A_CustomMissile ("OldschoolRocketSmokeTrailDarker", 32, 0, random (160, 210), 2, random (10, 90))
			TNT1 AAA 4 A_CustomMissile ("OldschoolRocketSmokeTrailDarker", 14, 0, random (160, 210), 2, random (10, 90))
			Stop
		
		
		SpawnDirt:
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("BrownCloudSmallLong", 0, 0, random (0, 360), 2, random (10, 150))
			TNT1 AA 0 A_CustomMissile ("DirtChunk3", 0, 0, random (0, 360), 2, random (30, 150))
			TNT1 AA 0 A_CustomMissile ("DirtChunk4", 0, 0, random (0, 360), 2, random (30, 150))
			TNT1 A 0 A_CustomMissile ("MudDustSmall", 4, 0, random (0, 360), 2, random (30, 150))
			TNT1 A 0 A_SpawnItem("DirtRicochet")
			Stop
		
		
		SpawnSand:
			TNT1 A 0
			TNT1 A 0 A_CustomMissile ("SandCloudSmallLong", 0, 0, random (0, 360), 2, random (10, 90))
			TNT1 A 0 A_CustomMissile ("SandCloudSmall", 0, 0, random (0, 360), 2, random (10, 90))
			TNT1 A 0 A_CustomMissile ("SandDustSmall", 4, 0, random (0, 360), 2, random (30, 150))
			Stop
		
		XDeath: // hit a bleeding actor
			TNT1 A 0 
			TNT1 A 0 A_JumpIf(!CallAcs("FBD_DS_Quad"), 2)
			TNT1 A 0 A_PlaySound("quaddamage/echo", CHAN_7)
		//Melee: //***Che i don't know what this is so I comment it out
		Crash: // hit a non-bleeding actor
			TNT1 A 0
			TNT1 A 0 A_GiveInventory("DSHit", 1, AAPTR_TARGET)
			PUFF A 0 A_PlaySound("player/cyborg/fist", 3)
			TNT1 A 0 A_PlaySound("AXEHIT", 6)
			//TNT1 A 0 A_PlaySound("B2KCLANG", 1)
			TNT1 A 0 A_SpawnItemEx ("PLOFT2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 Radius_Quake (2, 6, 0, 5, 0)//(intensity, duration, damrad, tremrad, tid)
			
			//***Che this never worked because fast projectiles cannot check target's inventory
			//TNT1 A 0 A_JumpIfInTargetInventory("PowerStrength", 1, "Berserk")
			TNT1 A 10
			Stop
/* this never worked and its fine without				
		Berserk:
			TNT1 A 1
			TNT1 A 0 A_explode(90, 5, 0)
			TNT1 A 10
			Stop
*/			
	
	}
}



Actor DSAttack2: DSAttack
{
	+RIPPER
	-BLOODSPLATTER
	+NOBLOOD
	Damagetype "Extreme"
	Damage (random(5,5))
	//***Che this inflicts 5 * 8 = 40 damage because ripper rips exactly 8 times per tic
}