mirror of
https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer.git
synced 2025-06-08 01:47:50 -05:00
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:
parent
83a2e644ea
commit
aab6678ec2
@ -1,3 +1,4 @@
|
||||
//checked includes match cerberus output
|
||||
#include maps/mp/_challenges;
|
||||
#include maps/mp/gametypes/_dev;
|
||||
#include maps/mp/teams/_teams;
|
||||
@ -8,7 +9,7 @@
|
||||
#include maps/mp/_utility;
|
||||
#include common_scripts/utility;
|
||||
|
||||
init()
|
||||
init() //checked partially changed to match cerberus output and beta dump did not change while loop to for loop see github for more info
|
||||
{
|
||||
level.classmap[ "class_smg" ] = "CLASS_SMG";
|
||||
level.classmap[ "class_cqb" ] = "CLASS_CQB";
|
||||
@ -101,39 +102,29 @@ init()
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !isDefined( level.tbl_weaponids[ i ] ) || level.tbl_weaponids[ i ][ "reference" ] == "" )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon_type = level.tbl_weaponids[ i ][ "group" ];
|
||||
weapon = level.tbl_weaponids[ i ][ "reference" ];
|
||||
attachment = level.tbl_weaponids[ i ][ "attachment" ];
|
||||
weapon_class_register( weapon + "_mp", weapon_type );
|
||||
while ( isDefined( attachment ) && attachment != "" )
|
||||
if ( isDefined( attachment ) && attachment != "" )
|
||||
{
|
||||
attachment_tokens = strtok( attachment, " " );
|
||||
while ( isDefined( attachment_tokens ) )
|
||||
if ( isDefined( attachment_tokens ) )
|
||||
{
|
||||
if ( attachment_tokens.size == 0 )
|
||||
{
|
||||
weapon_class_register( ( weapon + "_" ) + attachment + "_mp", weapon_type );
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
k = 0;
|
||||
while ( k < attachment_tokens.size )
|
||||
for ( k = 0; k < attachment_tokens.size; k++ )
|
||||
{
|
||||
weapon_class_register( ( weapon + "_" ) + attachment_tokens[ k ] + "_mp", weapon_type );
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -144,59 +135,55 @@ init()
|
||||
level thread onplayerconnecting();
|
||||
}
|
||||
|
||||
create_class_exclusion_list()
|
||||
create_class_exclusion_list() //checked changed to match the beta dump
|
||||
{
|
||||
currentdvar = 0;
|
||||
level.itemexclusions = [];
|
||||
while ( getDvarInt( 853497292 + currentdvar ) )
|
||||
while ( getDvarInt( "item_exclusion_" + currentdvar ) )
|
||||
{
|
||||
level.itemexclusions[ currentdvar ] = getDvarInt( 853497292 + currentdvar );
|
||||
level.itemexclusions[ currentdvar ] = getDvarInt( "item_exclusion_" + currentdvar );
|
||||
currentdvar++;
|
||||
}
|
||||
level.attachmentexclusions = [];
|
||||
currentdvar = 0;
|
||||
while ( getDvar( 2137981926 + currentdvar ) != "" )
|
||||
while ( getDvar( "attachment_exclusion_" + currentdvar ) != "" )
|
||||
{
|
||||
level.attachmentexclusions[ currentdvar ] = getDvar( 2137981926 + currentdvar );
|
||||
level.attachmentexclusions[ currentdvar ] = getDvar( "attachment_exclusion_" + currentdvar );
|
||||
currentdvar++;
|
||||
}
|
||||
}
|
||||
|
||||
is_item_excluded( itemindex )
|
||||
is_item_excluded( itemindex ) //checked changed to match cerberus output
|
||||
{
|
||||
if ( !level.onlinegame )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
numexclusions = level.itemexclusions.size;
|
||||
exclusionindex = 0;
|
||||
while ( exclusionindex < numexclusions )
|
||||
for ( exclusionindex = 0; exclusionindex < numexclusions; exclusionindex++ )
|
||||
{
|
||||
if ( itemindex == level.itemexclusions[ exclusionindex ] )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
exclusionindex++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
is_attachment_excluded( attachment )
|
||||
is_attachment_excluded( attachment ) //checked changed to match cerberus output
|
||||
{
|
||||
numexclusions = level.attachmentexclusions.size;
|
||||
exclusionindex = 0;
|
||||
while ( exclusionindex < numexclusions )
|
||||
for ( exclusionindex = 0; exclusionindex < numexclusions; exclusionindex++ )
|
||||
{
|
||||
if ( attachment == level.attachmentexclusions[ exclusionindex ] )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
exclusionindex++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
set_statstable_id()
|
||||
set_statstable_id() //checked matches cerberus output
|
||||
{
|
||||
if ( !isDefined( level.statstableid ) )
|
||||
{
|
||||
@ -204,7 +191,7 @@ set_statstable_id()
|
||||
}
|
||||
}
|
||||
|
||||
get_item_count( itemreference )
|
||||
get_item_count( itemreference ) //checked matches cerberus output
|
||||
{
|
||||
set_statstable_id();
|
||||
itemcount = int( tablelookup( level.statstableid, 4, itemreference, 5 ) );
|
||||
@ -215,7 +202,7 @@ get_item_count( itemreference )
|
||||
return itemcount;
|
||||
}
|
||||
|
||||
getdefaultclassslotwithexclusions( classname, slotname )
|
||||
getdefaultclassslotwithexclusions( classname, slotname ) //checked matches cerberus output
|
||||
{
|
||||
itemreference = getdefaultclassslot( classname, slotname );
|
||||
set_statstable_id();
|
||||
@ -227,12 +214,12 @@ getdefaultclassslotwithexclusions( classname, slotname )
|
||||
return itemreference;
|
||||
}
|
||||
|
||||
load_default_loadout( class, classnum )
|
||||
load_default_loadout( class, classnum ) //checked matches cerberus output
|
||||
{
|
||||
level.classtoclassnum[ class ] = classnum;
|
||||
}
|
||||
|
||||
weapon_class_register( weapon, weapon_type )
|
||||
weapon_class_register( weapon, weapon_type ) //checked matches cerberus output
|
||||
{
|
||||
if ( issubstr( "weapon_smg weapon_cqb weapon_assault weapon_lmg weapon_sniper weapon_shotgun weapon_launcher weapon_special", weapon_type ) )
|
||||
{
|
||||
@ -256,18 +243,19 @@ weapon_class_register( weapon, weapon_type )
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( 0, "Weapon group info is missing from statsTable for: " + weapon_type );
|
||||
#/
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
cac_init()
|
||||
cac_init() //checked changed to match cerberus output
|
||||
{
|
||||
level.tbl_weaponids = [];
|
||||
set_statstable_id();
|
||||
i = 0;
|
||||
while ( i < 256 )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
{
|
||||
itemrow = tablelookuprownum( level.statstableid, 0, i );
|
||||
if ( itemrow > -1 )
|
||||
@ -285,11 +273,9 @@ cac_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
level.perknames = [];
|
||||
i = 0;
|
||||
while ( i < 256 )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
{
|
||||
itemrow = tablelookuprownum( level.statstableid, 0, i );
|
||||
if ( itemrow > -1 )
|
||||
@ -308,13 +294,11 @@ cac_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
level.killstreaknames = [];
|
||||
level.killstreakicons = [];
|
||||
level.killstreakindices = [];
|
||||
i = 0;
|
||||
while ( i < 256 )
|
||||
for ( i = 0; i < 256; i++ )
|
||||
{
|
||||
itemrow = tablelookuprownum( level.statstableid, 0, i );
|
||||
if ( itemrow > -1 )
|
||||
@ -338,19 +322,20 @@ cac_init()
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
getclasschoice( response )
|
||||
getclasschoice( response ) //checked matches cerberus output
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( level.classmap[ response ] ) );
|
||||
#/
|
||||
*/
|
||||
return level.classmap[ response ];
|
||||
}
|
||||
|
||||
getloadoutitemfromddlstats( customclassnum, loadoutslot )
|
||||
getloadoutitemfromddlstats( customclassnum, loadoutslot ) //checked matches cerberus output
|
||||
{
|
||||
itemindex = self getloadoutitem( customclassnum, loadoutslot );
|
||||
if ( is_item_excluded( itemindex ) && !is_warlord_perk( itemindex ) )
|
||||
@ -360,7 +345,7 @@ getloadoutitemfromddlstats( customclassnum, loadoutslot )
|
||||
return itemindex;
|
||||
}
|
||||
|
||||
getattachmentstring( weaponnum, attachmentnum )
|
||||
getattachmentstring( weaponnum, attachmentnum ) //checked matches cerberus output
|
||||
{
|
||||
attachmentstring = getitemattachment( weaponnum, attachmentnum );
|
||||
if ( attachmentstring != "none" && !is_attachment_excluded( attachmentstring ) )
|
||||
@ -374,7 +359,7 @@ getattachmentstring( weaponnum, attachmentnum )
|
||||
return attachmentstring;
|
||||
}
|
||||
|
||||
getattachmentsdisabled()
|
||||
getattachmentsdisabled() //checked matches cerberus output
|
||||
{
|
||||
if ( !isDefined( level.attachmentsdisabled ) )
|
||||
{
|
||||
@ -383,13 +368,13 @@ getattachmentsdisabled()
|
||||
return level.attachmentsdisabled;
|
||||
}
|
||||
|
||||
getkillstreakindex( class, killstreaknum )
|
||||
getkillstreakindex( class, killstreaknum ) //checked changed to match beta dump
|
||||
{
|
||||
killstreaknum++;
|
||||
killstreakstring = "killstreak" + killstreaknum;
|
||||
if ( getDvarInt( #"826EB3B9" ) == 2 )
|
||||
if ( getDvarInt( "custom_killstreak_mode" ) == 2 )
|
||||
{
|
||||
return getDvarInt( 3788714527 + killstreakstring );
|
||||
return getDvarInt( "custom_" + killstreakstring );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -397,7 +382,7 @@ getkillstreakindex( class, killstreaknum )
|
||||
}
|
||||
}
|
||||
|
||||
givekillstreaks( classnum )
|
||||
givekillstreaks( classnum ) //checked changed to match cerberus output
|
||||
{
|
||||
self.killstreak = [];
|
||||
if ( !level.loadoutkillstreaksenabled )
|
||||
@ -406,15 +391,16 @@ givekillstreaks( classnum )
|
||||
}
|
||||
sortedkillstreaks = [];
|
||||
currentkillstreak = 0;
|
||||
killstreaknum = 0;
|
||||
while ( killstreaknum < level.maxkillstreaks )
|
||||
for ( killstreaknum = 0; killstreaknum < level.maxkillstreaks; killstreaknum++ )
|
||||
{
|
||||
killstreakindex = getkillstreakindex( classnum, killstreaknum );
|
||||
if ( isDefined( killstreakindex ) && killstreakindex > 0 )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( level.tbl_killstreakdata[ killstreakindex ] ), "KillStreak #:" + killstreakindex + "'s data is undefined" );
|
||||
#/
|
||||
*/
|
||||
if ( isDefined( level.tbl_killstreakdata[ killstreakindex ] ) )
|
||||
{
|
||||
self.killstreak[ currentkillstreak ] = level.tbl_killstreakdata[ killstreakindex ];
|
||||
@ -446,7 +432,6 @@ givekillstreaks( classnum )
|
||||
{
|
||||
self maps/mp/gametypes/_class::setweaponammooverall( weapon, 0 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -462,24 +447,16 @@ givekillstreaks( classnum )
|
||||
sortdata.cost = level.killstreaks[ killstreaktype ].momentumcost;
|
||||
sortdata.weapon = weapon;
|
||||
sortindex = 0;
|
||||
sortindex = 0;
|
||||
while ( sortindex < sortedkillstreaks.size )
|
||||
for ( sortindex = 0; sortindex < sortedkillstreaks.size; sortindex++ )
|
||||
{
|
||||
if ( sortedkillstreaks[ sortindex ].cost > sortdata.cost )
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sortindex++;
|
||||
}
|
||||
}
|
||||
i = sortedkillstreaks.size;
|
||||
while ( i > sortindex )
|
||||
for ( i = sortedkillstreaks.size; i > sortindex; i-- )
|
||||
{
|
||||
sortedkillstreaks[ i ] = sortedkillstreaks[ i - 1 ];
|
||||
i--;
|
||||
|
||||
}
|
||||
sortedkillstreaks[ sortindex ] = sortdata;
|
||||
}
|
||||
@ -487,7 +464,6 @@ givekillstreaks( classnum )
|
||||
currentkillstreak++;
|
||||
}
|
||||
}
|
||||
killstreaknum++;
|
||||
}
|
||||
actionslotorder = [];
|
||||
actionslotorder[ 0 ] = 4;
|
||||
@ -504,7 +480,7 @@ givekillstreaks( classnum )
|
||||
}
|
||||
}
|
||||
|
||||
is_warlord_perk( itemindex )
|
||||
is_warlord_perk( itemindex ) //checked matches cerberus output
|
||||
{
|
||||
if ( itemindex == 168 || itemindex == 169 )
|
||||
{
|
||||
@ -516,47 +492,46 @@ is_warlord_perk( itemindex )
|
||||
}
|
||||
}
|
||||
|
||||
isperkgroup( perkname )
|
||||
isperkgroup( perkname ) //checked changed at own discretion
|
||||
{
|
||||
if ( isDefined( perkname ) )
|
||||
if ( isDefined( perkname ) && isstring( perkname ) )
|
||||
{
|
||||
return isstring( perkname );
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
logclasschoice( class, primaryweapon, specialtype, perks )
|
||||
logclasschoice( class, primaryweapon, specialtype, perks ) //checked changed to match cerberus output
|
||||
{
|
||||
if ( class == self.lastclass )
|
||||
{
|
||||
return;
|
||||
}
|
||||
self logstring( "choseclass: " + class + " weapon: " + primaryweapon + " special: " + specialtype );
|
||||
i = 0;
|
||||
while ( i < perks.size )
|
||||
for ( i = 0; i < perks.size; i++ )
|
||||
{
|
||||
self logstring( "perk" + i + ": " + perks[ i ] );
|
||||
i++;
|
||||
}
|
||||
self.lastclass = class;
|
||||
}
|
||||
|
||||
reset_specialty_slots( class_num )
|
||||
reset_specialty_slots( class_num ) //checked matches cerberus output
|
||||
{
|
||||
self.specialty = [];
|
||||
}
|
||||
|
||||
initstaticweaponstime()
|
||||
initstaticweaponstime() //checked matches cerberus output
|
||||
{
|
||||
self.staticweaponsstarttime = getTime();
|
||||
}
|
||||
|
||||
initweaponattachments( weaponname )
|
||||
initweaponattachments( weaponname ) //checked matches cerberus output
|
||||
{
|
||||
self.currentweaponstarttime = getTime();
|
||||
self.currentweapon = weaponname;
|
||||
}
|
||||
|
||||
isequipmentallowed( equipment )
|
||||
isequipmentallowed( equipment ) //checked matches cerberus output
|
||||
{
|
||||
if ( equipment == "camera_spike_mp" && self issplitscreen() )
|
||||
{
|
||||
@ -569,7 +544,7 @@ isequipmentallowed( equipment )
|
||||
return 1;
|
||||
}
|
||||
|
||||
isleagueitemrestricted( item )
|
||||
isleagueitemrestricted( item ) //checked matches cerberus output
|
||||
{
|
||||
if ( level.leaguematch )
|
||||
{
|
||||
@ -578,7 +553,7 @@ isleagueitemrestricted( item )
|
||||
return 0;
|
||||
}
|
||||
|
||||
giveloadoutlevelspecific( team, class )
|
||||
giveloadoutlevelspecific( team, class ) //checked matches cerberus output
|
||||
{
|
||||
pixbeginevent( "giveLoadoutLevelSpecific" );
|
||||
if ( isDefined( level.givecustomcharacters ) )
|
||||
@ -592,41 +567,35 @@ giveloadoutlevelspecific( team, class )
|
||||
pixendevent();
|
||||
}
|
||||
|
||||
removeduplicateattachments( weapon )
|
||||
removeduplicateattachments( weapon ) //checked changed to match cerberus output
|
||||
{
|
||||
if ( !isDefined( weapon ) )
|
||||
{
|
||||
return undefined;
|
||||
}
|
||||
attachments = strtok( weapon, "+" );
|
||||
attachmentindex = 1;
|
||||
while ( attachmentindex < attachments.size )
|
||||
for ( attachmentindex = 1; attachmentindex < attachments.size; attachmentindex++ )
|
||||
{
|
||||
attachmentindex2 = attachmentindex + 1;
|
||||
while ( attachmentindex2 < attachments.size )
|
||||
for ( attachmentindex2 = attachmentindex + 1; attachmentindex2 < attachments.size; attachmentindex2++ )
|
||||
{
|
||||
if ( attachments[ attachmentindex ] == attachments[ attachmentindex2 ] )
|
||||
{
|
||||
attachments[ attachmentindex2 ] = "none";
|
||||
}
|
||||
attachmentindex2++;
|
||||
}
|
||||
attachmentindex++;
|
||||
}
|
||||
uniqueattachmentsweapon = attachments[ 0 ];
|
||||
attachmentindex = 1;
|
||||
while ( attachmentindex < attachments.size )
|
||||
for ( attachmentindex = 1; attachmentindex < attachments.size; attachmentindex++ )
|
||||
{
|
||||
if ( attachments[ attachmentindex ] != "none" )
|
||||
{
|
||||
uniqueattachmentsweapon = ( uniqueattachmentsweapon + "+" ) + attachments[ attachmentindex ];
|
||||
}
|
||||
attachmentindex++;
|
||||
}
|
||||
return uniqueattachmentsweapon;
|
||||
}
|
||||
|
||||
giveloadout( team, class )
|
||||
giveloadout( team, class ) //checked partially changed to match cerberus output did not use continue in for loop see github for more info
|
||||
{
|
||||
pixbeginevent( "giveLoadout" );
|
||||
self takeallweapons();
|
||||
@ -659,9 +628,11 @@ giveloadout( team, class )
|
||||
else
|
||||
{
|
||||
pixbeginevent( "default class" );
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( self.pers[ "class" ] ), "Player during spawn and loadout got no class!" );
|
||||
#/
|
||||
*/
|
||||
class_num = level.classtoclassnum[ class ];
|
||||
self.class_num = class_num;
|
||||
pixendevent();
|
||||
@ -669,10 +640,9 @@ giveloadout( team, class )
|
||||
knifeweaponoptions = self calcweaponoptions( class_num, 2 );
|
||||
self giveweapon( "knife_mp", 0, knifeweaponoptions );
|
||||
self.specialty = self getloadoutperks( class_num );
|
||||
while ( level.leaguematch )
|
||||
if ( level.leaguematch )
|
||||
{
|
||||
i = 0;
|
||||
while ( i < self.specialty.size )
|
||||
for ( i = 0; i < self.specialty.size; i++ )
|
||||
{
|
||||
if ( isleagueitemrestricted( self.specialty[ i ] ) )
|
||||
{
|
||||
@ -680,7 +650,6 @@ giveloadout( team, class )
|
||||
i--;
|
||||
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
self register_perks();
|
||||
@ -717,9 +686,7 @@ giveloadout( team, class )
|
||||
self.secondaryloadoutweapon = sidearm;
|
||||
self.secondaryloadoutaltweapon = weaponaltweaponname( sidearm );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( self isbonuscardactive( 0, self.class_num ) )
|
||||
else if ( self isbonuscardactive( 0, self.class_num ) )
|
||||
{
|
||||
self.primaryloadoutweapon = weapon;
|
||||
}
|
||||
@ -727,7 +694,6 @@ giveloadout( team, class )
|
||||
{
|
||||
self.secondaryloadoutweapon = sidearm;
|
||||
}
|
||||
}
|
||||
if ( sidearm != "weapon_null_mp" )
|
||||
{
|
||||
secondaryweaponoptions = self calcweaponoptions( class_num, 1 );
|
||||
@ -750,9 +716,11 @@ giveloadout( team, class )
|
||||
primaryweapon = weapon;
|
||||
primarytokens = strtok( primaryweapon, "_" );
|
||||
self.pers[ "primaryWeapon" ] = primarytokens[ 0 ];
|
||||
/*
|
||||
/#
|
||||
println( "^5GiveWeapon( " + weapon + " ) -- weapon" );
|
||||
#/
|
||||
*/
|
||||
if ( primaryweapon != "" && primaryweapon != "weapon_null_mp" && primaryweapon != "weapon_null" )
|
||||
{
|
||||
if ( self hasperk( "specialty_extraammo" ) )
|
||||
@ -780,9 +748,11 @@ giveloadout( team, class )
|
||||
spawnweapon = self.spawnweapon;
|
||||
}
|
||||
self.pers[ "changed_class" ] = 0;
|
||||
/*
|
||||
/#
|
||||
assert( spawnweapon != "" );
|
||||
#/
|
||||
*/
|
||||
self.spawnweapon = spawnweapon;
|
||||
self.pers[ "spawnWeapon" ] = self.spawnweapon;
|
||||
self setspawnweapon( spawnweapon );
|
||||
@ -825,9 +795,11 @@ giveloadout( team, class )
|
||||
grenadetypeprimary = level.weapons[ "flash" ];
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
println( "^5GiveWeapon( " + grenadetypeprimary + " ) -- grenadeTypePrimary" );
|
||||
#/
|
||||
*/
|
||||
self giveweapon( grenadetypeprimary );
|
||||
self setweaponammoclip( grenadetypeprimary, primarygrenadecount );
|
||||
self switchtooffhand( grenadetypeprimary );
|
||||
@ -840,9 +812,11 @@ giveloadout( team, class )
|
||||
if ( grenadetypesecondary != "" && grenadetypesecondary != "weapon_null_mp" && isequipmentallowed( grenadetypesecondary ) )
|
||||
{
|
||||
self setoffhandsecondaryclass( grenadetypesecondary );
|
||||
/*
|
||||
/#
|
||||
println( "^5GiveWeapon( " + grenadetypesecondary + " ) -- grenadeTypeSecondary" );
|
||||
#/
|
||||
*/
|
||||
self giveweapon( grenadetypesecondary );
|
||||
self setweaponammoclip( grenadetypesecondary, grenadesecondarycount );
|
||||
self.grenadetypesecondary = grenadetypesecondary;
|
||||
@ -851,20 +825,16 @@ giveloadout( team, class )
|
||||
self bbclasschoice( class_num, primaryweapon, sidearm );
|
||||
if ( !sessionmodeiszombiesgame() )
|
||||
{
|
||||
i = 0;
|
||||
while ( i < 3 )
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
if ( level.loadoutkillstreaksenabled && isDefined( self.killstreak[ i ] ) && isDefined( level.killstreakindices[ self.killstreak[ i ] ] ) )
|
||||
{
|
||||
killstreaks[ i ] = level.killstreakindices[ self.killstreak[ i ] ];
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
killstreaks[ i ] = 0;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
self recordloadoutperksandkillstreaks( primaryweapon, sidearm, grenadetypeprimary, grenadetypesecondary, killstreaks[ 0 ], killstreaks[ 1 ], killstreaks[ 2 ] );
|
||||
}
|
||||
@ -904,7 +874,7 @@ giveloadout( team, class )
|
||||
pixendevent();
|
||||
}
|
||||
|
||||
setweaponammooverall( weaponname, amount )
|
||||
setweaponammooverall( weaponname, amount ) //checked matches cerberus output
|
||||
{
|
||||
if ( isweaponcliponly( weaponname ) )
|
||||
{
|
||||
@ -914,14 +884,16 @@ setweaponammooverall( weaponname, amount )
|
||||
{
|
||||
self setweaponammoclip( weaponname, amount );
|
||||
diff = amount - self getweaponammoclip( weaponname );
|
||||
/*
|
||||
/#
|
||||
assert( diff >= 0 );
|
||||
#/
|
||||
*/
|
||||
self setweaponammostock( weaponname, diff );
|
||||
}
|
||||
}
|
||||
|
||||
onplayerconnecting()
|
||||
onplayerconnecting() //checked matches cerberus output
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
@ -943,19 +915,19 @@ onplayerconnecting()
|
||||
}
|
||||
}
|
||||
|
||||
fadeaway( waitdelay, fadedelay )
|
||||
fadeaway( waitdelay, fadedelay ) //checked matches cerberus output
|
||||
{
|
||||
wait waitdelay;
|
||||
self fadeovertime( fadedelay );
|
||||
self.alpha = 0;
|
||||
}
|
||||
|
||||
setclass( newclass )
|
||||
setclass( newclass ) //checked matches cerberus output
|
||||
{
|
||||
self.curclass = newclass;
|
||||
}
|
||||
|
||||
initperkdvars()
|
||||
initperkdvars() //checked matches cerberus output
|
||||
{
|
||||
level.cac_armorpiercing_data = cac_get_dvar_int( "perk_armorpiercing", "40" ) / 100;
|
||||
level.cac_bulletdamage_data = cac_get_dvar_int( "perk_bulletDamage", "35" );
|
||||
@ -966,60 +938,51 @@ initperkdvars()
|
||||
level.cac_flakjacket_hardcore_data = cac_get_dvar_int( "perk_flakJacket_hardcore", "9" );
|
||||
}
|
||||
|
||||
cac_selector()
|
||||
cac_selector() //checked changed to match cerberus output
|
||||
{
|
||||
perks = self.specialty;
|
||||
self.detectexplosives = 0;
|
||||
i = 0;
|
||||
while ( i < perks.size )
|
||||
for ( i = 0; i < perks.size; i++ )
|
||||
{
|
||||
perk = perks[ i ];
|
||||
if ( perk == "specialty_detectexplosive" )
|
||||
{
|
||||
self.detectexplosives = 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
register_perks()
|
||||
register_perks() //checked changed at own discretion did not use continue in for loop see github for more info
|
||||
{
|
||||
perks = self.specialty;
|
||||
self clearperks();
|
||||
i = 0;
|
||||
while ( i < perks.size )
|
||||
for ( i = 0; i < perks.size; i++ )
|
||||
{
|
||||
perk = perks[ i ];
|
||||
if ( perk != "specialty_null" || issubstr( perk, "specialty_weapon_" ) && perk == "weapon_null" )
|
||||
if ( perk == "specialty_null" || issubstr( perk, "specialty_weapon_" ) || perk == "weapon_null" )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
else if ( !level.perksenabled )
|
||||
{
|
||||
if ( !level.perksenabled )
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
self setperk( perk );
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
maps/mp/gametypes/_dev::giveextraperks();
|
||||
#/
|
||||
*/
|
||||
}
|
||||
|
||||
cac_get_dvar_int( dvar, def )
|
||||
cac_get_dvar_int( dvar, def ) //checked matches cerberus output
|
||||
{
|
||||
return int( cac_get_dvar( dvar, def ) );
|
||||
}
|
||||
|
||||
cac_get_dvar( dvar, def )
|
||||
cac_get_dvar( dvar, def ) //checked matches cerberus output
|
||||
{
|
||||
if ( getDvar( dvar ) != "" )
|
||||
{
|
||||
@ -1032,13 +995,13 @@ cac_get_dvar( dvar, def )
|
||||
}
|
||||
}
|
||||
|
||||
cac_modified_vehicle_damage( victim, attacker, damage, meansofdeath, weapon, inflictor )
|
||||
cac_modified_vehicle_damage( victim, attacker, damage, meansofdeath, weapon, inflictor ) //checked changed to match cerberus output dvars obtained from beta dump
|
||||
{
|
||||
if ( isDefined( victim ) || !isDefined( attacker ) && !isplayer( attacker ) )
|
||||
if ( !isDefined( victim ) || !isDefined( attacker ) || !isplayer( attacker ) )
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
if ( isDefined( damage ) || !isDefined( meansofdeath ) && !isDefined( weapon ) )
|
||||
if ( !isDefined( damage ) || !isDefined( meansofdeath ) || !isDefined( weapon ) )
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
@ -1047,41 +1010,45 @@ cac_modified_vehicle_damage( victim, attacker, damage, meansofdeath, weapon, inf
|
||||
if ( attacker hasperk( "specialty_bulletdamage" ) && isprimarydamage( meansofdeath ) )
|
||||
{
|
||||
final_damage = ( damage * ( 100 + level.cac_bulletdamage_data ) ) / 100;
|
||||
/*
|
||||
/#
|
||||
if ( getDvarInt( #"5ABA6445" ) )
|
||||
if ( getDvarInt( "scr_perkdebug" ) )
|
||||
{
|
||||
println( "Perk/> " + attacker.name + "'s bullet damage did extra damage to vehicle" );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( attacker hasperk( "specialty_explosivedamage" ) && isplayerexplosiveweapon( weapon, meansofdeath ) )
|
||||
else if ( attacker hasperk( "specialty_explosivedamage" ) && isplayerexplosiveweapon( weapon, meansofdeath ) )
|
||||
{
|
||||
final_damage = ( damage * ( 100 + level.cac_explosivedamage_data ) ) / 100;
|
||||
/*
|
||||
/#
|
||||
if ( getDvarInt( #"5ABA6445" ) )
|
||||
if ( getDvarInt( "scr_perkdebug" ) )
|
||||
{
|
||||
println( "Perk/> " + attacker.name + "'s explosive damage did extra damage to vehicle" );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
final_damage = old_damage;
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getDvarInt( #"5ABA6445" ) )
|
||||
if ( getDvarInt( "scr_perkdebug" ) )
|
||||
{
|
||||
println( "Perk/> Damage Factor: " + ( final_damage / old_damage ) + " - Pre Damage: " + old_damage + " - Post Damage: " + final_damage );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
return int( final_damage );
|
||||
}
|
||||
|
||||
cac_modified_damage( victim, attacker, damage, mod, weapon, inflictor, hitloc )
|
||||
cac_modified_damage( victim, attacker, damage, mod, weapon, inflictor, hitloc ) //checked changed to match cerberus output certain order of operations changed to match beta dump
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( victim ) );
|
||||
#/
|
||||
@ -1091,6 +1058,7 @@ cac_modified_damage( victim, attacker, damage, mod, weapon, inflictor, hitloc )
|
||||
/#
|
||||
assert( isplayer( victim ) );
|
||||
#/
|
||||
*/
|
||||
if ( victim == attacker )
|
||||
{
|
||||
return damage;
|
||||
@ -1103,75 +1071,79 @@ cac_modified_damage( victim, attacker, damage, mod, weapon, inflictor, hitloc )
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
/*
|
||||
/#
|
||||
debug = 0;
|
||||
if ( getDvarInt( #"5ABA6445" ) )
|
||||
if ( getDvarInt( "scr_perkdebug" ) )
|
||||
{
|
||||
debug = 1;
|
||||
#/
|
||||
}
|
||||
*/
|
||||
final_damage = damage;
|
||||
if ( attacker hasperk( "specialty_bulletdamage" ) && isprimarydamage( mod ) )
|
||||
{
|
||||
if ( victim hasperk( "specialty_armorvest" ) && !isheaddamage( hitloc ) )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
if ( debug )
|
||||
{
|
||||
println( "Perk/> " + victim.name + "'s armor countered " + attacker.name + "'s increased bullet damage" );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
final_damage = ( damage * ( 100 + level.cac_bulletdamage_data ) ) / 100;
|
||||
final_damage = damage * ( 100 + level.cac_bulletdamage_data ) / 100;
|
||||
/*
|
||||
/#
|
||||
if ( debug )
|
||||
{
|
||||
println( "Perk/> " + attacker.name + "'s bullet damage did extra damage to " + victim.name );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ( victim hasperk( "specialty_armorvest" ) && isprimarydamage( mod ) && !isheaddamage( hitloc ) )
|
||||
{
|
||||
if ( victim hasperk( "specialty_armorvest" ) && isprimarydamage( mod ) && !isheaddamage( hitloc ) )
|
||||
{
|
||||
final_damage = damage * ( level.cac_armorvest_data * 0,01 );
|
||||
final_damage = damage * ( level.cac_armorvest_data * 0.01 );
|
||||
/*
|
||||
/#
|
||||
if ( debug )
|
||||
{
|
||||
println( "Perk/> " + attacker.name + "'s bullet damage did less damage to " + victim.name );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( victim hasperk( "specialty_fireproof" ) && isfiredamage( weapon, mod ) )
|
||||
else if ( victim hasperk( "specialty_fireproof" ) && isfiredamage( weapon, mod ) )
|
||||
{
|
||||
final_damage = damage * ( ( 100 - level.cac_fireproof_data ) / 100 );
|
||||
/*
|
||||
/#
|
||||
if ( debug )
|
||||
{
|
||||
println( "Perk/> " + attacker.name + "'s flames did less damage to " + victim.name );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
else if ( attacker hasperk( "specialty_explosivedamage" ) && isplayerexplosiveweapon( weapon, mod ) )
|
||||
{
|
||||
if ( attacker hasperk( "specialty_explosivedamage" ) && isplayerexplosiveweapon( weapon, mod ) )
|
||||
{
|
||||
final_damage = ( damage * ( 100 + level.cac_explosivedamage_data ) ) / 100;
|
||||
final_damage = damage * ( 100 + level.cac_explosivedamage_data ) / 100;
|
||||
/*
|
||||
/#
|
||||
if ( debug )
|
||||
{
|
||||
println( "Perk/> " + attacker.name + "'s explosive damage did extra damage to " + victim.name );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( victim hasperk( "specialty_flakjacket" ) && isexplosivedamage( weapon, mod ) && !victim grenadestuck( inflictor ) )
|
||||
else if ( victim hasperk( "specialty_flakjacket" ) && isexplosivedamage( weapon, mod ) && !victim grenadestuck( inflictor ) )
|
||||
{
|
||||
if ( level.hardcoremode )
|
||||
{
|
||||
@ -1184,25 +1156,21 @@ cac_modified_damage( victim, attacker, damage, mod, weapon, inflictor, hitloc )
|
||||
{
|
||||
victim thread maps/mp/_challenges::flakjacketprotected( weapon, attacker );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( attacker != victim )
|
||||
else if ( attacker != victim )
|
||||
{
|
||||
victim thread maps/mp/_challenges::flakjacketprotected( weapon, attacker );
|
||||
}
|
||||
}
|
||||
final_damage = int( damage * ( cac_data / 100 ) );
|
||||
/*
|
||||
/#
|
||||
if ( debug )
|
||||
{
|
||||
println( "Perk/> " + victim.name + "'s flak jacket decreased " + attacker.name + "'s grenade damage" );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
victim.cac_debug_damage_type = tolower( mod );
|
||||
victim.cac_debug_original_damage = damage;
|
||||
@ -1215,6 +1183,7 @@ cac_modified_damage( victim, attacker, damage, mod, weapon, inflictor, hitloc )
|
||||
println( "Perk/> Damage Factor: " + ( final_damage / damage ) + " - Pre Damage: " + damage + " - Post Damage: " + final_damage );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
final_damage = int( final_damage );
|
||||
if ( final_damage < 1 )
|
||||
{
|
||||
@ -1223,7 +1192,7 @@ cac_modified_damage( victim, attacker, damage, mod, weapon, inflictor, hitloc )
|
||||
return final_damage;
|
||||
}
|
||||
|
||||
isexplosivedamage( weapon, meansofdeath )
|
||||
isexplosivedamage( weapon, meansofdeath ) //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( weapon ) )
|
||||
{
|
||||
@ -1250,25 +1219,39 @@ isexplosivedamage( weapon, meansofdeath )
|
||||
return 0;
|
||||
}
|
||||
|
||||
hastacticalmask( player )
|
||||
hastacticalmask( player ) //checked changed at own discretion
|
||||
{
|
||||
if ( !player hasperk( "specialty_stunprotection" ) && !player hasperk( "specialty_flashprotection" ) )
|
||||
if ( player hasperk( "specialty_stunprotection" ) || player hasperk( "specialty_flashprotection" ) || player hasperk( "specialty_proximityprotection" ) )
|
||||
{
|
||||
return player hasperk( "specialty_proximityprotection" );
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
isprimarydamage( meansofdeath )
|
||||
isprimarydamage( meansofdeath ) //checked changed at own discretion
|
||||
{
|
||||
if ( meansofdeath != "MOD_RIFLE_BULLET" )
|
||||
if ( meansofdeath != "MOD_RIFLE_BULLET" || meansofdeath == "MOD_PISTOL_BULLET" )
|
||||
{
|
||||
return meansofdeath == "MOD_PISTOL_BULLET";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
isfiredamage( weapon, meansofdeath )
|
||||
isfiredamage( weapon, meansofdeath ) //checked changed at own discretion
|
||||
{
|
||||
if ( !issubstr( weapon, "flame" ) && !issubstr( weapon, "napalmblob_" ) && issubstr( weapon, "napalm_" ) && meansofdeath != "MOD_BURNED" || meansofdeath == "MOD_GRENADE" && meansofdeath == "MOD_GRENADE_SPLASH" )
|
||||
if ( ( meansofdeath == "MOD_BURNED" || meansofdeath == "MOD_GRENADE" ) && isSubStr( weapon, "napalm_" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if ( isSubStr( weapon, "napalm_" ) && meansofdeath == "MOD_GRENADE_SPLASH" )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if ( ( isSubStr( weapon, "flame" ) || isSubStr( weapon, "napalmblob_" ) ) && ( meansofdeath == "MOD_BURNED" || meansofdeath == "MOD_GRENADE" ) )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if ( ( isSubStr( weapon, "flame" ) || isSubStr( weapon, "napalmblob_" ) ) && meansofdeath == "MOD_GRENADE_SPLASH" )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@ -1279,7 +1262,7 @@ isfiredamage( weapon, meansofdeath )
|
||||
return 0;
|
||||
}
|
||||
|
||||
isplayerexplosiveweapon( weapon, meansofdeath )
|
||||
isplayerexplosiveweapon( weapon, meansofdeath ) //checked matches cerberus output
|
||||
{
|
||||
if ( !isexplosivedamage( weapon, meansofdeath ) )
|
||||
{
|
||||
@ -1298,18 +1281,22 @@ isplayerexplosiveweapon( weapon, meansofdeath )
|
||||
return 1;
|
||||
}
|
||||
|
||||
isheaddamage( hitloc )
|
||||
isheaddamage( hitloc ) //checked changed at own discretion
|
||||
{
|
||||
if ( hitloc != "helmet" && hitloc != "head" )
|
||||
if ( hitloc == "helmet" && hitloc == "head" || hitloc == "neck" )
|
||||
{
|
||||
return hitloc == "neck";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
grenadestuck( inflictor )
|
||||
grenadestuck( inflictor ) //checked changed at own discretion
|
||||
{
|
||||
if ( isDefined( inflictor ) && isDefined( inflictor.stucktoplayer ) )
|
||||
if ( isDefined( inflictor ) && isDefined( inflictor.stucktoplayer ) && inflictor.stucktoplayer == self )
|
||||
{
|
||||
return inflictor.stucktoplayer == self;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
//checked includes match cerberus output
|
||||
#include maps/mp/_challenges;
|
||||
#include maps/mp/_scoreevents;
|
||||
#include maps/mp/gametypes/_damagefeedback;
|
||||
@ -7,7 +8,7 @@
|
||||
#include maps/mp/gametypes/_globallogic_player;
|
||||
#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" )
|
||||
{
|
||||
@ -45,14 +46,11 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( smeansofdeath == "MOD_HEAD_SHOT" )
|
||||
else if ( smeansofdeath == "MOD_HEAD_SHOT" )
|
||||
{
|
||||
idamage = 150;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( smeansofdeath == "MOD_BURNED" )
|
||||
{
|
||||
if ( sweapon == "none" )
|
||||
@ -70,14 +68,11 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
{
|
||||
sweapon = "explodable_barrel_mp";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
|
||||
else if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
|
||||
{
|
||||
sweapon = "destructible_car_mp";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( idflags & level.idflags_no_protection )
|
||||
{
|
||||
if ( isplayer( eattacker ) )
|
||||
@ -104,9 +99,7 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( level.friendlyfire == 3 )
|
||||
else if ( level.friendlyfire == 3 )
|
||||
{
|
||||
idamage = int( idamage * 0,5 );
|
||||
if ( idamage < 1 )
|
||||
@ -116,12 +109,9 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
self.lastdamagewasfromenemy = 0;
|
||||
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
|
||||
}
|
||||
}
|
||||
friendly = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode )
|
||||
else if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -145,15 +135,19 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
{
|
||||
self.wascooked = undefined;
|
||||
}
|
||||
if ( isDefined( eattacker ) )
|
||||
if ( isDefined( eattacker ) && eattacker != self )
|
||||
{
|
||||
self.lastdamagewasfromenemy = eattacker != self;
|
||||
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 ( sweapon != "artillery_mp" && !isDefined( einflictor ) || !isai( einflictor ) )
|
||||
{
|
||||
if ( idamage > 0 )
|
||||
{
|
||||
@ -162,12 +156,14 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getDvarInt( "g_debugDamage" ) )
|
||||
{
|
||||
println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + " hitLoc:" + shitloc );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
if ( 1 )
|
||||
{
|
||||
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" )
|
||||
{
|
||||
@ -219,3 +215,4 @@ callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
//checked includes match cerberus output
|
||||
#include maps/mp/gametypes/_rank;
|
||||
#include maps/mp/killstreaks/_killstreaks;
|
||||
#include maps/mp/gametypes/_spawnlogic;
|
||||
@ -8,23 +9,20 @@
|
||||
#include maps/mp/_utility;
|
||||
#include common_scripts/utility;
|
||||
|
||||
getwinningteamfromloser( losing_team )
|
||||
getwinningteamfromloser( losing_team ) //checked changed to match cerberus output
|
||||
{
|
||||
if ( level.multiteam )
|
||||
{
|
||||
return "tie";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( losing_team == "axis" )
|
||||
else if ( losing_team == "axis" )
|
||||
{
|
||||
return "allies";
|
||||
}
|
||||
}
|
||||
return "axis";
|
||||
}
|
||||
|
||||
default_onforfeit( team )
|
||||
default_onforfeit( team ) //checked matches cerberus output
|
||||
{
|
||||
level.gameforfeited = 1;
|
||||
level notify( "forfeit in progress" );
|
||||
@ -56,12 +54,14 @@ default_onforfeit( team )
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( team ), "Forfeited team is not defined" );
|
||||
#/
|
||||
/#
|
||||
assert( 0, "Forfeited team " + team + " is not allies or axis" );
|
||||
#/
|
||||
*/
|
||||
winner = "tie";
|
||||
}
|
||||
level.forcedend = 1;
|
||||
@ -76,7 +76,7 @@ default_onforfeit( team )
|
||||
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 ] ) )
|
||||
{
|
||||
@ -88,7 +88,9 @@ default_ondeadevent( team )
|
||||
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "team eliminated", winner );
|
||||
thread maps/mp/gametypes/_globallogic::endgame( winner, eliminatedstring );
|
||||
}
|
||||
else makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "tie" ] );
|
||||
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 )
|
||||
@ -99,9 +101,10 @@ default_ondeadevent( team )
|
||||
{
|
||||
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 ] ) )
|
||||
{
|
||||
@ -113,7 +116,9 @@ default_onlastteamaliveevent( team )
|
||||
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "team eliminated", winner );
|
||||
thread maps/mp/gametypes/_globallogic::endgame( winner, eliminatedstring );
|
||||
}
|
||||
else makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "tie" ] );
|
||||
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 )
|
||||
@ -124,18 +129,19 @@ default_onlastteamaliveevent( team )
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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 )
|
||||
{
|
||||
@ -161,21 +167,18 @@ default_ononeleftevent( team )
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
else if ( !isDefined( player.pers[ "team" ] ) || player.pers[ "team" ] != team )
|
||||
if ( !isDefined( player.pers[ "team" ] ) || player.pers[ "team" ] != team )
|
||||
{
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
player maps/mp/gametypes/_globallogic_audio::leaderdialogonplayer( "sudden_death" );
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default_ontimelimit()
|
||||
default_ontimelimit() //checked changed to match cerberus output
|
||||
{
|
||||
winner = undefined;
|
||||
if ( level.teambased )
|
||||
@ -183,7 +186,9 @@ default_ontimelimit()
|
||||
winner = maps/mp/gametypes/_globallogic::determineteamwinnerbygamestat( "teamScores" );
|
||||
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "time limit", winner );
|
||||
}
|
||||
else winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
|
||||
else
|
||||
{
|
||||
winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
|
||||
if ( isDefined( winner ) )
|
||||
{
|
||||
logstring( "time limit, win: " + winner.name );
|
||||
@ -192,12 +197,13 @@ default_ontimelimit()
|
||||
{
|
||||
logstring( "time limit, tie" );
|
||||
}
|
||||
}
|
||||
makedvarserverinfo( "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" ] );
|
||||
}
|
||||
|
||||
default_onscorelimit()
|
||||
default_onscorelimit() //checked changed to match cerberus output
|
||||
{
|
||||
if ( !level.endgameonscorelimit )
|
||||
{
|
||||
@ -209,7 +215,9 @@ default_onscorelimit()
|
||||
winner = maps/mp/gametypes/_globallogic::determineteamwinnerbygamestat( "teamScores" );
|
||||
maps/mp/gametypes/_globallogic_utils::logteamwinstring( "scorelimit", winner );
|
||||
}
|
||||
else winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
|
||||
else
|
||||
{
|
||||
winner = maps/mp/gametypes/_globallogic_score::gethighestscoringplayer();
|
||||
if ( isDefined( winner ) )
|
||||
{
|
||||
logstring( "scorelimit, win: " + winner.name );
|
||||
@ -218,13 +226,14 @@ default_onscorelimit()
|
||||
{
|
||||
logstring( "scorelimit, tie" );
|
||||
}
|
||||
}
|
||||
makedvarserverinfo( "ui_text_endreason", game[ "strings" ][ "score_limit_reached" ] );
|
||||
setdvar( "ui_text_endreason", game[ "strings" ][ "score_limit_reached" ] );
|
||||
thread maps/mp/gametypes/_globallogic::endgame( winner, game[ "strings" ][ "score_limit_reached" ] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
default_onspawnspectator( origin, angles )
|
||||
default_onspawnspectator( origin, angles ) //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( origin ) && isDefined( angles ) )
|
||||
{
|
||||
@ -233,14 +242,16 @@ default_onspawnspectator( origin, angles )
|
||||
}
|
||||
spawnpointname = "mp_global_intermission";
|
||||
spawnpoints = getentarray( spawnpointname, "classname" );
|
||||
/*
|
||||
/#
|
||||
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 );
|
||||
self spawn( spawnpoint.origin, spawnpoint.angles );
|
||||
}
|
||||
|
||||
default_onspawnintermission()
|
||||
default_onspawnintermission() //checked matches cerberus output
|
||||
{
|
||||
spawnpointname = "mp_global_intermission";
|
||||
spawnpoints = getentarray( spawnpointname, "classname" );
|
||||
@ -251,18 +262,20 @@ default_onspawnintermission()
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
/#
|
||||
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 );
|
||||
}
|
||||
|
||||
default_getteamkillpenalty( einflictor, attacker, smeansofdeath, sweapon )
|
||||
default_getteamkillpenalty( einflictor, attacker, smeansofdeath, sweapon ) //checked matches cerberus output
|
||||
{
|
||||
teamkill_penalty = 1;
|
||||
score = maps/mp/gametypes/_globallogic_score::_getplayerscore( attacker );
|
||||
@ -277,7 +290,8 @@ default_getteamkillpenalty( einflictor, attacker, smeansofdeath, sweapon )
|
||||
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" );
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
//checked includes match cerberus output
|
||||
#include maps/mp/gametypes/_class;
|
||||
#include maps/mp/gametypes/_globallogic_player;
|
||||
#include maps/mp/gametypes/_spectating;
|
||||
@ -10,7 +11,7 @@
|
||||
#include common_scripts/utility;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
init()
|
||||
init() //checked matches cerberus output
|
||||
{
|
||||
precachestring( &"MP_HALFTIME" );
|
||||
precachestring( &"MP_OVERTIME" );
|
||||
@ -37,7 +38,7 @@ init()
|
||||
}
|
||||
}
|
||||
|
||||
setupcallbacks()
|
||||
setupcallbacks() //checked matches cerberus output
|
||||
{
|
||||
level.autoassign = ::menuautoassign;
|
||||
level.spectator = ::menuspectator;
|
||||
@ -45,16 +46,16 @@ setupcallbacks()
|
||||
level.teammenu = ::menuteam;
|
||||
}
|
||||
|
||||
hideloadoutaftertime( delay )
|
||||
hideloadoutaftertime( delay ) //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "perks_hidden" );
|
||||
wait delay;
|
||||
self thread hideallperks( 0,4 );
|
||||
self thread hideallperks( 0.4 );
|
||||
self notify( "perks_hidden" );
|
||||
}
|
||||
|
||||
hideloadoutondeath()
|
||||
hideloadoutondeath() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "perks_hidden" );
|
||||
@ -63,7 +64,7 @@ hideloadoutondeath()
|
||||
self notify( "perks_hidden" );
|
||||
}
|
||||
|
||||
hideloadoutonkill()
|
||||
hideloadoutonkill() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self endon( "death" );
|
||||
@ -73,19 +74,17 @@ hideloadoutonkill()
|
||||
self notify( "perks_hidden" );
|
||||
}
|
||||
|
||||
freegameplayhudelems()
|
||||
freegameplayhudelems() //checked changed to match cerberus output
|
||||
{
|
||||
while ( isDefined( self.perkicon ) )
|
||||
if ( isDefined( self.perkicon ) )
|
||||
{
|
||||
numspecialties = 0;
|
||||
while ( numspecialties < level.maxspecialties )
|
||||
for ( numspecialties = 0; numspecialties < level.maxspecialties; numspecialties++ )
|
||||
{
|
||||
if ( isDefined( self.perkicon[ numspecialties ] ) )
|
||||
{
|
||||
self.perkicon[ numspecialties ] destroyelem();
|
||||
self.perkname[ numspecialties ] destroyelem();
|
||||
}
|
||||
numspecialties++;
|
||||
}
|
||||
}
|
||||
if ( isDefined( self.perkhudelem ) )
|
||||
@ -139,14 +138,11 @@ freegameplayhudelems()
|
||||
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;
|
||||
_a146 = level.teams;
|
||||
_k146 = getFirstArrayKey( _a146 );
|
||||
while ( isDefined( _k146 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a146[ _k146 ];
|
||||
if ( !isDefined( count ) )
|
||||
{
|
||||
count = playercounts[ team ];
|
||||
@ -158,31 +154,26 @@ teamplayercountsequal( playercounts )
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
_k146 = getNextArrayKey( _a146, _k146 );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
teamwithlowestplayercount( playercounts, ignore_team )
|
||||
teamwithlowestplayercount( playercounts, ignore_team ) //checked changed to match cerberus output
|
||||
{
|
||||
count = 9999;
|
||||
lowest_team = undefined;
|
||||
_a165 = level.teams;
|
||||
_k165 = getFirstArrayKey( _a165 );
|
||||
while ( isDefined( _k165 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a165[ _k165 ];
|
||||
if ( count > playercounts[ team ] )
|
||||
{
|
||||
count = playercounts[ team ];
|
||||
lowest_team = team;
|
||||
}
|
||||
_k165 = getNextArrayKey( _a165, _k165 );
|
||||
}
|
||||
return lowest_team;
|
||||
}
|
||||
|
||||
menuautoassign( comingfrommenu )
|
||||
menuautoassign( comingfrommenu ) //checked changed to match cerberus output
|
||||
{
|
||||
teamkeys = getarraykeys( level.teams );
|
||||
assignment = teamkeys[ randomint( teamkeys.size ) ];
|
||||
@ -191,16 +182,14 @@ menuautoassign( comingfrommenu )
|
||||
{
|
||||
assignment = "allies";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( level.teambased )
|
||||
else if ( level.teambased )
|
||||
{
|
||||
if ( getDvarInt( "party_autoteams" ) == 1 )
|
||||
{
|
||||
if ( level.allow_teamchange == "1" || self.hasspawned && comingfrommenu )
|
||||
{
|
||||
assignment = "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -228,17 +217,13 @@ menuautoassign( comingfrommenu )
|
||||
{
|
||||
assignment = team;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( team == "spectator" && !level.forceautoassign )
|
||||
else if ( team == "spectator" && !level.forceautoassign )
|
||||
{
|
||||
self setclientscriptmainmenu( game[ "menu_class" ] );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( assignment == "" || getDvarInt( "party_autoteams" ) == 0 )
|
||||
{
|
||||
if ( sessionmodeiszombiesgame() )
|
||||
@ -248,9 +233,11 @@ menuautoassign( comingfrommenu )
|
||||
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 );
|
||||
@ -264,7 +251,9 @@ menuautoassign( comingfrommenu )
|
||||
assignment = getotherteam( host.team );
|
||||
}
|
||||
}
|
||||
else playercounts = self maps/mp/teams/_teams::countplayers();
|
||||
else
|
||||
{
|
||||
playercounts = self maps/mp/teams/_teams::countplayers();
|
||||
if ( teamplayercountsequal( playercounts ) )
|
||||
{
|
||||
if ( !level.splitscreen && self issplitscreen() )
|
||||
@ -285,7 +274,8 @@ menuautoassign( comingfrommenu )
|
||||
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;
|
||||
@ -300,18 +290,14 @@ menuautoassign( comingfrommenu )
|
||||
{
|
||||
assignment = team;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( team == "spectator" && !level.forceautoassign )
|
||||
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.joining_team = assignment;
|
||||
@ -320,7 +306,10 @@ menuautoassign( comingfrommenu )
|
||||
}
|
||||
self.pers[ "team" ] = assignment;
|
||||
self.team = assignment;
|
||||
self.pers["class"] = undefined;
|
||||
self.class = undefined;
|
||||
self.pers["weapon"] = undefined;
|
||||
self.pers["savedmodel"] = undefined;
|
||||
self updateobjectivetext();
|
||||
if ( level.teambased )
|
||||
{
|
||||
@ -367,14 +356,11 @@ menuautoassign( comingfrommenu )
|
||||
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;
|
||||
_a397 = level.teams;
|
||||
_k397 = getFirstArrayKey( _a397 );
|
||||
while ( isDefined( _k397 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a397[ _k397 ];
|
||||
if ( !isDefined( score ) )
|
||||
{
|
||||
score = getteamscore( team );
|
||||
@ -386,7 +372,6 @@ teamscoresequal()
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
_k397 = getNextArrayKey( _a397, _k397 );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -395,21 +380,17 @@ teamwithlowestscore()
|
||||
{
|
||||
score = 99999999;
|
||||
lowest_team = undefined;
|
||||
_a416 = level.teams;
|
||||
_k416 = getFirstArrayKey( _a416 );
|
||||
while ( isDefined( _k416 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a416[ _k416 ];
|
||||
if ( score > getteamscore( team ) )
|
||||
{
|
||||
lowest_team = team;
|
||||
}
|
||||
_k416 = getNextArrayKey( _a416, _k416 );
|
||||
}
|
||||
return lowest_team;
|
||||
}
|
||||
|
||||
pickteamfromscores( teams )
|
||||
pickteamfromscores( teams ) //checked matches cerberus output
|
||||
{
|
||||
assignment = "allies";
|
||||
if ( teamscoresequal() )
|
||||
@ -423,7 +404,7 @@ pickteamfromscores( teams )
|
||||
return assignment;
|
||||
}
|
||||
|
||||
getsplitscreenteam()
|
||||
getsplitscreenteam() //checked partially changed to match cerberus output did not use for loop see github for more info
|
||||
{
|
||||
index = 0;
|
||||
while ( index < level.players.size )
|
||||
@ -433,30 +414,27 @@ getsplitscreenteam()
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
else if ( level.players[ index ] == self )
|
||||
if ( level.players[ index ] == self )
|
||||
{
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
else if ( !self isplayeronsamemachine( level.players[ index ] ) )
|
||||
if ( !self isplayeronsamemachine( level.players[ index ] ) )
|
||||
{
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
team = level.players[ index ].sessionteam;
|
||||
if ( team != "spectator" )
|
||||
{
|
||||
return team;
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
updateobjectivetext()
|
||||
updateobjectivetext() //checked matches cerberus output
|
||||
{
|
||||
if ( sessionmodeiszombiesgame() || self.pers[ "team" ] == "spectator" )
|
||||
{
|
||||
@ -473,17 +451,19 @@ updateobjectivetext()
|
||||
}
|
||||
}
|
||||
|
||||
closemenus()
|
||||
closemenus() //checked matches cerberus output
|
||||
{
|
||||
self closemenu();
|
||||
self closeingamemenu();
|
||||
}
|
||||
|
||||
beginclasschoice( forcenewchoice )
|
||||
beginclasschoice( forcenewchoice ) //checked matches cerberus output
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( isDefined( level.teams[ self.pers[ "team" ] ] ) );
|
||||
#/
|
||||
*/
|
||||
team = self.pers[ "team" ];
|
||||
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" ] ] ) );
|
||||
#/
|
||||
*/
|
||||
team = self.pers[ "team" ];
|
||||
if ( level.wagermatch )
|
||||
{
|
||||
@ -527,7 +509,7 @@ showmainmenuforteam()
|
||||
}
|
||||
}
|
||||
|
||||
menuteam( team )
|
||||
menuteam( team ) //checked changed to match cerberus output
|
||||
{
|
||||
self closemenus();
|
||||
if ( !level.console && level.allow_teamchange == "0" && isDefined( self.hasdonecombat ) && self.hasdonecombat )
|
||||
@ -549,7 +531,10 @@ menuteam( team )
|
||||
}
|
||||
self.pers[ "team" ] = team;
|
||||
self.team = team;
|
||||
self.pers[ "class" ] = undefined;
|
||||
self.class = undefined;
|
||||
self.pers[ "weapon" ] = undefined;
|
||||
self.pers[ "savedmodel" ] = undefined;
|
||||
self updateobjectivetext();
|
||||
if ( !level.rankedmatch && !level.leaguematch )
|
||||
{
|
||||
@ -572,7 +557,7 @@ menuteam( team )
|
||||
self beginclasschoice();
|
||||
}
|
||||
|
||||
menuspectator()
|
||||
menuspectator() //checked changed to match cerberus output
|
||||
{
|
||||
self closemenus();
|
||||
if ( self.pers[ "team" ] != "spectator" )
|
||||
@ -586,7 +571,10 @@ menuspectator()
|
||||
}
|
||||
self.pers[ "team" ] = "spectator";
|
||||
self.team = "spectator";
|
||||
self.pers[ "class" ] = undefined;
|
||||
self.class = undefined;
|
||||
self.pers[ "weapon" ] = undefined;
|
||||
self.pers[ "savedmodel" ] = undefined;
|
||||
self updateobjectivetext();
|
||||
self.sessionteam = "spectator";
|
||||
if ( !level.teambased )
|
||||
@ -600,7 +588,7 @@ menuspectator()
|
||||
}
|
||||
}
|
||||
|
||||
menuclass( response )
|
||||
menuclass( response ) //checked changed to match cerberus output
|
||||
{
|
||||
self closemenus();
|
||||
if ( !isDefined( self.pers[ "team" ] ) || !isDefined( level.teams[ self.pers[ "team" ] ] ) )
|
||||
@ -635,7 +623,7 @@ menuclass( response )
|
||||
supplystationclasschange = self.usingsupplystation;
|
||||
}
|
||||
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.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/killstreaks/_killstreaks::giveownedkillstreak();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !self issplitscreen() )
|
||||
else if ( !self issplitscreen() )
|
||||
{
|
||||
self iprintlnbold( game[ "strings" ][ "change_class" ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self.pers[ "class" ] = class;
|
||||
self.class = class;
|
||||
self.pers[ "weapon" ] = undefined;
|
||||
if ( game[ "state" ] == "postgame" )
|
||||
{
|
||||
return;
|
||||
@ -689,7 +675,7 @@ menuclass( response )
|
||||
self thread maps/mp/gametypes/_spectating::setspectatepermissionsformachine();
|
||||
}
|
||||
|
||||
removespawnmessageshortly( delay )
|
||||
removespawnmessageshortly( delay ) //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
waittillframeend;
|
||||
@ -697,3 +683,4 @@ removespawnmessageshortly( delay )
|
||||
wait delay;
|
||||
self clearlowermessage( 2 );
|
||||
}
|
||||
|
||||
|
@ -1,19 +1,20 @@
|
||||
//checked includes match cerberus output
|
||||
#include maps/mp/gametypes/_globallogic_score;
|
||||
#include maps/mp/gametypes/_hostmigration;
|
||||
#include maps/mp/killstreaks/_killstreaks;
|
||||
#include maps/mp/gametypes/_hud_message;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
waittillslowprocessallowed()
|
||||
waittillslowprocessallowed() //checked matches cerberus output
|
||||
{
|
||||
while ( level.lastslowprocessframe == getTime() )
|
||||
{
|
||||
wait 0,05;
|
||||
wait 0.05;
|
||||
}
|
||||
level.lastslowprocessframe = getTime();
|
||||
}
|
||||
|
||||
testmenu()
|
||||
testmenu() //checked matches cerberus output
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
@ -28,7 +29,7 @@ testmenu()
|
||||
}
|
||||
}
|
||||
|
||||
testshock()
|
||||
testshock() //checked changed to match cerberus output
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
@ -36,18 +37,16 @@ testshock()
|
||||
{
|
||||
wait 3;
|
||||
numshots = randomint( 6 );
|
||||
i = 0;
|
||||
while ( i < numshots )
|
||||
for ( i = 0; i < numshots; i++ )
|
||||
{
|
||||
iprintlnbold( numshots );
|
||||
self shellshock( "frag_grenade_mp", 0,2 );
|
||||
wait 0,1;
|
||||
i++;
|
||||
wait 0.1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
testhps()
|
||||
testhps() //checked matches cerberus output
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "disconnect" );
|
||||
@ -66,7 +65,7 @@ testhps()
|
||||
}
|
||||
}
|
||||
|
||||
timeuntilroundend()
|
||||
timeuntilroundend() //checked matches cerberus output
|
||||
{
|
||||
if ( level.gameended )
|
||||
{
|
||||
@ -95,12 +94,12 @@ timeuntilroundend()
|
||||
return timeremaining + level.postroundtime;
|
||||
}
|
||||
|
||||
gettimeremaining()
|
||||
gettimeremaining() //checked matches cerberus output
|
||||
{
|
||||
return ( ( level.timelimit * 60 ) * 1000 ) - gettimepassed();
|
||||
}
|
||||
|
||||
registerpostroundevent( eventfunc )
|
||||
registerpostroundevent( eventfunc ) //checked matches cerberus output
|
||||
{
|
||||
if ( !isDefined( level.postroundevents ) )
|
||||
{
|
||||
@ -109,29 +108,25 @@ registerpostroundevent( eventfunc )
|
||||
level.postroundevents[ level.postroundevents.size ] = eventfunc;
|
||||
}
|
||||
|
||||
executepostroundevents()
|
||||
executepostroundevents() //checked changed to match cerberus output
|
||||
{
|
||||
if ( !isDefined( level.postroundevents ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
i = 0;
|
||||
while ( i < level.postroundevents.size )
|
||||
for ( i = 0; i < level.postroundevents.size; i++ )
|
||||
{
|
||||
[[ level.postroundevents[ i ] ]]();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
getvalueinrange( value, minvalue, maxvalue )
|
||||
getvalueinrange( value, minvalue, maxvalue ) //checked changed to match cerberus output
|
||||
{
|
||||
if ( value > maxvalue )
|
||||
{
|
||||
return maxvalue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( value < minvalue )
|
||||
else if ( value < minvalue )
|
||||
{
|
||||
return minvalue;
|
||||
}
|
||||
@ -139,68 +134,60 @@ getvalueinrange( value, minvalue, maxvalue )
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assertproperplacement()
|
||||
assertproperplacement() //checked partially changed to match cerberus output changed at own discretion
|
||||
{
|
||||
/*
|
||||
/#
|
||||
numplayers = level.placement[ "all" ].size;
|
||||
if ( level.teambased )
|
||||
{
|
||||
i = 0;
|
||||
while ( i < ( numplayers - 1 ) )
|
||||
for ( i = 0; i < numplayers - 1; i++ )
|
||||
{
|
||||
if ( level.placement[ "all" ][ i ].score < level.placement[ "all" ][ i + 1 ].score )
|
||||
{
|
||||
println( "^1Placement array:" );
|
||||
i = 0;
|
||||
while ( i < numplayers )
|
||||
for ( i = 0; i < numplayers; i++ )
|
||||
{
|
||||
player = level.placement[ "all" ][ i ];
|
||||
println( "^1" + i + ". " + player.name + ": " + player.score );
|
||||
i++;
|
||||
}
|
||||
assertmsg( "Placement array was not properly sorted" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else i = 0;
|
||||
while ( i < ( numplayers - 1 ) )
|
||||
for ( i = 0; i < numplayers - 1; i++ )
|
||||
{
|
||||
if ( level.placement[ "all" ][ i ].pointstowin < level.placement[ "all" ][ i + 1 ].pointstowin )
|
||||
{
|
||||
println( "^1Placement array:" );
|
||||
i = 0;
|
||||
while ( i < numplayers )
|
||||
for ( i = 0; i < numplayers; i++ )
|
||||
{
|
||||
player = level.placement[ "all" ][ i ];
|
||||
println( "^1" + i + ". " + player.name + ": " + player.pointstowin );
|
||||
i++;
|
||||
}
|
||||
assertmsg( "Placement array was not properly sorted" );
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
#/
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
isvalidclass( class )
|
||||
isvalidclass( class ) //checked matches cerberus output
|
||||
{
|
||||
if ( level.oldschool || sessionmodeiszombiesgame() )
|
||||
{
|
||||
/*
|
||||
/#
|
||||
assert( !isDefined( class ) );
|
||||
#/
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
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( "stop_ticking" );
|
||||
@ -226,28 +213,28 @@ playtickingsound( gametype_tick_sound )
|
||||
else if ( time > 4 )
|
||||
{
|
||||
time -= 0,5;
|
||||
wait 0,5;
|
||||
wait 0.5;
|
||||
}
|
||||
else if ( time > 1 )
|
||||
{
|
||||
time -= 0,4;
|
||||
wait 0,4;
|
||||
wait 0.4;
|
||||
}
|
||||
else
|
||||
{
|
||||
time -= 0,3;
|
||||
wait 0,3;
|
||||
wait 0.3;
|
||||
}
|
||||
maps/mp/gametypes/_hostmigration::waittillhostmigrationdone();
|
||||
}
|
||||
}
|
||||
|
||||
stoptickingsound()
|
||||
stoptickingsound() //checked matches cerberus output
|
||||
{
|
||||
self notify( "stop_ticking" );
|
||||
}
|
||||
|
||||
gametimer()
|
||||
gametimer() //checked changed to match cerberus output
|
||||
{
|
||||
level endon( "game_ended" );
|
||||
level waittill( "prematch_over" );
|
||||
@ -256,6 +243,7 @@ gametimer()
|
||||
if ( isDefined( game[ "roundMillisecondsAlreadyPassed" ] ) )
|
||||
{
|
||||
level.starttime -= game[ "roundMillisecondsAlreadyPassed" ];
|
||||
game["roundMillisecondsAlreadyPassed"] = undefined;
|
||||
}
|
||||
prevtime = getTime();
|
||||
while ( game[ "state" ] == "playing" )
|
||||
@ -269,7 +257,7 @@ gametimer()
|
||||
}
|
||||
}
|
||||
|
||||
gettimepassed()
|
||||
gettimepassed() //checked matches cerberus output
|
||||
{
|
||||
if ( !isDefined( level.starttime ) )
|
||||
{
|
||||
@ -285,7 +273,7 @@ gettimepassed()
|
||||
}
|
||||
}
|
||||
|
||||
pausetimer()
|
||||
pausetimer() //checked matches cerberus output
|
||||
{
|
||||
if ( level.timerstopped )
|
||||
{
|
||||
@ -295,7 +283,7 @@ pausetimer()
|
||||
level.timerpausetime = getTime();
|
||||
}
|
||||
|
||||
resumetimer()
|
||||
resumetimer() //checked matches cerberus output
|
||||
{
|
||||
if ( !level.timerstopped )
|
||||
{
|
||||
@ -305,14 +293,16 @@ resumetimer()
|
||||
level.discardtime += getTime() - level.timerpausetime;
|
||||
}
|
||||
|
||||
getscoreremaining( team )
|
||||
getscoreremaining( team ) //checked matches cerberus output
|
||||
{
|
||||
/*
|
||||
/#
|
||||
if ( !isplayer( self ) )
|
||||
{
|
||||
assert( isDefined( team ) );
|
||||
}
|
||||
#/
|
||||
*/
|
||||
scorelimit = level.scorelimit;
|
||||
if ( isplayer( self ) )
|
||||
{
|
||||
@ -324,7 +314,7 @@ getscoreremaining( team )
|
||||
}
|
||||
}
|
||||
|
||||
getteamscoreforround( team )
|
||||
getteamscoreforround( team ) //checked matches cerberus output
|
||||
{
|
||||
if ( level.roundscorecarry && isDefined( game[ "lastroundscore" ][ team ] ) )
|
||||
{
|
||||
@ -333,17 +323,19 @@ getteamscoreforround( team )
|
||||
return getteamscore( team );
|
||||
}
|
||||
|
||||
getscoreperminute( team )
|
||||
getscoreperminute( team ) //checked matches cerberus output
|
||||
{
|
||||
/*
|
||||
/#
|
||||
if ( !isplayer( self ) )
|
||||
{
|
||||
assert( isDefined( team ) );
|
||||
}
|
||||
#/
|
||||
*/
|
||||
scorelimit = level.scorelimit;
|
||||
timelimit = level.timelimit;
|
||||
minutespassed = ( gettimepassed() / 60000 ) + 0,0001;
|
||||
minutespassed = ( gettimepassed() / 60000 ) + 0.0001;
|
||||
if ( isplayer( self ) )
|
||||
{
|
||||
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 ) )
|
||||
{
|
||||
assert( isDefined( team ) );
|
||||
}
|
||||
#/
|
||||
*/
|
||||
scoreperminute = self getscoreperminute( team );
|
||||
scoreremaining = self getscoreremaining( team );
|
||||
if ( !scoreperminute )
|
||||
@ -371,36 +365,38 @@ getestimatedtimeuntilscorelimit( team )
|
||||
return scoreremaining / scoreperminute;
|
||||
}
|
||||
|
||||
rumbler()
|
||||
rumbler() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
while ( 1 )
|
||||
{
|
||||
wait 0,1;
|
||||
wait 0.1;
|
||||
self playrumbleonentity( "damage_heavy" );
|
||||
}
|
||||
}
|
||||
|
||||
waitfortimeornotify( time, notifyname )
|
||||
waitfortimeornotify( time, notifyname ) //checked matches cerberus output
|
||||
{
|
||||
self endon( notifyname );
|
||||
wait time;
|
||||
}
|
||||
|
||||
waitfortimeornotifynoartillery( time, notifyname )
|
||||
waitfortimeornotifynoartillery( time, notifyname ) //checked matches cerberus output
|
||||
{
|
||||
self endon( notifyname );
|
||||
wait time;
|
||||
while ( isDefined( 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" )
|
||||
{
|
||||
@ -419,7 +415,7 @@ isheadshot( sweapon, shitloc, smeansofdeath, einflictor )
|
||||
}
|
||||
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;
|
||||
}
|
||||
@ -427,7 +423,7 @@ isheadshot( sweapon, shitloc, smeansofdeath, einflictor )
|
||||
return 1;
|
||||
}
|
||||
|
||||
gethitlocheight( shitloc )
|
||||
gethitlocheight( shitloc ) //checked matches cerberus output
|
||||
{
|
||||
switch( shitloc )
|
||||
{
|
||||
@ -459,34 +455,32 @@ gethitlocheight( shitloc )
|
||||
return 48;
|
||||
}
|
||||
|
||||
debugline( start, end )
|
||||
debugline( start, end ) //checked changed to match cerberus output
|
||||
{
|
||||
/*
|
||||
/#
|
||||
i = 0;
|
||||
while ( i < 50 )
|
||||
for ( i = 0; i < 50; i++ )
|
||||
{
|
||||
line( start, end );
|
||||
wait 0,05;
|
||||
i++;
|
||||
wait 0.05;
|
||||
#/
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
isexcluded( entity, entitylist )
|
||||
isexcluded( entity, entitylist ) //checked changed to match cerberus output
|
||||
{
|
||||
index = 0;
|
||||
while ( index < entitylist.size )
|
||||
for ( index = 0; index < entitylist.size; index++ )
|
||||
{
|
||||
if ( entity == entitylist[ index ] )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
waitfortimeornotifies( desireddelay )
|
||||
waitfortimeornotifies( desireddelay ) //checked matches cerberus output
|
||||
{
|
||||
startedwaiting = getTime();
|
||||
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;
|
||||
if ( isDefined( winner ) )
|
||||
{
|
||||
log_string = ( log_string + ", win: " ) + winner;
|
||||
}
|
||||
_a495 = level.teams;
|
||||
_k495 = getFirstArrayKey( _a495 );
|
||||
while ( isDefined( _k495 ) )
|
||||
foreach ( team in level.teams )
|
||||
{
|
||||
team = _a495[ _k495 ];
|
||||
log_string = ( log_string + ", " ) + team + ": " + game[ "teamScores" ][ team ];
|
||||
_k495 = getNextArrayKey( _a495, _k495 );
|
||||
}
|
||||
logstring( log_string );
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
//checked includes match cerberus output
|
||||
#include maps/mp/gametypes/_damagefeedback;
|
||||
#include maps/mp/gametypes/_globallogic_player;
|
||||
#include maps/mp/gametypes/_weapons;
|
||||
@ -5,7 +6,7 @@
|
||||
#include maps/mp/gametypes/_class;
|
||||
#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 )
|
||||
{
|
||||
@ -38,14 +39,11 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
{
|
||||
sweapon = "explodable_barrel_mp";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
|
||||
else if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
|
||||
{
|
||||
sweapon = "destructible_car_mp";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( idflags & level.idflags_no_protection )
|
||||
{
|
||||
if ( self isvehicleimmunetodamage( idflags, smeansofdeath, sweapon ) )
|
||||
@ -55,9 +53,7 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
if ( smeansofdeath == "MOD_PISTOL_BULLET" || smeansofdeath == "MOD_RIFLE_BULLET" )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( smeansofdeath == "MOD_PROJECTILE" || smeansofdeath == "MOD_GRENADE" )
|
||||
else if ( smeansofdeath == "MOD_PROJECTILE" || smeansofdeath == "MOD_GRENADE" )
|
||||
{
|
||||
idamage *= getvehicleprojectilescalar( sweapon );
|
||||
idamage = int( idamage );
|
||||
@ -66,9 +62,7 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( smeansofdeath == "MOD_GRENADE_SPLASH" )
|
||||
else if ( smeansofdeath == "MOD_GRENADE_SPLASH" )
|
||||
{
|
||||
idamage *= getvehicleunderneathsplashscalar( sweapon );
|
||||
idamage = int( idamage );
|
||||
@ -77,8 +71,6 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
idamage *= level.vehicledamagescalar;
|
||||
idamage = int( idamage );
|
||||
if ( isplayer( eattacker ) )
|
||||
@ -131,9 +123,7 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
self.lastdamagewasfromenemy = 0;
|
||||
self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( level.friendlyfire == 3 )
|
||||
else if ( level.friendlyfire == 3 )
|
||||
{
|
||||
idamage = int( idamage * 0,5 );
|
||||
if ( idamage < 1 )
|
||||
@ -143,7 +133,6 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
self.lastdamagewasfromenemy = 0;
|
||||
self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 0 );
|
||||
}
|
||||
}
|
||||
friendly = 1;
|
||||
}
|
||||
else
|
||||
@ -152,18 +141,13 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !level.teambased && isDefined( self.targetname ) && self.targetname == "rcbomb" )
|
||||
else if ( !level.teambased && isDefined( self.targetname ) && self.targetname == "rcbomb" )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDefined( self.owner ) && isDefined( eattacker ) && self.owner == eattacker )
|
||||
else if ( isDefined( self.owner ) && isDefined( eattacker ) && self.owner == eattacker )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( idamage < 1 )
|
||||
{
|
||||
idamage = 1;
|
||||
@ -185,9 +169,13 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
{
|
||||
attacker_seat = self getoccupantseat( eattacker );
|
||||
}
|
||||
if ( isDefined( eattacker ) )
|
||||
if ( isDefined( eattacker ) && !isDefined( attacker_seat ) )
|
||||
{
|
||||
self.lastdamagewasfromenemy = !isDefined( attacker_seat );
|
||||
self.lastdamagewasfromenemy = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
self.lastdamagewasfromenemy = 0;
|
||||
}
|
||||
self finishvehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, damagefromunderneath, modelindex, partname, 0 );
|
||||
if ( level.gametype == "hack" && sweapon != "emp_grenade_mp" )
|
||||
@ -195,7 +183,6 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
idamage = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( isDefined( eattacker ) && eattacker != self )
|
||||
{
|
||||
if ( maps/mp/gametypes/_globallogic_player::dodamagefeedback( sweapon, einflictor ) )
|
||||
@ -207,12 +194,14 @@ callback_vehicledamage( einflictor, eattacker, idamage, idflags, smeansofdeath,
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getDvarInt( "g_debugDamage" ) )
|
||||
{
|
||||
println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + " hitLoc:" + shitloc );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
if ( 1 )
|
||||
{
|
||||
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 );
|
||||
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;
|
||||
}
|
||||
friendly = 0;
|
||||
if ( idflags & level.idflags_no_protection )
|
||||
if ( !idflags & !level.idflags_no_protection )
|
||||
{
|
||||
if ( self isvehicleimmunetodamage( idflags, smeansofdeath, sweapon ) )
|
||||
{
|
||||
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 );
|
||||
idamage = int( idamage * scalar );
|
||||
@ -325,28 +314,23 @@ callback_vehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fout
|
||||
}
|
||||
}
|
||||
friendly = 1;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !level.hardcoremode && isDefined( self.owner ) && isDefined( eattacker.owner ) && self.owner == eattacker.owner )
|
||||
{
|
||||
return;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( idamage < 1 )
|
||||
else if ( idamage < 1 )
|
||||
{
|
||||
idamage = 1;
|
||||
}
|
||||
self finishvehicleradiusdamage( einflictor, eattacker, idamage, finnerdamage, fouterdamage, idflags, smeansofdeath, sweapon, vpoint, fradius, fconeanglecos, vconedir, psoffsettime );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vehiclecrush()
|
||||
vehiclecrush() //checked matches cerberus output
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
if ( isDefined( level._effect ) && isDefined( level._effect[ "tanksquish" ] ) )
|
||||
@ -356,7 +340,7 @@ vehiclecrush()
|
||||
self playsound( "chr_crunch" );
|
||||
}
|
||||
|
||||
getvehicleprojectilescalar( sweapon )
|
||||
getvehicleprojectilescalar( sweapon ) //checked matches cerberus output
|
||||
{
|
||||
if ( sweapon == "remote_missile_missile_mp" )
|
||||
{
|
||||
@ -368,11 +352,11 @@ getvehicleprojectilescalar( sweapon )
|
||||
}
|
||||
else if ( sweapon == "smaw_mp" )
|
||||
{
|
||||
scale = 0,2;
|
||||
scale = 0.2;
|
||||
}
|
||||
else if ( sweapon == "fhj18_mp" )
|
||||
{
|
||||
scale = 0,2;
|
||||
scale = 0.2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -381,7 +365,7 @@ getvehicleprojectilescalar( sweapon )
|
||||
return scale;
|
||||
}
|
||||
|
||||
getvehicleprojectilesplashscalar( sweapon )
|
||||
getvehicleprojectilesplashscalar( sweapon ) //checked matches cerberus output
|
||||
{
|
||||
if ( sweapon == "remote_missile_missile_mp" )
|
||||
{
|
||||
@ -393,7 +377,7 @@ getvehicleprojectilesplashscalar( sweapon )
|
||||
}
|
||||
else if ( sweapon == "chopper_minigun_mp" )
|
||||
{
|
||||
scale = 0,5;
|
||||
scale = 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -402,7 +386,7 @@ getvehicleprojectilesplashscalar( sweapon )
|
||||
return scale;
|
||||
}
|
||||
|
||||
getvehicleunderneathsplashscalar( sweapon )
|
||||
getvehicleunderneathsplashscalar( sweapon ) //checked matches cerberus output
|
||||
{
|
||||
if ( sweapon == "satchel_charge_mp" )
|
||||
{
|
||||
@ -416,7 +400,7 @@ getvehicleunderneathsplashscalar( sweapon )
|
||||
return scale;
|
||||
}
|
||||
|
||||
getvehiclebulletdamage( sweapon )
|
||||
getvehiclebulletdamage( sweapon ) //checked matches cerberus output
|
||||
{
|
||||
if ( issubstr( sweapon, "ptrs41_" ) )
|
||||
{
|
||||
@ -437,7 +421,7 @@ getvehiclebulletdamage( sweapon )
|
||||
return idamage;
|
||||
}
|
||||
|
||||
allowfriendlyfiredamage( einflictor, eattacker, smeansofdeath, sweapon )
|
||||
allowfriendlyfiredamage( einflictor, eattacker, smeansofdeath, sweapon ) //checked matches cerberus output
|
||||
{
|
||||
if ( isDefined( self.allowfriendlyfiredamageoverride ) )
|
||||
{
|
||||
@ -446,3 +430,4 @@ allowfriendlyfiredamage( einflictor, eattacker, smeansofdeath, sweapon )
|
||||
vehicle = eattacker getvehicleoccupied();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,11 @@ patch_mp/maps/mp/gametypes/_damagefeedback.gsc
|
||||
patch_mp/maps/mp/gametypes/_deathicons.gsc
|
||||
patch_mp/maps/mp/gametypes/_friendicons.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/_hostmigration.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:
|
||||
```
|
||||
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_defaults.gsc
|
||||
patch_mp/maps/mp/gametypes/_globallogic_player.gsc
|
||||
patch_mp/maps/mp/gametypes/_globallogic_score.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_util.gsc
|
||||
patch_mp/maps/mp/gametypes/_spawning.gsc
|
||||
|
@ -1,3 +1,4 @@
|
||||
//checked includes match cerberus output
|
||||
#include maps/mp/_challenges;
|
||||
#include maps/mp/gametypes_zm/_damagefeedback;
|
||||
#include maps/mp/gametypes_zm/_weapons;
|
||||
@ -5,7 +6,7 @@
|
||||
#include maps/mp/gametypes_zm/_globallogic_player;
|
||||
#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" )
|
||||
{
|
||||
@ -43,28 +44,22 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( smeansofdeath == "MOD_HEAD_SHOT" )
|
||||
else if ( smeansofdeath == "MOD_HEAD_SHOT" )
|
||||
{
|
||||
idamage = 150;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( sweapon == "none" && isDefined( einflictor ) )
|
||||
{
|
||||
if ( isDefined( einflictor.targetname ) && einflictor.targetname == "explodable_barrel" )
|
||||
{
|
||||
sweapon = "explodable_barrel_mp";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
|
||||
else if ( isDefined( einflictor.destructible_type ) && issubstr( einflictor.destructible_type, "vehicle_" ) )
|
||||
{
|
||||
sweapon = "destructible_car_mp";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( idflags & level.idflags_no_protection )
|
||||
{
|
||||
if ( isplayer( eattacker ) )
|
||||
@ -91,9 +86,7 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( level.friendlyfire == 3 )
|
||||
else if ( level.friendlyfire == 3 )
|
||||
{
|
||||
idamage = int( idamage * 0,5 );
|
||||
if ( idamage < 1 )
|
||||
@ -103,12 +96,9 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
self.lastdamagewasfromenemy = 0;
|
||||
self finishactordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex );
|
||||
}
|
||||
}
|
||||
friendly = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode )
|
||||
else if ( isDefined( eattacker ) && isDefined( self.script_owner ) && eattacker == self.script_owner && !level.hardcoremode )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -122,7 +112,7 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
}
|
||||
if ( isDefined( eattacker ) && isplayer( eattacker ) && isDefined( sweapon ) && !issubstr( smeansofdeath, "MOD_MELEE" ) )
|
||||
{
|
||||
eattacker thread maps/mp/gametypes_zm/_weapons::checkhit( sweapon );
|
||||
eattacker thread maps/mp/gametypes/_weapons::checkhit( sweapon );
|
||||
}
|
||||
if ( issubstr( smeansofdeath, "MOD_GRENADE" ) && isDefined( einflictor ) && isDefined( einflictor.iscooked ) )
|
||||
{
|
||||
@ -132,15 +122,18 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
{
|
||||
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 ( 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 )
|
||||
{
|
||||
@ -149,12 +142,14 @@ callback_actordamage( einflictor, eattacker, idamage, idflags, smeansofdeath, sw
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
/#
|
||||
if ( getDvarInt( "g_debugDamage" ) )
|
||||
{
|
||||
println( "actor:" + self getentitynumber() + " health:" + self.health + " attacker:" + eattacker.clientid + " inflictor is player:" + isplayer( einflictor ) + " damage:" + idamage + shitloc + ";" + boneindex + "\n" );
|
||||
#/
|
||||
}
|
||||
*/
|
||||
if ( 1 )
|
||||
{
|
||||
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" )
|
||||
{
|
||||
@ -205,3 +200,5 @@ callback_actorkilled( einflictor, attacker, idamage, smeansofdeath, sweapon, vdi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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/_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/_hostmigration.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:
|
||||
```
|
||||
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_defaults.gsc
|
||||
patch_zm/maps/mp/gametypes_zm/_globallogic_player.gsc
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
### 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/zm_nuked.gsc
|
||||
```
|
||||
### The following scripts compile and run successfully with minor errors:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user