//////////////////////////////////////////////////////// GREEN Reagent

ACTOR ReagentGreen : CustomInventory
{
  +INVENTORY.INVBAR
  Inventory.MaxAmount 9999
  Inventory.Icon "ARTIRGN1"
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickupMessage "Green Reagent"
  Tag "Green Reagent"
  Inventory.InterHubAmount 9999
  States
  {
  Spawn:
    RGN1 A 700
    Stop
  Use:
	TNT1 A 0 A_JumpIfInventory ("ArtiGreenFlask", ACS_ExecuteWithResult(WOC_DECORATE,STATS,ITEMCAP,ACTIVATOR), "TooMany")
    TNT1 A 0 A_JumpIfInventory ("ReagentGreen",2,"CheckFlask") //Check Reagents
    TNT1 A 0 A_Print ("you need at least 2 green reagents!")
    Fail
  TooMany:
	TNT1 A 0 A_Print ("you have too many flasks!")
    Fail
  CheckFlask:
    TNT1 A 0 A_JumpIfInventory ("ArtiEmptyFlask",1,"Success") //Check for empty flasks
    TNT1 A 0 A_Print ("you need an empty flask!")
    Fail
  Success:
    TNT1 A 0 A_TakeInventory ("ReagentGreen", 1) //(1 + 1 when using this artifact = 2)
    TNT1 A 0 A_TakeInventory ("ArtiEmptyFlask", 1)
    TNT1 A 0 A_GiveInventory ("ArtiGreenFlask", 1)
    Stop
  }
}

/////////////////////////////////////////////////////// RED Reagent

ACTOR ReagentRed : CustomInventory
{
  +INVENTORY.INVBAR
  Inventory.MaxAmount 9999
  Inventory.Icon "ARTIRGN2"
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickupMessage "Red Reagent"
  Tag "Red Reagent"
  Inventory.InterHubAmount 9999
  States
  {
  Spawn:
    RGN2 A 700
    Stop
  Use:
	TNT1 A 0 A_JumpIfInventory ("ArtiRedFlask",ACS_ExecuteWithResult(WOC_DECORATE,STATS,ITEMCAP,ACTIVATOR),"TooMany")
    TNT1 A 0 A_JumpIfInventory ("ReagentRed",2,"CheckFlask") //Check Reagents
    TNT1 A 0 A_Print ("you need at least 2 red reagents!")
    Fail
  TooMany:
	TNT1 A 0 A_Print ("you have too many flasks!")
    Fail
  CheckFlask:
    TNT1 A 0 A_JumpIfInventory ("ArtiEmptyFlask",1,"Success") //Check for empty flasks
    TNT1 A 0 A_Print ("you need an empty flask!")
    Fail
  Success:
    TNT1 A 0 A_TakeInventory ("ReagentRed", 1) //(1 + 1 when using this artifact = 2)
    TNT1 A 0 A_TakeInventory ("ArtiEmptyFlask", 1)
    TNT1 A 0 A_GiveInventory ("ArtiRedFlask", 1)
    Stop
  }
}

/////////////////////////////////////////////////////// BLUE Reagent

ACTOR ReagentBlue : CustomInventory
{
  +INVENTORY.INVBAR
  Inventory.MaxAmount 9999
  Inventory.Icon "ARTIRGN3"
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickupMessage "Blue Reagent"
  Tag "Blue Reagent"
  Inventory.InterHubAmount 9999
  States
  {
  Spawn:
    RGN3 A 700
    Stop
  Use:
	TNT1 A 0 A_JumpIfInventory ("ArtiBlueFlask",ACS_ExecuteWithResult(WOC_DECORATE,STATS,ITEMCAP,ACTIVATOR),"TooMany")
    TNT1 A 0 A_JumpIfInventory ("ReagentBlue",2,"CheckFlask") //Check Reagents
    TNT1 A 0 A_Print ("you need at least 2 blue reagents!")
    Fail
  TooMany:
	TNT1 A 0 A_Print ("you have too many flasks!")
    Fail
  CheckFlask:
    TNT1 A 0 A_JumpIfInventory ("ArtiEmptyFlask",1,"Success") //Check for empty flasks
    TNT1 A 0 A_Print ("you need an empty flask!")
    Fail
  Success:
    TNT1 A 0 A_TakeInventory ("ReagentBlue", 1) //(1 + 1 when using this artifact = 2)
    TNT1 A 0 A_TakeInventory ("ArtiEmptyFlask", 1)
    TNT1 A 0 A_GiveInventory ("ArtiBlueFlask", 1)
    Stop
  }
}

ACTOR BlueSpawner
{
  +NOBLOCKMAP
  +NOCLIP
  +NOGRAVITY
  +DONTSPLASH
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_Jump(16,"Reagent")
    Stop
  Reagent:
    TNT1 A 200
    TNT1 A 0 A_SpawnItemEx ("ReagentBlue", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0)
    stop
  }
}

/////////////////////////////////////////////////////// TAN Reagent

ACTOR ReagentTan : CustomInventory
{
  +INVENTORY.INVBAR
  Inventory.MaxAmount 9999
  Inventory.Icon "ARTIRGN4"
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickupMessage "Tan Reagent"
  Tag "Tan Reagent"
  Inventory.InterHubAmount 9999
  States
  {
  Spawn:
    LEF2 A 700
    Stop
  Use:
	TNT1 A 0 A_JumpIfInventory ("ArtiTanFlask",ACS_ExecuteWithResult(WOC_DECORATE,STATS,ITEMCAP,ACTIVATOR),"TooMany")
    TNT1 A 0 A_JumpIfInventory ("ReagentTan",2,"CheckFlask") //Check Reagents
    TNT1 A 0 A_Print ("you need at least 2 tan reagents!")
    Fail
  TooMany:
	TNT1 A 0 A_Print ("you have too many flasks!")
    Fail                          
  CheckFlask:
    TNT1 A 0 A_JumpIfInventory ("ArtiEmptyFlask",1,"Success") //Check for empty flasks
    TNT1 A 0 A_Print ("you need an empty flask!")
    Fail
  Success:
    TNT1 A 0 A_TakeInventory ("ReagentTan", 1) //(1 + 1 when using this artifact = 2)
    TNT1 A 0 A_TakeInventory ("ArtiEmptyFlask", 1)
    TNT1 A 0 A_GiveInventory ("ArtiTanFlask", 1)
    Stop
  }
}

ACTOR TanSpawner
{
  +NOBLOCKMAP
  +NOCLIP
  +NOGRAVITY
  +DONTSPLASH
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_Jump(16,"Reagent")
    Stop
  Reagent:
    TNT1 A 200
    TNT1 A 0 A_SpawnItemEx ("ReagentTan", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0)
    stop
  }
}