Skip to content

refactor: rewrite CustomScpTermination #624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

XingYeNotFish
Copy link

Refine and match corresponding DamageHandler

Description

Describe the changes
Refactored CustomScpTermination to align with the new CustomHandler type and DamageType enumeration, removed overly-restrictive CustomHandlerBase type checks, filled in all missing kill scenarios.

What is the current behavior? (You can also link to an open issue here)

  • Missing messages for Scp Kill Scp, SCP-1507, and unknown death reason
  • Potential NullReferenceException
  • Messages do not match the actual DamageHandler(eg. MicroHidDamageHandler -> "TERMINATED BY AUTOMATIC SECURITY SYSTEM")

What is the new behavior? (if this is a feature change)

  • Uses CustomDamageHandler exclusively; determines kill source via DamageType and Attacker
  • Adds new text branches for Scp Kill Scp, SCP-1507, and unspecified kills
  • Explicit null-check for info and Attacker to prevent exceptions

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Yes — method signature changed from CustomHandlerBase to CustomHandler; any external callers must update their references.
    (Impact is zero if the entire codebase already uses CustomHandler.)

Other information:

  • Glitchy effect parameters (GlitchyMessage glitchChance/jamChance) remain unchanged
  • No Harmony patches or IL modifications required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

/// <param name="info">Hit Information.</param>
public static void CustomScpTermination(string scpName, CustomHandlerBase info)

Choose a reason for hiding this comment

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

This is breaking change

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

Successfully merging this pull request may close these issues.

3 participants