Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

AE attach/discard by health & ExtraWarheads & Aux/FeedbackWeapon & other tweaks

Open Coronia opened this issue 7 months ago • 1 comments

A sequel of https://github.com/Phobos-developers/Phobos/pull/1355. Was trying to use a generic condition group with many conditions for AE before, but it appeared to be quite laggy since it needed to be calculated on each techno with AE per frame. Hence, we had to abandon a group of unified conditions, and only add conditions when it's really needed. Together with some other tweaks here

  • If Duration.ApplyVersus.Warhead is set, it can multiply the duration by the set warhead's versus against the target's armor type if it's not negative. Can't reduce duration to below 0 by a negative versus.
  • If DiscardOn.CumulativeCount is greater than 0, the effect is discarded when it has Cumulative=yes and been attached to the object more than this amount of times.
  • If DiscardOn.AbovePercent or DiscardOn.BelowPercent is set, the effect is discarded when the object's health percentage is above/below that value.
  • If AffectAbovePercent or AffectBelowPercent is set, the effect can be applied only when the object's health percentage is above/below that value.
  • Attached effect can allow the TechnoType's weapon to detonate multiple Warheads on impact by listing ExtraWarheads. The warheads are detonated at same location as the main one, after it in listed order. This only works in cases where a projectile has been fired by a weapon and still remembers it when it is detonated (due to currently existing technical limitations, this excludes AirburstWeapon).
    • ExtraWarheads.DamageOverrides can be used to override the weapon's Damage for the extra Warhead detonations. Value from position matching the position from ExtraWarheads is used if found, or last listed value if not found. If list is empty, WeaponType Damage is used.
    • ExtraWarheads.DetonationChances can be used to customize the chance of each extra Warhead detonation occuring. Value from position matching the position from ExtraWarheads is used if found, or last listed value if not found. If list is empty, every extra Warhead detonation is guaranteed to occur.
    • ExtraWarheads.FullDetonation can be used to customize whether or not each individual Warhead is detonated fully (as part of a dummy weapon) or simply deals area damage and applies Phobos' Warhead effects. Value from position matching the position from ExtraWarheads is used if found, or last listed value if not found. If list is empty, defaults to true.
    • ExtraWarheads.UseInvokerAsOwner can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the weapon's owner & invoker instead of the object the effect is attached to. Value from position matching the position from ExtraWarheads is used if found, or last listed value if not found. If list is empty, defaults to false.
    • Note that the listed Warheads must be listed in [Warheads] for them to work.
  • You can now specify an auxiliary weapon to be fired when a weapon is fired.
    • FireInTransport setting of the auxiliary weapons are respected to determine if it can be fired when the original weapon is fired from inside OpenTopped=true transport. If auxiliary weapons are fired, it is fired on the transport. OpenToppedDamageMultiplier is not applied on auxiliary weapons.
  • AuxWeapon is fired at the original target, or another nearby target if AuxWeapon.Retarget set to true.
    • AuxWeapon.Offset defines the relative position to the firer that the auxiliary weapon will be fired from. AuxWeapon.FireOnTurret defines if the FLH is relative to the turret rather than the body.
    • If AuxWeapon.AllowZeroDamage set to true, the auxiliary weapon will be fired even if its damage on the set target is 0.
    • AuxWeapon.ApplyFirepowerMult determines whether or not the auxiliary weapon's damage should multiply the firer's firepower multipliers.
    • AuxWeapon.Retarget.AroundFirer determines whether the original target or the firer will be the center of the retargeting. AuxWeapon.Retarget.Range determines the radius of the retargeting, default to the auxiliary weapon's Range if the center is the firer, and 0 if the center is the original target.
    • AuxWeapon.Retarget.Accuracy defines the probability that the auxiliary weapon is fired to the original target.
    • AuxWeapon.UseInvokerAsOwner can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the weapon's owner & invoker instead of the object the effect is attached to.
  • FeedbackWeapon is fired at the firer.
    • FeedbackWeapon.UseInvokerAsOwner can be used to set the house and TechnoType that created the effect (e.g firer of the weapon that applied it) as the weapon's owner & invoker instead of the object the effect is attached to.
  • If RevengeWeapon.RealLaunch/KillWeapon.OnFirer.RealLaunch set to true, the weapon will be fired through a real projectile from the TechnoType to the killer.
  • PreventNegativeDamage can be used to prevent the techno from taking negative damage. This includes both negative Damage and negative Verses.

in rulesmd.ini:

[SOMEATTACHEFFECT]                                 ; AttachEffectType
Duration.ApplyVersus.Warhead=                      ; WarheadType
DiscardOn.CumulativeCount=-1                       ; integer
DiscardOn.AbovePercent=                            ; floating point value, percents or absolute (0.0-1.0)
DiscardOn.BelowPercent=                            ; floating point value, percents or absolute (0.0-1.0)
AffectAbovePercent=                                ; floating point value, percents or absolute (0.0-1.0)
AffectBelowPercent=                                ; floating point value, percents or absolute (0.0-1.0)
ExtraWarheads=                                     ; List of WarheadTypes
ExtraWarheads.DamageOverrides=                     ; List of integers
ExtraWarheads.DetonationChances=                   ; List of floating-point values (percentage or absolute)
ExtraWarheads.FullDetonation=                      ; List of booleans
ExtraWarheads.UseInvokerAsOwner=false              ; boolean
AuxWeapon=                                         ; WeaponType
AuxWeapon.Offset=0,0,0                             ; integer - Forward,Lateral,Height
AuxWeapon.FireOnTurret=false                       ; boolean
AuxWeapon.AllowZeroDamage=true                     ; boolean
AuxWeapon.ApplyFirepowerMult=true                  ; boolean
AuxWeapon.Retarget=false                           ; boolean
AuxWeapon.Retarget.Range=                          ; integer
AuxWeapon.Retarget.Accuracy=1.0                    ; floating point value, percents or absolute (0.0-1.0)
AuxWeapon.Retarget.AroundFirer=false               ; boolean
AuxWeapon.UseInvokerAsOwner=false                  ; boolean
FeedbackWeapon=                                    ; WeaponType
FeedbackWeapon.UseInvokerAsOwner=false             ; boolean
RevengeWeapon.RealLaunch=false                     ; boolean
PreventNegativeDamage=false                        ; boolean

[SOMETECHNO]                    ; TechnoType
RevengeWeapon.RealLaunch=false  ; boolean

[SOMEWARHEAD]                         ; WarheadType
KillWeapon.OnFirer.RealLaunch=false   ; boolean

[SOMEWEAPON]                              ; WeaponType
AuxWeapon=                                ; WeaponType
AuxWeapon.Offset=0,0,0                    ; integer - Forward,Lateral,Height
AuxWeapon.FireOnTurret=false              ; boolean
AuxWeapon.AllowZeroDamage=true            ; boolean
AuxWeapon.ApplyFirepowerMult=true         ; boolean
AuxWeapon.Retarget=false                  ; boolean
AuxWeapon.Retarget.Range=                 ; integer
AuxWeapon.Retarget.Accuracy=1.0           ; floating point value, percents or absolute (0.0-1.0)
AuxWeapon.Retarget.AroundFirer=false      ; boolean

Coronia avatar Apr 23 '25 02:04 Coronia

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.

github-actions[bot] avatar Apr 23 '25 04:04 github-actions[bot]