Skip to content

Commit 04b9a9c

Browse files
committed
update traitors challenge to not use frag count
1 parent 4312589 commit 04b9a9c

8 files changed

Lines changed: 22 additions & 5 deletions

File tree

reactivedrop/content/traitors_challenge/resource/challenges/traitors.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"_rd_traitors_challenge_enabled" "1"
77
"rd_player_bots_allowed" "0"
88
"rd_add_index_to_name" "1"
9+
"rd_restrict_aspect_width" "1.77777777"
910
"rd_draw_restricted_rectangles_coop" "1"
1011

1112
"rd_auto_fast_restart" "1"

reactivedrop/content/traitors_challenge/scripts/vscripts/challenge_traitors.nut

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function SetTraitorIcon(interval = 10) {
228228
if (hPlayer == null || !hPlayer.IsValid()) {
229229
continue;
230230
}
231-
NetProps.SetPropInt(hPlayer, "m_iFrags", 99);
231+
NetProps.SetPropInt(hPlayer, "m_iChallengeScratch", 1);
232232
}
233233
}
234234

src/game/client/swarm/c_asw_player.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ BEGIN_NETWORK_TABLE( C_ASW_Player, DT_ASW_Player )
270270
RecvPropQAngles( RECVINFO( m_angMarineAutoAimFromClient ) ),
271271
RecvPropFloat( RECVINFO( m_flInactiveKickWarning ) ),
272272
RecvPropDataTable( RECVINFO_DT( m_EquippedItemData ), 0, &REFERENCE_RECV_TABLE( DT_RD_ItemInstances_Player ) ),
273+
RecvPropInt( RECVINFO( m_iChallengeScratch ) ),
273274
END_RECV_TABLE()
274275

275276
BEGIN_PREDICTION_DATA( C_ASW_Player )
@@ -357,6 +358,7 @@ C_ASW_Player::C_ASW_Player() :
357358
m_flInactiveKickWarning = 0.0f;
358359
m_nLastInactiveKickWarning = 0;
359360
m_flNextServerInfoUpdate = 0.0f;
361+
m_iChallengeScratch = 0;
360362
}
361363

362364

src/game/client/swarm/c_asw_player.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ class C_ASW_Player : public C_BasePlayer, public IASWPlayerAnimStateHelpers
359359
STEAM_CALLBACK( C_ASW_Player, Steam_OnUserStatsStored, UserStatsStored_t );
360360
#endif
361361

362+
int m_iChallengeScratch;
363+
362364
private:
363365
C_ASW_Player( const C_ASW_Player & );
364366
};

src/game/client/swarm/vgui/asw_hud_emotes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ void CASWHudEmotes::PaintEmotesFor( C_ASW_Marine *pMarine )
160160

161161
if ( _rd_traitors_challenge_enabled.GetBool() )
162162
{
163-
CASW_Marine *pViewMarine = C_ASW_Marine::GetViewMarine();
164-
if ( pViewMarine && pViewMarine->GetMarineResource() && ( pViewMarine->GetMarineResource()->m_iChallengeScratch & 1 ) )
163+
C_ASW_Player *pLocalPlayer = C_ASW_Player::GetLocalASWPlayer();
164+
if ( pLocalPlayer && ( pLocalPlayer->m_iChallengeScratch & 1 ) )
165165
{
166166
if ( pMarine->m_iEmote & ( 1 << 8 ) )
167167
PaintTraitorEmote( pMarine, m_nTraitorEmoteTexture, 0.35f );

src/game/server/swarm/asw_player.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ IMPLEMENT_SERVERCLASS_ST( CASW_Player, DT_ASW_Player )
245245
SendPropQAngles( SENDINFO( m_angMarineAutoAimFromClient ), 10, SPROP_CHANGES_OFTEN ),
246246
SendPropFloat( SENDINFO( m_flInactiveKickWarning ) ),
247247
SendPropDataTable( SENDINFO_DT( m_EquippedItemData ), &REFERENCE_SEND_TABLE( DT_RD_ItemInstances_Player ) ),
248+
SendPropInt( SENDINFO( m_iChallengeScratch ) ),
248249
END_SEND_TABLE()
249250

250251
BEGIN_DATADESC( CASW_Player )
@@ -275,6 +276,7 @@ BEGIN_DATADESC( CASW_Player )
275276
DEFINE_FIELD( m_angMarineAutoAimFromClient, FIELD_VECTOR ),
276277
DEFINE_FIELD( m_flLastActiveTime, FIELD_TIME ),
277278
DEFINE_FIELD( m_flInactiveKickWarning, FIELD_TIME ),
279+
DEFINE_FIELD( m_iChallengeScratch, FIELD_INTEGER ),
278280
END_DATADESC()
279281

280282
BEGIN_ENT_SCRIPTDESC( CASW_Player, CBasePlayer, "The player entity." )
@@ -436,6 +438,7 @@ CASW_Player::CASW_Player()
436438
m_iRecentMapVotesCount = 0;
437439
m_fMapVoteCooldownEndTime = 0.0f;
438440
m_fLastMapVoteTime = -1000.0f;
441+
m_iChallengeScratch = 0;
439442
}
440443

441444

src/game/server/swarm/asw_player.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@ class CASW_Player : public CBaseMultiplayerPlayer, public IASWPlayerAnimStateHel
329329
CUtlVector<ReactiveDropInventory::ItemInstance_t> m_CraftingMaterialInstances;
330330
#endif
331331

332-
private:
333-
334332
// Copyed from EyeAngles() so we can send it to the client.
335333
CNetworkQAngle( m_angEyeAngles );
336334
Vector m_vecCrosshairTracePos; // the world location directly beneath the player's crosshair
337335
CNetworkVarForDerived( bool, m_fIsWalking );
338336

339337
IPlayerAnimState *m_PlayerAnimState;
340338
bool m_bFirstInhabit;
339+
340+
CNetworkVar( int, m_iChallengeScratch );
341341
};
342342

343343
extern void TE_MarineAnimEvent( CASW_Marine *pMarine, PlayerAnimEvent_t event );

src/game/shared/swarm/asw_gamerules.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9981,6 +9981,15 @@ void CAlienSwarm::EnableChallenge( const char *szChallengeName )
99819981
else if ( bChanged )
99829982
{
99839983
UTIL_ClientPrintAll( ASW_HUD_PRINTTALKANDCONSOLE, "#rd_challenge_enabled", pKV->GetString( "name", szChallengeName ) );
9984+
for ( int i = 1; i <= MAX_PLAYERS; i++ )
9985+
{
9986+
CASW_Player *pPlayer = ToASW_Player( UTIL_PlayerByIndex( i ) );
9987+
if ( pPlayer )
9988+
{
9989+
// Reset to 0 before the challenge activates.
9990+
pPlayer->m_iChallengeScratch = 0;
9991+
}
9992+
}
99849993
}
99859994
// if rd_max_marines changed we need to update marines limits using SetMaxMarines
99869995
SetMaxMarines();

0 commit comments

Comments
 (0)