;SDL

;//////////////////////////////////////////////////////////////////////////////
(define "crew_inside"
	{boarder
		{anm "left"
			{forward	{begin	"board_tank"}}
			{reverse 	{end	"emit_tank_1_hold"}}
		}
		{anm "right"
			{forward	{begin	"board_tank"}}
			{reverse 	{end	"emit_tank_1_hold"}}
		}
	}
)
(define "crew_human_visible_anm"
	{placer
		{place "%place"
			{group "crew"}
			{linkbone "%place"}
			{turnoff {sensor} {shadow}}
			{visor "%visor"}
			{openForCrush}
		}
	}
	{boarder
		{door "%door1"}
		{door "%door2"}
		{link "%door1" "%place" {anm "%anm_left"} {forward putoff} {reverse puton}}
		{link "%door2" "%place" {anm "%anm_right"} {forward putoff} {reverse puton}}
	}
)
(define "crew_human_visible"
	("crew_human_visible_anm" place(%place) door1(%door1) door2(%door2) visor(%visor) anm_left(left) anm_right(right))
)
(define "crew_human"
	{placer
		{place "%place"
			{group "crew"}
			{visor "%visor"}
		}
	}
	{boarder
		{door "%door1"}
		{door "%door2"}
		{link "%door1" "%place" {anm "left"} {forward putoff} {reverse puton}}
		{link "%door2" "%place" {anm "right"} {forward putoff} {reverse puton}}
	}
)
(define "crew_3_human"
	("crew_inside")
	("crew_human" place(gunner)		door1(emit1) door2(emit2) visor(main))
	("crew_human" place(driver)		door1(emit1) door2(emit2) visor(driver))
	("crew_human" place(charger)	door1(emit1) door2(emit2) visor(main))
)
(define "crew_4_human"
	("crew_3_human")
	("crew_human" place(commander)	door1(emit1) door2(emit2) visor(main))
)
(define "crew_2_human"
	("crew_inside")
	("crew_human" place(gunner) door1(emit1) door2(emit2) visor(main))
	("crew_human" place(driver)	door1(emit1) door2(emit2) visor(driver))
)

(define "crew_4_human_extended"
	("crew_inside")
	{placer
		{place "driver" {group "crew"} {visor "driver"}}
	}
	{boarder
		{door "emit0"}
		{link "emit0" "driver" {anm "driver"} {forward putoff} {reverse puton}}
	}
	("crew_human" place(gunner)		door1(emit1) door2(emit2) visor(main))
	("crew_human" place(charger)	door1(emit1) door2(emit2) visor(main))
	("crew_human" place(commander)	door1(emit1) door2(emit2) visor(main))
)

;//////////////////////////////////////////////////////////////////////////////
(define "seat_on_armor"
	{boarder
		{anm "armor"
			{forward	{begin "board_bigcar"}	{end "seat_armor"}}
			{reverse	{end "emit_tank_1_hold"}}
		}
	}
)
(define "seat_human"
	{placer
		{place "%place" {LinkBone "%bone"} {openForCrush}}
	}
	{boarder
		{door "%door"}
		{link "%door" "%place" {anm "%animation"} {forward putoff} {reverse puton}}
	}
)
(define "seat_2_human"
	("seat_on_armor")
	("seat_human" place(seat1) bone(seat01) door(emit3) animation(armor))
	("seat_human" place(seat2) bone(seat02) door(emit4) animation(armor))
)
(define "seat_3_human"
	("seat_2_human")
	("seat_human" place(seat3) bone(seat03) door(emit5) animation(armor))
)
(define "seat_4_human"
	("seat_3_human")
	("seat_human" place(seat4) bone(seat04) door(emit6) animation(armor))
)
(define "seat_6_human"
	("seat_4_human")
	("seat_human" place(seat5) bone(seat05) door(emit7) animation(armor))
	("seat_human" place(seat6) bone(seat06) door(emit8) animation(armor))
)
(define "seat_9_human"
	("seat_6_human")
	("seat_human" place(seat7) bone(seat07) door(emit9) animation(armor))
	("seat_human" place(seat8) bone(seat08) door(emit10) animation(armor))
	("seat_human" place(seat9) bone(seat09) door(emit11) animation(armor))
)


(define "seat_inside"
	{boarder
		{anm "passenger"
			{forward	{begin	"board_tank"}}
			{reverse 	{end	"board_tank" -1}}
		}
	}
)
(define "passenger_invisible"
	{placer
		{place "%place" {group "%place"} {linkbone "%bone"} {turnoff {sensor} {visible}}}
	}
	{boarder
		{door "%door"}
		{link "%door" "%place" {anm "%animation"} {forward putoff} {reverse puton}}
	}
)
(define "passenger_7_human_invisible"
	("seat_inside")
	("passenger_invisible" place(seat4)	bone(seat01)	door(emit4) animation(passenger))
	("passenger_invisible" place(seat5)	bone(seat02)	door(emit0)	animation(passenger))
	("passenger_invisible" place(seat7)	bone(seat03)	door(emit0)	animation(passenger))
	("passenger_invisible" place(seat6)	bone(seat04)	door(emit4)	animation(passenger))
	("passenger_invisible" place(seat8)	bone(seat05)	door(emit0)	animation(passenger))
	("passenger_invisible" place(seat9)	bone(seat06)	door(emit0)	animation(passenger))
	("passenger_invisible" place(seat10)	bone(seat07)	door(emit0)	animation(passenger))
	;("passenger_invisible" place(seat8)	bone(seat08)	door(emit4)	animation(passenger))
	;("passenger_invisible" place(seat9)	bone(seat09)	door(emit3)	animation(passenger))
	;("passenger_invisible" place(seat10) bone(seat10)	door(emit4)	animation(passenger))
)


;//////////////////////////////////////////////////////////////////////////////
(define "crew_human_gunner"
	("crew_human_visible" place(%place) door1(emit1) door2(emit2) visor(main))
	{sensor
		{visor "top"
			{vision "vehicle_top_mgun"} 
			{bone "%visorbone"}
		}
	}
	{placer 
		{place "%place" {visor "top"}}
	}
)
(define "gunner_visible"
	("crew_human_gunner" place(gunner2) visorbone(mgun2))
)
