From f4247a67466001bff226b2141c9cd99ebce44d38 Mon Sep 17 00:00:00 2001 From: ChocoTaco Date: Fri, 18 Feb 2022 14:34:07 -0500 Subject: [PATCH] Removed all trailing spaces --- Classic/scripts/CTFGame.cs | 310 +++++++++++++-------------- Classic/scripts/SCtFGame.cs | 404 ++++++++++++++++++------------------ 2 files changed, 357 insertions(+), 357 deletions(-) diff --git a/Classic/scripts/CTFGame.cs b/Classic/scripts/CTFGame.cs index d5912e3..b05ed33 100755 --- a/Classic/scripts/CTFGame.cs +++ b/Classic/scripts/CTFGame.cs @@ -2,7 +2,7 @@ //--- GAME RULES BEGIN --- //Prevent enemy from capturing your flag -//Score one point for grabbing the enemy's flag +//Score one point for grabbing the enemy's flag //To capture, your flag must be at its stand //Score 100 points each time enemy flag is captured //--- GAME RULES END --- @@ -13,14 +13,14 @@ exec("scripts/aiCTF.cs"); //-- tracking --- function CTFGame::initGameVars(%game) { - // --------------------------------------------------- + // --------------------------------------------------- // z0dd - ZOD, 9/29/02. Removed T2 demo code from here %game.SCORE_PER_SUICIDE = 0; // z0dd - ZOD, 8/19/02. No penalty for suicide! Was -10 %game.SCORE_PER_TEAMKILL = -10; - %game.SCORE_PER_DEATH = 0; + %game.SCORE_PER_DEATH = 0; %game.SCORE_PER_TK_DESTROY = -10; // z0dd - ZOD, 10/03/02. Penalty for TKing equiptment. - %game.SCORE_PER_KILL = 10; + %game.SCORE_PER_KILL = 10; %game.SCORE_PER_PLYR_FLAG_CAP = 30; %game.SCORE_PER_PLYR_FLAG_TOUCH = 20; %game.SCORE_PER_TEAM_FLAG_CAP = 100; @@ -32,7 +32,7 @@ function CTFGame::initGameVars(%game) %game.SCORE_PER_TURRET_KILL = 10; // controlled %game.SCORE_PER_TURRET_KILL_AUTO = 5; // uncontrolled, z0dd - ZOD, 5/27/03. More points, was 3 - %game.SCORE_PER_FLAG_DEFEND = 5; + %game.SCORE_PER_FLAG_DEFEND = 5; %game.SCORE_PER_CARRIER_KILL = 5; %game.SCORE_PER_FLAG_RETURN = 10; %game.SCORE_PER_STALEMATE_RETURN = 15; @@ -74,7 +74,7 @@ function CTFGame::initGameVars(%game) %game.TIME_CONSIDERED_FLAGCARRIER_THREAT = 3 * 1000; //after damaging enemy flag carrier %game.RADIUS_GEN_DEFENSE = 20; //meters - %game.RADIUS_FLAG_DEFENSE = 20; //meters + %game.RADIUS_FLAG_DEFENSE = 20; //meters %game.TOUCH_DELAY_MS = 20000; //20 secs @@ -87,9 +87,9 @@ function CTFGame::initGameVars(%game) %game.stalemateTimeMS = 60000; %game.stalemateFreqMS = 15000; %game.stalemateDurationMS = 6000; - - - // --------------------------------------------------- + + + // --------------------------------------------------- // z0dd - ZOD, 9/29/02. Removed T2 demo code from here } @@ -242,7 +242,7 @@ function Flag::onEnterLiquid(%data, %obj, %coverage, %type) if(%type > 3) // 1-3 are water, 4+ is lava and quicksand(?) { //error("flag("@%obj@") is in liquid type" SPC %type); - // Changed slightly so this can be cancelled if it leaves the + // Changed slightly so this can be cancelled if it leaves the // lava before its supposed to be returned - Ilys %obj.lavaEnterThread = Game.schedule(3000, "flagReturn", %obj); } @@ -251,7 +251,7 @@ function Flag::onEnterLiquid(%data, %obj, %coverage, %type) function Flag::onLeaveLiquid(%data, %obj, %type) { // Added to stop the flag retrun if it slides out of the lava - Ilys - if(isEventPending(%obj.lavaEnterThread)) + if(isEventPending(%obj.lavaEnterThread)) cancel(%obj.lavaEnterThread); } @@ -298,35 +298,35 @@ function CTFGame::getTeamSkin(%game, %team) else if(%team == 2) %skin = 'dsword'; else %skin = 'base'; - + case "badlands": if(%team == 1) %skin = 'swolf'; else if(%team == 2) %skin = 'dsword'; else %skin = 'base'; - + case "ice": if(%team == 1) %skin = 'swolf'; else if(%team == 2) %skin = 'beagle'; else %skin = 'base'; - + case "desert": if(%team == 1) %skin = 'cotp'; else if(%team == 2) %skin = 'beagle'; else %skin = 'base'; - + case "Volcanic": if(%team == 1) %skin = 'dsword'; else if(%team == 2) %skin = 'cotp'; else %skin = 'base'; - + default: if(%team == 2) %skin = 'baseb'; @@ -334,7 +334,7 @@ function CTFGame::getTeamSkin(%game, %team) } } else %skin = $teamSkin[%team]; - + //error("%skin = " SPC getTaggedString(%skin)); return %skin; } @@ -358,7 +358,7 @@ function CTFGame::missionLoadDone(%game) for(%i = 1; %i < (%game.numTeams + 1); %i++) $teamScore[%i] = 0; - // remove + // remove MissionGroup.clearFlagWaypoints(); //reset some globals, just in case... @@ -376,7 +376,7 @@ function CTFGame::playerTouchFlag(%game, %player, %flag) if ((%flag.carrier $= "") && (%player.getState() !$= "Dead")) { // z0dd - ZOD, 5/07/04. Cancel the lava return. - if(isEventPending(%obj.lavaEnterThread)) + if(isEventPending(%obj.lavaEnterThread)) cancel(%obj.lavaEnterThread); //flag isn't held and has been touched by a live player @@ -390,7 +390,7 @@ function CTFGame::playerTouchFlag(%game, %player, %flag) } function CTFGame::playerTouchOwnFlag(%game, %player, %flag) -{ +{ if(%flag.isHome) { if (%player.holdingFlag !$= "") @@ -400,7 +400,7 @@ function CTFGame::playerTouchOwnFlag(%game, %player, %flag) %game.flagReturn(%flag, %player); //call the AI function - %game.AIplayerTouchOwnFlag(%player, %flag); + %game.AIplayerTouchOwnFlag(%player, %flag); } function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) @@ -419,7 +419,7 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) %client = %player.client; %player.holdingFlag = %flag; //%player has this flag %flag.carrier = %player; //this %flag is carried by %player - + // attach the camera to the flag.carrier if($Observers) { @@ -430,10 +430,10 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) observeFlag(%cl, %player.client, 2, %flag.team); } } - + %player.mountImage(FlagImage, $FlagSlot, true, %game.getTeamSkin(%flag.team)); %game.playerGotFlagTarget(%player); - + //only cancel the return timer if the player is in bounds... if(!%client.outOfBounds) { @@ -484,7 +484,7 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) { // get the grab speed %grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6); - + if(%grabspeed > $stats::MaxGrabSpeed || ($stats::MaxGrabSpeed $= "")) { $stats::MaxGrabSpeed = %grabspeed; @@ -493,14 +493,14 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) } %flag.hide(true); - %flag.startFade(0, 0, false); + %flag.startFade(0, 0, false); %flag.isHome = false; if(%flag.stand) %flag.stand.getDataBlock().onFlagTaken(%flag.stand);//animate, if exterior stand $flagStatus[%flag.team] = %client.nameBase; %teamName = %game.getTeamName(%flag.team); - + if(%grabspeed) { messageTeamExcept(%client, 'MsgCTFFlagTaken', '\c2Teammate %1 took the %2 flag. (Speed: %5Kph)~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase, %grabspeed); @@ -519,7 +519,7 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) messageClient(%client, 'MsgCTFFlagTaken', '\c2You took the %2 flag.~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase); } logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") took team "@%flag.team@" flag ("@%grabspeed@")"); // MP: 6/15/2011 added grabspeed. - + //call the AI function %game.AIplayerTouchEnemyFlag(%player, %flag); @@ -559,19 +559,19 @@ function CTFGame::playerDroppedFlag(%game, %player) { %client = %player.client; %flag = %player.holdingFlag; - + %game.updateFlagTransform(%flag); // z0dd - ZOD, 8/4/02, Call to KineticPoet's flag updater %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag? - + %game.playerLostFlagTarget(%player); - + if($Host::ClassicEvoStats) %game.totalFlagHeldTime[%flag] = 0; %player.holdingFlag = ""; //player isn't holding a flag anymore - %flag.carrier = ""; //flag isn't held anymore + %flag.carrier = ""; //flag isn't held anymore $flagStatus[%flag.team] = ""; - + // attach the camera to the flag if($Observers) { @@ -582,9 +582,9 @@ function CTFGame::playerDroppedFlag(%game, %player) observeFlag(%cl, $TeamFlag[%flag.team], 1, %flag.team); } } - - %player.unMountImage($FlagSlot); - %flag.hide(false); //Does the throwItem function handle this? + + %player.unMountImage($FlagSlot); + %flag.hide(false); //Does the throwItem function handle this? %teamName = %game.getTeamName(%flag.team); messageTeamExcept(%client, 'MsgCTFFlagDropped', '\c2Teammate %1 dropped the %2 flag. (Held: %4)~wfx/misc/flag_drop.wav', %client.name, %teamName, %flag.team, %held); // z0dd - ZOD, 8/15/02. How long flag was held @@ -598,7 +598,7 @@ function CTFGame::playerDroppedFlag(%game, %player) //don't duplicate the schedule if there's already one in progress... if ($FlagReturnTimer[%flag] <= 0) $FlagReturnTimer[%flag] = %game.schedule(%game.FLAG_RETURN_DELAY - %game.fadeTimeMS, "flagReturnFade", %flag); - + //call the AI function %game.AIplayerDroppedFlag(%player, %flag); } @@ -608,7 +608,7 @@ function CTFGame::flagCap(%game, %player) %client = %player.client; %flag = %player.holdingFlag; %flag.carrier = ""; - + // when a player cap the flag, attach to flag again if($Observers) { @@ -621,7 +621,7 @@ function CTFGame::flagCap(%game, %player) } %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], true); // z0dd - ZOD, 8/15/02. How long did player hold flag? - + %game.playerLostFlagTarget(%player); if($Host::ClassicEvoStats) @@ -659,21 +659,21 @@ function CTFGame::flagCap(%game, %player) export("$flagstats::*", %fileOut, false); if(%prevheld2) %saved = "\c2Saved: \c3-" @ %game.formatTime(%prevheld2 - %held2, true) @ "\c2"; - schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2 " @ %saved @ "~wfx/misc/hunters_horde.wav"); + schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2 " @ %saved @ "~wfx/misc/hunters_horde.wav"); } else schedule(4000, 0, "messageClient", %client, '', "\c2New flag records are disabled until" SPC $Host::MinFlagRecordPlayerCount SPC "players."); } - + bottomprint(%client, "You captured the flag in" SPC %realTime SPC "seconds.", 10, 1); - + $stats::caps[%client]++; if($stats::caps[%client] > $stats::caps_counter) { $stats::caps_counter = $stats::caps[%client]; $stats::caps_client = getTaggedString(%client.name); } - + if(%held2 < $stats::fastestCap || !$stats::fastestCap) { $stats::fastestCap = %held2; @@ -686,26 +686,26 @@ function CTFGame::flagCap(%game, %player) //award points to player and team %teamName = %game.getTeamName(%flag.team); messageTeamExcept(%client, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); - messageTeam(%flag.team, 'MsgCTFFlagCapped', '\c2Your flag was captured by %1. (Held: %5)~wfx/misc/flag_lost.wav', %client.name, 0, %flag.team, %client.team, %held); - messageTeam(0, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); + messageTeam(%flag.team, 'MsgCTFFlagCapped', '\c2Your flag was captured by %1. (Held: %5)~wfx/misc/flag_lost.wav', %client.name, 0, %flag.team, %client.team, %held); + messageTeam(0, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); messageClient(%client, 'MsgCTFFlagCapped', '\c2You captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); // Yogi, 8/18/02. 3rd param changed 0 -> %client.name logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") capped team "@%client.team@" flag"@" (Held: "@%held@")"); // MP: 6/14/2011 The team is wrong, but the stats program auto-corrects it, so just leave as is %player.holdingFlag = ""; //no longer holding it. %player.unMountImage($FlagSlot); - %game.awardScoreFlagCap(%client, %flag); + %game.awardScoreFlagCap(%client, %flag); %game.flagReset(%flag); - + //call the AI function %game.AIflagCap(%player, %flag); //Determine score status %caplimit = MissionGroup.CTF_scoreLimit; - %otherteam = ( %client.team == 1 ) ? 2 : 1; + %otherteam = ( %client.team == 1 ) ? 2 : 1; //Find out caps from score %clientteamcaps = mFloor($TeamScore[%client.team] / %game.SCORE_PER_TEAM_FLAG_CAP); %otherteamcaps = mFloor($TeamScore[%otherteam] / %game.SCORE_PER_TEAM_FLAG_CAP); - + //Determine Gamepoint if(%clientteamcaps >= (%caplimit - 1)) { @@ -758,7 +758,7 @@ function CTFGame::flagReturn(%game, %flag, %player) else %otherTeam = 1; %teamName = %game.getTeamName(%flag.team); - + // when the flag return, attach to flag again if($Observers) { @@ -769,7 +769,7 @@ function CTFGame::flagReturn(%game, %flag, %player) observeFlag(%cl, $TeamFlag[%flag.team], 1, %flag.team); } } - + if (%player !$= "") { //a player returned it @@ -779,7 +779,7 @@ function CTFGame::flagReturn(%game, %flag, %player) messageTeam(0, 'MsgCTFFlagReturned', '\c2%1 returned the %2 flag.~wfx/misc/flag_return.wav', %client.name, %teamName, %flag.team); messageClient(%client, 'MsgCTFFlagReturned', '\c2You returned your flag.~wfx/misc/flag_return.wav', %client.name, %teamName, %flag.team); // Yogi, 8/18/02. 3rd param changed 0 -> %client.name logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") returned team "@%flag.team@" flag"); - + // find out what type of return it is // stalemate return? @@ -795,14 +795,14 @@ function CTFGame::flagReturn(%game, %flag, %player) { %enemyFlagDist = vectorDist($flagPos[%flag.team], $flagPos[%otherTeam]); %dist = vectorDist(%flag.position, %flag.originalPosition); - + %rawRatio = %dist/%enemyFlagDist; %ratio = %rawRatio < 1 ? %rawRatio : 1; %percentage = mFloor( (%ratio) * 10 ) * 10; - %game.awardScoreFlagReturn(%player.client, %percentage); + %game.awardScoreFlagReturn(%player.client, %percentage); } // --------------------------------------------------- - } + } else { //returned due to timer @@ -888,10 +888,10 @@ function CTFGame::antiTurtle(%game) if(%game.stalemateSchedule > 0) %game.stalemateSchedule = 0; - + for (%i = 1; %i <= Game.numTeams; %i++) Game.flagReturn($TeamFlag[%i]); - + messageAll( "", "\c3Both flags returned to bases to break stalemate.~wfx/misc/flag_return.wav"); error(formatTimeString("HH:nn:ss") SPC "Anti-Turtle thread ended"); } @@ -923,7 +923,7 @@ function CTFGame::flagReset(%game, %flag) %flag.stand.getDataBlock().onFlagReturn(%flag.stand);//animate, if exterior stand //fade the flag in... - %flag.startFade(%game.fadeTimeMS, 0, false); + %flag.startFade(%game.fadeTimeMS, 0, false); // dont render base target setTargetRenderMask(%flag.waypoint.getTarget(), 0); @@ -941,7 +941,7 @@ function CTFGame::flagReset(%game, %flag) { cancel(%flag.searchSchedule); } - // -------------------------------------------------------------------------- + // -------------------------------------------------------------------------- } function CTFGame::timeLimitReached(%game) @@ -1027,7 +1027,7 @@ function CTFGame::gameOver(%game) } messageAll('MsgClearObjHud', ""); - for(%i = 0; %i < ClientGroup.getCount(); %i ++) + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { %client = ClientGroup.getObject(%i); %game.resetScore(%client); @@ -1037,7 +1037,7 @@ function CTFGame::gameOver(%game) } function CTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc) -{ +{ if(%clVictim.headshot && %damageType == $DamageType::Laser && %clVictim.team != %clAttacker.team) { %clAttacker.scoreHeadshot++; @@ -1065,16 +1065,16 @@ function CTFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %i //the DefaultGame will set some vars DefaultGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, %implement, %damageLoc); - + //if victim is carrying a flag and is not on the attackers team, mark the attacker as a threat for x seconds(for scoring purposes) if ((%clVictim.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team)) { %clAttacker.dmgdFlagCarrier = true; - cancel(%clAttacker.threatTimer); //restart timer + cancel(%clAttacker.threatTimer); //restart timer %clAttacker.threatTimer = schedule(%game.TIME_CONSIDERED_FLAGCARRIER_THREAT, %clAttacker.dmgdFlagCarrier = false); } } - + //////////////////////////////////////////////////////////////////////////////////////// function CTFGame::clientMissionDropReady(%game, %client) { @@ -1088,8 +1088,8 @@ function CTFGame::clientMissionDropReady(%game, %client) //%game.populateTeamRankArray(%client); //messageClient(%client, 'MsgYourRankIs', "", -1); - - messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); + + messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } @@ -1114,34 +1114,34 @@ function CTFGame::recalcScore(%game, %cl) // --------------------------------------------------- // z0dd - ZOD, 9/29/02. Removed T2 demo code from here %cl.offenseScore = %killPoints + - %cl.suicides * %game.SCORE_PER_SUICIDE + + %cl.suicides * %game.SCORE_PER_SUICIDE + %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + - %cl.teamKills * %game.SCORE_PER_TEAMKILL + + %cl.teamKills * %game.SCORE_PER_TEAMKILL + %cl.tkDestroys * %game.SCORE_PER_TK_DESTROY + // z0dd - ZOD, 10/03/02. Penalty for tking equiptment. - %cl.scoreHeadshot * %game.SCORE_PER_HEADSHOT + + %cl.scoreHeadshot * %game.SCORE_PER_HEADSHOT + %cl.scoreRearshot * %game.SCORE_PER_REARSHOT + // z0dd - ZOD, 8/25/02. Added Lance rear shot messages - %cl.scoreMidAir * %game.SCORE_PER_MIDAIR + - %cl.flagCaps * %game.SCORE_PER_PLYR_FLAG_CAP + - %cl.flagGrabs * %game.SCORE_PER_PLYR_FLAG_TOUCH + - %cl.genDestroys * %game.SCORE_PER_DESTROY_GEN + - %cl.sensorDestroys * %game.SCORE_PER_DESTROY_SENSOR + - %cl.turretDestroys * %game.SCORE_PER_DESTROY_TURRET + - %cl.iStationDestroys * %game.SCORE_PER_DESTROY_ISTATION + - %cl.vstationDestroys * %game.SCORE_PER_DESTROY_VSTATION + + %cl.scoreMidAir * %game.SCORE_PER_MIDAIR + + %cl.flagCaps * %game.SCORE_PER_PLYR_FLAG_CAP + + %cl.flagGrabs * %game.SCORE_PER_PLYR_FLAG_TOUCH + + %cl.genDestroys * %game.SCORE_PER_DESTROY_GEN + + %cl.sensorDestroys * %game.SCORE_PER_DESTROY_SENSOR + + %cl.turretDestroys * %game.SCORE_PER_DESTROY_TURRET + + %cl.iStationDestroys * %game.SCORE_PER_DESTROY_ISTATION + + %cl.vstationDestroys * %game.SCORE_PER_DESTROY_VSTATION + %cl.mpbtstationDestroys * %game.SCORE_PER_DESTROY_MPBTSTATION + // z0dd - ZOD 3/30/02. MPB Teleporter - %cl.solarDestroys * %game.SCORE_PER_DESTROY_SOLAR + - %cl.sentryDestroys * %game.SCORE_PER_DESTROY_SENTRY + - %cl.depSensorDestroys * %game.SCORE_PER_DESTROY_DEP_SENSOR + - %cl.depTurretDestroys * %game.SCORE_PER_DESTROY_DEP_TUR + + %cl.solarDestroys * %game.SCORE_PER_DESTROY_SOLAR + + %cl.sentryDestroys * %game.SCORE_PER_DESTROY_SENTRY + + %cl.depSensorDestroys * %game.SCORE_PER_DESTROY_DEP_SENSOR + + %cl.depTurretDestroys * %game.SCORE_PER_DESTROY_DEP_TUR + %cl.depStationDestroys * %game.SCORE_PER_DESTROY_DEP_INV + - %cl.vehicleScore + %cl.vehicleBonus; + %cl.vehicleScore + %cl.vehicleBonus; - %cl.defenseScore = %cl.genDefends * %game.SCORE_PER_GEN_DEFEND + + %cl.defenseScore = %cl.genDefends * %game.SCORE_PER_GEN_DEFEND + %cl.flagDefends * %game.SCORE_PER_FLAG_DEFEND + - %cl.carrierKills * %game.SCORE_PER_CARRIER_KILL + - %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + - %cl.turretKills * %game.SCORE_PER_TURRET_KILL_AUTO + - %cl.mannedturretKills * %game.SCORE_PER_TURRET_KILL + + %cl.carrierKills * %game.SCORE_PER_CARRIER_KILL + + %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + + %cl.turretKills * %game.SCORE_PER_TURRET_KILL_AUTO + + %cl.mannedturretKills * %game.SCORE_PER_TURRET_KILL + %cl.genRepairs * %game.SCORE_PER_REPAIR_GEN + %cl.SensorRepairs * %game.SCORE_PER_REPAIR_SENSOR + %cl.TurretRepairs * %game.SCORE_PER_REPAIR_TURRET + @@ -1153,7 +1153,7 @@ function CTFGame::recalcScore(%game, %cl) %cl.sentryRepairs * %game.SCORE_PER_REPAIR_SENTRY + %cl.depInvRepairs * %game.SCORE_PER_REPAIR_DEP_INV + %cl.depTurretRepairs * %game.SCORE_PER_REPAIR_DEP_TUR + - %cl.returnPts; + %cl.returnPts; // --------------------------------------------------- // z0dd - ZOD, 9/29/02. Removed T2 demo code from here @@ -1166,14 +1166,14 @@ function CTFGame::recalcScore(%game, %cl) function CTFGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) { // is this a vehicle kill rather than a player kill - + // console error message suppression if( isObject( %implement ) ) { if( %implement.getDataBlock().getName() $= "AssaultPlasmaTurret" || %implement.getDataBlock().getName() $= "BomberTurret" ) // gunner %clKiller = %implement.vehicleMounted.getMountNodeObject(1).client; else if(%implement.getDataBlock().catagory $= "Vehicles") // pilot - %clKiller = %implement.getMountNodeObject(0).client; + %clKiller = %implement.getMountNodeObject(0).client; } if(%game.testTurretKill(%implement)) //check for turretkill before awarded a non client points for a kill @@ -1187,7 +1187,7 @@ function CTFGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %im if (%game.testGenDefend(%clVictim, %clKiller)) %game.awardScoreGenDefend(%clKiller); - if(%game.testCarrierKill(%clVictim, %clKiller)) + if(%game.testCarrierKill(%clVictim, %clKiller)) %game.awardScoreCarrierKill(%clKiller); else { @@ -1195,35 +1195,35 @@ function CTFGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %im %game.awardScoreFlagDefend(%clKiller); } if (%game.testEscortAssist(%clVictim, %clKiller)) - %game.awardScoreEscortAssist(%clKiller); - } + %game.awardScoreEscortAssist(%clKiller); + } else - { + { if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide { - %game.awardScoreSuicide(%clVictim); + %game.awardScoreSuicide(%clVictim); } else { if (%game.testTeamKill(%clVictim, %clKiller, %damageType)) //otherwise test for a teamkill %game.awardScoreTeamKill(%clVictim, %clKiller); } - } + } } function CTFGame::testFlagDefend(%game, %victimID, %killerID) { InitContainerRadiusSearch(%victimID.plyrPointOfDeath, %game.RADIUS_FLAG_DEFENSE, $TypeMasks::ItemObjectType); - %objID = containerSearchNext(); - while(%objID != 0) + %objID = containerSearchNext(); + while(%objID != 0) { %objType = %objID.getDataBlock().getName(); - if ((%objType $= "Flag") && (%objID.team == %killerID.team)) + if ((%objType $= "Flag") && (%objID.team == %killerID.team)) return true; //found the(a) killer's flag near the victim's point of death else - %objID = containerSearchNext(); + %objID = containerSearchNext(); } - return false; //didn't find a qualifying flag within required radius of victims point of death + return false; //didn't find a qualifying flag within required radius of victims point of death } function CTFGame::testGenDefend(%game, %victimID, %killerID) @@ -1233,23 +1233,23 @@ function CTFGame::testGenDefend(%game, %victimID, %killerID) while(%objID != 0) { %objType = %objID.getDataBlock().ClassName; - if ((%objType $= "generator") && (%objID.team == %killerID.team)) + if ((%objType $= "generator") && (%objID.team == %killerID.team)) return true; //found a killer's generator within required radius of victim's death else %objID = containerSearchNext(); } - return false; //didn't find a qualifying gen within required radius of victim's point of death + return false; //didn't find a qualifying gen within required radius of victim's point of death } function CTFGame::testCarrierKill(%game, %victimID, %killerID) { %flag = %victimID.plyrDiedHoldingFlag; - return ((%flag !$= "") && (%flag.team == %killerID.team)); + return ((%flag !$= "") && (%flag.team == %killerID.team)); } function CTFGame::testEscortAssist(%game, %victimID, %killerID) { - return (%victimID.dmgdFlagCarrier); + return (%victimID.dmgdFlagCarrier); } function CTFGame::awardScoreFlagCap(%game, %cl, %flag) @@ -1336,14 +1336,14 @@ function CTFGame::checkScoreLimit(%game, %team) // default of 5 if scoreLimit not defined if(%scoreLimit $= "") %scoreLimit = 5 * %game.SCORE_PER_TEAM_FLAG_CAP; - if($TeamScore[%team] >= %scoreLimit) + if($TeamScore[%team] >= %scoreLimit) %game.scoreLimitReached(); } function CTFGame::awardScoreFlagReturn(%game, %cl, %perc) { %cl.flagReturns++; //give flagreturn stat - + // --------------------------------------------------- // z0dd - ZOD, 9/29/02. Removed T2 demo code from here if (%game.SCORE_PER_FLAG_RETURN != 0) @@ -1353,7 +1353,7 @@ function CTFGame::awardScoreFlagReturn(%game, %cl, %perc) messageClient(%cl, 'scoreFlaRetMsg', 'Flag return - exceeded capping distance - %1 point bonus.', %pts, %perc); else if(%perc == 0) messageClient(%cl, 'scoreFlaRetMsg', 'You gently place the flag back on the stand.', %pts, %perc); - else + else messageClient(%cl, 'scoreFlaRetMsg', '\c0Flag return from %2%% of capping distance - %1 point bonus.', %pts, %perc); %cl.returnPts += %pts; } @@ -1395,7 +1395,7 @@ function CTFGame::awardScoreCarrierKill(%game, %killerID) messageTeamExcept(%killerID, 'msgCarKill', '\c2%1 stopped the enemy flag carrier.', %killerID.name); // z0dd - ZOD, 8/15/02. Tell team //messageTeamExcept(%killerID, 'msgCarKill', '\c0Teammate %1 received a %2 point bonus for stopping the enemy flag carrier!', %killerID.name, %game.SCORE_PER_CARRIER_KILL); } - %game.recalcScore(%killerID); + %game.recalcScore(%killerID); return %game.SCORE_PER_CARRIER_KILL; } @@ -1407,7 +1407,7 @@ function CTFGame::awardScoreFlagDefend(%game, %killerID) messageClient(%killerID, 'msgFlagDef', '\c0You received a %1 point bonus for defending your flag!', %game.SCORE_PER_FLAG_DEFEND); messageTeamExcept(%killerID, 'msgFlagDef', '\c2%1 defended our flag.', %killerID.name); // z0dd - ZOD, 8/15/02. Tell team //messageTeamExcept(%killerID, 'msgFlagDef', '\c0Teammate %1 received a %2 point bonus for defending your flag!', %killerID.name, %game.SCORE_PER_FLAG_DEFEND); - } + } %game.recalcScore(%killerID); return %game.SCORE_PER_FLAG_DEFEND; } @@ -1561,7 +1561,7 @@ function CTFGame::testValidRepair(%game, %obj) return false; else if(%obj.team != %obj.repairedBy.team) return false; - else + else { if(%obj.soiledByEnemyRepair) %obj.soiledByEnemyRepair = false; @@ -1714,8 +1714,8 @@ function CTFGame::resetScore(%game, %client) %client.depSensorDestroys = 0; %client.depTurretDestroys = 0; %client.depStationDestroys = 0; - %client.vehicleScore = 0; - %client.vehicleBonus = 0; + %client.vehicleScore = 0; + %client.vehicleBonus = 0; %client.flagDefends = 0; %client.defenseScore = 0; @@ -1744,7 +1744,7 @@ function CTFGame::enterMissionArea(%game, %playerData, %player) { if(%player.getState() $= "Dead") return; - %player.client.outOfBounds = false; + %player.client.outOfBounds = false; messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.'); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") entered mission area"); @@ -1791,7 +1791,7 @@ function CTFGame::boundaryLoseFlag(%game, %player) %flag.setCollisionTimeout(%player); %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag? - + if($Host::ClassicEvoStats) %game.totalFlagHeldTime[%flag] = 0; @@ -1852,28 +1852,28 @@ function CTFGame::vehicleDestroyed(%game, %vehicle, %destroyer) %vehicleType = getTaggedString(%data.targetTypeTag); if(%vehicleType !$= "MPB") %vehicleType = strlwr(%vehicleType); - + %enemyTeam = ( %destroyer.team == 1 ) ? 2 : 1; - + %scorer = 0; %multiplier = 1; - + %passengers = 0; for(%i = 0; %i < %data.numMountPoints; %i++) if(%vehicle.getMountNodeObject(%i)) %passengers++; - + //what destroyed this vehicle if(%destroyer.client) { //it was a player, or his mine, satchel, whatever... %destroyer = %destroyer.client; %scorer = %destroyer; - + // determine if the object used was a mine if(%vehicle.lastDamageType == $DamageType::Mine) %multiplier = 2; - } + } else if(%destroyer.getClassName() $= "Turret") { if(%destroyer.getControllingClient()) @@ -1882,12 +1882,12 @@ function CTFGame::vehicleDestroyed(%game, %vehicle, %destroyer) %destroyer = %destroyer.getControllingClient(); %scorer = %destroyer; } - else + else { %destroyerName = "A turret"; %multiplier = 0; } - } + } else if(%destroyer.getDataBlock().catagory $= "Vehicles") { // Vehicle vs vehicle kill! @@ -1895,7 +1895,7 @@ function CTFGame::vehicleDestroyed(%game, %vehicle, %destroyer) %gunnerNode = 1; else %gunnerNode = 0; - + if(%destroyer.getMountNodeObject(%gunnerNode)) { %destroyer = %destroyer.getMountNodeObject(%gunnerNode).client; @@ -1906,23 +1906,23 @@ function CTFGame::vehicleDestroyed(%game, %vehicle, %destroyer) else // Is there anything else we care about? return; - + if(%destroyerName $= "") %destroyerName = %destroyer.name; - + if(%vehicle.team == %destroyer.team) // team kill { %pref = (%vehicleType $= "Assault Tank") ? "an" : "a"; messageAll( 'msgVehicleTeamDestroy', '\c0%1 TEAMKILLED %3 %2!', %destroyerName, %vehicleType, %pref); } - + else // legit kill { //messageTeamExcept(%destroyer, 'msgVehicleDestroy', '\c0%1 destroyed an enemy %2.', %destroyerName, %vehicleType); // z0dd - ZOD, 8/20/02. not needed with new messenger on line below teamDestroyMessage(%destroyer, 'msgVehDestroyed', '\c5%1 destroyed an enemy %2!', %destroyerName, %vehicleType); // z0dd - ZOD, 8/20/02. Send teammates a destroy message messageTeam(%enemyTeam, 'msgVehicleDestroy', '\c0%1 destroyed your team\'s %2.', %destroyerName, %vehicleType); //messageClient(%destroyer, 'msgVehicleDestroy', '\c0You destroyed an enemy %1.', %vehicleType); - + if(%scorer) { %value = %game.awardScoreVehicleDestroyed(%scorer, %vehicleType, %multiplier, %passengers); @@ -1934,7 +1934,7 @@ function CTFGame::vehicleDestroyed(%game, %vehicle, %destroyer) function CTFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mult, %passengers) { // z0dd - ZOD, 9/29/02. Removed T2 demo code from here - + if(%vehicleType $= "Grav Cycle") %base = %game.SCORE_PER_DESTROY_WILDCAT; else if(%vehicleType $= "Assault Tank") @@ -1947,11 +1947,11 @@ function CTFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mult %base = %game.SCORE_PER_DESTROY_BOMBER; else if(%vehicleType $= "Heavy Transport") %base = %game.SCORE_PER_DESTROY_TRANSPORT; - - %total = ( %base * %mult ) + ( %passengers * %game.SCORE_PER_PASSENGER ); + + %total = ( %base * %mult ) + ( %passengers * %game.SCORE_PER_PASSENGER ); %client.vehicleScore += %total; - + messageClient(%client, 'msgVehicleScore', '\c0You received a %1 point bonus for destroying an enemy %2.', %total, %vehicleType); %game.recalcScore(%client); return %total; @@ -1959,9 +1959,9 @@ function CTFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mult function CTFGame::shareScore(%game, %client, %amount) { - // z0dd - ZOD, 9/29/02. Removed T2 demo code from here - - //error("share score of"SPC %amount SPC "from client:" SPC %client); + // z0dd - ZOD, 9/29/02. Removed T2 demo code from here + + //error("share score of"SPC %amount SPC "from client:" SPC %client); // all of the player in the bomber and tank share the points // gained from any of the others %vehicle = %client.vehicleMounted; @@ -1983,9 +1983,9 @@ function CTFGame::shareScore(%game, %client, %amount) %occCl.vehicleBonus += %amount; %game.recalcScore(%occCl); } - } + } } - + } } @@ -1995,7 +1995,7 @@ function CTFGame::awardScoreTurretKill(%game, %victimID, %implement) { if (%killer == %victimID) %game.awardScoreSuicide(%victimID); - else if (%killer.team == %victimID.team) //player controlling a turret killed a teammate + else if (%killer.team == %victimID.team) //player controlling a turret killed a teammate { %killer.teamKills++; %game.awardScoreTurretTeamKill(%victimID, %killer); @@ -2006,22 +2006,22 @@ function CTFGame::awardScoreTurretKill(%game, %victimID, %implement) %killer.mannedturretKills++; %game.recalcScore(%killer); %game.awardScoreDeath(%victimID); - } - } + } + } else if ((%killer = %implement.owner) != 0) //if it isn't controlled, award score to whoever deployed it { - if (%killer.team == %victimID.team) + if (%killer.team == %victimID.team) { %game.awardScoreDeath(%victimID); } - else + else { %killer.turretKills++; %game.recalcScore(%killer); %game.awardScoreDeath(%victimID); } - } - //default is, no one was controlling it, no one owned it. No score given. + } + //default is, no one was controlling it, no one owned it. No score given. } function CTFGame::testKill(%game, %victimID, %killerID) @@ -2031,8 +2031,8 @@ function CTFGame::testKill(%game, %victimID, %killerID) function CTFGame::awardScoreKill(%game, %killerID) { - %killerID.kills++; - %game.recalcScore(%killerID); + %killerID.kills++; + %game.recalcScore(%killerID); return %game.SCORE_PER_KILL; } @@ -2042,7 +2042,7 @@ function checkVehicleCamping( %team ) %position = $flagPos[%team]; %radius = 15; InitContainerRadiusSearch(%position, %radius, $TypeMasks::VehicleObjectType ); - + while ((%vehicle = containerSearchNext()) != 0) { %dist = containerSearchCurrRadDamageDist(); @@ -2050,12 +2050,12 @@ function checkVehicleCamping( %team ) if (%dist > %radius) continue; else - { + { //if( %vehicle.team == %team ) applyVehicleCampDamage( %vehicle ); } } - + if( %team == 1 ) Game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 ); else @@ -2071,9 +2071,9 @@ function applyVehicleCampDamage( %vehicle ) return; %client = %vehicle.getMountNodeObject(0).client; // grab the pilot - + messageClient( %client, 'serverMessage', "Can't park vehicles in flag zones!" ); - %vehicle.getDataBlock().damageObject( %vehicle, 0, "0 0 0", 0.5, 0); + %vehicle.getDataBlock().damageObject( %vehicle, 0, "0 0 0", 0.5, 0); } // z0dd - ZOD, 10/02/02. Hack for flag collision bug. @@ -2144,14 +2144,14 @@ function CTFGame::voteAntiTurtleTime(%game, %admin, %newLimit) else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; - if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) + if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) { - messageAll('MsgVotePassed', '\c2The anti-turtle time is set to %1.', %display); + messageAll('MsgVotePassed', '\c2The anti-turtle time is set to %1.', %display); $Host::ClassicAntiTurtleTime = %newLimit; %cause = "(vote)"; } - else - messageAll('MsgVoteFailed', '\c2The vote to change the anti-turtle time did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); + else + messageAll('MsgVoteFailed', '\c2The vote to change the anti-turtle time did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); } if(%cause !$= "") logEcho($AdminCl.name @ ": anti-turtle time set to "@%display SPC %cause, 1); diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index d10795c..c870ba8 100755 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -2,7 +2,7 @@ //--- GAME RULES BEGIN --- //Prevent enemy from capturing your flag -//Score one point for grabbing the enemy's flag +//Score one point for grabbing the enemy's flag //To capture, your flag must be at its stand //Score 100 points each time enemy flag is captured //--- GAME RULES END --- @@ -32,10 +32,10 @@ function SCtFGame::initGameVars(%game) { %game.SCORE_PER_SUICIDE = 0; %game.SCORE_PER_TEAMKILL = -10; - %game.SCORE_PER_DEATH = 0; + %game.SCORE_PER_DEATH = 0; %game.SCORE_PER_TK_DESTROY = -10; - %game.SCORE_PER_KILL = 10; + %game.SCORE_PER_KILL = 10; %game.SCORE_PER_PLYR_FLAG_CAP = 30; %game.SCORE_PER_PLYR_FLAG_TOUCH = 20; %game.SCORE_PER_TEAM_FLAG_CAP = 100; @@ -47,12 +47,12 @@ function SCtFGame::initGameVars(%game) %game.SCORE_PER_TURRET_KILL = 10; %game.SCORE_PER_TURRET_KILL_AUTO = 5; - %game.SCORE_PER_FLAG_DEFEND = 5; + %game.SCORE_PER_FLAG_DEFEND = 5; %game.SCORE_PER_CARRIER_KILL = 5; %game.SCORE_PER_FLAG_RETURN = 10; %game.SCORE_PER_STALEMATE_RETURN = 15; %game.SCORE_PER_GEN_DEFEND = 5; - + %game.SCORE_PER_DESTROY_GEN = 10; %game.SCORE_PER_DESTROY_SENSOR = 4; %game.SCORE_PER_DESTROY_TURRET = 5; @@ -72,7 +72,7 @@ function SCtFGame::initGameVars(%game) %game.SCORE_PER_DESTROY_TANK = 8; %game.SCORE_PER_DESTROY_MPB = 12; %game.SCORE_PER_PASSENGER = 2; - + %game.SCORE_PER_REPAIR_GEN = 8; %game.SCORE_PER_REPAIR_SENSOR = 1; %game.SCORE_PER_REPAIR_TURRET = 4; @@ -89,7 +89,7 @@ function SCtFGame::initGameVars(%game) %game.TIME_CONSIDERED_FLAGCARRIER_THREAT = 3 * 1000; %game.RADIUS_GEN_DEFENSE = 20; - %game.RADIUS_FLAG_DEFENSE = 20; + %game.RADIUS_FLAG_DEFENSE = 20; %game.TOUCH_DELAY_MS = 20000; @@ -250,7 +250,7 @@ package SCtFGame if(%type > 3) // 1-3 are water, 4+ is lava and quicksand(?) { //error("flag("@%obj@") is in liquid type" SPC %type); - // Changed slightly so this can be cancelled if it leaves the + // Changed slightly so this can be cancelled if it leaves the // lava before its supposed to be returned - Ilys %obj.lavaEnterThread = Game.schedule(3000, "flagReturn", %obj); } @@ -259,17 +259,17 @@ package SCtFGame function Flag::onLeaveLiquid(%data, %obj, %type) { // Added to stop the flag retrun if it slides out of the lava - Ilys - if(isEventPending(%obj.lavaEnterThread)) + if(isEventPending(%obj.lavaEnterThread)) cancel(%obj.lavaEnterThread); } - - function stationTrigger::onEnterTrigger(%data, %obj, %colObj) + + function stationTrigger::onEnterTrigger(%data, %obj, %colObj) { //make sure it's a player object, and that that object is still alive if(%colObj.getDataBlock().className !$= "Armor" || %colObj.getState() $= "Dead") return; - // z0dd - ZOD, 7/13/02 Part of hack to keep people from mounting + // z0dd - ZOD, 7/13/02 Part of hack to keep people from mounting // vehicles in disallowed armors. if(%obj.station.getDataBlock().getName() !$= "StationVehicle") %colObj.client.inInv = true; @@ -311,23 +311,23 @@ package SCtFGame } } } - + function deployMineCheck(%mineObj, %player) { // explode it vgc schedule(2000, %mineObj, "explodeMine", %mineObj, true); } - + //Take out anything vehicle related function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC) - { + { //error("Armor::damageObject( "@%data@", "@%targetObject@", "@%sourceObject@", "@%position@", "@%amount@", "@%damageType@", "@%momVec@" )"); if(%targetObject.invincible || %targetObject.getState() $= "Dead") return; %targetClient = %targetObject.getOwnerClient(); if(isObject(%mineSC)) - %sourceClient = %mineSC; + %sourceClient = %mineSC; else %sourceClient = isObject(%sourceObject) ? %sourceObject.getOwnerClient() : 0; @@ -340,7 +340,7 @@ package SCtFGame %sourceTeam = %sourceClient.getSensorGroup(); else if(%damageType == $DamageType::Suicide) %sourceTeam = 0; - + // if teamdamage is off, and both parties are on the same team // (but are not the same person), apply no damage if(!$teamDamage && (%targetClient != %sourceClient) && (%targetTeam == %sourceTeam)) @@ -348,7 +348,7 @@ package SCtFGame if(%targetObject.isShielded && %damageType != $DamageType::Blaster) %amount = %data.checkShields(%targetObject, %position, %amount, %damageType); - + if(%amount == 0) return; @@ -356,14 +356,14 @@ package SCtFGame %damageScale = %data.damageScale[%damageType]; if(%damageScale !$= "") %amount *= %damageScale; - + if(%damageType == $DamageType::Laser && $InvBanList[SctF, "SniperRifle"]) //banned return; - + %flash = %targetObject.getDamageFlash() + (%amount * 2); if (%flash > 0.75) %flash = 0.75; - + // Teratos: Originally from Eolk? Mine+Disc tracking/death message support. // No Schedules by DarkTiger Ver.2 %targetClient.mineDisc = false; @@ -372,17 +372,17 @@ package SCtFGame case $DamageType::Disc: if((getSimTime() - %targetClient.mdcTime1) < 256) %targetClient.mineDisc = true; - - %targetClient.mdcTime2 = getSimTime(); + + %targetClient.mdcTime2 = getSimTime(); case $DamageType::Mine: if((getSimTime() - %targetClient.mdcTime2) < 256) %targetClient.mineDisc = true; - - %targetClient.mdcTime1 = getSimTime(); + + %targetClient.mdcTime1 = getSimTime(); } // -- End Mine+Disc insert. - + %previousDamage = %targetObject.getDamagePercent(); %targetObject.setDamageFlash(%flash); %targetObject.applyDamage(%amount); @@ -390,43 +390,43 @@ package SCtFGame %targetClient.lastDamagedBy = %damagingClient; %targetClient.lastDamaged = getSimTime(); - - //now call the "onKilled" function if the client was... you know... + + //now call the "onKilled" function if the client was... you know... if(%targetObject.getState() $= "Dead") { // where did this guy get it? %damLoc = %targetObject.getDamageLocation(%position); - + // should this guy be blown apart? - if( %damageType == $DamageType::Explosion || - %damageType == $DamageType::Mortar || - %damageType == $DamageType::SatchelCharge || - %damageType == $DamageType::Missile ) + if( %damageType == $DamageType::Explosion || + %damageType == $DamageType::Mortar || + %damageType == $DamageType::SatchelCharge || + %damageType == $DamageType::Missile ) { if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining { %targetObject.setMomentumVector(%momVec); - %targetObject.blowup(); + %targetObject.blowup(); } } - + // If we were killed, max out the flash %targetObject.setDamageFlash(0.75); - + %damLoc = %targetObject.getDamageLocation(%position); Game.onClientKilled(%targetClient, %sourceClient, %damageType, %sourceObject, %damLoc); } else if ( %amount > 0.1 ) - { + { if( %targetObject.station $= "" && %targetObject.isCloaked() ) { %targetObject.setCloaked( false ); - %targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true ); + %targetObject.reCloak = %targetObject.schedule( 500, "setCloaked", true ); } - + playPain( %targetObject ); } - } + } }; ///////////////////////////////////////////////////////////////////////////////////////// @@ -441,7 +441,7 @@ function SCtFGame::missionLoadDone(%game) for(%i = 1; %i < (%game.numTeams + 1); %i++) $teamScore[%i] = 0; - // remove + // remove MissionGroup.clearFlagWaypoints(); //reset some globals, just in case... @@ -451,7 +451,7 @@ function SCtFGame::missionLoadDone(%game) echo( "starting camp thread..." ); %game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 ); %game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 ); - + deleteNonSCtFObjectsFromMap(); } @@ -465,7 +465,7 @@ function SCtFGame::clientMissionDropReady(%game, %client) $Teams[%i].score = 0; messageClient(%client, 'MsgCTFAddTeam', "", %i, %game.getTeamName(%i), $flagStatus[%i], $TeamScore[%i]); } - messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); + messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName ); DefaultGame::clientMissionDropReady(%game, %client); } @@ -499,7 +499,7 @@ function SCtFGame::equip(%game, %player) %player.setInventory(GrenadeLauncher,1); %player.setInventory(DiscAmmo, %player.getDataBlock().max[DiscAmmo]); %player.setInventory(GrenadeLauncherAmmo, %player.getDataBlock().max[GrenadeLauncherAmmo]); - %player.setInventory(Grenade, %player.getDataBlock().max[Grenade]); + %player.setInventory(Grenade, %player.getDataBlock().max[Grenade]); %player.setInventory(Mine, %player.getDataBlock().max[Mine]); %player.setInventory(RepairKit,1); %player.setInventory(EnergyPack,1); @@ -594,7 +594,7 @@ function SCtFGame::gameOver(%game) } messageAll('MsgClearObjHud', ""); - for(%i = 0; %i < ClientGroup.getCount(); %i ++) + for(%i = 0; %i < ClientGroup.getCount(); %i ++) { %client = ClientGroup.getObject(%i); %game.resetScore(%client); @@ -614,7 +614,7 @@ function SCtFGame::playerTouchFlag(%game, %player, %flag) if ((%flag.carrier $= "") && (%player.getState() !$= "Dead")) { // z0dd - ZOD, 5/07/04. Cancel the lava return. - if(isEventPending(%obj.lavaEnterThread)) + if(isEventPending(%obj.lavaEnterThread)) cancel(%obj.lavaEnterThread); //flag isn't held and has been touched by a live player @@ -628,17 +628,17 @@ function SCtFGame::playerTouchFlag(%game, %player, %flag) } function SCtFGame::playerTouchOwnFlag(%game, %player, %flag) -{ +{ if(%flag.isHome) { - if (%player.holdingFlag !$= "") + if (%player.holdingFlag !$= "") %game.flagCap(%player); } - else + else %game.flagReturn(%flag, %player); - + //call the AI function - %game.AIplayerTouchOwnFlag(%player, %flag); + %game.AIplayerTouchOwnFlag(%player, %flag); } function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag) @@ -667,10 +667,10 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag) observeFlag(%cl, %player.client, 2, %flag.team); } } - + %player.mountImage(FlagImage, $FlagSlot, true, %game.getTeamSkin(%flag.team)); %game.playerGotFlagTarget(%player); - + //only cancel the return timer if the player is in bounds... if (!%client.outOfBounds) { @@ -692,7 +692,7 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag) if (%startStalemate) %game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate); - + if($Host::ClassicEvoStats) { $stats::grabs[%client]++; @@ -702,39 +702,39 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag) $stats::grabs_client = getTaggedString(%client.name); } } - + if($Host::ClassicEvoStats) %game.totalFlagHeldTime[%flag] = getSimTime(); } - + if($Host::ClassicEvoStats && !%player.flagStatsWait) { // get the grab speed %grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6); - + if(%grabspeed > $stats::MaxGrabSpeed || ($stats::MaxGrabSpeed $= "")) { $stats::MaxGrabSpeed = %grabspeed; $stats::Grabber = getTaggedString(%client.name); } } - + %flag.hide(true); - %flag.startFade(0, 0, false); + %flag.startFade(0, 0, false); %flag.isHome = false; if(%flag.stand) %flag.stand.getDataBlock().onFlagTaken(%flag.stand);//animate, if exterior stand $flagStatus[%flag.team] = %client.nameBase; %teamName = %game.getTeamName(%flag.team); - + if(%grabspeed) { messageTeamExcept(%client, 'MsgCTFFlagTaken', '\c2Teammate %1 took the %2 flag. (Speed: %5Kph)~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase, %grabspeed); messageTeam(%flag.team, 'MsgCTFFlagTaken', '\c2Your flag has been taken by %1! (Speed: %5Kph)~wfx/misc/flag_taken.wav',%client.name, 0, %flag.team, %client.nameBase, %grabspeed); messageTeam(0, 'MsgCTFFlagTaken', '\c2%1 took the %2 flag. (Speed: %5Kph)~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase, %grabspeed); messageClient(%client, 'MsgCTFFlagTaken', '\c2You took the %2 flag. (Speed: %5Kph)~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase, %grabspeed); - + if(%grabspeed > 300) messageAll('', "~wfx/Bonuses/high-level4-blazing.wav"); } @@ -746,7 +746,7 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag) messageClient(%client, 'MsgCTFFlagTaken', '\c2You took the %2 flag.~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase); } logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") took team "@%flag.team@" flag ("@%grabspeed@")"); // MP: 6/15/2011 added grabspeed. - + //call the AI function %game.AIplayerTouchEnemyFlag(%player, %flag); @@ -787,16 +787,16 @@ function SCtFGame::playerDroppedFlag(%game, %player) %flag = %player.holdingFlag; %game.updateFlagTransform(%flag); // z0dd - ZOD, 8/4/02, Call to KineticPoet's flag updater %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag? - + %game.playerLostFlagTarget(%player); - + if($Host::ClassicEvoStats) %game.totalFlagHeldTime[%flag] = 0; %player.holdingFlag = ""; //player isn't holding a flag anymore - %flag.carrier = ""; //flag isn't held anymore + %flag.carrier = ""; //flag isn't held anymore $flagStatus[%flag.team] = ""; - + // attach the camera to the flag if($Observers) { @@ -807,9 +807,9 @@ function SCtFGame::playerDroppedFlag(%game, %player) observeFlag(%cl, $TeamFlag[%flag.team], 1, %flag.team); } } - - %player.unMountImage($FlagSlot); - %flag.hide(false); //Does the throwItem function handle this? + + %player.unMountImage($FlagSlot); + %flag.hide(false); //Does the throwItem function handle this? %teamName = %game.getTeamName(%flag.team); messageTeamExcept(%client, 'MsgCTFFlagDropped', '\c2Teammate %1 dropped the %2 flag. (Held: %4)~wfx/misc/flag_drop.wav', %client.name, %teamName, %flag.team, %held); // z0dd - ZOD, 8/15/02. How long flag was held @@ -823,7 +823,7 @@ function SCtFGame::playerDroppedFlag(%game, %player) //don't duplicate the schedule if there's already one in progress... if ($FlagReturnTimer[%flag] <= 0) $FlagReturnTimer[%flag] = %game.schedule(%game.FLAG_RETURN_DELAY - %game.fadeTimeMS, "flagReturnFade", %flag); - + //call the AI function %game.AIplayerDroppedFlag(%player, %flag); } @@ -833,7 +833,7 @@ function SCtFGame::flagCap(%game, %player) %client = %player.client; %flag = %player.holdingFlag; %flag.carrier = ""; - + // when a player cap the flag, attach to flag again if($Observers) { @@ -846,7 +846,7 @@ function SCtFGame::flagCap(%game, %player) } %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], true); // z0dd - ZOD, 8/15/02. How long did player hold flag? - + %game.playerLostFlagTarget(%player); if($Host::ClassicEvoStats) @@ -884,21 +884,21 @@ function SCtFGame::flagCap(%game, %player) export("$flagstats::*", %fileOut, false); if(%prevheld2) %saved = "\c2Saved: \c3-" @ %game.formatTime(%prevheld2 - %held2, true) @ "\c2"; - schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2 " @ %saved @ "~wfx/misc/hunters_horde.wav"); + schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2 " @ %saved @ "~wfx/misc/hunters_horde.wav"); } else schedule(4000, 0, "messageClient", %client, '', "\c2New flag records are disabled until" SPC $Host::MinFlagRecordPlayerCount SPC "players."); } - + bottomprint(%client, "You captured the flag in" SPC %realTime SPC "seconds.", 10, 1); - + $stats::caps[%client]++; if($stats::caps[%client] > $stats::caps_counter) { $stats::caps_counter = $stats::caps[%client]; $stats::caps_client = getTaggedString(%client.name); } - + if(%held2 < $stats::fastestCap || !$stats::fastestCap) { $stats::fastestCap = %held2; @@ -907,30 +907,30 @@ function SCtFGame::flagCap(%game, %player) } } } - + //award points to player and team %teamName = %game.getTeamName(%flag.team); messageTeamExcept(%client, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); - messageTeam(%flag.team, 'MsgCTFFlagCapped', '\c2Your flag was captured by %1. (Held: %5)~wfx/misc/flag_lost.wav', %client.name, 0, %flag.team, %client.team, %held); - messageTeam(0, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); + messageTeam(%flag.team, 'MsgCTFFlagCapped', '\c2Your flag was captured by %1. (Held: %5)~wfx/misc/flag_lost.wav', %client.name, 0, %flag.team, %client.team, %held); + messageTeam(0, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); messageClient(%client, 'MsgCTFFlagCapped', '\c2You captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); // Yogi, 8/18/02. 3rd param changed 0 -> %client.name logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") capped team "@%client.team@" flag"@" (Held: "@%held@")"); %player.holdingFlag = ""; //no longer holding it. %player.unMountImage($FlagSlot); - %game.awardScoreFlagCap(%client, %flag); + %game.awardScoreFlagCap(%client, %flag); %game.flagReset(%flag); - + //call the AI function %game.AIflagCap(%player, %flag); //Determine score status %caplimit = MissionGroup.CTF_scoreLimit; - %otherteam = ( %client.team == 1 ) ? 2 : 1; + %otherteam = ( %client.team == 1 ) ? 2 : 1; //Find out caps from score %clientteamcaps = mFloor($TeamScore[%client.team] / %game.SCORE_PER_TEAM_FLAG_CAP); %otherteamcaps = mFloor($TeamScore[%otherteam] / %game.SCORE_PER_TEAM_FLAG_CAP); - + //Determine Gamepoint if(%clientteamcaps >= (%caplimit - 1)) { @@ -979,7 +979,7 @@ function SCtFGame::flagReturn(%game, %flag, %player) else %otherTeam = 1; %teamName = %game.getTeamName(%flag.team); - + // when the flag return, attach to flag again if($Observers) { @@ -990,7 +990,7 @@ function SCtFGame::flagReturn(%game, %flag, %player) observeFlag(%cl, $TeamFlag[%flag.team], 1, %flag.team); } } - + if (%player !$= "") { //a player returned it @@ -1000,7 +1000,7 @@ function SCtFGame::flagReturn(%game, %flag, %player) messageTeam(0, 'MsgCTFFlagReturned', '\c2%1 returned the %2 flag.~wfx/misc/flag_return.wav', %client.name, %teamName, %flag.team); messageClient(%client, 'MsgCTFFlagReturned', '\c2You returned your flag.~wfx/misc/flag_return.wav', %client.name, %teamName, %flag.team); // Yogi, 8/18/02. 3rd param changed 0 -> %client.name logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") returned team "@%flag.team@" flag"); - + // find out what type of return it is // stalemate return? // --------------------------------------------------- @@ -1015,13 +1015,13 @@ function SCtFGame::flagReturn(%game, %flag, %player) { %enemyFlagDist = vectorDist($flagPos[%flag.team], $flagPos[%otherTeam]); %dist = vectorDist(%flag.position, %flag.originalPosition); - + %rawRatio = %dist/%enemyFlagDist; %ratio = %rawRatio < 1 ? %rawRatio : 1; %percentage = mFloor( (%ratio) * 10 ) * 10; - %game.awardScoreFlagReturn(%player.client, %percentage); + %game.awardScoreFlagReturn(%player.client, %percentage); } - } + } else { //returned due to timer @@ -1107,10 +1107,10 @@ function SCtFGame::antiTurtle(%game) if(%game.stalemateSchedule > 0) %game.stalemateSchedule = 0; - + for (%i = 1; %i <= Game.numTeams; %i++) Game.flagReturn($TeamFlag[%i]); - + messageAll( "", "\c3Both flags returned to bases to break stalemate.~wfx/misc/flag_return.wav"); error(formatTimeString("HH:nn:ss") SPC "Anti-Turtle thread ended"); } @@ -1142,7 +1142,7 @@ function SCtFGame::flagReset(%game, %flag) %flag.stand.getDataBlock().onFlagReturn(%flag.stand);//animate, if exterior stand //fade the flag in... - %flag.startFade(%game.fadeTimeMS, 0, false); + %flag.startFade(%game.fadeTimeMS, 0, false); // dont render base target setTargetRenderMask(%flag.waypoint.getTarget(), 0); @@ -1159,7 +1159,7 @@ function SCtFGame::flagReset(%game, %flag) if(%flag.searchSchedule !$="") { cancel(%flag.searchSchedule); - } + } } function SCtFGame::notifyMineDeployed(%game, %mine) @@ -1206,11 +1206,11 @@ function SCtFGame::onClientDamaged(%game, %clVictim, %clAttacker, %damageType, % if ((%clVictim.holdingFlag !$= "") && (%clVictim.team != %clAttacker.team)) { %clAttacker.dmgdFlagCarrier = true; - cancel(%clAttacker.threatTimer); //restart timer + cancel(%clAttacker.threatTimer); //restart timer %clAttacker.threatTimer = schedule(%game.TIME_CONSIDERED_FLAGCARRIER_THREAT, %clAttacker.dmgdFlagCarrier = false); } } - + //////////////////////////////////////////////////////////////////////////////////////// function SCtFGame::recalcScore(%game, %cl) @@ -1224,34 +1224,34 @@ function SCtFGame::recalcScore(%game, %cl) %killPoints = (%killValue * %killValue) / (%killValue - %deathValue); %cl.offenseScore = %killPoints + - %cl.suicides * %game.SCORE_PER_SUICIDE + + %cl.suicides * %game.SCORE_PER_SUICIDE + %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + - %cl.teamKills * %game.SCORE_PER_TEAMKILL + + %cl.teamKills * %game.SCORE_PER_TEAMKILL + %cl.tkDestroys * %game.SCORE_PER_TK_DESTROY + %cl.scoreHeadshot * %game.SCORE_PER_HEADSHOT + %cl.scoreRearshot * %game.SCORE_PER_REARSHOT + - %cl.scoreMidAir * %game.SCORE_PER_MIDAIR + - %cl.flagCaps * %game.SCORE_PER_PLYR_FLAG_CAP + - %cl.flagGrabs * %game.SCORE_PER_PLYR_FLAG_TOUCH + - %cl.genDestroys * %game.SCORE_PER_DESTROY_GEN + - %cl.sensorDestroys * %game.SCORE_PER_DESTROY_SENSOR + - %cl.turretDestroys * %game.SCORE_PER_DESTROY_TURRET + - %cl.iStationDestroys * %game.SCORE_PER_DESTROY_ISTATION + - %cl.vstationDestroys * %game.SCORE_PER_DESTROY_VSTATION + + %cl.scoreMidAir * %game.SCORE_PER_MIDAIR + + %cl.flagCaps * %game.SCORE_PER_PLYR_FLAG_CAP + + %cl.flagGrabs * %game.SCORE_PER_PLYR_FLAG_TOUCH + + %cl.genDestroys * %game.SCORE_PER_DESTROY_GEN + + %cl.sensorDestroys * %game.SCORE_PER_DESTROY_SENSOR + + %cl.turretDestroys * %game.SCORE_PER_DESTROY_TURRET + + %cl.iStationDestroys * %game.SCORE_PER_DESTROY_ISTATION + + %cl.vstationDestroys * %game.SCORE_PER_DESTROY_VSTATION + %cl.mpbtstationDestroys * %game.SCORE_PER_DESTROY_MPBTSTATION + - %cl.solarDestroys * %game.SCORE_PER_DESTROY_SOLAR + + %cl.solarDestroys * %game.SCORE_PER_DESTROY_SOLAR + %cl.sentryDestroys * %game.SCORE_PER_DESTROY_SENTRY + %cl.depSensorDestroys * %game.SCORE_PER_DESTROY_DEP_SENSOR + %cl.depTurretDestroys * %game.SCORE_PER_DESTROY_DEP_TUR + %cl.depStationDestroys * %game.SCORE_PER_DESTROY_DEP_INV + - %cl.vehicleScore + %cl.vehicleBonus; + %cl.vehicleScore + %cl.vehicleBonus; - %cl.defenseScore = %cl.genDefends * %game.SCORE_PER_GEN_DEFEND + + %cl.defenseScore = %cl.genDefends * %game.SCORE_PER_GEN_DEFEND + %cl.flagDefends * %game.SCORE_PER_FLAG_DEFEND + - %cl.carrierKills * %game.SCORE_PER_CARRIER_KILL + - %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + - %cl.turretKills * %game.SCORE_PER_TURRET_KILL_AUTO + - %cl.mannedturretKills * %game.SCORE_PER_TURRET_KILL + + %cl.carrierKills * %game.SCORE_PER_CARRIER_KILL + + %cl.escortAssists * %game.SCORE_PER_ESCORT_ASSIST + + %cl.turretKills * %game.SCORE_PER_TURRET_KILL_AUTO + + %cl.mannedturretKills * %game.SCORE_PER_TURRET_KILL + %cl.genRepairs * %game.SCORE_PER_REPAIR_GEN + %cl.SensorRepairs * %game.SCORE_PER_REPAIR_SENSOR + %cl.TurretRepairs * %game.SCORE_PER_REPAIR_TURRET + @@ -1260,7 +1260,7 @@ function SCtFGame::recalcScore(%game, %cl) %cl.mpbtstationRepairs * %game.SCORE_PER_REPAIR_MPBTSTATION + %cl.solarRepairs * %game.SCORE_PER_REPAIR_SOLAR + %cl.sentryRepairs * %game.SCORE_PER_REPAIR_SENTRY + - %cl.depSensorRepairs * %game.SCORE_PER_REPAIR_DEP_SEN + + %cl.depSensorRepairs * %game.SCORE_PER_REPAIR_DEP_SEN + %cl.depInvRepairs * %game.SCORE_PER_REPAIR_DEP_INV + %cl.depTurretRepairs * %game.SCORE_PER_REPAIR_DEP_TUR + %cl.returnPts; @@ -1278,7 +1278,7 @@ function SCtFGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %i if( %implement.getDataBlock().getName() $= "AssaultPlasmaTurret" || %implement.getDataBlock().getName() $= "BomberTurret" ) // gunner %clKiller = %implement.vehicleMounted.getMountNodeObject(1).client; else if(%implement.getDataBlock().catagory $= "Vehicles") // pilot - %clKiller = %implement.getMountNodeObject(0).client; + %clKiller = %implement.getMountNodeObject(0).client; } if(%game.testTurretKill(%implement)) //check for turretkill before awarded a non client points for a kill @@ -1292,7 +1292,7 @@ function SCtFGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %i if (%game.testGenDefend(%clVictim, %clKiller)) %game.awardScoreGenDefend(%clKiller); - if(%game.testCarrierKill(%clVictim, %clKiller)) + if(%game.testCarrierKill(%clVictim, %clKiller)) %game.awardScoreCarrierKill(%clKiller); else { @@ -1300,35 +1300,35 @@ function SCtFGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %i %game.awardScoreFlagDefend(%clKiller); } if (%game.testEscortAssist(%clVictim, %clKiller)) - %game.awardScoreEscortAssist(%clKiller); - } + %game.awardScoreEscortAssist(%clKiller); + } else - { + { if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide { - %game.awardScoreSuicide(%clVictim); + %game.awardScoreSuicide(%clVictim); } else { if (%game.testTeamKill(%clVictim, %clKiller, %damageType)) //otherwise test for a teamkill %game.awardScoreTeamKill(%clVictim, %clKiller); } - } + } } function SCtFGame::testFlagDefend(%game, %victimID, %killerID) { InitContainerRadiusSearch(%victimID.plyrPointOfDeath, %game.RADIUS_FLAG_DEFENSE, $TypeMasks::ItemObjectType); - %objID = containerSearchNext(); - while(%objID != 0) + %objID = containerSearchNext(); + while(%objID != 0) { %objType = %objID.getDataBlock().getName(); - if ((%objType $= "Flag") && (%objID.team == %killerID.team)) + if ((%objType $= "Flag") && (%objID.team == %killerID.team)) return true; //found the(a) killer's flag near the victim's point of death else - %objID = containerSearchNext(); + %objID = containerSearchNext(); } - return false; //didn't find a qualifying flag within required radius of victims point of death + return false; //didn't find a qualifying flag within required radius of victims point of death } function SCtFGame::testGenDefend(%game, %victimID, %killerID) @@ -1338,23 +1338,23 @@ function SCtFGame::testGenDefend(%game, %victimID, %killerID) while(%objID != 0) { %objType = %objID.getDataBlock().ClassName; - if ((%objType $= "generator") && (%objID.team == %killerID.team)) + if ((%objType $= "generator") && (%objID.team == %killerID.team)) return true; //found a killer's generator within required radius of victim's death else %objID = containerSearchNext(); } - return false; //didn't find a qualifying gen within required radius of victim's point of death + return false; //didn't find a qualifying gen within required radius of victim's point of death } function SCtFGame::testCarrierKill(%game, %victimID, %killerID) { %flag = %victimID.plyrDiedHoldingFlag; - return ((%flag !$= "") && (%flag.team == %killerID.team)); + return ((%flag !$= "") && (%flag.team == %killerID.team)); } function SCtFGame::testEscortAssist(%game, %victimID, %killerID) { - return (%victimID.dmgdFlagCarrier); + return (%victimID.dmgdFlagCarrier); } function SCtFGame::testValidRepair(%game, %obj) @@ -1374,13 +1374,13 @@ function SCtFGame::testValidRepair(%game, %obj) //error(%obj SPC "was repaired by an enemy"); return false; } - else + else { if(%obj.soiledByEnemyRepair) %obj.soiledByEnemyRepair = false; return true; } -} +} function SCtFGame::awardScoreFlagCap(%game, %cl, %flag) { @@ -1422,7 +1422,7 @@ function SCtFGame::awardScoreFlagCap(%game, %cl, %flag) function SCtFGame::awardScoreFlagTouch(%game, %cl, %flag) { - + %flag.grabber = %cl; %flag.grabber.flagGrabs++; //moved from awardScoreFlagCap to correctly count flaggrabs %team = %cl.team; @@ -1458,14 +1458,14 @@ function SCtFGame::checkScoreLimit(%game, %team) // default of 5 if scoreLimit not defined if(%scoreLimit $= "") %scoreLimit = 5 * %game.SCORE_PER_TEAM_FLAG_CAP; - if($TeamScore[%team] >= %scoreLimit) + if($TeamScore[%team] >= %scoreLimit) %game.scoreLimitReached(); } function SCtFGame::awardScoreFlagReturn(%game, %cl, %perc) { %cl.flagReturns++; //give flagreturn stat - + if (%game.SCORE_PER_FLAG_RETURN != 0) { %pts = mfloor( %game.SCORE_PER_FLAG_RETURN * (%perc/100) ); @@ -1473,7 +1473,7 @@ function SCtFGame::awardScoreFlagReturn(%game, %cl, %perc) messageClient(%cl, 'scoreFlaRetMsg', 'Flag return - exceeded capping distance - %1 point bonus.', %pts, %perc); else if(%perc == 0) messageClient(%cl, 'scoreFlaRetMsg', 'You gently place the flag back on the stand.', %pts, %perc); - else + else messageClient(%cl, 'scoreFlaRetMsg', '\c0Flag return from %2%% of capping distance - %1 point bonus.', %pts, %perc); %cl.returnPts += %pts; } @@ -1512,7 +1512,7 @@ function SCtFGame::awardScoreCarrierKill(%game, %killerID) messageClient(%killerID, 'msgCarKill', '\c0You received a %1 point bonus for stopping the enemy flag carrier!', %game.SCORE_PER_CARRIER_KILL); messageTeamExcept(%killerID, 'msgCarKill', '\c2%1 stopped the enemy flag carrier.', %killerID.name); // z0dd - ZOD, 8/15/02. Tell team } - %game.recalcScore(%killerID); + %game.recalcScore(%killerID); return %game.SCORE_PER_CARRIER_KILL; } @@ -1523,7 +1523,7 @@ function SCtFGame::awardScoreFlagDefend(%game, %killerID) { messageClient(%killerID, 'msgFlagDef', '\c0You received a %1 point bonus for defending your flag!', %game.SCORE_PER_FLAG_DEFEND); messageTeamExcept(%killerID, 'msgFlagDef', '\c2%1 defended our flag.', %killerID.name); // z0dd - ZOD, 8/15/02. Tell team - } + } %game.recalcScore(%killerID); return %game.SCORE_PER_FLAG_DEFEND; } @@ -1563,8 +1563,8 @@ function SCtFGame::resetScore(%game, %client) %client.depSensorDestroys = 0; %client.depTurretDestroys = 0; %client.depStationDestroys = 0; - %client.vehicleScore = 0; - %client.vehicleBonus = 0; + %client.vehicleScore = 0; + %client.vehicleBonus = 0; %client.flagDefends = 0; %client.defenseScore = 0; @@ -1723,7 +1723,7 @@ function SCtFGame::testValidRepair(%game, %obj) return false; else if(%obj.team != %obj.repairedBy.team) return false; - else + else { if(%obj.soiledByEnemyRepair) %obj.soiledByEnemyRepair = false; @@ -1856,7 +1856,7 @@ function SCtFGame::enterMissionArea(%game, %playerData, %player) if(%player.getState() $= "Dead") return; - %player.client.outOfBounds = false; + %player.client.outOfBounds = false; messageClient(%player.client, 'EnterMissionArea', '\c1You are back in the mission area.'); logEcho(%player.client.nameBase@" (pl "@%player@"/cl "@%player.client@") entered mission area"); @@ -1905,10 +1905,10 @@ function SCtFGame::boundaryLoseFlag(%game, %player) %flag.setCollisionTimeout(%player); %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag? - + if($Host::ClassicEvoStats) %game.totalFlagHeldTime[%flag] = 0; - + %game.playerDroppedFlag(%player); // now for the tricky part -- throwing the flag back into the mission area @@ -1942,7 +1942,7 @@ function SCtFGame::boundaryLoseFlag(%game, %player) } function SCtFGame::dropFlag(%game, %player) -{ +{ if(%player.holdingFlag > 0) { if (!%player.client.outOfBounds) @@ -1965,28 +1965,28 @@ function SCtFGame::vehicleDestroyed(%game, %vehicle, %destroyer) %vehicleType = getTaggedString(%data.targetTypeTag); if(%vehicleType !$= "MPB") %vehicleType = strlwr(%vehicleType); - + %enemyTeam = ( %destroyer.team == 1 ) ? 2 : 1; - + %scorer = 0; %multiplier = 1; - + %passengers = 0; for(%i = 0; %i < %data.numMountPoints; %i++) if(%vehicle.getMountNodeObject(%i)) %passengers++; - + //what destroyed this vehicle if(%destroyer.client) { //it was a player, or his mine, satchel, whatever... %destroyer = %destroyer.client; %scorer = %destroyer; - + // determine if the object used was a mine if(%vehicle.lastDamageType == $DamageType::Mine) %multiplier = 2; - } + } else if(%destroyer.getClassName() $= "Turret") { if(%destroyer.getControllingClient()) @@ -1995,12 +1995,12 @@ function SCtFGame::vehicleDestroyed(%game, %vehicle, %destroyer) %destroyer = %destroyer.getControllingClient(); %scorer = %destroyer; } - else + else { %destroyerName = "A turret"; %multiplier = 0; } - } + } else if(%destroyer.getDataBlock().catagory $= "Vehicles") { // Vehicle vs vehicle kill! @@ -2008,7 +2008,7 @@ function SCtFGame::vehicleDestroyed(%game, %vehicle, %destroyer) %gunnerNode = 1; else %gunnerNode = 0; - + if(%destroyer.getMountNodeObject(%gunnerNode)) { %destroyer = %destroyer.getMountNodeObject(%gunnerNode).client; @@ -2019,23 +2019,23 @@ function SCtFGame::vehicleDestroyed(%game, %vehicle, %destroyer) else // Is there anything else we care about? return; - + if(%destroyerName $= "") %destroyerName = %destroyer.name; - + if(%vehicle.team == %destroyer.team) // team kill { %pref = (%vehicleType $= "Assault Tank") ? "an" : "a"; messageAll( 'msgVehicleTeamDestroy', '\c0%1 TEAMKILLED %3 %2!', %destroyerName, %vehicleType, %pref); } - + else // legit kill { //messageTeamExcept(%destroyer, 'msgVehicleDestroy', '\c0%1 destroyed an enemy %2.', %destroyerName, %vehicleType); // z0dd - ZOD, 8/20/02. not needed with new messenger on line below teamDestroyMessage(%destroyer, 'msgVehDestroyed', '\c5%1 destroyed an enemy %2!', %destroyerName, %vehicleType); // z0dd - ZOD, 8/20/02. Send teammates a destroy message messageTeam(%enemyTeam, 'msgVehicleDestroy', '\c0%1 destroyed your team\'s %2.', %destroyerName, %vehicleType); //messageClient(%destroyer, 'msgVehicleDestroy', '\c0You destroyed an enemy %1.', %vehicleType); - + if(%scorer) { %value = %game.awardScoreVehicleDestroyed(%scorer, %vehicleType, %multiplier, %passengers); @@ -2047,7 +2047,7 @@ function SCtFGame::vehicleDestroyed(%game, %vehicle, %destroyer) function SCtFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mult, %passengers) { // z0dd - ZOD, 9/29/02. Removed T2 demo code from here - + if(%vehicleType $= "Grav Cycle") %base = %game.SCORE_PER_DESTROY_WILDCAT; else if(%vehicleType $= "Assault Tank") @@ -2060,11 +2060,11 @@ function SCtFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mul %base = %game.SCORE_PER_DESTROY_BOMBER; else if(%vehicleType $= "Heavy Transport") %base = %game.SCORE_PER_DESTROY_TRANSPORT; - - %total = ( %base * %mult ) + ( %passengers * %game.SCORE_PER_PASSENGER ); + + %total = ( %base * %mult ) + ( %passengers * %game.SCORE_PER_PASSENGER ); %client.vehicleScore += %total; - + messageClient(%client, 'msgVehicleScore', '\c0You received a %1 point bonus for destroying an enemy %2.', %total, %vehicleType); %game.recalcScore(%client); return %total; @@ -2072,9 +2072,9 @@ function SCtFGame::awardScoreVehicleDestroyed(%game, %client, %vehicleType, %mul function SCtFGame::shareScore(%game, %client, %amount) { - // z0dd - ZOD, 9/29/02. Removed T2 demo code from here - - //error("share score of"SPC %amount SPC "from client:" SPC %client); + // z0dd - ZOD, 9/29/02. Removed T2 demo code from here + + //error("share score of"SPC %amount SPC "from client:" SPC %client); // all of the player in the bomber and tank share the points // gained from any of the others %vehicle = %client.vehicleMounted; @@ -2097,7 +2097,7 @@ function SCtFGame::shareScore(%game, %client, %amount) %occCl.vehicleBonus += %amount; %game.recalcScore(%occCl); } - } + } } } } @@ -2108,7 +2108,7 @@ function SCtFGame::awardScoreTurretKill(%game, %victimID, %implement) { if (%killer == %victimID) %game.awardScoreSuicide(%victimID); - else if (%killer.team == %victimID.team) //player controlling a turret killed a teammate + else if (%killer.team == %victimID.team) //player controlling a turret killed a teammate { %killer.teamKills++; %game.awardScoreTurretTeamKill(%victimID, %killer); @@ -2119,22 +2119,22 @@ function SCtFGame::awardScoreTurretKill(%game, %victimID, %implement) %killer.mannedturretKills++; %game.recalcScore(%killer); %game.awardScoreDeath(%victimID); - } - } + } + } else if ((%killer = %implement.owner) != 0) //if it isn't controlled, award score to whoever deployed it { - if (%killer.team == %victimID.team) + if (%killer.team == %victimID.team) { %game.awardScoreDeath(%victimID); } - else + else { %killer.turretKills++; %game.recalcScore(%killer); %game.awardScoreDeath(%victimID); } - } - //default is, no one was controlling it, no one owned it. No score given. + } + //default is, no one was controlling it, no one owned it. No score given. } function SCtFGame::testKill(%game, %victimID, %killerID) @@ -2144,8 +2144,8 @@ function SCtFGame::testKill(%game, %victimID, %killerID) function SCtFGame::awardScoreKill(%game, %killerID) { - %killerID.kills++; - %game.recalcScore(%killerID); + %killerID.kills++; + %game.recalcScore(%killerID); return %game.SCORE_PER_KILL; } @@ -2154,7 +2154,7 @@ function checkVehicleCamping( %team ) %position = $flagPos[%team]; %radius = 5; InitContainerRadiusSearch(%position, %radius, $TypeMasks::VehicleObjectType ); - + while ((%vehicle = containerSearchNext()) != 0) { %dist = containerSearchCurrRadDamageDist(); @@ -2162,12 +2162,12 @@ function checkVehicleCamping( %team ) if (%dist > %radius) continue; else - { + { //if( %vehicle.team == %team ) applyVehicleCampDamage( %vehicle ); } } - + if( %team == 1 ) Game.campThread_1 = schedule( 1000, 0, "checkVehicleCamping", 1 ); else @@ -2183,9 +2183,9 @@ function applyVehicleCampDamage( %vehicle ) return; %client = %vehicle.getMountNodeObject(0).client; // grab the pilot - + messageClient( %client, 'serverMessage', "Can't park vehicles in flag zones!" ); - %vehicle.getDataBlock().damageObject( %vehicle, 0, "0 0 0", 0.5, 0); + %vehicle.getDataBlock().damageObject( %vehicle, 0, "0 0 0", 0.5, 0); } // z0dd - ZOD, 10/02/02. Hack for flag collision bug. @@ -2208,12 +2208,12 @@ function SCtFGame::startFlagCollisionSearch(%game, %flag) function SCtFGame::sendGameVoteMenu(%game, %client, %key) { parent::sendGameVoteMenu( %game, %client, %key ); - + %isAdmin = ( %client.isAdmin || %client.isSuperAdmin ); - + if(!%client.canVote && !%isAdmin) return; - + if ( %game.scheduleVote $= "" ) { if(!%client.isAdmin) @@ -2270,7 +2270,7 @@ function SCtFGame::sendGameVoteMenu(%game, %client, %key) //} function SCtFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4) -{ +{ switch$ (%typeName) { //case "voteAntiTurtleTime": @@ -2280,7 +2280,7 @@ function SCtFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4 case "SCtFProMode": %game.SCtFProMode(%admin, %arg1, %arg2, %arg3, %arg4); } - + parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4); } @@ -2301,14 +2301,14 @@ function SCtFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4 // else // { // %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; -// if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) +// if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) // { -// messageAll('MsgVotePassed', '\c2The anti-turtle time is set to %1.', %display); +// messageAll('MsgVotePassed', '\c2The anti-turtle time is set to %1.', %display); // $Host::ClassicAntiTurtleTime = %newLimit; // %cause = "(vote)"; // } -// else -// messageAll('MsgVoteFailed', '\c2The vote to change the anti-turtle time did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); +// else +// messageAll('MsgVoteFailed', '\c2The vote to change the anti-turtle time did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); // } // if(%cause !$= "") // logEcho($AdminCl.name @ ": anti-turtle time set to "@%display SPC %cause, 1); @@ -2326,14 +2326,14 @@ function SCtFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4 // else // { // %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; -// if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) +// if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100)) // { -// messageAll('MsgVotePassed', '\c2The armor class was set to %1.', %newLimit); +// messageAll('MsgVotePassed', '\c2The armor class was set to %1.', %newLimit); // $Sctf::Armor = %newLimit; // %cause = "(vote)"; // } -// else -// messageAll('MsgVoteFailed', '\c2The vote to change the armor class did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); +// else +// messageAll('MsgVoteFailed', '\c2The vote to change the armor class did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount) * 100)); // } // switch$ ( %newLimit ) // { @@ -2371,18 +2371,18 @@ function SCtFGame::SCtFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4) { if( $countdownStarted && $MatchStarted ) { - if(%admin) + if(%admin) { killeveryone(); if($Host::SCtFProMode) { messageAll('MsgAdminForce', '\c2The Admin has disabled Pro Mode.'); - + $InvBanList[SCtF, "Chaingun"] = 0; $InvBanList[SCtF, "ShockLance"] = 0; $InvBanList[SCtF, "Plasma"] = 0; - + $Host::SCtFProMode = false; } else @@ -2392,11 +2392,11 @@ function SCtFGame::SCtFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4) $InvBanList[SCtF, "Chaingun"] = 1; $InvBanList[SCtF, "ShockLance"] = 1; $InvBanList[SCtF, "Plasma"] = 1; - + $Host::SCtFProMode = true; } } - else + else { %totalVotes = %game.totalVotesFor + %game.totalVotesAgainst; if(%totalVotes > 0 && (%game.totalVotesFor / ClientGroup.getCount()) > ($Host::VotePasspercent / 100)) @@ -2410,7 +2410,7 @@ function SCtFGame::SCtFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4) $InvBanList[SCtF, "Chaingun"] = 0; $InvBanList[SCtF, "ShockLance"] = 0; $InvBanList[SCtF, "Plasma"] = 0; - + $Host::SCtFProMode = false; } else @@ -2420,12 +2420,12 @@ function SCtFGame::SCtFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4) $InvBanList[SCtF, "Chaingun"] = 1; $InvBanList[SCtF, "ShockLance"] = 1; $InvBanList[SCtF, "Plasma"] = 1; - + $Host::SCtFProMode = true; } } else - messageAll('MsgVoteFailed', '\c2Mode change did not pass: %1 percent.', mFloor(%game.totalVotesFor/ClientGroup.getCount() * 100)); + messageAll('MsgVoteFailed', '\c2Mode change did not pass: %1 percent.', mFloor(%game.totalVotesFor/ClientGroup.getCount() * 100)); } } } @@ -2504,7 +2504,7 @@ function deleteObjectsFromMapByType(%type) return; } - + deleteObjectsFromGroupByType(%team1Base0Group, %type); deleteObjectsFromGroupByType(%team2Base0Group, %type); } @@ -2540,7 +2540,7 @@ function deleteObjectsFromGroupByType(%group, %type) } function deleteNonSCtFObjectsFromMap() -{ +{ deleteObjectsFromGroupByType(MissionGroup, "Turret"); deleteObjectsFromGroupByType(MissionGroup, "StaticShape"); deleteObjectsFromGroupByType(MissionGroup, "FlyingVehicle");