
//==========================================================================
//
// Character Animation Script    F O R      V   E   N   O   M
//
// This defines the animations and events that might occur at different times
// for this character. State changes, and random behaviour during idle/alert
// states will look here for default behaviour, if that character doesn't have
// something specific in their scripts for that level.
//
//==========================================================================
// DEFINES
//
// These can be used to simplify the scripting, by defining replacement strings

DEFINES

// weapons
set weapons pistols = SP5 Pistol AND luger AND colt
set weapons machineguns = mp40 AND thompson AND sten AND flamethrower 
set weapons rifles = mauser rifle AND snooper rifle
set weapons throwables = dynamite weapon AND pineapple AND grenade

set weapons one_handed_weapons = SP5 Pistol AND luger AND colt
set weapons two_handed_weapons = mp40 AND thompson AND sten AND mauser rifle AND snooper rifle AND sniper scope AND flamethrower AND panzerfaust AND venom 

set weapons venom_weapons = flamethrower AND venom

// movetypes
set movetype moving = walk AND walkcr AND walkcrbk AND walkbk AND run AND runbk AND straferight AND strafeleft
set movetype crouching = idlecr AND walkcr AND walkcrbk
set movetype backstep = walkbk AND runbk AND walkcrbk

//==========================================================================
// ANIMATIONS
//
//	NOTE: scripts are chosen by first-come-first-serve basis. The first match
//	found is the one used.
//
// format:
//
// state <state description>
// {
//		<movement type>
//		{
//			[DEFAULT / <condition type> [<condition value>], ...]
//			{
//				<both/legs/torso> <animation> [sound <filename>]
//				<both/legs/torso> <animation> [sound <filename>]
//				...
//			}
//		}
//	}
//
//	legend:
//
//	<state description>: relaxed, alert, combat
//
//	<movement type>: idle, idlecr, walk, walkbk, walkcr, walkcrbk, run, runbk, straferight, strafeleft, turnright, turnleft
//
//	<condition type>: weapons, position, enemy_weapon, underwater, mounted, movetype, underhand, leaning
//
//	<condition value>:
//
//		weapons: <see weapon pickup names>
//		position: behind, infront, right, left
//		enemy_weapon: <see weapon pickup names>
//		underwater: <no values>
//		mounted: mg42
//		movetype: <see movement types>
//		underhand: <no values>
//		leaning: right, left
//

ANIMATIONS

STATE RELAXED
{
	idle
	{
		weapons two_handed_weapons
		{
			both relaxed_idle_2h_1
		}
	}

	idlecr
	{
		weapons two_handed_weapons
		{
			both alert_crchidle_2h
		}
	}

	walk
	{
		weapons two_handed_weapons
		{
			both relaxed_walk_2h_1
			both relaxed_walk_2h_2
		}
		default
		{
			both relaxed_walk_2h_1
		}
	}

	walkcr
	{
		weapons two_handed_weapons
		{
			both alert_crch_2h
		}
	}

	walkcrbk
	{
		weapons two_handed_weapons
		{
			both alert_crbk_2h
		}
	}

	walkbk
	{
		weapons two_handed_weapons
		{
			both alert_bk_2h
		}
	}

	run
	{
		weapons two_handed_weapons
		{
			both alert_run_2h
		}
	}

	runbk
	{
		weapons two_handed_weapons
		{
			both alert_bk_2h
		}
	}

	climbup
	{
		default
		{
			both climb_up
		}
	}

	climbdown
	{
		default
		{
			both climb_down
		}
	}

	turnright
	{		
		movetype idlecr
		{
			legs turn_crch_R
		}
		movetype idle
		{
			legs turn_1h_R
		}
	}

	turnleft
	{		
		movetype idlecr
		{
			legs turn_crch_L
		}
		movetype idle
		{
			legs turn_1h_L
		}
	}
}


STATE ALERT
{
	idle
	{
		weapons two_handed_weapons
		{
			both alert_idle_2h
		}
	}

	idlecr
	{
		weapons two_handed_weapons
		{
			legs alert_crchidle_2h torso stand_venom
		}
	}

	walk
	{
		weapons two_handed_weapons
		{
			both alert_walk_2h
		}
	}

	walkcr
	{
		weapons two_handed_weapons
		{
			both alert_crch_2h
		}
	}

	walkcrbk
	{
		weapons two_handed_weapons
		{
			both alert_crbk_2h
		}
	}

	walkbk
	{
		weapons two_handed_weapons
		{
			both alert_bk_2h
		}
	}

	run
	{
		weapons two_handed_weapons
		{
			both alert_run_2h
		}
	}

	runbk
	{
		weapons two_handed_weapons
		{
			both alert_bk_2h
		}
	}

	straferight
	{
		weapons two_handed_weapons
		{
			both firing_strafe_2h_R
		}
	}

	strafeleft
	{
		weapons two_handed_weapons
		{
			both firing_strafe_2h_L
		}
	}
}

STATE COMBAT
{
	idle
	{
		weapons two_handed_weapons, firing
		{
			both firing_venom
		}		
		weapons two_handed_weapons 
		{
			both stand_venom
		}		
	}

	walkbk
	{
		weapons two_handed_weapons
		{
			both alert_bk_2h
		}
	}
}

//==========================================================================
// CANNED_ANIMATIONS
//
//	These animations are played at random, momentarily cutting off the
//	above "normal" animations.
//
//	format:
//
//	(see ANIMATION section above)
//

canned_animations 

//==========================================================================
// STATECHANGES
//
// format:
//
// statechange <directionto> <state>
// {
//		[DEFAULT / <condition type> [<condition value>], ...]
//		{
//			<both/legs/torso> <animation> [sound <filename>]
//			<both/legs/torso> <animation> [sound <filename>]
//			...
//		}
// }

STATECHANGES

statechange relaxed query
{
	weapons two_handed_weapons
	{
		both query_idle_2h
	}
}

statechange alert combat
{
	weapons two_handed_weapons
	{
		both alert_to_combat_2h_1
		both alert_to_combat_2h_2
	}
}

statechange relaxed alert
{
	weapons two_handed_weapons
	{
		both relax_to_alert_2h
	}
}

//==========================================================================
// EVENTS
//
// format:
//
// <event description>
// {
//		[DEFAULT / <condition type> [<condition value>], ...]
//		{
//			<both/legs/torso> <animation> [sound <filename>]
//			<both/legs/torso> <animation> [sound <filename>]
//			...
//		}
// }
//
// legend:
//
// <event description>: death, pain, fireweapon, jump, jumpbk, land, dropweapon,
//		raiseweapon, climbdismount, reload
//
//	NOTE: for gameplay anims (weapons firing, reload, etc) that show no legs movement
//		only the torso should animation from here, leave the legs doing what their
//		locomotive anims want them to do
//

EVENTS

fireweapon
{
// MG42
	
// KNIFE

// PISTOLS
	
// MACHINEGUNS
	
// RIFLES

// GRENADES

// VENOM

	weapons venom_weapons, movetype straferight
	{
		torso firing_strafe_2h_R
	}
	weapons venom_weapons, movetype strafeleft
	{
		torso firing_strafe_2h_L
	}
	weapons venom_weapons, movetype walk AND turnleft AND turnright AND idlecr
	{
		torso firing_venom duration 50
	}
	weapons venom_weapons, movetype walkcrbk 
	{
		torso firing_crbk_2h duration 50
	}
	weapons venom_weapons, movetype crouching
	{
		torso firing_crch_2h duration 50
	}
	weapons venom_weapons, movetype run AND swim
	{
		torso firing_run_2h duration 50
	}
	weapons venom_weapons, movetype backstep AND swimbk
	{
		torso firing_bk_2h duration 50
	}
	weapons venom_weapons
	{
		torso firing_venom duration 50
	}
}



raiseweapon
{
	weapons venom_weapons
	{
		torso raise_venom
	}
}

