game_manager
{
       spawn
       {
           wm_set_main_objective		0	1
           wm_set_main_objective		0	0
           wm_set_defending_team	1
           wm_setwinner	0
           wm_number_of_objectives 3

           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 0 1
           wm_axis_respawntime 15
           wm_allied_respawntime 15
           wm_set_round_timelimit 30
}








       trigger objective_counter

       {

              accum 1 inc 0
              trigger game_manager checkgame

       }
   
       trigger checkgame

       {

       accum 1 abort_if_not_equal 0
       wm_setwinner 1

       wait 5000

       wm_endround

       }
 
}

blimp
{
       spawn 
       {
       wait 200

       constructible_class 3 
       }


       death  
       {

       wm_announce "^2Allied have ^1destroyed ^6 V2 usine!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"

       setstate prop invisible
       trigger game_manager objective_counter
       }

}

// ================================================
// =============== COMMAND POSTS ==================
// ================================================

allied_radio_destroyed
{
	spawn
	{
		wait 400
		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
	}
}

allied_radio_closed
{
	trigger hide
	{
		setstate allied_radio_closed invisible
		setstate allied_radio_closed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 1
		setstate allied_radio_closed default
		setstate allied_radio_closed_model default
	}

	trigger disable
	{
		accum 0 set 1
	}
}

allied_radio_built
{
	spawn
	{
		wait 400

		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 allied_radio_destroyed hide
		trigger allied_radio_closed 	hide
	}

	built final
	{
		trigger allied_radio_built_model show

		trigger allied_radio_destroyed enable
		trigger allied_radio_closed 	disable

		trigger allied_radio_built_model enable_allied_features

		enablespeaker allies_compost_sound
	}

	decayed final
	{
		trigger allied_radio_built_model hide

		trigger allied_radio_destroyed show
		trigger allied_radio_closed 	show
	}

	death
	{
		trigger allied_radio_built_model hide

		trigger allied_radio_destroyed show

		trigger allied_radio_built_model disable_allied_features

		disablespeaker allies_compost_sound
	}
}

allied_radio_built_model
{
	spawn
	{
		wait 400
		setstate allied_radio_built_model invisible
	}

	trigger show
	{
		setstate allied_radio_built_model default
	}

	trigger hide
	{
		setstate allied_radio_built_model invisible
	}

	trigger trans
	{
		setstate allied_radio_built_model underconstruction
	}

	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	"^9Allied ^7Command ^8Post ^3constructed. ^1Charge ^5speed ^4increased!"

		// *----------------------------------- 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 7 1 1
		wm_objective_status 7 0 2

	}

	trigger disable_allied_features
	{
		// Some kind of UI pop-up to alert players
		wm_announce	"^1Axis ^2team ^3has ^4destroyed ^5the ^6Allied ^7Command ^8Post!!!!!!!!!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 1 "allies_hqt_compost_construc"

		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		// *----------------------------------- vo ------------------------------------------*

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

		wm_objective_status 7 1 0
		wm_objective_status 7 0 0
	}
}

axis_radio_destroyed
{
	spawn
	{
		wait 400
		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
	}
}

axis_radio_closed
{
	trigger hide
	{
		setstate axis_radio_closed invisible
		setstate axis_radio_closed_model invisible
	}

	trigger show
	{
		accum 0 abort_if_equal 1
		setstate axis_radio_closed default
		setstate axis_radio_closed_model default
	}

	trigger disable
	{
		accum 0 set 1
	}
}

