
/* HARBOUR - Game name "WATERFRONT" */



/* ------------------- SETUP INFO ------------------*/

PLAY_TIME 4800

SKIP_MINI_GAMES


// Arena
LANDSCAPE harbourmesh.obe 0 0 0
	ACTOR_DONT_STATIC_LIGHT
	ACTOR_DONT_FOG

// Periphery
BACKGROUND harbourperiph.obe 0 0 0
	ACTOR_DONT_LIGHT

// Sky
PLATFORM_BACKGROUND harb_sky.obe 0 -400 0
	ACTOR_DONT_LIGHT
	ACTOR_DONT_FOG

RESPAWN_POINT -100 600 700
RESPAWN_POINT 700 600 100
RESPAWN_POINT -300 600 100
RESPAWN_POINT 500 600 700

/* ------------------ CAMERA  ------------------*/


CAMERA_ROT -0.45
CAMERA_ORIGIN 0 0 7000


INTRO_CAM     harbour1.lom
INTRO_CAM_LOW_DETAIL
INTRO_CAM     harbour2.lom
INTRO_CAM     harbour3.lom
INTRO_CAM     harbour4.lom
INTRO_CAM     harbour5.lom


WINNER_CAM
//Camera pos
		1190	910	-1740

//Winners
		1030	600	-1040
		730	600	-1080
		1160	600	-930
		850	600	-950

//Losers
		840	600	-680
		1130	600	-660
		680	600	-830


/***** PUT RAIN BACK LATER

RAIN 8192 3000 0 200 3000 3000
*******/



/* -------------------- FOG --------------------*/

// Dark
FOG 1000 30000	50 50 30


/*---------------- SCENE LIGHTING --------------*/


AMBIENTLIGHT 140 140 120	

DIRECTIONAL_LIGHT 250 220 210  -0.4 3


//                    	xRot    yRot   zRot
SHADOW  DIRECTIONAL     1      0     0 


/* -------------- SFX ---------------------*/



#define SFX_AMB_LAPPING 2
#define SFX_AMB_GULLS_3 5
#define SFX_AMB_HIGH_HORN 6
#define SFX_AMB_LOW_HORN 7
#define SFX_AMB_LIGHTNING_2 9
#define SFX_AMB_RAIN 11
#define SFX_CHAIN_REEL_1 14
#define SFX_FISH_LAND_1 17
#define SFX_FISH_LAND_2 18
#define SFX_CRANE_REEL_2 19
#define SFX_CRANE_REEL_3 21
#define SFX_CRANE_ARM_2 23
#define SFX_CRANE_ARM_3 24
#define SFX_CRANE_DROPS_CRATE 25
#define SFX_CRATES_LAND 26
#define SFX_CRATE_SMASH_1 12
#define SFX_CRATE_SMASH_2 13
#define SFX_WAREHOUSE_OPEN 27
#define SFX_WAREHOUSE_SHUT 28
#define SFX_ROBOT_STEP 29
#define SFX_ROBOT_GEARS_1 30
#define SFX_ROBOT_GEARS_2 31
#define SFX_ROBOT_PIPE_CHINK 32
#define SFX_GRATES_SLIDE_BACK 33
#define SFX_GATES_SWING_OPEN 34
#define SFX_BOAT_DOCKS_MOVING 36
#define SFX_BOAT_DOCKS_THUD 37
#define SFX_FISH_WARNING 38

SAMPLE harbour_01b.wav SFX_AMB_LAPPING
SAMPLE harbour_01e.wav SFX_AMB_GULLS_3
SAMPLE harbour_01f.wav SFX_AMB_HIGH_HORN
SAMPLE harbour_01g.wav SFX_AMB_LOW_HORN
SAMPLE harbour_01i.wav SFX_AMB_LIGHTNING_2
SAMPLE harbour_01k.wav SFX_AMB_RAIN
SAMPLE harbour_06a.wav SFX_CHAIN_REEL_1
SAMPLE harbour_08a.wav SFX_FISH_LAND_1
SAMPLE harbour_08b.wav SFX_FISH_LAND_2 
SAMPLE harbour_09b.wav SFX_CRANE_REEL_2 
SAMPLE harbour_09c.wav SFX_CRANE_REEL_3 
SAMPLE harbour_10b.wav SFX_CRANE_ARM_2 
SAMPLE harbour_10c.wav SFX_CRANE_ARM_3 
SAMPLE harbour_11a.wav SFX_CRANE_DROPS_CRATE 
SAMPLE harbour_12a.wav SFX_CRATES_LAND
SAMPLE harbour_03a.wav SFX_CRATE_SMASH_1
SAMPLE harbour_03c.wav SFX_CRATE_SMASH_2 
SAMPLE harbour_13a.wav SFX_WAREHOUSE_OPEN 
SAMPLE harbour_13b.wav SFX_WAREHOUSE_SHUT 
SAMPLE harbour_14a.wav SFX_ROBOT_STEP 
SAMPLE harbour_15a.wav SFX_ROBOT_GEARS_1 
SAMPLE harbour_15b.wav SFX_ROBOT_GEARS_2 
SAMPLE harbour_16a.wav SFX_ROBOT_PIPE_CHINK 
SAMPLE harbour_17b.wav SFX_GRATES_SLIDE_BACK 
SAMPLE harbour_18a.wav SFX_GATES_SWING_OPEN 
SAMPLE harbour_19a.wav SFX_BOAT_DOCKS_MOVING 
SAMPLE harbour_22a.wav SFX_BOAT_DOCKS_THUD 
SAMPLE hazard.wav SFX_FISH_WARNING



#define TEMP_VOL 255
#define CHAIN_VOL 150
#define AMB_VOL 127
#define FISH_VOL 190
#define ROBOT_VOL 150

PUZZLE START_OF_FIRST_HALF
	//ACTION PLAY_SAMPLE SFX_AMB_RAIN 	150 0 		0
	ACTION PLAY_SAMPLE SFX_AMB_LAPPING 	AMB_VOL 0	0
	ACTION PLAY_SAMPLE SFX_AMB_LIGHTNING_2 	TEMP_VOL 0 	0
	

PUZZLE REPEAT
	ACTION PLAY_SAMPLE SFX_AMB_GULLS_3 	AMB_VOL 0	180
	ACTION PLAY_SAMPLE SFX_AMB_LIGHTNING_2 	TEMP_VOL 0 	360
	ACTION PLAY_SAMPLE SFX_AMB_HIGH_HORN 	AMB_VOL 0	1100
	ACTION PLAY_SAMPLE SFX_AMB_LIGHTNING_2 	AMB_VOL 0 	1200
	ACTION PLAY_SAMPLE SFX_AMB_GULLS_3 	AMB_VOL 0	1800
	ACTION PLAY_SAMPLE SFX_AMB_HIGH_HORN 	AMB_VOL 0	2300




/* ------------------------------- GAME  -------------------------------*/

/* ------------------------------ GOAL  -----------------------------*/


#define GOAL_EFFECT_1 1
#define GOAL_EFFECT_2 2

PLATFORM goalbase.obe 900 620 -900
	TEXTURE_ANIM  activegoalanim.gif  1
	GOAL 
	ACTOR_DONT_LIGHT


PLATFORM goalbase.obe -900 820 -500
	TEXTURE_ANIM  activegoalanim.gif  1
	GOAL 
	ACTOR_DONT_LIGHT


PLATFORM_BACKGROUND goaleffect.obe  900 580 -900
	TAG GOAL_EFFECT_1
	TEXTURE_ANIM  goalsign_anim.gif  1
	ACTOR_DONT_LIGHT

