Merge branch 'NoEvo'

This commit is contained in:
ChocoTaco1 2020-04-17 15:29:09 -04:00
commit 1ccfa797d0
4 changed files with 111 additions and 98 deletions

View file

@ -354,9 +354,8 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
// borlak -- DJ + gren spam abuse, remove player height
if(%damageType == $DamageType::Grenade && !$lastObjExplode.isHandNade)
%targetPosition = setWord(%targetPosition, 2, getWord(%targetPosition,2) - getHeight(%targetObject));
//if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser)
if(%damageType == $DamageType::ShockLance)
if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser)
{
$lastObjExplode = 0;
%distance = VectorDist(%targetPosition, %sourceObject.getWorldBoxCenter());
@ -380,8 +379,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
%velBonus = (mPow(%vel,1.125)/10)+1;
// for shock and laser, you get MA points if -you- are in the air not the opponent
//if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser)
if(%damageType == $DamageType::ShockLance)
if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser)
%ma = TestForMA(%sourceObject, 6);
else
%ma = TestForMA(%targetObject, 6);
@ -400,45 +398,6 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
if(Game.noSplashDamage && %percentDam < 98 && $lastObjExplode && !$lastObjExplode.isHandNade && %damageType != $DamageType::Mine)
%amount = 0.0;
//if(%damageType == $DamageType::Laser && (%energy > 0.5 || %players > 7))
//{
// %players = (ClientGroup.getCount()-1)/1.5;
// %points = (%distance/75)+1;
//
// if(%ma)
// %points *= 1.75;
//
// if(%targetObject.client.headshot)
// {
// %sound = %defaultSound;
// %special = " Headshot";
// %points *= 1.75;
// }
// %sourceObject.client.totalSnipeHits++;
// %weapon = "Snipe";
//}
//else if(%damageType == $DamageType::Bullet)
//{
// // doesn't matter if it's MA
// %ma = 0;
//
// %players = (ClientGroup.getCount()-1)/1.75;
//
// $LakFired[%sourceObject, ChaingunBullet, 1]++;
//
// if($LakFired[%sourceObject, ChaingunBullet, 1] % 5 == 0)
// {
// %accamount = mFloor(($LakFired[%sourceObject, ChaingunBullet, 1] / $LakFired[%sourceObject, ChaingunBullet, 0])*100);
// %velBonus = 0;
// %points = (%accamount/3)+1;
// %accuracy = " [Accuracy:" @ %accamount @ "%]";
//
// %sourceObject.client.totalChainAccuracy += %accamount;
// %sourceObject.client.totalChainHits++;
// }
// %weapon = "Chaingun";
//}
switch$(%damageType)
{
case $DamageType::Disc:
@ -505,37 +464,60 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
}
%weapon = "Disc";
case $DamageType::Grenade:
if(Game.PubPro)
if($lastObjExplode.isHandNade) //Hand grenades
{
if(%ma && %percentDam >= 98)
if(%percentDam > 20)
{
%points = %distanceBonus;
%sound = %defaultSound;
%accuracy = " [Accuracy:" @ %percentDam @ "%]";
%points = (%percentDam/10)+1;
%velBonus = 0;
%sound = '~wfx/misc/coin.wav';
}
if(%percentDam >= 25 && !%ma && %distance >= 80 && %velTarget > 20)
if(%percentDam >= 99)
{
%points = %longDistanceBonus;
%velBonus /= 2;
%long = 1;
%sound = %defaultSound;
%sound = '~wfx/misc/Cheer.wav';
%points *= 2.0;
}
if(%ma)
%points *= 1.5;
%weapon = "Hand-Nade";
}
else
else
{
if(%ma && %percentDam >= 98)
if(Game.PubPro)
{
%points = %distanceBonus/1.85;
%sound = %defaultSound;
if(%ma && %percentDam >= 98)
{
%points = %distanceBonus;
%sound = %defaultSound;
}
if(%percentDam >= 25 && !%ma && %distance >= 80 && %velTarget > 20)
{
%points = %longDistanceBonus;
%velBonus /= 2;
%long = 1;
%sound = %defaultSound;
}
}
if(%percentDam >= 25 && !%ma && %distance >= 100 && %velTarget > 30)
else
{
%points = %longDistanceBonus/1.85;
%velBonus /= 4;
%long = 1;
%sound = %defaultSound;
if(%ma && %percentDam >= 98)
{
%points = %distanceBonus/1.85;
%sound = %defaultSound;
}
if(%percentDam >= 25 && !%ma && %distance >= 100 && %velTarget > 30)
{
%points = %longDistanceBonus/1.85;
%velBonus /= 4;
%long = 1;
%sound = %defaultSound;
}
}
%weapon = "Grenade-Launcher";
}
%weapon = "Grenade-Launcher";
case $DamageType::Mortar:
if(%ma && %percentDam >= 98)
{
@ -588,7 +570,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
%dif = VectorNormalize(%dif);
%dot = VectorDot(%dif, %objDir2D);
if(%dot >= mCos(1.05))
if(%dot >= mCos(1.05))
{
if(%sourceObject.holdingFlag && TestForMA(%targetObject, 6))
{
@ -602,16 +584,22 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
}
if(%ma)
%points += 3;
%sound = %defaultSound;
%sourceObject.client.totalShockHits++;
%weapon = "ShockLance";
//not a bug. sl gets points ma or not
%sound = %defaultSound;
%sourceObject.client.totalShockHits++;
%weapon = "ShockLance";
case $DamageType::Blaster:
if(%ma)
{
%points = %distanceBonus/2;
%points = %distanceBonus/2.5; //was 2
%velBonus /= 2;
%sound = %defaultSound;
%amount *= 0.7; //Midair blaster damage reduction - particularly for blaster spamming
}
else
%amount *= 0.5; //Ground blaster damage reduction - particularly for blaster spamming
%weapon = "Blaster";
case $DamageType::Plasma:
if(%ma && %percentDam >= 98)
@ -627,30 +615,46 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
%sound = %defaultSound;
}
%weapon = "Plasma";
case $DamageType::Laser:
if($InvBanList[LakRabbit, "SniperRifle"]) //banned
return;
if(%energy > 0.5 || %players > 7)
{
%players = (ClientGroup.getCount()-1)/1.5;
%points = (%distance/75)+1;
if(%ma)
%points *= 1.75;
if(%targetObject.client.headshot)
{
%sound = %defaultSound;
%special = " Headshot";
%points *= 1.75;
}
%sourceObject.client.totalSnipeHits++;
%weapon = "Snipe";
}
case $DamageType::Bullet:
// doesn't matter if it's MA
%ma = 0;
%players = (ClientGroup.getCount()-1)/1.75;
$LakFired[%sourceObject, ChaingunBullet, 1]++;
if($LakFired[%sourceObject, ChaingunBullet, 1] % 5 == 0)
{
%accamount = mFloor(($LakFired[%sourceObject, ChaingunBullet, 1] / $LakFired[%sourceObject, ChaingunBullet, 0])*100);
%velBonus = 0;
%points = (%accamount/3)+1;
%accuracy = " [Accuracy:" @ %accamount @ "%]";
%sourceObject.client.totalChainAccuracy += %accamount;
%sourceObject.client.totalChainHits++;
}
%weapon = "Chaingun";
}
}
//Hand grenades
if(%damageType == $DamageType::Grenade && $lastObjExplode.isHandNade)
{
if(%percentDam > 20)
{
%accuracy = " [Accuracy:" @ %percentDam @ "%]";
%points = (%percentDam/10)+1;
%velBonus = 0;
%sound = '~wfx/misc/coin.wav';
}
if(%percentDam >= 99)
{
%sound = '~wfx/misc/Cheer.wav';
%points *= 2.0;
}
if(%ma)
%points *= 1.5;
%weapon = "Hand-Nade";
}
// borlak -- recalc score for hits
if( isObject(%sourceObject)

View file

@ -88,15 +88,22 @@ function ClassicChatLog(%client, %id, %team, %msg)
return;
// Don't log voicepack stuff.
if(strstr(%msg, "~w") != -1)
if(strstr(%msg, "~w") != -1 || strstr(%msg, "flag") != -1)
return;
%team = getTaggedString(Game.getTeamName(%team));
if(%team $= "Unassigned")
%team = "Observer";
else if($CurrentMissionType $= "LakRabbit" || $CurrentMissionType $= "DM")
%team = $dtStats::gtNameLong[%client.lgame]; //from zDarktigerStats.cs
switch$(%id)
{
case 0:
%team = "[Global]";
case 1:
%team = "["@getTaggedString(Game.getTeamName(%team))@"]";
%team = "[" @ %team @ "]";
case 2:
%team = "[Admin]";
case 3:
@ -105,10 +112,7 @@ function ClassicChatLog(%client, %id, %team, %msg)
%team = "[Centerprint]";
}
// Make it all uppercase
%team = strupr(%team);
$ClassicChatLog = "["@formattimestring("H:nn:ss")@"]" SPC %team SPC getTaggedString(%client.name) @": "@%msg;
$ClassicChatLog = "["@formattimestring("H:nn:ss")@"] "@%team SPC getTaggedString(%client.name)@": "@%msg;
$ClassicChatLog = stripChars($ClassicChatLog, "\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\x10\x11\co\cp");
%path = $Host::ClassicChatLogPath @ formatTimeString("/yy/mm-MM/dd.log");
export("$ClassicChatLog", %path, true);

View file

@ -235,7 +235,7 @@ $dtStats::gtNameShort["DMGame"] = "DM";
$dtStats::gtNameShort["SCtFGame"] = "LCTF";
$dtStats::gtNameShort["ArenaGame"] = "Arena";
$dtStats::gtNameShort["DuelGame"] = "Duel";
//Display name
//Display name - rely on these in tacoserver enablelogs.cs
$dtStats::gtNameLong["CTFGame"] = "Capture the Flag";
$dtStats::gtNameLong["LakRabbitGame"] = "LakRabbit";
$dtStats::gtNameLong["DMGame"] = "Deathmatch";
@ -786,6 +786,8 @@ $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "shockHitMaxDist";
$dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "packpickupCount";
$dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "weaponpickupCount";
$dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairpackpickupCount";
$dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "dtTeam";
///////////////////////////////////////////////////////////////////
$dtStats::uFC["dtStats"] = 0; // not saved but used to calculate other stats that are saved
@ -3211,6 +3213,9 @@ function DefaultGame::postGameStats(%game,%client){ //stats to add up at the end
else if(%game.class $= "LakRabbitGame"){
%client.flagTimeMin = mFloor((%client.flagTimeMS / 1000)/60);
}
//Record clients team
%client.dtTeam = %client.team;
}
function DefaultGame::getGamePct(%game)

View file

@ -1,7 +1,7 @@
![Tribes 2](https://cdn.discordapp.com/attachments/521797012014759970/678460505597149214/TacoServer.png)
# TacoServer
## A Tribes 2 server with competative features that is also open-source.
## A Tribes 2 server with competitive features that is also open-source.
---