From 14a633b6ae6297ec83b747fb30ab9e7c71c47cb6 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Wed, 29 Sep 2021 14:04:33 +0100 Subject: [PATCH] Test pers team --- _inf_alive_rewards.gsc | 2 +- _inf_anti_camp.gsc | 6 +- _inf_anti_rage_quit.gsc | 35 ++++++++ _inf_model.gsc | 64 ++++++++++++-- _inf_nuke_dome.gsc | 184 ++++++++++++++++++++++++++++++++++++++++ _inf_utils.gsc | 4 +- 6 files changed, 283 insertions(+), 12 deletions(-) create mode 100644 _inf_anti_rage_quit.gsc create mode 100644 _inf_nuke_dome.gsc diff --git a/_inf_alive_rewards.gsc b/_inf_alive_rewards.gsc index 90dd258..b01aad0 100644 --- a/_inf_alive_rewards.gsc +++ b/_inf_alive_rewards.gsc @@ -34,7 +34,7 @@ monitorForRewards() for ( ;; ) { self waittill( "killed_enemy" ); - if ( self.sessionteam == "axis" ) return; // It's infected. Once your team is axis you are done for the game + if ( self.pers["team"] == "axis" ) return; // It's infected. Once your team is axis you are done for the game count = self.kills; switch( count ) { diff --git a/_inf_anti_camp.gsc b/_inf_anti_camp.gsc index d322f36..4ea819e 100644 --- a/_inf_anti_camp.gsc +++ b/_inf_anti_camp.gsc @@ -31,14 +31,14 @@ connected() for ( ;; ) { self waittill( "spawned_player" ); - if ( self.sessionteam != "allies" ) + if ( self.pers["team"] != "allies" ) self.anti_camp = false; } } startAntiCamp() { - assert( self.sessionteam == "allies" ); + assert( self.pers["team"] == "allies" ); level endon( "game_ended" ); self endon ( "disconnect" ); @@ -76,7 +76,7 @@ monitorKillStreak() { self waittill( "killed_enemy" ); count = self getPlayerData( "killstreaksState", "count" ); - if ( count > 24 && self.sessionteam != "axis" ) + if ( count > 24 && self.pers["team"] != "axis" ) { self.anti_camp = true; self thread startAntiCamp(); diff --git a/_inf_anti_rage_quit.gsc b/_inf_anti_rage_quit.gsc new file mode 100644 index 0000000..bd6fc03 --- /dev/null +++ b/_inf_anti_rage_quit.gsc @@ -0,0 +1,35 @@ +/* + _inf_anti_rage_quit + Author: FutureRave + Date: 29/09/2021 +*/ + +#include common_scripts\utility; +#include maps\mp\_utility; + +init() +{ + thread antiRageQuit(); +} + +antiRageQuit() +{ + level endon( "game_ended" ); + gameFlagWait( "prematch_done" ); + + for ( ;; ) + { + wait( .5 ); +// If it's only 2 people let them quit + if (level.players.size < 3) continue; + + foreach( player in level.players ) + { + if ( player.pers["team"] == "axis" ) + { + player closepopupmenu( "" ); + player closeingamemenu(); + } + } + } +} diff --git a/_inf_model.gsc b/_inf_model.gsc index 2794f5e..c2ccda3 100644 --- a/_inf_model.gsc +++ b/_inf_model.gsc @@ -10,6 +10,8 @@ init() { + replaceFunc( maps\mp\gametypes\_teams::playerModelForWeapon, ::playerModelForWeaponStub ); + thread onConnect(); preCacheShader( "specialty_carepackage_crate" ); @@ -37,17 +39,12 @@ connected() { self waittill( "spawned_player" ); waittillframeend; - if ( self.sessionteam == "allies" ) + if ( self.pers["team"] == "allies" ) { self giveAllPerks(); } else { -/* - team = self.team; - [[game[ self.team + "_model" ][ "GHILLIE" ]]](); - self.isSniper = true; -*/ self giveAllPerks(); self SetOffhandPrimaryClass( "other" ); self giveWeapon( "bouncingbetty_mp" ); @@ -97,3 +94,58 @@ giveAllPerks() } } } + +playerModelForWeaponStub( weapon, secondary ) +{ + team = self.team; + + if ( isDefined( game[ team + "_model" ][weapon] ) ) + { + [[game[ team + "_model" ][weapon]]](); + return; + } + + if ( self.pers["team"] == "axis" ) + { + if ( level.environment != "" && self isItemUnlocked( "ghillie_" + level.environment ) ) + [[game[ team + "_model" ]["GHILLIE"]]](); + else + [[game[ team + "_model" ]["SNIPER"]]](); + return; + } + + weaponClass = tablelookup( "mp/statstable.csv", 4, weapon, 2 ); + + switch ( weaponClass ) + { + case "weapon_smg": + [[game[ team + "_model" ]["SMG"]]](); + break; + case "weapon_assault": + [[game[ team + "_model" ]["ASSAULT"]]](); + break; + case "weapon_sniper": + if ( level.environment != "" && self isItemUnlocked( "ghillie_" + level.environment ) ) + [[game[ team + "_model" ]["GHILLIE"]]](); + else + [[game[ team + "_model" ]["SNIPER"]]](); + break; + case "weapon_lmg": + [[game[ team + "_model" ]["LMG"]]](); + break; + case "weapon_riot": + [[game[ team + "_model" ]["RIOT"]]](); + break; + case "weapon_shotgun": + [[game[ team + "_model" ]["SHOTGUN"]]](); + break; + default: + [[game[team+"_model"]["ASSAULT"]]](); + break; + } + + if ( self isJuggernaut() ) + { + [[game[ team + "_model" ]["JUGGERNAUT"]]](); + } +} diff --git a/_inf_nuke_dome.gsc b/_inf_nuke_dome.gsc new file mode 100644 index 0000000..0dac277 --- /dev/null +++ b/_inf_nuke_dome.gsc @@ -0,0 +1,184 @@ +/* + _inf_nuke_dome + Author: FutureRave, Slvr11 + Date: 10/06/2021 +*/ + +#include common_scripts\utility; +#include maps\mp\_utility; + +init() +{ + level._effect[ "nolight_burst_mp" ] = loadfx( "fire/firelp_huge_pm_nolight_burst" ); + precacheMpAnim( "windmill_spin_med" ); + precacheMpAnim( "foliage_desertbrush_1_sway" ); + precacheMpAnim( "oilpump_pump01" ); + precacheMpAnim( "oilpump_pump02" ); + precacheMpAnim( "windsock_large_wind_medium" ); + + thread domeDyn(); + thread nukeDeath(); +} + +domeDyn() +{ + if ( getDvar( "mapname" ) != "mp_dome" ) return; + + animated = getentarray( "animated_model", "targetname" ); + + for ( i = 0; i < animated.size; i++ ) + { + model_name = animated[i].model; + if ( isSubStr( model_name, "fence_tarp_" ) ) + { +// print( "domeDyn fence_tarp_" ); + animated[i].targetname = "dynamic_model"; + precacheMpAnim( model_name + "_med_01" ); + animated[i] ScriptModelPlayAnim( model_name + "_med_01" ); + } + else if ( model_name == "machinery_windmill" ) + { +// print( "domeDyn machinery_windmill" ); + animated[i].targetname = "dynamic_model"; + animated[i] ScriptModelPlayAnim( "windmill_spin_med" ); + } + else if ( isSubStr( model_name, "foliage" ) ) + { +// print( "domeDyn foliage" ); + animated[i].targetname = "dynamic_model"; + animated[i] ScriptModelPlayAnim( "foliage_desertbrush_1_sway" ); + } + else if ( isSubStr( model_name, "oil_pump_jack" ) ) + { +// print( "domeDyn oil_pump_jack" ); + animated[i].targetname = "dynamic_model"; + animation = "oilpump_pump0" + ( randomint( 2 ) + 1 ); + animated[i] ScriptModelPlayAnim( animation ); + } + else if ( model_name == "accessories_windsock_large" ) + { +// print( "domeDyn accessories_windsock_large" ); + animated[i].targetname = "dynamic_model"; + animated[i] ScriptModelPlayAnim( "windsock_large_wind_medium" ); + } + } +} + +doBoxEffect( effect ) +{ + wait ( 3 ); + forward = AnglesToForward( self.angles ); + up = AnglesToUp( self.angles ); + + effect delete(); + PlayFX( getfx( "box_explode_mp" ), self.origin, forward, up ); + + self self_func( "scriptModelClearAnim" ); + self Hide(); +} + +fenceEffect() +{ + forward = AnglesToForward( self.angles ); + up = AnglesToUp( self.angles ); + + fxEnt = SpawnFx( getfx( "nolight_burst_mp" ), self.origin, forward, up ); + TriggerFx( fxEnt ); + + self thread doBoxEffect( fxEnt ); +} + +clearAmim( delay ) +{ + wait ( delay ); + self self_func( "scriptModelClearAnim" ); +} + +windsockLarge() +{ + self self_func( "scriptModelClearAnim" ); + self.origin += ( 0, 0, 20 ); + bounds_1 = spawn("script_model", self.origin + ( 15, -7, 0 ) ); + bounds_2 = spawn("script_model", self.origin + ( 70, -38, 0 ) ); + + bounds_1 setModel( "com_plasticcase_friendly" ); + bounds_2 setModel( "com_plasticcase_friendly" ); + + bounds_1 hide(); + bounds_2 hide(); + + bounds_1 CloneBrushmodelToScriptmodel( level.airDropCrateCollision ); + bounds_2 CloneBrushmodelToScriptmodel( level.airDropCrateCollision ); + + bounds_1 SetContents( 1 ); + bounds_2 SetContents( 1 ); + + bounds_1.angles = self.angles + ( 0, 90, 0 ); + bounds_2.angles = bounds_1.angles; + + self linkto( bounds_2 ); + bounds_2 linkto( bounds_1 ); + bounds_1 PhysicsLaunchServer( ( 0, 0, 0 ), ( -400, -250, 10 ) ); +} + +nukeDeath() +{ + level endon( "game_ended" ); + gameFlagWait( "prematch_done" ); + if ( getDvar( "mapname" ) != "mp_dome" ) return; + + for ( ;; ) + { + level waittill( "nuke_death" ); + dynamic = getentarray( "dynamic_model", "targetname" ); + + for ( i = 0; i < dynamic.size; i++ ) + { + model_name = dynamic[i].model; + if ( isSubStr( model_name, "fence_tarp_" ) ) + { +// print( "Doing fenceEffect" ); + dynamic[i] thread fenceEffect(); + } + + else if ( model_name == "machinery_windmill" ) + { +// print( "Doing machinery_windmill" ); + dynamic[i] rotateroll( 80, 2, .5, .1 ); + dynamic[i] thread clearAmim( 1 ); + } + + else if ( isSubStr( model_name, "foliage" ) ) + { +// print( "Doing foliage" ); + dynamic[i].origin -= ( 0, 0, 50 ); + } + + else if ( isSubStr( model_name, "oil_pump_jack" ) ) + { +// print( "Doing oil_pump_jack" ); + dynamic[i] self_func( "scriptModelClearAnim" ); + } + + else if ( model_name == "accessories_windsock_large" ) + { +// print( "Doing accessories_windsock_large" ); + dynamic[i] thread windsockLarge(); + } + } + + wait( 5 ); + ents_to_blowup = getentarray("destructable", "targetname"); + ents_to_blowup = array_combine( ents_to_blowup, getentarray( "destructible_toy", "targetname" ) ); + ents_to_blowup = array_combine( ents_to_blowup, getentarray( "destructible_vehicle", "targetname" ) ); + ents_to_blowup = array_combine( ents_to_blowup, getentarray( "explodable_barrel", "targetname" ) ); + + for (i = 0; i < ents_to_blowup.size; i++) + { + ents_to_blowup[i] thread maps\mp\_destructables::destructable_destruct(); + } + + level notify( "game_cleanup" ); + print( "Destroyed a lot of stuff" ); + } +} diff --git a/_inf_utils.gsc b/_inf_utils.gsc index b5ac2ea..affff6a 100644 --- a/_inf_utils.gsc +++ b/_inf_utils.gsc @@ -68,11 +68,11 @@ codeCallbackPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath playLeaderDialog( sound ) { - assert( self.sessionteam != "spectator" ); + assert( self.pers["team"] != "spectator" ); suffix = "1mc_" + sound; - if ( self.sessionteam == "allies" ) + if ( self.pers["team"] == "allies" ) { self playLocalSound( getTeamVoicePrefix( game["allies"] ) + suffix ); }