diff options
Diffstat (limited to 'Northstar.CustomServers/mod')
15 files changed, 308 insertions, 119 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut index abd189e8..a31963cf 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut @@ -267,15 +267,25 @@ void function TryGivePilotLoadoutForGracePeriod( entity player ) if ( ( ( Time() - respawnTimeReal <= CLASS_CHANGE_GRACE_PERIOD || GetGameState() < eGameState.Playing ) && file.loadoutGracePeriodEnabled ) || player.p.usingLoadoutCrate ) { - // because the game sucks and stuff Loadouts_TryGivePilotLoadout doesn't work in intro so have to do this manually - int loadoutIndex = GetPersistentSpawnLoadoutIndex( player, "pilot" ) - GivePilotLoadout( player, GetPilotLoadoutFromPersistentData( player, loadoutIndex ) ) - SetActivePilotLoadout( player ) - SetActivePilotLoadoutIndex( player, loadoutIndex ) + if ( !Loadouts_CanGivePilotLoadout( player ) && player.GetParent() != null && ( HasCinematicFlag( player, CE_FLAG_INTRO ) || HasCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) || HasCinematicFlag( player, CE_FLAG_WAVE_SPAWNING ) ) ) + thread GiveLoadoutWhenIntroOver( player ) + else + Loadouts_TryGivePilotLoadout( player ) player.p.usingLoadoutCrate = false } else SendHudMessage( player, "#LOADOUT_CHANGE_NEXT_BOTH", -1, 0.4, 255, 255, 255, 255, 0.15, 3.0, 0.5 ) // like 90% sure this is innacurate lol } -}
\ No newline at end of file +} + +void function GiveLoadoutWhenIntroOver( entity player ) +{ + player.EndSignal( "OnDestroy" ) + player.EndSignal( "OnDeath" ) + + while ( player.GetParent() != null && ( HasCinematicFlag( player, CE_FLAG_INTRO ) || HasCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) || HasCinematicFlag( player, CE_FLAG_WAVE_SPAWNING ) ) ) + WaitFrame() + + Loadouts_TryGivePilotLoadout( player ) +} diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut index 73277371..d1f4bd80 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut @@ -293,6 +293,9 @@ void function PlayerUsesAmpedWeaponsBurncardThreaded( entity player ) //weapons.extend( player.GetOffhandWeapons() ) // idk? unsure of vanilla behaviour here
foreach ( entity weapon in weapons )
{
+ if( weapon.GetWeaponPrimaryClipCountMax() > 0 )
+ weapon.SetWeaponPrimaryClipCount( weapon.GetWeaponPrimaryClipCountMax() ) // kind of a fix to get ammo to full, cba to give new weapon
+
weapon.RemoveMod( "silencer" ) // both this and the burnmod will override firing fx, if a second one overrides this we crash
foreach ( string mod in GetWeaponBurnMods( weapon.GetWeaponClassName() ) )
{
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut index 961816c7..0fee4f2c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut @@ -4,14 +4,16 @@ global function TryPlayWeaponBattleChatterLine void function BattleChatter_Init() { - //ShBattleChatter_Init() + AddCallback_OnPlayerGetsNewPilotLoadout( UpdatePlayerVoiceIndex ) } void function PlayBattleChatterLine( entity player, string conversationType ) { + int conversationIndex = GetConversationIndex( conversationType ) + foreach( entity otherPlayer in GetPlayerArray() ) if ( ShouldPlayBattleChatter( conversationType, otherPlayer, player ) && player != otherPlayer ) - Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_PlayBattleChatter", GetConversationIndex( conversationType ), player.GetEncodedEHandle() ) + Remote_CallFunction_Replay( otherPlayer, "ServerCallback_PlayBattleChatter", conversationIndex, player.GetEncodedEHandle() ) } void function TryPlayWeaponBattleChatterLine( entity player, entity weapon ) @@ -22,4 +24,22 @@ void function TryPlayWeaponBattleChatterLine( entity player, entity weapon ) expect string( chatterEvent ) PlayBattleChatterLine( player, chatterEvent ) +} + +void function UpdatePlayerVoiceIndex( entity player, PilotLoadoutDef voiceIndex ) +{ + if ( IsPlayerFemale( player ) ) + { + if ( player.IsMechanical() ) + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomAndroidFemaleBattleChatterVoice() ) + else + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomFemaleBattleChatterVoice() ) + } + else + { + if ( player.IsMechanical() ) + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomAndroidMaleBattleChatterVoice() ) + else + player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomMaleBattleChatterVoice() ) + } }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut index b638e92b..1a70c289 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_grunt_chatter_mp.gnut @@ -14,5 +14,5 @@ void function PlayGruntChatterMPLine( entity grunt, string conversationType ) foreach ( entity player in GetPlayerArray() ) if ( ShouldPlayGruntChatterMPLine( conversationType, player, grunt ) ) - Remote_CallFunction_NonReplay( player, "ServerCallback_PlayGruntChatterMP", GetConversationIndex( conversationType ), grunt.GetEncodedEHandle() ) + Remote_CallFunction_Replay( player, "ServerCallback_PlayGruntChatterMP", GetConversationIndex( conversationType ), grunt.GetEncodedEHandle() ) }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut index 2f9e0f84..74ba5371 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_spectre_chatter_mp.gnut @@ -14,5 +14,5 @@ void function PlaySpectreChatterMPLine( entity spectre, string conversationType foreach ( entity player in GetPlayerArray() ) if ( ShouldPlaySpectreChatterMPLine( conversationType, player, spectre ) ) - Remote_CallFunction_NonReplay( player, "ServerCallback_PlaySpectreChatterMP", GetConversationIndex( conversationType ), spectre.GetEncodedEHandle() ) + Remote_CallFunction_Replay( player, "ServerCallback_PlaySpectreChatterMP", GetConversationIndex( conversationType ), spectre.GetEncodedEHandle() ) }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut index 691f07fb..dda84976 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter.gnut @@ -39,8 +39,6 @@ global function SharedEarnMeter_AddEarnedAndOwned global function PlayerEarnMeter_SetEnabled global function PlayerEarnMeter_Enabled -global function PlayerEarnMeter_SetBoostByRef - global struct EarnMeterThresholdEarnedStruct { float threshold @@ -507,24 +505,4 @@ void function PlayerEarnMeter_SetEnabled( bool enabled ) bool function PlayerEarnMeter_Enabled() { return file.earnMeterEnabled -} - -void function PlayerEarnMeter_SetBoostByRef( entity player, string boostRef ) { - EarnObject earnobject = EarnObject_GetByRef( boostRef ) - BurnReward burncard = BurnReward_GetByRef( boostRef ) - - if ( Riff_BoostAvailability() != eBoostAvailability.Disabled ) - { - PlayerEarnMeter_SetReward( player, earnobject ) // pretty sure this works? - PlayerEarnMeter_SetRewardFrac( player, burncard.cost ) - PlayerEarnMeter_EnableReward( player ) - } - - if ( EarnMeterMP_IsTitanEarnGametype() ) - { - PlayerEarnMeter_SetGoal( player, EarnObject_GetByRef( GetTitanLoadoutForPlayer( player ).titanClass ) ) - PlayerEarnMeter_EnableGoal( player ) // prevents goalstate from being set incorrectly - } - else - PlayerEarnMeter_SetGoal( player, earnobject ) }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut index 1aa0f042..4417168a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/earn_meter/sv_earn_meter_mp.gnut @@ -2,6 +2,7 @@ untyped global function Sv_EarnMeterMP_Init global function EarnMeterMP_SetTitanLoadout global function EarnMeterMP_SetPassiveMeterGainEnabled +global function EarnMeterMP_SetBoostByRef struct { float playingStartTime @@ -36,7 +37,7 @@ void function SetupPlayerEarnMeter( entity player ) PlayerEarnMeter_Reset( player ) string burncardRef = GetSelectedBurnCardRef( player ) - PlayerEarnMeter_SetBoostByRef( player, burncardRef ) + EarnMeterMP_SetBoostByRef( player, burncardRef ) // catchup bonus for late joiners // todo: maths on this is fine but for some reason it won't set correctly, could be getting reset somewhere? @@ -176,4 +177,25 @@ void function EarnMeterMP_TitanEarned( entity player ) if ( PlayerEarnMeter_GetRewardFrac( player ) != 0 ) PlayerEarnMeter_EnableReward( player ) } +} + +void function EarnMeterMP_SetBoostByRef( entity player, string boostRef ) +{ + EarnObject earnobject = EarnObject_GetByRef( boostRef ) + BurnReward burncard = BurnReward_GetByRef( boostRef ) + + if ( Riff_BoostAvailability() != eBoostAvailability.Disabled ) + { + PlayerEarnMeter_SetReward( player, earnobject ) // pretty sure this works? + PlayerEarnMeter_SetRewardFrac( player, burncard.cost ) + PlayerEarnMeter_EnableReward( player ) + } + + if ( EarnMeterMP_IsTitanEarnGametype() ) + { + PlayerEarnMeter_SetGoal( player, EarnObject_GetByRef( GetTitanLoadoutForPlayer( player ).titanClass ) ) + PlayerEarnMeter_EnableGoal( player ) // prevents goalstate from being set incorrectly + } + else + PlayerEarnMeter_SetGoal( player, earnobject ) }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut index 8e5599a1..56e1d04f 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut @@ -2,6 +2,7 @@ untyped global function GamemodeCP_Init global function RateSpawnpoints_CP +global function DEV_PrintHardpointsInfo // needed for sh_gamemode_cp_dialogue global array<entity> HARDPOINTS @@ -157,104 +158,210 @@ void function StartHardpointThink() void function HardpointThink( HardpointStruct hardpoint ) { entity hardpointEnt = hardpoint.hardpoint - + float lastTime = Time() float lastScoreTime = Time() - + WaitFrame() // wait a frame so deltaTime is never zero + while ( GamePlayingOrSuddenDeath() ) { - int imcCappers = hardpoint.imcCappers.len() - int militiaCappers = hardpoint.militiaCappers.len() - - float deltaTime = Time() - lastTime - - int cappingTeam - if ( imcCappers > militiaCappers ) - cappingTeam = TEAM_IMC - else if ( militiaCappers > imcCappers ) - cappingTeam = TEAM_MILITIA - - if ( cappingTeam != TEAM_UNASSIGNED ) + int imcPilotCappers = 0 + int militiaPilotCappers = 0 + + int imcTitanCappers = 0 + int militiaTitanCappers = 0 + + float currentTime = Time() + float deltaTime = currentTime - lastTime + + foreach(entity p in hardpoint.imcCappers) { - // hardpoint is owned by controlling team - if ( hardpointEnt.GetTeam() == cappingTeam ) + if(p.IsPlayer()) { - // hardpoint is being neutralised, reverse the neutralisation - if ( GetHardpointCappingTeam( hardpoint ) != cappingTeam || GetHardpointCaptureProgress( hardpoint ) < 1.0 ) + if(p.IsTitan()) { - SetHardpointCappingTeam( hardpoint, cappingTeam ) - SetHardpointCaptureProgress( hardpoint, min( 1.0, GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / CAPTURE_DURATION_CAPTURE ) ) ) + imcTitanCappers = imcTitanCappers + 1 } - // hardpoint is fully captured, start amping if amping is enabled - else if ( file.ampingEnabled && GetHardpointState( hardpoint ) < CAPTURE_POINT_STATE_AMPING ) - SetHardpointState( hardpoint, CAPTURE_POINT_STATE_AMPING ) - - // amp the hardpoint - if ( GetHardpointState( hardpoint ) == CAPTURE_POINT_STATE_AMPING ) + else { - SetHardpointCaptureProgress( hardpoint, min( 2.0, GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / HARDPOINT_AMPED_DELAY ) ) ) - if ( GetHardpointCaptureProgress( hardpoint ) == 2.0 ) + imcPilotCappers = imcPilotCappers + 1 + } + } + } + foreach(entity p in hardpoint.militiaCappers) + { + if(p.IsPlayer()) + { + if(p.IsTitan()) + { + militiaTitanCappers = militiaTitanCappers + 1 + } + else + { + + militiaPilotCappers = militiaPilotCappers + 1 + } + } + } + int imcCappers + int militiaCappers + + bool hardpointBlocked = false + if((imcTitanCappers+militiaTitanCappers)>0) + { + imcCappers = imcTitanCappers + militiaCappers = militiaTitanCappers + } + else + { + imcCappers = imcPilotCappers + militiaCappers = militiaPilotCappers + } + + int cappingTeam + int capperAmount = 0 + + if((imcCappers > 0) && (militiaCappers > 0)){ + hardpointBlocked = true + } + else if ( imcCappers > 0 ) + { + cappingTeam = TEAM_IMC + capperAmount = imcCappers + } + else if ( militiaCappers > 0 ) + { + cappingTeam = TEAM_MILITIA + capperAmount = militiaCappers + } + capperAmount = int(min(capperAmount, 3)) + + if(hardpointBlocked) + { + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_HALTED) + } + else if(cappingTeam==TEAM_UNASSIGNED)//nobody on point + { + + switch(GetHardpointState(hardpoint)) + { + case CAPTURE_POINT_STATE_UNASSIGNED: + SetHardpointCaptureProgress(hardpoint,max(0.0,GetHardpointCaptureProgress(hardpoint)-(deltaTime/CAPTURE_DURATION_CAPTURE))) + if(GetHardpointCaptureProgress(hardpoint)==0.0) { - SetHardpointState( hardpoint, CAPTURE_POINT_STATE_AMPED ) - - // can't use the dialogue functions here because for some reason GamemodeCP_VO_Amped isn't global? - PlayFactionDialogueToTeam( "amphp_youAmped" + hardpointEnt.kv.hardpointGroup, cappingTeam ) - PlayFactionDialogueToTeam( "amphp_enemyAmped" + hardpointEnt.kv.hardpointGroup, GetOtherTeam( cappingTeam ) ) + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_UNASSIGNED) + SetHardpointCappingTeam(hardpoint,TEAM_UNASSIGNED) } + break + case CAPTURE_POINT_STATE_CAPTURED: + SetHardpointCappingTeam(hardpoint,hardpointEnt.GetTeam()) + SetHardpointCaptureProgress(hardpoint,min(1.0,GetHardpointCaptureProgress(hardpoint)+(deltaTime/CAPTURE_DURATION_CAPTURE))) + break + case CAPTURE_POINT_STATE_AMPED: + case CAPTURE_POINT_STATE_AMPING: + SetHardpointCappingTeam(hardpoint,hardpointEnt.GetTeam()) + SetHardpointCaptureProgress(hardpoint,max(1.0,GetHardpointCaptureProgress(hardpoint)-(deltaTime/HARDPOINT_AMPED_DELAY))) + if(GetHardpointCaptureProgress(hardpoint)<=1.001) + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_CAPTURED) + break + } + } + else if(hardpointEnt.GetTeam()==TEAM_UNASSIGNED) + { + if(GetHardpointCappingTeam(hardpoint)==TEAM_UNASSIGNED) + { + SetHardpointCaptureProgress( hardpoint, min(1.0,GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / CAPTURE_DURATION_CAPTURE * capperAmount) ) ) + SetHardpointCappingTeam(hardpoint,cappingTeam) + if(GetHardpointCaptureProgress(hardpoint)>=1.0) + { + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_CAPTURED) + SetTeam( hardpointEnt, cappingTeam ) + SetTeam( hardpoint.prop, cappingTeam ) + EmitSoundOnEntityToTeamExceptPlayer( hardpointEnt, "hardpoint_console_captured", cappingTeam, null ) + GamemodeCP_VO_Captured( hardpointEnt ) } } - else // we don't own this hardpoint, cap it + else if(GetHardpointCappingTeam(hardpoint)==cappingTeam) { - SetHardpointCappingTeam( hardpoint, cappingTeam ) - GamemodeCP_VO_StartCapping( hardpointEnt ) // this doesn't consistently trigger for some reason - - SetHardpointCaptureProgress( hardpoint, min( 1.0, GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / CAPTURE_DURATION_CAPTURE ) ) ) - - if ( GetHardpointCaptureProgress( hardpoint ) >= 1.0 ) + SetHardpointCaptureProgress( hardpoint,min(1.0, GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / CAPTURE_DURATION_CAPTURE * capperAmount) ) ) + if(GetHardpointCaptureProgress(hardpoint)>=1.0) { + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_CAPTURED) SetTeam( hardpointEnt, cappingTeam ) SetTeam( hardpoint.prop, cappingTeam ) - SetHardpointState( hardpoint, CAPTURE_POINT_STATE_CAPTURED ) - EmitSoundOnEntityToTeamExceptPlayer( hardpointEnt, "hardpoint_console_captured", cappingTeam, null ) GamemodeCP_VO_Captured( hardpointEnt ) } } + else + { + SetHardpointCaptureProgress( hardpoint,max(0.0, GetHardpointCaptureProgress( hardpoint ) - ( deltaTime / CAPTURE_DURATION_CAPTURE * capperAmount) ) ) + if(GetHardpointCaptureProgress(hardpoint)==0.0) + { + SetHardpointCappingTeam(hardpoint,cappingTeam) + if(GetHardpointCaptureProgress(hardpoint)>=1) + { + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_CAPTURED) + SetTeam( hardpointEnt, cappingTeam ) + SetTeam( hardpoint.prop, cappingTeam ) + EmitSoundOnEntityToTeamExceptPlayer( hardpointEnt, "hardpoint_console_captured", cappingTeam, null ) + GamemodeCP_VO_Captured( hardpointEnt ) + } + } + + } } - // capture halting - else if ( imcCappers > 0 && imcCappers == militiaCappers ) - SetHardpointState( hardpoint, CAPTURE_POINT_STATE_HALTED ) - // amped decay - else if ( imcCappers == 0 && militiaCappers == 0 && GetHardpointState( hardpoint ) >= CAPTURE_POINT_STATE_AMPING ) + else if(hardpointEnt.GetTeam()!=cappingTeam) { - // it seems like network vars won't change if they're too similar? often we get situations here where it's tryna change from 1.00098 to 1 which doesn't work - // so we need to check the "real" progress manually - // have only gotten this issue here so far, but in theory i think this could be an issue in a good few places, worth looking out for - // tho, idk might not be, we don't work with numbers at this small of a scale too often - float realProgress = max( 1.0, GetHardpointCaptureProgress( hardpoint ) - ( deltaTime / HARDPOINT_AMPED_DELAY ) ) - SetHardpointCaptureProgress( hardpoint, realProgress ) - - if ( realProgress == 1 ) - SetHardpointState( hardpoint, CAPTURE_POINT_STATE_CAPTURED ) - // dont use unamping atm - //else - // SetHardpointState( hardpoint, CAPTURE_POINT_STATE_SELF_UNAMPING ) + SetHardpointCappingTeam(hardpoint,cappingTeam) + SetHardpointCaptureProgress( hardpoint,max(0.0, GetHardpointCaptureProgress( hardpoint ) - ( deltaTime / CAPTURE_DURATION_CAPTURE * capperAmount) ) ) + if(GetHardpointCaptureProgress(hardpoint)<=1.0) + { + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_CAPTURED)//unamp + } + if(GetHardpointCaptureProgress(hardpoint)<=0.0) + { + SetHardpointCaptureProgress(hardpoint,1.0) + SetTeam( hardpointEnt, cappingTeam ) + SetTeam( hardpoint.prop, cappingTeam ) + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_CAPTURED) + EmitSoundOnEntityToTeamExceptPlayer( hardpointEnt, "hardpoint_console_captured", cappingTeam, null ) + GamemodeCP_VO_Captured( hardpointEnt ) + } } - - // scoring - if ( hardpointEnt.GetTeam() != TEAM_UNASSIGNED && GetHardpointState( hardpoint ) >= CAPTURE_POINT_STATE_CAPTURED && Time() - lastScoreTime >= TEAM_OWNED_SCORE_FREQ ) + else if(hardpointEnt.GetTeam()==cappingTeam) { - lastScoreTime = Time() - - // 2x score if amped + SetHardpointCappingTeam(hardpoint,cappingTeam) + if(GetHardpointCaptureProgress(hardpoint)<1.0) + { + SetHardpointCaptureProgress(hardpoint,GetHardpointCaptureProgress(hardpoint)+(deltaTime/CAPTURE_DURATION_CAPTURE*capperAmount)) + } + else if(file.ampingEnabled)//amping or reamping + { + if(GetHardpointState(hardpoint)<CAPTURE_POINT_STATE_AMPING) + SetHardpointState(hardpoint,CAPTURE_POINT_STATE_AMPING) + SetHardpointCaptureProgress( hardpoint, min( 2.0, GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / HARDPOINT_AMPED_DELAY * capperAmount ) ) ) + if(GetHardpointCaptureProgress(hardpoint)==2.0&&!(GetHardpointState(hardpoint)==CAPTURE_POINT_STATE_AMPED)) + { + SetHardpointState( hardpoint, CAPTURE_POINT_STATE_AMPED ) + // can't use the dialogue functions here because for some reason GamemodeCP_VO_Amped isn't global? + PlayFactionDialogueToTeam( "amphp_youAmped" + hardpointEnt.kv.hardpointGroup, cappingTeam ) + PlayFactionDialogueToTeam( "amphp_enemyAmped" + hardpointEnt.kv.hardpointGroup, GetOtherTeam( cappingTeam ) ) + } + } + } + + if ( hardpointEnt.GetTeam() != TEAM_UNASSIGNED && GetHardpointState( hardpoint ) >= CAPTURE_POINT_STATE_CAPTURED && currentTime - lastScoreTime >= TEAM_OWNED_SCORE_FREQ && !hardpointBlocked&&!(cappingTeam==GetOtherTeam(hardpointEnt.GetTeam()))) + { + lastScoreTime = currentTime if ( GetHardpointState( hardpoint ) == CAPTURE_POINT_STATE_AMPED ) AddTeamScore( hardpointEnt.GetTeam(), 2 ) - else + else if( GetHardpointState( hardpoint) >= CAPTURE_POINT_STATE_CAPTURED) AddTeamScore( hardpointEnt.GetTeam(), 1 ) } - - lastTime = Time() + + lastTime = currentTime WaitFrame() } } @@ -264,33 +371,33 @@ void function HardpointThink( HardpointStruct hardpoint ) void function TrackChevronStates() { // you get 1 amped arrow for chevron / 4, 1 unamped arrow for every 1 the amped chevrons - + while ( true ) { int imcChevron int militiaChevron - + foreach ( HardpointStruct hardpoint in file.hardpoints ) { if ( hardpoint.hardpoint.GetTeam() == TEAM_IMC ) { if ( hardpoint.hardpoint.GetHardpointState() == CAPTURE_POINT_STATE_AMPED ) imcChevron += 4 - else if ( hardpoint.hardpoint.GetHardpointState() >= CAPTURE_POINT_STATE_CAPTURED ) + else imcChevron++ } else if ( hardpoint.hardpoint.GetTeam() == TEAM_MILITIA ) { if ( hardpoint.hardpoint.GetHardpointState() == CAPTURE_POINT_STATE_AMPED ) militiaChevron += 4 - else if ( hardpoint.hardpoint.GetHardpointState() >= CAPTURE_POINT_STATE_CAPTURED ) + else militiaChevron++ } } - + SetGlobalNetInt( "imcChevronState", imcChevron ) SetGlobalNetInt( "milChevronState", militiaChevron ) - + WaitFrame() } } @@ -319,4 +426,35 @@ void function OnHardpointLeft( entity trigger, entity player ) hardpoint.imcCappers.remove( hardpoint.imcCappers.find( player ) ) else hardpoint.militiaCappers.remove( hardpoint.militiaCappers.find( player ) ) -}
\ No newline at end of file +} + +string function CaptureStateToString( int state ) +{ + switch ( state ) + { + case CAPTURE_POINT_STATE_UNASSIGNED: + return "UNASSIGNED" + case CAPTURE_POINT_STATE_HALTED: + return "HALTED" + case CAPTURE_POINT_STATE_CAPTURED: + return "CAPTURED" + case CAPTURE_POINT_STATE_AMPING: + return "AMPING" + case CAPTURE_POINT_STATE_AMPED: + return "AMPED" + } + return "UNKNOWN" +} + +void function DEV_PrintHardpointsInfo() +{ + foreach (entity hardpoint in HARDPOINTS) + { + printt( + "Hardpoint:", hardpoint.kv.hardpointGroup, + "|Team:", Dev_TeamIDToString(hardpoint.GetTeam()), + "|State:", CaptureStateToString(hardpoint.GetHardpointState()), + "|Progress:", GetGlobalNetFloat("objective" + hardpoint.kv.hardpointGroup + "Progress") + ) + } +} diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut index 64a78d35..a02b9072 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ps.nut @@ -30,7 +30,7 @@ void function GamemodePs_Init() void function GiveScoreForPlayerKill( entity victim, entity attacker, var damageInfo )
{
- if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() || GetGameState() != eGameState.Playing )
+ if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() && GetGameState() == eGameState.Playing )
AddTeamScore( attacker.GetTeam(), 1 )
table<int, bool> alreadyAssisted
@@ -230,4 +230,4 @@ void function RateSpawnpoints_SpawnZones( int checkClass, array<entity> spawnpoi spawn.CalculateRating( checkClass, player.GetTeam(), rating, rating )
}
-}
\ No newline at end of file +}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut index 974481c1..207af721 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_speedball.nut @@ -23,6 +23,7 @@ void function GamemodeSpeedball_Init() AddCallback_GameStateEnter( eGameState.Prematch, CreateFlagIfNoFlagSpawnpoint ) AddCallback_GameStateEnter( eGameState.Playing, ResetFlag ) + AddCallback_GameStateEnter( eGameState.WinnerDetermined,GamemodeSpeedball_OnWinnerDetermined) AddCallback_OnTouchHealthKit( "item_flag", OnFlagCollected ) AddCallback_OnPlayerKilled( OnPlayerKilled ) SetTimeoutWinnerDecisionFunc( TimeoutCheckFlagHolder ) @@ -147,3 +148,9 @@ int function TimeoutCheckFlagHolder() return file.flagCarrier.GetTeam() } + +void function GamemodeSpeedball_OnWinnerDetermined() +{ + if(IsValid(file.flagCarrier)) + file.flagCarrier.AddToPlayerGameStat( PGS_ASSAULT_SCORE, 1 ) +}
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut index 8699375a..a3ea5172 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut @@ -10,7 +10,7 @@ void function GamemodeTdm_Init() void function GiveScoreForPlayerKill( entity victim, entity attacker, var damageInfo )
{
- if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() || GetGameState() != eGameState.Playing )
+ if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() && GetGameState() == eGameState.Playing )
AddTeamScore( attacker.GetTeam(), 1 )
table<int, bool> alreadyAssisted
@@ -48,4 +48,4 @@ int function CheckScoreForDraw() return TEAM_MILITIA
return TEAM_UNASSIGNED
-}
\ No newline at end of file +}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut index 417d0fbf..3102326c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut @@ -71,7 +71,7 @@ void function PlayerWatchesTTDMIntroIntermissionCam( entity player ) void function AddTeamScoreForPlayerKilled( entity victim, entity attacker, var damageInfo )
{
- if ( victim == attacker || !victim.IsPlayer() || !attacker.IsPlayer() || GetGameState() != eGameState.Playing )
+ if ( victim == attacker || !victim.IsPlayer() || !attacker.IsPlayer() && GetGameState() == eGameState.Playing )
return
AddTeamScore( GetOtherTeam( victim.GetTeam() ), 1 )
@@ -85,4 +85,4 @@ int function CheckScoreForDraw() return TEAM_MILITIA
return TEAM_UNASSIGNED
-}
\ No newline at end of file +}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 2d39cf2d..e5c8799d 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -848,5 +848,9 @@ void function GiveTitanToPlayer( entity player ) float function GetTimeLimit_ForGameMode() { - return 100.0 + string mode = GameRules_GetGameMode() + string playlistString = "timelimit" + + // default to 10 mins, because that seems reasonable + return GetCurrentPlaylistVarFloat( playlistString, 10 ) }
\ No newline at end of file diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut index 887e97cc..b7fd4d52 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut @@ -95,7 +95,7 @@ void function ScoreEvent_PlayerKilled( entity victim, entity attacker, var damag // have to do this early before we reset victim's player killstreaks // nemesis when you kill a player that is dominating you - if ( attacker.IsPlayer() && attacker in victim.p.playerKillStreaks && victim.p.playerKillStreaks[ attacker ] == NEMESIS_KILL_REQUIREMENT ) + if ( attacker.IsPlayer() && attacker in victim.p.playerKillStreaks && victim.p.playerKillStreaks[ attacker ] >= NEMESIS_KILL_REQUIREMENT ) AddPlayerScore( attacker, "Nemesis" ) // reset killstreaks on specific players @@ -108,7 +108,7 @@ void function ScoreEvent_PlayerKilled( entity victim, entity attacker, var damag if ( !attacker.IsPlayer() ) return - + attacker.p.numberOfDeathsSinceLastKill = 0 // since they got a kill, remove the comeback trigger // pilot kill AddPlayerScore( attacker, "KillPilot", victim ) @@ -145,7 +145,7 @@ void function ScoreEvent_PlayerKilled( entity victim, entity attacker, var damag attacker.p.playerKillStreaks[ victim ]++ // dominating - if ( attacker.p.playerKillStreaks[ victim ] == DOMINATING_KILL_REQUIREMENT ) + if ( attacker.p.playerKillStreaks[ victim ] >= DOMINATING_KILL_REQUIREMENT ) AddPlayerScore( attacker, "Dominating" ) if ( Time() - attacker.s.lastKillTime > CASCADINGKILL_REQUIREMENT_TIME ) @@ -163,7 +163,7 @@ void function ScoreEvent_PlayerKilled( entity victim, entity attacker, var damag AddPlayerScore( attacker, "DoubleKill" ) else if ( attacker.s.currentTimedKillstreak == TRIPLEKILL_REQUIREMENT_KILLS ) AddPlayerScore( attacker, "TripleKill" ) - else if ( attacker.s.currentTimedKillstreak == MEGAKILL_REQUIREMENT_KILLS ) + else if ( attacker.s.currentTimedKillstreak >= MEGAKILL_REQUIREMENT_KILLS ) AddPlayerScore( attacker, "MegaKill" ) } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut index 87c9ea98..e7cc8224 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_angel_city.nut @@ -13,6 +13,7 @@ void function CodeCallback_MapInit() // there are some really busted titan startspawns that are on the fucking other side of the map from where they should be, so we remove them AddSpawnCallback( "info_spawnpoint_titan_start", TrimBadTitanStartSpawns ) + AddSpawnCallback( "sky_camera", FixSkycamFog ) } void function TrimBadTitanStartSpawns( entity spawn ) @@ -24,4 +25,10 @@ void function TrimBadTitanStartSpawns( entity spawn ) if ( Distance2D( spawn.GetOrigin(), comparisonOrigin ) >= 2000.0 ) spawn.Destroy() +} + +void function FixSkycamFog( entity skycam ) +{ + if ( skycam.GetTargetName() == "skybox_cam_level" ) + skycam.kv.useworldfog = 1 }
\ No newline at end of file |