//==============================================================================
//		BASE RL WEAPON PICKUP
//==============================================================================

ACTOR RLBaseWeaponPickup : CustomInventory
{
	Tag "Unknown Weapon [Pickup]"
	var int user_floorhit;
	
	Radius 16
	Height 8
	Inventory.PickupMessage ""
	Inventory.PickupSound ""
	-SPECIAL
	+THRUACTORS
	+NOBLOCKMONST
	+WEAPONSPAWN
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 0, "NoSpecialStartsStuff")
		"####" "#" 0 A_Jump(256, "SpecialStartsStuff")
		Goto SpecialStartsStuff
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamStandard", 0, 0, 0, 0, 0, 0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
		
	SpawnFrame:
		PISG X 4
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
		
	SpawnLoop:
		"####" "#" 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("weapons/gundropsmall")
		"####" "#" 0 A_Jump(256, "FloorHitFinish")
		Goto FloorHitFinish
	FloorHitFinish:
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
	Pickup:
		"####" "#" 0
		Fail
	NotPickup_NoPrint:
		"####" "#" 0
		Fail
//==============================================================================
	SpecialStartsStuff:
		"####" "#" 0 A_JumpIf(CallACS("DRPGCheckTiem"), "NoSpecialStartsStuff")
		"####" "#" 0 A_JumpIf(CallACS("DRLA_specialstarts") == 1, "KeenStuff")
		"####" "#" 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2Stuff")
		"####" "#" 0 A_JumpIf(CallACS("DRLA_specialstarts") == 3, "MarathonStuff")
		"####" "#" 0 A_JumpIf(CallACS("DRLA_specialstarts") == 4, "SuperweaponStuff")
		"####" "#" 0 A_Jump(256, "NoSpecialStartsStuff")
		Goto NoSpecialStartsStuff
	KeenStuff:
		"####" "#" 0 A_SpawnItemEx("RLNeuralStunnerPickup",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	Duke2Stuff:
		"####" "#" 0 A_SpawnItemEx("RLDuke2WeaponCrate",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	MarathonStuff:
		"####" "#" 0 A_SpawnItemEx("RLMarathonPistolClip",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
	SuperweaponStuff:
		"####" "#" 0 A_SpawnItemEx("RLSuperweaponModeSpawner",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
//==============================================================================
//					--	DRPG Compatibility Stuff  --
//==============================================================================
	DRPGInit:
		"####" "#" 0 ACS_NamedExecuteAlways("ItemInit", 0)
		"####" "#" 0 A_Jump (256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLStandardWeaponPickup : RLBaseWeaponPickup
{
    //$category "Standard Weapon"
}

ACTOR RLMasterAssembledWeaponPickup : RLBaseWeaponPickup
{
    //$category "Master Assembled Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_JumpIf(CallACS("DRLA_opengl"), 3) // If enabled, rarity beam will be cyan, rather than blue
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembled", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump(256,2)
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembledDRPG", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLAdvancedAssembledWeaponPickup : RLBaseWeaponPickup
{
    //$category "Advanced Assembled Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_JumpIf(CallACS("DRLA_opengl"), 3) // If enabled, rarity beam will be cyan, rather than blue
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembled", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump(256,2)
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembledDRPG", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLBasicAssembledWeaponPickup : RLBaseWeaponPickup
{
    //$category "Basic Assembled Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_JumpIf(CallACS("DRLA_opengl"), 3) // If enabled, rarity beam will be cyan, rather than blue
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembled", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump(256,2)
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamAssembledDRPG", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLExoticWeaponPickup : RLBaseWeaponPickup
{
    //$category "Exotic Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamExotic", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLSuperiorWeaponPickup : RLBaseWeaponPickup
{
    //$category "Superior Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamSuperior", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLUniqueWeaponPickup : RLBaseWeaponPickup
{
    //$category "Unique Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamUnique", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLDemonicWeaponPickup : RLBaseWeaponPickup
{
    //$category "Demonic Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamDemonic", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

ACTOR RLLegendaryWeaponPickup : RLBaseWeaponPickup
{
    //$category "Legendary Weapon"
	+DONTGIB
	States
	{
	NoSpecialStartsStuff:
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendary", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		"####" "#" 0 A_Jump(256, "SpawnFrame")
		Goto SpawnFrame
	}
}

// EOF