{"marine"
	{on spawn
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center1"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center2"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center3"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center4"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center5"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center6"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center7"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center8"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center9"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_small_center10"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_norm_front1"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_norm_front2"}
		{add_view	"wash_ship_stop"	"on_stead"	"FX_bulb_norm_engine1"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center1"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center2"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center3"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center4"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center5"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center6"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center7"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center8"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center9"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_center10"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_back1"}
		{add_view	"wash_ship_motion"	"on_move"	"FX_bulb_small_back2"}
		{add_view	"wash_front_small"	"on_move"	"FX_bulb_small_front1"}
		{add_view	"wash_front_small"	"on_move"	"FX_bulb_small_front2"}
		{add_view	"wash_front_norm"	"on_move"	"FX_bulb_norm_front1"}
		{add_view	"wash_front_norm"	"on_move"	"FX_bulb_norm_front2"}
		{add_view	"wash_ship_motion_norm"	"on_move"	"FX_bulb_norm_front1"}
		{add_view	"wash_ship_motion_norm"	"on_move"	"FX_bulb_norm_front2"}
		{add_view	"wash_engine_small"	"on_move"	"FX_bulb_small_engine1"}
		{add_view	"wash_engine_norm"	"on_move"	"FX_bulb_norm_engine1"}
		{view start "on_stead"}
		{ani_play "drift" loop}
		{if not sunlight
			{add_view "light_post" "light" "fx_light"}
			{add_view "light_post" "light" "fx_light1"}
			{view start "light"}
			{view show "light"}
		}
	}
	{on move on
		{view start "on_move"}
		{view pause "on_stead"}
	}
	{on move off
		{view start "on_stead"}
		{view pause "on_move"}
	}
	{on pierce
		{component disable work repair}
		{if volume "float"
			{call "break_float"}
		}
	}
	{on blast
		{if min_energy 2
			{component disable work repair}
			{if volume "float"
				{call "break_float"}
			}
		}
	}
	{on "break_float"
		{volume disable float bullet blast}
		{impulse up 0.2}
	}
	{on grounded on
		{ani_stop "drift"}
	}
	{on grounded off
		{ani_play "drift" loop}
	}
	{on "lights_on" overload}
	{on "lights_off" overload}
}

{"platforma"
	{on break
		{if component "body1"
			{spawn "TANK_DIE" "fxdead_1a"}
		}
		{if component "body2"
			{spawn "TANK_DIE" "fxdead_2a"}
		}
		{if component "ballast_l1"
			{spawn "ex_water_extra_big_test" "fxdead_l1a"}
			{spawn "platform_par1" "fxdead_l1a"}
		}
		{if component "ballast_r1"
			{spawn "ex_water_extra_big_test" "fxdead_r1a"}
			{spawn "platform_par1" "fxdead_r1a"}
		}
		{if component "ballast_l2"
			{spawn "ex_water_extra_big_test" "fxdead_l2a"}
			{spawn "platform_par1" "fxdead_l2a"}
		}
		{if component "ballast_r2"
			{spawn "ex_water_extra_big_test" "fxdead_r2a"}
			{spawn "platform_par1" "fxdead_r2a"}
		}
	}
}

{"torpedo_boat marine"
	{on fire "torpedo"
		{if not "torpedo1"
			{set "torpedo1" 1}
			{ani_play "torpedo1" callback}
		else not "torpedo2"
			{set "torpedo2" 1}
			{ani_play "torpedo2" callback}
		}
	}
	{on animation_end "torpedo1"
		{spawn "torpedo" "torpedo1" x nonormal noposition}
		{bone cut "torpedo1"}
	}
	{on animation_end "torpedo2"
		{spawn "torpedo" "torpedo2" x nonormal noposition}
		{bone cut "torpedo2"}
	}
	{on operatable on
		{delay 0.1
			{play_sound "engine_operatable" 1}
		}
	}
	{on operatable off
		{stop_sound "engine_operatable"}
	}
	{on "break"
		{stop_sound "engine_operatable"}
	}
	(define "torpedo_detonate"
		{if volume "%0"
			{delay 0.1
				{spawn "tank_die" "fx_exp_%0"}
				{blastwave c4 8 r0 3 r1 6 bone "fx_exp_%0"}
				{bone cut "%0"}
				{set "%0" 1}
			}
		}
	)
	{on pierce
		("torpedo_detonate" args torpedo1)
		("torpedo_detonate" args torpedo2)
	}
	{on blast
		{if min_energy 2
			("torpedo_detonate" args torpedo1)
			("torpedo_detonate" args torpedo2)
		}
	}
	{on "_explosion"
		{view stop "light"}
		{view hide "light"}
	}
}

{"mtb_d3"
	{on "add_movement_sound" overload
		{link_sound "move"				"wheels.d3_move"}
		{link_sound "move_end"			"wheels.d3_move_end"}
		{link_sound "engine"			"engine.d3"		}
		{link_sound "engine_end"		"engine.d3_end"	}
		{link_sound "exhaust"			"engine.d3_up"	}
	}
	{on collect in
		{if bone "emit"
			{ani_play	"rope"}
		else bone "emit1"
			{ani_play	"rope1"}
		else bone "emit2"
			{ani_play	"rope2"}
		else bone "emit3"
			{ani_play	"rope3"}
		else bone "emit4"
			{ani_play	"rope4"}
		else bone "emit5"
			{ani_play	"rope5"}
		else bone "emit6"
			{ani_play	"rope6"}
		}
	}
	(define "sink_volume"
		{delay %1 1
			{volumes %0 disable float bullet blast}
			{impulse up 0.2}
		}
	)
	(define "sink_sequence"
		{impulse up 0.2}
		("sink_volume" args %0 %1)
		("sink_volume" args %2 %3)
		("sink_volume" args %4 %5)
		("sink_volume" args %6 %7)
		{delay 3
			{call "explosion"}
		}
	)
	{on break
		{if component "body_front"
			("sink_sequence" args "ballast1" 2 "ballast3" 4 "ballast2" 7 "ballast4" 8)
		}
		{if component "body"
			("sink_sequence" args "ballast3" 2 "ballast1" 4 "ballast4" 7 "ballast2" 8)
		}
		{if component "body_rear"
			("torpedo_detonate" args torpedo1)
			("torpedo_detonate" args torpedo2)
			("sink_sequence" args "ballast2" 2 "ballast4" 4 "ballast3" 7 "ballast1" 8)
		}
	}
}

{"torpedo"
	{on spawn
		{spawn "spherewater_big"}
		{spawn "spherewater_big2" local_offset -40 0 0}
		{spawn "spherewater_big2" local_offset -80 0 0}
		{spawn "spherewater_big2" local_offset -120 0 0}
		{add_view "wash_torpedo_small" "tail" "tail"}
		{view start "tail"}
	}
	{on "explosion"
		{blastwave c4 15 r0 8 r1 15}
		{spawn "shockwave"}
		{spawn "ex_bomb_big" offset 0 0 20}
		{spawn "spherewater_big"}
		{delete}
	}
	{on ground_hit
		{call "explosion"}
		{spawn "crater_big" nonormal}
	}
	{on contact
		{call "explosion"}
	}
}
