Skip to content
Merged
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
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ This page lists all the individual contributions to the project by their author.
- Fix the EIP#007120F7 caused when the `Strength` value is lower than `RepairStep`
- Allow the use of more precise calculation of repair costs
- Fix the initial direction of building placed by Ares's UnitDelivery superweapon
- Customize default mirage disguises per vehicletypes
- **Apollo** - Translucent SHP drawing patches
- **ststl**:
- Customizable `ShowTimer` priority of superweapons
Expand Down
10 changes: 10 additions & 0 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 +2267,16 @@ WaterImage.ConditionRed= ; VehicleType entry
Note that the VehicleTypes had to be defined under [VehicleTypes] and use same image type (SHP/VXL) for vanilla/damaged states.
```

### Default mirage disguise for individual VehicleTypes

- Vehicle can now have its `DefaultMirageDisguises` overridden per-type.

In `rulesmd.ini`:
```ini
[SOMEVEHICLE] ; VehicleType
DefaultMirageDisguises= ; List of TerrainTypes
```

### Independent SHP Vehicle Turret Files

- SHP turret vehicles support the use of `*tur.shp` files.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ New:
- 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)
- [Customize default mirage disguises per vehicletypes](New-or-Enhanced-Logics.md#default-mirage-disguise-for-individual-vehicletypes) (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
5 changes: 5 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/CREDITS.po
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,11 @@ msgid ""
msgstr ""
"修复了 Ares 的单位投放超级武器投放的建筑物的初始朝向"

msgid ""
"Customize default mirage disguises per vehicletypes"
msgstr ""
"为每个载具类型单独定义默认的幻影伪装类型"

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

Expand Down
6 changes: 6 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po
Original file line number Diff line number Diff line change
Expand Up @@ -4922,6 +4922,12 @@ msgid ""
" same image type (SHP/VXL) for vanilla/damaged states."
msgstr "注意这些被使用的载具必须在 `[VehicleTypes]` 下注册并且在常规/伤残状态下使用相同的图像类型(Shape/Voxel)。"

msgid "Default mirage disguise for individual VehicleTypes"
msgstr "载具类型默认幻影伪装"

msgid "Vehicle can now have its `DefaultMirageDisguises` overridden per-type."
msgstr "现在可以单独为每个载具类型设置其 `DefaultMirageDisguises`。"

msgid "Independent SHP Vehicle Turret Files"
msgstr "独立的 Shape 载具炮塔文件"

Expand Down
8 changes: 8 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Whats-New.po
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,14 @@ msgid ""
msgstr ""
"修复了由于 `Strength` 值低于 `RepairStep` 时引发的 [EIP#007120F7](https://modenc.renegadeprojects.com/Internal_Error#eip_007120F7)(by NetsuNegi)"

msgid ""
"[Customize default mirage disguises per vehicletypes](New-or-Enhanced-"
"Logics.md#default-mirage-disguise-for-individual-vehicletypes) (by "
"NetsuNegi)"
msgstr ""
"[为每个载具类型单独定义默认的幻影伪装类型](New-or-Enhanced-Logics.md#"
"default-mirage-disguise-for-individual-vehicletypes)(by NetsuNegi)"

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

Expand Down
15 changes: 15 additions & 0 deletions src/Ext/Techno/Hooks.Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,21 @@ DEFINE_HOOK(0x522790, InfantryClass_ClearDisguise_DefaultDisguise, 0x6)
return 0;
}

DEFINE_HOOK(0x746A30, UnitClass_UpdateDisguise_DefaultMirageDisguises, 0x5)
{
enum { Apply = 0x746A6C };

GET(UnitClass*, pThis, ESI);
const auto& disguises = TechnoTypeExt::ExtMap.Find(pThis->Type)->DefaultMirageDisguises.GetElements(RulesClass::Instance->DefaultMirageDisguises);
TerrainTypeClass* pDisguiseAs = nullptr;

if (const int size = static_cast<int>(disguises.size()))
pDisguiseAs = disguises[ScenarioClass::Instance->Random.RandomRanged(0, size - 1)];

R->EAX(pDisguiseAs);
return Apply;
}

DEFINE_HOOK(0x74691D, UnitClass_UpdateDisguise_EMP, 0x6)
{
GET(UnitClass*, pThis, ESI);
Expand Down
2 changes: 2 additions & 0 deletions src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->NotHuman_RandomDeathSequence.Read(exINI, pSection, "NotHuman.RandomDeathSequence");

this->DefaultDisguise.Read(exINI, pSection, "DefaultDisguise");
this->DefaultMirageDisguises.Read(exINI, pSection, "DefaultMirageDisguises");
this->UseDisguiseMovementSpeed.Read(exINI, pSection, "UseDisguiseMovementSpeed");

this->OpenTopped_RangeBonus.Read(exINI, pSection, "OpenTopped.RangeBonus");
Expand Down Expand Up @@ -1566,6 +1567,7 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
.Process(this->DestroyAnim_Random)
.Process(this->NotHuman_RandomDeathSequence)
.Process(this->DefaultDisguise)
.Process(this->DefaultMirageDisguises)
.Process(this->UseDisguiseMovementSpeed)
.Process(this->WeaponBurstFLHs)
.Process(this->EliteWeaponBurstFLHs)
Expand Down
1 change: 1 addition & 0 deletions src/Ext/TechnoType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class TechnoTypeExt
Valueable<bool> NotHuman_RandomDeathSequence;

Valueable<InfantryTypeClass*> DefaultDisguise;
NullableVector<TerrainTypeClass*> DefaultMirageDisguises;
Valueable<bool> UseDisguiseMovementSpeed;

Nullable<int> OpenTopped_RangeBonus;
Expand Down
Loading