initial
commit
355f6a6ebc
|
@ -0,0 +1,5 @@
|
||||||
|
z_svr_bots.iwd
|
||||||
|
bots.txt
|
||||||
|
scriptdata
|
||||||
|
logs
|
||||||
|
bots.txt
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,587 @@
|
||||||
|
#include maps\mp\gametypes\_hud_util;
|
||||||
|
#include maps\mp\_utility;
|
||||||
|
#include common_scripts\utility;
|
||||||
|
|
||||||
|
streakInit()
|
||||||
|
{
|
||||||
|
precacheShader("cardtitle_horsemen_war");
|
||||||
|
precacheShader("cardtitle_roll_hard_six");
|
||||||
|
|
||||||
|
level thread Connect();
|
||||||
|
level.strIcon["Devastate"] = "cardicon_award_jets";
|
||||||
|
level.strIcon["Suicide Bomber"] = "cardicon_skull_black";
|
||||||
|
level.strIcon["Adrenaline"] = "specialty_marathon_upgrade";
|
||||||
|
level.strIcon["Napalm Strike"] = "cardicon_aircraft_01";
|
||||||
|
level.strIcon["Death Vision"] = "cardicon_binoculars_1";
|
||||||
|
level.strIcon["Exploding Bullets"] = "cardicon_doubletap";
|
||||||
|
level.strIcon["Area of Effect"] = "cardicon_skullnbones";
|
||||||
|
|
||||||
|
level.strSound["Devastate"] = "ac130";
|
||||||
|
level.strSound["Suicide Bomber"] = "predator_missile";
|
||||||
|
level.strSound["Adrenaline"] = "emp";
|
||||||
|
level.strSound["Napalm Strike"] = "stealth_airstrike";
|
||||||
|
level.strSound["Death Vision"] = "nuke";
|
||||||
|
level.strSound["Exploding Bullets"] = "airdrop_sentry";
|
||||||
|
level.strSound["Area of Effect"] = "nuke";
|
||||||
|
|
||||||
|
|
||||||
|
level.strExp["Death Vision"] = 100;
|
||||||
|
level.strExp["Suicide Bomber"] = 200;
|
||||||
|
level.strExp["Adrenaline"] = 250;
|
||||||
|
level.strExp["Devastate"] = 300;
|
||||||
|
level.strExp["Exploding Bullets"] = 500;
|
||||||
|
level.strExp["Napalm Strike"] = 1000;
|
||||||
|
level.strExp["Area of Effect"] = 5000;
|
||||||
|
|
||||||
|
level.pops = (0.5,1,0);
|
||||||
|
//self thread JoinTeam();
|
||||||
|
|
||||||
|
precacheShader(level.strIcon["Devastate"]);
|
||||||
|
precacheShader(level.strIcon["Suicide Bomber"]);
|
||||||
|
precacheShader(level.strIcon["Adrenaline"]);
|
||||||
|
precacheShader(level.strIcon["Napalm Strike"]);
|
||||||
|
precacheShader(level.strIcon["Death Vision"]);
|
||||||
|
precacheShader(level.strIcon["Exploding Bullets"]);
|
||||||
|
precacheShader(level.strIcon["Area of Effect"]);
|
||||||
|
|
||||||
|
setDvar( "scr_airdrop_ammo", 0 );
|
||||||
|
setDvar( "scr_airdrop_uav", 0 );
|
||||||
|
setDvar( "scr_airdrop_counter_uav", 0 );
|
||||||
|
setDvar( "scr_airdrop_sentry", 0 );
|
||||||
|
setDvar( "scr_airdrop_predator_missile", 0 );
|
||||||
|
setDvar( "scr_airdrop_precision_airstrike", 0 );
|
||||||
|
setDvar( "scr_airdrop_harrier_airstrike", 0 );
|
||||||
|
setDvar( "scr_airdrop_helicopter", 0 );
|
||||||
|
setDvar( "scr_airdrop_helicopter_flares", 0 );
|
||||||
|
setDvar( "scr_airdrop_stealth_airstrike", 0 );
|
||||||
|
setDvar( "scr_airdrop_helicopter_minigun", 0 );
|
||||||
|
setDvar( "scr_airdrop_ac130", 0 );
|
||||||
|
setDvar( "scr_airdrop_emp", 0 );
|
||||||
|
setDvar( "scr_airdrop_nuke", 0 );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Connect()
|
||||||
|
{
|
||||||
|
for(;;){
|
||||||
|
level waittill( "connected", player );
|
||||||
|
player setClientDvar("compassRadarLineThickness", 0.001);
|
||||||
|
player setClientDvar("compassRadarPingFadeTime", 0.1);
|
||||||
|
player setClientDvar("compassRadarUpdateTime", 9999);
|
||||||
|
player thread Spawned();
|
||||||
|
|
||||||
|
|
||||||
|
//showExistence = player createFontString( "arial", 1 );
|
||||||
|
//showExistence setPoint( "LEFT", "TOP", -70, 41 );
|
||||||
|
//showExistence setText( "cod.chroma.games" );
|
||||||
|
//showExistence.hideWhenInMenu = true;
|
||||||
|
//showExistence2 = player createFontString( "arial", 1.3 );
|
||||||
|
//showExistence2 setPoint( "LEFT", "TOP", -70, 32 );
|
||||||
|
//showExistence2 setText( "CUSTOM KILLSTREAKS" );
|
||||||
|
//showExistence2.hideWhenInMenu = true;
|
||||||
|
//showExistence3 = player createFontString( "arial", 2 );
|
||||||
|
//showExistence3 setPoint( "CENTER", "TOP", -10, 8 );
|
||||||
|
//showExistence3 setText( "AZUMIKKEL'S" );
|
||||||
|
//showExistence3.hideWhenInMenu = true;
|
||||||
|
|
||||||
|
//RTDExistence = player createFontString( "arial", 1.3 );
|
||||||
|
//RTDExistence setPoint( "LEFT", "TOP", -70, 22 );
|
||||||
|
//RTDExistence setText( "ROLL THE DICE 3.2" );
|
||||||
|
//RTDExistence.hideWhenInMenu = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spawned()
|
||||||
|
{
|
||||||
|
self.killcount = self.pers["kills"];
|
||||||
|
self.numberofstreaks = 0;
|
||||||
|
self.usingstreak = 0;
|
||||||
|
self.tips = 0;
|
||||||
|
self.AoEactive = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//streakIcon = createIcon( "cardtitle_roll_hard_six", 155, 38 );
|
||||||
|
//streakIcon setPoint( "CENTER", "TOP", 0, 25 );
|
||||||
|
//streakIcon.hideWhenInMenu = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for(;;){
|
||||||
|
self waittill("spawned_player");
|
||||||
|
self setClientDvar("cg_weaponCycleDelay", 0);
|
||||||
|
if(self.numberofstreaks)
|
||||||
|
self thread giveStreak(self.streaknumber[self.numberofstreaks], self.durationnumber[self.numberofstreaks], 0);
|
||||||
|
self thread streakDealer();
|
||||||
|
self maps\mp\gametypes\_class::setKillstreaks( "none", "none", "none" );
|
||||||
|
if(self isHost())
|
||||||
|
self thread Test();}
|
||||||
|
}
|
||||||
|
|
||||||
|
Test()
|
||||||
|
{
|
||||||
|
for(;;){
|
||||||
|
self waittill("3");
|
||||||
|
self thread dealStreak("Exploding Bullets");}
|
||||||
|
}
|
||||||
|
|
||||||
|
streakDealer()
|
||||||
|
{
|
||||||
|
self endon("death");
|
||||||
|
|
||||||
|
self.startscore = self.pers["kills"];
|
||||||
|
self.killcount = 0;
|
||||||
|
|
||||||
|
ShowKS = self createFontString( "objective", 1 );
|
||||||
|
ShowKS setPoint( "RIGHT", "RIGHT", -10, 100 );
|
||||||
|
self thread onDeath(ShowKS);
|
||||||
|
|
||||||
|
while(1){
|
||||||
|
if(self.killcount != self.pers["kills"] - self.startscore){
|
||||||
|
self.killcount = self.pers["kills"] - self.startscore;
|
||||||
|
|
||||||
|
ShowKS setText( "Current Killstreak: " +self.killcount );
|
||||||
|
|
||||||
|
switch(self.killcount){
|
||||||
|
case 3: self thread dealStreak("Death Vision", 20); break;
|
||||||
|
case 4: self maps\mp\gametypes\_hud_message::killstreakSplashNotify( "airdrop", undefined, "pickup" );
|
||||||
|
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", true, true ); break;
|
||||||
|
case 5: self thread dealStreak("Suicide Bomber"); break;
|
||||||
|
case 6: self thread dealStreak("Adrenaline", 40); break;
|
||||||
|
case 8: self thread dealStreak("Devastate"); break;
|
||||||
|
case 9: self thread dealStreak("Exploding Bullets", 30); break;
|
||||||
|
case 11: self thread dealStreak("Napalm Strike"); break;
|
||||||
|
case 15: self thread dealStreak("Area of Effect", 30); break;}}
|
||||||
|
|
||||||
|
wait 0.05;}
|
||||||
|
}
|
||||||
|
|
||||||
|
dealStreak(strName, duration, message)
|
||||||
|
{
|
||||||
|
self notify("newstreak");
|
||||||
|
self.numberofstreaks += 1;
|
||||||
|
self.streaknumber[self.numberofstreaks] = strName;
|
||||||
|
if(isDefined(duration))
|
||||||
|
self.durationnumber[self.numberofstreaks] = duration;
|
||||||
|
self giveStreak(strName, duration, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
giveStreak(strName, duration, message)
|
||||||
|
{
|
||||||
|
self endon("newstreak");
|
||||||
|
self endon("death");
|
||||||
|
self notify("destroyIcon");
|
||||||
|
|
||||||
|
self notifyOnPlayercommand("K5", "+actionslot 2");
|
||||||
|
|
||||||
|
streakIcon = createIcon( level.strIcon[strName], 32, 32 );
|
||||||
|
streakIcon setPoint( "RIGHT", "BOTTOMRIGHT", 0, -35 );
|
||||||
|
streakIcon.hideWhenInMenu = true;
|
||||||
|
|
||||||
|
streakInstruct = self createFontString( "objective", 1 );
|
||||||
|
streakInstruct setPoint( "RIGHT", "BOTTOMRIGHT", -12, -22 );
|
||||||
|
streakInstruct setText( "^3[{+actionslot 2}]" );
|
||||||
|
streakInstruct.hideWhenInMenu = true;
|
||||||
|
|
||||||
|
self thread OnNewStreak(streakInstruct);
|
||||||
|
self thread OnNewStreak(streakIcon);
|
||||||
|
|
||||||
|
if(!isDefined(message)){
|
||||||
|
notifyData = spawnstruct();
|
||||||
|
notifyData.iconName = level.strIcon[strName];
|
||||||
|
notifyData.titleText = strName;
|
||||||
|
notifyData.notifyText = "Press [{+actionslot 2}] to activate!";
|
||||||
|
notifyData.glowColor = (0.8, 0.8, 0.3);
|
||||||
|
notifyData.glowAlpha = 1;
|
||||||
|
notifyData.sound = maps\mp\killstreaks\_killstreaks::getKillstreakSound( level.strSound[strName] );
|
||||||
|
self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
|
||||||
|
self thread OnNewStreak(notifyData);}
|
||||||
|
|
||||||
|
self waittill("K5");
|
||||||
|
self notify("destroyIcon");
|
||||||
|
|
||||||
|
|
||||||
|
if(strName == "Death Vision"){
|
||||||
|
self thread triggerC4(strName);
|
||||||
|
self waittill("continuestreak");
|
||||||
|
self thread maps\mp\gametypes\_rank::scorePopup( 100, 0, level.pops, 0 );
|
||||||
|
self notify("refreshthermal");
|
||||||
|
self VisionSetThermalForPlayer( "cobra_sunset3", 1 );
|
||||||
|
self thread keepThermal(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(strName == "Suicide Bomber"){
|
||||||
|
self thread triggerC4(strName);
|
||||||
|
self waittill("continuestreak");
|
||||||
|
self thread maps\mp\gametypes\_rank::scorePopup( 200, 0, level.pops, 0 );
|
||||||
|
self thread makeSuicide();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strName == "Adrenaline"){
|
||||||
|
self thread triggerC4(strName);
|
||||||
|
self waittill("continuestreak");
|
||||||
|
self thread maps\mp\gametypes\_rank::scorePopup( 300, 0, level.pops, 0 );
|
||||||
|
self notify("refreshspeed");
|
||||||
|
self thread keepSpeed(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strName == "Devastate"){
|
||||||
|
self thread triggerLaptop(strName);
|
||||||
|
self.DevastateXP = 500;
|
||||||
|
wait 0.80;
|
||||||
|
self thread makeDevastate();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strName == "Exploding Bullets"){
|
||||||
|
self thread triggerC4(strName);
|
||||||
|
self waittill("continuestreak");
|
||||||
|
self thread maps\mp\gametypes\_rank::scorePopup( 1000, 0, level.pops, 0 );
|
||||||
|
self notify("refreshbullets");
|
||||||
|
self thread keepBullets(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strName == "Napalm Strike"){
|
||||||
|
self thread triggerLaptop(strName);
|
||||||
|
self.bomberXP = 2500;
|
||||||
|
wait 0.80;
|
||||||
|
self thread makeBomber();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(strName == "Area of Effect"){
|
||||||
|
self thread triggerC4(strName);
|
||||||
|
self waittill("continuestreak");
|
||||||
|
self thread maps\mp\gametypes\_rank::scorePopup( 5000, 0, level.pops, 0 );
|
||||||
|
self notify("refreshAoE");
|
||||||
|
self thread keepAoE(duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(strName != "Devastate")
|
||||||
|
if(strName != "Napalm Strike")
|
||||||
|
self iPrintlnBold(strName +" activated");
|
||||||
|
|
||||||
|
self.numberofstreaks -= 1;
|
||||||
|
if(self.numberofstreaks > 0){
|
||||||
|
wait 1;
|
||||||
|
self thread giveStreak(self.streaknumber[self.numberofstreaks], self.durationnumber[self.numberofstreaks], 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerC4(strName)
|
||||||
|
{
|
||||||
|
self endon("death");
|
||||||
|
self notifyOnPlayerCommand("fire", "+attack");
|
||||||
|
beforehandweapon = self getCurrentWeapon();
|
||||||
|
beforehandnade = self getCurrentOffhand();
|
||||||
|
beforehandnadeammo = self getWeaponAmmoClip(beforehandnade);
|
||||||
|
self takeWeapon(beforehandnade);
|
||||||
|
self giveWeapon("killstreak_uav_mp");
|
||||||
|
self setWeaponAmmoClip("killstreak_uav_mp", 0);
|
||||||
|
self switchToWeapon("killstreak_uav_mp");
|
||||||
|
self setClientDvar("cg_weaponCycleDelay", 999999999);
|
||||||
|
self waittill("fire");
|
||||||
|
self setClientDvar("cg_weaponCycleDelay", 0);
|
||||||
|
self playLocalSound( "weap_c4detpack_trigger_plr" );
|
||||||
|
self notify("continuestreak");
|
||||||
|
wait 0.10;
|
||||||
|
self switchToWeapon(beforehandweapon);
|
||||||
|
wait 0.20;
|
||||||
|
self takeWeapon("killstreak_uav_mp");
|
||||||
|
self giveWeapon(beforehandnade);
|
||||||
|
self setWeaponAmmoClip(beforehandnade, beforehandnadeammo);
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerLaptop(strName)
|
||||||
|
{
|
||||||
|
self endon("death");
|
||||||
|
self endon("esckey");
|
||||||
|
|
||||||
|
self.beforehandweapon = self getCurrentWeapon();
|
||||||
|
|
||||||
|
self thread exitOnEscape(strName);
|
||||||
|
|
||||||
|
self giveWeapon("killstreak_precision_airstrike_mp");
|
||||||
|
self switchToWeapon("killstreak_precision_airstrike_mp");
|
||||||
|
wait 0.20;
|
||||||
|
self waittill("confirm_location");
|
||||||
|
self switchToWeapon(self.beforehandweapon);
|
||||||
|
wait 0.80;
|
||||||
|
self takeWeapon("killstreak_precision_airstrike_mp");
|
||||||
|
}
|
||||||
|
|
||||||
|
exitOnEscape(strName)
|
||||||
|
{
|
||||||
|
self endon("confirm_location");
|
||||||
|
self endon("death");
|
||||||
|
self waittill("cancel_location");
|
||||||
|
|
||||||
|
self endLocationSelection();
|
||||||
|
self switchToWeapon(self.beforehandweapon);
|
||||||
|
wait 0.80;
|
||||||
|
self takeWeapon("killstreak_precision_airstrike_mp");
|
||||||
|
self thread dealStreak(strName, undefined, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
makeSuicide()
|
||||||
|
{
|
||||||
|
self waittill("death");
|
||||||
|
MagicBullet( "ac130_105mm_mp", self.origin, self.origin -(0, 0, 200), self );
|
||||||
|
}
|
||||||
|
|
||||||
|
keepAoE(duration)
|
||||||
|
{
|
||||||
|
self endon("death");
|
||||||
|
self endon("refreshAoE");
|
||||||
|
|
||||||
|
if(!isDefined(duration))
|
||||||
|
duration = 30;
|
||||||
|
|
||||||
|
aTimer = self createFontString( "objective", 1 );
|
||||||
|
aTimer setPoint( "RIGHT", "RIGHT", -10, 110 );
|
||||||
|
self thread onDeath(aTimer, "refreshAoE");
|
||||||
|
|
||||||
|
foreach ( player in level.players ){
|
||||||
|
if(player.name != self.name)
|
||||||
|
player iPrintLnBold("^1" +self.name +" has Area of Effect!");
|
||||||
|
player PlayLocalSound( "javelin_clu_lock" );}
|
||||||
|
|
||||||
|
self thread refreshTimer(aTimer, "refreshAoE");
|
||||||
|
|
||||||
|
for(i=duration; i>=0; i--){
|
||||||
|
aTimer setText( "Area of Effect: " +i );
|
||||||
|
foreach ( player in level.players )
|
||||||
|
player VisionSetNakedForPlayer( "cheat_contrast", 3 );
|
||||||
|
self.AoEactive = 1;
|
||||||
|
wait 0.50; RadiusDamage( self.origin +(0, 0, 55), 99999, 99999, 999, self );
|
||||||
|
wait 0.50; RadiusDamage( self.origin, 99999, 99999, 999, self );
|
||||||
|
RadiusDamage( self.origin +(0, 0, 55), 99999, 99999, 999, self );
|
||||||
|
RadiusDamage( self.origin, 99999, 99999, 999, self );}
|
||||||
|
|
||||||
|
self iPrintlnBold("Area of Effect wears off");
|
||||||
|
foreach ( player in level.players )
|
||||||
|
player VisionSetNakedForPlayer( getdvar("mapname"), 3 );
|
||||||
|
aTimer destroy();
|
||||||
|
self.AoEactive = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
keepBullets(duration)
|
||||||
|
{
|
||||||
|
self endon("death");
|
||||||
|
self endon("refreshbullets");
|
||||||
|
|
||||||
|
if(!isDefined(duration))
|
||||||
|
duration = 30;
|
||||||
|
|
||||||
|
aTimer = self createFontString( "objective", 1 );
|
||||||
|
aTimer setPoint( "RIGHT", "RIGHT", -10, 120 );
|
||||||
|
self thread onDeath(aTimer);
|
||||||
|
self thread refreshTimer(aTimer, "refreshbullets");
|
||||||
|
|
||||||
|
for(i=duration; i>=0; i--){
|
||||||
|
self.tips = 1;
|
||||||
|
aTimer setText( "Exploding Bullets: " +i );
|
||||||
|
wait 1;}
|
||||||
|
self iPrintlnBold("Exploding Bullets wear off");
|
||||||
|
self.tips = 0;
|
||||||
|
aTimer destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
keepSpeed(duration)
|
||||||
|
{
|
||||||
|
self endon("death");
|
||||||
|
self endon("refreshspeed");
|
||||||
|
|
||||||
|
if(!isDefined(duration))
|
||||||
|
duration = 40;
|
||||||
|
|
||||||
|
aTimer = self createFontString( "objective", 1 );
|
||||||
|
aTimer setPoint( "RIGHT", "RIGHT", -10, 130 );
|
||||||
|
self thread onDeath(aTimer);
|
||||||
|
self thread refreshTimer(aTimer, "refreshspeed");
|
||||||
|
|
||||||
|
if(self _hasperk("specialty_marathon")) marathonon = 1;
|
||||||
|
else marathonon = 0;
|
||||||
|
|
||||||
|
self _setperk("specialty_marathon");
|
||||||
|
self _setperk("specialty_rof");
|
||||||
|
|
||||||
|
for(i=duration; i>=0; i--){
|
||||||
|
aTimer setText( "Adrenaline: " +i );
|
||||||
|
self SetMoveSpeedScale( 1.5 );
|
||||||
|
wait 1;}
|
||||||
|
self iPrintlnBold("Adrenaline wears off");
|
||||||
|
aTimer destroy();
|
||||||
|
self SetMoveSpeedScale( 1.0 );
|
||||||
|
self _unsetperk("specialty_rof");
|
||||||
|
if(!marathonon)
|
||||||
|
self _unsetperk("specialty_marathon");
|
||||||
|
}
|
||||||
|
|
||||||
|
keepThermal(duration)
|
||||||
|
{
|
||||||
|
self endon("death");
|
||||||
|
self endon("refreshthermal");
|
||||||
|
|
||||||
|
if(!isDefined(duration))
|
||||||
|
duration = 20;
|
||||||
|
|
||||||
|
aTimer = self createFontString( "objective", 1 );
|
||||||
|
aTimer setPoint( "RIGHT", "RIGHT", -10, 140 );
|
||||||
|
self thread onDeath(aTimer);
|
||||||
|
self thread refreshTimer(aTimer, "refreshthermal");
|
||||||
|
self _setperk("specialty_thermal");
|
||||||
|
|
||||||
|
for(i=duration; i>=0; i--){
|
||||||
|
aTimer setText( "Thermal: " +i );
|
||||||
|
wait 1;}
|
||||||
|
self _unsetperk("specialty_thermal");
|
||||||
|
aTimer destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshTimer(HE, eventname)
|
||||||
|
{
|
||||||
|
self waittill(eventname);
|
||||||
|
HE destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
OnNewStreak(HE)
|
||||||
|
{
|
||||||
|
self waittill("destroyIcon");
|
||||||
|
HE destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
onDeath(HE, Additional)
|
||||||
|
{
|
||||||
|
self waittill("death");
|
||||||
|
HE destroy();
|
||||||
|
if(Additional == "AoE")
|
||||||
|
foreach ( player in level.players )
|
||||||
|
player VisionSetNakedForPlayer( getdvar("mapname"), 3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
makeDevastate()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("cancel_location");
|
||||||
|
|
||||||
|
self beginLocationSelection( "map_artillery_selector", true, ( level.mapSize / 5.625 ) );
|
||||||
|
self.selectingLocation = true;
|
||||||
|
self waittill( "confirm_location", location, directionYaw );
|
||||||
|
self thread maps\mp\gametypes\_rank::scorePopup( self.DevastateXP, 0, level.pops, 0 );
|
||||||
|
HeavyArtillery = BulletTrace( location, ( location + ( 0, 0, -100000 ) ), 0, self )[ "position" ];
|
||||||
|
|
||||||
|
self endLocationSelection();
|
||||||
|
self.selectingLocation = undefined;
|
||||||
|
|
||||||
|
HeavyArtillery2 = HeavyArtillery+(0, 0, 8000);
|
||||||
|
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2, HeavyArtillery, self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(100, 0, 0), HeavyArtillery +(100, 0, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(0, 100, 0), HeavyArtillery +(0, 100, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(-100, 0, 0), HeavyArtillery +(-100, 0, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(0, -100, 0), HeavyArtillery +(0, -100, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(66, 66, 0), HeavyArtillery +(66, 66, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(-66, -66, 0), HeavyArtillery +(-66, -66, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(-66, 66, 0), HeavyArtillery +(-66, 66, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", HeavyArtillery2 +(66, -66, 0), HeavyArtillery +(66, -66, 0), self );
|
||||||
|
|
||||||
|
wait 3;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
makeBomber()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("cancel_location");
|
||||||
|
|
||||||
|
self beginLocationSelection( "map_artillery_selector", true, ( level.mapSize / 5.625 ) );
|
||||||
|
self.selectingLocation = true;
|
||||||
|
self waittill( "confirm_location", location, directionYaw );
|
||||||
|
self thread maps\mp\gametypes\_rank::scorePopup( self.bomberXP, 0, level.pops, 0 );
|
||||||
|
|
||||||
|
if ( directionYaw > 25 && directionYaw < 65 ) {
|
||||||
|
y = (sin(directionYaw)*100)*-1;
|
||||||
|
x = (sqrt(10000 - y*y))*-1;
|
||||||
|
}
|
||||||
|
else if ( directionYaw > 115 && directionYaw < 155 ) {
|
||||||
|
y = (sin(directionYaw-90)*100)*-1;
|
||||||
|
x = sqrt(10000 - y*y);
|
||||||
|
}
|
||||||
|
else if ( directionYaw > 205 && directionYaw < 245) {
|
||||||
|
y = (sin(directionYaw-180)*100);
|
||||||
|
x = (sqrt(10000 - y*y));
|
||||||
|
}
|
||||||
|
else if ( directionYaw > 295 && directionYaw < 335 ) {
|
||||||
|
y = sin(directionYaw-270)*100;
|
||||||
|
x = (sqrt(10000 - y*y))*-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else if ( directionYaw >= 65 && directionYaw <= 115 ) {
|
||||||
|
y = -100;
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
|
else if ( directionYaw >= 245 && directionYaw <= 295 ) {
|
||||||
|
y = 100;
|
||||||
|
x = 0;
|
||||||
|
}
|
||||||
|
else if ( directionYaw <= 25 || directionYaw >= 335 ) {
|
||||||
|
y = 0;
|
||||||
|
x = -100;
|
||||||
|
}
|
||||||
|
else if ( directionYaw >= 155 && directionYaw <= 205 ) {
|
||||||
|
y = 0;
|
||||||
|
x = 100;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
y = 0;
|
||||||
|
x = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
self endLocationSelection();
|
||||||
|
self.selectingLocation = undefined;
|
||||||
|
|
||||||
|
self playsound( "veh_b2_dist_loop" );
|
||||||
|
wait 1;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*40, y*40, 8000), location +(x*40, y*40, 0), self ); wait 0.25;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*35, y*35, 8000), location +(x*35, y*35, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*30, y*30, 8000), location +(x*30, y*30, 0), self );
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*35, y*35, 8000), location +(x*35, y*35, 0), self );
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*20, y*20, 8000), location +(x*20, y*20, 0), self ); wait 0.25;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*30, y*30, 8000), location +(x*30, y*30, 0), self ); wait 0.25;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*24, y*25, 8000), location +(x*25, y*25, 0), self ); wait 0.25;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*20, y*20, 8000), location +(x*20, y*20, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*20, y*20, 8000), location +(x*20, y*20, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*14, y*15, 8000), location +(x*15, y*15, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "javelin_mp", location +(x*13, y*13, 4000), location +(x*13, y*13, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*10, y*10, 8000), location +(x*10, y*10, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*9, y*10, 8000), location +(x*10, y*10, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*5, y*4, 8000), location +(x*5, y*5, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*5, y*5, 8000), location +(x*5, y*5, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*0, y*0, 8000), location +(x*0, y*0, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "javelin_mp", location +(x*-35, y*-35, 8000), location +(x*-35, y*-35, 0), self ); wait 0.20;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*0, y*0, 8000), location +(x*0, y*0, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*-5, y*-5, 8000), location +(x*-5, y*-5, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "javelin_mp", location +(x*-7, y*-7, 4000), location +(x*-7, y*-7, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*-10, y*-10, 8000), location +(x*-10, y*-10, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*-10, y*-10, 8000), location +(x*-10, y*-10, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "javelin_mp", location +(x*-15, y*-15, 8000), location +(x*-15, y*-15, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*-15, y*-15, 8000), location +(x*-15, y*-15, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*-20, y*-20, 8000), location +(x*-20, y*-20, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*-20, y*-20, 8000), location +(x*-20, y*-20, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*-25, y*-25, 8000), location +(x*-25, y*-25, 0), self ); wait 0.20;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*-30, y*-30, 8000), location +(x*-30, y*-30, 0), self ); wait 0.20;
|
||||||
|
MagicBullet( "ac130_105mm_mp", location +(x*-40, y*-40, 8000), location +(x*-40, y*-40, 0), self );
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*40, y*40, 8000), location +(x*40, y*40, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*30, y*30, 8000), location +(x*30, y*30, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*20, y*20, 8000), location +(x*20, y*20, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*12, y*10, 8000), location +(x*10, y*10, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*40, y*40, 8000), location +(x*40, y*40, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*31, y*30, 8000), location +(x*30, y*30, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*20, y*20, 8000), location +(x*20, y*20, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*10, y*11, 8000), location +(x*10, y*10, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*40, y*40, 8000), location +(x*40, y*40, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*30, y*32, 8000), location +(x*30, y*30, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*20, y*20, 8000), location +(x*20, y*20, 0), self ); wait 0.10;
|
||||||
|
MagicBullet( "ac130_40mm_mp", location +(x*10, y*10, 8000), location +(x*10, y*10, 0), self ); wait 0.10;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,724 @@
|
||||||
|
#include common_scripts\utility;
|
||||||
|
#include maps\mp\_utility;
|
||||||
|
#include maps\mp\gametypes\_hud_util;
|
||||||
|
|
||||||
|
initTestClients(numberOfTestClients)
|
||||||
|
{
|
||||||
|
self notifyonplayercommand("n", "+actionslot 1");
|
||||||
|
self waittill("n");
|
||||||
|
for(i = 0; i < numberOfTestClients; i++)
|
||||||
|
{
|
||||||
|
ent[i] = addtestclient();
|
||||||
|
|
||||||
|
if (!isdefined(ent[i]))
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
ent[i].pers["isBot"] = true;
|
||||||
|
ent[i] thread initIndividualBot();
|
||||||
|
wait 0.1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
initIndividualBot()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
while(!isdefined(self.pers["team"]))
|
||||||
|
wait .05;
|
||||||
|
self notify("menuresponse", game["menu_team"], "axis");
|
||||||
|
wait 0.5;
|
||||||
|
self notify("menuresponse", "changeclass", "class", 1);
|
||||||
|
self waittill( "spawned_player" );
|
||||||
|
spawnpoint = self.origin;
|
||||||
|
for(;;){
|
||||||
|
self waittill( "spawned_player" );
|
||||||
|
wait 1;
|
||||||
|
self setorigin(spawnpoint);}
|
||||||
|
}
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
level.scoreInfo = [];
|
||||||
|
level.xpScale = getDvarInt( "scr_xpscale" );
|
||||||
|
|
||||||
|
if ( level.xpScale > 4 || level.xpScale < 0)
|
||||||
|
exitLevel( false );
|
||||||
|
|
||||||
|
level.xpScale = min( level.xpScale, 4 );
|
||||||
|
level.xpScale = max( level.xpScale, 0 );
|
||||||
|
|
||||||
|
level.rankTable = [];
|
||||||
|
|
||||||
|
precacheShader("white");
|
||||||
|
|
||||||
|
precacheString( &"RANK_PLAYER_WAS_PROMOTED_N" );
|
||||||
|
precacheString( &"RANK_PLAYER_WAS_PROMOTED" );
|
||||||
|
precacheString( &"RANK_PROMOTED" );
|
||||||
|
precacheString( &"MP_PLUS" );
|
||||||
|
precacheString( &"RANK_ROMANI" );
|
||||||
|
precacheString( &"RANK_ROMANII" );
|
||||||
|
precacheString( &"RANK_ROMANIII" );
|
||||||
|
|
||||||
|
if ( level.teamBased )
|
||||||
|
{
|
||||||
|
registerScoreInfo( "kill", 100 );
|
||||||
|
registerScoreInfo( "headshot", 100 );
|
||||||
|
registerScoreInfo( "assist", 20 );
|
||||||
|
registerScoreInfo( "suicide", 0 );
|
||||||
|
registerScoreInfo( "teamkill", 0 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
registerScoreInfo( "kill", 50 );
|
||||||
|
registerScoreInfo( "headshot", 50 );
|
||||||
|
registerScoreInfo( "assist", 0 );
|
||||||
|
registerScoreInfo( "suicide", 0 );
|
||||||
|
registerScoreInfo( "teamkill", 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
registerScoreInfo( "win", 1 );
|
||||||
|
registerScoreInfo( "loss", 0.5 );
|
||||||
|
registerScoreInfo( "tie", 0.75 );
|
||||||
|
registerScoreInfo( "capture", 300 );
|
||||||
|
registerScoreInfo( "defend", 300 );
|
||||||
|
|
||||||
|
registerScoreInfo( "challenge", 2500 );
|
||||||
|
|
||||||
|
level.maxRank = int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1 ));
|
||||||
|
level.maxPrestige = int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1 ));
|
||||||
|
|
||||||
|
pId = 0;
|
||||||
|
rId = 0;
|
||||||
|
for ( pId = 0; pId <= level.maxPrestige; pId++ )
|
||||||
|
{
|
||||||
|
for ( rId = 0; rId <= level.maxRank; rId++ )
|
||||||
|
precacheShader( tableLookup( "mp/rankIconTable.csv", 0, rId, pId+1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
rankId = 0;
|
||||||
|
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
|
||||||
|
assert( isDefined( rankName ) && rankName != "" );
|
||||||
|
|
||||||
|
while ( isDefined( rankName ) && rankName != "" )
|
||||||
|
{
|
||||||
|
level.rankTable[rankId][1] = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
|
||||||
|
level.rankTable[rankId][2] = tableLookup( "mp/ranktable.csv", 0, rankId, 2 );
|
||||||
|
level.rankTable[rankId][3] = tableLookup( "mp/ranktable.csv", 0, rankId, 3 );
|
||||||
|
level.rankTable[rankId][7] = tableLookup( "mp/ranktable.csv", 0, rankId, 7 );
|
||||||
|
|
||||||
|
precacheString( tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 ) );
|
||||||
|
|
||||||
|
rankId++;
|
||||||
|
rankName = tableLookup( "mp/ranktable.csv", 0, rankId, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
maps\mp\gametypes\_missions::buildChallegeInfo();
|
||||||
|
|
||||||
|
level thread patientZeroWaiter();
|
||||||
|
|
||||||
|
level thread onPlayerConnect();
|
||||||
|
setDvar("testClients_doAttack", "0");
|
||||||
|
}
|
||||||
|
|
||||||
|
patientZeroWaiter()
|
||||||
|
{
|
||||||
|
level endon( "game_ended" );
|
||||||
|
|
||||||
|
while ( !isDefined( level.players ) || !level.players.size )
|
||||||
|
wait ( 0.05 );
|
||||||
|
|
||||||
|
if ( !matchMakingGame() )
|
||||||
|
{
|
||||||
|
if ( (getDvar( "mapname" ) == "mp_rust" && randomInt( 1000 ) == 999) )
|
||||||
|
level.patientZeroName = level.players[0].name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( getDvar( "scr_patientZero" ) != "" )
|
||||||
|
level.patientZeroName = getDvar( "scr_patientZero" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
isRegisteredEvent( type )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.scoreInfo[type] ) )
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
registerScoreInfo( type, value )
|
||||||
|
{
|
||||||
|
level.scoreInfo[type]["value"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getScoreInfoValue( type )
|
||||||
|
{
|
||||||
|
overrideDvar = "scr_" + level.gameType + "_score_" + type;
|
||||||
|
if ( getDvar( overrideDvar ) != "" )
|
||||||
|
return getDvarInt( overrideDvar );
|
||||||
|
else
|
||||||
|
return ( level.scoreInfo[type]["value"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getScoreInfoLabel( type )
|
||||||
|
{
|
||||||
|
return ( level.scoreInfo[type]["label"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getRankInfoMinXP( rankId )
|
||||||
|
{
|
||||||
|
return int(level.rankTable[rankId][2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getRankInfoXPAmt( rankId )
|
||||||
|
{
|
||||||
|
return int(level.rankTable[rankId][3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getRankInfoMaxXp( rankId )
|
||||||
|
{
|
||||||
|
return int(level.rankTable[rankId][7]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getRankInfoFull( rankId )
|
||||||
|
{
|
||||||
|
return tableLookupIString( "mp/ranktable.csv", 0, rankId, 16 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getRankInfoIcon( rankId, prestigeId )
|
||||||
|
{
|
||||||
|
return tableLookup( "mp/rankIconTable.csv", 0, rankId, prestigeId+1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
getRankInfoLevel( rankId )
|
||||||
|
{
|
||||||
|
return int( tableLookup( "mp/ranktable.csv", 0, rankId, 13 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onPlayerConnect()
|
||||||
|
{
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
level waittill( "connected", player );
|
||||||
|
|
||||||
|
/#
|
||||||
|
if ( getDvarInt( "scr_forceSequence" ) )
|
||||||
|
player setPlayerData( "experience", 145499 );
|
||||||
|
#/
|
||||||
|
player.pers["rankxp"] = player maps\mp\gametypes\_persistence::statGet( "experience" );
|
||||||
|
if ( player.pers["rankxp"] < 0 ) // paranoid defensive
|
||||||
|
player.pers["rankxp"] = 0;
|
||||||
|
|
||||||
|
rankId = player getRankForXp( player getRankXP() );
|
||||||
|
player.pers[ "rank" ] = rankId;
|
||||||
|
player.pers[ "participation" ] = 0;
|
||||||
|
|
||||||
|
player.xpUpdateTotal = 0;
|
||||||
|
player.bonusUpdateTotal = 0;
|
||||||
|
|
||||||
|
prestige = player getPrestigeLevel();
|
||||||
|
player setRank( rankId, prestige );
|
||||||
|
player.pers["prestige"] = prestige;
|
||||||
|
|
||||||
|
player.postGamePromotion = false;
|
||||||
|
if ( !isDefined( player.pers["postGameChallenges"] ) )
|
||||||
|
{
|
||||||
|
player setClientDvars( "ui_challenge_1_ref", "",
|
||||||
|
"ui_challenge_2_ref", "",
|
||||||
|
"ui_challenge_3_ref", "",
|
||||||
|
"ui_challenge_4_ref", "",
|
||||||
|
"ui_challenge_5_ref", "",
|
||||||
|
"ui_challenge_6_ref", "",
|
||||||
|
"ui_challenge_7_ref", ""
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
player setClientDvar( "ui_promotion", 0 );
|
||||||
|
|
||||||
|
if ( !isDefined( player.pers["summary"] ) )
|
||||||
|
{
|
||||||
|
player.pers["summary"] = [];
|
||||||
|
player.pers["summary"]["xp"] = 0;
|
||||||
|
player.pers["summary"]["score"] = 0;
|
||||||
|
player.pers["summary"]["challenge"] = 0;
|
||||||
|
player.pers["summary"]["match"] = 0;
|
||||||
|
player.pers["summary"]["misc"] = 0;
|
||||||
|
|
||||||
|
// resetting game summary dvars
|
||||||
|
player setClientDvar( "player_summary_xp", "0" );
|
||||||
|
player setClientDvar( "player_summary_score", "0" );
|
||||||
|
player setClientDvar( "player_summary_challenge", "0" );
|
||||||
|
player setClientDvar( "player_summary_match", "0" );
|
||||||
|
player setClientDvar( "player_summary_misc", "0" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// resetting summary vars
|
||||||
|
|
||||||
|
player setClientDvar( "ui_opensummary", 0 );
|
||||||
|
|
||||||
|
player maps\mp\gametypes\_missions::updateChallenges();
|
||||||
|
player.explosiveKills[0] = 0;
|
||||||
|
player.xpGains = [];
|
||||||
|
|
||||||
|
player.hud_scorePopup = newClientHudElem( player );
|
||||||
|
player.hud_scorePopup.horzAlign = "center";
|
||||||
|
player.hud_scorePopup.vertAlign = "middle";
|
||||||
|
player.hud_scorePopup.alignX = "center";
|
||||||
|
player.hud_scorePopup.alignY = "middle";
|
||||||
|
player.hud_scorePopup.x = 0;
|
||||||
|
if ( level.splitScreen )
|
||||||
|
player.hud_scorePopup.y = -40;
|
||||||
|
else
|
||||||
|
player.hud_scorePopup.y = -60;
|
||||||
|
player.hud_scorePopup.font = "hudbig";
|
||||||
|
player.hud_scorePopup.fontscale = 0.75;
|
||||||
|
player.hud_scorePopup.archived = false;
|
||||||
|
player.hud_scorePopup.color = (0.5,0.5,0.5);
|
||||||
|
player.hud_scorePopup.sort = 10000;
|
||||||
|
player.hud_scorePopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );
|
||||||
|
|
||||||
|
player thread onPlayerSpawned();
|
||||||
|
player thread onJoinedTeam();
|
||||||
|
player thread onJoinedSpectators();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onJoinedTeam()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill( "joined_team" );
|
||||||
|
self thread removeRankHUD();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onJoinedSpectators()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill( "joined_spectators" );
|
||||||
|
self thread removeRankHUD();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onPlayerSpawned()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill("spawned_player");
|
||||||
|
if(self isHost())
|
||||||
|
self thread initTestClients(17);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
roundUp( floatVal )
|
||||||
|
{
|
||||||
|
if ( int( floatVal ) != floatVal )
|
||||||
|
return int( floatVal+1 );
|
||||||
|
else
|
||||||
|
return int( floatVal );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
giveRankXP( type, value )
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
lootType = "none";
|
||||||
|
|
||||||
|
if ( !self rankingEnabled() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( level.teamBased && (!level.teamCount["allies"] || !level.teamCount["axis"]) )
|
||||||
|
return;
|
||||||
|
else if ( !level.teamBased && (level.teamCount["allies"] + level.teamCount["axis"] < 2) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( !isDefined( value ) )
|
||||||
|
value = getScoreInfoValue( type );
|
||||||
|
|
||||||
|
if ( !isDefined( self.xpGains[type] ) )
|
||||||
|
self.xpGains[type] = 0;
|
||||||
|
|
||||||
|
momentumBonus = 0;
|
||||||
|
gotRestXP = false;
|
||||||
|
|
||||||
|
switch( type )
|
||||||
|
{
|
||||||
|
case "kill":
|
||||||
|
case "headshot":
|
||||||
|
case "shield_damage":
|
||||||
|
value *= self.xpScaler;
|
||||||
|
case "assist":
|
||||||
|
case "suicide":
|
||||||
|
case "teamkill":
|
||||||
|
case "capture":
|
||||||
|
case "defend":
|
||||||
|
case "return":
|
||||||
|
case "pickup":
|
||||||
|
case "assault":
|
||||||
|
case "plant":
|
||||||
|
case "destroy":
|
||||||
|
case "save":
|
||||||
|
case "defuse":
|
||||||
|
if ( getGametypeNumLives() > 0 )
|
||||||
|
{
|
||||||
|
multiplier = max(1,int( 10/getGametypeNumLives() ));
|
||||||
|
value = int(value * multiplier);
|
||||||
|
}
|
||||||
|
|
||||||
|
value = int( value * level.xpScale );
|
||||||
|
|
||||||
|
restXPAwarded = getRestXPAward( value );
|
||||||
|
value += restXPAwarded;
|
||||||
|
if ( restXPAwarded > 0 )
|
||||||
|
{
|
||||||
|
if ( isLastRestXPAward( value ) )
|
||||||
|
thread maps\mp\gametypes\_hud_message::splashNotify( "rested_done" );
|
||||||
|
|
||||||
|
gotRestXP = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !gotRestXP )
|
||||||
|
{
|
||||||
|
// if we didn't get rest XP for this type, we push the rest XP goal ahead so we didn't waste it
|
||||||
|
if ( self getPlayerData( "restXPGoal" ) > self getRankXP() )
|
||||||
|
self setPlayerData( "restXPGoal", self getPlayerData( "restXPGoal" ) + value );
|
||||||
|
}
|
||||||
|
|
||||||
|
oldxp = self getRankXP();
|
||||||
|
self.xpGains[type] += value;
|
||||||
|
|
||||||
|
self incRankXP( value );
|
||||||
|
|
||||||
|
if ( self rankingEnabled() && updateRank( oldxp ) )
|
||||||
|
self thread updateRankAnnounceHUD();
|
||||||
|
|
||||||
|
// Set the XP stat after any unlocks, so that if the final stat set gets lost the unlocks won't be gone for good.
|
||||||
|
self syncXPStat();
|
||||||
|
|
||||||
|
if ( !level.hardcoreMode )
|
||||||
|
{
|
||||||
|
if ( type == "teamkill" )
|
||||||
|
{
|
||||||
|
self thread scorePopup( 0 - getScoreInfoValue( "kill" ), 0, (1,0,0), 0 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
color = (1,1,0.5);
|
||||||
|
if ( gotRestXP )
|
||||||
|
color = (1,.65,0);
|
||||||
|
self thread scorePopup( value, momentumBonus, color, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch( type )
|
||||||
|
{
|
||||||
|
case "kill":
|
||||||
|
case "headshot":
|
||||||
|
case "suicide":
|
||||||
|
case "teamkill":
|
||||||
|
case "assist":
|
||||||
|
case "capture":
|
||||||
|
case "defend":
|
||||||
|
case "return":
|
||||||
|
case "pickup":
|
||||||
|
case "assault":
|
||||||
|
case "plant":
|
||||||
|
case "defuse":
|
||||||
|
self.pers["summary"]["score"] += value;
|
||||||
|
self.pers["summary"]["xp"] += value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "win":
|
||||||
|
case "loss":
|
||||||
|
case "tie":
|
||||||
|
self.pers["summary"]["match"] += value;
|
||||||
|
self.pers["summary"]["xp"] += value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "challenge":
|
||||||
|
self.pers["summary"]["challenge"] += value;
|
||||||
|
self.pers["summary"]["xp"] += value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
self.pers["summary"]["misc"] += value; //keeps track of ungrouped match xp reward
|
||||||
|
self.pers["summary"]["match"] += value;
|
||||||
|
self.pers["summary"]["xp"] += value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateRank( oldxp )
|
||||||
|
{
|
||||||
|
newRankId = self getRank();
|
||||||
|
if ( newRankId == self.pers["rank"] )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
oldRank = self.pers["rank"];
|
||||||
|
rankId = self.pers["rank"];
|
||||||
|
self.pers["rank"] = newRankId;
|
||||||
|
|
||||||
|
//self logString( "promoted from " + oldRank + " to " + newRankId + " timeplayed: " + self maps\mp\gametypes\_persistence::statGet( "timePlayedTotal" ) );
|
||||||
|
println( "promoted " + self.name + " from rank " + oldRank + " to " + newRankId + ". Experience went from " + oldxp + " to " + self getRankXP() + "." );
|
||||||
|
|
||||||
|
self setRank( newRankId );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateRankAnnounceHUD()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
self notify("update_rank");
|
||||||
|
self endon("update_rank");
|
||||||
|
|
||||||
|
team = self.pers["team"];
|
||||||
|
if ( !isdefined( team ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// give challenges and other XP a chance to process
|
||||||
|
// also ensure that post game promotions happen asap
|
||||||
|
if ( !levelFlag( "game_over" ) )
|
||||||
|
level waittill_notify_or_timeout( "game_over", 0.25 );
|
||||||
|
|
||||||
|
|
||||||
|
newRankName = self getRankInfoFull( self.pers["rank"] );
|
||||||
|
rank_char = level.rankTable[self.pers["rank"]][1];
|
||||||
|
subRank = int(rank_char[rank_char.size-1]);
|
||||||
|
|
||||||
|
thread maps\mp\gametypes\_hud_message::promotionSplashNotify();
|
||||||
|
|
||||||
|
if ( subRank > 1 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for ( i = 0; i < level.players.size; i++ )
|
||||||
|
{
|
||||||
|
player = level.players[i];
|
||||||
|
playerteam = player.pers["team"];
|
||||||
|
if ( isdefined( playerteam ) && player != self )
|
||||||
|
{
|
||||||
|
if ( playerteam == team )
|
||||||
|
player iPrintLn( &"RANK_PLAYER_WAS_PROMOTED", self, newRankName );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
endGameUpdate()
|
||||||
|
{
|
||||||
|
player = self;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
scorePopup( amount, bonus, hudColor, glowAlpha )
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "joined_team" );
|
||||||
|
self endon( "joined_spectators" );
|
||||||
|
|
||||||
|
if ( amount == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
self notify( "scorePopup" );
|
||||||
|
self endon( "scorePopup" );
|
||||||
|
|
||||||
|
self.xpUpdateTotal += amount;
|
||||||
|
self.bonusUpdateTotal += bonus;
|
||||||
|
|
||||||
|
wait ( 0.05 );
|
||||||
|
|
||||||
|
if ( self.xpUpdateTotal < 0 )
|
||||||
|
self.hud_scorePopup.label = &"";
|
||||||
|
else
|
||||||
|
self.hud_scorePopup.label = &"MP_PLUS";
|
||||||
|
|
||||||
|
self.hud_scorePopup.color = hudColor;
|
||||||
|
self.hud_scorePopup.glowColor = hudColor;
|
||||||
|
self.hud_scorePopup.glowAlpha = glowAlpha;
|
||||||
|
|
||||||
|
self.hud_scorePopup setValue(self.xpUpdateTotal);
|
||||||
|
self.hud_scorePopup.alpha = 0.85;
|
||||||
|
self.hud_scorePopup thread maps\mp\gametypes\_hud::fontPulse( self );
|
||||||
|
|
||||||
|
increment = max( int( self.bonusUpdateTotal / 20 ), 1 );
|
||||||
|
|
||||||
|
if ( self.bonusUpdateTotal )
|
||||||
|
{
|
||||||
|
while ( self.bonusUpdateTotal > 0 )
|
||||||
|
{
|
||||||
|
self.xpUpdateTotal += min( self.bonusUpdateTotal, increment );
|
||||||
|
self.bonusUpdateTotal -= min( self.bonusUpdateTotal, increment );
|
||||||
|
|
||||||
|
self.hud_scorePopup setValue( self.xpUpdateTotal );
|
||||||
|
|
||||||
|
wait ( 0.05 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait ( 1.0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
self.hud_scorePopup fadeOverTime( 0.75 );
|
||||||
|
self.hud_scorePopup.alpha = 0;
|
||||||
|
|
||||||
|
self.xpUpdateTotal = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
removeRankHUD()
|
||||||
|
{
|
||||||
|
self.hud_scorePopup.alpha = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRank()
|
||||||
|
{
|
||||||
|
rankXp = self.pers["rankxp"];
|
||||||
|
rankId = self.pers["rank"];
|
||||||
|
|
||||||
|
if ( rankXp < (getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId )) )
|
||||||
|
return rankId;
|
||||||
|
else
|
||||||
|
return self getRankForXp( rankXp );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
levelForExperience( experience )
|
||||||
|
{
|
||||||
|
return getRankForXP( experience );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getRankForXp( xpVal )
|
||||||
|
{
|
||||||
|
rankId = 0;
|
||||||
|
rankName = level.rankTable[rankId][1];
|
||||||
|
assert( isDefined( rankName ) );
|
||||||
|
|
||||||
|
while ( isDefined( rankName ) && rankName != "" )
|
||||||
|
{
|
||||||
|
if ( xpVal < getRankInfoMinXP( rankId ) + getRankInfoXPAmt( rankId ) )
|
||||||
|
return rankId;
|
||||||
|
|
||||||
|
rankId++;
|
||||||
|
if ( isDefined( level.rankTable[rankId] ) )
|
||||||
|
rankName = level.rankTable[rankId][1];
|
||||||
|
else
|
||||||
|
rankName = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
rankId--;
|
||||||
|
return rankId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getSPM()
|
||||||
|
{
|
||||||
|
rankLevel = self getRank() + 1;
|
||||||
|
return (3 + (rankLevel * 0.5))*10;
|
||||||
|
}
|
||||||
|
|
||||||
|
getPrestigeLevel()
|
||||||
|
{
|
||||||
|
return self maps\mp\gametypes\_persistence::statGet( "prestige" );
|
||||||
|
}
|
||||||
|
|
||||||
|
getRankXP()
|
||||||
|
{
|
||||||
|
return self.pers["rankxp"];
|
||||||
|
}
|
||||||
|
|
||||||
|
incRankXP( amount )
|
||||||
|
{
|
||||||
|
if ( !self rankingEnabled() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( isDefined( self.isCheater ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
xp = self getRankXP();
|
||||||
|
newXp = (int( min( xp, getRankInfoMaxXP( level.maxRank ) ) ) + amount);
|
||||||
|
|
||||||
|
if ( self.pers["rank"] == level.maxRank && newXp >= getRankInfoMaxXP( level.maxRank ) )
|
||||||
|
newXp = getRankInfoMaxXP( level.maxRank );
|
||||||
|
|
||||||
|
self.pers["rankxp"] = newXp;
|
||||||
|
}
|
||||||
|
|
||||||
|
getRestXPAward( baseXP )
|
||||||
|
{
|
||||||
|
if ( !getdvarint( "scr_restxp_enable" ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp
|
||||||
|
|
||||||
|
wantGiveRestXP = int(baseXP * restXPAwardRate);
|
||||||
|
mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();
|
||||||
|
|
||||||
|
if ( mayGiveRestXP <= 0 )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
// we don't care about giving more rest XP than we have; we just want it to always be X2
|
||||||
|
//if ( wantGiveRestXP > mayGiveRestXP )
|
||||||
|
// return mayGiveRestXP;
|
||||||
|
|
||||||
|
return wantGiveRestXP;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
isLastRestXPAward( baseXP )
|
||||||
|
{
|
||||||
|
if ( !getdvarint( "scr_restxp_enable" ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
restXPAwardRate = getDvarFloat( "scr_restxp_restedAwardScale" ); // as a fraction of base xp
|
||||||
|
|
||||||
|
wantGiveRestXP = int(baseXP * restXPAwardRate);
|
||||||
|
mayGiveRestXP = self getPlayerData( "restXPGoal" ) - self getRankXP();
|
||||||
|
|
||||||
|
if ( mayGiveRestXP <= 0 )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( wantGiveRestXP >= mayGiveRestXP )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
syncXPStat()
|
||||||
|
{
|
||||||
|
if ( level.xpScale > 4 || level.xpScale <= 0)
|
||||||
|
exitLevel( false );
|
||||||
|
|
||||||
|
xp = self getRankXP();
|
||||||
|
|
||||||
|
self maps\mp\gametypes\_persistence::statSet( "experience", xp );
|
||||||
|
}
|
|
@ -0,0 +1,892 @@
|
||||||
|
#include maps\mp\_utility;
|
||||||
|
|
||||||
|
FACTION_REF_COL = 0;
|
||||||
|
FACTION_NAME_COL = 1;
|
||||||
|
FACTION_SHORT_NAME_COL = 2;
|
||||||
|
FACTION_ELIMINATED_COL = 3;
|
||||||
|
FACTION_FORFEITED_COL = 4;
|
||||||
|
FACTION_ICON_COL = 5;
|
||||||
|
FACTION_HUD_ICON_COL = 6;
|
||||||
|
FACTION_VOICE_PREFIX_COL = 7;
|
||||||
|
FACTION_SPAWN_MUSIC_COL = 8;
|
||||||
|
FACTION_WIN_MUSIC_COL = 9;
|
||||||
|
FACTION_FLAG_MODEL_COL = 10;
|
||||||
|
FACTION_FLAG_CARRY_MODEL_COL = 11;
|
||||||
|
FACTION_FLAG_ICON_COL = 12;
|
||||||
|
FACTION_FLAG_FX_COL = 13;
|
||||||
|
FACTION_COLOR_R_COL = 14;
|
||||||
|
FACTION_COLOR_G_COL = 15;
|
||||||
|
FACTION_COLOR_B_COL = 16;
|
||||||
|
FACTION_HEAD_ICON_COL = 17;
|
||||||
|
FACTION_CRATE_MODEL_COL = 18;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
initScoreBoard();
|
||||||
|
|
||||||
|
level.teamBalance = 0;
|
||||||
|
level.maxClients = 18;
|
||||||
|
|
||||||
|
level._effect["thermal_beacon"] = loadFx("misc/thermal_beacon_inverted");
|
||||||
|
effect = level._effect["thermal_beacon"];
|
||||||
|
PrecacheFxTeamThermal( effect, "J_Spine4" );
|
||||||
|
|
||||||
|
setPlayerModels();
|
||||||
|
|
||||||
|
level.freeplayers = [];
|
||||||
|
|
||||||
|
if( level.teamBased )
|
||||||
|
{
|
||||||
|
level thread onPlayerConnect();
|
||||||
|
level thread updateTeamBalance();
|
||||||
|
|
||||||
|
wait .15;
|
||||||
|
level thread updatePlayerTimes();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread onFreePlayerConnect();
|
||||||
|
|
||||||
|
wait .15;
|
||||||
|
level thread updateFreePlayerTimes();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
initScoreBoard()
|
||||||
|
{
|
||||||
|
setDvar("g_TeamName_Allies", getTeamShortName( "allies" ));
|
||||||
|
setDvar("g_TeamIcon_Allies", getTeamIcon( "allies" ));
|
||||||
|
setDvar("g_TeamIcon_MyAllies", getTeamIcon( "allies" ));
|
||||||
|
setDvar("g_TeamIcon_EnemyAllies", getTeamIcon( "allies" ));
|
||||||
|
scoreColor = getTeamColor( "allies" );
|
||||||
|
setDvar("g_ScoresColor_Allies", scoreColor[0] + " " + scoreColor[1] + " " + scoreColor[2] );
|
||||||
|
|
||||||
|
setDvar("g_TeamName_Axis", getTeamShortName( "axis" ));
|
||||||
|
setDvar("g_TeamIcon_Axis", getTeamIcon( "axis" ));
|
||||||
|
setDvar("g_TeamIcon_MyAxis", getTeamIcon( "axis" ));
|
||||||
|
setDvar("g_TeamIcon_EnemyAxis", getTeamIcon( "axis" ));
|
||||||
|
scoreColor = getTeamColor( "axis" );
|
||||||
|
setDvar("g_ScoresColor_Axis", scoreColor[0] + " " + scoreColor[1] + " " + scoreColor[2] );
|
||||||
|
|
||||||
|
setdvar("g_ScoresColor_Spectator", ".25 .25 .25");
|
||||||
|
setdvar("g_ScoresColor_Free", ".76 .78 .10");
|
||||||
|
setdvar("g_teamColor_MyTeam", ".6 .8 .6" );
|
||||||
|
setdvar("g_teamColor_EnemyTeam", "1 .45 .5" );
|
||||||
|
setdvar("g_teamTitleColor_MyTeam", ".6 .8 .6" );
|
||||||
|
setdvar("g_teamTitleColor_EnemyTeam", "1 .45 .5" );
|
||||||
|
}
|
||||||
|
|
||||||
|
onPlayerConnect()
|
||||||
|
{
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
level waittill( "connected", player );
|
||||||
|
|
||||||
|
player thread onJoinedTeam();
|
||||||
|
player thread onJoinedSpectators();
|
||||||
|
player thread onPlayerSpawned();
|
||||||
|
|
||||||
|
player thread trackPlayedTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onFreePlayerConnect()
|
||||||
|
{
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
level waittill( "connected", player );
|
||||||
|
|
||||||
|
player thread trackFreePlayedTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onJoinedTeam()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill( "joined_team" );
|
||||||
|
//self logString( "joined team: " + self.pers["team"] );
|
||||||
|
self updateTeamTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onJoinedSpectators()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill("joined_spectators");
|
||||||
|
self.pers["teamTime"] = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
trackPlayedTime()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
self.timePlayed["allies"] = 0;
|
||||||
|
self.timePlayed["axis"] = 0;
|
||||||
|
self.timePlayed["free"] = 0;
|
||||||
|
self.timePlayed["other"] = 0;
|
||||||
|
self.timePlayed["total"] = 0;
|
||||||
|
|
||||||
|
gameFlagWait( "prematch_done" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
if ( game["state"] == "playing" )
|
||||||
|
{
|
||||||
|
if ( self.sessionteam == "allies" )
|
||||||
|
{
|
||||||
|
self.timePlayed["allies"]++;
|
||||||
|
self.timePlayed["total"]++;
|
||||||
|
}
|
||||||
|
else if ( self.sessionteam == "axis" )
|
||||||
|
{
|
||||||
|
self.timePlayed["axis"]++;
|
||||||
|
self.timePlayed["total"]++;
|
||||||
|
}
|
||||||
|
else if ( self.sessionteam == "spectator" )
|
||||||
|
{
|
||||||
|
self.timePlayed["other"]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
wait ( 1.0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updatePlayerTimes()
|
||||||
|
{
|
||||||
|
if ( !level.rankedmatch )
|
||||||
|
return;
|
||||||
|
|
||||||
|
level endon( "game_ended" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
foreach ( player in level.players )
|
||||||
|
player updatePlayedTime();
|
||||||
|
|
||||||
|
wait( 1.0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updatePlayedTime()
|
||||||
|
{
|
||||||
|
if ( !self rankingEnabled() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( self.timePlayed["allies"] )
|
||||||
|
{
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedAllies", self.timePlayed["allies"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedTotal", self.timePlayed["allies"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddChildBuffered( "round", "timePlayed", self.timePlayed["allies"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self.timePlayed["axis"] )
|
||||||
|
{
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedOpfor", self.timePlayed["axis"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedTotal", self.timePlayed["axis"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddChildBuffered( "round", "timePlayed", self.timePlayed["axis"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self.timePlayed["other"] )
|
||||||
|
{
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedOther", self.timePlayed["other"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedTotal", self.timePlayed["other"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddChildBuffered( "round", "timePlayed", self.timePlayed["other"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( game["state"] == "postgame" )
|
||||||
|
return;
|
||||||
|
|
||||||
|
self.timePlayed["allies"] = 0;
|
||||||
|
self.timePlayed["axis"] = 0;
|
||||||
|
self.timePlayed["other"] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateTeamTime()
|
||||||
|
{
|
||||||
|
if ( game["state"] != "playing" )
|
||||||
|
return;
|
||||||
|
|
||||||
|
self.pers["teamTime"] = getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateTeamBalanceDvar()
|
||||||
|
{
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
teambalance = getdvarInt("scr_teambalance");
|
||||||
|
if(level.teambalance != teambalance)
|
||||||
|
level.teambalance = getdvarInt("scr_teambalance");
|
||||||
|
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateTeamBalance()
|
||||||
|
{
|
||||||
|
level.teamLimit = level.maxclients;
|
||||||
|
|
||||||
|
level thread updateTeamBalanceDvar();
|
||||||
|
|
||||||
|
wait .15;
|
||||||
|
|
||||||
|
if ( level.teamBalance && isRoundBased() )
|
||||||
|
{
|
||||||
|
if( isDefined( game["BalanceTeamsNextRound"] ) )
|
||||||
|
iPrintLnbold( &"MP_AUTOBALANCE_NEXT_ROUND" );
|
||||||
|
|
||||||
|
// TODO: add or change
|
||||||
|
level waittill( "restarting" );
|
||||||
|
|
||||||
|
if( isDefined( game["BalanceTeamsNextRound"] ) )
|
||||||
|
{
|
||||||
|
level balanceTeams();
|
||||||
|
game["BalanceTeamsNextRound"] = undefined;
|
||||||
|
}
|
||||||
|
else if( !getTeamBalance() )
|
||||||
|
{
|
||||||
|
game["BalanceTeamsNextRound"] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level endon ( "game_ended" );
|
||||||
|
for( ;; )
|
||||||
|
{
|
||||||
|
if( level.teamBalance )
|
||||||
|
{
|
||||||
|
if( !getTeamBalance() )
|
||||||
|
{
|
||||||
|
iPrintLnBold( &"MP_AUTOBALANCE_SECONDS", 15 );
|
||||||
|
wait 15.0;
|
||||||
|
|
||||||
|
if( !getTeamBalance() )
|
||||||
|
level balanceTeams();
|
||||||
|
}
|
||||||
|
|
||||||
|
wait 59.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wait 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getTeamBalance()
|
||||||
|
{
|
||||||
|
level.team["allies"] = 0;
|
||||||
|
level.team["axis"] = 0;
|
||||||
|
|
||||||
|
players = level.players;
|
||||||
|
for(i = 0; i < players.size; i++)
|
||||||
|
{
|
||||||
|
if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies"))
|
||||||
|
level.team["allies"]++;
|
||||||
|
else if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "axis"))
|
||||||
|
level.team["axis"]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((level.team["allies"] > (level.team["axis"] + level.teamBalance)) || (level.team["axis"] > (level.team["allies"] + level.teamBalance)))
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
balanceTeams()
|
||||||
|
{
|
||||||
|
iPrintLnBold( game["strings"]["autobalance"] );
|
||||||
|
//Create/Clear the team arrays
|
||||||
|
AlliedPlayers = [];
|
||||||
|
AxisPlayers = [];
|
||||||
|
|
||||||
|
// Populate the team arrays
|
||||||
|
players = level.players;
|
||||||
|
for(i = 0; i < players.size; i++)
|
||||||
|
{
|
||||||
|
if(!isdefined(players[i].pers["teamTime"]))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies"))
|
||||||
|
AlliedPlayers[AlliedPlayers.size] = players[i];
|
||||||
|
else if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "axis"))
|
||||||
|
AxisPlayers[AxisPlayers.size] = players[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
MostRecent = undefined;
|
||||||
|
|
||||||
|
while((AlliedPlayers.size > (AxisPlayers.size + 1)) || (AxisPlayers.size > (AlliedPlayers.size + 1)))
|
||||||
|
{
|
||||||
|
if(AlliedPlayers.size > (AxisPlayers.size + 1))
|
||||||
|
{
|
||||||
|
// Move the player that's been on the team the shortest ammount of time (highest teamTime value)
|
||||||
|
for(j = 0; j < AlliedPlayers.size; j++)
|
||||||
|
{
|
||||||
|
if(isdefined(AlliedPlayers[j].dont_auto_balance))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(!isdefined(MostRecent))
|
||||||
|
MostRecent = AlliedPlayers[j];
|
||||||
|
else if(AlliedPlayers[j].pers["teamTime"] > MostRecent.pers["teamTime"])
|
||||||
|
MostRecent = AlliedPlayers[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
MostRecent [[level.axis]]();
|
||||||
|
}
|
||||||
|
else if(AxisPlayers.size > (AlliedPlayers.size + 1))
|
||||||
|
{
|
||||||
|
// Move the player that's been on the team the shortest ammount of time (highest teamTime value)
|
||||||
|
for(j = 0; j < AxisPlayers.size; j++)
|
||||||
|
{
|
||||||
|
if(isdefined(AxisPlayers[j].dont_auto_balance))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(!isdefined(MostRecent))
|
||||||
|
MostRecent = AxisPlayers[j];
|
||||||
|
else if(AxisPlayers[j].pers["teamTime"] > MostRecent.pers["teamTime"])
|
||||||
|
MostRecent = AxisPlayers[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
MostRecent [[level.allies]]();
|
||||||
|
}
|
||||||
|
|
||||||
|
MostRecent = undefined;
|
||||||
|
AlliedPlayers = [];
|
||||||
|
AxisPlayers = [];
|
||||||
|
|
||||||
|
players = level.players;
|
||||||
|
for(i = 0; i < players.size; i++)
|
||||||
|
{
|
||||||
|
if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies"))
|
||||||
|
AlliedPlayers[AlliedPlayers.size] = players[i];
|
||||||
|
else if((isdefined(players[i].pers["team"])) &&(players[i].pers["team"] == "axis"))
|
||||||
|
AxisPlayers[AxisPlayers.size] = players[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setGhillieModels( env )
|
||||||
|
{
|
||||||
|
level.environment = env;
|
||||||
|
switch ( env )
|
||||||
|
{
|
||||||
|
case "desert":
|
||||||
|
mptype\mptype_ally_ghillie_desert::precache();
|
||||||
|
mptype\mptype_opforce_ghillie_desert::precache();
|
||||||
|
game["allies_model"]["GHILLIE"] = mptype\mptype_ally_ghillie_desert::main;
|
||||||
|
game["axis_model"]["GHILLIE"] = mptype\mptype_opforce_ghillie_desert::main;
|
||||||
|
break;
|
||||||
|
case "arctic":
|
||||||
|
mptype\mptype_ally_ghillie_arctic::precache();
|
||||||
|
mptype\mptype_opforce_ghillie_arctic::precache();
|
||||||
|
game["allies_model"]["GHILLIE"] = mptype\mptype_ally_ghillie_arctic::main;
|
||||||
|
game["axis_model"]["GHILLIE"] = mptype\mptype_opforce_ghillie_arctic::main;
|
||||||
|
break;
|
||||||
|
case "urban":
|
||||||
|
mptype\mptype_ally_ghillie_urban::precache();
|
||||||
|
mptype\mptype_opforce_ghillie_urban::precache();
|
||||||
|
game["allies_model"]["GHILLIE"] = mptype\mptype_ally_ghillie_urban::main;
|
||||||
|
game["axis_model"]["GHILLIE"] = mptype\mptype_opforce_ghillie_urban::main;
|
||||||
|
break;
|
||||||
|
case "forest":
|
||||||
|
mptype\mptype_ally_ghillie_forest::precache();
|
||||||
|
mptype\mptype_opforce_ghillie_forest::precache();
|
||||||
|
game["allies_model"]["GHILLIE"] = mptype\mptype_ally_ghillie_forest::main;
|
||||||
|
game["axis_model"]["GHILLIE"] = mptype\mptype_opforce_ghillie_forest::main;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setTeamModels( team, charSet )
|
||||||
|
{
|
||||||
|
switch ( charSet )
|
||||||
|
{
|
||||||
|
case "seals_udt":
|
||||||
|
mptype\mptype_seal_udt_sniper::precache();
|
||||||
|
mptype\mptype_seal_udt_lmg::precache();
|
||||||
|
mptype\mptype_seal_udt_assault::precache();
|
||||||
|
mptype\mptype_seal_udt_shotgun::precache();
|
||||||
|
mptype\mptype_seal_udt_smg::precache();
|
||||||
|
mptype\mptype_seal_udt_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_seal_udt_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_seal_udt_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_seal_udt_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_seal_udt_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_seal_udt_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_seal_udt_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "us_army":
|
||||||
|
mptype\mptype_us_army_sniper::precache();
|
||||||
|
mptype\mptype_us_army_lmg::precache();
|
||||||
|
mptype\mptype_us_army_assault::precache();
|
||||||
|
mptype\mptype_us_army_shotgun::precache();
|
||||||
|
mptype\mptype_us_army_smg::precache();
|
||||||
|
mptype\mptype_us_army_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_us_army_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_us_army_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_us_army_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_us_army_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_us_army_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_us_army_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "opforce_composite":
|
||||||
|
mptype\mptype_opforce_comp_assault::precache();
|
||||||
|
mptype\mptype_opforce_comp_lmg::precache();
|
||||||
|
mptype\mptype_opforce_comp_shotgun::precache();
|
||||||
|
mptype\mptype_opforce_comp_smg::precache();
|
||||||
|
mptype\mptype_opforce_comp_sniper::precache();
|
||||||
|
mptype\mptype_opforce_comp_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_opforce_comp_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_opforce_comp_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_opforce_comp_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_opforce_comp_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_opforce_comp_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_opforce_comp_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "opforce_arctic":
|
||||||
|
mptype\mptype_opforce_arctic_assault::precache();
|
||||||
|
mptype\mptype_opforce_arctic_lmg::precache();
|
||||||
|
mptype\mptype_opforce_arctic_shotgun::precache();
|
||||||
|
mptype\mptype_opforce_arctic_smg::precache();
|
||||||
|
mptype\mptype_opforce_arctic_sniper::precache();
|
||||||
|
mptype\mptype_opforce_arctic_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_opforce_arctic_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_opforce_arctic_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_opforce_arctic_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_opforce_arctic_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_opforce_arctic_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_opforce_arctic_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "opforce_airborne":
|
||||||
|
mptype\mptype_opforce_airborne_assault::precache();
|
||||||
|
mptype\mptype_opforce_airborne_lmg::precache();
|
||||||
|
mptype\mptype_opforce_airborne_shotgun::precache();
|
||||||
|
mptype\mptype_opforce_airborne_smg::precache();
|
||||||
|
mptype\mptype_opforce_airborne_sniper::precache();
|
||||||
|
mptype\mptype_opforce_airborne_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_opforce_airborne_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_opforce_airborne_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_opforce_airborne_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_opforce_airborne_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_opforce_airborne_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_opforce_airborne_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "militia":
|
||||||
|
mptype\mptype_opforce_militia_assault::precache();
|
||||||
|
mptype\mptype_opforce_militia_lmg::precache();
|
||||||
|
mptype\mptype_opforce_militia_shotgun::precache();
|
||||||
|
mptype\mptype_opforce_militia_smg::precache();
|
||||||
|
mptype\mptype_opforce_militia_sniper::precache();
|
||||||
|
mptype\mptype_opforce_militia_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_opforce_militia_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_opforce_militia_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_opforce_militia_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_opforce_militia_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_opforce_militia_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_opforce_militia_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "socom_141":
|
||||||
|
mptype\mptype_socom_assault::precache();
|
||||||
|
mptype\mptype_socom_lmg::precache();
|
||||||
|
mptype\mptype_socom_shotgun::precache();
|
||||||
|
mptype\mptype_socom_smg::precache();
|
||||||
|
mptype\mptype_socom_sniper::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_socom_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_socom_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_socom_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_socom_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_socom_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_socom_smg::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "socom_141_desert":
|
||||||
|
mptype\mptype_tf141_desert_assault::precache();
|
||||||
|
mptype\mptype_tf141_desert_lmg::precache();
|
||||||
|
mptype\mptype_tf141_desert_smg::precache();
|
||||||
|
mptype\mptype_tf141_desert_shotgun::precache();
|
||||||
|
mptype\mptype_tf141_desert_sniper::precache();
|
||||||
|
mptype\mptype_tf141_desert_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_tf141_desert_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_tf141_desert_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_tf141_desert_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_tf141_desert_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_tf141_desert_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_tf141_desert_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "socom_141_forest":
|
||||||
|
mptype\mptype_tf141_forest_assault::precache();
|
||||||
|
mptype\mptype_tf141_forest_lmg::precache();
|
||||||
|
mptype\mptype_tf141_forest_smg::precache();
|
||||||
|
mptype\mptype_tf141_forest_shotgun::precache();
|
||||||
|
mptype\mptype_tf141_forest_sniper::precache();
|
||||||
|
mptype\mptype_tf141_forest_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_tf141_forest_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_tf141_forest_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_tf141_forest_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_tf141_forest_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_tf141_forest_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_tf141_forest_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "socom_141_arctic":
|
||||||
|
mptype\mptype_tf141_arctic_assault::precache();
|
||||||
|
mptype\mptype_tf141_arctic_lmg::precache();
|
||||||
|
mptype\mptype_tf141_arctic_smg::precache();
|
||||||
|
mptype\mptype_tf141_arctic_shotgun::precache();
|
||||||
|
mptype\mptype_tf141_arctic_sniper::precache();
|
||||||
|
mptype\mptype_tf141_arctic_riot::precache();
|
||||||
|
|
||||||
|
game[team + "_model"]["SNIPER"] = mptype\mptype_tf141_arctic_sniper::main;
|
||||||
|
game[team + "_model"]["LMG"] = mptype\mptype_tf141_arctic_lmg::main;
|
||||||
|
game[team + "_model"]["ASSAULT"] = mptype\mptype_tf141_arctic_assault::main;
|
||||||
|
game[team + "_model"]["SHOTGUN"] = mptype\mptype_tf141_arctic_shotgun::main;
|
||||||
|
game[team + "_model"]["SMG"] = mptype\mptype_tf141_arctic_smg::main;
|
||||||
|
game[team + "_model"]["RIOT"] = mptype\mptype_tf141_arctic_riot::main;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setPlayerModels()
|
||||||
|
{
|
||||||
|
//mptype\mptype_us_army_riot::precache();
|
||||||
|
//game["allies_model"]["riotshield"] = mptype\mptype_us_army_riot::main;
|
||||||
|
//game["axis_model"]["riotshield"] = mptype\mptype_us_army_riot::main;
|
||||||
|
|
||||||
|
setTeamModels( "allies", game["allies"] );
|
||||||
|
setTeamModels( "axis", game["axis"] );
|
||||||
|
|
||||||
|
setGhillieModels( getMapCustom( "environment" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
playerModelForWeapon( weapon, secondary )
|
||||||
|
{
|
||||||
|
team = self.team;
|
||||||
|
|
||||||
|
|
||||||
|
if ( isDefined( game[team + "_model"][weapon] ) )
|
||||||
|
{
|
||||||
|
[[game[team+"_model"][weapon]]]();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
weaponClass = tablelookup( "mp/statstable.csv", 4, weapon, 2 );
|
||||||
|
|
||||||
|
switch ( weaponClass )
|
||||||
|
{
|
||||||
|
case "weapon_smg":
|
||||||
|
[[game[team+"_model"]["SMG"]]]();
|
||||||
|
break;
|
||||||
|
case "weapon_assault":
|
||||||
|
weaponClass = tablelookup( "mp/statstable.csv", 4, secondary, 2 );
|
||||||
|
if ( weaponClass == "weapon_shotgun" )
|
||||||
|
[[game[team+"_model"]["SHOTGUN"]]]();
|
||||||
|
else
|
||||||
|
[[game[team+"_model"]["ASSAULT"]]]();
|
||||||
|
break;
|
||||||
|
case "weapon_sniper":
|
||||||
|
if ( level.environment != "" && self isItemUnlocked( "ghillie_" + level.environment ) )
|
||||||
|
[[game[team+"_model"]["GHILLIE"]]]();
|
||||||
|
else
|
||||||
|
[[game[team+"_model"]["SNIPER"]]]();
|
||||||
|
break;
|
||||||
|
case "weapon_lmg":
|
||||||
|
[[game[team+"_model"]["LMG"]]]();
|
||||||
|
break;
|
||||||
|
case "weapon_riot":
|
||||||
|
[[game[team+"_model"]["RIOT"]]]();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
[[game[team+"_model"]["ASSAULT"]]]();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CountPlayers()
|
||||||
|
{
|
||||||
|
//chad
|
||||||
|
players = level.players;
|
||||||
|
allies = 0;
|
||||||
|
axis = 0;
|
||||||
|
for(i = 0; i < players.size; i++)
|
||||||
|
{
|
||||||
|
if ( players[i] == self )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "allies"))
|
||||||
|
allies++;
|
||||||
|
else if((isdefined(players[i].pers["team"])) && (players[i].pers["team"] == "axis"))
|
||||||
|
axis++;
|
||||||
|
}
|
||||||
|
players["allies"] = allies;
|
||||||
|
players["axis"] = axis;
|
||||||
|
return players;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
trackFreePlayedTime()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
self.timePlayed["allies"] = 0;
|
||||||
|
self.timePlayed["axis"] = 0;
|
||||||
|
self.timePlayed["other"] = 0;
|
||||||
|
self.timePlayed["total"] = 0;
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
if ( game["state"] == "playing" )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.pers["team"] ) && self.pers["team"] == "allies" && self.sessionteam != "spectator" )
|
||||||
|
{
|
||||||
|
self.timePlayed["allies"]++;
|
||||||
|
self.timePlayed["total"]++;
|
||||||
|
}
|
||||||
|
else if ( isDefined( self.pers["team"] ) && self.pers["team"] == "axis" && self.sessionteam != "spectator" )
|
||||||
|
{
|
||||||
|
self.timePlayed["axis"]++;
|
||||||
|
self.timePlayed["total"]++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.timePlayed["other"]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wait ( 1.0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/#
|
||||||
|
playerConnectedTest()
|
||||||
|
{
|
||||||
|
if ( getdvarint( "scr_runlevelandquit" ) == 1 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
level endon( "exitLevel_called" );
|
||||||
|
|
||||||
|
// every frame, do a getPlayerData on each player in level.players.
|
||||||
|
// this will force a script error if a player in level.players isn't connected.
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
foreach ( player in level.players )
|
||||||
|
{
|
||||||
|
player getPlayerData( "experience" );
|
||||||
|
}
|
||||||
|
wait .05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#/
|
||||||
|
|
||||||
|
|
||||||
|
updateFreePlayerTimes()
|
||||||
|
{
|
||||||
|
if ( !level.rankedmatch )
|
||||||
|
return;
|
||||||
|
|
||||||
|
/#
|
||||||
|
thread playerConnectedTest();
|
||||||
|
#/
|
||||||
|
|
||||||
|
nextToUpdate = 0;
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
nextToUpdate++;
|
||||||
|
if ( nextToUpdate >= level.players.size )
|
||||||
|
nextToUpdate = 0;
|
||||||
|
|
||||||
|
if ( isDefined( level.players[nextToUpdate] ) )
|
||||||
|
level.players[nextToUpdate] updateFreePlayedTime();
|
||||||
|
|
||||||
|
wait ( 1.0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateFreePlayedTime()
|
||||||
|
{
|
||||||
|
if ( !self rankingEnabled() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( self.timePlayed["allies"] )
|
||||||
|
{
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedAllies", self.timePlayed["allies"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedTotal", self.timePlayed["allies"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self.timePlayed["axis"] )
|
||||||
|
{
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedOpfor", self.timePlayed["axis"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedTotal", self.timePlayed["axis"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self.timePlayed["other"] )
|
||||||
|
{
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedOther", self.timePlayed["other"] );
|
||||||
|
self maps\mp\gametypes\_persistence::statAddBuffered( "timePlayedTotal", self.timePlayed["other"] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( game["state"] == "postgame" )
|
||||||
|
return;
|
||||||
|
|
||||||
|
self.timePlayed["allies"] = 0;
|
||||||
|
self.timePlayed["axis"] = 0;
|
||||||
|
self.timePlayed["other"] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getJoinTeamPermissions( team )
|
||||||
|
{
|
||||||
|
teamcount = 0;
|
||||||
|
|
||||||
|
players = level.players;
|
||||||
|
for(i = 0; i < players.size; i++)
|
||||||
|
{
|
||||||
|
player = players[i];
|
||||||
|
|
||||||
|
if((isdefined(player.pers["team"])) && (player.pers["team"] == team))
|
||||||
|
teamcount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( teamCount < level.teamLimit )
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onPlayerSpawned()
|
||||||
|
{
|
||||||
|
level endon ( "game_ended" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill ( "spawned_player" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamName( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookupIString( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_NAME_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamShortName( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookupIString( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_SHORT_NAME_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamForfeitedString( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookupIString( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_FORFEITED_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamEliminatedString( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookupIString( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_ELIMINATED_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamIcon( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_ICON_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamHudIcon( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_HUD_ICON_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamHeadIcon( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_HEAD_ICON_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamVoicePrefix( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_VOICE_PREFIX_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamSpawnMusic( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_SPAWN_MUSIC_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamWinMusic( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_WIN_MUSIC_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamFlagModel( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_FLAG_MODEL_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamFlagCarryModel( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_FLAG_CARRY_MODEL_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamFlagIcon( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_FLAG_ICON_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamFlagFX( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_FLAG_FX_COL ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamColor( teamRef )
|
||||||
|
{
|
||||||
|
return ( (stringToFloat( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_COLOR_R_COL ) ),
|
||||||
|
stringToFloat( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_COLOR_G_COL ) ),
|
||||||
|
stringToFloat( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_COLOR_B_COL ) ))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getTeamCrateModel( teamRef )
|
||||||
|
{
|
||||||
|
return ( tableLookup( "mp/factionTable.csv", FACTION_REF_COL, game[teamRef], FACTION_CRATE_MODEL_COL ) );
|
||||||
|
}
|
|
@ -0,0 +1,187 @@
|
||||||
|
1: Extra speed
|
||||||
|
2: Thumper Akimbo
|
||||||
|
3: No Recoil
|
||||||
|
4: You are a one hit kill
|
||||||
|
5: No ADS
|
||||||
|
6: Triple HP
|
||||||
|
7: 18 different perks
|
||||||
|
8: Unlimited frag grenades
|
||||||
|
9: Go get 'em Makarov
|
||||||
|
10: Darkness
|
||||||
|
11: Thermal vision
|
||||||
|
12: Barrett roll
|
||||||
|
13: Negative
|
||||||
|
14: Knife runner
|
||||||
|
15: Turtle
|
||||||
|
16: Supermodel 1887
|
||||||
|
17: Fallout
|
||||||
|
18: Unlimited ammo
|
||||||
|
19: Wallhack for 40 seconds
|
||||||
|
20: Double HP and roll again
|
||||||
|
21: Godmode for 15 seconds
|
||||||
|
22: Bullseye
|
||||||
|
23: Blast them asses
|
||||||
|
24: Now you are retarded
|
||||||
|
25: AZUMOOB
|
||||||
|
26: Tank
|
||||||
|
27: EMP
|
||||||
|
28: Semi-Automatic M16
|
||||||
|
29: Morpheus
|
||||||
|
30: Unlimited Ammo and roll again
|
||||||
|
31: COD4
|
||||||
|
32: Handgun of Crap
|
||||||
|
33: Extra speed and roll again
|
||||||
|
34: Walking AC130
|
||||||
|
35: Invisibility for 15 seconds
|
||||||
|
36: Nightvision
|
||||||
|
37: No ammo reserve
|
||||||
|
38: Javelin
|
||||||
|
39: It's late
|
||||||
|
40: Golden Deagle
|
||||||
|
41: Spas
|
||||||
|
42: Problem, ranger?
|
||||||
|
43: FalL
|
||||||
|
44: Gaymore
|
||||||
|
45: Heaven. not.
|
||||||
|
46: Bomberman
|
||||||
|
47: Old school
|
||||||
|
48: You are flashing
|
||||||
|
49: No perks
|
||||||
|
50: No primary
|
||||||
|
______________
|
||||||
|
|
||||||
|
Roll the Dice V2 Rolls:
|
||||||
|
|
||||||
|
51: ADS Only
|
||||||
|
52: Satellite
|
||||||
|
53: Hardcore
|
||||||
|
54: Arcade
|
||||||
|
55: Counter-Strike
|
||||||
|
56: Distracting
|
||||||
|
57: Noob >:O
|
||||||
|
58: 3rd Person Shooter
|
||||||
|
59: Underwater
|
||||||
|
60: Got any glasses?
|
||||||
|
61: Drug Abuse
|
||||||
|
62: You're fat.
|
||||||
|
63: Blood malfunction
|
||||||
|
64: Equipment toggle
|
||||||
|
65: Freeze
|
||||||
|
66: Bullet proof
|
||||||
|
67: Roll Twice
|
||||||
|
68: Fleshwound
|
||||||
|
69: Spy
|
||||||
|
70: Midget
|
||||||
|
71: Exorcist
|
||||||
|
72: Blackouts
|
||||||
|
73: Special
|
||||||
|
74: No melee
|
||||||
|
75: Thunder
|
||||||
|
76: Field of view
|
||||||
|
77: L453R
|
||||||
|
78: Deaf
|
||||||
|
79: No secondary
|
||||||
|
80: Deflect
|
||||||
|
81: Jesus Christ!
|
||||||
|
82: Healer
|
||||||
|
83: Mini Akimbo Gungame
|
||||||
|
84: Propipe
|
||||||
|
85: Steady
|
||||||
|
86: Mini Bling Gungame
|
||||||
|
87: Suicide Bomber
|
||||||
|
88: Invisible weapon
|
||||||
|
89: Commander
|
||||||
|
90: Aura
|
||||||
|
91: Mini Sprayer Gungame
|
||||||
|
92: Better hearing
|
||||||
|
93: Super speed for 15 seconds
|
||||||
|
94: Sentry and reroll
|
||||||
|
95: Killstreaks
|
||||||
|
96: Spray
|
||||||
|
97: FFFFFFFFFFFFFFFUUUUUUUUUUUUUUUU
|
||||||
|
98: Nitro
|
||||||
|
99: Faster regen
|
||||||
|
100: 1/5 Chance of EMP
|
||||||
|
______________
|
||||||
|
|
||||||
|
Roll the Dice V3 Rolls:
|
||||||
|
|
||||||
|
101: Paranoid
|
||||||
|
102: No idea
|
||||||
|
103: Annoying
|
||||||
|
104: Javelin fire
|
||||||
|
105: Noobtuber PRO
|
||||||
|
106: Ninja
|
||||||
|
107: Super damage
|
||||||
|
108: Leech
|
||||||
|
109: Icy Bullets
|
||||||
|
110: Force Weapon
|
||||||
|
111: Copycat
|
||||||
|
112: Telekinetic
|
||||||
|
113: Ragdoll #!!NEW!!#
|
||||||
|
114: Roll twice
|
||||||
|
115: Reflection
|
||||||
|
116: Mini Explosives Gungame
|
||||||
|
117: RPG FIRE
|
||||||
|
118: Death Grip
|
||||||
|
119: Paradox
|
||||||
|
120: Kamikaze #!!NEW!!#
|
||||||
|
121: One in the Chamber
|
||||||
|
122: Attractive
|
||||||
|
123: Rotate
|
||||||
|
124: Near death
|
||||||
|
125: Shellshock immune (Stun/flash)
|
||||||
|
126: Riot Control
|
||||||
|
127: Insensitive
|
||||||
|
128: Creeper
|
||||||
|
129: Quake
|
||||||
|
130: Small clip
|
||||||
|
131: Hunter
|
||||||
|
132: Spotted
|
||||||
|
133: Knockback
|
||||||
|
134: Stuns of ice
|
||||||
|
135: Rapist
|
||||||
|
136: Loner
|
||||||
|
137: EMP nades
|
||||||
|
138: Camper
|
||||||
|
139: Blindfire
|
||||||
|
140: Evasive Manuver
|
||||||
|
141: Mini Pistol Gungame
|
||||||
|
142: Distracting
|
||||||
|
143: Choose an advantage
|
||||||
|
144: Choose a disadvantage
|
||||||
|
145: HEADSHOT
|
||||||
|
146: Semi-auto
|
||||||
|
147: Poser
|
||||||
|
148: Choose your roll
|
||||||
|
149: Military Training
|
||||||
|
150: 1/10 Chance of NUKE
|
||||||
|
______________
|
||||||
|
|
||||||
|
Roll the Dice V3.2 Rolls:
|
||||||
|
|
||||||
|
151: Crush Enemies
|
||||||
|
152: Profit
|
||||||
|
153: Acid
|
||||||
|
154: Reverse Thermal
|
||||||
|
155: Automatic Intervention
|
||||||
|
156: Pullback
|
||||||
|
157: Walking AC130 40MM
|
||||||
|
158: Walking AC130 105MM
|
||||||
|
159: Artillery Strike and reroll
|
||||||
|
160: Cancer
|
||||||
|
161: Blur Bullets
|
||||||
|
162: Choose your roll twice
|
||||||
|
163: Venom
|
||||||
|
164: Black Ops crossbow
|
||||||
|
165: Smoker
|
||||||
|
166: EEEEVIIIIIIIILLL
|
||||||
|
167: Stamp
|
||||||
|
168: Less spread
|
||||||
|
169: Super spread
|
||||||
|
170: Teleport
|
||||||
|
171: Raygun
|
||||||
|
172: Humiliation
|
||||||
|
173: Mines
|
||||||
|
174: Rainbow world
|
||||||
|
175: 1/3 Chance of Napalm Strike
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,670 @@
|
||||||
|
#include maps\mp\_utility;
|
||||||
|
#include maps\mp\gametypes\_hud_util;
|
||||||
|
#include common_scripts\utility;
|
||||||
|
#include maps\mp\gametypes\_killstreaks;
|
||||||
|
|
||||||
|
KILLSTREAK_STRING_TABLE = "mp/killstreakTable.csv";
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
// Load custom killstreak mod
|
||||||
|
thread streakInit();
|
||||||
|
|
||||||
|
// &&1 Kill Streak!
|
||||||
|
precacheString( &"MP_KILLSTREAK_N" );
|
||||||
|
precacheString( &"MP_NUKE_ALREADY_INBOUND" );
|
||||||
|
precacheString( &"MP_UNAVILABLE_IN_LASTSTAND" );
|
||||||
|
precacheString( &"MP_UNAVAILABLE_WHEN_EMP" );
|
||||||
|
precacheString( &"MP_UNAVAILABLE_USING_TURRET" );
|
||||||
|
precacheString( &"MP_UNAVAILABLE_WHEN_INCAP" );
|
||||||
|
precacheString( &"MP_HELI_IN_QUEUE" );
|
||||||
|
|
||||||
|
initKillstreakData();
|
||||||
|
|
||||||
|
level.killstreakFuncs = [];
|
||||||
|
level.killstreakSetupFuncs = [];
|
||||||
|
level.killstreakWeapons = [];
|
||||||
|
|
||||||
|
level.killStreakMod = 0;
|
||||||
|
|
||||||
|
thread maps\mp\killstreaks\_ac130::init();
|
||||||
|
thread maps\mp\killstreaks\_remotemissile::init();
|
||||||
|
thread maps\mp\killstreaks\_uav::init();
|
||||||
|
thread maps\mp\killstreaks\_airstrike::init();
|
||||||
|
thread maps\mp\killstreaks\_airdrop::init();
|
||||||
|
thread maps\mp\killstreaks\_helicopter::init();
|
||||||
|
thread maps\mp\killstreaks\_autosentry::init();
|
||||||
|
thread maps\mp\killstreaks\_tank::init();
|
||||||
|
thread maps\mp\killstreaks\_emp::init();
|
||||||
|
thread maps\mp\killstreaks\_nuke::init();
|
||||||
|
|
||||||
|
level.killstreakRoundDelay = getIntProperty( "scr_game_killstreakdelay", 8 );
|
||||||
|
|
||||||
|
level thread onPlayerConnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
initKillstreakData()
|
||||||
|
{
|
||||||
|
for ( i = 1; true; i++ )
|
||||||
|
{
|
||||||
|
retVal = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 1 );
|
||||||
|
if ( !isDefined( retVal ) || retVal == "" )
|
||||||
|
break;
|
||||||
|
|
||||||
|
streakRef = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 1 );
|
||||||
|
assert( streakRef != "" );
|
||||||
|
|
||||||
|
streakUseHint = tableLookupIString( KILLSTREAK_STRING_TABLE, 0, i, 6 );
|
||||||
|
assert( streakUseHint != &"" );
|
||||||
|
precacheString( streakUseHint );
|
||||||
|
|
||||||
|
streakEarnDialog = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 8 );
|
||||||
|
assert( streakEarnDialog != "" );
|
||||||
|
game[ "dialog" ][ streakRef ] = streakEarnDialog;
|
||||||
|
|
||||||
|
streakAlliesUseDialog = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 9 );
|
||||||
|
assert( streakAlliesUseDialog != "" );
|
||||||
|
game[ "dialog" ][ "allies_friendly_" + streakRef + "_inbound" ] = "use_" + streakAlliesUseDialog;
|
||||||
|
game[ "dialog" ][ "allies_enemy_" + streakRef + "_inbound" ] = "enemy_" + streakAlliesUseDialog;
|
||||||
|
|
||||||
|
streakAxisUseDialog = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 10 );
|
||||||
|
assert( streakAxisUseDialog != "" );
|
||||||
|
game[ "dialog" ][ "axis_friendly_" + streakRef + "_inbound" ] = "use_" + streakAxisUseDialog;
|
||||||
|
game[ "dialog" ][ "axis_enemy_" + streakRef + "_inbound" ] = "enemy_" + streakAxisUseDialog;
|
||||||
|
|
||||||
|
streakWeapon = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 12 );
|
||||||
|
precacheItem( streakWeapon );
|
||||||
|
|
||||||
|
streakPoints = int( tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 13 ) );
|
||||||
|
assert( streakPoints != 0 );
|
||||||
|
maps\mp\gametypes\_rank::registerScoreInfo( "killstreak_" + streakRef, streakPoints );
|
||||||
|
|
||||||
|
streakShader = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 14 );
|
||||||
|
precacheShader( streakShader );
|
||||||
|
|
||||||
|
streakShader = tableLookup( KILLSTREAK_STRING_TABLE, 0, i, 15 );
|
||||||
|
if ( streakShader != "" )
|
||||||
|
precacheShader( streakShader );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onPlayerConnect()
|
||||||
|
{
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
level waittill( "connected", player );
|
||||||
|
|
||||||
|
if( !isDefined ( player.pers[ "killstreaks" ] ) )
|
||||||
|
player.pers[ "killstreaks" ] = [];
|
||||||
|
|
||||||
|
player.lifeId = 0;
|
||||||
|
|
||||||
|
if ( isDefined( player.pers["deaths"] ) )
|
||||||
|
player.lifeId = player.pers["deaths"];
|
||||||
|
|
||||||
|
player VisionSetMissilecamForPlayer( game["thermal_vision"] );
|
||||||
|
|
||||||
|
player thread onPlayerSpawned();
|
||||||
|
player thread onPlayerChangeKit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onPlayerSpawned()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "spawned_player" );
|
||||||
|
self thread killstreakUseWaiter();
|
||||||
|
self thread waitForChangeTeam();
|
||||||
|
|
||||||
|
self giveOwnedKillstreakItem( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onPlayerChangeKit()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "changed_kit" );
|
||||||
|
self giveOwnedKillstreakItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
waitForChangeTeam()
|
||||||
|
{
|
||||||
|
self endon ( "disconnect" );
|
||||||
|
|
||||||
|
self notify ( "waitForChangeTeam" );
|
||||||
|
self endon ( "waitForChangeTeam" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill ( "joined_team" );
|
||||||
|
clearKillstreaks();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
isRideKillstreak( streakName )
|
||||||
|
{
|
||||||
|
switch( streakName )
|
||||||
|
{
|
||||||
|
case "helicopter_minigun":
|
||||||
|
case "helicopter_mk19":
|
||||||
|
case "ac130":
|
||||||
|
case "predator_missile":
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
isCarryKillstreak( streakName )
|
||||||
|
{
|
||||||
|
switch( streakName )
|
||||||
|
{
|
||||||
|
case "sentry":
|
||||||
|
case "sentry_gl":
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
deadlyKillstreak( streakName )
|
||||||
|
{
|
||||||
|
switch ( streakName )
|
||||||
|
{
|
||||||
|
case "predator_missile":
|
||||||
|
case "precision_airstrike":
|
||||||
|
case "harrier_airstrike":
|
||||||
|
//case "helicopter":
|
||||||
|
//case "helicopter_flares":
|
||||||
|
case "stealth_airstrike":
|
||||||
|
//case "helicopter_minigun":
|
||||||
|
case "ac130":
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
killstreakUsePressed()
|
||||||
|
{
|
||||||
|
streakName = self.pers["killstreaks"][0].streakName;
|
||||||
|
lifeId = self.pers["killstreaks"][0].lifeId;
|
||||||
|
isEarned = self.pers["killstreaks"][0].earned;
|
||||||
|
awardXp = self.pers["killstreaks"][0].awardXp;
|
||||||
|
|
||||||
|
assert( isDefined( streakName ) );
|
||||||
|
assert( isDefined( level.killstreakFuncs[ streakName ] ) );
|
||||||
|
|
||||||
|
if ( !self isOnGround() && ( isRideKillstreak( streakName ) || isCarryKillstreak( streakName ) ) )
|
||||||
|
return ( false );
|
||||||
|
|
||||||
|
if ( self isUsingRemote() )
|
||||||
|
return ( false );
|
||||||
|
|
||||||
|
if ( isDefined( self.selectingLocation ) )
|
||||||
|
return ( false );
|
||||||
|
|
||||||
|
if ( deadlyKillstreak( streakName ) && level.killstreakRoundDelay && getGametypeNumLives() )
|
||||||
|
{
|
||||||
|
if ( level.gracePeriod - level.inGracePeriod < level.killstreakRoundDelay )
|
||||||
|
{
|
||||||
|
self iPrintLnBold( &"MP_UNAVAILABLE_FOR_N", (level.killstreakRoundDelay - (level.gracePeriod - level.inGracePeriod)) );
|
||||||
|
return ( false );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (level.teamBased && level.teamEMPed[self.team]) || (!level.teamBased && isDefined( level.empPlayer ) && level.empPlayer != self) )
|
||||||
|
{
|
||||||
|
self iPrintLnBold( &"MP_UNAVAILABLE_WHEN_EMP" );
|
||||||
|
return ( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self IsUsingTurret() && ( isRideKillstreak( streakName ) || isCarryKillstreak( streakName ) ) )
|
||||||
|
{
|
||||||
|
self iPrintLnBold( &"MP_UNAVAILABLE_USING_TURRET" );
|
||||||
|
return ( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isDefined( self.lastStand ) && isRideKillstreak( streakName ) )
|
||||||
|
{
|
||||||
|
self iPrintLnBold( &"MP_UNAVILABLE_IN_LASTSTAND" );
|
||||||
|
return ( false );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !self isWeaponEnabled() )
|
||||||
|
return ( false );
|
||||||
|
|
||||||
|
if ( !self [[ level.killstreakFuncs[ streakName ] ]]( lifeId ) )
|
||||||
|
return ( false );
|
||||||
|
|
||||||
|
self usedKillstreak( streakName, awardXp );
|
||||||
|
self shuffleKillStreaksFILO( streakName );
|
||||||
|
self giveOwnedKillstreakItem();
|
||||||
|
|
||||||
|
return ( true );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//this overwrites killstreak at index 0 and decrements all other killstreaks (FCLS style)
|
||||||
|
shuffleKillStreaksFILO( streakName )
|
||||||
|
{
|
||||||
|
self _setActionSlot( 4, "" );
|
||||||
|
|
||||||
|
arraySize = self.pers["killstreaks"].size;
|
||||||
|
|
||||||
|
streakIndex = -1;
|
||||||
|
for ( i = 0; i < arraySize; i++ )
|
||||||
|
{
|
||||||
|
if ( self.pers["killstreaks"][i].streakName != streakName )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
streakIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
assert( streakIndex >= 0 );
|
||||||
|
|
||||||
|
self.pers["killstreaks"][streakIndex] = undefined;
|
||||||
|
|
||||||
|
for( i = streakIndex + 1; i < arraySize; i++ )
|
||||||
|
{
|
||||||
|
if ( i == arraySize - 1 )
|
||||||
|
{
|
||||||
|
self.pers["killstreaks"][i-1] = self.pers["killstreaks"][i];
|
||||||
|
self.pers["killstreaks"][i] = undefined;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.pers["killstreaks"][i-1] = self.pers["killstreaks"][i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
usedKillstreak( streakName, awardXp )
|
||||||
|
{
|
||||||
|
self playLocalSound( "weap_c4detpack_trigger_plr" );
|
||||||
|
|
||||||
|
if ( awardXp )
|
||||||
|
self thread [[ level.onXPEvent ]]( "killstreak_" + streakName );
|
||||||
|
|
||||||
|
self thread maps\mp\gametypes\_missions::useHardpoint( streakName );
|
||||||
|
|
||||||
|
awardref = maps\mp\_awards::getKillstreakAwardRef( streakName );
|
||||||
|
if ( isDefined( awardref ) )
|
||||||
|
self thread incPlayerStat( awardref, 1 );
|
||||||
|
|
||||||
|
team = self.team;
|
||||||
|
|
||||||
|
if ( level.teamBased )
|
||||||
|
{
|
||||||
|
thread leaderDialog( team + "_friendly_" + streakName + "_inbound", team );
|
||||||
|
|
||||||
|
if ( getKillstreakInformEnemy( streakName ) )
|
||||||
|
thread leaderDialog( team + "_enemy_" + streakName + "_inbound", level.otherTeam[ team ] );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self thread leaderDialogOnPlayer( team + "_friendly_" + streakName + "_inbound" );
|
||||||
|
|
||||||
|
if ( getKillstreakInformEnemy( streakName ) )
|
||||||
|
{
|
||||||
|
excludeList[0] = self;
|
||||||
|
thread leaderDialog( team + "_enemy_" + streakName + "_inbound", undefined, undefined, excludeList );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
clearKillstreaks()
|
||||||
|
{
|
||||||
|
foreach ( index, streakStruct in self.pers["killstreaks"] )
|
||||||
|
self.pers["killstreaks"][index] = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
killstreakUseWaiter()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "finish_death" );
|
||||||
|
level endon( "game_ended" );
|
||||||
|
|
||||||
|
self.lastKillStreak = 0;
|
||||||
|
if ( !isDefined( self.pers["lastEarnedStreak"] ) )
|
||||||
|
self.pers["lastEarnedStreak"] = undefined;
|
||||||
|
|
||||||
|
self thread finishDeathWaiter();
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill ( "weapon_change", newWeapon );
|
||||||
|
|
||||||
|
if ( !isAlive( self ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( !isDefined( self.pers["killstreaks"][0] ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( newWeapon != getKillstreakWeapon( self.pers["killstreaks"][0].streakName ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
waittillframeend;
|
||||||
|
|
||||||
|
streakName = self.pers["killstreaks"][0].streakName;
|
||||||
|
result = self killstreakUsePressed();
|
||||||
|
|
||||||
|
//no force switching weapon for ridable killstreaks
|
||||||
|
if ( !isRideKillstreak( streakName ) || !result )
|
||||||
|
self switchToWeapon( self getLastWeapon() );
|
||||||
|
|
||||||
|
// give time to switch to the near weapon; when the weapon is none (such as during a "disableWeapon()" period
|
||||||
|
// re-enabling the weapon immediately does a "weapon_change" to the killstreak weapon we just used. In the case that
|
||||||
|
// we have two of that killstreak, it immediately uses the second one
|
||||||
|
if ( self getCurrentWeapon() == "none" )
|
||||||
|
{
|
||||||
|
while ( self getCurrentWeapon() == "none" )
|
||||||
|
wait ( 0.05 );
|
||||||
|
|
||||||
|
waittillframeend;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
finishDeathWaiter()
|
||||||
|
{
|
||||||
|
self endon ( "disconnect" );
|
||||||
|
|
||||||
|
self waittill ( "death" );
|
||||||
|
wait ( 0.05 );
|
||||||
|
self notify ( "finish_death" );
|
||||||
|
self.pers["lastEarnedStreak"] = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
checkKillstreakReward( streakCount )
|
||||||
|
{
|
||||||
|
self notify( "got_killstreak", streakCount );
|
||||||
|
|
||||||
|
maxVal = 0;
|
||||||
|
killStreaks = [];
|
||||||
|
foreach ( streakVal, streakName in self.killStreaks )
|
||||||
|
{
|
||||||
|
killStreaks[streakName] = streakVal;
|
||||||
|
if ( streakVal > maxVal )
|
||||||
|
maxVal = streakVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ( streakVal, streakName in self.killStreaks )
|
||||||
|
{
|
||||||
|
actualVal = streakVal + level.killStreakMod;
|
||||||
|
|
||||||
|
if ( actualVal > streakCount )
|
||||||
|
break;
|
||||||
|
|
||||||
|
if ( isDefined( self.pers["lastEarnedStreak"] ) && killStreaks[streakName] <= killStreaks[self.pers["lastEarnedStreak"]] )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( isSubStr( streakName, "-rollover" ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
/*
|
||||||
|
if ( game["defcon"] > 2 )
|
||||||
|
{
|
||||||
|
self.pers["lastEarnedStreak"] = streakName;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
useStreakName = strTok( streakName, "-" )[0];
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
useStreakName = streakName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self tryGiveKillstreak( useStreakName, int(max( actualVal, streakCount )) ) )
|
||||||
|
{
|
||||||
|
self thread killstreakEarned( useStreakName );
|
||||||
|
self.pers["lastEarnedStreak"] = streakName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
killstreakEarned( streakName )
|
||||||
|
{
|
||||||
|
if ( self getPlayerData( "killstreaks", 0 ) == streakName )
|
||||||
|
{
|
||||||
|
self.firstKillstreakEarned = getTime();
|
||||||
|
}
|
||||||
|
else if ( self getPlayerData( "killstreaks", 2 ) == streakName && isDefined( self.firstKillstreakEarned ) )
|
||||||
|
{
|
||||||
|
if ( getTime() - self.firstKillstreakEarned < 20000 )
|
||||||
|
self thread maps\mp\gametypes\_missions::genericChallenge( "wargasm" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rewardNotify( streakName, streakVal )
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
self maps\mp\gametypes\_hud_message::killstreakSplashNotify( streakName, streakVal );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tryGiveKillstreak( streakName, streakVal )
|
||||||
|
{
|
||||||
|
level notify ( "gave_killstreak", streakName );
|
||||||
|
|
||||||
|
if ( !level.gameEnded )
|
||||||
|
self thread rewardNotify( streakName, streakVal );
|
||||||
|
|
||||||
|
self giveKillstreak( streakName, streakVal, true );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
giveKillstreak( streakName, isEarned, awardXp, owner )
|
||||||
|
{
|
||||||
|
self endon ( "disconnect" );
|
||||||
|
|
||||||
|
weapon = getKillstreakWeapon( streakName );
|
||||||
|
|
||||||
|
self giveKillstreakWeapon( weapon );
|
||||||
|
|
||||||
|
// shuffle existing killstreaks up a notch
|
||||||
|
for( i = self.pers["killstreaks"].size; i >= 0; i-- )
|
||||||
|
self.pers["killstreaks"][i + 1] = self.pers["killstreaks"][i];
|
||||||
|
|
||||||
|
self.pers["killstreaks"][0] = spawnStruct();
|
||||||
|
self.pers["killstreaks"][0].streakName = streakName;
|
||||||
|
self.pers["killstreaks"][0].earned = isDefined( isEarned ) && isEarned;
|
||||||
|
self.pers["killstreaks"][0].awardxp = isDefined( awardXp ) && awardXp;
|
||||||
|
self.pers["killstreaks"][0].owner = owner;
|
||||||
|
if ( !self.pers["killstreaks"][0].earned )
|
||||||
|
self.pers["killstreaks"][0].lifeId = -1;
|
||||||
|
else
|
||||||
|
self.pers["killstreaks"][0].lifeId = self.pers["deaths"];
|
||||||
|
|
||||||
|
// probably obsolete unless we bring back the autoshotty
|
||||||
|
if ( isdefined( level.killstreakSetupFuncs[ streakName ] ) )
|
||||||
|
self [[ level.killstreakSetupFuncs[ streakName ] ]]();
|
||||||
|
|
||||||
|
if ( isDefined( isEarned ) && isEarned && isDefined( awardXp ) && awardXp )
|
||||||
|
self notify( "received_earned_killstreak" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
giveKillstreakWeapon( weapon )
|
||||||
|
{
|
||||||
|
weaponList = self getWeaponsListItems();
|
||||||
|
|
||||||
|
foreach ( item in weaponList )
|
||||||
|
{
|
||||||
|
if ( !isSubStr( item, "killstreak" ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( self getCurrentWeapon() == item )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
self takeWeapon( item );
|
||||||
|
}
|
||||||
|
|
||||||
|
self _giveWeapon( weapon, 0 );
|
||||||
|
self _setActionSlot( 4, "weapon", weapon );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getStreakCost( streakName )
|
||||||
|
{
|
||||||
|
return int( tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 4 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getKillstreakHint( streakName )
|
||||||
|
{
|
||||||
|
return tableLookupIString( KILLSTREAK_STRING_TABLE, 1, streakName, 6 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getKillstreakInformEnemy( streakName )
|
||||||
|
{
|
||||||
|
return int( tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 11 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getKillstreakSound( streakName )
|
||||||
|
{
|
||||||
|
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 7 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getKillstreakDialog( streakName )
|
||||||
|
{
|
||||||
|
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 8 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getKillstreakWeapon( streakName )
|
||||||
|
{
|
||||||
|
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 12 );
|
||||||
|
}
|
||||||
|
|
||||||
|
getKillstreakIcon( streakName )
|
||||||
|
{
|
||||||
|
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 14 );
|
||||||
|
}
|
||||||
|
|
||||||
|
getKillstreakCrateIcon( streakName )
|
||||||
|
{
|
||||||
|
return tableLookup( KILLSTREAK_STRING_TABLE, 1, streakName, 15 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
giveOwnedKillstreakItem( skipDialog )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.pers["killstreaks"][0] ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
streakName = self.pers["killstreaks"][0].streakName;
|
||||||
|
|
||||||
|
weapon = getKillstreakWeapon( streakName );
|
||||||
|
self giveKillstreakWeapon( weapon );
|
||||||
|
|
||||||
|
if ( !isDefined( skipDialog ) && !level.inGracePeriod )
|
||||||
|
self leaderDialogOnPlayer( streakName, "killstreak_earned" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
initRideKillstreak()
|
||||||
|
{
|
||||||
|
self _disableUsability();
|
||||||
|
result = self initRideKillstreak_internal();
|
||||||
|
|
||||||
|
if ( isDefined( self ) )
|
||||||
|
self _enableUsability();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
initRideKillstreak_internal()
|
||||||
|
{
|
||||||
|
laptopWait = self waittill_any_timeout( 1.0, "disconnect", "death", "weapon_switch_started" );
|
||||||
|
|
||||||
|
if ( laptopWait == "weapon_switch_started" )
|
||||||
|
return ( "fail" );
|
||||||
|
|
||||||
|
if ( !isAlive( self ) )
|
||||||
|
return "fail";
|
||||||
|
|
||||||
|
if ( laptopWait == "disconnect" || laptopWait == "death" )
|
||||||
|
{
|
||||||
|
if ( laptopWait == "disconnect" )
|
||||||
|
return ( "disconnect" );
|
||||||
|
|
||||||
|
if ( self.team == "spectator" )
|
||||||
|
return "fail";
|
||||||
|
|
||||||
|
return ( "success" );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self isEMPed() || self isNuked() )
|
||||||
|
{
|
||||||
|
return ( "fail" );
|
||||||
|
}
|
||||||
|
|
||||||
|
self VisionSetNakedForPlayer( "black_bw", 0.75 );
|
||||||
|
blackOutWait = self waittill_any_timeout( 0.80, "disconnect", "death" );
|
||||||
|
|
||||||
|
if ( blackOutWait != "disconnect" )
|
||||||
|
{
|
||||||
|
self thread clearRideIntro( 1.0 );
|
||||||
|
|
||||||
|
if ( self.team == "spectator" )
|
||||||
|
return "fail";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !isAlive( self ) )
|
||||||
|
return "fail";
|
||||||
|
|
||||||
|
if ( self isEMPed() || self isNuked() )
|
||||||
|
return "fail";
|
||||||
|
|
||||||
|
if ( blackOutWait == "disconnect" )
|
||||||
|
return ( "disconnect" );
|
||||||
|
else
|
||||||
|
return ( "success" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
clearRideIntro( delay )
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
|
||||||
|
if ( isDefined( delay ) )
|
||||||
|
wait( delay );
|
||||||
|
|
||||||
|
//self freezeControlsWrapper( false );
|
||||||
|
|
||||||
|
if ( !isDefined( level.nukeVisionInProgress ) )
|
||||||
|
self VisionSetNakedForPlayer( getDvar( "mapname" ), 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue