// md_bunker - BUNKER ET MAP BY =MIZAR= DESIGN 
// 
// Version:	0.95
// Modified:	01.11.2003
// Copyright:	=MIZAR=

game_manager
{
	spawn
	{

		remapshaderflush

		// Set the default values for game mode and respawning
		wm_axis_respawntime		25
		wm_allied_respawntime		25
		wm_set_round_timelimit		30

		// 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

		// Objectives
		// 1: Powergenerator
		// 2: Accesscode documents
		// 3: Missile
		// 4: Tunnel fence
		// 5: Tower access door
		// 6: Flakgun access door
		// 7: Forward spawn flag

		wm_number_of_objectives		8

		// Set current main objectives for both teams
		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		// Objective status: 0=blank, 1=tick, 2=cross
		wm_objective_status 1 0 0
		wm_objective_status 1 1	0	 
		wm_objective_status 2 0	0
		wm_objective_status 2 1	0	 
		wm_objective_status 3 0	0
		wm_objective_status 3 1	0	
		wm_objective_status 4 0	0
		wm_objective_status 4 1	0	
		wm_objective_status 5 0	0
		wm_objective_status 5 1	0	
		wm_objective_status 6 0	0
		wm_objective_status 6 1	0	
		wm_objective_status 7 0	0
		wm_objective_status 7 1	0	
		wm_objective_status 8 0	0
		wm_objective_status 8 1	0	
	
		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		// Local Variables
		// 1: Powergenerator 0=OK, 1= Destroyed
		// 2: Accesscode documents 0=OK, 1=Stolen, 2=Transmitted
		// 3: Missile 0=OK, 1= Destroyed
		// 4: Watergates 0=Closed, 1=Open
		
		accum 1 set 0		
		accum 2 set 0		
		accum 3 set 0		
		accum 4 set 0	

		wait 2000

		// Set default spawn areas for both teams
		setstate forwardflag_wobj default

		setautospawn	"Axis main bunker spawn"	0
		setautospawn	"Beach spawn 1"			1


		// Initialize water gates lights
		setstate gatelight1 default
		setstate gatelight2 invisible

		// Start the warnig lights at the secured door
		setstate powerlight1b invisible
		setstate powerlight2b invisible
		trigger powerlight1 rotate
		trigger powerlight2 rotate

		trigger fan1 rotate
		trigger bigfan1 rotate
		trigger bigfan2 rotate
		trigger bigfan3 rotate
		trigger bigfan4 rotate
		trigger bigfan5 rotate
		trigger bigfan6 rotate

 	}

	// ===================================================================================

	trigger checkgame
	{
		accum 2 abort_if_not_equal 2
		accum 3 abort_if_not_equal 1

		wm_setwinner 1
		wait 500

		wm_endround
	}


	// ===================================================================================

	trigger forwardflagblue
	{
		// Change the objective state internally, so UI can update, etc.
		// Allied takes control of forward flag

		// Some kind of UI pop-up to alert players
		wm_announce	"Allies capture the forward spawn!"

		wm_objective_status	7 1 1
		wm_objective_status	7 0 2

	}

	trigger forwardflagred
	{
		// Change the objective state internally, so UI can update, etc.
		// Axis takes control of forward flag

		// Some kind of UI pop-up to alert players
		wm_announce	"Axis capture the forward spawn!"

		wm_objective_status	7 1 2
		wm_objective_status	7 0 1
	}


	// ===================================================================================

	trigger accesscode_check
	{
		accum 2 abort_if_equal 0

		trigger axiscodedoor move	// Mainbunker North
	}
	trigger accesscode_check2
	{
		accum 2 abort_if_equal 0

		trigger axiscodedoor2 move	// Mainbunker East
	}
	trigger accesscode_check3
	{
		accum 2 abort_if_equal 0	// Westbunker

		trigger axiscodedoor3 move
	}
	trigger accesscode_check4
	{
		accum 2 abort_if_equal 0	// Storagebunker West

		trigger axiscodedoor4 move
	}

	trigger accesscode_check5
	{
		accum 2 abort_if_equal 0	// Storagebunker East

		trigger axiscodedoor5 move
	}


	// Objective 3: Axis secure accesscode (team_CTF_redflag)

	trigger accesscode_death
 	{
		accum 2 set 2
 	}

	trigger accesscode_stolen
 	{
		accum 2 set 1
 	}

	trigger accesscode_returned
 	{
		accum 2 set 0		
 	}

	trigger accesscode_captured
 	{
		accum 2 set 2

		wm_objective_status 		2 0 2
		wm_objective_status 		2 1 1

		wm_announce "Allies has successfully transmitted the access codes!"

		wm_set_main_objective		3 0
		wm_set_main_objective		3 1

		//setstate alliedstoragespawn_toi default
		//setstate alliesbeachspawn_toi invisible

		//setstate axisstoragespawn_toi invisible

		//setautospawn "Axis main bunker spawn" 0
		//setautospawn "Allied storage spawn"   1

		trigger game_manager checkgame
 	}


	// entities destroyed scripting

	trigger axisgenerator_destroyed
	{
		wm_announce "Axis power generator destroyed!"
		disablespeaker generator_sound
		wait 500

		accum 1 set 1
		wm_objective_status		1 0 2
		wm_objective_status		1 1 1

		wm_set_main_objective		2 0
		wm_set_main_objective		2 1

		trigger securedoor_th powerdown
		disablespeaker securedoor_sound

		setstate powerlight1_corona invisible
		setstate powerlight2_corona invisible

		trigger powerlight1 stop
		trigger powerlight2 stop
		wait 100
		setstate powerlight1b default
		setstate powerlight1 invisible
		trigger powerlight1 disable
		setstate powerlight2b default
		setstate powerlight2 invisible
		trigger powerlight2 disable

		wm_announce "Powershield on secure door is down!"
		wait 100
		wm_announce "Protect the secure documents!"

	}

	trigger axismissile_destroyed
	{
		setstate axismissile_mod invisible
		wait 100
		kill axismissile_mod
		wait 100

		wm_announce "The Allies have destroyed the missile!"

		accum 3 set 1
		wm_objective_status		3 0 2
		wm_objective_status		3 1 1

		wait 1000
		
		trigger game_manager checkgame

	}

	trigger axisflakgundoor_destroyed
	{
		wm_announce "Axis flakgun door destroyed!"

		wm_objective_status		6 0 2
		wm_objective_status		6 1 1

	}

	trigger axistowerdoor_destroyed
	{
		wm_announce "Axis tower door destroyed!"
		wm_objective_status		5 0 2
		wm_objective_status		5 1 1
	}


	trigger axistunnelfence_destroyed
	{
		wm_announce "Axis tunnel fence destroyed!"
		wm_objective_status		4 0 2
		wm_objective_status		4 1 1
	}


	trigger securedoor_th_death
	{
		setstate securedoor_th invisible
		disablespeaker securedoor_sound

		wm_announce "Powershield on secure door is down!"
	}

	trigger controlroom_destroyed
	{
		wm_announce "Bassin wall destroyed!"
	}

	trigger gates_open
	{

		accum 4 abort_if_not_equal 0 // gates closed?
		wm_announce	"Water gates are opening!"
		wait 100
 		trigger gate1 move_up
		trigger gate2 move_up

		setstate gatelight2 default
		setstate gatelight1 invisible
		wm_announce	"Water gates are opened!"
		accum 4 set 1
	}

	trigger gates_close
	{
		accum 4 abort_if_not_equal 1 // gates closed?
		wm_announce	"Water gates are closing!"
		wait 100
 		trigger gate1 move_down
		trigger gate2 move_down

		setstate gatelight1 default
		setstate gatelight2 invisible
		wm_announce	"Water gates are closed!"
		accum 4 set 0
	}


}


// ===================================================================================
// Axis secure code doors: entities and events

axiscodedoor		// Main bunker - North door
{
	spawn
	{
		accum 1 set 0 //0 means the mover is in starting positon, 1 means it is in the end position
	}
	trigger move
	{
		accum 1 abort_if_not_equal 0 //only do this if the lift is in the start position
		accum 1 set 1
		gotomarker axiscodedoor_up 32 wait
		wait 1000
		gotomarker axiscodedoor_down 32 wait
		accum 1 set 0 //set the mover to start position
	}
}

axiscodedoortrigger	// script gets triggered when axis are near the door
{
	spawn
	{
		wait 50
	}

	trigger open
	{
		trigger axiscodedoor move
	}
}

axiscodepanel		// script gets triggered when allies enters code into panel
{
	spawn
	{
		wait 50
	}

	trigger checkcode
	{
		trigger game_manager accesscode_check
	}
}

// -------------------------------------------------------------------------------------------------

axiscodedoor2		// Main bunker - West door
{
	spawn
	{
		accum 1 set 0 //0 means the mover is in starting positon, 1 means it is in the end position
	}
	trigger move
	{
		accum 1 abort_if_not_equal 0 //only do this if the lift is in the start position
		accum 1 set 1
		gotomarker axiscodedoor2_up 32 wait
		wait 1000
		gotomarker axiscodedoor2_down 32 wait
		accum 1 set 0 //set the mover to start position
	}
}

