Skip to content

Commit

Permalink
If players get a "worth it" they spawn with full meter next time. If …
Browse files Browse the repository at this point in the history
…players are killed by another player (not by the ground) during a superfall then that's an automatic "worth it" even if they didn't hit anything, since they were at least in the fight.
  • Loading branch information
BSVino committed Jan 5, 2014
1 parent 02d8774 commit 3d3ff3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mp/src/game/server/sdk/sdk_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ CSDKPlayer::CSDKPlayer()

m_bHasPlayerDied = false;
m_bThirdPerson = false;
m_bGotWorthIt = false;

m_iKills = m_iDeaths = 0;

Expand Down Expand Up @@ -1156,6 +1157,10 @@ void CSDKPlayer::Spawn()
m_iCurrentStreak = 0;
m_flNextSuicideTime = 0;

if (m_bGotWorthIt)
AddStylePoints(9999, STYLE_SOUND_NONE, ANNOUNCEMENT_NONE, STYLE_POINT_LARGE);
m_bGotWorthIt = false;

m_bHasSuperSlowMo = (m_Shared.m_iStyleSkill == SKILL_REFLEXES);
if (m_Shared.m_iStyleSkill == SKILL_REFLEXES)
GiveSlowMo(1);
Expand Down Expand Up @@ -1716,7 +1721,7 @@ void CSDKPlayer::Event_Killed( const CTakeDamageInfo &info )

StopSound( "Player.GoSlide" );

if (m_Shared.IsSuperFalling() && m_bDamagedEnemyDuringFall)
if (m_Shared.IsSuperFalling() && (m_bDamagedEnemyDuringFall || (m_hKiller.Get() && m_hKiller->IsPlayer() && m_hKiller.Get() != this)))
{
AddStylePoints(10, STYLE_SOUND_LARGE, ANNOUNCEMENT_STYLISH, STYLE_POINT_LARGE);
// Send "Worth it!" after the style points so that if the player gets their skill activated because of it, that message won't override the "Worth it!" message.
Expand Down Expand Up @@ -2094,6 +2099,9 @@ void CSDKPlayer::SendAnnouncement(announcement_t eAnnouncement, style_point_t eP

void CSDKPlayer::SendNotice(notice_t eNotice)
{
if (eNotice == NOTICE_WORTHIT)
m_bGotWorthIt = true;

CSingleUserRecipientFilter user( this );
user.MakeReliable();

Expand Down
2 changes: 2 additions & 0 deletions mp/src/game/server/sdk/sdk_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ class CSDKPlayer : public CBaseMultiplayerPlayer

CNetworkHandle(CBriefcase, m_hBriefcase);

bool m_bGotWorthIt;

CNetworkVar( bool, m_bCoderHacks );
CNetworkVar( int, m_nCoderHacksButtons );

Expand Down

0 comments on commit 3d3ff3f

Please sign in to comment.