blob: b27fdbaacd5bde7355453d83bfd37810cf7414a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
untyped
global function Playlist_Init
void function Playlist_Init()
{
// featured mode settings
AddCallback_OnPlayerRespawned( FeaturedModeSettingsSetupPilotLoadouts )
AddCallback_OnPilotBecomesTitan( FeaturedModeSettingsSetupTitanLoadouts )
if ( IsFeaturedMode( "all_holopilot" ) || IsFeaturedMode( "all_grapple" ) ||
IsFeaturedMode( "all_phase" ) || IsFeaturedMode( "all_ticks" ) ||
IsFeaturedMode( "rocket_arena" ) || IsFeaturedMode( "shotguns_snipers" ) ||
IsFeaturedMode( "tactikill" ) || IsFeaturedMode( "amped_tacticals" ) )
SetLoadoutGracePeriodEnabled( false )
// iron lts rules
if ( HasIronRules() )
Riff_ForceTitanExitEnabled( eTitanExitEnabled.Never )
}
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" ) )
{
// this crashes sometimes for some reason
shouldChangeLoadout = true
// have to set attachments too, otherwise we could give invalid mods for this weapon
modifiedLoadout.primary = "mp_weapon_epg"
modifiedLoadout.primaryMods = [ "rocket_arena" ]
modifiedLoadout.primaryAttachments = [ "" ]
// 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" ]
}
modifiedLoadout.meleeMods = [ "rocket_arena" ]
player.GiveExtraWeaponMod( "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" ]
modifiedLoadout.primaryAttachments = [ "" ]
// 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 )
{
if ( IsFeaturedMode( "turbo_titans" ) )
{
array<string> settingsMods = player.GetPlayerSettingsMods()
// seems to crash if we set both of these at once? idk odd game
if ( !settingsMods.contains( "pas_mobility_dash_capacity" ) )
{
settingsMods.append( "turbo_titan" )
player.SetPlayerSettingsWithMods( player.GetPlayerSettings(), settingsMods )
}
}
}
|