Skip to content

Commit

Permalink
Merge branch 'main' into fix-for-the-triple-threat
Browse files Browse the repository at this point in the history
  • Loading branch information
Alystrasz authored Nov 6, 2024
2 parents 5a7a1cb + 730616d commit 010e748
Show file tree
Hide file tree
Showing 13 changed files with 259 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ Choisissez Oui si vous êtes d'accord. Ce choix peut être modifié à tout inst
"DOWNLOADING_MOD_TEXT" "Téléchargement de %s1 v%s2..."
"WRONG_MOD_VERSION" "Le serveur requiert la version v%s2 du mod \"%s1\" (vous avez la version v%s3)"
"DOWNLOADING_MOD_TEXT_W_PROGRESS" "Téléchargement de %s1 v%s2...\n(%s3/%s4 Mo)"
"CHECKSUMING_TITLE" "Vérification de la somme de contrôle du mod"
"CHECKSUMING_TITLE" "Vérification de l'intégrité du mod"
"CHECKSUMING_TEXT" "Vérification du contenu de %s1 v%s2..."
"EXTRACTING_MOD_TEXT" "Extraction de %s1 v%s2...\n(%s3/%s4 Mo)"
"FAILED_DOWNLOADING" "Echec du téléchargement du mod"
Expand All @@ -379,5 +379,15 @@ Choisissez Oui si vous êtes d'accord. Ce choix peut être modifié à tout inst
"MOD_FETCHING_FAILED_GENERAL" "L'extraction du mod a échoué. Consultez le journal pour plus d'informations."
"MANIFESTO_FETCHING_TITLE" "Préparation du téléchargement du mod"
"MANIFESTO_FETCHING_TEXT" "Récupération de la liste des mods vérifiés..."
"MODE_MENU_PVPVE" "JcJcE"
"MODE_MENU_PVE" "JcE"
"MODE_MENU_PVP" "JcJ"
"MODE_MENU_FFA" "Mêlée générale"
"MODE_MENU_OTHER" "Autre"
"MODE_MENU_CUSTOM" "Personnalisé"
"MODE_MENU_ALL" "Tout"
"MODE_MENU_UNKNOWN" "Inconnu"
"MODE_MENU_SWITCH" "Filtre"
"MODE_MENU_TITAN_ONLY" "Titan Uniquement"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen
"HIDE_LOCKED" "Esconder desativados"

// In-game chat
"HUD_CHAT_WHISPER_PREFIX" "[WHISPER]"
"HUD_CHAT_SERVER_PREFIX" "[SERVER]"
"HUD_CHAT_WHISPER_PREFIX" "[SUSSURRO]"
"HUD_CHAT_SERVER_PREFIX" "[SERVIDOR]"
"ONLY_HOST_MATCH_SETTINGS" "Somente o Host pode mudar as configurações da Partida Privada"
"ONLY_HOST_CAN_START_MATCH" "Somente o Host pode Iniciar a Partida"
"LOG_UNKNOWN_CLIENTCOMMANDS" "Registrar Comandos desconhecidos de Clientes"
Expand Down Expand Up @@ -355,8 +355,8 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen
"MOD_DL_DISABLED" "(download automático de mod está desabilitado)"
"DOWNLOADING_MOD_TITLE" "Baixando mod"
"DOWNLOADING_MOD_TEXT_W_PROGRESS" "Baixando %s1 v%s2...\n(%s3/%s4 MB)"
"CHECKSUMING_TITLE" "Verificando o mod"
"CHECKSUMING_TEXT" "Verificando conteúdo de %s1 v%s2..."
"CHECKSUMING_TITLE" "Verificando a integridade do mod"
"CHECKSUMING_TEXT" "Validando arquivos de %s1 v%s2..."
"EXTRACTING_MOD_TITLE" "Extraíndo mod (%s1%)"
"MOD_REQUIRED_WARNING" " Este mod pode ser desativado quando entrar em um servidor"
"AUTHENTICATION_FAILED_HEADER" "Autenticação Falhou"
Expand All @@ -376,5 +376,15 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen
"MOD_FETCHING_FAILED_GENERAL" "Extração do mod falhou. Verifique os logs para mais detalhes."
"MANIFESTO_FETCHING_TEXT" "Retornando a lista de mods verificados..."
"MANIFESTO_FETCHING_TITLE" "Preparando o download do mod"
"MODE_MENU_PVPVE" "JcJcA"
"MODE_MENU_PVE" "JcA"
"MODE_MENU_PVP" "JcJ"
"MODE_MENU_FFA" "TcT"
"MODE_MENU_OTHER" "Outros"
"MODE_MENU_CUSTOM" "Personalizado"
"MODE_MENU_ALL" "Todos"
"MODE_MENU_UNKNOWN" "Desconhecido"
"MODE_MENU_SWITCH" "Filtrar"
"MODE_MENU_TITAN_ONLY" "Somente Titãs"
}
}
171 changes: 171 additions & 0 deletions Northstar.Client/mod/scripts/vscripts/mp/levels/cl_mp_glitch.nut
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
global function ClientCodeCallback_MapInit
global function AddInWorldMinimapObject

