Skip to content

Target: last_damager issue #1499

@NightScythe1

Description

@NightScythe1

Having a slight issue with the target: last_damager/target: damager parameter, mostly that it doesn't update quite as expected in certain circumstances-

Players who damage themselves do not get passed as their own "last_damager", and "last_damager" doesn't reset/clear if damaged by a non-entity source. This is useful for things spells which will want to always keep "last_damager" as the most recent player/entity that hit them without losing their target by taking environmental or recoil damage, but it can be problematic when the spell continues to target an old damager even if they haven't actually dealt the most recent damage to the target.

Example here is a spell that is intended to deal 1 damage back to anything that hurts the player. This does work, but since "last_damager" doesn't update/clear, the player can then repeatedly deal damage to that entity by damaging themselves, jumping in lava, taking fall damage, etc. If an entity were to hit you just once, you can infinitely deal damage back to them by taking damage from yourself or any non-entity source.

hellish_rebuke:
  name: Hellish Rebuke
  triggers:
    - trigger: damage
  actions:
    cast:
    - class: Damage
      damage: 1
  parameters:
    target: last_damager

Since both of these functions are useful in different circumstances, would it be worth splitting the last_damager and damager alias into 2 different target types perhaps? Perhaps last_damager remaining as it currently works, and damager getting cleared after use, or allowing the caster to be included as the last damager? Or maybe a spell action that clears the current last_damager saved?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions