aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/scripts/vscripts/gamemodes/_featured_mode_settings.gnut
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/gamemodes/_featured_mode_settings.gnut')
-rw-r--r--Northstar.CustomServers/scripts/vscripts/gamemodes/_featured_mode_settings.gnut121
1 files changed, 121 insertions, 0 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/gamemodes/_featured_mode_settings.gnut b/Northstar.CustomServers/scripts/vscripts/gamemodes/_featured_mode_settings.gnut
new file mode 100644
index 000000000..272043804
--- /dev/null
+++ b/Northstar.CustomServers/scripts/vscripts/gamemodes/_featured_mode_settings.gnut
@@ -0,0 +1,121 @@
+untyped
+global function FeaturedModeSettings_Init
+
+void function FeaturedModeSettings_Init()
+{
+ // if it's not super obvious at a glance this script is used for playlist vars with the prefix "featured_mode_"
+ // these often set loadouts and shit so they need a script
+ // note: for turbo_titans, the core multiplier is set in playlist
+
+ AddCallback_OnPlayerRespawned( FeaturedModeSettingsSetupPilotLoadouts )
+ AddCallback_OnPilotBecomesTitan( FeaturedModeSettingsSetupTitanLoadouts )
+}
+
+bool function IsFeaturedMode( string modeName )
+{
+ return GetCurrentPlaylistVar( "featured_mode_" + modeName ) == "1"
+}
+
+void function FeaturedModeSettingsSetupPilotLoadouts( entity player )
+{
+ bool shouldChangeLoadout = false
+
+ // create loadout struct
+ PilotLoadoutDef modifiedLoadout = clone GetActivePilotLoadout( player )
+
+ if ( IsFeaturedMode( "all_holopilot" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.special = "mp_ability_holopilot"
+ }
+
+ if ( IsFeaturedMode( "all_grapple" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.special = "mp_ability_grapple"
+ modifiedLoadout.specialMods = [ "all_grapple" ]
+ }
+
+ if ( IsFeaturedMode( "all_phase" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.special = "mp_ability_shifter"
+ modifiedLoadout.specialMods = [ "all_phase" ]
+ }
+
+ if ( IsFeaturedMode( "all_ticks" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.ordnance = "mp_weapon_frag_drone"
+ modifiedLoadout.ordnanceMods = [ "all_ticks" ]
+ }
+
+ if ( IsFeaturedMode( "rocket_arena" ) )
+ {
+ shouldChangeLoadout = true
+
+ modifiedLoadout.primary = "mp_weapon_epg"
+ modifiedLoadout.primaryMods = [ "rocket_arena" ]
+
+ // set secondary to whatever one is pistol
+ if ( GetWeaponInfoFileKeyField_Global( player.GetMainWeapons()[ 1 ].GetWeaponClassName(), "menu_category" ) == "at" )
+ {
+ modifiedLoadout.weapon3 = "mp_weapon_autopistol"
+ modifiedLoadout.weapon3Mods = [ "rocket_arena" ]
+ }
+ else
+ {
+ modifiedLoadout.secondary = "mp_weapon_autopistol"
+ modifiedLoadout.secondaryMods = [ "rocket_arena" ]
+ }
+ }
+
+ if ( IsFeaturedMode( "shotguns_snipers" ) )
+ {
+
+ shouldChangeLoadout = true
+
+ // this one was never released, assuming it just gives you a mastiff and a kraber with quick swap
+ modifiedLoadout.primary = "mp_weapon_sniper"
+ modifiedLoadout.primaryMods = [ "pas_fast_swap", "pas_fast_ads" ]
+
+ // set secondary to whatever one is pistol
+ if ( GetWeaponInfoFileKeyField_Global( player.GetMainWeapons()[ 1 ].GetWeaponClassName(), "menu_category" ) == "at" )
+ {
+ modifiedLoadout.weapon3 = "mp_weapon_mastiff"
+ modifiedLoadout.weapon3Mods = [ "pas_fast_swap", "pas_run_and_gun" ]
+ }
+ else
+ {
+ modifiedLoadout.secondary = "mp_weapon_mastiff"
+ modifiedLoadout.secondaryMods = [ "pas_fast_swap", "pas_run_and_gun" ]
+ }
+ }
+
+ // dont wanna give a new loadout if it's not necessary, could break other callbacks
+ if ( shouldChangeLoadout )
+ GivePilotLoadout( player, modifiedLoadout )
+
+ if ( IsFeaturedMode( "tactikill" ) )
+ player.GiveExtraWeaponMod( "tactical_cdr_on_kill" )
+
+ if ( IsFeaturedMode( "amped_tacticals" ) )
+ player.GiveExtraWeaponMod( "amped_tacticals" )
+}
+
+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 )
+ }
+} \ No newline at end of file