Skip to content

Commit

Permalink
Merge branch 'develop' into develop-Mix4BEtest
Browse files Browse the repository at this point in the history
  • Loading branch information
CrimRecya committed Dec 23, 2024
2 parents 96976a4 + fa48f61 commit e091ded
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ This page lists all the individual contributions to the project by their author.
- Ares' `SW.Shots` hint on extended tooltips
- Ares' Abductor weapon fix
- Suppress Ares' swizzle warning when parsing tags and taskforces
- Better fix for Ares academy not working on the initial payloads of vehicles built from a war factory
- Misc code refactor & maintenance, CN doc fixes, bugfixes
- **FlyStar**
- Campaign load screen PCX support
Expand Down Expand Up @@ -400,6 +401,7 @@ This page lists all the individual contributions to the project by their author.
- Global value of `RepairBaseNodes`
- Units are now unable to kick out from a factory that is in construction process
- **tyuah8** - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
- **Aephiex** - initial fix for Ares academy not working on the initial payloads of vehicles built from a war factory
- **Ares developers**
- YRpp and Syringe which are used, save/load, project foundation and generally useful code from Ares
- unfinished RadTypes code
Expand Down
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed an issue introduced by Ares that caused `Grinding=true` building `ActiveAnim` to be incorrectly restored while `SpecialAnim` was playing and the building was sold, erased or destroyed.
- Fixed Ares' Abductor weapon leaves permanent placement stats when abducting moving vehicles.
- Suppressed Ares' swizzle warning when parsing `Tags` and `TaskForces` (typically begin with `[Developer fatal]Pointer 00000000 declared change to both`).
- Fixed Academy *(Ares feature)* not working on the initial payloads *(Ares feature)* of vehicles built from a war factory.

## Aircraft

Expand Down
2 changes: 1 addition & 1 deletion docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This page describes all the engine features that are either new and introduced b
- `Crit.AllowWarheads` can be used to list only Warheads that can benefit from this critical hit chance multiplier and `Crit.DisallowWarheads` weapons that are not allowed to, respectively.
- `RevengeWeapon` can be used to temporarily grant the specified weapon as a [revenge weapon](#revenge-weapon) for the attached object.
- `RevengeWeapon.AffectsHouses` customizes which houses can trigger the revenge weapon.
- `ReflectDamage` can be set to true to have any positive damage dealt to the object the effect is attached to be reflected back to the attacker. `ReflectDamage.Warhead` determines which Warhead is used to deal the damage, defaults to `[CombatDamage]`->`C4Warhead`. If `ReflectDamage.Warhead` is set to true, the Warhead is fully detonated instead of used to simply deal damage. `ReflectDamage.Multiplier` is a multiplier to the damage received and then reflected back. Already reflected damage cannot be further reflected back.
- `ReflectDamage` can be set to true to have any positive damage dealt to the object the effect is attached to be reflected back to the attacker. `ReflectDamage.Warhead` determines which Warhead is used to deal the damage, defaults to `[CombatDamage]`->`C4Warhead`. If `ReflectDamage.Warhead.Detonate` is set to true, the Warhead is fully detonated instead of used to simply deal damage. `ReflectDamage.Multiplier` is a multiplier to the damage received and then reflected back. Already reflected damage cannot be further reflected back.
- Warheads can prevent reflect damage from occuring by setting `SuppressReflectDamage` to true. `SuppressReflectDamage.Types` can control which AttachEffectTypes' reflect damage is suppressed, if none are listed then all of them are suppressed.
- `DisableWeapons` can be used to disable ability to fire any and all weapons.
- On TechnoTypes with `OpenTopped=true`, `OpenTopped.CheckTransportDisableWeapons` can be set to true to make passengers not be able to fire out if transport's weapons are disabled by `DisableWeapons`.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ Fixes / interactions with other extensions:
- Appended Ares' `SW.Shots` usage to extended tooltips (by Trsdy)
- Fixed Ares' Abductor weapon leaves permanent placement stats when abducting moving vehicles (by Trsdy)
- Suppressed Ares' swizzle warning when parsing `Tags` and `TaskForces` (by Trsdy)
- Fixed Academy *(Ares feature)* not working on the initial payloads *(Ares feature)* of vehicles built from a war factory (by Trsdy, supersedes Aephiex impl.)
</details>
### 0.3.0.1
Expand Down
15 changes: 15 additions & 0 deletions src/Misc/Hooks.Ares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ DEFINE_HOOK(0x44E9FA, BuildingClass_Detach_RestoreAnims, 0x6)
// Patches presented here are exceptions rather that the rule. They must be short, concise and correct.
// DO NOT POLLUTE ISSUEs and PRs.

ObjectClass* __fastcall CreateInitialPayload(TechnoTypeClass* type, void*, HouseClass* owner)
{
// temporarily reset the mutex since it's not part of the design
int mutex_old = std::exchange(Unsorted::IKnowWhatImDoing(), 0);
auto instance = type->CreateObject(owner);
Unsorted::IKnowWhatImDoing = mutex_old;
return instance;
}

void Apply_Ares3_0_Patches()
{
// Abductor fix:
Expand All @@ -36,6 +45,9 @@ void Apply_Ares3_0_Patches()
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x62267, &Helpers::Alex::getCellSpreadItems);
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x528C8, &Helpers::Alex::getCellSpreadItems);
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x5273A, &Helpers::Alex::getCellSpreadItems);

// InitialPayload creation:
Patch::Apply_CALL6(AresHelper::AresBaseAddress + 0x43D5D, &CreateInitialPayload);
}

void Apply_Ares3_0p1_Patches()
Expand All @@ -49,4 +61,7 @@ void Apply_Ares3_0p1_Patches()
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x62FB7, &Helpers::Alex::getCellSpreadItems);
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x53578, &Helpers::Alex::getCellSpreadItems);
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x533EA, &Helpers::Alex::getCellSpreadItems);

// InitialPayload creation:
Patch::Apply_CALL6(AresHelper::AresBaseAddress + 0x4483D, &CreateInitialPayload);
}

0 comments on commit e091ded

Please sign in to comment.