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 @@ -474,6 +474,7 @@ This page lists all the individual contributions to the project by their author.
- Fix the issue that technos cannot spawn survivors due to non-probabilistic reasons when the tech type was destroyed
- Fix the bug that vehicle survivor can spawn on wrong position when transport has been destroyed
- Fix the bug that if object has been removed from LogicClass in Update(), next object will be skip
- Customize reveal radius of `RevealToAll`
- **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 @@ -679,6 +679,16 @@ SpyEffect.VictimSuperWeapon= ; SuperWeaponType
SpyEffect.InfiltratorSuperWeapon= ; SuperWeaponType
```

### Customize reveal radius of `RevealToAll`

- In vanilla, `RevealToAll` is hardcoded to reveal area in radius is `Sight`. Now you can customize it.

In `rulesmd.ini`:
```ini
[SOMEBUILDING] ; BuildingType
RevealToAll.Radius= ; integer
```

## Infantry

### Customizable FLH when infantry is prone or deployed
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ New:
- Map Action [`511` Undeploy Building to Waypoint](AI-Scripting-and-Mapping.md#undeploy-building-to-waypoint), [`609` Set Radar Mode](AI-Scripting-and-Mapping.md#set-radar-mode), [`610` Set house's `TeamDelays` value](AI-Scripting-and-Mapping.md#set-house-s-teamdelays-value) (by FlyStar)
- Fixed an issue that rockets do not consider the destination altitude during climbing (by TaranDahl)
- Fixed the bug that if object has been removed from LogicClass in Update(), next object will be skip (by NetsuNegi)
- Customize reveal radius of `RevealToAll` (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
3 changes: 3 additions & 0 deletions src/Ext/BuildingType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ void BuildingTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)

this->BuildingRadioLink_SyncOwner.Read(exINI, pSection, "BuildingRadioLink.SyncOwner");

this->RevealToAll_Radius.Read(exINI, pSection, "RevealToAll.Radius");

// PlacementPreview
{
this->PlacementPreview.Read(exINI, pSection, "PlacementPreview");
Expand Down Expand Up @@ -348,6 +350,7 @@ void BuildingTypeExt::ExtData::Serialize(T& Stm)
.Process(this->HasPowerUpAnim)
.Process(this->UndeploysInto_Sellable)
.Process(this->BuildingRadioLink_SyncOwner)
.Process(this->RevealToAll_Radius)

// Ares 0.2
.Process(this->CloningFacility)
Expand Down
4 changes: 4 additions & 0 deletions src/Ext/BuildingType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class BuildingTypeExt

Nullable<bool> BuildingRadioLink_SyncOwner;

Nullable<int> RevealToAll_Radius;

// Ares 0.2
Valueable<bool> CloningFacility;

Expand Down Expand Up @@ -177,6 +179,8 @@ class BuildingTypeExt

, BuildingRadioLink_SyncOwner {}

, RevealToAll_Radius {}

// Ares 0.2
, CloningFacility { false }

Expand Down
26 changes: 26 additions & 0 deletions src/Ext/BuildingType/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,29 @@
}

#pragma endregion

DEFINE_HOOK(0x446816, BuildingClass_Place_RevealToAll_UpdateSight, 0x5)
{
enum { SkipGameCode = 0x44682F };

GET(BuildingClass*, pThis, EBP);
const auto pType = pThis->Type;
const auto pTypeExt = BuildingTypeExt::ExtMap.Find(pType);

const int radius = pTypeExt->RevealToAll_Radius.Get(pType->Sight);
pThis->UpdateSight(false, false, true, reinterpret_cast<DWORD>(HouseClass::CurrentPlayer), radius);
return SkipGameCode;
}

DEFINE_HOOK(0x446816, BuildingClass_Place_RevealToAll_UpdateSight, 0x5)

Check failure on line 446 in src/Ext/BuildingType/Hooks.cpp

View workflow job for this annotation

GitHub Actions / build

function 'DWORD BuildingClass_Place_RevealToAll_UpdateSight(REGISTERS *)' already has a body [D:\a\Phobos\Phobos\Phobos.vcxproj]

Check failure on line 446 in src/Ext/BuildingType/Hooks.cpp

View workflow job for this annotation

GitHub Actions / build

'hookdecl SyringeData::Hooks::_hk__0x446816BuildingClass_Place_RevealToAll_UpdateSight': redefinition [D:\a\Phobos\Phobos\Phobos.vcxproj]

Check failure on line 446 in src/Ext/BuildingType/Hooks.cpp

View workflow job for this annotation

GitHub Actions / build

'SyringeData::Hooks::_hk__0x446816BuildingClass_Place_RevealToAll_UpdateSight': redefinition; multiple initialization [D:\a\Phobos\Phobos\Phobos.vcxproj]
{
enum { SkipGameCode = 0x44682F };

GET(BuildingClass*, pThis, EBP);
const auto pType = pThis->Type;
const auto pTypeExt = BuildingTypeExt::ExtMap.Find(pType);

const int radius = pTypeExt->RevealToAll_Radius.Get(pType->Sight);
pThis->UpdateSight(false, false, true, reinterpret_cast<DWORD>(HouseClass::CurrentPlayer), radius);
return SkipGameCode;
}
Loading