diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-15 00:41:45 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-15 00:41:45 +0000 |
commit | 3f7c13c0df67d1e80ffafa65f9fb6d87c38f4653 (patch) | |
tree | 86c154287f2fa858a2f9a07e7c49fec08a555c9d /Northstar.Custom | |
parent | 4f53db798e049fd55219a6a3ec3157568cac6828 (diff) | |
parent | 9d346f8c96cbfad841c82eaefa437015c9bf4ce4 (diff) | |
download | NorthstarMods-3f7c13c0df67d1e80ffafa65f9fb6d87c38f4653.tar.gz NorthstarMods-3f7c13c0df67d1e80ffafa65f9fb6d87c38f4653.zip |
Merge branch 'main' of https://github.com/R2Northstar/NorthstarMods
Diffstat (limited to 'Northstar.Custom')
11 files changed, 577 insertions, 100 deletions
diff --git a/Northstar.Custom/keyvalues/playlists_v2.txt b/Northstar.Custom/keyvalues/playlists_v2.txt index 3bf111b5..0800ef6d 100644 --- a/Northstar.Custom/keyvalues/playlists_v2.txt +++ b/Northstar.Custom/keyvalues/playlists_v2.txt @@ -258,6 +258,26 @@ playlists gamemode_score_hint #GAMEMODE_SCORE_HINT_TDM } } + sns + { + inherit defaults + vars + { + name #PL_sns + lobbytitle #PL_sns_lobby + description #PL_sns_desc + hint #PL_sns_desc + abbreviation #PL_sns_abbr + image ffa + at_turrets_enabled 0 + max_players 16 + max_teams 20 + scorelimit 300 + classic_mp 1 + + gamemode_score_hint #GAMEMODE_SCORE_HINT_FFA + } + } } Playlists { @@ -564,18 +584,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 @@ -626,7 +646,7 @@ playlists mp_glitch 1 mp_angel_city 1 mp_colony02 1 - mp_relic02 1 + mp_relic02 1 mp_grave 1 mp_homestead 1 mp_drydock 1 @@ -635,7 +655,7 @@ playlists mp_eden 2 mp_black_water_canal 1 mp_glitch 1 - mp_relic02 1 + mp_relic02 1 mp_wargames 1 mp_rise 1 mp_crashsite3 1 @@ -819,18 +839,69 @@ 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 + } + } + } + } + sns + { + inherit defaults + vars + { + name #PL_sns + lobbytitle #PL_sns_lobby + description #PL_sns_desc + hint #PL_sns_desc + abbreviation #PL_sns_abbr + image ps + max_players 16 + max_teams 20 + scorelimit 300 + classic_mp 1 + mixtape_timeout 120 + visible 0 + + gamemode_score_hint #GAMEMODE_SCORE_HINT_FFA + } + gamemodes + { + sns + { + maps + { + 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_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 diff --git a/Northstar.Custom/keyvalues/scripts/weapons/mp_weapon_wingman_n.txt b/Northstar.Custom/keyvalues/scripts/weapons/mp_weapon_wingman_n.txt index ba6f0964..da0c2601 100644 --- a/Northstar.Custom/keyvalues/scripts/weapons/mp_weapon_wingman_n.txt +++ b/Northstar.Custom/keyvalues/scripts/weapons/mp_weapon_wingman_n.txt @@ -2,10 +2,27 @@ WeaponData { Mods { - one_in_the_chamber + one_in_the_chamber { - damage_near_value "9999" - damage_far_value "9999" + damage_near_value "9999" + damage_far_value "9999" + damage_very_far_value "9999" + } + sns + { + damage_near_value "9999" + damage_far_value "9999" + damage_very_far_value "9999" + ammo_clip_size "1" + reload_time "*0.5" + reload_time_late1 "*0.5" + reloadempty_time "*0.5" + reloadempty_time_late1 "*0.5" + bolt_bounce_frac "0.7" + projectile_damage_reduction_per_bounce "0.0" + projectile_damages_owner "0" + projectile_ricochet_max_count "3" + ads_move_speed_scale "1" } } }
\ No newline at end of file diff --git a/Northstar.Custom/mod.json b/Northstar.Custom/mod.json index de71af58..4c933b1c 100644 --- a/Northstar.Custom/mod.json +++ b/Northstar.Custom/mod.json @@ -1,21 +1,31 @@ { - "Name" : "Northstar.Custom", + "Name": "Northstar.Custom", "Description": "Custom content for Northstar: extra weapons, gamemodes, etc.", "Version": "1.1.0", "LoadPriority": 1, "RequiredOnClient": true, - "ConVars": [ { + "Name": "ns_disallowed_tacticals", + "DefaultValue": "" + }, + { + "Name": "ns_disallowed_tactical_replacement", + "DefaultValue": "" + }, + { "Name": "ns_disallowed_weapons", "DefaultValue": "" }, { "Name": "ns_disallowed_weapon_primary_replacement", "DefaultValue": "mp_weapon_rspn101" + }, + { + "Name": "ns_force_melee", + "DefaultValue": "" } ], - "Scripts": [ { "Path": "sh_northstar_custom_precache.gnut", @@ -23,7 +33,6 @@ "ClientCallback": { "After": "NorthstarCustomPrecache" }, - "ServerCallback": { "After": "NorthstarCustomPrecache" } @@ -35,19 +44,16 @@ "After": "NorthstarDevCommands_Init" } }, - { "Path": "weapons/mp_weapon_peacekraber.nut", "RunOn": "( CLIENT || SERVER ) && MP" }, - { "Path": "gamemodes/sh_gamemode_chamber.nut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeChamber_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeChamber_Init" } @@ -66,7 +72,6 @@ "ClientCallback": { "Before": "Sh_GamemodeHidden_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeHidden_Init" } @@ -79,14 +84,31 @@ "Path": "gamemodes/cl_gamemode_hidden.nut", "RunOn": "CLIENT && MP" }, - + { + "Path": "gamemodes/sh_gamemode_sns.gnut", + "RunOn": "SERVER || CLIENT", + "ServerCallback": { + "Before": "SNSMode_Init" + }, + "ClientCallback": { + "Before": "SNSMode_Init" + } + }, + { + "Path": "gamemodes/cl_gamemode_sns.gnut", + "RunOn": "CLIENT" + }, + { + "Path": "gamemodes/_gamemode_sns.gnut", + "RunOn": "SERVER" + }, + { "Path": "gamemodes/sh_gamemode_fw_custom.nut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "SHCreateGamemodeFW_Init" }, - "ServerCallback": { "Before": "SHCreateGamemodeFW_Init" } @@ -99,14 +121,12 @@ "Path": "gamemodes/cl_gamemode_fw.nut", "RunOn": "CLIENT && MP" }, - { "Path": "gamemodes/sh_gamemode_gg.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeGG_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeGG_Init" } @@ -119,14 +139,12 @@ "Path": "gamemodes/cl_gamemode_gg.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "gamemodes/sh_gamemode_tt.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeTT_Init" - }, - + }, "ServerCallback": { "Before": "Sh_GamemodeTT_Init" } @@ -139,14 +157,12 @@ "Path": "gamemodes/cl_gamemode_tt.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "gamemodes/sh_gamemode_inf.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeInfection_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeInfection_Init" } @@ -159,7 +175,6 @@ "Path": "gamemodes/cl_gamemode_inf.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "_droppod_spawn.gnut", "RunOn": "SERVER && MP", @@ -173,7 +188,6 @@ "ClientCallback": { "Before": "Sh_GamemodeArena_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeArena_Init" } @@ -181,15 +195,12 @@ { "Path": "gamemodes/sh_arena_loadouts.gnut", "RunOn": "UI || MP", - "ClientCallback": { "After": "InitialiseArenaLoadouts" }, - "ServerCallback": { "After": "InitialiseArenaLoadouts" }, - "UICallback": { "After": "InitialiseArenaLoadouts" } @@ -202,14 +213,12 @@ "Path": "gamemodes/cl_gamemode_arena.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "gamemodes/sh_gamemode_kr.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeKR_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeKR_Init" } @@ -222,14 +231,12 @@ "Path": "gamemodes/cl_gamemode_kr.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "gamemodes/sh_gamemode_fastball.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeFastball_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeFastball_Init" } @@ -246,14 +253,12 @@ "Path": "gamemodes/cl_gamemode_fastball.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "gamemodes/sh_gamemode_hs.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeHideAndSeek_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeHideAndSeek_Init" } @@ -266,41 +271,34 @@ "Path": "gamemodes/cl_gamemode_hs.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "gamemodes/sh_gamemode_ctf_comp.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "ShGamemodeCTFComp_Init" }, - "ServerCallback": { "Before": "ShGamemodeCTFComp_Init" } }, - { "Path": "gamemodes/sh_gamemode_tffa.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "Before": "Sh_GamemodeTFFA_Init" }, - "ServerCallback": { "Before": "Sh_GamemodeTFFA_Init" } }, - { "Path": "gamemodes/_gamemode_tffa.gnut", "RunOn": "SERVER && MP" }, - { "Path": "gamemodes/cl_gamemode_tffa.gnut", "RunOn": "CLIENT && MP" }, - { "Path": "sh_3psequence_to_1p_hacks.gnut", "RunOn": "( CLIENT || SERVER ) && MP", @@ -308,49 +306,41 @@ "Before": "FirstPersonSequenceForce1P_Init", "After": "FirstPersonSequenceForce1P_InitPlaylistVars" }, - "ServerCallback": { "Before": "FirstPersonSequenceForce1P_Init", "After": "FirstPersonSequenceForce1P_InitPlaylistVars" } }, - { "Path": "gamemodes/sh_riff_instagib.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "After": "RiffInstagib_Init" }, - "ServerCallback": { "After": "RiffInstagib_Init" } }, - { "Path": "sh_custom_air_accel.gnut", "RunOn": "CLIENT || SERVER", "ClientCallback": { "After": "CustomAirAccelVars_Init" }, - "ServerCallback": { "After": "CustomAirAccelVars_Init" } }, - { "Path": "sh_promode.gnut", "RunOn": "MP", "ClientCallback": { "After": "Promode_Init" }, - "ServerCallback": { "After": "Promode_Init" } }, - { "Path": "sh_bleedout_damage.gnut", "RunOn": "( CLIENT || SERVER ) && MP", @@ -358,37 +348,31 @@ "Before": "BleedoutDamage_PreInit", "After": "BleedoutDamage_Init" }, - "ServerCallback": { "Before": "BleedoutDamage_PreInit", "After": "BleedoutDamage_Init" } }, - { "Path": "sh_custom_oob_timer.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "After": "CustomOOBTimer_Init" }, - "ServerCallback": { "After": "CustomOOBTimer_Init" } }, - { "Path": "rodeo/sh_classic_rodeo.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "After": "ClassicRodeo_InitPlaylistVars" }, - "ServerCallback": { "After": "ClassicRodeo_InitPlaylistVars" } }, - { "Path": "_disallowed_weapons.gnut", "RunOn": "SERVER && MP", @@ -396,20 +380,31 @@ "After": "DisallowedWeapons_Init" } }, - + { + "Path": "_disallowed_tacticals.gnut", + "RunOn": "SERVER && MP", + "ServerCallback": { + "After": "DisallowedTacticals_Init" + } + }, + { + "Path": "_force_melee.gnut", + "RunOn": "SERVER && MP", + "ServerCallback": { + "After": "ForceMelee_Init" + } + }, { "Path": "sh_custom_pilot_collision.gnut", "RunOn": "( CLIENT || SERVER ) && MP", "ClientCallback": { "After": "CustomPilotCollision_InitPlaylistVars" }, - "ServerCallback": { "After": "CustomPilotCollision_InitPlaylistVars" } } ], - "Maps": [ { "Name": "mp_skyway_v1", @@ -417,8 +412,7 @@ "RPak": "sp_skyway_v1" } ], - "Localisation": [ "resource/northstar_custom_%language%.txt" ] -} +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/_disallowed_tacticals.gnut b/Northstar.Custom/mod/scripts/vscripts/_disallowed_tacticals.gnut new file mode 100644 index 00000000..b4a41931 --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/_disallowed_tacticals.gnut @@ -0,0 +1,51 @@ +global function DisallowedTacticals_Init + +struct { + array<string> disallowedTacticals + string disallowedTacticalsStringLastVal + string disallowedTacticalReplacement +} file + +void function DisallowedTacticals_Init() +{ + UpdateDisallowedTacticalList() + AddCallback_OnPlayerRespawned( ReplacePlayerTactical ) + AddCallback_OnPlayerGetsNewPilotLoadout( ReplacePlayerTacticalForLoadoutChange ) +} + +void function UpdateDisallowedTacticalList() +{ + string cvar = GetConVarString( "ns_disallowed_tacticals" ) + if ( file.disallowedTacticalsStringLastVal == cvar ) + return + + file.disallowedTacticals = split( cvar, "," ) + foreach ( string tactical in file.disallowedTacticals ) + StringReplace( tactical, " ", "" ) + + file.disallowedTacticalReplacement = GetConVarString( "ns_disallowed_tactical_replacement") +} + +void function ReplacePlayerTactical( entity player ) +{ + UpdateDisallowedTacticalList() + if ( file.disallowedTacticals.len() == 0 ) + return + array<entity> offhand = player.GetOffhandWeapons() + + if ( file.disallowedTacticals.contains( offhand[1].GetWeaponClassName() ) ) + { + player.TakeOffhandWeapon( 1 ) + if ( file.disallowedTacticalReplacement != ""){ + player.GiveOffhandWeapon( file.disallowedTacticalReplacement, OFFHAND_SPECIAL ) + SendHudMessage( player, "Restricted tactical was replaced", -1, 0.4, 255, 255, 255, 255, 0.15, 3.0, 0.5 ) + } + else { SendHudMessage( player, "Restricted tactical was removed", -1, 0.4, 255, 255, 255, 255, 0.15, 3.0, 0.5 ) } + } + +} + +void function ReplacePlayerTacticalForLoadoutChange( entity player, PilotLoadoutDef loadout ) +{ + ReplacePlayerTactical( player ) +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/_force_melee.gnut b/Northstar.Custom/mod/scripts/vscripts/_force_melee.gnut new file mode 100644 index 00000000..cdc14fff --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/_force_melee.gnut @@ -0,0 +1,36 @@ +global function ForceMelee_Init + +struct { + string forcedMeleeWeapon +} file + +void function ForceMelee_Init() +{ + GetForcedMelee() + AddCallback_OnPlayerRespawned( ReplaceMelee ) + AddCallback_OnPlayerGetsNewPilotLoadout( ReplaceMeleeForLoadoutChange ) +} + +void function GetForcedMelee() +{ + string cvar = GetConVarString( "ns_force_melee" ) + if ( cvar == "" || cvar.len() == 0 ) + return + + file.forcedMeleeWeapon = cvar +} + +void function ReplaceMelee( entity player ) +{ + GetForcedMelee() + if ( file.forcedMeleeWeapon.len() == 0 ) + return + + player.TakeOffhandWeapon( 5 ) + player.GiveOffhandWeapon( file.forcedMeleeWeapon, OFFHAND_MELEE ) +} + +void function ReplaceMeleeForLoadoutChange( entity player, PilotLoadoutDef loadout ) +{ + ReplaceMelee( player ) +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut index 4f764af8..f6c0968c 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball.gnut @@ -125,10 +125,28 @@ void function GamemodeFastball_Init() FastballAddBuddySpawnForLevel( "mp_glitch", TEAM_IMC, < 4100, 890, 320>, < 0, 180, 0 > ) FastballAddPanelSpawnsForLevel( "mp_glitch", [ < 2703, 2170, 25 >, < 0, 0.00, 0 >, - < -192, 129, -55 >, < 0, 90.00, 0 >, + < -192, 129, -250 >, < 0, 90.00, 0 >, < -3088, -1905, 25 >, < 0, -180.00, 0 > ]) + FastballAddPropForLevel("mp_glitch", $"models/containers/plastic_pallet_01.mdl", [ + < -190, 0, -250 >, < 0, 90.00, 0 >, + < -190, 65, -250 >, < 0, 90.00, 0 >, + < -190, 130, -250 >, < 0, 90.00, 0 >, + < -190, 195, -250 >, < 0, 90.00, 0 >, + < -190, 250, -250 >, < 0, 90.00, 0 >, + < -125, 0, -250 >, < 0, 90.00, 0 >, + < -125, 65, -250 >, < 0, 90.00, 0 >, + < -125, 130, -250 >, < 0, 90.00, 0 >, + < -125, 195, -250 >, < 0, 90.00, 0 >, + < -125, 250, -250 >, < 0, 90.00, 0 >, + < -255, 0, -250 >, < 0, 90.00, 0 >, + < -255, 65, -250 >, < 0, 90.00, 0 >, + < -255, 130, -250 >, < 0, 90.00, 0 >, + < -255, 195, -250 >, < 0, 90.00, 0 >, + < -255, 250, -250 >, < 0, 90.00, 0 > + ] ) + FastballAddBuddySpawnForLevel( "mp_relic02", TEAM_MILITIA, < 4504, -3500, 150 >, < 0, -170, 0 > ) FastballAddBuddySpawnForLevel( "mp_relic02", TEAM_IMC, < -4505, -3750, 367>, < 0, 10, 0 > ) FastballAddPanelSpawnsForLevel( "mp_relic02", [ @@ -191,6 +209,25 @@ void function FastballAddPanelSpawnsForLevel( string level, array<vector> positi } } +void function FastballAddPropForLevel( string level, asset model, array<vector> positionsAndOrigins) +{ + if ( GetMapName() != level ) + return + + for ( int i = 0; i < positionsAndOrigins.len(); i += 2 ) + { + entity prop = CreateEntity( "prop_control_panel" ) + prop.SetValueForModelKey( model ) + prop.SetOrigin( positionsAndOrigins[ i ] ) + prop.SetAngles( positionsAndOrigins[ i + 1 ] ) + prop.kv.solid = SOLID_VPHYSICS + DispatchSpawn( prop ) + + prop.SetModel( model ) + } + +} + entity function CreatePanel( vector origin, vector angles ) { entity panel = CreateEntity( "prop_control_panel" ) @@ -256,4 +293,4 @@ int function FastballDecideWinner() return TEAM_IMC return TEAM_UNASSIGNED -} +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut new file mode 100644 index 00000000..f3b7d2ee --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut @@ -0,0 +1,144 @@ +global function SNS_Init + +struct { + string score_leader_highlight = "enemy_boss_bounty" // highlight effect applied to person in 1st place + string offhand_weapon = "mp_weapon_thermite_grenade" // offhand weapon + + bool reset_pulse_blade_cooldown_on_pulse_blade_kill = true + + int wme_kill_value = 10 + int offhand_kill_value = 10 + int reset_kill_value = 5 + int melee_kill_value = 5 +} file + + +void function SNS_Init() +{ + SetShouldUseRoundWinningKillReplay( true ) + ClassicMP_ForceDisableEpilogue( true ) + SetLoadoutGracePeriodEnabled( false ) // prevent modifying loadouts with grace period + SetWeaponDropsEnabled( false ) + Riff_ForceTitanAvailability( eTitanAvailability.Never ) + Riff_ForceBoostAvailability( eBoostAvailability.Disabled ) + + AddCallback_OnPlayerKilled( OnPlayerKilled ) + AddCallback_OnPlayerRespawned( OnPlayerRespawned ) + AddCallback_GameStateEnter( eGameState.WinnerDetermined, OnWinnerDetermined ) +} + +void function OnPlayerKilled( entity victim, entity attacker, var damageInfo ) +{ + if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() && GetGameState() == eGameState.Playing ) + { + SetRoundWinningKillReplayAttacker(attacker) + if ( DamageInfo_GetDamageSourceIdentifier( damageInfo ) == eDamageSourceId.mp_weapon_grenade_sonar || DamageInfo_GetDamageSourceIdentifier( damageInfo ) == eDamageSourceId.human_execution) + { + if (victim == GetWinningPlayer()) + { + foreach ( entity otherPlayer in GetPlayerArray() ) + { + if (otherPlayer == victim) + continue + Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_AnnounceKillLeaderBankrupt", victim.GetEncodedEHandle(), attacker.GetEncodedEHandle() ) + } + } + if (file.reset_pulse_blade_cooldown_on_pulse_blade_kill) + { + attacker.TakeWeaponNow( "mp_weapon_grenade_sonar" ) // resets cooldown if you kill with it + attacker.GiveOffhandWeapon( "mp_weapon_grenade_sonar", OFFHAND_LEFT ) + } + + EmitSoundOnEntityOnlyToPlayer( attacker, attacker, "UI_CTF_3P_TeamGrabFlag" ) + bankrupt(victim, attacker) + + AddTeamScore( attacker.GetTeam(), file.reset_kill_value ) + attacker.AddToPlayerGameStat( PGS_ASSAULT_SCORE, file.reset_kill_value ) + attacker.AddToPlayerGameStat( PGS_TITAN_KILLS, 1 ) + } + else if ( DamageInfo_GetDamageSourceIdentifier( damageInfo ) == eDamageSourceId.melee_pilot_emptyhanded ) + { + AddTeamScore( attacker.GetTeam(), file.melee_kill_value ) + attacker.AddToPlayerGameStat( PGS_ASSAULT_SCORE, file.melee_kill_value ) + } + else if ( DamageInfo_GetDamageSourceIdentifier( damageInfo ) == eDamageSourceId.mp_weapon_wingman_n ) + { + AddTeamScore( attacker.GetTeam(), file.wme_kill_value ) + attacker.AddToPlayerGameStat( PGS_ASSAULT_SCORE, file.wme_kill_value ) + } + else + { + AddTeamScore( attacker.GetTeam(), file.offhand_kill_value ) + attacker.AddToPlayerGameStat( PGS_ASSAULT_SCORE, file.offhand_kill_value ) + } + + if (attacker == GetWinningPlayer()) + SetHighlight( attacker ) + } +} + +void function bankrupt(entity player, entity attacker) { + while (GameRules_GetTeamScore(player.GetTeam()) > 0) { + AddTeamScore( player.GetTeam(), -1 ) + } + player.SetPlayerGameStat( PGS_ASSAULT_SCORE, 0) + + Remote_CallFunction_NonReplay( player , "ServerCallback_AnnounceBankrupt", attacker.GetEncodedEHandle() ) + EmitSoundOnEntityOnlyToPlayer( player, player, "UI_InGame_MarkedForDeath_PlayerMarked" ) +} + +void function OnWinnerDetermined() +{ + SetRespawnsEnabled( false ) + SetKillcamsEnabled( false ) +} + +void function OnPlayerRespawned( entity player ) +{ + foreach ( entity weapon in player.GetMainWeapons() ) + player.TakeWeaponNow( weapon.GetWeaponClassName() ) + + foreach ( entity weapon in player.GetOffhandWeapons() ) + player.TakeWeaponNow( weapon.GetWeaponClassName() ) + + array<string> mods = ["sns", "pas_fast_ads", "tactical_cdr_on_kill", "pas_run_and_gun", "pas_fast_swap"] + player.GiveWeapon( "mp_weapon_wingman_n", mods) + player.GiveOffhandWeapon( "melee_pilot_emptyhanded", OFFHAND_MELEE ) + player.GiveOffhandWeapon( file.offhand_weapon, OFFHAND_RIGHT ) + player.GiveOffhandWeapon( "mp_weapon_grenade_sonar", OFFHAND_LEFT ) + + if (player == GetWinningPlayer()) + SetHighlight( player ) + + thread OnPlayerRespawned_Threaded( player ) +} + +void function OnPlayerRespawned_Threaded( entity player ) +{ + // bit of a hack, need to rework earnmeter code to have better support for completely disabling it + // rn though this just waits for earnmeter code to set the mode before we set it back + WaitFrame() + if ( IsValid( player ) ) + PlayerEarnMeter_SetMode( player, eEarnMeterMode.DISABLED ) +} + +entity function GetWinningPlayer() +{ + entity bestplayer + + foreach ( entity player in GetPlayerArray() ) { + if (bestplayer == null) + bestplayer = player + + if (GameRules_GetTeamScore(player.GetTeam()) > GameRules_GetTeamScore(bestplayer.GetTeam())) + bestplayer = player + } + + return bestplayer +} + +void function SetHighlight(entity player) { + foreach ( entity player in GetPlayerArray() ) + Highlight_ClearEnemyHighlight(player) + Highlight_SetEnemyHighlight( player, file.score_leader_highlight ) +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_sns.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_sns.gnut new file mode 100644 index 00000000..f91c4255 --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_sns.gnut @@ -0,0 +1,55 @@ +global function ClGameModeSNS_Init +global function ServerCallback_AnnounceKillLeaderBankrupt +global function ServerCallback_AnnounceBankrupt + +void function ClGameModeSNS_Init() +{ + ClGameState_RegisterGameStateAsset( $"ui/gamestate_info_ffa.rpak" ) + + // add music for mode, this is copied directly from the ffa/fra music registered in cl_music.gnut + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_INTRO, "music_mp_freeagents_intro", TEAM_IMC ) + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_INTRO, "music_mp_freeagents_intro", TEAM_MILITIA ) + + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_WIN, "music_mp_freeagents_outro_win", TEAM_IMC ) + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_WIN, "music_mp_freeagents_outro_win", TEAM_MILITIA ) + + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_DRAW, "music_mp_freeagents_outro_lose", TEAM_IMC ) + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_DRAW, "music_mp_freeagents_outro_lose", TEAM_MILITIA ) + + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_LOSS, "music_mp_freeagents_outro_lose", TEAM_IMC ) + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_LOSS, "music_mp_freeagents_outro_lose", TEAM_MILITIA ) + + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_THREE_MINUTE, "music_mp_freeagents_almostdone", TEAM_IMC ) + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_THREE_MINUTE, "music_mp_freeagents_almostdone", TEAM_MILITIA ) + + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_LAST_MINUTE, "music_mp_freeagents_lastminute", TEAM_IMC ) + RegisterLevelMusicForTeam( eMusicPieceID.LEVEL_LAST_MINUTE, "music_mp_freeagents_lastminute", TEAM_MILITIA ) + AddCallback_GameStateEnter( eGameState.Postmatch, DisplayPostMatchTop3 ) +} + +void function ServerCallback_AnnounceKillLeaderBankrupt( int leaderEHandle, int killerEHandle ) +{ + entity player = GetEntityFromEncodedEHandle( leaderEHandle ) + entity killer = GetEntityFromEncodedEHandle( killerEHandle ) + AnnouncementData announcement = Announcement_Create( "#SNS_LEADER_BANKRUPT" ) + Announcement_SetSubText( announcement, Localize( "#SNS_LEADER_BANKRUPT_SUB", player.GetPlayerName(), killer.GetPlayerName())) + Announcement_SetTitleColor( announcement, <1,1,0> ) + Announcement_SetPurge( announcement, true ) + Announcement_SetPriority( announcement, 200 ) //Be higher priority than Titanfall ready indicator etc + Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK ) + Announcement_SetStyle( announcement, ANNOUNCEMENT_STYLE_QUICK ) + AnnouncementFromClass( GetLocalViewPlayer(), announcement ) +} + +void function ServerCallback_AnnounceBankrupt(int killerEHandle) +{ + entity killer = GetEntityFromEncodedEHandle( killerEHandle ) + AnnouncementData announcement = Announcement_Create( "#SNS_BANKRUPT" ) + Announcement_SetSubText( announcement, Localize( "#SNS_BANKRUPT_SUB", killer.GetPlayerName() )) + Announcement_SetTitleColor( announcement, <1,0,0> ) + Announcement_SetPurge( announcement, true ) + Announcement_SetPriority( announcement, 200 ) //Be higher priority than Titanfall ready indicator etc + Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK ) + Announcement_SetStyle( announcement, ANNOUNCEMENT_STYLE_QUICK ) + AnnouncementFromClass( GetLocalViewPlayer(), announcement ) +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_sns.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_sns.gnut new file mode 100644 index 00000000..b3d2c2da --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_sns.gnut @@ -0,0 +1,51 @@ +globalize_all_functions + +global array<var> consoleVars; +global const string GAMEMODE_SNS = "sns" + +void function SNSMode_Init() +{ + AddCallback_OnCustomGamemodesInit( CreateGamemodeSNS ) + AddCallback_OnRegisteringCustomNetworkVars( SNSRegisterNetworkVars ) +} + + +void function CreateGamemodeSNS() +{ + GameMode_Create( GAMEMODE_SNS ) + GameMode_SetName( GAMEMODE_SNS, "#GAMEMODE_SNS" ) + GameMode_SetDesc( GAMEMODE_SNS, "#PL_sns_desc" ) + GameMode_SetGameModeAnnouncement( GAMEMODE_SNS, "ffa_modeDesc" ) + GameMode_SetDefaultTimeLimits( GAMEMODE_SNS, 15, 0.0 ) + GameMode_AddScoreboardColumnData( GAMEMODE_SNS, "#SCOREBOARD_SCORE", PGS_ASSAULT_SCORE, 2 ) + GameMode_AddScoreboardColumnData( GAMEMODE_SNS, "#SCOREBOARD_PILOT_KILLS", PGS_PILOT_KILLS, 2 ) + GameMode_AddScoreboardColumnData( GAMEMODE_SNS, "#SCOREBOARD_BANKRUPTS", PGS_TITAN_KILLS, 2 ) + GameMode_SetColor( GAMEMODE_SNS, [147, 204, 57, 255] ) + + AddPrivateMatchMode( GAMEMODE_SNS ) // add to private lobby modes + + GameMode_SetDefaultScoreLimits( GAMEMODE_SNS, 300, 0 ) + + #if SERVER + GameMode_AddServerInit( GAMEMODE_SNS, SNS_Init ) + GameMode_AddServerInit( GAMEMODE_SNS, GamemodeFFAShared_Init ) + GameMode_SetPilotSpawnpointsRatingFunc( GAMEMODE_SNS, RateSpawnpoints_Generic ) + GameMode_SetTitanSpawnpointsRatingFunc( GAMEMODE_SNS, RateSpawnpoints_Generic ) + #elseif CLIENT + GameMode_AddClientInit( GAMEMODE_SNS, ClGameModeSNS_Init ) + GameMode_AddClientInit( GAMEMODE_SNS, GamemodeFFAShared_Init ) + GameMode_AddClientInit( GAMEMODE_SNS, ClGamemodeFFA_Init ) + #endif + #if !UI + GameMode_SetScoreCompareFunc( GAMEMODE_SNS, CompareAssaultScore ) + GameMode_AddSharedInit( GAMEMODE_SNS, GamemodeFFA_Dialogue_Init ) + #endif +} + +void function SNSRegisterNetworkVars() +{ + if ( GAMETYPE != GAMEMODE_SNS ) + return + Remote_RegisterFunction( "ServerCallback_AnnounceBankrupt" ) + Remote_RegisterFunction( "ServerCallback_AnnounceKillLeaderBankrupt" ) +}
\ No newline at end of file diff --git a/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut b/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut index a9da541f..b910cff3 100644 --- a/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut +++ b/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut @@ -5,6 +5,7 @@ untyped global function OnWeaponPrimaryAttack_peacekraber; global function OnWeaponDeactivate_peacekraber global function OnWeaponActivate_peacekraber +global function OnWeaponOwnerChanged_weapon_peacekraber #if SERVER global function OnWeaponNpcPrimaryAttack_peacekraber @@ -47,8 +48,19 @@ void function OnWeaponActivate_peacekraber (entity weapon) { void function OnWeaponDeactivate_peacekraber (entity weapon) { #if CLIENT + if (!IsValid( weapon.GetWeaponOwner() )) return if (!weapon.GetWeaponOwner().IsPlayer() || weapon.GetWeaponOwner() != GetLocalViewPlayer()) return; - isWeaponActive = false; + isWeaponActive = false + #endif +} + +void function OnWeaponOwnerChanged_weapon_peacekraber (entity weapon, WeaponOwnerChangedParams changeParams) +{ + #if CLIENT + if (changeParams.oldOwner == GetLocalViewPlayer()) + { + isWeaponActive = false + } #endif } #if CLIENT @@ -60,7 +72,11 @@ void function CrosshairCycle() { int chargeLevel; float chargeFrac; while (isWeaponActive) { - WaitFrame() + if (!IsValid( clientWeapon )) + { + isWeaponActive = false + continue + } chargeLevel = clientWeapon.GetWeaponChargeLevel(); chargeFrac = clientWeapon.GetWeaponChargeFraction(); RuiSetFloat3(rui, "teamColor", colors[chargeLevel]); @@ -89,6 +105,7 @@ void function CrosshairCycle() { default: break; } + WaitFrame() } RuiDestroy(rui); @@ -159,4 +176,4 @@ function FireWeaponPlayerAndNPC( WeaponPrimaryAttackParams attackParams, bool pl } return 1 -}
\ No newline at end of file +} diff --git a/Northstar.Custom/mod/scripts/weapons/mp_weapon_peacekraber.txt b/Northstar.Custom/mod/scripts/weapons/mp_weapon_peacekraber.txt index 59219cab..464a9429 100644 --- a/Northstar.Custom/mod/scripts/weapons/mp_weapon_peacekraber.txt +++ b/Northstar.Custom/mod/scripts/weapons/mp_weapon_peacekraber.txt @@ -21,6 +21,7 @@ WeaponData "OnWeaponActivate" "OnWeaponActivate_peacekraber" "OnWeaponDeactivate" "OnWeaponDeactivate_peacekraber" "OnWeaponPrimaryAttack" "OnWeaponPrimaryAttack_peacekraber" + "OnWeaponOwnerChanged" "OnWeaponOwnerChanged_weapon_peacekraber" "OnWeaponChargeLevelIncreased" "OnWeaponChargeLevelIncreased_titanweapon_sniper" "OnWeaponNpcPrimaryAttack" "OnWeaponNpcPrimaryAttack_peacekraber" @@ -59,7 +60,8 @@ WeaponData "charge_drain_sound_1p" "Weapon_Titan_Sniper_WindDown" "charge_drain_sound_stop_when_empty" "1" "charge_drain_sound_seek_to_charge_fraction" "1" - // Spread + "charge_remain_full_when_fired" "0" + // Spread "spread_stand_hip" "0" "spread_stand_hip_run" "0" "spread_stand_hip_sprint" "0" @@ -73,27 +75,28 @@ WeaponData "damage_type" "bullet" "damage_near_distance" "500" "damage_far_distance" "1000" - "damage_near_value" "11" - "damage_far_value" "11" - "damage_near_value_titanarmor" "20" - "damage_far_value_titanarmor" "15" + "damage_near_value" "15" + "damage_far_value" "15" + "damage_near_value_titanarmor" "40" + "damage_far_value_titanarmor" "30" // Ammo "ammo_stockpile_max" "20" + "ammo_no_remove_from_stockpile" "1" "ammo_default_total" "25" "ammo_clip_size" "5" "ammo_size_segmented_reload" "5" "ammo_display_as_clips" "0" "reload_is_segmented" "0" - "reload_time" "2.45" - "reload_time_late1" "2.175" + "reload_time" "2.5" + "reload_time_late1" "2.2" "reload_time_late2" "0" - "reloadempty_time" "3.35" + "reloadempty_time" "3.5" "reloadempty_time_late1" "2.5" "reloadempty_time_late2" "1.7" "reloadempty_time_late2" "1.1" - "rechamber_time" "0.756" + "rechamber_time" "0.924" "viewmodel_offset_ads" "0 0 0" @@ -129,12 +132,13 @@ WeaponData "bolt_hitsize_growfinal_lerptime" "0.18" "bolt_hitsize_growfinal_size" "6.0" "bolt_bounce_frac" "1.0" - + "titanarmor_critical_hit_required" "1" + "critical_hit" "1" "bolt_gravity_enabled" "1" // Behavior - "fire_rate" "1.33" + "fire_rate" "4.0" "zoom_time_in" "0.2" "zoom_time_out" "0.2" "zoom_fov" "50" @@ -340,4 +344,4 @@ WeaponData "ui" "ui/crosshair_lstar" "base_spread" "4" } -}
\ No newline at end of file +} |