mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2026-08-24 05:06:47 +01:00
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:
@@ -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
|
||||
. = ..()
|
||||
Reference in New Issue
Block a user