Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ This page lists all the individual contributions to the project by their author.
- Fix the bug that if paradropping technos with `Crashable=yes` has been destroyed in air, they will falling down on ground but not dead
- Fix the bug where paradropped infantry with `NotHuman=yes` will ignore `Crashable=no` and crash on ground when killed in air
- Fix an issue where a unit might cause the target to fall from above its own head when using a locomotor warhead with `Locomotor=Jumpjet` to pull a target with `BalloonHover=yes`
- Fix the EIP#007120F7 caused when the `Strength` value is lower than `RepairStep`
- Allow the use of more precise calculation of repair costs
- **Apollo** - Translucent SHP drawing patches
- **ststl**:
- Customizable `ShowTimer` priority of superweapons
Expand Down
10 changes: 10 additions & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed the bug that if paradropping technos with `Crashable=yes` has been destroyed in air, they will falling down on ground but not dead.
- Fixed the bug where paradropped infantry with `NotHuman=yes` will ignore `Crashable=no` and crash on ground when killed in air.
- Fixed an issue where a unit might cause the target to fall from above its own head when using a locomotor warhead with `Locomotor=Jumpjet` to pull a target with `BalloonHover=yes`.
- Fixed the [EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7) that was triggered when repairing because the `Strength` value was lower than `RepairStep`.

## Fixes / interactions with other extensions

