[WIP] Dominant Prey

Adds dominant prey to the game.
This commit is contained in:
VerySoft
2022-03-04 16:18:27 -05:00
parent 8b9302a688
commit 1b95caa390
3 changed files with 198 additions and 0 deletions
@@ -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, "<span class='notice'>You are not inside a predator body.</span>")
return
var/mob/living/pred = loc.loc
if(src.stat)
to_chat(src, "<span class='warning'>You cannot do that in your current state.</span>")
return
if(!pred.ckey)
to_chat(src, "<span class='notice'>\The [src] isn't able to be dominated.</span>")
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, "<span class='notice'>You attempt to exert your control over \the [pred]...</span>")
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, "<span class='warning'>\The [pred] declined your request for control.</span>")
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, "<span class='warning'>You can feel the will of another overwriting your own, control of your body being sapped away from you...</span>")
to_chat(src, "<span class='warning'>You can feel the will of your host diminishing as you exert your will over them!</span>")
if(!do_after(src, 10 SECONDS, exclusive = TRUE) || !isbelly(loc) || loc.loc != pred)
to_chat(src, "<span class='notice'>You are not inside \the [pred]'s body, your attempt to link up with them has been interrupted.</span>")
to_chat(pred, "<span class='notice'>The dominant sensation fades away...</span>")
return
to_chat(src, "<span class='danger'>You plunge your conciousness into \the [pred], assuming control over their very body, leaving your own behind within \the [pred]'s [loc].</span>")
to_chat(pred, "<span class='danger'>You feel your body move on its own, as you are pushed to the background, and an alien consciousness displaces yours.</span>")
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
@@ -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
@@ -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, "<font color='red'>You cannot speak in IC (muted).</font>")
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, "<font color='red'>You cannot speak in IC (muted).</font>")
return
to_chat(src, "<span class='danger'>You cannot emote as a captive mind.</span>")
return
/mob/living/captive_brain/emote(var/message)
if (src.client)
if(client.prefs.muted & MUTE_IC)
to_chat(src, "<font color='red'>You cannot speak in IC (muted).</font>")
return
to_chat(src, "<span class='danger'>You cannot emote as a captive mind.</span>")
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, "<span class='danger'>You begin doggedly resisting the parasite's control (this will take approximately sixty seconds).</span>")
to_chat(B.host, "<span class='danger'>You feel the captive mind of [src] begin to resist your control.</span>")
spawn(rand(200,250)+B.host.brainloss)
if(!B || !B.controlling) return
B.host.adjustBrainLoss(rand(0.1,0.5))
to_chat(H, "<span class='danger'>With an immense exertion of will, you regain control of your body!</span>")
to_chat(B.host, "<span class='danger'>You feel control of the host brain ripped from your grasp, and retract your probosci before the wild neural impulses can damage you.</span>")
B.detatch()
verbs -= /mob/living/carbon/proc/release_control
verbs -= /mob/living/carbon/proc/punish_host
verbs -= /mob/living/carbon/proc/spawn_larvae
return
..()