axiscodedoor2trigger	// script gets triggered when axis are near the door
{
	spawn
	{
		wait 50
	}

	trigger open
	{
		trigger axiscodedoor2 move
	}
}

axiscodepanel2		// script gets triggered when allies enters code into panel
{
	spawn
	{
		wait 50
	}

	trigger checkcode
	{
		trigger game_manager accesscode_check2
	}
}

// -------------------------------------------------------------------------------------------------

axiscodedoor3		// West bunker door
{
	spawn
	{
		accum 1 set 0 //0 means the mover is in starting positon, 1 means it is in the end position
	}
	trigger move
	{
		accum 1 abort_if_not_equal 0 //only do this if the lift is in the start position
		accum 1 set 1
		gotomarker axiscodedoor3_up 32 wait
		wait 1000
		gotomarker axiscodedoor3_down 32 wait
		accum 1 set 0 //set the mover to start position
	}
}

axiscodedoor3trigger	// script gets triggered when axis are near the door
{
	spawn
	{
		wait 50
	}

	trigger open
	{
		trigger axiscodedoor3 move
	}
}

axiscodepanel3		// script gets triggered when allies enters code into panel
{
	spawn
	{
		wait 50
	}

	trigger checkcode
	{
		trigger game_manager accesscode_check3
	}
}

// -------------------------------------------------------------------------------------------------

axiscodedoor4		// Storage bunker - West door
{
	spawn
	{
		accum 1 set 0 //0 means the mover is in starting positon, 1 means it is in the end position
	}
	trigger move
	{
		accum 1 abort_if_not_equal 0 //only do this if the lift is in the start position
		accum 1 set 1
		gotomarker axiscodedoor4_up 32 wait
		wait 1000
		gotomarker axiscodedoor4_down 32 wait
		accum 1 set 0 //set the mover to start position
	}
}

axiscodedoor4trigger	// script gets triggered when axis are near the door
{
	spawn
	{
		wait 50
	}

	trigger open
	{
		trigger axiscodedoor4 move
	}
}

axiscodepanel4		// script gets triggered when allies enters code into panel
{
	spawn
	{
		wait 50
	}

	trigger checkcode
	{
		trigger game_manager accesscode_check4
	}
}



// -------------------------------------------------------------------------------------------------

axiscodedoor5		// Storage bunker - East door
{
	spawn
	{
		accum 1 set 0 //0 means the mover is in starting positon, 1 means it is in the end position
	}
	trigger move
	{
		accum 1 abort_if_not_equal 0 //only do this if the lift is in the start position
		accum 1 set 1
		gotomarker axiscodedoor5_up 32 wait
		wait 1000
		gotomarker axiscodedoor5_down 32 wait
		accum 1 set 0 //set the mover to start position
	}
}

axiscodedoor5trigger	// script gets triggered when axis are near the door
{
	spawn
	{
		wait 50
	}

	trigger open
	{
		trigger axiscodedoor5 move
	}
}

axiscodepanel5		// script gets triggered when allies enters code into panel
{
	spawn
	{
		wait 50
	}

	trigger checkcode
	{
		trigger game_manager accesscode_check5
	}
}


// ===================================================================================
// Objectives

// Objective 1: Axis Power generator (West bunker)
axisgenerator
{
	spawn
	{
		wait 50
		constructible_class 3
		constructible_destructxpbonus 30
	}

	death
	{
		trigger game_manager axisgenerator_destroyed
		remove
	}
}

// Objective 2: Axis secure accesscode (team_CTF_redflag)
accesscode
{
	spawn
	{
		wait 50
	}

	death
	{
		trigger game_manager accesscode_death
	}

	trigger stolen
	{
		trigger game_manager accesscode_stolen
	}

	trigger returned
	{
		trigger game_manager accesscode_returned
	}

	trigger captured
	{
		trigger game_manager accesscode_captured
	}
}