// someday, move this to in world minimap

struct
{
array<var> minimapBGTopos
array<var> minimapTopos
array<var> screens
float mapCornerX
float mapCornerY
float mapScale
float threatMaxDist
} file

void function ClientCodeCallback_MapInit()
{
AddCallback_EntitiesDidLoad( EntitiesDidLoad )
AddCallback_MinimapEntSpawned( AddInWorldMinimapObject )
AddCallback_LocalViewPlayerSpawned( AddInWorldMinimapObject )
}

void function EntitiesDidLoad()
{
InitMinimapScreens()
}

var function AddInWorldMinimapTopo( entity ent, float width, float height )
{
vector ang = ent.GetAngles()
vector right = ( (AnglesToRight( ang )*-1) * width * 0.5 )
vector down = ( (AnglesToUp( ang )*-1) * height * 0.5 )

vector org = ent.GetOrigin()

org = ent.GetOrigin() - right*0.5 - down*0.5

var topo = RuiTopology_CreatePlane( org, right, down, true )
return topo
}

void function InitMinimapScreens()
{
array<entity> screens = GetEntArrayByScriptName( "inworld_minimap" )
foreach ( screen in screens )
{
file.minimapTopos.append( AddInWorldMinimapTopo( screen, 350, 350 ) )
file.minimapBGTopos.append( AddInWorldMinimapTopo( screen, 450, 450 ) )
}

asset mapImage = Minimap_GetAssetForKey( "minimap" )
file.mapCornerX = Minimap_GetFloatForKey( "pos_x" )
file.mapCornerY = Minimap_GetFloatForKey( "pos_y" )
float displayDist = Minimap_GetFloatForKey( "displayDist" )
float threatDistNear = Minimap_GetFloatForKey( "threatNearDist" )
float threatDistFar = Minimap_GetFloatForKey( "threatFarDist" )
file.mapScale = Minimap_GetFloatForKey( "scale" )

file.threatMaxDist = Minimap_GetFloatForKey( "threatMaxDist" )

foreach ( screen in file.minimapBGTopos )
{
entity player = GetLocalViewPlayer()
var rui = RuiCreate( $"ui/in_world_minimap_border.rpak", screen, RUI_DRAW_WORLD, 0 )
string factionChoice = GetFactionChoice( player )
ItemDisplayData displayData = GetItemDisplayData( factionChoice )
asset factionLogo = displayData.image
RuiSetImage( rui, "logo", factionLogo )
RuiSetImage( rui, "basicImage", $"overviews/mp_glitch_wallmap_bracket" )
}
foreach ( screen in file.minimapTopos )
{
var rui = RuiCreate( $"ui/in_world_minimap_base.rpak", screen, RUI_DRAW_WORLD, 0 )
RuiSetImage( rui, "mapImage", $"overviews/mp_glitch_wallmap" )
RuiSetFloat3( rui, "mapCorner", <file.mapCornerX, file.mapCornerY, 0> )
RuiSetFloat( rui, "displayDist", max( file.threatMaxDist, 2200 ) )
RuiSetFloat( rui, "mapScale", file.mapScale )
file.screens.append( rui )
}

foreach ( player in GetPlayerArray() )
{
if ( IsValid( player ) )
AddInWorldMinimapObject( player )
}
}

void function AddInWorldMinimapObject( entity ent ) //TODO: If we want radar jammer boost to hide friendly players we need to be able to get the rui handles back.
{
Assert( IsValid( ent ) )

if ( !ent.IsPlayer() && !ent.IsTitan() )
return

ent.SetDoDestroyCallback( true )

foreach ( screen in file.minimapTopos )
thread AddInWorldMinimapObjectInternal( ent, screen )
}

void function AddInWorldMinimapObjectInternal( entity ent, var screen )
{
bool isNPCTitan = ent.IsNPC() && ent.IsTitan()
bool isPetTitan = ent == GetLocalViewPlayer().GetPetTitan()
bool isLocalPlayer = ent == GetLocalViewPlayer()
int customState = ent.Minimap_GetCustomState()
asset minimapAsset = $"ui/in_world_minimap_player.rpak"
if ( isNPCTitan )
{
minimapAsset = $"ui/in_world_minimap_object.rpak"
}

int zOrder = ent.Minimap_GetZOrder()
entity viewPlayer = GetLocalViewPlayer()

var rui = RuiCreate( minimapAsset, screen, RUI_DRAW_WORLD, MINIMAP_Z_BASE + zOrder )

//RuiTrackGameTime( rui, "lastFireTime", ent, RUI_TRACK_LAST_FIRED_TIME )

RuiSetFloat3( rui, "mapCorner", <file.mapCornerX,file.mapCornerY,0.0> )
RuiSetFloat( rui, "mapScale", file.mapScale )

RuiTrackFloat3( rui, "objectPos", ent, RUI_TRACK_ABSORIGIN_FOLLOW )
RuiTrackFloat3( rui, "objectAngles", ent, RUI_TRACK_EYEANGLES_FOLLOW )
RuiTrackInt( rui, "objectFlags", ent, RUI_TRACK_MINIMAP_FLAGS )
RuiTrackInt( rui, "customState", ent, RUI_TRACK_MINIMAP_CUSTOM_STATE )
RuiSetFloat( rui, "displayDist", max( file.threatMaxDist, 2200 ) )

if ( isLocalPlayer )
RuiSetBool( rui, "isLocalPlayer", isLocalPlayer )

// MinimapPackage_PlayerInit( ent, rui )

if ( isPetTitan )
{
RuiSetBool( rui, "useTeamColor", false )
RuiSetFloat3( rui, "iconColor", TEAM_COLOR_YOU / 255.0 )
}

OnThreadEnd(
function() : ( rui )
{
RuiDestroy( rui )
}
)

ent.EndSignal( "OnDestroy" )

if ( ent.IsPlayer() )
{
while ( IsValid( ent ) )
{
WaitSignal( ent, "SettingsChanged", "OnDeath" )
}
}
else
{
ent.WaitSignal( "OnDestroy" )
}
}

void function MinimapPackage_PlayerInit( entity ent, var rui )
{
RuiTrackGameTime( rui, "lastFireTime", ent, RUI_TRACK_LAST_FIRED_TIME )
if ( !IsFFAGame() ) //JFS: Too much work to get FFA to work correctly with Minimap logic, so disabling it for FFA
{
RuiTrackFloat( rui, "sonarDetectedFrac", ent, RUI_TRACK_STATUS_EFFECT_SEVERITY, eStatusEffect.sonar_detected )
RuiTrackFloat( rui, "maphackDetectedFrac", ent, RUI_TRACK_STATUS_EFFECT_SEVERITY, eStatusEffect.maphack_detected )
}
}
16 changes: 13 additions & 3 deletions Northstar.Client/mod/scripts/vscripts/presence/cl_presence.nut
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@ GameStateStruct function DiscordRPC_GenerateGameState( GameStateStruct gs )
gs.mapDisplayname = Localize(GetMapDisplayName(GetMapName()))

gs.playlist = GetCurrentPlaylistName()
gs.playlistDisplayname = Localize(GetCurrentPlaylistVarString("name", GetCurrentPlaylistName()))
gs.playlistDisplayname = Localize( GetCurrentPlaylistVarString( "name", GetCurrentPlaylistName() ) )

gs.currentPlayers = GetPlayerArray().len()
gs.maxPlayers = GetCurrentPlaylistVarInt( "maxPlayers", -1 )
int reservedCount = GetTotalPendingPlayersReserved()
int connectingCount = GetTotalPendingPlayersConnecting()
int loadingCount = GetTotalPendingPlayersLoading()
int connectedCount = GetPlayerArray().len()
int allKnownPlayersCount = reservedCount + connectingCount + loadingCount + connectedCount

gs.currentPlayers = allKnownPlayersCount
gs.maxPlayers = GetCurrentPlaylistVarInt( "max_players", 16 )

if ( IsValid( GetLocalClientPlayer() ) )
gs.ownScore = GameRules_GetTeamScore( GetLocalClientPlayer().GetTeam() )

#if MP
if ( GameRules_GetGameMode() == FD )
{
gs.playlist = "fd" // So it returns only one thing to the plugin side instead of the 5 separate difficulties FD have
Expand All @@ -41,6 +48,9 @@ GameStateStruct function DiscordRPC_GenerateGameState( GameStateStruct gs )
else
gs.fd_waveNumber = -1 // Tells plugin it's on Wave Break
}
#else
gs.fd_waveNumber = -1 // Unecessary for campaign so return -1
#endif

gs.serverGameState = GetGameState() == -1 ? 0 : GetGameState()
gs.otherHighestScore = gs.ownScore == highestScore ? secondHighest : highestScore
Expand Down
2 changes: 1 addition & 1 deletion Northstar.Client/mod/scripts/vscripts/ui/atlas_auth.nut
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void function AtlasAuthDialog_Threaded()
if ( res.errorCode != "" )
dialogData.message += format( "\n\n%s", Localize( "#AUTHENTICATION_FAILED_ERROR_CODE", res.errorCode ) )

string link = "https://r2northstar.gitbook.io/r2northstar-wiki/installing-northstar/troubleshooting"
string link = "https://docs.northstar.tf/Wiki/installing-northstar/troubleshooting/"
// link to generic troubleshooting page if we don't have an error code from Atlas
if ( res.errorCode != "" )
link = format( "%s#%s", link, res.errorCode )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void function UpdateVisibleModes()
if( blockedModes.contains( file.sortedModes[ modeIndex ] ) )
Hud_SetLocked( button, true )

if ( !PrivateMatch_IsValidMapModeCombo( PrivateMatch_GetSelectedMap(), mode ) )
if ( PrivateMatch_IsValidMapModeCombo( PrivateMatch_GetSelectedMap(), mode ) )
{
Hud_SetLocked( button, true )
SetButtonRuiText( button, mode )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ string function GetSelectedBurnCardRef( entity player )

#if SERVER
if ( GetItemDisplayData( ref ).hidden )
ClientCommand( player, "disconnect" )
NSDisconnectPlayer( player, "" )
#endif

#if SERVER || CLIENT
Expand Down
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
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -226,37 +226,7 @@ void function SetWinner( int team, string winningReason = "", string losingReaso
SetGameState( eGameState.WinnerDetermined )
ScoreEvent_MatchComplete( team )

array<entity> players = GetPlayerArray()
int functionref( entity, entity ) compareFunc = GameMode_GetScoreCompareFunc( GAMETYPE )
if ( compareFunc != null )
{
players.sort( compareFunc )
int playerCount = players.len()
int currentPlace = 1
for ( int i = 0; i < 3; i++ )
{
if ( i >= playerCount )
continue

if ( i > 0 && compareFunc( players[i - 1], players[i] ) != 0 )
currentPlace += 1

switch( currentPlace )
{
case 1:
UpdatePlayerStat( players[i], "game_stats", "mvp" )
UpdatePlayerStat( players[i], "game_stats", "mvp_total" )
UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" )
break
case 2:
UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" )
break
case 3:
UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" )
break
}
}
}
RegisterMatchStats_OnMatchComplete()
}
}
}
Expand Down
Loading

0 comments on commit 010e748

Please sign in to comment.