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
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ This page lists all the individual contributions to the project by their author.
- Customize which parasite can remove by warhead
- Fix the bug that unit will play crashing voice & sound when dropped by warhead with `IsLocomotor=yes`
- Add toggle of whether shield use ArmorMultiplier or not
- 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 @@ -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)
- [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 @@ -1671,6 +1671,11 @@ msgid ""
msgstr ""
"添加了护盾是否使用护甲倍率的开关"

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 @@ -4918,6 +4918,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 @@ -1755,6 +1755,14 @@ msgstr "添加了护盾是否使用护甲倍率的开关(by NetsuNegi)"
msgid "Customize which parasite can remove by warhead (by NetsuNegi)"
msgstr "自定义哪些寄生者可被弹头移除(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