//2009 peyote, adds a new spawn at Command Post for Axis
game_manager
{
	spawn
	{
		create
		{
			classname "team_WOLF_objective"
			scriptname "axis_command_spawn"
			targetname "axis_command_spawn"
			origin "1291 -1991 280"   // z = CC_FILTER_ALLIES(1) | CC_FILTER_SPAWNS(4)
			spawnflags 3	 // TEAM_AXIS(3)
			description "Axis CP Spawn"
		}

		// spawn1
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn1"
			origin "833 -2444 84"
			spawnflags 3 // TEAM_AXIS
			angle "90"
		}

		// spawn2
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn2"
			origin "634 -2492 76"
			spawnflags 3 // TEAM_AXIS
			angle "90"
		}
		// spawn3
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn3"
			origin "759 -2292 56"
			spawnflags 3 // TEAM_AXIS
			angle "180"
		}

		// spawn4
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn4"
			origin "569 -2291 76"
			spawnflags 3 // TEAM_AXIS
			angle "180"
		}

		// spawn5
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn5"
			origin "574 -2133 76"
			spawnflags 3 // TEAM_AXIS
			angle "0"
		}

		// spawn6
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn6"
			origin "753 -2136 76"
			spawnflags 3 // TEAM_AXIS
			angle "180"
		}

		// spawn7
		create
		{
			classname "team_CTF_redspawn"
		targetname "cpspawn"
		scriptName "cpspawn7"
			origin "627 -1742 76"
			spawnflags 3 // TEAM_AXIS
			angle "270"
		}


		// spawn8
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn8"
			origin "885 -2000 76"
			spawnflags 3 // TEAM_AXIS
			angle "90"
		}

		// spawn9
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn9"
			origin "475 -1977 76"
			spawnflags 3 // TEAM_AXIS
			angle "0"
		}

		// spawn10
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn10"
			origin "417 -2308 76"
			spawnflags 3 // TEAM_AXIS
			angle "0"
		}

		// spawn11
		create
		{
			classname "team_CTF_redspawn"
			targetname "cpspawn"
			scriptName "cpspawn11"
			origin "236 -2768 184"
			spawnflags 3 // TEAM_AXIS
			angle "45"
		}
	// spawn12
	create
		{
			classname "team_CTF_redspawn"
		targetname "cpspawn"
			scriptName "cpspawn12"
			origin "447 -2798 184"
			spawnflags 3 // TEAM_AXIS
			angle "180"
		}
	
	//	remapshader "models/mapobjects/tanks_sd/mg42turret" "models/mapobjects/tanks_sd/mg42turret_2"
		remapshader "models/mapobjects/tanks_sd/jagdpanther_full" "models/mapobjects/tanks_sd/jagdpanther_snow"
		remapshader "models/mapobjects/tanks_sd/jagdpanther_additions_desert" "models/mapobjects/tanks_sd/jagdpanther_additions_snow"
		remapshaderflush
	
		
		// Game rules
		wm_axis_respawntime	15
		wm_allied_respawntime	25
		wm_number_of_objectives 7
		wm_set_round_timelimit	30

		// Objectives
		// 1: Build the bridge
		// 2: Build barriers to impede the tank
		// 3: Destroy Church main doors
		// 4: Destroy Church side door
		// 5: Dynomite the Allied Command Center
		// 6: Allied command post
		// 7: Axis command post

		// Current main objectives for each team (0=Axis, 1=Allies)
		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		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

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

		// Winner on expiration of round timer (0=Axis, 1=Allies)
		wm_setwinner	1
	
		wait 50
		setautospawn	"Hotel"			1
		setautospawn	"Axis Headquarters"	0
		accum 1 set 0
		wait 500
		// start triggered loops on/off as required (eg: command post radio sounds)
		disablespeaker allies_compost_sound
		disablespeaker axis_compost_sound

		wait 2000
				// *----------------------------------- vo ------------------------------------------*

		wm_teamvoiceannounce 0 "bulge_axis_construct_bridge"
		wm_teamvoiceannounce 0 "axis_hq_compost_construct"
		
		wm_teamvoiceannounce 1 "bulge_allies_construct_bridge"
		wm_teamvoiceannounce 1 "bulge_allies_construct_tankbar"
		wm_teamvoiceannounce 1 "allies_hq_compost_construct"

		// *---------------------------------------------------------------------------------*
		
	}


trigger objective1
	{
		wm_announce "Axis team has constructed the bridge!"
	}



trigger axis_endgame
	{
		
		accum 1 set 1		// check to win round

		wm_objective_status 5 0 1
		wm_objective_status 5 1 2
		
		wm_announce "Axis team has destroyed the Allied command and control!"
		wait 2000

		// Call function to check if the round has been won
		trigger game_manager checkgame
	}
trigger checkgame
	{
		accum 1 abort_if_not_equal 1
		wm_setwinner 0
		wait 1000
		wm_endround
	}
}

axis_obj1
{
	spawn
	{
		wait 200
		constructible_class 3
		setstate axis_obj1 default
	}	
		
	death
	{
		trigger game_manager axis_endgame
	//	setstate axis_obj1 invisible
	//	setstate axis_obj1_toi invisible
		
	}
}

// ============================================================================
// The Bridge
// ============================================================================
bridge
{
	spawn
	{
		accum 7 set 0	// Bridge stage construction and tank status
		wait 200

		constructible_class 3
		constructible_chargebarreq 2.5
//		constructible_health 1200
		setstate bridgematerials default
		setstate bridgematerials_clip default
		setstate bridgematerials_flag default
		setstate bridge invisible

		accum 7 bitset 1	// Tank NOT over bridge yet
	}

	buildstart final
	{
		setstate bridge underconstruction
	}

	built final
	{
		trigger tank setBridge
		setstate bridge default
		setstate bridgematerials invisible
		setstate bridgematerials_clip invisible
		setstate bridgematerials_flag invisible
		setstate bridge_toi invisible

		// Some kind of UI pop-up to alert players
		wm_announce	"Axis team has contructed the Bridge!"
		accum 7 abort_if_not_bitset 1	// Tank over bridge?

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_bridge_constructed"
		wm_teamvoiceannounce 1 "bulge_allies_bridge_constructed"

		// *---------------------------------------------------------------------------------*

		wm_set_main_objective		1	1	// Completed an objective
	}
	death
	{
		setstate bridge invisible
		setstate bridge_toi default
		setstate bridgematerials default
		setstate bridgematerials_clip default
		setstate bridgematerials_flag default

		// Some kind of UI pop-up to alert players
		wm_announce	"Allied team has destroyed the Bridge!"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_bridge_destroyed"
		wm_teamvoiceannounce 1 "bulge_allies_bridge_destroyed"

	}

	//-----------------------------------------------------------------------
	// Tank has made it over the bridge and on route to the town
	// remove all VO reference to the bridge construct/destruct
	//-----------------------------------------------------------------------
	trigger tank_passed
	{
		accum 7 bitreset 1	// Tank over bridge, no more announcements
	
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tank_across_bridge"
		wm_teamvoiceannounce 1 "bulge_allies_tank_across_bridge"
		
		// *---------------------------------------------------------------------------------*
		setautospawn	"Axis CP Spawn"	0
	}

}

// *************************************************
// ***************** TANK STUFF ********************
// *************************************************

