Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*************************************************************************************************************************************************************************************************************************************************************
- * Infected - Unreleased *
- * *
- * Overall Credits: *
- * Rendflex main coder. *
- * DidUknowiPwn/Intricate rewriting & updating. *
- * momo5502 for assistance. *
- * JoeyB for assistance. *
- * Puffiamo for C4/Claymore Pickup code. *
- * *
- * © 2013 DidUknowiPwn ™ *
- * Do not edit this mod without contacting us: Rendflex & Intricate. Our Steam are: Intricate & Rendflex. If you do, you will be in trouble. *
- *************************************************************************************************************************************************************************************************************************************************************/
- #include maps\mp\_utility;
- #include maps\mp\gametypes\_hud_util;
- #include common_scripts\utility;
- main()
- {
- maps\mp\gametypes\_globallogic::init();
- maps\mp\gametypes\_callbacksetup::SetupCallbacks();
- maps\mp\gametypes\_globallogic::SetupCallbacks();
- registerRoundSwitchDvar( level.gameType, 0, 0, 9 );
- registerTimeLimitDvar( level.gameType, 10, 0, 1440 );
- registerScoreLimitDvar( level.gameType, 500, 0, 5000 );
- registerRoundLimitDvar( level.gameType, 1, 0, 10 );
- registerWinLimitDvar( level.gameType, 1, 0, 10 );
- registerRoundSwitchDvar( level.gameType, 3, 0, 30 );
- registerNumLivesDvar( level.gameType, 0, 0, 10 );
- registerHalfTimeDvar( level.gameType, 0, 0, 1 );
- level.teamBased = true;
- level.doPrematch = true;
- level.onPrecacheGameType = ::onPrecacheGameType;
- level.onStartGameType = ::onStartGameType;
- level.onSpawnPlayer = ::onSpawnPlayer;
- level.getSpawnPoint = ::getSpawnPoint;
- level.onPlayerKilled = ::onPlayerKilled;
- level.onTimeLimit = ::onTimeLimit;
- }
- onPrecacheGameType()
- {
- //Shaders
- PrecacheShader("specialty_marathon");
- PrecacheShader("specialty_fastreload");
- PrecacheShader("specialty_lightweight");
- PrecacheShader("specialty_scavenger");
- PrecacheShader("specialty_bulletdamage");
- PrecacheShader("specialty_coldblooded");
- PrecacheShader("specialty_dangerclose");
- PrecacheShader("specialty_commando");
- PrecacheShader("specialty_steadyaim");
- PrecacheShader("specialty_bulletaccuracy");
- PrecacheShader("specialty_detectexplosive");
- PrecacheShader("specialty_heartbreaker");
- PrecacheShader("specialty_localjammer");
- PrecacheShader("specialty_quieter");
- PrecacheShader("specialty_bombsquad");
- PrecacheShader("specialty_hardline");
- PrecacheShader("specialty_onemanarmy_upgrade");
- //Strings
- PrecacheString( &"PERKS_MARATHON" );
- PrecacheString( &"PERKS_SLEIGHT_OF_HAND" );
- PrecacheString( &"PERKS_SCAVENGER" );
- //--
- PrecacheString( &"PERKS_STOPPING_POWER" );
- PrecacheString( &"PERKS_LIGHTWEIGHT" );
- PrecacheString( &"PERKS_COLDBLOODED" );
- PrecacheString( &"PERKS_DANGERCLOSE" );
- //--
- PrecacheString( &"PERKS_EXTENDEDMELEE" );
- PrecacheString( &"PERKS_STEADY_AIM" );
- PrecacheString( &"PERKS_LOCALJAMMER" );
- PrecacheString( &"PERKS_NINJA" );
- }
- onStartGameType()
- {
- setClientNameMode("auto_change");
- setObjectiveText( "allies", "Watch your back." );
- setObjectiveText( "axis", "Infect the Surviviors!" );
- if ( level.splitscreen )
- {
- setObjectiveScoreText( "allies", "Survive the Infected!" );
- setObjectiveScoreText( "axis", "Infect the Survivors!" );
- }
- else
- {
- setObjectiveScoreText( "allies", "Survive the Infected!" );
- setObjectiveScoreText( "axis", "Infect all Survivors to win!" );
- }
- setObjectiveHintText( "allies", "Watch your back." );
- setObjectiveHintText( "axis", "Infect the Survivors!" );
- level.spawnMins = ( 0, 0, 0 );
- level.spawnMaxs = ( 0, 0, 0 );
- maps\mp\gametypes\_spawnlogic::addSpawnPoints( "allies", "mp_dm_spawn" );
- maps\mp\gametypes\_spawnlogic::addSpawnPoints( "axis", "mp_dm_spawn" );
- level.mapCenter = maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs );
- setMapCenter( level.mapCenter );
- allowed = [];
- maps\mp\gametypes\_gameobjects::main(allowed);
- maps\mp\gametypes\_rank::registerScoreInfo( "final_rogue", 200 );
- maps\mp\gametypes\_rank::registerScoreInfo( "draft_rogue", 100 );
- maps\mp\gametypes\_rank::registerScoreInfo( "survivor", 100 );
- SetDvars();
- level.infect_timerDisplay = createServerTimer( "objective", 1.4 );
- level.infect_timerDisplay setPoint( "TOPLEFT", "TOPLEFT", 115, 5 );
- level.infect_timerDisplay.label = &"";
- level.infect_timerDisplay.alpha = 0;
- level.infect_timerDisplay.archived = false;
- level.infect_timerDisplay.hideWhenInMenu = true;
- level.infect_choseFirstInfected = false;
- level.infect_choosingFirstInfected = false;
- level thread onPlayerConnect();
- level thread SetupAlliesClass();
- }
- getSpawnPoint()
- {
- if ( level.inGracePeriod )
- {
- spawnPoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_dm_spawn" );
- spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random( spawnPoints );
- }
- else
- {
- spawnPoints = maps\mp\gametypes\_spawnlogic::getTeamSpawnPoints( self.pers["team"] );
- spawnPoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_NearTeam( spawnPoints );
- }
- return spawnPoint;
- }
- SetDvars()
- {
- SetDvar( "g_TeamName_Allies", "Survivors" );
- SetDvar( "g_TeamName_Axis", "Infected" );
- SetDvar( "ui_allow_teamchange", 0 );
- SetDvar("scr_game_hardpoints", 0);
- SetDvar("scr_teambalance", 0);
- SetDvarIfUninitialized("moab", 1);
- SetDvarIfUninitialized("scr_infected_pick_time", 15);
- SetDvarIfUninitialized("scr_infected_allow_inf_tk", 1);
- SetDvarIfUninitialized("scr_infected_allow_inf_tactical_insertion", 1);
- SetDvarIfUninitialized("scr_infected_allow_allies_equipment", 1);
- SetDvarIfUninitialized("scr_infected_allow_allies_starting_perks", 1);
- SetDvarIfUninitialized("scr_infected_allow_allies_specialist", 1);
- SetDvarIfUninitialized("scr_infected_allies_attachments", 1);
- }
- onTimeLimit()
- {
- level.finalKillCam_winner = "allies";
- level thread maps\mp\gametypes\_gamelogic::endGame( "allies", game["strings"]["time_limit_reached"] );
- }
- onPlayerConnect()
- {
- for(;;)
- {
- level waittill( "connected", player );
- player thread onPlayerDisconnect();
- player.hud_EventPopup = player createEventPopup();
- player thread DeleteOnEndGame();
- }
- }
- onPlayerDisconnect()
- {
- level endon("game_ended");
- for(;;)
- {
- self waittill ( "disconnect" );
- if ( isDefined( level.infect_isBeingChosen ) || level.infect_choseFirstInfected )
- {
- if ( getNumSurvivors() == 0 )
- {
- level thread inf_endGame( "axis", "Survivors eliminated." );
- }
- else if ( getNumInfected() == 0 )
- {
- level.infect_choseFirstInfected = false;
- level thread chooseFirstInfected();
- }
- }
- updateTeamScores();
- }
- }
- onSpawnPlayer()
- {
- if ( !level.infect_choosingFirstInfected && getNumSurvivors() > 1 )
- {
- level.infect_choosingFirstInfected = true;
- level thread chooseFirstInfected();
- iprintln("1");
- }
- //code broken somewhere in choosefirstinfected
- updateTeamScores();
- if( self.team == "allies" )
- {
- self iprintln("set allies class");
- self thread SetSurvivorClass();
- self iprintln("14");
- }
- else if( self.team == "axis" )
- {
- self iprintln("set axis class");
- self thread SetInfectedClass();
- self iprintln("15");
- }
- self iprintln("4");
- self iprintln( level.infc_primaryWep );
- self iprintln( level.infc_secondaryWep );
- }
- onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration, lifeId )
- {
- if ( isDefined( attacker ) && self.team == "allies" && level.infect_choseFirstInfected == true )
- {
- wait 0.1;
- iprintln("12");
- playSoundOnPlayers( "mp_enemy_obj_captured", "allies" );
- playSoundOnPlayers( "mp_war_objective_taken", "axis" );
- self maps\mp\gametypes\_menus::addToTeam( "axis" );
- self thread EventPopup( "Infected!", (1,0,0), 1 );
- attacker thread EventPopup( "Infected!", (1,0,0), 1 );
- numSurvivors = getNumSurvivors();
- if( numSurvivors > 1 )
- {
- foreach ( player in level.players )
- {
- if ( player.team == "allies" )
- {
- player thread EventPopup( "Survivor!" );
- player iprintln("16");
- }
- break;
- }
- }
- if( numSurvivors == 1 )
- {
- foreach ( player in level.players )
- {
- if ( player.team == "allies" )
- {
- player thread EventPopup( "Last Alive!" );
- level thread teamPlayerCardSplash( "callout_lastteammemberalive", player, "allies" );
- level thread teamPlayerCardSplash( "callout_lastenemyalive", player, "axis" );
- player iprintln("17");
- }
- break;
- }
- }
- else if( numSurvivors == 0 )
- {
- attacker.finalKill = true;
- level thread inf_endGame( "axis", "Survivors eliminated.");
- attacker iprintln("18");
- self iprintln("18");
- }
- updateTeamScores();
- }
- if ( isDefined( attacker ) && attacker.team == "allies" && level.infect_choseFirstInfected == true && getDvarInt("scr_infected_allow_allies_specialist") == 1 )
- {
- if( attacker.pers["cur_kill_streak"] == 2 )
- {
- attacker.ksOneIcon.alpha = 1;
- attacker _SetPerk( level.infc_SpecialistPerk1 );
- attacker Specialist( getPerkString( level.infc_SpecialistPerk1 ), GetGoodColor(), getPerkMaterial( level.infc_SpecialistPerk1 ) );
- }
- else if( attacker.pers["cur_kill_streak"] == 4 )
- {
- attacker.ksTwoIcon.alpha = 1;
- attacker _SetPerk( level.infc_SpecialistPerk2 );
- attacker Specialist( getPerkString( level.infc_SpecialistPerk2 ), GetGoodColor(), getPerkMaterial( level.infc_SpecialistPerk2 ) );
- }
- else if( attacker.pers["cur_kill_streak"] == 6 )
- {
- attacker.ksThrIcon.alpha = 1;
- attacker _SetPerk( level.infc_SpecialistPerk3 );
- attacker Specialist( getPerkString( level.infc_SpecialistPerk3 ), GetGoodColor(), getPerkMaterial( level.infc_SpecialistPerk3 ) );
- }
- else if( attacker.pers["cur_kill_streak"] == 8 )
- {
- attacker.ksForIcon.alpha = 1;
- attacker setAllPerks();
- attacker Specialist( "Specialist Bonus", GetGoodColor(), level.infc_Specialist );
- }
- else if( attacker.pers["cur_kill_streak"] == 24 && getDvarInt( "moab" ) == 1 )
- {
- attacker maps\mp\killstreaks\_killstreaks::giveKillstreak( "nuke", true );
- attacker thread maps\mp\gametypes\_hud_message::killstreakSplashNotify( "nuke", 24 );
- }
- }
- iprintln("13");
- }
- Specialist( text, glowColor, shader )
- {
- self endon("disconnect");
- self PlayLocalSound("mp_bonus_start");
- self.DatText = createFontString( "hudsmall", "1" );
- self.DatText setPoint( "TOP", undefined, 0, 100 );
- self.DatIcon = createIcon( "white", 45, 45 );
- self.DatIcon setPoint( "TOP", undefined, 0, 105 );
- self.DatIcon.alpha = 0;
- self.DatText.glowColor = glowColor;
- self.DatText.glowAlpha = 0.2;
- self.DatText.hideWhenInMenu = false;
- self.DatText.archived = false;
- self.DatText.notifyText = text;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( self.DatText );
- self.DatIcon setShader( shader, 45, 45 );
- self.DatIcon.sort = 100;
- self.DatText fadeOverTime( 0.75 );
- self.DatIcon fadeOverTime( 0.75 );
- self.DatIcon.alpha = 1;
- self.DatText.alpha = 1;
- wait ( 1.0 );
- self.DatText fadeOverTime( 6 );
- self.DatIcon fadeOverTime( 6 );
- self.DatText.alpha = 0;
- self.DatIcon.alpha = 0;
- }
- SetTeam()
- {
- if( level.infect_choseFirstInfected == true && level.infect_isBeingChosen == false )
- {
- wait 0.01;
- self notify("menuresponse", game["menu_team"], "axis");
- wait 0.01;
- self notify("menuresponse", "changeclass", "class1");
- wait 0.01;
- iprintln("0");
- }
- else
- {
- wait 0.01;
- self notify("menuresponse", game["menu_team"], "allies");
- wait 0.01;
- self notify("menuresponse", "changeclass", "class1");
- wait 0.01;
- iprintln("0.5");
- }
- }
- chooseFirstInfected()
- {
- level endon( "game_ended" );
- gameFlagWait( "prematch_done" );
- iprintln("9");
- level.infect_timerDisplay.label = &"Infection countdown: ";
- level.infect_timerDisplay setTimer( getDvarInt( "scr_infected_pick_time" ) );
- level.infect_timerDisplay.alpha = 1;
- level.infect_isBeingChosen = true;
- maps\mp\gametypes\_hostmigration::waitLongDurationWithHostMigrationPause( getDvarInt( "scr_infected_pick_time" ) );
- level.infect_timerDisplay.alpha = 0;
- iprintln("10");
- first = level.players[ randomInt( level.players.size ) ];
- first endon( "disconnect" );
- while( !isAlive( first ) )
- wait( 0.05 );
- first maps\mp\gametypes\_menus::addToTeam( "axis" );
- first thread SetInfectedClass();
- first [[game["axis_model"]["SMG"]]]();
- level.infect_choseFirstInfected = true;
- level.infect_isBeingChosen = false;
- first.isInitialInfected = true;
- updateTeamScores();
- playSoundOnPlayers( "mp_enemy_obj_captured", "allies" );
- playSoundOnPlayers( "mp_war_objective_taken", "axis" );
- iprintln("11");
- }
- SetupAlliesClass()
- {
- level.infc_primaryWep = getRandomPrimary( randomInt(4) );
- level.infc_secondaryWep = getRandomSecondary( randomInt(6) );
- if( getDvarInt( "scr_infected_allow_allies_starting_perks" ) == 1 )
- {
- level.infc_StartingPerk1 = getRandomPerk( 0 );
- level.infc_StartingPerk2 = getRandomPerk( 1 );
- level.infc_StartingPerk3 = getRandomPerk( 2 );
- }
- if( getDvarInt( "scr_infected_allow_allies_specialist" ) == 1 )
- {
- level.infc_SpecialistPerk1 = getRandomPerk( 0 );
- level.infc_SpecialistPerk2 = getRandomPerk( 1 );
- level.infc_SpecialistPerk3 = getRandomPerk( 2 );
- level.infc_Specialist = "specialty_onemanarmy_upgrade";
- }
- while( level.infc_StartingPerk1 == level.infc_SpecialistPerk1 )
- {
- level.infc_SpecialistPerk1 = getRandomPerk( 0 );
- wait 0.01;
- }
- while( level.infc_StartingPerk2 == level.infc_SpecialistPerk2 )
- {
- level.infc_SpecialistPerk2 = getRandomPerk( 1 );
- wait 0.01;
- }
- while( level.infc_StartingPerk3 == level.infc_SpecialistPerk3 )
- {
- level.infc_SpecialistPerk3 = getRandomPerk( 2 );
- wait 0.01;
- }
- }
- SetSurvivorClass()
- {
- self iprintln("2");
- wait 0.2;
- self takeAllWeapons();
- self clearPerks();
- self thread SpecialistList();
- self giveWeapon( level.infc_primaryWep, randomInt(9), true );
- self giveWeapon( level.infc_secondaryWep, randomInt(4), true );
- self switchToWeapon( level.infc_primaryWep );
- if( getDvarInt( "scr_infected_allow_allies_starting_perks" ) == 1 )
- {
- self _SetPerk( level.infc_StartingPerk1 );
- self _SetPerk( level.infc_StartingPerk2 );
- self _SetPerk( level.infc_StartingPerk3 );
- }
- if( WeaponClass( level.infc_primaryWep ) == "sniper" )
- self [[game["axis_model"]["GHILLIE"]]]();
- }
- SetInfectedClass()
- {
- self iprintln("3");
- wait 0.2;
- self takeAllWeapons();
- self clearPerks();
- self GiveWeapon("usp_tactical_mp");
- self SetWeaponAmmoClip("usp_tactical_mp", 0);
- self SetWeaponAmmoStock("usp_tactical_mp", 0);
- self SetSpawnWeapon("usp_tactical_mp");
- if( getDvarInt( "scr_infected_allow_inf_tk" ) == 1 && getNumInfected() <= 1 )
- {
- self GiveWeapon("throwingknife_mp");
- self _SetPerk("throwingknife_mp");
- self SetOffhandPrimaryClass( "throwingknife" );
- }
- if( getDvarInt( "scr_infected_allow_inf_tactical_insertion" ) == 1 )
- {
- self _SetPerk( "specialty_tacticalinsertion" );
- self SetActionslot( 3, "weapon", "flare_mp" );
- }
- self _SetPerk("specialty_marathon"); //Marathon
- self _SetPerk("specialty_fastmantle"); //Marathon Pro
- self _SetPerk("specialty_lightweight"); //Lightweight
- }
- SpecialistList()
- {
- self iprintln("5");
- self thread CurrentKS();
- self thread DeleteKSIcons();
- level.infc_SpecialistPerk1M = getPerkMaterial( level.infc_SpecialistPerk1 );
- level.infc_SpecialistPerk2M = getPerkMaterial( level.infc_SpecialistPerk2 );
- level.infc_SpecialistPerk3M = getPerkMaterial( level.infc_SpecialistPerk3 );
- self.ksOneIcon = createKSIcon( level.infc_SpecialistPerk1M, -90 );
- self.ksTwoIcon = createKSIcon( level.infc_SpecialistPerk2M, -115 );
- self.ksThrIcon = createKSIcon( level.infc_SpecialistPerk3M, -140 );
- self.ksForIcon = createKSIcon( level.infc_Specialist, -165 );
- }
- DeleteKSIcons()
- {
- self waittill_either( "death", "joined_team" );
- self iprintln("6");
- self.ksOneIcon.alpha = 0;
- self.ksTwoIcon.alpha = 0;
- self.ksThrIcon.alpha = 0;
- self.ksForIcon.alpha = 0;
- self.streak.alpha = 0;
- }
- CurrentKS()
- {
- self.streak = self createFontString( "hudsmall", 0.8 );
- self.streak setPoint("TOPLEFT", "TOPLEFT", 5, 110);
- self.streak.hidewheninmenu = true;
- self.streak.alpha = 1;
- self iprintln("7");
- for(;;)
- {
- self waittill( "killed_enemy" );
- self.streak setText( "Killstreak: " + self.pers["cur_kill_streak"] );
- self iprintln("8");
- }
- }
- createKSIcon(ksShader, y)
- {
- ksIcon = createIcon( ksShader, 20, 20 );
- ksIcon setPoint( "BOTTOM RIGHT", "BOTTOM RIGHT", -32, y );
- ksIcon.alpha = 0.5;
- ksIcon.hideWhenInMenu = true;
- ksIcon.foreground = true;
- return ksIcon;
- }
- createEventPopup()
- {
- hud_EventPopup = newClientHudElem( self );
- hud_EventPopup.children = [];
- hud_EventPopup.horzAlign = "center";
- hud_EventPopup.vertAlign = "middle";
- hud_EventPopup.alignX = "center";
- hud_EventPopup.alignY = "middle";
- hud_EventPopup.x = 50;
- hud_EventPopup.y = -35;
- hud_EventPopup.font = "hudbig";
- hud_EventPopup.fontscale = 0.65;
- hud_EventPopup.archived = false;
- hud_EventPopup.color = (0.5,0.5,0.5);
- hud_EventPopup.sort = 10000;
- hud_EventPopup.elemType = "msgText";
- hud_EventPopup maps\mp\gametypes\_hud::fontPulseInit( 3.0 );
- return hud_EventPopup;
- }
- EventPopup( event, hudColor, glowAlpha )
- {
- self endon( "disconnect" );
- self notify( "EventPopup" );
- self endon( "EventPopup" );
- wait ( 0.05 );
- if ( !isDefined( hudColor ) )
- hudColor = (1,1,0.5);
- if ( !isDefined( glowAlpha ) )
- glowAlpha = 0;
- self.hud_EventPopup.color = hudColor;
- self.hud_EventPopup.glowColor = hudColor;
- self.hud_EventPopup.glowAlpha = glowAlpha;
- self.hud_EventPopup setText(event);
- self.hud_EventPopup.alpha = 0.85;
- wait ( 1.0 );
- self.hud_EventPopup fadeOverTime( 0.75 );
- self.hud_EventPopup.alpha = 0;
- }
- inf_endGame( winningTeam, endReasonText )
- {
- thread maps\mp\gametypes\_gamelogic::endGame( winningTeam, endReasonText );
- }
- updateTeamScores()
- {
- game["teamScores"]["axis"] = getNumInfected();
- setTeamScore( "axis", getNumInfected() );
- game["teamScores"]["allies"] = getNumSurvivors();
- setTeamScore( "allies", getNumSurvivors() );
- }
- getNumInfected()
- {
- numInfected = 0;
- foreach ( player in level.players )
- {
- if ( player.team == "axis" )
- numInfected++;
- }
- return numInfected;
- }
- getNumSurvivors()
- {
- numSurvivors = 0;
- foreach ( player in level.players )
- {
- if ( player.team == "allies" )
- numSurvivors++;
- }
- return numSurvivors;
- }
- getRandomPrimary( type )
- {
- primary = [];
- attachment = [];
- primary[primary.size] = strTok("ak47_,fal_,famas_,m4_,fn2000_,m16_,masada_,scar_,tavor_", ","); //AR
- primary[primary.size] = strTok("kriss_,mp5k_,p90_,uzi_,ump45_,", ","); //SMG
- primary[primary.size] = strTok("rpd_,sa80_,aug_,mg4_,m240_", ","); //LMG
- primary[primary.size] = strTok("barrett_,m21_,cheytac_,wa2000_", ","); //SNIPER
- attachment[attachment.size] = strTok("acog_mp,eotech_mp,fmj_mp,reflex_mp,thermal_mp,xmags_mp,heartbeat_mp", ","); //AR
- attachment[attachment.size] = strTok("acog_mp,eotech_mp,fmj_mp,reflex_mp,thermal_mp,xmags_mp,rof_mp,akimbo_mp", ","); //SMG
- attachment[attachment.size] = strTok("acog_mp,eotech_mp,fmj_mp,reflex_mp,thermal_mp,xmags_mp,heartbeat_mp,grip_mp", ","); //LMG
- attachment[attachment.size] = strTok("acog_mp,fmj_mp,thermal_mp,xmags_mp,heartbeat_mp", ","); //SNIPER
- if( getDvarInt( "scr_infected_allies_attachments" ) == 1 )
- return primary[type][randomInt(primary[type].size)] + attachment[type][randomInt(attachment[type].size)];
- else
- return primary[type][randomInt(primary[type].size)] + "mp";
- }
- getRandomSecondary( type )
- {
- secondary = [];
- attachment = [];
- secondary[secondary.size] = strTok("aa12_,striker_,spas12_,m1014_", ","); //Shotgun
- secondary[secondary.size] = strTok("model1887_,ranger_,", ","); //Special Shotguns
- secondary[secondary.size] = strTok("usp_,beretta_", ","); //Pistol
- secondary[secondary.size] = strTok("deserteagle_,coltanaconda_", ","); //Special Pistols
- secondary[secondary.size] = strTok("tmp_,beretta393_,", ","); //Machine Pistol
- secondary[secondary.size] = strTok("glock_,pp2000_,", ","); //Special Machine Pistols
- attachment[attachment.size] = strTok("eotech_mp,reflex_mp,fmj_mp,grip_mp,xmags_mp", ","); //Shotgun
- attachment[attachment.size] = strTok("akimbo_mp,fmj_mp", ","); //Special Shotgun
- attachment[attachment.size] = strTok("tactical_mp,fmj_mp,xmags_mp", ","); //Pistol
- attachment[attachment.size] = strTok("tactical_mp,fmj_mp", ","); //Special Pistol
- attachment[attachment.size] = strTok("reflex_mp,fmj_mp,xmags_mp,akimbo_mp", ","); //Machine Pistol
- attachment[attachment.size] = strTok("reflex_mp,fmj_mp,eotech_mp,xmags_mp,akimbo_mp", ","); //Special Machine Pistol
- if( getDvarInt( "scr_infected_allies_attachments" ) == 1 )
- return secondary[type][randomInt(secondary[type].size)] + attachment[type][randomInt(attachment[type].size)];
- else
- return secondary[type][randomInt(secondary[type].size)] + "mp";
- }
- getRandomPerk( type )
- {
- perks = [];
- perks[perks.size] = strTok("specialty_scavenger,specialty_fastreload,specialty_marathon", ",");
- perks[perks.size] = strTok("specialty_bulletdamage,specialty_lightweight,specialty_coldblooded,specialty_explosivedamage", ",");
- perks[perks.size] = strTok("specialty_bulletaccuracy,specialty_heartbreaker,specialty_detectexplosive,specialty_extendedmelee", ",");
- return perks[type][randomInt(perks[type].size)];
- }
- getPerkMaterial( perk )
- {
- return tableLookUp( "mp/perkTable.csv", 1, perk, 3 );
- }
- getPerkString( perk )
- {
- return tableLookUpIString( "mp/perkTable.csv", 1, perk, 2 );
- }
- setAllPerks()
- {
- self _setPerk("specialty_marathon");
- self _setPerk("specialty_fastmantle");
- self _setPerk("specialty_fastreload");
- self _setPerk("specialty_quickdraw");
- self _setPerk("specialty_lightweight");
- self _setPerk("specialty_fastsprintrecovery");
- self _setPerk("specialty_scavenger");
- self _setPerk("specialty_extraammo");
- self _setPerk("specialty_bulletdamage");
- self _setPerk("specialty_armorpiercing");
- self _setPerk("specialty_coldblooded");
- self _setPerk("specialty_spygame");
- self _setPerk("specialty_explosivedamage");
- self _setPerk("specialty_dangerclose");
- self _setPerk("specialty_extendedmelee");
- self _setPerk("specialty_falldamage");
- self _setPerk("specialty_bulletaccuracy");
- self _setPerk("specialty_holdbreath");
- self _setPerk("specialty_delaymine"); //Only Pro version of Scrambler
- self _setPerk("specialty_heartbreaker");
- self _setPerk("specialty_quieter");
- self _setPerk("specialty_detectexplosive");
- self _setPerk("specialty_selectivehearing");
- self _setPerk("specialty_hardline");
- self _setPerk("specialty_rollover");
- }
- getGoodColor()
- {
- color = [];
- for( i=0; i<3; i++ )
- {
- color[i] = randomint( 2 );
- wait 0.05;
- }
- if( color[0] == color[1] && color[1] == color[2] )
- {
- rand = randomint(3);
- color[rand] += 1;
- color[rand] %= 2;
- }
- return ( color[0], color[1], color[2] );
- }
- DeleteOnEndGame()
- {
- level waittill("game_ended");
- self.ksOneIcon.alpha = 0;
- self.ksTwoIcon.alpha = 0;
- self.ksThrIcon.alpha = 0;
- self.ksForIcon.alpha = 0;
- self.streak.alpha = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement