//Punch Battle
//MAP BY JEDRAS
//Thanks to all tersters: Kamil, Kratek, Xan, szkarlatyn, BONEMAN, elypter, Magnus, JackS, Wojti, FirstBlood, Aim, Andrej, Baron, YoGhurt
//2015

PLAYER_PED p1 = (158.5, 137.5, 5.0) 16 180
PLAYER_PED p2 = (156.5, 137.5, 5.0) 17 180
PLAYER_PED p3 = (160.5, 137.5, 5.0) 51 180
PLAYER_PED p4 = (154.5, 137.5, 5.0) 45 180
PLAYER_PED p5 = (159.0, 127.5, 5.0) 34 0
PLAYER_PED p6 = (156.0, 127.5, 5.0) 50 0

GENERATOR electro_1 = (157.5, 128.5, 6.0) 0 COLLECT_03 1000 1000 8
GENERATOR electro_2 = (161.5, 137.5, 6.0) 0 COLLECT_03 2000 2000 8

COUNTER p1_explode
COUNTER p2_explode
COUNTER p3_explode
COUNTER p4_explode
COUNTER p5_explode
COUNTER p6_explode
COUNTER tmr_explode = 1
COUNTER col_explode = 1
COUNTER res_explode = 2000
OBJ_DATA obj_explode

COUNTER loop = 1

SOUND soun
SOUND umcybuncy = (157.5,133.5,5.0) NIGHT_CLUB PLAY_FOREVER
SET_GANG_INFO (islagang, 06, DUAL_PISTOL,DUAL_PISTOL,DUAL_PISTOL,
               0, 0.0,0.0,0.0, 0, GRAHAM, 30)

PARKED_CAR_DATA plane = (148.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane2 = (150.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane3 = (152.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane4 = (154.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane5 = (156.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane6 = (158.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane7 = (160.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane8 = (162.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane9 = (164.5,145.5,5.0) -1 300 TOWTRUCK
PARKED_CAR_DATA plane10 = (166.5,145.5,5.0) -1 300 TOWTRUCK

LEVELSTART
SET_AMBIENT_LEVEL (0.45, 0)
SWITCH_GENERATOR ( electro_1 , ON )
SWITCH_GENERATOR ( electro_2 , ON )
WHILE_EXEC(loop=1)
SET_CHAR_GRAPHIC_TYPE (p1, DUMMY_GRAPHIC, 16)
SET_CHAR_GRAPHIC_TYPE (p2, DUMMY_GRAPHIC, 17)
SET_CHAR_GRAPHIC_TYPE (p3, DUMMY_GRAPHIC, 51)
SET_CHAR_GRAPHIC_TYPE (p4, DUMMY_GRAPHIC, 45)
SET_CHAR_GRAPHIC_TYPE (p5, DUMMY_GRAPHIC, 34)
SET_CHAR_GRAPHIC_TYPE (p6, DUMMY_GRAPHIC, 50)

IF (CHECK_CHARACTER_HEALTH(p1, 0))
  	GIVE_WEAPON (p1, FLAME_THROWER, 99)
ENDIF

IF (CHECK_CHARACTER_HEALTH(p2, 0))
	GIVE_WEAPON (p2, FLAME_THROWER, 99)
ENDIF

IF (CHECK_CHARACTER_HEALTH(p3, 0))
  	GIVE_WEAPON (p3, FLAME_THROWER, 99)
ENDIF

IF (CHECK_CHARACTER_HEALTH(p4, 0))
  	GIVE_WEAPON (p4, FLAME_THROWER, 99)
ENDIF

IF (CHECK_CHARACTER_HEALTH(p5, 0))
  	GIVE_WEAPON (p5, FLAME_THROWER, 99)
ENDIF

IF (CHECK_CHARACTER_HEALTH(p6, 0))
  	GIVE_WEAPON (p6, FLAME_THROWER, 99)
ENDIF

IF (CHECK_CHARACTER_HEALTH(p1, 0))
	IF ((LOCATE_CHARACTER_ANY_MEANS ( p1 , 157.5, 133.5, 2.0 , 0.8 , 0.8 ))AND(col_explode = 0))
		SET tmr_explode = 0
 		SET p1_explode = 1
		DELETE_ITEM ( obj_explode )
		soun = CREATE_SOUND (157.5, 133.5, 5.0) SCREAM PLAY_INSTANT END
	ENDIF
	IF ( p1_explode = 1 )
		IF ( NOT ( DELAY ( 15 ) ) )
			IF (CHECK_CHARACTER_HEALTH(p2, 0))
  				EXPLODE_SMALL (p2)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p3, 0))
  				EXPLODE_SMALL (p3)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p4, 0))
   				EXPLODE_SMALL (p4)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p5, 0))
   				EXPLODE_SMALL (p5)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p6, 0))
   				EXPLODE_SMALL (p6)
			ENDIF
			EXPLODE_LARGE (154.5, 128.5, 6.0)
			EXPLODE_LARGE (160.5, 128.5, 6.0)
			EXPLODE_LARGE (155.5, 131.5, 6.0)
			EXPLODE_LARGE (159.5, 131.5, 6.0)
			EXPLODE_LARGE (153.5, 133.5, 6.0)
			EXPLODE_LARGE (161.5, 133.5, 6.0)
			EXPLODE_LARGE (153.5, 137.5, 6.0)
			EXPLODE_LARGE (161.5, 137.5, 6.0)
   			SET p1_explode = 0
		ENDIF
	ENDIF
ENDIF

IF (CHECK_CHARACTER_HEALTH(p2, 0))
	IF ((LOCATE_CHARACTER_ANY_MEANS ( p2 , 157.5, 133.5, 2.0 , 0.8 , 0.8 ))AND(col_explode = 0))
		SET tmr_explode = 0
 		SET p2_explode = 1
		DELETE_ITEM ( obj_explode )
		soun = CREATE_SOUND (157.5, 133.5, 5.0) SCREAM PLAY_INSTANT END
	ENDIF
	IF ( p2_explode = 1 )
		IF ( NOT ( DELAY ( 15 ) ) )
			IF (CHECK_CHARACTER_HEALTH(p1, 0))
  				EXPLODE_SMALL (p1)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p3, 0))
  				EXPLODE_SMALL (p3)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p4, 0))
   				EXPLODE_SMALL (p4)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p5, 0))
   				EXPLODE_SMALL (p5)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p6, 0))
   				EXPLODE_SMALL (p6)
			ENDIF
			EXPLODE_LARGE (154.5, 128.5, 6.0)
			EXPLODE_LARGE (160.5, 128.5, 6.0)
			EXPLODE_LARGE (155.5, 131.5, 6.0)
			EXPLODE_LARGE (159.5, 131.5, 6.0)
			EXPLODE_LARGE (153.5, 133.5, 6.0)
			EXPLODE_LARGE (161.5, 133.5, 6.0)
			EXPLODE_LARGE (153.5, 137.5, 6.0)
			EXPLODE_LARGE (161.5, 137.5, 6.0)
   			SET p2_explode = 0
		ENDIF
	ENDIF
ENDIF

IF (CHECK_CHARACTER_HEALTH(p3, 0))
	IF ((LOCATE_CHARACTER_ANY_MEANS ( p3 , 157.5, 133.5, 2.0 , 0.8 , 0.8 ))AND(col_explode = 0))
		SET tmr_explode = 0
 		SET p3_explode = 1
		DELETE_ITEM ( obj_explode )
		soun = CREATE_SOUND (157.5, 133.5, 5.0) SCREAM PLAY_INSTANT END
	ENDIF
	IF ( p3_explode = 1 )
		IF ( NOT ( DELAY ( 15 ) ) )
			IF (CHECK_CHARACTER_HEALTH(p1, 0))
  				EXPLODE_SMALL (p1)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p2, 0))
  				EXPLODE_SMALL (p2)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p4, 0))
   				EXPLODE_SMALL (p4)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p5, 0))
   				EXPLODE_SMALL (p5)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p6, 0))
   				EXPLODE_SMALL (p6)
			ENDIF
			EXPLODE_LARGE (154.5, 128.5, 6.0)
			EXPLODE_LARGE (160.5, 128.5, 6.0)
			EXPLODE_LARGE (155.5, 131.5, 6.0)
			EXPLODE_LARGE (159.5, 131.5, 6.0)
			EXPLODE_LARGE (153.5, 133.5, 6.0)
			EXPLODE_LARGE (161.5, 133.5, 6.0)
			EXPLODE_LARGE (153.5, 137.5, 6.0)
			EXPLODE_LARGE (161.5, 137.5, 6.0)
   			SET p3_explode = 0
		ENDIF
	ENDIF
ENDIF

IF (CHECK_CHARACTER_HEALTH(p4, 0))
	IF ((LOCATE_CHARACTER_ANY_MEANS ( p4 , 157.5, 133.5, 2.0 , 0.8 , 0.8 ))AND(col_explode = 0))
		SET tmr_explode = 0
 		SET p4_explode = 1
		DELETE_ITEM ( obj_explode )
		soun = CREATE_SOUND (157.5, 133.5, 5.0) SCREAM PLAY_INSTANT END
	ENDIF
	IF ( p4_explode = 1 )
		IF ( NOT ( DELAY ( 15 ) ) )
			IF (CHECK_CHARACTER_HEALTH(p1, 0))
  				EXPLODE_SMALL (p1)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p2, 0))
  				EXPLODE_SMALL (p2)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p3, 0))
   				EXPLODE_SMALL (p3)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p5, 0))
   				EXPLODE_SMALL (p5)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p6, 0))
   				EXPLODE_SMALL (p6)
			ENDIF
			EXPLODE_LARGE (154.5, 128.5, 6.0)
			EXPLODE_LARGE (160.5, 128.5, 6.0)
			EXPLODE_LARGE (155.5, 131.5, 6.0)
			EXPLODE_LARGE (159.5, 131.5, 6.0)
			EXPLODE_LARGE (153.5, 133.5, 6.0)
			EXPLODE_LARGE (161.5, 133.5, 6.0)
			EXPLODE_LARGE (153.5, 137.5, 6.0)
			EXPLODE_LARGE (161.5, 137.5, 6.0)
   			SET p4_explode = 0
		ENDIF
	ENDIF