reload
{
	weapons venom_weapons, crouching
	{
		torso reload_machinegun_cr
	}
	weapons venom_weapons
	{
		torso reload_machinegun
	}
}

jump
{
	weapons two_handed_weapons, movetype run
	{
		both jump_1step_2h
	}
	weapons two_handed_weapons
	{
		both jump_nostep_1h
	}
	default
	{
		both jump_1step_2h 
	}
}

jumpbk
{
	weapons two_handed_weapons, movetype run
	{
		both jump_1step_2h
	}
	weapons two_handed_weapons
	{
		both jump_nostep_1h
	}
	default
	{
		both jump_1step_2h 
	}
}

climbmount
{
	default
	{
		both climb_start
	}
}

climbdismount
{
	default
	{
		both climb_dis
	}
}

//pickupgrenade
//{
//	default
//	{
//		both throw_bk
//	}
//}

kickgrenade
{
	default
	{
		both kick_bk
	}
}

inform_friendly_of_enemy
{
	enemy_team allies
	{
		sound infantryInformFriendlyOfEnemyAllies1
		sound infantryInformFriendlyOfEnemyAllies2
		sound infantryInformFriendlyOfEnemyGeneral1
		sound infantryInformFriendlyOfEnemyGeneral2
		sound infantryInformFriendlyOfEnemyGeneral3
	}

	default
	{
		sound infantryInformFriendlyOfEnemyGeneral1
		sound infantryInformFriendlyOfEnemyGeneral2
		sound infantryInformFriendlyOfEnemyGeneral3
	}
}

DEATH
{
	enemy_weapon knife 
	{
		both death_machinegun_1 sound infantryDeathmachine1
	}
	
	enemy_weapon flamethrower
	{
		both death_flame_1 sound infantryDeathflame1
	}
	
	enemy_weapon tesla gun
	{
		both death_tesla_1 sound infantryDeathtesla1
		both death_tesla_2 sound infantryDeathtesla2
	}

	default
	{
		both death_gut sound infantryDeathgut
		both death_forward sound infantryDeathforward
		both death_knife_1 sound infantryDeathknife1
		both death_knife_2 sound infantryDeathknife2
//		both death_rifle_head_1 sound infantryDeathriflehead1
		both death_rifle_head_2 sound infantryDeathriflehead2
		both death_rifle_torso_1 sound infantryDeathrifletorso1
		both death_rifle_torso_2 sound infantryDeathrifletorso2
//		both death_machinegun_1 sound infantryDeathmachine1
		both death_machinegun_2 sound infantryDeathmachine2
	}
}


pain
{
	movetype crouching, impact_point head
	{
		both pain_cr_head
	}

	movetype crouching, impact_point shoulder_right
	{
		both pain_cr_shoulderR
	}

	movetype crouching, impact_point shoulder_left
	{
		both pain_cr_shoulderL
	}

	movetype crouching	// pick one at random if they failed
	{
		both pain_cr_head
		both pain_cr_shoulderR
		both pain_cr_shoulderL
	}

	enemy_weapon flamethrower
	{
		both pain_fire
	}

	enemy_weapon tesla gun
	{
		both pain_tesla_1
		both pain_tesla_2
	}
	stunned
	{
		both pain_daze
	}

	impact_point head
	{
		both pain_head
	}

	impact_point chest
	{
		both pain_chest
	}

	impact_point gut
	{
		both pain_gut
	}

	impact_point groin
	{
		both pain_groin
	}

	impact_point shoulder_right
	{
		both pain_shoulderR
	}

	impact_point shoulder_left
	{
		both pain_shoulderL
	}

	impact_point knee_right
	{
		both pain_kneeR
	}

	impact_point knee_left
	{
		both pain_kneeL
	}

	default
	{
		both pain_chest
		both pain_gut
		both pain_groin
	}
}

BULLETIMPACT
{
	default
	{
		sound infantryBulletImpact
	}
}
 
INSPECTSOUND
{
	default
	{
		sound infantryInspectSound
	}
}