tank_sound
{
	trigger start
	{
		trigger tank sound_start
		wait 3400
		trigger tank sound_move
	}

	trigger stop
	{
		trigger tank sound_stop
		wait 1400
		trigger tank sound_idle
	}

	trigger rebirth
	{
		trigger tank sound_rebirth
		wait 1400
		trigger tank sound_idle
	}
}
// digibob: converting truck script from goldrush over...
// ============================================================================
// accum 0, dynamite count
// accum 1
//  - bit 0: bridge state		( 0 = not built,	1 = built		)
//  - bit 1: blank 				(									)
//  - bit 2: spline status 		( 0 = not moving, 	1 = moving 		)
//  - bit 3: stuck check flag 	( 0 = not stuck, 	1 = stuck 		)
//  - bit 4: blank 				(									)
//  - bit 5: track state		( 0 = stopped,		1 = forward		)
//  - bit 6: temp register 		(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
//  - bit 7: death status 		( 0 = alive, 		1 = dead		)
//  - bit 8: player check 		( 0 = players, 		1 = no players	)
//  - bit 9: visible state		( 0 = alive, 		1 = dead		)
// accum 2, blank
// accum 3, current movement loop position
// accum 4, stop counter
// accum 5, lockout ref counter
// accum 6, blank
// accum 7, blank
// track events:
//  - tracks_forward
//  - tracks_stop
//  - tracks_turningleft
//  - tracks_turningright

