
//==============================================================================================================================================
//==============================================================================
//		LEGENDARY BOOTS
//==============================================================================
//==============================================================================================================================================


ACTOR RLAngelicBootsPickup : RLGenericBootsPickup
{
    //$category "Legendary Boots"
	//$Sprite ANGBA0
    Tag "Angelic Boots"
    Inventory.Icon "ANGBBOX"
	Inventory.RespawnTics 105000
	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:
		ANGB A 0 A_JumpIf(Abs(VelZ) <= 0.01 && user_floorhit == 0, "FloorHit")
		"####" "#" 1
		Loop
	SpawnLoop:
// Play the armor's sprite animation.
		ANGB A 6
		ANGB A 6 Bright
		Loop
		
//------------------------------------------------------------------------------
	Use:
		TNT1 A 0
// Check to see if these boots have been activated once before.
		TNT1 A 0 A_JumpIfInventory("RLAngelicBootsUse",1,"BootsEquip")
		TNT1 A 0 A_Jump (256, "UseTokenRemoval")
		Goto UseTokenRemoval
		
	UseTokenGiven:
// Gives you the identifier that indicates what boots you are manipulating right now.
		TNT1 A 0 A_GiveInventory("RLAngelicBootsUse", 1)
// Check to see if you are already wearing boots and change the activation message.
		TNT1 A 0 A_Jump (256, "BootsWornCheck")
		Goto BootsWornCheck
		
	BootsEquipTokens:
		TNT1 A 0 A_TakeInventory("RLAngelicBootsUse",1)
		TNT1 A 0 A_TakeInventory("RLArmorInInventory",1)
// Give the Token and/or Bonus items that are used to define the boots as being worn.
		TNT1 A 0 A_GiveInventory("RLAngelicBootsToken",1)
		TNT1 A 0 A_GiveInventory("PowerRLAbsoluteBootsProtection",1)
		TNT1 A 0 A_GiveInventory("RLBootsWorn",1)
		TNT1 A 0 A_Jump (256, "EquipFinish")
		Goto EquipFinish

//------------------------------------------------------------------------------
// Equip messages are grouped down here.
	PickupDisplayMessage:
// Picking up boots, and you have room for it.
		"####" "#" 0 A_GiveInventory("RLLegendaryItemFound",1, AAPTR_PLAYER1)
		TNT1 A 0 A_Print("Picked up the \ckAngelic Boots.", 2)
		Stop
	EquipFinish:
// Successfully wearing boots.
		TNT1 A 0 A_Print("\ckAngelic Boots \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
		
	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 Boots =", 2, "CONFONT")
		Fail
		
//------------------------------------------------------------------------------
/*	SetBonusChecking:
		TNT1 A 0 A_GiveInventory("RLAngelicAttireSetBonusBoots",1)
		TNT1 A 0 A_JumpIfInventory("RLAngelicAttireSetBonusArmor",1,"SetBonusCheckingDetection")
		Stop
	SetBonusCheckingDetection:
		TNT1 A 0 A_JumpIfInventory("RLAngelicAttireSetBonusArmor",1,1)
		Stop
		TNT1 A 0 A_GiveInventory("RLAngelicAttireSetBonusActive",1)
		TNT1 A 0 A_Print("\ckAngelic Boots \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 = Angelic (Red)
// k = Legendary (Yellow)
// u = Onyx (Dark Gray)
	}
}

ACTOR RLAngelicBootsWorldSpawnPickup : RLAngelicBootsPickup 19033
{
    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 these boots.
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLAngelicBootsPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}

ACTOR RLAngelicBootsPickupSpecial : RLAngelicBootsPickup
{
    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 these boots.
//		TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "PickupNonLimited")
		TNT1 A 0 A_JumpIfInventory("RLArmorInInventory",0,"NotPickup")
		TNT1 A 0 A_GiveInventory("RLAngelicBootsPickup",1)
		Stop
		
	PickupNonLimited:
		TNT1 A 0
// Check to see if you have the capacity to pickup these boots.
        TNT1 A 0 ACS_NamedExecuteWithResult("CheckCapacity") // Special Capacity checking function for armor
		TNT1 A 0 A_GiveInventory("RLAngelicBootsPickup",1)
		Stop
//------------------------------------------------------------------------------
	Use:
		Stop	
	}
}
	
Actor RLAngelicBootsToken : RLPermanentInventory {}
Actor RLAngelicBootsUse : RLPermanentInventory {}

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