//Credit to Zhs2 for bothering to write initial thing, as it triggered me to expand it!
#library "VodkaIsGoodForYou"

#include "zcommon.acs"
#define NumAmmoTypes 13 // Change this to reflect the number of ammo types in your mod if you add more or weird things might happen.

int ammotypes[NumAmmoTypes] = {
"Boolet",
"100MMAmmo",
"HeadAmmo",
"IonAmmo",
"NukeCellAmmo",
"PlasmaAmmo",
"RawketAmmo",
"ErasusAmmo",
"StickyAmmo",
"VearAmmo",
"VoidAmmo",
"ErasusCasing",
"BooletCasing"
};

script 703 (void)
{
	if(CheckInventory("Backpack") && !((GetAmmoCapacity(ammotypes[0])*2)>0x7FFFFFFF) && GetCVar("RO_SuperBackpack"))
	{
		for (int i = 0; i < NumAmmoTypes; i++)
		{
			SetAmmoCapacity(ammotypes[i],GetAmmoCapacity(ammotypes[i])*2);
		}
		GiveInventory("BackPack",1);
	}
	else GiveInventory("Backpack",1);
	if(GetCVar("RO_FullBackpack") == true)
		{
		GiveInventory("Boolet",0x7FFFFFFF);
		GiveInventory("100MMAmmo",0x7FFFFFFF);
		GiveInventory("ErasusAmmo",0x7FFFFFFF);
		GiveInventory("RawketAmmo",0x7FFFFFFF);
		
		GiveInventory("HeadAmmo",0x7FFFFFFF);
		GiveInventory("NukeCellAmmo",0x7FFFFFFF);
		GiveInventory("IonAmmo",0x7FFFFFFF);
		GiveInventory("PlasmaAmmo",0x7FFFFFFF);
		GiveInventory("VoidAmmo",0x7FFFFFFF);
		GiveInventory("VearAmmo",0x7FFFFFFF);
		
		GiveInventory("StickyAmmo",0x7FFFFFFF);
		GiveInventory("BooletCasing",0x7FFFFFFF);
		GiveInventory("ErasusCasing",0x7FFFFFFF);
		}
}

script 708 (void)
{
	if(GetCVar("RO_InfiniteAmp"))
	{
		GiveInventory("InfiniteAmplifier",1);
	}
	else TakeInventory("InfiniteAmplifier",1);
}

script 698 enter
{
	if(GetCVar("RO_ComboMode"))
	{
		GiveInventory("ComboMode",1);
	}
	else TakeInventory("ComboMode",1);
	Delay(const:1);
	Restart;
}

script 717 (void)
{
	SetResultValue(GetCVar("RO_ShotgunSpawn"));
}