From e110fd5129222cb4632318dcb730d10ef4d9af70 Mon Sep 17 00:00:00 2001 From: JezuzLizard Date: Sat, 26 Sep 2020 16:53:35 -0700 Subject: [PATCH] Checked all mp gametype scripts again. --- patch_mp/maps/mp/gametypes/conf.gsc | 2 + patch_mp/maps/mp/gametypes/ctf.gsc | 2 + patch_mp/maps/mp/gametypes/dem.gsc | 50 +++++++++-------- patch_mp/maps/mp/gametypes/dm.gsc | 3 +- patch_mp/maps/mp/gametypes/dom.gsc | 74 ++++++++++++++------------ patch_mp/maps/mp/gametypes/gun.gsc | 6 ++- patch_mp/maps/mp/gametypes/hq.gsc | 17 +++--- patch_mp/maps/mp/gametypes/koth.gsc | 67 +++++++++++++---------- patch_mp/maps/mp/gametypes/oic.gsc | 5 +- patch_mp/maps/mp/gametypes/oneflag.gsc | 2 + patch_mp/maps/mp/gametypes/sas.gsc | 1 + patch_mp/maps/mp/gametypes/sd.gsc | 61 +++++++++++++-------- patch_mp/maps/mp/gametypes/shrp.gsc | 2 + 13 files changed, 173 insertions(+), 119 deletions(-) diff --git a/patch_mp/maps/mp/gametypes/conf.gsc b/patch_mp/maps/mp/gametypes/conf.gsc index 8145981..5a7d4c2 100644 --- a/patch_mp/maps/mp/gametypes/conf.gsc +++ b/patch_mp/maps/mp/gametypes/conf.gsc @@ -77,6 +77,7 @@ onstartgametype() //checked changed to match cerberus output game[ "attackers" ] = olddefenders; game[ "defenders" ] = oldattackers; } + allowed = []; allowed[ 0 ] = level.gametype; maps/mp/gametypes/_gameobjects::main( allowed ); level.spawnmins = ( 0, 0, 1 ); @@ -136,6 +137,7 @@ spawndogtags( victim, attacker ) //checked changed to match cerberus output } else { + visuals = []; visuals[ 0 ] = spawn( "script_model", ( 0, 0, 0 ) ); visuals[ 0 ] setmodel( "p6_dogtags" ); visuals[ 1 ] = spawn( "script_model", ( 0, 0, 0 ) ); diff --git a/patch_mp/maps/mp/gametypes/ctf.gsc b/patch_mp/maps/mp/gametypes/ctf.gsc index 97850a4..29e2f9f 100644 --- a/patch_mp/maps/mp/gametypes/ctf.gsc +++ b/patch_mp/maps/mp/gametypes/ctf.gsc @@ -179,6 +179,7 @@ onstartgametype() //checked changed to match cerberus output setobjectivehinttext( "axis", &"MP_CTF_OVERTIME_ROUND_2_TIE" ); } } + allowed = []; allowed[ 0 ] = "ctf"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); @@ -413,6 +414,7 @@ updategametypedvars() //checked matches cerberus output createflag( trigger ) //checked matches cerberus output { + visuals = []; if ( isDefined( trigger.target ) ) { visuals[ 0 ] = getent( trigger.target, "targetname" ); diff --git a/patch_mp/maps/mp/gametypes/dem.gsc b/patch_mp/maps/mp/gametypes/dem.gsc index 4ed211f..bc4994a 100644 --- a/patch_mp/maps/mp/gametypes/dem.gsc +++ b/patch_mp/maps/mp/gametypes/dem.gsc @@ -266,6 +266,7 @@ onstartgametype() //checked changed to match cerberus output { level.dembombzonename = "bombzone"; } + allowed = []; allowed[ 0 ] = "sd"; allowed[ 1 ] = level.dembombzonename; allowed[ 2 ] = "blocker"; @@ -394,7 +395,7 @@ onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shi bombzone = level.bombzones[ index ]; break; } - else dist = distance2d( attacker.origin, level.bombzones[ index ].curorigin ); + dist = distance2d( attacker.origin, level.bombzones[ index ].curorigin ); if ( dist < level.defaultoffenseradius ) { inbombzone = 1; @@ -427,30 +428,33 @@ onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shi */ } } - else if ( !isDefined( attacker.dem_defends ) ) + else { - attacker.dem_defends = 0; - } - attacker.dem_defends++; - if ( level.playerdefensivemax >= attacker.dem_defends ) - { - if ( isDefined( attacker.pers[ "defends" ] ) ) + if ( !isDefined( attacker.dem_defends ) ) { - attacker.pers[ "defends" ]++; - attacker.defends = attacker.pers[ "defends" ]; + attacker.dem_defends = 0; + } + attacker.dem_defends++; + if ( level.playerdefensivemax >= attacker.dem_defends ) + { + if ( isDefined( attacker.pers[ "defends" ] ) ) + { + attacker.pers[ "defends" ]++; + attacker.defends = attacker.pers[ "defends" ]; + } + attacker maps/mp/_medals::defenseglobalcount(); + attacker addplayerstatwithgametype( "DEFENDS", 1 ); + self recordkillmodifier( "assaulting" ); + maps/mp/_scoreevents::processscoreevent( "killed_attacker", attacker, self, sweapon ); + } + else + { + /* + /# + attacker iprintlnbold( "GAMETYPE DEBUG: NOT GIVING YOU DEFENSIVE CREDIT AS BOOSTING PREVENTION" ); + #/ + */ } - attacker maps/mp/_medals::defenseglobalcount(); - attacker addplayerstatwithgametype( "DEFENDS", 1 ); - self recordkillmodifier( "assaulting" ); - maps/mp/_scoreevents::processscoreevent( "killed_attacker", attacker, self, sweapon ); - } - else - { - /* -/# - attacker iprintlnbold( "GAMETYPE DEBUG: NOT GIVING YOU DEFENSIVE CREDIT AS BOOSTING PREVENTION" ); -#/ - */ } } if ( self.isplanting == 1 ) @@ -466,7 +470,7 @@ onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shi checkallowspectating() //checked changed to match cerberus output { self endon( "disconnect" ); - wait 0,05; + wait 0.05; update = 0; livesleft = !level.numlives && !self.pers["lives"]; if ( !level.alivecount[ game[ "attackers" ] ] && !livesleft ) diff --git a/patch_mp/maps/mp/gametypes/dm.gsc b/patch_mp/maps/mp/gametypes/dm.gsc index c20cc32..c90be26 100644 --- a/patch_mp/maps/mp/gametypes/dm.gsc +++ b/patch_mp/maps/mp/gametypes/dm.gsc @@ -51,6 +51,7 @@ onstartgametype() //checked matches cerberus output } setobjectivehinttext( "allies", &"OBJECTIVES_DM_HINT" ); setobjectivehinttext( "axis", &"OBJECTIVES_DM_HINT" ); + allowed = []; allowed[ 0 ] = "dm"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); @@ -104,7 +105,7 @@ onscoreclosemusic() //checked changed to match cerberus output while ( !level.gameended ) { scorelimit = level.scorelimit; - scorethreshold = scorelimit * 0,9; + scorethreshold = scorelimit * 0.9; for ( i = 0; i < level.players.size; i++ ) { scorecheck = [[ level._getplayerscore ]]( level.players[ i ] ); diff --git a/patch_mp/maps/mp/gametypes/dom.gsc b/patch_mp/maps/mp/gametypes/dom.gsc index 1693a53..0a49a3f 100644 --- a/patch_mp/maps/mp/gametypes/dom.gsc +++ b/patch_mp/maps/mp/gametypes/dom.gsc @@ -101,6 +101,7 @@ onstartgametype() //checked changed to match cerberus output level.flagbasefxid[ "allies" ] = loadfx( "misc/fx_ui_flagbase_" + game[ "allies" ] ); level.flagbasefxid[ "axis" ] = loadfx( "misc/fx_ui_flagbase_" + game[ "axis" ] ); setclientnamemode( "auto_change" ); + allowed = []; allowed[ 0 ] = "dom"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); @@ -151,21 +152,17 @@ onspawnplayer( predictedspawn ) //checked partially changed to match cerberus ou flagsowned = 0; enemyflagsowned = 0; enemyteam = getotherteam( self.pers[ "team" ] ); - i = 0; - while ( i < level.flags.size ) + for ( i = 0; i < level.flags.size; i++ ) { team = level.flags[ i ] getflagteam(); if ( team == self.pers[ "team" ] ) { flagsowned++; - i++; - continue; } - if ( team == enemyteam ) + else if ( team == enemyteam ) { enemyflagsowned++; } - i++; } enemyteam = getotherteam( spawnteam ); if ( flagsowned == level.flags.size ) @@ -180,7 +177,7 @@ onspawnplayer( predictedspawn ) //checked partially changed to match cerberus ou else { bestflag = undefined; - if ( enemyflagsowned > 0 && enemyflagsowned < level.flags.size ) + if ( ( enemyflagsowned > 0 ) && ( enemyflagsowned < level.flags.size ) ) { bestflag = getunownedflagneareststart( spawnteam ); } @@ -288,6 +285,7 @@ domflags() //checked changed to match cerberus output return; } level.flags = []; + visuals = []; for ( index = 0; index < primaryflags.size; index++ ) { level.flags[ level.flags.size ] = primaryflags[ index ]; @@ -367,7 +365,7 @@ getunownedflagneareststart( team, excludeflag ) //checked partially changed to m continue; } distsq = distancesquared( flag.origin, level.startpos[ team ] ); - if ( isDefined( excludeflag ) && flag != excludeflag || !isDefined( best ) && distsq < bestdistsq ) + if ( ( !isDefined( excludeflag ) || flag != excludeflag ) && ( !isDefined( best ) || ( distsq < bestdistsq ) ) ) { bestdistsq = distsq; best = flag; @@ -736,7 +734,7 @@ updatedomscores() //checked matches cerberus output } onscoreclosemusic(); timepassed = maps/mp/gametypes/_globallogic_utils::gettimepassed(); - if ( ( timepassed / 1000 ) > 120 && numownedflags < 2 && ( timepassed / 1000 ) > 300 && numownedflags < 3 && gamemodeismode( level.gamemode_public_match ) ) + if ( ( ( timepassed / 1000 ) > 120 ) && numownedflags < 2 || ( ( timepassed / 1000 ) > 300 ) && numownedflags < 3 && gamemodeismode( level.gamemode_public_match ) ) { thread maps/mp/gametypes/_globallogic::endgame( "tie", game[ "strings" ][ "time_limit_reached" ] ); return; @@ -769,7 +767,7 @@ onscoreclosemusic() //checked matches cerberus output } /* /# - if ( getDvarInt( #"0BC4784C" ) > 0 ) + if ( getDvarInt( "debug_music" ) > 0 ) { println( "Music System Domination - scoreDif " + scoredif ); println( "Music System Domination - axisScore " + axisscore ); @@ -782,7 +780,7 @@ onscoreclosemusic() //checked matches cerberus output #/ } */ - if ( scoredif <= scorethreshold && scorethresholdstart <= currentscore && level.playingactionmusic != 1 ) + if ( ( scoredif <= scorethreshold ) && ( scorethresholdstart <= currentscore ) && level.playingactionmusic != 1 ) { thread maps/mp/gametypes/_globallogic_audio::set_music_on_team( "TIME_OUT", "both" ); thread maps/mp/gametypes/_globallogic_audio::actionmusicset(); @@ -907,11 +905,14 @@ onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shi self recordkillmodifier( "assaulting" ); break; } - /* - /# - attacker iprintlnbold( "GAMETYPE DEBUG: NOT GIVING YOU OFFENSIVE CREDIT AS BOOSTING PREVENTION" ); - #/ - */ + else + { + /* + /# + attacker iprintlnbold( "GAMETYPE DEBUG: NOT GIVING YOU OFFENSIVE CREDIT AS BOOSTING PREVENTION" ); + #/ + */ + } } } } @@ -945,7 +946,7 @@ killwhilecontesting( flag ) //checked matches cerberus output } self.clearenemycount++; flag waittill( "contest_over" ); - if ( playerteam != self.pers[ "team" ] || isDefined( self.spawntime ) && killtime < self.spawntime ) + if ( playerteam != self.pers[ "team" ] || isDefined( self.spawntime ) && ( killtime < self.spawntime ) ) { self.clearenemycount = 0; return; @@ -1192,20 +1193,22 @@ flagsetup() //checked partially changed to match cerberus output did not change continue; } nearestflag = desc.flag; - break; } - nearestflag = undefined; - nearestdist = undefined; - for ( j = 0; j < flags.size; j++ ) + else { - dist = distancesquared( flags[ j ].origin, spawnpoints[ i ].origin ); - if ( !isDefined( nearestflag ) || dist < nearestdist ) + nearestflag = undefined; + nearestdist = undefined; + for ( j = 0; j < flags.size; j++ ) { - nearestflag = flags[ j ]; - nearestdist = dist; + dist = distancesquared( flags[ j ].origin, spawnpoints[ i ].origin ); + if ( !isDefined( nearestflag ) || ( dist < nearestdist ) ) + { + nearestflag = flags[ j ]; + nearestdist = dist; + } } + nearestflag.nearbyspawns[ nearestflag.nearbyspawns.size ] = spawnpoints[ i ]; } - nearestflag.nearbyspawns[ nearestflag.nearbyspawns.size ] = spawnpoints[ i ]; i++; } if ( maperrors.size > 0 ) @@ -1332,13 +1335,16 @@ change_dom_spawns() //checked changed to match cerberus output maps/mp/gametypes/_spawnlogic::addspawnpoints( "axis", flagspawnname ); } } - for ( i = 0; i < flag_number; i++ ) + else { - label = level.flags[ i ].useobj maps/mp/gametypes/_gameobjects::getlabel(); - flagspawnname = "mp_dom_spawn_flag" + label; - flag_team = level.flags[ i ] getflagteam(); - addspawnpointsforflag( "allies", flag_team, flagspawnname ); - addspawnpointsforflag( "axis", flag_team, flagspawnname ); + for ( i = 0; i < flag_number; i++ ) + { + label = level.flags[ i ].useobj maps/mp/gametypes/_gameobjects::getlabel(); + flagspawnname = "mp_dom_spawn_flag" + label; + flag_team = level.flags[ i ] getflagteam(); + addspawnpointsforflag( "allies", flag_team, flagspawnname ); + addspawnpointsforflag( "axis", flag_team, flagspawnname ); + } } maps/mp/gametypes/_spawning::updateallspawnpoints(); } @@ -1363,7 +1369,7 @@ dominated_challenge_check() //checked changed to match cerberus output { return 0; } - if ( allied_flags > 0 && axis_flags > 0 ) + if ( ( allied_flags > 0 ) && ( axis_flags > 0 ) ) { return 0; } @@ -1387,7 +1393,7 @@ dominated_check() //checked changed to match cerberus output { axis_flags++; } - if ( allied_flags > 0 && axis_flags > 0 ) + if ( ( allied_flags > 0 ) && ( axis_flags > 0 ) ) { return 0; } diff --git a/patch_mp/maps/mp/gametypes/gun.gsc b/patch_mp/maps/mp/gametypes/gun.gsc index e853a68..50a8344 100644 --- a/patch_mp/maps/mp/gametypes/gun.gsc +++ b/patch_mp/maps/mp/gametypes/gun.gsc @@ -195,9 +195,10 @@ promoteplayer( weaponused ) //checked changed to match cerberus output self endon( "cancel_promotion" ); level endon( "game_ended" ); wait 0.05; - for ( i = 0; i < level.gunprogression[self.gunprogress].names.size; i++ ) + for ( i = 0; i < level.gunprogression[ self.gunprogress ].names.size; i++ ) { - if ( weaponused == level.gunprogression[ self.gunprogress ].names[ i ] || weaponused == "explosive_bolt_mp" && level.gunprogression[ self.gunprogress ].names[ i ] != "crossbow_mp" || level.gunprogression[ self.gunprogress ].names[ i ] == "crossbow_mp+reflex" && level.gunprogression[ self.gunprogress ].names[ i ] == "crossbow_mp+acog" ) + //treyarchs original implementation of this if statement was cancer so i changed it to be simpler + if ( weaponused == level.gunprogression[ self.gunprogress ].names[ i ] || weaponused == "explosive_bolt_mp" && issubstr( level.gunprogression[ self.gunprogress ].names[ i ], "crossbow" ) ) { if ( self.gunprogress < ( level.gunprogression.size - 1 ) ) { @@ -305,6 +306,7 @@ onstartgametype() //checked matches cerberus output } setobjectivehinttext( "allies", &"OBJECTIVES_GUN_HINT" ); setobjectivehinttext( "axis", &"OBJECTIVES_GUN_HINT" ); + allowed = []; allowed[ 0 ] = "gun"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); diff --git a/patch_mp/maps/mp/gametypes/hq.gsc b/patch_mp/maps/mp/gametypes/hq.gsc index b19f08f..c984799 100644 --- a/patch_mp/maps/mp/gametypes/hq.gsc +++ b/patch_mp/maps/mp/gametypes/hq.gsc @@ -180,6 +180,7 @@ onstartgametype() //checked changed to match cerberus output updateobjectivehintmessage( level.objectivehintcapturehq ); } setclientnamemode( "auto_change" ); + allowed = []; allowed[ 0 ] = "hq"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); @@ -337,10 +338,11 @@ hqmainloop() //checked changed to match cerberus output { timerdisplay[ team ] settimer( level.hqautodestroytime ); } - //wait 0.05; - continue; } - level.hqdestroyedbytimer = 0; + else + { + level.hqdestroyedbytimer = 0; + } while ( 1 ) { ownerteam = level.radio.gameobject maps/mp/gametypes/_gameobjects::getownerteam(); @@ -833,7 +835,7 @@ setupnearbyspawns() //checked changed to match cerberus output for ( i = 1; i < spawns.size; i++ ) { thespawn = spawns[ i ]; - for ( j = i - 1; j >= 0 && thespawn.distsq < spawns[j].distsq; j-- ) + for ( j = i - 1; j >= 0 && thespawn.distsq < spawns[ j ].distsq; j-- ) { spawns[ j + 1 ] = spawns[ j ]; @@ -849,7 +851,7 @@ setupnearbyspawns() //checked changed to match cerberus output { first[ first.size ] = spawns[ i ]; } - while ( i < spawns.size ) + for ( ; i < spawns.size; i++ ) { outer[ outer.size ] = spawns[ i ]; if ( i <= ( thirdsize * 2 ) ) @@ -860,7 +862,6 @@ setupnearbyspawns() //checked changed to match cerberus output { third[ third.size ] = spawns[ i ]; } - i++; } self.gameobject.nearspawns = first; self.gameobject.midspawns = second; @@ -1088,7 +1089,7 @@ onroundswitch() //checked matches cerberus output onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration ) //checked changed to match cerberus output { - if ( isplayer( attacker ) || !self.touchtriggers.size && !attacker.touchtriggers.size || attacker.pers[ "team" ] == self.pers[ "team" ] ) + if ( isplayer( attacker ) || ( !self.touchtriggers.size && !attacker.touchtriggers.size ) || attacker.pers[ "team" ] == self.pers[ "team" ] ) { return; } @@ -1194,7 +1195,7 @@ killwhilecontesting( radio ) //checked matches cerberus output } self.clearenemycount++; radio waittill( "state_change" ); - if ( playerteam != self.pers[ "team" ] || isDefined( self.spawntime ) && killtime < self.spawntime ) + if ( playerteam != self.pers[ "team" ] || isDefined( self.spawntime ) && ( killtime < self.spawntime ) ) { self.clearenemycount = 0; return; diff --git a/patch_mp/maps/mp/gametypes/koth.gsc b/patch_mp/maps/mp/gametypes/koth.gsc index ee6d207..5fe737e 100644 --- a/patch_mp/maps/mp/gametypes/koth.gsc +++ b/patch_mp/maps/mp/gametypes/koth.gsc @@ -192,6 +192,7 @@ onstartgametype() //checked partially changed to match cerberus output did not u updateobjectivehintmessage( level.objectivehintcapturezone ); } setclientnamemode( "auto_change" ); + allowed = []; allowed[ 0 ] = "koth"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); @@ -375,7 +376,6 @@ kothmainloop() //checked changed to match cerberus output timerdisplay = []; foreach ( team in level.teams ) { - team = _a436[ _k436 ]; timerdisplay[ team ] = createservertimer( "objective", 1.4, team ); timerdisplay[ team ] setgamemodeinfopoint(); timerdisplay[ team ].label = zonespawninginstr; @@ -559,15 +559,18 @@ onzonecapture( player ) //checked partially changed to match cerberus output did } thread playsoundonplayers( game[ "objective_gained_sound" ], team ); } - else if ( oldteam == team ) + else { - maps/mp/gametypes/_globallogic_audio::leaderdialog( "koth_lost", team, "gamemode_objective" ); + if ( oldteam == team ) + { + maps/mp/gametypes/_globallogic_audio::leaderdialog( "koth_lost", team, "gamemode_objective" ); + } + else if ( oldteam == "neutral" ) + { + maps/mp/gametypes/_globallogic_audio::leaderdialog( "koth_captured", team, "gamemode_objective" ); + } + thread playsoundonplayers( game[ "objective_lost_sound" ], team ); } - else if ( oldteam == "neutral" ) - { - maps/mp/gametypes/_globallogic_audio::leaderdialog( "koth_captured", team, "gamemode_objective" ); - } - thread playsoundonplayers( game[ "objective_lost_sound" ], team ); } level thread awardcapturepoints( capture_team, self.lastcaptureteam ); self.capturecount++; @@ -1264,22 +1267,25 @@ onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shi self recordkillmodifier( "defending" ); scoreeventprocessed = 1; } - else if ( !medalgiven ) + else { - if ( isDefined( attacker.pers[ "defends" ] ) ) + if ( !medalgiven ) { - attacker.pers[ "defends" ]++; - attacker.defends = attacker.pers[ "defends" ]; + if ( isDefined( attacker.pers[ "defends" ] ) ) + { + attacker.pers[ "defends" ]++; + attacker.defends = attacker.pers[ "defends" ]; + } + attacker maps/mp/_medals::defenseglobalcount(); + medalgiven = 1; + attacker addplayerstatwithgametype( "DEFENDS", 1 ); + attacker recordgameevent( "return" ); } - attacker maps/mp/_medals::defenseglobalcount(); - medalgiven = 1; - attacker addplayerstatwithgametype( "DEFENDS", 1 ); - attacker recordgameevent( "return" ); + attacker maps/mp/_challenges::killedzoneattacker( sweapon ); + maps/mp/_scoreevents::processscoreevent( "hardpoint_kill", attacker, undefined, sweapon ); + self recordkillmodifier( "assaulting" ); + scoreeventprocessed = 1; } - attacker maps/mp/_challenges::killedzoneattacker( sweapon ); - maps/mp/_scoreevents::processscoreevent( "hardpoint_kill", attacker, undefined, sweapon ); - self recordkillmodifier( "assaulting" ); - scoreeventprocessed = 1; } } if ( attacker.touchtriggers.size || level.capturetime == 0 && attacker istouching( level.zone.trig ) ) @@ -1313,16 +1319,19 @@ onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shi self recordkillmodifier( "assaulting" ); } } - else if ( !medalgiven ) + else { - attacker maps/mp/_medals::offenseglobalcount(); - medalgiven = 1; - attacker addplayerstatwithgametype( "OFFENDS", 1 ); - } - if ( scoreeventprocessed == 0 ) - { - maps/mp/_scoreevents::processscoreevent( "hardpoint_kill", attacker, undefined, sweapon ); - self recordkillmodifier( "defending" ); + if ( !medalgiven ) + { + attacker maps/mp/_medals::offenseglobalcount(); + medalgiven = 1; + attacker addplayerstatwithgametype( "OFFENDS", 1 ); + } + if ( scoreeventprocessed == 0 ) + { + maps/mp/_scoreevents::processscoreevent( "hardpoint_kill", attacker, undefined, sweapon ); + self recordkillmodifier( "defending" ); + } } } } diff --git a/patch_mp/maps/mp/gametypes/oic.gsc b/patch_mp/maps/mp/gametypes/oic.gsc index 4143eb8..f92c65d 100644 --- a/patch_mp/maps/mp/gametypes/oic.gsc +++ b/patch_mp/maps/mp/gametypes/oic.gsc @@ -44,7 +44,7 @@ main() //checked matches cerberus output onplayerdamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime ) //checked changed to match cerberus output { - if ( smeansofdeath != "MOD_PISTOL_BULLET" || smeansofdeath == "MOD_RIFLE_BULLET" || smeansofdeath == "MOD_HEAD_SHOT" ) + if ( smeansofdeath == "MOD_PISTOL_BULLET" || smeansofdeath == "MOD_RIFLE_BULLET" || smeansofdeath == "MOD_HEAD_SHOT" ) { idamage = self.maxhealth + 1; } @@ -62,12 +62,14 @@ givecustomloadout() //checked matches cerberus output if ( isDefined( self.pers[ "clip_ammo" ] ) ) { clipammo = self.pers[ "clip_ammo" ]; + self.pers["clip_ammo"] = undefined; } self setweaponammoclip( weapon, clipammo ); stockammo = 0; if ( isDefined( self.pers[ "stock_ammo" ] ) ) { stockammo = self.pers[ "stock_ammo" ]; + self.pers["stock_ammo"] = undefined; } self setweaponammostock( weapon, stockammo ); self setspawnweapon( weapon ); @@ -91,6 +93,7 @@ onstartgametype() //checked matches cerberus output setobjectivescoretext( "allies", &"OBJECTIVES_DM_SCORE" ); setobjectivescoretext( "axis", &"OBJECTIVES_DM_SCORE" ); } + allowed = []; allowed[ 0 ] = "oic"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); diff --git a/patch_mp/maps/mp/gametypes/oneflag.gsc b/patch_mp/maps/mp/gametypes/oneflag.gsc index a9db045..87559be 100644 --- a/patch_mp/maps/mp/gametypes/oneflag.gsc +++ b/patch_mp/maps/mp/gametypes/oneflag.gsc @@ -189,6 +189,7 @@ onstartgametype() //checked changed to match cerberus output setobjectivehinttext( "axis", &"MP_ONE_FLAG_CTF_OVERTIME_ROUND_2_TIE" ); } } + allowed = []; allowed[ 0 ] = "ctf"; allowed[ 1 ] = "dom"; maps/mp/gametypes/_gameobjects::main( allowed ); @@ -464,6 +465,7 @@ updategametypedvars() //checked matches cerberus output createflag( trigger ) //checked matches cerberus output { + visuals = []; if ( isDefined( trigger.target ) ) { visuals[ 0 ] = getent( trigger.target, "targetname" ); diff --git a/patch_mp/maps/mp/gametypes/sas.gsc b/patch_mp/maps/mp/gametypes/sas.gsc index 610dba2..d7ea558 100644 --- a/patch_mp/maps/mp/gametypes/sas.gsc +++ b/patch_mp/maps/mp/gametypes/sas.gsc @@ -204,6 +204,7 @@ onstartgametype() //checked changed to match cerberus output } maps/mp/_utility::setobjectivehinttext( "allies", &"OBJECTIVES_SAS_HINT" ); maps/mp/_utility::setobjectivehinttext( "axis", &"OBJECTIVES_SAS_HINT" ); + allowed = []; allowed[ 0 ] = "sas"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); diff --git a/patch_mp/maps/mp/gametypes/sd.gsc b/patch_mp/maps/mp/gametypes/sd.gsc index a6d9f26..de109f1 100644 --- a/patch_mp/maps/mp/gametypes/sd.gsc +++ b/patch_mp/maps/mp/gametypes/sd.gsc @@ -1,3 +1,4 @@ +//checked includes match cerberus output #include maps/mp/gametypes/_hostmigration; #include maps/mp/gametypes/_globallogic_utils; #include maps/mp/_demo; @@ -156,7 +157,7 @@ getbetterteam() //checked changed to match cerberus output { player = level.players[ i ]; team = player.pers[ "team" ]; - if ( isDefined( team ) || team == "allies" && team == "axis" ) + if ( ( team == "allies" || team == "axis" ) && isDefined( team ) ) { kills[ team ] += player.kills; deaths[ team ] += player.deaths; @@ -222,13 +223,14 @@ onstartgametype() //checked matches cerberus output } setobjectivehinttext( game[ "attackers" ], &"OBJECTIVES_SD_ATTACKER_HINT" ); setobjectivehinttext( game[ "defenders" ], &"OBJECTIVES_SD_DEFENDER_HINT" ); + allowed = []; allowed[ 0 ] = "sd"; allowed[ 1 ] = "bombzone"; allowed[ 2 ] = "blocker"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); - level.spawnmins = ( 0, 0, 1 ); - level.spawnmaxs = ( 0, 0, 1 ); + level.spawnmins = ( 0, 0, 0 ); + level.spawnmaxs = ( 0, 0, 0 ); maps/mp/gametypes/_spawnlogic::placespawnpoints( "mp_sd_spawn_attacker" ); maps/mp/gametypes/_spawnlogic::placespawnpoints( "mp_sd_spawn_defender" ); level.mapcenter = maps/mp/gametypes/_spawnlogic::findboxcenter( level.spawnmins, level.spawnmaxs ); @@ -313,15 +315,18 @@ onplayerkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shi self recordkillmodifier( "defending" ); maps/mp/_scoreevents::processscoreevent( "killed_defender", attacker, self, sweapon ); } - else if ( isDefined( attacker.pers[ "defends" ] ) ) + else { - attacker.pers[ "defends" ]++; - attacker.defends = attacker.pers[ "defends" ]; + if ( isDefined( attacker.pers[ "defends" ] ) ) + { + attacker.pers[ "defends" ]++; + attacker.defends = attacker.pers[ "defends" ]; + } + attacker maps/mp/_medals::defenseglobalcount(); + attacker addplayerstatwithgametype( "DEFENDS", 1 ); + self recordkillmodifier( "assaulting" ); + maps/mp/_scoreevents::processscoreevent( "killed_attacker", attacker, self, sweapon ); } - attacker maps/mp/_medals::defenseglobalcount(); - attacker addplayerstatwithgametype( "DEFENDS", 1 ); - self recordkillmodifier( "assaulting" ); - maps/mp/_scoreevents::processscoreevent( "killed_attacker", attacker, self, sweapon ); } if ( isplayer( attacker ) && attacker.pers[ "team" ] != self.pers[ "team" ] && isDefined( self.isbombcarrier ) && self.isbombcarrier == 1 ) { @@ -342,8 +347,15 @@ checkallowspectating() //checked matches cerberus output self endon( "disconnect" ); wait 0.05; update = 0; - if ( level.numliveslivesleft = self.pers[ "lives" ]; - && !level.alivecount[ game[ "attackers" ] ] && !livesleft ) + if ( !level.numliveslivesleft && !self.pers[ "lives" ] ) + { + livesleft = 0; + } + else + { + livesleft = 1; + } + if ( !level.alivecount[ game[ "attackers" ] ] && !livesleft ) { level.spectateoverride[ game[ "attackers" ] ].allowenemyspectate = 1; update = 1; @@ -518,6 +530,7 @@ bombs() //checked changed to match cerberus output */ return; } + visuals = []; visuals[ 0 ] = getent( "sd_bomb", "targetname" ); if ( !isDefined( visuals[ 0 ] ) ) { @@ -626,13 +639,16 @@ onbeginuse( player ) //checked changed to match cerberus output level.sdbombmodel hide(); } } - player.isplanting = 1; - player thread maps/mp/gametypes/_battlechatter_mp::gametypespecificbattlechatter( "sd_friendlyplant", player.pers[ "team" ] ); - while ( level.multibomb ) + else { - for ( i = 0; i < self.otherbombzones.size; i++ ) + player.isplanting = 1; + player thread maps/mp/gametypes/_battlechatter_mp::gametypespecificbattlechatter( "sd_friendlyplant", player.pers[ "team" ] ); + if ( level.multibomb ) { - self.otherbombzones[ i ] maps/mp/gametypes/_gameobjects::disableobject(); + for ( i = 0; i < self.otherbombzones.size; i++ ) + { + self.otherbombzones[ i ] maps/mp/gametypes/_gameobjects::disableobject(); + } } } player playsound( "fly_bomb_raise_plr" ); @@ -654,11 +670,14 @@ onenduse( team, player, result ) //checked changed to match cerberus output level.sdbombmodel show(); } } - if ( level.multibomb && !result ) + else { - for ( i = 0; i < self.otherbombzones.size; i++ ) + if ( level.multibomb && !result ) { - self.otherbombzones[ i ] maps/mp/gametypes/_gameobjects::enableobject(); + for ( i = 0; i < self.otherbombzones.size; i++ ) + { + self.otherbombzones[ i ] maps/mp/gametypes/_gameobjects::enableobject(); + } } } } @@ -946,7 +965,7 @@ sd_iskillboosting() //checked matches cerberus output { return 1; } - if ( level.teambased || self.team == "allies" && self.team == "axis" ) + if ( ( self.team == "allies" || self.team == "axis" ) && level.teambased ) { if ( game[ "totalKillsTeam" ][ self.team ] > ( level.playerkillsmax * ( roundsplayed + 1 ) ) ) { diff --git a/patch_mp/maps/mp/gametypes/shrp.gsc b/patch_mp/maps/mp/gametypes/shrp.gsc index 928e701..eb33e3d 100644 --- a/patch_mp/maps/mp/gametypes/shrp.gsc +++ b/patch_mp/maps/mp/gametypes/shrp.gsc @@ -74,6 +74,7 @@ onstartgametype() //checked matches cerberus output } setobjectivehinttext( "allies", &"OBJECTIVES_SHRP_HINT" ); setobjectivehinttext( "axis", &"OBJECTIVES_SHRP_HINT" ); + allowed = []; allowed[ 0 ] = "shrp"; maps/mp/gametypes/_gameobjects::main( allowed ); maps/mp/gametypes/_spawning::create_map_placed_influencers(); @@ -424,6 +425,7 @@ chooserandomguns() //checked changed to match cerberus output may need to review { level.players[ i ] thread maps/mp/gametypes/_wager::queuewagerpopup( &"MP_SHRP_RND", 0, &"MP_SHRP_FINAL_MULTIPLIER", "wm_shrp_rnd" ); } + break; } else {