From 74d6473c3be5ee1f9f3153a4d246145afb18c112 Mon Sep 17 00:00:00 2001 From: Artur Date: Tue, 25 Feb 2020 17:07:40 +0200 Subject: [PATCH] Initial Commit Changes isvamp() to isbloodsucker(), adds a isvampire() check for the race itself, reworks regen cores codewise, adds a defib check for bloodsuckers --- code/__DEFINES/is_helpers.dm | 3 +- .../game/gamemodes/bloodsucker/bloodsucker.dm | 99 +++++-------------- code/game/machinery/cloning.dm | 2 +- .../bloodsucker/objects/bloodsucker_crypt.dm | 14 +-- .../mining/equipment/regenerative_core.dm | 27 +++-- .../living/carbon/alien/special/facehugger.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 2 +- 7 files changed, 48 insertions(+), 101 deletions(-) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 55bfcaff79..e69f5df05e 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -67,6 +67,7 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list( #define iscatperson(A) (ishumanbasic(A) && istype(A.dna.species, /datum/species/human/felinid) ) #define isdwarf(A) (is_species(A, /datum/species/dwarf)) #define isdullahan(A) (is_species(A, /datum/species/dullahan)) +#define isbloodsuckerire(A) (is_species(A,/datum/species/vampire)) // Citadel specific species #define isipcperson(A) (is_species(A, /datum/species/ipc)) @@ -263,4 +264,4 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list( #define isblobmonster(O) (istype(O, /mob/living/simple_animal/hostile/blob)) -#define isshuttleturf(T) (length(T.baseturfs) && (/turf/baseturf_skipover/shuttle in T.baseturfs)) \ No newline at end of file +#define isshuttleturf(T) (length(T.baseturfs) && (/turf/baseturf_skipover/shuttle in T.baseturfs)) diff --git a/code/game/gamemodes/bloodsucker/bloodsucker.dm b/code/game/gamemodes/bloodsucker/bloodsucker.dm index a45e989318..3737d0a5b1 100644 --- a/code/game/gamemodes/bloodsucker/bloodsucker.dm +++ b/code/game/gamemodes/bloodsucker/bloodsucker.dm @@ -9,7 +9,7 @@ var/list/vassal_allowed_antags = list(/datum/antagonist/brother, /datum/antagonist/traitor, /datum/antagonist/traitor/internal_affairs, /datum/antagonist/survivalist, \ /datum/antagonist/rev, /datum/antagonist/nukeop, /datum/antagonist/pirate, /datum/antagonist/cult, /datum/antagonist/abductee, /datum/antagonist/valentine, /datum/antagonist/heartbreaker,) // The antags you're allowed to be if turning Vassal. -/proc/isvamp(mob/living/M) +/proc/isbloodsucker(mob/living/M) return istype(M) && M.mind && M.mind.has_antag_datum(/datum/antagonist/bloodsucker) /datum/game_mode/bloodsucker @@ -70,49 +70,28 @@ // Gamemode is all done being set up. We have all our Vamps. We now pick objectives and let them know what's happening. /datum/game_mode/bloodsucker/post_setup() - // Sunlight (Creating Bloodsuckers manually will check to create this, too) check_start_sunlight() - // Vamps for(var/datum/mind/bloodsucker in bloodsuckers) - // spawn() --> Run block of code but game continues on past it. - // sleep() --> Run block of code and freeze code there (including whoever called us) until it's resolved. - - //Clean Bloodsucker Species (racist?) - //clean_invalid_species(bloodsucker) - // TO-DO !!! - - // Add Bloodsucker Antag Datum (or remove from list on Fail) - if (!make_bloodsucker(bloodsucker)) + if(!make_bloodsucker(bloodsucker)) bloodsuckers -= bloodsucker - - // NOTE: Hunters are done in ..() parent proc - return ..() -// Checking for ACTUALLY Dead Vamps -/datum/game_mode/bloodsucker/are_special_antags_dead() - // Bloodsucker not Final Dead - for(var/datum/mind/bloodsucker in bloodsuckers) - if(!bloodsucker.AmFinalDeath()) - return FALSE - return TRUE - // Init Sunlight (called from datum_bloodsucker.on_gain(), in case game mode isn't even Bloodsucker /datum/game_mode/proc/check_start_sunlight() // Already Sunlight (and not about to cancel) - if (istype(bloodsucker_sunlight) && !bloodsucker_sunlight.cancel_me) + if(istype(bloodsucker_sunlight) && !bloodsucker_sunlight.cancel_me) return bloodsucker_sunlight = new () // End Sun (last bloodsucker removed) /datum/game_mode/proc/check_cancel_sunlight() // No Sunlight - if (!istype(bloodsucker_sunlight)) + if(!istype(bloodsucker_sunlight)) return - if (bloodsuckers.len <= 0) + if(bloodsuckers.len <= 0) bloodsucker_sunlight.cancel_me = TRUE qdel(bloodsucker_sunlight) bloodsucker_sunlight = null @@ -158,64 +137,36 @@ /datum/game_mode/proc/make_bloodsucker(datum/mind/bloodsucker, datum/mind/creator = null) // NOTE: This is a game_mode/proc, NOT a game_mode/bloodsucker/proc! We need to access this function despite the game mode. - if (!can_make_bloodsucker(bloodsucker)) + if(!can_make_bloodsucker(bloodsucker)) return FALSE - // Create Datum: Fledgling var/datum/antagonist/bloodsucker/A - - // [FLEDGLING] - if (creator) + // [FLEDGLING] AKA a young vampire. + if(creator) A = new (bloodsucker) A.creator = creator bloodsucker.add_antag_datum(A) // Log message_admins("[bloodsucker] has become a Bloodsucker, and was created by [creator].") log_admin("[bloodsucker] has become a Bloodsucker, and was created by [creator].") - // [MASTER] else A = bloodsucker.add_antag_datum(ANTAG_DATUM_BLOODSUCKER) - - return TRUE - /datum/game_mode/proc/remove_bloodsucker(datum/mind/bloodsucker) bloodsucker.remove_antag_datum(ANTAG_DATUM_BLOODSUCKER) - /datum/game_mode/proc/clean_invalid_species(datum/mind/bloodsucker) // Only checking for Humans here - if (!ishuman(bloodsucker.current) || !bloodsucker.current.client) - return - var/am_valid = TRUE - var/mob/living/carbon/human/H = bloodsucker.current - - // Check if PLASMAMAN? - if(NOBLOOD in H.dna.species.species_traits) - am_valid = FALSE - - // PROBLEM: - // - // Setting species leaves clothes on. If you were a plasmaman, we need to reassign your entire outfit. Otherwise - // everyone will wonder why you're a human with Plasma clothes (jk they'll know you're antag) - - // Convert to HUMAN (along with ID and PDA) - if (!am_valid) - H.set_species(/datum/species/human) - H.real_name = H.client.prefs.custom_names["human"] - var/obj/item/card/id/ID = H.wear_id?.GetID() - if(ID) - ID.registered_name = H.real_name - ID.update_label() - + if(ishuman(bloodsucker.current) || bloodsucker.current.client && NOBLOOD in H.dna.species.species_traits) + var/mob/living/carbon/human/H = bloodsucker.current + //Give them blood if they dont have any. + H.dna.species.species_traits =- NOBLOOD /datum/game_mode/proc/can_make_vassal(mob/living/target, datum/mind/creator, display_warning=TRUE)//, check_antag_or_loyal=FALSE) // Not Correct Type: Abort - if (!iscarbon(target) || !creator) - return FALSE - if (target.stat > UNCONSCIOUS) + if(!iscarbon(target) || !creator || target.stat > UNCONSCIOUS) return FALSE // Check Overdose: Am I even addicted to blood? Do I even have any in me? //if (!target.reagents.addiction_list || !target.reagents.reagent_list) @@ -233,23 +184,23 @@ //message_admins("DEBUG4: can_make_vassal() Abort: No Blood") // return 0 // No Mind! - if (!target.mind || !target.mind.key) - if (display_warning) + if(!target.mind || !target.mind.key) + if(display_warning) to_chat(creator, "[target] isn't self-aware enough to be made into a Vassal.") return FALSE // Already MY Vassal var/datum/antagonist/vassal/V = target.mind.has_antag_datum(ANTAG_DATUM_VASSAL) - if (istype(V) && V.master) - if (V.master.owner == creator) - if (display_warning) + if(istype(V) && V.master) + if(V.master.owner == creator) + if(display_warning) to_chat(creator, "[target] is already your loyal Vassal!") else - if (display_warning) + if(display_warning) to_chat(creator, "[target] is the loyal Vassal of another Bloodsucker!") return FALSE // Already Antag or Loyal (Vamp Hunters count as antags) - if (target.mind.enslaved_to || AmInvalidAntag(target.mind)) //!VassalCheckAntagValid(target.mind, check_antag_or_loyal)) // HAS_TRAIT(target, TRAIT_MINDSHIELD, "implant") || - if (display_warning) + if(target.mind.enslaved_to || AmInvalidAntag(target.mind)) //!VassalCheckAntagValid(target.mind, check_antag_or_loyal)) // HAS_TRAIT(target, TRAIT_MINDSHIELD, "implant") || + if(display_warning) to_chat(creator, "[target] resists the power of your blood to dominate their mind!") return FALSE return TRUE @@ -268,15 +219,15 @@ return FALSE // Does even ONE antag appear in this mind that isn't in the list? Then FAIL! for(var/datum/antagonist/antag_datum in M.antag_datums) - if (!(antag_datum.type in vassal_allowed_antags)) // vassal_allowed_antags is a list stored in the game mode, above. - //message_admins("DEBUG VASSAL: Found Invalid: [antag_datum] // [antag_datum.type]") + // vassal_allowed_antags is a list stored in the game mode, above. + if(!(antag_datum.type in vassal_allowed_antags)) return TRUE //message_admins("DEBUG VASSAL: Valid Antags! (total of [M.antag_datums.len])") // WHEN YOU DELETE THE ABOVE: Remove the 3 second timer on converting the vassal too. return FALSE /datum/game_mode/proc/make_vassal(mob/living/target, datum/mind/creator) - if (!can_make_vassal(target,creator)) + if(!can_make_vassal(target,creator)) return FALSE // Make Vassal var/datum/antagonist/vassal/V = new (target.mind) @@ -285,7 +236,7 @@ target.mind.add_antag_datum(V, V.master.get_team()) // Update Bloodsucker Title (we're a daddy now) B.SelectTitle(am_fledgling = FALSE) // Only works if you have no title yet. - // Log + // lOg it message_admins("[target] has become a Vassal, and is enslaved to [creator].") log_admin("[target] has become a Vassal, and is enslaved to [creator].") return TRUE diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 62304112b2..266fcd0e40 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -157,7 +157,7 @@ mess = TRUE update_icon() return FALSE - if(isvamp(clonemind)) //If the mind is a bloodsucker + if(isbloodsucker(clonemind)) //If the mind is a bloodsucker return FALSE attempting = TRUE //One at a time!! diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm index 9e46203483..2eace3a94d 100644 --- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm @@ -116,7 +116,7 @@ /obj/structure/bloodsucker/vassalrack/examine(mob/user) . = ..() - if(isvamp(user) || isobserver(user)) + if(isbloodsucker(user) || isobserver(user)) . += {"This is the vassal rack, which allows you to thrall crewmembers into loyal minions in your service."} . += {"You need to first secure the vassal rack by clicking on it while it is in your lair."} . += {"Simply click and hold on a victim, and then drag their sprite on the vassal rack. Alt click on the vassal rack to unbuckle them."} @@ -130,7 +130,7 @@ /obj/structure/bloodsucker/vassalrack/MouseDrop_T(atom/movable/O, mob/user) if(!O.Adjacent(src) || O == user || !isliving(O) || !isliving(user) || useLock || has_buckled_mobs() || user.incapacitated()) return - if(!anchored && isvamp(user)) + if(!anchored && isbloodsucker(user)) to_chat(user, "Until this rack is secured in place, it cannot serve its purpose.") return // PULL TARGET: Remember if I was pullin this guy, so we can restore this @@ -183,7 +183,7 @@ /obj/structure/bloodsucker/vassalrack/user_unbuckle_mob(mob/living/M, mob/user) // Attempt Unbuckle - if(!isvamp(user)) + if(!isbloodsucker(user)) if(M == user) M.visible_message("[user] tries to release themself from the rack!",\ "You attempt to release yourself from the rack!") // For sound if not seen --> "You hear a squishy wet noise.") @@ -454,7 +454,7 @@ /obj/structure/bloodsucker/candelabrum/examine(mob/user) . = ..() - if((isvamp()) || isobserver(user)) + if((isbloodsucker()) || isobserver(user)) . += {"This is a magical candle which drains at the sanity of mortals who are not under your command while it is active."} . += {"You can alt click on it from any range to turn it on remotely, or simply be next to it and click on it to turn it on and off normally."} /* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL) @@ -463,12 +463,12 @@ /obj/structure/bloodsucker/candelabrum/attack_hand(mob/user) var/datum/antagonist/vassal/T = user.mind.has_antag_datum(ANTAG_DATUM_VASSAL) - if(isvamp(user) || istype(T)) + if(isbloodsucker(user) || istype(T)) toggle() /obj/structure/bloodsucker/candelabrum/AltClick(mob/user) // Bloodsuckers can turn their candles on from a distance. SPOOOOKY. - if(isvamp(user)) + if(isbloodsucker(user)) toggle() /obj/structure/bloodsucker/candelabrum/proc/toggle(mob/user) @@ -485,7 +485,7 @@ if(lit) for(var/mob/living/carbon/human/H in viewers(7, src)) var/datum/antagonist/vassal/T = H.mind.has_antag_datum(ANTAG_DATUM_VASSAL) - if(isvamp(H) || T) //We dont want vassals or vampires affected by this + if(isbloodsucker(H) || T) //We dont want vassals or vampires affected by this return H.hallucination = 20 SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "vampcandle", /datum/mood_event/vampcandle) diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm index e8ba72e62f..65304c5460 100644 --- a/code/modules/mining/equipment/regenerative_core.dm +++ b/code/modules/mining/equipment/regenerative_core.dm @@ -69,14 +69,15 @@ /obj/item/organ/regenerative_core/afterattack(atom/target, mob/user, proximity_flag) . = ..() - if(proximity_flag && ishuman(target)) + if(proximity_flag) + apply_healing_core(target, user) + +/obj/item/organ/regenerative_core/apply_healing_core(atom/target, mob/user) + if(ishuman(target)) var/mob/living/carbon/human/H = target if(inert) to_chat(user, "[src] has decayed and can no longer be used to heal.") return - if(isvamp(user)) - to_chat(user, "[src] breaks down as it fails to heal your unholy self") - return else if(H.stat == DEAD) to_chat(user, "[src] are useless on the dead.") @@ -87,22 +88,16 @@ else to_chat(user, "You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.") SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self")) - H.revive(full_heal = 1) + if(!isbloodsucker(H)) + H.revive(full_heal = TRUE) + else + H.revive(full_heal = FALSE) qdel(src) user.log_message("[user] used [src] to heal [H]! Wake the fuck up, Samurai!", LOG_ATTACK, color="green") //Logging for 'old' style legion core use, when clicking on a sprite of yourself or another. /obj/item/organ/regenerative_core/attack_self(mob/user) //Knouli's first hack! Allows for the use of the core in hand rather than needing to click on the target, yourself, to selfheal. Its a rip of the proc just above - but skips on distance check and only uses 'user' rather than 'target' - if(ishuman(user)) //Check if user is human, no need for distance check as it's self heal - var/mob/living/carbon/human/H = user //Set H to user rather than target - if(inert) //Inert cores are useless - to_chat(user, "[src] has decayed and can no longer be used to heal.") - return - else //Skip on check if the target to be healed is dead as, if you are dead, you're not going to be able to use it on yourself! - to_chat(user, "You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.") - SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self")) - H.revive(full_heal = 1) - qdel(src) - H.log_message("[H] used [src] to heal themselves! Making use of Knouli's sexy and intelligent use-in-hand proc!", LOG_ATTACK, color="green") //Logging for 'new' style legion core use, when using the core in-hand. + . = ..() + apply_healing_core(user) /obj/item/organ/regenerative_core/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE) diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 6947ab28f8..de65b775b4 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -252,7 +252,7 @@ return 0 if(M.getorgan(/obj/item/organ/alien/hivenode)) return 0 - if(isvamp(M)) + if(isbloodsucker(M)) return 0 if(ismonkey(M)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 574a5aedd2..d07785873a 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -837,7 +837,7 @@ /mob/living/carbon/proc/can_defib() var/tlimit = DEFIB_TIME_LIMIT * 10 var/obj/item/organ/heart = getorgan(/obj/item/organ/heart) - if(suiciding || hellbound || HAS_TRAIT(src, TRAIT_HUSK)) + if(suiciding || hellbound || HAS_TRAIT(src, TRAIT_HUSK) || isbloodsucker()) return if((world.time - timeofdeath) > tlimit) return