Add vampire ability permission check

Adds a new mob proc that allows checking if vampiric abilities should function. Allows easily checking anti-magic, trait holy, garlic necklace, garlic blood, and staked status.

Bloodfledge actions and coffin healing will now use this check. Flight potions will warn bloodfledge quirk users before allowing consumption.
This commit is contained in:
Darius
2023-02-12 10:57:13 -05:00
parent 23b6be270b
commit bc48a6eafc
5 changed files with 91 additions and 5 deletions
@@ -0,0 +1,26 @@
// Potion of flight
/obj/item/reagent_containers/glass/bottle/potion/flight/attack(mob/living/target, mob/living/user)
// Check for self attack
// Check for carbon target
if((target != user) || (!iscarbon(user)))
// Return normally
return ..()
// Check for bloodfledge
if(HAS_TRAIT(user, TRAIT_BLOODFLEDGE))
// Define list of options
var/list/prompt_options = list("Confirm", "Cancel")
// Prompt user for input
var/input_warning = tgui_alert(user, "You sense that drinking this may be a bad idea. Are you sure you'd like to continue?",src,prompt_options)
// Sanitize input
sanitize_inlist(input_warning, prompt_options)
// Check if input was NOT confirmation
if(input_warning != "Confirm")
// Return without results
return
// Return normally
. = ..()