Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/__DEFINES/~darkpack/signals_kindred.dm
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
75 changes: 75 additions & 0 deletions modular_darkpack/modules/blood_drinking/code/bite_tutorial.dm
Original file line number Diff line number Diff line change
@@ -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 '<b>Pull</b>' 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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -127,6 +129,13 @@

GLOB.kindred_list -= owner

/datum/splat/vampire/kindred/splat_life(seconds_per_tick)
Copy link
Collaborator

Choose a reason for hiding this comment

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

surely there's a better way than having a check for this each splat_life() tick???

Copy link
Member Author

Choose a reason for hiding this comment

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

If u have one ill try it.

Copy link
Contributor

Choose a reason for hiding this comment

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

is this how /tg/ handles it???

Copy link
Member Author

Choose a reason for hiding this comment

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

tg doesnt need to listen to things around it, they just call it directly in the attack_chain code for the hand tutorials lol.

Copy link
Contributor

Choose a reason for hiding this comment

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

cant we instead just trigger it from grabbing an npc, or perhaps when bloodpool enters hungry state via TRAIT_NEEDS_BLOOD so that it isn't running on every life tick?

Copy link
Member Author

Choose a reason for hiding this comment

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

Once it finds and tries an npc once, it wont get past !tutorial_shown so i dont reallllly see the issue tbh.

. = ..()
// 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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// DM Environment file for tgstation.dme.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\drugs\code\bloodpacks\methpack.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\drugs\code\bloodpacks\cokepack.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\drugs\code\bloodpacks\morphpack.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\drugs\code\bloodpacks\bloodpack_adulteration.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\werewolf_the_apocalypse\code\old\gifts.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\werewolf_the_apocalypse\code\gifts\tribes\tribes.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\weather\code\weather.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\computers\code\computer.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\computers\code\app.dm.

Check failure on line 1 in tgstation.dme

View workflow job for this annotation

GitHub Actions / Run Linters / linters

Ticked File Enforcement

Missing include for modular_darkpack\modules\computers\code\app_types.dm.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.

Expand Down Expand Up @@ -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"
Expand Down
Loading