Skip to content

Commit

Permalink
Merge branch 'main' into unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanieon authored Apr 11, 2024
2 parents bac32d7 + a8c0653 commit cb2498d
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,41 @@ Clique em Sim se você concorda. Esta escolha pode ser alterada a qualquer momen
"SHOULD_RETURN_TO_LOBBY" "Retornar ao saguão após término de Partida"
"WILL_RESET_SETTING" "Isso irá resetar a configuração %s1 ao valor padrão.\n\nAção não reversível."
"aitdm_archer_grunts" "Soldados com Archer"
"player_force_respawn" "Resurgimento Forçado"
"PROGRESSION_ENABLED_HEADER" "Progressão Habilitada!"
"PROGRESSION_ENABLED_BODY" "^CCCC0000Progressão foi habilitada.^\n\nTitãs, Armas, Facções, Cosméticos, etc. serão destravados ao ganhar níveis, ou comprados com Méritos.\n\nIsso pode ser alterado a qualquer momento no menu de multijogador."
"PROGRESSION_DISABLED_HEADER" "Progressão Desabilitada!"
"TOGGLE_PROGRESSION" "Habilitar Progressão"
"PROGRESSION_TOGGLE_ENABLED_HEADER" "Desabilitar Progressão?"
"PROGRESSION_TOGGLE_ENABLED_BODY" "Titãs, Armas, Facções, Cosméticos etc. serão todos destravados e usáveis a qualquer momento.\n\nIsso pode ser alterado a qualquer hora no menu de multijogador."
"PROGRESSION_TOGGLE_DISABLED_HEADER" "Habilitar Progressão?"
"PROGRESSION_TOGGLE_DISABLED_BODY" "Titãs, Armas, Facções, Cosméticos, etc. terão que ser destravados ao ganhar níveis, ou comprados com Méritos.\n\nIsso pode ser alterado a qualquer momento no menu de multijogador.\n\n^CC000000Aviso: Se você atualmente tem qualquer item equipado que não foi préviamente destravado, ele será resetado!"
"Y_BUTTON_TOGGLE_PROGRESSION" "%[Y_BUTTON|]% Alternar Progressão"
"DOWNLOADING_MOD_TITLE_W_PROGRESS" "Baixando mod (%s1%)"
"DOWNLOADING_MOD_TEXT" "Baixando %s1 v%s2..."
"MISSING_MOD" "Mod em falta \"%s1\" v%s2"
"MOD_NOT_VERIFIED" "(o mod não é verificado, e não pode ser baixado automaticamente)"
"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..."
"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"
"AUTHENTICATION_FAILED_BODY" "Falha ao autenticar com Atlas!"
"AUTHENTICATION_FAILED_ERROR_CODE" "Código de Erro: ^DB6F2C00%s1^"
"AUTHENTICATION_FAILED_HELP" "Ajuda"
"EXTRACTING_MOD_TEXT" "Extraíndo %s1 v%s2...\n(%s3/%s4 MB)"
"FAILED_DOWNLOADING" "Falha ao baixar mod"
"FAILED_READING_ARCHIVE" "Um erro ocorreu ao ler o aqruivo do mod."
"MOD_FETCHING_FAILED" "O arquivo do mod não pode ser baixado da Thunderstore."
"MOD_CORRUPTED" "O aquivo baixado não condiz com a assinatura de verificação registrada."
"NO_DISK_SPACE_AVAILABLE" "Não há espaço suficiente no disco."
"PROGRESSION_DISABLED_BODY" "^CCCC0000Progressão foi desabilitada.^\n\nTitãs, Facções, Armas, Cosméticos, etc. estarão disponíveis para uso a qualquer momento.\n\nIsso pode ser alterado a qualquer hora no menu de multijogador."
"PROGRESSION_ANNOUNCEMENT_BODY" "^CCCC0000Progressão agora pode ser habilitada!^\n\nNorthstar agora suporta a progressão original, o que significa que você pode optar por destravar Armas, Cosméticos, Titãs e outros através do ganho de níveis e completando os desafios.\n\nVocê pode habilitar a progressão usando o botão no rodapé do menu de multijogador.\n\nIsso pode ser alterado a qualquer momento."
"WRONG_MOD_VERSION" "O servidor tem o mod \"%s1\" v%s2 enquanto você possui v%s3"
"FAILED_WRITING_TO_DISK" "Um erro ocorreu enquanto se extraía o conteúdo do mod para o sistema."
"MOD_FETCHING_FAILED_GENERAL" "Extração do mod falhou. Verifique os logs para mais detalhes."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ void function ConnectWithPassword( var button )
if ( GetTopNonDialogMenu() == file.menu )
{
TriggerConnectToServerCallbacks()
thread ThreadedAuthAndConnectToServer( Hud_GetUTF8Text( Hud_GetChild( file.menu, "EnterPasswordBox" ) ) )
thread ThreadedAuthAndConnectToServer( Hud_GetUTF8Text( Hud_GetChild( file.menu, "EnterPasswordBox" ) ), true )
}
}
13 changes: 2 additions & 11 deletions Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut
Original file line number Diff line number Diff line change
Expand Up @@ -1050,13 +1050,6 @@ void function OnServerSelected_Threaded( var button )
}
}

// Make Northstar aware new mods have been added
if ( downloadedMods > 0 )
{
print( "Some new mods have been downloaded or enabled, reloading mods." )
NSReloadMods();
}

if ( server.requiresPassword )
{
OnCloseServerBrowserMenu()
Expand All @@ -1065,12 +1058,12 @@ void function OnServerSelected_Threaded( var button )
else
{
TriggerConnectToServerCallbacks()
thread ThreadedAuthAndConnectToServer()
thread ThreadedAuthAndConnectToServer( "", downloadedMods != 0 )
}
}


void function ThreadedAuthAndConnectToServer( string password = "" )
void function ThreadedAuthAndConnectToServer( string password = "", bool modsChanged = false )
{
if ( NSIsAuthenticatingWithServer() )
return
Expand Down Expand Up @@ -1098,8 +1091,6 @@ void function ThreadedAuthAndConnectToServer( string password = "" )

if ( NSWasAuthSuccessful() )
{
bool modsChanged = false

// disable all RequiredOnClient mods that are not required by the server and are currently enabled
foreach ( string modName in NSGetModNames() )
{
Expand Down
81 changes: 30 additions & 51 deletions Northstar.Custom/keyvalues/playlists_v2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ playlists
mp_colony02 1
mp_glitch 1
mp_lf_stacks 1
mp_lf_stacks 1
mp_lf_deck 1
mp_lf_meadow 1
mp_lf_traffic 1
Expand Down Expand Up @@ -449,7 +448,6 @@ playlists
mp_colony02 1
mp_glitch 1
mp_lf_stacks 1
mp_lf_stacks 1
mp_lf_deck 1
mp_lf_meadow 1
mp_lf_traffic 1
Expand Down Expand Up @@ -498,7 +496,6 @@ playlists
mp_colony02 1
mp_glitch 1
mp_lf_stacks 1
mp_lf_stacks 1
mp_lf_deck 1
mp_lf_meadow 1
mp_lf_traffic 1
Expand Down Expand Up @@ -626,35 +623,27 @@ playlists
{
maps
{
mp_complex3 1
mp_drydock 1
mp_glitch 1
mp_homestead 2
mp_eden 1
mp_forwardbase_kodai 1
mp_black_water_canal 1
mp_glitch 1
mp_angel_city 1
mp_colony02 1
mp_relic02 1
mp_grave 1
mp_homestead 1
mp_drydock 1
mp_glitch 1
mp_thaw 1
mp_eden 2
mp_black_water_canal 1
mp_glitch 1
mp_relic02 1
mp_wargames 1
mp_rise 1
mp_eden 1
mp_drydock 1
mp_crashsite3 1
mp_complex3 1
mp_angel_city 1
mp_colony02 1
mp_glitch 1
mp_lf_stacks 1
mp_lf_deck 1
mp_lf_meadow 1
mp_lf_traffic 1
mp_lf_township 1
mp_lf_uma 1
mp_relic02 1
mp_wargames 1
mp_rise 1
}
}
}
Expand All @@ -681,35 +670,27 @@ playlists
{
maps
{
mp_complex3 1
mp_drydock 1
mp_glitch 1
mp_homestead 2
mp_eden 1
mp_forwardbase_kodai 1
mp_black_water_canal 1
mp_glitch 1
mp_angel_city 1
mp_colony02 1
mp_relic02 1
mp_grave 1
mp_homestead 1
mp_drydock 1
mp_glitch 1
mp_thaw 1
mp_eden 2
mp_black_water_canal 1
mp_glitch 1
mp_relic02 1
mp_wargames 1
mp_rise 1
mp_eden 1
mp_drydock 1
mp_crashsite3 1
mp_complex3 1
mp_angel_city 1
mp_colony02 1
mp_glitch 1
mp_lf_stacks 1
mp_lf_deck 1
mp_lf_meadow 1
mp_lf_traffic 1
mp_lf_township 1
mp_lf_uma 1
mp_relic02 1
mp_wargames 1
mp_rise 1
}
}
}
Expand Down Expand Up @@ -747,7 +728,6 @@ playlists
mp_colony02 1
mp_glitch 1
mp_lf_stacks 1
mp_lf_stacks 1
mp_lf_deck 1
mp_lf_meadow 1
mp_lf_traffic 1
Expand Down Expand Up @@ -795,7 +775,6 @@ playlists
mp_colony02 1
mp_glitch 1
mp_lf_stacks 1
mp_lf_stacks 1
mp_lf_deck 1
mp_lf_meadow 1
mp_lf_traffic 1
Expand Down Expand Up @@ -829,18 +808,18 @@ playlists
{
maps
{
mp_forwardbase_kodai 1
mp_grave 1
mp_homestead 1
mp_thaw 1
mp_black_water_canal 1
mp_eden 1
mp_drydock 1
mp_crashsite3 1
mp_complex3 1
mp_angel_city 1
mp_colony02 1
mp_glitch 1
mp_forwardbase_kodai 1
mp_grave 1
mp_homestead 1
mp_thaw 1
mp_black_water_canal 1
mp_eden 1
mp_drydock 1
mp_crashsite3 1
mp_complex3 1
mp_angel_city 1
mp_colony02 1
mp_glitch 1
mp_relic02 1
mp_wargames 1
mp_rise 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ void function SelectFirstInfectedDelayed()
wait 10.0 + RandomFloat( 5.0 )

array<entity> players = GetPlayerArray()
entity infected = players[ RandomInt( players.len() ) ]

// End game if server empty on selecting infected
if ( !players.len() )
{
printt( "Couldn't select first infected: player array was empty" )
SetWinner( INFECTION_TEAM_SURVIVOR )
return
}

entity infected = players.getrandom()

InfectPlayer( infected )
RespawnInfected( infected )
Expand Down
2 changes: 1 addition & 1 deletion Northstar.CustomServers/mod/scripts/vscripts/_items.nut
Original file line number Diff line number Diff line change
Expand Up @@ -10094,7 +10094,7 @@ void function InitUnlockAsEntitlement( string itemRef, string parentRef, int ent
unlock = file.entitlementUnlocks[fullRef]
}

unlock.entitlementIds.append( entitlementId )
unlock.entitlementIds.append( 1 ) // Using `1` here instead of the huge DLC check I did previously. Having the `1` seems to keep all paid cosmetics unlocked with progression enabled.
}

array<int> function GetEntitlementIds( string itemRef, string parentRef = "" )
Expand Down
20 changes: 4 additions & 16 deletions Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ void function SvLoadoutsMP_Init()
AddClientCommandCallback( "InGameMPMenuClosed", ClientCommandCallback_InGameMPMenuClosed )
AddClientCommandCallback( "LoadoutMenuClosed", ClientCommandCallback_LoadoutMenuClosed )
}

AddCallback_OnPlayerKilled( DestroyDroppedWeapon )
}

