Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into merge-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dzianishchyts committed Apr 25, 2024
2 parents ff1230f + 5b8ae44 commit 0a97b13
Show file tree
Hide file tree
Showing 17 changed files with 123 additions and 78 deletions.
2 changes: 1 addition & 1 deletion SQL/updates/53-54.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#Add a choice for what type of brain borgs want to have

ALTER TABLE `characters`
ADD COLUMN `cyborg_brain_type` VARCHAR(11) NOT NULL DEFAULT 'MMI' AFTER `height`;
ADD COLUMN `cyborg_brain_type` ENUM('MMI', 'Robobrain', 'Positronic') NOT NULL DEFAULT 'MMI' AFTER `height`;
3 changes: 1 addition & 2 deletions _maps/map_files/RandomRuins/SpaceRuins/listeningpost.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,14 @@
info = "Nothing of interest to report.";
name = "november report"
},
/obj/item/pen,
/obj/item/tape,
/obj/item/radio/intercom{
freerange = 1;
pixel_y = -24;
name = "intercom"
},
/obj/item/paper_bin,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/obj/effect/decal/cleanable/dirt,
/turf/simulated/floor/plasteel/dark,
/area/ruin/space/syndicate_listening_station)
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/RandomRuins/SpaceRuins/mechtransport.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@
/obj/item/paper_bin{
pixel_x = -6
},
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/mineral/plastitanium,
/area/ruin/space/mech_transport)
"MA" = (
Expand Down
1 change: 1 addition & 0 deletions _maps/map_files/RandomRuins/SpaceRuins/moonoutpost19.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -5200,6 +5200,7 @@
},
/obj/item/coin/antagtoken/syndicate,
/obj/structure/table,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plating/asteroid/ancient,
/area/ruin/space/moonbase19)
"rk" = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
pixel_x = 4
},
/obj/item/paper/syndicate_druglab,
/obj/item/pen,
/obj/item/flashlight/lamp/green/off{
pixel_y = 12;
pixel_x = -6
},
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/carpet/black,
/area/ruin/space/syndicate_druglab)
"qa" = (
Expand Down
8 changes: 4 additions & 4 deletions _maps/map_files/RandomRuins/SpaceRuins/syndie_space_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -2985,7 +2985,7 @@
dir = 8
},
/obj/item/hand_labeler,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plasteel{
dir = 9;
icon_state = "darkgreen"
Expand Down Expand Up @@ -3423,7 +3423,7 @@
"th" = (
/obj/structure/table,
/obj/item/paper_bin,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/obj/structure/extinguisher_cabinet{
name = "north bump";
pixel_y = 30
Expand Down Expand Up @@ -3760,7 +3760,7 @@
/area/ruin/unpowered/syndicate_space_base/service)
"vd" = (
/obj/structure/table,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/obj/item/paper_bin,
/obj/item/stamp/syndicate,
/obj/machinery/light_switch{
Expand Down Expand Up @@ -8462,7 +8462,7 @@
dir = 8
},
/obj/item/hand_labeler,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plasteel{
dir = 10;
icon_state = "darkgreen"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@
/obj/machinery/light/small{
dir = 4
},
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/engine,
/area/ruin/space/unpowered)
"tX" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/RandomRuins/SpaceRuins/syndiedepot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@
"bV" = (
/obj/structure/table,
/obj/item/folder/syndicate/yellow,
/obj/item/pen,
/obj/item/pen/multi/syndicate,
/turf/simulated/floor/plasteel{
icon_state = "dark"
},
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1061,3 +1061,6 @@

/// Used by admin-tooling to remove radiation
#define COMSIG_ADMIN_DECONTAMINATE "admin_decontaminate"

/// Sent when bodies transfer between shades/shards and constructs
#define COMSIG_SHADE_TO_CONSTRUCT_TRANSFER "shade_to_construct_transfer"
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
var/allow_antag_hud = TRUE
/// Forbid players from rejoining if they use AntagHUD?
var/restrict_antag_hud_rejoin = TRUE
/// Enable respanws by default?
/// Enable respawns by default?
var/respawn_enabled = FALSE
/// Enable CID randomiser buster?
var/enabled_cid_randomiser_buster = FALSE
Expand Down Expand Up @@ -94,6 +94,7 @@
CONFIG_LOAD_BOOL(allow_antag_hud, data["allow_antag_hud"])
CONFIG_LOAD_BOOL(restrict_antag_hud_rejoin, data["restrict_antag_hud_rejoin"])
CONFIG_LOAD_BOOL(enabled_cid_randomiser_buster, data["enable_cid_randomiser_buster"])
CONFIG_LOAD_BOOL(respawn_enabled, data["respawn_enabled"])
CONFIG_LOAD_BOOL(forbid_singulo_possession, data["prevent_admin_singlo_possession"])
CONFIG_LOAD_BOOL(popup_admin_pm, data["popup_admin_pm"])
CONFIG_LOAD_BOOL(allow_holidays, data["allow_holidays"])
Expand Down
76 changes: 76 additions & 0 deletions code/datums/components/cult_held_body.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* A component for tracking and manipulating bodies held inside constructs/shades
* Will drop the body/brain when the parent dies or is deleted.
*/
/datum/component/construct_held_body
dupe_mode = COMPONENT_DUPE_ALLOWED
/// A reference to either a mob, or a brain organ that is held inside our parent. Will drop when parent dies/is deleted
var/atom/movable/held_body

/datum/component/construct_held_body/Initialize(atom/movable/new_body)
. = ..()
add_body(new_body)

/datum/component/construct_held_body/Destroy(force, silent)
if(held_body)
stack_trace("/datum/component/construct_held_body had a held body still despite being destroyed. Body is [held_body] ([held_body.type])")
held_body = null
return ..()

/datum/component/construct_held_body/PostTransfer()
held_body.forceMove(parent) // forcemove them to the new parent

/datum/component/construct_held_body/RegisterWithParent()
RegisterSignal(parent, COMSIG_MOB_DEATH, PROC_REF(drop_body))
RegisterSignal(parent, COMSIG_PARENT_QDELETING, PROC_REF(drop_body))
RegisterSignal(parent, COMSIG_SHADE_TO_CONSTRUCT_TRANSFER, PROC_REF(transfer_held_body))

/datum/component/construct_held_body/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_MOB_DEATH)
UnregisterSignal(parent, COMSIG_PARENT_QDELETING)
UnregisterSignal(parent, COMSIG_SHADE_TO_CONSTRUCT_TRANSFER)

/datum/component/construct_held_body/proc/add_body(atom/movable/new_body)
held_body = new_body
RegisterSignal(new_body, COMSIG_PARENT_QDELETING, PROC_REF(_null_held_body))
new_body.forceMove(parent)

/datum/component/construct_held_body/proc/_null_held_body()
SIGNAL_HANDLER // COMSIG_PARENT_QDELETING
UnregisterSignal(held_body, COMSIG_PARENT_QDELETING)
held_body = null

/datum/component/construct_held_body/proc/transfer_held_body(mob/living/current_parent, mob/living/new_body_holder)
SIGNAL_HANDLER // COMSIG_SHADE_TO_CONSTRUCT_TRANSFER
new_body_holder.TakeComponent(src)

/datum/component/construct_held_body/proc/drop_body()
SIGNAL_HANDLER // COMSIG_MOB_DEATH + COMSIG_PARENT_QDELETING
INVOKE_ASYNC(src, PROC_REF(_drop_body))

/datum/component/construct_held_body/proc/_drop_body() // call me lazy ig
if(!held_body) // Null check for empty bodies
return
var/mob/living/parent_mob = parent
held_body.forceMove(get_turf(parent))
SSticker.mode?.cult_team?.add_cult_immunity(held_body)

var/mob/living/held_mob = held_body
if(ismob(held_body)) // Check if the held_body is a mob
held_mob.key = parent_mob.key
held_mob.cancel_camera()
else if(istype(held_body, /obj/item/organ/internal/brain)) // Check if the held_body is a brain
var/obj/item/organ/internal/brain/brain = held_body
if(brain.brainmob) // Check if the brain has a brainmob
brain.brainmob.key = parent_mob.key // Set the key to the brainmob
held_mob = brain.brainmob

if(!istype(held_mob) || QDELETED(held_mob))
CRASH("/datum/component/construct_held_body/proc/_drop_body attempted to drop a body despite having no body, or a qdeleted body")

parent_mob.mind.transfer_to(held_mob) // Transfer the mind to the original mob
// goodbye construct antag datums!
held_mob.mind.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
held_mob.mind.remove_antag_datum(/datum/antagonist/wizard/construct, silent_removal = TRUE)
held_body = null
qdel(src) // our job here is done
61 changes: 26 additions & 35 deletions code/game/gamemodes/wizard/soulstone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
slot_flags = SLOT_FLAG_BELT
origin_tech = "bluespace=4;materials=5"

/// The body/brain of the player inside this construct, transferred over from the soulstone.
var/atom/movable/held_body
/// Should we show rays? Triggered by a held body
var/animate_rays = FALSE
/// Does this soulstone ask the victim whether they want to be turned into a shade
var/optional = FALSE
/// Can this soul stone be used by anyone, or only cultists/wizards?
Expand All @@ -26,13 +26,6 @@
var/opt_in = FALSE
var/purified = FALSE

/obj/item/soulstone/proc/add_held_body(atom/movable/body)
held_body = body
RegisterSignal(body, COMSIG_PARENT_QDELETING, PROC_REF(remove_held_body))

/obj/item/soulstone/proc/remove_held_body()
SIGNAL_HANDLER
held_body = null

/obj/item/soulstone/proc/can_use(mob/living/user)
if(IS_CULTIST(user) && purified && !iswizard(user))
Expand Down Expand Up @@ -78,13 +71,12 @@
/obj/item/soulstone/Destroy() //Stops the shade from being qdel'd immediately and their ghost being sent back to the arrival shuttle.
for(var/mob/living/simple_animal/shade/A in src)
A.death()
remove_held_body()
STOP_PROCESSING(SSobj, src)
return ..()

/obj/item/soulstone/process()
. = ..()
if(held_body)
if(animate_rays)
var/new_filter = isnull(get_filter("ray"))
if(!purified)
ray_filter_helper(1, 40,"#c926ae", 6, 20)
Expand Down Expand Up @@ -242,20 +234,19 @@
to_chat(user, "<span class='notice'>The shard feels too tough to shatter, you are not holy enough to free its captive!</span>")
return

if(!do_after_once(user, 10 SECONDS, FALSE, src) || !held_body)
if(!do_after_once(user, 10 SECONDS, FALSE, src))
return

user.visible_message("[user] shatters the soulstone apart! Releasing [held_body] from their prison!", "You shatter the soulstone holding [held_body], binding them free!", "You hear something shatter with a ghastly crack.")
if(ismob(held_body))
var/mob/M = held_body
M.key = S.key
else if(istype(held_body, /obj/item/organ/internal/brain))
var/obj/item/organ/internal/brain/B = held_body
B.brainmob.key = S.key
S.cancel_camera()
held_body.forceMove(get_turf(src))
SSticker.mode?.cult_team?.add_cult_immunity(held_body)
remove_held_body()
if(!S)
return

var/datum/component/construct_held_body/body_holder = S.GetComponent(/datum/component/construct_held_body)
var/atom/movable/dropped_body = body_holder.held_body
body_holder.drop_body()
if(!dropped_body)
return

user.visible_message("[user] shatters the soulstone apart! Releasing [dropped_body] from their prison!", "You shatter the soulstone holding [dropped_body], binding them free!", "You hear something shatter with a ghastly crack.")
new /obj/effect/temp_visual/cult/sparks(get_turf(src))
playsound(src, 'sound/effects/pylon_shatter.ogg', 40, TRUE)
qdel(src)
Expand All @@ -276,6 +267,7 @@
was_used()
remove_filter("ray")
STOP_PROCESSING(SSobj, src)
animate_rays = FALSE

///////////////////////////Transferring to constructs/////////////////////////////////////////////////////
/obj/structure/constructshell
Expand Down Expand Up @@ -320,9 +312,8 @@
to_chat(user, "<span class='userdanger'>Capture failed!</span> The soul has already fled its mortal frame. You attempt to bring it back...")
T.Paralyse(40 SECONDS)
if(!get_cult_ghost(T, user, TRUE))
add_held_body(T)
T.forceMove(src) //If we can't get a ghost, shard the body anyways.
START_PROCESSING(SSobj, src)
// no luck, dont shard them.
to_chat(user, "<span class='userdanger'>No soul responds to the soul stone.</span>")

if("VICTIM")
var/mob/living/carbon/human/T = target
Expand Down Expand Up @@ -361,6 +352,7 @@
name = "soulstone : [T.name]"
to_chat(T, "<span class='notice'>Your soul has been recaptured by the soul stone, its arcane energies are reknitting your ethereal form</span>")
to_chat(user, "<span class='notice'>Capture successful!</span> [T.name]'s has been recaptured and stored within the soul stone.")
animate_rays = TRUE
START_PROCESSING(SSobj, src)

if("CONSTRUCT")
Expand Down Expand Up @@ -413,9 +405,8 @@
to_chat(src, "<span class='userdanger'>You are still bound to serve the cult, follow their orders and help them complete their goals at all costs.</span>")
else
to_chat(src, "<span class='userdanger'>You are still bound to serve your creator, follow their orders and help them complete their goals at all costs.</span>")
SS.held_body.forceMove(src)
add_held_body(SS.held_body)
SS.remove_held_body()

SEND_SIGNAL(shade, COMSIG_SHADE_TO_CONSTRUCT_TRANSFER, src)
cancel_camera()
qdel(shell)
qdel(shade)
Expand Down Expand Up @@ -465,13 +456,13 @@
if(!isrobot(M))
for(var/obj/item/I in M)
M.unEquip(I)

var/target_body = M
if(isbrain(M))
var/obj/item/organ/internal/brain/brain_obj = M.loc
add_held_body(brain_obj)
brain_obj.forceMove(src)
else
add_held_body(M)
M.forceMove(src)
target_body = M.loc // get the brain organ instead of the brain mob

S.AddComponent(/datum/component/construct_held_body, target_body)
animate_rays = TRUE

/obj/item/soulstone/proc/get_shade_type()
if(purified)
Expand Down
28 changes: 1 addition & 27 deletions code/modules/mob/living/simple_animal/constructs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,12 @@

set_light(2, 3, l_color = GET_CULT_DATA(construct_glow, LIGHT_COLOR_BLOOD_MAGIC))

/mob/living/simple_animal/hostile/construct/Destroy()
mind?.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
mind?.remove_antag_datum(/datum/antagonist/wizard/construct, silent_removal = TRUE)
remove_held_body()
return ..()

/mob/living/simple_animal/hostile/construct/death(gibbed)
mind?.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
mind?.remove_antag_datum(/datum/antagonist/wizard/construct, silent_removal = TRUE)
if(held_body) // Null check for empty bodies
held_body.forceMove(get_turf(src))
SSticker.mode?.cult_team?.add_cult_immunity(held_body)
if(ismob(held_body)) // Check if the held_body is a mob
held_body.key = key
else if(istype(held_body, /obj/item/organ/internal/brain)) // Check if the held_body is a brain
var/obj/item/organ/internal/brain/brain = held_body
if(brain.brainmob) // Check if the brain has a brainmob
brain.brainmob.key = key // Set the key to the brainmob
brain.brainmob.mind.transfer_to(brain.brainmob) // Transfer the mind to the brainmob
held_body.cancel_camera()
// we also drop our heldbody from the /construct_held_body component, as well as our cult/wiz construct antag datums
new /obj/effect/temp_visual/cult/sparks(get_turf(src))
playsound(src, 'sound/effects/pylon_shatter.ogg', 40, TRUE)
return ..()

/mob/living/simple_animal/hostile/construct/proc/add_held_body(atom/movable/body)
held_body = body
RegisterSignal(body, COMSIG_PARENT_QDELETING, PROC_REF(remove_held_body))

/mob/living/simple_animal/hostile/construct/proc/remove_held_body()
SIGNAL_HANDLER
held_body = null

/mob/living/simple_animal/hostile/construct/examine(mob/user)
. = ..()

Expand Down
5 changes: 0 additions & 5 deletions code/modules/mob/living/simple_animal/shade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
deathmessage = "lets out a contented sigh as their form unwinds."
var/holy = FALSE

/mob/living/simple_animal/shade/Destroy()
mind?.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE)
mind?.remove_antag_datum(/datum/antagonist/wizard/construct, silent_removal = TRUE)
return ..()

/mob/living/simple_animal/shade/attackby(obj/item/O, mob/user) //Marker -Agouri
if(istype(O, /obj/item/soulstone))
var/obj/item/soulstone/SS = O
Expand Down
1 change: 1 addition & 0 deletions code/modules/projectiles/ammunition/ammo_casings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
/obj/item/ammo_casing/shotgun/ion
name = "ion shell"
desc = "An advanced 12 gauge shell that fires a spread of ion bolts."
icon_state = "ionshell"
projectile_type = /obj/item/projectile/ion/weak
pellets = 4
variance = 35
Expand Down
Loading

0 comments on commit 0a97b13

Please sign in to comment.