accesscodedrop
{
	spawn
	{
		wait 50
	}

}

// Objective 3: Axis Missle (Missile bunker)
axismissile
{
	spawn
	{
		wait 50
		constructible_class 3
		constructible_destructxpbonus 50
	}

	death
	{
		trigger game_manager axismissile_destroyed
		remove
	}
}

axismissile_mod
{
	spawn
	{
		wait 50
	}
}



// ===================================================================================
// Secondary Objectives & destructible entities

// Objective 4: Axis tunnel fence (Main bunker complex)
axistunnelfence
{
	spawn
	{
		wait 50
		constructible_class 3
		constructible_destructxpbonus 15
	}

	death
	{
		trigger game_manager axistunnelfence_destroyed
		remove
	}
	
}

// Objective 5: Axis tower door (West tower)
axistowerdoor
{
	spawn
	{
		wait 50
		constructible_class 3
		constructible_destructxpbonus 15
	}

	death
	{
		trigger game_manager axistowerdoor_destroyed
		remove
	}
}


// Objective 6: Axis Flakgun door (West bunker)
axisflakgundoor
{
	spawn
	{
		wait 50
		constructible_class 3
		constructible_destructxpbonus 15
	}

	death
	{
		trigger game_manager axisflakgundoor_destroyed
		remove
	}
}

// Secondary Objective: Axis trigger hurt (powershield) (West bunker)
securedoor_th
{
	spawn
	{
		wait 50
	}

	trigger powerdown
	{
		trigger game_manager securedoor_th_death
		remove
	}
}

// Secondary Objective: Axis secret tunnel wall (Main bunker complex)
axistunnelwall1
{
	spawn
	{
		wait 50
		constructible_class 3
		constructible_destructxpbonus 15
	}

	death
	{
		trigger game_manager axistunnelwall1_destroyed
		remove
	}
		
}

// Secondary Objective: Axis water gates control room (Main bunker complex)
controlroom
{
	spawn
	{
		wait 50
		constructible_class 3
		constructible_destructxpbonus 15
	}

	death
	{
		trigger game_manager controlroom_destroyed
		remove
	}
		
}

// ===================================================================================

// Secure door: Power warning lights
powerlight1
{
	spawn
	{
		wait 50
	}

	trigger rotate
	{
		setrotation 0 500 0
	}
	trigger stop
	{
		stoprotation
		faceangles 0 0 0 500	
	}
	trigger disable
	{
		remove
	}
}

powerlight1b
{
	spawn
	{
		wait 50
	}
}

powerlight2
{
	spawn
	{
		wait 50
	}

	trigger rotate
	{
		setrotation 0 500 0
	}
	trigger stop
	{
		stoprotation
		faceangles 0 0 0 500	
	}
	trigger disable
	{
		remove
	}
}

powerlight2b
{
	spawn
	{
		wait 50
	}
}

powerflash
{
	spawn
	{
		wait 50
	}
}

// ===================================================================================
// Control room and watergates

gatepanel		// script gets triggered when allies enters code into panel
{
	spawn
	{
		wait 50
	}
	trigger switchgates
	{
		trigger game_manager gates_open
		trigger game_manager gates_close
	}
}

gate1		// script_mover entity and event
{
	spawn
	{
		accum 1 set 0 //0 means the mover is in starting positon, 1 means it is in the end position
	}
	trigger move_up
	{
		accum 1 abort_if_not_equal 0 //only do this if the lift is in the start position
		wm_announce	"Allies are opening the water gates!"
		wait 100
		gotomarker gate1_up 32 wait
		wm_announce	"Allies have opened the water gates!"
		accum 1 set 1
	}
	trigger move_down
	{
		accum 1 abort_if_not_equal 1 //only do this if the lift is in the start position
		wm_announce	"Axis are closing the water gates!"
		wait 100
		gotomarker gate1_down 32 wait
		wm_announce	"Axis have closed the water gates!"
		accum 1 set 0
	}
}


gate2		// script_mover entity and event
{
	spawn
	{
		accum 1 set 0 //0 means the mover is in starting positon, 1 means it is in the end position
	}
	trigger move_up
	{
		accum 1 abort_if_not_equal 0 //only do this if the lift is in the start position
		gotomarker gate2_up 32 wait
		accum 1 set 1
	}
	trigger move_down
	{
		accum 1 abort_if_not_equal 1 //only do this if the lift is in the start position
		gotomarker gate2_down 32 wait
		accum 1 set 0
	}
}