ENDIF

IF (CHECK_CHARACTER_HEALTH(p5, 0))
	IF ((LOCATE_CHARACTER_ANY_MEANS ( p5 , 157.5, 133.5, 2.0 , 0.8 , 0.8 ))AND(col_explode = 0))
		SET tmr_explode = 0
 		SET p5_explode = 1
		DELETE_ITEM ( obj_explode )
		soun = CREATE_SOUND (157.5, 133.5, 5.0) SCREAM PLAY_INSTANT END
	ENDIF
	IF ( p5_explode = 1 )
		IF ( NOT ( DELAY ( 15 ) ) )
			IF (CHECK_CHARACTER_HEALTH(p1, 0))
  				EXPLODE_SMALL (p1)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p2, 0))
  				EXPLODE_SMALL (p2)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p3, 0))
   				EXPLODE_SMALL (p3)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p4, 0))
   				EXPLODE_SMALL (p4)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p6, 0))
   				EXPLODE_SMALL (p6)
			ENDIF
			EXPLODE_LARGE (154.5, 128.5, 6.0)
			EXPLODE_LARGE (160.5, 128.5, 6.0)
			EXPLODE_LARGE (155.5, 131.5, 6.0)
			EXPLODE_LARGE (159.5, 131.5, 6.0)
			EXPLODE_LARGE (153.5, 133.5, 6.0)
			EXPLODE_LARGE (161.5, 133.5, 6.0)
			EXPLODE_LARGE (153.5, 137.5, 6.0)
			EXPLODE_LARGE (161.5, 137.5, 6.0)
   			SET p5_explode = 0
		ENDIF
	ENDIF
ENDIF

IF (CHECK_CHARACTER_HEALTH(p6, 0))
	IF ((LOCATE_CHARACTER_ANY_MEANS ( p6 , 157.5, 133.5, 2.0 , 0.8 , 0.8 ))AND(col_explode = 0))
		SET tmr_explode = 0
 		SET p6_explode = 1
		DELETE_ITEM ( obj_explode )
		soun = CREATE_SOUND (157.5, 133.5, 5.0) SCREAM PLAY_INSTANT END
	ENDIF
	IF ( p6_explode = 1 )
		IF ( NOT ( DELAY ( 15 ) ) )
			IF (CHECK_CHARACTER_HEALTH(p1, 0))
  				EXPLODE_SMALL (p1)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p2, 0))
  				EXPLODE_SMALL (p2)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p3, 0))
   				EXPLODE_SMALL (p3)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p4, 0))
   				EXPLODE_SMALL (p4)
			ENDIF
			IF (CHECK_CHARACTER_HEALTH(p5, 0))
   				EXPLODE_SMALL (p5)
			ENDIF
			EXPLODE_LARGE (154.5, 128.5, 6.0)
			EXPLODE_LARGE (160.5, 128.5, 6.0)
			EXPLODE_LARGE (155.5, 131.5, 6.0)
			EXPLODE_LARGE (159.5, 131.5, 6.0)
			EXPLODE_LARGE (153.5, 133.5, 6.0)
			EXPLODE_LARGE (161.5, 133.5, 6.0)
			EXPLODE_LARGE (153.5, 137.5, 6.0)
			EXPLODE_LARGE (161.5, 137.5, 6.0)
   			SET p6_explode = 0
		ENDIF
	ENDIF
ENDIF

IF (tmr_explode=0)
	SET tmr_explode = (res_explode + 0)
	SET col_explode = 1
	DELETE_ITEM ( obj_explode )
	obj_explode = CREATE_OBJ ( 157.5, 133.5 , 2.0 ) 0 RUBBISH END
	DELETE_ITEM ( obj_explode )
ENDIF
IF (tmr_explode>1)
	SET tmr_explode = ( tmr_explode - 1 )
ENDIF
IF (tmr_explode=1)
	SET col_explode = 0
	SET tmr_explode = -1
	obj_explode = CREATE_OBJ ( 157.5, 133.5 , 2.0 ) 0 KILL_FRENZY END
ENDIF
ENDWHILE
LEVELEND
