-
Notifications
You must be signed in to change notification settings - Fork 55
Biting Tutorial #732
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
Open
FalloutFalcon
wants to merge
3
commits into
DarkPack13:master
Choose a base branch
from
FalloutFalcon:biting-tutorial
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Biting Tutorial #732
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
modular_darkpack/modules/blood_drinking/code/bite_tutorial.dm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
surely there's a better way than having a check for this each splat_life() tick???
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 u have one ill try it.
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.
is this how /tg/ handles it???
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.
tg doesnt need to listen to things around it, they just call it directly in the attack_chain code for the hand tutorials lol.
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.
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?
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.
Once it finds and tries an npc once, it wont get past !tutorial_shown so i dont reallllly see the issue tbh.