//{ //HEADER
// Rocket Chamber - combined script
// script and map by elypter
// for details look at rocket_chamber_readme.txt

// this is the a combined file with all modes. the final scripts are generated from that.

//todo

//not yet commited changes

/*
//close whole in roof over respawn points

IF(HAS_CHARACTER_DIED(p1))
		//{ //all
			CHANGE_BLOCK TYPE (26, 26, 1) FIELD 0
			CHANGE_BLOCK TYPE (26, 34, 1) FIELD 0
			CHANGE_BLOCK TYPE (34, 26, 1) FIELD 0
			CHANGE_BLOCK TYPE (34, 34, 1) FIELD 0
		//}
	ENDIF
	
//reduce rocket death flight
	
OBJ_DATA twr1 = (30.4, 29.6, 2.9) 0 TOWER
OBJ_DATA twr2 = (30.9, 29.6, 2.9) 0 TOWER
OBJ_DATA twr3 = (30.9, 29.6, 2.9) 0 TOWER
OBJ_DATA twr4 = (29.4, 30.5, 2.9) 0 TOWER
OBJ_DATA twr5 = (29.7, 30.5, 2.9) 0 TOWER
OBJ_DATA twr6 = (30.0, 30.5, 2.9) 0 TOWER	
	
	
*/
	
//}

//{ //Declares

//{ //all
//{ //player
PLAYER_PED p1 = (29.5, 30.5, 1.0) 9 270
PLAYER_PED p2 = (31.5, 30.5, 1.0) 9 90
PLAYER_PED p3 = (31.0, 29.5, 1.0) 9 135
PLAYER_PED p4 = (30.0, 31.5, 1.0) 9 315
PLAYER_PED p5 = (30.0, 29.5, 1.0) 9 225
PLAYER_PED p6 = (31.0, 31.5, 1.0) 9 45
//}

OBJ_DATA name = (30.5, 24.2, 1.0) 0 FOOTY //Radio

COUNTER mainloop = 1
COUNTER temp = 0
COUNTER temp2 =0
COUNTER rand = 0
COUNTER tmr = 0
COUNTER roof_tmr = 0

COUNTER dsum = 0
COUNTER psum = 0

//doors - you cannot shoot rockets through them or bots cannot walk through them
DECLARE_DOOR_INFO ( 32 , 35 , 2 )
DECLARE_DOOR_INFO ( 31 , 35 , 2 )
DOOR_DATA door_1 = SINGLE (23, 30, 1) (24.0, 30.5, 1.0, 2.0, 1.0) RIGHT 0 ANY_PLAYER CLOSE_WHEN_OPEN_RULE_FAILS 0 FLIP_RIGHT NOT_REVERSED
DOOR_DATA door_2 = SINGLE (37, 30, 1) (37.0, 30.5, 1.0, 2.0, 1.0) LEFT 0 ANY_PLAYER CLOSE_WHEN_OPEN_RULE_FAILS 0 FLIP_RIGHT NOT_REVERSED

//debug
ONSCREEN_COUNTER dummy_osc
//}

//{ //ep
OBJ_DATA dispenser = (1.5, 1.5, 7.50) 90 CAR_STOP
COUNTER pos = 0
COUNTER disp_c=30
SOUND energy_snd

LIGHT  light1  =  ( 23.0 , 29.5 , 6.0 )  4.0  255 ( 255 , 0 , 0 ) 0  0  0 
LIGHT  light2  =  ( 23.0 , 31.5 , 6.0 )  4.0  255 ( 255 , 0 , 0 ) 0  0  0 
LIGHT  light3  =  ( 37.0 , 29.5 , 6.0 )  4.0  255 ( 255 , 0 , 0 ) 0  0  0 
LIGHT  light4  =  ( 37.0 , 31.5 , 6.0 )  4.0  255 ( 255 , 0 , 0 ) 0  0  0 
//}

//{ //hd
COUNTER cdtime = 0
COUNTER cdspeed = 0
COUNTER timer = 100
COUNTER timerup = 0
COUNTER sum = 0

COUNTER p1_button = 0
COUNTER p2_button = 0
COUNTER p3_button = 0
COUNTER p4_button = 0
COUNTER p5_button = 0
COUNTER p6_button = 0

ONSCREEN_COUNTER countdown
SOUND button_snd
COUNTER button_trg = 0
//}

//{ //pe
CHAR_DATA pistol_guard
CHAR_DATA punch_guard
COUNTER guard_c = 1501 //46 in usual while
SOUND elevator_sound1
SOUND elevator_sound2
forward guards:
//}

//}

LEVELSTART

WHILE_EXEC (mainloop = 1)
++tmr
++rand
IF(tmr = 1)

//{ //all
ADD_NEW_BLOCK  (  22 ,  29 ,  5   )
CHANGE_BLOCK TYPE (22, 29, 5) AIR 43
CHANGE_BLOCK LID (22, 29, 5) NOT_FLAT NOT_FLIP 0 270 1

ADD_NEW_BLOCK  (  22 ,  31 ,  5   )
CHANGE_BLOCK TYPE (22, 31, 5) AIR 43
CHANGE_BLOCK LID (22, 31, 5) NOT_FLAT NOT_FLIP 0 270 1

ADD_NEW_BLOCK  (  38 ,  29 ,  5   )
CHANGE_BLOCK TYPE (38, 29, 5) AIR 44
CHANGE_BLOCK LID (38, 29, 5) NOT_FLAT NOT_FLIP 3 90 1

ADD_NEW_BLOCK  (  38 ,  31 ,  5   )
CHANGE_BLOCK TYPE (38, 31, 5) AIR 44
CHANGE_BLOCK LID (38, 31, 5) NOT_FLAT NOT_FLIP 3 90 1

//}

//{ //not hd

ADD_NEW_BLOCK  (  30 ,  30 ,  1   )
CHANGE_BLOCK TYPE (30, 30, 1) AIR 0
CHANGE_BLOCK LID (30, 30, 1) NOT_FLAT NOT_FLIP 0 0 4
CHANGE_BLOCK SIDE (30, 30, 1) TOP WALL BULLET NOT_FLAT NOT_FLIP 0 4
CHANGE_BLOCK SIDE (30, 30, 1) BOTTOM WALL BULLET NOT_FLAT NOT_FLIP 0 4
CHANGE_BLOCK SIDE (30, 30, 1) LEFT WALL BULLET NOT_FLAT NOT_FLIP 0 4
CHANGE_BLOCK SIDE (30, 30, 1) RIGHT WALL BULLET NOT_FLAT NOT_FLIP 0 4
//}

//{ //none
DISPLAY_BRIEF ( 1606 )
//}

//{ //ep
DISPLAY_BRIEF ( 1609 )

ADD_NEW_BLOCK  (  22 ,  29 ,  5   )
CHANGE_BLOCK TYPE (22, 29, 5) AIR 37
CHANGE_BLOCK LID (22, 29, 5) FLAT NOT_FLIP 0 90 27
ADD_NEW_BLOCK  (  23 ,  29 ,  5   )
CHANGE_BLOCK TYPE (23, 29, 5) AIR 43
CHANGE_BLOCK LID (23, 29, 5) NOT_FLAT FLIP 0 90 41
CHANGE_BLOCK SIDE (23, 29, 5) TOP WALL BULLET FLAT FLIP 0 37
CHANGE_BLOCK SIDE (23, 29, 5) BOTTOM WALL BULLET FLAT NOT_FLIP 0 37

ADD_NEW_BLOCK  (  22 ,  31 ,  5   )
CHANGE_BLOCK TYPE (22, 31, 5) AIR 37
CHANGE_BLOCK LID (22, 31, 5) FLAT NOT_FLIP 0 90 27
ADD_NEW_BLOCK  (  23 ,  31 ,  5   )
CHANGE_BLOCK TYPE (23, 31, 5) AIR 43
CHANGE_BLOCK LID (23, 31, 5) NOT_FLAT FLIP 0 90 41
CHANGE_BLOCK SIDE (23, 31, 5) TOP WALL BULLET FLAT FLIP 0 37
CHANGE_BLOCK SIDE (23, 31, 5) BOTTOM WALL BULLET FLAT NOT_FLIP 0 37

