-
Notifications
You must be signed in to change notification settings - Fork 98
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
Prevent stuns on vampire bite #688
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
if(iskindred(src)) | ||
return COMPONENT_RESIST_VAMPIRE_KISS | ||
|
||
//Garou are not stunned by another vampire's bite | ||
if(isgarou(src)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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!)
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)) |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/datum/species/garou/proc/on_garou_bitten(/datum/source) | |
/datum/species/garou/proc/on_garou_bitten(datum/source, mob/living/vampire_biting) |
var/mob/living/carbon/wolf = src | ||
adjust_rage(1, src, TRUE) | ||
return COMPONENT_RESIST_VAMPIRE_KISS |
There was a problem hiding this comment.
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.
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;
- src would refer to the datum here, not the person being bitten
- 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.
There was a problem hiding this comment.
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
/datum/species/kindred/on_species_loss(mob/living/carbon/human/C, datum/species/new_species, pref_load) | ||
. = ..() | ||
UnregisterSignal(src, COMSIG_MOB_VAMPIRE_SUCKED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)) |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
code/modules/wod13/bloodsucking.dm
Outdated
@@ -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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Co-authored-by: Joshua Kidder <[email protected]>
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. |
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: