Skip to content
Closed
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 @@ -847,6 +847,7 @@ This page lists all the individual contributions to the project by their author.
- Allow beacon placement hotkey in single player
- Adjust recruitable status on team member discharge
- RA1-Style multi-turret and multi-barrel
- Allow other vehicles to attempt to move above the target like ZEP
- **solar-III (凤九歌)**
- Target scanning delay customization (documentation)
- Skip target scanning function calling for unarmed technos (documentation)
Expand Down
11 changes: 11 additions & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2437,6 +2437,17 @@ Harvester.CanGuardArea=false ; boolean
Harvester.CanGuardArea.RequireTarget=false ; boolean
```

### Allow other vehicles to attempt to move above the target like ZEP

- In vanilla, vehicles with `BalloonHover=yes` and a weapon with projectile with `Vertical=yes` will attempt to move above the target.
- Now you can make other vehicles do the same without `BalloonHover=yes` or `Vertical=yes`.

In `rulesmd.ini`:
```ini
[SOMEWEAPON] ; WeaponType
GoAboveTarget=false ; boolean
```

### Custom Unit Crate Reroll Chance

- It is possible to influence weighting of units given from crates (`CrateGoodie=true`) via `CrateGoodie.RerollChance`, which determines the chance that if this type of unit is rolled, it will reroll again for another type of unit.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ HideShakeEffects=false ; boolean
- [Show game time](User-Interface.md#show-game-time) (by Trsdy & Ollerus)
- Provided a toggle for whether the landing direction in default scenarios does not use the building direction but follows `[AudioVisual] -> PoseDir` (by Noble_Fish)
- [Separate the definitions of default direction for aircraft production and landing in the field](Fixed-or-Improved-Logics.md#separate-the-definitions-of-default-direction-for-aircraft-production-and-landing-in-the-field) (by Noble_Fish)
- Allow other vehicles to attempt to move above the target like ZEP (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
3 changes: 3 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/CREDITS.po
Original file line number Diff line number Diff line change
Expand Up @@ -2880,6 +2880,9 @@ msgstr "允许在单人模式下使用信标放置快捷键"
msgid "Adjust recruitable status on team member discharge"
msgstr "小队成员解散时调整可招募性"

msgid "Allow other vehicles to attempt to move above the target like ZEP"
msgstr "使其他单位也能像 ZEP 一样尝试移动到目标上方"

msgid "**solar-III (凤九歌)**"
msgstr "**solar-III(凤九歌)**"

Expand Down
15 changes: 15 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po
Original file line number Diff line number Diff line change
Expand Up @@ -5192,6 +5192,21 @@ msgstr ""
"若 `Harvester.CanGuardArea.RequireTarget` 设为 "
"true,当单位警戒范围内不存在有效目标时将会切换回通常所用的 `Havrest` 任务。"

msgid "Allow other vehicles to attempt to move above the target like ZEP"
msgstr "使其他单位也能像 ZEP 一样尝试移动到目标上方"

msgid ""
"In vanilla, vehicles with `BalloonHover=yes` and a weapon with projectile "
"with `Vertical=yes` will attempt to move above the target."
msgstr ""
"在原版中,拥有 `BalloonHover=yes` 且武器抛射体 `Vertical=yes` 的载具会尝试移动到目标上方。"

msgid ""
"Now you can make other vehicles do the same without `BalloonHover=yes` or "
"`Vertical=yes`."
msgstr ""
"现在你可以让其他载具无需 `BalloonHover=yes` 或 `Vertical=yes` 也能做到这点。"

msgid "Custom Unit Crate Reroll Chance"
msgstr "自定义单位箱子重新随机选取的概率"

Expand Down
6 changes: 6 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Whats-New.po
Original file line number Diff line number Diff line change
Expand Up @@ -2940,6 +2940,12 @@ msgid ""
"set to a value exceeding 256 (by Noble_Fish)"
msgstr "修复降落方向设为超出 256 的值时不能正确换算的 Bug(by Noble_Fish)"

msgid ""
"Allow other vehicles to attempt to move above the target like ZEP (by "
"TaranDahl)"
msgstr ""
"使其他单位也能像 ZEP 一样尝试移动到目标上方(by TaranDahl)"

msgid "Fixes / interactions with other extensions:"
msgstr "其他扩展引擎相关的修复/交互:"

Expand Down
18 changes: 18 additions & 0 deletions src/Ext/Unit/Hooks.Firing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,21 @@ DEFINE_HOOK(0x741A96, UnitClass_SetDestination_ResetFiringFrame, 0x6)

return 0;
}

DEFINE_HOOK(0x74159F, UnitClass_ApproachTarget_GoAboveTarget, 0x6)
{
GET(UnitClass* const, pThis, ESI);

if (const auto pTarget = pThis->Target)
{
const int weaponIndex = pThis->SelectWeapon(pTarget);

if (const auto pWeapon = pThis->GetWeapon(weaponIndex)->WeaponType)
{
if (WeaponTypeExt::Fetch(pWeapon)->GoAboveTarget)
return 0x7415E5;
}
}

return 0;
}
2 changes: 2 additions & 0 deletions src/Ext/WeaponType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ void WeaponTypeExt::LoadFromINIFile(CCINIClass* const pINI)
this->AttackCursorOnFriendlies.Read(exINI, pSection, "AttackCursorOnFriendlies");
this->AttackNoThreatBuildings.Read(exINI, pSection, "AttackNoThreatBuildings");
this->CylinderRangefinding.Read(exINI, pSection, "CylinderRangefinding");
this->GoAboveTarget.Read(exINI, pSection, "GoAboveTarget");
this->Anim_Update.Read(exINI, pSection, "Anim.Update");

// handle SkipWeaponPicking
Expand Down Expand Up @@ -305,6 +306,7 @@ void WeaponTypeExt::Serialize(T& Stm)
.Process(this->AttackCursorOnFriendlies)
.Process(this->AttackNoThreatBuildings)
.Process(this->CylinderRangefinding)
.Process(this->GoAboveTarget)
.Process(this->Anim_Update)
;
};
Expand Down
3 changes: 2 additions & 1 deletion src/Ext/WeaponType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class WeaponTypeExt final : public AbstractTypeExt
Nullable<bool> AttackFriendlies;
Nullable<bool> AttackCursorOnFriendlies;
Nullable<bool> AttackNoThreatBuildings;

Valueable<bool> GoAboveTarget;
Nullable<bool> Anim_Update;

bool SkipWeaponPicking;
Expand Down Expand Up @@ -204,6 +204,7 @@ class WeaponTypeExt final : public AbstractTypeExt
, AttackCursorOnFriendlies {}
, AttackNoThreatBuildings {}
, CylinderRangefinding {}
, GoAboveTarget { false }
, Anim_Update {}
{ }

Expand Down
Loading