diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-05 16:03:50 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-05 16:03:50 +0000 |
commit | 51e16034230f4dd759900c7922b8db43941e0a70 (patch) | |
tree | 6492337f6855e2403db0376b8d1021196df80879 /Northstar.CustomServers/mod/scripts/vscripts/gamemodes | |
parent | b48fd143624f2b887699acd98d9a4c55b792ab0e (diff) | |
download | NorthstarMods-51e16034230f4dd759900c7922b8db43941e0a70.tar.gz NorthstarMods-51e16034230f4dd759900c7922b8db43941e0a70.zip |
big commit for playtesting
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/gamemodes')
4 files changed, 73 insertions, 63 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut index 090814cb..62fd52c9 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_featured_mode_settings.gnut @@ -113,13 +113,10 @@ void function FeaturedModeSettingsSetupPilotLoadouts( entity player ) void function FeaturedModeSettingsSetupTitanLoadouts( entity player, entity titan ) { - // this doesn't work atm, figure out how it should work and fix at some point - entity soul = player.GetTitanSoul() if ( IsFeaturedMode( "turbo_titans" ) ) { - if ( GetSoulTitanSubClass( soul ) == "stryder" || GetSoulTitanSubClass( soul ) == "atlas" ) - GivePassive( player, ePassives.PAS_MOBILITY_DASH_CAPACITY ) - else - GivePassive( player, ePassives.PAS_DASH_RECHARGE ) + array<string> settingsMods = player.GetPlayerSettingsMods() + settingsMods.append( "turbo_titan" ) + player.SetPlayerSettingsWithMods( player.GetPlayerSettings(), settingsMods ) } }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut index a30944cf..a8089679 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_aitdm.nut @@ -1,12 +1,6 @@ global function GamemodeAITdm_Init -global function RateSpawnpoints_Frontline void function GamemodeAITdm_Init() { -} - -void function RateSpawnpoints_Frontline(int _0, array<entity> _1, int _2, entity _3) -{ - }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut index 8d0545cb..326f3302 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_mfd.nut @@ -1,9 +1,11 @@ untyped global function GamemodeMfd_Init +global function RateSpawnpoints_Frontline struct { entity imcLastMark entity militiaLastMark + bool isMfdPro } file void function GamemodeMfd_Init() @@ -11,6 +13,16 @@ void function GamemodeMfd_Init() GamemodeMfdShared_Init() RegisterSignal( "MarkKilled" ) + + // todo + if ( GAMETYPE == MARKED_FOR_DEATH_PRO ) + { + file.isMfdPro = true + SetRespawnsEnabled( true ) + SetRoundBased( true ) + SetShouldUseRoundWinningKillReplay( true ) + Riff_ForceSetEliminationMode( eEliminationMode.Pilots ) + } AddCallback_OnPlayerKilled( UpdateMarksForKill ) AddCallback_GameStateEnter( eGameState.Playing, CreateInitialMarks ) @@ -170,63 +182,57 @@ void function UpdateMarksForKill( entity victim, entity attacker, var damageInfo } } -/* -void function MarkPlayers() +// could probably put this in spawn.nut? only here because i believe it's the main mode that uses this func +void function RateSpawnpoints_Frontline( int checkClass, array<entity> spawnpoints, int team, entity player ) { - // todo: need to handle disconnecting marks - if ( !TargetsMarkedImmediately() ) - wait MFD_BETWEEN_MARKS_TIME - + Frontline frontline = GetFrontline( player.GetTeam() ) - // wait until we actually have 2 valid players - array<entity> imcPlayers - array<entity> militiaPlayers - while ( imcPlayers.len() == 0 || militiaPlayers.len() == 0 ) - { - imcPlayers = GetPlayerArrayOfTeam( TEAM_IMC ) - militiaPlayers = GetPlayerArrayOfTeam( TEAM_MILITIA ) - - WaitFrame() - } + // heavily based on ctf spawn algo iteration 4, only changes it at the end + array<entity> startSpawns = SpawnPoints_GetPilotStart( team ) + array<entity> enemyStartSpawns = SpawnPoints_GetPilotStart( GetOtherTeam( team ) ) + array<entity> enemyPlayers = GetPlayerArrayOfTeam_Alive( team ) - // decide marks - entity imcMark = imcPlayers[ RandomInt( imcPlayers.len() ) ] - level.mfdPendingMarkedPlayerEnt[ TEAM_IMC ].SetOwner( imcMark ) + // get average startspawn position and max dist between spawns + // could probably cache this, tbh, not like it should change outside of halftimes + vector averageFriendlySpawns + float maxFriendlySpawnDist - entity militiaMark = militiaPlayers[ RandomInt( militiaPlayers.len() ) ] - level.mfdPendingMarkedPlayerEnt[ TEAM_MILITIA ].SetOwner( militiaMark ) - - foreach ( entity player in GetPlayerArray() ) + foreach ( entity spawn in startSpawns ) { - Remote_CallFunction_NonReplay( player, "SCB_MarkedChanged" ) - Remote_CallFunction_NonReplay( player, "ServerCallback_MFD_StartNewMarkCountdown", Time() + MFD_COUNTDOWN_TIME ) - } + foreach ( entity otherSpawn in startSpawns ) + { + float dist = Distance2D( spawn.GetOrigin(), otherSpawn.GetOrigin() ) + if ( dist > maxFriendlySpawnDist ) + maxFriendlySpawnDist = dist + } - wait MFD_COUNTDOWN_TIME + averageFriendlySpawns += spawn.GetOrigin() + } - while ( !IsAlive( imcMark ) || !IsAlive( militiaMark ) ) - WaitFrame() + averageFriendlySpawns /= startSpawns.len() - // clear pending marks - level.mfdPendingMarkedPlayerEnt[ TEAM_IMC ].SetOwner( null ) - level.mfdPendingMarkedPlayerEnt[ TEAM_MILITIA ].SetOwner( null ) + // get average enemy startspawn position + vector averageEnemySpawns - // set marks - level.mfdActiveMarkedPlayerEnt[ TEAM_IMC ].SetOwner( imcMark ) - level.mfdActiveMarkedPlayerEnt[ TEAM_MILITIA ].SetOwner( militiaMark ) + foreach ( entity spawn in enemyStartSpawns ) + averageEnemySpawns += spawn.GetOrigin() - foreach ( entity player in GetPlayerArray() ) - Remote_CallFunction_NonReplay( player, "SCB_MarkedChanged" ) + averageEnemySpawns /= enemyStartSpawns.len() + + // from here, rate spawns + float baseDistance = Distance2D( averageFriendlySpawns, averageEnemySpawns ) + float spawnIterations = ( baseDistance / maxFriendlySpawnDist ) / 2 - while ( IsAlive( imcMark ) && IsAlive( militiaMark ) ) - WaitFrame() + foreach ( entity spawn in spawnpoints ) + { + // ratings should max/min out at 100 / -100 + // start by prioritizing closer spawns, but not so much that enemies won't really affect them + float rating = 10 * ( 1.0 - Distance2D( averageFriendlySpawns, spawn.GetOrigin() ) / baseDistance ) - // clear marks - level.mfdActiveMarkedPlayerEnt[ TEAM_IMC ].SetOwner( null ) - level.mfdActiveMarkedPlayerEnt[ TEAM_MILITIA ].SetOwner( null ) + // rate based on distance to frontline, and then prefer spawns in the same dir from the frontline as the combatdir + rating += rating * ( 1.0 - ( Distance2D( spawn.GetOrigin(), frontline.friendlyCenter ) / baseDistance ) ) + rating *= fabs( frontline.combatDir.y - Normalize( spawn.GetOrigin() - averageFriendlySpawns ).y ) - foreach ( entity player in GetPlayerArray() ) - Remote_CallFunction_NonReplay( player, "SCB_MarkedChanged" ) - - thread MarkPlayers() -}*/
\ No newline at end of file + spawn.CalculateRating( checkClass, player.GetTeam(), rating, rating ) + } +}
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut index b660e89f..f8aa7799 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_riff_floor_is_lava.nut @@ -1,5 +1,10 @@ global function RiffFloorIsLava_Init +struct { + float pilotDamageMultiplier + float titanDamageMultiplier +} file + void function RiffFloorIsLava_Init() { AddCallback_OnPlayerRespawned( FloorIsLava_PlayerRespawned ) @@ -83,20 +88,28 @@ void function FloorIsLava_ThinkForPlayer( entity player ) player.EndSignal( "OnDestroy" ) player.EndSignal( "OnDeath" ) + float lastHeight + while ( true ) { WaitFrame() - - if ( player.GetOrigin().z < GetLethalFogTop() ) + + float height = player.GetOrigin().z + if ( height < GetLethalFogTop() ) { // do damage float damageMultiplier = 0.08 if ( player.IsTitan() ) - damageMultiplier *= 0.05 - + damageMultiplier = 0.04 + + // scale damage by time spent in fog and depth + damageMultiplier *= 1 - ( height / GetLethalFogTop() ) + player.TakeDamage( player.GetMaxHealth() * damageMultiplier, null, null, { damageSourceId = eDamageSourceId.floor_is_lava } ) wait 0.1 } + + lastHeight = height } }
\ No newline at end of file |