mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-16 08:34:43 +00:00
Killstreak waypoints by DarkTiger
This commit is contained in:
parent
3f2e013250
commit
a60031d9b1
1 changed files with 401 additions and 268 deletions
|
|
@ -26,6 +26,13 @@ $InvBanList[DM, "CameraGrenade"] = 1;
|
||||||
$InvBanList[DM, "FlashGrenade"] = 1;
|
$InvBanList[DM, "FlashGrenade"] = 1;
|
||||||
$InvBanList[DM, "InventoryDeployable"] = 1;
|
$InvBanList[DM, "InventoryDeployable"] = 1;
|
||||||
|
|
||||||
|
$DMGame::wpKillCount = 5; //person with highest amount of kills above the kill count gets a mark on there head
|
||||||
|
$DMGame::wpMessage = "Kill Me";
|
||||||
|
//set 1 only mark the target with highest amount of kills
|
||||||
|
//set 2 only mark target with highest score
|
||||||
|
$DMGame::mode = 1; // this could be made into a vote command to switch modes
|
||||||
|
|
||||||
|
|
||||||
function DMGame::setUpTeams(%game)
|
function DMGame::setUpTeams(%game)
|
||||||
{
|
{
|
||||||
%group = nameToID("MissionGroup/Teams");
|
%group = nameToID("MissionGroup/Teams");
|
||||||
|
|
@ -78,9 +85,10 @@ function DMGame::setUpTeams(%game)
|
||||||
function DMGame::initGameVars(%game)
|
function DMGame::initGameVars(%game)
|
||||||
{
|
{
|
||||||
%game.SCORE_PER_KILL = 1;
|
%game.SCORE_PER_KILL = 1;
|
||||||
%game.SCORE_PER_DEATH = -1;
|
%game.SCORE_PER_DEATH = -1; //was -1
|
||||||
%game.SCORE_PER_SUICIDE = -1;
|
%game.SCORE_PER_SUICIDE = -1; //was -1
|
||||||
%game.SCORE_PER_MIDAIR = 0.2; // Added Chocotaco. From sctf
|
%game.SCORE_PER_MIDAIR = 0.2; // Added Chocotaco. From sctf
|
||||||
|
%game.SCORE_PER_BIGGAME = 1; // taking out a kill streak
|
||||||
}
|
}
|
||||||
|
|
||||||
exec("scripts/aiDeathMatch.cs");
|
exec("scripts/aiDeathMatch.cs");
|
||||||
|
|
@ -98,22 +106,22 @@ function DMGame::equip(%game, %player)
|
||||||
|
|
||||||
if( $Host::DMSLOnlyMode )
|
if( $Host::DMSLOnlyMode )
|
||||||
{
|
{
|
||||||
%player.clearInventory();
|
%player.clearInventory();
|
||||||
%player.setInventory(EnergyPack, 1);
|
%player.setInventory(EnergyPack, 1);
|
||||||
%player.setInventory(Shocklance, 1);
|
%player.setInventory(Shocklance, 1);
|
||||||
%player.setInventory(RepairKit, 1);
|
%player.setInventory(RepairKit, 1);
|
||||||
%player.setInventory(TargetingLaser, 1);
|
%player.setInventory(TargetingLaser, 1);
|
||||||
%player.setInventory(Grenade, 5);
|
%player.setInventory(Grenade, 5);
|
||||||
%player.use("Shocklance");
|
%player.use("Shocklance");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buyFavorites(%player.client);
|
buyFavorites(%player.client);
|
||||||
%player.setEnergyLevel(%player.getDataBlock().maxEnergy);
|
%player.setEnergyLevel(%player.getDataBlock().maxEnergy);
|
||||||
%player.selectWeaponSlot( 0 );
|
%player.selectWeaponSlot( 0 );
|
||||||
|
|
||||||
// do we want to give players a disc launcher instead? GJL: Yes we do!
|
// do we want to give players a disc launcher instead? GJL: Yes we do!
|
||||||
%player.use("Disc");
|
%player.use("Disc");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -182,7 +190,7 @@ function DMGame::clientMissionDropReady(%game, %client)
|
||||||
|
|
||||||
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);
|
DefaultGame::clientMissionDropReady(%game, %client);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DMGame::AIHasJoined(%game, %client)
|
function DMGame::AIHasJoined(%game, %client)
|
||||||
|
|
@ -203,8 +211,9 @@ function DMGame::checkScoreLimit(%game, %client)
|
||||||
|
|
||||||
function DMGame::createPlayer(%game, %client, %spawnLoc, %respawn)
|
function DMGame::createPlayer(%game, %client, %spawnLoc, %respawn)
|
||||||
{
|
{
|
||||||
DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn);
|
DefaultGame::createPlayer(%game, %client, %spawnLoc, %respawn);
|
||||||
%client.setSensorGroup(%client.team);
|
%client.setSensorGroup(%client.team);
|
||||||
|
%client.isObserver =0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function DMGame::resetScore(%game, %client)
|
function DMGame::resetScore(%game, %client)
|
||||||
|
|
@ -215,12 +224,114 @@ function DMGame::resetScore(%game, %client)
|
||||||
%client.efficiency = 0.0;
|
%client.efficiency = 0.0;
|
||||||
%client.suicides = 0;
|
%client.suicides = 0;
|
||||||
%client.scoreMidAir = 0;
|
%client.scoreMidAir = 0;
|
||||||
|
%client.bigGame = 0;
|
||||||
|
%client.killCounter = 0;// not a score thing but needs to be reset
|
||||||
|
}
|
||||||
|
|
||||||
|
function DMGame::forceObserver( %game, %client, %reason ){
|
||||||
|
parent::forceObserver( %game, %client, %reason );
|
||||||
|
%client.isObserver =1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
|
function DMGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc)
|
||||||
{
|
{
|
||||||
cancel(%clVictim.player.alertThread);
|
cancel(%clVictim.player.alertThread);
|
||||||
|
|
||||||
DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
|
DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLoc);
|
||||||
|
|
||||||
|
if(%clVictim.isMarked && $DMGame::mode){
|
||||||
|
if(%clVictim != %clKiller && %clKiller !$= ""){
|
||||||
|
%clKiller.bigGame++; // stats rename to what ever
|
||||||
|
messageAll('Msgding', '\c1%1 took out %2 ending their kill streak of %3.~wfx/misc/flag_lost.wav',%clKiller.name,%clVictim.name, %clVictim.killCounter);
|
||||||
|
}
|
||||||
|
for(%a = 0; %a < ClientGroup.getCount(); %a++)
|
||||||
|
{
|
||||||
|
%client = ClientGroup.getObject(%a);
|
||||||
|
if(%client != %clVictim){
|
||||||
|
hideTargetWaypoint(%client,%clVictim);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%clVictim.isMarked = 0;
|
||||||
|
}
|
||||||
|
else if($DMGame::mode == 2){
|
||||||
|
if(%game.lastGuy != %clKiller && %clVictim == %game.lastGuy){
|
||||||
|
%clKiller.bigGame++;
|
||||||
|
messageClient(%clKiller, 'MsgPingWaypoint', '\c2Big Target Count %1.~wfx/misc/~wfx/misc/flag_lost.wav',%clKiller.bigGame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%clKiller.killCounter++;
|
||||||
|
%clVictim.killCounter = 0;
|
||||||
|
switch$($DMGame::mode){
|
||||||
|
case 1: // player with the highest kill streak if they are above $DMGame::wpKillCount
|
||||||
|
%bigClient = 0;
|
||||||
|
for(%b = 0; %b < ClientGroup.getCount(); %b++){
|
||||||
|
%cl = ClientGroup.getObject(%b);
|
||||||
|
if(%cl.killCounter >= $DMGame::wpKillCount && %cl.killCounter > %bigClient.killCounter && !%cl.isObserver){
|
||||||
|
%bigClient = %cl;// we have a new
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(%bigClient != %game.lastGuy && %bigClient != 0){
|
||||||
|
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
|
||||||
|
messageClient(%cl, 'MsgPingWaypoint', '\c2%1 is on a kill streak of %2.',%bigClient.name,%bigClient.killCounter);
|
||||||
|
|
||||||
|
hideTargetWaypoint(%cl,%game.lastGuy);
|
||||||
|
if(%cl != %bigClient){
|
||||||
|
markTargetDM(%cl,%bigClient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%game.lastGuy.isMarked = 0;
|
||||||
|
%bigClient.isMarked = 1;
|
||||||
|
%game.lastGuy = %bigClient;
|
||||||
|
}
|
||||||
|
case 2: // player with the highest score
|
||||||
|
%bigClient = 0;
|
||||||
|
for(%b = 0; %b < ClientGroup.getCount(); %b++){
|
||||||
|
%cl = ClientGroup.getObject(%b);
|
||||||
|
if(%cl.score > %bigClient.score && !%cl.isObserver){
|
||||||
|
%bigClient = %cl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(%bigClient != 0 && %game.lastGuy != %bigClient){
|
||||||
|
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||||
|
%cl = ClientGroup.getObject(%i);
|
||||||
|
//messageClient(%cl, 'MsgPingWaypoint', '\c2%1 now has the highest score.',%bigClient.name);
|
||||||
|
messageClient(%cl, 'MsgPingWaypoint', '\c2%1 now has the highest score.',%bigClient.name);
|
||||||
|
hideTargetWaypoint(%cl,%game.lastGuy);
|
||||||
|
if(%cl != %bigClient){
|
||||||
|
markTargetDM(%cl,%bigClient);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%game.lastGuy = %bigClient;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//function listDM(){// for debug
|
||||||
|
//for(%a = 0; %a < ClientGroup.getCount(); %a++){
|
||||||
|
//%client = ClientGroup.getObject(%a);
|
||||||
|
//echo(%client.nameBase SPC KIlls SPC %client.killCounter);
|
||||||
|
//}
|
||||||
|
//}
|
||||||
|
function markTargetDM(%client,%clTarget){// out of bountygame
|
||||||
|
if(isObject(%clTarget) && isObject(%client) && !%client.isAIControlled()){
|
||||||
|
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
||||||
|
%visMask |= (1 << %client.getSensorGroup());
|
||||||
|
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
||||||
|
%clTarget.player.scopeToClient(%client);
|
||||||
|
%client.setTargetId(%clTarget.target);
|
||||||
|
commandToClient(%client, 'TaskInfo', %client, -1, false, $DMGame::wpMessage);
|
||||||
|
%client.sendTargetTo(%client, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function hideTargetWaypoint(%client,%clTarget){
|
||||||
|
if(isObject(%clTarget) && isObject(%client) && !%client.isAIControlled()){
|
||||||
|
%visMask = getSensorGroupAlwaysVisMask(%clTarget.getSensorGroup());
|
||||||
|
%visMask &= ~(1 << %client.getSensorGroup());
|
||||||
|
setSensorGroupAlwaysVisMask(%clTarget.getSensorGroup(), %visMask);
|
||||||
|
removeClientTargetType(%client, "AssignedTask");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function DMGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement)
|
function DMGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement)
|
||||||
|
|
@ -242,13 +353,13 @@ function DMGame::recalcScore(%game, %client)
|
||||||
%killValue = %client.kills * %game.SCORE_PER_KILL;
|
%killValue = %client.kills * %game.SCORE_PER_KILL;
|
||||||
%deathValue = %client.deaths * %game.SCORE_PER_DEATH;
|
%deathValue = %client.deaths * %game.SCORE_PER_DEATH;
|
||||||
%suicideValue = %client.suicides * %game.SCORE_PER_SUICIDE;
|
%suicideValue = %client.suicides * %game.SCORE_PER_SUICIDE;
|
||||||
|
%bigGameValue = %client.bigGame * %game.SCORE_PER_BIGGAME;
|
||||||
if (%killValue - %deathValue == 0)
|
if (%killValue - %deathValue == 0)
|
||||||
%client.efficiency = %suicideValue;
|
%client.efficiency = %suicideValue;
|
||||||
else
|
else
|
||||||
%client.efficiency = ((%killValue * %killValue) / (%killValue - %deathValue)) + %suicideValue;
|
%client.efficiency = ((%killValue * %killValue) / (%killValue - %deathValue)) + %suicideValue;
|
||||||
|
|
||||||
%client.score = mFloatLength(%client.efficiency, 1);
|
%client.score = mFloatLength(%client.efficiency, 1) + %bigGameValue;
|
||||||
messageClient(%client, 'MsgYourScoreIs', "", %client.score);
|
messageClient(%client, 'MsgYourScoreIs', "", %client.score);
|
||||||
%game.recalcTeamRanks(%client);
|
%game.recalcTeamRanks(%client);
|
||||||
%game.checkScoreLimit(%client);
|
%game.checkScoreLimit(%client);
|
||||||
|
|
@ -271,7 +382,7 @@ function DMGame::scoreLimitReached(%game)
|
||||||
function DMGame::gameOver(%game)
|
function DMGame::gameOver(%game)
|
||||||
{
|
{
|
||||||
//call the default
|
//call the default
|
||||||
DefaultGame::gameOver(%game);
|
DefaultGame::gameOver(%game);
|
||||||
|
|
||||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
||||||
|
|
||||||
|
|
@ -294,88 +405,88 @@ function DMGame::enterMissionArea(%game, %playerData, %player)
|
||||||
// borlak -- TAKEN FROM TR2 -- thanks! :D
|
// borlak -- TAKEN FROM TR2 -- thanks! :D
|
||||||
function plzBounceOffGrid(%obj, %bounceForce, %count)
|
function plzBounceOffGrid(%obj, %bounceForce, %count)
|
||||||
{
|
{
|
||||||
%bounds = MissionArea.area;
|
%bounds = MissionArea.area;
|
||||||
%boundsWest = firstWord(%bounds);
|
%boundsWest = firstWord(%bounds);
|
||||||
%boundsNorth = getWord(%bounds, 1);
|
%boundsNorth = getWord(%bounds, 1);
|
||||||
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
||||||
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
||||||
|
|
||||||
%shapePos = %obj.getPosition();
|
%shapePos = %obj.getPosition();
|
||||||
%shapex = firstWord(%shapePos);
|
%shapex = firstWord(%shapePos);
|
||||||
%shapey = getWord(%shapePos, 1);
|
%shapey = getWord(%shapePos, 1);
|
||||||
|
|
||||||
if( %shapex >= %boundsWest && %shapex <= %boundsEast && %shapey >= %boundsNorth && %shapey <= %boundsSouth) {
|
if( %shapex >= %boundsWest && %shapex <= %boundsEast && %shapey >= %boundsNorth && %shapey <= %boundsSouth) {
|
||||||
// we don't need to bounce at all
|
// we don't need to bounce at all
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( %count == 8 ) {
|
if( %count == 8 ) {
|
||||||
// just kill this retard
|
// just kill this retard
|
||||||
%obj.scriptKill($DamageType::OutOfBounds);
|
%obj.scriptKill($DamageType::OutOfBounds);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (%bounceForce $= "")
|
if (%bounceForce $= "")
|
||||||
%bounceForce = 65;
|
%bounceForce = 65;
|
||||||
|
|
||||||
%oldVel = %obj.getVelocity();
|
%oldVel = %obj.getVelocity();
|
||||||
%obj.setVelocity("0 0 0");
|
%obj.setVelocity("0 0 0");
|
||||||
|
|
||||||
%vecx = firstWord(%oldVel);
|
%vecx = firstWord(%oldVel);
|
||||||
%vecy = getWord(%oldVel, 1);
|
%vecy = getWord(%oldVel, 1);
|
||||||
%vecz = getWord(%oldVel, 2);
|
%vecz = getWord(%oldVel, 2);
|
||||||
|
|
||||||
// four cases, not two cases you fucktard kineticpoet
|
// four cases, not two cases you fucktard kineticpoet
|
||||||
// no wonder the trives of vengrances failed
|
// no wonder the trives of vengrances failed
|
||||||
if(%shapex <= %boundsWest) {
|
if(%shapex <= %boundsWest) {
|
||||||
%vecx = mAbs(%vecx);
|
%vecx = mAbs(%vecx);
|
||||||
}
|
}
|
||||||
else if(%shapex >= %boundsEast) {
|
else if(%shapex >= %boundsEast) {
|
||||||
%vecx = -mAbs(%vecx);
|
%vecx = -mAbs(%vecx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%shapey <= %boundsNorth) {
|
if(%shapey <= %boundsNorth) {
|
||||||
%vecy = mAbs(%vecy);
|
%vecy = mAbs(%vecy);
|
||||||
}
|
}
|
||||||
else if(%shapey >= %boundsSouth) {
|
else if(%shapey >= %boundsSouth) {
|
||||||
%vecy = -mAbs(%vecy);
|
%vecy = -mAbs(%vecy);
|
||||||
}
|
}
|
||||||
|
|
||||||
%vec = %vecx SPC %vecy SPC %vecz;
|
%vec = %vecx SPC %vecy SPC %vecz;
|
||||||
|
|
||||||
// If the object's speed was pretty slow, give it a boost
|
// If the object's speed was pretty slow, give it a boost
|
||||||
%oldSpeed = VectorLen(%oldVel);
|
%oldSpeed = VectorLen(%oldVel);
|
||||||
if (%oldSpeed < 25)
|
if (%oldSpeed < 25)
|
||||||
{
|
{
|
||||||
%vec = VectorNormalize(%vec);
|
%vec = VectorNormalize(%vec);
|
||||||
%vec = VectorScale(%vec, 25);
|
%vec = VectorScale(%vec, 25);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
%vec = VectorScale(%vec, 1.15);
|
%vec = VectorScale(%vec, 1.15);
|
||||||
|
|
||||||
// apply the impulse to the object
|
// apply the impulse to the object
|
||||||
//%obj.applyImpulse(%obj.getWorldBoxCenter(), %vec);
|
//%obj.applyImpulse(%obj.getWorldBoxCenter(), %vec);
|
||||||
%obj.setVelocity(%vec);
|
%obj.setVelocity(%vec);
|
||||||
|
|
||||||
// repeat this bounce 4 times per second. if we're oob for 2 seconds, take action
|
// repeat this bounce 4 times per second. if we're oob for 2 seconds, take action
|
||||||
// don't do this with the flag because that has its own thread
|
// don't do this with the flag because that has its own thread
|
||||||
if( %obj.dataBlock !$= "Flag" ) {
|
if( %obj.dataBlock !$= "Flag" ) {
|
||||||
schedule(250, 0, plzBounceOffGrid, %obj, %bounceForce, %count + 1);
|
schedule(250, 0, plzBounceOffGrid, %obj, %bounceForce, %count + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function isOutOfBounds(%position)
|
function isOutOfBounds(%position)
|
||||||
{
|
{
|
||||||
%shapePos = %position;
|
%shapePos = %position;
|
||||||
%shapex = firstWord(%shapePos);
|
%shapex = firstWord(%shapePos);
|
||||||
%shapey = getWord(%shapePos, 1);
|
%shapey = getWord(%shapePos, 1);
|
||||||
%bounds = MissionArea.area;
|
%bounds = MissionArea.area;
|
||||||
%boundsWest = firstWord(%bounds);
|
%boundsWest = firstWord(%bounds);
|
||||||
%boundsNorth = getWord(%bounds, 1);
|
%boundsNorth = getWord(%bounds, 1);
|
||||||
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
%boundsEast = %boundsWest + getWord(%bounds, 2);
|
||||||
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
%boundsSouth = %boundsNorth + getWord(%bounds, 3);
|
||||||
|
|
||||||
return (%shapex < %boundsWest || %shapex > %boundsEast ||
|
return (%shapex < %boundsWest || %shapex > %boundsEast ||
|
||||||
%shapey < %boundsNorth || %shapey > %boundsSouth);
|
%shapey < %boundsNorth || %shapey > %boundsSouth);
|
||||||
}
|
}
|
||||||
|
|
||||||
function DMGame::leaveMissionArea(%game, %playerData, %player)
|
function DMGame::leaveMissionArea(%game, %playerData, %player)
|
||||||
|
|
@ -414,7 +525,7 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
messageClient( %client, 'SetScoreHudHeader', "", "" );
|
messageClient( %client, 'SetScoreHudHeader', "", "" );
|
||||||
|
|
||||||
// Send the subheader:
|
// Send the subheader:
|
||||||
messageClient(%client, 'SetScoreHudSubheader', "", '<tab:15,235,340,415>\tPLAYER\tRATING\tKILLS\tDEATHS');
|
messageClient(%client, 'SetScoreHudSubheader', "", '<tab:15,200,280,360,465>\tPLAYER\tRATING\tKILLS\tDEATHS\tBONUS');
|
||||||
|
|
||||||
for (%index = 0; %index < $TeamRank[0, count]; %index++)
|
for (%index = 0; %index < $TeamRank[0, count]; %index++)
|
||||||
{
|
{
|
||||||
|
|
@ -422,7 +533,7 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
%cl = $TeamRank[0, %index];
|
%cl = $TeamRank[0, %index];
|
||||||
|
|
||||||
//get the score
|
//get the score
|
||||||
%clScore = mFloatLength( %cl.efficiency, 1 );
|
%clScore = %cl.score;
|
||||||
|
|
||||||
%clKills = mFloatLength( %cl.kills, 0 );
|
%clKills = mFloatLength( %cl.kills, 0 );
|
||||||
%clDeaths = mFloatLength( %cl.deaths + %cl.suicides, 0 );
|
%clDeaths = mFloatLength( %cl.deaths + %cl.suicides, 0 );
|
||||||
|
|
@ -430,15 +541,15 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
|
|
||||||
//if the client is not an observer, send the message
|
//if the client is not an observer, send the message
|
||||||
if (%client.team != 0)
|
if (%client.team != 0)
|
||||||
{
|
{ // <tab:15,235,340,415,500>\%5\%1\%2\%3\tBG'
|
||||||
messageClient( %client, 'SetLineHud', "", %tag, %index, '%5<tab:20, 450>\t<clip:200>%1</clip><rmargin:280><just:right>%2<rmargin:370><just:right>%3<rmargin:460><just:right>%4',
|
messageClient( %client, 'SetLineHud', "", %tag, %index, '%5<tab:20, 450>\t<clip:115>%1</clip><rmargin:225><just:right>%2<rmargin:300><just:right>%3<rmargin:390><just:right>%4<rmargin:490>%6',
|
||||||
%cl.name, %clScore, %clKills, %clDeaths, %clStyle );
|
%cl.name, %clScore, %clKills, %clDeaths, %clStyle, %cl.bigGame);
|
||||||
}
|
}
|
||||||
//else for observers, create an anchor around the player name so they can be observed
|
//else for observers, create an anchor around the player name so they can be observed
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
messageClient( %client, 'SetLineHud', "", %tag, %index, '%5<tab:20, 450>\t<clip:200><a:gamelink\t%6>%1</a></clip><rmargin:280><just:right>%2<rmargin:370><just:right>%3<rmargin:460><just:right>%4',
|
messageClient( %client, 'SetLineHud', "", %tag, %index, '%5<tab:20, 450>\t<clip:115><a:gamelink\t%6>%1</a></clip><rmargin:225><just:right>%2<rmargin:300><just:right>%3<rmargin:390><just:right>%4<rmargin:490>%7',
|
||||||
%cl.name, %clScore, %clKills, %clDeaths, %clStyle, %cl );
|
%cl.name, %clScore, %clKills, %clDeaths, %clStyle, %cl,%cl.bigGame );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -453,9 +564,9 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
|
|
||||||
if (%observerCount > 0)
|
if (%observerCount > 0)
|
||||||
{
|
{
|
||||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
|
messageClient( %client, 'SetLineHud', "", %tag, %index, "");
|
||||||
%index++;
|
%index++;
|
||||||
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
|
messageClient(%client, 'SetLineHud', "", %tag, %index, '<tab:10, 310><spush><font:Univers Condensed:22>\tOBSERVERS (%1)<rmargin:260><just:right>TIME<spop>', %observerCount);
|
||||||
%index++;
|
%index++;
|
||||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
{
|
{
|
||||||
|
|
@ -465,8 +576,8 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
{
|
{
|
||||||
%obsTime = getSimTime() - %cl.observerStartTime;
|
%obsTime = getSimTime() - %cl.observerStartTime;
|
||||||
%obsTimeStr = %game.formatTime(%obsTime, false);
|
%obsTimeStr = %game.formatTime(%obsTime, false);
|
||||||
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
|
messageClient( %client, 'SetLineHud', "", %tag, %index, '<tab:20, 310>\t<clip:150>%1</clip><rmargin:260><just:right>%2',
|
||||||
%cl.name, %obsTimeStr );
|
%cl.name, %obsTimeStr );
|
||||||
%index++;
|
%index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -483,28 +594,28 @@ function DMGame::updateScoreHud(%game, %client, %tag)
|
||||||
package DMGame
|
package DMGame
|
||||||
{
|
{
|
||||||
|
|
||||||
function deployMineCheck(%mineObj, %player)
|
function deployMineCheck(%mineObj, %player)
|
||||||
{
|
{
|
||||||
// explode it vgc
|
// explode it vgc
|
||||||
schedule(2000, %mineObj, "explodeMine", %mineObj, true);
|
schedule(2000, %mineObj, "explodeMine", %mineObj, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
|
function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
|
||||||
{
|
{
|
||||||
if(!isObject(%targetObject) && !isObject(%projectile.sourceObject))
|
if(!isObject(%targetObject) && !isObject(%projectile.sourceObject))
|
||||||
return;
|
return;
|
||||||
if(!(%targetObject.getType() & ($TypeMasks::StaticTSObjectType | $TypeMasks::InteriorObjectType |
|
if(!(%targetObject.getType() & ($TypeMasks::StaticTSObjectType | $TypeMasks::InteriorObjectType |
|
||||||
$TypeMasks::TerrainObjectType | $TypeMasks::WaterObjectType)))
|
$TypeMasks::TerrainObjectType | $TypeMasks::WaterObjectType)))
|
||||||
{
|
{
|
||||||
if(%projectile.sourceObject.team !$= %targetObject.team)
|
if(%projectile.sourceObject.team !$= %targetObject.team)
|
||||||
{
|
{
|
||||||
if(%targetObject.getDataBlock().getClassName() $= "PlayerData" && %data.getName() $= "DiscProjectile")
|
if(%targetObject.getDataBlock().getClassName() $= "PlayerData" && %data.getName() $= "DiscProjectile")
|
||||||
{
|
{
|
||||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
|
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
|
||||||
%start = %targetObject.getWorldBoxCenter();
|
%start = %targetObject.getWorldBoxCenter();
|
||||||
%distance = mFloor(VectorDist(%start, %projectile.initialPosition));
|
%distance = mFloor(VectorDist(%start, %projectile.initialPosition));
|
||||||
%end = getWord(%start, 0) SPC getWord(%start, 1) SPC getWord(%start, 2) - 15;
|
%end = getWord(%start, 0) SPC getWord(%start, 1) SPC getWord(%start, 2) - 15;
|
||||||
%grounded = ContainerRayCast(%start, %end, %mask, 0);
|
%grounded = ContainerRayCast(%start, %end, %mask, 0);
|
||||||
if(!%grounded)
|
if(!%grounded)
|
||||||
{
|
{
|
||||||
%projectile.sourceObject.client.scoreMidAir++;
|
%projectile.sourceObject.client.scoreMidAir++;
|
||||||
|
|
@ -516,55 +627,55 @@ function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifie
|
||||||
}
|
}
|
||||||
Parent::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal);
|
Parent::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
||||||
{
|
{
|
||||||
//Other armors get more damage
|
//Other armors get more damage
|
||||||
if(%targetObject.client.armor $= "Medium")
|
if(%targetObject.client.armor $= "Medium")
|
||||||
{
|
{
|
||||||
%amount *= 1.3;
|
%amount *= 1.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%targetObject.client.armor $= "Heavy")
|
if(%targetObject.client.armor $= "Heavy")
|
||||||
{
|
{
|
||||||
%amount *= 1.5;
|
%amount *= 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function DMGame::sendGameVoteMenu(%game, %client, %key)
|
function DMGame::sendGameVoteMenu(%game, %client, %key)
|
||||||
{
|
{
|
||||||
parent::sendGameVoteMenu( %game, %client, %key );
|
parent::sendGameVoteMenu( %game, %client, %key );
|
||||||
|
|
||||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||||
|
|
||||||
if ( %game.scheduleVote $= "" )
|
if ( %game.scheduleVote $= "" )
|
||||||
{
|
{
|
||||||
if(!%client.isAdmin)
|
if(!%client.isAdmin)
|
||||||
{
|
{
|
||||||
if(!$Host::DMSLOnlyMode)
|
if(!$Host::DMSLOnlyMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
|
||||||
}
|
}
|
||||||
else if (%client.ForceVote > 0 && %client.NextMission !$= 1 ) //Added for SetNextMission
|
else if (%client.ForceVote > 0 && %client.NextMission !$= 1 ) //Added for SetNextMission
|
||||||
{
|
{
|
||||||
if(!$Host::DMSLOnlyMode)
|
if(!$Host::DMSLOnlyMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to enable Shocklance Only Mode', 'Vote to enable Shocklance Only Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'vote to disable Shocklance Only Mode', 'Vote to disable Shocklance Only Mode' );
|
||||||
}
|
}
|
||||||
else if ( %client.NextMission !$= 1 ) //Added for SetNextMission
|
else if ( %client.NextMission !$= 1 ) //Added for SetNextMission
|
||||||
{
|
{
|
||||||
if(!$Host::DMSLOnlyMode)
|
if(!$Host::DMSLOnlyMode)
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'change to enable Shocklance Only Mode', 'Enable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'change to enable Shocklance Only Mode', 'Enable Shocklance Only Mode' );
|
||||||
else
|
else
|
||||||
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'change to disable Shocklance Only Mode', 'Disable Shocklance Only Mode' );
|
messageClient( %client, 'MsgVoteItem', "", %key, 'DMSLOnlyMode', 'change to disable Shocklance Only Mode', 'Disable Shocklance Only Mode' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -572,11 +683,11 @@ function DMGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
{
|
{
|
||||||
switch$ (%typeName)
|
switch$ (%typeName)
|
||||||
{
|
{
|
||||||
case "DMSLOnlyMode":
|
case "DMSLOnlyMode":
|
||||||
%game.DMSLOnlyMode(%admin, %arg1, %arg2, %arg3, %arg4);
|
%game.DMSLOnlyMode(%admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------DMSLOnlyMode--------------------------------
|
//--------------------------------DMSLOnlyMode--------------------------------
|
||||||
|
|
@ -585,74 +696,96 @@ $VoteMessage["DMSLOnlyMode"] = "turn";
|
||||||
|
|
||||||
function DMGame::DMSLOnlyMode(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
function DMGame::DMSLOnlyMode(%game, %admin, %arg1, %arg2, %arg3, %arg4)
|
||||||
{
|
{
|
||||||
if( $countdownStarted && $MatchStarted )
|
if( $countdownStarted && $MatchStarted )
|
||||||
|
{
|
||||||
|
if(%admin)
|
||||||
|
{
|
||||||
|
killeveryone();
|
||||||
|
|
||||||
|
if( $Host::DMSLOnlyMode )
|
||||||
|
{
|
||||||
|
messageAll('MsgAdminForce', '\c2The Admin has disabled Shocklance Only Mode.');
|
||||||
|
|
||||||
|
$Host::DMSLOnlyMode = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
messageAll('MsgAdminForce', '\c2The Admin has enabled Shocklance Only Mode.');
|
||||||
|
|
||||||
|
$Host::DMSLOnlyMode = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
|
||||||
|
if(%totalVotes > 0 && (%game.totalVotesFor / ClientGroup.getCount()) > ($Host::VotePasspercent / 100))
|
||||||
|
{
|
||||||
|
killeveryone();
|
||||||
|
|
||||||
|
if( $Host::DMSLOnlyMode )
|
||||||
|
{
|
||||||
|
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Disabled.');
|
||||||
|
|
||||||
|
$Host::DMSLOnlyMode = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Enabled.');
|
||||||
|
|
||||||
|
$Host::DMSLOnlyMode = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
messageAll('MsgVoteFailed', '\c2Mode change did not pass: %1 percent.', mFloor(%game.totalVotesFor/ClientGroup.getCount() * 100));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//from lak
|
||||||
|
function killEveryone(%ignore, %message)
|
||||||
|
{
|
||||||
|
if(!%message)
|
||||||
|
messageAll('msgKillEveryone', 'Resetting...');
|
||||||
|
else
|
||||||
|
messageAll('msgKillEveryone', %message);
|
||||||
|
|
||||||
|
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||||
{
|
{
|
||||||
if(%admin)
|
%target = ClientGroup.getObject(%i);
|
||||||
{
|
|
||||||
killeveryone();
|
|
||||||
|
|
||||||
if( $Host::DMSLOnlyMode )
|
if(!%target.player || %target.player == %ignore)
|
||||||
{
|
continue;
|
||||||
messageAll('MsgAdminForce', '\c2The Admin has disabled Shocklance Only Mode.');
|
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = false;
|
%target.player.blowup();
|
||||||
}
|
%target.player.scriptKill();
|
||||||
else
|
|
||||||
{
|
|
||||||
messageAll('MsgAdminForce', '\c2The Admin has enabled Shocklance Only Mode.');
|
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
|
|
||||||
if(%totalVotes > 0 && (%game.totalVotesFor / ClientGroup.getCount()) > ($Host::VotePasspercent / 100))
|
|
||||||
{
|
|
||||||
killeveryone();
|
|
||||||
|
|
||||||
if( $Host::DMSLOnlyMode )
|
|
||||||
{
|
|
||||||
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Disabled.');
|
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
messageAll('MsgVotePassed', '\c2Shocklance Only Mode Enabled.');
|
|
||||||
|
|
||||||
$Host::DMSLOnlyMode = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
messageAll('MsgVoteFailed', '\c2Mode change did not pass: %1 percent.', mFloor(%game.totalVotesFor/ClientGroup.getCount() * 100));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// For voting to work properly - evo admin.ovl
|
// For voting to work properly - evo admin.ovl
|
||||||
//
|
//
|
||||||
// case "DMSLOnlyMode":
|
// case "DMSLOnlyMode":
|
||||||
// if( %isAdmin && !%client.ForceVote )
|
// if( %isAdmin && !%client.ForceVote )
|
||||||
// {
|
// {
|
||||||
// adminStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4);
|
// adminStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4);
|
||||||
// adminLog(%client, " has toggled " @ %arg1 @ " (" @ %arg2 @ ")");
|
// adminLog(%client, " has toggled " @ %arg1 @ " (" @ %arg2 @ ")");
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// if(Game.scheduleVote !$= "")
|
// if(Game.scheduleVote !$= "")
|
||||||
// {
|
// {
|
||||||
// messageClient(%client, 'voteAlreadyRunning', '\c2A vote is already in progress.');
|
// messageClient(%client, 'voteAlreadyRunning', '\c2A vote is already in progress.');
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// %actionMsg = ($Host::DMSLOnlyMode ? "disable Shocklance Only Mode" : "enable Shocklance Only Mode");
|
// %actionMsg = ($Host::DMSLOnlyMode ? "disable Shocklance Only Mode" : "enable Shocklance Only Mode");
|
||||||
// for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
|
// for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
|
||||||
// {
|
// {
|
||||||
// %cl = ClientGroup.getObject(%idx);
|
// %cl = ClientGroup.getObject(%idx);
|
||||||
// if(!%cl.isAIControlled())
|
// if(!%cl.isAIControlled())
|
||||||
// {
|
// {
|
||||||
// messageClient(%cl, 'VoteStarted', '\c2%1 initiated a vote to %2.', %client.name, %actionMsg);
|
// messageClient(%cl, 'VoteStarted', '\c2%1 initiated a vote to %2.', %client.name, %actionMsg);
|
||||||
// %clientsVoting++;
|
// %clientsVoting++;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// playerStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4, %clientsVoting);
|
// playerStartNewVote(%client, %typename, %arg1, %arg2, %arg3, %arg4, %clientsVoting);
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue