checked 6 scripts one of which was a dual script

Checked _globallogic_actor, _globallogic_defualts, _globallogic_ui, _globallogic_utils, _globallogic_vehicle for patch_mp. Checked _globallogic_actor for patch_zm. Checked zm_nuked for zm_nuked_patch.
This commit is contained in:
JezuzLizard 2020-05-22 09:04:12 -07:00
parent 83a2e644ea
commit aab6678ec2
11 changed files with 970 additions and 1074 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/_challenges; #include maps/mp/_challenges;
#include maps/mp/_scoreevents; #include maps/mp/_scoreevents;
#include maps/mp/gametypes/_damagefeedback; #include maps/mp/gametypes/_damagefeedback;
@ -7,7 +8,7 @@
#include maps/mp/gametypes/_globallogic_player; #include maps/mp/gametypes/_globallogic_player;
#include maps/mp/_utility; #include maps/mp/_utility;
callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex ) callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex ) //checked changed to match cerberus output
{ {
if ( game[ "state" ] == "postgame" ) if ( game[ "state" ] == "postgame" )
{ {
@ -45,12 +46,9 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
{ {
return; return;
} }
else else if ( smeansofdeath == "MOD_HEAD_SHOT" )
{ {
if ( smeansofdeath == "MOD_HEAD_SHOT" ) idamage = 150;
{
idamage = 150;
}
} }
} }
if ( smeansofdeath == "MOD_BURNED" ) if ( smeansofdeath == "MOD_BURNED" )
@ -70,12 +68,9 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
{ {
sweapon = "explodable_barrel_mp"; sweapon = "explodable_barrel_mp";
} }
else else if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
{ {
if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) ) sweapon = "destructible_car_mp";
{
sweapon = "destructible_car_mp";
}
} }
} }
if ( idflags & level.idflags_no_protection ) if ( idflags & level.idflags_no_protection )
@ -104,56 +99,55 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
{ {
return; return;
} }
else else if ( level.friendlyfire == 3 )
{ {
if ( level.friendlyfire == 3 ) idamage = int( idamage * 0,5 );
if ( idamage < 1 )
{ {
idamage = int( idamage * 0,5 ); idamage = 1;
if ( idamage < 1 )
{
idamage = 1;
}
self.lastdamagewasfromenemy = 0;
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
} }
self.lastdamagewasfromenemy = 0;
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
} }
friendly = 1; friendly = 1;
} }
else if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode )
{
return;
}
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && isDefined( eattacker.script_owner ) && eattacker.script_owner == self.script_owner )
{
return;
}
if ( idamage < 1 )
{
idamage = 1;
}
if ( isDefined( eattacker ) && isplayer( eattacker ) && isDefined( sweapon ) && !issubstr( smeansofdeath, "MOD_MELEE" ) )
{
eattacker thread maps/mp/gametypes/_weapons::checkhit( sweapon );
}
if ( issubstr( smeansofdeath, "MOD_GRENADE" ) && isDefined( einflictor ) && isDefined( einflictor.iscooked ) )
{
self.wascooked = getTime();
}
else else
{ {
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode ) self.wascooked = undefined;
{
return;
}
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && isDefined( eattacker.script_owner ) && eattacker.script_owner == self.script_owner )
{
return;
}
if ( idamage < 1 )
{
idamage = 1;
}
if ( isDefined( eattacker ) && isplayer( eattacker ) && isDefined( sweapon ) && !issubstr( smeansofdeath, "MOD_MELEE" ) )
{
eattacker thread maps/mp/gametypes/_weapons::checkhit( sweapon );
}
if ( issubstr( smeansofdeath, "MOD_GRENADE" ) && isDefined( einflictor ) && isDefined( einflictor.iscooked ) )
{
self.wascooked = getTime();
}
else
{
self.wascooked = undefined;
}
if ( isDefined( eattacker ) )
{
self.lastdamagewasfromenemy = eattacker != self;
}
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
} }
if ( isDefined( eattacker ) && eattacker != self ) if ( isDefined( eattacker ) && eattacker != self )
{ {
if ( sweapon != "artillery_mp" || !isDefined( einflictor ) && !isai( einflictor ) ) self.lastdamagewasfromenemy = 1;
}
else
{
self.lastdamagewasfromenemy = 0;
}
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
}
if ( isDefined( eattacker ) && eattacker != self )
{
if ( sweapon != "artillery_mp" && !isDefined( einflictor ) || !isai( einflictor ) )
{ {
if ( idamage > 0 ) if ( idamage > 0 )
{ {
@ -162,12 +156,14 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
} }
} }
} }
/*
/# /#
if ( getDvarInt( "g_debugDamage" ) ) if ( getDvarInt( "g_debugDamage" ) )
{ {
println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + " hitLoc:" + shitloc ); println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + " hitLoc:" + shitloc );
#/ #/
} }
*/
if ( 1 ) if ( 1 )
{ {
lpselfnum = self getentitynumber(); lpselfnum = self getentitynumber();
@ -191,7 +187,7 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
} }
} }
callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime ) callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime ) //checked matches cerberus output
{ {
if ( game[ "state" ] == "postgame" ) if ( game[ "state" ] == "postgame" )
{ {
@ -219,3 +215,4 @@ callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdi
} }
} }
} }

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_rank; #include maps/mp/gametypes/_rank;
#include maps/mp/killstreaks/_killstreaks; #include maps/mp/killstreaks/_killstreaks;
#include maps/mp/gametypes/_spawnlogic; #include maps/mp/gametypes/_spawnlogic;
@ -8,23 +9,20 @@
#include maps/mp/_utility; #include maps/mp/_utility;
#include common_scripts/utility; #include common_scripts/utility;
getwinningteamfromloser( losing_team ) getwinningteamfromloser( losing_team ) //checked changed to match cerberus output
{ {
if ( level.multiteam ) if ( level.multiteam )
{ {
return "tie"; return "tie";
} }
else else if ( losing_team == "axis" )
{ {
if ( losing_team == "axis" ) return "allies";
{
return "allies";
}
} }
return "axis"; return "axis";
} }
default_onforfeit( team ) default_onforfeit( team ) //checked matches cerberus output
{ {
level.gameforfeited = 1; level.gameforfeited = 1;
level notify( "forfeit in progress" ); level notify( "forfeit in progress" );
@ -56,12 +54,14 @@ default_onforfeit( team )
} }
else else
{ {
/*
/# /#
assert( isDefined( team ), "Forfeited team is not defined" ); assert( isDefined( team ), "Forfeited team is not defined" );
#/ #/
/# /#
assert( 0, "Forfeited team " + team + " is not allies or axis" ); assert( 0, "Forfeited team " + team + " is not allies or axis" );
#/ #/
*/
winner = "tie"; winner = "tie";
} }
level.forcedend = 1; level.forcedend = 1;
@ -76,7 +76,7 @@ default_onforfeit( team )
thread maps/mp/gametypes/_globallogic::endgame( winner, endreason ); thread maps/mp/gametypes/_globallogic::endgame( winner, endreason );
} }
default_ondeadevent( team ) default_ondeadevent( team ) //checked changed to match cerberus output
{ {
if ( isDefined( level.teams[ team ] ) ) if ( isDefined( level.teams[ team ] ) )
{ {
@ -88,20 +88,23 @@ default_ondeadevent( team )
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "team eliminated", winner ); maps/mp/gametypes/_globallogic_utils::logteamwinstring( "team eliminated", winner );
thread maps/mp/gametypes/_globallogic::endgame( winner, eliminatedstring ); thread maps/mp/gametypes/_globallogic::endgame( winner, eliminatedstring );
} }
else makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "tie" ] );
setdvar( "ui_text_endreason", game[ "strings" ][ "tie" ] );
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "tie" );
if ( level.teambased )
{
thread maps/mp/gametypes/_globallogic::endgame( "tie", game[ "strings" ][ "tie" ] );
}
else else
{ {
thread maps/mp/gametypes/_globallogic::endgame( undefined, game[ "strings" ][ "tie" ] ); makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "tie" ] );
setdvar( "ui_text_endreason", game[ "strings" ][ "tie" ] );
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "tie" );
if ( level.teambased )
{
thread maps/mp/gametypes/_globallogic::endgame( "tie", game[ "strings" ][ "tie" ] );
}
else
{
thread maps/mp/gametypes/_globallogic::endgame( undefined, game[ "strings" ][ "tie" ] );
}
} }
} }
default_onlastteamaliveevent( team ) default_onlastteamaliveevent( team ) //checked changed to match cerberus output
{ {
if ( isDefined( level.teams[ team ] ) ) if ( isDefined( level.teams[ team ] ) )
{ {
@ -113,29 +116,32 @@ default_onlastteamaliveevent( team )
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "team eliminated", winner ); maps/mp/gametypes/_globallogic_utils::logteamwinstring( "team eliminated", winner );
thread maps/mp/gametypes/_globallogic::endgame( winner, eliminatedstring ); thread maps/mp/gametypes/_globallogic::endgame( winner, eliminatedstring );
} }
else makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "tie" ] );
setdvar( "ui_text_endreason", game[ "strings" ][ "tie" ] );
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "tie" );
if ( level.teambased )
{
thread maps/mp/gametypes/_globallogic::endgame( "tie", game[ "strings" ][ "tie" ] );
}
else else
{ {
thread maps/mp/gametypes/_globallogic::endgame( undefined, game[ "strings" ][ "tie" ] ); makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "tie" ] );
setdvar( "ui_text_endreason", game[ "strings" ][ "tie" ] );
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "tie" );
if ( level.teambased )
{
thread maps/mp/gametypes/_globallogic::endgame( "tie", game[ "strings" ][ "tie" ] );
}
else
{
thread maps/mp/gametypes/_globallogic::endgame( undefined, game[ "strings" ][ "tie" ] );
}
} }
} }
default_onalivecountchange( team ) default_onalivecountchange( team ) //checked matches cerberus output
{ {
} }
default_onroundendgame( winner ) default_onroundendgame( winner ) //checked matches cerberus output
{ {
return winner; return winner;
} }
default_ononeleftevent( team ) default_ononeleftevent( team ) //checked partially changed to match beta dump did not change while loop to for loop see github for more info
{ {
if ( !level.teambased ) if ( !level.teambased )
{ {
@ -161,21 +167,18 @@ default_ononeleftevent( team )
index++; index++;
continue; continue;
} }
else if ( !isDefined( player.pers[ "team" ] ) || player.pers[ "team" ] != team ) if ( !isDefined( player.pers[ "team" ] ) || player.pers[ "team" ] != team )
{ {
index++; index++;
continue; continue;
} }
else player maps/mp/gametypes/_globallogic_audio::leaderdialogonplayer( "sudden_death" );
{
player maps/mp/gametypes/_globallogic_audio::leaderdialogonplayer( "sudden_death" );
}
index++; index++;
} }
} }
} }
default_ontimelimit() default_ontimelimit() //checked changed to match cerberus output
{ {
winner = undefined; winner = undefined;
if ( level.teambased ) if ( level.teambased )
@ -183,21 +186,24 @@ default_ontimelimit()
winner = maps/mp/gametypes/_globallogic::determineteamwinnerbygamestat( "teamScores" ); winner = maps/mp/gametypes/_globallogic::determineteamwinnerbygamestat( "teamScores" );
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "time limit", winner ); maps/mp/gametypes/_globallogic_utils::logteamwinstring( "time limit", winner );
} }
else winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
if ( isDefined( winner ) )
{
logstring( "time limit, win: " + winner.name );
}
else else
{ {
logstring( "time limit, tie" ); winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
if ( isDefined( winner ) )
{
logstring( "time limit, win: " + winner.name );
}
else
{
logstring( "time limit, tie" );
}
} }
makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "time_limit_reached" ] ); makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "time_limit_reached" ] );
setdvar( "ui_text_endreason", game[ "strings" ][ "time_limit_reached" ] ); setdvar( "ui_text_endreason", game[ "strings" ][ "time_limit_reached" ] );
thread maps/mp/gametypes/_globallogic::endgame( winner, game[ "strings" ][ "time_limit_reached" ] ); thread maps/mp/gametypes/_globallogic::endgame( winner, game[ "strings" ][ "time_limit_reached" ] );
} }
default_onscorelimit() default_onscorelimit() //checked changed to match cerberus output
{ {
if ( !level.endgameonscorelimit ) if ( !level.endgameonscorelimit )
{ {
@ -209,14 +215,17 @@ default_onscorelimit()
winner = maps/mp/gametypes/_globallogic::determineteamwinnerbygamestat( "teamScores" ); winner = maps/mp/gametypes/_globallogic::determineteamwinnerbygamestat( "teamScores" );
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "scorelimit", winner ); maps/mp/gametypes/_globallogic_utils::logteamwinstring( "scorelimit", winner );
} }
else winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
if ( isDefined( winner ) )
{
logstring( "scorelimit, win: " + winner.name );
}
else else
{ {
logstring( "scorelimit, tie" ); winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
if ( isDefined( winner ) )
{
logstring( "scorelimit, win: " + winner.name );
}
else
{
logstring( "scorelimit, tie" );
}
} }
makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "score_limit_reached" ] ); makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "score_limit_reached" ] );
setdvar( "ui_text_endreason", game[ "strings" ][ "score_limit_reached" ] ); setdvar( "ui_text_endreason", game[ "strings" ][ "score_limit_reached" ] );
@ -224,7 +233,7 @@ default_onscorelimit()
return 1; return 1;
} }
default_onspawnspectator( origin, angles ) default_onspawnspectator( origin, angles ) //checked matches cerberus output
{ {
if ( isDefined( origin ) && isDefined( angles ) ) if ( isDefined( origin ) && isDefined( angles ) )
{ {
@ -233,14 +242,16 @@ default_onspawnspectator( origin, angles )
} }
spawnpointname = "mp_global_intermission"; spawnpointname = "mp_global_intermission";
spawnpoints = getentarray( spawnpointname, "classname" ); spawnpoints = getentarray( spawnpointname, "classname" );
/*
/# /#
assert( spawnpoints.size, "There are no mp_global_intermission spawn points in the map. There must be at least one." ); assert( spawnpoints.size, "There are no mp_global_intermission spawn points in the map. There must be at least one." );
#/ #/
*/
spawnpoint = maps/mp/gametypes/_spawnlogic::getspawnpoint_random( spawnpoints ); spawnpoint = maps/mp/gametypes/_spawnlogic::getspawnpoint_random( spawnpoints );
self spawn( spawnpoint.origin, spawnpoint.angles ); self spawn( spawnpoint.origin, spawnpoint.angles );
} }
default_onspawnintermission() default_onspawnintermission() //checked matches cerberus output
{ {
spawnpointname = "mp_global_intermission"; spawnpointname = "mp_global_intermission";
spawnpoints = getentarray( spawnpointname, "classname" ); spawnpoints = getentarray( spawnpointname, "classname" );
@ -251,18 +262,20 @@ default_onspawnintermission()
} }
else else
{ {
/*
/# /#
maps/mp/_utility::error( "NO " + spawnpointname + " SPAWNPOINTS IN MAP" ); maps/mp/_utility::error( "NO " + spawnpointname + " SPAWNPOINTS IN MAP" );
#/ #/
*/
} }
} }
default_gettimelimit() default_gettimelimit() //checked matches cerberus output
{ {
return clamp( getgametypesetting( "timeLimit" ), level.timelimitmin, level.timelimitmax ); return clamp( getgametypesetting( "timeLimit" ), level.timelimitmin, level.timelimitmax );
} }
default_getteamkillpenalty( einflictor, attacker, smeansofdeath, sweapon ) default_getteamkillpenalty( einflictor, attacker, smeansofdeath, sweapon ) //checked matches cerberus output
{ {
teamkill_penalty = 1; teamkill_penalty = 1;
score = maps/mp/gametypes/_globallogic_score::_getplayerscore( attacker ); score = maps/mp/gametypes/_globallogic_score::_getplayerscore( attacker );
@ -277,7 +290,8 @@ default_getteamkillpenalty( einflictor, attacker, smeansofdeath, sweapon )
return teamkill_penalty; return teamkill_penalty;
} }
default_getteamkillscore( einflictor, attacker, smeansofdeath, sweapon ) default_getteamkillscore( einflictor, attacker, smeansofdeath, sweapon ) //checked matches cerberus output
{ {
return maps/mp/gametypes/_rank::getscoreinfovalue( "team_kill" ); return maps/mp/gametypes/_rank::getscoreinfovalue( "team_kill" );
} }

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_class; #include maps/mp/gametypes/_class;
#include maps/mp/gametypes/_globallogic_player; #include maps/mp/gametypes/_globallogic_player;
#include maps/mp/gametypes/_spectating; #include maps/mp/gametypes/_spectating;
@ -10,7 +11,7 @@
#include common_scripts/utility; #include common_scripts/utility;
#include maps/mp/_utility; #include maps/mp/_utility;
init() init() //checked matches cerberus output
{ {
precachestring( &"MP_HALFTIME" ); precachestring( &"MP_HALFTIME" );
precachestring( &"MP_OVERTIME" ); precachestring( &"MP_OVERTIME" );
@ -37,7 +38,7 @@ init()
} }
} }
setupcallbacks() setupcallbacks() //checked matches cerberus output
{ {
level.autoassign = ::menuautoassign; level.autoassign = ::menuautoassign;
level.spectator = ::menuspectator; level.spectator = ::menuspectator;
@ -45,16 +46,16 @@ setupcallbacks()
level.teammenu = ::menuteam; level.teammenu = ::menuteam;
} }
hideloadoutaftertime( delay ) hideloadoutaftertime( delay ) //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "perks_hidden" ); self endon( "perks_hidden" );
wait delay; wait delay;
self thread hideallperks( 0,4 ); self thread hideallperks( 0.4 );
self notify( "perks_hidden" ); self notify( "perks_hidden" );
} }
hideloadoutondeath() hideloadoutondeath() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "perks_hidden" ); self endon( "perks_hidden" );
@ -63,7 +64,7 @@ hideloadoutondeath()
self notify( "perks_hidden" ); self notify( "perks_hidden" );
} }
hideloadoutonkill() hideloadoutonkill() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
self endon( "death" ); self endon( "death" );
@ -73,19 +74,17 @@ hideloadoutonkill()
self notify( "perks_hidden" ); self notify( "perks_hidden" );
} }
freegameplayhudelems() freegameplayhudelems() //checked changed to match cerberus output
{ {
while ( isDefined( self.perkicon ) ) if ( isDefined( self.perkicon ) )
{ {
numspecialties = 0; for ( numspecialties = 0; numspecialties < level.maxspecialties; numspecialties++ )
while ( numspecialties < level.maxspecialties )
{ {
if ( isDefined( self.perkicon[ numspecialties ] ) ) if ( isDefined( self.perkicon[ numspecialties ] ) )
{ {
self.perkicon[ numspecialties ] destroyelem(); self.perkicon[ numspecialties ] destroyelem();
self.perkname[ numspecialties ] destroyelem(); self.perkname[ numspecialties ] destroyelem();
} }
numspecialties++;
} }
} }
if ( isDefined( self.perkhudelem ) ) if ( isDefined( self.perkhudelem ) )
@ -139,14 +138,11 @@ freegameplayhudelems()
maps/mp/killstreaks/_killstreaks::destroykillstreaktimers(); maps/mp/killstreaks/_killstreaks::destroykillstreaktimers();
} }
teamplayercountsequal( playercounts ) teamplayercountsequal( playercounts ) //checked partially changed to match cerberus output did not use continue see github for more info
{ {
count = undefined; count = undefined;
_a146 = level.teams; foreach ( team in level.teams )
_k146 = getFirstArrayKey( _a146 );
while ( isDefined( _k146 ) )
{ {
team = _a146[ _k146 ];
if ( !isDefined( count ) ) if ( !isDefined( count ) )
{ {
count = playercounts[ team ]; count = playercounts[ team ];
@ -158,31 +154,26 @@ teamplayercountsequal( playercounts )
return 0; return 0;
} }
} }
_k146 = getNextArrayKey( _a146, _k146 );
} }
return 1; return 1;
} }
teamwithlowestplayercount( playercounts, ignore_team ) teamwithlowestplayercount( playercounts, ignore_team ) //checked changed to match cerberus output
{ {
count = 9999; count = 9999;
lowest_team = undefined; lowest_team = undefined;
_a165 = level.teams; foreach ( team in level.teams )
_k165 = getFirstArrayKey( _a165 );
while ( isDefined( _k165 ) )
{ {
team = _a165[ _k165 ];
if ( count > playercounts[ team ] ) if ( count > playercounts[ team ] )
{ {
count = playercounts[ team ]; count = playercounts[ team ];
lowest_team = team; lowest_team = team;
} }
_k165 = getNextArrayKey( _a165, _k165 );
} }
return lowest_team; return lowest_team;
} }
menuautoassign( comingfrommenu ) menuautoassign( comingfrommenu ) //checked changed to match cerberus output
{ {
teamkeys = getarraykeys( level.teams ); teamkeys = getarraykeys( level.teams );
assignment = teamkeys[ randomint( teamkeys.size ) ]; assignment = teamkeys[ randomint( teamkeys.size ) ];
@ -191,80 +182,78 @@ menuautoassign( comingfrommenu )
{ {
assignment = "allies"; assignment = "allies";
} }
else else if ( level.teambased )
{ {
if ( level.teambased ) if ( getDvarInt( "party_autoteams" ) == 1 )
{ {
if ( getDvarInt( "party_autoteams" ) == 1 ) if ( level.allow_teamchange == "1" || self.hasspawned && comingfrommenu )
{ {
if ( level.allow_teamchange == "1" || self.hasspawned && comingfrommenu ) assignment = "";
{ }
assignment = ""; }
else
{
team = getassignedteam( self );
switch( team )
{
case 1:
assignment = teamkeys[ 1 ];
break; break;
case 2:
assignment = teamkeys[ 0 ];
break;
case 3:
assignment = teamkeys[ 2 ];
break;
case 4:
if ( !isDefined( level.forceautoassign ) || !level.forceautoassign )
{
self setclientscriptmainmenu( game[ "menu_class" ] );
return;
}
default:
assignment = "";
if ( isDefined( level.teams[ team ] ) )
{
assignment = team;
}
else if ( team == "spectator" && !level.forceautoassign )
{
self setclientscriptmainmenu( game[ "menu_class" ] );
return;
}
}
}
if ( assignment == "" || getDvarInt( "party_autoteams" ) == 0 )
{
if ( sessionmodeiszombiesgame() )
{
assignment = "allies";
}
else if ( maps/mp/bots/_bot::is_bot_comp_stomp() )
{
host = gethostplayerforbots();
/*
/#
assert( isDefined( host ) );
#/
*/
if ( !isDefined( host.team ) || host.team == "spectator" )
{
host.team = random( teamkeys );
}
if ( !self is_bot() )
{
assignment = host.team;
}
else
{
assignment = getotherteam( host.team );
}
} }
else else
{ {
team = getassignedteam( self ); playercounts = self maps/mp/teams/_teams::countplayers();
switch( team )
{
case 1:
assignment = teamkeys[ 1 ];
break;
case 2:
assignment = teamkeys[ 0 ];
break;
case 3:
assignment = teamkeys[ 2 ];
break;
case 4:
if ( !isDefined( level.forceautoassign ) || !level.forceautoassign )
{
self setclientscriptmainmenu( game[ "menu_class" ] );
return;
}
default:
assignment = "";
if ( isDefined( level.teams[ team ] ) )
{
assignment = team;
}
else
{
if ( team == "spectator" && !level.forceautoassign )
{
self setclientscriptmainmenu( game[ "menu_class" ] );
return;
}
}
}
}
}
if ( assignment == "" || getDvarInt( "party_autoteams" ) == 0 )
{
if ( sessionmodeiszombiesgame() )
{
assignment = "allies";
}
else if ( maps/mp/bots/_bot::is_bot_comp_stomp() )
{
host = gethostplayerforbots();
/#
assert( isDefined( host ) );
#/
if ( !isDefined( host.team ) || host.team == "spectator" )
{
host.team = random( teamkeys );
}
if ( !self is_bot() )
{
assignment = host.team;
}
else
{
assignment = getotherteam( host.team );
}
}
else playercounts = self maps/mp/teams/_teams::countplayers();
if ( teamplayercountsequal( playercounts ) ) if ( teamplayercountsequal( playercounts ) )
{ {
if ( !level.splitscreen && self issplitscreen() ) if ( !level.splitscreen && self issplitscreen() )
@ -285,33 +274,30 @@ menuautoassign( comingfrommenu )
assignment = teamwithlowestplayercount( playercounts, "none" ); assignment = teamwithlowestplayercount( playercounts, "none" );
} }
} }
if ( assignment == self.pers[ "team" ] || self.sessionstate == "playing" && self.sessionstate == "dead" ) }
if ( assignment == self.pers[ "team" ] && self.sessionstate == "playing" || self.sessionstate == "dead" )
{
self beginclasschoice();
return;
}
}
else if ( getDvarInt( "party_autoteams" ) == 1 )
{
if ( level.allow_teamchange != "1" || !self.hasspawned && !comingfrommenu )
{
team = getassignedteam( self );
if ( isDefined( level.teams[ team ] ) )
{ {
self beginclasschoice(); assignment = team;
}
else if ( team == "spectator" && !level.forceautoassign )
{
self setclientscriptmainmenu( game[ "menu_class" ] );
return; return;
} }
} }
else if ( getDvarInt( "party_autoteams" ) == 1 )
{
if ( level.allow_teamchange != "1" || !self.hasspawned && !comingfrommenu )
{
team = getassignedteam( self );
if ( isDefined( level.teams[ team ] ) )
{
assignment = team;
}
else
{
if ( team == "spectator" && !level.forceautoassign )
{
self setclientscriptmainmenu( game[ "menu_class" ] );
return;
}
}
}
}
} }
if ( assignment != self.pers[ "team" ] || self.sessionstate == "playing" && self.sessionstate == "dead" ) if ( assignment != self.pers[ "team" ] && self.sessionstate == "playing" || self.sessionstate == "dead" )
{ {
self.switching_teams = 1; self.switching_teams = 1;
self.joining_team = assignment; self.joining_team = assignment;
@ -320,7 +306,10 @@ menuautoassign( comingfrommenu )
} }
self.pers[ "team" ] = assignment; self.pers[ "team" ] = assignment;
self.team = assignment; self.team = assignment;
self.pers["class"] = undefined;
self.class = undefined; self.class = undefined;
self.pers["weapon"] = undefined;
self.pers["savedmodel"] = undefined;
self updateobjectivetext(); self updateobjectivetext();
if ( level.teambased ) if ( level.teambased )
{ {
@ -367,14 +356,11 @@ menuautoassign( comingfrommenu )
self setclientscriptmainmenu( game[ "menu_class" ] ); self setclientscriptmainmenu( game[ "menu_class" ] );
} }
teamscoresequal() teamscoresequal() //checked partially changed to match cerberus output did not use continue in foreach see github for more info
{ {
score = undefined; score = undefined;
_a397 = level.teams; foreach ( team in level.teams )
_k397 = getFirstArrayKey( _a397 );
while ( isDefined( _k397 ) )
{ {
team = _a397[ _k397 ];
if ( !isDefined( score ) ) if ( !isDefined( score ) )
{ {
score = getteamscore( team ); score = getteamscore( team );
@ -386,7 +372,6 @@ teamscoresequal()
return 0; return 0;
} }
} }
_k397 = getNextArrayKey( _a397, _k397 );
} }
return 1; return 1;
} }
@ -395,21 +380,17 @@ teamwithlowestscore()
{ {
score = 99999999; score = 99999999;
lowest_team = undefined; lowest_team = undefined;
_a416 = level.teams; foreach ( team in level.teams )
_k416 = getFirstArrayKey( _a416 );
while ( isDefined( _k416 ) )
{ {
team = _a416[ _k416 ];
if ( score > getteamscore( team ) ) if ( score > getteamscore( team ) )
{ {
lowest_team = team; lowest_team = team;
} }
_k416 = getNextArrayKey( _a416, _k416 );
} }
return lowest_team; return lowest_team;
} }
pickteamfromscores( teams ) pickteamfromscores( teams ) //checked matches cerberus output
{ {
assignment = "allies"; assignment = "allies";
if ( teamscoresequal() ) if ( teamscoresequal() )
@ -423,7 +404,7 @@ pickteamfromscores( teams )
return assignment; return assignment;
} }
getsplitscreenteam() getsplitscreenteam() //checked partially changed to match cerberus output did not use for loop see github for more info
{ {
index = 0; index = 0;
while ( index < level.players.size ) while ( index < level.players.size )
@ -433,30 +414,27 @@ getsplitscreenteam()
index++; index++;
continue; continue;
} }
else if ( level.players[ index ] == self ) if ( level.players[ index ] == self )
{ {
index++; index++;
continue; continue;
} }
else if ( !self isplayeronsamemachine( level.players[ index ] ) ) if ( !self isplayeronsamemachine( level.players[ index ] ) )
{ {
index++; index++;
continue; continue;
} }
else team = level.players[ index ].sessionteam;
if ( team != "spectator" )
{ {
team = level.players[ index ].sessionteam; return team;
if ( team != "spectator" )
{
return team;
}
} }
index++; index++;
} }
return ""; return "";
} }
updateobjectivetext() updateobjectivetext() //checked matches cerberus output
{ {
if ( sessionmodeiszombiesgame() || self.pers[ "team" ] == "spectator" ) if ( sessionmodeiszombiesgame() || self.pers[ "team" ] == "spectator" )
{ {
@ -473,17 +451,19 @@ updateobjectivetext()
} }
} }
closemenus() closemenus() //checked matches cerberus output
{ {
self closemenu(); self closemenu();
self closeingamemenu(); self closeingamemenu();
} }
beginclasschoice( forcenewchoice ) beginclasschoice( forcenewchoice ) //checked matches cerberus output
{ {
/*
/# /#
assert( isDefined( level.teams[ self.pers[ "team" ] ] ) ); assert( isDefined( level.teams[ self.pers[ "team" ] ] ) );
#/ #/
*/
team = self.pers[ "team" ]; team = self.pers[ "team" ];
if ( level.disableclassselection == 1 || getDvarInt( "migration_soak" ) == 1 ) if ( level.disableclassselection == 1 || getDvarInt( "migration_soak" ) == 1 )
{ {
@ -511,11 +491,13 @@ beginclasschoice( forcenewchoice )
} }
} }
showmainmenuforteam() showmainmenuforteam() //checked matches cerberus output
{ {
/*
/# /#
assert( isDefined( level.teams[ self.pers[ "team" ] ] ) ); assert( isDefined( level.teams[ self.pers[ "team" ] ] ) );
#/ #/
*/
team = self.pers[ "team" ]; team = self.pers[ "team" ];
if ( level.wagermatch ) if ( level.wagermatch )
{ {
@ -527,7 +509,7 @@ showmainmenuforteam()
} }
} }
menuteam( team ) menuteam( team ) //checked changed to match cerberus output
{ {
self closemenus(); self closemenus();
if ( !level.console && level.allow_teamchange == "0" && isDefined( self.hasdonecombat ) && self.hasdonecombat ) if ( !level.console && level.allow_teamchange == "0" && isDefined( self.hasdonecombat ) && self.hasdonecombat )
@ -549,7 +531,10 @@ menuteam( team )
} }
self.pers[ "team" ] = team; self.pers[ "team" ] = team;
self.team = team; self.team = team;
self.pers[ "class" ] = undefined;
self.class = undefined; self.class = undefined;
self.pers[ "weapon" ] = undefined;
self.pers[ "savedmodel" ] = undefined;
self updateobjectivetext(); self updateobjectivetext();
if ( !level.rankedmatch && !level.leaguematch ) if ( !level.rankedmatch && !level.leaguematch )
{ {
@ -572,7 +557,7 @@ menuteam( team )
self beginclasschoice(); self beginclasschoice();
} }
menuspectator() menuspectator() //checked changed to match cerberus output
{ {
self closemenus(); self closemenus();
if ( self.pers[ "team" ] != "spectator" ) if ( self.pers[ "team" ] != "spectator" )
@ -586,7 +571,10 @@ menuspectator()
} }
self.pers[ "team" ] = "spectator"; self.pers[ "team" ] = "spectator";
self.team = "spectator"; self.team = "spectator";
self.pers[ "class" ] = undefined;
self.class = undefined; self.class = undefined;
self.pers[ "weapon" ] = undefined;
self.pers[ "savedmodel" ] = undefined;
self updateobjectivetext(); self updateobjectivetext();
self.sessionteam = "spectator"; self.sessionteam = "spectator";
if ( !level.teambased ) if ( !level.teambased )
@ -600,7 +588,7 @@ menuspectator()
} }
} }
menuclass( response ) menuclass( response ) //checked changed to match cerberus output
{ {
self closemenus(); self closemenus();
if ( !isDefined( self.pers[ "team" ] ) || !isDefined( level.teams[ self.pers[ "team" ] ] ) ) if ( !isDefined( self.pers[ "team" ] ) || !isDefined( level.teams[ self.pers[ "team" ] ] ) )
@ -635,7 +623,7 @@ menuclass( response )
supplystationclasschange = self.usingsupplystation; supplystationclasschange = self.usingsupplystation;
} }
self.usingsupplystation = 0; self.usingsupplystation = 0;
if ( level.ingraceperiod || !self.hasdonecombat && supplystationclasschange ) if ( level.ingraceperiod && !self.hasdonecombat || supplystationclasschange )
{ {
self maps/mp/gametypes/_class::setclass( self.pers[ "class" ] ); self maps/mp/gametypes/_class::setclass( self.pers[ "class" ] );
self.tag_stowed_back = undefined; self.tag_stowed_back = undefined;
@ -643,18 +631,16 @@ menuclass( response )
self maps/mp/gametypes/_class::giveloadout( self.pers[ "team" ], self.pers[ "class" ] ); self maps/mp/gametypes/_class::giveloadout( self.pers[ "team" ], self.pers[ "class" ] );
self maps/mp/killstreaks/_killstreaks::giveownedkillstreak(); self maps/mp/killstreaks/_killstreaks::giveownedkillstreak();
} }
else else if ( !self issplitscreen() )
{ {
if ( !self issplitscreen() ) self iprintlnbold( game[ "strings" ][ "change_class" ] );
{
self iprintlnbold( game[ "strings" ][ "change_class" ] );
}
} }
} }
else else
{ {
self.pers[ "class" ] = class; self.pers[ "class" ] = class;
self.class = class; self.class = class;
self.pers[ "weapon" ] = undefined;
if ( game[ "state" ] == "postgame" ) if ( game[ "state" ] == "postgame" )
{ {
return; return;
@ -689,7 +675,7 @@ menuclass( response )
self thread maps/mp/gametypes/_spectating::setspectatepermissionsformachine(); self thread maps/mp/gametypes/_spectating::setspectatepermissionsformachine();
} }
removespawnmessageshortly( delay ) removespawnmessageshortly( delay ) //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
waittillframeend; waittillframeend;
@ -697,3 +683,4 @@ removespawnmessageshortly( delay )
wait delay; wait delay;
self clearlowermessage( 2 ); self clearlowermessage( 2 );
} }

