diff --git a/code/__DEFINES/antagonists.dm b/code/__DEFINES/antagonists.dm index b2f05fd5f8..058fd864bd 100644 --- a/code/__DEFINES/antagonists.dm +++ b/code/__DEFINES/antagonists.dm @@ -40,3 +40,19 @@ #define NOT_DOMINATING -1 #define MAX_LEADERS_GANG 4 #define INITIAL_DOM_ATTEMPTS 3 + +//Bloodsucker defines +// Bloodsucker related antag datums +#define ANTAG_DATUM_BLOODSUCKER /datum/antagonist/bloodsucker +#define ANTAG_DATUM_VASSAL /datum/antagonist/vassal +//#define ANTAG_DATUM_HUNTER /datum/antagonist/vamphunter Disabled for now + +// BLOODSUCKER +#define BLOODSUCKER_LEVEL_TO_EMBRACE 3 +#define BLOODSUCKER_FRENZY_TIME 25 // How long the vamp stays in frenzy. +#define BLOODSUCKER_FRENZY_OUT_TIME 300 // How long the vamp goes back into frenzy. +#define BLOODSUCKER_STARVE_VOLUME 5 // Amount of blood, below which a Vamp is at risk of frenzy. + +#define CAT_STRUCTURE "Structures" + +#define MARTIALART_HUNTER "hunter-fu" diff --git a/code/__DEFINES/atom_hud.dm b/code/__DEFINES/atom_hud.dm index 0e4f0f3a6e..322a150617 100644 --- a/code/__DEFINES/atom_hud.dm +++ b/code/__DEFINES/atom_hud.dm @@ -58,6 +58,7 @@ #define ANTAG_HUD_SOULLESS 21 #define ANTAG_HUD_CLOCKWORK 22 #define ANTAG_HUD_BROTHER 23 +#define ANTAG_HUD_BLOODSUCKER 24 // Notification action types #define NOTIFY_JUMP "jump" diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index b316c003a9..d5e3f828b8 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -35,6 +35,8 @@ #define ROLE_LAVALAND "lavaland" #define ROLE_INTERNAL_AFFAIRS "internal affairs agent" #define ROLE_GANG "gangster" +#define ROLE_BLOODSUCKER "bloodsucker" +//#define ROLE_MONSTERHUNTER "monster hunter" Disabled for now //Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR. //The gamemode specific ones are just so the gamemodes can query whether a player is old enough @@ -60,7 +62,9 @@ GLOBAL_LIST_INIT(special_roles, list( ROLE_OVERTHROW = /datum/game_mode/overthrow, ROLE_INTERNAL_AFFAIRS = /datum/game_mode/traitor/internal_affairs, ROLE_SENTIENCE, - ROLE_GANG = /datum/game_mode/gang + ROLE_GANG = /datum/game_mode/gang, + ROLE_BLOODSUCKER = /datum/game_mode/bloodsucker + //ROLE_MONSTERHUNTER Disabled for now )) //Job defines for what happens when you fail to qualify for any job during job selection diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index f9360117bb..d772680ce4 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -46,7 +46,7 @@ #define STATUS_EFFECT_SLEEPING /datum/status_effect/incapacitating/sleeping //the affected is asleep -#define STATUS_EFFECT_TASED /datum/status_effect/electrode //the affected has been tased, preventing fine muscle control +#define STATUS_EFFECT_TASED /datum/status_effect/no_combat_mode/electrode/ //the affected has been tased, preventing fine muscle control #define STATUS_EFFECT_PACIFY /datum/status_effect/pacify //the affected is pacified, preventing direct hostile actions @@ -83,6 +83,9 @@ #define STATUS_EFFECT_BREASTS_ENLARGEMENT /datum/status_effect/chem/breast_enlarger //Applied slowdown due to the ominous bulk. #define STATUS_EFFECT_PENIS_ENLARGEMENT /datum/status_effect/chem/penis_enlarger //More applied slowdown, just like the above. + +#define STATUS_EFFECT_NO_COMBAT_MODE /datum/status_effect/no_combat_mode //Wont allow combat mode and will disable it +#define STATUS_EFFECT_MESMERIZE /datum/status_effect/no_combat_mode/mesmerize //Just reskinned no_combat_mode ///////////// // NEUTRAL // ///////////// diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 14dbd97ffa..8cc8960b01 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -127,6 +127,12 @@ #define TRAIT_ABDUCTOR_TRAINING "abductor-training" #define TRAIT_ABDUCTOR_SCIENTIST_TRAINING "abductor-scientist-training" #define TRAIT_SURGEON "surgeon" +#define TRAIT_COLDBLOODED "coldblooded" // Your body is literal room temperature. Does not make you immune to the temp. +#define TRAIT_NONATURALHEAL "nonaturalheal" // Only Admins can heal you. NOTHING else does it unless it's given the god tag. +#define TRAIT_NORUNNING "norunning" // You walk! +#define TRAIT_NOMARROW "nomarrow" // You don't make blood, with chemicals or nanites. +#define TRAIT_NOPULSE "nopulse" // Your heart doesn't beat. + //non-mob traits #define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 7f2fca9d98..3b5f851333 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -349,6 +349,13 @@ devilsouldisplay = new /obj/screen/devil/soul_counter infodisplay += devilsouldisplay + blood_display = new /obj/screen/bloodsucker/blood_counter // Blood Volume + infodisplay += blood_display + vamprank_display = new /obj/screen/bloodsucker/rank_counter // Vampire Rank + infodisplay += vamprank_display + sunlight_display = new /obj/screen/bloodsucker/sunlight_counter // Sunlight + infodisplay += sunlight_display + zone_select = new /obj/screen/zone_sel() zone_select.icon = ui_style zone_select.update_icon(mymob) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 9cb0c52b9a..f082f2ad16 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -110,7 +110,7 @@ totitemdamage *= 0.5 //CIT CHANGES END HERE apply_damage(totitemdamage, I.damtype) //CIT CHANGE - replaces I.force with totitemdamage - if(I.damtype == BRUTE) + if(I.damtype == BRUTE && !HAS_TRAIT(src, TRAIT_NOMARROW)) if(prob(33)) I.add_mob_blood(src) var/turf/location = get_turf(src) @@ -163,4 +163,3 @@ /obj/item/proc/getweight() return total_mass || w_class * 1.25 - diff --git a/code/datums/hud.dm b/code/datums/hud.dm index 32bce89f4d..169b08dc98 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -27,6 +27,7 @@ GLOBAL_LIST_INIT(huds, list( ANTAG_HUD_SOULLESS = new/datum/atom_hud/antag/hidden(), ANTAG_HUD_CLOCKWORK = new/datum/atom_hud/antag(), ANTAG_HUD_BROTHER = new/datum/atom_hud/antag/hidden(), + ANTAG_HUD_BLOODSUCKER = new/datum/atom_hud/antag/bloodsucker() )) /datum/atom_hud diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index 94a64c3bd4..a6e4c8ed4f 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -198,3 +198,48 @@ description = "It feels quite cold out here.\n" mood_change = -2 timeout = 1 MINUTES + +/datum/mood_event/vampcandle + description = "Something is making your mind feel... loose...\n" + mood_change = -10 + timeout = 1 MINUTES + +/datum/mood_event/drankblood_bad + description = "I drank the blood of a lesser creature. Disgusting.\n" + mood_change = -4 + timeout = 900 + +/datum/mood_event/drankblood_dead + description = "I drank dead blood. I am better than this.\n" + mood_change = -7 + timeout = 900 + +/datum/mood_event/drankblood_synth + description = "I drank synthetic blood. What is wrong with me?\n" + mood_change = -7 + timeout = 900 + +/datum/mood_event/drankkilled + description = "I drank from my victim until they died. I feel...less human.\n" + mood_change = -12 + timeout = 6000 + +/datum/mood_event/madevamp + description = "A soul has been cursed to undeath by my own hand.\n" + mood_change = -10 + timeout = 10000 + +/datum/mood_event/vampatefood + description = "Mortal nourishment no longer sustains me. I feel unwell.\n" + mood_change = -6 + timeout = 1000 + +/datum/mood_event/daylight_1 + description = "I slept poorly in a makeshift coffin during the day.\n" + mood_change = -3 + timeout = 1000 + +/datum/mood_event/daylight_2 + description = "I have been scorched by the unforgiving rays of the sun.\n" + mood_change = -6 + timeout = 1200 diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index 9ae7ba2289..6b4fa5e636 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -134,6 +134,15 @@ mood_change = 3 timeout = 3000 +/datum/mood_event/drankblood + description = "I have fed greedly from that which nourishes me.\n" + mood_change = 10 + timeout = 900 + +/datum/mood_event/coffinsleep + description = "I slept in a coffin during the day. I feel whole again.\n" + mood_change = 8 + timeout = 1200 //Cursed stuff below. /datum/mood_event/orgasm diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index d1196a7753..96d293543d 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -80,34 +80,55 @@ desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are." icon_state = "asleep" -//TASER -/datum/status_effect/electrode - id = "tased" +/datum/status_effect/no_combat_mode/ + id = "no_combat_mode" blocks_combatmode = TRUE - status_type = STATUS_EFFECT_REPLACE alert_type = null + status_type = STATUS_EFFECT_REPLACE -/datum/status_effect/electrode/on_creation(mob/living/new_owner, set_duration) +/datum/status_effect/no_combat_mode/on_creation(mob/living/new_owner, set_duration) if(isnum(set_duration)) duration = set_duration . = ..() + if(iscarbon(owner)) + var/mob/living/carbon/C = owner + if(C.combatmode) + C.toggle_combat_mode(TRUE) + +/datum/status_effect/no_combat_mode/mesmerize + id = "Mesmerize" + alert_type = /obj/screen/alert/status_effect/mesmerized + +/obj/screen/alert/status_effect/mesmerized + name = "Mesmerized" + desc = "You cant tear your sight from who is in front of you...Their gaze is simply too enthralling.." + icon = 'icons/mob/actions/bloodsucker.dmi' + icon_state = "power_mez" + +/datum/status_effect/no_combat_mode/electrode + id = "tased" + +/datum/status_effect/no_combat_mode/electrode/on_creation(mob/living/new_owner, set_duration) + if(isnum(set_duration)) //TODO, figure out how to grab from subtype + duration = set_duration + . = ..() if(iscarbon(owner)) var/mob/living/carbon/C = owner if(C.combatmode) C.toggle_combat_mode(TRUE) C.add_movespeed_modifier(MOVESPEED_ID_TASED_STATUS, TRUE, override = TRUE, multiplicative_slowdown = 8) -/datum/status_effect/electrode/on_remove() +/datum/status_effect/no_combat_mode/electrode/on_remove() if(iscarbon(owner)) var/mob/living/carbon/C = owner C.remove_movespeed_modifier(MOVESPEED_ID_TASED_STATUS) . = ..() -/datum/status_effect/electrode/tick() +/datum/status_effect/no_combat_mode/electrode/tick() if(owner) owner.adjustStaminaLoss(5) //if you really want to try to stamcrit someone with a taser alone, you can, but it'll take time and good timing. -/datum/status_effect/electrode/nextmove_modifier() //why is this a proc. its no big deal since this doesnt get called often at all but literally w h y +/datum/status_effect/no_combat_mode/electrode/nextmove_modifier() //why is this a proc. its no big deal since this doesnt get called often at all but literally w h y return 2 //OTHER DEBUFFS @@ -702,4 +723,4 @@ datum/status_effect/pacify if(LAZYLEN(targets) && I) to_chat(owner, "Your arm spasms!") owner.log_message("threw [I] due to a Muscle Spasm", LOG_ATTACK) - owner.throw_item(pick(targets)) \ No newline at end of file + owner.throw_item(pick(targets)) diff --git a/code/game/gamemodes/bloodsucker/bloodsucker.dm b/code/game/gamemodes/bloodsucker/bloodsucker.dm new file mode 100644 index 0000000000..e784fd836d --- /dev/null +++ b/code/game/gamemodes/bloodsucker/bloodsucker.dm @@ -0,0 +1,292 @@ + +/datum/game_mode + var/list/datum/mind/bloodsuckers = list() // List of minds belonging to this game mode. + var/list/datum/mind/vassals = list() // List of minds that have been turned into Vassals. + //var/list/datum/mind/vamphunters = list() // List of minds hunting vampires. Disabled at the moment + var/obj/effect/sunlight/bloodsucker_sunlight // Sunlight Timer. Created on first Bloodsucker assign. Destroyed on last removed Bloodsucker. + + // LISTS // + 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) + // The antags you're allowed to be if turning Vassal. + +/datum/game_mode/bloodsucker + name = "bloodsucker" + config_tag = "bloodsucker" + traitor_name = "Bloodsucker" + antag_flag = ROLE_BLOODSUCKER + false_report_weight = 1 + restricted_jobs = list("AI","Cyborg") + protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster") + required_players = 20 + required_enemies = 2 + recommended_enemies = 4 + reroll_friendly = FALSE + enemy_minimum_age = 7 + round_ends_with_antag_death = FALSE + + + announce_span = "danger" + announce_text = "Filthy, bloodsucking vampires are crawling around disguised as crewmembers!\n\ + Bloodsuckers: The crew are cattle, while you are both shepherd and slaughterhouse.\n\ + Crew: Put an end to the undead infestation before the station is overcome!" + +/datum/game_mode/bloodsucker/generate_report() + return "Reports indicate that some of your crew may have toppled statues in the past week, angering the gods and becoming cursed with undeath and a desire for blood. Watch out for crewmembers that seem to shun the light or are found pale and delirious." + +// Seems to be run by game ONCE, and finds all potential players to be antag. +/datum/game_mode/bloodsucker/pre_setup() + + // Set Restricted Jobs + if(CONFIG_GET(flag/protect_roles_from_antagonist)) + restricted_jobs += protected_jobs + + if(CONFIG_GET(flag/protect_assistant_from_antagonist)) + restricted_jobs += "Assistant" + + // Set number of Vamps + recommended_enemies = CLAMP(round(num_players()/10), 1, 6); + + // Select Antags + for(var/i = 0, i < recommended_enemies, i++) + if (!antag_candidates.len) + break + var/datum/mind/bloodsucker = pick(antag_candidates) + // Can we even BE a bloodsucker? + //if (can_make_bloodsucker(bloodsucker, display_warning=FALSE)) + bloodsuckers += bloodsucker + bloodsucker.restricted_roles = restricted_jobs + log_game("[bloodsucker.key] (ckey) has been selected as a Bloodsucker.") + antag_candidates.Remove(bloodsucker) // Apparently you can also write antag_candidates -= bloodsucker + + // Assign Hunters (as many as monsters, plus one) + //assign_monster_hunters(bloodsuckers.len, TRUE, bloodsuckers) // Disabled for now + + // Do we have enough vamps to continue? + return bloodsuckers.len >= required_enemies + + +// 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)) + 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) + return + bloodsucker_sunlight = new () + +// End Sun (last bloodsucker removed) +/datum/game_mode/proc/check_cancel_sunlight() + // No Sunlight + if (!istype(bloodsucker_sunlight)) + return + if (bloodsuckers.len <= 0) + bloodsucker_sunlight.cancel_me = TRUE + qdel(bloodsucker_sunlight) + bloodsucker_sunlight = null + +/datum/game_mode/proc/is_daylight() + return istype(bloodsucker_sunlight) && bloodsucker_sunlight.amDay + +////////////////////////////////////////////////////////////////////////////// + + +/datum/game_mode/proc/can_make_bloodsucker(datum/mind/bloodsucker, datum/mind/creator, display_warning=TRUE) // Creator is just here so we can display fail messages to whoever is turning us. + // No Mind + if(!bloodsucker || !bloodsucker.key) // KEY is client login? + //if(creator) // REMOVED. You wouldn't see their name if there is no mind, so why say anything? + // to_chat(creator, "[bloodsucker] isn't self-aware enough to be raised as a Bloodsucker!") + return FALSE + // Current body is invalid + if(!ishuman(bloodsucker.current))// && !ismonkey(bloodsucker.current)) + if(display_warning && creator) + to_chat(creator, "[bloodsucker] isn't evolved enough to be raised as a Bloodsucker!") + return FALSE + // Species Must have a HEART (Sorry Plasmabois) + var/mob/living/carbon/human/H = bloodsucker.current + if(NOBLOOD in H.dna.species.species_traits) + if(display_warning && creator) + to_chat(creator, "[bloodsucker]'s DNA isn't compatible!") + return FALSE + // Already a Non-Human Antag + if(bloodsucker.has_antag_datum(/datum/antagonist/abductor) || bloodsucker.has_antag_datum(/datum/antagonist/devil) || bloodsucker.has_antag_datum(/datum/antagonist/changeling)) + return FALSE + // Already a vamp + if(bloodsucker.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + if(display_warning && creator) + to_chat(creator, "[bloodsucker] is already a Bloodsucker!") + return FALSE + // Not High Enough + if(creator) + var/datum/antagonist/bloodsucker/creator_bloodsucker = creator.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(!istype(creator_bloodsucker) || creator_bloodsucker.vamplevel < BLOODSUCKER_LEVEL_TO_EMBRACE) + to_chat(creator, "Your blood is too thin to turn this corpse!") + return FALSE + return TRUE + + +/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)) + return FALSE + + // Create Datum: Fledgling + var/datum/antagonist/bloodsucker/A + + // [FLEDGLING] + 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() + + +/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) + 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) + //message_admins("DEBUG2: can_make_vassal() Abort: No reagents") + // return 0 + // Check Overdose: Did my current volume go over the Overdose threshold? + //var/am_addicted = 0 + //for (var/datum/reagent/blood/vampblood/blood in target.reagents.addiction_list) // overdosed is tracked in reagent_list, not addiction_list. + //message_admins("DEBUG3: can_make_vassal() Found Blood! [blood] [blood.overdose]") + //if (blood.overdosed) + // am_addicted = 1 // Blood is present in addiction? That's all we need. + // break + + //if (!am_addicted) + //message_admins("DEBUG4: can_make_vassal() Abort: No Blood") + // return 0 + // No Mind! + 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) + to_chat(creator, "[target] is already your loyal Vassal!") + else + 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) + to_chat(creator, "[target] resists the power of your blood to dominate their mind!") + return FALSE + return TRUE + + +/datum/game_mode/proc/AmValidAntag(datum/mind/M) + // No List? + if(!islist(M.antag_datums) || M.antag_datums.len == 0) + return FALSE + // Am I NOT an invalid Antag? NOTE: We already excluded non-antags above. Don't worry about the "No List?" check in AmInvalidIntag() + return !AmInvalidAntag(M) + +/datum/game_mode/proc/AmInvalidAntag(datum/mind/M) + // No List? + if(!islist(M.antag_datums) || M.antag_datums.len == 0) + 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]") + 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)) + return FALSE + // Make Vassal + var/datum/antagonist/vassal/V = new (target.mind) + var/datum/antagonist/bloodsucker/B = creator.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + V.master = B + 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 + 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 + +/datum/game_mode/proc/remove_vassal(datum/mind/vassal) + vassal.remove_antag_datum(ANTAG_DATUM_VASSAL) diff --git a/code/game/gamemodes/bloodsucker/hunter.dm b/code/game/gamemodes/bloodsucker/hunter.dm new file mode 100644 index 0000000000..cec990e9c3 --- /dev/null +++ b/code/game/gamemodes/bloodsucker/hunter.dm @@ -0,0 +1,50 @@ + + +/* +// Called from game mode pre_setup() +/datum/game_mode/proc/assign_monster_hunters(monster_count = 4, guaranteed_hunters = FALSE, list/datum/mind/exclude_from_hunter) + + // Not all game modes GUARANTEE a hunter + if (rand(0,2) == 0) // 50% of the time, we get fewer or NO Hunters + if (!guaranteed_hunters) + return + else + monster_count /= 2 + + var/list/no_hunter_jobs = list("AI","Cyborg") + + // Set Restricted Jobs + if(CONFIG_GET(flag/protect_roles_from_antagonist)) + no_hunter_jobs += list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster") + + if(CONFIG_GET(flag/protect_assistant_from_antagonist)) + no_hunter_jobs += "Assistant" + + // Find Valid Hunters + var/list/datum/mind/hunter_candidates = get_players_for_role(ROLE_MONSTERHUNTER) + + // Assign Hunters (as many as vamps, plus one) + for(var/i = 1, i < monster_count, i++) // Start at 1 so we skip Hunters if there's only one sucker. + if (!hunter_candidates.len) + break + // Assign Hunter + var/datum/mind/hunter = pick(hunter_candidates) + hunter_candidates.Remove(hunter) // Remove Either Way + // Already Antag? Skip + if (islist(exclude_from_hunter) && (locate(hunter) in exclude_from_hunter)) //if (islist(hunter.antag_datums) && hunter.antag_datums.len) + i -- + continue + // NOTE: + vamphunters += hunter + hunter.restricted_roles = no_hunter_jobs + log_game("[hunter.key] (ckey) has been selected as a Hunter.") + +// Called from game mode post_setup() +/datum/game_mode/proc/finalize_monster_hunters(monster_count = 4) + var/amEvil = TRUE // First hunter is always an evil boi + for(var/datum/mind/hunter in vamphunters) + var/datum/antagonist/vamphunter/A = new (hunter) + A.bad_dude = amEvil + hunter.add_antag_datum(A) + amEvil = FALSE // Every other hunter is just a boring greytider +*/ diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm index 06efc113da..01c11d8b0b 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm @@ -734,3 +734,31 @@ #undef ABDUCTOR_MAX_TEAMS #undef REVENANT_SPAWN_THRESHOLD + +////////////////////////////////////////////// +// // +// BLOODSUCKERS // +// // +////////////////////////////////////////////// + +/datum/dynamic_ruleset/latejoin/bloodsucker + name = "Bloodsucker Infiltrator" + config_tag = "latejoin_bloodsucker" + antag_datum = ANTAG_DATUM_BLOODSUCKER + antag_flag = ROLE_TRAITOR + restricted_roles = list("AI", "Cyborg") + protected_roles = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster") + required_candidates = 1 + weight = 3 + cost = 10 + requirements = list(90,80,70,60,55,50,45,40,35,30) + high_population_requirement = 30 + repeatable = TRUE + +/datum/dynamic_ruleset/latejoin/bloodsucker/execute() + var/mob/M = pick(candidates) + assigned += M.mind + M.mind.special_role = antag_flag + if(mode.make_bloodsucker(M.mind)) + mode.bloodsuckers += M + return TRUE diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index 56b02a1364..2d476eab19 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -778,3 +778,42 @@ var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10) spawn_meteors(ramp_up_final, wavetype) + +////////////////////////////////////////////// +// // +// BLOODSUCKERS // +// // +////////////////////////////////////////////// + +/datum/dynamic_ruleset/roundstart/bloodsucker + name = "Bloodsuckers" + config_tag = "bloodsucker" + persistent = TRUE + antag_flag = ROLE_BLOODSUCKER + antag_datum = ANTAG_DATUM_BLOODSUCKER + minimum_required_age = 0 + protected_roles = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Head of Personnel", "Chief Engineer", "Chief Medical Officer", "Research Director", "Quartermaster") + restricted_roles = list("Cyborg", "AI") + required_candidates = 1 + weight = 2 + cost = 15 + scaling_cost = 10 + requirements = list(90,80,70,60,50,50,50,50,50,50) + high_population_requirement = 50 + antag_cap = list(1,1,1,1,1,2,2,2,2,2) + +/datum/dynamic_ruleset/roundstart/bloodsucker/pre_execute() + var/num_bloodsuckers = antag_cap[indice_pop] * (scaled_times + 1) + for (var/i = 1 to num_bloodsuckers) + var/mob/M = pick_n_take(candidates) + assigned += M.mind + M.mind.special_role = ROLE_BLOODSUCKER + M.mind.restricted_roles = restricted_roles + return TRUE + +/datum/dynamic_ruleset/roundstart/bloodsucker/execute() + mode.check_start_sunlight() + for(var/datum/mind/M in assigned) + if(mode.make_bloodsucker(M)) + mode.bloodsuckers += M + return TRUE diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 4d7b346241..a56bf8da43 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -81,6 +81,7 @@ ///Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things /datum/game_mode/proc/post_setup(report) //Gamemodes can override the intercept report. Passing TRUE as the argument will force a report. + //finalize_monster_hunters() Disabled for now if(!report) report = !CONFIG_GET(flag/no_intercept_report) addtimer(CALLBACK(GLOBAL_PROC, .proc/display_roundstart_logout_report), ROUNDSTART_LOGOUT_REPORT_TIME) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 6fb5aa47d9..00381b9838 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -412,7 +412,7 @@ SLIME SCANNER if(ishuman(C)) if(H.bleed_rate) msg += "Subject is bleeding!\n" - var/blood_percent = round((C.blood_volume / (BLOOD_VOLUME_NORMAL * C.blood_ratio))*100) + var/blood_percent = round((C.scan_blood_volume() / (BLOOD_VOLUME_NORMAL * C.blood_ratio))*100) var/blood_type = C.dna.blood_type if(blood_id != ("blood" || "jellyblood"))//special blood substance var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id] @@ -420,12 +420,12 @@ SLIME SCANNER blood_type = R.name else blood_type = blood_id - if(C.blood_volume <= (BLOOD_VOLUME_SAFE*C.blood_ratio) && C.blood_volume > (BLOOD_VOLUME_OKAY*C.blood_ratio)) - msg += "LOW blood level [blood_percent] %, [C.blood_volume] cl, type: [blood_type]\n" - else if(C.blood_volume <= (BLOOD_VOLUME_OKAY*C.blood_ratio)) - msg += "CRITICAL blood level [blood_percent] %, [C.blood_volume] cl, type: [blood_type]\n" + if(C.scan_blood_volume() <= (BLOOD_VOLUME_SAFE*C.blood_ratio) && C.scan_blood_volume() > (BLOOD_VOLUME_OKAY*C.blood_ratio)) + msg += "LOW blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" + else if(C.scan_blood_volume() <= (BLOOD_VOLUME_OKAY*C.blood_ratio)) + msg += "CRITICAL blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" else - msg += "Blood level [blood_percent] %, [C.blood_volume] cl, type: [blood_type]\n" + msg += "Blood level [blood_percent] %, [C.scan_blood_volume()] cl, type: [blood_type]\n" var/cyberimp_detect for(var/obj/item/organ/cyberimp/CI in C.internal_organs) diff --git a/code/game/objects/items/implants/implant_mindshield.dm b/code/game/objects/items/implants/implant_mindshield.dm index 2a99c6e1ec..52f9f3b9a4 100644 --- a/code/game/objects/items/implants/implant_mindshield.dm +++ b/code/game/objects/items/implants/implant_mindshield.dm @@ -26,6 +26,9 @@ if(target.mind.has_antag_datum(/datum/antagonist/brainwashed)) target.mind.remove_antag_datum(/datum/antagonist/brainwashed) + if(target.mind.has_antag_datum(ANTAG_DATUM_VASSAL)) + SSticker.mode.remove_vassal(target.mind) + if(target.mind.has_antag_datum(/datum/antagonist/rev/head) || target.mind.unconvertable || target.mind.has_antag_datum(/datum/antagonist/gang/boss)) if(!silent) target.visible_message("[target] seems to resist the implant!", "You feel something interfering with your mental conditioning, but you resist it!") diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 33a895cad7..82aea26eda 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -228,7 +228,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \ /obj/item/stack/sheet/mineral/wood name = "wooden plank" - desc = "One can only guess that this is a bunch of wood." + desc = "One can only guess that this is a bunch of wood. You might be able to make a stake with this if you use something sharp on it" singular_name = "wood plank" icon_state = "sheet-wood" item_state = "sheet-wood" @@ -240,6 +240,35 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \ novariants = TRUE grind_results = list("carbon" = 20) + +/obj/item/stack/sheet/mineral/wood/attackby(obj/item/W, mob/user, params) // NOTE: sheet_types.dm is where the WOOD stack lives. Maybe move this over there. + // Taken from /obj/item/stack/rods/attackby in [rods.dm] + if(W.get_sharpness()) + user.visible_message("[user] begins whittling [src] into a pointy object.", \ + "You begin whittling [src] into a sharp point at one end.", \ + "You hear wood carving.") + // 8 Second Timer + if(!do_after(user, 80, TRUE, src)) + return + // Make Stake + var/obj/item/stake/basic/new_item = new(user.loc) + user.visible_message("[user] finishes carving a stake out of [src].", \ + "You finish carving a stake out of [src].") + // Prepare to Put in Hands (if holding wood) + var/obj/item/stack/sheet/mineral/wood/N = src + var/replace = (user.get_inactive_held_item() == N) + // Use Wood + N.use(1) + // If stack depleted, put item in that hand (if it had one) + if (!N && replace) + user.put_in_hands(new_item) + if(istype(W, merge_type)) + var/obj/item/stack/S = W + if(merge(S)) + to_chat(user, "Your [S.name] stack now contains [S.get_amount()] [S.singular_name]\s.") + else + . = ..() + /obj/item/stack/sheet/mineral/wood/Initialize(mapload, new_amount, merge = TRUE) recipes = GLOB.wood_recipes return ..() @@ -696,5 +725,3 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra merge_type = /obj/item/stack/sheet/cotton/durathread pull_effort = 70 loom_result = /obj/item/stack/sheet/durathread - - diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 23703c7891..e416b2b436 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -79,6 +79,15 @@ material_drop = /obj/item/stack/sheet/mineral/wood material_drop_amount = 5 +/obj/structure/closet/crate/coffin/examine(mob/user) + . = ..() + if(user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + . += {"This is a coffin which you can use to regenerate your burns and other wounds faster."} + . += {"You can also thicken your blood if you survive the day, and hide from the sun safely while inside."} + /* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL) + . += {"This is a coffin which your master can use to shield himself from the unforgiving sun.\n + You yourself are still human and dont need it. Yet."} */ + /obj/structure/closet/crate/internals desc = "An internals crate." name = "internals crate" diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index a7f751e63c..ba45ae5ef0 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -20,10 +20,9 @@ return if(broken || !Adjacent(user)) return - + if(ishuman(user)) var/mob/living/carbon/human/H = user - //see code/modules/mob/dead/new_player/preferences.dm at approx line 545 for comments! //this is largely copypasted from there. diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_flaws.dm b/code/modules/antagonists/bloodsucker/bloodsucker_flaws.dm new file mode 100644 index 0000000000..77169efd61 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/bloodsucker_flaws.dm @@ -0,0 +1,84 @@ + +// Getting Flaws: +// +// Killing crew +// +// Gaining ranks + + + +// * COMPULSION * Things you must do +// +// SELECTIVE: -Gender/BloodType/Job sustains you, but others give you less. +// + + + + +// * WEAKNESSES * Things that may harm you +// +// LIGHTS: -Bright light nullifies the Examine benefits of Masquerade. +// -Bright lights disable your healing (including in Torpor) +// +// STAKES: -Stakes kill you immediately. +// +// PAINFUL: -Your feed victims scream, despite being unconscious. +// +// FIRE: -You only need your max health (not x2) in fire damage to die. +// +// CORPSE: -Your Masquerade turns off when unconscious or crit. +// +// FERAL: - +// +// CRAVEN + + + + + + + + + + + + + + // BANES // + +// These are basically small weaknesses that affect your character in certain circumstances. +// As a rule, they should be specific as to when they happen, or have only some certain +// drawback. + +// (core ideas) +// SENSITIVE: You are slightly blinded by bright lights. +// DARKFRIEND: Your automatic healing is at a crawl when in bright light. +// TRADITIONAL: Every five minutes spent outside a coffin lowers your rate of automatic healing. +// CONSUMED: Every five minutes spent outside a coffin increases the rate at which your blood ticks down. +// GOURMAND: Animals and blood bags offer you no nourishment when feeding. +// DEATHMASK: You no longer fake having a heartbeat, and always show up as pale when examined. +// BESTIAL: When your blood is low, you will twitch involuntarily. + +// (alternate ideas) +// STERILE: There is a high chance that turning corpses to Bloodsuckers will fail, and further attempts on them by you are impossible. +// FERAL: You're a threat to Vampire-kind: New Bloodsuckers may have an Objective to destroy you. +// UNHOLY: The Chapel, the Bible, and Holy Water set you on fire. +// PARANOID: Only your own claimed coffin counts for healing and banes. + + +// ON LEVEL-UP: +// Burn Damage increases +// Regen Rate increases +// Max Punch Damage increase +// Reset Level Timer +// Select Bane + + +// How to Burn Vamps: +// C.adjustFireLoss(20) +// C.adjust_fire_stacks(6) +// C.IgniteMob() + + +/datum/antagonist/bloodsucker/proc/AssignRandomBane() + return \ No newline at end of file diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_integration.dm b/code/modules/antagonists/bloodsucker/bloodsucker_integration.dm new file mode 100644 index 0000000000..bf4ae4b6b5 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/bloodsucker_integration.dm @@ -0,0 +1,148 @@ +// INTEGRATION: Adding Procs and Datums to existing "classes" +/mob/living/proc/AmBloodsucker(falseIfInDisguise=FALSE) + // No Datum + if(!mind || !mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + return FALSE + return TRUE + + +/mob/living/proc/HaveBloodsuckerBodyparts(var/displaymessage="") // displaymessage can be something such as "rising from death" for Torpid Sleep. givewarningto is the person receiving messages. + if(!getorganslot(ORGAN_SLOT_HEART)) + if(displaymessage != "") + to_chat(src, "Without a heart, you are incapable of [displaymessage].") + return FALSE + if(!get_bodypart(BODY_ZONE_HEAD)) + if(displaymessage != "") + to_chat(src, "Without a head, you are incapable of [displaymessage].") + return FALSE + if(!getorgan(/obj/item/organ/brain)) // NOTE: This is mostly just here so we can do one scan for all needed parts when creating a vamp. You probably won't be trying to use powers w/out a brain. + if(displaymessage != "") + to_chat(src, "Without a brain, you are incapable of [displaymessage].") + return FALSE + return TRUE + + + +// GET DAMAGE + + +// Do NOT count the damage on prosthetics for this. +/mob/living/proc/getBruteLoss_nonProsthetic() + return getBruteLoss() + +/mob/living/proc/getFireLoss_nonProsthetic() + return getFireLoss() + +/mob/living/carbon/getBruteLoss_nonProsthetic() + var/amount = 0 + for(var/obj/item/bodypart/BP in bodyparts) + if(BP.status < 2) + amount += BP.brute_dam + return amount + +/mob/living/carbon/getFireLoss_nonProsthetic() + var/amount = 0 + for(var/obj/item/bodypart/BP in bodyparts) + if(BP.status < 2) + amount += BP.burn_dam + return amount + +/mob/living/carbon +// EXAMINING +/mob/living/carbon/human/proc/ReturnVampExamine(var/mob/viewer) + if(!mind || !viewer.mind) + return "" + // Target must be a Vamp + var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(!bloodsuckerdatum) + return "" + // Viewer is Target's Vassal? + if(viewer.mind.has_antag_datum(ANTAG_DATUM_VASSAL) in bloodsuckerdatum.vassals) + var/returnString = "\[This is your Master!\]" + var/returnIcon = "[icon2html('icons/misc/language.dmi', world, "bloodsucker")]" + returnString += "\n" + return returnIcon + returnString + // Viewer not a Vamp AND not the target's vassal? + if(!viewer.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) && !(viewer in bloodsuckerdatum.vassals)) + return "" + // Default String + var/returnString = "\[[bloodsuckerdatum.ReturnFullName(1)]\]" + var/returnIcon = "[icon2html('icons/misc/language.dmi', world, "bloodsucker")]" + + // In Disguise (Veil)? + //if (name_override != null) + // returnString += " ([real_name] in disguise!) " + + //returnString += "\n" Don't need spacers. Using . += "" in examine.dm does this on its own. + return returnIcon + returnString + + +/mob/living/carbon/human/proc/ReturnVassalExamine(var/mob/viewer) + if(!mind || !viewer.mind) + return "" + // Am I not even a Vassal? Then I am not marked. + var/datum/antagonist/vassal/vassaldatum = mind.has_antag_datum(ANTAG_DATUM_VASSAL) + if(!vassaldatum) + return "" + // Only Vassals and Bloodsuckers can recognize marks. + if(!viewer.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) && !viewer.mind.has_antag_datum(ANTAG_DATUM_VASSAL)) + return "" + + // Default String + var/returnString = "\[" + var/returnIcon = "" + // Am I Viewer's Vassal? + if(vassaldatum.master.owner == viewer.mind) + returnString += "This [dna.species.name] bears YOUR mark!" + returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal")]" + // Am I someone ELSE'S Vassal? + else if(viewer.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + returnString += "This [dna.species.name] bears the mark of [vassaldatum.master.ReturnFullName(vassaldatum.master.owner.current,1)]" + returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal_grey")]" + // Are you serving the same master as I am? + else if(viewer.mind.has_antag_datum(ANTAG_DATUM_VASSAL) in vassaldatum.master.vassals) + returnString += "[p_they(TRUE)] bears the mark of your Master" + returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal")]" + // You serve a different Master than I do. + else + returnString += "[p_they(TRUE)] bears the mark of another Bloodsucker" + returnIcon = "[icon2html('icons/misc/mark_icons.dmi', world, "vassal_grey")]" + + returnString += "\]" // \n" Don't need spacers. Using . += "" in examine.dm does this on its own. + return returnIcon + returnString + + +// Am I "pale" when examined? Bloodsuckers can trick this. +/mob/living/carbon/proc/ShowAsPaleExamine() + + // Normal Creatures: + if(!mind || !mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + return blood_volume < (BLOOD_VOLUME_SAFE * blood_ratio) + + var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(bloodsuckerdatum.poweron_masquerade) + return FALSE + + // If a Bloodsucker is malnourished, AND if his temperature matches his surroundings (aka he hasn't fed recently and looks COLD)... + return blood_volume < (BLOOD_VOLUME_OKAY * blood_ratio) // && !(bodytemperature <= get_temperature() + 2) + +/mob/living/carbon/human/ShowAsPaleExamine() + // Check for albino, as per human/examine.dm's check. + if(skin_tone == "albino") + return TRUE + + return ..() // Return vamp check + +/mob/living/carbon/proc/scan_blood_volume() + // Vamps don't show up normally to scanners unless Masquerade power is on ----> scanner.dm + if(mind) + var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if (istype(bloodsuckerdatum) && bloodsuckerdatum.poweron_masquerade) + return BLOOD_VOLUME_NORMAL + return blood_volume + +/mob/living/proc/IsFrenzied() + return FALSE + +/mob/living/proc/StartFrenzy(inTime = 120) + set waitfor = FALSE diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm new file mode 100644 index 0000000000..9174692b49 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm @@ -0,0 +1,361 @@ + + +// TO PLUG INTO LIFE: + +// Cancel BLOOD life +// Cancel METABOLISM life (or find a way to control what gets digested) +// Create COLDBLOODED trait (thermal homeostasis) + +// EXAMINE +// +// Show as dead when... + +/datum/antagonist/bloodsucker/proc/LifeTick()// Should probably run from life.dm, same as handle_changeling, but will be an utter pain to move + set waitfor = FALSE // Don't make on_gain() wait for this function to finish. This lets this code run on the side. + var/notice_healing = FALSE + while(owner && !AmFinalDeath()) // owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) == src + if(owner.current.stat == CONSCIOUS && !poweron_feed && !HAS_TRAIT(owner.current, TRAIT_DEATHCOMA)) // Deduct Blood + AddBloodVolume(-0.1) // -.15 (before tick went from 10 to 30, but we also charge more for faking life now) + if(HandleHealing(1)) // Heal + if(notice_healing == FALSE && owner.current.blood_volume > 0) + to_chat(owner, "The power of your blood begins knitting your wounds...") + notice_healing = TRUE + else if(notice_healing == TRUE) + notice_healing = FALSE // Apply Low Blood Effects + HandleStarving() // Death + HandleDeath() // Standard Update + update_hud()// Daytime Sleep in Coffin + if (SSticker.mode.is_daylight() && !HAS_TRAIT_FROM(owner.current, TRAIT_DEATHCOMA, "bloodsucker")) + if(istype(owner.current.loc, /obj/structure/closet/crate/coffin)) + Torpor_Begin() + // Wait before next pass + sleep(10) + FreeAllVassals() // Free my Vassals! (if I haven't yet) + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// BLOOD + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/antagonist/bloodsucker/proc/AddBloodVolume(value) + owner.current.blood_volume = CLAMP(owner.current.blood_volume + value, 0, maxBloodVolume) + update_hud() + +/datum/antagonist/bloodsucker/proc/HandleFeeding(mob/living/carbon/target, mult=1) + // mult: SILENT feed is 1/3 the amount + var/blood_taken = min(feedAmount, target.blood_volume) * mult // Starts at 15 (now 8 since we doubled the Feed time) + target.blood_volume -= blood_taken + // Simple Animals lose a LOT of blood, and take damage. This is to keep cats, cows, and so forth from giving you insane amounts of blood. + if(!ishuman(target)) + target.blood_volume -= (blood_taken / max(target.mob_size, 0.1)) * 3.5 // max() to prevent divide-by-zero + target.apply_damage_type(blood_taken / 3.5) // Don't do too much damage, or else they die and provide no blood nourishment. + if(target.blood_volume <= 0) + target.blood_volume = 0 + target.death(0) + /////////// + // Shift Body Temp (toward Target's temp, by volume taken) + owner.current.bodytemperature = ((owner.current.blood_volume * owner.current.bodytemperature) + (blood_taken * target.bodytemperature)) / (owner.current.blood_volume + blood_taken) + // our volume * temp, + their volume * temp, / total volume + /////////// + // Reduce Value Quantity + if(target.stat == DEAD) // Penalty for Dead Blood + blood_taken /= 3 + if(!ishuman(target)) // Penalty for Non-Human Blood + blood_taken /= 2 + //if (!iscarbon(target)) // Penalty for Animals (they're junk food) + // Apply to Volume + AddBloodVolume(blood_taken) + // Reagents (NOT Blood!) + if(target.reagents && target.reagents.total_volume) + target.reagents.reaction(owner.current, INGEST, 1) // Run Reaction: what happens when what they have mixes with what I have? + target.reagents.trans_to(owner.current, 1) // Run transfer of 1 unit of reagent from them to me. + // Blood Gulp Sound + owner.current.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// HEALING + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/antagonist/bloodsucker/proc/HandleHealing(mult = 1) + // NOTE: Mult of 0 is just a TEST to see if we are injured and need to go into Torpor! + //It is called from your coffin on close (by you only) + if(poweron_masquerade == TRUE || owner.current.AmStaked()) + return FALSE + owner.current.adjustStaminaLoss(-2 + (regenRate * -10) * mult, 0) // Humans lose stamina damage really quickly. Vamps should heal more. + owner.current.adjustCloneLoss(-1 * (regenRate * 4) * mult, 0) + owner.current.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1 * (regenRate * 4) * mult) //adjustBrainLoss(-1 * (regenRate * 4) * mult, 0) + // No Bleeding + if(ishuman(owner.current)) //NOTE Current bleeding is horrible, not to count the amount of blood ballistics delete. + var/mob/living/carbon/human/H = owner.current + H.bleed_rate = 0 + if(iscarbon(owner.current)) // Damage Heal: Do I have damage to ANY bodypart? + var/mob/living/carbon/C = owner.current + var/costMult = 1 // Coffin makes it cheaper + var/fireheal = 0 // BURN: Heal in Coffin while Fakedeath, or when damage above maxhealth (you can never fully heal fire) + var/amInCoffinWhileTorpor = istype(C.loc, /obj/structure/closet/crate/coffin) && (mult == 0 || HAS_TRAIT(C, TRAIT_DEATHCOMA)) // Check for mult 0 OR death coma. (mult 0 means we're testing from coffin) + if(amInCoffinWhileTorpor) + mult *= 5 // Increase multiplier if we're sleeping in a coffin. + fireheal = min(C.getFireLoss_nonProsthetic(), regenRate) // NOTE: Burn damage ONLY heals in torpor. + costMult = 0.25 + C.ExtinguishMob() + CureDisabilities() // Extinguish Fire + C.remove_all_embedded_objects() // Remove Embedded! + owner.current.regenerate_organs() // Heal Organs (will respawn original eyes etc. but we replace right away, next) + CheckVampOrgans() // Heart, Eyes + else + if(owner.current.blood_volume <= 0) // No Blood? Lower Mult + mult = 0.25 + // Crit from burn? Lower damage to maximum allowed. + //if (C.getFireLoss() > owner.current.getMaxHealth()) + // fireheal = regenRate / 2 + // BRUTE: Always Heal + var/bruteheal = min(C.getBruteLoss_nonProsthetic(), regenRate) + var/toxinheal = min(C.getToxLoss(), regenRate) + // Heal if Damaged + if(bruteheal + fireheal + toxinheal > 0) // Just a check? Don't heal/spend, and return. + if(mult == 0) + return TRUE + // We have damage. Let's heal (one time) + C.adjustBruteLoss(-bruteheal * mult, forced = TRUE)// Heal BRUTE / BURN in random portions throughout the body. + C.adjustFireLoss(-fireheal * mult, forced = TRUE) + C.adjustToxLoss(-toxinheal * mult * 2, forced = TRUE) //Toxin healing because vamps arent immune + //C.heal_overall_damage(bruteheal * mult, fireheal * mult) // REMOVED: We need to FORCE this, because otherwise, vamps won't heal EVER. Swapped to above. + AddBloodVolume((bruteheal * -0.5 + fireheal * -1) / mult * costMult) // Costs blood to heal + return TRUE // Healed! Done for this tick. + if(amInCoffinWhileTorpor) // Limbs? (And I have no other healing) + var/list/missing = owner.current.get_missing_limbs() // Heal Missing + if (missing.len) // Cycle through ALL limbs and regen them! + for (var/targetLimbZone in missing) // 1) Find ONE Limb and regenerate it. + owner.current.regenerate_limb(targetLimbZone, 0) // regenerate_limbs() <--- If you want to EXCLUDE certain parts, do it like this ----> regenerate_limbs(0, list("head")) + var/obj/item/bodypart/L = owner.current.get_bodypart( targetLimbZone ) // 2) Limb returns Damaged + AddBloodVolume(50 * costMult) // Costs blood to heal + L.brute_dam = 60 + to_chat(owner.current, "Your flesh knits as it regrows [L]!") + playsound(owner.current, 'sound/magic/demon_consume.ogg', 50, 1) + // DONE! After regenerating ANY number of limbs, we stop here. + return TRUE + /*else // REMOVED: For now, let's just leave prosthetics on. Maybe you WANT to be a robovamp. + // Remove Prosthetic/False Limb + for(var/obj/item/bodypart/BP in C.bodyparts) + message_admins("T1: [BP] ") + if (istype(BP) && BP.status == 2) + message_admins("T2: [BP] ") + BP.drop_limb() + return TRUE */ + // NOTE: Limbs have a "status", like their hosts "stat". 2 is dead (aka Prosthetic). 1 seems to be idle/alive.*/ + return FALSE + +/datum/antagonist/bloodsucker/proc/CureDisabilities() + var/mob/living/carbon/C = owner.current + C.cure_blind(list(EYE_DAMAGE))//() + C.cure_nearsighted(EYE_DAMAGE) + C.set_blindness(0) // Added 9/2/19 + C.set_blurriness(0) // Added 9/2/19 + C.update_tint() // Added 9/2/19 + C.update_sight() // Added 9/2/19 + for(var/O in C.internal_organs) //owner.current.adjust_eye_damage(-100) // This was removed by TG + var/obj/item/organ/organ = O + organ.setOrganDamage(0) + owner.current.cure_husk() + +// I am thirsty for blud! +/datum/antagonist/bloodsucker/proc/HandleStarving() + + // High: Faster Healing + // Med: Pale + // Low: Twitch + // V.Low: Blur Vision + // EMPTY: Frenzy! + // BLOOD_VOLUME_GOOD: [336] Pale (handled in bloodsucker_integration.dm + // BLOOD_VOLUME_BAD: [224] Jitter + if(owner.current.blood_volume < BLOOD_VOLUME_BAD && !prob(0.5)) + owner.current.Jitter(3) + // BLOOD_VOLUME_SURVIVE: [122] Blur Vision + if(owner.current.blood_volume < BLOOD_VOLUME_BAD / 2) + owner.current.blur_eyes(8 - 8 * (owner.current.blood_volume / BLOOD_VOLUME_BAD)) + // Nutrition + owner.current.nutrition = min(owner.current.blood_volume, NUTRITION_LEVEL_FED) // <-- 350 //NUTRITION_LEVEL_FULL +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// DEATH + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/antagonist/bloodsucker/proc/HandleDeath() + // FINAL DEATH + // Fire Damage? (above double health) + if (owner.current.getFireLoss_nonProsthetic() >= owner.current.getMaxHealth() * 2) + FinalDeath() + return + // Staked while "Temp Death" or Asleep + if (owner.current.StakeCanKillMe() && owner.current.AmStaked()) + FinalDeath() + return + // Not "Alive"? + if (!owner.current || !isliving(owner.current) || isbrain(owner.current) || !get_turf(owner.current)) + FinalDeath() + return + // Missing Brain or Heart? + if (!owner.current.HaveBloodsuckerBodyparts()) + FinalDeath() + return + // Disable Powers: Masquerade * NOTE * This should happen as a FLAW! + //if (stat >= UNCONSCIOUS) + // for (var/datum/action/bloodsucker/masquerade/P in powers) + // P.Deactivate() + // TEMP DEATH + var/total_brute = owner.current.getBruteLoss_nonProsthetic() + var/total_burn = owner.current.getFireLoss_nonProsthetic() + var/total_toxloss = owner.current.getToxLoss() //This is neater than just putting it in total_damage + var/total_damage = total_brute + total_burn + total_toxloss + // Died? Convert to Torpor (fake death) + if (owner.current.stat >= DEAD) + Torpor_Begin() + to_chat(owner, "Your immortal body will not yet relinquish your soul to the abyss. You enter Torpor.") + if (poweron_masquerade == TRUE) + to_chat(owner, "Your wounds will not heal until you disable the Masquerade power.") + // End Torpor: + else // No damage, OR toxin healed AND brute healed and NOT in coffin (since you cannot heal burn) + if (total_damage <= 0 || total_toxloss <= 0 && total_brute <= 0 && !istype(owner.current.loc, /obj/structure/closet/crate/coffin)) + // Not Daytime, Not in Torpor + if (!SSticker.mode.is_daylight() && HAS_TRAIT_FROM(owner.current, TRAIT_DEATHCOMA, "bloodsucker")) + Torpor_End() + // Fake Unconscious + if (poweron_masquerade == TRUE && total_damage >= owner.current.getMaxHealth() - HEALTH_THRESHOLD_FULLCRIT) + owner.current.Unconscious(20,1) + + //HEALTH_THRESHOLD_CRIT 0 + //HEALTH_THRESHOLD_FULLCRIT -30 + //HEALTH_THRESHOLD_DEAD -100 + +/datum/antagonist/bloodsucker/proc/Torpor_Begin(amInCoffin=FALSE) + owner.current.stat = UNCONSCIOUS + owner.current.fakedeath("bloodsucker") // Come after UNCONSCIOUS or else it fails + ADD_TRAIT(owner.current, TRAIT_NODEATH, "bloodsucker") // Without this, you'll just keep dying while you recover. + ADD_TRAIT(owner.current, TRAIT_RESISTHIGHPRESSURE, "bloodsucker") // So you can heal in 0 G. otherwise you just...heal forever. + ADD_TRAIT(owner.current, TRAIT_RESISTLOWPRESSURE, "bloodsucker") // So you can heal in 0 G. otherwise you just...heal forever. + // Visuals + owner.current.update_sight() + owner.current.reload_fullscreen() + // Disable ALL Powers + for (var/datum/action/bloodsucker/power in powers) + if (power.active && !power.can_use_in_torpor) + power.DeactivatePower() + + +/datum/antagonist/bloodsucker/proc/Torpor_End() + owner.current.stat = SOFT_CRIT + owner.current.cure_fakedeath("bloodsucker") // Come after SOFT_CRIT or else it fails + REMOVE_TRAIT(owner.current, TRAIT_NODEATH, "bloodsucker") + REMOVE_TRAIT(owner.current, TRAIT_RESISTHIGHPRESSURE, "bloodsucker") + REMOVE_TRAIT(owner.current, TRAIT_RESISTLOWPRESSURE, "bloodsucker") + to_chat(owner, "You have recovered from Torpor.") + + +/datum/antagonist/proc/AmFinalDeath() + // Standard Antags can be dead OR final death + return owner && (owner.current && owner.current.stat >= DEAD || owner.AmFinalDeath()) + +/datum/antagonist/bloodsucker/AmFinalDeath() + return owner && owner.AmFinalDeath() +/datum/antagonist/changeling/AmFinalDeath() + return owner && owner.AmFinalDeath() + +/datum/mind/proc/AmFinalDeath() + return !current || QDELETED(current) || !isliving(current) || isbrain(current) || !get_turf(current) // NOTE: "isliving()" is not the same as STAT == CONSCIOUS. This is to make sure you're not a BORG (aka silicon) + +/datum/antagonist/bloodsucker/proc/FinalDeath() + if(!iscarbon(owner.current)) //Check for non carbons. + owner.current.gib() + return + playsound(get_turf(owner.current), 'sound/effects/tendril_destroyed.ogg', 60, 1) + owner.current.drop_all_held_items() + owner.current.unequip_everything() + var/mob/living/carbon/C = owner.current + C.remove_all_embedded_objects() + // Make me UN-CLONEABLE + owner.current.hellbound = TRUE // This was done during creation, but let's do it again one more time...to make SURE this guy stays dead, but they dont stay dead because brains can be cloned! + // Free my Vassals! + FreeAllVassals() + // Elders get Dusted + if (vamplevel >= 4) // (vamptitle) + owner.current.visible_message("[owner.current]'s skin crackles and dries, their skin and bones withering to dust. A hollow cry whips from what is now a sandy pile of remains.", \ + "Your soul escapes your withering body as the abyss welcomes you to your Final Death.", \ + "You hear a dry, crackling sound.") + owner.current.dust() + // Fledglings get Gibbed + else + owner.current.visible_message("[owner.current]'s skin bursts forth in a spray of gore and detritus. A horrible cry echoes from what is now a wet pile of decaying meat.", \ + "Your soul escapes your withering body as the abyss welcomes you to your Final Death.", \ + "You hear a wet, bursting sound.") + owner.current.gib(TRUE, FALSE, FALSE)//Brain cloning is wierd and allows hellbounds. Lets destroy the brain for safety. + playsound(owner.current.loc, 'sound/effects/tendril_destroyed.ogg', 40, 1) + + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// HUMAN FOOD + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/mob/proc/CheckBloodsuckerEatFood(var/food_nutrition) + if (!isliving(src)) + return + var/mob/living/L = src + if (!L.AmBloodsucker()) + return + // We're a vamp? Try to eat food... + var/datum/antagonist/bloodsucker/bloodsuckerdatum = mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + bloodsuckerdatum.handle_eat_human_food(food_nutrition) + + +/datum/antagonist/bloodsucker/proc/handle_eat_human_food(var/food_nutrition) // Called from snacks.dm and drinks.dm + set waitfor = FALSE + if (!owner.current || !iscarbon(owner.current)) + return + var/mob/living/carbon/C = owner.current + // Remove Nutrition, Give Bad Food + C.nutrition -= food_nutrition + foodInGut += food_nutrition + // Already ate some bad clams? Then we can back out, because we're already sick from it. + if (foodInGut != food_nutrition) + return + // Haven't eaten, but I'm in a Human Disguise. + else if (poweron_masquerade) + to_chat(C, "Your stomach turns, but your \"human disguise\" keeps the food down...for now.") + // Keep looping until we purge. If we have activated our Human Disguise, we ignore the food. But it'll come up eventually... + var/sickphase = 0 + while (foodInGut) + sleep(50) + C.adjust_disgust(10 * sickphase) + // Wait an interval... + sleep(50 + 50 * sickphase) // At intervals of 100, 150, and 200. (10 seconds, 15 seconds, and 20 seconds) + // Died? Cancel + if(C.stat == DEAD) + return + // Put up disguise? Then hold off the vomit. + if(poweron_masquerade) + if(sickphase > 0) + to_chat(C, "Your stomach settles temporarily. You regain your composure...for now.") + sickphase = 0 + continue + switch(sickphase) + if (1) + to_chat(C, "You feel unwell. You can taste ash on your tongue.") + C.Stun(10) + if (2) + to_chat(C, "Your stomach turns. Whatever you ate tastes of grave dirt and brimstone.") + C.Dizzy(15) + C.Stun(13) + if (3) + to_chat(C, "You purge the food of the living from your viscera! You've never felt worse.") + C.vomit(foodInGut * 4, foodInGut * 2, 0) // (var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1, var/toxic = 0) + C.blood_volume = max(0, C.blood_volume - foodInGut * 2) + C.Stun(30) + //C.Dizzy(50) + foodInGut = 0 + sickphase ++ diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_objectives.dm b/code/modules/antagonists/bloodsucker/bloodsucker_objectives.dm new file mode 100644 index 0000000000..63e1470576 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/bloodsucker_objectives.dm @@ -0,0 +1,351 @@ + + +// Hide a random object somewhere on the station: +// var/turf/targetturf = get_random_station_turf() +// var/turf/targetturf = get_safe_random_station_turf() + + + + +/datum/objective/bloodsucker + martyr_compatible = TRUE + +// GENERATE! +/datum/objective/bloodsucker/proc/generate_objective() + update_explanation_text() + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// // PROCS // // + + +/datum/objective/bloodsucker/proc/return_possible_targets() + var/list/possible_targets = list() + + // Look at all crew members, and for/loop through. + for(var/datum/mind/possible_target in get_crewmember_minds()) + // Check One: Default Valid User + if(possible_target != owner && ishuman(possible_target.current) && possible_target.current.stat != DEAD)// && is_unique_objective(possible_target)) + // Check Two: Am Bloodsucker? OR in Bloodsucker list? + if (possible_target.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) || (possible_target in SSticker.mode.bloodsuckers)) + continue + else + possible_targets += possible_target + + return possible_targets + + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/objective/bloodsucker/lair + +// EXPLANATION +/datum/objective/bloodsucker/lair/update_explanation_text() + explanation_text = "Create a lair by claiming a coffin, and protect it until the end of the shift"// Make sure to keep it safe!" + +// WIN CONDITIONS? +/datum/objective/bloodsucker/lair/check_completion() + var/datum/antagonist/bloodsucker/antagdatum = owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if (antagdatum && antagdatum.coffin && antagdatum.lair) + return TRUE + return FALSE + + // Space_Station_13_areas.dm <--- all the areas + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Vassal becomes a Head, or part of a department +/datum/objective/bloodsucker/protege + + // LOOKUP: /datum/crewmonitor/proc/update_data(z) for .assignment to see how to get a person's PDA. + var/list/roles = list( + "Captain", + "Head of Personnel", + "Research Director", + "Chief Engineer", + "Chief Medical Officer", + "Quartermaster" + ) + var/list/departs = list( + "Research Director", + "Chief Engineer", + "Chief Medical Officer", + "Quartermaster" + ) + + + var/target_role // Equals "HEAD" when it's not a department role. + var/department_string + +// GENERATE! +/datum/objective/bloodsucker/protege/generate_objective() + target_role = rand(0,2) == 0 ? "HEAD" : pick(departs) + + // Heads? + if (target_role == "HEAD") + target_amount = rand(1, round(SSticker.mode.num_players() / 20)) + target_amount = CLAMP(target_amount,1,3) + // Department? + else + switch(target_role) + if("Research Director") + department_string = "Science" + if("Chief Engineer") + department_string = "Engineering" + if("Chief Medical Officer") + department_string = "Medical" + if("Quartermaster") + department_string = "Cargo" + target_amount = rand(round(SSticker.mode.num_players() / 20), round(SSticker.mode.num_players() / 10)) + target_amount = CLAMP(target_amount, 2, 4) + ..() + +// EXPLANATION +/datum/objective/bloodsucker/protege/update_explanation_text() + if (target_role == "HEAD") + if (target_amount == 1) + explanation_text = "Guarantee a Vassal ends up as a Department Head or in a Leadership role." + else + explanation_text = "Guarantee [target_amount] Vassals end up as different Leadership or Department Heads." + else + explanation_text = "Have [target_amount] Vassal[target_amount==1?"":"s"] in the [department_string] department." + +// WIN CONDITIONS? +/datum/objective/bloodsucker/protege/check_completion() + + var/datum/antagonist/bloodsucker/antagdatum = owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if (!antagdatum || antagdatum.vassals.len == 0) + return FALSE + + // Get list of all jobs that are qualified (for HEAD, this is already done) + var/list/valid_jobs + if (target_role == "HEAD") + valid_jobs = roles + else + valid_jobs = list() + var/list/alljobs = subtypesof(/datum/job) // This is just a list of TYPES, not the actual variables! + for(var/T in alljobs) + var/datum/job/J = SSjob.GetJobType(T) // + if (!istype(J)) + continue + // Found a job whose Dept Head matches either list of heads, or this job IS the head + if ((target_role in J.department_head) || target_role == J.title) + valid_jobs += J.title + + + // Check Vassals, and see if they match + var/objcount = 0 + var/list/counted_roles = list() // So you can't have more than one Captain count. + for(var/datum/antagonist/vassal/V in antagdatum.vassals) + if (!V || !V.owner) // Must exist somewhere, and as a vassal. + continue + + var/thisRole = "none" + + // Mind Assigned + if ((V.owner.assigned_role in valid_jobs) && !(V.owner.assigned_role in counted_roles)) + //to_chat(owner, "PROTEGE OBJECTIVE: (MIND ROLE)") + thisRole = V.owner.assigned_role + // Mob Assigned + else if ((V.owner.current.job in valid_jobs) && !(V.owner.current.job in counted_roles)) + //to_chat(owner, "PROTEGE OBJECTIVE: (MOB JOB)") + thisRole = V.owner.current.job + // PDA Assigned + else if (V.owner.current && ishuman(V.owner.current)) + var/mob/living/carbon/human/H = V.owner.current + var/obj/item/card/id/I = H.wear_id ? H.wear_id.GetID() : null + if (I && (I.assignment in valid_jobs) && !(I.assignment in counted_roles)) + //to_chat(owner, "PROTEGE OBJECTIVE: (GET ID)") + thisRole = I.assignment + + // NO MATCH + if (thisRole == "none") + continue + + // SUCCESS! + objcount ++ + if (target_role == "HEAD") + counted_roles += thisRole // Add to list so we don't count it again (but only if it's a Head) + + // NOTE!!!!!!!!!!! + + // Look for jobs value on mobs! This is assigned at start, but COULD be assigned from HoP? + // + // ALSO - Search through all jobs (look for prefs earlier that look for all jobs, and search through all jobs to see if their head matches the head listed, or it IS the head) + // + // ALSO - registered_account in _vending.dm for banks, and assigning new ones. + + //to_chat(antagdatum.owner, "PROTEGE OBJECTIVE: Final Count: [objcount] of [antagdatum.vassals.len] vassals") + return objcount >= target_amount + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Eat blood from a lot of people +/datum/objective/bloodsucker/gourmand + +// HOW: Track each feed (if human). Count victory. + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Convert a crewmate +/datum/objective/bloodsucker/embrace + +// HOW: Find crewmate. Check if person is a bloodsucker + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Defile a facility with blood +/datum/objective/bloodsucker/desecrate + + // Space_Station_13_areas.dm <--- all the areas + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Destroy the Solar Arrays +/datum/objective/bloodsucker/solars + +// Space_Station_13_areas.dm <--- all the areas +/datum/objective/bloodsucker/solars/update_explanation_text() + explanation_text = "Prevent all solar arrays on the station from functioning." + +/datum/objective/bloodsucker/solars/check_completion() + // Sort through all /obj/machinery/power/solar_control in the station ONLY, and check that they are functioning. + // Make sure that lastgen is 0 or connected_panels.len is 0. Doesnt matter if it's tracking. + for (var/obj/machinery/power/solar_control/SC in SSsun.solars) + // Check On Station: + var/turf/T = get_turf(SC) + if(!T || !is_station_level(T.z)) // <------ Taken from NukeOp + //message_admins("DEBUG A: [SC] not on station!") + continue // Not on station! We don't care about this. + if (SC && SC.lastgen > 0 && SC.connected_panels.len > 0 && SC.connected_tracker) + return FALSE + return TRUE + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Steal hearts. You just really wanna have some hearts. +/datum/objective/bloodsucker/heartthief + // NOTE: Look up /steal in objective.dm for inspiration. + +// GENERATE! +/datum/objective/bloodsucker/heartthief/generate_objective() + target_amount = rand(2,3) + + update_explanation_text() + //dangerrating += target_amount * 2 + +// EXPLANATION +/datum/objective/bloodsucker/heartthief/update_explanation_text() + explanation_text = "Steal and keep [target_amount] heart[target_amount == 1 ? "" : "s"]." // TO DO: Limit them to Human Only! + +// WIN CONDITIONS? +/datum/objective/bloodsucker/heartthief/check_completion() + // -Must have a body. + if (!owner.current) + return FALSE + // Taken from /steal in objective.dm + var/list/all_items = owner.current.GetAllContents() // Includes items inside other items. + var/itemcount = FALSE + for(var/obj/I in all_items) //Check for items + if(I == /obj/item/organ/heart) + itemcount ++ + if (itemcount >= target_amount) // Got the right amount? + return TRUE + + return FALSE + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/objective/bloodsucker/survive + martyr_compatible = FALSE + + +// EXPLANATION +/datum/objective/bloodsucker/survive/update_explanation_text() + explanation_text = "Survive the entire shift without succumbing to Final Death." + +// WIN CONDITIONS? +/datum/objective/bloodsucker/survive/check_completion() + // -Must have a body. + if (!owner.current || !isliving(owner.current)) + return FALSE + // Dead, without a head or heart? Cya + return owner.current.stat != DEAD// || owner.current.HaveBloodsuckerBodyparts() + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/objective/bloodsucker/vamphunter + +// GENERATE! +/datum/objective/bloodsucker/vamphunter/generate_objective() + update_explanation_text() + +// EXPLANATION +/datum/objective/bloodsucker/vamphunter/update_explanation_text() + explanation_text = "Destroy all Bloodsuckers on [station_name()]." + +// WIN CONDITIONS? +/datum/objective/bloodsucker/vamphunter/check_completion() + for (var/datum/mind/M in SSticker.mode.bloodsuckers) + if (M && M.current && M.current.stat != DEAD && get_turf(M.current)) + return FALSE + return TRUE + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/objective/bloodsucker/monsterhunter + +// GENERATE! +/datum/objective/bloodsucker/monsterhunter/generate_objective() + update_explanation_text() + +// EXPLANATION +/datum/objective/bloodsucker/monsterhunter/update_explanation_text() + explanation_text = "Destroy all monsters on [station_name()]." + +// WIN CONDITIONS? +/datum/objective/bloodsucker/monsterhunter/check_completion() + var/list/datum/mind/monsters = list() + monsters += SSticker.mode.bloodsuckers + monsters += SSticker.mode.devils + monsters += SSticker.mode.cult + monsters += SSticker.mode.wizards + monsters += SSticker.mode.apprentices + //monsters += SSticker.mode.servants_of_ratvar + //monsters += SSticker.mode.changelings disabled anyways + + for (var/datum/mind/M in monsters) + if (M && M != owner && M.current && M.current.stat != DEAD && get_turf(M.current)) + return FALSE + return TRUE + + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/datum/objective/bloodsucker/vassal + +// GENERATE! +/datum/objective/bloodsucker/vassal/generate_objective() + update_explanation_text() + +// EXPLANATION +/datum/objective/bloodsucker/vassal/update_explanation_text() + explanation_text = "Guarantee the success of your Master's mission!" + +// WIN CONDITIONS? +/datum/objective/bloodsucker/vassal/check_completion() + var/datum/antagonist/vassal/antag_datum = owner.has_antag_datum(ANTAG_DATUM_VASSAL) + return antag_datum.master && antag_datum.master.owner && antag_datum.master.owner.current && antag_datum.master.owner.current.stat != DEAD diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm new file mode 100644 index 0000000000..dffdeaf7fc --- /dev/null +++ b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm @@ -0,0 +1,284 @@ +/datum/action/bloodsucker + name = "Vampiric Gift" + desc = "A vampiric gift." + button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon + background_icon_state = "vamp_power_off" //And this is the state for the background icon + var/background_icon_state_on = "vamp_power_on" // FULP: Our "ON" icon alternative. + var/background_icon_state_off = "vamp_power_off" // FULP: Our "OFF" icon alternative. + icon_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the ACTION icon + button_icon_state = "power_feed" //And this is the state for the action icon + buttontooltipstyle = "cult" + + // Action-Related + //var/amPassive = FALSE // REMOVED: Just made it its own kind. // Am I just "on" at all times? (aka NO ICON) + var/amTargetted = FALSE // Am I asked to choose a target when enabled? (Shows as toggled ON when armed) + var/amToggle = FALSE // Can I be actively turned on and off? + var/amSingleUse = FALSE // Am I removed after a single use? + var/active = FALSE + var/cooldown = 20 // 10 ticks, 1 second. + var/cooldownUntil = 0 // From action.dm: next_use_time = world.time + cooldown_time + // Power-Related + var/level_current = 0 // Can increase to yield new abilities. Each power goes up in strength each Rank. + //var/level_max = 1 // + var/bloodcost = 10 + var/needs_button = TRUE // Taken from Changeling - for passive abilities that dont need a button + var/bloodsucker_can_buy = FALSE // Must be a bloodsucker to use this power. + var/warn_constant_cost = FALSE // Some powers charge you for staying on. Masquerade, Cloak, Veil, etc. + var/can_use_in_torpor = FALSE // Most powers don't function if you're in torpor. + var/must_be_capacitated = FALSE // Some powers require you to be standing and ready. + var/can_be_immobilized = FALSE // Brawn can be used when incapacitated/laying if it's because you're being immobilized. NOTE: If must_be_capacitated is FALSE, this is irrelevant. + var/can_be_staked = FALSE // Only Feed can happen with a stake in you. + var/cooldown_static = FALSE // Feed, Masquerade, and One-Shot powers don't improve their cooldown. + //var/not_bloodsucker = FALSE // This goes to Vassals or Hunters, but NOT bloodsuckers. + +/datum/action/bloodsucker/New() + if (bloodcost > 0) + desc += "

COST: [bloodcost] Blood" // Modify description to add cost. + if (warn_constant_cost) + desc += "

Your over-time blood consumption increases while [name] is active." + if (amSingleUse) + desc += "

Useable once per night." + ..() + +// NOTES +// +// click.dm <--- Where we can take over mouse clicks +// spells.dm /add_ranged_ability() <--- How we take over the mouse click to use a power on a target. + +/datum/action/bloodsucker/Trigger() + // Active? DEACTIVATE AND END! + if (active && CheckCanDeactivate(TRUE)) + DeactivatePower() + return + if (!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE)) + return + PayCost() + if (amToggle) + active = !active + UpdateButtonIcon() + if (!amToggle || !active) + StartCooldown() // Must come AFTER UpdateButton(), otherwise icon will revert. + ActivatePower() // NOTE: ActivatePower() freezes this power in place until it ends. + if (active) // Did we not manually disable? Handle it here. + DeactivatePower() + if (amSingleUse) + RemoveAfterUse() + +/datum/action/bloodsucker/proc/CheckCanPayCost(display_error) + if(!owner || !owner.mind) + return FALSE + // Cooldown? + if (cooldownUntil > world.time) + if (display_error) + to_chat(owner, "[src] is unavailable. Wait [(cooldownUntil - world.time) / 10] seconds.") + return FALSE + // Have enough blood? + var/mob/living/L = owner + if (L.blood_volume < bloodcost) + if (display_error) + to_chat(owner, "You need at least [bloodcost] blood to activate [name]") + return FALSE + return TRUE + +/datum/action/bloodsucker/proc/CheckCanUse(display_error) // These checks can be scanned every frame while a ranged power is on. + if(!owner || !owner.mind) + return FALSE + // Torpor? + if(!can_use_in_torpor && HAS_TRAIT(owner, TRAIT_DEATHCOMA)) + if(display_error) + to_chat(owner, "Not while you're in Torpor.") + return FALSE + // Stake? + if(!can_be_staked && owner.AmStaked()) + if(display_error) + to_chat(owner, "You have a stake in your chest! Your powers are useless.") + return FALSE + // Incap? + if(must_be_capacitated) + var/mob/living/L = owner + if (L.incapacitated(TRUE, TRUE) || L.resting && !can_be_immobilized) + if(display_error) + to_chat(owner, "Not while you're incapacitated!") + return FALSE + // Constant Cost (out of blood) + if(warn_constant_cost) + var/mob/living/L = owner + if(L.blood_volume <= 0) + if(display_error) + to_chat(owner, "You don't have the blood to upkeep [src].") + return FALSE + return TRUE + +/datum/action/bloodsucker/proc/StartCooldown() + set waitfor = FALSE + // Alpha Out + button.color = rgb(128,0,0,128) + button.alpha = 100 + // Calculate Cooldown (by power's level) + var/this_cooldown = (cooldown_static || amSingleUse) ? cooldown : max(cooldown / 2, cooldown - (cooldown / 16 * (level_current-1))) + // NOTE: With this formula, you'll hit half cooldown at level 8 for that power. + + // Wait for cooldown + cooldownUntil = world.time + this_cooldown + spawn(this_cooldown) + // Alpha In + button.color = rgb(255,255,255,255) + button.alpha = 255 + +/datum/action/bloodsucker/proc/CheckCanDeactivate(display_error) + return TRUE + +/datum/action/bloodsucker/UpdateButtonIcon(force = FALSE) + background_icon_state = active? background_icon_state_on : background_icon_state_off + ..()//UpdateButtonIcon() + + +/datum/action/bloodsucker/proc/PayCost() + // owner for actions is the mob, not mind. + var/mob/living/L = owner + L.blood_volume -= bloodcost + + +/datum/action/bloodsucker/proc/ActivatePower() + + +/datum/action/bloodsucker/proc/DeactivatePower(mob/living/user = owner, mob/living/target) + active = FALSE + UpdateButtonIcon() + StartCooldown() + +/datum/action/bloodsucker/proc/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active. + return active && user && (!warn_constant_cost || user.blood_volume > 0) + +/datum/action/bloodsucker/proc/RemoveAfterUse() + // Un-Learn Me! (GO HOME + var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if (istype(bloodsuckerdatum)) + bloodsuckerdatum.powers -= src + Remove(owner) + +/datum/action/bloodsucker/proc/Upgrade() + level_current ++ + +/////////////////////////////////// PASSIVE POWERS /////////////////////////////////// + +// New Type: Passive (Always on, no button) +/datum/action/bloodsucker/passive + +/datum/action/bloodsucker/passive/New() + // REMOVED: DO NOTHBING! + ..() + // Don't Display Button! (it doesn't do anything anyhow) + button.screen_loc = DEFAULT_BLOODSPELLS + button.moved = DEFAULT_BLOODSPELLS + button.ordered = FALSE +/datum/action/bloodsucker/passive/Destroy() + if(owner) + Remove(owner) + target = null + +/////////////////////////////////// TARGETTED POWERS /////////////////////////////////// + +/datum/action/bloodsucker/targeted + // NOTE: All Targeted spells are Toggles! We just don't bother checking here. + var/target_range = 99 + var/message_Trigger = "Select a target." + var/obj/effect/proc_holder/bloodsucker/bs_proc_holder + var/power_activates_immediately = TRUE // Most powers happen the moment you click. Some, like Mesmerize, require time and shouldn't cost you if they fail. + + var/power_in_use = FALSE // Is this power LOCKED due to being used? + +/datum/action/bloodsucker/targeted/New(Target) + desc += "
\[Targeted Power\]" // Modify description to add notice that this is aimed. + ..() + // Create Proc Holder for intercepting clicks + bs_proc_holder = new () + bs_proc_holder.linked_power = src + +// Click power: Begin Aim +/datum/action/bloodsucker/targeted/Trigger() + if(active && CheckCanDeactivate(TRUE)) + DeactivateRangedAbility() + DeactivatePower() + return + if(!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE)) + return + active = !active + UpdateButtonIcon() + // Create & Link Targeting Proc + var/mob/living/L = owner + if(L.ranged_ability) + L.ranged_ability.remove_ranged_ability() + bs_proc_holder.add_ranged_ability(L) + + if(message_Trigger != "") + to_chat(owner, "[message_Trigger]") + +/datum/action/bloodsucker/targeted/CheckCanUse(display_error) + . = ..() + if(!.) + return + if(!owner.client) // <--- We don't allow non client usage so that using powers like mesmerize will FAIL if you try to use them as ghost. Why? because ranged_abvility in spell.dm + return FALSE // doesn't let you remove powers if you're not there. So, let's just cancel the power entirely. + return TRUE + +/datum/action/bloodsucker/targeted/DeactivatePower(mob/living/user = owner, mob/living/target) + // Don't run ..(), we don't want to engage the cooldown until we USE this power! + active = FALSE + UpdateButtonIcon() + +/datum/action/bloodsucker/targeted/proc/DeactivateRangedAbility() + // Only Turned off when CLICK is disabled...aka, when you successfully clicked (or + bs_proc_holder.remove_ranged_ability() + +// Check if target is VALID (wall, turf, or character?) +/datum/action/bloodsucker/targeted/proc/CheckValidTarget(atom/A) + return FALSE // FALSE targets nothing. + +// Check if valid target meets conditions +/datum/action/bloodsucker/targeted/proc/CheckCanTarget(atom/A, display_error) + // Out of Range + if(!(A in view(target_range, owner))) + if(display_error && target_range > 1) // Only warn for range if it's greater than 1. Brawn doesn't need to announce itself. + to_chat(owner, "Your target is out of range.") + return FALSE + return istype(A) + +// Click Target +/datum/action/bloodsucker/targeted/proc/ClickWithPower(atom/A) + // CANCEL RANGED TARGET check + if(power_in_use || !CheckValidTarget(A)) + return FALSE + // Valid? (return true means DON'T cancel power!) + if(!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE) || !CheckCanTarget(A, TRUE)) + return TRUE + // Skip this part so we can return TRUE right away. + if(power_activates_immediately) + PowerActivatedSuccessfully() // Mesmerize pays only after success. + power_in_use = TRUE // Lock us into this ability until it successfully fires off. Otherwise, we pay the blood even if we fail. + FireTargetedPower(A) // We use this instead of ActivatePower(), which has no input + power_in_use = FALSE + return TRUE + +/datum/action/bloodsucker/targeted/proc/FireTargetedPower(atom/A) + // Like ActivatePower, but specific to Targeted (and takes an atom input). We don't use ActivatePower for targeted. + +/datum/action/bloodsucker/targeted/proc/PowerActivatedSuccessfully() + // The power went off! We now pay the cost of the power. + PayCost() + DeactivateRangedAbility() + DeactivatePower() + StartCooldown() // Do AFTER UpdateIcon() inside of DeactivatePower. Otherwise icon just gets wiped. + +/datum/action/bloodsucker/targeted/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active. + return ..() +// Target Proc Holder +/obj/effect/proc_holder/bloodsucker + var/datum/action/bloodsucker/targeted/linked_power + +/obj/effect/proc_holder/bloodsucker/remove_ranged_ability(msg) + ..() + linked_power.DeactivatePower() + +/obj/effect/proc_holder/bloodsucker/InterceptClickOn(mob/living/caller, params, atom/A) + return linked_power.ClickWithPower(A) diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_sunlight.dm b/code/modules/antagonists/bloodsucker/bloodsucker_sunlight.dm new file mode 100644 index 0000000000..bb6e2a69f9 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/bloodsucker_sunlight.dm @@ -0,0 +1,195 @@ +#define TIME_BLOODSUCKER_NIGHT 900 // 15 minutes +#define TIME_BLOODSUCKER_DAY_WARN 90 // 1.5 minutes +#define TIME_BLOODSUCKER_DAY_FINAL_WARN 25 // 25 sec +#define TIME_BLOODSUCKER_DAY 60 // 1.5 minutes // 10 is a second, 600 is a minute. +#define TIME_BLOODSUCKER_BURN_INTERVAL 40 // 4 sec + + +// Over Time, tick down toward a "Solar Flare" of UV buffeting the station. This period is harmful to vamps. +/obj/effect/sunlight + //var/amDay = FALSE + var/cancel_me = FALSE + var/amDay = FALSE + var/time_til_cycle = 0 + +/obj/effect/sunlight/Initialize() + countdown() + hud_tick() + +/obj/effect/sunlight/proc/countdown() + set waitfor = FALSE + + while(!cancel_me) + + time_til_cycle = TIME_BLOODSUCKER_NIGHT + + // Part 1: Night (all is well) + while(time_til_cycle > TIME_BLOODSUCKER_DAY_WARN) + sleep(10) + if(cancel_me) + return + //sleep(TIME_BLOODSUCKER_NIGHT - TIME_BLOODSUCKER_DAY_WARN) + warn_daylight(1,"Solar Flares will bombard the station with dangerous UV in [TIME_BLOODSUCKER_DAY_WARN / 60] minutes. Prepare to seek cover in a coffin or closet.") // time2text <-- use Help On + give_home_power() // Give VANISHING ACT power to all vamps with a lair! + + // Part 2: Night Ending + while(time_til_cycle > TIME_BLOODSUCKER_DAY_FINAL_WARN) + sleep(10) + if(cancel_me) + return + //sleep(TIME_BLOODSUCKER_DAY_WARN - TIME_BLOODSUCKER_DAY_FINAL_WARN) + message_admins("BLOODSUCKER NOTICE: Daylight beginning in [TIME_BLOODSUCKER_DAY_FINAL_WARN] seconds.)") + warn_daylight(2,"Solar Flares are about to bombard the station! You have [TIME_BLOODSUCKER_DAY_FINAL_WARN] seconds to find cover!",\ + "In [TIME_BLOODSUCKER_DAY_FINAL_WARN / 10], your master will be at risk of a Solar Flare. Make sure they find cover!") + + // (FINAL LIL WARNING) + while(time_til_cycle > 5) + sleep(10) + if (cancel_me) + return + //sleep(TIME_BLOODSUCKER_DAY_FINAL_WARN - 50) + warn_daylight(3,"Seek cover, for Sol rises!") + + // Part 3: Night Ending + while (time_til_cycle > 0) + sleep(10) + if (cancel_me) + return + //sleep(50) + warn_daylight(4,"Solar flares bombard the station with deadly UV light!
Stay in cover for the next [TIME_BLOODSUCKER_DAY / 60] minutes or risk Final Death!",\ + "Solar flares bombard the station with UV light!") + + // Part 4: Day + amDay = TRUE + message_admins("BLOODSUCKER NOTICE: Daylight Beginning (Lasts for [TIME_BLOODSUCKER_DAY / 60] minutes.)") + time_til_cycle = TIME_BLOODSUCKER_DAY + sleep(10) // One second grace period. + //var/daylight_time = TIME_BLOODSUCKER_DAY + var/issued_XP = FALSE + while(time_til_cycle > 0) + punish_vamps() + sleep(TIME_BLOODSUCKER_BURN_INTERVAL) + if (cancel_me) + return + //daylight_time -= TIME_BLOODSUCKER_BURN_INTERVAL + // Issue Level Up! + if(!issued_XP && time_til_cycle <= 15) + issued_XP = TRUE + vamps_rank_up() + + warn_daylight(5,"The solar flare has ended, and the daylight danger has passed...for now.",\ + "The solar flare has ended, and the daylight danger has passed...for now.") + amDay = FALSE + day_end() // Remove VANISHING ACT power from all vamps who have it! Clear Warnings (sunlight, locker protection) + message_admins("BLOODSUCKER NOTICE: Daylight Ended. Resetting to Night (Lasts for [TIME_BLOODSUCKER_NIGHT / 60] minutes.)") + + +/obj/effect/sunlight/proc/hud_tick() + set waitfor = FALSE + while(!cancel_me) + // Update all Bloodsucker sunlight huds + for(var/datum/mind/M in SSticker.mode.bloodsuckers) + if(!istype(M) || !istype(M.current)) + continue + var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(istype(bloodsuckerdatum)) + bloodsuckerdatum.update_sunlight(max(0, time_til_cycle), amDay) // This pings all HUDs + sleep(10) + time_til_cycle -- + +/obj/effect/sunlight/proc/warn_daylight(danger_level=0, vampwarn = "", vassalwarn = "") + for(var/datum/mind/M in SSticker.mode.bloodsuckers) + if(!istype(M)) + continue + to_chat(M,vampwarn) + if(M.current) + if(danger_level == 1) + M.current.playsound_local(null, 'sound/chatter/griffin_3.ogg', 50 + danger_level, 1) + else if(danger_level == 2) + M.current.playsound_local(null, 'sound/chatter/griffin_5.ogg', 50 + danger_level, 1) + else if(danger_level == 3) + M.current.playsound_local(null, 'sound/effects/alert.ogg', 75, 1) + else if(danger_level == 4) + M.current.playsound_local(null, 'sound/ambience/ambimystery.ogg', 100, 1) + else if(danger_level == 5) + M.current.playsound_local(null, 'sound/spookoween/ghosty_wind.ogg', 90, 1) + + if(vassalwarn != "") + for(var/datum/mind/M in SSticker.mode.vassals) + if(!istype(M)) + continue + to_chat(M,vassalwarn) + + +/obj/effect/sunlight/proc/punish_vamps() + // Cycle through all vamp antags and check if they're inside a closet. + for(var/datum/mind/M in SSticker.mode.bloodsuckers) + if(!istype(M) || !istype(M.current)) + continue + var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(!istype(bloodsuckerdatum)) + continue + // Closets offer SOME protection + if(istype(M.current.loc, /obj/structure)) + // Coffins offer the BEST protection + if(istype(M.current.loc, /obj/structure/closet/crate/coffin)) + SEND_SIGNAL(M.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/coffinsleep) + continue + else + if(!bloodsuckerdatum.warn_sun_locker) + to_chat(M, "Your skin sizzles. The [M.current.loc] doesn't protect well against UV bombardment.") + bloodsuckerdatum.warn_sun_locker = TRUE + M.current.adjustFireLoss(0.5 + bloodsuckerdatum.vamplevel / 2) // M.current.fireloss += 0.5 + bloodsuckerdatum.vamplevel / 2 // Do DIRECT damage. Being spaced was causing this to not occur. setFireLoss(bloodsuckerdatum.vamplevel) + M.current.updatehealth() + SEND_SIGNAL(M.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/daylight_1) + // Out in the Open? Buh Bye + else + if(!bloodsuckerdatum.warn_sun_burn) + if(bloodsuckerdatum.vamplevel > 0) + to_chat(M, "The solar flare sets your skin ablaze!") + else + to_chat(M, "The solar flare scalds your neophyte skin!") + bloodsuckerdatum.warn_sun_burn = TRUE + if(M.current.fire_stacks <= 0) + M.current.fire_stacks = 0 + if(bloodsuckerdatum.vamplevel > 0) + M.current.adjust_fire_stacks(0.2 + bloodsuckerdatum.vamplevel / 10) + M.current.IgniteMob() + M.current.adjustFireLoss(2 + bloodsuckerdatum.vamplevel) // M.current.fireloss += 2 + bloodsuckerdatum.vamplevel // Do DIRECT damage. Being spaced was causing this to not occur. //setFireLoss(2 + bloodsuckerdatum.vamplevel) + M.current.updatehealth() + SEND_SIGNAL(M.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/daylight_2) + +/obj/effect/sunlight/proc/day_end() + for(var/datum/mind/M in SSticker.mode.bloodsuckers) + if(!istype(M) || !istype(M.current)) + continue + var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(!istype(bloodsuckerdatum)) + continue + // Reset Warnings + bloodsuckerdatum.warn_sun_locker = FALSE + bloodsuckerdatum.warn_sun_burn = FALSE + // Remove Dawn Powers + for(var/datum/action/bloodsucker/P in bloodsuckerdatum.powers) + if(istype(P, /datum/action/bloodsucker/gohome)) + bloodsuckerdatum.powers -= P + P.Remove(M.current) + +/obj/effect/sunlight/proc/vamps_rank_up() + set waitfor = FALSE + // Cycle through all vamp antags and check if they're inside a closet. + for(var/datum/mind/M in SSticker.mode.bloodsuckers) + if(!istype(M) || !istype(M.current)) + continue + var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(istype(bloodsuckerdatum)) + bloodsuckerdatum.RankUp() // Rank up! Must still be in a coffin to level! + +/obj/effect/sunlight/proc/give_home_power() + // It's late...! Give the "Vanishing Act" gohome power to bloodsuckers. + for(var/datum/mind/M in SSticker.mode.bloodsuckers) + if(!istype(M) || !istype(M.current)) + continue + var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(istype(bloodsuckerdatum) && bloodsuckerdatum.lair && !(locate(/datum/action/bloodsucker/gohome) in bloodsuckerdatum.powers)) + bloodsuckerdatum.BuyPower(new /datum/action/bloodsucker/gohome) diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_ui.dm b/code/modules/antagonists/bloodsucker/bloodsucker_ui.dm new file mode 100644 index 0000000000..b922af6066 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/bloodsucker_ui.dm @@ -0,0 +1,116 @@ + + +// For all things visual, such as leveling up + + +// Look up: _vending.dm proc/ui_interact() +// Malf_Modules.dm proc/use() + +/* +/datum/antagonist/bloodsucker/proc/LevelUpMenu() + var/list/dat = list() + + dat += "

