// Synthetic-Fire system. Uses ACS and GetPlayerInput to 'simulate' the use of
// fire buttons. This effectively allows for true dual-wielded weapons. Nifty!
// Courtesy of Xaser. Shoot first, ask questions later!

#library "synthfire"
#include "zcommon.acs"

script 720 (void)
{
	while(checkinventory("SynthFireActive")>0)
	{
		if(getplayerinput(-1, INPUT_BUTTONS) & BT_ATTACK)
		{
			giveinventory("SynthFireLeft",1);
			while(checkinventory("SynthFireLeft">0) || getplayerinput(-1, INPUT_BUTTONS) & BT_ATTACK) { delay(1); }
			takeinventory("SynthFireLeft",1);
		}
		delay(1);
	}
}

script 721 (void)
{
	while(CheckInventory("SynthFireActive")>0)
	{
		if(GetPlayerInput(-1, INPUT_BUTTONS) & BT_ALTATTACK)
		{
			GiveInventory("SynthFireRight",1);
			while(GetPlayerInput(-1, INPUT_BUTTONS) & BT_ALTATTACK) { delay(1); }
			TakeInventory("SynthFireRight",1);
		}
		delay(1);
	}
}