void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info ) { //update damage info with our accumulated physics force CTakeDamageInfo subinfo = info; subinfo.SetDamageForce( m_vecTotalBulletForce ); SetNumAnimOverlays( 0 ); // Note: since we're dead, it won't draw us on the client, but we don't set EF_NODRAW // because we still want to transmit to the clients in our PVS. CreateRagdollEntity(); DetonateTripmines(); BaseClass::Event_Killed( subinfo ); if ( info.GetDamageType() & DMG_DISSOLVE ) { if ( m_hRagdoll ) { m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL ); } } FlashlightTurnOff(); m_lifeState = LIFE_DEAD; RemoveEffects( EF_NODRAW ); // still draw player body StopZooming(); }
void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info ) { //update damage info with our accumulated physics force CTakeDamageInfo subinfo = info; subinfo.SetDamageForce( m_vecTotalBulletForce ); #ifdef GE_DLL // Since we fixed force application, give the ragdoll an extra oomph to emphasize his death m_vecTotalBulletForce.x *= 2.5f; m_vecTotalBulletForce.y *= 2.5f; m_vecTotalBulletForce.z *= 2.0f; #endif // Note: since we're dead, it won't draw us on the client, but we don't set EF_NODRAW // because we still want to transmit to the clients in our PVS. CreateRagdollEntity(); #ifndef GE_DLL DetonateTripmines(); #endif BaseClass::Event_Killed( subinfo ); if ( info.GetDamageType() & DMG_DISSOLVE ) { if ( m_hRagdoll ) { m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL ); } } #ifndef GE_DLL CBaseEntity *pAttacker = info.GetAttacker(); if ( pAttacker ) { int iScoreToAdd = 1; if ( pAttacker == this ) { iScoreToAdd = -1; } GetGlobalTeam( pAttacker->GetTeamNumber() )->AddMatchScore( iScoreToAdd ); } #endif FlashlightTurnOff(); m_lifeState = LIFE_DEAD; RemoveEffects( EF_NODRAW ); // still draw player body StopZooming(); }
void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info ) { //update damage info with our accumulated physics force CTakeDamageInfo subinfo = info; subinfo.SetDamageForce( m_vecTotalBulletForce ); //BP empêche de créer un ragdoll si on change de team en mode spectateur if(GetTeamNumber() != TEAM_SPECTATOR) CreateRagdollEntity(); BaseClass::Event_Killed( subinfo ); if ( info.GetDamageType() & DMG_DISSOLVE ) if ( m_hRagdoll ) m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL ); CBaseEntity *pAttacker = info.GetAttacker(); if ( pAttacker ) { int iScoreToAdd = 1; if ( pAttacker == this) { if(HL2MPRules()->GetGameType() == GAME_TDM) iScoreToAdd = 0; else iScoreToAdd = -1; } if((HL2MPRules()->GetGameType() == GAME_FORTS) || (HL2MPRules()->GetGameType() == GAME_PUSH)) iScoreToAdd = 0; GetGlobalTeam( pAttacker->GetTeamNumber() )->AddScore( iScoreToAdd ); } FlashlightTurnOff(); m_lifeState = LIFE_DEAD; RemoveEffects( EF_NODRAW ); // still draw player body StopZooming(); DetonateTripmines(); //BP enregistre le tueur SetKiller(info.GetAttacker()); }
void CHL2MP_Player::ChangeTeam( int iTeam ) { /*if ( GetNextTeamChangeTime() >= gpGlobals->curtime ) { char szReturnString[128]; Q_snprintf( szReturnString, sizeof( szReturnString ), "Please wait %d more seconds before trying to switch teams again.\n", (int)(GetNextTeamChangeTime() - gpGlobals->curtime) ); ClientPrint( this, HUD_PRINTTALK, szReturnString ); return; }*/ bool bKill = false; if ( !HL2MPRules()->IsTeamplay() && iTeam != TEAM_SPECTATOR ) //don't let them try to join combine or rebels during deathmatch. iTeam = TEAM_UNASSIGNED; if ( HL2MPRules()->IsTeamplay() ) if ( iTeam != GetTeamNumber() && GetTeamNumber() != TEAM_UNASSIGNED ) bKill = true; BaseClass::ChangeTeam( iTeam ); m_flNextTeamChangeTime = gpGlobals->curtime + TEAM_CHANGE_INTERVAL; if ( HL2MPRules()->IsTeamplay() == true ) SetPlayerTeamModel(); else SetPlayerModel(); if ( iTeam == TEAM_SPECTATOR ) { RemoveAllItems( true ); State_Transition( STATE_OBSERVER_MODE ); } if ( bKill == true ) CommitSuicide(); DetonateTripmines(); }