From 1b95caa390c06f8b03763bb57572e992682aafd1 Mon Sep 17 00:00:00 2001 From: VerySoft Date: Fri, 4 Mar 2022 16:18:27 -0500 Subject: [PATCH] [WIP] Dominant Prey Adds dominant prey to the game. --- .../station/station_special_abilities_vr.dm | 75 ++++++++++++ .../species/station/traits_vr/neutral.dm | 12 ++ .../subtypes/vore/dominated_brain.dm | 111 ++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 code/modules/mob/living/simple_mob/subtypes/vore/dominated_brain.dm diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm index 5788ded0be5..966d009c9b4 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm @@ -1003,3 +1003,78 @@ species.has_glowing_eyes = !species.has_glowing_eyes update_eyes() to_chat(src, "Your eyes [species.has_glowing_eyes ? "are now" : "are no longer"] glowing.") + +//Welcome to the adapted borer code. +/mob/living/proc/dominate_predator() + set category = "Abilities" + set name = "Dominate Predator" + set desc = "Connect to and dominate the brain of your predator." + + if(isbelly(loc)) + to_chat(src, "You are not inside a predator body.") + return + + var/mob/living/pred = loc.loc + + if(src.stat) + to_chat(src, "You cannot do that in your current state.") + return + + if(!pred.ckey) + to_chat(src, "\The [src] isn't able to be dominated.") + return + + if(tgui_alert(src, "You are attempting to take over [pred], are you sure? Ensure that their preferences align with this kind of play.", "Take Over Predator",list("No","Yes")) != "Yes") + return + to_chat(src, "You attempt to exert your control over \the [pred]...") + log_admin("[key_name_admin(src)] attempted to take over [pred].") + if(tgui_alert(M, "\The [src] has elected to attempt to take control of you. Is this something you will allow to happen?", "Allow Prey Domination",list("No","Yes")) != "Yes") + to_chat(src, "\The [pred] declined your request for control.") + return + if(tgui_alert(M, "Are you sure? If you should decide to revoke this, you will have the ability to do so in your 'Abilities' tab.", "Allow Prey Domination",list("No","Yes")) != "Yes") + return + to_chat(pred, "You can feel the will of another overwriting your own, control of your body being sapped away from you...") + to_chat(src, "You can feel the will of your host diminishing as you exert your will over them!") + if(!do_after(src, 10 SECONDS, exclusive = TRUE) || !isbelly(loc) || loc.loc != pred) + to_chat(src, "You are not inside \the [pred]'s body, your attempt to link up with them has been interrupted.") + to_chat(pred, "The dominant sensation fades away...") + return + + to_chat(src, "You plunge your conciousness into \the [pred], assuming control over their very body, leaving your own behind within \the [pred]'s [loc].") + to_chat(pred, "You feel your body move on its own, as you are pushed to the background, and an alien consciousness displaces yours.") + + var/mob/living/dominated_brain/pred_brain = new mob/living/dominated_brain(src, src, pred) + // pred -> brain + var/pred_id = pred.computer_id + var/pred_ip = pred.lastKnownIP + pred.computer_id = null + pred.lastKnownIP = null + + pred_brain.ckey = pred.ckey + + pred_brain.name = pred.name + + if(!pred_brain.computer_id) + pred_brain.computer_id = pred_id + + if(!pred_brain.lastKnownIP) + pred_brain.lastKnownIP = pred_ip + + // prey -> pred + var/prey_id = src.computer_id + var/prey_ip= src.lastKnownIP + src.computer_id = null + src.lastKnownIP = null + + pred.ckey = src.ckey + + if(!pred.computer_id) + pred.computer_id = s2h_id + + if(!pred.lastKnownIP) + pred.lastKnownIP = s2h_ip + + controlling = 1 + + pred.verbs += /mob/living/proc/release_predator + pred.verbs += /mob/living/proc/punish_host diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm index 3c2e0935801..67067c24a28 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm @@ -480,3 +480,15 @@ /datum/trait/neutral/thinner/apply(var/datum/species/S,var/mob/living/carbon/human/H) ..(S,H) H.update_transform() + +/////WOWIE///// + +/datum/trait/neutral/dominate_predator + name = "Dominate Predator" + desc = "Makes you able to gain nutrition from draining prey in your grasp." + cost = 0 + custom_only = FALSE + +/datum/trait/neutral/dominate_predator/apply(var/datum/species/S,var/mob/living/carbon/human/H) + ..(S,H) + H.verbs |= /mob/living/carbon/human/proc/dominate_predator \ No newline at end of file diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/dominated_brain.dm b/code/modules/mob/living/simple_mob/subtypes/vore/dominated_brain.dm new file mode 100644 index 00000000000..bc73a17137a --- /dev/null +++ b/code/modules/mob/living/simple_mob/subtypes/vore/dominated_brain.dm @@ -0,0 +1,111 @@ +///// A mob that gets used when prey dominate predators. Will automatically delete itself if it's not inside a mob. + +/mob/living/dominated_brain + name = "dominated brain" + desc = "Someone who has taken a back seat within their own body." + icon = 'icons/obj/surgery.dmi' + icon_state = "brain1" + var/original_body //The body this brain originally belongs to + var/dominating_body //The body that dominated this brain + var/original_ckey + var/dominating_ckey + +/mob/living/dominated_brain/New(loc, var/mob/living/prey, var/mob/living/pred) + . = ..() + name = pred.name + original_body = pred + dominating_body = prey + original_ckey = pred.ckey + dominating_ckey = prey.ckey + +/mob/living/dominated_brain/Initialize() + if(!isliving(loc)) + qdel(src) + return + . = ..() + RegisterSignal(original_body, COMSIG_PARENT_QDELETING, .proc/ob_was_deleted, TRUE) + RegisterSignal(dominating_body, COMSIG_PARENT_QDELETING, .proc/db_was_deleted, TRUE) + +/mob/living/dominated_brain/proc/ob_was_deleted() + if(original_body) + UnregisterSignal(original_body, COMSIG_PARENT_QDELETING) + original_body = null + +/mob/living/dominated_brain/proc/db_was_deleted() + if(dominating_body) + UnregisterSignal(dominating_body, COMSIG_PARENT_QDELETING) + dominating_body = null + +/mob/living/dominated_brain/Destroy() + ob_was_deleted() + db_was_deleted() + . = ..() + +/mob/living/captive_brain/say(var/message, var/datum/language/speaking = null, var/whispering = 0) + + if (src.client) + if(client.prefs.muted & MUTE_IC) + to_chat(src, "You cannot speak in IC (muted).") + return + + if(loc = original_body) + + message = sanitize(message) + if (!message) + return + log_say(message,src) + if (stat == 2) + return say_dead(message) + + var/mob/living/simple_mob/animal/borer/B = src.loc + to_chat(src, "You whisper silently, \"[message]\"") + to_chat(B.host, "The captive mind of [src] whispers, \"[message]\"") + + for (var/mob/M in player_list) + if (istype(M, /mob/new_player)) + continue + else if(M.stat == DEAD && M.is_preference_enabled(/datum/client_preference/ghost_ears)) + to_chat(M, "The captive mind of [src] whispers, \"[message]\"") + +/mob/living/captive_brain/me_verb(message as text) + if (src.client) + if(client.prefs.muted & MUTE_IC) + to_chat(src, "You cannot speak in IC (muted).") + return + + to_chat(src, "You cannot emote as a captive mind.") + return + +/mob/living/captive_brain/emote(var/message) + if (src.client) + if(client.prefs.muted & MUTE_IC) + to_chat(src, "You cannot speak in IC (muted).") + return + + to_chat(src, "You cannot emote as a captive mind.") + return + +/mob/living/captive_brain/process_resist() + //Resisting control by an alien mind. + if(istype(src.loc, /mob/living/simple_mob/animal/borer)) + var/mob/living/simple_mob/animal/borer/B = src.loc + var/mob/living/captive_brain/H = src + + to_chat(H, "You begin doggedly resisting the parasite's control (this will take approximately sixty seconds).") + to_chat(B.host, "You feel the captive mind of [src] begin to resist your control.") + + spawn(rand(200,250)+B.host.brainloss) + if(!B || !B.controlling) return + + B.host.adjustBrainLoss(rand(0.1,0.5)) + to_chat(H, "With an immense exertion of will, you regain control of your body!") + to_chat(B.host, "You feel control of the host brain ripped from your grasp, and retract your probosci before the wild neural impulses can damage you.") + B.detatch() + verbs -= /mob/living/carbon/proc/release_control + verbs -= /mob/living/carbon/proc/punish_host + verbs -= /mob/living/carbon/proc/spawn_larvae + + return + + ..() +