You have become more ancient.
Direct the path of your blood

" + dat += "
" + + // Step One: Decide powers you CAN buy. + for(var/pickedpower in typesof(/datum/action/bloodsucker)) + var/obj/effect/proc_holder/spell/bloodsucker/power = pickedpower + // NAME + dat += "[power.name]" + // COST + dat += "[power.name] Vend" + dat == "
" + + var/datum/browser/popup = new(owner.current, "bloodsuckerrank", "Bloodsucker Rank Up") + popup.set_content(dat.Join()) + popup.open() + +/datum/antagonist/bloodsucker/Topic(href, href_list) + if(..()) + return +*/ + + +// From browser.dm: /datum/browser/New(nuser, nwindow_id, ntitle = 0, nwidth = 0, nheight = 0, var/atom/nref = null) + + +/* + var/list/dat = list() + dat += "Select use of processing time: (currently #[processing_time] left.)
" + dat += "
" + dat += "Install Module:
" + dat += "The number afterwards is the amount of processing time it consumes.
" + for(var/datum/AI_Module/large/module in possible_modules) + dat += "[module.module_name]\[?\] ([module.cost])
" + for(var/datum/AI_Module/small/module in possible_modules) + dat += "[module.module_name]\[?\] ([module.cost])
" + dat += "
" + if(temp) + dat += "[temp]" + var/datum/browser/popup = new(user, "modpicker", "Malf Module Menu") + popup.set_content(dat.Join()) + popup.open() +*/ + +/* + var/dat = "" + var/datum/bank_account/account + var/mob/living/carbon/human/H + var/obj/item/card/id/C + if(ishuman(user)) + H = user + C = H.get_idcard(TRUE) + + if(!C) + dat += "

No ID Card detected!

" + else if (!C.registered_account) + dat += "

No account on registered ID card!

" + if(onstation && C && C.registered_account) + account = C.registered_account + dat += "

Select an item

" + dat += "
" + if(!product_records.len) + dat += "No product loaded!" + else + var/list/display_records = product_records + coin_records + if(extended_inventory) + display_records = product_records + coin_records + hidden_records + dat += "" + for (var/datum/data/vending_product/R in display_records) + var/price_listed = "$[default_price]" + var/is_hidden = hidden_records.Find(R) + if(is_hidden && !extended_inventory) + continue + if(R.custom_price) + price_listed = "$[R.custom_price]" + if(!onstation || account && account.account_job && account.account_job.paycheck_department == payment_department) + price_listed = "FREE" + if(coin_records.Find(R) || is_hidden) + price_listed = "$[R.custom_premium_price ? R.custom_premium_price : extra_price]" + dat += "" + dat += "" + if(R.amount > 0 && ((C && C.registered_account && onstation) || (!onstation && isliving(user)))) + dat += "" + else + dat += "" + dat += "" + dat += "
[sanitize(R.name)] ([price_listed])[R.amount] VendNot Available
" + dat += "
" + if(onstation && C && C.registered_account) + dat += "Balance: $[account.account_balance]" + if(istype(src, /obj/machinery/vending/snack)) + dat += "

Chef's Food Selection

" + dat += "
" + for (var/O in dish_quants) + if(dish_quants[O] > 0) + var/N = dish_quants[O] + dat += "Dispense " + dat += "[capitalize(O)] ($[default_price]): [N]
" + dat += "
" + + var/datum/browser/popup = new(user, "vending", (name)) + popup.set_content(dat) + popup.set_title_image(user.browse_rsc_icon(icon, icon_state)) + popup.open() +*/ \ No newline at end of file diff --git a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm new file mode 100644 index 0000000000..febf53c324 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm @@ -0,0 +1,765 @@ +/datum/team/vampireclan + name = "Clan" // Teravanni, + +/datum/antagonist/bloodsucker + name = "Bloodsucker" + roundend_category = "bloodsuckers" + antagpanel_category = "Bloodsucker" + job_rank = ROLE_BLOODSUCKER + + // NAME + var/vampname // My Dracula name + var/vamptitle // My Dracula title + var/vampreputation // My "Surname" or description of my deeds + // CLAN + var/datum/team/vampireclan/clan + var/list/datum/antagonist/vassal/vassals = list()// Vassals under my control. Periodically remove the dead ones. + var/datum/mind/creator // Who made me? For both Vassals AND Bloodsuckers (though Master Vamps won't have one) + // POWERS + var/list/datum/action/powers = list()// Purchased powers + var/poweron_feed = FALSE // Am I feeding? + var/poweron_masquerade = FALSE + // STATS + var/vamplevel = 0 + var/vamplevel_unspent = 1 + var/regenRate = 0.3 // How many points of Brute do I heal per tick? + var/feedAmount = 15 // Amount of blood drawn from a target per tick. + var/maxBloodVolume = 600 // Maximum blood a Vamp can hold via feeding. // BLOOD_VOLUME_NORMAL 550 // BLOOD_VOLUME_SAFE 475 //BLOOD_VOLUME_OKAY 336 //BLOOD_VOLUME_BAD 224 // BLOOD_VOLUME_SURVIVE 122 + // OBJECTIVES + var/list/datum/objective/objectives_given = list() // For removal if needed. + var/area/lair + var/obj/structure/closet/crate/coffin + // TRACKING + var/foodInGut = 0 // How much food to throw up later. You shouldn't have eaten that. + var/warn_sun_locker = FALSE // So we only get the locker burn message once per day. + var/warn_sun_burn = FALSE // So we only get the sun burn message once per day. + var/had_toxlover = FALSE + // LISTS + var/static/list/defaultTraits = list (TRAIT_STABLEHEART, TRAIT_NOBREATH, TRAIT_SLEEPIMMUNE, TRAIT_NOCRITDAMAGE, TRAIT_RESISTCOLD, TRAIT_RADIMMUNE, TRAIT_VIRUSIMMUNE, TRAIT_NIGHT_VISION, \ + TRAIT_NOSOFTCRIT, TRAIT_NOHARDCRIT, TRAIT_AGEUSIA, TRAIT_COLDBLOODED, TRAIT_NONATURALHEAL, TRAIT_NOMARROW, TRAIT_NOPULSE, TRAIT_NOCLONE) + // NOTES: TRAIT_AGEUSIA <-- Doesn't like flavors. + // REMOVED: TRAIT_NODEATH + // TO ADD: + //var/static/list/defaultOrgans = list (/obj/item/organ/heart/vampheart,/obj/item/organ/heart/vampeyes) + +/datum/antagonist/bloodsucker/on_gain() + SSticker.mode.bloodsuckers |= owner // Add if not already in here (and you might be, if you were picked at round start) + SSticker.mode.check_start_sunlight()// Start Sunlight? (if first Vamp) + SelectFirstName()// Name & Title + SelectTitle(am_fledgling=TRUE) // If I have a creator, then set as Fledgling. + SelectReputation(am_fledgling=TRUE) + AssignStarterPowersAndStats()// Give Powers & Stats + forge_bloodsucker_objectives()// Objectives & Team + update_bloodsucker_icons_added(owner.current, "bloodsucker") // Add Antag HUD + LifeTick() // Run Life Function + . = ..() + + +/datum/antagonist/bloodsucker/on_removal() + SSticker.mode.bloodsuckers -= owner + SSticker.mode.check_cancel_sunlight()// End Sunlight? (if last Vamp) + ClearAllPowersAndStats()// Clear Powers & Stats + clear_bloodsucker_objectives() // Objectives + update_bloodsucker_icons_removed(owner.current)// Clear Antag HUD + . = ..() + + + +/datum/antagonist/bloodsucker/greet() + var/fullname = ReturnFullName(TRUE) + to_chat(owner, "You are [fullname], a bloodsucking vampire!
") + owner.announce_objectives() + to_chat(owner, "* You regenerate your health slowly, you're weak to fire, and you depend on blood to survive. Allow your stolen blood to run too low, and you will find yourself at \ + risk of being discovered!
") + //to_chat(owner, "As an immortal, your power is linked to your age. The older you grow, the more abilities you will have access to.") + var/vamp_greet + vamp_greet += "* Other Bloodsuckers are not necessarily your friends, but your survival may depend on cooperation. Betray them at your own discretion and peril.
" + vamp_greet += "* Use \",b\" to speak your ancient Bloodsucker language.
" + vamp_greet += "Bloodsucker Tip: Rest in a Coffin to claim it, and that area, as your lair.
" + vamp_greet += "Bloodsucker Tip: Fear the daylight! Solar flares will bombard the station periodically, and only your coffin can guarantee your safety.
" + vamp_greet += "Bloodsucker Tip: You wont loose blood if you are unconcious or sleeping. Use this to your advantage to conserve blood.
" + to_chat(owner, vamp_greet) + + owner.current.playsound_local(null, 'sound/bloodsucker/BloodsuckerAlert.ogg', 100, FALSE, pressure_affected = FALSE) + antag_memory += "Although you were born a mortal, in un-death you earned the name [fullname].
" + + +/datum/antagonist/bloodsucker/farewell() + owner.current.visible_message("[owner.current]'s skin flushes with color, their eyes growing glossier. They look...alive.",\ + "With a snap, your curse has ended. You are no longer a Bloodsucker. You live once more!") + // Refill with Blood + owner.current.blood_volume = max(owner.current.blood_volume,BLOOD_VOLUME_SAFE) + + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + +/datum/antagonist/bloodsucker/proc/SelectFirstName() + // Names (EVERYONE gets one)) + if (owner.current.gender == MALE) + vampname = pick("Desmond","Rudolph","Dracul","Vlad","Pyotr","Gregor","Cristian","Christoff","Marcu","Andrei","Constantin","Gheorghe","Grigore","Ilie","Iacob","Luca","Mihail","Pavel","Vasile","Octavian","Sorin", \ + "Sveyn","Aurel","Alexe","Iustin","Theodor","Dimitrie","Octav","Damien","Magnus","Caine","Abel", // Romanian/Ancient + "Lucius","Gaius","Otho","Balbinus","Arcadius","Romanos","Alexios","Vitellius", // Latin + "Melanthus","Teuthras","Orchamus","Amyntor","Axion", // Greek + "Thoth","Thutmose","Osorkon,","Nofret","Minmotu","Khafra", // Egyptian + "Dio") + + else + vampname = pick("Islana","Tyrra","Greganna","Pytra","Hilda","Andra","Crina","Viorela","Viorica","Anemona","Camelia","Narcisa","Sorina","Alessia","Sophia","Gladda","Arcana","Morgan","Lasarra","Ioana","Elena", \ + "Alina","Rodica","Teodora","Denisa","Mihaela","Svetla","Stefania","Diyana","Kelssa","Lilith", // Romanian/Ancient + "Alexia","Athanasia","Callista","Karena","Nephele","Scylla","Ursa", // Latin + "Alcestis","Damaris","Elisavet","Khthonia","Teodora", // Greek + "Nefret","Ankhesenpep") // Egyptian + +/datum/antagonist/bloodsucker/proc/SelectTitle(am_fledgling = 0, forced = FALSE) + // Already have Title + if (!forced && vamptitle != null) + return + // Titles [Master] + if (!am_fledgling) + if (owner.current.gender == MALE) + vamptitle = pick ("Count","Baron","Viscount","Prince","Duke","Tzar","Dreadlord","Lord","Master") + else + vamptitle = pick ("Countess","Baroness","Viscountess","Princess","Duchess","Tzarina","Dreadlady","Lady","Mistress") + to_chat(owner, "You have earned a title! You are now known as [ReturnFullName(TRUE)]!") + // Titles [Fledgling] + else + vamptitle = null + +/datum/antagonist/bloodsucker/proc/SelectReputation(am_fledgling = 0, forced=FALSE) + // Already have Reputation + if (!forced && vampreputation != null) + return + // Reputations [Master] + if (!am_fledgling) + vampreputation = pick("Butcher","Blood Fiend","Crimson","Red","Black","Terror","Nightman","Feared","Ravenous","Fiend","Malevolent","Wicked","Ancient","Plaguebringer","Sinister","Forgotten","Wretched","Baleful", \ + "Inqisitor","Harvester","Reviled","Robust","Betrayer","Destructor","Damned","Accursed","Terrible","Vicious","Profane","Vile","Depraved","Foul","Slayer","Manslayer","Sovereign","Slaughterer", \ + "Forsaken","Mad","Dragon","Savage","Villainous","Nefarious","Inquisitor","Marauder","Horrible","Immortal","Undying","Overlord","Corrupt","Hellspawn","Tyrant","Sanguineous") + if (owner.current.gender == MALE) + if (prob(10)) // Gender override + vampreputation = pick("King of the Damned", "Blood King", "Emperor of Blades", "Sinlord", "God-King") + else + if (prob(10)) // Gender override + vampreputation = pick("Queen of the Damned", "Blood Queen", "Empress of Blades", "Sinlady", "God-Queen") + + to_chat(owner, "You have earned a reputation! You are now known as [ReturnFullName(TRUE)]!") + + // Reputations [Fledgling] + else + vampreputation = pick ("Crude","Callow","Unlearned","Neophyte","Novice","Unseasoned","Fledgling","Young","Neonate","Scrapling","Untested","Unproven","Unknown","Newly Risen","Born","Scavenger","Unknowing",\ + "Unspoiled","Disgraced","Defrocked","Shamed","Meek","Timid","Broken")//,"Fresh") + + +/datum/antagonist/bloodsucker/proc/AmFledgling() + return !vamptitle + +/datum/antagonist/bloodsucker/proc/ReturnFullName(var/include_rep=0) + + var/fullname + // Name First + fullname = (vampname ? vampname : owner.current.name) + // Title + if(vamptitle) + fullname = vamptitle + " " + fullname + // Rep + if(include_rep && vampreputation) + fullname = fullname + " the " + vampreputation + + return fullname + + +/datum/antagonist/bloodsucker/proc/BuyPower(datum/action/bloodsucker/power)//(obj/effect/proc_holder/spell/power) + powers += power + power.Grant(owner.current)// owner.AddSpell(power) + +/datum/antagonist/bloodsucker/proc/AssignStarterPowersAndStats() + // Blood/Rank Counter + add_hud() + update_hud(TRUE) // Set blood value, current rank + // Powers + BuyPower(new /datum/action/bloodsucker/feed) + BuyPower(new /datum/action/bloodsucker/masquerade) + BuyPower(new /datum/action/bloodsucker/veil) + // Traits + for (var/T in defaultTraits) + ADD_TRAIT(owner.current, T, "bloodsucker") + if(HAS_TRAIT(owner.current, TRAIT_TOXINLOVER)) //No slime bonuses here, no thank you + had_toxlover = TRUE + REMOVE_TRAIT(owner.current, TRAIT_TOXINLOVER, "species") + // Traits: Species + if(ishuman(owner.current)) + var/mob/living/carbon/human/H = owner.current + var/datum/species/S = H.dna.species + S.species_traits |= DRINKSBLOOD + // Clear Addictions + owner.current.reagents.addiction_list = list() // Start over from scratch. Lucky you! At least you're not addicted to blood anymore (if you were) + // Stats + if(ishuman(owner.current)) + var/mob/living/carbon/human/H = owner.current + var/datum/species/S = H.dna.species + // Make Changes + S.brutemod *= 0.5 // <-------------------- Start small, but burn mod increases based on rank! + S.coldmod = 0 + S.stunmod *= 0.25 + S.siemens_coeff *= 0.75 //base electrocution coefficient 1 + //S.heatmod += 0.5 // Heat shouldn't affect. Only Fire. + //S.punchstunthreshold = 8 //damage at which punches from this race will stun 9 + S.punchdamagelow += 1 //lowest possible punch damage 0 + S.punchdamagehigh += 1 //highest possible punch damage 9 + // Clown + if(istype(H) && owner.assigned_role == "Clown") + H.dna.remove_mutation(CLOWNMUT) + to_chat(H, "As a vampiric clown, you are no longer a danger to yourself. Your nature is subdued.") + // Physiology + CheckVampOrgans() // Heart, Eyes + // Language + owner.current.grant_language(/datum/language/vampiric) + // Soul + //owner.current.hellbound = TRUE Causes wierd stuff + owner.hasSoul = FALSE // If false, renders the character unable to sell their soul. + owner.isholy = FALSE // is this person a chaplain or admin role allowed to use bibles + // Disabilities + CureDisabilities() + +/datum/antagonist/bloodsucker/proc/ClearAllPowersAndStats() + // Blood/Rank Counter + remove_hud() + // Powers + while(powers.len) + var/datum/action/bloodsucker/power = pick(powers) + powers -= power + power.Remove(owner.current) + // owner.RemoveSpell(power) + // Traits + for(var/T in defaultTraits) + REMOVE_TRAIT(owner.current, T, "bloodsucker") + if(had_toxlover == TRUE) + ADD_TRAIT(owner.current, TRAIT_TOXINLOVER, "species") + + // Traits: Species + if(ishuman(owner.current)) + var/mob/living/carbon/human/H = owner.current + H.set_species(H.dna.species.type) + // Stats + if(ishuman(owner.current)) + var/mob/living/carbon/human/H = owner.current + H.set_species(H.dna.species.type) + // Clown + if(istype(H) && owner.assigned_role == "Clown") + H.dna.add_mutation(CLOWNMUT) + // NOTE: Use initial() to return things to default! + // Physiology + owner.current.regenerate_organs() + // Update Health + owner.current.setMaxHealth(100) + // Language + owner.current.remove_language(/datum/language/vampiric) + // Soul + if (owner.soulOwner == owner) // Return soul, if *I* own it. + owner.hasSoul = TRUE +//owner.current.hellbound = FALSE + +datum/antagonist/bloodsucker/proc/RankUp() + set waitfor = FALSE + if(!owner || !owner.current) + return + vamplevel_unspent ++ + // Spend Rank Immediately? + if(istype(owner.current.loc, /obj/structure/closet/crate/coffin)) + SpendRank() + else + to_chat(owner, "You have grown more ancient! Sleep in a coffin that you have claimed to thicken your blood and become more powerful.") + if(vamplevel_unspent >= 2) + to_chat(owner, "Bloodsucker Tip: If you cannot find or steal a coffin to use, they can be built from wooden planks.
") + +datum/antagonist/bloodsucker/proc/LevelUpPowers() + for(var/datum/action/bloodsucker/power in powers) + power.level_current ++ + +datum/antagonist/bloodsucker/proc/SpendRank() + set waitfor = FALSE + if (vamplevel_unspent <= 0 || !owner || !owner.current || !owner.current.client) + return + ///////// + // Powers + //TODO: Make this into a radial + // Purchase Power Prompt + var/list/options = list() // Taken from gasmask.dm, for Clown Masks. + for(var/pickedpower in typesof(/datum/action/bloodsucker)) + var/datum/action/bloodsucker/power = pickedpower + // If I don't own it, and I'm allowed to buy it. + if(!(locate(power) in powers) && initial(power.bloodsucker_can_buy)) + options[initial(power.name)] = power // TESTING: After working with TGUI, it seems you can use initial() to view the variables inside a path? + options["\[ Not Now \]"] = null + // Abort? + if(options.len > 1) + var/choice = input(owner.current, "You have the opportunity to grow more ancient. Select a power to advance your Rank.", "Your Blood Thickens...") in options + // Cheat-Safety: Can't keep opening/closing coffin to spam levels + if(vamplevel_unspent <= 0) // Already spent all your points, and tried opening/closing your coffin, pal. + return + if(!istype(owner.current.loc, /obj/structure/closet/crate/coffin)) + to_chat(owner.current, "Return to your coffin to advance your Rank.") + return + if(!choice || !options[choice] || (locate(options[choice]) in powers)) // ADDED: Check to see if you already have this power, due to window stacking. + to_chat(owner.current, "You prevent your blood from thickening just yet, but you may try again later.") + return + // Buy New Powers + var/datum/action/bloodsucker/P = options[choice] + BuyPower(new P) + to_chat(owner.current, "You have learned [initial(P.name)]!") + else + to_chat(owner.current, "You grow more ancient by the night!") + ///////// + // Advance Powers (including new) + LevelUpPowers() + //////// + // Advance Stats + if(ishuman(owner.current)) + var/mob/living/carbon/human/H = owner.current + var/datum/species/S = H.dna.species + S.burnmod *= 0.025 // Slightly more burn damage + S.stunmod *= 0.95 // Slightly less stun time. + S.punchdamagelow += 0.5 + S.punchdamagehigh += 0.5 // NOTE: This affects the hitting power of Brawn. + // More Health + owner.current.setMaxHealth(owner.current.maxHealth + 5) + // Vamp Stats + regenRate += 0.05 // Points of brute healed (starts at 0.3) + feedAmount += 2 // Increase how quickly I munch down vics (15) + maxBloodVolume += 50 // Increase my max blood (600) + ///////// + vamplevel ++ + vamplevel_unspent -- + + // Assign True Reputation + if(vamplevel == 4) + SelectReputation(am_fledgling = FALSE, forced = TRUE) + to_chat(owner.current, "You are now a rank [vamplevel] Bloodsucker. Your strength, resistence, health, feed rate, regen rate, and maximum blood have all increased!") + to_chat(owner.current, "Your existing powers have all ranked up as well!") + update_hud(TRUE) + owner.current.playsound_local(null, 'sound/effects/pope_entry.ogg', 25, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +//This handles the application of antag huds/special abilities +/datum/antagonist/bloodsucker/apply_innate_effects(mob/living/mob_override) + return + +//This handles the removal of antag huds/special abilities +/datum/antagonist/bloodsucker/remove_innate_effects(mob/living/mob_override) + return + +//Assign default team and creates one for one of a kind team antagonists +/datum/antagonist/bloodsucker/create_team(datum/team/team) + return + +// Create Objectives +/datum/antagonist/bloodsucker/proc/forge_bloodsucker_objectives() // Fledgling vampires can have different objectives. + + // TEAM + //clan = new /datum/team/vampireclan(owner) + + + // Lair Objective: Create a Lair + var/datum/objective/bloodsucker/lair/lair_objective = new + lair_objective.owner = owner + lair_objective.generate_objective() + add_objective(lair_objective) + + // Protege Objective + var/datum/objective/bloodsucker/protege/protege_objective = new + protege_objective.owner = owner + protege_objective.generate_objective() + add_objective(protege_objective) + + if (rand(0,1) == 0) + // Heart Thief Objective + var/datum/objective/bloodsucker/heartthief/heartthief_objective = new + heartthief_objective.owner = owner + heartthief_objective.generate_objective() + add_objective(heartthief_objective) + + else + // Solars Objective + var/datum/objective/bloodsucker/solars/solars_objective = new + solars_objective.owner = owner + solars_objective.generate_objective() + add_objective(solars_objective) + + // Survive Objective + var/datum/objective/bloodsucker/survive/survive_objective = new + survive_objective.owner = owner + survive_objective.generate_objective() + add_objective(survive_objective) + + +/datum/antagonist/bloodsucker/proc/add_objective(var/datum/objective/O) + objectives += O + objectives_given += O + +/datum/antagonist/bloodsucker/proc/clear_bloodsucker_objectives() + + var/datum/team/team = get_team() + if(team) + team.remove_member(owner) + + for(var/O in objectives_given) + objectives -= O + qdel(O) + objectives_given = list() // Traitors had this, so I added it. Not sure why. + + +/datum/antagonist/bloodsucker/get_team() + return clan + +//Name shown on antag list +/datum/antagonist/bloodsucker/antag_listing_name() + return ..() + "([ReturnFullName(TRUE)])" + +//Whatever interesting things happened to the antag admins should know about +//Include additional information about antag in this part +/datum/antagonist/bloodsucker/antag_listing_status() + if (owner && owner.AmFinalDeath()) + return "Final Death" + return ..() + + + +//Individual roundend report +/datum/antagonist/bloodsucker/roundend_report() + // Get the default Objectives + var/list/report = list() + + // Vamp Name + report += "
\[[ReturnFullName(TRUE)]\]" + + // Default Report + report += ..() + + // Now list their vassals + if (vassals.len > 0) + report += "Their Vassals were..." + for (var/datum/antagonist/vassal/V in vassals) + if (V.owner) + var/jobname = V.owner.assigned_role ? "the [V.owner.assigned_role]" : "" + report += "[V.owner.name] [jobname]" + + return report.Join("
") + +//Displayed at the start of roundend_category section, default to roundend_category header +/datum/antagonist/bloodsucker/roundend_report_header() + return "Lurking in the darkness, the Bloodsuckers were:
" + + + + + +// 2019 Breakdown of Bloodsuckers: + +// G A M E P L A Y +// +// Bloodsuckers should be inherrently powerful: they never stay dead, and they can hide in plain sight +// better than any other antagonist aboard the station. +// +// However, only elder Bloodsuckers are the powerful creatures of legend. Ranking up as a Bloodsucker +// should impart slight strength and health benefits, as well as powers that can grow over time. But +// their weaknesses should grow as well, and not just to fire. + + +// A B I L I T I E S +// +// * Bloodsuckers can FEIGN LIFE + DEATH. +// Feigning LIFE: +// - Warms up the body +// - Creates a heartbeat +// - Fake blood amount (550) +// Feign DEATH: Not yet done +// - When lying down or sitting, you appear "dead and lifeless" + +// * Bloodsuckers REGENERATE +// - Brute damage heals rather rapidly. Burn damage heals slowly. +// - Healing is reduced when hungry or starved. +// - Burn does not heal when starved. A starved vampire remains "dead" until burns can heal. +// - Bodyparts and organs regrow in Torpor (except for the Heart and Brain). +// +// * Bloodsuckers are IMMORTAL +// - Brute damage cannot destroy them (and it caps very low, so they don't stack too much) +// - Burn damage can only kill them at very high amounts. +// - Removing the head kills the vamp forever. +// - Removing the heart kills the vamp until replaced. +// +// * Bloodsuckers are DEAD +// - They do not breathe. +// - Cold affects them less. +// - They are immune to disease (but can spread it) +// - Food is useless and cause sickness. +// - Nothing can heal the vamp other than his own blood. +// +// * Bloodsuckers are PREDATORS +// - They detect life/heartbeats nearby. +// - They know other predators instantly (Vamps, Werewolves, and alien types) regardless of disguise. +// +// +// +// * Bloodsuckers enter Torpor when DEAD or RESTING in coffin +// - Torpid vampires regenerate their health. Coffins negate cost and speed up the process. +// ** To rest in a coffin, either SLEEP or CLOSE THE LID while you're in it. You will be given a prompt to sleep until healed. Healing in a coffin costs NO blood! +// + + + +// O B J E C T I V E S +// +// +// +// +// 1) GROOM AN HEIR: Find a person with appropriate traits (hair, blood type, gender) to be turned as a Vampire. Before they rise, they must be properly trained. Raise them to great power after their change. +// +// 2) BIBLIOPHILE: Research objects of interest, study items looking for clues of ancient secrets, and hunt down the clues to a Vampiric artifact of horrible power. +// +// 3) CRYPT LORD: Build a terrifying sepulcher to your evil, with servants to lavish upon you in undeath. The trappings of a true crypt lord come at grave cost. +// +// 4) GOURMOND: Oh, to taste all the delicacies the station has to offer! DRINK ## BLOOD FROM VICTIMS WHO LIVE, EAT ## ORGANS FROM VICTIMS WHO LIVE + + +// Vassals +// +// - Loyal to (and In Love With) Master +// - Master can speak to, summon, or punish his Vassals, even while asleep or torpid. +// - Master may have as many Vassals as Rank +// - Vassals see their Master's speech emboldened! + + + + + + + + +// Dev Notes +// +// HEALING: Maybe Vamps metabolize specially? Like, they slowly drip their own blood into their system? +// - Give Vamps their own metabolization proc, perhaps? +// ** shadowpeople.dm has rules for healing. +// +// KILLING: It's almost impossible to track who someone has directly killed. But an Admin could be given +// an easy way to whip a Bloodsucker for cruel behavior, as a RP mechanic but not a punishment. +// ** +// +// HUNGER: Just keep adjusting mob's nutrition to Blood Hunger level. No need to cancel nutrition from eating. +// ** mob.dm /set_nutrition() +// ** snacks.dm / attack() <-- Stop food from doing anything? + +// ORGANS: Liver +// ** life.dm /handle_liver() +// +// CORPSE: Most of these effects likely go away when using "Masquerade" to appear alive. +// ** status_procs.dm /adjust_bodytemperature() +// ** traits.dm /TRAIT_NOBREATH /TRAIT_SLEEPIMMUNE /TRAIT_RESISTCOLD /TRAIT_RADIMMUNE /TRAIT_VIRUSIMMUNE +// * MASQUERADE ON/OFF: /TRAIT_FAKEDEATH (M) +// * /TRAIT_NIGHT_VISION +// * /TRAIT_DEATHCOMA <-- This basically makes you immobile. When using status_procs /fakedeath(), make sure to remove Coma unless we're in Torpor! +// * /TRAIT_NODEATH <--- ??? +// ** species /NOZOMBIE +// * ADD: TRAIT_COLDBLOODED <-- add to carbon/life.dm /natural_bodytemperature_stabilization() +// +// MASQUERADE Appear as human! +// ** examine.dm /examine() <-- Change "blood_volume < BLOOD_VOLUME_SAFE" to a new examine +// +// NOSFERATU ** human.add_trait(TRAIT_DISFIGURED, "insert_vamp_datum_here") <-- Makes you UNKNOWN unless your ID says otherwise. +// STEALTH ** human_helpers.dm /get_visible_name() ** shadowpeople.dm has rules for Light. +// +// FRENZY ** living.dm /update_mobility() (USED TO be update_canmove) +// +// PREDATOR See other Vamps! +// * examine.dm /examine() +// +// WEAKNESSES: -Poor mood in Chapel or near Chaplain. -Stamina damage from Bible + + + + //message_admins("DEBUG3: attempt_cast() [name] / [user_C.handcuffed] ") + + +// TODO: +// +// Death (fire, heart, brain, head) +// Disable Life: BLOOD +// Body Temp +// Spend blood over time (more if imitating life) (none if sleeping in coffin) +// Auto-Heal (brute to 0, fire to 99) (toxin/o2 always 0) +// +// Hud Icons +// UI Blood Counter +// Examine Name (+Masquerade, only "Dead and lifeless" if not standing?) +// +// +// Turn vamps +// Create vassals +// + + +// FIX LIST +// + + +///////////////////////////////////// + + // HUD! // + +/datum/antagonist/bloodsucker/proc/update_bloodsucker_icons_added(datum/mind/m) + var/datum/atom_hud/antag/vamphud = GLOB.huds[ANTAG_HUD_BLOODSUCKER] + vamphud.join_hud(owner.current) + set_antag_hud(owner.current, "bloodsucker") // "bloodsucker" + owner.current.hud_list[ANTAG_HUD].icon = image('icons/mob/hud.dmi', owner.current, "bloodsucker") //Check prepare_huds in mob.dm to see why. + +/datum/antagonist/bloodsucker/proc/update_bloodsucker_icons_removed(datum/mind/m) + var/datum/atom_hud/antag/vamphud = GLOB.huds[ANTAG_HUD_BLOODSUCKER] + vamphud.leave_hud(owner.current) + set_antag_hud(owner.current, null) + +/datum/atom_hud/antag/bloodsucker // from hud.dm in /datums/ Also see data_huds.dm + antag_hud.dm + +/datum/atom_hud/antag/bloodsucker/add_to_single_hud(mob/M, atom/A) + if (!check_valid_hud_user(M,A)) // FULP: This checks if the Mob is a Vassal, and if the Atom is his master OR on his team. + return + ..() + +/datum/atom_hud/antag/bloodsucker/proc/check_valid_hud_user(mob/M, atom/A) // Remember: A is being added to M's hud. Because M's hud is a /antag/vassal hud, this means M is the vassal here. + // Ghost Admins always see Bloodsuckers/Vassals + if (isobserver(M)) + return TRUE + // GOAL: Vassals see their Master and his other Vassals. + // GOAL: Vassals can BE seen by their Bloodsucker and his other Vassals. + // GOAL: Bloodsuckers can see each other. + if (!M || !A || !ismob(A) || !M.mind)// || !A.mind) + return FALSE + var/mob/A_mob = A + if (!A_mob.mind) + return FALSE + // Find Datums: Bloodsucker + var/datum/antagonist/bloodsucker/atom_B = A_mob.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + var/datum/antagonist/bloodsucker/mob_B = M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + // Check 1) Are we both Bloodsuckers? + if (atom_B && mob_B) + return TRUE + // Find Datums: Vassal + var/datum/antagonist/vassal/atom_V = A_mob.mind.has_antag_datum(ANTAG_DATUM_VASSAL) + var/datum/antagonist/vassal/mob_V = M.mind.has_antag_datum(ANTAG_DATUM_VASSAL) + // Check 2) If they are a BLOODSUCKER, then are they my Master? + if (mob_V && atom_B == mob_V.master) + return TRUE // SUCCESS! + // Check 3) If I am a BLOODSUCKER, then are they my Vassal? + if (mob_B && atom_V && (atom_V in mob_B.vassals)) + return TRUE // SUCCESS! + // Check 4) If we are both VASSAL, then do we have the same master? + if (atom_V && mob_V && atom_V.master == mob_V.master) + return TRUE // SUCCESS! + return FALSE + + + + ///////////////////////////////////// + + + // BLOOD COUNTER & RANK MARKER ! // + +#define ui_sunlight_display "WEST:6,CENTER-0:0" // 6 pixels to the right, zero tiles & 5 pixels DOWN. +#define ui_blood_display "WEST:6,CENTER-1:0" // 1 tile down +#define ui_vamprank_display "WEST:6,CENTER-2:-5" // 2 tiles down + +/datum/hud + var/obj/screen/bloodsucker/blood_counter/blood_display + var/obj/screen/bloodsucker/rank_counter/vamprank_display + var/obj/screen/bloodsucker/sunlight_counter/sunlight_display + +/datum/antagonist/bloodsucker/proc/add_hud() + return + +/datum/antagonist/bloodsucker/proc/remove_hud() + // No Hud? Get out. + if (!owner.current.hud_used) + return + owner.current.hud_used.blood_display.invisibility = INVISIBILITY_ABSTRACT + owner.current.hud_used.vamprank_display.invisibility = INVISIBILITY_ABSTRACT + owner.current.hud_used.sunlight_display.invisibility = INVISIBILITY_ABSTRACT + +/datum/antagonist/bloodsucker/proc/update_hud(updateRank=FALSE) + // No Hud? Get out. + if(!owner.current.hud_used) + return + // Update Blood Counter + if (owner.current.hud_used.blood_display) + var/valuecolor = "#FF6666" + if(owner.current.blood_volume > BLOOD_VOLUME_SAFE) + valuecolor = "#FFDDDD" + else if(owner.current.blood_volume > BLOOD_VOLUME_BAD) + valuecolor = "#FFAAAA" + owner.current.hud_used.blood_display.update_counter(owner.current.blood_volume, valuecolor) + + // Update Rank Counter + if(owner.current.hud_used.vamprank_display) + var/valuecolor = vamplevel_unspent ? "#FFFF00" : "#FF0000" + owner.current.hud_used.vamprank_display.update_counter(vamplevel, valuecolor) + if(updateRank) // Only change icon on special request. + owner.current.hud_used.vamprank_display.icon_state = (vamplevel_unspent > 0) ? "rank_up" : "rank" + + +/obj/screen/bloodsucker + invisibility = INVISIBILITY_ABSTRACT + +/obj/screen/bloodsucker/proc/clear() + invisibility = INVISIBILITY_ABSTRACT + +/obj/screen/bloodsucker/proc/update_counter(value, valuecolor) + invisibility = 0 // Make Visible + +/obj/screen/bloodsucker/blood_counter // NOTE: Look up /obj/screen/devil/soul_counter in _onclick / hud / human.dm + icon = 'icons/mob/actions/bloodsucker.dmi'//'icons/mob/screen_gen.dmi' + name = "Blood Consumed" + icon_state = "blood_display"//"power_display" + screen_loc = ui_blood_display + +/obj/screen/bloodsucker/blood_counter/update_counter(value, valuecolor) + ..() + maptext = "
[round(value,1)]
" + +/obj/screen/bloodsucker/rank_counter + name = "Bloodsucker Rank" + icon = 'icons/mob/actions/bloodsucker.dmi' + icon_state = "rank" + screen_loc = ui_vamprank_display + +/obj/screen/bloodsucker/rank_counter/update_counter(value, valuecolor) + ..() + maptext = "
[round(value,1)]
" + +/obj/screen/bloodsucker/sunlight_counter + icon = 'icons/mob/actions/bloodsucker.dmi' + name = "Solar Flare Timer" + icon_state = "sunlight_night" + screen_loc = ui_sunlight_display + +/datum/antagonist/bloodsucker/proc/update_sunlight(value, amDay = FALSE) + // No Hud? Get out. + if (!owner.current.hud_used) + return + // Update Sun Time + if (owner.current.hud_used.sunlight_display) + var/valuecolor = "#BBBBFF" + if (amDay) + valuecolor = "#FF5555" + else if(value <= 25) + valuecolor = "#FFCCCC" + else if(value < 10) + valuecolor = "#FF5555" + var/value_string = (value >= 60) ? "[round(value / 60, 1)] m" : "[round(value,1)] s" + owner.current.hud_used.sunlight_display.update_counter( value_string, valuecolor ) + owner.current.hud_used.sunlight_display.icon_state = "sunlight_" + (amDay ? "day":"night") + + +/obj/screen/bloodsucker/sunlight_counter/update_counter(value, valuecolor) + ..() + maptext = "
[value]
" diff --git a/code/modules/antagonists/bloodsucker/datum_hunter.dm b/code/modules/antagonists/bloodsucker/datum_hunter.dm new file mode 100644 index 0000000000..2d680d0e09 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/datum_hunter.dm @@ -0,0 +1,295 @@ +/* +#define HUNTER_SCAN_MIN_DISTANCE 8 +#define HUNTER_SCAN_MAX_DISTANCE 35 +#define HUNTER_SCAN_PING_TIME 20 //5s update time. + + +/datum/antagonist/vamphunter + name = "Hunter" + roundend_category = "hunters" + antagpanel_category = "Monster Hunter" + job_rank = ROLE_MONSTERHUNTER + var/list/datum/action/powers = list()// Purchased powers + var/list/datum/objective/objectives_given = list() // For removal if needed. + var/datum/martial_art/my_kungfu // Hunters know a lil kung fu. + var/bad_dude = FALSE // Every first hunter spawned is a SHIT LORD. + + +/datum/antagonist/vamphunter/on_gain() + + SSticker.mode.vamphunters |= owner // Add if not already in here (and you might be, if you were picked at round start) + + // Hunter Pinpointer + //owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition) + + // Give Hunter Power + var/datum/action/P = new /datum/action/bloodsucker/trackvamp + P.Grant(owner.current) + + // Give Hunter Martial Arts + //if (rand(1,3) == 1) + // var/datum/martial_art/pick_type = pick (/datum/martial_art/cqc, /datum/martial_art/krav_maga, /datum/martial_art/cqc, /datum/martial_art/krav_maga, /datum/martial_art/wrestling) // /datum/martial_art/boxing <--- doesn't include grabbing, so don't use! + // my_kungfu = new pick_type //pick (/datum/martial_art/boxing, /datum/martial_art/cqc) // ick_type + // my_kungfu.teach(owner.current, 0) + + // Give Hunter Objective + var/datum/objective/bloodsucker/monsterhunter/monsterhunter_objective = new + monsterhunter_objective.owner = owner + monsterhunter_objective.generate_objective() + objectives += monsterhunter_objective + objectives_given += monsterhunter_objective + // Badguy Hunter? (Give him BADGUY objectives) + if (bad_dude) + // Stolen DIRECTLY from datum_traitor.dm + if(prob(15) && !(locate(/datum/objective/download) in objectives) && !(owner.assigned_role in list("Research Director", "Scientist", "Roboticist"))) + var/datum/objective/download/download_objective = new + download_objective.owner = owner + download_objective.gen_amount_goal() + objectives += download_objective + objectives_given += download_objective + else + var/datum/objective/steal/steal_objective = new + steal_objective.owner = owner + steal_objective.find_target() + objectives += steal_objective + objectives_given += steal_objective + + + . = ..() + +/datum/antagonist/vamphunter/on_removal() + + SSticker.mode.vamphunters -= owner // Add if not already in here (and you might be, if you were picked at round start) + + // Master Pinpointer + //owner.current.remove_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition) + + // Take Hunter Power + if (owner.current) + for (var/datum/action/bloodsucker/P in owner.current.actions) + P.Remove(owner.current) + + // Take Hunter Martial Arts + //my_kungfu.remove(owner.current) + + // Remove Hunter Objectives + for(var/O in objectives_given) + objectives -= O + qdel(O) + objectives_given = list() + + . = ..() + +/datum/antagonist/vamphunter/greet() + var/vamp_hunter_greet = "You are a fearless Monster Hunter!" + vamp_hunter_greet += "You know there's one or more filthy creature onboard the station, though their identities elude you." + vamp_hunter_greet += "It's your job to root them out, destroy their nests, and save the crew." + vamp_hunter_greet += "Use WHATEVER MEANS NECESSARY to find these creatures...no matter who gets hurt or what you have to destroy to do it." + vamp_hunter_greet += "There are greater stakes at hand than the safety of the station!" + vamp_hunter_greet += "However, security may detain you if they discover your mission..." + antag_memory += "You remember your training:
" + antag_memory += " -Bloodsuckers are weak to fire, or a stake to the heart. Removing their head or heart will also destroy them permanently.
" + antag_memory += " -Wooden stakes can be made from planks, and hardened by a welding tool. Your recipes list has ways of making them even stronger.
" + antag_memory += " -Changelings return to life unless their body is destroyed. Not even decapitation can stop them for long.
" + antag_memory += " -Cultists are weak to the Chaplain's holy water.
" + antag_memory += " -Wizards are notoriously hard to outmatch. Rob or steal whatever weapons you need to destroy them, and shoot before asking questions.

" + if (my_kungfu != null) + vamp_hunter_greet += "Hunter Tip: Use your [my_kungfu.name] techniques to give you an advantage over the enemy.
" + antag_memory += "You remember your training: You are skilled in the [my_kungfu.name] style of combat.
" + to_chat(owner, vamp_hunter_greet) + +/datum/antagonist/vamphunter/farewell() + to_chat(owner, "Your hunt has ended: you are no longer a monster hunter!") + + +// TAKEN FROM: /datum/action/changeling/pheromone_receptors // pheromone_receptors.dm for a version of tracking that Changelings have! + + +/datum/status_effect/agent_pinpointer/hunter_edition + alert_type = /obj/screen/alert/status_effect/agent_pinpointer/hunter_edition + minimum_range = HUNTER_SCAN_MIN_DISTANCE + tick_interval = HUNTER_SCAN_PING_TIME + duration = 160 // Lasts 10s + range_fuzz_factor = 5//PINPOINTER_EXTRA_RANDOM_RANGE + +/obj/screen/alert/status_effect/agent_pinpointer/hunter_edition + name = "Monster Tracking" + desc = "You always know where the hellspawn are." + + +/datum/status_effect/agent_pinpointer/hunter_edition/on_creation(mob/living/new_owner, ...) + ..() + + // Pick target + var/turf/my_loc = get_turf(owner) + var/list/mob/living/carbon/vamps = list() + + for(var/datum/mind/M in SSticker.mode.bloodsuckers) + if (!M.current || M.current == owner || !get_turf(M.current) || !get_turf(new_owner)) + continue + var/datum/antagonist/bloodsucker/antag_datum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(!istype(antag_datum)) + continue + var/their_loc = get_turf(M.current) + var/distance = get_dist_euclidian(my_loc, their_loc) + if (distance < HUNTER_SCAN_MAX_DISTANCE) + vamps[M.current] = (HUNTER_SCAN_MAX_DISTANCE ** 2) - (distance ** 2) + // Found one! + if(vamps.len) + scan_target = pickweight(vamps) //Point at a 'random' vamp, biasing heavily towards closer ones. + to_chat(owner, "You detect signs of monsters to the [dir2text(get_dir(my_loc,get_turf(scan_target)))]!") + // Will yield a "?" + else + to_chat(owner, "There are no monsters nearby.") + // Force Point-To Immediately + point_to_target() + +/datum/status_effect/agent_pinpointer/hunter_edition/scan_for_target() + // Lose target? Done. Otherwise, scan for target's current position. + if (!scan_target && owner) + owner.remove_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition) + + // NOTE: Do NOT run ..(), or else we'll remove our target. + + +/datum/status_effect/agent_pinpointer/hunter_edition/Destroy() + if (scan_target) + to_chat(owner, "You've lost the trail.") + ..() +*/ + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/* + + +/datum/action/bloodsucker/trackvamp/ + name = "Track Monster"//"Cellular Emporium" + desc = "Take a moment to look for clues of any nearby monsters.
These creatures are slippery, and often look like the crew." + button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon + background_icon_state = "vamp_power_off" //And this is the state for the background icon + icon_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the ACTION icon + button_icon_state = "power_hunter" //And this is the state for the action icon + amToggle = FALSE // Action-Related + cooldown = 300 // 10 ticks, 1 second. + bloodcost = 0 + +/datum/action/bloodsucker/trackvamp/ActivatePower() + + var/mob/living/user = owner + to_chat(user, "You look around, scanning your environment and discerning signs of any filthy, wretched affronts to the natural order.") + + if (!do_mob(user,owner,80)) + return + // Add Power + // REMOVED //user.apply_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition) + // We don't track direction anymore! + // Return text indicating direction + display_proximity() + // NOTE: DON'T DEACTIVATE! + //DeactivatePower() + +/datum/action/bloodsucker/trackvamp/proc/display_proximity() + // Pick target + var/turf/my_loc = get_turf(owner) + //var/list/mob/living/carbon/vamps = list() + var/best_dist = 9999 + var/mob/living/best_vamp + + // Track ALL MONSTERS in Game Mode + var/list/datum/mind/monsters = list() + monsters += SSticker.mode.bloodsuckers + monsters += SSticker.mode.devils + //monsters += SSticker.mode.cult + monsters += SSticker.mode.wizards + monsters += SSticker.mode.apprentices + monsters += SSticker.mode.servants_of_ratvar + //monsters += SSticker.mode.changelings Disabled anyways + // + for(var/datum/mind/M in monsters) + if (!M.current || M.current == owner)// || !get_turf(M.current) || !get_turf(owner)) + continue + for(var/a in M.antag_datums) + var/datum/antagonist/antag_datum = a // var/datum/antagonist/antag_datum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(!istype(antag_datum) || antag_datum.AmFinalDeath()) + continue + var/their_loc = get_turf(M.current) + var/distance = get_dist_euclidian(my_loc, their_loc) + // Found One: Closer than previous/max distance + if (distance < best_dist && distance <= HUNTER_SCAN_MAX_DISTANCE) + best_dist = distance + best_vamp = M.current + break // Stop searching through my antag datums and go to the next guy + + // Found one! + if(best_vamp) + var/distString = best_dist <= HUNTER_SCAN_MAX_DISTANCE / 2 ? "somewhere closeby!" : "somewhere in the distance." + //to_chat(owner, "You detect signs of Bloodsuckers to the [dir2text(get_dir(my_loc,get_turf(targetVamp)))]!") + to_chat(owner, "You detect signs of monsters [distString]") + + // Will yield a "?" + else + to_chat(owner, "There are no monsters nearby.") + + + + + + + + + + + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// From martial.dm + +/* +/datum/martial_art/hunter + name = "Hunter-Fu" + id = "MARTIALART_HUNTER" //ID, used by mind/has_martialart + //streak = "" + //max_streak_length = 6 + //current_target + //datum/martial_art/base // The permanent style. This will be null unless the martial art is temporary + //deflection_chance = 0 //Chance to deflect projectiles + //reroute_deflection = FALSE //Delete the bullet, or actually deflect it in some direction? + //block_chance = 0 //Chance to block melee attacks using items while on throw mode. + //restraining = 0 //used in cqc's disarm_act to check if the disarmed is being restrained and so whether they should be put in a chokehold or not + //help_verb + //no_guns = FALSE + //allow_temp_override = TRUE //if this martial art can be overridden by temporary martial arts + +/datum/martial_art/hunter/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) + return FALSE + +/datum/martial_art/hunter/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) + return FALSE + +/datum/martial_art/hunter/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D) + return FALSE + +/datum/martial_art/hunter/can_use(mob/living/carbon/human/H) + return TRUE + + +/datum/martial_art/hunter/add_to_streak(element,mob/living/carbon/human/D) + if(D != current_target) + current_target = D + streak = "" + restraining = 0 + streak = streak+element + if(length(streak) > max_streak_length) + streak = copytext(streak,2) + return + + +/datum/martial_art/hunter/basic_hit(mob/living/carbon/human/A,mob/living/carbon/human/D) + + var/damage = rand(A.dna.species.punchdamagelow, A.dna.species.punchdamagehigh) +*/ +*/ diff --git a/code/modules/antagonists/bloodsucker/datum_vassal.dm b/code/modules/antagonists/bloodsucker/datum_vassal.dm new file mode 100644 index 0000000000..71ee0bcc1d --- /dev/null +++ b/code/modules/antagonists/bloodsucker/datum_vassal.dm @@ -0,0 +1,151 @@ +#define VASSAL_SCAN_MIN_DISTANCE 5 +#define VASSAL_SCAN_MAX_DISTANCE 500 +#define VASSAL_SCAN_PING_TIME 20 //2s update time. + + +/datum/antagonist/bloodsucker/proc/attempt_turn_vassal(mob/living/carbon/C) + C.silent = 0 + return SSticker.mode.make_vassal(C,owner) + +/datum/antagonist/bloodsucker/proc/FreeAllVassals() + for (var/datum/antagonist/vassal/V in vassals) + SSticker.mode.remove_vassal(V.owner) + +/datum/antagonist/vassal + name = "Vassal"//WARNING: DO NOT SELECT" // "Vassal" + roundend_category = "vassals" + antagpanel_category = "Bloodsucker" + job_rank = ROLE_BLOODSUCKER + var/datum/antagonist/bloodsucker/master // Who made me? + var/list/datum/action/powers = list()// Purchased powers + var/list/datum/objective/objectives_given = list() // For removal if needed. + +/datum/antagonist/vassal/can_be_owned(datum/mind/new_owner) + // If we weren't created by a bloodsucker, then we cannot be a vassal (assigned from antag panel) + if (!master) + return FALSE + return ..() + +/datum/antagonist/vassal/on_gain() + SSticker.mode.vassals |= owner // Add if not already in here (and you might be, if you were picked at round start) + // Mindslave Add + if(master) + var/datum/antagonist/bloodsucker/B = master.owner.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(B) + B.vassals |= src + owner.enslave_mind_to_creator(master.owner.current) + // Master Pinpointer + owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/vassal_edition) + // Powers + var/datum/action/bloodsucker/vassal/recuperate/new_Recuperate = new () + new_Recuperate.Grant(owner.current) + powers += new_Recuperate + // Give Vassal Objective + var/datum/objective/bloodsucker/vassal/vassal_objective = new + vassal_objective.owner = owner + vassal_objective.generate_objective() + objectives += vassal_objective + objectives_given += vassal_objective + give_thrall_eyes() + owner.current.grant_language(/datum/language/vampiric) + // Add Antag HUD + update_vassal_icons_added(owner.current, "vassal") + . = ..() + +/datum/antagonist/vassal/proc/give_thrall_eyes() + var/obj/item/organ/eyes/vassal/E = new + E.Insert(owner.current) + +/obj/item/organ/eyes/vassal/ + lighting_alpha = 180 // LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE <--- This is too low a value at 128. We need to SEE what the darkness is so we can hide in it. + see_in_dark = 12 + flash_protect = -1 //These eyes are weaker to flashes, but let you see in the dark + +/datum/antagonist/vassal/proc/remove_thrall_eyes() + var/obj/item/organ/eyes/E = new + E.Insert(owner.current) + +/datum/antagonist/vassal/on_removal() + SSticker.mode.vassals -= owner // Add if not already in here (and you might be, if you were picked at round start) + // Mindslave Remove + if (master && master.owner) + master.vassals -= src + if (owner.enslaved_to == master.owner.current) + owner.enslaved_to = null + // Master Pinpointer + owner.current.remove_status_effect(/datum/status_effect/agent_pinpointer/vassal_edition) + // Powers + while(powers.len) + var/datum/action/power = pick(powers) + powers -= power + power.Remove(owner.current) + // Remove Hunter Objectives + for(var/O in objectives_given) + objectives -= O + qdel(O) + objectives_given = list() + remove_thrall_eyes() + owner.current.remove_language(/datum/language/vampiric) + // Clear Antag HUD + update_vassal_icons_removed(owner.current) + + . = ..() + +/datum/antagonist/vassal/greet() + to_chat(owner, "You are now the mortal servant of [master.owner.current], a bloodsucking vampire!") + to_chat(owner, "The power of [master.owner.current.p_their()] immortal blood compells you to obey [master.owner.current.p_them()] in all things, even offering your own life to prolong theirs.
\ + You are not required to obey any other Bloodsucker, for only [master.owner.current] is your master. The laws of Nanotransen do not apply to you now; only your vampiric master's word must be obeyed.") + // Effects... + owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE) + //owner.store_memory("You became the mortal servant of [master.owner.current], a bloodsucking vampire!") + antag_memory += "You became the mortal servant of [master.owner.current], a bloodsucking vampire!
" + // And to your new Master... + to_chat(master.owner, "[owner.current] has become addicted to your immortal blood. [owner.current.p_they(TRUE)] [owner.current.p_are()] now your undying servant!") + master.owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE) + +/datum/antagonist/vassal/farewell() + owner.current.visible_message("[owner.current]'s eyes dart feverishly from side to side, and then stop. [owner.current.p_they(TRUE)] seem[owner.current.p_s()] calm, \ + like [owner.current.p_they()] [owner.current.p_have()] regained some lost part of [owner.current.p_them()]self.",\ + "With a snap, you are no longer enslaved to [master.owner]! You breathe in heavily, having regained your free will.") + owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE) + // And to your former Master... + //if (master && master.owner) + // to_chat(master.owner, "You feel the bond with your vassal [owner.current] has somehow been broken!") + +/datum/status_effect/agent_pinpointer/vassal_edition + id = "agent_pinpointer" + alert_type = /obj/screen/alert/status_effect/agent_pinpointer/vassal_edition + minimum_range = VASSAL_SCAN_MIN_DISTANCE + tick_interval = VASSAL_SCAN_PING_TIME + duration = -1 // runs out fast + range_fuzz_factor = 0 + +/obj/screen/alert/status_effect/agent_pinpointer/vassal_edition + name = "Blood Bond" + desc = "You always know where your master is." + //icon = 'icons/obj/device.dmi' + //icon_state = "pinon" + +/datum/status_effect/agent_pinpointer/vassal_edition/on_creation(mob/living/new_owner, ...) + ..() + + var/datum/antagonist/vassal/antag_datum = new_owner.mind.has_antag_datum(ANTAG_DATUM_VASSAL) + scan_target = antag_datum?.master?.owner?.current + +/datum/status_effect/agent_pinpointer/vassal_edition/scan_for_target() + // DO NOTHING. We already have our target, and don't wanna do anything from agent_pinpointer + +/datum/antagonist/vassal/proc/update_vassal_icons_added(mob/living/vassal, icontype="vassal") + var/datum/atom_hud/antag/bloodsucker/hud = GLOB.huds[ANTAG_HUD_BLOODSUCKER] + hud.join_hud(vassal) + set_antag_hud(vassal, icontype) // Located in icons/mob/hud.dmi + owner.current.hud_list[ANTAG_HUD].icon = image('icons/mob/hud.dmi', owner.current, "bloodsucker") + +/datum/antagonist/vassal/proc/update_vassal_icons_removed(mob/living/vassal) + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_BLOODSUCKER] + hud.leave_hud(vassal) + set_antag_hud(vassal, null) + +//Displayed at the start of roundend_category section, default to roundend_category header +/*/datum/antagonist/vassal/roundend_report_header() + return "Loyal to their bloodsucking masters, the Vassals were:

"*/ diff --git a/code/modules/antagonists/bloodsucker/items/bloodsucker_organs.dm b/code/modules/antagonists/bloodsucker/items/bloodsucker_organs.dm new file mode 100644 index 0000000000..5a905857c5 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/items/bloodsucker_organs.dm @@ -0,0 +1,70 @@ + + +/datum/antagonist/bloodsucker/proc/CheckVampOrgans() + // Do I have any parts that need replacing? + var/obj/item/organ/O + // Heart + O = owner.current.getorganslot(ORGAN_SLOT_HEART) + if(!istype(O, /obj/item/organ/heart/vampheart)) + qdel(O) + var/obj/item/organ/heart/vampheart/H = new + H.Insert(owner.current) + H.Stop() // Now...stop beating! + // Eyes + O = owner.current.getorganslot(ORGAN_SLOT_EYES) + if(!istype(O, /obj/item/organ/eyes/vassal/bloodsucker)) + qdel(O) + var/obj/item/organ/eyes/vassal/bloodsucker/E = new + E.Insert(owner.current) + +/datum/antagonist/bloodsucker/proc/RemoveVampOrgans() + // Heart + var/obj/item/organ/heart/H = new + H.Insert(owner.current) + // Eyes + var/obj/item/organ/eyes/E = new + E.Insert(owner.current) +// HEART: OVERWRITE // +// HEART // +/obj/item/organ/heart/vampheart + beating = 0 + var/fakingit = 0 + +/obj/item/organ/heart/vampheart/prepare_eat() + ..() + // Do cool stuff for eating vamp heart? + +/obj/item/organ/heart/vampheart/Restart() + beating = 0 // DONT run ..(). We don't want to start beating again. + return 0 + +/obj/item/organ/heart/vampheart/Stop() + fakingit = 0 + return ..() + +/obj/item/organ/heart/vampheart/proc/FakeStart() + fakingit = 1 // We're pretending to beat, to fool people. + +/obj/item/organ/heart/vampheart/HeartStrengthMessage() + if(fakingit) + return "a healthy" + return "no" // Bloodsuckers don't have a heartbeat at all when stopped (default is "an unstable") +// EYES // + +/obj/item/organ/eyes/vassal/bloodsucker + flash_protect = 2 //Eye healing isnt working properly + sight_flags = SEE_MOBS // Taken from augmented_eyesight.dm + +/* +// LIVER // +/obj/item/organ/liver/vampliver + // Livers run on_life(), which calls reagents.metabolize() in holder.dm, which calls on_mob_life.dm in the cheam (medicine_reagents.dm) + // Holder also calls reagents.reaction_mob for the moment it happens + +/obj/item/organ/liver/vampliver/on_life() + var/mob/living/carbon/C = owner + + if(!istype(C)) + return + +*/ diff --git a/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm new file mode 100644 index 0000000000..9db4cae1ff --- /dev/null +++ b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm @@ -0,0 +1,176 @@ + + +// organ_internal.dm -- /obj/item/organ + + + +// Do I have a stake in my heart? +/mob/living/AmStaked() + var/obj/item/bodypart/BP = get_bodypart("chest") + if (!BP) + return FALSE + for(var/obj/item/I in BP.embedded_objects) + if (istype(I,/obj/item/stake/)) + return TRUE + return FALSE +/mob/proc/AmStaked() + return FALSE + + +/mob/living/proc/StakeCanKillMe() + return IsSleeping() || stat >= UNCONSCIOUS || blood_volume <= 0 || HAS_TRAIT(src, TRAIT_DEATHCOMA) // NOTE: You can't go to sleep in a coffin with a stake in you. + + +///obj/item/weapon/melee/stake +/obj/item/stake/ + name = "wooden stake" + desc = "A simple wooden stake carved to a sharp point." + icon = 'icons/obj/items_and_weapons.dmi' + icon_state = "wood" // Inventory Icon + item_state = "wood" // In-hand Icon + lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi' // File for in-hand icon + righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi' + attack_verb = list("staked") + slot_flags = ITEM_SLOT_BELT + w_class = WEIGHT_CLASS_SMALL + hitsound = 'sound/weapons/bladeslice.ogg' + force = 6 + throwforce = 10 + embedding = list("embed_chance" = 25, "embedded_fall_chance" = 0.5) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled + //embed_chance = 25 // Look up "is_pointed" to see where we set stakes able to do this. + //embedded_fall_chance = 0.5 // Chance it will fall out. + obj_integrity = 30 + max_integrity = 30 + //embedded_fall_pain_multiplier + var/staketime = 120 // Time it takes to embed the stake into someone's chest. + +/obj/item/stake/basic + name = "wooden stake" + // This exists so Hardened/Silver Stake can't have a welding torch used on them. + +/obj/item/stake/basic/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/weldingtool)) + //if (amWelded) + // to_chat(user, "This stake has already been treated with fire.") + // return + //amWelded = TRUE + // Weld it + var/obj/item/weldingtool/WT = W + if(WT.use(0))//remove_fuel(0,user)) + user.visible_message("[user.name] scorched the pointy end of [src] with the welding tool.", \ + "You scorch the pointy end of [src] with the welding tool.", \ + "You hear welding.") + // 8 Second Timer + if(!do_mob(user, src, 80)) + return + // Create the Stake + qdel(src) + var/obj/item/stake/hardened/new_item = new(usr.loc) + user.put_in_hands(new_item) + else + return ..() + +/obj/item/stake/afterattack(atom/target, mob/user, proximity) + //to_chat(world, "DEBUG: Staking ") + // Invalid Target, or not targetting chest with HARM intent? + if(!iscarbon(target) || check_zone(user.zone_selected) != "chest" || user.a_intent != INTENT_HARM) + return + var/mob/living/carbon/C = target + // Needs to be Down/Slipped in some way to Stake. + if(!C.can_be_staked() || target == user) + to_chat(user, "You cant stake [target] when they are moving moving about! They have to be laying down!") + return + // Oops! Can't. + if(HAS_TRAIT(C, TRAIT_PIERCEIMMUNE)) + to_chat(user, "[target]'s chest resists the stake. It won't go in.") + return + // Make Attempt... + to_chat(user, "You put all your weight into embedding the stake into [target]'s chest...") + playsound(user, 'sound/magic/Demon_consume.ogg', 50, 1) + if(!do_mob(user, C, staketime, 0, 1, extra_checks=CALLBACK(C, /mob/living/carbon/proc/can_be_staked))) // user / target / time / uninterruptable / show progress bar / extra checks + return + // Drop & Embed Stake + user.visible_message("[user.name] drives the [src] into [target]'s chest!", \ + "You drive the [src] into [target]'s chest!") + playsound(get_turf(target), 'sound/effects/splat.ogg', 40, 1) + user.dropItemToGround(src, TRUE) //user.drop_item() // "drop item" doesn't seem to exist anymore. New proc is user.dropItemToGround() but it doesn't seem like it's needed now? + var/obj/item/bodypart/B = C.get_bodypart("chest") // This was all taken from hitby() in human_defense.dm + B.embedded_objects |= src + add_mob_blood(target)//Place blood on the stake + loc = C // Put INSIDE the character + B.receive_damage(w_class * embedding.embedded_impact_pain_multiplier) + if(C.mind) + var/datum/antagonist/bloodsucker/bloodsucker = C.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(bloodsucker) + // If DEAD or TORPID...kill vamp! + if(C.StakeCanKillMe()) // NOTE: This is the ONLY time a staked Torpid vamp dies. + bloodsucker.FinalDeath() + return + else + to_chat(target, "You have been staked! Your powers are useless, your death forever, while it remains in place.") + to_chat(user, "You missed [C.p_their(TRUE)]'s heart! It would be easier if [C.p_they(TRUE)] weren't struggling so much.") + +// Can this target be staked? If someone stands up before this is complete, it fails. Best used on someone stationary. +/mob/living/carbon/proc/can_be_staked() + //return resting || IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (has_trait(TRAIT_FAKEDEATH)) || resting || IsStun() || IsFrozen() || (pulledby && pulledby.grab_state >= GRAB_NECK) + return (src.resting || src.lying) + // ABOVE: Taken from update_mobility() in living.dm + +/obj/item/stake/hardened + // Created by welding and acid-treating a simple stake. + name = "hardened stake" + desc = "A hardened wooden stake carved to a sharp point and scorched at the end." + icon_state = "hardened" // Inventory Icon + force = 8 + throwforce = 12 + armour_penetration = 10 + embedding = list("embed_chance" = 50, "embedded_fall_chance" = 0) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled + obj_integrity = 120 + max_integrity = 120 + + staketime = 80 + +/obj/item/stake/hardened/silver + name = "silver stake" + desc = "Polished and sharp at the end. For when some mofo is always trying to iceskate uphill." + icon_state = "silver" // Inventory Icon + item_state = "silver" // In-hand Icon + siemens_coefficient = 1 //flags = CONDUCT // var/siemens_coefficient = 1 // for electrical admittance/conductance (electrocution checks and shit) + force = 9 + armour_penetration = 25 + embedding = list("embed_chance" = 65) // UPDATE 2/10/18 embedding_behavior.dm is how this is handled + obj_integrity = 300 + max_integrity = 300 + + staketime = 60 + +// Convert back to Silver +/obj/item/stake/hardened/silver/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/weldingtool)) + var/obj/item/weldingtool/WT = I + if(WT.use(0))//remove_fuel(0, user)) + var/obj/item/stack/sheet/mineral/silver/newsheet = new (user.loc) + for(var/obj/item/stack/sheet/mineral/silver/S in user.loc) + if(S == newsheet) + continue + if(S.amount >= S.max_amount) + continue + S.attackby(newsheet, user) + to_chat(user, "You melt down the stake and add it to the stack. It now contains [newsheet.amount] sheet\s.") + qdel(src) + else + return ..() + + +// Look up recipes.dm OR pneumaticCannon.dm +/datum/crafting_recipe/silver_stake + name = "Silver Stake" + result = /obj/item/stake/hardened/silver + tools = list(/obj/item/weldingtool) + reqs = list(/obj/item/stack/sheet/mineral/silver = 1, + /obj/item/stake/hardened = 1) + ///obj/item/stack/packageWrap = 8, + ///obj/item/pipe = 2) + time = 80 + category = CAT_WEAPONRY + subcategory = CAT_WEAPON diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm new file mode 100644 index 0000000000..946c472f11 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm @@ -0,0 +1,242 @@ + + +// TRAIT_DEATHCOMA - Activate this when you're in your coffin to simulate sleep/death. + + +// Coffins... +// -heal all wounds, and quickly. +// -restore limbs & organs +// + +// Without Coffins... +// - +// -limbs stay lost + + + +// To put to sleep: use owner.current.fakedeath("bloodsucker") but change name to "bloodsucker_coffin" so you continue to stay fakedeath despite healing in the main thread! + + +/datum/antagonist/bloodsucker/proc/ClaimCoffin(obj/structure/closet/crate/claimed) // NOTE: This can be any "closet" that you are resting AND inside of. + // ALREADY CLAIMED + if(claimed.resident) + if(claimed.resident == owner.current) + to_chat(owner, "This is your [src].") + else + to_chat(owner, "This [src] has already been claimed by another.") + return FALSE + // Bloodsucker Learns new Recipes! + owner.teach_crafting_recipe(/datum/crafting_recipe/bloodsucker/vassalrack) + owner.teach_crafting_recipe(/datum/crafting_recipe/bloodsucker/candelabrum) + // This is my Lair + coffin = claimed + lair = get_area(claimed) + // DONE + to_chat(owner, "You have claimed the [claimed] as your place of immortal rest! Your lair is now [lair].") + to_chat(owner, "You have learned new construction recipes to improve your lair.") + to_chat(owner, "Bloodsucker Tip: Find new lair recipes in the misc tab of the Crafting Menu at the bottom of the screen, including the Persuasion Rack for converting crew into Vassals.

") + RunLair() // Start + return TRUE + +// crate.dm +/obj/structure/closet/crate + var/mob/living/resident // This lets bloodsuckers claim any "closet" as a Coffin, so long as they could get into it and close it. This locks it in place, too. + +/obj/structure/closet/crate/coffin + var/pryLidTimer = 250 + can_weld_shut = FALSE + breakout_time = 200 + + +/obj/structure/closet/crate/coffin/blackcoffin + name = "black coffin" + desc = "For those departed who are not so dear." + icon_state = "coffin" + icon = 'icons/obj/vamp_obj.dmi' + can_weld_shut = FALSE + resistance_flags = 0 // Start off with no bonuses. + open_sound = 'sound/bloodsucker/coffin_open.ogg' + close_sound = 'sound/bloodsucker/coffin_close.ogg' + breakout_time = 600 + pryLidTimer = 400 + resistance_flags = NONE + +/obj/structure/closet/crate/coffin/meatcoffin + name = "meat coffin" + desc = "When you're ready to meat your maker, the steaks can never be too high." + icon_state = "meatcoffin" + icon = 'icons/obj/vamp_obj.dmi' + can_weld_shut = FALSE + resistance_flags = 0 // Start off with no bonuses. + open_sound = 'sound/effects/footstep/slime1.ogg' + close_sound = 'sound/effects/footstep/slime1.ogg' + breakout_time = 200 + pryLidTimer = 200 + resistance_flags = NONE + material_drop = /obj/item/reagent_containers/food/snacks/meat/slab + material_drop_amount = 3 + +/obj/structure/closet/crate/coffin/metalcoffin + name = "metal coffin" + desc = "A big metal sardine can inside of another big metal sardine can, in space." + icon_state = "metalcoffin" + icon = 'icons/obj/vamp_obj.dmi' + can_weld_shut = FALSE + resistance_flags = FIRE_PROOF | LAVA_PROOF + open_sound = 'sound/effects/pressureplate.ogg' + close_sound = 'sound/effects/pressureplate.ogg' + breakout_time = 300 + pryLidTimer = 200 + resistance_flags = NONE + material_drop = /obj/item/stack/sheet/metal + material_drop_amount = 5 + +////////////////////////////////////////////// + +/obj/structure/closet/crate/proc/ClaimCoffin(mob/living/claimant) // NOTE: This can be any "closet" that you are resting AND inside of. + // Bloodsucker Claim + var/datum/antagonist/bloodsucker/bloodsuckerdatum = claimant.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(bloodsuckerdatum) + // Vamp Successfuly Claims Me? + if(bloodsuckerdatum.ClaimCoffin(src)) + resident = claimant + anchored = 1 // No moving this + +/obj/structure/closet/crate/coffin/Destroy() + UnclaimCoffin() + return ..() + +/obj/structure/closet/crate/proc/UnclaimCoffin() + if (resident) + // Vamp Un-Claim + if (resident.mind) + var/datum/antagonist/bloodsucker/bloodsuckerdatum = resident.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if (bloodsuckerdatum && bloodsuckerdatum.coffin == src) + bloodsuckerdatum.coffin = null + bloodsuckerdatum.lair = null + to_chat(resident, "You sense that the link with your coffin, your sacred place of rest, has been brokem! You will need to seek another.") + resident = null // Remove resident. Because this object isnt removed from the game immediately (GC?) we need to give them a way to see they don't have a home anymore. + +/obj/structure/closet/crate/coffin/can_open(mob/living/user) + // You cannot lock in/out a coffin's owner. SORRY. + if (locked) + if(user == resident) + if (welded) + welded = FALSE + update_icon() + //to_chat(user, "You flip a secret latch and unlock [src].") // Don't bother. We know it's unlocked. + locked = FALSE + return 1 + else + playsound(get_turf(src), 'sound/machines/door_locked.ogg', 20, 1) + to_chat(user, "[src] is locked tight from the inside.") + return ..() + +/obj/structure/closet/crate/coffin/close(mob/living/user) + var/turf/Turf = get_turf(src) + var/area/A = get_area(src) + if (!..()) + return FALSE + // Only the User can put themself into Torpor (if you're already in it, you'll start to heal) + if((user in src)) + // Bloodsucker Only + var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(bloodsuckerdatum) + LockMe(user) + Turf = get_turf(user) //we may have moved. adjust as needed... + A = get_area(src) + // Claim? + if(!bloodsuckerdatum.coffin && !resident && (is_station_level(Turf.z) || !A.map_name == "Space")) + switch(alert(user,"Do you wish to claim this as your coffin? [get_area(src)] will be your lair.","Claim Lair","Yes", "No")) + if("Yes") + ClaimCoffin(user) + if (user.AmStaked()) // Stake? No Heal! + to_chat(bloodsuckerdatum.owner.current, "You are staked! Remove the offending weapon from your heart before sleeping.") + return + // Heal + if(bloodsuckerdatum.HandleHealing(0)) // Healing Mult 0 <--- We only want to check if healing is valid! + to_chat(bloodsuckerdatum.owner.current, "You enter the horrible slumber of deathless Torpor. You will heal until you are renewed.") + bloodsuckerdatum.Torpor_Begin() + // Level Up? + bloodsuckerdatum.SpendRank() // Auto-Fails if not appropriate + return TRUE + +/obj/structure/closet/crate/coffin/attackby(obj/item/W, mob/user, params) + // You cannot weld or deconstruct an owned coffin. STILL NOT SORRY. + if (resident != null && user != resident) // Owner can destroy their own coffin. + if(opened) + if(istype(W, cutting_tool)) + to_chat(user, "This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src].") + return + else if(anchored && istype(W, /obj/item/wrench)) // Can't unanchor unless owner. + to_chat(user, "The coffin won't come unanchored from the floor.") + return + + if(locked && istype(W, /obj/item/crowbar)) + var/pry_time = pryLidTimer * W.toolspeed // Pry speed must be affected by the speed of the tool. + user.visible_message("[user] tries to pry the lid off of [src] with [W].", \ + "You begin prying the lid off of [src] with [W]. This should take about [DisplayTimeText(pry_time)].") + if (!do_mob(user,src,pry_time)) + return + bust_open() + user.visible_message("[user] snaps the door of [src] wide open.", \ + "The door of [src] snaps open.") + return + ..() + + + +/obj/structure/closet/crate/coffin/AltClick(mob/user) + // Distance Check (Inside Of) + if (user in src) // user.Adjacent(src) + LockMe(user, !locked) + +/obj/structure/closet/crate/proc/LockMe(mob/user, inLocked = TRUE) + // Lock + if (user == resident) + if (!broken) + locked = inLocked + to_chat(user, "You flip a secret latch and [locked?"":"un"]lock yourself inside [src].") + else + to_chat(resident, "The secret latch to lock [src] from the inside is broken. You set it back into place...") + if (do_mob(resident, src, 50))//sleep(10) + if (broken) // Spam Safety + to_chat(resident, "You fix the mechanism and lock it.") + broken = FALSE + locked = TRUE + +// Look up recipes.dm OR pneumaticCannon.dm +/datum/crafting_recipe/bloodsucker/blackcoffin + name = "Black Coffin" + result = /obj/structure/closet/crate/coffin/blackcoffin + tools = list(/obj/item/weldingtool, + /obj/item/screwdriver) + reqs = list(/obj/item/stack/sheet/cloth = 1, + /obj/item/stack/sheet/mineral/wood = 5, + /obj/item/stack/sheet/metal = 1) + ///obj/item/stack/packageWrap = 8, + ///obj/item/pipe = 2) + time = 150 + category = CAT_MISC + always_availible = TRUE + +/datum/crafting_recipe/bloodsucker/meatcoffin + name = "Meat Coffin" + result =/obj/structure/closet/crate/coffin/meatcoffin + tools = list(/obj/item/kitchen/knife, + /obj/item/kitchen/rollingpin) + reqs = list(/obj/item/reagent_containers/food/snacks/meat/slab = 5, + /obj/item/restraints/handcuffs/cable = 1) + time = 150 + category = CAT_MISC + always_availible = TRUE + +/datum/crafting_recipe/bloodsucker/metalcoffin + name = "Metal Coffin" + result =/obj/structure/closet/crate/coffin/metalcoffin + tools = list(/obj/item/weldingtool, + /obj/item/screwdriver) + reqs = list(/obj/item/stack/sheet/metal = 5) + time = 100 + category = CAT_MISC + always_availible = TRUE diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm new file mode 100644 index 0000000000..f73912d0f5 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm @@ -0,0 +1,497 @@ + + + +// IDEAS -- +// An object that disguises your coffin while you're in it! +// +// An object that lets your lair itself protect you from sunlight, like a coffin would (no healing tho) + + + +// Hide a random object somewhere on the station: +// var/turf/targetturf = get_random_station_turf() +// var/turf/targetturf = get_safe_random_station_turf() + + + + +// CRYPT OBJECTS +// +// +// PODIUM Stores your Relics +// +// ALTAR Transmute items into sacred items. +// +// PORTRAIT Gaze into your past to: restore mood boost? +// +// BOOKSHELF Discover secrets about crew and locations. Learn languages. Learn marial arts. +// +// BRAZER Burn rare ingredients to gleen insights. +// +// RUG Ornate, and creaks when stepped upon by any humanoid other than yourself and your vassals. +// +// X COFFIN (Handled elsewhere) +// +// X CANDELABRA (Handled elsewhere) +// +// THRONE Your mental powers work at any range on anyone inside your crypt. +// +// MIRROR Find any person +// +// BUST/STATUE Create terror, but looks just like you (maybe just in Examine?) + + +// RELICS +// +// RITUAL DAGGER +// +// SKULL +// +// VAMPIRIC SCROLL +// +// SAINTS BONES +// +// GRIMOIRE + + +// RARE INGREDIENTS +// Ore +// Books (Manuals) + + +// NOTE: Look up AI and Sentient Disease to see how the game handles the selector logo that only one player is allowed to see. We could add hud for vamps to that? +// ALTERNATIVELY, use the Vamp Huds on relics to mark them, but only show to relevant vamps? + + +/obj/structure/bloodsucker + var/mob/living/owner + +/* +/obj/structure/bloodsucker/bloodthrone + name = "wicked throne" + desc = "Twisted metal shards jut from the arm rests. Very uncomfortable looking. It would take a sadistic sort to sit on this jagged piece of furniture." + +/obj/structure/bloodsucker/bloodaltar + name = "bloody altar" + desc = "It is marble, lined with basalt, and radiates an unnerving chill that puts your skin on edge." + +/obj/structure/bloodsucker/bloodstatue + name = "bloody countenance" + desc = "It looks upsettingly familiar..." + +/obj/structure/bloodsucker/bloodportrait + name = "oil portrait" + desc = "A disturbingly familiar face stares back at you. On second thought, the reds don't seem to be painted in oil..." + +/obj/structure/bloodsucker/bloodbrazer + name = "lit brazer" + desc = "It burns slowly, but doesn't radiate any heat." + +/obj/structure/bloodsucker/bloodmirror + name = "faded mirror" + desc = "You get the sense that the foggy reflection looking back at you has an alien intelligence to it." +*/ + + +/obj/structure/bloodsucker/vassalrack + name = "persuasion rack" + desc = "If this wasn't meant for torture, then someone has some fairly horrifying hobbies." + icon = 'icons/obj/vamp_obj.dmi' + icon_state = "vassalrack" + buckle_lying = FALSE + anchored = FALSE + density = TRUE // Start dense. Once fixed in place, go non-dense. + can_buckle = TRUE + var/useLock = FALSE // So we can't just keep dragging ppl on here. + var/mob/buckled + var/convert_progress = 3 // Resets on each new character to be added to the chair. Some effects should lower it... + var/disloyalty_confirm = FALSE // Command & Antags need to CONFIRM they are willing to lose their role (and will only do it if the Vassal'ing succeeds) + var/disloyalty_offered = FALSE // Has the popup been issued? Don't spam them. + var/convert_cost = 100 + +/obj/structure/bloodsucker/vassalrack/deconstruct(disassembled = TRUE) + new /obj/item/stack/sheet/metal(src.loc, 4) + new /obj/item/stack/rods(loc, 4) + qdel(src) + +/obj/structure/bloodsucker/vassalrack/examine(mob/user) + . = ..() + if((user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) || 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."} + . += {"Make sure that the victim is handcuffed, or else they can simply run away or resist, as the process is not instant."} + . += {"To convert the victim, simply click on the vassal rack itself. Sharp weapons work faster than other tools."} +/* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL) + . += {"This is the vassal rack, which allows your master to thrall crewmembers into his minions.\n + Aid your master in bringing their victims here and keeping them secure.\n + You can secure victims to the vassal rack by click dragging the victim onto the rack while it is secured"} */ + +/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 && user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + 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 + var/waspulling = (O == owner.pulling) + var/wasgrabstate = owner.grab_state + // * MOVE! * + O.forceMove(drop_location()) + // PULL TARGET: Restore? + if(waspulling) + owner.start_pulling(O, wasgrabstate, TRUE) + // NOTE: in bs_lunge.dm, we use [target.grabbedby(owner)], which simulates doing a grab action. We don't want that though...we're cutting directly back to where we were in a grab. + // Do Action! + useLock = TRUE + if(do_mob(user, O, 50)) + attach_victim(O,user) + useLock = FALSE + +/obj/structure/bloodsucker/vassalrack/AltClick(mob/user) + if(!has_buckled_mobs() || !isliving(user) || useLock) + return + // Attempt Release (Owner vs Non Owner) + var/mob/living/carbon/C = pick(buckled_mobs) + if(C) + if(user == owner) + unbuckle_mob(C) + else + user_unbuckle_mob(C,user) + +/obj/structure/bloodsucker/vassalrack/proc/attach_victim(mob/living/M, mob/living/user) + // Standard Buckle Check + if(!buckle_mob(M)) // force=TRUE)) + return + // Attempt Buckle + user.visible_message("[user] straps [M] into the rack, immobilizing them.", \ + "You secure [M] tightly in place. They won't escape you now.") + + playsound(src.loc, 'sound/effects/pop_expl.ogg', 25, 1) + //M.forceMove(drop_location()) <--- CANT DO! This cancels the buckle_mob() we JUST did (even if we foced the move) + M.setDir(2) + density = TRUE + var/matrix/m180 = matrix(M.transform) + m180.Turn(180)//90)//180 + animate(M, transform = m180, time = 2) + M.pixel_y = -2 //M.get_standard_pixel_y_offset(120)//180) + update_icon() + // Torture Stuff + convert_progress = 2 // Goes down unless you start over. + disloyalty_confirm = FALSE // New guy gets the chance to say NO if he's special. + disloyalty_offered = FALSE // Prevents spamming torture window. + +/obj/structure/bloodsucker/vassalrack/user_unbuckle_mob(mob/living/M, mob/user) + // Attempt Unbuckle + if(!user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + 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.") + else + M.visible_message("[user] tries to pull [M] rack!",\ + "[user] attempts to release you from the rack!") // For sound if not seen --> "You hear a squishy wet noise.") + if(!do_mob(user, M, 100)) + return + // Did the time. Now try to do it. + ..() + unbuckle_mob(M) + +/obj/structure/bloodsucker/vassalrack/unbuckle_mob(mob/living/buckled_mob, force = FALSE) + if(!..()) + return + var/matrix/m180 = matrix(buckled_mob.transform) + m180.Turn(180)//-90)//180 + animate(buckled_mob, transform = m180, time = 2) + buckled_mob.pixel_y = buckled_mob.get_standard_pixel_y_offset(180) + src.visible_message(text("[buckled_mob][buckled_mob.stat==DEAD?"'s corpse":""] slides off of the rack.")) + density = FALSE + buckled_mob.AdjustKnockdown(30) + update_icon() + useLock = FALSE // Failsafe + +/obj/structure/bloodsucker/vassalrack/attackby(obj/item/W, mob/user, params) + if(has_buckled_mobs()) // Attack w/weapon vs guy standing there? Don't do an attack. + attack_hand(user) + return FALSE + return ..() + +/obj/structure/bloodsucker/vassalrack/attack_hand(mob/user) + //. = ..() // Taken from sacrificial altar in divine.dm + //if(.) + // return + // Go away. Torturing. + if(useLock) + return + var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + // CHECK ONE: Am I claiming this? Is it in the right place? + if(istype(bloodsuckerdatum) && !owner) + if(!bloodsuckerdatum.lair) + to_chat(user, "You don't have a lair. Claim a coffin to make that location your lair.") + if(bloodsuckerdatum.lair != get_area(src)) + to_chat(user, "You may only activate this structure in your lair: [bloodsuckerdatum.lair].") + return + switch(alert(user,"Do you wish to afix this structure here? Be aware you wont be able to unsecure it anymore","Secure [src]","Yes", "No")) + if("Yes") + owner = user + density = FALSE + anchored = TRUE + return //No, you cant move this ever again + // No One Home + if(!has_buckled_mobs()) + return + // CHECK TWO: Am I a non-bloodsucker? + var/mob/living/carbon/C = pick(buckled_mobs) + if(!istype(bloodsuckerdatum)) + // Try to release this guy + user_unbuckle_mob(C, user) + return + // Bloodsucker Owner! Let the boy go. + if(C.mind) + var/datum/antagonist/vassal/vassaldatum = C.mind.has_antag_datum(ANTAG_DATUM_VASSAL) + if (istype(vassaldatum) && vassaldatum.master == bloodsuckerdatum || C.stat >= DEAD) + unbuckle_mob(C) + useLock = FALSE // Failsafe + return + // Just torture the boy + torture_victim(user, C) + +/obj/structure/bloodsucker/vassalrack/proc/torture_victim(mob/living/user, mob/living/target) + // Check Bloodmob/living/M, force = FALSE, check_loc = TRUE + if(user.blood_volume < convert_cost + 5) + to_chat(user, "You don't have enough blood to initiate the Dark Communion with [target].") + return + // Prep... + useLock = TRUE + // Step One: Tick Down Conversion from 3 to 0 + // Step Two: Break mindshielding/antag (on approve) + // Step Three: Blood Ritual + // Conversion Process + if(convert_progress > 0) + to_chat(user, "You prepare to initiate [target] into your service.") + if(!do_torture(user,target)) + to_chat(user, "The ritual has been interrupted!") + else + convert_progress -- // Ouch. Stop. Don't. + // All done! + if(convert_progress <= 0) + // FAIL: Can't be Vassal + if(!SSticker.mode.can_make_vassal(target, user, display_warning=FALSE) && HAS_TRAIT(target, TRAIT_MINDSHIELD)) // If I'm an unconvertable Antag ONLY + to_chat(user, "[target] doesn't respond to your persuasion. It doesn't appear they can be converted to follow you, they either have a mindshield or their external loyalties are too difficult for you to break.\[ALT+click to release\]") + convert_progress ++ // Pop it back up some. Avoids wasting Blood on a lost cause. + // SUCCESS: All done! + else + if(RequireDisloyalty(target)) + to_chat(user, "[target] has external loyalties! [target.p_they(TRUE)] will require more persuasion to break [target.p_them()] to your will!") + else + to_chat(user, "[target] looks ready for the Dark Communion.") + // Still Need More Persuasion... + else + to_chat(user, "[target] could use [convert_progress == 1?"a little":"some"] more persuasion.") + useLock = FALSE + return + // Check: Mindshield & Antag + if(!disloyalty_confirm && RequireDisloyalty(target)) + if(!do_disloyalty(user,target)) + to_chat(user, "The ritual has been interrupted!") + else if (!disloyalty_confirm) + to_chat(user, "[target] refuses to give into your persuasion. Perhaps a little more?") + else + to_chat(user, "[target] looks ready for the Dark Communion.") + useLock = FALSE + return + // Check: Blood + if(user.blood_volume < convert_cost) + to_chat(user, "You don't have enough blood to initiate the Dark Communion with [target].") + useLock = FALSE + return + var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + bloodsuckerdatum.AddBloodVolume(-convert_cost) + target.add_mob_blood(user) + user.visible_message("[user] marks a bloody smear on [target]'s forehead and puts a wrist up to [target.p_their()] mouth!", \ + "You paint a bloody marking across [target]'s forehead, place your wrist to [target.p_their()] mouth, and subject [target.p_them()] to the Dark Communion.") + if(!do_mob(user, src, 50)) + to_chat(user, "The ritual has been interrupted!") + useLock = FALSE + return + // Convert to Vassal! + if(bloodsuckerdatum && bloodsuckerdatum.attempt_turn_vassal(target)) + //remove_loyalties(target) // In case of Mindshield, or appropriate Antag (Traitor, Internal, etc) + //if (!target.buckled) + // to_chat(user, "The ritual has been interrupted!") + // useLock = FALSE + // return + user.playsound_local(null, 'sound/effects/explosion_distant.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. + target.playsound_local(null, 'sound/effects/explosion_distant.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. + target.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. + target.Jitter(25) + target.emote("laugh") + //remove_victim(target) // Remove on CLICK ONLY! + useLock = FALSE + +/obj/structure/bloodsucker/vassalrack/proc/do_torture(mob/living/user, mob/living/target, mult=1) + var/torture_time = 15 // Fifteen seconds if you aren't using anything. Shorter with weapons and such. + var/torture_dmg_brute = 2 + var/torture_dmg_burn = 0 + // Get Bodypart + var/target_string = "" + var/obj/item/bodypart/BP = null + if(iscarbon(target)) + var/mob/living/carbon/C = target + BP = pick(C.bodyparts) + if(BP) + target_string += BP.name + // Get Weapon + var/obj/item/I = user.get_active_held_item() + if(!istype(I)) + I = user.get_inactive_held_item() + // Create Strings + var/method_string = I?.attack_verb?.len ? pick(I.attack_verb) : pick("harmed","tortured","wrenched","twisted","scoured","beaten","lashed","scathed") + var/weapon_string = I ? I.name : pick("bare hands","hands","fingers","fists") + // Weapon Bonus + SFX + if(I) + torture_time -= I.force / 4 + torture_dmg_brute += I.force / 4 + //torture_dmg_burn += I. + if(I.sharpness == IS_SHARP) + torture_time -= 1 + else if(I.sharpness == IS_SHARP_ACCURATE) + torture_time -= 2 + if(istype(I, /obj/item/weldingtool)) + var/obj/item/weldingtool/welder = I + welder.welding = TRUE + torture_time -= 5 + torture_dmg_burn += 5 + I.play_tool_sound(target) + torture_time = max(50, torture_time * 10) // Minimum 5 seconds. + // Now run process. + if(!do_mob(user, target, torture_time * mult)) + return FALSE + // SUCCESS + if(I) + playsound(loc, I.hitsound, 30, 1, -1) + I.play_tool_sound(target) + target.visible_message("[user] has [method_string] [target]'s [target_string] with [user.p_their()] [weapon_string]!", \ + "[user] has [method_string] your [target_string] with [user.p_their()] [weapon_string]!") + if(!target.is_muzzled()) + target.emote("scream") + target.Jitter(5) + target.apply_damages(brute = torture_dmg_brute, burn = torture_dmg_burn, def_zone = (BP ? BP.body_zone : null)) // take_overall_damage(6,0) + return TRUE + +/obj/structure/bloodsucker/vassalrack/proc/do_disloyalty(mob/living/user, mob/living/target) + + // OFFER YES/NO NOW! + spawn(10) + if(useLock && target && target.client) // Are we still torturing? Did we cancel? Are they still here? + to_chat(user, "[target] has been given the opportunity for servitude. You await their decision...") + var/alert_text = "You are being tortured! Do you want to give in and pledge your undying loyalty to [user]?" + /* if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) + alert_text += "\n\nYou will no longer be loyal to the station!" + if(SSticker.mode.AmValidAntag(target.mind)) */ + alert_text += "\n\nYou will not lose your current objectives, but they come second to the will of your new master!" + switch(alert(target, alert_text,"THE HORRIBLE PAIN! WHEN WILL IT END?!","Yes, Master!", "NEVER!")) + if("Yes, Master!") + disloyalty_accept(target) + else + disloyalty_refuse(target) + if(!do_torture(user,target, 2)) + return FALSE + + // NOTE: We only remove loyalties when we're CONVERTED! + return TRUE + +/obj/structure/bloodsucker/vassalrack/proc/RequireDisloyalty(mob/living/target) + return SSticker.mode.AmValidAntag(target.mind) //|| HAS_TRAIT(target, TRAIT_MINDSHIELD) + +/obj/structure/bloodsucker/vassalrack/proc/disloyalty_accept(mob/living/target) + // FAILSAFE: Still on the rack? + if(!(locate(target) in buckled_mobs)) + return + // NOTE: You can say YES after torture. It'll apply to next time. + disloyalty_confirm = TRUE + /*if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) + to_chat(target, "You give in to the will of your torturer. If they are successful, you will no longer be loyal to the station!") +*/ +/obj/structure/bloodsucker/vassalrack/proc/disloyalty_refuse(mob/living/target) + // FAILSAFE: Still on the rack? + if(!(locate(target) in buckled_mobs)) + return + // Failsafe: You already said YES. + if(disloyalty_confirm) + return + to_chat(target, "You refuse to give in! You will not break!") + + +/obj/structure/bloodsucker/vassalrack/proc/remove_loyalties(mob/living/target) + // Find Mind Implant & Destroy + if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) + for(var/obj/item/implant/I in target.implants) + if(I.type == /obj/item/implant/mindshield) + I.removed(target,silent=TRUE) + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/obj/structure/bloodsucker/candelabrum + name = "candelabrum" + desc = "It burns slowly, but doesn't radiate any heat." + icon = 'icons/obj/vamp_obj.dmi' + icon_state = "candelabrum" + light_color = "#66FFFF"//LIGHT_COLOR_BLUEGREEN // lighting.dm + light_power = 3 + light_range = 0 // to 2 + density = FALSE + anchored = FALSE + var/lit = FALSE +///obj/structure/bloodsucker/candelabrum/is_hot() // candle.dm + //return FALSE + +/obj/structure/bloodsucker/candelabrum/Destroy() + STOP_PROCESSING(SSobj, src) + +/obj/structure/bloodsucker/candelabrum/update_icon() + icon_state = "candelabrum[lit ? "_lit" : ""]" + +/obj/structure/bloodsucker/candelabrum/examine(mob/user) + . = ..() + if((user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) || 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) + . += {"This is a magical candle which drains at the sanity of the fools who havent yet accepted your master, as long as it is active.\n + You can turn it on and off by clicking on it while you are next to it"} */ + +/obj/structure/bloodsucker/candelabrum/attack_hand(mob/user) + var/datum/antagonist/bloodsucker/V = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) //I wish there was a better way to do this + var/datum/antagonist/vassal/T = user.mind.has_antag_datum(ANTAG_DATUM_VASSAL) + if(istype(V) || istype(T)) + toggle() + +/obj/structure/bloodsucker/candelabrum/AltClick(mob/user) + var/datum/antagonist/bloodsucker/V = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + // Bloodsuckers can turn their candles on from a distance. SPOOOOKY. + if(istype(V)) + toggle() + +/obj/structure/bloodsucker/candelabrum/proc/toggle(mob/user) + lit = !lit + if(lit) + set_light(2, 3, "#66FFFF") + START_PROCESSING(SSobj, src) + else + set_light(0) + STOP_PROCESSING(SSobj, src) + update_icon() + +/obj/structure/bloodsucker/candelabrum/process() + 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) + var/datum/antagonist/bloodsucker/V = H.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if(V || 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) +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// OTHER THINGS TO USE: HUMAN BLOOD. /obj/effect/decal/cleanable/blood + +/obj/item/restraints/legcuffs/beartrap/bloodsucker diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_lair.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_lair.dm new file mode 100644 index 0000000000..f68191d6d7 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_lair.dm @@ -0,0 +1,88 @@ + + +// Created by claiming a Coffin. + + + +// THINGS TO SPAWN: +// +// /obj/effect/decal/cleanable/cobweb && /obj/effect/decal/cleanable/cobweb/cobweb2 +// /obj/effect/decal/cleanable/generic +// /obj/effect/decal/cleanable/dirt/dust <-- Pretty cool, just stains the tile itself. +// /obj/effect/decal/cleanable/blood/old + +/* +/area/ + // All coffins assigned to this area + var/list/obj/structure/closet/crate/laircoffins = new list() + +// Called by Coffin when an area is claimed as a vamp's lair +/area/proc/ClaimAsLair(/obj/structure/closet/crate/inClaimant) + set waitfor = FALSE // Don't make on_gain() wait for this function to finish. This lets this code run on the side. + + laircoffins += laircoffins + sleep() + + // Cancel! + if (laircoffins.len == 0) + return + */ + +/datum/antagonist/bloodsucker/proc/RunLair() + set waitfor = FALSE // Don't make on_gain() wait for this function to finish. This lets this code run on the side. + while(!AmFinalDeath() && coffin && lair) + // WAit 2 min and Repeat + sleep(120) + // Coffin Moved SOMEHOW? + if(lair != get_area(coffin)) + if(coffin) + coffin.UnclaimCoffin() + //lair = get_area(coffin) + break // DONE + var/list/turf/area_turfs = get_area_turfs(lair) + // Create Dirt etc. + var/turf/T_Dirty = pick(area_turfs) + if(T_Dirty && !T_Dirty.density) + // Default: Dirt + // CHECK: Cobweb already there? + //if (!locate(var/obj/effect/decal/cleanable/cobweb) in T_Dirty) // REMOVED! Cleanables don't stack. + // STEP ONE: COBWEBS + // CHECK: Wall to North? + var/turf/check_N = get_step(T_Dirty, NORTH) + if(istype(check_N, /turf/closed/wall)) + // CHECK: Wall to West? + var/turf/check_W = get_step(T_Dirty, WEST) + if(istype(check_W, /turf/closed/wall)) + new /obj/effect/decal/cleanable/cobweb (T_Dirty) + // CHECK: Wall to East? + var/turf/check_E = get_step(T_Dirty, EAST) + if(istype(check_E, /turf/closed/wall)) + new /obj/effect/decal/cleanable/cobweb/cobweb2 (T_Dirty) + // STEP TWO: DIRT + new /obj/effect/decal/cleanable/dirt (T_Dirty) + // Find Animals in Area + /* if(rand(0,2) == 0) + var/mobCount = 0 + var/mobMax = CLAMP(area_turfs.len / 25, 1, 4) + for (var/turf/T in area_turfs) + if(!T) continue + var/mob/living/simple_animal/SA = locate() in T + if(SA) + mobCount ++ + if (mobCount >= mobMax) // Already at max + break + Spawn One + if(mobCount < mobMax) + Seek Out Location + while(area_turfs.len > 0) + var/turf/T = pick(area_turfs) // We use while&pick instead of a for/loop so it's random, rather than from the top of the list. + if(T && !T.density) + var/mob/living/simple_animal/SA = /mob/living/simple_animal/mouse // pick(/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse, /mob/living/simple_animal/hostile/retaliate/bat) //prob(300) /mob/living/simple_animal/mouse, + new SA (T) + break + area_turfs -= T*/ + // NOTE: area_turfs is now cleared out! + if(coffin) + coffin.UnclaimCoffin() + // Done (somehow) + lair = null diff --git a/code/modules/antagonists/bloodsucker/powers/bs_brawn.dm b/code/modules/antagonists/bloodsucker/powers/bs_brawn.dm new file mode 100644 index 0000000000..49aada3611 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_brawn.dm @@ -0,0 +1,174 @@ + + +/datum/action/bloodsucker/targeted/brawn + name = "Brawn"//"Cellular Emporium" + desc = "Snap restraints with ease, or deal terrible damage with your bare hands." + button_icon_state = "power_strength" + bloodcost = 10 + cooldown = 130 + target_range = 1 + power_activates_immediately = TRUE + message_Trigger = ""//"Whom will you subvert to your will?" + must_be_capacitated = TRUE + can_be_immobilized = TRUE + bloodsucker_can_buy = TRUE + // Level Up + var/upgrade_canLocker = FALSE + var/upgrade_canDoor = FALSE + +/datum/action/bloodsucker/targeted/brawn/CheckCanUse(display_error) + . = ..() + if(!.) + return + . = TRUE + // Break Out of Restraints! (And then cancel) + if(CheckBreakRestraints()) + //PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!DEACTIVATE! + . = FALSE //return FALSE + // Throw Off Attacker! (And then cancel) + if(CheckEscapePuller()) + //PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!DEACTIVATE! + . = FALSE //return FALSE + /*if(CheckBreakLocker()) + .= FALSE */ + // Did we successfuly use power to BREAK CUFFS and/or ESCAPE PULLER and/or escape from a locker? + // Then PAY COST! + if(. == FALSE) + PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN!DEACTIVATE! + + // NOTE: We use . = FALSE so that we can break cuffs AND throw off our attacker in one use! + //return TRUE +/datum/action/bloodsucker/targeted/brawn/CheckValidTarget(atom/A) + return isliving(A) || istype(A, /obj/machinery/door) + +/datum/action/bloodsucker/targeted/brawn/CheckCanTarget(atom/A, display_error) + // DEFAULT CHECKS (Distance) + if(!..()) // Disable range notice for Brawn. + return FALSE + // Must outside Closet to target anyone! + if(!isturf(owner.loc)) + return FALSE + // Check: Self + if(A == owner) + return FALSE + // Target Type: Living + if(isliving(A)) + return TRUE + // Target Type: Door + else if(istype(A, /obj/machinery/door)) + return TRUE + return ..() // yes, FALSE! You failed if you got here! BAD TARGET + +/datum/action/bloodsucker/targeted/brawn/FireTargetedPower(atom/A) + // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. + var/mob/living/carbon/target = A + var/mob/living/user = owner + // Target Type: Mob + if(isliving(target)) + var/mob/living/carbon/user_C = user + var/hitStrength = user_C.dna.species.punchdamagehigh * 1.3 + 5 + // Knockdown! + var/powerlevel = min(5, 1 + level_current) + if(rand(5 + powerlevel) >= 5) + target.visible_message("[user] lands a vicious punch, sending [target] away!", \ + "[user] has landed a horrifying punch on you, sending you flying!!", null, COMBAT_MESSAGE_RANGE) + target.Knockdown(min(5, rand(10, 10 * powerlevel)) ) + // Chance of KO + if(rand(6 + powerlevel) >= 6 && target.stat <= UNCONSCIOUS) + target.Unconscious(40) + // Attack! + playsound(get_turf(target), 'sound/weapons/punch4.ogg', 60, 1, -1) + user.do_attack_animation(target, ATTACK_EFFECT_SMASH) + var/obj/item/bodypart/affecting = target.get_bodypart(ran_zone(target.zone_selected)) + target.apply_damage(hitStrength, BRUTE, affecting) + // Knockback + var/send_dir = get_dir(owner, target) + var/turf/T = get_ranged_target_turf(target, send_dir, powerlevel) + owner.newtonian_move(send_dir) // Bounce back in 0 G + target.throw_at(T, powerlevel, TRUE, owner) //new /datum/forced_movement(target, get_ranged_target_turf(target, send_dir, (hitStrength / 4)), 1, FALSE) + // Target Type: Door + else if(istype(target, /obj/machinery/door)) + var/obj/machinery/door/D = target + playsound(get_turf(usr), 'sound/machines/airlock_alien_prying.ogg', 40, 1, -1) + to_chat(user, "You prepare to tear open [D].") + if(do_mob(usr,target,25)) + if (D.Adjacent(user)) + to_chat(user, "You tear open the [D].") + user.Stun(10) + user.do_attack_animation(D, ATTACK_EFFECT_SMASH) + playsound(get_turf(D), 'sound/effects/bang.ogg', 30, 1, -1) + D.open(2) // open(2) is like a crowbar or jaws of life. + // Target Type: Closet + +/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakRestraints() + if(!iscarbon(owner)) // || !owner.restrained() + return FALSE + // (NOTE: Just like biodegrade.dm, we only remove one thing per use // + // Destroy Cuffs + var/mob/living/carbon/user_C = owner + //message_admins("DEBUG3: attempt_cast() [name] / [user_C.handcuffed] ") + if(user_C.handcuffed) + var/obj/O = user_C.get_item_by_slot(SLOT_HANDCUFFED) + if(istype(O)) + //user_C.visible_message("[user_C] attempts to remove [O]!", \ + // "You snap [O] like it's nothing!") + user_C.clear_cuffs(O,TRUE) + playsound(get_turf(usr), 'sound/effects/grillehit.ogg', 80, 1, -1) + return TRUE +/* Doesnt work + // Destroy Straightjacket + if(ishuman(owner)) + var/mob/living/carbon/human/user_H = owner + if(user_H.wear_suit && user_H.wear_suit.breakouttime) + var/obj/item/clothing/suit/straight_jacket/S = user_H.get_item_by_slot(ITEM_SLOT_ICLOTHING) + if(istype(S)) + user_C.visible_message("[user_C] attempts to remove [S]!", \ + "You rip through [S] like it's nothing!") + user_C.clear_cuffs(S,TRUE) + playsound(get_turf(usr), 'sound/effects/grillehit.ogg', 80, 1, -1) + return TRUE */ + // Destroy Leg Cuffs + if(user_C.legcuffed) + var/obj/O = user_C.get_item_by_slot(SLOT_LEGCUFFED) + if(istype(O)) + //user_C.visible_message("[user_C] attempts to remove [O]!", \ + // "You snap [O] like it's nothing!") + user_C.clear_cuffs(O,TRUE) + playsound(get_turf(usr), 'sound/effects/grillehit.ogg', 80, 1, -1) + return TRUE + return FALSE + +/datum/action/bloodsucker/targeted/brawn/proc/CheckEscapePuller() + if(!owner.pulledby)// || owner.pulledby.grab_state <= GRAB_PASSIVE) + return FALSE + var/mob/M = owner.pulledby + var/pull_power = M.grab_state + playsound(get_turf(M), 'sound/effects/woodhit.ogg', 75, 1, -1) + // Knock Down (if Living) + if (isliving(M)) + var/mob/living/L = M + L.Knockdown(pull_power * 10 + 20) + // Knock Back (before Knockdown, which probably cancels pull) + var/send_dir = get_dir(owner, M) + var/turf/T = get_ranged_target_turf(M, send_dir, pull_power) + owner.newtonian_move(send_dir) // Bounce back in 0 G + M.throw_at(T, pull_power, TRUE, owner, FALSE) // Throw distance based on grab state! Harder grabs punished more aggressively. + // /proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null) + log_combat(owner, M, "used Brawn power") + owner.visible_message("[owner] tears free of [M]'s grasp!", \ + "You shrug off [M]'s grasp!") + owner.pulledby = null // It's already done, but JUST IN CASE. + return TRUE +/* Doesnt work +/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakLocker() + if(!istype(owner.loc, /obj/structure/closet)) + return FALSE + playsound(get_turf(owner), 'sound/machines/airlock_alien_prying.ogg', 40, 1, -1) + if(do_mob(owner ,target, 25)) + var/obj/structure/closet/C = owner.loc + to_chat(owner, "You prepare to tear open the [C].") + owner.do_attack_animation(C, ATTACK_EFFECT_SMASH) + playsound(get_turf(C), 'sound/effects/bang.ogg', 30, 1, -1) + C.bust_open() + return TRUE +*/ diff --git a/code/modules/antagonists/bloodsucker/powers/bs_cloak.dm b/code/modules/antagonists/bloodsucker/powers/bs_cloak.dm new file mode 100644 index 0000000000..cea942e26d --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_cloak.dm @@ -0,0 +1,57 @@ + + +/datum/action/bloodsucker/cloak + name = "Cloak of Darkness" + desc = "Blend into the shadows and become invisible to the untrained eye." + button_icon_state = "power_cloak" + bloodcost = 5 + cooldown = 50 + bloodsucker_can_buy = TRUE + amToggle = TRUE + warn_constant_cost = TRUE + + var/light_min = 0.5 // If lum is above this, no good. + +/datum/action/bloodsucker/cloak/CheckCanUse(display_error) + . = ..() + if(!.) + return + // Must be Dark + var/turf/T = owner.loc + if(istype(T) && T.get_lumcount() > light_min) + to_chat(owner, "This area is not dark enough to blend in") + return FALSE + return TRUE + +/datum/action/bloodsucker/cloak/ActivatePower() + var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + var/mob/living/user = owner + var/was_running = (user.m_intent == MOVE_INTENT_RUN) + if(was_running) + user.toggle_move_intent() + ADD_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness") + while(bloodsuckerdatum && ContinueActive(user) || user.m_intent == MOVE_INTENT_RUN) + // Pay Blood Toll (if awake) + owner.alpha = max(0, owner.alpha - min(75, 20 + 15 * level_current)) + bloodsuckerdatum.AddBloodVolume(-0.2) + sleep(5) // Check every few ticks that we haven't disabled this power + // Return to Running (if you were before) + if(was_running && user.m_intent != MOVE_INTENT_RUN) + user.toggle_move_intent() + +/datum/action/bloodsucker/cloak/ContinueActive(mob/living/user, mob/living/target) + if (!..()) + return FALSE + if(user.stat == !CONSCIOUS) // Must be CONSCIOUS + to_chat(owner, "Your cloak failed due to you falling unconcious! ") + return FALSE + var/turf/T = owner.loc // Must be DARK + if(istype(T) && T.get_lumcount() > light_min) + to_chat(owner, "Your cloak failed due to there being too much light!") + return FALSE + return TRUE + +/datum/action/bloodsucker/cloak/DeactivatePower(mob/living/user = owner, mob/living/target) + ..() + REMOVE_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness") + user.alpha = 255 diff --git a/code/modules/antagonists/bloodsucker/powers/bs_feed.dm b/code/modules/antagonists/bloodsucker/powers/bs_feed.dm new file mode 100644 index 0000000000..7c4cf46e3c --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_feed.dm @@ -0,0 +1,324 @@ + + +/datum/action/bloodsucker/feed + name = "Feed" + desc = "Draw the heartsblood of living victims in your grasp.
None/Passive: Feed silently and unnoticed by your victim.
Aggressive: Subdue your target quickly." + button_icon_state = "power_feed" + + bloodcost = 0 + cooldown = 30 + amToggle = TRUE + bloodsucker_can_buy = TRUE + can_be_staked = TRUE + cooldown_static = TRUE + + var/notice_range = 2 // Distance before silent feeding is noticed. + var/mob/living/feed_target // So we can validate more than just the guy we're grappling. + var/target_grappled = FALSE // If you started grappled, then ending it will end your Feed. + +/datum/action/bloodsucker/feed/CheckCanUse(display_error) + . = ..() + if(!.) + return + // Wearing mask + var/mob/living/L = owner + if (L.is_mouth_covered()) + if (display_error) + to_chat(owner, "You cannot feed with your mouth covered! Remove your mask.") + return FALSE + // Find my Target! + if (!FindMyTarget(display_error)) // Sets feed_target within after Validating + return FALSE + // Not in correct state + // DONE! + return TRUE + +/datum/action/bloodsucker/feed/proc/ValidateTarget(mob/living/target, display_error) // Called twice: validating a subtle victim, or validating your grapple victim. + // Bloodsuckers + Animals MUST be grabbed aggressively! + if (!owner.pulling || target == owner.pulling && owner.grab_state < GRAB_AGGRESSIVE) + // NOTE: It's OKAY that we are checking if(!target) below, AFTER animals here. We want passive check vs animal to warn you first, THEN the standard warning. + // Animals: + if (isliving(target) && !iscarbon(target)) + if (display_error) + to_chat(owner, "Lesser beings require a tighter grip.") + return FALSE + // Bloodsuckers: + else if (iscarbon(target) && target.mind && target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + if (display_error) + to_chat(owner, "Other Bloodsuckers will not fall for your subtle approach.") + return FALSE + // Must have Target + if (!target) // || !ismob(target) + if (display_error) + to_chat(owner, "You must be next to or grabbing a victim to feed from them.") + return FALSE + // Not even living! + if (!isliving(target) || issilicon(target)) + if (display_error) + to_chat(owner, "You may only feed from living beings.") + return FALSE + if (target.blood_volume <= 0) + if (display_error) + to_chat(owner, "Your victim has no blood to take.") + return FALSE + if (ishuman(target)) + var/mob/living/carbon/human/H = target + if(NOBLOOD in H.dna.species.species_traits)// || owner.get_blood_id() != target.get_blood_id()) + if (display_error) + to_chat(owner, "Your victim's blood is not suitable for you to take.") + return FALSE + return TRUE + +// If I'm not grabbing someone, find me someone nearby. +/datum/action/bloodsucker/feed/proc/FindMyTarget(display_error) + // Default + feed_target = null + target_grappled = FALSE + // If you are pulling a mob, that's your target. If you don't like it, then release them. + if (owner.pulling && ismob(owner.pulling)) + // Check grapple target Valid + if (!ValidateTarget(owner.pulling, display_error)) // Grabbed targets display error. + return FALSE + target_grappled = TRUE + feed_target = owner.pulling + return TRUE + // Find Targets + var/list/mob/living/seen_targets = view(1, owner) + var/list/mob/living/seen_mobs = list() + for(var/mob/living/M in seen_targets) + if (isliving(M) && M != owner) + seen_mobs += M + // None Seen! + if (seen_mobs.len == 0) + if (display_error) + to_chat(owner, "You must be next to or grabbing a victim to feed from them.") + return FALSE + // Check Valids... + var/list/targets_valid = list() + var/list/targets_dead = list() + for(var/mob/living/M in seen_mobs) + // Check adjecent Valid target + if (M != owner && ValidateTarget(M, display_error = FALSE)) // Do NOT display errors. We'll be doing this again in CheckCanUse(), which will rule out grabbed targets. + // Prioritize living, but remember dead as backup + if (M.stat < DEAD) + targets_valid += M + else + targets_dead += M + // No Living? Try dead. + if (targets_valid.len == 0 && targets_dead.len > 0) + targets_valid = targets_dead + // No Targets + if (targets_valid.len == 0) + // Did I see targets? Then display at least one error + if (seen_mobs.len > 1) + if (display_error) + to_chat(owner, "None of these are valid targets to feed from subtly.") + else + ValidateTarget(seen_mobs[1], display_error) + return FALSE + // Too Many Targets + //else if (targets.len > 1) + // if (display_error) + // to_chat(owner, "You are adjecent to too many witnesses. Either grab your victim or move away.") + // return FALSE + // One Target! + else + feed_target = pick(targets_valid)//targets[1] + return TRUE + +/datum/action/bloodsucker/feed/ActivatePower() + // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up Activate(), so Deactivate() can happen after. + var/mob/living/target = feed_target // Stored during CheckCanUse(). Can be a grabbed OR adjecent character. + var/mob/living/user = owner + var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + // Am I SECRET or LOUD? It stays this way the whole time! I must END IT to try it the other way. + var/amSilent = (!target_grappled || owner.grab_state <= GRAB_PASSIVE) // && iscarbon(target) // Non-carbons (animals) not passive. They go straight into aggressive. + // Initial Wait + var/feed_time = (amSilent ? 45 : 25) - (2.5 * level_current) + feed_time = max(15, feed_time) + if (amSilent) + to_chat(user, "You lean quietly toward [target] and secretly draw out your fangs...") + else + to_chat(user, "You pull [target] close to you and draw out your fangs...") + if (!do_mob(user, target, feed_time,0,1,extra_checks=CALLBACK(src, .proc/ContinueActive, user, target)))//sleep(10) + to_chat(user, "Your feeding was interrupted.") + //DeactivatePower(user,target) + return + // Put target to Sleep (Bloodsuckers are immune to their own bite's sleep effect) + if (!amSilent) + ApplyVictimEffects(target) // Sleep, paralysis, immobile, unconscious, and mute + if(target.stat <= UNCONSCIOUS) + sleep(1) + // Wait, then Cancel if Invalid + if (!ContinueActive(user,target)) // Cancel. They're gone. + //DeactivatePower(user,target) + return + // Pull Target Close + if (!target.density) // Pull target to you if they don't take up space. + target.Move(user.loc) + // Broadcast Message + if (amSilent) + //if (!iscarbon(target)) + // user.visible_message("[user] shifts [target] closer to [user.p_their()] mouth.", \ + // "You secretly slip your fangs into [target]'s flesh.", \ + // vision_distance = 2, ignored_mobs=target) // Only people who AREN'T the target will notice this action. + //else + var/deadmessage = target.stat == DEAD ? "" : " [target.p_they(TRUE)] looks dazed, and will not remember this." + user.visible_message("[user] puts [target]'s wrist up to [user.p_their()] mouth.", \ + "You secretly slip your fangs into [target]'s wrist.[deadmessage]", \ + vision_distance = notice_range, ignored_mobs=target) // Only people who AREN'T the target will notice this action. + // Warn Feeder about Witnesses... + var/was_unnoticed = TRUE + for(var/mob/living/M in viewers(notice_range, owner)) + if(M != owner && M != target && iscarbon(M) && M.mind && !M.has_unlimited_silicon_privilege && !M.eye_blind && !M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + was_unnoticed = FALSE + break + if (was_unnoticed) + to_chat(user, "You think no one saw you...") + else + to_chat(user, "Someone may have noticed...") + + else // /atom/proc/visible_message(message, self_message, blind_message, vision_distance, ignored_mobs) + user.visible_message("[user] closes [user.p_their()] mouth around [target]'s neck!", \ + "You sink your fangs into [target]'s neck.") + // My mouth is full! + ADD_TRAIT(user, TRAIT_MUTE, "bloodsucker_feed") + + // Begin Feed Loop + var/warning_target_inhuman = FALSE + var/warning_target_dead = FALSE + var/warning_full = FALSE + var/warning_target_bloodvol = 99999 + var/amount_taken = 0 + var/blood_take_mult = amSilent ? 0.3 : 1 // Quantity to take per tick, based on Silent or not. + var/was_alive = target.stat < DEAD && ishuman(target) + // Activate Effects + //target.add_trait(TRAIT_MUTE, "bloodsucker_victim") // <----- Make mute a power you buy? + + // FEEEEEEEEED!!! // + bloodsuckerdatum.poweron_feed = TRUE + while (bloodsuckerdatum && target && active) + //user.mobility_flags &= ~MOBILITY_MOVE // user.canmove = 0 // Prevents spilling blood accidentally. + + // Abort? A bloody mistake. + if (!do_mob(user, target, 20, 0, 0, extra_checks=CALLBACK(src, .proc/ContinueActive, user, target))) + // May have disabled Feed during do_mob + if (!active || !ContinueActive(user, target)) + break + + if (amSilent) + to_chat(user, "Your feeding has been interrupted...but [target.p_they()] didn't seem to notice you.") + else + to_chat(user, "Your feeding has been interrupted!") + user.visible_message("[user] is ripped from [target]'s throat. [target.p_their(TRUE)] blood sprays everywhere!", \ + "Your teeth are ripped from [target]'s throat. [target.p_their(TRUE)] blood sprays everywhere!") + + // Deal Damage to Target (should have been more careful!) + if (iscarbon(target)) + var/mob/living/carbon/C = target + C.bleed(15) + playsound(get_turf(target), 'sound/effects/splat.ogg', 40, 1) + if (ishuman(target)) + var/mob/living/carbon/human/H = target + H.bleed_rate += 5 + target.add_splatter_floor(get_turf(target)) + user.add_mob_blood(target) // Put target's blood on us. The donor goes in the ( ) + target.add_mob_blood(target) + target.take_overall_damage(10,0) + target.emote("scream") + + // Killed Target? + if (was_alive) + CheckKilledTarget(user,target) + + return + + /////////////////////////////////////////////////////////// + // Handle Feeding! User & Victim Effects (per tick) + bloodsuckerdatum.HandleFeeding(target, blood_take_mult) + amount_taken += amSilent ? 0.3 : 1 + if (!amSilent) + ApplyVictimEffects(target) // Sleep, paralysis, immobile, unconscious, and mute + if (amount_taken > 5 && target.stat < DEAD && ishuman(target)) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood) // GOOD // in bloodsucker_life.dm + + /////////////////////////////////////////////////////////// + // Not Human? + if (!ishuman(target)) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood_bad) // BAD // in bloodsucker_life.dm + if (!warning_target_inhuman) + to_chat(user, "You recoil at the taste of a lesser lifeform.") + warning_target_inhuman = TRUE + // Dead Blood? + if (target.stat >= DEAD) + if (ishuman(target)) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood_dead) // BAD // in bloodsucker_life.dm + if (!warning_target_dead) + to_chat(user, "Your victim is dead. [target.p_their(TRUE)] blood barely nourishes you.") + warning_target_dead = TRUE + // Full? + if (!warning_full && user.blood_volume >= bloodsuckerdatum.maxBloodVolume) + to_chat(user, "You are full. Further blood will be wasted.") + warning_full = TRUE + // Blood Remaining? (Carbons/Humans only) + if (iscarbon(target) && !target.AmBloodsucker(1)) + if (target.blood_volume <= BLOOD_VOLUME_BAD && warning_target_bloodvol > BLOOD_VOLUME_BAD) + to_chat(user, "Your victim's blood volume is fatally low!") + else if (target.blood_volume <= BLOOD_VOLUME_OKAY && warning_target_bloodvol > BLOOD_VOLUME_OKAY) + to_chat(user, "Your victim's blood volume is dangerously low.") + else if (target.blood_volume <= BLOOD_VOLUME_SAFE && warning_target_bloodvol > BLOOD_VOLUME_SAFE) + to_chat(user, "Your victim's blood is at an unsafe level.") + warning_target_bloodvol = target.blood_volume // If we had a warning to give, it's been given by now. + // Done? + if (target.blood_volume <= 0) + to_chat(user, "You have bled your victim dry.") + break + + // Blood Gulp Sound + owner.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. + + // DONE! + //DeactivatePower(user,target) + if (amSilent) + to_chat(user, "You slowly release [target]'s wrist." + (target.stat == 0 ? " [target.p_their(TRUE)] face lacks expression, like you've already been forgotten." : "")) + else + user.visible_message("[user] unclenches their teeth from [target]'s neck.", \ + "You retract your fangs and release [target] from your bite.") + + // /proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null) + log_combat(owner, target, "fed on blood", addition="(and took [amount_taken] blood)") + + // Killed Target? + if (was_alive) + CheckKilledTarget(user,target) + + +/datum/action/bloodsucker/feed/proc/CheckKilledTarget(mob/living/user, mob/living/target) + // Bad Vampire. You shouldn't do that. + if (target && target.stat >= DEAD && ishuman(target)) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankkilled", /datum/mood_event/drankkilled) // BAD // in bloodsucker_life.dm + +/datum/action/bloodsucker/feed/ContinueActive(mob/living/user, mob/living/target) + return ..() && target && (!target_grappled || user.pulling == target)// Active, and still Antag, + // NOTE: We only care about pulling if target started off that way. Mostly only important for Aggressive feed. + +/datum/action/bloodsucker/feed/proc/ApplyVictimEffects(mob/living/target) + // Bloodsuckers not affected by "the Kiss" of another vampire + if (!target.mind || !target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + target.Unconscious(50,0) + target.Knockdown(40 + 5 * level_current,1) + // NOTE: THis is based on level of power! + if (ishuman(target)) + target.adjustStaminaLoss(5, forced = TRUE)// Base Stamina Damage + +/datum/action/bloodsucker/feed/DeactivatePower(mob/living/user = owner, mob/living/target) + ..() // activate = FALSE + var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + // No longer Feeding + if (bloodsuckerdatum) + bloodsuckerdatum.poweron_feed = FALSE + feed_target = null + // My mouth is no longer full + REMOVE_TRAIT(owner, TRAIT_MUTE, "bloodsucker_feed") + // Let me move immediately + user.update_canmove() diff --git a/code/modules/antagonists/bloodsucker/powers/bs_fortitude.dm b/code/modules/antagonists/bloodsucker/powers/bs_fortitude.dm new file mode 100644 index 0000000000..3305504c15 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_fortitude.dm @@ -0,0 +1,54 @@ + + + + +/datum/action/bloodsucker/fortitude + name = "Fortitude"//"Cellular Emporium" + desc = "Withstand egregious physical wounds and walk away from attacks that would stun, pierce, and dismember lesser beings. You cannot run while active." + button_icon_state = "power_fortitude" + bloodcost = 5 + cooldown = 80 + bloodsucker_can_buy = TRUE + amToggle = TRUE + warn_constant_cost = TRUE + + var/this_resist // So we can raise and lower your brute resist based on what your level_current WAS. + +/datum/action/bloodsucker/fortitude/ActivatePower() + var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + var/mob/living/user = owner + to_chat(user, "Your flesh, skin, and muscles become as steel.") + // Traits & Effects + ADD_TRAIT(user, TRAIT_PIERCEIMMUNE, "fortitude") + ADD_TRAIT(user, TRAIT_NODISMEMBER, "fortitude") + ADD_TRAIT(user, TRAIT_STUNIMMUNE, "fortitude") + ADD_TRAIT(user, TRAIT_NORUNNING, "fortitude") + if (ishuman(owner)) + var/mob/living/carbon/human/H = owner + this_resist = max(0.3, 0.7 - level_current * 0.1) + H.physiology.brute_mod *= this_resist//0.5 + H.physiology.burn_mod *= this_resist//0.5 + // Stop Running (Taken from /datum/quirk/nyctophobia in negative.dm) + var/was_running = (user.m_intent == MOVE_INTENT_RUN) + if(was_running) + user.toggle_move_intent() + while(bloodsuckerdatum && ContinueActive(user) || user.m_intent == MOVE_INTENT_RUN) + // Pay Blood Toll (if awake) + if (user.stat == CONSCIOUS) + bloodsuckerdatum.AddBloodVolume(-0.5) // Used to be 0.3 blood per 2 seconds, but we're making it more expensive to keep on. + sleep(20) // Check every few ticks that we haven't disabled this power + // Return to Running (if you were before) + if(was_running && user.m_intent != MOVE_INTENT_RUN) + user.toggle_move_intent() + +/datum/action/bloodsucker/fortitude/DeactivatePower(mob/living/user = owner, mob/living/target) + ..() + // Restore Traits & Effects + REMOVE_TRAIT(user, TRAIT_PIERCEIMMUNE, "fortitude") + REMOVE_TRAIT(user, TRAIT_NODISMEMBER, "fortitude") + REMOVE_TRAIT(user, TRAIT_STUNIMMUNE, "fortitude") + REMOVE_TRAIT(user, TRAIT_NORUNNING, "fortitude") + if (ishuman(owner)) + var/mob/living/carbon/human/H = owner + H.physiology.brute_mod /= this_resist//0.5 + H.physiology.burn_mod /= this_resist//0.5 diff --git a/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm b/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm new file mode 100644 index 0000000000..0da9ab5ba3 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm @@ -0,0 +1,115 @@ + + +/datum/action/bloodsucker/gohome + name = "Vanishing Act" + desc = "As dawn aproaches, disperse into mist and return directly to your Lair.
WARNING: You will drop ALL of your possessions if observed by mortals." + button_icon_state = "power_gohome" + background_icon_state_on = "vamp_power_off_oneshot" // Even though this never goes off. + background_icon_state_off = "vamp_power_off_oneshot" + + bloodcost = 25 + cooldown = 99999 // It'll never come back. + amToggle = FALSE + amSingleUse = TRUE + + bloodsucker_can_buy = FALSE // You only get this if you've claimed a lair, and only just before sunrise. + can_use_in_torpor = TRUE + must_be_capacitated = TRUE + can_be_immobilized = TRUE + +/datum/action/bloodsucker/gohome/CheckCanUse(display_error) + . = ..() + if(!.) + return + // Have No Lair (NOTE: You only got this power if you had a lair, so this means it's destroyed) + var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + if (!istype(bloodsuckerdatum) || !bloodsuckerdatum.coffin) + if (display_error) + to_chat(owner, "Your coffin has been destroyed!") + return FALSE + return TRUE + +/datum/action/bloodsucker/gohome/ActivatePower() + var/mob/living/carbon/user = owner + var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + // IMPORTANT: Check for lair at every step! It might get destroyed. + to_chat(user, "You focus on separating your consciousness from your physical form...") + // STEP ONE: Flicker Lights + for(var/obj/machinery/light/L in view(3, get_turf(owner))) // /obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) + L.flicker(5) + playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', 20, 1) + sleep(50) + for(var/obj/machinery/light/L in view(3, get_turf(owner))) // /obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) + L.flicker(5) + playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', 40, 1) + sleep(50) + for(var/obj/machinery/light/L in view(6, get_turf(owner))) // /obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) + L.flicker(5) + playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', 60, 1) + // ( STEP TWO: Lights OFF? ) + // CHECK: Still have Coffin? + if (!istype(bloodsuckerdatum) || !bloodsuckerdatum.coffin) + to_chat(user, "Your coffin has been destroyed! You no longer have a destination.") + return FALSE + if (!owner) + return + // SEEN?: (effects ONLY if there are witnesses! Otherwise you just POOF) + // NOTE: Stolen directly from statue.dm, thanks guys! + var/am_seen = FALSE // Do Effects (seen by anyone) + var/drop_item = FALSE // Drop Stuff (seen by non-vamp) + if (isturf(owner.loc)) // Only check if I'm not in a Locker or something. + // A) Check for Darkness (we can just leave) + var/turf/T = get_turf(user) + if(T && T.lighting_object && T.get_lumcount()>= 0.1) + // B) Check for Viewers + for(var/mob/living/M in viewers(owner)) + if(M != owner && isliving(M) && M.mind && !M.has_unlimited_silicon_privilege && !M.eye_blind) // M.client <--- add this in after testing! + am_seen = TRUE + if (!M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + drop_item = TRUE + break + // LOSE CUFFS + if(user.handcuffed) + var/obj/O = user.handcuffed + user.dropItemToGround(O) + if(user.legcuffed) + var/obj/O = user.legcuffed + user.dropItemToGround(O) + // SEEN! + if (drop_item) + // DROP: Clothes, held items, and cuffs etc + // NOTE: Taken from unequip_everything() in inventory.dm. We need to + // *force* all items to drop, so we had to just gut the code out of it. + var/list/items = list() + items |= user.get_equipped_items() + for(var/I in items) + user.dropItemToGround(I,TRUE) + for(var/obj/item/I in owner.held_items) // drop_all_held_items() + user.dropItemToGround(I, TRUE) + if (am_seen) + // POOF EFFECTS + playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', 60, 1) + var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/() + puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke + puff.set_up(3, 0, get_turf(owner)) + puff.start() + // TELEPORT: Move to Coffin & Close it! + do_teleport(owner, bloodsuckerdatum.coffin, no_effects = TRUE, forced = TRUE, channel = TELEPORT_CHANNEL_QUANTUM) // in teleport.dm? + // SLEEP + user.resting = TRUE + //user.Unconscious(30,0) + user.Stun(30,1) + // CLOSE LID: If fail, force me in. + if (!bloodsuckerdatum.coffin.close(owner)) + bloodsuckerdatum.coffin.insert(owner) // Puts me inside. + // The following was taken from close() proc in closets.dm + // (but we had to do it this way because there is no way to force entry) + playsound(bloodsuckerdatum.coffin.loc, bloodsuckerdatum.coffin.close_sound, 15, 1, -3) + bloodsuckerdatum.coffin.opened = FALSE + bloodsuckerdatum.coffin.density = TRUE + bloodsuckerdatum.coffin.update_icon() + // Lock Coffin + bloodsuckerdatum.coffin.LockMe(owner) + // ( STEP FIVE: Create animal at prev location? ) + //var/mob/living/simple_animal/SA = /mob/living/simple_animal/hostile/retaliate/bat // pick(/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse, /mob/living/simple_animal/hostile/retaliate/bat) //prob(300) /mob/living/simple_animal/mouse, + //new SA (owner.loc) diff --git a/code/modules/antagonists/bloodsucker/powers/bs_haste.dm b/code/modules/antagonists/bloodsucker/powers/bs_haste.dm new file mode 100644 index 0000000000..ee1dd3007c --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_haste.dm @@ -0,0 +1,85 @@ + +// Level 1: Speed to location +// Level 2: Dodge Bullets +// Level 3: Stun People Passed + +/datum/action/bloodsucker/targeted/haste + name = "Immortal Haste" + desc = "Dash somewhere with supernatural speed. Those nearby may be knocked away, stunned, or left empty-handed." + button_icon_state = "power_speed" + bloodcost = 6 + cooldown = 30 + target_range = 15 + power_activates_immediately = TRUE + message_Trigger = ""//"Whom will you subvert to your will?" + bloodsucker_can_buy = TRUE + must_be_capacitated = TRUE + +/datum/action/bloodsucker/targeted/haste/CheckCanUse(display_error) + . = ..() + if(!.) + return + // Being Grabbed + if(owner.pulledby && owner.pulledby.grab_state >= GRAB_AGGRESSIVE) + if(display_error) + to_chat(owner, "You're being grabbed!") + return FALSE + if(!owner.has_gravity(owner.loc)) //We dont want people to be able to use this to fly around in space + if(display_error) + to_chat(owner, "You cant dash while floating!") + return FALSE + return TRUE + +/datum/action/bloodsucker/targeted/haste/CheckValidTarget(atom/A) + return isturf(A) || A.loc != owner.loc // Anything will do, if it's not me or my square + +/datum/action/bloodsucker/targeted/haste/CheckCanTarget(atom/A, display_error) + // DEFAULT CHECKS (Distance) + if (!..()) + return FALSE + // Check: Range + //if (!(A in view(target_range, get_turf(owner)))) + // return FALSE + return TRUE + +/datum/action/bloodsucker/targeted/haste/FireTargetedPower(atom/A) + // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. + var/mob/living/user = owner + var/turf/T = isturf(A) ? A : get_turf(A) + // Pulled? Not anymore. + owner.pulledby = null + // Step One: Heatseek toward Target's Turf + walk_to(owner, T, 0, 0.01, 20) // NOTE: this runs in the background! to cancel it, you need to use walk(owner.current,0), or give them a new path. + playsound(get_turf(owner), 'sound/weapons/punchmiss.ogg', 25, 1, -1) + var/safety = 20 + while(get_turf(owner) != T && safety > 0 && !(isliving(target) && target.Adjacent(owner))) + user.canmove = FALSE //Dont move while doing the thing, or itll break + safety -- + // Did I get knocked down? + if(owner && owner.incapacitated(ignore_restraints=TRUE, ignore_grab=TRUE))// owner.incapacitated()) + // We're gonna cancel. But am I on the ground? Spin me! + if(user.resting) + var/send_dir = get_dir(owner, T) + new /datum/forced_movement(owner, get_ranged_target_turf(owner, send_dir, 1), 1, FALSE) + owner.spin(10) + break + // Spin/Stun people we pass. + //var/mob/living/newtarget = locate(/mob/living) in oview(1, owner) + var/list/mob/living/foundtargets = list() + for(var/mob/living/newtarget in oview(1, owner)) + if (newtarget && newtarget != target && !(newtarget in foundtargets))//!newtarget.IsKnockdown()) + if (rand(0, 5) < level_current) + playsound(get_turf(newtarget), "sound/weapons/punch[rand(1,4)].ogg", 15, 1, -1) + newtarget.Knockdown(10 + level_current * 5) + if(newtarget.IsStun()) + newtarget.spin(10,1) + if (rand(0,4)) + newtarget.drop_all_held_items() + foundtargets += newtarget + sleep(1) + if(user) + user.update_canmove() //Let the poor guy move again + +/datum/action/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target) + ..() // activate = FALSE + user.update_canmove() diff --git a/code/modules/antagonists/bloodsucker/powers/bs_lunge.dm b/code/modules/antagonists/bloodsucker/powers/bs_lunge.dm new file mode 100644 index 0000000000..2c1b8d6321 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_lunge.dm @@ -0,0 +1,83 @@ +// Level 1: Grapple level 2 +// Level 2: Grapple 3 from Behind +// Level 3: Grapple 3 from Shadows +/datum/action/bloodsucker/targeted/lunge + name = "Predatory Lunge" + desc = "Spring at your target and aggressively grapple them without warning. Attacks from concealment or the rear may even knock them down." + button_icon_state = "power_lunge" + bloodcost = 10 + cooldown = 100 + target_range = 3 + power_activates_immediately = TRUE + message_Trigger = ""//"Whom will you subvert to your will?" + must_be_capacitated = TRUE + bloodsucker_can_buy = TRUE + +/datum/action/bloodsucker/targeted/lunge/CheckCanUse(display_error) + if(!..(display_error))// DEFAULT CHECKS + return FALSE + // Being Grabbed + if(owner.pulledby && owner.pulledby.grab_state >= GRAB_AGGRESSIVE) + if(display_error) + to_chat(owner, "You're being grabbed!") + return FALSE + if(!owner.has_gravity(owner.loc))//TODO figure out how to check if theyre able to move while in nograv + if(display_error) + to_chat(owner, "You cant lunge while floating!") + return FALSE + return TRUE + +/datum/action/bloodsucker/targeted/lunge/CheckValidTarget(atom/A) + return isliving(A) + +/datum/action/bloodsucker/targeted/lunge/CheckCanTarget(atom/A, display_error) + // Check: Self + if(target == owner) + return FALSE + // Check: Range + //if (!(target in view(target_range, get_turf(owner)))) + // if (display_error) + // to_chat(owner, "Your victim is too far away.") + // return FALSE + // DEFAULT CHECKS (Distance) + if(!..()) + return FALSE + // Check: Turf + var/mob/living/L = A + if(!isturf(L.loc)) + return FALSE + return TRUE + +/datum/action/bloodsucker/targeted/lunge/FireTargetedPower(atom/A) + // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. + var/mob/living/carbon/target = A + var/turf/T = get_turf(target) + // Clear Vars + owner.pulling = null + // Will we Knock them Down? + var/do_knockdown = !is_A_facing_B(target,owner) || owner.alpha <= 0 || istype(owner.loc, /obj/structure/closet) + // CAUSES: Target has their back to me, I'm invisible, or I'm in a Closet + // Step One: Heatseek toward Target's Turf + + walk_towards(owner, T, 0.1, 10) // NOTE: this runs in the background! to cancel it, you need to use walk(owner.current,0), or give them a new path. + addtimer(CALLBACK(owner, .proc/_walk, 0), 2 SECONDS) + if(get_turf(owner) != T && !(isliving(target) && target.Adjacent(owner)) && owner.incapacitated() && owner.resting) + var/send_dir = get_dir(owner, T) + new /datum/forced_movement(owner, get_ranged_target_turf(owner, send_dir, 1), 1, FALSE) + owner.spin(10) + // Step Two: Check if I'm at/adjectent to Target's CURRENT turf (not original...that was just a destination) + sleep(1) + if(target.Adjacent(owner)) + // LEVEL 2: If behind target, mute or unconscious! + if(do_knockdown) // && level_current >= 1) + target.Knockdown(15 + 10 * level_current,1) + target.adjustStaminaLoss(40 + 10 * level_current) + // Cancel Walk (we were close enough to contact them) + walk(owner, 0) + target.Stun(10,1) //Without this the victim can just walk away + target.grabbedby(owner) // Taken from mutations.dm under changelings + target.grippedby(owner, instant = TRUE) //instant aggro grab + +/datum/action/bloodsucker/targeted/lunge/DeactivatePower(mob/living/user = owner, mob/living/target) + ..() // activate = FALSE + user.update_canmove() diff --git a/code/modules/antagonists/bloodsucker/powers/bs_masquerade.dm b/code/modules/antagonists/bloodsucker/powers/bs_masquerade.dm new file mode 100644 index 0000000000..6ee17b3014 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_masquerade.dm @@ -0,0 +1,97 @@ + + + +// WITHOUT THIS POWER: +// +// - Mid-Blood: SHOW AS PALE +// - Low-Blood: SHOW AS DEAD +// - No Heartbeat +// - Examine shows actual blood +// - Thermal homeostasis (ColdBlooded) + + + +// WITH THIS POWER: +// - Normal body temp -- remove Cold Blooded (return on deactivate) +// - + + +/datum/action/bloodsucker/masquerade + name = "Masquerade" + desc = "Feign the vital signs of a mortal, and escape both casual and medical notice as the monster you truly are." + button_icon_state = "power_human" + bloodcost = 10 + cooldown = 50 + amToggle = TRUE + bloodsucker_can_buy = TRUE + warn_constant_cost = TRUE + can_use_in_torpor = TRUE // Masquerade is maybe the only one that can do this. It stops your healing. + cooldown_static = TRUE + +// NOTE: Firing off vulgar powers disables your Masquerade! + +/*/datum/action/bloodsucker/masquerade/CheckCanUse(display_error) + if(!..(display_error))// DEFAULT CHECKS + return FALSE + // DONE! + return TRUE +*/ + + +/datum/action/bloodsucker/masquerade/ActivatePower() + + var/mob/living/user = owner + var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + + to_chat(user, "Your heart beats falsely within your lifeless chest. You may yet pass for a mortal.") + to_chat(user, "Your vampiric healing is halted while imitating life.") + + + // Remove ColdBlooded & Hard/SoftCrit + REMOVE_TRAIT(user, TRAIT_COLDBLOODED, "bloodsucker") + REMOVE_TRAIT(user, TRAIT_NOHARDCRIT, "bloodsucker") + REMOVE_TRAIT(user, TRAIT_NOSOFTCRIT, "bloodsucker") + var/obj/item/organ/heart/vampheart/H = user.getorganslot(ORGAN_SLOT_HEART) + + // WE ARE ALIVE! // + bloodsuckerdatum.poweron_masquerade = TRUE + while(bloodsuckerdatum && ContinueActive(user)) + + // HEART + if (istype(H)) + H.FakeStart() + + // PASSIVE (done from LIFE) + // Don't Show Pale/Dead on low blood + // Don't vomit food + // Don't Heal + + // Pay Blood Toll (if awake) + if (user.stat == CONSCIOUS) + bloodsuckerdatum.AddBloodVolume(-0.2) + + sleep(20) // Check every few ticks that we haven't disabled this power + + +/datum/action/bloodsucker/masquerade/ContinueActive(mob/living/user) + // Disable if unable to use power anymore. + //if (user.stat == DEAD || user.blood_volume <= 0) // not conscious or soft critor uncon, just dead + // return FALSE + return ..() // Active, and still Antag + + +/datum/action/bloodsucker/masquerade/DeactivatePower(mob/living/user = owner, mob/living/target) + ..() // activate = FALSE + + var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + bloodsuckerdatum.poweron_masquerade = FALSE + + ADD_TRAIT(user, TRAIT_COLDBLOODED, "bloodsucker") + ADD_TRAIT(user, TRAIT_NOHARDCRIT, "bloodsucker") + ADD_TRAIT(user, TRAIT_NOSOFTCRIT, "bloodsucker") + + // HEART + var/obj/item/organ/heart/H = user.getorganslot(ORGAN_SLOT_HEART) + H.Stop() + + to_chat(user, "Your heart beats one final time, while your skin dries out and your icy pallor returns.") diff --git a/code/modules/antagonists/bloodsucker/powers/bs_mesmerize.dm b/code/modules/antagonists/bloodsucker/powers/bs_mesmerize.dm new file mode 100644 index 0000000000..94bc0e11d0 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_mesmerize.dm @@ -0,0 +1,114 @@ + +// * MEZMERIZE +// LOVE: Target falls in love with you. Being harmed directly causes them harm if they see it? +// STAY: Target will do everything they can to stand in the same place. +// FOLLOW: Target follows you, spouting random phrases from their history (or maybe Poly's or NPC's vocab?) +// ATTACK: Target finds a nearby non-Bloodsucker victim to attack. + +/datum/action/bloodsucker/targeted/mesmerize + name = "Mesmerize" + desc = "Dominate the mind of a mortal who can see your eyes." + button_icon_state = "power_mez" + bloodcost = 30 + cooldown = 200 + target_range = 1 + power_activates_immediately = FALSE + message_Trigger = "Whom will you subvert to your will?" + must_be_capacitated = TRUE + bloodsucker_can_buy = TRUE + +/datum/action/bloodsucker/targeted/mesmerize/CheckCanUse(display_error) + . = ..() + if(!.) + return + if (!owner.getorganslot(ORGAN_SLOT_EYES)) + if (display_error) + to_chat(owner, "You have no eyes with which to mesmerize.") + return FALSE + // Check: Eyes covered? + var/mob/living/L = owner + if (istype(L) && L.is_eyes_covered() || !isturf(owner.loc)) + if (display_error) + to_chat(owner, "Your eyes are concealed from sight.") + return FALSE + return TRUE + +/datum/action/bloodsucker/targeted/mesmerize/CheckValidTarget(atom/A) + return iscarbon(A) + +/datum/action/bloodsucker/targeted/mesmerize/CheckCanTarget(atom/A,display_error) + // Check: Self + if (A == owner) + return FALSE + var/mob/living/carbon/target = A // We already know it's carbon due to CheckValidTarget() + // Bloodsucker + if (target.mind && target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + if (display_error) + to_chat(owner, "Bloodsuckers are immune to [src].") + return FALSE + // Dead/Unconscious + if (target.stat > CONSCIOUS) + if (display_error) + to_chat(owner, "Your victim is not [(target.stat == DEAD || HAS_TRAIT(target, TRAIT_FAKEDEATH))?"alive":"conscious"].") + return FALSE + // Check: Target has eyes? + if (!target.getorganslot(ORGAN_SLOT_EYES)) + if (display_error) + to_chat(owner, "They have no eyes!") + return FALSE + // Check: Target blind? + if (target.eye_blind > 0) + if (display_error) + to_chat(owner, "Your victim's eyes are glazed over. They cannot perceive you.") + return FALSE + // Check: Target See Me? (behind wall) + if (!(owner in view(target_range, get_turf(target)))) + // Sub-Check: GET CLOSER + //if (!(owner in range(target_range, get_turf(target))) + // if (display_error) + // to_chat(owner, "You're too far from your victim.") + if (display_error) + to_chat(owner, "You're too far outside your victim's view.") + return FALSE + // Check: Facing target? + if (!is_A_facing_B(owner,target)) // in unsorted.dm + if (display_error) + to_chat(owner, "You must be facing your victim.") + return FALSE + // Check: Target facing me? + if (!target.resting && !is_A_facing_B(target,owner)) + if (display_error) + to_chat(owner, "Your victim must be facing you to see into your eyes.") + return FALSE + return TRUE + +/datum/action/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/A) + // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. + var/mob/living/carbon/target = A + var/mob/living/user = owner + + if(istype(target)) + target.Stun(40) //Utterly useless without this, its okay since there are so many checks to go through + target.silent = 45 //Shhhh little lamb + target.apply_status_effect(STATUS_EFFECT_MESMERIZE, 45) //So you cant rotate with combat mode, plus fancy status alert + + if(do_mob(user, target, 40, 0, TRUE, extra_checks=CALLBACK(src, .proc/ContinueActive, user, target))) + PowerActivatedSuccessfully() // PAY COST! BEGIN COOLDOWN! + var/power_time = 90 + level_current * 12 + target.silent = power_time + 20 + target.apply_status_effect(STATUS_EFFECT_MESMERIZE, 100 + level_current * 15) + to_chat(user, "[target] is fixed in place by your hypnotic gaze.") + target.Stun(power_time) + //target.silent += power_time / 10 // Silent isn't based on ticks. + target.next_move = world.time + power_time // <--- Use direct change instead. We want an unmodified delay to their next move // target.changeNext_move(power_time) // check click.dm + target.notransform = TRUE // <--- Fuck it. We tried using next_move, but they could STILL resist. We're just doing a hard freeze. + spawn(power_time) + if(istype(target)) + target.notransform = FALSE + // They Woke Up! (Notice if within view) + if(istype(user) && target.stat == CONSCIOUS && (target in view(10, get_turf(user))) ) + to_chat(user, "[target] has snapped out of their trance.") + + +/datum/action/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target) + return ..() && CheckCanUse() && CheckCanTarget(target) diff --git a/code/modules/antagonists/bloodsucker/powers/bs_trespass.dm b/code/modules/antagonists/bloodsucker/powers/bs_trespass.dm new file mode 100644 index 0000000000..c650a6af15 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_trespass.dm @@ -0,0 +1,124 @@ + + +/datum/action/bloodsucker/targeted/trespass + name = "Trespass" + desc = "Become mist and advance two tiles in one direction, ignoring all obstacles except for walls. Useful for skipping past doors and barricades." + button_icon_state = "power_tres" + + bloodcost = 10 + cooldown = 60 + amToggle = FALSE + //target_range = 2 + + bloodsucker_can_buy = TRUE + must_be_capacitated = FALSE + can_be_immobilized = TRUE + + var/turf/target_turf // We need to decide where we're going based on where we clicked. It's not actually the tile we clicked. + +/datum/action/bloodsucker/targeted/trespass/CheckCanUse(display_error) + . = ..() + if(!.) + return + if(owner.notransform || !get_turf(owner)) + return FALSE + + return TRUE + + +/datum/action/bloodsucker/targeted/trespass/CheckValidTarget(atom/A) + // Can't target my tile + if (A == get_turf(owner) || get_turf(A) == get_turf(owner)) + return FALSE + + return TRUE // All we care about is destination. Anything you click is fine. + + +/datum/action/bloodsucker/targeted/trespass/CheckCanTarget(atom/A, display_error) + // NOTE: Do NOT use ..()! We don't want to check distance or anything. + + // Get clicked tile + var/final_turf = isturf(A) ? A : get_turf(A) + + // Are either tiles WALLS? + var/turf/from_turf = get_turf(owner) + var/this_dir // = get_dir(from_turf, target_turf) + for (var/i=1 to 2) + // Keep Prev Direction if we've reached final turf + if (from_turf != final_turf) + this_dir = get_dir(from_turf, final_turf) // Recalculate dir so we don't overshoot on a diagonal. + from_turf = get_step(from_turf, this_dir) + // ERROR! Wall! + if (iswallturf(from_turf)) + if (display_error) + var/wallwarning = (i == 1) ? "in the way" : "at your destination" + to_chat(owner, "There is a solid wall [wallwarning].") + return FALSE + // Done + target_turf = from_turf + + return TRUE + + +/datum/action/bloodsucker/targeted/trespass/FireTargetedPower(atom/A) + // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. + + // Find target turf, at or below Atom + var/mob/living/carbon/user = owner + var/turf/my_turf = get_turf(owner) + + user.visible_message("[user]'s form dissipates into a cloud of mist!", \ + "You disspiate into formless mist.") + + + // Effect Origin + playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', 60, 1) + var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/() + puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke + puff.set_up(3, 0, my_turf) + puff.start() + + var/mist_delay = max(5, 20 - level_current * 2.5) // Level up and do this faster. + + // Freeze Me + user.next_move = world.time + mist_delay + user.Stun(mist_delay, ignore_canstun = TRUE) + user.notransform = TRUE + user.density = 0 + var/invis_was = user.invisibility + user.invisibility = INVISIBILITY_MAXIMUM + + // LOSE CUFFS + if(user.handcuffed) + var/obj/O = user.handcuffed + user.dropItemToGround(O) + if(user.legcuffed) + var/obj/O = user.legcuffed + user.dropItemToGround(O) + + // Wait... + sleep(mist_delay / 2) + + // Move & Freeze + if (isturf(target_turf)) + do_teleport(owner, target_turf, no_effects=TRUE, channel = TELEPORT_CHANNEL_QUANTUM) // in teleport.dm? + user.next_move = world.time + mist_delay / 2 + user.Stun(mist_delay / 2, ignore_canstun = TRUE) + + // Wait... + sleep(mist_delay / 2) + + // Un-Hide & Freeze + user.dir = get_dir(my_turf, target_turf) + user.next_move = world.time + mist_delay / 2 + user.Stun(mist_delay / 2, ignore_canstun = TRUE) + user.notransform = FALSE + user.density = 1 + user.invisibility = invis_was + + // Effect Destination + playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', 60, 1) + puff = new /datum/effect_system/steam_spread/() + puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke + puff.set_up(3, 0, target_turf) + puff.start() diff --git a/code/modules/antagonists/bloodsucker/powers/bs_veil.dm b/code/modules/antagonists/bloodsucker/powers/bs_veil.dm new file mode 100644 index 0000000000..0c83cc2d44 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/bs_veil.dm @@ -0,0 +1,163 @@ + +/datum/action/bloodsucker/veil + name = "Veil of Many Faces" + desc = "Disguise yourself in the illusion of another identity." + button_icon_state = "power_veil" + bloodcost = 15 + cooldown = 100 + amToggle = TRUE + bloodsucker_can_buy = TRUE + warn_constant_cost = TRUE + + // Outfit Vars + var/list/original_items = list() + + // Identity Vars + var/prev_gender + var/prev_skin_tone + var/prev_hair_style + var/prev_facial_hair_style + var/prev_hair_color + var/prev_facial_hair_color + var/prev_underwear + var/prev_undie_color + var/prev_undershirt + var/prev_shirt_color + var/prev_socks + var/prev_socks_color + var/prev_disfigured + var/list/prev_features // For lizards and such + + +/datum/action/bloodsucker/veil/CheckCanUse(display_error) + . = ..() + if(!.) + return + + return TRUE + + +/datum/action/bloodsucker/veil/ActivatePower() + + cast_effect() // POOF + + //if (blahblahblah) + // Disguise_Outfit() + + Disguise_FaceName() + + +/datum/action/bloodsucker/veil/proc/Disguise_Outfit() + + // Step One: Back up original items + + + + +/datum/action/bloodsucker/veil/proc/Disguise_FaceName() + + // Change Name/Voice + var/mob/living/carbon/human/H = owner + H.name_override = H.dna.species.random_name(H.gender) + H.name = H.name_override + H.SetSpecialVoice(H.name_override) + to_chat(owner, "You mystify the air around your person. Your identity is now altered.") + + // Store Prev Appearance + prev_gender = H.gender + prev_skin_tone = H.skin_tone + prev_hair_style = H.hair_style + prev_facial_hair_style = H.facial_hair_style + prev_hair_color = H.hair_color + prev_facial_hair_color = H.facial_hair_color + prev_underwear = H.underwear + prev_undie_color = H.undie_color + prev_undershirt = H.undershirt + prev_shirt_color = H.shirt_color + prev_socks = H.socks + prev_socks_color = H.socks_color + //prev_eye_color + prev_disfigured = HAS_TRAIT(H, TRAIT_DISFIGURED) // I was disfigured! //prev_disabilities = H.disabilities + prev_features = H.dna.features + + // Change Appearance, not randomizing clothes colour, itll just be janky + H.gender = pick(MALE, FEMALE) + H.skin_tone = random_skin_tone() + H.hair_style = random_hair_style(H.gender) + H.facial_hair_style = pick(random_facial_hair_style(H.gender),"Shaved") + H.hair_color = random_short_color() + H.facial_hair_color = H.hair_color + H.underwear = random_underwear(H.gender) + H.undershirt = random_undershirt(H.gender) + H.socks = random_socks(H.gender) + //H.eye_color = random_eye_color() + REMOVE_TRAIT(H, TRAIT_DISFIGURED, null) // + H.dna.features = random_features() + + // Apply Appearance + H.update_body() // Outfit and underware, also body. + //H.update_mutant_bodyparts() // Lizard tails etc + H.update_hair() + H.update_body_parts() + + // Wait here til we deactivate power or go unconscious + var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) + while (ContinueActive(owner) && istype(bloodsuckerdatum))//active && owner && owner.stat == CONSCIOUS) + bloodsuckerdatum.AddBloodVolume(-0.2) + sleep(10) + + // Wait for a moment if you fell unconscious... + if (owner && owner.stat > CONSCIOUS) + sleep(50) + + +/datum/action/bloodsucker/veil/DeactivatePower(mob/living/user = owner, mob/living/target) + ..() + if (ishuman(user)) + var/mob/living/carbon/human/H = user + + // Revert Identity + H.UnsetSpecialVoice() + H.name_override = null + H.name = H.real_name + + // Revert Appearance + H.gender = prev_gender + H.skin_tone = prev_skin_tone + H.hair_style = prev_hair_style + H.facial_hair_style = prev_facial_hair_style + H.hair_color = prev_hair_color + H.facial_hair_color = prev_facial_hair_color + H.underwear = prev_underwear + H.undie_color = prev_undie_color + H.undershirt = prev_undershirt + H.shirt_color = prev_shirt_color + H.socks = prev_socks + H.socks_color = prev_socks_color + + //H.disabilities = prev_disabilities // Restore HUSK, CLUMSY, etc. + if (prev_disfigured) + ADD_TRAIT(H, TRAIT_DISFIGURED, "husk") // NOTE: We are ASSUMING husk. // H.status_flags |= DISFIGURED // Restore "Unknown" disfigurement + H.dna.features = prev_features + // Apply Appearance + H.update_body() // Outfit and underware, also body. + H.update_hair() + H.update_body_parts() // Body itself, maybe skin color? + cast_effect() // POOF + + // CAST EFFECT // // General effect (poof, splat, etc) when you cast. Doesn't happen automatically! +/datum/action/bloodsucker/veil/proc/cast_effect() + // Effect + playsound(get_turf(owner), 'sound/magic/smoke.ogg', 20, 1) + var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/() + puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke + puff.set_up(3, 0, get_turf(owner)) + puff.attach(owner) // OPTIONAL + puff.start() + owner.spin(8, 1) // Spin around like a loon. + +/obj/effect/particle_effect/smoke/vampsmoke + opaque = FALSE + lifetime = 0 +/obj/effect/particle_effect/smoke/vampsmoke/fade_out(frames = 6) + ..(frames) diff --git a/code/modules/antagonists/bloodsucker/powers/v_recuperate.dm b/code/modules/antagonists/bloodsucker/powers/v_recuperate.dm new file mode 100644 index 0000000000..6b8795ea02 --- /dev/null +++ b/code/modules/antagonists/bloodsucker/powers/v_recuperate.dm @@ -0,0 +1,38 @@ +/datum/action/bloodsucker/vassal/recuperate + name = "Sanguine Recuperation" + desc = "Slowly heal brute damage while active. This process is exhausting, and requires some of your tainted blood." + button_icon_state = "power_recup" + amToggle = TRUE + bloodcost = 5 + cooldown = 100 + +/datum/action/bloodsucker/vassal/recuperate/CheckCanUse(display_error) + . = ..() + if(!.) + return + if (owner.stat >= DEAD) + return FALSE + return TRUE + +/datum/action/bloodsucker/vassal/recuperate/ActivatePower() + to_chat(owner, "Your muscles clench and your skin crawls as your master's immortal blood knits your wounds and gives you stamina.") + var/mob/living/carbon/C = owner + var/mob/living/carbon/human/H + if(ishuman(owner)) + H = owner + while(ContinueActive(owner)) + C.adjustBruteLoss(-1.5) + C.adjustFireLoss(-0.5) + C.adjustToxLoss(-2, forced = TRUE) + C.blood_volume -= 0.2 + C.adjustStaminaLoss(-15) + // Stop Bleeding + if(istype(H) && H.bleed_rate > 0 && rand(20) == 0) + H.bleed_rate -- + C.Jitter(5) + sleep(10) + // DONE! + //DeactivatePower(owner) + +/datum/action/bloodsucker/vassal/recuperate/ContinueActive(mob/living/user, mob/living/target) + return ..() && user.stat <= DEAD && user.blood_volume > 500 diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index f27da5f667..c669ff7877 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -33,6 +33,7 @@ melee_damage_lower = 30 melee_damage_upper = 30 see_in_dark = 8 + blood_volume = 0 //No bleeding on getting shot, for skeddadles lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE bloodcrawl = BLOODCRAWL_EAT var/playstyle_string = "You are a slaughter demon, a terrible creature from another realm. You have a single desire: To kill. \ diff --git a/code/modules/clothing/neck/_neck.dm b/code/modules/clothing/neck/_neck.dm index 2356bb16eb..e863dc8860 100644 --- a/code/modules/clothing/neck/_neck.dm +++ b/code/modules/clothing/neck/_neck.dm @@ -66,7 +66,9 @@ var/obj/item/organ/heart/heart = M.getorganslot(ORGAN_SLOT_HEART) var/obj/item/organ/lungs/lungs = M.getorganslot(ORGAN_SLOT_LUNGS) - if(!(M.stat == DEAD || (HAS_TRAIT(M, TRAIT_FAKEDEATH)))) + if (!do_mob(user,M,60)) // Stethoscope should take a moment to listen + return // FAIL + if(!(M.stat == DEAD || (HAS_TRAIT(M, TRAIT_FAKEDEATH)) || (HAS_TRAIT(M, TRAIT_NOPULSE)))) if(heart && istype(heart)) heart_strength = "an unstable" if(heart.beating) diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm index 795515835e..0e14f9f5be 100644 --- a/code/modules/crafting/craft.dm +++ b/code/modules/crafting/craft.dm @@ -439,4 +439,4 @@ /datum/mind/proc/teach_crafting_recipe(R) if(!learned_recipes) learned_recipes = list() - learned_recipes |= R \ No newline at end of file + learned_recipes |= R diff --git a/code/modules/crafting/recipes/recipes_misc.dm b/code/modules/crafting/recipes/recipes_misc.dm index 00878d1c59..70dd4d1370 100644 --- a/code/modules/crafting/recipes/recipes_misc.dm +++ b/code/modules/crafting/recipes/recipes_misc.dm @@ -320,3 +320,41 @@ reqs = list(/obj/item/stack/rods = 2, /obj/item/clothing/under/rank/security = 1) category = CAT_MISC + + /datum/crafting_recipe/bloodsucker/vassalrack + name = "Persuasion Rack" + //desc = "For converting crewmembers into loyal Vassals." + result = /obj/structure/bloodsucker/vassalrack + tools = list(/obj/item/weldingtool, + ///obj/item/screwdriver, + /obj/item/wrench + ) + reqs = list(/obj/item/stack/sheet/mineral/wood = 3, + /obj/item/stack/sheet/metal = 2, + /obj/item/restraints/handcuffs/cable = 2, + ///obj/item/storage/belt = 1 + ///obj/item/stack/sheet/animalhide = 1, // /obj/item/stack/sheet/leather = 1, + ///obj/item/stack/sheet/plasteel = 5 + ) + //parts = list(/obj/item/storage/belt = 1 + // ) + + time = 150 + category = CAT_MISC + always_availible = FALSE // Disabled til learned + + + /datum/crafting_recipe/bloodsucker/candelabrum + name = "Candelabrum" + //desc = "For converting crewmembers into loyal Vassals." + result = /obj/structure/bloodsucker/candelabrum + tools = list(/obj/item/weldingtool, + /obj/item/wrench + ) + reqs = list(/obj/item/stack/sheet/metal = 3, + /obj/item/stack/rods = 1, + /obj/item/candle = 1 + ) + time = 100 + category = CAT_MISC + always_availible = FALSE // Disabled til learned diff --git a/code/modules/language/vampiric.dm b/code/modules/language/vampiric.dm new file mode 100644 index 0000000000..6da54ce844 --- /dev/null +++ b/code/modules/language/vampiric.dm @@ -0,0 +1,25 @@ +// VAMPIRE LANGUAGE // + +/datum/language/vampiric + name = "Blah-Sucker" + desc = "The native language of the Bloodsucker elders, learned intuitively by Fledglings and as they pass from death into immortality. Thralls are also given the ability to speak this as apart of their conversion ritual." + speech_verb = "growls" + ask_verb = "growls" + exclaim_verb = "snarls" + whisper_verb = "hisses" + key = "b" + space_chance = 40 + default_priority = 90 + icon_state = "bloodsucker" + + flags = TONGUELESS_SPEECH | LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD // Hide the icon next to your text if someone doesn't know this language. + syllables = list( + "luk","cha","no","kra","pru","chi","busi","tam","pol","spu","och", // Start: Vampiric + "umf","ora","stu","si","ri","li","ka","red","ani","lup","ala","pro", + "to","siz","nu","pra","ga","ump","ort","a","ya","yach","tu","lit", + "wa","mabo","mati","anta","tat","tana","prol", + "tsa","si","tra","te","ele","fa","inz", // Start: Romanian + "nza","est","sti","ra","pral","tsu","ago","esch","chi","kys","praz", // Start: Custom + "froz","etz","tzil", + "t'","k'","t'","k'","th'","tz'" + ) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 757aadaea1..8195b3d84b 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -36,6 +36,9 @@ if(bleed_rate <= 0) bleed_rate = 0 + if(HAS_TRAIT(src, TRAIT_NOMARROW)) //Bloodsuckers don't need to be here. + return + if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood. //Blood regeneration if there is some space diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 21541e8c28..d893108bcd 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -65,6 +65,8 @@ /mob/living/carbon/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE) + if (!forced && amount < 0 && HAS_TRAIT(src,TRAIT_NONATURALHEAL)) + return FALSE if(!forced && (status_flags & GODMODE)) return FALSE if(amount > 0) @@ -74,6 +76,8 @@ return amount /mob/living/carbon/adjustFireLoss(amount, updating_health = TRUE, forced = FALSE) + if (!forced && amount < 0 && HAS_TRAIT(src,TRAIT_NONATURALHEAL)) //Vamps don't heal naturally. + return FALSE if(!forced && (status_flags & GODMODE)) return FALSE if(amount > 0) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 04ec0454f8..a18d249eef 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -15,6 +15,13 @@ . = list("*---------*\nThis is [!obscure_name ? name : "Unknown"]!") + var/vampDesc = ReturnVampExamine(user) // Vamps recognize the names of other vamps. + var/vassDesc = ReturnVassalExamine(user) // Vassals recognize each other's marks. + if (vampDesc != "") // If we don't do it this way, we add a blank space to the string...something to do with this --> . += "" + . += vampDesc + if (vassDesc != "") + . += vassDesc + var/list/obscured = check_obscured_slots() var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE)) @@ -237,7 +244,7 @@ if(DISGUST_LEVEL_DISGUSTED to INFINITY) msg += "[t_He] look[p_s()] extremely disgusted.\n" - if(blood_volume < (BLOOD_VOLUME_SAFE*blood_ratio)) + if(ShowAsPaleExamine()) msg += "[t_He] [t_has] pale skin.\n" if(bleedsuppress) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 96bd62b1f6..67d7cb585e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1279,6 +1279,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) //////// /datum/species/proc/handle_digestion(mob/living/carbon/human/H) + if(HAS_TRAIT(src, TRAIT_NOHUNGER)) + return //hunger is for BABIES //The fucking TRAIT_FAT mutation is the dumbest shit ever. It makes the code so difficult to work with if(HAS_TRAIT(H, TRAIT_FAT))//I share your pain, past coder. diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 7d568ed510..069317d4a8 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -44,7 +44,7 @@ C.faction |= "slime" /datum/species/jelly/spec_life(mob/living/carbon/human/H) - if(H.stat == DEAD) //can't farm slime jelly from a dead slime/jelly person indefinitely + if(H.stat == DEAD || HAS_TRAIT(H, TRAIT_NOMARROW)) //can't farm slime jelly from a dead slime/jelly person indefinitely, and no regeneration for vampires return if(!H.blood_volume) H.blood_volume += 5 @@ -177,6 +177,8 @@ bodies = old_species.bodies /datum/species/jelly/slime/spec_life(mob/living/carbon/human/H) + if((HAS_TRAIT(H, TRAIT_NOMARROW))) + return if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) if(prob(5)) to_chat(H, "You feel very bloated!") diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 16a9f07ceb..0061c7ed70 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -659,6 +659,9 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put //used in human and monkey handle_environment() /mob/living/carbon/proc/natural_bodytemperature_stabilization() + if (HAS_TRAIT(src, TRAIT_COLDBLOODED)) + return 0 //Return 0 as your natural temperature. Species proc handle_environment() will adjust your temperature based on this. + var/body_temperature_difference = BODYTEMP_NORMAL - bodytemperature switch(bodytemperature) if(-INFINITY to BODYTEMP_COLD_DAMAGE_LIMIT) //Cold damage limit is 50 below the default, the temperature where you start to feel effects. diff --git a/code/modules/mob/living/silicon/login.dm b/code/modules/mob/living/silicon/login.dm index 82c1435344..81f8fcbef1 100644 --- a/code/modules/mob/living/silicon/login.dm +++ b/code/modules/mob/living/silicon/login.dm @@ -4,4 +4,7 @@ var/datum/antagonist/rev/rev = mind.has_antag_datum(/datum/antagonist/rev) if(rev) rev.remove_revolutionary(TRUE) + var/datum/antagonist/bloodsucker/V = mind.has_antag_datum(/datum/antagonist/bloodsucker) + if(V) + mind.remove_antag_datum(V) ..() diff --git a/code/modules/mob/living/simple_animal/astral.dm b/code/modules/mob/living/simple_animal/astral.dm index 2aafedb149..3d0c335989 100644 --- a/code/modules/mob/living/simple_animal/astral.dm +++ b/code/modules/mob/living/simple_animal/astral.dm @@ -27,6 +27,7 @@ unsuitable_atmos_damage = 0 minbodytemp = 0 maxbodytemp = 100000 + blood_volume = 0 /mob/living/simple_animal/astral/death() icon_state = "shade_dead" diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index e61cfad068..7a653f4aa4 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -14,6 +14,7 @@ atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) maxbodytemp = INFINITY minbodytemp = 0 + blood_volume = 0 has_unlimited_silicon_privilege = 1 sentience_type = SENTIENCE_ARTIFICIAL status_flags = NONE //no default canpush diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index b7067f8904..be900aa4ef 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -33,6 +33,7 @@ initial_language_holder = /datum/language_holder/construct deathmessage = "collapses in a shattered heap." hud_type = /datum/hud/constructs + blood_volume = 0 var/list/construct_spells = list() var/playstyle_string = "You are a generic construct! Your job is to not exist, and you should probably adminhelp this." var/master = null @@ -459,4 +460,3 @@ hud_used.healths.icon_state = "[icon_state]_health5" else hud_used.healths.icon_state = "[icon_state]_health6" - diff --git a/code/modules/mob/living/simple_animal/friendly/cockroach.dm b/code/modules/mob/living/simple_animal/friendly/cockroach.dm index c85890df88..26d4691d83 100644 --- a/code/modules/mob/living/simple_animal/friendly/cockroach.dm +++ b/code/modules/mob/living/simple_animal/friendly/cockroach.dm @@ -3,6 +3,7 @@ desc = "This station is just crawling with bugs." icon_state = "cockroach" icon_dead = "cockroach" + blood_volume = 50 health = 1 maxHealth = 1 turns_per_move = 5 diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/simple_animal/friendly/crab.dm index d7d673ff8b..9c3e5b5def 100644 --- a/code/modules/mob/living/simple_animal/friendly/crab.dm +++ b/code/modules/mob/living/simple_animal/friendly/crab.dm @@ -8,6 +8,7 @@ speak_emote = list("clicks") emote_hear = list("clicks.") emote_see = list("clacks.") + blood_volume = 350 speak_chance = 1 turns_per_move = 5 butcher_results = list(/obj/item/reagent_containers/food/snacks/meat/slab = 1) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 387973b979..7e0e43055f 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -50,6 +50,7 @@ dextrous_hud_type = /datum/hud/dextrous/drone lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE see_in_dark = 7 + blood_volume = 0 can_be_held = TRUE held_items = list(null, null) var/staticChoice = "static" diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index bf45c9cc73..5b962b2dd8 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -10,6 +10,7 @@ emote_see = list("runs in a circle.", "shakes.") speak_chance = 1 turns_per_move = 5 + blood_volume = 250 see_in_dark = 6 maxHealth = 5 health = 5 diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index e3ef14c784..1bd434b233 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -20,6 +20,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians icon_living = "magicOrange" icon_dead = "magicOrange" speed = 0 + blood_volume = 0 a_intent = INTENT_HARM stop_automated_movement = 1 movement_type = FLYING // Immunity to chasms and landmines, etc. diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm index 4e7cb0ac70..bc766f7409 100644 --- a/code/modules/mob/living/simple_animal/hostile/faithless.dm +++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm @@ -19,6 +19,7 @@ spacewalk = TRUE stat_attack = UNCONSCIOUS robust_searching = 1 + blood_volume = 0 harm_intent_damage = 10 obj_damage = 50 @@ -42,4 +43,4 @@ var/mob/living/carbon/C = target C.Knockdown(60) C.visible_message("\The [src] knocks down \the [C]!", \ - "\The [src] knocks you down!") \ No newline at end of file + "\The [src] knocks you down!") diff --git a/code/modules/mob/living/simple_animal/hostile/hivebot.dm b/code/modules/mob/living/simple_animal/hostile/hivebot.dm index ece5d7e24c..a9576a467b 100644 --- a/code/modules/mob/living/simple_animal/hostile/hivebot.dm +++ b/code/modules/mob/living/simple_animal/hostile/hivebot.dm @@ -28,6 +28,7 @@ gold_core_spawnable = HOSTILE_SPAWN del_on_death = 1 loot = list(/obj/effect/decal/cleanable/robot_debris) + blood_volume = 0 do_footstep = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm b/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm index 1a894734d8..38dd17a09b 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/seedling.dm @@ -30,6 +30,7 @@ robust_searching = TRUE stat_attack = UNCONSCIOUS anchored = TRUE + blood_volume = 0 var/combatant_state = SEEDLING_STATE_NEUTRAL var/obj/seedling_weakpoint/weak_point var/mob/living/beam_debuff_target diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 6279821170..397d40925b 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -50,6 +50,7 @@ Difficulty: Normal armour_penetration = 75 melee_damage_lower = 15 melee_damage_upper = 20 + blood_volume = 0 speed = 1 move_to_delay = 11 ranged = 1 diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm index 20916c9311..51919dad24 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/curse_blob.dm @@ -22,6 +22,7 @@ environment_smash = ENVIRONMENT_SMASH_NONE sentience_type = SENTIENCE_BOSS layer = LARGE_MOB_LAYER + blood_volume = 0 var/doing_move_loop = FALSE var/mob/living/set_target var/timerid diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm index cc54ad3bef..4856ba2176 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/bat.dm @@ -6,6 +6,7 @@ icon_dead = "bat_dead" icon_gib = "bat_dead" turns_per_move = 1 + blood_volume = 250 response_help = "brushes aside" response_disarm = "flails at" response_harm = "hits" diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm index 32e1c4d047..bfe8349192 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm @@ -31,6 +31,7 @@ movement_type = FLYING pressure_resistance = 300 gold_core_spawnable = NO_SPAWN //too spooky for science + blood_volume = 0 var/ghost_hair_style var/ghost_hair_color var/mutable_appearance/ghost_hair diff --git a/code/modules/mob/living/simple_animal/hostile/skeleton.dm b/code/modules/mob/living/simple_animal/hostile/skeleton.dm index d0ae01f443..48b69a1f5c 100644 --- a/code/modules/mob/living/simple_animal/hostile/skeleton.dm +++ b/code/modules/mob/living/simple_animal/hostile/skeleton.dm @@ -12,6 +12,7 @@ emote_see = list("rattles") a_intent = INTENT_HARM maxHealth = 40 + blood_volume = 0 health = 40 speed = 1 harm_intent_damage = 5 diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index 804989e71e..da423f3788 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -18,6 +18,7 @@ maxHealth = 50000 health = 50000 healable = 0 + blood_volume = 0 harm_intent_damage = 10 obj_damage = 100 diff --git a/code/modules/mob/living/simple_animal/hostile/stickman.dm b/code/modules/mob/living/simple_animal/hostile/stickman.dm index 7a86870aa1..fa5cb151ed 100644 --- a/code/modules/mob/living/simple_animal/hostile/stickman.dm +++ b/code/modules/mob/living/simple_animal/hostile/stickman.dm @@ -13,6 +13,7 @@ response_disarm = "shoves" response_harm = "hits" speed = 0 + blood_volume = 0 stat_attack = UNCONSCIOUS robust_searching = 1 environment_smash = ENVIRONMENT_SMASH_NONE diff --git a/code/modules/mob/living/simple_animal/shade.dm b/code/modules/mob/living/simple_animal/shade.dm index 3bd24c4df7..32ef52a6ae 100644 --- a/code/modules/mob/living/simple_animal/shade.dm +++ b/code/modules/mob/living/simple_animal/shade.dm @@ -31,6 +31,7 @@ loot = list(/obj/item/ectoplasm) del_on_death = TRUE initial_language_holder = /datum/language_holder/construct + blood_volume = 0 /mob/living/simple_animal/shade/death() deathmessage = "lets out a contented sigh as [p_their()] form unwinds." diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 52e58aea4e..990fa008fe 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -4,6 +4,7 @@ health = 20 maxHealth = 20 gender = PLURAL //placeholder + blood_volume = 550 //How much blud it has for bloodsucking status_flags = CANPUSH diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 185d717a00..d1e10ea693 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -26,6 +26,7 @@ health = 150 healable = 0 gender = NEUTER + blood_volume = 0 //Until someome reworks for them to have slime jelly see_in_dark = 8 diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 2c8935c786..1a836c06cf 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -366,6 +366,9 @@ if(m_intent == MOVE_INTENT_RUN) m_intent = MOVE_INTENT_WALK else + if (HAS_TRAIT(src,TRAIT_NORUNNING)) // FULPSTATION 7/10/19 So you can't run during fortitude. + to_chat(src, "You find yourself unable to run.") + return FALSE m_intent = MOVE_INTENT_RUN if(hud_used && hud_used.static_inventory) for(var/obj/screen/mov_intent/selector in hud_used.static_inventory) @@ -401,4 +404,4 @@ return TRUE /mob/proc/canZMove(direction, turf/target) - return FALSE \ No newline at end of file + return FALSE diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 88e766edfc..9141a6d299 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -180,7 +180,7 @@ else new /obj/effect/temp_visual/dir_setting/bloodsplatter(target_loca, splatter_dir, bloodtype_to_color()) - if(iscarbon(L)) + if(iscarbon(L) && !HAS_TRAIT(L, TRAIT_NOMARROW)) var/mob/living/carbon/C = L C.bleed(damage) else diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index f96acf2d71..fd28ff9c47 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -610,6 +610,8 @@ All effects don't start immediately, but rather get worse over time; the rate is value = 1.3 /datum/reagent/consumable/ethanol/bloody_mary/on_mob_life(mob/living/carbon/C) + if((HAS_TRAIT(C, TRAIT_NOMARROW))) + return if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) C.blood_volume = min((BLOOD_VOLUME_NORMAL*C.blood_ratio), C.blood_volume + 3) //Bloody Mary quickly restores blood loss. ..() diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 2a8ad86646..60c5cd6e71 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -355,6 +355,8 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) value = 1 /datum/reagent/medicine/salglu_solution/on_mob_life(mob/living/carbon/M) + if((HAS_TRAIT(M, TRAIT_NOMARROW))) + return if(last_added) M.blood_volume -= last_added last_added = 0 diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index bb65392057..eceb1cdd29 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -30,7 +30,7 @@ if(iscarbon(L)) var/mob/living/carbon/C = L var/blood_id = C.get_blood_id() - if((blood_id == "blood" || blood_id == "jellyblood") && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) + if((HAS_TRAIT(C, TRAIT_NOMARROW) || blood_id == "blood" || blood_id == "jellyblood") && (method == INJECT || (method == INGEST && C.dna && C.dna.species && (DRINKSBLOOD in C.dna.species.species_traits)))) C.blood_volume = min(C.blood_volume + round(reac_volume, 0.1), BLOOD_VOLUME_MAXIMUM * C.blood_ratio) // we don't care about bloodtype here, we're just refilling the mob @@ -38,6 +38,8 @@ L.add_blood_DNA(list(data["blood_DNA"] = data["blood_type"])) /datum/reagent/blood/on_mob_life(mob/living/carbon/C) //Because lethals are preferred over stamina. damnifino. + if((HAS_TRAIT(C, TRAIT_NOMARROW))) + return //We dont want vampires getting toxed from blood var/blood_id = C.get_blood_id() if((blood_id == "blood" || blood_id == "jellyblood")) if(!data || !(data["blood_type"] in get_safe_blood(C.dna.blood_type))) //we only care about bloodtype here because this is where the poisoning should be @@ -1116,6 +1118,8 @@ color = "#c2391d" /datum/reagent/iron/on_mob_life(mob/living/carbon/C) + if((HAS_TRAIT(C, TRAIT_NOMARROW))) + return if(C.blood_volume < (BLOOD_VOLUME_NORMAL*C.blood_ratio)) C.blood_volume += 0.01 //we'll have synthetics from medbay. ..() diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index fe35981bfe..61449fc153 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -107,8 +107,29 @@ else return ..() +/obj/item/reagent_containers/blood/attack(mob/M, mob/user, def_zone) + if(user.a_intent == INTENT_HELP && reagents.total_volume > 0) + if (user != M) + to_chat(user, "You force [M] to drink from the [src]") + user.visible_message("[user] forces [M] to drink from the [src].") + if(!do_mob(user, M, 50)) + return + else + if(!do_mob(user, M, 10)) + return + to_chat(user, "You take a sip from the [src].") + user.visible_message("[user] puts the [src] up to their mouth.") + if(reagents.total_volume <= 0) // Safety: In case you spam clicked the blood bag on yourself, and it is now empty (below will divide by zero) + return + var/gulp_size = 5 + var/fraction = min(gulp_size / reagents.total_volume, 1) + reagents.reaction(M, INGEST, fraction) //checkLiked(fraction, M) // Blood isn't food, sorry. + reagents.trans_to(M, gulp_size) + playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) + ..() + /obj/item/reagent_containers/blood/bluespace name = "bluespace blood pack" desc = "Contains blood used for transfusion, this one has been made with bluespace technology to hold much more blood. Must be attached to an IV drip." icon_state = "bsbloodpack" - volume = 600 //its a blood bath! \ No newline at end of file + volume = 600 //its a blood bath! diff --git a/code/modules/research/nanites/nanite_programs/healing.dm b/code/modules/research/nanites/nanite_programs/healing.dm index 50fb5efcb0..e2e1661ab7 100644 --- a/code/modules/research/nanites/nanite_programs/healing.dm +++ b/code/modules/research/nanites/nanite_programs/healing.dm @@ -98,7 +98,7 @@ /datum/nanite_program/blood_restoring/check_conditions() if(iscarbon(host_mob)) var/mob/living/carbon/C = host_mob - if(C.blood_volume >= (BLOOD_VOLUME_SAFE*C.blood_ratio)) + if(C.blood_volume >= (BLOOD_VOLUME_SAFE*C.blood_ratio) || (HAS_TRAIT(C, TRAIT_NOMARROW))) return FALSE else return FALSE diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 212605669d..5b74b58cd0 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -55,6 +55,11 @@ update_icon() return 1 +/obj/item/organ/heart/proc/HeartStrengthMessage() + if(beating) + return "a healthy" + return "an unstable" + /obj/item/organ/heart/prepare_eat() var/obj/S = ..() S.icon_state = "[icon_base]-off" diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 6b435f282f..0fbd8c8406 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -22,6 +22,7 @@ /datum/language/ratvar, /datum/language/aphasia, /datum/language/slime, + /datum/language/vampiric, )) healing_factor = STANDARD_ORGAN_HEALING*5 //Fast!! decay_factor = STANDARD_ORGAN_DECAY/2 diff --git a/config/game_options.txt b/config/game_options.txt index a44c68226e..3b031bb5b9 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -92,6 +92,7 @@ PROBABILITY SECRET_EXTENDED 0 PROBABILITY DEVIL 0 PROBABILITY DEVIL_AGENTS 0 PROBABILITY CLOWNOPS 0 +PROBABILITY BLOODSUCKER 0 ## You probably want to keep sandbox off by default for secret and random. PROBABILITY SANDBOX 0 @@ -114,6 +115,7 @@ CONTINUOUS CLOCKWORK_CULT CONTINUOUS CHANGELING CONTINUOUS WIZARD #CONTINUOUS MONKEY +CONTINUOUS BLOODSUCKER ##Note: do not toggle continuous off for these modes, as they have no antagonists and would thus end immediately! diff --git a/icons/misc/language.dmi b/icons/misc/language.dmi index dcd10a51b7..6f6f2546d5 100644 Binary files a/icons/misc/language.dmi and b/icons/misc/language.dmi differ diff --git a/icons/misc/mark_icons.dmi b/icons/misc/mark_icons.dmi new file mode 100644 index 0000000000..1d8472752b Binary files /dev/null and b/icons/misc/mark_icons.dmi differ diff --git a/icons/mob/actions/bloodsucker.dmi b/icons/mob/actions/bloodsucker.dmi new file mode 100644 index 0000000000..c08509dbbd Binary files /dev/null and b/icons/mob/actions/bloodsucker.dmi differ diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index d2b67f4314..8ea155256c 100644 Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ diff --git a/icons/mob/inhands/weapons/melee_lefthand.dmi b/icons/mob/inhands/weapons/melee_lefthand.dmi index 092881ee01..fc82db43ae 100644 Binary files a/icons/mob/inhands/weapons/melee_lefthand.dmi and b/icons/mob/inhands/weapons/melee_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/melee_righthand.dmi b/icons/mob/inhands/weapons/melee_righthand.dmi index ede430390c..a93a4e38d5 100644 Binary files a/icons/mob/inhands/weapons/melee_righthand.dmi and b/icons/mob/inhands/weapons/melee_righthand.dmi differ diff --git a/icons/obj/items_and_weapons.dmi b/icons/obj/items_and_weapons.dmi index e6e0b940a8..e3540a782b 100644 Binary files a/icons/obj/items_and_weapons.dmi and b/icons/obj/items_and_weapons.dmi differ diff --git a/icons/obj/stake.dmi b/icons/obj/stake.dmi new file mode 100644 index 0000000000..dfc1dc08bf Binary files /dev/null and b/icons/obj/stake.dmi differ diff --git a/icons/obj/vamp_obj.dmi b/icons/obj/vamp_obj.dmi new file mode 100644 index 0000000000..89718773dd Binary files /dev/null and b/icons/obj/vamp_obj.dmi differ diff --git a/sound/bloodsucker/BloodsuckerAlert.ogg b/sound/bloodsucker/BloodsuckerAlert.ogg new file mode 100644 index 0000000000..686f15bb71 Binary files /dev/null and b/sound/bloodsucker/BloodsuckerAlert.ogg differ diff --git a/sound/bloodsucker/coffin_close.ogg b/sound/bloodsucker/coffin_close.ogg new file mode 100644 index 0000000000..600809f782 Binary files /dev/null and b/sound/bloodsucker/coffin_close.ogg differ diff --git a/sound/bloodsucker/coffin_open.ogg b/sound/bloodsucker/coffin_open.ogg new file mode 100644 index 0000000000..38ca5c1f87 Binary files /dev/null and b/sound/bloodsucker/coffin_open.ogg differ diff --git a/tgstation.dme b/tgstation.dme index 4c7e29739f..b1e984ab26 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -555,6 +555,8 @@ #include "code\game\gamemodes\game_mode.dm" #include "code\game\gamemodes\objective.dm" #include "code\game\gamemodes\objective_items.dm" +#include "code\game\gamemodes\bloodsucker\bloodsucker.dm" +#include "code\game\gamemodes\bloodsucker\hunter.dm" #include "code\game\gamemodes\brother\traitor_bro.dm" #include "code\game\gamemodes\changeling\changeling.dm" #include "code\game\gamemodes\changeling\traitor_chan.dm" @@ -1214,6 +1216,33 @@ #include "code\modules\antagonists\blob\blob\blobs\resource.dm" #include "code\modules\antagonists\blob\blob\blobs\shield.dm" #include "code\modules\antagonists\blood_contract\blood_contract.dm" +#include "code\modules\antagonists\bloodsucker\bloodsucker_flaws.dm" +#include "code\modules\antagonists\bloodsucker\bloodsucker_integration.dm" +#include "code\modules\antagonists\bloodsucker\bloodsucker_life.dm" +#include "code\modules\antagonists\bloodsucker\bloodsucker_objectives.dm" +#include "code\modules\antagonists\bloodsucker\bloodsucker_powers.dm" +#include "code\modules\antagonists\bloodsucker\bloodsucker_sunlight.dm" +#include "code\modules\antagonists\bloodsucker\bloodsucker_ui.dm" +#include "code\modules\antagonists\bloodsucker\datum_bloodsucker.dm" +#include "code\modules\antagonists\bloodsucker\datum_hunter.dm" +#include "code\modules\antagonists\bloodsucker\datum_vassal.dm" +#include "code\modules\antagonists\bloodsucker\items\bloodsucker_organs.dm" +#include "code\modules\antagonists\bloodsucker\items\bloodsucker_stake.dm" +#include "code\modules\antagonists\bloodsucker\objects\bloodsucker_coffin.dm" +#include "code\modules\antagonists\bloodsucker\objects\bloodsucker_crypt.dm" +#include "code\modules\antagonists\bloodsucker\objects\bloodsucker_lair.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_brawn.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_cloak.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_feed.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_fortitude.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_gohome.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_haste.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_lunge.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_masquerade.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_mesmerize.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_trespass.dm" +#include "code\modules\antagonists\bloodsucker\powers\bs_veil.dm" +#include "code\modules\antagonists\bloodsucker\powers\v_recuperate.dm" #include "code\modules\antagonists\brainwashing\brainwashing.dm" #include "code\modules\antagonists\brother\brother.dm" #include "code\modules\antagonists\changeling\cellular_emporium.dm" @@ -1920,6 +1949,7 @@ #include "code\modules\language\ratvarian.dm" #include "code\modules\language\slime.dm" #include "code\modules\language\swarmer.dm" +#include "code\modules\language\vampiric.dm" #include "code\modules\language\xenocommon.dm" #include "code\modules\library\lib_codex_gigas.dm" #include "code\modules\library\lib_items.dm"