ADD_NEW_BLOCK  (  38 ,  29 ,  5   )
CHANGE_BLOCK TYPE (38, 29, 5) AIR 29
CHANGE_BLOCK LID (38, 29, 5) FLAT NOT_FLIP 0 270 27
ADD_NEW_BLOCK  (  37 ,  29 ,  5   )
CHANGE_BLOCK TYPE (37, 29, 5) AIR 44
CHANGE_BLOCK LID (37, 29, 5) NOT_FLAT FLIP 0 270 41
CHANGE_BLOCK SIDE (37, 29, 5) TOP WALL BULLET FLAT NOT_FLIP 0 37
CHANGE_BLOCK SIDE (37, 29, 5) BOTTOM WALL BULLET FLAT FLIP 0 37

ADD_NEW_BLOCK  (  38 ,  31 ,  5   )
CHANGE_BLOCK TYPE (38, 31, 5) AIR 29
CHANGE_BLOCK LID (38, 31, 5) FLAT NOT_FLIP 0 270 27
ADD_NEW_BLOCK  (  37 ,  31 ,  5   )
CHANGE_BLOCK TYPE (37, 31, 5) AIR 44
CHANGE_BLOCK LID (37, 31, 5) NOT_FLAT FLIP 0 270 41
CHANGE_BLOCK SIDE (37, 31, 5) TOP WALL BULLET FLAT NOT_FLIP 0 37
CHANGE_BLOCK SIDE (37, 31, 5) BOTTOM WALL BULLET FLAT FLIP 0 37
//}

//{ //hd
DISPLAY_BRIEF ( 1608 )
//}

//{ //pe
DISPLAY_BRIEF ( 1607 )
//}

ENDIF

//{ //ep
IF ( disp_c > 1 )
	--disp_c
ENDIF
IF ( disp_c = 120 )
	CHANGE_BLOCK TYPE (30, 30, 1) AIR 0

	CHANGE_BLOCK TYPE (29, 30, 1) AIR 0
	CHANGE_BLOCK TYPE (29, 31, 1) AIR 0
	CHANGE_BLOCK TYPE (30, 31, 1) AIR 0
	CHANGE_BLOCK TYPE (31, 31, 1) AIR 0
	CHANGE_BLOCK TYPE (31, 30, 1) AIR 0
	CHANGE_BLOCK TYPE (31, 29, 1) AIR 0
	CHANGE_BLOCK TYPE (30, 29, 1) AIR 0
	CHANGE_BLOCK TYPE (29, 29, 1) AIR 0
ENDIF
IF ( disp_c = 110 )

	CHANGE_BLOCK TYPE (30, 30, 1) FIELD 0

	CHANGE_BLOCK TYPE (29, 30, 1) FIELD 0
	CHANGE_BLOCK TYPE (29, 31, 1) FIELD 0
	CHANGE_BLOCK TYPE (30, 31, 1) FIELD 0
	CHANGE_BLOCK TYPE (31, 31, 1) FIELD 0
	CHANGE_BLOCK TYPE (31, 30, 1) FIELD 0
	CHANGE_BLOCK TYPE (31, 29, 1) FIELD 0
	CHANGE_BLOCK TYPE (30, 29, 1) FIELD 0
	CHANGE_BLOCK TYPE (29, 29, 1) FIELD 0
ENDIF
IF ( disp_c = 100 )
	EXPLODE_NO_RING(dispenser)
	EXPLODE_SMALL(dispenser)
	DELETE_ITEM(dispenser)
ENDIF
IF ( disp_c > 100 )
	energy_snd = CREATE_SOUND ( 30.5, 30.5 , 1.0 ) BANK_ALARM PLAY_INSTANT END
