Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 technotypes
- **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 @@ -2320,6 +2320,16 @@ FireUp= ; integer
FireUp.ResetInRetarget=true ; boolean
```

### 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
```

## Warheads

```{hint}
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 technotypes (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
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