View File

@ -1,19 +1,20 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_globallogic_score; #include maps/mp/gametypes/_globallogic_score;
#include maps/mp/gametypes/_hostmigration; #include maps/mp/gametypes/_hostmigration;
#include maps/mp/killstreaks/_killstreaks; #include maps/mp/killstreaks/_killstreaks;
#include maps/mp/gametypes/_hud_message; #include maps/mp/gametypes/_hud_message;
#include maps/mp/_utility; #include maps/mp/_utility;
waittillslowprocessallowed() waittillslowprocessallowed() //checked matches cerberus output
{ {
while ( level.lastslowprocessframe == getTime() ) while ( level.lastslowprocessframe == getTime() )
{ {
wait 0,05; wait 0.05;
} }
level.lastslowprocessframe = getTime(); level.lastslowprocessframe = getTime();
} }
testmenu() testmenu() //checked matches cerberus output
{ {
self endon( "death" ); self endon( "death" );
self endon( "disconnect" ); self endon( "disconnect" );
@ -28,7 +29,7 @@ testmenu()
} }
} }
testshock() testshock() //checked changed to match cerberus output
{ {
self endon( "death" ); self endon( "death" );
self endon( "disconnect" ); self endon( "disconnect" );
@ -36,18 +37,16 @@ testshock()
{ {
wait 3; wait 3;
numshots = randomint( 6 ); numshots = randomint( 6 );
i = 0; for ( i = 0; i < numshots; i++ )
while ( i < numshots )
{ {
iprintlnbold( numshots ); iprintlnbold( numshots );
self shellshock( "frag_grenade_mp", 0,2 ); self shellshock( "frag_grenade_mp", 0,2 );
wait 0,1; wait 0.1;
i++;
} }
} }
} }
testhps() testhps() //checked matches cerberus output
{ {
self endon( "death" ); self endon( "death" );
self endon( "disconnect" ); self endon( "disconnect" );
@ -66,7 +65,7 @@ testhps()
} }
} }
timeuntilroundend() timeuntilroundend() //checked matches cerberus output
{ {
if ( level.gameended ) if ( level.gameended )
{ {
@ -95,12 +94,12 @@ timeuntilroundend()
return timeremaining + level.postroundtime; return timeremaining + level.postroundtime;
} }
gettimeremaining() gettimeremaining() //checked matches cerberus output
{ {
return ( ( level.timelimit * 60 ) * 1000 ) - gettimepassed(); return ( ( level.timelimit * 60 ) * 1000 ) - gettimepassed();
} }
registerpostroundevent( eventfunc ) registerpostroundevent( eventfunc ) //checked matches cerberus output
{ {
if ( !isDefined( level.postroundevents ) ) if ( !isDefined( level.postroundevents ) )
{ {
@ -109,98 +108,86 @@ registerpostroundevent( eventfunc )
level.postroundevents[ level.postroundevents.size ] = eventfunc; level.postroundevents[ level.postroundevents.size ] = eventfunc;
} }
executepostroundevents() executepostroundevents() //checked changed to match cerberus output
{ {
if ( !isDefined( level.postroundevents ) ) if ( !isDefined( level.postroundevents ) )
{ {
return; return;
} }
i = 0; for ( i = 0; i < level.postroundevents.size; i++ )
while ( i < level.postroundevents.size )
{ {
[[ level.postroundevents[ i ] ]](); [[ level.postroundevents[ i ] ]]();
i++;
} }
} }
getvalueinrange( value, minvalue, maxvalue ) getvalueinrange( value, minvalue, maxvalue ) //checked changed to match cerberus output
{ {
if ( value > maxvalue ) if ( value > maxvalue )
{ {
return maxvalue; return maxvalue;
} }
else if ( value < minvalue )
{
return minvalue;
}
else else
{ {
if ( value < minvalue ) return value;
{
return minvalue;
}
else
{
return value;
}
} }
} }
assertproperplacement() assertproperplacement() //checked partially changed to match cerberus output changed at own discretion
{ {
/*
/# /#
numplayers = level.placement[ "all" ].size; numplayers = level.placement[ "all" ].size;
if ( level.teambased ) if ( level.teambased )
{ {
i = 0; for ( i = 0; i < numplayers - 1; i++ )
while ( i < ( numplayers - 1 ) )
{ {
if ( level.placement[ "all" ][ i ].score < level.placement[ "all" ][ i + 1 ].score ) if ( level.placement[ "all" ][ i ].score < level.placement[ "all" ][ i + 1 ].score )
{ {
println( "^1Placement array:" ); println( "^1Placement array:" );
i = 0; for ( i = 0; i < numplayers; i++ )
while ( i < numplayers )
{ {
player = level.placement[ "all" ][ i ]; player = level.placement[ "all" ][ i ];
println( "^1" + i + ". " + player.name + ": " + player.score ); println( "^1" + i + ". " + player.name + ": " + player.score );
i++;
} }
assertmsg( "Placement array was not properly sorted" ); assertmsg( "Placement array was not properly sorted" );
break; break;
} }
else
{
i++;
}
} }
} }
else i = 0; else
while ( i < ( numplayers - 1 ) )
{ {
if ( level.placement[ "all" ][ i ].pointstowin < level.placement[ "all" ][ i + 1 ].pointstowin ) for ( i = 0; i < numplayers - 1; i++ )
{ {
println( "^1Placement array:" ); if ( level.placement[ "all" ][ i ].pointstowin < level.placement[ "all" ][ i + 1 ].pointstowin )
i = 0;
while ( i < numplayers )
{ {
player = level.placement[ "all" ][ i ]; println( "^1Placement array:" );
println( "^1" + i + ". " + player.name + ": " + player.pointstowin ); for ( i = 0; i < numplayers; i++ )
i++; {
player = level.placement[ "all" ][ i ];
println( "^1" + i + ". " + player.name + ": " + player.pointstowin );
}
assertmsg( "Placement array was not properly sorted" );
break;
} }
assertmsg( "Placement array was not properly sorted" );
return;
}
else
{
i++;
#/
} }
} }
#/
*/
} }
isvalidclass( class ) isvalidclass( class ) //checked matches cerberus output
{ {
if ( level.oldschool || sessionmodeiszombiesgame() ) if ( level.oldschool || sessionmodeiszombiesgame() )
{ {
/*
/# /#
assert( !isDefined( class ) ); assert( !isDefined( class ) );
#/ #/
*/
return 1; return 1;
} }
if ( isDefined( class ) ) if ( isDefined( class ) )
@ -209,7 +196,7 @@ isvalidclass( class )
} }
} }
playtickingsound( gametype_tick_sound ) playtickingsound( gametype_tick_sound ) //checked matches cerberus output
{ {
self endon( "death" ); self endon( "death" );
self endon( "stop_ticking" ); self endon( "stop_ticking" );
@ -226,28 +213,28 @@ playtickingsound( gametype_tick_sound )
else if ( time > 4 ) else if ( time > 4 )
{ {
time -= 0,5; time -= 0,5;
wait 0,5; wait 0.5;
} }
else if ( time > 1 ) else if ( time > 1 )
{ {
time -= 0,4; time -= 0,4;
wait 0,4; wait 0.4;
} }
else else
{ {
time -= 0,3; time -= 0,3;
wait 0,3; wait 0.3;
} }
maps/mp/gametypes/_hostmigration::waittillhostmigrationdone(); maps/mp/gametypes/_hostmigration::waittillhostmigrationdone();
} }
} }
stoptickingsound() stoptickingsound() //checked matches cerberus output
{ {
self notify( "stop_ticking" ); self notify( "stop_ticking" );
} }
gametimer() gametimer() //checked changed to match cerberus output
{ {
level endon( "game_ended" ); level endon( "game_ended" );
level waittill( "prematch_over" ); level waittill( "prematch_over" );
@ -256,6 +243,7 @@ gametimer()
if ( isDefined( game[ "roundMillisecondsAlreadyPassed" ] ) ) if ( isDefined( game[ "roundMillisecondsAlreadyPassed" ] ) )
{ {
level.starttime -= game[ "roundMillisecondsAlreadyPassed" ]; level.starttime -= game[ "roundMillisecondsAlreadyPassed" ];
game["roundMillisecondsAlreadyPassed"] = undefined;
} }
prevtime = getTime(); prevtime = getTime();
while ( game[ "state" ] == "playing" ) while ( game[ "state" ] == "playing" )
@ -269,7 +257,7 @@ gametimer()
} }
} }
gettimepassed() gettimepassed() //checked matches cerberus output
{ {
if ( !isDefined( level.starttime ) ) if ( !isDefined( level.starttime ) )
{ {
@ -285,7 +273,7 @@ gettimepassed()
} }
} }
pausetimer() pausetimer() //checked matches cerberus output
{ {
if ( level.timerstopped ) if ( level.timerstopped )
{ {
@ -295,7 +283,7 @@ pausetimer()
level.timerpausetime = getTime(); level.timerpausetime = getTime();
} }
resumetimer() resumetimer() //checked matches cerberus output
{ {
if ( !level.timerstopped ) if ( !level.timerstopped )
{ {
@ -305,14 +293,16 @@ resumetimer()
level.discardtime += getTime() - level.timerpausetime; level.discardtime += getTime() - level.timerpausetime;
} }
getscoreremaining( team ) getscoreremaining( team ) //checked matches cerberus output
{ {
/*
/# /#
if ( !isplayer( self ) ) if ( !isplayer( self ) )
{ {
assert( isDefined( team ) ); assert( isDefined( team ) );
} }
#/ #/
*/
scorelimit = level.scorelimit; scorelimit = level.scorelimit;
if ( isplayer( self ) ) if ( isplayer( self ) )
{ {
@ -324,7 +314,7 @@ getscoreremaining( team )
} }
} }
getteamscoreforround( team ) getteamscoreforround( team ) //checked matches cerberus output
{ {
if ( level.roundscorecarry && isDefined( game[ "lastroundscore" ][ team ] ) ) if ( level.roundscorecarry && isDefined( game[ "lastroundscore" ][ team ] ) )
{ {
@ -333,17 +323,19 @@ getteamscoreforround( team )
return getteamscore( team ); return getteamscore( team );
} }
getscoreperminute( team ) getscoreperminute( team ) //checked matches cerberus output
{ {
/*
/# /#
if ( !isplayer( self ) ) if ( !isplayer( self ) )
{ {
assert( isDefined( team ) ); assert( isDefined( team ) );
} }
#/ #/
*/
scorelimit = level.scorelimit; scorelimit = level.scorelimit;
timelimit = level.timelimit; timelimit = level.timelimit;
minutespassed = ( gettimepassed() / 60000 ) + 0,0001; minutespassed = ( gettimepassed() / 60000 ) + 0.0001;
if ( isplayer( self ) ) if ( isplayer( self ) )
{ {
return maps/mp/gametypes/_globallogic_score::_getplayerscore( self ) / minutespassed; return maps/mp/gametypes/_globallogic_score::_getplayerscore( self ) / minutespassed;
@ -354,14 +346,16 @@ getscoreperminute( team )
} }
} }
getestimatedtimeuntilscorelimit( team ) getestimatedtimeuntilscorelimit( team ) //checked matches cerberus output
{ {
/*
/# /#
if ( !isplayer( self ) ) if ( !isplayer( self ) )
{ {
assert( isDefined( team ) ); assert( isDefined( team ) );
} }
#/ #/
*/
scoreperminute = self getscoreperminute( team ); scoreperminute = self getscoreperminute( team );
scoreremaining = self getscoreremaining( team ); scoreremaining = self getscoreremaining( team );
if ( !scoreperminute ) if ( !scoreperminute )
@ -371,36 +365,38 @@ getestimatedtimeuntilscorelimit( team )
return scoreremaining / scoreperminute; return scoreremaining / scoreperminute;
} }
rumbler() rumbler() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
while ( 1 ) while ( 1 )
{ {
wait 0,1; wait 0.1;
self playrumbleonentity( "damage_heavy" ); self playrumbleonentity( "damage_heavy" );
} }
} }
waitfortimeornotify( time, notifyname ) waitfortimeornotify( time, notifyname ) //checked matches cerberus output
{ {
self endon( notifyname ); self endon( notifyname );
wait time; wait time;
} }
waitfortimeornotifynoartillery( time, notifyname ) waitfortimeornotifynoartillery( time, notifyname ) //checked matches cerberus output
{ {
self endon( notifyname ); self endon( notifyname );
wait time; wait time;
while ( isDefined( level.artilleryinprogress ) ) while ( isDefined( level.artilleryinprogress ) )
{ {
/*
/# /#
assert( level.artilleryinprogress ); assert( level.artilleryinprogress );
#/ #/
wait 0,25; */
wait 0.25;
} }
} }
isheadshot( sweapon, shitloc, smeansofdeath, einflictor ) isheadshot( sweapon, shitloc, smeansofdeath, einflictor ) //checked changed to match cerberus output
{ {
if ( shitloc != "head" && shitloc != "helmet" ) if ( shitloc != "head" && shitloc != "helmet" )
{ {
@ -419,7 +415,7 @@ isheadshot( sweapon, shitloc, smeansofdeath, einflictor )
} }
if ( maps/mp/killstreaks/_killstreaks::iskillstreakweapon( sweapon ) ) if ( maps/mp/killstreaks/_killstreaks::iskillstreakweapon( sweapon ) )
{ {
if ( isDefined( einflictor ) || !isDefined( einflictor.controlled ) && einflictor.controlled == 0 ) if ( isDefined( einflictor ) || !isDefined( einflictor.controlled ) || einflictor.controlled == 0 )
{ {
return 0; return 0;
} }
@ -427,7 +423,7 @@ isheadshot( sweapon, shitloc, smeansofdeath, einflictor )
return 1; return 1;
} }
gethitlocheight( shitloc ) gethitlocheight( shitloc ) //checked matches cerberus output
{ {
switch( shitloc ) switch( shitloc )
{ {
@ -459,34 +455,32 @@ gethitlocheight( shitloc )
return 48; return 48;
} }
debugline( start, end ) debugline( start, end ) //checked changed to match cerberus output
{ {
/*
/# /#
i = 0; for ( i = 0; i < 50; i++ )
while ( i < 50 )
{ {
line( start, end ); line( start, end );
wait 0,05; wait 0.05;
i++;
#/ #/
} }
*/
} }
isexcluded( entity, entitylist ) isexcluded( entity, entitylist ) //checked changed to match cerberus output
{ {
index = 0; for ( index = 0; index < entitylist.size; index++ )
while ( index < entitylist.size )
{ {
if ( entity == entitylist[ index ] ) if ( entity == entitylist[ index ] )
{ {
return 1; return 1;
} }
index++;
} }
return 0; return 0;
} }
waitfortimeornotifies( desireddelay ) waitfortimeornotifies( desireddelay ) //checked matches cerberus output
{ {
startedwaiting = getTime(); startedwaiting = getTime();
waitedtime = ( getTime() - startedwaiting ) / 1000; waitedtime = ( getTime() - startedwaiting ) / 1000;
@ -501,20 +495,17 @@ waitfortimeornotifies( desireddelay )
} }
} }
logteamwinstring( wintype, winner ) logteamwinstring( wintype, winner ) //checked changed to match cerberus output
{ {
log_string = wintype; log_string = wintype;
if ( isDefined( winner ) ) if ( isDefined( winner ) )
{ {
log_string = ( log_string + ", win: " ) + winner; log_string = ( log_string + ", win: " ) + winner;
} }
_a495 = level.teams; foreach ( team in level.teams )
_k495 = getFirstArrayKey( _a495 );
while ( isDefined( _k495 ) )
{ {
team = _a495[ _k495 ];
log_string = ( log_string + ", " ) + team + ": " + game[ "teamScores" ][ team ]; log_string = ( log_string + ", " ) + team + ": " + game[ "teamScores" ][ team ];
_k495 = getNextArrayKey( _a495, _k495 );
} }
logstring( log_string ); logstring( log_string );
} }

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/gametypes/_damagefeedback; #include maps/mp/gametypes/_damagefeedback;
#include maps/mp/gametypes/_globallogic_player; #include maps/mp/gametypes/_globallogic_player;
#include maps/mp/gametypes/_weapons; #include maps/mp/gametypes/_weapons;
@ -5,7 +6,7 @@
#include maps/mp/gametypes/_class; #include maps/mp/gametypes/_class;
#include maps/mp/_utility; #include maps/mp/_utility;
callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname ) callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname ) //checked partially changed to match cerberus output partially changed to match beta dump //changed at own discretion
{ {
if ( level.idflags_radius & idflags ) if ( level.idflags_radius & idflags )
{ {
@ -38,12 +39,9 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
{ {
sweapon = "explodable_barrel_mp"; sweapon = "explodable_barrel_mp";
} }
else else if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
{ {
if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) ) sweapon = "destructible_car_mp";
{
sweapon = "destructible_car_mp";
}
} }
} }
if ( idflags & level.idflags_no_protection ) if ( idflags & level.idflags_no_protection )
@ -55,28 +53,22 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
if ( smeansofdeath == "MOD_PISTOL_BULLET" || smeansofdeath == "MOD_RIFLE_BULLET" ) if ( smeansofdeath == "MOD_PISTOL_BULLET" || smeansofdeath == "MOD_RIFLE_BULLET" )
{ {
} }
else else if ( smeansofdeath == "MOD_PROJECTILE" || smeansofdeath == "MOD_GRENADE" )
{ {
if ( smeansofdeath == "MOD_PROJECTILE" || smeansofdeath == "MOD_GRENADE" ) idamage *= getvehicleprojectilescalar( sweapon );
idamage = int( idamage );
if ( idamage == 0 )
{ {
idamage *= getvehicleprojectilescalar( sweapon ); return;
idamage = int( idamage );
if ( idamage == 0 )
{
return;
}
} }
else }
else if ( smeansofdeath == "MOD_GRENADE_SPLASH" )
{
idamage *= getvehicleunderneathsplashscalar( sweapon );
idamage = int( idamage );
if ( idamage == 0 )
{ {
if ( smeansofdeath == "MOD_GRENADE_SPLASH" ) return;
{
idamage *= getvehicleunderneathsplashscalar( sweapon );
idamage = int( idamage );
if ( idamage == 0 )
{
return;
}
}
} }
} }
idamage *= level.vehicledamagescalar; idamage *= level.vehicledamagescalar;
@ -131,18 +123,15 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
self.lastdamagewasfromenemy = 0; self.lastdamagewasfromenemy = 0;
self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 1 ); self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 1 );
} }
else else if ( level.friendlyfire == 3 )
{ {
if ( level.friendlyfire == 3 ) idamage = int( idamage * 0,5 );
if ( idamage < 1 )
{ {
idamage = int( idamage * 0,5 ); idamage = 1;
if ( idamage < 1 )
{
idamage = 1;
}
self.lastdamagewasfromenemy = 0;
self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 0 );
} }
self.lastdamagewasfromenemy = 0;
self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 0 );
} }
friendly = 1; friendly = 1;
} }
@ -152,48 +141,46 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
{ {
return; return;
} }
else if ( !level.teambased && isDefined( self.targetname ) && self.targetname == "rcbomb" )
{
}
else if ( isDefined( self.owner ) && isDefined( eattacker ) && self.owner == eattacker )
{
return;
}
if ( idamage < 1 )
{
idamage = 1;
}
if ( isDefined( eattacker ) && isplayer( eattacker ) && isDefined( sweapon ) )
{
eattacker thread maps/mp/gametypes/_weapons::checkhit( sweapon );
}
if ( issubstr( smeansofdeath, "MOD_GRENADE" ) && isDefined( einflictor.iscooked ) )
{
self.wascooked = getTime();
}
else else
{ {
if ( !level.teambased && isDefined( self.targetname ) && self.targetname == "rcbomb" ) self.wascooked = undefined;
{ }
} attacker_seat = undefined;
else if ( isDefined( eattacker ) )
{ {
if ( isDefined( self.owner ) && isDefined( eattacker ) && self.owner == eattacker ) attacker_seat = self getoccupantseat( eattacker );
{ }
return; if ( isDefined( eattacker ) && !isDefined( attacker_seat ) )
} {
} self.lastdamagewasfromenemy = 1;
if ( idamage < 1 ) }
{ else
idamage = 1; {
} self.lastdamagewasfromenemy = 0;
if ( isDefined( eattacker ) && isplayer( eattacker ) && isDefined( sweapon ) ) }
{ self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 0 );
eattacker thread maps/mp/gametypes/_weapons::checkhit( sweapon ); if ( level.gametype == "hack" && sweapon != "emp_grenade_mp" )
} {
if ( issubstr( smeansofdeath, "MOD_GRENADE" ) && isDefined( einflictor.iscooked ) ) idamage = 0;
{
self.wascooked = getTime();
}
else
{
self.wascooked = undefined;
}
attacker_seat = undefined;
if ( isDefined( eattacker ) )
{
attacker_seat = self getoccupantseat( eattacker );
}
if ( isDefined( eattacker ) )
{
self.lastdamagewasfromenemy = !isDefined( attacker_seat );
}
self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 0 );
if ( level.gametype == "hack" && sweapon != "emp_grenade_mp" )
{
idamage = 0;
}
} }
} }
if ( isDefined( eattacker ) && eattacker != self ) if ( isDefined( eattacker ) && eattacker != self )
@ -207,12 +194,14 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
} }
} }
} }
/*
/# /#
if ( getDvarInt( "g_debugDamage" ) ) if ( getDvarInt( "g_debugDamage" ) )
{ {
println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + " hitLoc:" + shitloc ); println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + " hitLoc:" + shitloc );
#/ #/
} }
*/
if ( 1 ) if ( 1 )
{ {
lpselfnum = self getentitynumber(); lpselfnum = self getentitynumber();
@ -236,7 +225,7 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
} }
} }
callback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, psoffsettime ) callback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, psoffsettime ) //checked changed to match beta dump
{ {
idamage = maps/mp/gametypes/_class::cac_modified_vehicle_damage( self, eattacker, idamage, smeansofdeath, sweapon, einflictor ); idamage = maps/mp/gametypes/_class::cac_modified_vehicle_damage( self, eattacker, idamage, smeansofdeath, sweapon, einflictor );
finnerdamage = maps/mp/gametypes/_class::cac_modified_vehicle_damage( self, eattacker, finnerdamage, smeansofdeath, sweapon, einflictor ); finnerdamage = maps/mp/gametypes/_class::cac_modified_vehicle_damage( self, eattacker, finnerdamage, smeansofdeath, sweapon, einflictor );
@ -252,13 +241,13 @@ callback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fout
return; return;
} }
friendly = 0; friendly = 0;
if ( idflags & level.idflags_no_protection ) if ( !idflags & !level.idflags_no_protection )
{ {
if ( self isvehicleimmunetodamage( idflags, smeansofdeath, sweapon ) ) if ( self isvehicleimmunetodamage( idflags, smeansofdeath, sweapon ) )
{ {
return; return;
} }
if ( smeansofdeath != "MOD_PROJECTILE_SPLASH" || smeansofdeath == "MOD_GRENADE_SPLASH" && smeansofdeath == "MOD_EXPLOSIVE" ) if ( smeansofdeath == "MOD_PROJECTILE_SPLASH" || smeansofdeath == "MOD_GRENADE_SPLASH" || smeansofdeath == "MOD_EXPLOSIVE" )
{ {
scalar = getvehicleprojectilesplashscalar( sweapon ); scalar = getvehicleprojectilesplashscalar( sweapon );
idamage = int( idamage * scalar ); idamage = int( idamage * scalar );
@ -325,28 +314,23 @@ callback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fout
} }
} }
friendly = 1; friendly = 1;
return;
} }
else else
{ {
if ( !level.hardcoremode && isDefined( self.owner ) && isDefined( eattacker.owner ) && self.owner == eattacker.owner ) if ( !level.hardcoremode && isDefined( self.owner ) && isDefined( eattacker.owner ) && self.owner == eattacker.owner )
{ {
return; return;
return;
} }
else else if ( idamage < 1 )
{ {
if ( idamage < 1 ) idamage = 1;
{
idamage = 1;
}
self finishvehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, psoffsettime );
} }
self finishvehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, psoffsettime );
} }
} }
} }
vehiclecrush() vehiclecrush() //checked matches cerberus output
{ {
self endon( "disconnect" ); self endon( "disconnect" );
if ( isDefined( level._effect ) && isDefined( level._effect[ "tanksquish" ] ) ) if ( isDefined( level._effect ) && isDefined( level._effect[ "tanksquish" ] ) )
@ -356,7 +340,7 @@ vehiclecrush()
self playsound( "chr_crunch" ); self playsound( "chr_crunch" );
} }
getvehicleprojectilescalar( sweapon ) getvehicleprojectilescalar( sweapon ) //checked matches cerberus output
{ {
if ( sweapon == "remote_missile_missile_mp" ) if ( sweapon == "remote_missile_missile_mp" )
{ {
@ -368,11 +352,11 @@ getvehicleprojectilescalar( sweapon )
} }
else if ( sweapon == "smaw_mp" ) else if ( sweapon == "smaw_mp" )
{ {
scale = 0,2; scale = 0.2;
} }
else if ( sweapon == "fhj18_mp" ) else if ( sweapon == "fhj18_mp" )
{ {
scale = 0,2; scale = 0.2;
} }
else else
{ {
@ -381,7 +365,7 @@ getvehicleprojectilescalar( sweapon )
return scale; return scale;
} }
getvehicleprojectilesplashscalar( sweapon ) getvehicleprojectilesplashscalar( sweapon ) //checked matches cerberus output
{ {
if ( sweapon == "remote_missile_missile_mp" ) if ( sweapon == "remote_missile_missile_mp" )
{ {
@ -393,7 +377,7 @@ getvehicleprojectilesplashscalar( sweapon )
} }
else if ( sweapon == "chopper_minigun_mp" ) else if ( sweapon == "chopper_minigun_mp" )
{ {
scale = 0,5; scale = 0.5;
} }
else else
{ {
@ -402,7 +386,7 @@ getvehicleprojectilesplashscalar( sweapon )
return scale; return scale;
} }
getvehicleunderneathsplashscalar( sweapon ) getvehicleunderneathsplashscalar( sweapon ) //checked matches cerberus output
{ {
if ( sweapon == "satchel_charge_mp" ) if ( sweapon == "satchel_charge_mp" )
{ {
@ -416,7 +400,7 @@ getvehicleunderneathsplashscalar( sweapon )
return scale; return scale;
} }
getvehiclebulletdamage( sweapon ) getvehiclebulletdamage( sweapon ) //checked matches cerberus output
{ {
if ( issubstr( sweapon, "ptrs41_" ) ) if ( issubstr( sweapon, "ptrs41_" ) )
{ {
@ -437,7 +421,7 @@ getvehiclebulletdamage( sweapon )
return idamage; return idamage;
} }
allowfriendlyfiredamage( einflictor, eattacker, smeansofdeath, sweapon ) allowfriendlyfiredamage( einflictor, eattacker, smeansofdeath, sweapon ) //checked matches cerberus output
{ {
if ( isDefined( self.allowfriendlyfiredamageoverride ) ) if ( isDefined( self.allowfriendlyfiredamageoverride ) )
{ {
@ -446,3 +430,4 @@ allowfriendlyfiredamage( einflictor, eattacker, smeansofdeath, sweapon )
vehicle = eattacker getvehicleoccupied(); vehicle = eattacker getvehicleoccupied();
return 0; return 0;
} }

View File

@ -39,6 +39,11 @@ patch_mp/maps/mp/gametypes/_damagefeedback.gsc
patch_mp/maps/mp/gametypes/_deathicons.gsc patch_mp/maps/mp/gametypes/_deathicons.gsc
patch_mp/maps/mp/gametypes/_friendicons.gsc patch_mp/maps/mp/gametypes/_friendicons.gsc
patch_mp/maps/mp/gametypes/_globallogic.gsc patch_mp/maps/mp/gametypes/_globallogic.gsc
patch_mp/maps/mp/gametypes/_globallogic_actor.gsc
patch_mp/maps/mp/gametypes/_globallogic_defaults.gsc
patch_mp/maps/mp/gametypes/_globallogic_ui.gsc
patch_mp/maps/mp/gametypes/_globallogic_utils.gsc
patch_mp/maps/mp/gametypes/_globallogic_vehicle.gsc
patch_mp/maps/mp/gametypes/_healthoverlay.gsc patch_mp/maps/mp/gametypes/_healthoverlay.gsc
patch_mp/maps/mp/gametypes/_hostmigration.gsc patch_mp/maps/mp/gametypes/_hostmigration.gsc
patch_mp/maps/mp/gametypes/_hud.gsc patch_mp/maps/mp/gametypes/_hud.gsc
@ -73,15 +78,10 @@ patch_mp/maps/mp/gametypes/tdm.gsc
### The following scripts are not checked yet, uploaded to setup a baseline: ### The following scripts are not checked yet, uploaded to setup a baseline:
``` ```
patch_mp/maps/mp/gametypes/_gameobjects.gsc patch_mp/maps/mp/gametypes/_gameobjects.gsc
patch_mp/maps/mp/gametypes/_globallogic_actor.gsc
patch_mp/maps/mp/gametypes/_globallogic_audio.gsc patch_mp/maps/mp/gametypes/_globallogic_audio.gsc
patch_mp/maps/mp/gametypes/_globallogic_defaults.gsc
patch_mp/maps/mp/gametypes/_globallogic_player.gsc patch_mp/maps/mp/gametypes/_globallogic_player.gsc
patch_mp/maps/mp/gametypes/_globallogic_score.gsc patch_mp/maps/mp/gametypes/_globallogic_score.gsc
patch_mp/maps/mp/gametypes/_globallogic_spawn.gsc patch_mp/maps/mp/gametypes/_globallogic_spawn.gsc
patch_mp/maps/mp/gametypes/_globallogic_ui.gsc
patch_mp/maps/mp/gametypes/_globallogic_utils.gsc
patch_mp/maps/mp/gametypes/_globallogic_vehicle.gsc
patch_mp/maps/mp/gametypes/_hud_message.gsc patch_mp/maps/mp/gametypes/_hud_message.gsc
patch_mp/maps/mp/gametypes/_hud_util.gsc patch_mp/maps/mp/gametypes/_hud_util.gsc
patch_mp/maps/mp/gametypes/_spawning.gsc patch_mp/maps/mp/gametypes/_spawning.gsc

View File

@ -1,3 +1,4 @@
//checked includes match cerberus output
#include maps/mp/_challenges; #include maps/mp/_challenges;
#include maps/mp/gametypes_zm/_damagefeedback; #include maps/mp/gametypes_zm/_damagefeedback;
#include maps/mp/gametypes_zm/_weapons; #include maps/mp/gametypes_zm/_weapons;
@ -5,7 +6,7 @@
#include maps/mp/gametypes_zm/_globallogic_player; #include maps/mp/gametypes_zm/_globallogic_player;
#include maps/mp/_utility; #include maps/mp/_utility;
callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex ) callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex ) //checked changed to match cerberus output
{ {
if ( game[ "state" ] == "postgame" ) if ( game[ "state" ] == "postgame" )
{ {
@ -43,12 +44,9 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
{ {
return; return;
} }
else else if ( smeansofdeath == "MOD_HEAD_SHOT" )
{ {
if ( smeansofdeath == "MOD_HEAD_SHOT" ) idamage = 150;
{
idamage = 150;
}
} }
} }
if ( sweapon == "none" && isDefined( einflictor ) ) if ( sweapon == "none" && isDefined( einflictor ) )
@ -57,12 +55,9 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
{ {
sweapon = "explodable_barrel_mp"; sweapon = "explodable_barrel_mp";
} }
else else if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
{ {
if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) ) sweapon = "destructible_car_mp";
{
sweapon = "destructible_car_mp";
}
} }
} }
if ( idflags & level.idflags_no_protection ) if ( idflags & level.idflags_no_protection )
@ -91,56 +86,54 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
{ {
return; return;
} }
else else if ( level.friendlyfire == 3 )
{ {
if ( level.friendlyfire == 3 ) idamage = int( idamage * 0,5 );
if ( idamage < 1 )
{ {
idamage = int( idamage * 0,5 ); idamage = 1;
if ( idamage < 1 )
{
idamage = 1;
}
self.lastdamagewasfromenemy = 0;
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
} }
self.lastdamagewasfromenemy = 0;
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
} }
friendly = 1; friendly = 1;
} }
else if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode )
{
return;
}
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && isDefined( eattacker.script_owner ) && eattacker.script_owner == self.script_owner )
{
return;
}
if ( idamage < 1 )
{
idamage = 1;
}
if ( isDefined( eattacker ) && isplayer( eattacker ) && isDefined( sweapon ) && !issubstr( smeansofdeath, "MOD_MELEE" ) )
{
eattacker thread maps/mp/gametypes/_weapons::checkhit( sweapon );
}
if ( issubstr( smeansofdeath, "MOD_GRENADE" ) && isDefined( einflictor ) && isDefined( einflictor.iscooked ) )
{
self.wascooked = getTime();
}
else else
{ {
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode ) self.wascooked = undefined;
{
return;
}
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && isDefined( eattacker.script_owner ) && eattacker.script_owner == self.script_owner )
{
return;
}
if ( idamage < 1 )
{
idamage = 1;
}
if ( isDefined( eattacker ) && isplayer( eattacker ) && isDefined( sweapon ) && !issubstr( smeansofdeath, "MOD_MELEE" ) )
{
eattacker thread maps/mp/gametypes_zm/_weapons::checkhit( sweapon );
}
if ( issubstr( smeansofdeath, "MOD_GRENADE" ) && isDefined( einflictor ) && isDefined( einflictor.iscooked ) )
{
self.wascooked = getTime();
}
else
{
self.wascooked = undefined;
}
if ( isDefined( eattacker ) )
{
self.lastdamagewasfromenemy = eattacker != self;
}
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
} }
if ( isDefined( eattacker ) && eattacker != self ) if ( isDefined( eattacker ) && eattacker != self )
{ {
if ( sweapon != "artillery_mp" || !isDefined( einflictor ) && !isai( einflictor ) ) self.lastdamagewasfromenemy = 1;
}
else
{
self.lastdamagewasfromenemy = 0;
}
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
if ( isDefined( eattacker ) && eattacker != self )
{
if ( sweapon != "artillery_mp" && !isDefined( einflictor ) || !isai( einflictor ) )
{ {
if ( idamage > 0 ) if ( idamage > 0 )
{ {
@ -149,12 +142,14 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
} }
} }
} }
/*
/# /#
if ( getDvarInt( "g_debugDamage" ) ) if ( getDvarInt( "g_debugDamage" ) )
{ {
println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + shitloc + ";" + boneindex + "\n" ); println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + shitloc + ";" + boneindex + "\n" );
#/ #/
} }
*/
if ( 1 ) if ( 1 )
{ {
lpselfnum = self getentitynumber(); lpselfnum = self getentitynumber();
@ -178,7 +173,7 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
} }
} }
callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime ) callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime ) //checked matches cerberus output
{ {
if ( game[ "state" ] == "postgame" ) if ( game[ "state" ] == "postgame" )
{ {
@ -205,3 +200,5 @@ callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdi
} }
} }
} }

View File

@ -51,6 +51,7 @@ patch_zm/maps/mp/zombies/_zm_pers_upgrades_functions.gsc
``` ```
patch_zm/maps/mp/gametypes_zm/_callbacksetup.gsc patch_zm/maps/mp/gametypes_zm/_callbacksetup.gsc
patch_zm/maps/mp/gametypes_zm/_damagefeedback.gsc patch_zm/maps/mp/gametypes_zm/_damagefeedback.gsc
patch_zm/maps/mp/gametypes_zm/_globallogic_actor.gsc
patch_zm/maps/mp/gametypes_zm/_healthoverlay.gsc patch_zm/maps/mp/gametypes_zm/_healthoverlay.gsc
patch_zm/maps/mp/gametypes_zm/_hostmigration.gsc patch_zm/maps/mp/gametypes_zm/_hostmigration.gsc
patch_zm/maps/mp/gametypes_zm/_hud.gsc patch_zm/maps/mp/gametypes_zm/_hud.gsc
@ -81,7 +82,6 @@ patch_zm/maps/mp/zombies/_zm_weap_cymbal_monkey.gsc
### The following scripts are not checked yet, uploaded to setup a baseline: ### The following scripts are not checked yet, uploaded to setup a baseline:
``` ```
patch_zm/maps/mp/gametypes_zm/_gameobjects.gsc patch_zm/maps/mp/gametypes_zm/_gameobjects.gsc
patch_zm/maps/mp/gametypes_zm/_globallogic_actor.gsc
patch_zm/maps/mp/gametypes_zm/_globallogic_audio.gsc patch_zm/maps/mp/gametypes_zm/_globallogic_audio.gsc
patch_zm/maps/mp/gametypes_zm/_globallogic_defaults.gsc patch_zm/maps/mp/gametypes_zm/_globallogic_defaults.gsc
patch_zm/maps/mp/gametypes_zm/_globallogic_player.gsc patch_zm/maps/mp/gametypes_zm/_globallogic_player.gsc

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
### The following gscs compile and run successfully with no known errors: ### The following gscs compile and run successfully with no known errors:
``` ```
zm_nuked_patch/maps/mp/gametypes_zm/zstandard.gsc zm_nuked_patch/maps/mp/gametypes_zm/zstandard.gsc
zm_nuked_patch/maps/mp/zm_nuked.gsc
``` ```
### The following scripts compile and run successfully with minor errors: ### The following scripts compile and run successfully with minor errors: