NoEvo Redo

This commit is contained in:
ChocoTaco 2020-03-23 16:23:42 -04:00
parent b84ddd8859
commit facba6d9cd
36 changed files with 6686 additions and 2425 deletions

View file

@ -0,0 +1,489 @@
//Taco October 2018
//removed alot of things that were already included in the classic code
//and checked if evo wasnt double overriding functions
package AntiLouExploitFixes
{
// MPB INSTANT ENERGY FIX
// VehicleData::onRemove(%this, %obj)
// Info: this is called after the MPB is destroyed. Reset the variable
function VehicleData::onRemove(%this, %obj)
{
if(%obj.station.isDestroyed)
%obj.station.isDestroyed = 0;
parent::onRemove(%this, %obj);
}
// stationTrigger::onEnterTrigger(%data, %obj, %colObj)
// Info: If the MPB is destroyed, don't allow players to use the inv
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;
// Part of hack to keep people from mounting vehicles in disallowed armors.
if(%obj.station.getDataBlock().getName() !$= "StationVehicle")
%colObj.client.inInv = true;
%colObj.inStation = true;
commandToClient(%colObj.client,'setStationKeys', true);
if(Game.stationOnEnterTrigger(%data, %obj, %colObj))
{
//verify station.team is team associated and isn't on player's team
if((%obj.mainObj.team != %colObj.client.team) && (%obj.mainObj.team != 0))
{
messageClient(%colObj.client, 'msgStationDenied', '\c2Access Denied -- Wrong team.~wfx/powered/station_denied.wav');
}
else if(%obj.disableObj.isDisabled())
{
messageClient(%colObj.client, 'msgStationDisabled', '\c2Station is disabled.');
}
else if(!%obj.mainObj.isPowered())
{
messageClient(%colObj.client, 'msgStationNoPower', '\c2Station is not powered.');
}
else if(%obj.station.notDeployed)
{
messageClient(%colObj.client, 'msgStationNotDeployed', '\c2Station is not deployed.');
}
else if(%obj.station.isDestroyed)
{
messageClient(%colObj.client, 'msgStationDestroyed', '\c2Station is destroyed.');
}
else if(%obj.station.triggeredBy $= "")
{
if(%obj.station.getDataBlock().setPlayersPosition(%obj.station, %obj, %colObj))
{
messageClient(%colObj.client, 'CloseHud', "", 'inventoryScreen');
commandToClient(%colObj.client, 'TogglePlayHuds', true);
%obj.station.triggeredBy = %colObj;
%obj.station.getDataBlock().stationTriggered(%obj.station, 1);
%colObj.station = %obj.station;
%colObj.lastWeapon = ( %colObj.getMountedImage($WeaponSlot) == 0 ) ? "" : %colObj.getMountedImage($WeaponSlot).getName().item;
%colObj.unmountImage($WeaponSlot);
}
}
}
}
// END MPB INSTANT ENERGY FIX
// VEHICLE STATION SPAM FIX
// serverCmdBuyVehicle(%client, %blockName)
// Info: Fix an exploit that makes the server lag.
function serverCmdBuyVehicle(%client, %blockName)
{
// if the client has already created a vehicle, don't execute the function
if(%client.cantBuyVehicle)
return;
%team = %client.getSensorGroup();
if(vehicleCheck(%blockName, %team))
{
%station = %client.player.station.pad;
if((%station.ready) && (%station.station.vehicle[%blockName]))
{
%trans = %station.getTransform();
%pos = getWords(%trans, 0, 2);
%matrix = VectorOrthoBasis(getWords(%trans, 3, 6));
%yrot = getWords(%matrix, 3, 5);
%p = vectorAdd(%pos,vectorScale(%yrot, -3));
%p = getWords(%p, 0, 1) @ " " @ getWord(%p, 2) + 4;
%p = vectorAdd(%p, %blockName.spawnOffset);
%rot = getWords(%trans, 3, 5);
%angle = getWord(%trans, 6) + 3.14;
%mask = $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StationObjectType | $TypeMasks::TurretObjectType;
InitContainerRadiusSearch(%p, %blockName.checkRadius, %mask);
%clear = 1;
for(%x = 0; (%obj = containerSearchNext()) != 0; %x++)
{
if((%obj.getType() & $TypeMasks::VehicleObjectType) && (%obj.getDataBlock().checkIfPlayersMounted(%obj)))
{
%clear = 0;
break;
}
else
%removeObjects[%x] = %obj;
}
if(%clear)
{
%fadeTime = 0;
for(%i = 0; %i < %x; %i++)
{
if(%removeObjects[%i].getType() & $TypeMasks::PlayerObjectType)
{
%pData = %removeObjects[%i].getDataBlock();
%pData.damageObject(%removeObjects[%i], 0, "0 0 0", 1000, $DamageType::VehicleSpawn);
}
else
{
%removeObjects[%i].mountable = 0;
%removeObjects[%i].startFade(1000, 0, true);
%removeObjects[%i].schedule(1001, "delete");
%fadeTime = 1500;
}
}
// client has buyed a vehicle
%client.cantBuyVehicle = 1;
schedule(%fadeTime, 0, "createVehicle", %client, %station, %blockName, %team , %p, %rot, %angle);
// wait 6,5 seconds (time a vehicle needs to be created) before buying another vehicle
schedule(6500, 0, "resetBuyVehicle", %client);
}
else
MessageClient(%client, "", 'Can\'t create vehicle. A player is on the creation pad.');
}
else
messageClient(%client, "", "~wfx/misc/misc.error.wav");
}
else
messageClient(%client, "", "~wfx/misc/misc.error.wav");
}
// resetBuyVehicle(%client)
// Info: delete the variable, so client can buy another vehicle
function resetBuyVehicle(%client)
{
%client.cantBuyVehicle = "";
}
// END VEHICLE STATION SPAM FIX
// ShapeBase::throwObject(%this,%obj)
// Info: Delay on calculating flag stats
function ShapeBase::throwObject(%this,%obj)
{
// z0dd - ZOD, 4/15/02. Allow respawn switching during tourney wait.
if(!$MatchStarted)
return;
// z0dd - ZOD, 5/26/02. Remove anti-hover so flag can be thrown properly
if(%obj.getDataBlock().getName() $= "Flag")
{
%obj.static = false;
// z0dd - ZOD - SquirrelOfDeath, 10/02/02. Hack for flag collision bug.
if(Game.Class $= CTFGame || Game.Class $= PracticeCTFGame)
%obj.searchSchedule = Game.schedule(10, "startFlagCollisionSearch", %obj);
}
%srcCorpse = (%this.getState() $= "Dead"); // z0dd - ZOD, 4/14/02. Flag tossed from corpse
//if the object is being thrown by a corpse, use a random vector
if (%srcCorpse && %obj.getDataBlock().getName() !$= "Flag") // z0dd - ZOD, 4/14/02. Except for flags..
{
%vec = (-1.0 + getRandom() * 2.0) SPC (-1.0 + getRandom() * 2.0) SPC getRandom();
%vec = vectorScale(%vec, 10);
}
else // else Initial vel based on the dir the player is looking
{
%eye = %this.getEyeVector();
%vec = vectorScale(%eye, 20);
}
// Add a vertical component to give the item a better arc
%dot = vectorDot("0 0 1",%eye);
if (%dot < 0)
%dot = -%dot;
%vec = vectorAdd(%vec,vectorScale("0 0 12",1 - %dot)); // z0dd - ZOD, 9/10/02. 10 was 8
// Add player's velocity
%vec = vectorAdd(%vec,%this.getVelocity());
%pos = getBoxCenter(%this.getWorldBox());
//since flags have a huge mass (so when you shoot them, they don't bounce too far)
//we need to up the %vec so that you can still throw them...
if (%obj.getDataBlock().getName() $= "Flag")
{
%vec = vectorScale(%vec, (%srcCorpse ? 40 : 75)); // z0dd - ZOD, 4/14/02. Throw flag force. Value was 40
// z0dd - ZOD, 9/27/02. Delay on grabbing flag after tossing it
%this.flagTossWait = true;
%this.schedule(1000, resetFlagTossWait);
// Delay on calculating stats
%this.flagStatsWait = true;
%this.schedule(5000, resetFlagStatsWait);
}
//
%obj.setTransform(%pos);
%obj.applyImpulse(%pos,%vec);
%obj.setCollisionTimeout(%this);
%data = %obj.getDatablock();
%data.onThrow(%obj, %this);
//call the AI hook
AIThrowObject(%obj);
}
// Player::resetFlagStatsWait(%this)
// Info: Delay on calculating the stats
function Player::resetFlagStatsWait(%this)
{
%this.flagStatsWait = false;
}
// Fix for observer vehicle bug, where observers are drawn to
// a vehicle no matter whether they are observing the client or not
// Thanks to MT for pointing out.
function resetObserveFollow( %client, %dismount )
{
if( %dismount )
{
if( !isObject( %client.player ) )
return;
for( %i = 0; %i < %client.observeCount; %i++ )
{
// Check if data in %client.observers[%i] is correct at all
if ( %client.observers[%i].clientObserve != %client )
{
continue;
}
%client.observers[%i].camera.setOrbitMode( %client.player, %client.player.getTransform(), 0.5, 4.5, 4.5);
}
}
else
{
if( !%client.player.isMounted() )
return;
// grab the vehicle...
%mount = %client.player.getObjectMount();
if( %mount.getDataBlock().observeParameters $= "" )
%params = %client.player.getTransform();
else
%params = %mount.getDataBlock().observeParameters;
for( %i = 0; %i < %client.observeCount; %i++ )
{
// Check if data in %client.observers[%i] is correct at all
if ( %client.observers[%i].clientObserve != %client )
{
continue;
}
%client.observers[%i].camera.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
}
}
}
// ilys - Start checkSpeed schedule on MPB
function MobileBaseVehicle::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
%obj.schedule(5000, "checkSpeed", %obj);
}
// ilys - checkSpeed function. Kill the driver and MPB if going too fast.
function WheeledVehicle::checkSpeed(%data, %obj)
{
if(VectorLen(%obj.getVelocity()) > 200)
{
if(%obj.getMountNodeObject(0)) %obj.getMountNodeObject(0).scriptKill(36);
%obj.setDamagelevel(4);
}
%obj.schedule(5000, "checkSpeed", %data, %obj);
}
// ilys - No lava, please.
function StationVehiclePad::createStationVehicle(%data, %obj)
{
%group = %obj.getGroup();
%xform = %obj.getSlotTransform(0);
%position = getWords(%xform, 0, 2);
%rotation = getWords(%xform, 3, 5);
%angle = (getWord(%xform, 6) * 180) / 3.14159;
if(%obj.stationPos $= "" || %obj.stationRot $= "")
{
%pos = %position;
%rot = %rotation @ " " @ %angle;
}
else
{
%pos = %obj.stationPos;
%rot = %obj.stationRot;
}
%sv = new StaticShape() {
scale = "1 1 1";
dataBlock = "StationVehicle";
lockCount = "0";
homingCount = "0";
team = %obj.team;
position = %pos;
rotation = %rot;
};
%group.add(%sv);
%sv.setPersistent(false);
%sv.getDataBlock().gainPower(%sv);
%sv.getDataBlock().createTrigger(%sv);
%sv.pad = %obj;
%obj.station = %sv;
%sv.trigger.mainObj = %obj;
%sv.trigger.disableObj = %sv;
if(%sv.getTarget() != -1)
setTargetSensorGroup(%sv.getTarget(), %obj.team);
if(%obj.scoutVehicle !$= "Removed")
%sv.vehicle[scoutvehicle] = true;
if(%obj.assaultVehicle !$= "Removed")
%sv.vehicle[assaultVehicle] = true;
if(%obj.mobileBaseVehicle !$= "Removed")
{
// ilys - Removed lava waterblock code from here
%sv.vehicle[mobileBasevehicle] = true;
%sv.getDataBlock().createTeleporter(%sv, %group);
}
if(%obj.scoutFlyer !$= "Removed")
%sv.vehicle[scoutFlyer] = true;
if(%obj.bomberFlyer !$= "Removed")
%sv.vehicle[bomberFlyer] = true;
if(%obj.hapcFlyer !$= "Removed")
%sv.vehicle[hapcFlyer] = true;
}
// ilys - We dont do anything here now
function serverCmdClientTeamChange( %client )
{
// Don't do it, man. DON'T DO IT!
}
// ilys - Only allow the client to force play when the match has started
function serverCmdClientJoinGame(%client)
{
if(!$MatchStarted) return;
parent::serverCmdClientJoinGame(%client);
}
function serverCmdPlayAnim(%client, %anim)
{
// Not used in Classic
}
// ilys - Do not allow animations inside a forcefield.
// ilys - Unmount the mortar and grenade launcher on animation.
function PlayAnim(%client, %anim)
{
if( %anim $= "Death1" || %anim $= "Death2" || %anim $= "Death3" || %anim $= "Death4" || %anim $= "Death5" ||
%anim $= "Death6" || %anim $= "Death7" || %anim $= "Death8" || %anim $= "Death9" || %anim $= "Death10" ||
%anim $= "Death11" || %anim $= "sitting" || %anim $= "scoutRoot" || %anim $= "look" || %anim $= "lookms" ||
%anim $= "looknw" || %anim $= "head" || %anim $= "headSide" || %anim $= "ski" || %anim $= "light_recoil")
return;
%player = %client.player;
if(!isObject(%player))
return;
if(%player.isMounted() || %player.isInForceField())
return;
%weapon = ( %player.getMountedImage($WeaponSlot) == 0 ) ? "" : %player.getMountedImage($WeaponSlot).getName().item;
if(%weapon $= "MissileLauncher" || %weapon $= "GrenadeLauncher" || %weapon $= "SniperRifle" || %weapon $= "Mortar")
{
%player.animResetWeapon = true;
%player.lastWeapon = %weapon;
%player.unmountImage($WeaponSlot);
%player.setArmThread(look);
}
%player.setActionThread(%anim);
}
// ilys - Fix for the Standing Pilot bug
function Armor::onMount(%this,%obj,%vehicle,%node)
{
if (%node == 0)
{
%obj.setTransform("0 0 0 0 0 1 0");
%obj.setActionThread(%vehicle.getDatablock().mountPose[%node],true,true);
%obj.schedule(300,"setActionThread",%vehicle.getDatablock().mountPose[%node],true,true);
if(!%obj.inStation) %obj.lastWeapon = (%obj.getMountedImage($WeaponSlot) == 0 ) ? "" : %obj.getMountedImage($WeaponSlot).item;
%obj.unmountImage($WeaponSlot);
if(!%obj.client.isAIControlled())
{
%obj.setControlObject(%vehicle);
%obj.client.setObjectActiveImage(%vehicle, 2);
}
if(%obj == %obj.lastVehicle.lastPilot && %obj.lastVehicle != %vehicle)
{
schedule(15000, %obj.lastVehicle,"vehicleAbandonTimeOut", %obj.lastVehicle);
%obj.lastVehicle.lastPilot = "";
}
if(%vehicle.lastPilot !$= "" && %vehicle == %vehicle.lastPilot.lastVehicle) %vehicle.lastPilot.lastVehicle = "";
%vehicle.abandon = false;
%vehicle.lastPilot = %obj;
%obj.lastVehicle = %vehicle;
if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "")
{
setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup());
if( %vehicle.turretObject > 0 ) setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup());
}
commandToClient( %obj.client, 'VehicleMount' );
}
else
{
if(%vehicle.getDataBlock().mountPose[%node] !$= "") %obj.setActionThread(%vehicle.getDatablock().mountPose[%node]);
else %obj.setActionThread("root", true);
}
if(%vehicle.getDatablock().numMountPoints > 1)
{
%nodeName = findNodeName(%vehicle, %node); // function in vehicle.cs
for(%i = 0; %i < %vehicle.getDatablock().numMountPoints; %i++)
{
if (%vehicle.getMountNodeObject(%i) > 0)
{
if(%vehicle.getMountNodeObject(%i).client != %obj.client)
{
%team = (%obj.team == %vehicle.getMountNodeObject(%i).client.team ? 'Teammate' : 'Enemy');
messageClient( %vehicle.getMountNodeObject(%i).client, 'MsgShowPassenger', '\c2%3: \c3%1\c2 has boarded in the \c3%2\c2 position.', %obj.client.name, %nodeName, %team );
}
commandToClient( %vehicle.getMountNodeObject(%i).client, 'showPassenger', %node, true);
}
}
}
if ( %obj.getImageTrigger( $BackpackSlot ) ) %obj.setImageTrigger( $BackpackSlot, false );
%obj.client.vehicleMounted = %vehicle;
AIVehicleMounted(%vehicle);
if(%obj.client.isAIControlled()) %this.AIonMount(%obj, %vehicle, %node);
}
// TracerDX/ilys - Server crash exploit fix
function serverCmdTeamMessageSent(%client, %text)
{
if((%client.voice $= "") && (strstr(%text, "~w") != -1) && (getSubStr(%text, (strlen(%text) - 4), 4) !$= ".wav")) return;
parent::serverCmdTeamMessageSent(%client, %text);
}
function serverCmdMessageSent(%client, %text)
{
if((%client.voice $= "") && (strstr(%text, "~w") != -1) && (getSubStr(%text, (strlen(%text) - 4), 4) !$= ".wav")) return;
parent::serverCmdMessageSent(%client, %text);
}
// Fix a problem with the package system
// dropping the first package when a non-active
// package is deactivated
function DeactivatePackage(%this)
{
if(!isActivePackage(%this)) return;
parent::DeactivatePackage(%this);
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(AntiLouExploitFixes))
activatePackage(AntiLouExploitFixes);

View file

@ -27,26 +27,13 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
//Reset
%lastclient1 = "";
%lastclient2 = "";
//Team Count code by Keen
$PlayerCount[0] = 0;
$PlayerCount[1] = 0;
$PlayerCount[2] = 0;
for(%i = 0; %i < ClientGroup.getCount(); %i++)
{
%client = ClientGroup.getObject(%i);
//if(!%client.isAIControlled())
$PlayerCount[%client.team]++;
}
//Difference Variables
%team1difference = $PlayerCount[1] - $PlayerCount[2];
%team2difference = $PlayerCount[2] - $PlayerCount[1];
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
//If even, stop.
if( %team1difference == 1 || %team2difference == 1 || $PlayerCount[1] == $PlayerCount[2] )
if( %team1difference == 1 || %team2difference == 1 || $TeamRank[1, count] == $TeamRank[2, count] )
{
//Reset TBN
ResetTBNStatus();
@ -112,7 +99,8 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
// Fire Autobalance
Game.clientChangeTeam( %client, %otherTeam, 0 );
messageAll('MsgTeamBalanceNotify', '~wfx/powered/vehicle_screen_on.wav');
messageClient(%client, 'MsgTeamBalanceNotify', "\c0You were switched to the other team for balancing.~wfx/powered/vehicle_screen_on.wav");
messageAllExcept(%client, -1, 'MsgTeamBalanceNotify', "~wfx/powered/vehicle_screen_on.wav");
//Trigger GetCounts
ResetGetCountsStatus();

View file

@ -0,0 +1,61 @@
$Host::ClassicAdminLog = 1;
$Host::ClassicConnectLog = 1;
//exec("scripts/autoexec/EnableLogs.cs");
//Enable Logs
setlogmode(1);
// adminLog(%client, %msg)
// Info: Logs the admin events
function adminLog(%client, %msg)
{
if(%client.isAdmin && $Host::ClassicAdminLog)
{
// get the client info
%authInfo = %client.getAuthInfo();
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
// this is the info that will be logged
$AdminLog = formatTimeString("M-d") SPC formatTimeString("[HH:nn]") SPC %client.nameBase @ " (" @ getField(%authInfo, 0) @ ", " @ %ip @ ", " @ %client.guid @ ", " @ %client.getAddress() @ ")" @ %msg SPC "[" @ $CurrentMission @ "]";
%logpath = $Host::ClassicAdminLogPath;
export("$AdminLog", %logpath, true);
logEcho($AdminLog);
echo($AdminLog);
}
}
// connectLog(%client, %realname, %tag)
// Info: Logs the connections
function connectLog(%client, %isDisconnect)
{
if($Host::ClassicConnectLog && !%client.isAIControlled())
{
// get the client info
%authInfo = %client.getAuthInfo();
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
// net tournament client present?
if (!%client.t2csri_sentComCertDone)
%ntc = "N";
else
%ntc = "Y";
if(%isDisconnect)
%inout = "[Drop]";
else
%inout = "[Join]";
if(%client.isSmurf)
%name = stripChars( detag( getTaggedString( %client.name ) ), "\cp\co\c6\c7\c8\c9" );
else
%name = %client.nameBase;
$ConnectLog = %inout SPC "#P[" @ $HostGamePlayerCount @ "]" SPC formatTimeString("M-d") SPC formatTimeString("[HH:nn]") SPC %name SPC "(" @ getField(%authInfo, 0) @ "," SPC %client.guid @ "," SPC %ip @ ")" SPC "[" @ $CurrentMission @ "]" SPC "NTC[" @ %ntc @ "]";
%logpath = $Host::ClassicConnLogPath;
export("$ConnectLog", %logpath, true);
logEcho($ConnectLog);
echo($ConnectLog);
}
}

View file

@ -0,0 +1,431 @@
// Eolk - People like evo's stats a lot... so that's what we'll give them...
$weap_message[1] = "Blaster master";
$weap_message[2] = "Plasma roaster";
$weap_message[3] = "Chainwh0re";
$weap_message[4] = "Disc-O-maniac";
$weap_message[5] = "Grenade puppy";
$weap_message[6] = "Laser turret";
$weap_message[8] = "Mortar maniac";
$weap_message[9] = "Missile lamer";
$weap_message[10] = "Shocklance bee";
$weap_message[11] = "Mine mayhem";
$weap_message[13] = "Road killer";
// Extra Stats
$weap_message[31] = "Demoman";
$weap_message[21] = "Clamp Farmer";
$weap_message[22] = "Spike Farmer";
$weap_message[26] = "Shrike Gunner";
$weap_message[27] = "Tailgunner";
$weap_message[28] = "Bombardier";
$weap_message[29] = "Tank Gunner (chain)";
$weap_message[30] = "Tank Gunner (mortar)";
$weap_message[31] = "Satchel Punk";
$weap_message[50] = "Combo King (mine+disc)";
// Handlers
package EvoStatHandles
{
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
{
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
// call the function
if(!$Host::TournamentMode)
handleDamageStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
}
function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation)
{
Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation);
// call the function
if(!$Host::TournamentMode)
handleKillStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
}
function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
{
if(isObject(%targetObject)) // Console spam fix.
{
// call the function
if(!$Host::TournamentMode)
handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %normal);
}
Parent::onCollision( %data, %projectile, %targetObject, %modifier, %position, %normal );
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(EvoStatHandles))
activatePackage(EvoStatHandles);
// handleDamageStat(%targetObject, %sourceObject, %position, %amount, %damageType)
// Info: Calcs: Damage and SnipeShot detection.
function handleDamageStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
{
// Reject damage that is not player initiated.
if(%damageType == 7 || %damageType == 12 || %damageType == 14 || %damageType == 24 || %damageType == 25 || %damageType == 33 || %damageType == 35 || %damageType == 36 || %damageType == 98 || %damageType == 99)
return;
// failsafe
if(!isObject(%sourceObject) || %sourceObject $= "" || !isObject(%targetObject) || %targetObject $= "")
return;
// don't count damage done to vehicles
if(%targetObject.isMounted())
return;
// Vehicle Impacts.
if(%damageType == 13){ // run down by vehicle
if(!(%attacker = %sourceObject.getControllingClient()) > 0){
return;
}
}
// Turrets.
else if(%sourceObject.getClassName() $= "Turret" || %sourceObject.getClassName() $= "VehicleTurret" || %sourceObject.getClassName() $= "FlyingVehicle" || %sourceObject.getClassName() $= "HoverVehicle"){
// Controlled
%attacker = %sourceObject.getControllingClient(); //is turret being controlled?
if(%attacker == 0){ // Not controlled.
// Owned
if(isObject(%sourceObject.owner)){
%attacker = %sourceObject.owner;
}
// Automated & no-owner.
else{
return;
}
}
} else { // Pretty much anything else.
%attacker = %sourceObject.client;
}
%victim = %targetObject.client;
// failsafe
if(%attacker $= "" || %victim $= "" || %attacker $= %victim)
return;
// check if it's a tk
if(Game.numTeams > 1 && %attacker.team $= %victim.team)
return;
// store the damage
if($Host::ClassicStatsType == 2)
{
// Teratos: Going to add mine+disc as a category...
// Teratos: Tracking only gets the second batch of damage, but we add 85% of that to make up for the first batch of damage (just a dumb estimate so damage numbers look realistic in post-game).
if(%victim.mineDisc) {
//$stats::weapon_damage[%attacker, 50] += %amount + (%amount * (%damageType == 11 ? 0.87 : 1.41)); // Mine accounts for more than disc.
$stats::weapon_damage[%attacker, 50] += %amount + $stats::last_minedisc[%attacker];
if($stats::weapon_damage[%attacker, 50] > $stats::weap_table[50])
{
$stats::weap_table[50] = $stats::weapon_damage[%attacker, 50];
$stats::client_weap_table[50] = getTaggedString(%attacker.name);
}
}
$stats::last_minedisc[%attacker] = %amount; // Track the last amount of damage so we can add it to the mine+disc.
// Teratos: END Mine+Disc Support.
$stats::weapon_damage[%attacker, %damageType] += %amount;
if($stats::weapon_damage[%attacker, %damageType] > $stats::weap_table[%damageType])
{
$stats::weap_table[%damageType] = $stats::weapon_damage[%attacker, %damageType];
$stats::client_weap_table[%damageType] = getTaggedString(%attacker.name);
}
}
// is it a laser damage?
if(%damageType == 6)
{
// i will consider only shots that have been fired with 60% of total energy
if(%sourceObject.getEnergyLevel() / %sourceObject.getDataBlock().maxEnergy < 0.6)
return;
%distance = mFloor(VectorDist(%position, %sourceObject.getWorldBoxCenter()));
// max distance for sniper (this is the only fix i could find)
// if(%distance > 1000)
// %distance = 1000;
// is it an headshot?
if(%victim.headshot)
{
%attacker.hs++;
if( ( %attacker.showMA $= "" ) || ( %attacker.showMA == 1 ) )
bottomPrint(%attacker, "HEADSHOT (" @ %attacker.hs @ ")! Distance is " @ %distance @ " meters.", 3);
logEcho(%attacker.nameBase @" (pl "@%attacker.player@"/cl "@%attacker@") headshot ("@%distance@")");
if(%attacker.hs > $stats::snipe_counter)
{
$stats::snipe_counter = %attacker.hs;
$stats::snipe_client = getTaggedString(%attacker.name);
}
if(%distance > $stats::snipe_maxdistance)
{
$stats::snipe_maxdistance = %distance;
$stats::snipe_maxdistanceclient = getTaggedString(%attacker.name);
}
}
else // no
{
if(%attacker.showMA $= "" || %attacker.showMA)
bottomPrint(%attacker, "HIT! Distance is " @ %distance @ " meters.", 3);
if(%distance > $stats::snipe_maxdistance)
{
$stats::snipe_maxdistance = %distance;
$stats::snipe_maxdistanceclient = getTaggedString(%attacker.name);
}
}
// this callback will allow players to autoscreenshot the shot
messageClient(%attacker, 'MsgSnipeShot', "", %distance);
}
}
// handleKillStat(%clVictim, %clKiller, %damageType, %implement)
// Info: Calcs: Kills, TeamKills, FC kills
function handleKillStat(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation)
{
if(%damageType == 13) // is a roadkill
%clKiller = %implement.getControllingClient();
if ( !isObject( %clVictim ) || !isObject( %clKiller ) )
return;
// failsafe
if(%clKiller $= "" || %clVictim $= "" || %clKiller $= %clVictim)
return;
// is it a tk?
if(%game.numTeams > 1 && %clKiller.team $= %clVictim.team)
{
$stats::tk[%clKiller]++;
if($stats::tk[%clKiller] > $stats::tk_counter)
{
$stats::tk_counter = $stats::tk[%clKiller];
$stats::tk_client = getTaggedString(%clKiller.name);
}
}
else // no
{
if($Host::ClassicStatsType == 1)
{
$stats::weapon_kills[%clKiller, %damageType]++;
if($stats::weapon_kills[%clKiller, %damageType] > $stats::weap_table[%damageType])
{
$stats::weap_table[%damageType] = $stats::weapon_kills[%clKiller, %damageType];
$stats::client_weap_table[%damageType] = getTaggedString(%clKiller.name);
}
}
// was the victim a fc?
if(%clVictim.plyrDiedHoldingFlag)
{
$stats::fckiller[%clKiller]++;
if($stats::fckiller[%clKiller] > $stats::fckiller_counter)
{
$stats::fckiller_counter = $stats::fckiller[%clKiller];
$stats::fckiller_client = getTaggedString(%clKiller.name);
}
}
}
}
// handleMAStat(%projectile, %targetObject, %position)
// Info: MA detection
function handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %normal)
{
// failsafe
if(!isObject(%targetObject) || %targetObject $= "")
return;
// failsafe
if(!isObject(%projectile.sourceObject) || %projectile.sourceObject $= "")
return;
%victim = %targetObject.client;
%killer = %projectile.sourceObject.client;
// // Altair's method
// %distance = mFloor(VectorDist(%position, %projectile.sourceObject.getWorldBoxCenter()));
// // Evolution Method
%distance = mFloor(VectorDist(%position, %projectile.initialPosition));
// failsafe
if(%victim $= "" || %killer $= "")
return;
%projectileType = %data.getName() !$= "TR2DiscProjectile" ? %data.getName() : "DiscProjectile";
// only disc, plasma, or blaster
if(%projectileType !$= "DiscProjectile" && %projectileType !$= "PlasmaBolt" && %projectileType !$= "EnergyBolt")
return;
// is it a tk?
if(Game.numTeams > 1 && %killer.team $= %victim.team)
return;
// Eolk - changes to MA code
%position = %targetObject.getPosition();
%raycast = containerRaycast(%position, vectorAdd(%position, "0 0 -10"), $TypeMasks::ForceFieldObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::VehicleObjectType, %targetObject);
if(!isObject(firstWord(%raycast))) // We've got something...
{
if(%projectileType $= "DiscProjectile")
{
%killer.midairs++;
if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
bottomPrint(%killer, "Midair Disk (" @ %killer.midairs @ ")! Distance is " @ %distance @ " meters.", 3);
// this callback will allow players to autoscreenshot the MA
messageClient(%killer, 'MsgMidAir', "", %distance);
logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair disc shot ("@%distance@")");
if(%killer.midairs > $stats::ma_counter)
{
$stats::ma_counter = %killer.midairs;
$stats::ma_client = getTaggedString(%killer.name);
}
if(%distance > $stats::ma_maxdistance)
{
$stats::ma_maxdistance = %distance;
$stats::ma_maxdistanceclient = getTaggedString(%killer.name);
}
}
else if(%projectileType $= "PlasmaBolt")
{
%killer.PlaMA++;
if ( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
bottomPrint(%killer, "Midair Plasma (" @ %killer.PlaMA @ ")! Distance is " @ %distance @ " meters.", 3);
// this callback will allow players to autoscreenshot the MA
messageClient(%killer, 'MsgPlasmaMidAir', "", %distance);
logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair plasma shot ("@%distance@")");
if(%killer.PlaMA > $stats::PlaMA_counter)
{
$stats::PlaMA_counter = %killer.PlaMA;
$stats::PlaMA_client = getTaggedString(%killer.name);
}
if(%distance > $stats::PlaMA_maxdistance)
{
$stats::PlaMA_maxdistance = %distance;
$stats::PlaMA_maxdistanceclient = getTaggedString(%killer.name);
}
}
else if(%projectileType $= "EnergyBolt")
{
%killer.blaMA++;
if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
bottomPrint(%killer, "Midair Blaster (" @ %killer.blaMA @ ")! Distance is " @ %distance @ " meters.", 3);
// this callback will allow players to autoscreenshot the MA
messageClient(%killer, 'MsgBlasterMidAir', "", %distance);
logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair blaster shot ("@%distance@")");
if(%killer.blaMA > $stats::BlaMA_counter)
{
$stats::BlaMA_counter = %killer.BlaMA;
$stats::BlaMA_client = getTaggedString(%killer.name);
}
if(%distance > $stats::BlaMA_maxdistance)
{
$stats::BlaMA_maxdistance = %distance;
$stats::BlaMA_maxdistanceclient = getTaggedString(%killer.name);
}
}
}
}
// sendEvoDebriefing(%client)
// Info: Send Evo stats to the debriefing page
function sendEvoDebriefing(%client)
{
// Eolk - Remove redundant checks
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00>%1 - %2<spop>', $MissionDisplayName, $MissionTypeDisplayName);
if($stats::MaxGrabSpeed || $stats::grabs_counter || $stats::fckiller_counter || $stats::caps_counter || $stats::fastestCap)
{
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>FLAG STATS<spop>');
if($stats::fastestCap)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Fastest Cap</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::fastcap_client, $stats::fastcap_time);
if($stats::MaxGrabSpeed)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Flaming Ass</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2 Kph!</clip><spop>', $stats::Grabber, $stats::MaxGrabSpeed);
if($stats::caps_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Cap Mastah</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::caps_client, $stats::caps_counter);
if($stats::grabs_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Grabz0r</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::grabs_client, $stats::grabs_counter);
if($stats::fckiller_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> FC killer</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::fckiller_client, $stats::fckiller_counter);
}
if($stats::BlaMA_counter || $stats::ma_counter || $stats::PlaMA_counter)
{
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>MID AIR<lmargin%%:30>CHAMPION<lmargin%%:60>DISTANCE<spop>');
if($stats::ma_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Disk</clip><lmargin%%:30><clip%%:60> %1 (%2)</clip><lmargin%%:60><clip%%:60> %3 (%4 mt)</clip><spop>', $stats::ma_client, $stats::ma_counter, $stats::ma_maxdistanceclient, $stats::ma_maxdistance);
if($stats::PlaMA_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Plasma</clip><lmargin%%:30><clip%%:60> %1 (%2)</clip><lmargin%%:60><clip%%:60> %3 (%4 mt)</clip><spop>', $stats::PlaMA_client, $stats::PlaMA_counter, $stats::PlaMA_maxdistanceclient, $stats::PlaMA_maxdistance);
if($stats::BlaMA_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Blaster</clip><lmargin%%:30><clip%%:60> %1 (%2)</clip><lmargin%%:60><clip%%:60> %3 (%4 mt)</clip><spop>', $stats::BlaMA_client, $stats::BlaMA_counter, $stats::BlaMA_maxdistanceclient, $stats::BlaMA_maxdistance);
}
if($stats::snipe_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>Headhunter<lmargin%%:30> %1 (%2)!<spop>', $stats::snipe_client, $stats::snipe_counter);
if($stats::snipe_maxdistance)
{
%x = $stats::snipe_counter ? "" : "\n";
messageClient(%client, 'MsgDebriefAddLine', "", '%3<lmargin:0><spush><color:00dc00><font:univers condensed:18>Longest Snipeshot is %1 meters by %2<spop>', $stats::snipe_maxdistance, $stats::snipe_maxdistanceclient, %x);
}
for(%damageType = 1; %damageType < 51; %damageType++)
{
if(%damageType == 7 || %damageType == 12 || (%damageType > 13 && %damageType < 21) || %damageType == 23 || %damageType == 24 || %damageType == 25) {
continue;
}
if(%damageType > 31 && %damageType < 50) {
continue;
}
if($stats::weap_table[%damageType] > 0)
{
if($Host::ClassicStatsType == 2)
{
if(!%message)
{
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>TYPE<lmargin%%:30>PLAYER<lmargin%%:60>TOTAL DAMAGE<spop>');
%message = 1;
}
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> %1</clip><lmargin%%:30><clip%%:60> %2</clip><lmargin%%:60><clip%%:40> %3</clip><spop>', $weap_message[%damageType], $stats::client_weap_table[%damageType], mFormatFloat($stats::weap_table[%damageType], "%.2f"));
}
else if($Host::ClassicStatsType == 1)
{
if(!%message)
{
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>TYPE<lmargin%%:30>PLAYER<lmargin%%:60>KILLS<spop>');
%message = 1;
}
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> %1</clip><lmargin%%:30><clip%%:60> %2</clip><lmargin%%:60><clip%%:40> %3</clip><spop>', $weap_message[%damageType], $stats::client_weap_table[%damageType], $stats::weap_table[%damageType]);
}
}
}
if($stats::tk_counter)
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>And the best teamkiller award goes to... %1 (%2)!<spop>', $stats::tk_client, $stats::tk_counter);
}

View file

@ -1,131 +0,0 @@
// Get Random Maps Script
//
// Used by the Set Next Mission feature
//
// Random Set Next Mission maps
// Runs for SetNextMisssion (Random) and Map Repetition Checker
// Randomizes the maps available in the admin menu
//
// This file is present
$GetRandomMapsLoaded = true;
// getRandomMap - returns a random map without duplicates until all have been played.
// Script BY: DarkTiger
// set this to 1 to save rng list to continue where the server left off in case of server reset
$rngListSave = 1;
$rngDebug = 1;//show echos for testing
function getRandomMap(){
// builds valid map list to pick from
for(%i = 0; %i < $HostMissionCount; %i++){
%map = $HostMissionFile[%i];
%FFA = $Host::MapFFA[%map, $CurrentMissionType];
%Cycle =$Host::MapCycle[%map, $CurrentMissionType];
%bot = $BotEnabled[%i];
if(%FFA && %Cycle){
if($Host::BotsEnabled){
if(%bot)
%map[%c++] = %map;
}
else{
%map[%c++] = %map;
}
}
}
%rng = getRSGN(1,%c,$CurrentMissionType); // use gameType as the id
if($rngDebug){error(%map[%rng] SPC %rng);}
return %map[%rng];
}
function getRSGN(%min,%max,%id){
// This funciton is kind of like a random sequence generator but its done on the fly
// returns you a unique random number every time until max is reached
// id value is so it can be used in more then one place
// the id value can be function name that its used in or a number
// lastly it only for numbers between -1000 to 1000 see down below;
if($rngListSave && isFile("rngLists/" @ %id @ ".cs") && !$rngIsLoaded[%id]){
exec("rngLists/" @ %id @ ".cs");
$rngIsLoaded[%id] = 1;
if($rngDebug){error("Loading Map RNG List =" SPC "rngLists/" @ %id @ ".cs");}
}
if(%id $= ""){
error("getRSG function call does not have an id value");
return getRandom(%min,%max);
}
%c = %min - 1; // skip counter
if(((%max - %min) - ($rng::Count[%id] - 1)) < 1) // reset if we cycled though all possable
{
$rng::Count[%id] = 1; // we dont reset to 0 becuae of the last number used
// change these numbers to expand range
for(%a = %min; %a <= %max; %a++) // this resets a wide range incase min max change for what ever reasion
{
$rng::List[%id,%a] = 0; // reset number list back to 0
}
$rng::List[%id,$rng::Last[%id]] = 1; // mark the last number used as in used after reset
}
%rng = getRandom(%min,%max - $rng::Count[%id] ); // find random number - the total number we have done
for(%i = %min; %i <= %max; %i++) // loop cycle though all possable numbers
{
if($rng::List[%id,%i]) // skip over ones that we have all ready used
{
continue;
}
%c++; // skip counter
if(%rng == %c) // onces the skip counter matches the rng number we have landed on a valid number that we havent used yet
{
break; // kill the loop
}
}
$rng::List[%id,%i] = 1;// this marks said number as used
$rng::Count[%id]++;// up are total used numbers
$rng::Last[%id] = %i; // for when the list resets it wont pick the same number twice
if(%i > %max || %i < %min)
{ // fail safe
return %max;
}
if($rngListSave){
export( "$rng::*", "rngLists/" @ %id @ ".cs", false );
}
return %i; // return the one we stoped on
}
// Return random maps list for SetNextMission
// Primarily used in admin menus
function SetNextMapGetRandoms( %client )
{
%cyclecount = 1;
for(%i = 0; %i < 8; %i++)
{
$SetNextMissionMapSlot[%cyclecount] = getRandomMap();
%cyclecount++;
}
}
// Reset SetNextMission every map change
package ResetSetNextMission
{
function DefaultGame::gameOver(%game)
{
Parent::gameOver(%game);
//Reset SetNextMission Restore
$SetNextMissionRestore = "";
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(ResetSetNextMission))
activatePackage(ResetSetNextMission);

View file

@ -1,119 +0,0 @@
// Map Repetition Checker Script
//
// To help decrease the chances of a repeated map in the map rotation by correcting repeated maps thru script
//
// Runs at the beginning of every map change
// Keeps track of maps played (Last [$MRC::PastMapsDepth] Maps)
// If any are repeating it picks a new map
//
// $EvoCachedNextMission = "RoundTheMountain";
// $EvoCachedNextMission = "Arrakis";
// $EvoCachedNextMission = "RoundTheMountainLT";
// $EvoCachedNextMission = "ArenaDomeDM";
// How many previous maps you want to compare TheNextCached Map to
$MRC::PastMapsDepth = 6;
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
{
$MRC::PrevMap[%x] = "";
//echo("PM" @ %x @ ": " @ $MRC::PrevMap[%x]);
}
//Ran in MissionTypeOptions.cs
function MapRepetitionChecker( %game )
{
//Debug
//%MapRepetitionCheckerDebug = true;
if(isEventPending($MapRepetitionSchedule))
cancel($MapRepetitionSchedule);
//Make sure GetRandomMaps.cs is present
if(!$GetRandomMapsLoaded)
return;
if($EvoCachedNextMission $= "")
return;
if(!$Host::TournamentMode && $Host::EnableMapRepetitionChecker)
{
//Do work
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
{
if( $MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission || $CurrentMission $= $EvoCachedNextMission )
MapRepetitionCheckerFindRandom();
}
//Set vars
for(%x = $MRC::PastMapsDepth; %x >= 1; %x = %x - 1)
{
if(%x > 1)
{
if($MRC::PrevMap[%x - 1] !$= "")
$MRC::PrevMap[%x] = $MRC::PrevMap[%x - 1];
}
else if(%x $= 1)
$MRC::PrevMap[%x] = $CurrentMission;
}
//Debug
if(%MapRepetitionCheckerDebug)
{
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
{
if( $MRC::PrevMap[%x] !$= "" )
echo("PM" @ %x @ ": " @ $MRC::PrevMap[%x]);
}
}
}
}
function MapRepetitionCheckerFindRandom(%redone)
{
//Make sure GetRandomMaps.cs is present
if(!$GetRandomMapsLoaded)
return;
//Backup
if(%redone $="")
$SetNextMissionRestore = $EvoCachedNextMission;
//Do work
//getRandomMap() is in GetRandomMaps.cs
$EvoCachedNextMission = getRandomMap();
//Make sure new map still complies
%redo = 0;
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
{
if($MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission)
%redo = 1;
}
//Make sure its within maplimits
%newmaplimits = $Host::MapPlayerLimits[$EvoCachedNextMission, $CurrentMissionType];
%min = getWord(%newmaplimits,0);
%max = getWord(%newmaplimits,1);
if((%min > $AllPlayerCount || $AllPlayerCount > %max) && $AllPlayerCount > 2 )
%redo = 1;
if( %redo && %redone < 3 )
{
%redone++;
MapRepetitionCheckerFindRandom(%redone);
}
else
{
error(formatTimeString("HH:nn:ss") SPC "Map Repetition Corrected from" SPC $SetNextMissionRestore SPC "to" SPC $EvoCachedNextMission @ "." );
//Admin Message Only
for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
{
%cl = ClientGroup.getObject(%idx);
if(%cl.isAdmin)
messageClient(%cl, 'MsgMapRepCorrection', '\crMap Repetition Corrected: Next mission set from %1 to %2.', $SetNextMissionRestore, $EvoCachedNextMission);
}
}
}

View file

@ -43,21 +43,11 @@ function loadMissionStage2()
$Host::HiVisibility = "0"; //always SPEED
}
if(isEventPending($MapRepetitionSchedule))
cancel($MapRepetitionSchedule);
//Start MapRepetitionChecker
$MapRepetitionSchedule = schedule(20000, 0, "MapRepetitionChecker", %game);
//Siege NoBaseRape Fix
if( $CurrentMissionType $= "Siege" )
$Host::EvoNoBaseRapeEnabled = 0;
$Host::NoBaseRapeEnabled = 0;
else
$Host::EvoNoBaseRapeEnabled = 1;
//Fix for Lak to CTF transition (Uneven Teams)
if(Game.numTeams > 1 && ($TeamRank[1, count] > $TeamRank[2, count] + 2) && $previousMissionType $= "LakRabbit")
Game.setupClientTeams();
$Host::NoBaseRapeEnabled = 1;
parent::loadMissionStage2();
}

View file

@ -0,0 +1,42 @@
package NoBaseRape
{
//From Evolution MOD
//Modified for our needs
function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
{
//echo( %targetObject.getDataBlock().getClassName() );
//echo( %targetObject.getDataBlock().getName() );
%targetname = %targetObject.getDataBlock().getName();
//Used on some maps to make invs invincible
if( $CurrentMission $= "SmallCrossing" || $CurrentMission $= "Bulwark")
{
if( %targetObject.invincible && %targetname $= "StationInventory" )
{
//NBRAssetSound( %game, %sourceObject );
return;
}
}
else if(!$Host::TournamentMode && $Host::NoBaseRapeEnabled && $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount)
{
if( %targetname $= "GeneratorLarge" || %targetname $= "StationInventory" || %targetname $= "SolarPanel" )
{
//Notify only if asset is on other team
if( %targetObject.team !$= %sourceObject.team )
{
NBRAssetSound( %game, %sourceObject );
}
return;
}
}
parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType);
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(NoBaseRape))
activatePackage(NoBaseRape);

View file

@ -9,10 +9,10 @@
// Called in GetTeamCounts.cs
function NBRStatusNotify( %game )
{
if( $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled )
if( $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::NoBaseRapeEnabled )
{
//On
if( $Host::EvoNoBaseRapeClassicPlayerCount > $TotalTeamPlayerCount )
if( $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount )
{
if( $NBRStatus !$= "PLAYEDON" )
$NBRStatus = "ON";
@ -64,9 +64,9 @@ if (!isActivePackage(ResetNBRNotify))
function NBRAssetSound( %game, %sourceObject )
{
//Wont play again until the schedule is done
if(!isEventPending(%sourceObject.NBRAssetSoundSchedule) && $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled )
if(!isEventPending(%sourceObject.NBRAssetSoundSchedule) && $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::NoBaseRapeEnabled )
{
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::EvoNoBaseRapeClassicPlayerCount );
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::NoBaseRapePlayerCount );
%sourceObject.NBRAssetSoundSchedule = schedule(10000, 0, "ResetNBRAssetSound", %sourceObject );
}
}

View file

@ -0,0 +1,265 @@
package PizzaThings
{
// function OptionsDlg::onWake(%this)
// {
// if(!$observeFlagBind)
// {
// $ObsRemapName[$ObsRemapCount] = "Obs First Flag";
// $ObsRemapCmd[$ObsRemapCount] = "observeFirstFlag";
// $ObsRemapCount++;
// $ObsRemapName[$ObsRemapCount] = "Obs Second Flag";
// $ObsRemapCmd[$ObsRemapCount] = "observeSecondFlag";
// $ObsRemapCount++;
// $observeFlagBind = true;
// }
// parent::onWake(%this);
// }
// For Observe Flag
// From Evo
function Observer::onTrigger(%data, %obj, %trigger, %state)
{
if (%state == 0 || %trigger > 5)
return;
//first, give the game the opportunity to prevent the observer action
if (!Game.ObserverOnTrigger(%data, %obj, %trigger, %state))
return;
%client = %obj.getControllingClient();
if (%client == 0)
return;
switch$(%obj.mode)
{
case "followFlag":
if(!%client.observingFlag)
return;
if(%trigger == 0) // press FIRE, switch to the other flag
{
if(%client.flagObserved == $TeamFlag[1])
{
%otherFlag = $TeamFlag[2];
%otherFlagTeam = 2;
}
else if(%client.flagObserved == $TeamFlag[2])
{
%otherFlag = $TeamFlag[1];
%otherFlagTeam = 1;
}
else
return;
// the flag isn't carried
if(%otherFlag.carrier $= "")
observeFlag(%client, %otherFlag, 1, %otherFlagTeam);
else if(isObject(%otherFlag.carrier.client))
observeFlag(%client, %otherFlag.carrier.client, 2, %otherFlagTeam);
}
else if(%trigger == 3) // press JET, switch to the other flag
{
if(%client.flagObserved == $TeamFlag[1])
{
%otherFlag = $TeamFlag[2];
%otherFlagTeam = 2;
}
else if(%client.flagObserved == $TeamFlag[2])
{
%otherFlag = $TeamFlag[1];
%otherFlagTeam = 1;
}
else
return;
// the flag isn't carried
if(%otherFlag.carrier $= "")
observeFlag(%client, %otherFlag, 1, %otherFlagTeam);
else if(isObject(%otherFlag.carrier.client))
observeFlag(%client, %otherFlag.carrier.client, 2, %otherFlagTeam);
}
else if(%trigger == 2) //press JUMP, stop observing flag
{
if(%client.observeClient != -1)
{
observerFollowUpdate(%client, -1, false);
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
%client.observeClient = -1;
}
%obj.mode = "observerFly";
%obj.setFlyMode();
updateObserverFlyHud(%client);
%client.observingFlag = false;
%client.flagObserved = "";
%client.flagObsTeam = "";
}
default:
Parent::onTrigger(%data, %obj, %trigger, %state);
}
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(PizzaThings))
activatePackage(PizzaThings);
function serverCmdObserveFirstFlag(%client)
{
// works only for CTF
if(Game.class !$= CTFGame)
return;
// client must be an observer
if(%client.team > 0)
return;
// check if the flag is carried by someone
%player = $TeamFlag[1].carrier;
if($TeamFlag[1].isHome || %player $= "")
observeFlag(%client, $TeamFlag[1], 1, 1);
else
observeFlag(%client, %player.client, 2, 1);
}
function serverCmdObserveSecondFlag(%client)
{
// works only for CTF
if(Game.class !$= CTFGame)
return;
// client must be an observer
if(%client.team > 0)
return;
// check if the flag is carried by someone
%player = $TeamFlag[2].carrier;
if($TeamFlag[2].isHome || %player $= "")
observeFlag(%client, $TeamFlag[2], 1, 2);
else
observeFlag(%client, %player.client, 2, 2);
}
function observeFlag(%client, %target, %type, %flagTeam)
{
if(!isObject(%client) || !isObject(%target) || !isObject(%client.camera))
return;
if(Game.class !$= CTFGame)
return;
if(%client.team > 0)
return;
// cancel any scheduled update
if(isEventPending(%client.obsHudSchedule))
cancel(%client.obsHudSchedule);
// must be an observer when observing other clients
if(%client.getControlObject() != %client.camera)
return;
//can't observer yourself
if(%client == %target)
return;
%count = ClientGroup.getCount();
//can't go into observer mode if you're the only client
if(%count <= 1 && %type != 1)
return;
if(%type == 1) // Flag
{
if(isObject(%client.player))
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
%client.camera.getDataBlock().setMode(%client.camera, "followFlag", $TeamFlag[%flagTeam]);
%client.setControlObject(%client.camera);
clearBottomPrint(%client);
// was the client observing a player before?
if(%client.observeClient != -1)
{
observerFollowUpdate(%client, -1, false);
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
%client.observeClient = -1;
}
}
else // Player
{
// make sure the target actually exists
if(%target > 0)
{
%found = false;
for(%i = 0; %i < %count; %i++)
{
if(ClientGroup.getObject(%i) == %target)
{
%found = true;
break;
}
}
if(!%found)
return;
}
if(isObject(%client.player))
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
observerFollowUpdate(%client, %target, true);
displayObserverHud(%client, %target);
messageClient(%target, 'Observer', '\c1%1 is now observing you.', %client.name);
// was the client observing a player before?
if(%client.observeClient != -1)
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
%client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player);
%client.setControlObject(%client.camera);
%client.observeClient = %target;
}
//clear the observer fly mode var...
%client.observeFlyClient = -1;
%client.observingFlag = true;
%client.flagObserved = $TeamFlag[%flagTeam];
%client.flagObsTeam = %flagTeam;
}
// function observeFirstFlag()
// {
// commandToServer('ObserveFirstFlag');
// }
// function observeSecondFlag()
// {
// commandToServer('ObserveSecondFlag');
// }
// function sendPizzaHudUpdate(%game, %client, %msg)
// {
// %pizzaOptMask = 0;
// if($RandomTeams == 1) %pizzaOptMask += 1;
// if($Host::ClassicFairTeams == 1) %pizzaOptMask += 2;
// if($Host::ClassicAutoPWEnabled == 1) %pizzaOptMask += 4;
// if($Host::EvoFullServerPWEnabled == 1) %pizzaOptMask += 8;
// if($Host::EvoNoBaseRapeEnabled == 1) %pizzaOptMask += 16;
// if($PizzaHudRestartVar == 1) %pizzaOptMask += 32;
// messageClient(%client, 'UpdatePizzaHud', %msg, %pizzaOptMask, %client.isAdmin + %client.isSuperAdmin);
// }
// function serverCmdRegisterPizzaClient(%client)
// {
// if(!%client.pizza)
// {
// %client.pizza = true;
// %msg = "\c2Pizza Client registered.";
// sendPizzaHudUpdate(%game, %client, %msg);
// }
// }

View file

@ -103,22 +103,6 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
}
//Admin Next Mission Message at beginning of matches
function DefaultGame::startMatch(%game)
{
Parent::startMatch(%game);
for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
{
%cl = ClientGroup.getObject(%idx);
if(%cl.isAdmin)
{
messageClient( %cl, 'MsgNotifyEvoNextMission', '\crNext Mission: %1', $EvoCachedNextMission);
}
}
}
};
// Prevent package from being activated if it is already

View file

@ -14,7 +14,7 @@
// Called in GetTeamCounts.cs
function TeamBalanceNotify( %game, %team1difference, %team2difference )
{
if( ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "sctf") && $TotalTeamPlayerCount !$= 0 && !$Host::TournamentMode )
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 && !$Host::TournamentMode )
{
//echo ("%Team1Difference " @ %Team1Difference);
//echo ("%Team2Difference " @ %Team2Difference);

File diff suppressed because it is too large Load diff

View file

@ -20,8 +20,8 @@ function VoteSound( %game, %typename, %arg1, %arg2, %VoteSoundRandom )
messageAll('', '\c1Vote in Progress: \c0To change the mission to %1 (%2). %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
echo("Vote in Progress: To change the mission to" SPC %arg1 SPC "(" @ %arg2 @ ").");
case "VoteSkipMission":
messageAll('', '\c1Vote in Progress: \c0To skip the mission to %1. %2~wgui/objective_notification.wav', $EvoCachedNextMission, %votemsg );
echo("Vote in Progress: To skip the mission to" SPC $EvoCachedNextMission @ ".");
messageAll('', '\c1Vote in Progress: \c0To skip the mission. %1~wgui/objective_notification.wav', %votemsg );
echo("Vote in Progress: To skip the mission.");
case "VoteChangeTimeLimit":
if(%arg1 $= "999") %arg1 = "unlimited";
messageAll('', '\c1Vote in Progress: \c0To change the time limit to %1. %2~wgui/objective_notification.wav', %arg1, %votemsg );
@ -47,11 +47,14 @@ function VoteSound( %game, %typename, %arg1, %arg2, %VoteSoundRandom )
}
}
else //Is observer
messageAll('', '\c1Vote in Progress: \c0To kick player %1. %3~wgui/objective_notification.wav', %arg1.name, %votemsg );
echo("Vote in Progress: To kick player" SPC %arg1.name @ ".");
messageAll('', '\c1Vote in Progress: \c0To kick player %1. %2~wgui/objective_notification.wav', %arg1.nameBase, %votemsg );
echo("Vote in Progress: To kick player" SPC %arg1.nameBase SPC "(" @ %arg1.guid @ ").");
case "VoteTournamentMode":
messageAll('', '\c1Vote in Progress: \c0To change the mission to Tournament Mode (%1). %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
echo("Vote in Progress: To change the mission to Tournament Mode" SPC "(" @ %arg1 @ ").");
default:
messageAll('', '\c1Vote in Progress: \c0To %1. %2~wgui/objective_notification.wav', %arg1, %votemsg );
echo("Vote in Progress: To" SPC %arg1);
}
if(isEventPending($VoteSoundSchedule))

View file

@ -28,7 +28,7 @@
function checkVer_showBanner(%client)
{
// customize me
commandToClient(%client, 'CenterPrint', "<font:Sui Generis:22><color:3cb4b4>Version Check Failed!\n<font:Univers:16><color:3cb4b4>You need the latest TribesNext patch and TourneyNetClient2 to play.\n Download it from t2discord.tk and drop it into your GameData/Base folder.", 10, 3);
commandToClient(%client, 'CenterPrint', "<font:Sui Generis:22><color:3cb4b4>Version Check Failed!\n<font:Univers:16><color:3cb4b4>You need the latest TribesNext patch and TourneyNetClient2 to play.\n Download it from playt2.com and drop it into your GameData/Base folder.", 10, 3);
}
package checkver

View file

@ -1236,7 +1236,7 @@ package dtStats{
parent::missionLoadDone(%game);
//check to see if we are running evo or not, if not then lets just enable these
if(!isFile("scripts/autoexec/evolution.cs")){
$Host::EvoAveragePings = $Host::ShowIngamePlayerScores = 1;
$Host::AveragePings = $Host::ShowIngamePlayerScores = 1;
}
}
function serverCmdShowHud(%client, %tag){ // to refresh screen when client opens it up
@ -2503,7 +2503,7 @@ function LakRabbitHud(%game, %client, %tag){
$TeamRank[2, count] = 0;
}
if ( $Host::EvoAveragePings )
if ( $Host::AveragePings )
{
for ( %count = 0; %count <= Game.numteams; %count++ )
{

View file

@ -168,7 +168,7 @@ function ALTsendModInfoToClient(%client)
if($Host::TimeLimit $= "999" || $Host::TimeLimit $= "unlimited") %timeloadingvar = "Unlimited"; else %timeloadingvar = $Host::TimeLimit;
if($Host::EvoKickObservers $= 0) %obskickvar = "Off"; else %obskickvar = ($Host::EvoKickObservers / 60) @ " Minutes";
if($Host::KickObserverTimeout $= 0) %obskickvar = "Off"; else %obskickvar = ($Host::KickObserverTimeout / 60) @ " Minutes";
%time = "<color:" @ $Host::LoadScreenColor1 @ ">Time limit: <color:" @ $Host::LoadScreenColor2 @ ">" @ %timeloadingvar;
%max = "<color:" @ $Host::LoadScreenColor1 @ ">Max players: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::MaxPlayers;
@ -183,30 +183,14 @@ function ALTsendModInfoToClient(%client)
//%crc = "<color:" @ $Host::LoadScreenColor1 @ ">CRC checking: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::CRCTextures ? "On" : "Off");
//%pure = "<color:" @ $Host::LoadScreenColor1 @ ">Pure server: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::PureServer ? "On" : "Off");
if($Host::EvoNoBaseRapeEnabled)
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EvoNoBaseRapeClassicPlayerCount;
if($Host::NoBaseRapeEnabled)
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::NoBaseRapePlayerCount;
%turrets = "<color:" @ $Host::LoadScreenColor1 @ ">Min Turrets: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EnableTurretPlayerCount;
if($Host::EvoStats && (!$Host::TournamentMode || ($Host::TournamentMode && $Host::EvoStatsTourney)) && $Host::EvoStatsType != 0)
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::EvoStatsType == 1 ? "Kills" : "Damage");
if($Host::ClassicEvoStats && $Host::ClassicStatsType > 0)
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::ClassicStatsType == 1 ? "Kills" : "Damage");
if($Evo::ETMMode && $ETMmode::CurrentMap <= $ETMmode::Counter)
{
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $ETMmode::MapDisplayName[$ETMmode::CurrentMap];
}
else
{
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ findNextCycleMission();
if ( $Host::ClassicRandomMissions )
{
%nmis = %nmis SPC "(Random)";
}
if($Host::EvoTourneySameMap && $Host::TournamentMode)
{
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $CurrentMission @ " (Same)";
}
}
%currentmis = "<color:" @ $Host::LoadScreenColor1 @ ">Current mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $MissionDisplayName @ " (" @ $MissionTypeDisplayName @ ")";
@ -300,7 +284,7 @@ function ALTsendModInfoToClient(%client)
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %turrets;
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %obskick;
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %stats;
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %nmis;
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %currentmis;
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = %rape;
@ -396,30 +380,30 @@ function NORMALsendModInfoToClient(%client)
//%pure = "<color:" @ $Host::LoadScreenColor1 @ ">Pure server: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::PureServer ? "On" : "Off");
if($Host::EvoNoBaseRapeEnabled)
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EvoNoBaseRapeClassicPlayerCount;
if($Host::NoBaseRapeEnabled)
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::NoBaseRapePlayerCount;
%turrets = "<color:" @ $Host::LoadScreenColor1 @ ">Min Turrets: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EnableTurretPlayerCount;
if($Host::EvoStats && (!$Host::TournamentMode || ($Host::TournamentMode && $Host::EvoStatsTourney)) && $Host::EvoStatsType != 0)
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::EvoStatsType == 1 ? "Kills" : "Damage");
if($Host::ClassicEvoStats && $Host::ClassicStatsType > 0)
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::ClassicStatsType == 1 ? "Kills" : "Damage");
if($Evo::ETMMode && $ETMmode::CurrentMap <= $ETMmode::Counter)
{
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $ETMmode::MapDisplayName[$ETMmode::CurrentMap];
}
else
{
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ findNextCycleMission();
if ( $Host::ClassicRandomMissions )
{
%nmis = %nmis SPC "(Random)";
}
if($Host::EvoTourneySameMap && $Host::TournamentMode)
{
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $CurrentMission @ " (Same)";
}
}
//if($Evo::ETMMode && $ETMmode::CurrentMap <= $ETMmode::Counter)
//{
// %nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $ETMmode::MapDisplayName[$ETMmode::CurrentMap];
//}
//else
//{
//%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ findNextCycleMission();
//if ( $Host::ClassicRandomMissions )
//{
//%nmis = %nmis SPC "(Random)";
//}
//if($Host::EvoTourneySameMap && $Host::TournamentMode)
//{
//%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $CurrentMission @ " (Same)";
//}
//}
%currentmis = "<color:" @ $Host::LoadScreenColor1 @ ">Current mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $MissionDisplayName @ " (" @ $MissionTypeDisplayName @ ")";
@ -449,7 +433,7 @@ function NORMALsendModInfoToClient(%client)
%ServerTextLine[4] = %rapeppl;
%ServerTextLine[5] = %turrets;
%ServerTextLine[6] = %stats;
%ServerTextLine[7] = %nmis;
%ServerTextLine[7] = %currentmis;
//%serverTextLine[2] = %td;
//%serverTextLine[3] = %crc;

