From ce2177ca51cbc0f2b4bc75c7a75d2e19fc515562 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Mon, 6 Apr 2020 17:48:01 -0400 Subject: [PATCH] Update zDarkTigerStats.cs Added some new variables Repair Variables --- Classic/scripts/autoexec/zDarkTigerStats.cs | 104 ++++++++++++++++++-- 1 file changed, 97 insertions(+), 7 deletions(-) diff --git a/Classic/scripts/autoexec/zDarkTigerStats.cs b/Classic/scripts/autoexec/zDarkTigerStats.cs index 1bd31c9..8219791 100644 --- a/Classic/scripts/autoexec/zDarkTigerStats.cs +++ b/Classic/scripts/autoexec/zDarkTigerStats.cs @@ -756,6 +756,26 @@ $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "shockHitMaxDist"; $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "scoutFlyerEK"; $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "bomberFlyerEK"; $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "hapcFlyerEK"; + + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "chatallCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "chatteamCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "kickCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "obstimeoutkickCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "spawnobstimeoutCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "voteCount"; + + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairgenCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairsolarpanelCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairsensorlargeCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairstationinvCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairstationvehCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairturretlargeCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairturretsentryCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairdepmotsensorCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairturretspiderclampCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairturretlandspikeCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairdepinvstationCount"; + $dtStats::FV[$dtStats::FC["dtStats"]++,"dtStats"] = "repairmpbteleCount"; /////////////////////////////////////////////////////////////////// $dtStats::uFC["dtStats"] = 0; // not saved but used to calculate other stats that are saved @@ -1229,6 +1249,9 @@ package dtStats{ function DefaultGame::forceObserver( %game, %client, %reason ){ parent::forceObserver( %game, %client, %reason ); if($dtStats::Enable){ + if(%reason $= "spawnTimeout"){ + %client.spawnobstimeoutCount++; + } %client.gt = %client.at = 0;//air time ground time reset } } @@ -1298,6 +1321,38 @@ package dtStats{ return false; } ////////////////////////////////////////////////////////////////////////////////// + function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ){ + if($dtStats::Enable){ + %sender.chatallCount++; + } + parent::chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ); + } + function chatMessageTeam( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ){ + if($dtStats::Enable){ + %sender.chatteamCount++; + } + parent::chatMessageTeam( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 ); + } + function kick( %client, %admin, %guid ){ + if($dtStats::Enable){ + %client.kickCount++; + } + parent::kick( %client, %admin, %guid ); + } + function cmdAutoKickObserver(%client, %key){ // Edit GG + parent::cmdAutoKickObserver(%client, %key); + if($dtStats::Enable){ + %client.obstimeoutkickCount++; + } + } + function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg){ + parent::playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %teamSpecific, %msg); + if($dtStats::Enable){ + %client.voteCount++; + } + } + ////////////////////////////////////////////////////////////////////////////////// + }; //helps with game types that override functions and dont use parent // that way we get called first then the gametype can do whatever @@ -1339,7 +1394,7 @@ package dtStatsGame{ clientDmgStats(%data,%position,%sourceObject,%targetObject, %damageType,%amount); parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC); } - //0 Fire 1 ??? 2 jump 3 jet 4 gernade 5 mine + //0 Fire 1 ??? 2 jump 3 jet 4 grenade 5 mine function Armor::onTrigger(%data, %player, %triggerNum, %val){ parent::onTrigger(%data, %player, %triggerNum, %val); if($dtStats::Enable){ @@ -1490,6 +1545,41 @@ package dtStatsGame{ } parent::flagCap(%game, %player); } + function CTFGame::staticShapeOnRepaired(%game, %obj, %objName){ + parent::staticShapeOnRepaired(%game, %obj, %objName); + if($dtStats::Enable){ + if (%game.testValidRepair(%obj) && isObject(%repairman)){ + switch$ (%dataName){ + case "GeneratorLarge": + %repairman.repairgenCount++; + case "SolarPanel": + %repairman.repairsolarpanelCount++; + case "SensorLargePulse" or "SensorMediumPulse": + %repairman.repairsensorlargeCount++; + case "StationInventory" or "StationAmmo": + %repairman.repairstationinvCount++; + case "StationVehicle": + %repairman.repairstationvehCount++; + case "TurretBaseLarge": + %repairman.repairturretlargeCount++; + case "SentryTurret": + %repairman.repairturretsentryCount++; + case "DeployedMotionSensor" or "DeployedPulseSensor": + %repairman.repairdepmotsensorCount++; + case "TurretDeployedWallIndoor" or "TurretDeployedFloorIndoor" or "TurretDeployedCeilingIndoor": + %repairman.repairturretspiderclampCount++; + case "TurretDeployedOutdoor": + %repairman.repairturretlandspikeCount++; + case "DeployedStationInventory": + %repairman.repairdepinvstationCount++; + case "MPBTeleporter": + %repairman.repairmpbteleCount++; + default: + return; + } + } + } + } }; function chkGrounded(%player){ @@ -2917,13 +3007,13 @@ function DefaultGame::postGameStats(%game,%client){ //stats to add up at the end %client.totalTime = ((getSimTime() - %client.joinTime)/1000)/60;//convert it to min - %client.cgScore = %client.cgKill + %client.cgMA + %client.cgKillAir + (%client.cgKillMaxDist/100) + %client.cgCom; + %dtStats.cgScore = (%dtStats.cgKill + %dtStats.cgMA + %dtStats.cgKillAir + (%dtStats.cgKillMaxDist/100) + %dtStats.cgCom) / 100; %client.discScore = %client.discKill + %client.discMA + %client.discKillAir + (%client.discKillMaxDist/100) + %client.discCom; %client.hGrenadeScore = %client.hGrenadeKill + %client.hGrenadeMA + %client.hGrenadeKillAir + (%client.hGrenadeKillMaxDist/20) + %client.hGrenadeCom; %client.grenadeScore = %client.grenadeKill + %client.grenadeMA + %client.grenadeKillAir + (%client.grenadeKillMaxDist/100) + %client.grenadeCom; %client.laserScore = %client.laserKill + %client.laserMA + %client.laserKillAir + (%client.laserKillMaxDist/250) + %client.laserCom + %client.laserHeadShot; %client.mortarScore = %client.mortarKill + %client.mortarMA + %client.mortarKillAir + (%client.mortarKillMaxDist/50) + %client.mortarCom; - %client.missileScore = %client.missileKill + %client.missileMA + %client.missileKillAir + (%client.missileKillMaxDist/500) + %client.missileCom; + %dtStats.missileScore = (%dtStats.missileKill+ %dtStats.missileMA + %dtStats.missileKillAir + (%dtStats.missileKillMaxDist/500)+ %dtStats.missileCom) / 10; %client.shockScore = %client.shockKill + %client.shockMA + %client.shockKillAir + (%client.shockKillMaxDist/2) + %client.shockCom + %client.shockRearShot; %client.plasmaScore = %client.plasmaKill + %client.plasmaMA + %client.plasmaKillAir + (%client.plasmaKillMaxDist/50) + %client.plasmaCom; %client.blasterScore = %client.blasterKill + %client.blasterMA + %client.blasterKillAir + (%client.blasterKillMaxDist/50) + %client.blasterCom; @@ -6554,10 +6644,10 @@ case "LBOARDS": %line = 'Longest Shot: %1Highest Speed: %2'; messageClient( %client, 'SetLineHud', "", %tag, %index++, %line,%i1,%i2,"weaponHitMaxDistMax-Longest Shot-Max Distance","maxSpeedMax-Highest Speed-Speed km/h",%vClient); - %i1 = getField($lData::data["discInDmg",%client.lgame,%lType,%mon,%year],0) ? getField($lData::name["discInDmg",%client.lgame,%lType,%mon,%year],0) : %NA; - %i2 = getField($lData::data["shotsFired",%client.lgame,%lType,%mon,%year],0) ? getField($lData::name["shotsFired",%client.lgame,%lType,%mon,%year],0) : %NA; - %line = 'Most Damage: %1Rounds Fired: %2'; - messageClient( %client, 'SetLineHud', "", %tag, %index++, %line,%i1,%i2,"discInDmg-Most Damage-Total","shotsFired-Most Rounds Fired-Total",%vClient); + %i1 = getField($lData::data["totalWepDmg",%client.lgame,%lType,%mon,%year],0) ? getField($lData::name["totalWepDmg",%client.lgame,%lType,%mon,%year],0) : %NA; + %i2 = getField($lData::data["shotsFired",%client.lgame,%lType,%mon,%year],0) ? getField($lData::name["shotsFired",%client.lgame,%lType,%mon,%year],0) : %NA; + %line = 'Most Damage: %1Rounds Fired: %2'; + messageClient( %client, 'SetLineHud', "", %tag, %index++, %line,%i1,%i2,"totalWepDmg-Most Damage-Total","shotsFired-Most Rounds Fired-Total",%vClient); %i1 = getField($lData::data["shockRearShot",%client.lgame,%lType,%mon,%year],0) ? getField($lData::name["shockRearShot",%client.lgame,%lType,%mon,%year],0) : %NA; %i2 = getField($lData::data["laserHeadShot",%client.lgame,%lType,%mon,%year],0) ? getField($lData::name["laserHeadShot",%client.lgame,%lType,%mon,%year],0) : %NA;