PLATFORM_BACKGROUND goaleffect.obe  -900 780 -500
	TAG GOAL_EFFECT_2
	TEXTURE_ANIM  goalsign_anim.gif  1
	ACTOR_DONT_LIGHT
	

PUZZLE START_OF_FIRST_HALF
	ACTION ANIMATE_PLATFORM GOAL_EFFECT_1	active 1  0  0.5  0.1  0
	ACTION ANIMATE_PLATFORM GOAL_EFFECT_2	active 1  0  0.5  0.1  0
	ACTION SET_TEXTURE_ANIM_SPEED  GOAL_EFFECT_1  		1  0  0
	ACTION SET_TEXTURE_ANIM_SPEED  GOAL_EFFECT_2  		1  0  0


/* ----------------------------- BUTTON ----------------------------*/

#define FISH_BUTTON 400
#define FISH_HURT_RIGHT 401
#define FISH_HURT_LEFT 402
#define FISH_HURT_RIGHT_2 403
#define FISH_HURT_LEFT_2 404


PLATFORM brb.obe -400 600 -800
	BIGREDBUTTON AUTOMATIC 125 3.2 0
	TAG FISH_BUTTON
	ACTOR_DONT_STATIC_LIGHT

// Only activate button after 5 seconds

PUZZLE AFTER_TIME 1
	NUMTIMES 1
	ACTION ACTIVATE_BRB FISH_BUTTON 1 300
	ACTION SPRITE_ONOFF SPRITE_BUTTON 1 300



// Invisible hurty boxes fall on goals as fish fall
// Platforms with _2 extension fall slightly later than the first ones.

PLATFORM fish_hurt_box_coll.obe 900 2500 -900
	TAG FISH_HURT_RIGHT
	BEHAVIOUR LOOP
	SPEED 0
	MOVEKEY 900 2500 -900 0
	MOVEKEY 900 600 -900 30
	MOVEKEY 900 600 -900 70

PLATFORM fish_hurt_box_coll.obe 900 2500 -900
	TAG FISH_HURT_RIGHT_2
	BEHAVIOUR LOOP
	SPEED 0
	MOVEKEY 900 2500 -900 0
	MOVEKEY 900 600 -900 30
	MOVEKEY 900 600 -900 70



PLATFORM fish_hurt_box_coll.obe -1000 2500 -500
	TAG FISH_HURT_LEFT
	BEHAVIOUR LOOP
	SPEED 0
	MOVEKEY -1000 2500 -500 0
	MOVEKEY -1000 800 -500 30
	MOVEKEY -1000 800 -500 70

PLATFORM fish_hurt_box_coll.obe -1000 2500 -500
	TAG FISH_HURT_LEFT_2
	BEHAVIOUR LOOP
	SPEED 0
	MOVEKEY -1000 2500 -500 0
	MOVEKEY -1000 800 -500 30
	MOVEKEY -1000 800 -500 70




// Drop fish when pressed and re-activate after 10 seconds.

PUZZLE BRB_JUST_DOWN FISH_BUTTON 0
	ACTION PLAY_SAMPLE SFX_FISH_WARNING TEMP_VOL 0 0
	
	// Hurty box falls to simulate effect of deadly fish
	ACTION MAKE_KO FISH_HURT_RIGHT 1 0
	ACTION MAKE_KO FISH_HURT_RIGHT_2 1 0
	ACTION MAKE_KO FISH_HURT_LEFT 1 0
	ACTION MAKE_KO FISH_HURT_LEFT_2 1 0
	ACTION SET_PLATFORM_SPEED FISH_HURT_RIGHT 1 ONE_CYCLE 20
	ACTION SET_PLATFORM_SPEED FISH_HURT_LEFT 1 ONE_CYCLE 20
	ACTION SET_PLATFORM_SPEED FISH_HURT_RIGHT_2 1 ONE_CYCLE 50
	ACTION SET_PLATFORM_SPEED FISH_HURT_LEFT_2 1 ONE_CYCLE 50
	
	// Fish
	ACTION DROP_FISH 900 2500 -900 10 20
	ACTION DROP_FISH 900 2500 -900 7 40
	ACTION DROP_FISH 900 2500 -900 5 60
	ACTION DROP_FISH -900 2500 -500 10 20
	ACTION DROP_FISH -900 2500 -500 7 40
	ACTION DROP_FISH -900 2500 -500 5 60
//	ACTION PLAY_SAMPLE SFX_FISH_LAND_2 FISH_VOL 0 50
	ACTION PLAY_SAMPLE SFX_FISH_LAND_1 FISH_VOL 0 50
	ACTION PLAY_SAMPLE SFX_FISH_LAND_1 FISH_VOL 0 55
	ACTION PLAY_SAMPLE SFX_FISH_LAND_1 FISH_VOL 0 58
	ACTION PLAY_SAMPLE SFX_FISH_LAND_1 FISH_VOL 0 63
	ACTION PLAY_SAMPLE SFX_FISH_LAND_1 FISH_VOL 0 70
	
	// Button
	ACTION ACTIVATE_BRB FISH_BUTTON 0 0
	ACTION SPRITE_ONOFF SPRITE_BUTTON 0 0
	ACTION ACTIVATE_BRB FISH_BUTTON 1 600
	ACTION SPRITE_ONOFF SPRITE_BUTTON 1 600
	
	

/* ------------------------ CRATES AND CRANES --------------------------*/


 //Crates dropped by crane

// The third set of crates begins in position


  #define CRATE_1_1 501
  #define CRATE_1_2 502
  #define CRATE_1_3 503
  #define CRATE_1_4 504

  #define CRATE_3_1 509
  #define CRATE_3_2 510
  #define CRATE_3_3 511
  #define CRATE_3_4 512


  #define CRATE_4_1 513
  #define CRATE_4_2 514
  #define CRATE_4_3 515
  #define CRATE_4_4 516


#define CRANE 			80
#define BLINK_CRANE 		85
#define SPRITE_BLINK_CRANE 	86
#define CRANE_LIGHT 		87
#define SPRITE_CRANE_LIGHT 	88


#define CRANE_ANIMSPEED 0.7
#define CRATES_BELOW_CRANE -275
  
  // Variable to count animations
#define CRANE_COUNTER 81


// Main crane object
PLATFORM_BACKGROUND crane.obe -1435 2156 604
	TAG CRANE
	ACTOR_DONT_LIGHT


// Blinking light on top of lifting arm
PLATFORM_BACKGROUND blinker.obe 0 0 0
	TAG BLINK_CRANE
	ACTOR_DONT_LIGHT

// Sprite over light
CAMERA_ALIGNED_SPRITE 0 0 0	150 150 ai_light_glow_4.bmp 100 20 10    90 50   1
	TAG SPRITE_BLINK_CRANE


// Spot light attached to underside of crane
PLATFORM_BACKGROUND crane_light.obe -1327 1693 887
	TAG CRANE_LIGHT
	ACTOR_DONT_LIGHT

// Sprite for spot light
CAMERA_ALIGNED_SPRITE 0 0 0	400 400 ai_light_glow_2.bmp 127 90 30    90 150   1
	TAG SPRITE_CRANE_LIGHT



// Set up crane ------------------------------------

PUZZLE START_OF_FIRST_HALF
	ACTION ATTACH_PLATFORM_TO_NODE 	BLINK_CRANE 		CRANE 	harb_crane1 1073 -230 -12 0
	ACTION ATTACH_SPRITE_TO_NODE 	SPRITE_BLINK_CRANE 	CRANE 	harb_crane1 1073 -180 -12 0
	ACTION ATTACH_PLATFORM_TO_NODE 	CRANE_LIGHT 		CRANE 	harb_crane1 108 -463 -5 0
	ACTION ATTACH_SPRITE_TO_NODE 	SPRITE_CRANE_LIGHT 	CRANE 	harb_crane1 200 -500 -5 0
	//                              tag   nodename    offset x y z  size  on/off  r  g  b  delay             
	ACTION CREATE_LIGHT_AT_PLATFORM	CRANE harb_crane1 1050 -1000 0   2000    1   127 90 50  0

	
// Collect first set of crates ---------------------

PUZZLE  AFTER_TIME 120
	NUMTIMES 1
	// Graphics
	ACTION ANIMATE_PLATFORM 	 CRANE 2collect 0 0 CRANE_ANIMSPEED 0.1 0
	ACTION SET_PLATFORM_TARGET_ALPHA CRANE_LIGHT 0 10 			0
	ACTION SPRITE_ONOFF 		 SPRITE_CRANE_LIGHT 0 			30
	ACTION ACTIVATE_PLATFORM_LIGHTS  0           				30
	// SFX & var
	ACTION PLAY_SAMPLE 		 SFX_CHAIN_REEL_1 TEMP_VOL 0 		0
	ACTION PLAY_SAMPLE 		 SFX_CRANE_ARM_2 CHAIN_VOL 0 		30
	ACTION SET_VAR 			 CRANE_COUNTER 12 NO_FLAGS 		0
	

// Bring crates forward ----------------------------

PUZZLE  ( ANIM_ENDED CRANE )  &  ( VAR_EQUAL CRANE_COUNTER 12 ) 
	// Actions
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_4_1 CRANE harb_cranegrab 100 CRATES_BELOW_CRANE -100 	0
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_4_2 CRANE harb_cranegrab -100 CRATES_BELOW_CRANE -100 	0
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_4_3 CRANE harb_cranegrab 100 CRATES_BELOW_CRANE 100 	0
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_4_4 CRANE harb_cranegrab -100 CRATES_BELOW_CRANE 100 	0
	ACTION MAKE_HURTY 		 CRATE_4_1 1 				0
	ACTION MAKE_HURTY 		 CRATE_4_2 1 				0
	ACTION MAKE_HURTY 		 CRATE_4_3 1 				0
	ACTION MAKE_HURTY 		 CRATE_4_4 1 				0
	// Graphics
	ACTION ANIMATE_PLATFORM 	 CRANE 3bring 0 0 CRANE_ANIMSPEED 0.1 	60
	ACTION SET_PLATFORM_TARGET_ALPHA CRANE_LIGHT 255 10 			480
	ACTION SPRITE_ONOFF 		 SPRITE_CRANE_LIGHT 1 			500
	ACTION ACTIVATE_PLATFORM_LIGHTS  1           				500
	// SFX & var
	ACTION PLAY_SAMPLE 		 SFX_CHAIN_REEL_1 TEMP_VOL 0 		60
	ACTION PLAY_SAMPLE 		 SFX_CRANE_ARM_2 CHAIN_VOL 0 		240
	ACTION SET_VAR 			 CRANE_COUNTER 13 NO_FLAGS 		60



// Take crates to first position ---------------------

PUZZLE  ( ANIM_ENDED CRANE )  &  ( VAR_EQUAL CRANE_COUNTER 13 ) 
	// Graphics
	ACTION ANIMATE_PLATFORM 	 CRANE movetopos4 0 0 CRANE_ANIMSPEED 0.1 	0
	// SFX & var
	ACTION PLAY_SAMPLE		 SFX_CRANE_ARM_3 CHAIN_VOL 0 			0
	ACTION PLAY_SAMPLE		 SFX_CRANE_REEL_2 CHAIN_VOL 0 			180
	ACTION SET_VAR			 CRANE_COUNTER 14 NO_FLAGS 			0



// Drop crates and bring crane back to start ---------
	
PUZZLE  ( ANIM_ENDED CRANE )  &  ( VAR_EQUAL CRANE_COUNTER 14 ) 
	// Actions
	ACTION DROP_PLATFORM 	CRATE_4_1 	0
	ACTION DROP_PLATFORM 	CRATE_4_2 	0
	ACTION DROP_PLATFORM 	CRATE_4_3 	0
	ACTION DROP_PLATFORM 	CRATE_4_4 	0
	ACTION MAKE_HURTY 	CRATE_4_1 0 	10
	ACTION MAKE_HURTY 	CRATE_4_2 0 	10
	ACTION MAKE_HURTY 	CRATE_4_3 0 	10
	ACTION MAKE_HURTY 	CRATE_4_4 0 	10
	// Graphics
	ACTION ANIMATE_PLATFORM CRANE backfrompos4 0 0 CRANE_ANIMSPEED 0.1 0
	// SFX & var
	ACTION PLAY_SAMPLE 	SFX_CRANE_DROPS_CRATE TEMP_VOL 0 	0
	ACTION PLAY_SAMPLE 	SFX_CRATES_LAND TEMP_VOL 0 		10
	ACTION PLAY_SAMPLE 	SFX_CRANE_REEL_3 CHAIN_VOL 0 		30
	ACTION PLAY_SAMPLE 	SFX_CRANE_ARM_3 CHAIN_VOL 0 		120
	ACTION SET_VAR 		CRANE_COUNTER 15 NO_FLAGS 		0



// Collect second set of crates ------------------------

PUZZLE  ( ANIM_ENDED CRANE )  &  ( VAR_EQUAL CRANE_COUNTER 15 ) 
	// Graphics
	ACTION ANIMATE_PLATFORM		 CRANE 2collect 0 0 CRANE_ANIMSPEED 0.1 0
	ACTION SET_PLATFORM_TARGET_ALPHA CRANE_LIGHT 0 10 			0
	ACTION SPRITE_ONOFF		 SPRITE_CRANE_LIGHT 0 			30
	ACTION ACTIVATE_PLATFORM_LIGHTS  0           				30
	// SFX & var
	ACTION PLAY_SAMPLE		 SFX_CHAIN_REEL_1 TEMP_VOL 0 		0
	ACTION PLAY_SAMPLE		 SFX_CRANE_ARM_2 CHAIN_VOL 0 		30
	ACTION SET_VAR			 CRANE_COUNTER 16 NO_FLAGS 		0


// Bring crates forward ----------------------------

PUZZLE  ( ANIM_ENDED CRANE )  &  ( VAR_EQUAL CRANE_COUNTER 16 ) 
	// Actions
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_1_1 CRANE harb_cranegrab 100 CRATES_BELOW_CRANE -100 	0
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_1_2 CRANE harb_cranegrab -100 CRATES_BELOW_CRANE -100	0
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_1_3 CRANE harb_cranegrab 100 CRATES_BELOW_CRANE 100 	0
	ACTION ATTACH_PLATFORM_TO_NODE 	 CRATE_1_4 CRANE harb_cranegrab -100 CRATES_BELOW_CRANE 100 	0
	ACTION MAKE_HURTY		 CRATE_1_1 1 0
	ACTION MAKE_HURTY		 CRATE_1_2 1 0
	ACTION MAKE_HURTY		 CRATE_1_3 1 0
	ACTION MAKE_HURTY		 CRATE_1_4 1 0
	// Graphics
	ACTION ANIMATE_PLATFORM		 CRANE 3bring 0 0 CRANE_ANIMSPEED 0.1 	60
	ACTION SET_PLATFORM_TARGET_ALPHA CRANE_LIGHT 255 10 			480
	ACTION SPRITE_ONOFF		 SPRITE_CRANE_LIGHT 1 			500
	ACTION ACTIVATE_PLATFORM_LIGHTS  1           				500
	// SFX & var
	ACTION PLAY_SAMPLE		 SFX_CHAIN_REEL_1 TEMP_VOL 0 		60
	ACTION PLAY_SAMPLE		 SFX_CRANE_ARM_2 CHAIN_VOL 0 		240
	ACTION SET_VAR			 CRANE_COUNTER 17 NO_FLAGS 		60


