diff --git a/CREDITS.md b/CREDITS.md index 0ba36abe22..445e2d0dae 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -573,6 +573,7 @@ This page lists all the individual contributions to the project by their author. - Skip target scanning function calling for unarmed technos (code) - Force techno targeting in distributed frames to improve performance - Use `SkipCrushSlowdown=true` to avoid the bug related to `Accelerates=true` and `MovementZone=CrushAll` + - Customize the chained damage of the wall - **solar-III (凤九歌)** - Target scanning delay customization (documentation) - Skip target scanning function calling for unarmed technos (documentation) diff --git a/Phobos.vcxproj b/Phobos.vcxproj index 0f18342d27..0776ddb5c5 100644 --- a/Phobos.vcxproj +++ b/Phobos.vcxproj @@ -18,6 +18,7 @@ + diff --git a/YRpp b/YRpp index a8c3f616b8..1d715b4954 160000 --- a/YRpp +++ b/YRpp @@ -1 +1 @@ -Subproject commit a8c3f616b8b421bd8b806cf90e560ec59355fd05 +Subproject commit 1d715b4954756b5d0ee20ffd34488ee5bc5bf2b7 diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index dda05e64e1..1e59faf0e3 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -694,6 +694,19 @@ ProneSpeed.NoCrawls=1.5 ; floating point value, multiplier ProneSpeed= ; floating point value, multiplier, by default, use the corresponding global value according to Crawls ``` +## Overlays + +### Customize the chained damage of the wall + +- In vanilla, when the wall is damaged, it will deal 200 damage to the walls in the 4 nearby cells. This makes connected walls more vulnerable to damage compared to single walls. +- Now you can customize that damage by using the following flag. + +In `rulesmd.ini`: +```ini +[CombatDamage] +AdjacentWallDamage=200 ; integer +``` + ## Particle systems ### Fire particle target coordinate adjustment when firer rotates diff --git a/docs/Whats-New.md b/docs/Whats-New.md index ebc79976ad..9e4e48e417 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -426,6 +426,7 @@ New: - [Damaged aircraft image changes](New-or-Enhanced-Logics.md#damaged-aircraft-image-changes) (by Fryone) - [Additional attached animation position customizations](Fixed-or-Improved-Logics.md#attached-animation-position-customization) (by Starkku) - Use `SkipCrushSlowdown=true` to avoid the bug related to `Accelerates=true` and `MovementZone=CrushAll` (by TaranDahl) +- Customize the chained damage of the wall (by TaranDahl) Vanilla fixes: - Fixed sidebar not updating queued unit numbers when adding or removing units when the production is on hold (by CrimRecya) diff --git a/src/Ext/Cell/Body.h b/src/Ext/Cell/Body.h index 41689b9e9e..fc1dfae4d8 100644 --- a/src/Ext/Cell/Body.h +++ b/src/Ext/Cell/Body.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include diff --git a/src/Ext/Cell/Hooks.cpp b/src/Ext/Cell/Hooks.cpp new file mode 100644 index 0000000000..3472a5f499 --- /dev/null +++ b/src/Ext/Cell/Hooks.cpp @@ -0,0 +1,11 @@ +#include "Body.h" + +#include + +DEFINE_HOOK(0x480EA8, CellClass_DamageWall_AdjacentWallDamage, 0x7) +{ + enum{ SkipGameCode = 0x480EB4 }; + GET(CellClass*, pThis, EAX); + pThis->DamageWall(RulesExt::Global()->AdjacentWallDamage); + return SkipGameCode; +} diff --git a/src/Ext/Rules/Body.cpp b/src/Ext/Rules/Body.cpp index 869b2e39ae..61dd154ab0 100644 --- a/src/Ext/Rules/Body.cpp +++ b/src/Ext/Rules/Body.cpp @@ -295,6 +295,8 @@ void RulesExt::ExtData::LoadBeforeTypeData(RulesClass* pThis, CCINIClass* pINI) this->PlayerAttackMoveTargetingDelay.Read(exINI, GameStrings::General, "PlayerAttackMoveTargetingDelay"); this->DistributeTargetingFrame.Read(exINI, GameStrings::General, "DistributeTargetingFrame"); this->DistributeTargetingFrame_AIOnly.Read(exINI, GameStrings::General, "DistributeTargetingFrame.AIOnly"); + + this->AdjacentWallDamage.Read(exINI, GameStrings::CombatDamage, "AdjacentWallDamage"); // Section AITargetTypes int itemsCount = pINI->GetKeyCount("AITargetTypes"); @@ -546,6 +548,7 @@ void RulesExt::ExtData::Serialize(T& Stm) .Process(this->TintColorBerserk) .Process(this->AttackMove_IgnoreWeaponCheck) .Process(this->AttackMove_StopWhenTargetAcquired) + .Process(this->AdjacentWallDamage) ; } diff --git a/src/Ext/Rules/Body.h b/src/Ext/Rules/Body.h index 02d079ba0b..3439adf78f 100644 --- a/src/Ext/Rules/Body.h +++ b/src/Ext/Rules/Body.h @@ -244,6 +244,8 @@ class RulesExt Valueable AttackMove_IgnoreWeaponCheck; Nullable AttackMove_StopWhenTargetAcquired; + Valueable AdjacentWallDamage; + // cache tint color int TintColorIronCurtain; int TintColorForceShield; @@ -441,6 +443,8 @@ class RulesExt , AttackMove_IgnoreWeaponCheck { false } , AttackMove_StopWhenTargetAcquired { } + + , AdjacentWallDamage { 200 } { } virtual ~ExtData() = default;