// rain - Tue Sep 23 20:40:37 EDT 2003 - fixed setautospawns
// rain - Mon Feb  9 23:50:28 EST 2004 - made truck non-dynamitable
// Dersaidin	24/1/08 				 remove wait before wm_endround

game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	30
		wm_allied_respawntime	20
		wm_number_of_objectives 5
		wm_set_round_timelimit	20

		// Objectives
		// 1: Get into radar installation
		// 2: Deconstruct radar(s)
		// 3: Forward Bunker
		// 4: Axis Field Command
		// 5: Allies Base of Operations

		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		wm_objective_status 1 1 0
		wm_objective_status 1 0 0
		wm_objective_status 2 1 0
		wm_objective_status 2 0 0
		wm_objective_status 3 1 0
		wm_objective_status 3 0 0
		wm_objective_status 4 1 0
		wm_objective_status 4 0 0
		wm_objective_status 5 1 0
		wm_objective_status 5 0 0

		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// Winner on expiration of round timer (0=Axis, 1=Allies)
		wm_setwinner	0

		accum 1 set 0		// Set counter for radar equipment

		wait 500
		// spawns:
		// Abandoned Villa
		// Forward Bunker
		// Lower Warehouse
		// rain - set allied initial autospawn properly
		setautospawn "Abandoned Villa" 1
		setautospawn "Forward Bunker" 0

		disablespeaker allies_compost_sound
		disablespeaker axis_compost_sound

		// wait for everything to settle
		wait 500

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "radar_axis_entrances_defend"
		wm_addteamvoiceannounce 0 "radar_axis_bunker_stop"
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "radar_allies_entrances_destroy"
		wm_addteamvoiceannounce 1 "radar_allies_bunker_capture"

		wm_teamvoiceannounce 0 "radar_axis_entrances_defend"
		wm_teamvoiceannounce 0 "radar_axis_bunker_stop"
		wm_teamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 1 "radar_allies_entrances_destroy"
		wm_teamvoiceannounce 1 "radar_allies_bunker_capture"
		// *---------------------------------------------------------------------------------*
	}

	trigger stolen_circuit
	{
		accum 1 inc 1				// One circuit board home
		trigger game_manager checkgame		// Check for end of game
	}

	trigger maindoor1_destroyed
	{
		wm_objective_status 1 1 1
		wm_objective_status 1 0 2

		wm_set_main_objective		2	0
		wm_set_main_objective		2	1

		// spawns:
		// Abandoned Villa
		// Forward Bunker
		// Lower Warehouse
		setautospawn "Forward Bunker" 1
		setautospawn "Lower Warehouse" 0

		trigger roadbunker kill // Switch forward spawn to Allied ONLY
		wm_announce	"Allies have breached the Main Entrance and secured the Forward Bunker!"

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "radar_axis_radars_defend"

		wm_addteamvoiceannounce 1 "radar_allies_radars_steal"

		wm_teamvoiceannounce 0 "radar_axis_entrance1_destroyed"
		wm_teamvoiceannounce 0 "radar_axis_radars_defend"

		wm_teamvoiceannounce 1 "radar_allies_entrance1_destroyed"
		wm_teamvoiceannounce 1 "radar_allies_radars_steal"

		wm_removeteamvoiceannounce 0 "radar_axis_entrances_defend"
		wm_removeteamvoiceannounce 0 "radar_axis_entrance1_defend"
		wm_removeteamvoiceannounce 0 "radar_axis_bunker_stop"

		wm_removeteamvoiceannounce 1 "radar_allies_entrances_destroy"
		wm_removeteamvoiceannounce 1 "radar_allies_entrance1_destroy"
		wm_removeteamvoiceannounce 1 "radar_allies_bunker_capture"
		// *---------------------------------------------------------------------------------*
	}

	trigger sidedoor1_destroyed
	{
		wm_objective_status 1 1 1
		wm_objective_status 1 0 2

		wm_set_main_objective		2	0
		wm_set_main_objective		2	1

		wm_announce	"Allies have breached the Side Entrance!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "radar_axis_entrance2_destroyed"

		wm_teamvoiceannounce 1 "radar_allies_entrance2_destroyed"

		trigger allied_radio_built_model alliedcompostvo

		wm_removeteamvoiceannounce 0 "radar_axis_entrances_defend"
		wm_removeteamvoiceannounce 0 "radar_axis_entrance2_defend"

		wm_removeteamvoiceannounce 1 "radar_allies_entrances_destroy"
		wm_removeteamvoiceannounce 1 "radar_allies_entrance2_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger checkgame
	{
		accum 1 abort_if_not_equal 2
		wm_setwinner 1
		//wait 1500
		wm_endround
	}
}

truckbox1
{
	spawn
	{
		wait 50
		setstate truckbox1 invisible
		accum 1 set 0
	}

	trigger visible
	{
		setstate truckbox1 default
		accum 1 abort_if_not_equal 0
		wm_announce	"Allies have secured the West Radar Parts!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radarw_secured"

		wm_teamvoiceannounce 1 "radar_allies_radarw_secured"

		wm_removeteamvoiceannounce 0 "radar_axis_radarw_defend"
		// *---------------------------------------------------------------------------------*

		accum 1 set 1
	}

	trigger invisible
	{
		setstate truckbox1 invisible
	}
}

truckbox2
{
	spawn
	{
		wait 50
		setstate truckbox2 invisible
		accum 1 set 0
	}

	trigger visible
	{
		setstate truckbox2 default
		accum 1 abort_if_not_equal 0
		wm_announce "Allies have secured the East Radar Parts!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radare_secured"

		wm_teamvoiceannounce 1 "radar_allies_radare_secured"

		wm_removeteamvoiceannounce 0 "radar_axis_radare_defend"
		// *---------------------------------------------------------------------------------*

		accum 1 set 1
	}

	trigger invisible
	{
		setstate truckbox2 invisible
	}
}

truckboxtrans1
{
	trigger visible
	{
		setstate truckboxtrans1 default
	}

	trigger invisible
	{
		setstate truckboxtrans1 invisible
	}
}

truckboxtrans2
{
	trigger visible
	{
		setstate truckboxtrans2 default
	}

	trigger invisible
	{
		setstate truckboxtrans2 invisible
	}
}

thunderstuff
{
	spawn
	{
		accum 0 set 0 //randomiser to play different lightnings and thunders
		trigger self random
	}

	trigger random
	{
		accum 0 random 5
		accum 0 trigger_if_equal 0 thunderstuff thunder01
		accum 0 trigger_if_equal 1 thunderstuff thunder02
		accum 0 trigger_if_equal 2 thunderstuff thunder03
		accum 0 trigger_if_equal 3 thunderstuff thunder04
		accum 0 trigger_if_equal 4 thunderstuff thunder05
		wait 25000
		trigger self random
	}

	trigger thunder01
	{
		alertentity lightning01
		togglespeaker thunderspeaker01
	}

	trigger thunder02
	{
		alertentity lightning02
		togglespeaker thunderspeaker02
	}

	trigger thunder03
	{
		alertentity lightning03
		togglespeaker thunderspeaker03
	}

	trigger thunder04
	{
		alertentity lightning04
		togglespeaker thunderspeaker04
	}

	trigger thunder05
	{
		alertentity lightning05
		togglespeaker thunderspeaker05
	}
}

truck_exitpoint // Exit point of map
{
	death
	{
		trigger game_manager stolen_circuit
	}
}

// ================================================
// ============== RADAR DISH MISC =================
// ================================================

radarbox1
{
	spawn
	{
	}

	trigger stolen
	{
		setstate circuit1 invisible
		trigger circuit1_radartop down

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radarw_taken"

		wm_teamvoiceannounce 1 "radar_allies_radarw_taken"
		// *---------------------------------------------------------------------------------*
	}

	trigger dropped
	{
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radarw_lost"

		wm_teamvoiceannounce 1 "radar_allies_radarw_lost"
		// *---------------------------------------------------------------------------------*
	}

	trigger returned
	{
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radarw_returned"

		wm_teamvoiceannounce 1 "radar_allies_radarw_returned"
		// *---------------------------------------------------------------------------------*

		setstate circuit1 default
		trigger circuit1_radartop up
	}

	trigger captured
	{
		trigger truckbox1 visible
		trigger truckboxtrans1 invisible
	}
}