Expand Down Expand Up @@ -586,6 +587,15 @@ In `rulesmd.ini`:
ColorAddUse8BitRGB=false ; boolean
```

### Use more precise calculation of repair costs

- In vanilla, a calculation step for repairing technos performs a floor operation on the value after `Strength`/`RepairStep` and then uses it as a divisor for other calculations. This results in incorrect actual fund amounts. Now you can use a more precise cost calculation via the following flag.

```ini
[General]
FixRepairStepCost=false ; boolean
```

### Veinholes & Weeds

#### Veinholes
Expand Down
2 changes: 2 additions & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ New:
- [Implement `CurleyShuffle` for AircraftTypes](Fixed-or-Improved-Logics.md#implement-curleyshuffle-for-aircrafttypes) (ported from Vinifera by Noble_Fish)
- Customize which parasite can remove by warhead (by NetsuNegi)
- Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi)
- Allow the [use of more precise calculation of repair costs](Fixed-or-Improved-Logics.md#use-more-precise-calculation-of-repair-costs) (by NetsuNegi)

Vanilla fixes:
- Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya)
Expand Down Expand Up @@ -623,6 +624,7 @@ Vanilla fixes:
- Fixed the bug that if paradropping technos with `Crashable=yes` has been destroyed in air, they will falling down on ground but not dead (by NetsuNegi)
- Fixed the bug where paradropped infantry with `NotHuman=yes` will ignore `Crashable=no` and crash on ground when killed in air (by NetsuNegi)
- Fixed an issue where a unit might cause the target to fall from above its own head when using a locomotor warhead with `Locomotor=Jumpjet` to pull a target with `BalloonHover=yes` (by NetsuNegi)
- Fixed the [EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7) caused when the `Strength` value is lower than `RepairStep` (by NetsuNegi)

Phobos fixes:
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)
Expand Down
6 changes: 6 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/CREDITS.po
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,12 @@ msgid ""
msgstr ""
"修复了单位使用 `Locomotor=Jumpjet` 的运动模式弹头牵引拥有 `BalloonHover=yes` 的目标时可能使其从自己头顶下落的问题"

msgid "Fix the EIP#007120F7 caused when the `Strength` value is lower than `RepairStep`"
msgstr "修复了由于 `Strength` 值低于 `RepairStep` 时引发的 EIP#007120F7"

msgid "Allow the use of more precise calculation of repair costs"
msgstr "允许使用更精确的维修费用计算"

msgid "**Apollo** - Translucent SHP drawing patches"
msgstr "**Apollo** - 半透明 SHP 绘制补丁"

Expand Down
22 changes: 22 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,14 @@ msgid ""
msgstr ""
"修复了单位使用 `Locomotor=Jumpjet` 的运动模式弹头牵引拥有 `BalloonHover=yes` 的目标时可能使其从自己头顶下落的问题。"

msgid ""
"Fixed the "
"[EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7)"
" that was triggered when repairing because the `Strength` value was lower"
" than `RepairStep`."
msgstr ""
"修复了由于 `Strength` 值低于 `RepairStep` 而在维修时引发的 [EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7)。"

msgid "Fixes / interactions with other extensions"
msgstr "修复或与其他扩展的交互"

Expand Down Expand Up @@ -2147,6 +2155,20 @@ msgstr ""
"这适用于 `LaserTargetColor`、`IronCurtainColor`、`BerserkColor` 和 "
"`ForceShieldColor`。"

msgid "Use more precise calculation of repair costs"
msgstr "使用更精确的维修费用计算"

msgid ""
"In vanilla, a calculation step for repairing technos performs a floor "
"operation on the value after `Strength`/`RepairStep` and then uses it as "
"a divisor for other calculations. This results in incorrect actual fund "
"amounts. Now you can "
"use a more precise cost calculation via the following flag."
msgstr ""
"在原版中,维修单位时的一个计算步骤在 `Strength`/`RepairStep` 后将该值向下取整"
"再作为其他计算的除数,以至于实际的资金数额计算不正确。现在你可以通过下面的语句使用更"
"精确的费用计算。"

msgid "Veinholes & Weeds"
msgstr "泰伯利亚藤蔓与泰伯利亚废矿"

Expand Down
14 changes: 14 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Whats-New.po
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,20 @@ msgstr "自定义哪些寄生者可被弹头移除(by NetsuNegi)"
msgid "Add toggle of whether shield use ArmorMultiplier or not (by NetsuNegi)"
msgstr "添加了护盾是否使用护甲倍率的开关(by NetsuNegi)"

msgid ""
"Allow the [use of more precise calculation of repair costs](Fixed-or-"
"Improved-Logics.md#use-more-precise-calculation-of-repair-costs) (by "
"NetsuNegi)"
msgstr ""
"允许 [使用更精确的维修费用计算](Fixed-or-Improved-Logics.md#use-more-precise-calculation-of-repair-costs)(by NetsuNegi)"

msgid ""
"Fixed the "
"[EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7)"
" caused when the `Strength` value is lower than `RepairStep` (by NetsuNegi)"
msgstr ""
"修复了由于 `Strength` 值低于 `RepairStep` 时引发的 [EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7)(by NetsuNegi)"

msgid "Vanilla fixes:"
msgstr "原版问题修复:"

Expand Down
3 changes: 3 additions & 0 deletions src/Ext/Rules/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI)
this->AIAllToHunt.Read(exINI, GameStrings::General, "AIAllToHunt");
this->RepairBaseNodes.Read(exINI, GameStrings::Basic, "RepairBaseNodes");

this->FixRepairStepCost.Read(exINI, GameStrings::General, "FixRepairStepCost");

this->WarheadParticleAlphaImageIsLightFlash.Read(exINI, GameStrings::AudioVisual, "WarheadParticleAlphaImageIsLightFlash");
this->CombatLightDetailLevel.Read(exINI, GameStrings::AudioVisual, "CombatLightDetailLevel");
this->LightFlashAlphaImageDetailLevel.Read(exINI, GameStrings::AudioVisual, "LightFlashAlphaImageDetailLevel");
Expand Down Expand Up @@ -624,6 +626,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
.Process(this->AIFireSaleDelay)
.Process(this->AIAllToHunt)
.Process(this->RepairBaseNodes)
.Process(this->FixRepairStepCost)
.Process(this->WarheadParticleAlphaImageIsLightFlash)
.Process(this->CombatLightDetailLevel)
.Process(this->LightFlashAlphaImageDetailLevel)
Expand Down
3 changes: 3 additions & 0 deletions src/Ext/Rules/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ class RulesExt
Valueable<bool> AIAllToHunt;
Valueable<bool> RepairBaseNodes;

Valueable<bool> FixRepairStepCost;

Valueable<bool> WarheadParticleAlphaImageIsLightFlash;
Valueable<int> CombatLightDetailLevel;
Valueable<int> LightFlashAlphaImageDetailLevel;
Expand Down Expand Up @@ -512,6 +514,7 @@ class RulesExt
, AIFireSaleDelay { 0 }
, AIAllToHunt { true }
, RepairBaseNodes { false }
, FixRepairStepCost { false }
, WarheadParticleAlphaImageIsLightFlash { false }
, CombatLightDetailLevel { 0 }
, LightFlashAlphaImageDetailLevel { 0 }
Expand Down
15 changes: 15 additions & 0 deletions src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3260,3 +3260,18 @@ DEFINE_HOOK(0x54B3E7, JumpjetLocomotionClass_Move_To_LocomotorWarheadFix, 0x5)
{
return ImbueLocomotorTemp::Imbuing ? 0x54B3FC : 0;
}

DEFINE_HOOK(0x7120DD, TechnoTypeClass_GetRepairStepCost, 0x6)
{
enum { SkipGameCode = 0x71210C };

GET(TechnoTypeClass*, pType, ESI);
GET(int, cost, EAX);

if (RulesExt::Global()->FixRepairStepCost)
R->EAX(static_cast<int>((cost / std::max(static_cast<double>(pType->Strength) / RulesClass::Instance->RepairStep, 1.0)) * RulesClass::Instance->RepairPercent));
else
R->EAX(static_cast<int>((cost / std::max(pType->Strength / RulesClass::Instance->RepairStep, 1))* RulesClass::Instance->RepairPercent));

return SkipGameCode;
}
Loading