From b6653683169cab026aafb732500a98c96f8fc6d0 Mon Sep 17 00:00:00 2001 From: Monsterovich Date: Sun, 24 Mar 2024 05:18:14 +0200 Subject: [PATCH] Buffed repair speed for wheels, hover and cyborgs --- data/mp/stats/propulsion.json | 9 ++++++--- src/droid.cpp | 2 ++ src/stats.cpp | 1 + src/statsdef.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/data/mp/stats/propulsion.json b/data/mp/stats/propulsion.json index ba0944f0056..9ae8c4f7108 100644 --- a/data/mp/stats/propulsion.json +++ b/data/mp/stats/propulsion.json @@ -32,7 +32,8 @@ "turnSpeed": 225, "type": "Legged", "usageClass": "Cyborg", - "weight": 50 + "weight": 50, + "repairFactor": 1.25 }, "HalfTrack": { "buildPoints": 75, @@ -106,7 +107,8 @@ "skidDeceleration": 120, "speed": 300, "type": "Hover", - "weight": 200 + "weight": 200, + "repairFactor": 1.5 }, "tracked01": { "buildPoints": 125, @@ -132,6 +134,7 @@ "skidDeceleration": 350, "speed": 175, "type": "Wheeled", - "weight": 300 + "weight": 300, + "repairFactor": 2 } } diff --git a/src/droid.cpp b/src/droid.cpp index c0e3f64269a..31c755d925b 100644 --- a/src/droid.cpp +++ b/src/droid.cpp @@ -1292,6 +1292,8 @@ static bool droidUpdateDroidRepairBase(DROID *psRepairDroid, DROID *psDroidToRep int iPointsToAdd = gameTimeAdjustedAverage(iRepairRateNumerator, iRepairRateDenominator); + iPointsToAdd = static_cast(std::round(iPointsToAdd * psDroidToRepair->getPropulsionStats()->repairFactor)); + psDroidToRepair->body = clip(psDroidToRepair->body + iPointsToAdd, 0, psDroidToRepair->originalBody); /* add plasma repair effect whilst being repaired */ diff --git a/src/stats.cpp b/src/stats.cpp index 32eba101284..b7e7bda40d7 100644 --- a/src/stats.cpp +++ b/src/stats.cpp @@ -822,6 +822,7 @@ bool loadPropulsionStats(WzConfig &ini) psStats->acceleration = ini.value("acceleration", 250).toInt(); ASSERT(psStats->acceleration != 0, "\"%s\".\"acceleration\" is 0", psStats->id.toUtf8().c_str()); psStats->deceleration = ini.value("deceleration", 800).toInt(); + psStats->repairFactor = ini.value("repairFactor", 1.0f).toFloat(); psStats->skidDeceleration = ini.value("skidDeceleration", 600).toInt(); psStats->pIMD = nullptr; psStats->pIMD = statsGetIMD(ini, psStats, "model"); diff --git a/src/statsdef.h b/src/statsdef.h index e47fc2bc40b..3b185a2f9ff 100644 --- a/src/statsdef.h +++ b/src/statsdef.h @@ -338,6 +338,7 @@ struct PROPULSION_STATS : public COMPONENT_STATS unsigned skidDeceleration = 0; unsigned deceleration = 0; unsigned acceleration = 0; + float repairFactor = 0; struct UPGRADE : COMPONENT_STATS::UPGRADE {