Skip to content

Commit

Permalink
Restore missing faction dialogue for Titan Meter buildup (#876)
Browse files Browse the repository at this point in the history
Adds faction dialogue saying that Titan is soon ready as well as showing a message when Titan is ready to drop.
  • Loading branch information
Zanieon authored Oct 2, 2024
1 parent c92707e commit 75e95ef
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ void function EarnMeterMP_PlayerLifeThink( entity player )
EarnObject pilotReward = PlayerEarnMeter_GetReward( player )
float pilotRewardFrac = PlayerEarnMeter_GetRewardFrac( player )
int lastEarnMeterMode = PlayerEarnMeter_GetMode( player )
bool saidTitanSoon = false
bool titanReadyMsg = false
float lastPassiveGainTime = Time()

OnThreadEnd(
Expand Down Expand Up @@ -148,15 +150,34 @@ void function EarnMeterMP_PlayerLifeThink( entity player )

if ( lastEarnMeterMode == eEarnMeterMode.DEFAULT )
{
if ( Riff_TitanAvailability() != eTitanAvailability.Never )
{
if ( PlayerEarnMeter_GetOwnedFrac( player ) >= 0.75 && PlayerEarnMeter_GetOwnedFrac( player ) < 0.95 && !saidTitanSoon )
{
PlayFactionDialogueToPlayer( "mp_titanSoon", player )
saidTitanSoon = true
}
else if( PlayerEarnMeter_GetOwnedFrac( player ) < 0.75 )
saidTitanSoon = false
}

if ( PlayerEarnMeter_GetOwnedFrac( player ) < 1.0 )
{
PlayerEarnMeter_DisableGoal( player )
titanReadyMsg = false
}
else if ( player.GetPlayerNetInt( "goalState" ) != eRewardState.UNAVAILABLE )
{
// if goal is enabled then the client will show "titan ready" alerts even if it isn't
// the problem is that if the goal isn't available when we fill the earnmeter, then it won't make it available
// so unfortunately we have to do this manually
player.SetPlayerNetInt( "goalState", eRewardState.AVAILABLE )
PlayerEarnMeter_RefreshGoal( player )
if( !titanReadyMsg )
{
Remote_CallFunction_NonReplay( player, "ServerCallback_TitanReadyMessage" )
titanReadyMsg = true
}
}

if ( Time() - lastPassiveGainTime > 4.0 && file.passiveMeterGainEnabled ) // this might be 5.0
Expand Down

0 comments on commit 75e95ef

Please sign in to comment.