Skip to content
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

Deathlink, first pass. #81

Merged

Conversation

dewiniaid
Copy link
Collaborator

This is a first stab of Deathlink. It probably needs a bit of code reorg, but I wanted to get it visible.

Depends on serverside supported added in ArchipelagoMW/Archipelago#672

When enabled, choose how incoming deathlinks are handled:

vanilla: DeathLink kills you and is just like any other death. RIP your previous shade and geo.
shadeless: DeathLink kills you, but no shade spawns and no geo is lost. Your previous shade, if any, is untouched.
shade: DeathLink functions like a normal death if you do not already have a shade, shadeless otherwise.

Should properly handle dream sequences and other no-shade areas. Needs testing in some special cases; I saw some weirdness in GG_Atrium deaths respawning me at the dreamnail scene but oddly killing myself with the debug mod did not trigger this behavior.

@dewiniaid
Copy link
Collaborator Author

Oh, for documentation: The DeathLinkIcon is public domain clipart, sourced from:
https://publicdomainvectors.org/en/free-clipart/Headstone-vector-image/6436.html

I experimented with using the shade's Hunter's Journal icon, but ditched it due to not being particularly visible in dark environments. Replacement art is welcome.

@Ijwu Ijwu added enhancement New feature or request server-side This request or change involves work on the Archipelago Server as well labels Jun 19, 2022
@Ijwu Ijwu linked an issue Jun 19, 2022 that may be closed by this pull request
Copy link
Collaborator

@Ijwu Ijwu left a comment

Choose a reason for hiding this comment

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

Seems like it would work, but could use some cleanup for sure. Not bad, but I think a refactor pass would be beneficial to try and get the code a little more decoupled.

Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
@Ijwu Ijwu modified the milestone: 0.1.0 Jun 19, 2022
 - Move most Deathlink support into a dedicated DeathLinkSupport class
 - Override shade respawn locations in certain rooms to make them safe.
 - Other code quality updates
@dewiniaid
Copy link
Collaborator Author

Moved all of the Deathlink support into DeathlinkSupport.cs and a dedicated helper class.

Ran out of time so haven't tested this commit yet, but it's mostly just variable renaming other than the messaging bits. Will give it proper testing later -- likely in conjunction with other features with @Alchav

 - Can now trigger in dream sequences.
 - ShouldShadeSwap(): Use map zone instead of scene name to filter out
   dream sequences
 - SendDeathLink() now returns immediately if the current death was
   triggered by DeathLink so callers don't need to.
 - Ditch a modhook function that did nothing but call SendDeathLink, just
   use SendDeathLink instead
 - Actually pick messages if the cause of death was unknown so the death
   sends.
 - Remove unused using directives.
@dewiniaid dewiniaid changed the base branch from main to development June 21, 2022 19:30
Archipelago.HollowKnight/Archipelago.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/DeathLinkSupport.cs Outdated Show resolved Hide resolved
Archipelago.HollowKnight/DeathLinkSupport.cs Show resolved Hide resolved
Archipelago.HollowKnight/DeathLinkSupport.cs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ijwu Ijwu left a comment

Choose a reason for hiding this comment

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

Looks good enough to merge. Do so at your discretion. Great job and thank you.

@dewiniaid dewiniaid merged commit 5ff10af into ArchipelagoMW-HollowKnight:development Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request server-side This request or change involves work on the Archipelago Server as well
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DeathLink
2 participants