gatelight1
{
	spawn
	{
		wait 50
	}
}

gatelight2
{
	spawn
	{
		wait 50
	}
}


// Fun stuff

fan1
{
	spawn
	{
		wait 50
	}

	trigger rotate
	{
		setrotation 0 500 0
	}
	trigger stop
	{
		stoprotation
		faceangles 0 0 0 500	
	}
	trigger disable
	{
		remove
	}
}

bigfan1
{
	trigger rotate
	{
		setrotation 0 0 10
	}
}

bigfan2
{
	trigger rotate
	{
		setrotation 0 0 10
	}
}

bigfan3
{
	trigger rotate
	{
		setrotation 0 0 10
	}
}

bigfan4
{
	trigger rotate
	{
		setrotation 0 0 10
	}
}

bigfan5
{
	trigger rotate
	{
		setrotation 0 0 10
	}
}

bigfan6
{
	trigger rotate
	{
		setrotation 0 0 10
	}
}

// ===========================================================================
// Constructibles


towerbridge
{
	spawn
	{
		wait 50
		constructible_weaponclass 2

		constructible_constructxpbonus 15
		constructible_destructxpbonus 15
		constructible_duration 3000
	}

	buildstart final
	{
		setstate towerbridge underconstruction

	}

	built final
	{
		setstate towerbridge default
		setstate towerbridge_materials invisible

      		wm_announce   "Axis have built the tower bridge!" 
	}

   	decayed final 
   	{ 
      		trigger self startup 
   	} 

   	death 
   	{ 
      		trigger self startup 

      		wm_announce   "Allied team has destroyed the tower bridge!" 
	} 


	trigger startup 
   	{ 
		setstate towerbridge invisible
		setstate towerbridge_materials default
   	} 

}

missilegate1
{
	spawn
	{
		wait 50
		constructible_weaponclass 2

		constructible_constructxpbonus 15
		constructible_destructxpbonus 15
		constructible_duration 3000
	}

	buildstart final
	{
		setstate missilegate1 underconstruction

	}

	built final
	{
		setstate missilegate1 default
		setstate missilegate1_materials invisible

      		wm_announce   "Axis have built the gate to the missile bunkers!" 
	}

   	decayed final 
   	{ 
      		trigger self startup 
   	} 

   	death 
   	{ 
      		trigger self startup 

      		wm_announce   "Allied team has destroyed the gate to the misile bunkers!" 
	} 


	trigger startup 
   	{ 
		setstate missilegate1  invisible
		setstate missilegate1_materials default
   	} 

}


//Constructable MG positions


//Axis MG

axismg1_script 
{ 
	spawn 
	{ 
      		wait 200 
      		constructible_class 2 

		constructible_constructxpbonus 5
		constructible_destructxpbonus 5
		constructible_duration 2000

      		trigger self startup 
   	} 

   	buildstart final 
   	{ 
      		setstate axismg1_box underconstruction
   	} 

   	built final 
   	{ 
      		setstate axismg1_box default 
      		setstate axismg1_extra default 
      		setstate axismg1_mg42  default 
      		setstate axismg1_materials invisible 

      		wm_announce   "First Axis MG nest constructed!" 
   	} 

   	decayed final 
   	{ 
      		trigger self startup 
   	} 

   	death 
   	{ 
      		trigger self startup 

      		wm_announce   "Allied team has destroyed the first Axis MG nest!" 
	} 

	trigger startup 
   	{ 
      		setstate axismg1_box invisible 
		setstate axismg1_extra invisible 
		setstate axismg1_mg42  invisible 
		setstate axismg1_materials default 
      		repairmg42 construction_mg42 
   	} 
} 