// Take crates to second position ---------------------

PUZZLE  ( ANIM_ENDED CRANE )  &  ( VAR_EQUAL CRANE_COUNTER 17 )
	// Graphics 
	ACTION ANIMATE_PLATFORM 	 CRANE movetopos1 0 0 CRANE_ANIMSPEED 0.1 0
	// SFX & var
	ACTION PLAY_SAMPLE		 SFX_CRANE_ARM_3 CHAIN_VOL 0 	0
	ACTION PLAY_SAMPLE		 SFX_CRANE_REEL_2 CHAIN_VOL 0 	180
	ACTION SET_VAR			 CRANE_COUNTER 18 NO_FLAGS 	0



// Drop crates and bring crane back to start ---------
	
PUZZLE  ( ANIM_ENDED CRANE )  &  ( VAR_EQUAL CRANE_COUNTER 18 ) 
	// Actions
	ACTION DROP_PLATFORM 	CRATE_1_1 	0
	ACTION DROP_PLATFORM 	CRATE_1_2 	0
	ACTION DROP_PLATFORM 	CRATE_1_3 	0
	ACTION DROP_PLATFORM 	CRATE_1_4 	0
	ACTION MAKE_HURTY 	CRATE_1_1 0 	10
	ACTION MAKE_HURTY 	CRATE_1_2 0 	10
	ACTION MAKE_HURTY 	CRATE_1_3 0 	10
	ACTION MAKE_HURTY 	CRATE_1_4 0 	10
	// Graphics
	ACTION ANIMATE_PLATFORM CRANE backfrompos1 0 0 CRANE_ANIMSPEED 0.1 0
	// SFX & var
	ACTION PLAY_SAMPLE 	SFX_CRANE_DROPS_CRATE TEMP_VOL 0 0
	ACTION PLAY_SAMPLE 	SFX_CRATES_LAND TEMP_VOL 0 	10
	ACTION PLAY_SAMPLE 	SFX_CRANE_REEL_2 CHAIN_VOL 0 	30
	ACTION PLAY_SAMPLE 	SFX_CRANE_ARM_3 CHAIN_VOL 0 	120
	ACTION SET_VAR 		CRANE_COUNTER 19 NO_FLAGS 	0




/* ------------------------- WATER ----------------------------*/

#define EDGE_RIP_1 50
#define EDGE_RIP_2 51
#define BOAT_RIP_1 56
#define BOAT_RIP_2 57
#define BOAT_RIP_3 58
#define BOAT_RIP_4 59
#define BOAT_RIP_5 60
#define BOAT_RIP_6 61
#define BOAT_RIP_7 62

#define BOAT_RIP_DOCKED_1 69

#define START_EDGE_RIPS 70
#define START_EDGE_RIPS_2 71
#define BOAT_DOCKED_RIPPLES 72


#define EDGE_RIP_STRENGTH 15
#define BOAT_RIP_STRENGTH 20



WATER -2000 280 -3000 50 50 4300 4300  150
	//Water effect    dropsPerFrame     strengthOf Drops
	AGITATE        		6		0.2
	
	// Static ripples 
	// 		x1	z1	x2	z2    strength rate tag
	RIPPLE_EMITTER -1800 -700	-600 -700	EDGE_RIP_STRENGTH  	0  EDGE_RIP_1 NOFLAGS
	RIPPLE_EMITTER -200 -500	600 -500	EDGE_RIP_STRENGTH  	0  EDGE_RIP_2 NOFLAGS
	RIPPLE_EMITTER 700 -600		700 -1000	EDGE_RIP_STRENGTH  	0  EDGE_RIP_1 NOFLAGS
	RIPPLE_EMITTER 700 -1100	1100 -1100	EDGE_RIP_STRENGTH  	0  EDGE_RIP_1 NOFLAGS
	RIPPLE_EMITTER 1100 -1000	1100 -400	10  			0  EDGE_RIP_1 NOFLAGS
	RIPPLE_EMITTER 1200 -300	2100 -300	7			0  EDGE_RIP_1 NOFLAGS
                     // X    Z    duration    randtime    strength   size
        // Around edge
	STATIC_RIPPLE  -400 -800    240     	30           30        50	
	// Around crane	
	STATIC_RIPPLE  -1084 -1436  220     	30           50        80	
	// Around cabin
	STATIC_RIPPLE  1590 -780      200     	30           40        60		
	
	// Wake around boat 
	RIPPLE_EMITTER -100 -2200	-100 -3700	BOAT_RIP_STRENGTH  0  BOAT_RIP_1 NOFLAGS
	RIPPLE_EMITTER  500 -2200	 500 -3700	BOAT_RIP_STRENGTH  0  BOAT_RIP_1 NOFLAGS
	RIPPLE_EMITTER -100 -1800	-100 -3300	BOAT_RIP_STRENGTH  0  BOAT_RIP_2 NOFLAGS
	RIPPLE_EMITTER  500 -1800	 500 -3300	BOAT_RIP_STRENGTH  0  BOAT_RIP_2 NOFLAGS
	RIPPLE_EMITTER -100 -1400	-100 -2900	BOAT_RIP_STRENGTH  0  BOAT_RIP_3 NOFLAGS
	RIPPLE_EMITTER  500 -1400	 500 -2900	BOAT_RIP_STRENGTH  0  BOAT_RIP_3 NOFLAGS
	RIPPLE_EMITTER -100 -1000 	-100 -2500	BOAT_RIP_STRENGTH  0  BOAT_RIP_4 NOFLAGS
	RIPPLE_EMITTER  500 -1000	 500 -2500	BOAT_RIP_STRENGTH  0  BOAT_RIP_4 NOFLAGS
	RIPPLE_EMITTER -100 -600	-100 -2100	BOAT_RIP_STRENGTH  0  BOAT_RIP_5 NOFLAGS
	RIPPLE_EMITTER  500 -600	 500 -2100	BOAT_RIP_STRENGTH  0  BOAT_RIP_5 NOFLAGS
	RIPPLE_EMITTER -100 -200	-100 -1700	BOAT_RIP_STRENGTH  0  BOAT_RIP_6 NOFLAGS
	RIPPLE_EMITTER  500 -200	 500 -1700	BOAT_RIP_STRENGTH  0  BOAT_RIP_6 NOFLAGS
	RIPPLE_EMITTER -100  800	-100 -1300	BOAT_RIP_STRENGTH  0  BOAT_RIP_7 NOFLAGS
	RIPPLE_EMITTER  500  800	 500 -1300	BOAT_RIP_STRENGTH  0  BOAT_RIP_7 NOFLAGS
	
	// Around boat while docked
	RIPPLE_EMITTER -100 -900	-100 -1330 	20  0  BOAT_RIP_DOCKED_1 NOFLAGS
	RIPPLE_EMITTER -100 -1330	50 -1590 	20  0  BOAT_RIP_DOCKED_1 NOFLAGS
	RIPPLE_EMITTER 50 -1590		360 -1590 	20  0  BOAT_RIP_DOCKED_1 NOFLAGS
	RIPPLE_EMITTER 360 -1590	510 -1330 	20  0  BOAT_RIP_DOCKED_1 NOFLAGS
	RIPPLE_EMITTER 510 -1330	200 -850 	20  0  BOAT_RIP_DOCKED_1 NOFLAGS
	

