
//==============================================================================
//		BASE ARMOR PICKUP
//==============================================================================

// Super ultra miracle revamped armor pickup inheritance shenanigan code.
// This is gonna save me a lot of work in the future, that's for sure.
ACTOR RLGenericArmorPickup : CustomInventory 18000
{
	Radius 20
	Height 16
    -COUNTITEM
	-SPECIAL
	+THRUACTORS
	+NOBLOCKMONST
    +INVENTORY.INVBAR
    +INVENTORY.UNTOSSABLE
    //$category "Standard Armor"
    Tag "Generic Armor"
    Inventory.InterHubAmount 99
    Inventory.MaxAmount 99
    Inventory.Icon "ARM0BOX"
    Inventory.Pickupmessage ""
	Inventory.PickupSound "misc/rlarmor1"
	Inventory.UseSound "armor/equip"
	Inventory.RespawnTics 10500
	
	var int user_floorhit;
	States
	{
	Spawn:
		TNT1 A 0
// This section can be used and expanded on for any additional startup checks in the future.
		TNT1 A 0 A_Jump (256, "SpawnRarityBeam")
		Goto SpawnRarityBeam
		
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamStandard", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
	SpawnDRPGCheck:
// Initialize the item with DoomRPG so it can be used with cool stuff.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		TNT1 A 0 A_Jump (256, "SpecialStartCheck")
		Goto SpecialStartCheck
		
    SpecialStartCheck:
// Check for special gameplay starts that might modify the armor pickup.
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2Stuff")
		TNT1 A 0 A_CheckFloor ("SpawnOnFloor")
		TNT1 A 0 A_Jump (256, "SpawnLoopFall")
		Goto SpawnLoopFall
		
    SpawnLoopFall:
		ARM0 A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	FloorHit:
		"####" "#" 0 A_PlaySound("armor/drop", 7, 1, 0, 1.5)
		"####" "#" 0 A_ScaleVelocity (0.25)
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
		
	SpawnOnFloor:
		"####" "#" 0 A_ChangeFlag("SPECIAL", true)
		"####" "#" 0 A_ChangeFlag("THRUACTORS", false)
		"####" "#" 0 A_SetUserVar("user_floorhit", 1)
		"####" "#" 0 A_Jump(256, "SpawnLoop")
		Goto SpawnLoop
		
	SpawnLoop:
// Play the armor's sprite animation.
		ARM0 A 6
		ARM0 B 6 Bright
		Loop
		
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
//		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "PickupNonLimited")// Not actually needed, hahahaha
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLArmorInInventory",1)
		TNT1 A 0 A_Jump (256, "PickupDisplayMessage")
		Goto PickupDisplayMessage
/*		
	PickupNonLimited:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
        TNT1 A 0 ACS_NamedExecuteWithResult("CheckCapacity") // Special Capacity checking function for armor
		TNT1 A 0 A_Jump (256, "PickupDisplayMessage")
		Goto PickupDisplayMessage
*/		
		
//------------------------------------------------------------------------------
	Use:
		TNT1 A 0
// Check to see if an armor modpack is currently active.
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemActivate",1,"ArmorModReconfigure")
		TNT1 A 0 A_JumpIfInventory("RLUseOnyxMod",1,"OnyxModActivate")
		TNT1 A 0 A_Jump (256, "NoArmorModpackActive")
		Goto NoArmorModpackActive
		
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLGenericArmorUse",1,"ArmorEquip")
		TNT1 A 0 A_Jump (256, "UseTokenRemoval")
		Goto UseTokenRemoval
		
	UseTokenGiven:
// Gives you the identifier that indicates what armor you are manipulating right now.
		TNT1 A 0 A_GiveInventory("RLGenericArmorUse", 1)
// Check to see if you are already wearing armor and change the activation message.
		TNT1 A 0 A_Jump (256, "ArmorWornCheck")
		Goto ArmorWornCheck
		
	ArmorEquip:
// First, check to see if you have an active Doorpeg shield.
		TNT1 A 0 A_JumpIfInventory("DRPGDRLAActive",1,"DoorpegShieldCheck")
// Next, check to see if you are already wearing armor.
		TNT1 A 0 A_Jump (256, "ArmorWornCheckEquipping")
		Goto ArmorWornCheckEquipping
		
	ArmorEquipTokens:
		TNT1 A 0 A_TakeInventory("RLGenericArmorUse",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
// Give the Token and/or Bonus items that are used to define the armor as being worn.
		TNT1 A 0 A_GiveInventory("RLGenericArmorToken",1)
		TNT1 A 0 A_GiveInventory("RL100ArmorWorn",1)
// Give a different armor based on whether or not you are the Renegade.
		TNT1 A 0 A_JumpIfInventory("RLShellshockPerk",1,"RenegadeEquip")
		TNT1 A 0 A_GiveInventory("RLGenericArmor",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish
		
// The Renegade gets a version of the armor with 1.5x more protection, up to a max of 80%.
	RenegadeEquip:
		TNT1 A 0 A_GiveInventory("RLGenericArmorRenegade",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_TakeInventory("RLOnyxModItem",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_TakeInventory("RLGenericArmorPickup", 1)
		TNT1 A 0 A_PlaySound ("modpack/onyx", 7, 1, 0, 1.8)
		TNT1 A 0 A_SpawnItemEx("RLAaaghSphere", 32,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION)
		TNT1 A 0 A_Print("As an award for doing weird shit, you get a thingy.")
		TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1,2)
		TNT1 A 0 A_TakeInventory("RLModLimit", 1)
		Fail
		TNT1 A 0 A_TakeInventory("RLScavengerModLimit", 1)
		Fail
		
//------------------------------------------------------------------------------
// Armor modpack checking begins here.
	ArmorModReconfigure:
// Detect what kind of armor modpack you are carrying.
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_Jump (256, "ArmorModReconfigureCheckModType")
		Goto ArmorModReconfigureCheckModType
		
	ArmorModReconfigureCheckModType:
		TNT1 A 0 A_JumpIfInventory("RLArmorModItem", 1, "ArmorModpackGreen")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue", 1, "ArmorModpackBlue")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed", 1, "ArmorModpackRed")
// This armor is unalterable.
		TNT1 A 0 A_Jump (256, "NoArmorModpackActive")
		Goto NoArmorModpackActive
		
			ArmorModpackGreen:
// Reconfigure the selected armor into a Security (Green) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItem",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLGreenArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\cjGeneric Armor \c-reconfigured into \cdSecurity Armor.")
		Stop
		
			ArmorModpackBlue:
// Reconfigure the selected armor into a Combat (Blue) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItemBlue",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLBlueArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\cjGeneric Armor \c-reconfigured into \chCombat Armor.")
		Stop
		
			ArmorModpackRed:
// Reconfigure the selected armor into a Commando (Red) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItemRed",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLRedArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\cjGeneric Armor \c-reconfigured into \cgCommando Armor.")
		Stop
		
	IncompatibleArmorMod:
// Clear all the use tokens and print a message saying this doesn't work.
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_Print("This armor modpack type is incompatible/nwith the selected armor.", 8)
		Fail
		
//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		TNT1 A 0 A_Print("Picked up the \cjGeneric Armor.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\cjGeneric Armor \c-equipped.", 2)
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		Stop
	NotEquip:
// You are stupid. Stop being stupid.
		TNT1 A 0 A_Print("You are already wearing armor.", 2)
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		Fail
		
	ArmorAlreadyEquipped:
// You are wearing armor, but you can still drop the armor you are manipulating.
		TNT1 A 0 A_JumpIfInventory("RLArmorModItem", 1, "ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue", 1, "ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed", 1, "ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "ArmorAlreadyEquippedMessage")
		Goto ArmorAlreadyEquippedMessage
	ArmorAlreadyEquippedMessage:
// Check for an Onyx mod in your inventory, and print a different string if there is.
// Comment out the jump if it cannot be Onyx modded.
		TNT1 A 0 A_JumpIfInventory("RLOnyxModItem", 1, "ArmorAlreadyEquippedMessage2")
		TNT1 A 0 A_Jump (256, "ArmorAlreadyEquippedMessage1")
		Goto ArmorAlreadyEquippedMessage1
	ArmorAlreadyEquippedMessage1:
		TNT1 A 0 A_Print("Press \caDrop Item (DRLA)\c- to drop the selected armor, or switch weapons to cancel.", 5)
		Fail
	ArmorAlreadyEquippedMessage2:
		TNT1 A 0 A_Print("Press \caDrop Item (DRLA)\c- to drop the selected armor, or switch weapons to cancel.\n\nYou may activate an \cuOnyx\c- modpack to make this armor \cuindestructible\c-.", 5)
		Fail
	ArmorAlreadyEquippedArmorMod:
// Check for an Onyx mod in your inventory, and print a different string if there is.
// Comment out the jump if it cannot be Onyx modded.
		TNT1 A 0 A_JumpIfInventory("RLOnyxModItem", 1, "ArmorAlreadyEquippedArmorMod2")
		TNT1 A 0 A_Jump (256, "ArmorAlreadyEquippedArmorMod1")
		Goto ArmorAlreadyEquippedArmorMod1
	ArmorAlreadyEquippedArmorMod1:
		TNT1 A 0 A_Print("Press \caDrop Item (DRLA)\c- to drop the selected armor, or switch weapons to cancel.\n\nYou may activate a compatible armor modpack to\nconvert this armor to a different type.", 8)
		Fail
	ArmorAlreadyEquippedArmorMod2:
		TNT1 A 0 A_Print("Press \caDrop Item (DRLA)\c- to drop the selected armor, or switch weapons to cancel.\n\nYou may activate a compatible armor modpack to\nconvert this armor to a different type.\n\nYou may activate an \cuOnyx\c- modpack to make this armor \cuindestructible\c-.", 8)
		Fail
		
	NoArmorEquipped:
// You are free to either wear the armor or drop it.
		TNT1 A 0 A_JumpIfInventory("RLArmorModItem", 1, "NoArmorEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue", 1, "NoArmorEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed", 1, "NoArmorEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "NoArmorEquippedMessage")
		Goto NoArmorEquippedMessage
	NoArmorEquippedMessage:
// Check for an Onyx mod in your inventory, and print a different string if there is.
// Comment out the jump if it cannot be Onyx modded.
		TNT1 A 0 A_JumpIfInventory("RLOnyxModItem", 1, "NoArmorEquippedMessage2")
		TNT1 A 0 A_Jump (256, "NoArmorEquippedMessage1")
		Goto NoArmorEquippedMessage1
	NoArmorEquippedMessage1:
		TNT1 A 0 A_Print("Use the armor again to wear it.\n\nPress \caDrop Item (DRLA)\c- to drop it, or switch weapons to cancel.", 5)
		Fail
	NoArmorEquippedMessage2:
		TNT1 A 0 A_Print("Use the armor again to wear it.\n\nPress \caDrop Item (DRLA)\c- to drop it, or switch weapons to cancel.\n\nYou may activate an \cuOnyx\c- modpack to make this armor \cuindestructible\c-.", 5)
		Fail
	NoArmorEquippedArmorMod:
// You may also convert it with an armor modpack.
// Check for an Onyx mod in your inventory, and print a different string if there is.
// Comment out the jump if it cannot be Onyx modded.
		TNT1 A 0 A_JumpIfInventory("RLOnyxModItem", 1, "NoArmorEquippedArmorMod2")
		TNT1 A 0 A_Jump (256, "NoArmorEquippedArmorMod1")
		Goto NoArmorEquippedArmorMod1
	NoArmorEquippedArmorMod1:
		TNT1 A 0 A_Print("Use the armor again to wear it.\n\nPress \caDrop Item (DRLA)\c- to drop it, or switch weapons to cancel.\n\nYou may activate a compatible armor modpack to\nconvert this armor to a different type.", 8)
		Fail
	NoArmorEquippedArmorMod2:
		TNT1 A 0 A_Print("Use the armor again to wear it.\n\nPress \caDrop Item (DRLA)\c- to drop it, or switch weapons to cancel.\n\nYou may activate a compatible armor modpack to\nconvert this armor to a different type.\n\nYou may activate an \cuOnyx\c- modpack to make this armor \cuindestructible\c-.", 8)
		Fail
		
	NotPickup:
// This is for when you walk over an armor you cannot pick up.
		TNT1 A 0 A_JumpIfInventory("DRLA_ArmorAntiLogFloodCheck",1,"NotPickup_NoPrint")
		TNT1 A 0 A_GiveInventory("DRLA_ArmorAntiLogFloodCheck")
		TNT1 A 0 A_Print("\cj= Generic Armor =", 2, "CONFONT")
		Fail
	 NotPickup_NoPrint:	
// A cooldown dummy power prevents the message from spamming your console.
		TNT1 A 0
		Fail
		
//------------------------------------------------------------------------------
// Armor checking is grouped down here.

// Oh god the list. THE LIST. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
// This used a different system before, but it was a pain, really. And sorta became redundant.
//------------------------------------------------------------------------------
// This one checks to see if you are already wearing armor when first activating the item.
// If armor is detected being worn, it will print a different message accordingly.
	ArmorWornCheck:
// = THIS PART NEEDS TO BE CONSTANTLY UPDATED FOR ALL ARMORS IN INVENTORY =
		TNT1 A 0 A_JumpIfInventory("RLGenericArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLRedArmorToken",1,"ArmorAlreadyEquipped")
		
		TNT1 A 0 A_JumpIfInventory("RLCerberusArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLFireShieldArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLTowerShieldArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLTacticalArmorToken",1,"ArmorAlreadyEquipped")
		
		TNT1 A 0 A_JumpIfInventory("RLAblativeGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLAblativeBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLAblativeRedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBallisticGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBallisticBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBallisticRedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLCybernanoGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLCybernanoBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLCybernanoRedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLFireproofGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLFireproofBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLFireproofRedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberRedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberSkinGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberSkinBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberSkinRedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLPowerGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLPowerBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLPowerRedArmorToken",1,"ArmorAlreadyEquipped")
		
		TNT1 A 0 A_JumpIfInventory("RLBallisticShieldArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBallisticVestArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBulletProofVestArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLCyberwarriorArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLDuelistArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLEnergyShieldedVestArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLEnergyShieldArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLGothicArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLMedicalArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNuclearArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLPhaseshiftArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLPlasmaShieldArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLRechargeableEnergyShieldArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLRepulsionWaveSuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLSurvivalMediArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOnyxArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOverchargeSystemArmorToken",1,"ArmorAlreadyEquipped")
		
		TNT1 A 0 A_JumpIfInventory("RLBerserkerArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBerserkPowersuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLBlazingPhoenixDeviceSuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLCyberneticArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLEnergyDischargeHarnessArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLFrontlineEngineerSuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLGeosGoldenGauntletArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLJetpackArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLKateMatterstormHarnessArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLKyleTeslaboltArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLLavaArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLMaleksArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLMedicalPowerArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNanoAblativeArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNecroArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLNuclearPowerArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLPrototypeAssaultShieldArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLRoystensCommandArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLRyanCordellPsychicAmplifierSuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLShieldedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLSoloOperativeSuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLSoulshatterArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLTacticalAssemblerSuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLTerminusEst13BattlesuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLTorgueBlastplateArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLXaserPowerArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLZeroDiamondAssaultForceArmorToken",1,"ArmorAlreadyEquipped")
		
		TNT1 A 0 A_JumpIfInventory("RLDemonicCarapaceArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLGenericArmorToken",1,"ArmorAlreadyEquipped")
		
		TNT1 A 0 A_JumpIfInventory("RLAngelicArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLTheBeeArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLReactiveShieldSystemArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLChronotrooperArmorToken",1,"ArmorAlreadyEquipped")
		
		TNT1 A 0 A_JumpIfInventory("RLOModGreenArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModBlueArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModRedArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModBallisticVestArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModBulletProofVestArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModCyberwarriorArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModDuelistArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModEnergyShieldedVestArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModGothicArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModMedicalArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModPhaseshiftArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModRepulsionWaveSuitArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_JumpIfInventory("RLOModSurvivalMediArmorToken",1,"ArmorAlreadyEquipped")
		TNT1 A 0 A_Jump (256, "NoArmorEquipped")
		Goto NoArmorEquipped
//------------------------------------------------------------------------------
// This one checks to see if you are already wearing armor when confirming activation the item.
// If armor is detected being worn, it will prevent you from wearing it and print a message for it.
	ArmorWornCheckEquipping:
// = THIS PART NEEDS TO BE CONSTANTLY UPDATED FOR ALL ARMORS IN INVENTORY =
		TNT1 A 0 A_JumpIfInventory("RLGenericArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLRedArmorToken",1,"NotEquip")
		
		TNT1 A 0 A_JumpIfInventory("RLCerberusArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLFireShieldArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLTowerShieldArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLTacticalArmorToken",1,"NotEquip")
		
		TNT1 A 0 A_JumpIfInventory("RLAblativeGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLAblativeBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLAblativeRedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBallisticGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBallisticBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBallisticRedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLCybernanoGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLCybernanoBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLCybernanoRedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLFireproofGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLFireproofBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLFireproofRedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberRedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberSkinGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberSkinBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNanofiberSkinRedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLPowerGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLPowerBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLPowerRedArmorToken",1,"NotEquip")
		
		TNT1 A 0 A_JumpIfInventory("RLBallisticShieldArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBallisticVestArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBulletProofVestArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLCyberwarriorArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLDuelistArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLEnergyShieldedVestArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLEnergyShieldArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLGothicArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLMedicalArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNuclearArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLPhaseshiftArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLPlasmaShieldArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLRechargeableEnergyShieldArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLRepulsionWaveSuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLSurvivalMediArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOnyxArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOverchargeSystemArmorToken",1,"NotEquip")
		
		TNT1 A 0 A_JumpIfInventory("RLBerserkerArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBerserkPowersuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLBlazingPhoenixDeviceSuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLCyberneticArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLEnergyDischargeHarnessArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLFrontlineEngineerSuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLGeosGoldenGauntletArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLJetpackArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLKateMatterstormHarnessArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLKyleTeslaboltArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLLavaArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLMaleksArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLMedicalPowerArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNanoAblativeArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNecroArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLNuclearPowerArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLPrototypeAssaultShieldArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLRoystensCommandArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLRyanCordellPsychicAmplifierSuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLShieldedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLSoloOperativeSuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLSoulshatterArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLTacticalAssemblerSuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLTerminusEst13BattlesuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLTorgueBlastplateArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLWildWeaselPeacekeeperArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLXaserPowerArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLZeroDiamondAssaultForceArmorToken",1,"NotEquip")
		
		TNT1 A 0 A_JumpIfInventory("RLDemonicCarapaceArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLGenericArmorToken",1,"NotEquip")
		
		TNT1 A 0 A_JumpIfInventory("RLAngelicArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLTheBeeArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLReactiveShieldSystemArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLChronotrooperArmorToken",1,"NotEquip")
		
		TNT1 A 0 A_JumpIfInventory("RLOModGreenArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModBlueArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModRedArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModBallisticVestArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModBulletProofVestArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModCyberwarriorArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModDuelistArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModEnergyShieldedVestArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModGothicArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModMedicalArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModPhaseshiftArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModRepulsionWaveSuitArmorToken",1,"NotEquip")
		TNT1 A 0 A_JumpIfInventory("RLOModSurvivalMediArmorToken",1,"NotEquip")
		TNT1 A 0 A_Jump (256, "ArmorEquipTokens")
		Goto ArmorEquipTokens
		
//------------------------------------------------------------------------------
// This one simply removes all armor manipulation tokens.
// This will cut down on some weirdness when fiddling with multiple armors.
// I coooooould simply use the RLItemManipulationRemover thing I made, but I don't
// know if it'll finish doing it's job before the next part of this kicks in.
	UseTokenRemoval:
// = THIS PART NEEDS TO BE CONSTANTLY UPDATED FOR ALL ARMORS IN INVENTORY =
// Removes all other armor manipulation tokens to cut down on insanity.
		TNT1 A 0 A_TakeInventory("RLGenericArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLRedArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLCerberusArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLFireShieldArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLTowerShieldArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLTacticalArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLAblativeGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLAblativeBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLAblativeRedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBallisticGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBallisticBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBallisticRedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLCybernanoGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLCybernanoBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLCybernanoRedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLFireproofGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLFireproofBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLFireproofRedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNanofiberGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNanofiberBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNanofiberRedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNanofiberSkinGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNanofiberSkinBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNanofiberSkinRedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLPowerGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLPowerBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLPowerRedArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLBallisticShieldArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBallisticVestArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBulletProofVestArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLCyberwarriorArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLDuelistArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLEnergyShieldedVestArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLEnergyShieldArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLGothicArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLMedicalArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNuclearArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLPhaseshiftArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLPlasmaShieldArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLRechargeableEnergyShieldArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLRepulsionWaveSuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLSurvivalMediArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOnyxArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOverchargeSystemArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLBerserkerArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBerserkPowersuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLBlazingPhoenixDeviceSuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLCyberneticArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLEnergyDischargeHarnessArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLFrontlineEngineerSuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLGeosGoldenGauntletArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLJetpackArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLKateMatterstormHarnessArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLKyleTeslaboltArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLLavaArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLMaleksArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLMedicalPowerArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNanoAblativeArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNecroArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLNuclearPowerArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLPrototypeAssaultShieldArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLRoystensCommandArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLRyanCordellPsychicAmplifierSuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLShieldedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLSoloOperativeSuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLSoulshatterArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLTacticalAssemblerSuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLTerminusEst13BattlesuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLTorgueBlastplateArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLWildWeaselPeacekeeperArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLXaserPowerArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLZeroDiamondAssaultForceArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLDemonicCarapaceArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLGenericArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLAngelicArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLTheBeeArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLReactiveShieldSystemArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLChronotrooperArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLOModGreenArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModBlueArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModRedArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModBallisticVestArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModBulletProofVestArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModCyberwarriorArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModDuelistArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModEnergyShieldedVestArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModGothicArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModMedicalArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModPhaseshiftArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModRepulsionWaveSuitArmorUse", 1)
		TNT1 A 0 A_TakeInventory("RLOModSurvivalMediArmorUse", 1)
		
		TNT1 A 0 A_TakeInventory("RLSteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLProtectiveBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLPlasteelBootsUse",1)
		
		TNT1 A 0 A_TakeInventory("RLCerberusBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLTacticalBootsUse",1)
		
		TNT1 A 0 A_TakeInventory("RLAntigravSteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLAntigravProtectiveBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLAntigravPlasteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLEnviromentalSteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLEnviromentalProtectiveBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLEnviromentalPlasteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLFireproofSteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLFireproofProtectiveBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLFireproofPlasteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLGrapplingSteelBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLGrapplingProtectiveBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLGrapplingPlasteelBootsUse",1)
		
		TNT1 A 0 A_TakeInventory("RLShockwaveBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLAcidProofBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLGothicBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLPhaseshiftBootsUse",1)
		
		TNT1 A 0 A_TakeInventory("RLEnviroBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLFrontlineEngineerBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLLavaBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLLeonidasBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLNuclearPowerBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLNyarlaptotepsBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLRoystensCombatBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLSoloOperativeBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLTacticalAssemblerBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLTorgueBlastBootsUse",1)
		
		TNT1 A 0 A_TakeInventory("RLDemonicBootsUse",1)
		
		TNT1 A 0 A_TakeInventory("RLAngelicBootsUse",1)
		TNT1 A 0 A_Jump (256, "UseTokenGiven")
		Goto UseTokenGiven
		
//------------------------------------------------------------------------------
// Color code reference
// j = Standard (White)
// t = Exotic (Purple)
// v = Assembled (Cyan)
// i = Superior (Orange)
// d = Unique (Green)
// g = Demonic (Red)
// k = Legendary (Yellow)
// u = Onyx (Dark Gray)

//==============================================================================
	Duke2Stuff:
		"####" "#" 0 A_SpawnItemEx("RLDuke2ArmorCrate",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
//==============================================================================
//					--	DRPG Compatibility Stuff  --
//==============================================================================
// This makes the item do Doorpeggy things. Like hunting you down if you take magnetic drugs.
  DRPGInit:
	"####" "#" 0 ACS_NamedExecuteAlways("ItemInit", 0)
	"####" "#" 0 A_CheckFloor ("SpawnOnFloor")
	"####" "#" 0 A_Jump (256, "SpawnLoopFall")
	Goto SpawnLoopFall
	
  DoorpegShieldCheck:
// If the shields/armor cvar isn't active or the shields aren't on, continue doing armor things.
	TNT1 A 0 A_JumpIf(CallACS("ShieldRemoveArmor") == 1, "DoorpegNoShieldArmorShenanigans")
	TNT1 A 0 A_Jump (256, "ArmorWornCheckEquipping")
	Goto ArmorWornCheckEquipping
  DoorpegNoShieldArmorShenanigans:
	TNT1 A 0 A_GiveInventory("RLItemManipulationRemover",1)
// I like making random comment things like this, and other people seem to enjoy them too.
	TNT1 A 0 A_Jump(256, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
	TNT1 A 0 A_Print("You can't equip an armor through your shield, you dolt.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Yeah, you haven't suddenly gained the power to wear that\n through an energy shield.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Gonna have a bit of trouble with that shield in the way.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Maybe turn your shield off?\nJust a thought.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Noooooooope.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Turn your shield off first.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Press the off button or this isn't happening.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Shield is on. Makes this a bit difficult, yes?", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Yeah just... this isn't gonna work.\nTurn the shield off.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Turn your shield off, maget.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Nice shield you have there.\nIt would be a shame if it stopped you\nputting on that armor.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("pls no", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("OI", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Shields don't really work this way.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Welcome to your shield!\nPopulation: Still On", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Zap zap zap, look at that shield blocking your fashion attempts.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("stahp", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("Shield is on. Should be off.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("The last person who tried this set their vest on fire.\nYou should probably stop.", 3, "CONFONT")
	Fail
	TNT1 A 0 A_Print("YHOLL IS LAUGHING AT YOU\nDO YOU WANT YHOLL TO LAUGH AT YOU\n\nDO YOU REALLY", 3, "CONFONT")
	Fail
	}
}

ACTOR RLGenericArmorPickupSpecial : RLGenericArmorPickup
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnDRPGCheck:
// Initialize the item with DoomRPG so it can be used with cool stuff.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		TNT1 A 0 A_Jump (256, "SpawnLoopFall")
		Goto SpawnLoopFall	
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
//		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "PickupNonLimited")
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLGenericArmorPickup",1)
		Stop
		
	PickupNonLimited:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
        TNT1 A 0 ACS_NamedExecuteWithResult("CheckCapacity") // Special Capacity checking function for armor
		TNT1 A 0 A_GiveInventory("RLGenericArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}

Actor RLGenericArmor : BasicArmorPickup
{
  Radius 20
  Height 16
  Inventory.Pickupmessage ""
  Armor.Savepercent 30
  Armor.Saveamount 100
  States
  {
  Spawn:
    NOIC A 10
    loop
  }
}

ACTOR RLGenericArmorRenegade : RLGenericArmor
{
  Armor.Savepercent 45
}

Actor RLGenericArmorToken : RLPermanentInventory {}
Actor RLGenericArmorUse : RLPermanentInventory {}






//==============================================================================================================================================
//==============================================================================
//		STANDARD ARMORS
//==============================================================================
//==============================================================================================================================================

ACTOR RLGreenArmorPickup : RLGenericArmorPickup 18001
{
    //$category "Standard Armor"
	//$Sprite ARM1A0
    Tag "Security Armor"
    Inventory.Icon "ARM1BOX"
	Inventory.PickupSound "misc/rlarmor1"
	Inventory.UseSound "misc/rlarmor1"
	Inventory.RespawnTics 10500
	States
	{
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamStandard", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
    SpawnLoopFall:
		ARM1 A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		ARM1 A 6
		ARM1 B 6 Bright
		Loop
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_TakeInventory("RLOnyxModItem",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_TakeInventory("RLGreenArmorPickup", 1)
		TNT1 A 0 A_PlaySound ("modpack/onyx", 7, 1, 0, 1.8)
		TNT1 A 0 A_GiveInventory("RLOModGreenArmorPickup",1)
		TNT1 A 0 A_Print("Your \cjSecurity Armor\c- has been made \cuindestructible.\c-")
		TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1,2)
		TNT1 A 0 A_TakeInventory("RLModLimit", 1)
		Fail
		TNT1 A 0 A_TakeInventory("RLScavengerModLimit", 1)
		Fail
	
//------------------------------------------------------------------------------
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLGreenArmorUse",1,"ArmorEquip")
		TNT1 A 0 A_Jump (256, "UseTokenRemoval")
		Goto UseTokenRemoval
		
	UseTokenGiven:
// Gives you the identifier that indicates what armor you are manipulating right now.
		TNT1 A 0 A_GiveInventory("RLGreenArmorUse", 1)
// Check to see if you are already wearing armor and change the activation message.
		TNT1 A 0 A_Jump (256, "ArmorWornCheck")
		Goto ArmorWornCheck
		
	ArmorEquipTokens:
		TNT1 A 0 A_TakeInventory("RLGreenArmorUse",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
// Give the Token and/or Bonus items that are used to define the armor as being worn.
		TNT1 A 0 A_GiveInventory("RLGreenArmorToken",1)
		TNT1 A 0 A_GiveInventory("RL100ArmorWorn",1)
// Give a different armor based on whether or not you are the Renegade.
		TNT1 A 0 A_JumpIfInventory("RLShellshockPerk",1,"RenegadeEquip")
		TNT1 A 0 A_GiveInventory("RLGreenArmor",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish
		
// The Renegade gets a version of the armor with 1.5x more protection, up to a max of 80%.
	RenegadeEquip:
		TNT1 A 0 A_GiveInventory("RLGreenArmorRenegade",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Armor modpack checking begins here.
			ArmorModpackGreen:
// you wot m8
		TNT1 A 0 A_Jump (256, "IncompatibleArmorMod")
		Goto IncompatibleArmorMod
		
			ArmorModpackBlue:
// Reconfigure the selected armor into a Combat (Blue) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItemBlue",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLBlueArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\cdSecurity Armor \c-reconfigured into \chCombat Armor.")
		Stop
		
			ArmorModpackRed:
// Reconfigure the selected armor into a Commando (Red) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItemRed",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLRedArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\cdSecurity Armor \c-reconfigured into \cgCommando Armor.")
		Stop
		
//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		TNT1 A 0 A_Print("Picked up the \cjSecurity Armor.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\cjSecurity Armor \c-equipped.", 2)
		Stop
		
	ArmorAlreadyEquipped:
// You are wearing armor, but you can still drop the armor you are manipulating.
// Check for armor modpack modes that are compatible with this armor.
// Comment out the incompatible jumps.
//		TNT1 A 0 A_JumpIfInventory("RLArmorModItem",1,"ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue",1,"ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed",1,"ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "ArmorAlreadyEquippedMessage")
		Goto ArmorAlreadyEquippedMessage
	NoArmorEquipped:
// You are free to either wear the armor or drop it.
// Check for armor modpack modes that are compatible with this armor.
// Comment out the incompatible jumps.
//		TNT1 A 0 A_JumpIfInventory("RLArmorModItem",1,"NoArmorEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue",1,"NoArmorEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed",1,"NoArmorEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "NoArmorEquippedMessage")
		Goto NoArmorEquippedMessage
		
	NotPickup:
// This is for when you walk over an armor you cannot pick up.
		TNT1 A 0 A_JumpIfInventory("DRLA_ArmorAntiLogFloodCheck",1,"NotPickup_NoPrint")
		TNT1 A 0 A_GiveInventory("DRLA_ArmorAntiLogFloodCheck")
		TNT1 A 0 A_Print("\cj= Security Armor =", 2, "CONFONT")
		Fail
//------------------------------------------------------------------------------
// Color code reference
// j = Standard (White)
// t = Exotic (Purple)
// v = Assembled (Cyan)
// i = Superior (Orange)
// d = Unique (Green)
// g = Demonic (Red)
// k = Legendary (Yellow)
// u = Onyx (Dark Gray)
	}
}

ACTOR RLGreenArmorPickupSpecial : RLGreenArmorPickup
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnDRPGCheck:
// Initialize the item with DoomRPG so it can be used with cool stuff.
// We skip the special start checks so we don't make infinite loops.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		TNT1 A 0 A_Jump (256, "SpawnLoopFall")
		Goto SpawnLoopFall	
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
//		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "PickupNonLimited")
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLGreenArmorPickup",1)
		Stop
		
	PickupNonLimited:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
        TNT1 A 0 ACS_NamedExecuteWithResult("CheckCapacity") // Special Capacity checking function for armor
		TNT1 A 0 A_GiveInventory("RLGreenArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
		
Actor RLGreenArmor : RLGenericArmor
{
  Armor.Savepercent 10
  Armor.Saveamount 100
  DamageFactor "Bullet", 0.85
}

ACTOR RLGreenArmorRenegade : RLGreenArmor
{
  Armor.Savepercent 15
}

Actor RLGreenArmorToken : RLPermanentInventory {}
Actor RLGreenArmorUse : RLPermanentInventory {}

//==============================================================================

ACTOR RLBlueArmorPickup : RLGenericArmorPickup 18002
{
    //$category "Standard Armor"
	//$Sprite ARM2A0
    Tag "Combat Armor"
    Inventory.Icon "ARM2BOX"
	Inventory.PickupSound "misc/rlarmor1"
	Inventory.UseSound "misc/rlarmor1"
	Inventory.RespawnTics 10500
	States
	{
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamStandard", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
    SpawnLoopFall:
		ARM2 A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		ARM2 A 6
		ARM2 B 6 Bright
		Loop
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_TakeInventory("RLOnyxModItem",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_TakeInventory("RLBlueArmorPickup", 1)
		TNT1 A 0 A_PlaySound ("modpack/onyx", 7, 1, 0, 1.8)
		TNT1 A 0 A_GiveInventory("RLOModBlueArmorPickup",1)
		TNT1 A 0 A_Print("Your \cjCombat Armor\c- has been made \cuindestructible.\c-")
		TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1,2)
		TNT1 A 0 A_TakeInventory("RLModLimit", 1)
		Fail
		TNT1 A 0 A_TakeInventory("RLScavengerModLimit", 1)
		Fail
		
//------------------------------------------------------------------------------
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLBlueArmorUse",1,"ArmorEquip")
		TNT1 A 0 A_Jump (256, "UseTokenRemoval")
		Goto UseTokenRemoval
		
	UseTokenGiven:
// Gives you the identifier that indicates what armor you are manipulating right now.
		TNT1 A 0 A_GiveInventory("RLBlueArmorUse", 1)
// Check to see if you are already wearing armor and change the activation message.
		TNT1 A 0 A_Jump (256, "ArmorWornCheck")
		Goto ArmorWornCheck
		
	ArmorEquipTokens:
		TNT1 A 0 A_TakeInventory("RLBlueArmorUse",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
// Give the Token and/or Bonus items that are used to define the armor as being worn.
		TNT1 A 0 A_GiveInventory("RLBlueArmorToken",1)
		TNT1 A 0 A_GiveInventory("RL100ArmorWorn",1)
// Give a different armor based on whether or not you are the Renegade.
		TNT1 A 0 A_JumpIfInventory("RLShellshockPerk",1,"RenegadeEquip")
		TNT1 A 0 A_GiveInventory("RLBlueArmor",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish
		
// The Renegade gets a version of the armor with 1.5x more protection, up to a max of 80%.
	RenegadeEquip:
		TNT1 A 0 A_GiveInventory("RLBlueArmorRenegade",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Armor modpack checking begins here.
			ArmorModpackGreen:
// Reconfigure the selected armor into a Security (Green) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItem",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLGreenArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\chCombat Armor \c-reconfigured into \cdSecurity Armor.")
		Stop
		
			ArmorModpackBlue:
// you wot m8
		TNT1 A 0 A_Jump (256, "IncompatibleArmorMod")
		Goto IncompatibleArmorMod
		
		
			ArmorModpackRed:
// Reconfigure the selected armor into a Commando (Red) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItemRed",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLRedArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\chCombat Armor \c-reconfigured into \cgCommando Armor.")
		Stop
		
//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		TNT1 A 0 A_Print("Picked up the \cjCombat Armor.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\cjCombat Armor \c-equipped.", 2)
		Stop
		
	ArmorAlreadyEquipped:
// You are wearing armor, but you can still drop the armor you are manipulating.
// Check for armor modpack modes that are compatible with this armor.
// Comment out the incompatible jumps.
		TNT1 A 0 A_JumpIfInventory("RLArmorModItem",1,"ArmorAlreadyEquippedArmorMod")
//		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue",1,"ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed",1,"ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "ArmorAlreadyEquippedMessage")
		Goto ArmorAlreadyEquippedMessage
	NoArmorEquipped:
// You are free to either wear the armor or drop it.
// Check for armor modpack modes that are compatible with this armor.
// Comment out the incompatible jumps.
		TNT1 A 0 A_JumpIfInventory("RLArmorModItem",1,"NoArmorEquippedArmorMod")
//		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue",1,"NoArmorEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed",1,"NoArmorEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "NoArmorEquippedMessage")
		Goto NoArmorEquippedMessage
		
	NotPickup:
// This is for when you walk over an armor you cannot pick up.
		TNT1 A 0 A_JumpIfInventory("DRLA_ArmorAntiLogFloodCheck",1,"NotPickup_NoPrint")
		TNT1 A 0 A_GiveInventory("DRLA_ArmorAntiLogFloodCheck")
		TNT1 A 0 A_Print("\cj= Combat Armor =", 2, "CONFONT")
		Fail
//------------------------------------------------------------------------------
// Color code reference
// j = Standard (White)
// t = Exotic (Purple)
// v = Assembled (Cyan)
// i = Superior (Orange)
// d = Unique (Green)
// g = Demonic (Red)
// k = Legendary (Yellow)
// u = Onyx (Dark Gray)
	}
}

ACTOR RLBlueArmorPickupSpecial : RLBlueArmorPickup
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnDRPGCheck:
// Initialize the item with DoomRPG so it can be used with cool stuff.
// We skip the special start checks so we don't make infinite loops.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		TNT1 A 0 A_Jump (256, "SpawnLoopFall")
		Goto SpawnLoopFall	
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
//		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "PickupNonLimited")
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLBlueArmorPickup",1)
		Stop
		
	PickupNonLimited:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
        TNT1 A 0 ACS_NamedExecuteWithResult("CheckCapacity") // Special Capacity checking function for armor
		TNT1 A 0 A_GiveInventory("RLBlueArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
		
Actor RLBlueArmor : RLGenericArmor
{
  Armor.Savepercent 20
  Armor.Saveamount 100
  DamageFactor "Plasma", 0.8
}

ACTOR RLBlueArmorRenegade : RLBlueArmor
{
  Armor.Savepercent 30
}

Actor RLBlueArmorToken : RLPermanentInventory {}
Actor RLBlueArmorUse : RLPermanentInventory {}

//==============================================================================

ACTOR RLRedArmorPickup : RLGenericArmorPickup 18003
{
    //$category "Standard Armor"
	//$Sprite ARM3A0
    Tag "Commando Armor"
    Inventory.Icon "ARM3BOX"
	Inventory.PickupSound "misc/rlarmor1"
	Inventory.UseSound "misc/rlarmor1"
	Inventory.RespawnTics 10500
	States
	{
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamStandard", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
    SpawnLoopFall:
		ARM3 A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		ARM3 A 6
		ARM3 B 6 Bright
		Loop
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_TakeInventory("RLOnyxModItem",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_TakeInventory("RLRedArmorPickup", 1)
		TNT1 A 0 A_PlaySound ("modpack/onyx", 7, 1, 0, 1.8)
		TNT1 A 0 A_GiveInventory("RLOModRedArmorPickup",1)
		TNT1 A 0 A_Print("Your \cjCommando Armor\c- has been made \cuindestructible.\c-")
		TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1,2)
		TNT1 A 0 A_TakeInventory("RLModLimit", 1)
		Fail
		TNT1 A 0 A_TakeInventory("RLScavengerModLimit", 1)
		Fail
		
//------------------------------------------------------------------------------
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLRedArmorUse",1,"ArmorEquip")
		TNT1 A 0 A_Jump (256, "UseTokenRemoval")
		Goto UseTokenRemoval
		
	UseTokenGiven:
// Gives you the identifier that indicates what armor you are manipulating right now.
		TNT1 A 0 A_GiveInventory("RLRedArmorUse", 1)
// Check to see if you are already wearing armor and change the activation message.
		TNT1 A 0 A_Jump (256, "ArmorWornCheck")
		Goto ArmorWornCheck
		
	ArmorEquipTokens:
		TNT1 A 0 A_TakeInventory("RLRedArmorUse",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
// Give the Token and/or Bonus items that are used to define the armor as being worn.
		TNT1 A 0 A_GiveInventory("RLRedArmorToken",1)
		TNT1 A 0 A_GiveInventory("RL100ArmorWorn",1)
// Give a different armor based on whether or not you are the Renegade.
		TNT1 A 0 A_JumpIfInventory("RLShellshockPerk",1,"RenegadeEquip")
		TNT1 A 0 A_GiveInventory("RLRedArmor",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish
		
// The Renegade gets a version of the armor with 1.5x more protection, up to a max of 80%.
	RenegadeEquip:
		TNT1 A 0 A_GiveInventory("RLRedArmorRenegade",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Armor modpack checking begins here.
			ArmorModpackGreen:
// Reconfigure the selected armor into a Security (Green) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItem",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLGreenArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\cgCommando Armor \c-reconfigured into \cdSecurity Armor.")
		Stop
		
			ArmorModpackBlue:
// Reconfigure the selected armor into a Combat (Blue) variant.
		TNT1 A 0 A_TakeInventory("RLArmorModItemBlue",1)
		TNT1 A 0 A_TakeInventory("RLArmorModItemInInventory",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
		TNT1 A 0 A_GiveInventory("RLBlueArmorPickup",1)
		TNT1 A 0 A_PlaySound ("modpack/armor", 7, 1, 0, 1.8)
		TNT1 A 0 A_Print("\cgCommando Armor \c-reconfigured into \chCombat Armor.")
		Stop
		
			ArmorModpackRed:
// you wot m8
		TNT1 A 0 A_Jump (256, "IncompatibleArmorMod")
		Goto IncompatibleArmorMod
		
//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		TNT1 A 0 A_Print("Picked up the \cjCommando Armor.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\cjCommando Armor \c-equipped.", 2)
		Stop
		
	ArmorAlreadyEquipped:
// You are wearing armor, but you can still drop the armor you are manipulating.
// Check for armor modpack modes that are compatible with this armor.
// Comment out the incompatible jumps.
		TNT1 A 0 A_JumpIfInventory("RLArmorModItem",1,"ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue",1,"ArmorAlreadyEquippedArmorMod")
//		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed",1,"ArmorAlreadyEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "ArmorAlreadyEquippedMessage")
		Goto ArmorAlreadyEquippedMessage
	NoArmorEquipped:
// You are free to either wear the armor or drop it.
// Check for armor modpack modes that are compatible with this armor.
// Comment out the incompatible jumps.
		TNT1 A 0 A_JumpIfInventory("RLArmorModItem",1,"NoArmorEquippedArmorMod")
		TNT1 A 0 A_JumpIfInventory("RLArmorModItemBlue",1,"NoArmorEquippedArmorMod")
//		TNT1 A 0 A_JumpIfInventory("RLArmorModItemRed",1,"NoArmorEquippedArmorMod")
		TNT1 A 0 A_Jump (256, "NoArmorEquippedMessage")
		Goto NoArmorEquippedMessage
		
	NotPickup:
// This is for when you walk over an armor you cannot pick up.
		TNT1 A 0 A_JumpIfInventory("DRLA_ArmorAntiLogFloodCheck",1,"NotPickup_NoPrint")
		TNT1 A 0 A_GiveInventory("DRLA_ArmorAntiLogFloodCheck")
		TNT1 A 0 A_Print("\cj= Commando Armor =", 2, "CONFONT")
		Fail
//------------------------------------------------------------------------------
// Color code reference
// j = Standard (White)
// t = Exotic (Purple)
// v = Assembled (Cyan)
// i = Superior (Orange)
// d = Unique (Green)
// g = Demonic (Red)
// k = Legendary (Yellow)
// u = Onyx (Dark Gray)
	}
}

ACTOR RLRedArmorPickupSpecial : RLRedArmorPickup
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnDRPGCheck:
// Initialize the item with DoomRPG so it can be used with cool stuff.
// We skip the special start checks so we don't make infinite loops.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
		TNT1 A 0 A_Jump (256, "SpawnLoopFall")
		Goto SpawnLoopFall	
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
//		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "PickupNonLimited")
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLRedArmorPickup",1)
		Stop
		
	PickupNonLimited:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
        TNT1 A 0 ACS_NamedExecuteWithResult("CheckCapacity") // Special Capacity checking function for armor
		TNT1 A 0 A_GiveInventory("RLRedArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
		
Actor RLRedArmor : RLGenericArmor
{
  Armor.Savepercent 40
  Armor.Saveamount 100
  DamageFactor "Fire", 0.75
}

ACTOR RLRedArmorRenegade : RLRedArmor
{
  Armor.Savepercent 60
}

Actor RLRedArmorToken : RLPermanentInventory {}
Actor RLRedArmorUse : RLPermanentInventory {}