axis_radio_built
{
	spawn
	{
		wait 400

		constructible_class 2

		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 axis_radio_closed 	hide
	}

	built final
	{
		trigger axis_radio_built_model show

		trigger axis_radio_destroyed enable
		trigger axis_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 axis_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
	{
		wait 400
		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
	{
		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	"^1Axis ^2Command ^4Post ^3constructed. ^6Charge ^5speed ^9increased!!!!"

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

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		// *----------------------------------- vo ------------------------------------------*

		wm_objective_status 8 1 2
		wm_objective_status 8 0 1

	}

	trigger disable_axis_features
	{
		// Some kind of UI pop-up to alert players
		wm_announce	"^9Allied ^8team ^7has ^6destroyed ^5the ^4Axis ^3Command ^2Pos!!!!!!!!"

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

		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"
		// *----------------------------------- vo ------------------------------------------*

		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 8 1 0
		wm_objective_status 8 0 0
	}
}
defense2
{
	spawn
	{
		wait 200
		trigger defense2 setup
		constructible_class 3
	}

	trigger setup
	{
		setstate defense2 invisible

		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
	}

	buildstart final
	{
		setstate defense2 underconstruction
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default

	}

	built final
	{
		setstate defense2 default
		setstate defense2_materials invisible
		setstate defense2_materials_clip invisible
		setstate defense2_flag invisible

		wm_announce	"^9the ^1blimp's ^2lader ^6has ^8been ^3constructed ^7by ^5allied ^4team!!!!!!!!!"

	}

	decayed final
	{
		setstate defense2 invisible

		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
	}

	death
	{
		setstate defense2 invisible

		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default

		wm_announce	"^3the ^2blimp's ^7lader ^6has ^8been ^1destroyed ^5by ^4axis ^9team!!!!!!!!"

	}
}


// ------------MG42----------------------

construction_script_allimg // Allies mg.
{
	spawn
	{
		wait 1000
		constructible_class 2
		trigger self startup
	}

	buildstart final
	{
	   wm_announce   "^2Allies have started to build the MG42!"
	}

 built final
 	{
	 	setstate construction_extra_allimg default
	 	setstate construction_mg42_allimg default
	 	setstate construction_materials_allimg invisible
	 	wm_announce "^1Allied MG42 is constructed!"
		wm_teamvoiceannounce 0 "axis_hq_const_completed"
		wm_teamvoiceannounce 1 "allies_hq_const_completed"
	}

 decayed final
 	{
	 	trigger self startup
	}

 death
 	{
	 	trigger self startup
	 	// Some kind of UI pop-up to alert players
	 	wm_announce "^3Allied MG42 is destroyed!"
		wm_teamvoiceannounce 0 "axis_hq_const_destroyed"
		wm_teamvoiceannounce 1 "allies_hq_const_destroyed"
	}

 trigger startup
 	{
	 	setstate construction_materials_allimg default
	 	setstate construction_mg42_allimg invisible
	 	setstate construction_extra_allimg invisible
	 	repairmg42 construction_mg42_allimg
	}
}

// ------------ fin MG42----------------------

// ------------Wall----------------------


pink_floyd_the_wall // func_constructible
{


	spawn
	{
		wait 1000			// Wait for all entities to spawn
		constructible_class 2 // satchel or dyna
		trigger self startup
	}

	buildstart final
	{
	   wm_announce   "^2Axis Forces are rebuilding the Wall!"
	}

 built final
 	{
	 	setstate mcm_wall_alli default  // cm_satchel.tga, for Allies to see.
	 	setstate toi_realwall_alli default  // cm_satchel.tga, for Allies to see.
	 	setstate mcm_wall_axis default  // cm_wall.tga, for Axis to see.
	 	setstate toi_realwall_axis default  // cm_wall.tga, for Axis to see.
	 	setstate toi_wall invisible
		setstate constructionmaterials_wall invisible
		setstate crate_wall invisible
		setstate flag_wall invisible
		setstate wallrubble1 invisible
		wm_announce "^1Axis have built the Wall!"
		wm_teamvoiceannounce 0 "axis_hq_const_completed"
		wm_teamvoiceannounce 1 "allies_hq_const_completed"
		wm_objective_status 7 0 1 // 7 = Seventh objective (Axis Wall), 0 = Team Axis, 1 = Status "Yes".
		wm_objective_status 7 1 0
	}

 decayed final
 	{
	 	setstate mcm_wall_alli invisible  // cm_satchel.tga, for Allies to see.
	 	setstate toi_realwall_alli invisible  // cm_satchel.tga, for Allies to see.
	 	setstate mcm_wall_axis invisible  // cm_wall.tga, for Axis to see.
	 	setstate toi_realwall_axis invisible  // cm_wall.tga, for Axis to see.
	 	setstate toi_wall default
		setstate constructionmaterials_wall default
		setstate crate_wall default
		setstate flag_wall default
		setstate wallrubble1 default
	}

	death
	{
	 	setstate mcm_wall_alli invisible  // cm_satchel.tga, for Allies to see.
	 	setstate toi_realwall_alli invisible  // cm_satchel.tga, for Allies to see.
	 	setstate mcm_wall_axis invisible  // cm_wall.tga, for Axis to see.
	 	setstate toi_realwall_axis invisible  // cm_wall.tga, for Axis to see.

	 	setstate toi_wall default
		setstate constructionmaterials_wall default
		setstate crate_wall default
		setstate flag_wall default
		setstate wallrubble1 default
		wm_objective_status 7 0 0 // 7 = Seventh objective (Axis Wall), 0 = Team Axis, 0 = Status "No".
		wm_objective_status 7 1 1
		wait 250
		wm_announce "^3Allies have destroyed the Wall!"
		wait 1000
		wm_teamvoiceannounce 0 "axis_hq_obj_destroyed"
		wm_teamvoiceannounce 1 "allies_hq_obj_destroyed"
	}

	trigger startup
 	{
	 	setstate mcm_wall_alli invisible  // cm_satchel.tga, for Allies to see.
	 	setstate toi_realwall_alli invisible  // cm_satchel.tga, for Allies to see.
	 	setstate mcm_wall_axis default  // cm_wall.tga, for Axis to see.
	 	setstate toi_realwall_axis default  // cm_wall.tga, for Axis to see.

	 	setstate toi_wall invisible
		setstate constructionmaterials_wall invisible
		setstate crate_wall invisible
		setstate flag_wall invisible
		setstate wallrubble1 invisible
	}
}

// ------------End Wall----------------------