WATER_COLOUR 8 35 20

PUZZLE START_OF_FIRST_HALF 
	ACTION SET_VAR START_EDGE_RIPS 1 NO_FLAGS 0
	ACTION SET_VAR START_EDGE_RIPS_2 1 NO_FLAGS 0


PUZZLE ( VAR_EQUAL START_EDGE_RIPS 1 ) & ( REPEAT )
	ACTION SET_EMITTER_RATE EDGE_RIP_1 10 60


PUZZLE ( VAR_EQUAL START_EDGE_RIPS_2 1 ) & ( REPEAT )	
	ACTION SET_EMITTER_RATE EDGE_RIP_2 40 65



	
/* ----------------------- BOAT AND GATES ----------------------- */

#define BOAT 100
#define BOAT_DOCKS 480 	

#define RIGHT_GATE 101
#define LEFT_GATE 102
#define RIGHT_GRATE 103
#define LEFT_GRATE 104
#define RIGHT_SWINGER 105
#define LEFT_SWINGER 106

#define BLINK_BOAT_1 107
#define BLINK_BOAT_2 108
#define SPRITE_BOAT_1 109
#define SPRITE_BOAT_2 110


// Boat object
PLATFORM boat.obe 200 700 -3000
	TAG BOAT
	BEHAVIOUR STOP
	SPEED 0
	MOVEKEY 200 700 -3000 0 
	MOVEKEY 200 700 200 BOAT_DOCKS 
	ACTOR_DONT_STATIC_LIGHT


// Small lights on top of boat antennae and their sprites

PLATFORM_BACKGROUND blinker.obe 0 0 0
	TAG BLINK_BOAT_1
	ACTOR_DONT_LIGHT

PLATFORM_BACKGROUND blinker.obe 0 0 0
	TAG BLINK_BOAT_2
	ACTOR_DONT_LIGHT

CAMERA_ALIGNED_SPRITE 0 0 0	90 90 ai_light_glow_2.bmp 127 40 30    90 10   1
	TAG SPRITE_BOAT_1

CAMERA_ALIGNED_SPRITE 0 0 0	90 90 ai_light_glow_2.bmp 127 40 30    90 10   1
	TAG SPRITE_BOAT_2


// Smoke coming out of pipe

#define BOAT_SMOKE 1

NEW_VENT BLEND_SMOKE_BIG 100 100 70 BOAT_SMOKE  0  0.2
	VENT_POS 195 773 -4783	 	7 40
	VENT_PATTERN 0 10
	VENT_VEL 0 3 0 		1 8
	VENT_PLATFORM BOAT




// Set up boat ------------------------------------

PUZZLE START_OF_FIRST_HALF
	ACTION ATTACH_PLATFORM_TO_NODE BLINK_BOAT_1 BOAT boat_mast 0 467 -3
	ACTION ATTACH_PLATFORM_TO_NODE BLINK_BOAT_2 BOAT boat_mast 28 287 16
	ACTION ATTACH_SPRITE_TO_NODE SPRITE_BOAT_1 BOAT boat_mast 0 517 -3 0
	ACTION ATTACH_SPRITE_TO_NODE SPRITE_BOAT_2 BOAT boat_mast 28 337 16 0
	ACTION SET_PLATFORM_ALPHA BLINK_BOAT_1 150 0
	ACTION SET_PLATFORM_ALPHA BLINK_BOAT_2 150 0


// Gate objects -----------------------------------

PLATFORM dock_right.obe 700 600 -500
	TAG RIGHT_GATE
	BEHAVIOUR STOP
	SPEED 0
	ROTATEKEY 0 0 0 0 
	ROTATEKEY 0 0 0 180 
	ROTATEKEY 0 90 0 360 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM dock_left.obe -300 600 -500
	TAG LEFT_GATE
	BEHAVIOUR STOP
	SPEED 0
	ROTATEKEY 0 0 0 0 
	ROTATEKEY 0 0 0 180 
	ROTATEKEY 0 -90 0 360 
	ACTOR_DONT_STATIC_LIGHT


// Platforms over water open as boat arrives

PLATFORM grate_right.obe 500 550 -200
	TAG RIGHT_GRATE 
	MOVEKEY 500 550 -200 0
	MOVEKEY 1100 550 -200 180
	BEHAVIOUR STOP
	SPEED 0
	ACTOR_DONT_STATIC_LIGHT

PLATFORM grate_left.obe -100 550 -200
	TAG LEFT_GRATE 
	MOVEKEY -100 550 -200 0
	MOVEKEY -700 550 -200 180
	BEHAVIOUR STOP
	SPEED 0
	ACTOR_DONT_STATIC_LIGHT

PLATFORM swinger_right.obe 200 550 600
	TAG RIGHT_SWINGER
	ROTATEKEY 0 0 0 0
	ROTATEKEY 0 0 0 180
	ROTATEKEY 0 -80 0 360
	BEHAVIOUR STOP
	SPEED 0
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM swinger_left.obe 200 550 600
	TAG LEFT_SWINGER
	ROTATEKEY 0 0 0 0
	ROTATEKEY 0 0 0 180
	ROTATEKEY 0 80 0 360
	BEHAVIOUR STOP
	SPEED 0
	ACTOR_DONT_STATIC_LIGHT


// Bring boat in --------------------------------------

PUZZLE AFTER_TIME 1980
	NUMTIMES 1
	ACTION SET_PLATFORM_SPEED BOAT 		1 NO_FLAGS 0
	ACTION SET_PLATFORM_SPEED RIGHT_GATE 	1 NO_FLAGS 0
	ACTION SET_PLATFORM_SPEED LEFT_GATE	1 NO_FLAGS 0
	ACTION SET_PLATFORM_SPEED RIGHT_GRATE 	1 NO_FLAGS 0
	ACTION SET_PLATFORM_SPEED LEFT_GRATE 	1 NO_FLAGS 0
	ACTION SET_PLATFORM_SPEED RIGHT_SWINGER 1 NO_FLAGS 0
	ACTION SET_PLATFORM_SPEED LEFT_SWINGER 	1 NO_FLAGS 0
	ACTION PLAY_SAMPLE SFX_GRATES_SLIDE_BACK TEMP_VOL 0 0
	ACTION PLAY_SAMPLE SFX_GRATES_SLIDE_BACK TEMP_VOL 0 180
	ACTION PLAY_SAMPLE SFX_GATES_SWING_OPEN TEMP_VOL 0 180
	
	// Boat
	ACTION ANIMATE_PLATFORM BOAT sway 1 0 0.3 0.1 0
	ACTION ACTIVATE_VENT BOAT_SMOKE 90
	ACTION PLAY_SAMPLE SFX_AMB_LOW_HORN TEMP_VOL 0 360
	ACTION PLAY_SAMPLE SFX_BOAT_DOCKS_MOVING TEMP_VOL 0 0
	ACTION PLAY_SAMPLE SFX_BOAT_DOCKS_THUD TEMP_VOL 0 480
	
	// Activate crates
	ACTION ACTIVATE_PLATFORM BOAT_CRATE1 0
	ACTION ACTIVATE_PLATFORM BOAT_CRATE2 0
	ACTION ACTIVATE_PLATFORM BOAT_CRATE3 0
	ACTION ACTIVATE_PLATFORM BOAT_CRATE4 0
	ACTION ACTIVATE_PLATFORM BOAT_CRATE5 0
	ACTION ACTIVATE_PLATFORM BOAT_CRATE6 0
	
	// Attach crates to boat 
	ACTION ATTACH_PLATFORM_TO_NODE BOAT_CRATE1 BOAT boat_hull  100 -200 -700 0
	ACTION ATTACH_PLATFORM_TO_NODE BOAT_CRATE2 BOAT boat_hull -100 -200 -700 0
	ACTION ATTACH_PLATFORM_TO_NODE BOAT_CRATE3 BOAT boat_hull  100 -200 -500 0
	ACTION ATTACH_PLATFORM_TO_NODE BOAT_CRATE4 BOAT boat_hull -100 -200 -500 0
	ACTION ATTACH_PLATFORM_TO_NODE BOAT_CRATE5 BOAT boat_hull  100 -200 -300 0
	ACTION ATTACH_PLATFORM_TO_NODE BOAT_CRATE6 BOAT boat_hull -100 -200 -300 0
	
	// Turn off ripple across front of gates
	ACTION SET_VAR START_EDGE_RIPS_2 0 NO_FLAGS 180
	
	
	// Wake behind boat
	ACTION SET_EMITTER_RATE BOAT_RIP_1 20 120
	ACTION SET_EMITTER_RATE BOAT_RIP_2 20 180
	ACTION SET_EMITTER_RATE BOAT_RIP_3 20 240
	ACTION SET_EMITTER_RATE BOAT_RIP_4 20 300
	ACTION SET_EMITTER_RATE BOAT_RIP_5 20 360
	ACTION SET_EMITTER_RATE BOAT_RIP_6 20 420
	ACTION SET_EMITTER_RATE BOAT_RIP_7 20 480
	
	
	// Around boat while docked
	ACTION SET_VAR BOAT_DOCKED_RIPPLES 1 NO_FLAGS 420
	