circuit1_radartop
{
	spawn
	{
		accum 1 set 0	// 0:Down 1:Up
		accum 2 set 0	// 0:Stationary 1:Moving
		accum 3 set 0	// requested direction
		wait 50
		trigger circuit1_radartop up
	}

	trigger up
	{
		accum 3 set 1

		accum 1 abort_if_equal 1		// Abort if UP already
		accum 2 abort_if_equal 1		// Abort if moving already

		stopsound
		playsound sound/vehicles/misc/radar_start.wav volume 64	// radar start sound

		accum 2 set 1				// Moving, DND
		startanimation 0 35 15 nolerp norandom noloop
		wait 2500
		startanimation 34 1 15 norandom noloop	// Client PVS issue
		setrotation 0 30 0
		accum 2 set 0				// Finished
		accum 1 set 1				// Now in UP status

		enablespeaker radar1_sound	// radar spinning sound

		accum 3 abort_if_equal 1

		trigger self down
	}

	trigger down
	{
		accum 3 set 0

		accum 1 abort_if_equal 0		// Abort if DOWN already
		accum 2 abort_if_equal 1		// Abort if moving already

		disablespeaker radar1_sound		// radar spinning sound
		playsound sound/vehicles/misc/radar_end.wav volume 64	// radar stop sound

		accum 2 set 1				// Moving, DND
		stoprotation
		startanimation 34 29 15 nolerp norandom noloop
		wait 2500
		startanimation 0 1 15 norandom noloop	// Client PVS issue
		accum 2 set 0				// Finished
		accum 1 set 0				// Now in DOWN status

		accum 3 abort_if_equal 0

		trigger self up
	}
}

radarbox2
{
	spawn
	{
	}

	trigger stolen
	{
		setstate circuit2 invisible
		trigger circuit2_radartop down

		wait 1000

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radare_taken"

		wm_teamvoiceannounce 1 "radar_allies_radare_taken"
		// *---------------------------------------------------------------------------------*
	}

	trigger dropped
	{
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radare_lost"

		wm_teamvoiceannounce 1 "radar_allies_radare_lost"
		// *---------------------------------------------------------------------------------*
	}

	trigger returned
	{
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_radare_returned"

		wm_teamvoiceannounce 1 "radar_allies_radare_returned"
		// *---------------------------------------------------------------------------------*

		setstate circuit2 default
		trigger circuit2_radartop up
	}

	trigger captured
	{
		trigger truckbox2 visible
		trigger truckboxtrans2 invisible
	}
}

circuit2_radartop
{
	spawn
	{
		accum 1 set 0	// 0:Down 1:Up
		accum 2 set 0	// 0:Stationary 1:Moving
		accum 3 set 0	// requested direction
		wait 2500	// Offset so both radar's don't start at the same time
		trigger circuit2_radartop up
	}

	trigger up
	{
		accum 3 set 1

		accum 1 abort_if_equal 1		// Abort if UP already
		accum 2 abort_if_equal 1		// Abort if moving already

		stopsound
		playsound sound/vehicles/misc/radar_start.wav volume 64	// radar start sound

		accum 2 set 1				// Moving, DND
		startanimation 0 35 15 nolerp norandom noloop
		wait 2500
		startanimation 34 1 15 norandom noloop	// Client PVS issue
		setrotation 0 30 0
		accum 2 set 0				// Finished
		accum 1 set 1				// Now in UP status

		enablespeaker radar2_sound	// radar spinning sound

		accum 3 abort_if_equal 1

		trigger self down
	}

	trigger down
	{
		accum 3 set 0

		accum 1 abort_if_equal 0		// Abort if DOWN already
		accum 2 abort_if_equal 1		// Abort if moving already

		disablespeaker radar2_sound	// radar spinning sound
		playsound sound/vehicles/misc/radar_end.wav volume 64	// radar stop sound

		accum 2 set 1				// Moving, DND
		stoprotation
		startanimation 34 29 15 nolerp norandom noloop
		wait 2500
		startanimation 0 1 15 norandom noloop	// Client PVS issue
		accum 2 set 0				// Finished
		accum 1 set 0				// Now in DOWN status

		accum 3 abort_if_equal 0

		trigger self up
	}
}

// ================================================
// =============== BASE ENTRANCES =================
// ================================================

maindoor1 // Front door of complex
{
	spawn
	{
		wait 50
		constructible_class	3
	}

	death
	{
		trigger game_manager maindoor1_destroyed
	}
}

sidedoor1 // Side door of complex
{
	spawn
	{
		wait 50
		constructible_class	3
	}

	death
	{
		trigger game_manager sidedoor1_destroyed
	}
}