ENDIF
IF ( disp_c = 1 )
	SET temp = ( rand / 4 )
	SET temp = ( temp * 4 )
	SET pos= ( rand - temp )
	
	IF(pos=0)
	dispenser = CREATE_OBJ (22.5, 29.5, 6.00) 90 CAR_STOP END
	SET disp_c=215
	ENDIF
	IF(pos=1)
	dispenser = CREATE_OBJ (22.5, 31.5, 6.00) 90 CAR_STOP END
	SET disp_c=215
	ENDIF
	IF(pos=2)
	dispenser = CREATE_OBJ (38.5, 29.5, 6.00) 270 CAR_STOP END
	SET disp_c=215
	ENDIF
	IF(pos=3)
	dispenser = CREATE_OBJ (38.5, 31.5, 6.00) 270 CAR_STOP END
	SET disp_c=215
	ENDIF
	
	SET temp = ( rand / 3 )
	SET temp = ( temp * 3 )
	SET rand= ( rand - temp )	
ENDIF
//}

//{ //hd
SET sum = 0
SET dsum = 0
SET psum = 0

IF(tmr = 350)
ADD_ONSCREEN_COUNTER  (   countdown  , timer )
ENDIF
//}

//{ //pe
SET guard_c = ( guard_c + 1 )
IF ( guard_c = 1300 ) //45 in usual while
	elevator_sound1 = CREATE_SOUND ( 23.5, 30.5 , 6.0 ) YEEHA_BOMB PLAY_INSTANT END
	elevator_sound2 = CREATE_SOUND ( 37.5, 30.5 , 6.0 ) YEEHA_BOMB PLAY_INSTANT END
ENDIF
IF ( guard_c > 1500 ) //60 in usual while
	GOSUB guards:
ENDIF
//}

//{ //Player Check
IF (CHECK_CHARACTER_HEALTH(p1, 0))
	//{ //all
	GIVE_WEAPON (  p1 , rocket_launcher, 99 )
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p1, 22.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p1, 37.5, 30.5, 1.0, 270 )
	ENDIF
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p1, 38.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p1, 23.5, 30.5, 1.0, 90 )
	ENDIF
	
	IF (IS_CHAR_FIRING_ONSCREEN(p1))
		SET temp = ( rand / 3 )
		SET temp = ( temp * 3 )
		SET rand= ( rand - temp )
	ENDIF
	SET psum = (psum+1)
	IF(HAS_CHARACTER_DIED(p1))
		SET dsum = (dsum+1)
	ENDIF
	//}
	//{ //hd
	IF (LOCATE_CHARACTER_ANY_MEANS ( p1  ,  30.5 , 30.5 , 1.0  , 1.2 , 1.2  ))
		SET p1_button = 1
		SET sum = (sum+1)
	ELSE
		SET p1_button = 0
	ENDIF

	//}

ENDIF

IF (CHECK_CHARACTER_HEALTH(p2, 0))
	//{ //all
	GIVE_WEAPON (  p2 , rocket_launcher, 99 )
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p2, 22.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p2, 37.5, 30.5, 1.0, 270 )
	ENDIF
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p2, 38.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p2, 23.5, 30.5, 1.0, 90 )
	ENDIF
	
	IF (IS_CHAR_FIRING_ONSCREEN(p2))
		SET temp = ( rand / 3 )
		SET temp = ( temp * 3 )
		SET rand= ( rand - temp )
	ENDIF
	SET psum = (psum+1)
	IF(HAS_CHARACTER_DIED(p2))
		SET dsum = (dsum+1)
	ENDIF
	//}
	//{ //hd
	IF (LOCATE_CHARACTER_ANY_MEANS ( p2  ,  30.5 , 30.5 , 1.0  , 1.2 , 1.2  ))
		SET p2_button = 1
		SET sum = (sum+1)
	ELSE
		SET p2_button = 0
	ENDIF

	//}

ENDIF

IF (CHECK_CHARACTER_HEALTH(p3, 0))
	//{ //all
	GIVE_WEAPON (  p3 , rocket_launcher, 99 )
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p3, 22.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p3, 37.5, 30.5, 1.0, 270 )
	ENDIF
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p3, 38.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p3, 23.5, 30.5, 1.0, 90 )
	ENDIF
	
	IF (IS_CHAR_FIRING_ONSCREEN(p3))
		SET temp = ( rand / 3 )
		SET temp = ( temp * 3 )
		SET rand= ( rand - temp )
	ENDIF
	SET psum = (psum+1)
	IF(HAS_CHARACTER_DIED(p3))
		SET dsum = (dsum+1)
	ENDIF
	//}
	//{ //hd
	IF (LOCATE_CHARACTER_ANY_MEANS ( p3  ,  30.5 , 30.5 , 1.0  , 1.2 , 1.2  ))
		SET p3_button = 1
		SET sum = (sum+1)
	ELSE
		SET p3_button = 0
	ENDIF

	//}

ENDIF

IF (CHECK_CHARACTER_HEALTH(p4, 0))
	//{ //all
	GIVE_WEAPON (  p4 , rocket_launcher, 99 )
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p4, 22.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p4, 37.5, 30.5, 1.0, 270 )
	ENDIF
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p4, 38.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p4, 23.5, 30.5, 1.0, 90 )
	ENDIF
	
	IF (IS_CHAR_FIRING_ONSCREEN(p4))
		SET temp = ( rand / 3 )
		SET temp = ( temp * 3 )
		SET rand= ( rand - temp )
	ENDIF
	SET psum = (psum+1)
	IF(HAS_CHARACTER_DIED(p4))
		SET dsum = (dsum+1)
	ENDIF
	//}
	//{ //hd
	IF (LOCATE_CHARACTER_ANY_MEANS ( p4  ,  30.5 , 30.5 , 1.0  , 1.2 , 1.2  ))
		SET p4_button = 1
		SET sum = (sum+1)
	ELSE
		SET p4_button = 0
	ENDIF

	//}

ENDIF

IF (CHECK_CHARACTER_HEALTH(p5, 0))
	//{ //all
	GIVE_WEAPON (  p5 , rocket_launcher, 99 )
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p5, 22.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p5, 37.5, 30.5, 1.0, 270 )
	ENDIF
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p5, 38.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p5, 23.5, 30.5, 1.0, 90 )
	ENDIF
	
	IF (IS_CHAR_FIRING_ONSCREEN(p5))
		SET temp = ( rand / 3 )
		SET temp = ( temp * 3 )
		SET rand= ( rand - temp )
	ENDIF
	SET psum = (psum+1)
	IF(HAS_CHARACTER_DIED(p5))
		SET dsum = (dsum+1)
	ENDIF
	//}
	//{ //hd
	IF (LOCATE_CHARACTER_ANY_MEANS ( p5  ,  30.5 , 30.5 , 1.0  , 1.2 , 1.2  ))
		SET p5_button = 1
		SET sum = (sum+1)
	ELSE
		SET p5_button = 0
	ENDIF

	//}

ENDIF

IF (CHECK_CHARACTER_HEALTH(p6, 0))
	//{ //all
	GIVE_WEAPON (  p6 , rocket_launcher, 99 )
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p6, 22.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p6, 37.5, 30.5, 1.0, 270 )
	ENDIF
	IF ( LOCATE_CHARACTER_ANY_MEANS ( p6, 38.5, 30.5, 1.0, 1.0, 1.0) )
		WARP_FROM_CAR_TO_POINT ( p6, 23.5, 30.5, 1.0, 90 )
	ENDIF
	
	IF (IS_CHAR_FIRING_ONSCREEN(p6))
		SET temp = ( rand / 3 )
		SET temp = ( temp * 3 )
		SET rand= ( rand - temp )
	ENDIF
	SET psum = (psum+1)
	IF(HAS_CHARACTER_DIED(p6))
		SET dsum = (dsum+1)
	ENDIF
	//}
	//{ //hd
	IF (LOCATE_CHARACTER_ANY_MEANS ( p6  ,  30.5 , 30.5 , 1.0  , 1.2 , 1.2  ))
		SET p6_button = 1
		SET sum = (sum+1)
	ELSE
		SET p6_button = 0
	ENDIF

	//}