PUZZLE ( VAR_EQUAL BOAT_DOCKED_RIPPLES 1 ) & ( REPEAT )
	ACTION SET_EMITTER_RATE BOAT_RIP_DOCKED_1 20 60	


/*------------------- ITEMS IN CRATES -----------------*/

// Some crates contain orbs, others have power ups 


    #define GOLDEN PERSONALISED
    #define CRATE_SMASH_VOL 150



PUZZLE PLATFORM_DESTROYED CRATE_3_2
	NUMTIMES 1
	ACTION CREATE_COLLECTABLE SPEEDUP -500 600 500 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_4_3
	NUMTIMES 1
	ACTION CREATE_TILE_GROUP SUPER 22 -1 0
	ACTION DESTROY_TILE_GROUP 22 600
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0


PUZZLE PLATFORM_DESTROYED CRATE_4_4
	NUMTIMES 1
	ACTION CREATE_COLLECTABLE INVINCIBILITY 900 600 900 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_1_4
	NUMTIMES 1
	ACTION CREATE_TILE_GROUP SUPER 25 -1 0
	ACTION DESTROY_TILE_GROUP 25 600
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_1_1
	NUMTIMES 1
	ACTION CREATE_COLLECTABLE SPEEDUP -900 800 -100 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0


// Empty crates ---------------------------------

PUZZLE PLATFORM_DESTROYED CRATE_3_1
	NUMTIMES 1
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_3_4
	NUMTIMES 1
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_3_3
	NUMTIMES 1
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_4_1
	NUMTIMES 1
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_4_2
	NUMTIMES 1
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0


PUZZLE PLATFORM_DESTROYED CRATE_1_2
	NUMTIMES 1
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED CRATE_1_3
	NUMTIMES 1
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0



//Crates on board the boat -------------------------


  #define BOAT_CRATE1 250
  #define BOAT_CRATE2 251
  #define BOAT_CRATE3 252
  #define BOAT_CRATE4 253
  #define BOAT_CRATE5 254
  #define BOAT_CRATE6 255
 

PUZZLE PLATFORM_DESTROYED BOAT_CRATE1
	NUMTIMES 1
	ACTION CREATE_TILE_GROUP GOLDEN 14 -1 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED BOAT_CRATE2
	NUMTIMES 1
	ACTION CREATE_TILE_GROUP SUPER 15 -1 0
	ACTION DESTROY_TILE_GROUP 15 600
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED BOAT_CRATE3
	NUMTIMES 1
	ACTION CREATE_COLLECTABLE SUPER_ATTACK 300 600 -300 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED BOAT_CRATE4
	NUMTIMES 1
	ACTION CREATE_TILE_GROUP GOLDEN 17 -1 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED BOAT_CRATE5
	NUMTIMES 1
	ACTION CREATE_COLLECTABLE SPEEDUP 300 600 -100 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_2 CRATE_SMASH_VOL 0 0

PUZZLE PLATFORM_DESTROYED BOAT_CRATE6
	NUMTIMES 1
	ACTION CREATE_TILE_GROUP GOLDEN 19 -1 0
	ACTION PLAY_SAMPLE SFX_CRATE_SMASH_1 CRATE_SMASH_VOL 0 0




/* -------------  CRATE OBJECTS --------------------*/


#define SMASH_ANIMSPEED 0.4

PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_1_1
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL
	INACTIVE 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_1_2
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	INACTIVE 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_1_3
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	INACTIVE 
	
PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_1_4
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	INACTIVE 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -300 600 500
	TAG CRATE_3_1
	DESTRUCT 
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -500 600 500
	TAG CRATE_3_2
	DESTRUCT 
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -300 600 700
	TAG CRATE_3_3
	DESTRUCT 
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -500 600 700
	TAG CRATE_3_4
	DESTRUCT 
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_4_1
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	INACTIVE 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_4_2
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	INACTIVE 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_4_3
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	INACTIVE 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe -2600 600 1000
	TAG CRATE_4_4
	DESTRUCT MAKES_DUST
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	INACTIVE
	ACTOR_DONT_STATIC_LIGHT

// On board boat ---------------------------------

PLATFORM destructable.obe 300 500 -3700
	TAG 250
	DESTRUCT
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe 100 500 -3700
	TAG 251
	DESTRUCT
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe 300 500 -3500
	TAG 252
	DESTRUCT
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe 100 500 -3500
	TAG 253
	DESTRUCT
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe 300 500 -3300
	TAG 254
	DESTRUCT
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT
	
PLATFORM destructable.obe 100 500 -3300
	TAG 255
	DESTRUCT
	REMAINS destructable_smash.obe  SMASH_ANIMSPEED 
	REMAINS_NOCOLL 
	ACTOR_DONT_STATIC_LIGHT



/*------------------ ORB HANDLING -----------------------*/

// No golden orbs generated in the level in this half as 6 will arrive on the boat.


  #define BOAT_IN 2
  
  
PUZZLE START_OF_FIRST_HALF 
	ACTION SET_TILE_DEAL_DELAY 0 0
	ACTION ACTIVATE_TILE_GROUP 1 0


#define TILE_GENERATION_LOOP 1


// Normal orbs

PUZZLE AFTER_TIME 1 & REPEAT
	ACTION CREATE_RANDOM_TILE_GROUP 1 GOLDEN 1 1 0
	ACTION SET_VAR TILE_GENERATION_LOOP 1 NO_FLAGS 60


PUZZLE AFTER_TIME 1
	NUMTIMES 1
	ACTION CHANGE_HEIGHT_MAP BOAT_DOCKS
	ACTION SET_VAR BOAT_IN 1 NO_FLAGS BOAT_DOCKS

	