axismg2_script 
{ 
	spawn 
	{ 
      		wait 200 
      		constructible_class 2 

		constructible_constructxpbonus 5
		constructible_destructxpbonus 5
		constructible_duration 2000

      		trigger self startup 
   	} 

   	buildstart final 
   	{ 
      		setstate axismg2_box underconstruction
   	} 

   	built final 
   	{ 
      		setstate axismg2_box default 
      		setstate axismg2_extra default 
      		setstate axismg2_mg42  default 
      		setstate axismg2_materials invisible 

      		wm_announce   "Second Axis MG nest constructed!" 
   	} 

   	decayed final 
   	{ 
      		trigger self startup 
   	} 

   	death 
   	{ 
      		trigger self startup 

      		wm_announce   "Allied team has destroyed the second Axis MG nest!" 
	} 

	trigger startup 
   	{ 
      		setstate axismg2_box invisible 
		setstate axismg2_extra invisible 
		setstate axismg2_mg42  invisible 
		setstate axismg2_materials default 
      		repairmg42 construction_mg42 
   	} 
} 

axismg3_script 
{ 
	spawn 
	{ 
      		wait 200 
      		constructible_class 2 

		constructible_constructxpbonus 5
		constructible_destructxpbonus 5
		constructible_duration 2000

      		trigger self startup 
   	} 

   	buildstart final 
   	{ 
      		setstate axismg3_box underconstruction
   	} 

   	built final 
   	{ 
      		setstate axismg3_box default 
      		setstate axismg3_extra default 
      		setstate axismg3_mg42  default 
      		setstate axismg3_materials invisible 

      		wm_announce   "Third Axis MG nest constructed!" 
   	} 

   	decayed final 
   	{ 
      		trigger self startup 
   	} 

   	death 
   	{ 
      		trigger self startup 

      		wm_announce   "Allied team has destroyed the third Axis MG nest!" 
	} 

	trigger startup 
   	{ 
      		setstate axismg3_box invisible 
		setstate axismg3_extra invisible 
		setstate axismg3_mg42  invisible 
		setstate axismg3_materials default 
      		repairmg42 construction_mg42 
   	} 
} 

// FORWARD SPAWN POINT ================================================

forward_spawn
{
	spawn
	{
		wait 200
		setstate forwardflag_wobj invisible
		accum 0 set 0
	}

	trigger axis_capture
	{
		trigger game_manager forwardflagred
		trigger forward_spawn setaxis
	}

	trigger allied_capture
	{
		trigger game_manager forwardflagblue
		trigger forward_spawn setallies
	}

	trigger setaxis
	{
		setstate forwardflag_wobj default
		accum 0 abort_if_equal 0
		accum 0 set 0
		alertentity forwardflag_wobj
	}

	trigger setallies
	{
		setstate forwardflag_wobj default
		accum 0 abort_if_equal 1
		accum 0 set 1
		alertentity forwardflag_wobj
	}
}

// NEUTRAL COMMAND POST ================================================

allied_compost_built
{
	spawn
	{
		wait 400
		trigger allied_compost_built setup

		constructible_class 2
	}

	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
	{
		setstate allied_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate allied_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger allied_compost_built_model enable_allied_features

		enablespeaker allies_compost_sound
	}

	decayed final
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger allied_compost_built_model disable_allied_features

		disablespeaker allies_compost_sound
	}
}

allied_compost_built_model
{
	spawn
	{
		wait 400
		setstate allied_compost_built_model invisible
	}

	trigger enable_allied_features
	{
		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 1 1

		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"
		// *---------------------------------------------------------------------------------*

		
		//wm_objective_status 8 0 2
		//wm_objective_status 8 1 1
	}

	trigger disable_allied_features
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0

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

		// *----------------------------------- 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"
		// *---------------------------------------------------------------------------------*

		//wm_objective_status 8 0 0
		//wm_objective_status 8 1 0
	}
}

axis_compost_built
{
	spawn
	{
		wait 400
		trigger axis_compost_built setup

		constructible_class 2
	}

	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
	{
		setstate axis_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate axis_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger axis_compost_built_model enable_axis_features

		enablespeaker axis_compost_sound
	}

	decayed final
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger axis_compost_built_model disable_axis_features

		disablespeaker axis_compost_sound
	}
}

axis_compost_built_model
{
	spawn
	{
		wait 400
		setstate axis_compost_built_model invisible
	}

	trigger enable_axis_features
	{
		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_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"
		// *---------------------------------------------------------------------------------*

		//wm_objective_status 8 0 1
		//wm_objective_status 8 1 2
	}

	trigger disable_axis_features
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 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"
		// *---------------------------------------------------------------------------------*

		//wm_objective_status 8 0 0
		//wm_objective_status 8 1 0
	}
}
