Skip to content

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

Open
dh381-1 wants to merge 19 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 19 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.
  • Use IvanBomb.Detonate.InvokerOnly to configure whether the warhead can detonate Ivan bombs from other sources.
  • Use IvanBomb.Detonate.AffectsType to configure which targets' Ivan bombs can be detonated by warhead, use empty for all types.

In rulesmd.ini:

[SOMEWARHEAD]                             ; WarheadType
IvanBomb.Detonate=true                    ; boolean
IvanBomb.Detonate.InvokerOnly=false       ; boolean
IvanBomb.Detonate.AffectsType=HTNK,E1     ; List of Registration Name, use empty list for all types

@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
@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.

Comment thread docs/New-or-Enhanced-Logics.md Outdated
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
Comment thread src/Ext/Techno/Hooks.ReceiveDamage.cpp Outdated
@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

Comment thread src/Ext/Techno/Hooks.ReceiveDamage.cpp Outdated
Comment thread src/Ext/Techno/Hooks.ReceiveDamage.cpp Outdated
Comment thread src/Ext/Techno/Hooks.ReceiveDamage.cpp Outdated
[SOMEWARHEAD] ; WarheadType
IvanBomb.Detonate=true ; boolean
IvanBomb.Detonate.InvokerOnly=false ; boolean
IvanBomb.Detonate.AffectsType=HTNK,E1 ; List of Registration Name, use empty list for all types

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.

It is unreasonable to reinvent a filter here.

Comment thread src/Ext/Techno/Hooks.ReceiveDamage.cpp Outdated
Comment thread src/Ext/Techno/Hooks.ReceiveDamage.cpp Outdated
if(pWHExt->IvanBomb_Detonate_InvokerOnly)
{
if(pBomb->Owner == pSource && CanAffects)
pBomb->Detonate();

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.

Invoking a damage in another damage process is dangerous.
IMO resetting the timer would be better.

@NetsuNegi NetsuNegi 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.

uh, NVM this comment

IvanBomb.Detonate=true ; boolean
IvanBomb.Detonate.InvokerOnly=false ; boolean
IvanBomb.Detonate.PenetrateTransport=true ; boolean
IvanBomb.Detonate.PenetrateBuilding=true ; boolean

@Coronia Coronia Aug 28, 2026

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.

rename this to PenetratesGarrison since it can only affect garrisoned buildings, while not the other 'enterable' buildings such as Bio Reactor and Ares' tunnel

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.

6 participants