PUZZLE VAR_EQUAL BOAT_IN 1
	ACTION ACTIVATE_TILE_GROUP 2 0
	
	
/* ------------------- ORB POSITIONS ---------------------*/

TILE_POSITION -1100 800 100 	25 SUPER
TILE_POSITION 1100 600 900 	22 SUPER
//TILE_POSITION -500 600 700 	23 SUPER
//TILE_POSITION 700 600 300 	21 SUPER
//TILE_POSITION 300 500 -3500 	16 SUPER+MOVEABLE
//TILE_POSITION 100 500 -3700 	15 SUPER+MOVEABLE
//TILE_POSITION 100 500 -3500 	17 SUPER+MOVEABLE
//TILE_POSITION 300 500 -3700 	14 SUPER+MOVEABLE
//TILE_POSITION 300 500 -3300 	18 SUPER+MOVEABLE
//TILE_POSITION 100 500 -3300 	19 SUPER+MOVEABLE
TILE_POSITION 300 500 -500 	14 SUPER
TILE_POSITION 100 500 -500 	15 SUPER
//TILE_POSITION 300 500 -300 	16 SUPER
TILE_POSITION 100 500 -300 	17 SUPER
//TILE_POSITION 300 500 -100 	18 SUPER
TILE_POSITION 100 500 -100 	19 SUPER




TILE_POSITION -700 800 -100	1 GOLDEN
//TILE_POSITION -900 800 -100	1 GOLDEN
//TILE_POSITION -1100 800 -100	1 GOLDEN
TILE_POSITION -700 800 100	1 GOLDEN
//TILE_POSITION -900 800 100	1 GOLDEN
TILE_POSITION -1100 800 100	1 GOLDEN
TILE_POSITION -700 800 300	1 GOLDEN
TILE_POSITION -900 800 300	1 GOLDEN
TILE_POSITION -1100 800 300	1 GOLDEN
TILE_POSITION -700 800 500	1 GOLDEN //p
TILE_POSITION -900 800 500	1 GOLDEN
TILE_POSITION -1100 800 500	1 GOLDEN
TILE_POSITION -700 800 700	1 GOLDEN
TILE_POSITION -900 800 700	1 GOLDEN
TILE_POSITION -1100 800 700	1 GOLDEN
TILE_POSITION -700 800 900	1 GOLDEN
TILE_POSITION -900 800 900	1 GOLDEN
TILE_POSITION -1100 800 900	1 GOLDEN
TILE_POSITION -700 800 1100	1 GOLDEN
TILE_POSITION -900 800 1100	1 GOLDEN
TILE_POSITION -1100 800 1100	1 GOLDEN
TILE_POSITION -500 600 -500	1 GOLDEN //p
TILE_POSITION -500 600 -300	1 GOLDEN
TILE_POSITION -500 600 -100	1 GOLDEN
TILE_POSITION -500 600 100	1 GOLDEN
TILE_POSITION -500 600 300	1 GOLDEN
//TILE_POSITION -500 600 500	1 GOLDEN
//TILE_POSITION -500 600 700	1 GOLDEN
//TILE_POSITION -300 600 100	1 GOLDEN r
TILE_POSITION -300 600 300	1 GOLDEN
//TILE_POSITION -300 600 500	1 GOLDEN
//TILE_POSITION -300 600 700	1 GOLDEN
//TILE_POSITION -100 600 700	1 GOLDEN r
TILE_POSITION 100 600 700	1 GOLDEN
TILE_POSITION 300 600 700	1 GOLDEN
//TILE_POSITION 500 600 700	1 GOLDEN r
//TILE_POSITION 700 600 100	1 GOLDEN r
TILE_POSITION 700 600 300	1 GOLDEN 
TILE_POSITION 700 600 500	1 GOLDEN 
TILE_POSITION 700 600 700	1 GOLDEN
TILE_POSITION 900 600 -500	1 GOLDEN
TILE_POSITION 900 600 -300	1 GOLDEN
TILE_POSITION 900 600 -100	1 GOLDEN
TILE_POSITION 900 600 100	1 GOLDEN
TILE_POSITION 900 600 300	1 GOLDEN
TILE_POSITION 900 600 500	1 GOLDEN
//TILE_POSITION 900 600 700	1 GOLDEN
//TILE_POSITION 900 600 900	1 GOLDEN
TILE_POSITION 900 600 1100	1 GOLDEN
TILE_POSITION 1100 600 -500	1 GOLDEN
TILE_POSITION 1100 600 -300	1 GOLDEN
TILE_POSITION 1100 600 -100	1 GOLDEN
TILE_POSITION 1100 600 100	1 GOLDEN //p
TILE_POSITION 1100 600 300	1 GOLDEN
TILE_POSITION 1100 600 500	1 GOLDEN
//TILE_POSITION 1100 600 700	1 GOLDEN
TILE_POSITION 1100 600 900	1 GOLDEN
TILE_POSITION 1100 600 1100	1 GOLDEN

TILE_POSITION 500 600 -900	2 GOLDEN
TILE_POSITION 500 500 -700	2 GOLDEN
TILE_POSITION 500 500 -500	2 GOLDEN
TILE_POSITION 500 500 -300	2 GOLDEN
TILE_POSITION 500 500 -100	2 GOLDEN
TILE_POSITION 500 500 100	2 GOLDEN
TILE_POSITION 300 600 -1100	2 GOLDEN
TILE_POSITION 300 600 -900	2 GOLDEN
TILE_POSITION 300 500 -700	2 GOLDEN
TILE_POSITION 300 500 100	2 GOLDEN
TILE_POSITION 300 550 300	2 GOLDEN
TILE_POSITION 100 600 -1100	2 GOLDEN
TILE_POSITION 100 600 -900	2 GOLDEN
TILE_POSITION 100 500 -700	2 GOLDEN
TILE_POSITION 100 500 100	2 GOLDEN
TILE_POSITION 100 550 300	2 GOLDEN
TILE_POSITION -100 600 -900	2 GOLDEN
TILE_POSITION -100 500 -700	2 GOLDEN
TILE_POSITION -100 500 -500	2 GOLDEN
TILE_POSITION -100 500 -300	2 GOLDEN
TILE_POSITION -100 500 -100	2 GOLDEN
TILE_POSITION -100 500 100	2 GOLDEN




/* ---------------------- SCENIC OBJECTS -------------------------*/



/* ----------------- WAREHOUSE DOOR ------------------*/



#define WAREHOUSE_DOOR 20
#define WAREHOUSE_DOOR_2 21
#define WALKER_PIPES 22
#define WALKER_PIPELESS 23



#define WALKER_ANIMSPEED 1

PLATFORM_BACKGROUND waredoor.obe 0 0 0 
	TAG WAREHOUSE_DOOR
	MOVEKEY 0 0 0 0
	MOVEKEY 0 0 0 660
	MOVEKEY 1000 0 0 1200
	MOVEKEY 1000 0 0 1460
	MOVEKEY 0 0 0 1800
	MOVEKEY 0 0 0 1800
	BEHAVIOUR STOP
	SPEED 0
	INACTIVE
	ACTOR_DONT_LIGHT


#define ROBOT_HEIGHT 620

