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

Prevent stuns on vampire bite #688

Merged
merged 13 commits into from
Feb 13, 2025

Conversation

DiscordWizard
Copy link
Contributor

@DiscordWizard DiscordWizard commented Feb 6, 2025

About The Pull Request

This PR turns the sleep check at the end of the bite code into a proper signal to determine if whomever was bitten has resisted the bite or not once the bite is over. If they have, they are not put to sleep, if they haven't, they are put to sleep for 5 seconds.

This also makes it so only NPCs have a guaranteed constant stun for each cycle of the bite, giving garou and other players, even humans, the chance to escape. The difference is humans will pass out after breaking free, supernaturals who are meant to be resistant will not. This still leaves humans at the extreme disadvantage they should be under when going against vampires, but at least lets them be a little nuisance if unwilling and strong willed.

Why It's Good For The Game

There's been plenty of cases where werewolves, even in Crinos, have been chain-stunned by bite spamming vampires. This is both non lore compliant and also unfun in general to suffer. This will remove the issue completely, add a new signal to process bite resistances with and give a little buff to kine as a treat because human mains suffer enough as is. It also adds kuei jin to the list of things that should be 'resistant' to the kiss.

Changelog

🆑
balance: makes garou immune to vampire bite stun
balance: makes kuei-jin immune to vampire bite stun
balance: allows humans to resist out of a bite grab, will still KO them
/:cl:

Copy link
Contributor

@Metekillot Metekillot left a comment

Choose a reason for hiding this comment

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

excellent use of signals, review addresses code organization for them instead. nearly ready to merge.

*
* This handles vampire bite stun immunity.
*/
/mob/living/carbon/proc/on_vampire_bite(datum/source)
Copy link
Contributor

Choose a reason for hiding this comment

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

Put this on the species datums instead; you have my go ahead to do so and I'll merge it into my WIP branch for the species reworks.

Comment on lines 56 to 60
if(iskindred(src))
return COMPONENT_RESIST_VAMPIRE_KISS

//Garou are not stunned by another vampire's bite
if(isgarou(src))
Copy link
Contributor

Choose a reason for hiding this comment

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

Refactor these to instead be on datums, so iskindred would instead just be on the kindred species datum.

@@ -4,6 +4,7 @@

RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_NOBREATH), PROC_REF(on_nobreath_trait_gain))
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_NOMETABOLISM), PROC_REF(on_nometabolism_trait_gain))
RegisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_vampire_bite))
Copy link
Contributor

Choose a reason for hiding this comment

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

Have kindred and garou species register this signal on their species gainer instead in the on_gain_species procs

return COMPONENT_RESIST_VAMPIRE_KISS

//I hate this because crinos and lupus are not covered in isgarou()
if(iswerewolf(src))
Copy link
Contributor

Choose a reason for hiding this comment

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

Have the werewolf mob that people take control of when they transform register for this signal (and unregister when they unmorph, don't forget!)

Comment on lines 56 to 65
if(iskindred(src))
return COMPONENT_RESIST_VAMPIRE_KISS

//Garou are not stunned by another vampire's bite
if(isgarou(src))
return COMPONENT_RESIST_VAMPIRE_KISS

//I hate this because crinos and lupus are not covered in isgarou()
if(iswerewolf(src))
return COMPONENT_RESIST_VAMPIRE_KISS
Copy link
Contributor

Choose a reason for hiding this comment

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

Refactor these to instead be on datums, so iskindred would instead just be on the kindred species datum.

Copy link
Contributor

@Metekillot Metekillot left a comment

Choose a reason for hiding this comment

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

Please make sure you're compiling and testing your code if you mark it as ready for review; this code would have had several compile errors.

@@ -109,8 +109,12 @@
C.transformator = new(C)
C.transformator.human_form = C

//garou resist vampire bites better than mortals
RegisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_garou_bitten))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
RegisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_garou_bitten))
RegisterSignal(C, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_garou_bitten))

We'll worry about refactoring the single letter vars later;

When we register for a signal, we register it on the thing that will get signals sent to it. In this case, it'll be the human, not the species datum itself.

/datum/species/garou/on_species_loss(mob/living/carbon/human/C, datum/species/new_species, pref_load)
. = ..()
UnregisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
UnregisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED)
UnregisterSignal(C, COMSIG_MOB_VAMPIRE_SUCKED)

/datum/species/garou/proc/on_garou_bitten(/datum/source)
SIGNAL HANDLER

if(isgarou(src) || iswerewolf(src))
Copy link
Contributor

Choose a reason for hiding this comment

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

src refers to the current datum we're operating on. This will, in this case, be the species/garou datum, not the mob. We also don't actually need to check this; if we're still registered, we should always be a garou anyway.

Suggested change
if(isgarou(src) || iswerewolf(src))

*
* This handles vampire bite sleep immunity and any future special interactions.
*/
/datum/species/garou/proc/on_garou_bitten(/datum/source)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/datum/species/garou/proc/on_garou_bitten(/datum/source)
/datum/species/garou/proc/on_garou_bitten(datum/source, mob/living/vampire_biting)

Comment on lines 180 to 182
var/mob/living/carbon/wolf = src
adjust_rage(1, src, TRUE)
return COMPONENT_RESIST_VAMPIRE_KISS
Copy link
Contributor

Choose a reason for hiding this comment

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

See my previous comments about what src actually is.

Suggested change
var/mob/living/carbon/wolf = src
adjust_rage(1, src, TRUE)
return COMPONENT_RESIST_VAMPIRE_KISS
adjust_rage(1, src, TRUE)
return COMPONENT_RESIST_VAMPIRE_KISS

Did you test this? This wouldn't work, because;

  1. src would refer to the datum here, not the person being bitten
  2. the person being bitten doesn't get sent by the signal, so we actually have no way to reference them

We need to change the arguments on the SEND_SIGNAL if you want to adjust rage here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haven't tested yet, I just made the changes and was going to test today

code/modules/vtmb/kindred_species.dm Outdated Show resolved Hide resolved
/datum/species/kindred/on_species_loss(mob/living/carbon/human/C, datum/species/new_species, pref_load)
. = ..()
UnregisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
UnregisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED)
UnregisterSignal(C, COMSIG_MOB_VAMPIRE_SUCKED)

@@ -65,16 +65,20 @@
if(iscrinos(trans))
ntransform.Scale(0.75, 0.75)
if(ishuman(trans))
RegisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_garou_bitten))
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no on_garou_bitten proc defined on the transformation holder, so you should have gotten a compile error with this.

Comment on lines 74 to 82
RegisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_garou_bitten))
ntransform.Scale(1.25, 1.5)
if("Homid")
if(iscrinos(trans))
UnregisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_garou_bitten))
ntransform.Scale(0.75, 0.5)
if(islupus(trans))
UnregisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_garou_bitten))
ntransform.Scale(1, 1.5)
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, and as well, you're tryin to register and unregister to listen to the signal being sent to the transformator, not the person being bitten. Code hygiene nit, here; we could still have the species datum handling this, actually. Find where the werewolf_holder/transformation is being generated and given to the werewolf for them to invoke their transformations, and just have the species datum register to listen for the signal on those forms, too. They're held in stasis in nullspace, if I recall correctly, so we don't need to worry about doing signal registration judo with that method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that for some reason crinos and lupus forms don't actually get the garou species datum, at least in the current code.

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, but the species datum of the carbon mob can still register to those mobs

@@ -240,5 +240,5 @@
client.images -= suckbar
qdel(suckbar)
stop_sound_channel(CHANNEL_BLOOD)
if(!iskindred(mob))
if(!(SEND_SIGNAL(mob, COMSIG_MOB_VAMPIRE_SUCKED, src) & COMPONENT_RESIST_VAMPIRE_KISS))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(!(SEND_SIGNAL(mob, COMSIG_MOB_VAMPIRE_SUCKED, src) & COMPONENT_RESIST_VAMPIRE_KISS))
if(!(SEND_SIGNAL(mob, COMSIG_MOB_VAMPIRE_SUCKED, src, mob) & COMPONENT_RESIST_VAMPIRE_KISS))

Based on the behavior you're wanting to perform for the garou at least, we need to change the args we send with the signal.

@XanderDox XanderDox added Balance Changes to functionality that modifies how effective certain methods are at powergaming Vampire Does not respect the Traditions Werewolf Loves the Wyrm labels Feb 9, 2025
@DiscordWizard DiscordWizard changed the title Prevent garou stun on vampire bite Prevent stuns on vampire bite Feb 10, 2025
@XanderDox XanderDox added the Feature Freeze Wait in line behind this PR label Feb 12, 2025
@XanderDox
Copy link
Contributor

Hello! Your PR has been marked as Feature Freeze as it relates to Species/Splat code.

A Maintainer may decide to exempt your PR. Until then, you are encouraged to direct your PR to the ongoing species refactor branch.

@XanderDox XanderDox added Frozen Wait for someone else's PR to be merged and removed Feature Freeze Wait in line behind this PR labels Feb 12, 2025
@Metekillot Metekillot merged commit 3453b00 into WorldOfDarknessXIII:master Feb 13, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Balance Changes to functionality that modifies how effective certain methods are at powergaming Frozen Wait for someone else's PR to be merged Vampire Does not respect the Traditions Werewolf Loves the Wyrm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants