Skip to content

Customize the chained damage of the wall #1776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
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 @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Ext\Cell\Hooks.cpp" />
<ClCompile Include="src\Ext\Infantry\Hooks.cpp" />
<ClCompile Include="src\Ext\Infantry\Hooks.Firing.cpp" />
<ClCompile Include="src\Ext\TechnoType\Hooks.MultiWeapon.cpp" />
Expand Down
2 changes: 1 addition & 1 deletion YRpp
Submodule YRpp updated 1 files
+3 −0 CellClass.h
13 changes: 13 additions & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Ext/Cell/Body.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include <CellClass.h>

#include <Helpers/Macro.h>
#include <Utilities/Container.h>
#include <Utilities/Constructs.h>
#include <Utilities/Template.h>
Expand Down
11 changes: 11 additions & 0 deletions src/Ext/Cell/Hooks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "Body.h"

#include <Ext/Rules/Body.h>

DEFINE_HOOK(0x480EA8, CellClass_DamageWall_AdjacentWallDamage, 0x7)
{
enum{ SkipGameCode = 0x480EB4 };
GET(CellClass*, pThis, EAX);
pThis->DamageWall(RulesExt::Global()->AdjacentWallDamage);
return SkipGameCode;
}
3 changes: 3 additions & 0 deletions src/Ext/Rules/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -546,6 +548,7 @@ void RulesExt::ExtData::Serialize(T& Stm)
.Process(this->TintColorBerserk)
.Process(this->AttackMove_IgnoreWeaponCheck)
.Process(this->AttackMove_StopWhenTargetAcquired)
.Process(this->AdjacentWallDamage)
;
}

Expand Down
4 changes: 4 additions & 0 deletions src/Ext/Rules/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ class RulesExt
Valueable<bool> AttackMove_IgnoreWeaponCheck;
Nullable<bool> AttackMove_StopWhenTargetAcquired;

Valueable<int> AdjacentWallDamage;

// cache tint color
int TintColorIronCurtain;
int TintColorForceShield;
Expand Down Expand Up @@ -441,6 +443,8 @@ class RulesExt

, AttackMove_IgnoreWeaponCheck { false }
, AttackMove_StopWhenTargetAcquired { }

, AdjacentWallDamage { 200 }
{ }

virtual ~ExtData() = default;
Expand Down