ENDIF
//}

//{ //all
IF (dsum = 0)
	IF (roof_tmr>1)
		--roof_tmr
	ENDIF
	IF (roof_tmr=1)
		CHANGE_BLOCK TYPE (26, 26, 1) FIELD 0
		CHANGE_BLOCK TYPE (26, 34, 1) FIELD 0
		CHANGE_BLOCK TYPE (34, 26, 1) FIELD 0
		CHANGE_BLOCK TYPE (34, 34, 1) FIELD 0
		SET roof_tmr=0
	ENDIF
ENDIF
IF (dsum > 0)
	SET roof_tmr=100
	CHANGE_BLOCK TYPE (26, 26, 1) AIR 0
	CHANGE_BLOCK TYPE (26, 34, 1) AIR 0
	CHANGE_BLOCK TYPE (34, 26, 1) AIR 0
	CHANGE_BLOCK TYPE (34, 34, 1) AIR 0
ENDIF
//}

//{ //hd2
SET temp = 600
SET temp2 = (psum + 1)
SET cdtime = ( temp / psum)

IF (sum = 1)
	IF (button_trg = 0)
		button_snd = CREATE_SOUND ( 30.5, 30.5 , 1.0 ) POISONED PLAY_INSTANT END
	ENDIF
	SET button_trg = 1

	SET temp = (psum+1)
	SET temp = (temp/2)
	IF (dsum < temp)
		SET timer = ( timer - 1 )
	ENDIF
	
	CHANGE_BLOCK   LID   ( 30 ,  30 ,  0 )  NOT_FLAT   NOT_FLIP   0   0   45
	
	CHANGE_BLOCK   LID   ( 29 ,  30 ,  0 )  NOT_FLAT   NOT_FLIP   0   180   30
	CHANGE_BLOCK   LID   ( 29 ,  31 ,  0 )  NOT_FLAT   NOT_FLIP   0   180   23
	CHANGE_BLOCK   LID   ( 30 ,  31 ,  0 )  NOT_FLAT   NOT_FLIP   0   90   30
	CHANGE_BLOCK   LID   ( 31 ,  31 ,  0 )  NOT_FLAT   NOT_FLIP   0   90   23
	CHANGE_BLOCK   LID   ( 31 ,  30 ,  0 )  NOT_FLAT   NOT_FLIP   0   0   30
	CHANGE_BLOCK   LID   ( 31 ,  29 ,  0 )  NOT_FLAT   NOT_FLIP   0   0   23
	CHANGE_BLOCK   LID   ( 30 ,  29 ,  0 )  NOT_FLAT   NOT_FLIP   0   270   30
	CHANGE_BLOCK   LID   ( 29 ,  29 ,  0 )  NOT_FLAT   NOT_FLIP   0   270   23
ENDIF
IF (sum < 1)
	SET button_trg = 0
	IF ( timer < cdtime )
		button_snd = CREATE_SOUND ( 30.5, 30.5 , 1.0 ) CLOCK_TOWER PLAY_INSTANT END
	ENDIF
	
	//SET temp = 6
	//SET temp = ( temp / psum)
	SET temp = 1
	//SET timer = ( timer + temp )
	
	IF(timerup=1) //1:1 count up
	SET timer = ( timer + temp )
	SET timerup=0
	ENDIF
	++timerup	
	
	CHANGE_BLOCK   LID   ( 30 ,  30 ,  0 )  NOT_FLAT   NOT_FLIP   0   0   20
	
	CHANGE_BLOCK   LID   ( 29 ,  30 ,  0 )  NOT_FLAT   NOT_FLIP   0   180   18
	CHANGE_BLOCK   LID   ( 29 ,  31 ,  0 )  NOT_FLAT   NOT_FLIP   0   180   26
	CHANGE_BLOCK   LID   ( 30 ,  31 ,  0 )  NOT_FLAT   NOT_FLIP   0   90   18
	CHANGE_BLOCK   LID   ( 31 ,  31 ,  0 )  NOT_FLAT   NOT_FLIP   0   90   26
	CHANGE_BLOCK   LID   ( 31 ,  30 ,  0 )  NOT_FLAT   NOT_FLIP   0   0   18
	CHANGE_BLOCK   LID   ( 31 ,  29 ,  0 )  NOT_FLAT   NOT_FLIP   0   0   26
	CHANGE_BLOCK   LID   ( 30 ,  29 ,  0 )  NOT_FLAT   NOT_FLIP   0   270   18
	CHANGE_BLOCK   LID   ( 29 ,  29 ,  0 )  NOT_FLAT   NOT_FLIP   0   270   26
ENDIF

IF ( timer <= 0)
	SET timer = ( cdtime + 0 )

	//EXPLODE_NO_RING(30.5 , 30.5 , 1.0)
	EXPLODE(30.5 , 30.5 , 1.0)
	
	IF (p1_button=1)
		ADD_SCORE (p1 , 10000)
	ENDIF
		IF (p2_button=1)
		ADD_SCORE (p2 , 10000)
	ENDIF
		IF (p3_button=1)
		ADD_SCORE (p3 , 10000)
	ENDIF
		IF (p4_button=1)
		ADD_SCORE (p4 , 10000)
	ENDIF
		IF (p5_button=1)
		ADD_SCORE (p5 , 10000)
	ENDIF
		IF (p6_button=1)
		ADD_SCORE (p6 , 10000)
	ENDIF
ENDIF
IF ( timer > cdtime )
	SET timer = (cdtime + 0)
ENDIF
//}

ENDWHILE

LEVELEND

//SUBS
guards: //: //pe

	//FORCE_CLEANUP and delete doesnt prevent crash
	//DELETE_ITEM( pistol_guard  )
	//FORCE_CLEANUP  (  pistol_guard  )
	//DELETE_ITEM( punch_guard  )
	//FORCE_CLEANUP  (  punch_guard  )
	
	SET guard_c = 0

	OPEN_DOOR ( door_1 )
	pistol_guard = CREATE_CHAR (24.1, 30.5, 1.9) 51 90 ARMY END
	SET_CHAR_SHOOTING_SKILL ( pistol_guard , CRACK_SHOT )
	GIVE_WEAPON ( pistol_guard , PISTOL )
	SET_CHAR_OBJECTIVE (pistol_guard, GUARD_SPOT)
	SET_CHAR_THREAT_SEARCH (pistol_guard, AREA_PLAYER_ONLY)
	SET_CHAR_THREAT_REACTION (pistol_guard, REACT_AS_NORMAL)
	ADD_PATROL_POINT (pistol_guard, 26.5, 26.5, 1.0)
	ADD_PATROL_POINT (pistol_guard, 26.5, 34.5, 1.0)
	ADD_PATROL_POINT (pistol_guard, 34.5, 34.5, 1.0)
	ADD_PATROL_POINT (pistol_guard, 34.5, 26.5, 1.0)

	OPEN_DOOR ( door_2 )
	punch_guard = CREATE_CHAR (36.9, 30.5, 1.9) 51 270 ARMY END
	SET_CHAR_SHOOTING_SKILL ( punch_guard , CRACK_SHOT )
	SET_CHAR_OBJECTIVE (punch_guard, GUARD_SPOT)
	SET_CHAR_THREAT_SEARCH (punch_guard, AREA_PLAYER_ONLY)
	SET_CHAR_THREAT_REACTION (punch_guard, REACT_AS_NORMAL)
	ADD_PATROL_POINT (punch_guard, 34.5, 34.5, 1.0)
	ADD_PATROL_POINT (punch_guard, 26.5, 34.5, 1.0)
	ADD_PATROL_POINT (punch_guard, 26.5, 26.5, 1.0)
	ADD_PATROL_POINT (punch_guard, 34.5, 26.5, 1.0)
return
