Skip to content

[IDEA] Add IAttackerEvent or set Player to Target and add ITargetEvent #350

@ui2506

Description

@ui2506

Goal Description

Add the Attacker interface to events or change Player to Target.
Since there's no interface, I can't subscribe to multiple events with the same method.

For some reason, events with both Attacker and Player only have the IPlayer interface.
For example: DeathEventArgs, TeleportedEventArgs, and etc.

Example:

      //PlayerEvents.DeathEventArgs and Scp106Events.TeleportedEventArgs

        private void HealScpOnAttck<T>(T ev) where T : IAttackerEvent
        {
            if (ev.Attacker != null && Plugin.ScpHeal.TryGetValue(ev.Attacker.Role, out ushort heal))
                ev.Attacker.Heal(heal);
        }

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaThis is an idea to do

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions