diff --git a/code/__DEFINES/~darkpack/signals_kindred.dm b/code/__DEFINES/~darkpack/signals_kindred.dm index 3c3d6987dad7..b8938d77c1f5 100644 --- a/code/__DEFINES/~darkpack/signals_kindred.dm +++ b/code/__DEFINES/~darkpack/signals_kindred.dm @@ -1,7 +1,10 @@ // This is the new signals file for every signal vampire related in WOD13 // New signals related to vampires and things vampires do should be defined here -///called in bloodsucking.dm at the end of /mob/living/carbon/human/proc/drinksomeblood +///called in bloodsucking.dm at the end of /mob/living/carbon/human/proc/drinksomeblood: (mob/drunk_from, mob/living/carbon/human/drinker) #define COMSIG_MOB_VAMPIRE_SUCKED "mob_vampire_sucked" ///vampire suck resisted #define COMPONENT_RESIST_VAMPIRE_KISS (1<<0) + +///called in bloodsucking.dm at the end of /mob/living/carbon/human/proc/drinksomeblood: (mob/living/carbon/human/drinker, mob/drunk_from) +#define COMSIG_MOB_VAMPIRE_SUCKING "mob_vampire_sucking" diff --git a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/species_types/zombies.dm b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/species_types/zombies.dm index f01f9866ce1f..e7bfbc8b312c 100644 --- a/modular_darkpack/master_files/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/modular_darkpack/master_files/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -37,10 +37,10 @@ RegisterSignal(C, COMSIG_MOB_VAMPIRE_SUCKED, PROC_REF(on_zombie_bitten)) ADD_TRAIT(C, TRAIT_MASQUERADE_VIOLATING_FACE, "zombie") -/datum/species/zombie/proc/on_zombie_bitten(datum/source, mob/living/carbon/being_bitten) +/datum/species/zombie/proc/on_zombie_bitten(mob/drunk_from, mob/living/carbon/human/drinker) SIGNAL_HANDLER - if(iszombie(being_bitten)) + if(iszombie(drunk_from)) return COMPONENT_RESIST_VAMPIRE_KISS /datum/species/zombie/on_species_loss(mob/living/carbon/human/C, datum/species/new_species, pref_load) diff --git a/modular_darkpack/modules/blood_drinking/code/bite_tutorial.dm b/modular_darkpack/modules/blood_drinking/code/bite_tutorial.dm new file mode 100644 index 000000000000..6eb2dfc9c090 --- /dev/null +++ b/modular_darkpack/modules/blood_drinking/code/bite_tutorial.dm @@ -0,0 +1,75 @@ +#define STAGE_GRAB_VICTIM "STAGE_GRAB_VICTIM" +#define STAGE_PRESS_BITE "STAGE_PRESS_BITE" +#define STAGE_RELEASE_VICTIM "STAGE_RELEASE_VICTIM" + +/// Tutorial for showing how to switch hands. +/// Fired when clicking on an item with another item with an empty inactive hand. +/datum/tutorial/bite_prey + // grandfather_date = "2023-01-07" + + var/stage = STAGE_GRAB_VICTIM + +/datum/tutorial/bite_prey/Destroy(force) + return ..() + +/datum/tutorial/bite_prey/perform(list/modifiers) + addtimer(CALLBACK(src, PROC_REF(show_instructions)), 0.5 SECONDS) + + RegisterSignal(user, COMSIG_MOVABLE_SET_GRAB_STATE, PROC_REF(on_grab)) + RegisterSignal(user, COMSIG_MOB_VAMPIRE_SUCKING, PROC_REF(on_bite)) + RegisterSignal(user, COMSIG_ATOM_NO_LONGER_PULLING, PROC_REF(on_release)) + +/datum/tutorial/bite_prey/perform_completion_effects_with_delay() + UnregisterSignal(user, list(COMSIG_MOVABLE_SET_GRAB_STATE, COMSIG_MOB_VAMPIRE_SUCKING, COMSIG_ATOM_NO_LONGER_PULLING)) + return 0 + +/datum/tutorial/bite_prey/proc/show_instructions() + if(QDELETED(src)) + return + + switch(stage) + if(STAGE_GRAB_VICTIM) + show_instruction("Pull then grab the NPC to regain BP.") + if(STAGE_PRESS_BITE) + show_instruction(keybinding_message( + /datum/keybinding/human/bite, + "Press '%KEY%' to bite", + "Set a key to bite", + )) + if(STAGE_RELEASE_VICTIM) + show_instruction(keybinding_message( + /datum/keybinding/mob/stop_pulling, + "Press '%KEY%' to release to stop feeding!.", + "Click 'Pull' to stop feeding!.", + )) + +/datum/tutorial/bite_prey/proc/on_grab(mob/living/source, newstate) + SIGNAL_HANDLER + + if((newstate >= GRAB_AGGRESSIVE) && isnpc(source.pulling)) + stage = STAGE_PRESS_BITE + show_instructions() + /* + else if(stage == STAGE_PRESS_BITE) + stage = STAGE_GRAB_VICTIM + show_instructions() + */ + +/datum/tutorial/bite_prey/proc/on_bite(mob/living/carbon/human/drinker, mob/drunk_from) + SIGNAL_HANDLER + + stage = STAGE_RELEASE_VICTIM + show_instructions() + +/datum/tutorial/bite_prey/proc/on_release() + SIGNAL_HANDLER + + if(stage == STAGE_PRESS_BITE) + stage = STAGE_GRAB_VICTIM + show_instructions() + else if(stage == STAGE_RELEASE_VICTIM) + complete() + +#undef STAGE_RELEASE_VICTIM +#undef STAGE_PRESS_BITE +#undef STAGE_GRAB_VICTIM diff --git a/modular_darkpack/modules/blood_drinking/code/drinksomeblood.dm b/modular_darkpack/modules/blood_drinking/code/drinksomeblood.dm index 883508000700..52b2474012ba 100644 --- a/modular_darkpack/modules/blood_drinking/code/drinksomeblood.dm +++ b/modular_darkpack/modules/blood_drinking/code/drinksomeblood.dm @@ -28,7 +28,7 @@ if(!do_after(src, 3 SECONDS, target = drunk_from, timed_action_flags = NONE, progress = FALSE)) remove_drinking_overlay(drunk_from) - if(!(SEND_SIGNAL(drunk_from, COMSIG_MOB_VAMPIRE_SUCKED, drunk_from) & COMPONENT_RESIST_VAMPIRE_KISS)) + if(!(SEND_SIGNAL(drunk_from, COMSIG_MOB_VAMPIRE_SUCKED, src) & COMPONENT_RESIST_VAMPIRE_KISS)) drunk_from.apply_status_effect(/datum/status_effect/kissed) return @@ -82,6 +82,8 @@ remove_drinking_overlay(drunk_from) return + SEND_SIGNAL(src, COMSIG_MOB_VAMPIRE_SUCKING, drunk_from) + if(grab_state >= GRAB_PASSIVE) stop_sound_channel(CHANNEL_BLOOD) drinksomeblood(drunk_from) diff --git a/modular_darkpack/modules/vampire_the_masquerade/code/splats/kindred_splat/kindred_splat.dm b/modular_darkpack/modules/vampire_the_masquerade/code/splats/kindred_splat/kindred_splat.dm index 175de38ea834..19c1ded5783b 100644 --- a/modular_darkpack/modules/vampire_the_masquerade/code/splats/kindred_splat/kindred_splat.dm +++ b/modular_darkpack/modules/vampire_the_masquerade/code/splats/kindred_splat/kindred_splat.dm @@ -41,6 +41,8 @@ /// Timer tracking how long before the Kindred can wake up from torpor COOLDOWN_DECLARE(torpor_timer) + var/tutorial_shown = FALSE + /datum/splat/vampire/kindred/New(generation, clan, enlightenment = FALSE, mob/living/sire) src.generation = generation src.clan = clan @@ -127,6 +129,13 @@ GLOB.kindred_list -= owner +/datum/splat/vampire/kindred/splat_life(seconds_per_tick) + . = ..() + // Tried doing with proximity_monitor but only triggers when THEY walk + if(!tutorial_shown && owner.client && (owner.maxbloodpool != owner.bloodpool) && (locate(/mob/living/carbon/human/npc) in orange(2, owner))) + SStutorials.suggest_tutorial(owner, /datum/tutorial/bite_prey) + tutorial_shown = TRUE + /datum/splat/vampire/kindred/proc/damage_resistance(datum/source, list/damage_mods, damage_amount, damagetype, def_zone, sharpness, attack_direction, obj/item/attacking_item) SIGNAL_HANDLER @@ -177,7 +186,7 @@ * * This handles vampire bite sleep immunity and any future special interactions. */ -/datum/splat/vampire/kindred/proc/on_vampire_bitten(datum/source, mob/living/carbon/being_bitten) +/datum/splat/vampire/kindred/proc/on_vampire_bitten(mob/drunk_from, mob/living/carbon/human/drinker) SIGNAL_HANDLER return COMPONENT_RESIST_VAMPIRE_KISS diff --git a/tgstation.dme b/tgstation.dme index 16f285eae546..19ec8dcb6cfa 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -7020,6 +7020,7 @@ #include "modular_darkpack\modules\bitcoinminer\code\bitcoinminer.dm" #include "modular_darkpack\modules\blood_drinking\code\bite_helper_procs.dm" #include "modular_darkpack\modules\blood_drinking\code\bite_keybinding.dm" +#include "modular_darkpack\modules\blood_drinking\code\bite_tutorial.dm" #include "modular_darkpack\modules\blood_drinking\code\drinksomeblood.dm" #include "modular_darkpack\modules\blood_drinking\code\vamp_bite.dm" #include "modular_darkpack\modules\blood_drinking\code\kiss_status_effect\status_effect_kiss.dm"