PLATFORM_BACKGROUND harbrobotnologs.obe 3500 ROBOT_HEIGHT 1500
	TAG WALKER_PIPELESS
	ROTATEKEY 0 0 0  0
	ROTATEKEY 0 -90 0 1
	MOVEKEY 3500 ROBOT_HEIGHT 1500 0
	MOVEKEY 3500 ROBOT_HEIGHT 1500 300
	MOVEKEY  300 ROBOT_HEIGHT 1500 1080
	MOVEKEY  300 ROBOT_HEIGHT 1500 1260
	ROTATEKEY 0 -90 0 1080
	ROTATEKEY 0 0 0 1260
	MOVEKEY 300 ROBOT_HEIGHT 3300 1740
	MOVEKEY 300 ROBOT_HEIGHT 3300 1800
	BEHAVIOUR STOP
	SPEED 0
	ANIMATE walk 1 0 WALKER_ANIMSPEED 0.1 
	INACTIVE
	ACTOR_DONT_LIGHT


PLATFORM_BACKGROUND waredoor.obe 0 0 0 
	TAG WAREHOUSE_DOOR_2
	MOVEKEY 0 0 0 0
	MOVEKEY 0 0 0 100
	MOVEKEY 1000 0 0 340
	MOVEKEY 1000 0 0 920
	MOVEKEY 0 0 0 1160
	MOVEKEY 0 0 0 1800
	BEHAVIOUR STOP
	SPEED 0
	ACTOR_DONT_LIGHT


PLATFORM_BACKGROUND harbrobot.obe 300 ROBOT_HEIGHT 3300
	TAG WALKER_PIPES
	ROTATEKEY 0 0 0  0
	ROTATEKEY 0 180 0 1
	MOVEKEY 300 ROBOT_HEIGHT 3300 0
	MOVEKEY 300 ROBOT_HEIGHT 3300 300
	MOVEKEY 300 ROBOT_HEIGHT 1500 780
	MOVEKEY 300 ROBOT_HEIGHT 1500 960
	ROTATEKEY 0 180 0 780
	ROTATEKEY 0 90 0 960
	MOVEKEY 3500 ROBOT_HEIGHT 1500 1740
	MOVEKEY 3500 ROBOT_HEIGHT 1500 1800
	BEHAVIOUR STOP
	SPEED 0
	ANIMATE walk 1 0 WALKER_ANIMSPEED 0.1 
	ACTOR_DONT_LIGHT
	

#define STOP_STEPS_LOOP 25

PUZZLE AFTER_TIME 1 
	NUMTIMES 1
	// Walker comes out from warehouse
	ACTION SET_PLATFORM_SPEED WALKER_PIPES 1 ONE_CYCLE 	0
	ACTION SET_PLATFORM_SPEED WAREHOUSE_DOOR_2 1 ONE_CYCLE 	0
	// Walker turns
	ACTION PLAY_SAMPLE SFX_ROBOT_GEARS_1 100 0 		780
	ACTION PLAY_SAMPLE SFX_ROBOT_GEARS_2 100 0 		820
	ACTION PLAY_SAMPLE SFX_ROBOT_GEARS_1 100 0 		860
	// Warehouse door opens/shuts
	ACTION PLAY_SAMPLE SFX_WAREHOUSE_OPEN TEMP_VOL 0 	100
	ACTION PLAY_SAMPLE SFX_WAREHOUSE_SHUT TEMP_VOL 0 	920
	// Walker goes off screen, stop footsteps
	ACTION SET_VAR STOP_STEPS_LOOP 1 NO_FLAGS 		1560
	
	// Swap walkers
	ACTION DEACTIVATE_PLATFORM WALKER_PIPES 		1800
	ACTION ACTIVATE_PLATFORM WALKER_PIPELESS 		1800
	ACTION DEACTIVATE_PLATFORM WAREHOUSE_DOOR_2 		1800
	ACTION ACTIVATE_PLATFORM WAREHOUSE_DOOR 		1800
	
	// Walker enters warehouse
	ACTION SET_PLATFORM_SPEED WALKER_PIPELESS 1 ONE_CYCLE 	1800
	ACTION SET_PLATFORM_SPEED WAREHOUSE_DOOR 1 ONE_CYCLE 	1800
	// Walker turns
	ACTION PLAY_SAMPLE SFX_ROBOT_GEARS_1 ROBOT_VOL 0 	2880
	ACTION PLAY_SAMPLE SFX_ROBOT_GEARS_2 ROBOT_VOL 0 	2920
	ACTION PLAY_SAMPLE SFX_ROBOT_GEARS_1 ROBOT_VOL 0 	2960
	// Warehouse door opens/shuts
	ACTION PLAY_SAMPLE SFX_WAREHOUSE_OPEN TEMP_VOL 0 	2460
	ACTION PLAY_SAMPLE SFX_WAREHOUSE_SHUT TEMP_VOL 0 	3100
	// Walker goes off screen, stop footsteps
	ACTION SET_VAR STOP_STEPS_LOOP 0 NO_FLAGS 		2310
	ACTION SET_VAR STOP_STEPS_LOOP 1 NO_FLAGS 		3800


// Footstep loop
PUZZLE (AFTER_TIME 320) & ( VAR_NOT_EQUAL STOP_STEPS_LOOP 1 ) & (REPEAT)
	ACTION PLAY_SAMPLE SFX_ROBOT_STEP ROBOT_VOL 0 60





/* ----------- Sprites -----------------*/

// Attatched to warehouse door

#define SPRITE_DOOR 10

//			   x  y  z   xSize ySize  texture name      r  g  b  a   distance on/off

CAMERA_ALIGNED_SPRITE 200 1550 1957  	200 150  ai_light_glow_2.bmp 90 90 50 	90  50  1	
	TAG SPRITE_DOOR
//200 1550 1957

PUZZLE START_OF_FIRST_HALF
	ACTION ATTACH_SPRITE_TO_NODE SPRITE_DOOR WAREHOUSE_DOOR_2 har_warehsedoor 40 70 -36 0
	ACTION ATTACH_SPRITE_TO_NODE SPRITE_DOOR WAREHOUSE_DOOR har_warehsedoor 40 70 -36 1500



// Back walls
// right
CAMERA_ALIGNED_SPRITE 1730 1493 1890  	200 150  ai_light_glow_5.bmp 90 90 50 	90  50  1	
// left
CAMERA_ALIGNED_SPRITE -1195 1489 1890  	200 150  ai_light_glow_5.bmp 90 90 50 	90  50  1	


// Rim of docking area, left to right

#define XSIZE 120
#define YSIZE 90
#define SPRITE_RED 60
#define SPRITE_GREEN 80
#define SPRITE_BLUE 100

CAMERA_ALIGNED_SPRITE -1850 580 -800 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE -1350 580 -800 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE -855 580 -800 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE -396 580 -1000 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE -300 580 0 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE 15 580 553 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE 380 580 553 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE 700 580 0 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE 1030 580 -1200 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE 1450 580 -400 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1
CAMERA_ALIGNED_SPRITE 1935 580 -400 	XSIZE YSIZE  ai_light_glow_4.bmp SPRITE_RED SPRITE_GREEN SPRITE_BLUE 	90  30  1


// On portholes

CAMERA_ALIGNED_SPRITE -470 390 -960 	170 170 ai_light_glow_5.bmp 127 100 70	 90  70  1
CAMERA_ALIGNED_SPRITE -340 390 -960 	170 170 ai_light_glow_5.bmp 127 100 70	 90  70  1
CAMERA_ALIGNED_SPRITE  800 390 -1170	170 170 ai_light_glow_5.bmp 127 100 70	 90  70  1
CAMERA_ALIGNED_SPRITE  990 390 -1170	170 170 ai_light_glow_5.bmp 127 100 70	 90  70  1



// On button when active

#define SPRITE_BUTTON 11

CAMERA_ALIGNED_SPRITE -400 620 -800	250 250 ai_light_glow_2.bmp 127 90 30    90 150   0
	TAG SPRITE_BUTTON

