diff --git a/modular_splurt/code/datums/traits/trait_actions.dm b/modular_splurt/code/datums/traits/trait_actions.dm index 47988d7903..c2126cdd30 100644 --- a/modular_splurt/code/datums/traits/trait_actions.dm +++ b/modular_splurt/code/datums/traits/trait_actions.dm @@ -256,6 +256,27 @@ button_icon = 'icons/mob/actions/bloodsucker.dmi' transparent_when_unavailable = TRUE +// Basic can-use check +/datum/action/cooldown/bloodfledge/IsAvailable(silent = FALSE) + . = ..() + + // Check parent return + if(!.) + return FALSE + + // Check for carbon owner + if(!iscarbon(owner)) + // Warn user and return + to_chat(owner, span_warning("You shouldn't have this ability!")) + return FALSE + + // Check vampire ability mob proc + if(!owner.allow_vampiric_ability(silent = FALSE)) + return FALSE + + // Action can be used + return TRUE + // Action: Bite /datum/action/cooldown/bloodfledge/bite name = "Fledgling Bite" @@ -280,10 +301,6 @@ if(!.) return - // Check for carbon owner - if(!iscarbon(owner)) - return - // Define action owner var/mob/living/carbon/action_owner = owner diff --git a/modular_splurt/code/game/objects/structures/crates_lockers/crates.dm b/modular_splurt/code/game/objects/structures/crates_lockers/crates.dm index cc1a97d0f0..25f12883ff 100644 --- a/modular_splurt/code/game/objects/structures/crates_lockers/crates.dm +++ b/modular_splurt/code/game/objects/structures/crates_lockers/crates.dm @@ -25,7 +25,11 @@ to_chat(coffin_user, span_warning("Your components don't respond to [src]'s sanguine connection! Regeneration will not be possible.")) continue - // User is not synthetic + // Check if vampire ability is allowed + if(!coffin_user.allow_vampiric_ability()) + to_chat(coffin_user, span_warning("[src] fails to form a connection with your body amidst the strong magical interference! Something is blocking your connection to the other-world!")) + // Function already contains message + continue // Define quirk entry var/datum/quirk/bloodfledge/quirk_target = locate() in coffin_user.roundstart_quirks diff --git a/modular_splurt/code/modules/mining/lavaland/necropolis_chests.dm b/modular_splurt/code/modules/mining/lavaland/necropolis_chests.dm new file mode 100644 index 0000000000..1252d607bd --- /dev/null +++ b/modular_splurt/code/modules/mining/lavaland/necropolis_chests.dm @@ -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 + . = ..() diff --git a/modular_splurt/code/modules/mob/mob.dm b/modular_splurt/code/modules/mob/mob.dm index 2621165e97..3d5b2fea19 100644 --- a/modular_splurt/code/modules/mob/mob.dm +++ b/modular_splurt/code/modules/mob/mob.dm @@ -41,3 +41,41 @@ if (.) return to_chat(A, span_notice("[src] seems to be checking you out.")) + +/mob/proc/allow_vampiric_ability(check_anti_magic = TRUE, check_holy = TRUE, check_garlic_neck = TRUE, check_garlic_blood = TRUE, check_stake = TRUE, silent = TRUE) + // Check if carbon + if(!iscarbon(src)) + // Warn user and return false + if(!silent) + to_chat(src, span_warning("Your body cannot form connections to the other-world!")) + return FALSE + + // Check for anti-magic variables + if(check_anti_magic || check_holy) + // Check for anti-magic + if(src.anti_magic_check(check_anti_magic, check_holy, FALSE, 0, TRUE)) + // Warn user and return false + if(!silent) + to_chat(src, span_warning("A powerful anti-magic force is blocking your connection to the other-world!")) + return FALSE + + // Check for anti-garlic variables + if(check_garlic_neck || check_garlic_blood) + // Check bloodsucker checks + if(!blood_sucking_checks(src, check_garlic_neck, check_garlic_blood)) + // Warn user and return false + if(!silent) + to_chat(src, span_warning("The warding power of Allium Sativum prevents you from using any sanguine powers!")) + return FALSE + + // Check for stake variable + if(check_stake) + // Check for stake + if(src.AmStaked()) + // Warn user and return false + if(!silent) + to_chat(src, span_warning("You are staked! You must remove the offending weapon from your heart before using any sanguine powers!")) + return FALSE + + // All checks passed + return TRUE diff --git a/tgstation.dme b/tgstation.dme index 0b770aec0f..aa7d34126d 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4654,6 +4654,7 @@ #include "modular_splurt\code\modules\mentor\mentor_mouse.dm" #include "modular_splurt\code\modules\mentor\mentor_verbs.dm" #include "modular_splurt\code\modules\mining\equipment\kinetic_crusher.dm" +#include "modular_splurt\code\modules\mining\lavaland\necropolis_chests.dm" #include "modular_splurt\code\modules\mob\emote.dm" #include "modular_splurt\code\modules\mob\mob.dm" #include "modular_splurt\code\modules\mob\mob_defines.dm"