View file

@ -0,0 +1,196 @@
//**********************************************************
// CREDITS
//
// Eolks - I think he wrote most (probably all) of the mine+disc support.
//**********************************************************
$DamageTypeText[50] = 'Mine+Disc'; // Teratos: Pseudo-damage type
// Eolk - Mine disc messages // Teratos - betterized.
$DeathMessageMineDiscCount = 4;
$DeathMessageMineDisc[0] = '\c0%4 kills %1 with a mine+disc.';
$DeathMessageMineDisc[1] = '\c0%4 unleashes a world of hurt on %1 with a mine+disc.';
$DeathMessageMineDisc[2] = '\c0%4 shows %1 the power of a spinfusor+mine combo!';
$DeathMessageMineDisc[3] = '\c0%1 never saw that mine+disc coming from %4.';
// Teratos: Guessing this was Eolk?
function resetMineDiscCheck(%cl)
{
%cl.minediscCheck = 0;
}
package StatsMineDisc
{
function DefaultGame::displayDeathMessages(%game, %clVictim, %clKiller, %damageType, %implement)
{
// ----------------------------------------------------------------------------------
// z0dd - ZOD, 6/18/02. From Panama Jack, send the damageTypeText as the last varible
// in each death message so client knows what weapon it was that killed them.
%victimGender = (%clVictim.sex $= "Male" ? 'him' : 'her');
%victimPoss = (%clVictim.sex $= "Male" ? 'his' : 'her');
%killerGender = (%clKiller.sex $= "Male" ? 'him' : 'her');
%killerPoss = (%clKiller.sex $= "Male" ? 'his' : 'her');
%victimName = %clVictim.name;
%killerName = %clKiller.name;
//error("DamageType = " @ %damageType @ ", implement = " @ %implement @ ", implement class = " @ %implement.getClassName() @ ", is controlled = " @ %implement.getControllingClient());
if(%damageType == $DamageType::Explosion)
{
messageAll('msgExplosionKill', $DeathMessageExplosion[mFloor(getRandom() * $DeathMessageExplosionCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if(%damageType == $DamageType::Suicide) //player presses ctrl-k
{
messageAll('msgSuicide', $DeathMessageSuicide[mFloor(getRandom() * $DeathMessageSuicideCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if(%damageType == $DamageType::VehicleSpawn)
{
messageAll('msgVehicleSpawnKill', $DeathMessageVehPad[mFloor(getRandom() * $DeathMessageVehPadCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if(%damageType == $DamageType::ForceFieldPowerup)
{
messageAll('msgVehicleSpawnKill', $DeathMessageFFPowerup[mFloor(getRandom() * $DeathMessageFFPowerupCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if(%damageType == $DamageType::Crash)
{
messageAll('msgVehicleCrash', $DeathMessageVehicleCrash[%damageType, mFloor(getRandom() * $DeathMessageVehicleCrashCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if(%damageType == $DamageType::Impact) // run down by vehicle
{
if( ( %controller = %implement.getControllingClient() ) > 0)
{
%killerGender = (%controller.sex $= "Male" ? 'him' : 'her');
%killerPoss = (%controller.sex $= "Male" ? 'his' : 'her');
%killerName = %controller.name;
if(%controller.team != %clVictim.team)
{
messageAll('msgVehicleKill', $DeathMessageVehicle[mFloor(getRandom() * $DeathMessageVehicleCount)], %victimName, %victimGender, %victimPoss, %killerName ,%killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else
{
messageAll('msgTeamKill', $DeathMessageTeamKill[%damageType, mFloor(getRandom() * $DeathMessageTeamKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
}
else
{
messageAll('msgVehicleKill', $DeathMessageVehicleUnmanned[mFloor(getRandom() * $DeathMessageVehicleUnmannedCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
}
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// z0dd - ZOD, 5/15/02. Added Hover Vehicle so we get proper
// death messages when killed with Wildcat chaingun
//else if (isObject(%implement) && (%implement.getClassName() $= "Turret" || %implement.getClassName() $= "VehicleTurret" || %implement.getClassName() $= "FlyingVehicle")) //player killed by a turret
else if (isObject(%implement) && (%implement.getClassName() $= "Turret" || %implement.getClassName() $= "VehicleTurret" || %implement.getClassName() $= "FlyingVehicle" || %implement.getClassName() $= "HoverVehicle"))
{
if (%implement.getControllingClient() != 0) //is turret being controlled?
{
%controller = %implement.getControllingClient();
%killerGender = (%controller.sex $= "Male" ? 'him' : 'her');
%killerPoss = (%controller.sex $= "Male" ? 'his' : 'her');
%killerName = %controller.name;
if (%controller == %clVictim)
{
messageAll('msgTurretSelfKill', $DeathMessageTurretSelfKill[mFloor(getRandom() * $DeathMessageTurretSelfKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if (%controller.team == %clVictim.team) //controller TK'd a friendly
{
messageAll('msgCTurretKill', $DeathMessageCTurretTeamKill[%damageType, mFloor(getRandom() * $DeathMessageCTurretTeamKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else //controller killed an enemy
{
messageAll('msgCTurretKill', $DeathMessageCTurretKill[%damageType, mFloor(getRandom() * $DeathMessageCTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
}
// use the handle associated with the deployed object to verify valid owner
else if (isObject(%implement.owner))
{
%owner = %implement.owner;
//error("Owner is " @ %owner @ " Handle is " @ %implement.ownerHandle);
//error("Turret is still owned");
//turret is uncontrolled, but is owned - treat the same as controlled.
%killerGender = (%owner.sex $= "Male" ? 'him' : 'her');
%killerPoss = (%owner.sex $= "Male" ? 'his' : 'her');
%killerName = %owner.name;
if (%owner.team == %clVictim.team) //player got in the way of a teammates deployed but uncontrolled turret.
{
messageAll('msgCTurretKill', $DeathMessageCTurretAccdtlKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretAccdtlKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else //deployed, uncontrolled turret killed an enemy
{
messageAll('msgCTurretKill', $DeathMessageCTurretKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
}
else //turret is not a placed (owned) turret (or owner is no longer on it's team), and is not being controlled
{
if(%implement.team == %clVictim.team) // was it a teamkill?
{
messageAll('msgTurretKill', $DeathMessageCTurretAccdtlKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretAccdtlKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else // it was not a teamkill
{
messageAll('msgTurretKill', $DeathMessageTurretKill[%damageType,mFloor(getRandom() * $DeathMessageTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
}
}
// END TURRET MESSAGES
else if((%clKiller == %clVictim) || (%damageType == $DamageType::Ground)) //player killed himself or fell to death
{
messageAll('msgSelfKill', $DeathMessageSelfKill[%damageType,mFloor(getRandom() * $DeathMessageSelfKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if (%damageType == $DamageType::OutOfBounds) //killer died due to Out-of-Bounds damage
{
messageAll('msgOOBKill', $DeathMessageOOB[mFloor(getRandom() * $DeathMessageOOBCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if (%damageType == $DamageType::NexusCamping) //Victim died from camping near the nexus...
{
messageAll('msgCampKill', $DeathMessageCamping[mFloor(getRandom() * $DeathMessageCampingCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if(%clKiller.team == %clVictim.team) //was a TK
{
messageAll('msgTeamKill', $DeathMessageTeamKill[%damageType, mFloor(getRandom() * $DeathMessageTeamKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if (%damageType == $DamageType::Lava) //player died by falling in lava
{
messageAll('msgLavaKill', $DeathMessageLava[mFloor(getRandom() * $DeathMessageLavaCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if ( %damageType == $DamageType::Lightning ) // player was struck by lightning
{
messageAll('msgLightningKill', $DeathMessageLightning[mFloor(getRandom() * $DeathMessageLightningCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if ( %damageType == $DamageType::Mine && !isObject(%clKiller) )
{
messageAll('MsgRogueMineKill', $DeathMessageRogueMine[%damageType, mFloor(getRandom() * $DeathMessageRogueMineCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else //was a legitimate enemy kill
{
if((%damageType == $DamageType::Mine || %damageType == $DamageType::Disc) && %clVictim.mineDisc)
{
// mine disc just occurred
messageAll('MsgMineDiscKill', $DeathMessageMineDisc[mFloor(getRandom() * $DeathMessageMineDiscCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
else if(%damageType == 6 && (%clVictim.headShot))
{
// laser headshot just occurred
messageAll('MsgHeadshotKill', $DeathMessageHeadshot[%damageType, mFloor(getRandom() * $DeathMessageHeadshotCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
// ----------------------------------------------------
// z0dd - ZOD, 8/25/02. Rear Lance hits
else if (%damageType == 10 && (%clVictim.rearshot))
{
// shocklance rearshot just occurred
messageAll('MsgRearshotKill', $DeathMessageRearshot[%damageType, mFloor(getRandom() * $DeathMessageRearshotCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
// ----------------------------------------------------
else
{
messageAll('MsgLegitKill', $DeathMessage[%damageType, mFloor(getRandom() * $DeathMessageCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
}
}
}
};
// Prevent package from being activated if it is already
if (!isActivePackage(StatsMineDisc))
activatePackage(StatsMineDisc);