void function SetLoadoutGracePeriodEnabled( bool enabled )
Expand All @@ -62,20 +60,10 @@ void function SetLoadoutGracePeriodEnabled( bool enabled )

void function SetWeaponDropsEnabled( bool enabled )
{
file.weaponDropsEnabled = enabled
}

void function DestroyDroppedWeapon( entity victim, entity attacker, var damageInfo )
{
if ( !file.weaponDropsEnabled && IsValid( victim.GetActiveWeapon() ) )
thread DelayDestroyDroppedWeapon( victim.GetActiveWeapon() )
}

void function DelayDestroyDroppedWeapon( entity weapon )
{
WaitEndFrame()
if ( IsValid( weapon ) )
weapon.Destroy()
if( enabled )
FlagSet( "WeaponDropsAllowed" )
else
FlagClear( "WeaponDropsAllowed" )
}

void function AddCallback_OnTryGetTitanLoadout( TryGetTitanLoadoutCallbackType callback )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,15 @@ void function UpdateMarksForKill( entity victim, entity attacker, var damageInfo
{
if ( victim == GetMarked( victim.GetTeam() ) )
{
MessageToAll( eEventNotifications.MarkedForDeathKill, null, victim, attacker.GetEncodedEHandle() )
// handle suicides. Not sure what the actual message is that vanilla shows for this
// but this will prevent crashing for now
bool isSuicide = IsSuicide( victim, attacker, DamageInfo_GetDamageSourceIdentifier( damageInfo ) )
entity actualAttacker = isSuicide ? victim : attacker

MessageToAll( eEventNotifications.MarkedForDeathKill, null, victim, actualAttacker.GetEncodedEHandle() )
svGlobal.levelEnt.Signal( "MarkKilled", { mark = victim } )
if ( attacker.IsPlayer() )

if ( !isSuicide && attacker.IsPlayer() )
attacker.SetPlayerGameStat( PGS_ASSAULT_SCORE, attacker.GetPlayerGameStat( PGS_ASSAULT_SCORE ) + 1 )
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ void function BaseGametype_Init_MPSP()
AddCallback_OnPlayerKilled( CheckForAutoTitanDeath )
RegisterSignal( "PlayerRespawnStarted" )
RegisterSignal( "KillCamOver" )

FlagInit( "WeaponDropsAllowed", true )
}

void function SetIntermissionCamera( entity camera )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ global function SetTitanMeterGainScale

#if MP
global function CodeCallback_OnServerAnimEvent
global function CodeCallback_WeaponDropped
global function AddCallback_OnWeaponDropped
#endif

struct AccumulatedDamageData
Expand All @@ -43,6 +45,7 @@ struct
]

table<entity, AccumulatedDamageData> playerAccumulatedDamageData
array< void functionref( entity ) > weaponDroppedCallbacks
} file

void function CodeCallback_Init()
Expand Down Expand Up @@ -1030,4 +1033,26 @@ void function CodeCallback_OnServerAnimEvent( entity ent, string eventName )

PerfEnd( PerfIndexServer.CB_OnServerAnimEvent )
}

void function AddCallback_OnWeaponDropped( void functionref( entity ) callback )
{
file.weaponDroppedCallbacks.append( callback )
}

void function CodeCallback_WeaponDropped( entity weapon )
{
// shamelessly taken form SP
if ( !IsValid( weapon ) )
return

// Might look a bit hacky to put it here, but thats how SP does it
if ( !Flag( "WeaponDropsAllowed" ) )
{
weapon.Destroy()
return
}

foreach( callback in file.weaponDroppedCallbacks )
callback( weapon )
}
#endif // #if MP
2 changes: 1 addition & 1 deletion Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void function ScoreEvent_SetupEarnMeterValuesForMixedModes() // mixed modes in t
{
// todo needs earn/overdrive values
// player-controlled stuff
ScoreEvent_SetEarnMeterValues( "KillPilot", 0.07, 0.15 )
ScoreEvent_SetEarnMeterValues( "KillPilot", 0.07, 0.15, 0.33 ) // 5% for titan cores
ScoreEvent_SetEarnMeterValues( "KillTitan", 0.0, 0.15 )
ScoreEvent_SetEarnMeterValues( "TitanKillTitan", 0.0, 0.0 ) // unsure
ScoreEvent_SetEarnMeterValues( "PilotBatteryStolen", 0.0, 0.35 ) // this actually just doesn't have overdrive in vanilla even
Expand Down
Loading

0 comments on commit cb2498d

Please sign in to comment.