
//-------------------------------------------------------------------
//		ARTI MOD

Actor RLArtiModCounter : RLPermanentInventory
{
	inventory.maxamount 4 // Arti is just trying to help
}

ACTOR RLArtiModItem : CustomInventory 16636
{
  -COUNTITEM
  +INVENTORY.INVBAR
  +INVENTORY.UNDROPPABLE
  +INVENTORY.UNTOSSABLE
  +INVENTORY.BIGPOWERUP
  +DONTGIB
  Tag "Bulk Modpack?"
    //$category "DRLA Items"
  Inventory.InterHubAmount 1
  Inventory.MaxAmount 1
  Inventory.Icon "ARTMI0"
  Inventory.Pickupsound "misc/modpackpickup"
  Inventory.UseSound "modpack/secret"
  Inventory.PickupMessage "You picked up a... Bulk Mod Pack? It's looking at you."
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(CallACS("DRPGCheckTiem"), "DRPGInit")
  SpecialStartCheck:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_specialstarts") == 2, "Duke2Stuff")
  SpawnLoop:
    ARTM ABCDCB 3 Bright
	TNT1 A 0 A_JumpIf(CallACS("DRLA_lettermodpacks") == 1, "SpawnLetter")
    Loop
  SpawnLetter:
    ARTM E 5 Bright
    GMOD A 1
	TNT1 A 0 A_JumpIf(CallACS("DRLA_lettermodpacks") == 1, "SpawnLetter")
    Goto SpawnLoop
	
  Pickup:
	TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1,3)
	TNT1 A 0 A_JumpIfInventory("RLModLimit",0,"NoPickup")
    TNT1 A 0 A_GiveInventory("RLModLimit", 1)
    Stop
	TNT1 A 0 A_JumpIfInventory("RLScavengerModLimit",0,"NoPickup")
    TNT1 A 0 A_GiveInventory("RLScavengerModLimit", 1)
    Stop
	
  Use:
	TNT1 A 0 A_JumpIfInventory("RLUseArtiMod",1,"WeaponSelect")
    TNT1 A 0 A_GiveInventory("RLUseArtiMod", 1)
    TNT1 A 0 A_PlaySound("hud/generic", 5)
	TNT1 A 0 A_JumpIfInventory("RLFistSelected",1,"FistSelection")
	TNT1 A 0 A_JumpIfInventory("RLUnmakerSelected",1,"UnableToMod")
  UseAgainToMod:
	TNT1 A 0 A_Print("Use this... Bulk Mod? again to apply to current weapon.\n\nPress \caDrop Item (DRLA)\c- to drop it, or switch weapons to cancel.", 5)
    Fail
  FistSelection:
	TNT1 A 0 A_Print("Press \caDrop Item (DRLA)\c- to drop the strange Bulk Mod, or switch weapons to cancel.", 5)
    Fail
	
  WeaponSelect:
	TNT1 A 0 A_GiveInventory("RLMisfireSpamPreventionCooldown",1)
    TNT1 A 0 A_Print (" ", 0)
	TNT1 A 0 A_JumpIfInventory("RLFistSelected",1,"FistSelection")
    TNT1 A 0 A_TakeInventory("RLUseArtiMod", 1)
  ArtiIsThonking:
	TNT1 A 0 A_Jump(256, "ApplyBulk", "ApplyPower", "ApplyAgility", "ApplyTechnical", "ApplySniper", "ApplyFirestorm", "ApplyNano")
  ApplyBulk:
	TNT1 A 0 A_GiveInventory("RLBulkModAuto",1)
	TNT1 A 0 A_GiveInventory("RLArtiModCounter",1)
	TNT1 A 0 A_JumpIfInventory("RLArtiModCounter",0,"ArtiIsHelping")
	Goto ArtiIsThonking
  ApplyPower:
	TNT1 A 0 A_GiveInventory("RLPowerModAuto",1)
	TNT1 A 0 A_GiveInventory("RLArtiModCounter",1)
	TNT1 A 0 A_JumpIfInventory("RLArtiModCounter",0,"ArtiIsHelping")
	Goto ArtiIsThonking
  ApplyAgility:
	TNT1 A 0 A_GiveInventory("RLAgilityModAuto",1)
	TNT1 A 0 A_GiveInventory("RLArtiModCounter",1)
	TNT1 A 0 A_JumpIfInventory("RLArtiModCounter",0,"ArtiIsHelping")
	Goto ArtiIsThonking
  ApplyTechnical:
	TNT1 A 0 A_GiveInventory("RLTechnicalModAuto",1)
	TNT1 A 0 A_GiveInventory("RLArtiModCounter",1)
	TNT1 A 0 A_JumpIfInventory("RLArtiModCounter",0,"ArtiIsHelping")
	Goto ArtiIsThonking
  ApplySniper:
	TNT1 A 0 A_GiveInventory("RLSniperModAuto",1)
	TNT1 A 0 A_GiveInventory("RLArtiModCounter",1)
	TNT1 A 0 A_JumpIfInventory("RLArtiModCounter",0,"ArtiIsHelping")
	Goto ArtiIsThonking
  ApplyFirestorm:
	TNT1 A 0 A_GiveInventory("RLFirestormModAuto",1)
	TNT1 A 0 A_GiveInventory("RLArtiModCounter",1)
	TNT1 A 0 A_JumpIfInventory("RLArtiModCounter",0,"ArtiIsHelping")
	Goto ArtiIsThonking
  ApplyNano:
	TNT1 A 0 A_GiveInventory("RLNanoModAuto",1)
	TNT1 A 0 A_GiveInventory("RLArtiModCounter",1)
	TNT1 A 0 A_JumpIfInventory("RLArtiModCounter",0,"ArtiIsHelping")
	Goto ArtiIsThonking
  ArtiIsHelping:
	TNT1 A 0 A_TakeInventory("RLArtiModCounter",4)
	TNT1 A 0 A_GiveInventory("RLAssemblyConfirmationRemover",1)
	TNT1 A 0 A_Print("The strange sentient mod pack seems satisfied with the\nbizarre addons it somehow put on your weapon.", 4)
    TNT1 A 0 A_JumpIfInventory("RLScavengerPerk",1,2)
    TNT1 A 0 A_TakeInventory("RLModLimit", 1)
    Stop
    TNT1 A 0 A_TakeInventory("RLScavengerModLimit", 1)
    Stop
	
  UnableToMod:
	TNT1 A 0 A_Print("The strange mod pack seems confused.", 4)
    Fail
  NoPickup:
	TNT1 A 0 A_JumpIfInventory("DRLA_ModsAntiLogFloodCheck",1,"NoPickup_NoPrint")
	TNT1 A 0 A_GiveInventory("DRLA_ModsAntiLogFloodCheck")
	TNT1 A 0 A_Print("\cy= Bulk Mod? =", 2, "CONFONT")
   NoPickup_NoPrint:
    TNT1 A 0
	Fail
//==============================================================================
	Duke2Stuff:
		"####" "#" 0 A_SpawnItemEx("RLDuke2WeaponCrate",0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION)
		Stop
//==============================================================================
//					--	DRPG Compatibility Stuff  --
//==============================================================================
	DRPGInit:
		"####" "#" 0 ACS_NamedExecuteAlways("ItemInit", 0)
		"####" "#" 0 A_Jump (256, "SpecialStartCheck")
		Goto SpecialStartCheck
  }
}
