Skip to content

Commit

Permalink
Buffed repair speed for wheels, hover and cyborgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Mar 24, 2024
1 parent c7b19ff commit b665368
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions data/mp/stats/propulsion.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"turnSpeed": 225,
"type": "Legged",
"usageClass": "Cyborg",
"weight": 50
"weight": 50,
"repairFactor": 1.25
},
"HalfTrack": {
"buildPoints": 75,
Expand Down Expand Up @@ -106,7 +107,8 @@
"skidDeceleration": 120,
"speed": 300,
"type": "Hover",
"weight": 200
"weight": 200,
"repairFactor": 1.5
},
"tracked01": {
"buildPoints": 125,
Expand All @@ -132,6 +134,7 @@
"skidDeceleration": 350,
"speed": 175,
"type": "Wheeled",
"weight": 300
"weight": 300,
"repairFactor": 2
}
}
2 changes: 2 additions & 0 deletions src/droid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,8 @@ static bool droidUpdateDroidRepairBase(DROID *psRepairDroid, DROID *psDroidToRep

int iPointsToAdd = gameTimeAdjustedAverage(iRepairRateNumerator, iRepairRateDenominator);

iPointsToAdd = static_cast<int>(std::round(iPointsToAdd * psDroidToRepair->getPropulsionStats()->repairFactor));

psDroidToRepair->body = clip<UDWORD>(psDroidToRepair->body + iPointsToAdd, 0, psDroidToRepair->originalBody);

/* add plasma repair effect whilst being repaired */
Expand Down
1 change: 1 addition & 0 deletions src/stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions src/statsdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit b665368

Please sign in to comment.