// ================================================
// =========== SPAWN POINT CONTROLS ===============
// ================================================
roadbunker
{
	spawn
	{
		accum 0 set 0	// 0-Axis, 1-Allied
	}

	trigger axis_capture	// Flag has been claimed by an axis player
	{
		accum 0 abort_if_equal 0 // Do Axis already own the flag?

		accum 0 set 0 // Axis own the flag
		wm_announce	"Axis reclaim the Forward Bunker!"


		wm_objective_status 3 1 2
		wm_objective_status 3 0 1

		// spawns:
		// Abandoned Villa
		// Forward Bunker
		// Lower Warehouse
		setautospawn "Abandoned Villa" 1
		setautospawn "Forward Bunker" 0

		alertentity roadbunker_wobj

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "radar_axis_bunker_stop"

		wm_addteamvoiceannounce 1 "radar_allies_bunker_capture"

		wm_teamvoiceannounce 0 "radar_axis_bunker_reclaimed"

		wm_teamvoiceannounce 1 "radar_allies_bunker_reclaimed"
		// *---------------------------------------------------------------------------------*
	}

	trigger allied_capture	// Flag has been claimed by an allied player
	{
		accum 0 abort_if_equal 1 // Do Allies already own flag?

		accum 0 set 1 // Allied own the flag
		wm_announce	"Allies capture the Forward Bunker!"

		wm_objective_status 3 1 1
		wm_objective_status 3 0 2

		// spawns:
		// Abandoned Villa
		// Forward Bunker
		// Lower Warehouse
		setautospawn "Forward Bunker" 1
		setautospawn "Lower Warehouse" 0

		alertentity roadbunker_wobj

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "radar_axis_bunker_captured"

		wm_teamvoiceannounce 1 "radar_allies_bunker_captured"

		wm_removeteamvoiceannounce 0 "radar_axis_bunker_stop"

		wm_removeteamvoiceannounce 1 "radar_allies_bunker_capture"
		// *---------------------------------------------------------------------------------*
	}

	trigger kill
	{
		trigger roadbunker force_allied
		remove
	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1 // Do Allies already own flag?

		wm_objective_status 3 1 1
		wm_objective_status 3 0 2

		// spawns:
		// Abandoned Villa
		// Forward Bunker
		// Lower Warehouse
		setautospawn "Forward Bunker" 1
		setautospawn "Lower Warehouse" 0

		alertentity roadbunker_wobj
		alertentity roadbunkerspawns
	}

}

// *********************************************
// ************** COMMAND POST *****************
// *********************************************
axis_radio_destroyed
{
	spawn
	{
		wait 200
		accum 0 set 0
		setstate axis_radio_destroyed invisible
		setstate axis_radio_destroyed_model invisible
	}

	trigger hide
	{
		setstate axis_radio_destroyed invisible
		setstate axis_radio_destroyed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 0
		setstate axis_radio_destroyed default
		setstate axis_radio_destroyed_model default
	}

	trigger enable
	{
		accum 0 set 1
	}

	trigger disable
	{
		accum 0 set 0
	}
}

allied_radio_destroyed
{
	spawn
	{
		wait 200
		accum 0 set 0
		setstate allied_radio_destroyed invisible
		setstate allied_radio_destroyed_model invisible
	}

	trigger hide
	{
		setstate allied_radio_destroyed invisible
		setstate allied_radio_destroyed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 0
		setstate allied_radio_destroyed default
		setstate allied_radio_destroyed_model default
	}

	trigger enable
	{
		accum 0 set 1
	}

	trigger disable
	{
		accum 0 set 0
	}
}

neutral_radio_closed
{
	spawn
	{
		accum 0 set 0
	}

	trigger hide
	{
		setstate neutral_radio_closed invisible
		setstate neutral_radio_closed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 1
		setstate neutral_radio_closed default
		setstate neutral_radio_closed_model default
	}

	trigger disable
	{
		accum 0 set 1
	}
}

allied_radio_built
{
	spawn
	{
		wait 50
		constructible_class	2
		trigger allied_radio_built setup
	}

	trigger setup
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0
	}

	buildstart final
	{
		trigger allied_radio_built_model trans
		trigger axis_radio_destroyed hide
		trigger allied_radio_destroyed hide
		trigger neutral_radio_closed 	hide
	}

	built final
	{
		trigger allied_radio_built_model show
		trigger allied_radio_destroyed enable
		trigger axis_radio_destroyed disable
		trigger neutral_radio_closed 	disable
		trigger allied_radio_built_model enable_allied_features
		trigger alliedcpspawns_obj on

		enablespeaker allies_compost_sound
	}

	decayed final
	{
		trigger allied_radio_built_model hide
		trigger allied_radio_destroyed show
		trigger axis_radio_destroyed show
		trigger neutral_radio_closed 	show
	}

	death
	{
		trigger allied_radio_built_model hide
		trigger allied_radio_destroyed show
		trigger allied_radio_built_model disable_allied_features
		trigger alliedcpspawns_obj off

		disablespeaker allies_compost_sound
	}
}

axis_radio_built
{
	spawn
	{
		wait 50
		constructible_class	2

		wait 150
		trigger axis_radio_built setup
	}

	trigger setup
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0
	}

	buildstart final
	{
		trigger axis_radio_built_model trans
		trigger axis_radio_destroyed hide
		trigger allied_radio_destroyed hide
		trigger neutral_radio_closed 	hide
	}

	built final
	{
		trigger axis_radio_built_model show
		trigger axis_radio_destroyed enable
		trigger allied_radio_destroyed enable
		trigger neutral_radio_closed 	disable
		trigger axis_radio_built_model enable_axis_features

		enablespeaker axis_compost_sound
	}

	decayed final
	{
		trigger axis_radio_built_model hide
		trigger axis_radio_destroyed show
		trigger allied_radio_destroyed show
		trigger neutral_radio_closed 	show
	}

	death
	{
		trigger axis_radio_built_model hide
		trigger axis_radio_destroyed show
		trigger axis_radio_built_model disable_axis_features

		disablespeaker axis_compost_sound
	}
}

axis_radio_built_model
{
	spawn
	{
		accum 1 set 0
		wait 200
		setstate axis_radio_built_model invisible
	}

	trigger show
	{
		setstate axis_radio_built_model default
	}

	trigger hide
	{
		setstate axis_radio_built_model invisible
	}

	trigger trans
	{
		setstate axis_radio_built_model underconstruction
	}

	trigger enable_axis_features
	{
		// axis built it
		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75
		sethqstatus 0 1

		wm_objective_status	4 1 2
		wm_objective_status	4 0 1
		wm_objective_status	5 1 2
		wm_objective_status	5 0 1

		wm_announce	"Axis Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		// *---------------------------------------------------------------------------------*
	}

	trigger disable_axis_features
	{
		// axis lost it
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0

		wm_objective_status	4 1 0
		wm_objective_status	4 0 0
		wm_objective_status	5 1 0
		wm_objective_status	5 0 0

		wm_announce	"Allied team has destroyed the Axis Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"

		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*
	}
}

allied_radio_built_model
{
	spawn
	{
		accum 1 set 0
		accum 2 set 0 // state of command post as far as the VO is concerned (0=not built, 1=built) - Wils
		wait 200
		setstate allied_radio_built_model invisible
	}

	trigger show
	{
		setstate allied_radio_built_model default
		enablespeaker neutral_radio_sound
	}

	trigger hide
	{
		setstate allied_radio_built_model invisible
		disablespeaker neutral_radio_sound
	}

	trigger trans
	{
		setstate allied_radio_built_model underconstruction
	}

	trigger alliedcompostvo
	{
		accum 2 abort_if_equal 1
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
	}
		
	trigger enable_allied_features
	{
		// allies built it
		accum 1 set 1 // Is this ever used? - Wils
		accum 2 set 1 // State of com post as far as VO is concerned (1=built)
		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75
		sethqstatus 0 1

		wm_objective_status	4 1 1
		wm_objective_status	4 0 2
		wm_objective_status	5 1 1
		wm_objective_status	5 0 2

		wm_announce	"Allied Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*
	}

	trigger disable_allied_features
	{
		// allies lost it
		accum 2 set 0 // state of com post as far as VO is concerned (0=destroyed)
		wm_announce	"Axis team has destroyed the Allied Command Post!"

		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 0 0

		wm_objective_status	4 1 0
		wm_objective_status	4 0 0
		wm_objective_status	5 1 0
		wm_objective_status	5 0 0

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		// *---------------------------------------------------------------------------------*
	}
}

alliedcpspawns_obj
{
	spawn
	{
		wait 50
		setstate alliedcpspawns_obj invisible
		setstate alliedcpspawns invisible
	}

	trigger on
	{
		setstate alliedcpspawns_obj default
		setstate alliedcpspawns default
	}

	trigger off
	{
		setstate alliedcpspawns_obj invisible
		setstate alliedcpspawns invisible
	}
}

alliedcpspawns
{
	spawn
	{
		wait 50
		setstate alliedcpspawns invisible
	}
}

// ================================================
// ========== CONSTRUCTIBLE STUFF =================
// ================================================

// Axis ONLY - old house on main road
mg42_clip_1
{
	spawn
	{
		wait 50
		constructible_class	2
		trigger mg42_clip_1 setup
	}

	trigger setup
	{
		setstate mg42_1 invisible

		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default
	}

	buildstart final
	{
		setstate mg42_1 underconstruction

		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default
	}

	built final
	{
		setstate mg42_1 default

		setstate mg42_materials_1 invisible
		setstate mg42_materials_clip_1 invisible
		setstate mg42_flag_1 invisible
		wm_announce "The Axis Road MG Nest has been constructed."
	}

	decayed final
	{
		setstate mg42_1 invisible

		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default
	}

	death
	{
		setstate mg42_1 invisible
		repairmg42 mg42_1
		setstate mg42_materials_1 default
		setstate mg42_materials_clip_1 default
		setstate mg42_flag_1 default
		wm_announce "The Axis Road MG Nest has been destroyed."
	}
}

// Axis ONLY
mg42_clip_2
{
	spawn
	{
		wait 50
		constructible_class	2
		trigger mg42_clip_2 setup
	}

	trigger setup
	{
		setstate mg42_2 invisible

		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default
	}

	buildstart final
	{
		setstate mg42_2 underconstruction

		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default
	}

	built final
	{
		setstate mg42_2 default

		setstate mg42_materials_2 invisible
		setstate mg42_materials_clip_2 invisible
		setstate mg42_flag_2 invisible
		wm_announce "The Axis Watchtower MG Nest has been constructed."
	}

	decayed final
	{
		setstate mg42_2 invisible

		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default
	}

	death
	{
		setstate mg42_2 invisible
		repairmg42 mg42_2
		setstate mg42_materials_2 default
		setstate mg42_materials_clip_2 default
		setstate mg42_flag_2 default
		wm_announce "The Axis Watchtower MG Nest has been destroyed."
	}
}

// Axis ONLY - in forward bunker pointing towards villa
mg42_clip_3
{
	spawn
	{
		wait 50
		constructible_class	2
		trigger mg42_clip_3 setup
	}

	trigger setup
	{
		setstate mg42_3 invisible
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar invisible
	}

	buildstart final
	{
		setstate mg42_3 underconstruction
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar underconstruction
	}

	built final
	{
		setstate mg42_3 default
		setstate mg42_materials_3 invisible
		setstate mg42_materials_clip_3 invisible
		setstate mg42_flag_3 invisible
		setstate mg42_clip_3_pillar default
		wm_announce "The Bunker MG Nest has been constructed."
	}

	decayed final
	{
		setstate mg42_3 invisible
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar invisible
	}

	death
	{
		setstate mg42_3 invisible
		repairmg42 mg42_3
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar invisible
		wm_announce "The Bunker MG Nest has been destroyed."
	}
}

// Allied version - in forward bunker pointing towards villa
mg42_clip_3_allied
{
	spawn
	{
		wait 50
		constructible_class	2
		trigger mg42_clip_3_allied setup
	}

	trigger setup
	{
		setstate mg42_3 invisible
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar invisible
	}

	buildstart final
	{
		setstate mg42_3 underconstruction
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar underconstruction
	}

	built final
	{
		setstate mg42_3 default
		setstate mg42_materials_3 invisible
		setstate mg42_materials_clip_3 invisible
		setstate mg42_flag_3 invisible
		setstate mg42_clip_3_pillar default
		wm_announce "The Bunker MG Nest has been constructed."
	}

	decayed final
	{
		setstate mg42_3 invisible
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar invisible
	}

	death
	{
		setstate mg42_3 invisible
		repairmg42 mg42_3
		setstate mg42_materials_3 default
		setstate mg42_materials_clip_3 default
		setstate mg42_flag_3 default
		setstate mg42_clip_3_pillar invisible
		wm_announce "The Bunker MG Nest has been destroyed."
	}
}

// ================================================
// ======== END CONSTRUCTIBLE STUFF ===============
// ================================================

lmscab_toi
{
	spawn
	{
		wait 50
		remove
	}
}

axis_hacabinet_lms
{
	spawn
	{
		wait 50
		remove
	}
}

lmshacab1
{
	spawn
	{
		wait 50
		remove
	}
}

lmshacab2
{
	spawn
	{
		wait 50
		remove
	}
}

truck_trig
{
	spawn {
		set {
			// don't allow dynamite at the truck
			spawnflags 139 // AXIS/ALLIED_OBJECTIVE | TANK | DISABLED
		}
	}
}
