コード例 #1
0
ファイル: ui_players.c プロジェクト: SHOVELL/Unvanquished
/*
===============
UI_TorsoSequencing
===============
*/
static void UI_TorsoSequencing( playerInfo_t *pi )
{
	int currentAnim;

	currentAnim = pi->torsoAnim & ~ANIM_TOGGLEBIT;

	if ( pi->weapon != pi->currentWeapon )
	{
		if ( currentAnim != TORSO_DROP )
		{
			pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH;
			UI_ForceTorsoAnim( pi, TORSO_DROP );
		}
	}

	if ( pi->torsoAnimationTimer > 0 )
	{
		return;
	}

	if ( currentAnim == TORSO_GESTURE )
	{
		UI_SetTorsoAnim( pi, TORSO_STAND );
		return;
	}

	if ( currentAnim == TORSO_ATTACK || currentAnim == TORSO_ATTACK2 )
	{
		UI_SetTorsoAnim( pi, TORSO_STAND );
		return;
	}

	if ( currentAnim == TORSO_DROP )
	{
		UI_PlayerInfo_SetWeapon( pi, pi->weapon );
		pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH;
		UI_ForceTorsoAnim( pi, TORSO_RAISE );
		return;
	}

	if ( currentAnim == TORSO_RAISE )
	{
		UI_SetTorsoAnim( pi, TORSO_STAND );
		return;
	}
}
コード例 #2
0
/*
===============
UI_TorsoSequencing
===============
*/
static void UI_TorsoSequencing( playerInfo_t *pi ) {
	int		currentAnim;

	currentAnim = pi->torsoAnim & ~ANIM_TOGGLEBIT;

	if ( pi->weapon != pi->currentWeapon ) {
		if ( currentAnim != TORSO_DROPWEAP1 ) {
			pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH;
			UI_ForceTorsoAnim( pi, TORSO_DROPWEAP1 );
		}
	}

	if ( pi->torsoAnimationTimer > 0 ) {
		return;
	}

	if( currentAnim == BOTH_GESTURE1 ) {
		UI_SetTorsoAnim( pi, TORSO_WEAPONREADY3 );
		return;
	}

	if( currentAnim == BOTH_ATTACK3 || currentAnim == BOTH_A1_T__B_ ) {
		UI_SetTorsoAnim( pi, TORSO_WEAPONREADY3 );
		return;
	}

	if ( currentAnim == TORSO_DROPWEAP1 ) {
		UI_PlayerInfo_SetWeapon( pi, pi->weapon );
		pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH;
		UI_ForceTorsoAnim( pi, TORSO_RAISEWEAP1 );
		return;
	}

	if ( currentAnim == TORSO_RAISEWEAP1 ) {
		UI_SetTorsoAnim( pi, TORSO_WEAPONREADY3 );
		return;
	}
}
コード例 #3
0
/*
===============
UI_TorsoSequencing
===============
*/
static void UI_TorsoSequencing( uiPlayerInfo_t *pi ) {
	int		currentAnim;

	currentAnim = pi->torsoAnim & ~ANIM_TOGGLEBIT;

	if ( pi->weapon != pi->currentWeapon ) {
		if ( currentAnim != TORSO_DROP ) {
			pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH;
			UI_ForceTorsoAnim( pi, TORSO_DROP );
		}
	}

	if ( pi->torsoAnimationTimer > 0 ) {
		return;
	}

	if( currentAnim == TORSO_GESTURE ) {
#ifdef TA_WEAPSYS
		UI_SetTorsoAnim( pi, BG_TorsoStandForWeapon(pi->realWeapon) );
#else
		UI_SetTorsoAnim( pi, TORSO_STAND );
#endif
		return;
	}

#ifdef TA_WEAPSYS
	if (BG_PlayerAttackAnim(currentAnim)) {
		UI_SetTorsoAnim( pi, BG_TorsoStandForWeapon(pi->realWeapon) );
		return;
	}
#else
	if( currentAnim == TORSO_ATTACK || currentAnim == TORSO_ATTACK2 ) {
		UI_SetTorsoAnim( pi, TORSO_STAND );
		return;
	}
#endif

	if ( currentAnim == TORSO_DROP ) {
		UI_PlayerInfo_SetWeapon( pi, pi->weapon );
		pi->torsoAnimationTimer = UI_TIMER_WEAPON_SWITCH;
		UI_ForceTorsoAnim( pi, TORSO_RAISE );
		return;
	}

	if ( currentAnim == TORSO_RAISE ) {
#ifdef TA_WEAPSYS
		UI_SetTorsoAnim( pi, BG_TorsoStandForWeapon(pi->realWeapon) );
#else
		UI_SetTorsoAnim( pi, TORSO_STAND );
#endif
		return;
	}
}