tank
{
	spawn
	{
		wait 50
		faceangles 0 180 0 50
		trigger self sound_idle

		accum 1 bitset 5
		trigger self tracks_stop

		// Reset the tank+turret into correct position
		followspline 0 spln1 90 wait length -64

	}

// ===========================================================================================
	trigger startfire
	{
		startanimation 67 8 10 nolerp norandom
	}

	trigger stopfire
	{
		startanimation 0 1 15 nolerp norandom
	}
// ===========================================================================================
	trigger sound_idle
	{
		stopsound
		playsound sound/vehicles/tank/tank_idle.wav looping volume 512
	}

	trigger sound_start
	{
		stopsound
		playsound sound/vehicles/tank/tank_revup.wav volume 196
	}

	trigger sound_move
	{
		stopsound
		playsound sound/vehicles/tank/tank_move.wav looping volume 512
	}

	trigger sound_stop
	{
		stopsound
		playsound sound/vehicles/tank/tank_revdown.wav volume 196
	}

	trigger sound_death
	{
		stopsound
		playsound sound/vehicles/tank/tank_stop.wav volume 256
	}

	trigger sound_rebirth
	{
		stopsound
		playsound sound/vehicles/tank/tank_start.wav volume 196
	}
// TRACK ANIMATIONS

trigger tracks_forward
	{
		accum 0 abort_if_equal 1
		accum 0 set 1

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_stop
	{
		accum 0 abort_if_equal 0
		accum 0 set 0

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_left
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_right
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_left
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_right
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_left
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_right

		remapshaderflush
	}

	trigger tracks_turn_left
	{
		accum 0 abort_if_equal 2
		accum 0 set 2

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_forward

		remapshaderflush
	}

	trigger tracks_turn_right
	{
		accum 0 abort_if_equal 3
		accum 0 set 3

		remapshader models/mapobjects/tanks_sd/jag_tracks_left 	models/mapobjects/tanks_sd/jag_tracks_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_tracks_right models/mapobjects/tanks_sd/jag_tracks_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_wheels_left 	models/mapobjects/tanks_sd/jag_wheels_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_wheels_right models/mapobjects/tanks_sd/jag_wheels_alt_backward
		remapshader models/mapobjects/tanks_sd/jag_cogs_left 	models/mapobjects/tanks_sd/jag_cogs_alt_forward
		remapshader models/mapobjects/tanks_sd/jag_cogs_right 	models/mapobjects/tanks_sd/jag_cogs_alt_backward

		remapshaderflush
	}
	trigger run_continue
	{
		accum 3 inc 1
		trigger self deathcheck
		trigger self stopcheck
		trigger self move
	}


// ===========================================================================================
// movement

	trigger move_check
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3

		trigger self dispatch
	}

	trigger move
	{
		trigger self move_check

		wait 500

		trigger self move
	}

	trigger dispatch
	{
		accum 3 trigger_if_equal 0 tank run_0
		accum 3 trigger_if_equal 1 tank run_1
		accum 3 trigger_if_equal 2 tank run_2
		accum 3 trigger_if_equal 3 tank run_3
		accum 3 trigger_if_equal 4 tank run_4
		accum 3 trigger_if_equal 5 tank run_5
		accum 3 trigger_if_equal 6 tank run_6
		accum 3 trigger_if_equal 7 tank run_7
		accum 3 trigger_if_equal 8 tank run_8
		accum 3 trigger_if_equal 9 tank run_9
		accum 3 trigger_if_equal 10 tank run_10
		accum 3 trigger_if_equal 11 tank run_11
		accum 3 trigger_if_equal 12 tank run_12
		accum 3 trigger_if_equal 13 tank run_13
		accum 3 trigger_if_equal 14 tank run_14
		accum 3 trigger_if_equal 15 tank run_15
		accum 3 trigger_if_equal 16 tank run_16
		accum 3 trigger_if_equal 17 tank run_17
		accum 3 trigger_if_equal 18 tank run_18
		accum 3 trigger_if_equal 19 tank run_19
		accum 3 trigger_if_equal 20 tank run_20
		accum 3 trigger_if_equal 21 tank run_21
		accum 3 trigger_if_equal 22 tank run_22
		accum 3 trigger_if_equal 23 tank run_23
		accum 3 trigger_if_equal 24 tank run_24
		accum 3 trigger_if_equal 25 tank run_25
		accum 3 trigger_if_equal 26 tank run_26
		accum 3 trigger_if_equal 27 tank run_27
		accum 3 trigger_if_equal 28 tank run_28
		accum 3 trigger_if_equal 29 tank run_29
		accum 3 trigger_if_equal 30 tank run_30
		accum 3 trigger_if_equal 31 tank run_31
		accum 3 trigger_if_equal 32 tank run_32
		accum 3 trigger_if_equal 33 tank run_33
		accum 3 trigger_if_equal 34 tank run_34
		accum 3 trigger_if_equal 35 tank run_35
		accum 3 trigger_if_equal 36 tank run_36
		accum 3 trigger_if_equal 37 tank run_37
		accum 3 trigger_if_equal 38 tank run_38
		accum 3 trigger_if_equal 39 tank run_39
		accum 3 trigger_if_equal 40 tank run_40
		accum 3 trigger_if_equal 41 tank run_41
		accum 3 trigger_if_equal 42 tank run_42
		accum 3 trigger_if_equal 43 tank run_43
		accum 3 trigger_if_equal 44 tank run_44
		accum 3 trigger_if_equal 45 tank run_45
		accum 3 trigger_if_equal 46 tank run_46
		accum 3 trigger_if_equal 47 tank run_47
		accum 3 trigger_if_equal 48 tank run_48
		accum 3 trigger_if_equal 49 tank run_49
		accum 3 trigger_if_equal 50 tank run_50
		accum 3 trigger_if_equal 51 tank run_51
		accum 3 trigger_if_equal 52 tank run_52
		accum 3 trigger_if_equal 53 tank run_53
		accum 3 trigger_if_equal 54 tank run_54
		accum 3 trigger_if_equal 55 tank run_55
		accum 3 trigger_if_equal 56 tank run_56
		accum 3 trigger_if_equal 57 tank run_57
		accum 3 trigger_if_equal 58 tank run_58
		accum 3 trigger_if_equal 59 tank run_59
		accum 3 trigger_if_equal 60 tank run_60
		accum 3 trigger_if_equal 61 tank run_61
		accum 3 trigger_if_equal 62 tank run_62
		accum 3 trigger_if_equal 63 tank run_63
		accum 3 trigger_if_equal 64 tank run_64
		accum 3 trigger_if_equal 65 tank run_65
		accum 3 trigger_if_equal 66 tank run_66
		accum 3 trigger_if_equal 67 tank run_67
		accum 3 trigger_if_equal 68 tank run_68
		accum 3 trigger_if_equal 69 tank run_69
		accum 3 trigger_if_equal 70 tank run_70
		accum 3 trigger_if_equal 71 tank run_71
		accum 3 trigger_if_equal 72 tank run_72
		accum 3 trigger_if_equal 73 tank run_73
		accum 3 trigger_if_equal 74 tank run_74
		accum 3 trigger_if_equal 75 tank run_75
		accum 3 trigger_if_equal 76 tank run_76
		accum 3 trigger_if_equal 77 tank run_77
		accum 3 trigger_if_equal 78 tank run_78
		accum 3 trigger_if_equal 79 tank run_79
		accum 3 trigger_if_equal 80 tank run_80
		accum 3 trigger_if_equal 81 tank run_81
		accum 3 trigger_if_equal 82 tank run_82
		accum 3 trigger_if_equal 83 tank run_83
		accum 3 trigger_if_equal 84 tank run_84
		accum 3 trigger_if_equal 85 tank run_85
		accum 3 trigger_if_equal 86 tank run_86
		accum 3 trigger_if_equal 87 tank run_87
		accum 3 trigger_if_equal 88 tank run_88
		accum 3 trigger_if_equal 89 tank run_89
		accum 3 trigger_if_equal 90 tank run_90
		accum 3 trigger_if_equal 91 tank run_91
		accum 3 trigger_if_equal 92 tank run_92
		accum 3 trigger_if_equal 93 tank run_93
		accum 3 trigger_if_equal 94 tank run_94
		accum 3 trigger_if_equal 95 tank run_95
		accum 3 trigger_if_equal 96 tank run_96
		accum 3 trigger_if_equal 97 tank run_97
		accum 3 trigger_if_equal 98 tank run_98
		accum 3 trigger_if_equal 99 tank run_99
		accum 3 trigger_if_equal 100 tank run_100
		accum 3 trigger_if_equal 101 tank run_101
		accum 3 trigger_if_equal 102 tank run_102
		accum 3 trigger_if_equal 103 tank run_103
		accum 3 trigger_if_equal 104 tank run_104
		accum 3 trigger_if_equal 105 tank run_105
		accum 3 trigger_if_equal 106 tank run_106
		accum 3 trigger_if_equal 107 tank run_107
		accum 3 trigger_if_equal 108 tank run_108
		accum 3 trigger_if_equal 109 tank run_109
		accum 3 trigger_if_equal 110 tank run_110
		accum 3 trigger_if_equal 111 tank run_111
		accum 3 trigger_if_equal 112 tank run_112
		accum 3 trigger_if_equal 113 tank run_113
		accum 3 trigger_if_equal 114 tank run_114
		accum 3 trigger_if_equal 115 tank run_115
		accum 3 trigger_if_equal 116 tank run_116
		accum 3 trigger_if_equal 117 tank run_117
		accum 3 trigger_if_equal 118 tank run_118
		accum 3 trigger_if_equal 119 tank run_119
		accum 3 trigger_if_equal 120 tank run_120
		accum 3 trigger_if_equal 121 tank run_121
		accum 3 trigger_if_equal 122 tank run_122
		accum 3 trigger_if_equal 123 tank run_123
		accum 3 trigger_if_equal 124 tank run_124
		accum 3 trigger_if_equal 125 tank run_125
		accum 3 trigger_if_equal 126 tank run_126
		accum 3 trigger_if_equal 127 tank run_127
		accum 3 trigger_if_equal 128 tank run_128
		accum 3 trigger_if_equal 129 tank run_129
		accum 3 trigger_if_equal 130 tank run_130
		accum 3 trigger_if_equal 131 tank run_131
		accum 3 trigger_if_equal 132 tank run_132
		accum 3 trigger_if_equal 133 tank run_133
		accum 3 trigger_if_equal 134 tank run_134
		accum 3 trigger_if_equal 135 tank run_135
		accum 3 trigger_if_equal 136 tank run_136
		accum 3 trigger_if_equal 137 tank run_137
		accum 3 trigger_if_equal 138 tank run_138
		accum 3 trigger_if_equal 139 tank run_139
		accum 3 trigger_if_equal 140 tank run_140
		accum 3 trigger_if_equal 141 tank run_141
		accum 3 trigger_if_equal 142 tank run_142
		accum 3 trigger_if_equal 143 tank run_143
		accum 3 trigger_if_equal 144 tank run_144
		accum 3 trigger_if_equal 145 tank run_145
	}

	trigger run_0
	{
		accum 1 bitset 2
	//	followspline 0 spln1 90 wait length 32
		followspline 0 spln2 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_1
	{
		
		accum 1 bitset 2
		followspline 0 spln3 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_2
	{
		

		accum 1 bitset 2
		followspline 0 spln4 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_3
	{
		

		accum 1 bitset 2
		followspline 0 spln5 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_4
	{
		

		accum 1 bitset 2
		followspline 0 spln6 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_5
	{
		

		accum 1 bitset 2
		followspline 0 spln7 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_6
	{
		

		accum 1 bitset 2
		followspline 0 spln8 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_7
	{
		

		accum 1 bitset 2
		followspline 0 spln9 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_8
	{
		

		accum 1 bitset 2
		followspline 0 spln10 90 wait length 32
		accum 1 bitreset 2
	//	test teleporter - REMOVE ME!!!!
	//	accum 3 set 70
		trigger self run_continue
	}

	trigger run_9
	{
		accum 1 bitset 2
		trigger self 		tracks_turn_right
		followspline 0 spln11 90 wait length 180

		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_10
	{
		
		accum 1 bitset 2
		trigger self 		tracks_turn_right
		followspline 0 spln12 90 wait length 180
	
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_11
	{

		accum 1 bitset 2
		trigger self 		tracks_turn_right
		followspline 0 spln13 90 wait length 90

		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward		
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_12
	{
		
		accum 1 bitset 2
		followspline 0 spln14 90 wait length 90
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_13
	{
		trigger self tracks_turn_right

		accum 1 bitset 2
		followspline 0 spln15 90 wait length 90

		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward		
		accum 1 bitreset 2


		trigger self run_continue
	}

	trigger run_14
	{
		
		trigger self 		tracks_forward	
		accum 1 bitset 2
		followspline 0 spln16 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_15
	{
		

		accum 1 bitset 2
		followspline 0 spln17 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_16
	{
		

		accum 1 bitset 2
		followspline 0 spln18 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_17
	{
		

		accum 1 bitset 2
		followspline 0 spln19 90 wait length 90
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_18
	{
		

		accum 1 bitset 2
		followspline 0 spln20 90 wait length 90
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_19
	{
		

		accum 1 bitset 2
		followspline 0 spln21 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_20
	{
		

		accum 1 bitset 2
		followspline 0 spln22 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_21
	{
		

		accum 1 bitset 2
		followspline 0 spln23 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_22
	{
		

		accum 1 bitset 2
		followspline 0 spln24 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_23
	{
		

		accum 1 bitset 2
		followspline 0 spln25 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_24
	{
		

		accum 1 bitset 2
		followspline 0 spln26 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_25
	{
		

		accum 1 bitset 2
		followspline 0 spln27 90 wait length 32
		accum 1 bitreset 2
		
		trigger self run_continue
	}

	trigger run_26
	{
		

		accum 1 bitset 2
		followspline 0 spln28 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_27
	{
		

		accum 1 bitset 2
		followspline 0 spln29 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_28
	{
		

		accum 1 bitset 2
		followspline 0 spln30 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_29
	{
		
	
		accum 1 bitset 2
		followspline 0 spln31 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_30
	{
		

		accum 1 bitset 2
		followspline 0 spln32 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_31
	{
		

		accum 1 bitset 2
		followspline 0 spln33 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_32
	{
		

		accum 1 bitset 2
		followspline 0 spln34 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_33
	{
		

		accum 1 bitset 2
		followspline 0 spln35 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_34
	{
		

		accum 1 bitset 2
		followspline 0 spln36 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_35
	{
		

		accum 1 bitset 2
		followspline 0 spln37 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_36
	{
		

		accum 1 bitset 2
		followspline 0 spln38 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_37
	{
		

		accum 1 bitset 2
		followspline 0 spln39 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_38
	{
		
		// cross the bridge
		accum 1 bitset 2
		followspline 0 spln40 90 wait length 32
		followspline 0 spln41 90 wait length 32
		followspline 0 spln42 90 wait length 32
		followspline 0 spln43 90 wait length 32
		followspline 0 spln44 90 wait length 32
		followspline 0 spln45 90 wait length 32
		followspline 0 spln46 90 wait length 32
		followspline 0 spln47 90 wait length 32
		followspline 0 spln48 90 wait length 32	
		accum 1 bitreset 2
		
		trigger bridge tank_passed
		trigger self run_continue
	}

	trigger run_39
	{
		

		accum 1 bitset 2
		followspline 0 spln49 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_40
	{
		

		accum 1 bitset 2
		followspline 0 spln50 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_41
	{
		

		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln51 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_42
	{
		

		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln52 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_43
	{
		

		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln53 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_44
	{
		

		accum 1 bitset 2
		trigger self tracks_turn_right
		followspline 0 spln54 90 wait length 128
		accum 1 bitreset 2
		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward

		trigger self run_continue
	}

	trigger run_45
	{
		trigger self 		tracks_forward
		accum 1 bitset 2
		followspline 0 spln55 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_46
	{
		

		accum 1 bitset 2
		followspline 0 spln56 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_47
	{
		

		accum 1 bitset 2
		followspline 0 spln57 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_48
	{
		

		accum 1 bitset 2
		followspline 0 spln58 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_49
	{
		

		accum 1 bitset 2
		followspline 0 spln59 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_50
	{
		

		accum 1 bitset 2
		followspline 0 spln60 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_51
	{
		

		accum 1 bitset 2
		followspline 0 spln61 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_52
	{
		

		accum 1 bitset 2
		followspline 0 spln62 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_53
	{
		accum 1 bitset 2
		followspline 0 spln63 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_54
	{
		

		accum 1 bitset 2
		followspline 0 spln64 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_55
	{
		

		accum 1 bitset 2
		followspline 0 spln65 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_56
	{
		
		trigger self tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln66 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_57
	{
		
		trigger self tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln67 90 wait length 128
		accum 1 bitreset 2
		trigger tank stuck_check_barrier1_built_msg
		trigger self run_continue
	}

	trigger run_58
	{
		
		trigger self tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln68 90 wait length 128
		accum 1 bitreset 2
		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward

		trigger self run_continue
	}

	trigger run_59
	{
		
		trigger self 		tracks_forward
		accum 1 bitset 2
		followspline 0 spln69 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_60
	{
		accum 1 bitset 2
		followspline 0 spln70 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_61
	{
		

		accum 1 bitset 2
		followspline 0 spln71 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_62
	{
		

		accum 1 bitset 2
		followspline 0 spln72 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_63
	{
		

		accum 1 bitset 2
		followspline 0 spln73 90 wait length 32
		accum 1 bitreset 2
	
		trigger self run_continue
	}

	trigger run_64
	{
		

		accum 1 bitset 2
		followspline 0 spln74 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_65
	{
		

		// We've passed the 1st tank barrier
		trigger tree_up remove
		trigger tree_down remove
		accum 1 bitset 2
		followspline 0 spln75 90 wait length 128
		accum 1 bitreset 2
		setautospawn	"Hotel"			0
		setautospawn	"Allied Town Spawn"	1
	
		alertentity allied_hotel_spawns
		alertentity axis_hotel_spawns
		alertentity forwardflag		// Hotel team_WOLF_objective
		trigger self run_continue
	}

	trigger run_66
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_left
		followspline 0 spln76 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_67
	{
		
		trigger self 		tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln77 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_68
	{
		trigger self 		tracks_turn_left	
		accum 1 bitset 2
		followspline 0 spln78 90 wait length 128
		accum 1 bitreset 2

		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward

		trigger self run_continue
	}

	trigger run_69
	{
		
		trigger self 		tracks_forward
		accum 1 bitset 2
		followspline 0 spln79 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_70
	{
		

		accum 1 bitset 2
		followspline 0 spln80 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_71
	{
		
		trigger self 		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln81 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_72
	{
		
		trigger self 		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln82 90 wait length 128
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_73
	{
		
		trigger self 		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln83 90 wait length 128
		accum 1 bitreset 2
		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward

		trigger self run_continue
	}

	trigger run_74
	{
		trigger self 		tracks_forward

		accum 1 bitset 2
		followspline 0 spln84 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_75
	{
		

		accum 1 bitset 2
		followspline 0 spln85 90 wait length 32
		accum 1 bitreset 2
		// Tank at hotel
		
		trigger self run_continue
	}

	trigger run_76
	{
		

		accum 1 bitset 2
		followspline 0 spln86 90 wait length 32
		accum 1 bitreset 2
		
		trigger self run_continue
	}

	trigger run_77
	{
		

		accum 1 bitset 2
		followspline 0 spln87 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}


	trigger run_78
	{
		
		accum 1 bitset 2
		trigger self 		tracks_turn_left			
		followspline 0 spln88 90 wait length 128
		accum 1 bitreset 2
		trigger self run_continue
	}

	trigger run_79
	{
		accum 1 bitset 2
		trigger self 		tracks_turn_left
		followspline 0 spln89 90 wait length 128
		accum 1 bitreset 2
		faceangles 0 180 0 100
		trigger self run_continue
	}

	trigger run_80
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_left
		
		followspline 0 spln90 90 wait length 128
		
		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward

		accum 1 bitreset 2
		trigger self run_continue
	}

	trigger run_81
	{
		
		trigger self 		tracks_forward
		accum 1 bitset 2
		followspline 0 spln91 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_82
	{
		
		trigger self 		tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln92 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_83
	{
		
		trigger self 		tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln93 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_84
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_left
		followspline 0 spln94 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_85
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_left
		followspline 0 spln95 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_86
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_left
		followspline 0 spln96 90 wait length 96
		accum 1 bitreset 2

		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward

		trigger self run_continue
	}

	trigger run_87
	{
		

		accum 1 bitset 2
		followspline 0 spln97 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_88
	{
		

		accum 1 bitset 2
		followspline 0 spln98 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_89
	{
		

		accum 1 bitset 2
		followspline 0 spln99 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}
	
	trigger run_90
	{
		

		accum 1 bitset 2
		followspline 0 spln100 90 wait length 32
		accum 1 bitreset 2
		setautospawn	"Axis CP Spawn"	0
		trigger self run_continue
	}

	trigger run_91
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_right
		followspline 0 spln101 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_92
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_right
		followspline 0 spln102 90 wait length 96

		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_93
	{
		

		accum 1 bitset 2
		followspline 0 spln103 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_94
	{
		

		accum 1 bitset 2
		followspline 0 spln104 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_95
	{
		

		accum 1 bitset 2
		followspline 0 spln105 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_96
	{
		

		accum 1 bitset 2
		followspline 0 spln106 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_97
	{
		

		accum 1 bitset 2
		followspline 0 spln107 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_98
	{
		

		accum 1 bitset 2
		followspline 0 spln108 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_99
	{
		

		accum 1 bitset 2
		followspline 0 spln109 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_100
	{
		

		accum 1 bitset 2
		followspline 0 spln110 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_101
	{
		

		accum 1 bitset 2
		followspline 0 spln111 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_102
	{
		

		accum 1 bitset 2
		followspline 0 spln112 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_103
	{
		

		accum 1 bitset 2
		followspline 0 spln113 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_104
	{
		

		accum 1 bitset 2
		followspline 0 spln114 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_105
	{
		

		accum 1 bitset 2
		followspline 0 spln115 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_106
	{
		

		accum 1 bitset 2
		followspline 0 spln116 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_107
	{
		

		accum 1 bitset 2
		followspline 0 spln117 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_108
	{
		

		accum 1 bitset 2
		followspline 0 spln118 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_109
	{
		

		accum 1 bitset 2
		followspline 0 spln119 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_110
	{
		

		accum 1 bitset 2
		followspline 0 spln120 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_111
	{
		

		accum 1 bitset 2
		followspline 0 spln121 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_112
	{
		

		accum 1 bitset 2
		followspline 0 spln122 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_113
	{
		

		accum 1 bitset 2
		followspline 0 spln123 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_114
	{
		

		accum 1 bitset 2
		followspline 0 spln124 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_115
	{
		

		accum 1 bitset 2
		followspline 0 spln125 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_116
	{
		

		accum 1 bitset 2
		followspline 0 spln126 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_117
	{
		

		accum 1 bitset 2
		followspline 0 spln127 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_118
	{
		

		accum 1 bitset 2
		trigger self		tracks_turn_right
		followspline 0 spln128 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_119
	{
		
		trigger self		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln129 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_120
	{
		
		trigger self		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln130 90 wait length 96
		accum 1 bitreset 2
		trigger tank stuck_check_barrier2_built_msg
		trigger self run_continue
	}

	trigger run_121
	{
		
		trigger self		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln131 90 wait length 96
		accum 1 bitreset 2
		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward
		accum 1 bitreset 2
		trigger self run_continue
	}

	trigger run_122
	{
		
		trigger self 		tracks_forward
		accum 1 bitset 2
		followspline 0 spln132 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_123
	{
		

		accum 1 bitset 2
		followspline 0 spln133 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_124
	{
		

		accum 1 bitset 2
		followspline 0 spln134 90 wait length 32
		// the tank has passed defense barrier #2
		trigger defense2 remove
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_125
	{
		

		accum 1 bitset 2
		followspline 0 spln135 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_126
	{
		

		accum 1 bitset 2
		followspline 0 spln136 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_127
	{
		

		accum 1 bitset 2
		followspline 0 spln137 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_128
	{
		

		accum 1 bitset 2
		followspline 0 spln138 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_129
	{
		
		trigger self		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln139 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_130
	{
		

		trigger self		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln140 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_131
	{
		

		trigger self		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln141 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_132
	{
		

		trigger self		tracks_turn_right
		accum 1 bitset 2
		followspline 0 spln142 90 wait length 96
		accum 1 bitreset 2
		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward
		trigger self run_continue
	}

	trigger run_133
	{
		

		accum 1 bitset 2
		followspline 0 spln143 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_134
	{
		

		accum 1 bitset 2
		followspline 0 spln144 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_135
	{
		

		accum 1 bitset 2
		followspline 0 spln145 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_136
	{
		

		accum 1 bitset 2
		followspline 0 spln146 90 wait length 32
		trigger self script_lockout

		trigger self 		tracks_stop
		trigger tank_sound 	stop

		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom
		wait 900
		trigger tank_turret turn1

		accum 1 bitreset 2
		accum 3 inc 1

	}

	trigger run_137
	{
		

		accum 1 bitset 2
		trigger self 		tracks_turn_right
		followspline 0 spln147 90 wait length 128
		followspline 0 spln148 90 wait length 128
		followspline 0 spln149 90 wait length 96
		followspline 0 spln150 90 wait length 96
		// Reset tracks back to forward motion
		accum 1 bitreset 5
		trigger self 		tracks_forward
		followspline 0 spln151 90 wait length 32
		followspline 0 spln152 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_138
	{
		

		accum 1 bitset 2
		followspline 0 spln153 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_139
	{
		

		accum 1 bitset 2
		followspline 0 spln154 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_140
	{
		

		accum 1 bitset 2
		followspline 0 spln155 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_141
	{
		

		accum 1 bitset 2
		followspline 0 spln156 90 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_142
	{
		
		trigger self		tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln157 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_143
	{
		
		trigger self		tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln158 90 wait length 96
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_144
	{
		
		trigger self		tracks_turn_left
		accum 1 bitset 2
		followspline 0 spln159 90 wait length 96
		trigger self script_lockout

		trigger self 		tracks_stop
		trigger tank_sound 	stop
		
		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom
		wm_objective_status 2 0 2
		wm_objective_status 2 1 1
		trigger tank_turret turn2
		accum 3 inc 1
		accum 1 bitreset 2
		// SEND IN THE PLANE
		wait 8000
		trigger p51 attack

	}

	trigger run_145
	{
		
		

	}

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

// ===========================================================================================
// stuck checking
// digibob: since we cant return variables, just use bit 3 of accum 1 as a register... mmmm assembly...
	trigger stuck_check
	{
		accum 1 bitreset 3
		trigger self stuck_check_bridge_built
	//	trigger self stuck_check_bridge_dyna
		trigger self stuck_check_barrier1_built
		trigger self stuck_check_barrier2_built
		trigger self stuck_check_scriptlockout
		trigger self stuck_check_finished
	}
	
	trigger stuck_check_bridge_built
	{
		accum 3 abort_if_not_equal 38

		accum 1 abort_if_bitset 0

		accum 1 bitset 3
	}

	trigger stuck_check_bridge_dyna
	{
		accum 3 abort_if_not_equal 38

		accum 0 set_to_dynamitecount bridgetarget
		accum 0 abort_if_equal 0

		accum 1 bitset 3
	}

	trigger stuck_check_finished
	{
		accum 3 abort_if_less_than 145

		accum 1 bitset 3
	}

	trigger stuck_check_scriptlockout
	{
		accum 5 abort_if_equal 0

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built
	{
		accum 3 abort_if_not_equal 62

		accum 1 abort_if_bitset 1

		accum 1 bitset 3
	}

	trigger stuck_check_barrier1_built_msg
	{
		accum 1 abort_if_bitset 1

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_destroy_tankbar"
		wm_teamvoiceannounce 1 "bulge_allies_destroy_tankbar"
		// *---------------------------------------------------------------------------------*
	}

	trigger stuck_check_barrier2_built
	{
		accum 3 abort_if_not_equal 122

		accum 1 abort_if_bitset 4

		accum 1 bitset 3
	}

	trigger stuck_check_barrier2_built_msg
	{
		accum 1 abort_if_bitset 4

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 1 "bulge_axis_destroy_tankbar"
		wm_teamvoiceannounce 1 "bulge_allies_destroy_tankbar"
		// *---------------------------------------------------------------------------------*
	}
	
	// ========================================
	// barriers

	trigger enable_stage1
	{
		accum 1 bitreset 1
	}

	trigger disable_stage1
	{
		accum 1 bitset 1
	}

	trigger enable_stage2
	{
		accum 1 bitreset 4
	}

	trigger disable_stage2
	{
		accum 1 bitset 4
	}

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

// ===========================================================================================
// stop check

	trigger stopcheck_setup
	{
		accum 1 bitset 6			// stop if we're stuck/no-one's pushing :)

		accum 1 abort_if_bitset 8		// no one in the trigger, abort

		trigger self stuck_check		// call the stop check function
		accum 1 abort_if_bitset 3		// we're stuck so break out

		accum 1 bitreset 6			// we're free to move
	}

	trigger stopcheck
	{
		trigger self stopcheck_setup
		accum 1 abort_if_not_bitset 6

		trigger self script_lockout

		// Any just stopped moving stuff goes here
		trigger tank_sound 	stop
		trigger self 		tracks_stop
		startanimation 45 	10 	15 nolerp norandom
		wait 666
		startanimation 0 	1 	15 nolerp norandom
		wait 900

		trigger self script_lockout_stop
		resetscript
	}

// ===========================================================================================
// ===========================================================================================
// script lockouts

	trigger script_lockout
	{
		accum 5 inc 1
	}

	trigger script_lockout_stop
	{
		accum 5 inc -1
	}
// ===========================================================================================
// ===========================================================================================
// enable/disable

	trigger tank_enable
	{
		trigger self stuck_check
		accum 1 abort_if_bitset 3 	// stuck check

		accum 4 set 0				// reset stop counter
		accum 1 bitreset 8			// reset stop check

		accum 1 abort_if_bitset 2 	// already following spline
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 abort_if_bitset 7 	// death check

		// Any just started moving stuff goes here

		trigger self script_lockout

		trigger tank_sound start

		startanimation 55 10 15 nolerp norandom
		wait 666
		startanimation 5 40 15 nolerp norandom
		wait 500
		trigger self tracks_forward

		trigger self script_lockout_stop

		trigger self move
	}

	trigger tank_disable
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 4

		accum 1 bitset 8			// set stop check

		trigger self deathcheck
	}

// ===========================================================================================
// ===========================================================================================
// death / rebirth

	rebirth
	{
		accum 1 bitreset 9 // we're visibly alive
		accum 1 bitreset 7 // we're alive again

		trigger self script_lockout

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tank_repaired"

		wm_teamvoiceannounce 1 "bulge_allies_hq_tank_repaired"
		// *---------------------------------------------------------------------------------*
		wm_announce "The Tank has been repaired"

		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks.md3

		setstate tank_smoke invisible

		trigger tank_sound rebirth
		wait 500

		trigger self script_lockout_stop
	}

	death
	{
		accum 1 bitset 7
	}

	trigger deathcheck
	{
		accum 1 abort_if_not_bitset 7	// are we dead?
		accum 1 abort_if_bitset 9		// are we not already visibly dead?
		accum 1 abort_if_bitset 2		// are we not following a spline?
		accum 5 abort_if_not_equal 0	// are we not in a script lockout?

		accum 1 bitset 9				// we're now visibly dead

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tank_damaged"

		wm_teamvoiceannounce 1 "bulge_allies_tank_damaged"
		// *---------------------------------------------------------------------------------*

		wm_announce "The Tank has been damaged"

		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks2.md3

		setstate tank_smoke default

		kill tank_construct

		trigger self sound_death
		trigger self tracks_stop

		trigger self script_lockout

		trigger self tracks_stop
		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom

		trigger self script_lockout_stop

		resetscript
	}

	trigger planedeath
	{
		accum 4 inc 1				// up the stop counter
		accum 4 abort_if_less_than 4
		accum 1 bitset 8			// set stop check
		accum 1 bitset 7
		accum 1 bitset 9				// we're now visibly dead

		
		wm_announce "The Tank has been destroyed!"
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tank_destroyed"

		wm_teamvoiceannounce 1 "bulge_allies_tank_destroyed"
		// *---------------------------------------------------------------------------------*
	
		changemodel models/mapobjects/tanks_sd/jagdpanther_africa_tracks2.md3
		setstate tank_smoke default
		kill tank
		faceangles 0 195 5 500
		faceangles 0 185 0 500
		
		trigger self sound_death
		trigger self tracks_stop
		trigger self script_lockout
		trigger self tracks_stop
		startanimation 45 10 15 nolerp norandom
		wait 666
		startanimation 0 1 15 nolerp norandom
		setstate tank_trigger invisible
		setstate tank_build invisible
		
		
	}


	trigger setBridge
	{
		wm_objective_status 1 0 1
		wm_objective_status 1 1 2

		accum 1 bitset 0
	}

	trigger clearBridge
	{
		wm_objective_status 1 1 0
		wm_objective_status 1 0 0

		accum 1 bitreset 0
	}

}

tank_disabler
{
	trigger run
	{
		trigger tank tank_disable
	}
}

tank_enabler
{
	trigger run
	{
		trigger tank tank_enable
	}
}

tank_trigger
{
	spawn
	{
		wait 500

		attachtotag tank_shell tag_turret

		trigger tank_trigger bot_goal_loop
	}

	trigger bot_goal_loop
	{
		wait 4000	// check every 4 seconds
		trigger tank bot_active_check
		trigger tank_trigger bot_goal_loop
	}
}

tank_build
{
	spawn
	{
		wait 500

		attachtotag tank_shell tag_turret
	}
}

tank_construct
{
	spawn
	{
		wait 1000

		constructible_class 2
		constructible_health 1200
		constructible_constructxpbonus 10
		constructible_destructxpbonus 10
	}

	built final
	{
		alertentity tank

		wm_announce "The Tank has been repaired!"
	}
}

tank_shell
{
	spawn
	{
		wait 400
		attachtotag tank tag_tank
	}
}


//================================================================================
// Physical tank turret MODEL
//================================================================================
tank_turret
{
	spawn
	{
		wait 500

		attachtotag tank_shell tag_turret
	}

	trigger turn1
	{
		wait 1000

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles -4 0 0  3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav

		wait 500

		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav
		trigger tank_flash run
	}

	trigger turn2
	{
		wait 1000

		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 20 0  3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav

		wait 500

		trigger tank startfire
		playsound sound/vehicles/tank/tank_fire.wav
		trigger tank_flash run2
	}

	trigger blow_doors
	{
		setstate tank_flash invisible

		wait 200
		trigger tank stopfire

		alertentity churchdoor_solid
		trigger churchdoor_damaged boom
		//alertentity churchdoors_explo
		

		wm_announce "Axis team has destroyed the Church Doors!"

		wm_objective_status 3 0 1
		wm_objective_status 3 1 2

		wm_set_main_objective		3	0
		wm_set_main_objective		3	1

		wait 100
		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 0 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
		trigger tank script_lockout_stop
	}
	trigger blow_opsdoor
	{
		setstate tank_flash invisible

		wait 200
		trigger tank stopfire
		trigger cvopsdoor_damaged boom
		

		wm_announce "Axis team has destroyed the Church side Door!"

		wm_objective_status 4 0 1
		wm_objective_status 4 1 2

		wm_set_main_objective		4	0
		wm_set_main_objective		4	1

		wait 100
		playsound sound/vehicles/tank/turret_spin.wav looping
		faceangles 0 0 0 3000
		stopsound
		playsound sound/vehicles/tank/turret_end.wav
	//	trigger tank sound_death
		trigger tank script_lockout_stop
	}
}

tank_flash
{
	spawn
	{
		setstate tank_flash invisible
	}

	trigger run
	{
		setstate tank_flash default
 		attachtotag tank_turret tag_flash
		faceangles 0 90 0 50

		wait 50

		trigger tank_turret blow_doors
	}
	trigger run2
	{
		setstate tank_flash default
 		attachtotag tank_turret tag_flash
		faceangles 0 90 0 50

		wait 50

		trigger tank_turret blow_opsdoor
	}
}




tank_smoke
{
	spawn
	{
		wait 300
		attachtotag tank tag_turret
		setstate tank_smoke invisible
	}
}



// **************************************
// ******* Church Door Explosion ********
// **************************************
churchdoor_damaged
{
	spawn
	{
		wait 200
		setstate churchdoor_damaged invisible
	}
	
	trigger boom
	{
		//alertentity churchdoor_damaged
		setstate churchdoor_damaged default
		setstate churchdoor_toi invisible
		setstate churchdoor_cm_marker invisible
	

		alertentity churchdoor_debris
		alertentity maindoor_hurt
	   	
		wait 2000
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_mainentrance_destroyed"

		wm_teamvoiceannounce 1 "bulge_allies_mainentrance_destroyed"
		// *---------------------------------------------------------------------------------*
		kill maindoor_hurt
	}

}

// ************************************************
// ******* Church cover ops door Explosion ********
// ************************************************

churchteamdoor
{
	spawn
	{
		wait 200
		setstate churchteamdoor default
	}
}

cvopsdoor_damaged
{
	spawn
	{
		wait 200
		setstate cvopsdoor_damaged invisible
	}
	trigger boom
	{
		setstate cvopsdoor_damaged default
	//	alertentity cvopsdoor_solid
		setstate cvopsdoor_solid invisible
		alertentity cvopsdoor_debris
		trigger sidedoor_damage boom
		setstate churchteamdoor invisible
		setstate teamdoor_toi invisible
		setstate churchteamdoor invisible //remove
		
		wait 2000
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_sideentrance_destroyed"

		wm_teamvoiceannounce 1 "bulge_allies_sideentrance_destroyed"
		// *---------------------------------------------------------------------------------*
	
	}
}

sidedoor_damage
{
	spawn
	{
		wait 200
		setstate sidedoor_damage invisible
	}

	trigger boom
	{
		setstate  sidedoor_damage default
		wait 100
		remove
	}
}

cvopsdoor_solid
{
	spawn
	{
		wait 200
		setstate cvopsdoor_damaged default
	}
}
// **************************
// ******* The Plane ********
// **************************
p51
{
	spawn
	{
		wait 50
		faceangles 0 90 0 50
		accum 1 bitset 5
		accum 7 set 0
	}

	trigger attack
	{
	
		wait 50
		accum 7 trigger_if_equal 0 p51 run_0
		accum 7 trigger_if_equal 1 p51 run_1
		accum 7 trigger_if_equal 2 p51 run_2
		accum 7 trigger_if_equal 3 p51 run_3
		accum 7 trigger_if_equal 4 p51 run_4
		accum 7 trigger_if_equal 5 p51 run_5
		accum 7 trigger_if_equal 6 p51 hide

	}	

	trigger blowtank
	{
		alertentity flyby_debris
		wm_announce "The Tank has been damaged"
		alertentity planehurt
		alertentity flyby_boom
		wait 400
		setstate planehurt invisible
		kill planehurt
		trigger tank planedeath		

		accum 7 inc 1
	}

	trigger hide
	{
		wm_announce "The plane has damaged the tank"
		alertentity p51
		setstate p51 invisible
		remove
		kill p51
	}

	trigger run_continue
	{
		accum 7 inc 1
		trigger self move
	}


// ===========================================================================================
// movement

	trigger move_check
	{
		accum 1 abort_if_bitset 3
		trigger self attack
	}

	trigger move
	{
		trigger self move_check
		wait 500
		trigger self move
	}


	trigger run_0
	{
		setstate p51 default
		accum 1 bitset 2
		followspline 0 plane1 1200 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_1
	{
		accum 1 bitset 2
		followspline 0 plane2 1200 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_2
	{
		accum 1 bitset 2
		followspline 0 plane3 1200 wait length 32
		accum 1 bitreset 2

		trigger self run_continue
	}

	trigger run_3
	{
		accum 1 bitset 2
		followspline 0 plane4 1200 wait length 32
		accum 1 bitreset 2
		alertentity s_flyby
		trigger self run_continue
	}

	trigger run_4
	{
		accum 1 bitset 2
		followspline 0 plane5 1200 wait length 32
		accum 1 bitreset 2
		trigger p51 hide
		trigger self blowtank
		wait 50
		
		trigger self run_continue
		
	}

	trigger run_5
	{
		accum 1 bitset 2
		followspline 0 plane6 1200 wait length 32
		accum 1 bitreset 2
		
			
	}

	
}


// *********************************************
// **************** CONSTRUCTIBLES *************
// *********************************************

// *********************************************
// ****************The Tree Falling script *****
// *********************************************

tree_up
{
	spawn
	{
		wait 400
		constructible_health 1100
		trigger tree_up setup
		constructible_class 2

	}

	trigger setup
	{
		setstate tree_up default
		setstate tree_up_toi default
		setstate treesupport default
		trigger tank disable_stage1
	}


	death
	{
		alertentity treefall_sound
		trigger tree_up remove
		setstate tree_up invisible
		setstate tree_up_toi invisible
		setstate treesupport invisible
		trigger tank enable_stage1

		wm_announce "Tank Barrier #1 has been placed."
		trigger treefall drop
		trigger tree_down show
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tankbar_constructed"

		wm_teamvoiceannounce 1 "bulge_allies_tankbar_constructed"
		// *---------------------------------------------------------------------------------*
	}

	trigger remove
	{
		setstate tree_up invisible
		setstate tree_up_toi invisible
	//	remove
	}
}
tree_down
{
	spawn
	{
		wait 400
		trigger tree_down setup
		constructible_health 1000
		constructible_class 2
	}

	trigger setup
	{
		setstate tree_down invisible
		setstate tree_down_toi invisible
	}


	trigger show
	{
		setstate tree_down default
		setstate tree_down_toi default
	}
	death
	{
		setstate tree_down invisible
		setstate treefall invisible
		setstate tree_down_toi invisible
		alertentity barrier1_explode
		trigger tank disable_stage1

		wm_announce "Tank Barrier #1 has been destroyed."

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tankbar1_destroyed"
		wm_teamvoiceannounce 1 "bulge_allies_tankbar1_destroyed"
		// *---------------------------------------------------------------------------------*
	}

	trigger remove
	{
		setstate tree_down invisible
		setstate tree_down_toi invisible
		// *----------------------------------- vo ------------------------------------------*	
		wm_teamvoiceannounce 0 "bulge_axis_past_tankbar1"
		wm_teamvoiceannounce 1 "bulge_allied_past_tankbar1"
		// *----------------------------------- vo ------------------------------------------*	
		remove
	}
}

treefall
{
	spawn
	{
		wait 400
		faceangles 180 0 0 0

		setstate treefall default
	}
	trigger drop
	{
		faceangles -90 0 0 2000
		faceangles -86 0 0 400
		faceangles -90 0 0 200
	}
}

defense_window
{
	spawn
	{
		wait 400
		trigger defense_window setup

		constructible_class 2
	}

	trigger setup
	{
		setstate defense_window_materials default
		setstate defense_window_materials_clip default
		setstate defense_window_flag default
	}

	buildstart final
	{
		setstate defense_window_materials default
		setstate defense_window_materials_clip default
		setstate defense_window_flag default
	}

	built final
	{
		setstate defense_window_materials invisible
		setstate defense_window_materials_clip invisible
		setstate defense_window_flag invisible


		wm_announce "Window Defenses have been constructed."

		// *----------------------------------- vo ------------------------------------------*
	
		// *---------------------------------------------------------------------------------*
	}

	decayed final
	{
		setstate defense_window_materials default
		setstate defense_window_materials_clip default
		setstate defense_window_flag default
	}

	death
	{
		setstate defense_window_materials default
		setstate defense_window_materials_clip default
		setstate defense_window_flag default

		wm_announce "Window Defenses have been destroyed."

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_defense_destroyed"

		wm_teamvoiceannounce 1 "bulge_allies_defense_construct"
		// *---------------------------------------------------------------------------------*
	}

}
defense2
{
	spawn
	{
		wait 400
		trigger defense2 setup

		constructible_class 3
	}

	trigger setup
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
		setstate dragon_teeth1 invisible
		setstate dragon_teeth2 invisible
		setstate dragon_teeth3 invisible
		trigger tank disable_stage2

		setstate defense2 invisible
	}

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


		setstate defense2 underconstruction
		setstate dragon_teeth1 underconstruction
		setstate dragon_teeth2 underconstruction
		setstate dragon_teeth3 underconstruction
	}

	built final
	{
		setstate defense2_materials invisible
		setstate defense2_materials_clip invisible
		setstate defense2_flag invisible
		setstate dragon_teeth1 default
		setstate dragon_teeth2 default
		setstate dragon_teeth3 default

		setstate defense2 default

		trigger tank enable_stage2

		wm_announce "Tank Barrier #2 has been constructed."
		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tankbar_constructed"

		wm_teamvoiceannounce 1 "bulge_allies_tankbar_constructed"
		// *---------------------------------------------------------------------------------*
	}

	decayed final
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default


		setstate defense2 invisible
	}

	death
	{
		setstate defense2_materials default
		setstate defense2_materials_clip default
		setstate defense2_flag default
		setstate dragon_teeth1 invisible
		setstate dragon_teeth2 invisible
		setstate dragon_teeth3 invisible


		setstate defense2 invisible

		trigger tank disable_stage2

		wm_announce "Tank Barrier #2 has been destroyed."

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "bulge_axis_tankbar2_destroyed"

		wm_teamvoiceannounce 1 "bulge_allies_tankbar2_destroyed"
		// *---------------------------------------------------------------------------------*
	}

	trigger remove
	{
		setstate defense2_toi invisible
		setstate defense2_materials invisible
		setstate defense2_materials_clip invisible
		setstate defense2_flag invisible
		setstate defense2 invisible
		// *----------------------------------- vo ------------------------------------------*	
		wm_teamvoiceannounce 0 "bulge_axis_past_tankbar2"
		wm_teamvoiceannounce 1 "bulge_allied_past_tankbar2"
		// *----------------------------------- vo ------------------------------------------*	
		remove
	}
}

//==================================================
//========== Shutter movement=======================
//==================================================


shutter_front
{
	spawn
	{
		wait 500
		faceangles 0 315 0 2000
		trigger shutter_front random
	}
	trigger random
	{
		accum 6 set 0 
		accum 6 random 4
		accum 6 trigger_if_equal 0 shutter_front open
		accum 6 trigger_if_equal 1 shutter_front backopen
		accum 6 trigger_if_equal 2 shutter_front pass
		accum 6 trigger_if_equal 3 shutter_front closestrong
	}

	trigger open
	{
		enablespeaker wind_burst
		stopsound
		playsound sound/menzel/shutter_creak.wav volume 96
		faceangles 0 280 0 1500 DECCEL
		faceangles 0 315 0 2000 DECCEL
		disablespeaker wind_burst
		wait 20000
		trigger shutter_front random
		
	}

trigger closestrong
	{
		enablespeaker wind_burst
		stopsound
		playsound sound/menzel/shutter_hit.wav volume 96
		faceangles 0 360 0 700 DECCEL
		faceangles 0 315 0 2300 DECCEL
		disablespeaker wind_burst
		wait 20000
		trigger shutter_front random


		
	}

	trigger backopen
	{
		stopsound
		playsound sound/menzel/shutter_creak.wav volume 96
		trigger shutter_back open
		wait 10000
		trigger shutter_front random
		
	}

trigger pass
	{
	
		wait 10000
		trigger shutter_front random
		
	}
}

shutter_back
{
	spawn
	{
		faceangles 0 50 0 2000
	}

	trigger open
	{
		enablespeaker wind_burst
		stopsound
		playsound sound/menzel/shutter_creak.wav volume 96
		faceangles 0 85 0 1500 DECCEL
		faceangles 0 50 0 2000 DECCEL
		disablespeaker wind_burst
	}
}


// ================================================
// ============ 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_objective_status 6 0 2
		wm_objective_status 6 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_teamvoiceannounce 0 "axis_hq_compost_construct"

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

		wm_objective_status 6 0 0
		wm_objective_status 6 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_objective_status 7 0 1
		wm_objective_status 7 1 2
		trigger axis_command_spawn enable
	}

	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_teamvoiceannounce 0 "axis_hq_compost_damaged"

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

		wm_objective_status 7 0 0
		wm_objective_status 7 1 0
		trigger axis_command_spawn disable
	}
}

//New spawn at Command Post for Axis
axis_command_spawn
{
	spawn
	{
		set
		{
			description "Axis CP Spawn"
			messsage "Axis CP Spawn"
	        }
		wait 200
		alertentity cpspawn
		setstate axis_command_spawn invisible
	}
	trigger enable
	{
		alertentity cpspawn
		setstate axis_command_spawn default
	}
	trigger disable
	{
 		alertentity cpspawn
		setstate axis_command_spawn invisible
	}
}

