ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.
RepairPercent: Difference between revisions
Jump to navigation
Jump to search
De-DZed |
m For some reason I never actually removed the text from DZ's guide and it was just floating at the bottom of the page. |
||
(One intermediate revision by one other user not shown) | |||
Line 8: | Line 8: | ||
|ra2=yes | |ra2=yes | ||
|yr=yes | |yr=yes | ||
}} | }} | ||
This flag controls how much it costs to repair [[VehicleTypes]] docked with a [[BuildingType]] with {{ | This flag controls how much it costs to repair [[VehicleTypes]] docked with a [[BuildingType]] with {{f|UnitRepair|yes|link}} set, and BuildingTypes that are being repaired using a gameplay function (the "wrench" tool). | ||
The cost to recover {{ | The cost to recover {{f|RepairStep|link}} hitpoints every {{f|RepairRate|link}} minutes can be calculated by the following formula{{fnl|1}}: | ||
<pre>"repair step cost" = RepairPercent * ( Cost / ( Strength / RepairStep) )</pre> | <pre>"repair step cost" = RepairPercent * ( Cost / ( Strength / RepairStep) )</pre> | ||
Line 25: | Line 24: | ||
==References== | ==References== | ||
* {{SourceCode|http://dc.strategy-x.com/src2/TechnoTypeClass/GetRepairStepCost.cpp}} | * {{SourceCode|http://dc.strategy-x.com/src2/TechnoTypeClass/GetRepairStepCost.cpp}} | ||
Latest revision as of 01:14, 29 November 2009
Flag: | RepairPercent |
File(s): | rules(md).ini |
Values: | Percentages: Either a direct percentage (e.g. "50%"), or a floating point value (e.g. "0.5"). |
Default: | 25% |
Applicable to: | General |
This flag controls how much it costs to repair VehicleTypes docked with a BuildingType with UnitRepair=yes set, and BuildingTypes that are being repaired using a gameplay function (the "wrench" tool).
The cost to recover RepairStep hitpoints every RepairRate minutes can be calculated by the following formula1:
"repair step cost" = RepairPercent * ( Cost / ( Strength / RepairStep) )
If the result is a floating point value, all decimal places are ignored. Also, if the result is less than 1, it is bumped up to 1.
Notes
1 ↑ The division done in this formula is integer division, which means that any decimal places will be knocked off; i.e. 5/2 = 2, not 2.5.
References
- Relevant pseudocode is available at http://dc.strategy-x.com/src2/TechnoTypeClass/GetRepairStepCost.cpp.