Skip to content

Comments

Attached effect for transfering damage to invoker#2086

Open
Coronia wants to merge 3 commits intoPhobos-developers:developfrom
Coronia:big-other-ae
Open

Attached effect for transfering damage to invoker#2086
Coronia wants to merge 3 commits intoPhobos-developers:developfrom
Coronia:big-other-ae

Conversation

@Coronia
Copy link
Contributor

@Coronia Coronia commented Feb 4, 2026

Attached effect between object and invoker - Season 1

  • TransferDamage can be set to true to have any damage dealt to the object the effect is attached to be transfered to the invoker of the effect if it's alive.
    • TransferDamage.SelfMultiplier and TransferDamage.InvokerMultiplier are multuipliers of damage that'll be applied to the attached object and the invoker if a transfer happens. If an object has multiple effects with TransferDamage, the damage will be equally divided and calculated for each effect independently. TransferDamage.Minimum and TransferDamage.Maximum further restrict the bound of damage transfering to the invoker.
    • TransferDamage.Warhead determines which Warhead is used to deal the damage, defaults to [CombatDamage] -> C4Warhead. If TransferDamage.Warhead.Detonate is set to true, the Warhead is fully detonated instead of used to simply deal damage. If TransferDamage.UseOriginalWarhead is set to true, it'll reuse the Warhead that dealt damage to the object.
    • TransferDamage.Chance determines the chance of transfer, while TransferDamage.AffectsHouse customizes which houses can trigger the transfer damage. TransferDamage.Invoker.AbovePercent and TransferDamage.Invoker.BelowPercent determine if the transfer can happen when the invoker's health is above or below the given values.
    • Warheads can prevent transfer damage from occuring by setting SuppressTransferDamage to true. SuppressTransferDamage.Types can control which AttachEffectTypes' transfer damage is suppressed, if none are listed then all of them are suppressed. SuppressTransferDamage.Groups does the same thing but for all AttachEffectTypes in the listed groups.
    • SuppressTransferDamage.SelfOwned can be used to set the house and TechnoType that the object the effect is attached to as the transfered damage's owner & invoker. Otherwise, it'll be set to the original damage dealer that trigger this transfer.

In rulesmd.ini:

[SOMEATTACHEFFECT]                                 ; AttachEffectType
ReflectDamage.UseOriginalWarhead=false ; boolean
TransferDamage=false                               ; boolean
TransferDamage.SelfMultiplier=0.5                  ; floating point value
TransferDamage.InvokerMultiplier=0.5               ; floating point value
TransferDamage.Minimum=-2147483648                 ; integer
TransferDamage.Maximum=2147483647                  ; integer
TransferDamage.Warhead=                            ; WarheadType
TransferDamage.Warhead.Detonate=false              ; WarheadType
TransferDamage.UseOriginalWarhead=false            ; boolean
TransferDamage.AffectsHouse=all                    ; List of Affected House Enumeration (none|owner/self|allies/ally|team|enemies/enemy|all)
TransferDamage.Chance=1.0                          ; floating point value
TransferDamage.Invoker.AbovePercent=0.0            ; floating point value
TransferDamage.Invoker.BelowPercent=1.0            ; floating point value
TransferDamage.SelfOwned=false                     ; boolean

[SOMEWARHEAD]                                      ; WarheadType
SuppressTransferDamage=false                       ; boolean
SuppressTransferDamage.Types=                      ; List of AttachEffectTypes
SuppressTransferDamage.Groups=                     ; comma-separated list of strings (group IDs)

@Coronia Coronia added Needs testing ⚙️T1 T1 maintainer review is sufficient labels Feb 4, 2026
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

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.

Copy link
Contributor

@TaranDahl TaranDahl left a comment

Choose a reason for hiding this comment

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

The damage trigger, the pre-damage trigger. Things are getting better and better XD.
I bet someone will encounter problems caused by the settlement order in the future.
Maybe it's time to add an overall explanation of the settlement order.

{
int nDamageLeft = damage;

if (pExt->AE.TransferDamageCount > 0 && !pWHExt->Transfered)
Copy link
Contributor

Choose a reason for hiding this comment

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

It is better to write a comment to explain that checking Transfered is to prevent circular calls.

@Metadorius
Copy link
Member

Looking at all those coming PRs, it feels more and more like we should design a generic and flexible system instead of adding 123946123874238 different systems. It's just not feasible in the long run. We can add endless amount of things this way, because there will be endless amount of ideas to implement.

@TaranDahl
Copy link
Contributor

Looking at all those coming PRs

A large part of them are my fixes to vanilla bullshit 😝

@Metadorius
Copy link
Member

A large part of them are my fixes to vanilla bullshit 😝

I know. My point was more about @Coronia's additions like this one and the weapon one.

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

Labels

⚙️T1 T1 maintainer review is sufficient Tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants