Skip to content

Detonate Ivan Bombs placed by the attacker using custom warhead. - #2365

Open
dh381-1 wants to merge 12 commits into
Phobos-developers:developfrom
dh381-1:develop
Open

Detonate Ivan Bombs placed by the attacker using custom warhead.#2365
dh381-1 wants to merge 12 commits into
Phobos-developers:developfrom
dh381-1:develop

Conversation

@dh381-1

@dh381-1 dh381-1 commented Aug 23, 2026

Copy link
Copy Markdown

What kind of change is this?

  • New feature, vanilla bugfix or enhancement of a released feature - changelog, docs and credits entries are needed.
  • Improvement to a new (unreleased) feature - docs and credits entries are needed; no changelog entry (Skip Changelog).
  • Bugfix to a new (unreleased) feature - credits entry is needed; no changelog or docs entries (Skip Changelog, Skip Docs).
  • Bugfix to an old (released) feature - changelog and credits entries are needed; no docs entry (Skip Docs).
  • Completely minor change (e.g. a typo fix) - no entries are needed (Skip Changelog, Skip Docs, Skip Credits).

Description

  • Now you can detonate planted Ivan bombs using custom warhead. The bomb attached to the targeted unit will explode immediately, provided that it was planted by the attacker.

In rulesmd.ini:

[SOMEWARHEAD]               ; WarheadType
IvanBomb.Detonate=true     ; boolean

@phoboscn-bot

Copy link
Copy Markdown

To Chinese users:
This pull request has been mentioned on Phobos CN. There might be relevant details there:

致中文用户:
此拉取请求已在 Phobos CN 上被提及。那里可能有相关详细信息:

https://www.phoboscn.top/t/topic/725/14

@phoboscn-bot

Copy link
Copy Markdown

To Chinese users:
This pull request has been mentioned on Phobos CN. There might be relevant details there:

致中文用户:
此拉取请求已在 Phobos CN 上被提及。那里可能有相关详细信息:

https://www.phoboscn.top/t/topic/739/1

Comment thread src/Ext/Techno/Hooks.WeaponEffects.cpp Outdated

DEFINE_HOOK(0x702D19, TechnoClass_ReceiveDamage_IvanBombDetonate, 0x6)
{
GET(ObjectClass*, pThis, ESI);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pThis should be TechnoClass*. Besides, register esi has been popped here, I think you should not use it.
pThis 应该是 TechnoClass*。另外,ESI寄存器在此处已被弹出,我认为你不该用它。

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After changing the hook location,register esi can be used
换了一个hook位置,ESI寄存器现在就可以用了

@github-actions

Copy link
Copy Markdown

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

In `rulesmd.ini`:
```ini
[SOMEWEAPON] ; WeaponType
IvanBomb.Detonate=true ; Enable bomb detonation (true/false), default: false.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
IvanBomb.Detonate=true ; Enable bomb detonation (true/false), default: false.
IvanBomb.Detonate=false ; boolean

If there is a fixed default value, it should be placed as the value on the right side of the equals sign; only the value type should be written after the semicolon.

@dh381-1 dh381-1 changed the title Detonate Ivan Bombs placed by the attacker using custom weapons. Detonate Ivan Bombs placed by the attacker using custom warhead. Aug 24, 2026
Comment thread src/Ext/WeaponType/Body.h
bool SkipWeaponPicking;

Nullable<bool> CylinderRangefinding;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this ?


if(auto pBomb = pThis->AttachedBomb)
{
if(auto pSourceExt = TechnoExt::TryFetch(pSource))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(auto pSourceExt = TechnoExt::TryFetch(pSource))
if(auto pSourceExt = TechnoExt::Fetch(pSource))

No need use TryFetch here, you had checked pSource before.
这里不需要使用 TryFetch,你在前面已经检查过 pSource 了。

@NetsuNegi

Copy link
Copy Markdown
Contributor

Other codes looking good

@Coronia Coronia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't have to be restricted to the owner's bomb. It would also be useful if another unit could detonate it. Something like this:

IvanBomb.Detonate.InvokerOnly -> whether it can only affect your own bomb or not
IvanBomb.Detonate.AffectsType -> TechnoTypes in this list can have their ivan bomb detonated by this warhead. Use empty list for all types


if(auto pBomb = pThis->AttachedBomb)
{
if(auto pSourceExt = TechnoExt::TryFetch(pSource))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to use TryFetch here since it has already been checked above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants