
//==============================================================================================================================================
//==============================================================================
//		LEGENDARY ARMORS
//==============================================================================
//==============================================================================================================================================


ACTOR RLAngelicArmorPickup : RLGenericArmorPickup
{
    //$category "Legendary Armor"
	//$Sprite ANGAA0
    Tag "Angelic Armor"
    Inventory.Icon "ANGABOX"
	Inventory.PickupSound "misc/rlarmorlegendary"
	Inventory.UseSound "armor/equip"
	Inventory.RespawnTics 105000
	+DONTGIB
	States
	{
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendary", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
    SpawnLoopFall:
		ANGA A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		ANGA A 6
		ANGA A 6 Bright
		Loop
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
// Or not.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor cannot be made \cuindestructible.\c-")
		Fail
		
//------------------------------------------------------------------------------
	ArmorModReconfigure:
// This armor can't be reconfigured, so throw out an error and don't activate the armor or anything.
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor is not a reconfigurable\ntype of armor.")
		Fail
		
//------------------------------------------------------------------------------
// These two states are used to detect armor modpacks if the armor can be altered.
// These states only need to be redefined if the armor cannot be converted with them.
	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
	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
		
//------------------------------------------------------------------------------
	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
		
	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
		
	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
		
	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
		
//------------------------------------------------------------------------------
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLAngelicArmorUse",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("RLAngelicArmorUse", 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("RLAngelicArmorUse",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("RLAngelicArmorToken",1)
		TNT1 A 0 A_GiveInventory("RLIndestructibleArmorWorn",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("RLAngelicArmor",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("RLAngelicArmorRenegade",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		"####" "#" 0 A_GiveInventory("RLLegendaryItemFound",1, AAPTR_PLAYER1)
		TNT1 A 0 A_Print("Picked up the \ckAngelic Armor.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\ckAngelic Armor \c-equipped.", 2)
		TNT1 A 0 ACS_NamedExecuteWithResult("RLAngelicSetBonusCheck", 1) // Checks for all parts of the set bonus, gives or removes it accordingly - argument is tic delay before checking
		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("\ck= Angelic Armor =", 2, "CONFONT")
		Fail
		
//------------------------------------------------------------------------------
/*	SetBonusChecking:
		TNT1 A 0 A_GiveInventory("RLAngelicAttireSetBonusArmor",1)
		TNT1 A 0 A_JumpIfInventory("RLAngelicAttireSetBonusBoots",1,"SetBonusCheckingDetection")
		Stop
	SetBonusCheckingDetection:
		TNT1 A 0 A_JumpIfInventory("RLAngelicAttireSetBonusBoots",1,1)
		Stop
		TNT1 A 0 A_GiveInventory("RLAngelicAttireSetBonusActive",1)
		TNT1 A 0 A_Print("\ckAngelic Armor \c-equipped.\n\cf= ANGELIC ATTIRE =\n\cgImmunity to \cscorruption\c-\n\cgGetting hit causes an AOE \cnheal\c- on players\n\cgGetting hit causes AOE \cadamage\c- to monsters", 8, "CONFONT")
		Stop*/
//------------------------------------------------------------------------------
// 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 RLAngelicArmorWorldSpawnPickup : RLAngelicArmorPickup 18075
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnRarityBeam:
// Check for DoomRPG, if found, skip the check for special starts. If the armor shouldn't spawn, we need to skip the thunder sound.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), 2)
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2Stuff")
// This makes a thunder sound when it spawns, and emits twinkling noises every now and then to alert players.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendaryWorld", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_PlaySound("weapons/legendaryspawned", 7, 0.25, 0, 0)
		TNT1 A 0 A_GiveInventory("RLLegendaryItemSpawnMessageSender",1)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLAngelicArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}

ACTOR RLAngelicArmorPickupSpecial : RLAngelicArmorPickup
{
    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("RLAngelicArmorPickup",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("RLAngelicArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
		
Actor RLAngelicArmor : RLGenericArmor
{
  Armor.Savepercent 70
  Armor.Saveamount 99999
  DamageFactor "Melee", 0.50
  DamageFactor "Bullet", 0.50
}
	
Actor RLAngelicArmorRenegade : RLAngelicArmor
{
  Armor.Savepercent 80
}

Actor RLAngelicArmorToken : RLPermanentInventory {}
Actor RLAngelicArmorUse : RLPermanentInventory {}

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

ACTOR RLTheBeeArmorPickup : RLGenericArmorPickup
{
    //$category "Legendary Armor"
	//$Sprite BEESA0
    Tag "The Bee"
    Inventory.Icon "BEESBOX"
	Inventory.PickupSound "misc/rlarmorlegendary"
	Inventory.UseSound "misc/rlshield"
	Inventory.RespawnTics 105000
	+DONTGIB
	States
	{
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendary", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
    SpawnLoopFall:
		BEES A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		BEES B 6
		BEES A 6 Bright
		Loop
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
// Or not.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor cannot be made \cuindestructible.\c-")
		Fail
		
//------------------------------------------------------------------------------
	ArmorModReconfigure:
// This armor can't be reconfigured, so throw out an error and don't activate the armor or anything.
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor is not a reconfigurable\ntype of armor.")
		Fail
		
//------------------------------------------------------------------------------
// These two states are used to detect armor modpacks if the armor can be altered.
// These states only need to be redefined if the armor cannot be converted with them.
	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
	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
		
//------------------------------------------------------------------------------
	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
		
	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
		
	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
		
	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
		
//------------------------------------------------------------------------------
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLTheBeeArmorUse",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("RLTheBeeArmorUse", 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("RLTheBeeArmorUse",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("RLTheBeeArmorToken",1)
		TNT1 A 0 A_GiveInventory("RLTheBeeArmorBonus",1)
		TNT1 A 0 A_GiveInventory("PowerRLTheBeeDamageAmp",1) // also, die
		TNT1 A 0 A_GiveInventory("RLIndestructibleArmorWorn",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("RLTheBeeArmor",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("RLTheBeeArmor",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		"####" "#" 0 A_GiveInventory("RLLegendaryItemFound",1, AAPTR_PLAYER1)
		TNT1 A 0 A_Print("Picked up \ckThe Bee.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\ckThe Bee \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("\ck= The Bee =", 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 RLTheBeeArmorWorldSpawnPickup : RLTheBeeArmorPickup 18076
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnRarityBeam:
// Check for DoomRPG, if found, skip the check for special starts. If the armor shouldn't spawn, we need to skip the thunder sound.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), 2)
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2Stuff")
// This makes a thunder sound when it spawns, and emits twinkling noises every now and then to alert players.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendaryWorld", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_PlaySound("weapons/legendaryspawned", 7, 0.25, 0, 0)
		TNT1 A 0 A_GiveInventory("RLLegendaryItemSpawnMessageSender",1)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLTheBeeArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}

ACTOR RLTheBeeArmorPickupSpecial : RLTheBeeArmorPickup
{
    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("RLTheBeeArmorPickup",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("RLTheBeeArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
		
Actor RLTheBeeArmor : RLGenericArmor
{
  Armor.Savepercent 0
  Armor.Saveamount 99999
  DamageFactor "Melee", 2.0
  DamageFactor "Bullet", 2.0
  DamageFactor "Fire", 2.0
  DamageFactor "Plasma", 2.0
}
	
Actor RLTheBeeArmorToken : RLPermanentInventory {}
Actor RLTheBeeArmorBonus : RLPermanentInventory {}
Actor RLTheBeeArmorUse : RLPermanentInventory {}

actor PowerRLTheBeeDamageAmp : PowerDamage // what even is balance, am i rite?
{
   damagefactor "Melee", 3
   damagefactor "Bullet", 3
   damagefactor "Fire", 3
   damagefactor "Plasma", 3
   inventory.icon ""
   Powerup.Duration -0x7FFFFFFF
   +INVENTORY.PERSISTENTPOWER
}

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

ACTOR RLReactiveShieldSystemArmorPickup : RLGenericArmorPickup
{
    //$category "Legendary Armor"
	//$Sprite RSSDA0
    Tag "Reactive Shield System"
    Inventory.Icon "RSSDBOX"
	Inventory.PickupSound "misc/rlarmorlegendary"
	Inventory.UseSound "misc/rlshield"
	Inventory.RespawnTics 105000
	+DONTGIB
	States
	{
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendary", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
    SpawnLoopFall:
		RSSD A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		RSSD A 6
		RSSD A 6 Bright
		Loop
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
// Or not.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor cannot be made \cuindestructible.\c-")
		Fail
		
//------------------------------------------------------------------------------
	ArmorModReconfigure:
// This armor can't be reconfigured, so throw out an error and don't activate the armor or anything.
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor is not a reconfigurable\ntype of armor.")
		Fail
		
//------------------------------------------------------------------------------
// These two states are used to detect armor modpacks if the armor can be altered.
// These states only need to be redefined if the armor cannot be converted with them.
	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
	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
		
//------------------------------------------------------------------------------
	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
		
	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
		
	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
		
	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
		
//------------------------------------------------------------------------------
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLReactiveShieldSystemArmorUse",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("RLReactiveShieldSystemArmorUse", 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("RLReactiveShieldSystemArmorUse",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("RLReactiveShieldSystemArmorToken",1)
		TNT1 A 0 A_GiveInventory("RLReactiveShieldSystemArmorBonus",1)
		TNT1 A 0 A_GiveInventory("RLIndestructibleArmorWorn",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("RLReactiveShieldSystemArmor",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("RLReactiveShieldSystemArmor",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		"####" "#" 0 A_GiveInventory("RLLegendaryItemFound",1, AAPTR_PLAYER1)
		TNT1 A 0 A_Print("Picked up the \ckReactive Shield System.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\ckReactive Shield System \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("\ck= Reactive Shield System =", 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 RLReactiveShieldSystemArmorWorldSpawnPickup : RLReactiveShieldSystemArmorPickup 18077
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnRarityBeam:
// Check for DoomRPG, if found, skip the check for special starts. If the armor shouldn't spawn, we need to skip the thunder sound.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), 2)
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2Stuff")
// This makes a thunder sound when it spawns, and emits twinkling noises every now and then to alert players.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendaryWorld", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_PlaySound("weapons/legendaryspawned", 7, 0.25, 0, 0)
		TNT1 A 0 A_GiveInventory("RLLegendaryItemSpawnMessageSender",1)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLReactiveShieldSystemArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}

ACTOR RLReactiveShieldSystemArmorPickupSpecial : RLReactiveShieldSystemArmorPickup
{
    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("RLReactiveShieldSystemArmorPickup",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("RLReactiveShieldSystemArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
		
Actor RLReactiveShieldSystemArmor : RLGenericArmor
{
  Armor.Savepercent 0
  Armor.Saveamount 99999
}
	
Actor RLReactiveShieldSystemArmorToken : RLPermanentInventory {}
Actor RLReactiveShieldSystemArmorBonus : RLPermanentInventory {}
Actor RLReactiveShieldSystemArmorUse : RLPermanentInventory {}

ACTOR PowerRLReactiveShieldSystemActiveToken : Powerup
{
   inventory.icon ""
   Powerup.Duration -0x7FFFFFFF
   +INVENTORY.PERSISTENTPOWER
}

actor PowerRLReactiveShieldSystemBase : PowerProtection
{
   inventory.icon ""
   Powerup.Duration -0x7FFFFFFF
   +INVENTORY.PERSISTENTPOWER
}

actor PowerRLReactiveShieldSystemMelee : PowerRLReactiveShieldSystemBase
{
   damagefactor "Melee", 0.1
}

actor PowerRLReactiveShieldSystemBullet : PowerRLReactiveShieldSystemBase
{
   damagefactor "Bullet", 0.1
}

actor PowerRLReactiveShieldSystemFire : PowerRLReactiveShieldSystemBase
{
   damagefactor "Fire", 0.1
}

actor PowerRLReactiveShieldSystemPlasma : PowerRLReactiveShieldSystemBase
{
   damagefactor "Plasma", 0.1
}

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

ACTOR RLChronotrooperArmorPickup : RLGenericArmorPickup
{
    //$category "Legendary Armor"
	//$Sprite CHROA0
    Tag "Chronotrooper Armor"
    Inventory.Icon "CHROBOX"
	Inventory.PickupSound "misc/rlarmorlegendary"
	Inventory.UseSound "armor/equip"
	Inventory.RespawnTics 105000
	+DONTGIB
	States
	{
	SpawnRarityBeam:
// Create the appropriate rarity beam for the item.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendary", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
		
    SpawnLoopFall:
		CHRO A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		CHRO A 4
		CHRO BCB 4 Bright
		Loop
			
//------------------------------------------------------------------------------
// Apply an Onyx mod to the armor in your inventory.
// Or not.
	OnyxModActivate:
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor cannot be made \cuindestructible.\c-")
		Fail
		
//------------------------------------------------------------------------------
	ArmorModReconfigure:
// This armor can't be reconfigured, so throw out an error and don't activate the armor or anything.
		TNT1 A 0 A_GiveInventory("RLDeselectionFunction",1)
		TNT1 A 0 A_PlaySound ("hud/error", 7, 1)
		TNT1 A 0 A_Print("This armor is not a reconfigurable\ntype of armor.")
		Fail
		
//------------------------------------------------------------------------------
// These two states are used to detect armor modpacks if the armor can be altered.
// These states only need to be redefined if the armor cannot be converted with them.
	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
	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
		
//------------------------------------------------------------------------------
	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
		
	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
		
	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
		
	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
		
//------------------------------------------------------------------------------
	NoArmorModpackActive:
// Check to see if this armor has been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLChronotrooperArmorUse",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("RLChronotrooperArmorUse", 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("RLChronotrooperArmorUse",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("RLChronotrooperArmorToken",1)
		TNT1 A 0 A_GiveInventory("RLChronotrooperArmorBonus",1)
		TNT1 A 0 A_GiveInventory("RLIndestructibleArmorWorn",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("RLChronotrooperArmor",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("RLChronotrooperArmorRenegade",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up an armor, and you have room for it.
		"####" "#" 0 A_GiveInventory("RLLegendaryItemFound",1, AAPTR_PLAYER1)
		TNT1 A 0 A_Print("Picked up the \ckChronotrooper Armor.", 2)
		Stop
	EquipFinish:
// Successfully wearing an armor.
		TNT1 A 0 A_Print("\ckChronotrooper 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("\ck= Chronotrooper 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 RLChronotrooperArmorWorldSpawnPickup : RLChronotrooperArmorPickup 18078
{
    Inventory.InterHubAmount 0
    Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	States
	{
	SpawnRarityBeam:
// Check for DoomRPG, if found, skip the check for special starts. If the armor shouldn't spawn, we need to skip the thunder sound.
		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), 2)
		TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2Stuff")
// This makes a thunder sound when it spawns, and emits twinkling noises every now and then to alert players.
		TNT1 A 0 A_SpawnItemEx("RLRarityBeamLegendaryWorld", 0,0,0, 0,0,0, 0, SXF_SETMASTER)
		TNT1 A 0 A_PlaySound("weapons/legendaryspawned", 7, 0.25, 0, 0)
		TNT1 A 0 A_GiveInventory("RLLegendaryItemSpawnMessageSender",1)
		TNT1 A 0 A_Jump (256, "SpawnDRPGCheck")
		Goto SpawnDRPGCheck
//------------------------------------------------------------------------------
	Pickup:
		TNT1 A 0
// Check to see if you have the capacity to pickup this armor.
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLChronotrooperArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}

ACTOR RLChronotrooperArmorPickupSpecial : RLChronotrooperArmorPickup
{
    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("RLChronotrooperArmorPickup",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("RLChronotrooperArmorPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
		
Actor RLChronotrooperArmor : RLGenericArmor
{
  Armor.Savepercent 30
  Armor.Saveamount 99999
  DamageFactor "Melee", 0.85
  DamageFactor "Bullet", 0.85
  DamageFactor "Fire", 0.85
  DamageFactor "Plasma", 0.85
}
	
Actor RLChronotrooperArmorRenegade : RLChronotrooperArmor
{
  Armor.Savepercent 45
}

Actor RLChronotrooperArmorToken : RLPermanentInventory {}
Actor RLChronotrooperArmorBonus : RLPermanentInventory {}
Actor RLChronotrooperArmorUse : RLPermanentInventory {}

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