MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FighterDamageRoutine

Function FighterDamageRoutine

code/game/FighterNPC.cpp:956–1118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954}
955
956static void FighterDamageRoutine( Vehicle_t *pVeh, bgEntity_t *parent, playerState_t *parentPS, playerState_t *riderPS, qboolean isDead )
957{
958 if ( !pVeh->m_iRemovedSurfaces )
959 {//still in one piece
960 if ( pVeh->m_pParentEntity && isDead )
961 {//death spiral
962 pVeh->m_ucmd.upmove = 0;
963 //FIXME: don't bias toward pitching down when not in space
964 /*
965 if ( FighterIsInSpace( pVeh->m_pParentEntity ) )
966 {
967 }
968 else
969 */
970 if ( !(pVeh->m_pParentEntity->s.number%3) )
971 {//NOT everyone should do this
972 pVeh->m_vOrientation[PITCH] += pVeh->m_fTimeModifier;
973 if ( !BG_UnrestrainedPitchRoll( riderPS, pVeh ) )
974 {
975 if ( pVeh->m_vOrientation[PITCH] > 60.0f )
976 {
977 pVeh->m_vOrientation[PITCH] = 60.0f;
978 }
979 }
980 }
981 else if ( !(pVeh->m_pParentEntity->s.number%2) )
982 {
983 pVeh->m_vOrientation[PITCH] -= pVeh->m_fTimeModifier;
984 if ( !BG_UnrestrainedPitchRoll( riderPS, pVeh ) )
985 {
986 if ( pVeh->m_vOrientation[PITCH] > -60.0f )
987 {
988 pVeh->m_vOrientation[PITCH] = -60.0f;
989 }
990 }
991 }
992 if ( (pVeh->m_pParentEntity->s.number%2) )
993 {
994 pVeh->m_vOrientation[YAW] += pVeh->m_fTimeModifier;
995 pVeh->m_vOrientation[ROLL] += pVeh->m_fTimeModifier*4.0f;
996 }
997 else
998 {
999 pVeh->m_vOrientation[YAW] -= pVeh->m_fTimeModifier;
1000 pVeh->m_vOrientation[ROLL] -= pVeh->m_fTimeModifier*4.0f;
1001 }
1002 }
1003 return;
1004 }
1005
1006 //if we get into here we have at least one broken piece
1007 pVeh->m_ucmd.upmove = 0;
1008
1009 //if you're off the ground and not suspended, pitch down
1010 //FIXME: not in space!
1011 if ( pVeh->m_LandTrace.fraction >= 0.1f )
1012 {
1013 if ( !FighterSuspended( pVeh, parentPS ) )

Callers 1

FighterNPC.cppFile · 0.70

Calls 3

BG_UnrestrainedPitchRollFunction · 0.70
FighterSuspendedFunction · 0.70
G_DamageFunction · 0.70

Tested by

no test coverage detected