Skip to content

Commit

Permalink
Dialogue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanieon committed Sep 10, 2024
1 parent 3dfd209 commit fb3746f
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 titanReady = 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 )
titanReady = 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( !titanReady )
{
Remote_CallFunction_NonReplay( player, "ServerCallback_TitanReadyMessage" )
titanReady = true
}
}

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

0 comments on commit fb3746f

Please sign in to comment.