mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-15 16:14:35 +00:00
Update 7.8
This commit is contained in:
parent
96e137fb1d
commit
f56767693c
1 changed files with 48 additions and 5 deletions
|
|
@ -173,10 +173,14 @@
|
||||||
// KDR adjustment
|
// KDR adjustment
|
||||||
// Adjusted cleanup function
|
// Adjusted cleanup function
|
||||||
// Mine disc kill fix
|
// Mine disc kill fix
|
||||||
|
//
|
||||||
|
// 7.8
|
||||||
|
// Added Armor Timers
|
||||||
|
|
||||||
|
|
||||||
//-----------Settings------------
|
//-----------Settings------------
|
||||||
//Notes score ui width is 592
|
//Notes score ui width is 592
|
||||||
$dtStats::version = 7.7;
|
$dtStats::version = 7.8;
|
||||||
//disable stats system
|
//disable stats system
|
||||||
$dtStats::Enable = 1;
|
$dtStats::Enable = 1;
|
||||||
//enable disable map stats
|
//enable disable map stats
|
||||||
|
|
@ -802,6 +806,10 @@ $dtStats::FV[$dtStats::FC["TTL"]++,"TTL"] = "lagSpikes";
|
||||||
$dtStats::FV[$dtStats::FC["TTL"]++,"TTL"] = "clientCrash";
|
$dtStats::FV[$dtStats::FC["TTL"]++,"TTL"] = "clientCrash";
|
||||||
|
|
||||||
|
|
||||||
|
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "lArmorTime";
|
||||||
|
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "mArmorTime";
|
||||||
|
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "hArmorTime";
|
||||||
|
|
||||||
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "armorL";
|
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "armorL";
|
||||||
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "armorM";
|
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "armorM";
|
||||||
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "armorH";
|
$dtStats::FV[$dtStats::FC["TG"]++,"TG"] = "armorH";
|
||||||
|
|
@ -1959,6 +1967,16 @@ package dtStats{
|
||||||
}
|
}
|
||||||
parent::onLeaveTrigger(%data, %obj, %colObj);
|
parent::onLeaveTrigger(%data, %obj, %colObj);
|
||||||
}
|
}
|
||||||
|
function DefaultGame::playerSpawned(%game, %player){
|
||||||
|
parent::playerSpawned(%game, %player);
|
||||||
|
if($dtStats::Enable)
|
||||||
|
armorTimer(%player.client.dtStats, %player.getArmorSize(), 0);
|
||||||
|
}
|
||||||
|
function Player::setArmor(%this,%size){//for game types that use spawn favs
|
||||||
|
parent::setArmor(%this,%size);
|
||||||
|
if($dtStats::Enable)
|
||||||
|
armorTimer(%this.client.dtStats, %size, 0);
|
||||||
|
}
|
||||||
function Weapon::onPickup(%this, %obj, %shape, %amount){
|
function Weapon::onPickup(%this, %obj, %shape, %amount){
|
||||||
parent::onPickup(%this, %obj, %shape, %amount);
|
parent::onPickup(%this, %obj, %shape, %amount);
|
||||||
if($dtStats::Enable)
|
if($dtStats::Enable)
|
||||||
|
|
@ -3809,6 +3827,7 @@ function dtSaveDone(){
|
||||||
function DefaultGame::postGameStats(%game,%dtStats){ //stats to add up at the end of the match
|
function DefaultGame::postGameStats(%game,%dtStats){ //stats to add up at the end of the match
|
||||||
if(!isObject(%dtStats))
|
if(!isObject(%dtStats))
|
||||||
return;
|
return;
|
||||||
|
armorTimer(%dtStats, 0, 1);
|
||||||
%dtStats.null = getRandom(1,100);
|
%dtStats.null = getRandom(1,100);
|
||||||
%dtStats.kdr = %dtStats.deaths ? (%dtStats.kills/%dtStats.deaths) : %dtStats.kills;
|
%dtStats.kdr = %dtStats.deaths ? (%dtStats.kills/%dtStats.deaths) : %dtStats.kills;
|
||||||
if(statsGroup.lastKill == %dtStats)
|
if(statsGroup.lastKill == %dtStats)
|
||||||
|
|
@ -4040,7 +4059,6 @@ function CTFGame::getGamePct(%game){
|
||||||
else
|
else
|
||||||
%scorePct = ($TeamScore[2] / %scoreLimit) * 100;
|
%scorePct = ($TeamScore[2] / %scoreLimit) * 100;
|
||||||
|
|
||||||
|
|
||||||
if(%scorePct > %timePct)
|
if(%scorePct > %timePct)
|
||||||
return %scorePct;
|
return %scorePct;
|
||||||
else
|
else
|
||||||
|
|
@ -4204,9 +4222,10 @@ function getCNameToCID(%name){
|
||||||
return %name; // not a name its a client so return it
|
return %name; // not a name its a client so return it
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
%name = stripChars(%name, "\cp\co\c6\c7\c8\c9" );
|
||||||
for (%i = 0; %i < ClientGroup.getCount(); %i++){
|
for (%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||||
%client = ClientGroup.getObject(%i);
|
%client = ClientGroup.getObject(%i);
|
||||||
if(stripChars(getTaggedString( %client.name ), "\cp\co\c6\c7\c8\c9" ) $= %name){
|
if(stripChars( getTaggedString( %client.name ), "\cp\co\c6\c7\c8\c9" ) $= %name){
|
||||||
return %client;
|
return %client;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5108,6 +5127,29 @@ function buildVarList(){
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
//Stats Collecting
|
//Stats Collecting
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
function armorTimer(%dtStats, %size, %death){
|
||||||
|
if(%dtStats.lastArmor $= "Light" && %dtStats.ArmorTime[%dtStats.lastArmor] > 0){
|
||||||
|
%dtStats.lArmorTime += ((getSimTime() - %dtStats.ArmorTime[%dtStats.lastArmor])/1000)/60;
|
||||||
|
%dtStats.ArmorTime[%dtStats.lastArmor] = 0;
|
||||||
|
%dtStats.lastArmor = 0;
|
||||||
|
}
|
||||||
|
else if(%dtStats.lastArmor $= "Medium" && %dtStats.ArmorTime[%dtStats.lastArmor] > 0){
|
||||||
|
%dtStats.mArmorTime += ((getSimTime() - %dtStats.ArmorTime[%dtStats.lastArmor])/1000)/60;
|
||||||
|
%dtStats.ArmorTime[%dtStats.lastArmor] = 0;
|
||||||
|
%dtStats.lastArmor = 0;
|
||||||
|
}
|
||||||
|
else if(%dtStats.lastArmor $= "Heavy" && %dtStats.ArmorTime[%dtStats.lastArmor] > 0){
|
||||||
|
%dtStats.hArmorTime += ((getSimTime() - %dtStats.ArmorTime[%dtStats.lastArmor])/1000)/60;
|
||||||
|
%dtStats.ArmorTime[%dtStats.lastArmor] = 0;
|
||||||
|
%dtStats.lastArmor = 0;
|
||||||
|
}
|
||||||
|
if(!%death){
|
||||||
|
%dtStats.ArmorTime[%size] = getSimTime();
|
||||||
|
%dtStats.lastArmor = %size;
|
||||||
|
}
|
||||||
|
//error(%dtStats.lArmorTime SPC %dtStats.mArmorTime SPC %dtStats.hArmorTime);
|
||||||
|
}
|
||||||
|
|
||||||
function clientKillStats(%game,%clVictim, %clKiller, %damageType, %implement, %damageLocation){
|
function clientKillStats(%game,%clVictim, %clKiller, %damageType, %implement, %damageLocation){
|
||||||
if(%damageType == $DamageType::Explosion || %damageType == $DamageType::Ground ||
|
if(%damageType == $DamageType::Explosion || %damageType == $DamageType::Ground ||
|
||||||
%damageType == $DamageType::OutOfBounds || %damageType == $DamageType::Lava ||
|
%damageType == $DamageType::OutOfBounds || %damageType == $DamageType::Lava ||
|
||||||
|
|
@ -5131,6 +5173,7 @@ function clientKillStats(%game,%clVictim, %clKiller, %damageType, %implement, %d
|
||||||
%victimPlayer = isObject(%clVictim.player) ? %clVictim.player : %clVictim.lastPlayer;
|
%victimPlayer = isObject(%clVictim.player) ? %clVictim.player : %clVictim.lastPlayer;
|
||||||
%killerPlayer = isObject(%clKiller.player) ? %clKiller.player : %clKiller.lastPlayer;
|
%killerPlayer = isObject(%clKiller.player) ? %clKiller.player : %clKiller.lastPlayer;
|
||||||
%clVictim.lp = "";//last position for distMove
|
%clVictim.lp = "";//last position for distMove
|
||||||
|
armorTimer(%victimDT, 0, 1);
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
%victimDT.timeToLive += getSimTime() - %clVictim.spawnTime;
|
%victimDT.timeToLive += getSimTime() - %clVictim.spawnTime;
|
||||||
%victimDT.timeTL = mFloor((%victimDT.timeToLive/(%clVictim.deaths+%clVictim.suicides ? %clVictim.deaths+%clVictim.suicides : 1))/1000);
|
%victimDT.timeTL = mFloor((%victimDT.timeToLive/(%clVictim.deaths+%clVictim.suicides ? %clVictim.deaths+%clVictim.suicides : 1))/1000);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue