'##############
'Cashdesk-Script
'Kasse
'##############

'(c) 22.10.2010 Rüdiger Hülsmann
' modified for Hamburg addon Darius Bode 2012

'Revision History:
'- Rüdiger Hülsmann	22.09.2010	File created				


'Changer, lower row (single motion), Coins 0.05, 0.10, 0.50, 1.00, 2.00

{trigger:cashdesk_change_0500}
	6 (M.V.GiveChangeCoin)
{end}

{trigger:cashdesk_change_1000}
	7 (M.V.GiveChangeCoin)
{end}

{trigger:cp_wechsler_visible}
(L.L.cp_wechsler_visible) ! (S.L.cp_wechsler_visible)

{end}

{trigger:cashdesk_changer_0_05} 
{if}
	1 (S.L.cashdesk_changer_sw_0_05)
	5 (M.V.GiveChangeCoin)
	
	(L.L.cashdesk_changetimer_solo1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange_solo)
		0 (S.L.cashdesk_changetimer_solo1)
	{else}
		(L.L.cashdesk_changetimer_solo2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange_solo2)
			0 (S.L.cashdesk_changetimer_solo2)
		{else}
			(T.L.ev_ticketsale_givechange_solo3)
			0 (S.L.cashdesk_changetimer_solo3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_0_05_off}
	0 (S.L.cashdesk_changer_sw_0_05)
{end}


{trigger:cashdesk_changer_0_10}
{if}
	1 (S.L.cashdesk_changer_sw_0_10)
	4 (M.V.GiveChangeCoin)
	
	(L.L.cashdesk_changetimer_solo1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange_solo)
		0 (S.L.cashdesk_changetimer_solo1)
	{else}
		(L.L.cashdesk_changetimer_solo2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange_solo2)
			0 (S.L.cashdesk_changetimer_solo2)
		{else}
			(T.L.ev_ticketsale_givechange_solo3)
			0 (S.L.cashdesk_changetimer_solo3)	
		{endif}
		
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_0_10_off}
	0 (S.L.cashdesk_changer_sw_0_10)
{end}


{trigger:cashdesk_changer_0_20}
{if}
	1 (S.L.cashdesk_changer_sw_0_20)
	3 (M.V.GiveChangeCoin)
	
	(L.L.cashdesk_changetimer_solo1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange_solo)
		0 (S.L.cashdesk_changetimer_solo1)
	{else}
		(L.L.cashdesk_changetimer_solo2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange_solo2)
			0 (S.L.cashdesk_changetimer_solo2)
		{else}
			(T.L.ev_ticketsale_givechange_solo3)
			0 (S.L.cashdesk_changetimer_solo3)	
		{endif}
		{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_0_20_off}
	0 (S.L.cashdesk_changer_sw_0_20)
{end}


{trigger:cashdesk_changer_0_50}
{if}
	1 (S.L.cashdesk_changer_sw_0_50)
	2 (M.V.GiveChangeCoin)
	
	(L.L.cashdesk_changetimer_solo1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange_solo)
		0 (S.L.cashdesk_changetimer_solo1)
	{else}
		(L.L.cashdesk_changetimer_solo2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange_solo2)
			0 (S.L.cashdesk_changetimer_solo2)
		{else}
			(T.L.ev_ticketsale_givechange_solo3)
			0 (S.L.cashdesk_changetimer_solo3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_0_50_off}
	0 (S.L.cashdesk_changer_sw_0_50)
{end}


{trigger:cashdesk_changer_1_00}
{if}
	1 (S.L.cashdesk_changer_sw_1_00)
	1 (M.V.GiveChangeCoin)
	
	(L.L.cashdesk_changetimer_solo1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange_solo)
		0 (S.L.cashdesk_changetimer_solo1)
	{else}
		(L.L.cashdesk_changetimer_solo2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange_solo2)
			0 (S.L.cashdesk_changetimer_solo2)
		{else}
			(T.L.ev_ticketsale_givechange_solo3)
			0 (S.L.cashdesk_changetimer_solo3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_1_00_off}
	0 (S.L.cashdesk_changer_sw_1_00)
{end}


{trigger:cashdesk_changer_2_00}
{if}
	1 (S.L.cashdesk_changer_sw_2_00)
	0 (M.V.GiveChangeCoin)
	
	(L.L.cashdesk_changetimer_solo1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange_solo)
		0 (S.L.cashdesk_changetimer_solo1)
	{else}
		(L.L.cashdesk_changetimer_solo2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange_solo2)
			0 (S.L.cashdesk_changetimer_solo2)
		{else}
			(T.L.ev_ticketsale_givechange_solo3)
			0 (S.L.cashdesk_changetimer_solo3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_2_00_off}
	0 (S.L.cashdesk_changer_sw_2_00)
{end}


'Changer, upper row (double motion), Coins 3*0.05, 3*0.10, 3*0.50, 4*1.00, 4*2.00

{trigger:cashdesk_changer_0_15}
{if}
	1 (S.L.cashdesk_changer_sw_0_15) (S.L.cashdesk_changer_sw_0_05)
	

	(L.L.cashdesk_set_euro) !
	{if}
		5 (M.V.GiveChangeCoin)
		5 (M.V.GiveChangeCoin)
		5 (M.V.GiveChangeCoin)
	{else}
		5 (M.V.GiveChangeCoin)
		5 (M.V.GiveChangeCoin)
		5 (M.V.GiveChangeCoin)
		5 (M.V.GiveChangeCoin)
	{endif}
	
	(L.L.cashdesk_changetimer1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange)
		0 (S.L.cashdesk_changetimer1)
	{else}
		(L.L.cashdesk_changetimer2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange2)
			0 (S.L.cashdesk_changetimer2)
		{else}
			(T.L.ev_ticketsale_givechange3)
			0 (S.L.cashdesk_changetimer3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_0_15_off}
	0 (S.L.cashdesk_changer_sw_0_15) (S.L.cashdesk_changer_sw_0_05)
{end}


{trigger:cashdesk_changer_0_30}
{if}
	1 (S.L.cashdesk_changer_sw_0_30) (S.L.cashdesk_changer_sw_0_10)
	
	(L.L.cashdesk_set_euro) !
	{if}
		4 (M.V.GiveChangeCoin)
		4 (M.V.GiveChangeCoin)
		4 (M.V.GiveChangeCoin)
		4 (M.V.GiveChangeCoin)
	{else}
		4 (M.V.GiveChangeCoin)
		4 (M.V.GiveChangeCoin)
		4 (M.V.GiveChangeCoin)
		4 (M.V.GiveChangeCoin)
	{endif}
	
	(L.L.cashdesk_changetimer1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange)
		0 (S.L.cashdesk_changetimer1)
	{else}
		(L.L.cashdesk_changetimer2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange2)
			0 (S.L.cashdesk_changetimer2)
		{else}
			(T.L.ev_ticketsale_givechange3)
			0 (S.L.cashdesk_changetimer3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_0_30_off}
	0 (S.L.cashdesk_changer_sw_0_30) (S.L.cashdesk_changer_sw_0_10)
{end}


{trigger:cashdesk_changer_0_40}
{if}
	1 (S.L.cashdesk_changer_sw_0_40) (S.L.cashdesk_changer_sw_0_20)
	
	(L.L.cashdesk_set_euro) !
	{if}
		3 (M.V.GiveChangeCoin)
		3 (M.V.GiveChangeCoin)
		3 (M.V.GiveChangeCoin)
		3 (M.V.GiveChangeCoin)
	{else}
		3 (M.V.GiveChangeCoin)
		3 (M.V.GiveChangeCoin)
		3 (M.V.GiveChangeCoin)
	{endif}
	
	(L.L.cashdesk_changetimer1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange)
		0 (S.L.cashdesk_changetimer1)
	{else}
		(L.L.cashdesk_changetimer2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange2)
			0 (S.L.cashdesk_changetimer2)
		{else}
			(T.L.ev_ticketsale_givechange3)
			0 (S.L.cashdesk_changetimer3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_0_40_off}
	0 (S.L.cashdesk_changer_sw_0_40) (S.L.cashdesk_changer_sw_0_20)
{end}


{trigger:cashdesk_changer_1_50} 
{if}
	1 (S.L.cashdesk_changer_sw_1_50) (S.L.cashdesk_changer_sw_0_50)
	

	(L.L.cashdesk_set_euro) !
	{if}
		2 (M.V.GiveChangeCoin)
		2 (M.V.GiveChangeCoin)
		2 (M.V.GiveChangeCoin)
	{else}
		2 (M.V.GiveChangeCoin)
		2 (M.V.GiveChangeCoin)
		2 (M.V.GiveChangeCoin)
		2 (M.V.GiveChangeCoin)

	{endif}
	
	(L.L.cashdesk_changetimer1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange)
		0 (S.L.cashdesk_changetimer1)
	{else}
		(L.L.cashdesk_changetimer2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange2)
			0 (S.L.cashdesk_changetimer2)
		{else}
			(T.L.ev_ticketsale_givechange3)
			0 (S.L.cashdesk_changetimer3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_1_50_off}
	0 (S.L.cashdesk_changer_sw_1_50) (S.L.cashdesk_changer_sw_0_50)
{end}


{trigger:cashdesk_changer_4_00}
{if}
	1 (S.L.cashdesk_changer_sw_4_00) (S.L.cashdesk_changer_sw_1_00)
	
	(L.L.cashdesk_set_euro) !
	{if}
		1 (M.V.GiveChangeCoin)
		1 (M.V.GiveChangeCoin)
		1 (M.V.GiveChangeCoin)
	{else}
		1 (M.V.GiveChangeCoin)
		1 (M.V.GiveChangeCoin)
		1 (M.V.GiveChangeCoin)
		1 (M.V.GiveChangeCoin)
	{endif}
	
	(L.L.cashdesk_changetimer1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange)
		0 (S.L.cashdesk_changetimer1)
	{else}
		(L.L.cashdesk_changetimer2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange2)
			0 (S.L.cashdesk_changetimer2)
		{else}
			(T.L.ev_ticketsale_givechange3)
			0 (S.L.cashdesk_changetimer3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_4_00_off}
	0 (S.L.cashdesk_changer_sw_4_00) (S.L.cashdesk_changer_sw_1_00)
{end}


{trigger:cashdesk_changer_8_00}
{if}
	1 (S.L.cashdesk_changer_sw_8_00) (S.L.cashdesk_changer_sw_2_00)
	0 (M.V.GiveChangeCoin)
	0 (M.V.GiveChangeCoin)
	0 (M.V.GiveChangeCoin)
	
	(L.L.cashdesk_changetimer1) 1 >
	{if}
		(T.L.ev_ticketsale_givechange)
		0 (S.L.cashdesk_changetimer1)
	{else}
		(L.L.cashdesk_changetimer2) 1 >
		{if}
			(T.L.ev_ticketsale_givechange2)
			0 (S.L.cashdesk_changetimer2)
		{else}
			(T.L.ev_ticketsale_givechange3)
			0 (S.L.cashdesk_changetimer3)	
		{endif}
	{endif}	
	{endif}	
{end}

{trigger:cashdesk_changer_8_00_off}
	0 (S.L.cashdesk_changer_sw_8_00) (S.L.cashdesk_changer_sw_2_00)
{end}



{macro:cashdesk_frame}


	
'	Test: 3-fache Polyphonie der Geldausgabesounds für mehr Geschepper ;-)

	(L.L.cashdesk_changetimer1) (L.S.Timegap) + (S.L.cashdesk_changetimer1)
	(L.L.cashdesk_changetimer2) (L.S.Timegap) + (S.L.cashdesk_changetimer2)
	(L.L.cashdesk_changetimer3) (L.S.Timegap) + (S.L.cashdesk_changetimer3)

	(L.L.cashdesk_changetimer_solo1) (L.S.Timegap) + (S.L.cashdesk_changetimer_solo1)
	(L.L.cashdesk_changetimer_solo2) (L.S.Timegap) + (S.L.cashdesk_changetimer_solo2)
	(L.L.cashdesk_changetimer_solo3) (L.S.Timegap) + (S.L.cashdesk_changetimer_solo3)

{end}



