Synth refix (#29355)

* Revert "Novastation Synthetic Refactor Port (#29204)"

This reverts commit 2e1a819c4f.

* Refactor Synths away from /Robot/ limbs, Cybernetically augmented humanoids have alternative surgeries (#3970)

* [NO SELF SURGERY] Cybernetically augmented humanoids have alternative surgeries (both standard and advanced) [NO SELF SURGERY], as well as other misc additions

* 1

* p1

* Update limbs.dm

* oh yeah Taurs

* Limbs and Techwebs for them

* 3

* EMP

* Surgery Removals from Synths

* 5

* test

* Look Ma, no more surgery

* Update tgstation.dme

* Update hepatectomy.dm

* little bit more edit cleanup and diff reset

* Update surgery.dm

* Synth Organ Surgery!

* Update lungs.dm

* target

* 4

* Update synth_defines.dm

* you add the metal before the zap zap

* Apply suggestions from code review

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>

* 1

* Update code/modules/surgery/hepatectomy.dm

* Update code/modules/surgery/advanced/brainwashing.dm

---------

Co-authored-by: necromanceranne <40847847+necromanceranne@users.noreply.github.com>
Co-authored-by: Fluffles <piecopresident@gmail.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>

* some extra stuff

* Why me

* woops x2

* this is back

* cord stuff

* woops

* woopsx2

* bruh

* Some minor stuff that I'm adding to tg aswell

* This is good

* Makes this not pain

* Holy shit lacked a cleanup

* adds me to codeowners so no more synth changes escape my eye

* done

* eh heck it

---------

Co-authored-by: Zergspower <22140677+Zergspower@users.noreply.github.com>
Co-authored-by: necromanceranne <40847847+necromanceranne@users.noreply.github.com>
Co-authored-by: Fluffles <piecopresident@gmail.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
Waterpig
2024-08-18 02:58:45 +07:00
committed by GitHub
co-authored by Bloop necromanceranne Fluffles Zergspower
parent ec5f2f8297
commit 5d84083ada
22 changed files with 79 additions and 91 deletions
+5
View File
@@ -35,6 +35,11 @@
/modular_skyrat/modules/events/ @lessthnthree
/modular_skyrat/modules/ices_events/ @lessthnthree
# Waterpig
/code/modules/surgery @Majkl-J
/modular_skyrat/master_files/code/modules/surgery @Majkl-J
/modular_skyrat/modules/synths @Majkl-J
# Multiple Owners
# Maptainers
@@ -22,16 +22,14 @@
#define SYNTH_EMP_BRAIN_DAMAGE_MAXIMUM 75
// Universal stat defines
#define SYNTH_BAD_EFFECT_DURATION 20 SECONDS
#define SYNTH_HEART_DAMAGE_MESSAGE_INTERVAL 20 SECONDS
#define SYNTH_BRAIN_DAMAGE_MESSAGE_INTERVAL 20 SECONDS
#define SYNTH_DEAF_STACKS 30
// Charge level defines
#define SYNTH_CHARGE_MAX (STANDARD_CELL_CHARGE * 20) //Takes two high capacity cells to go from 0 to 100
#define SYNTH_CHARGE_MAX (STANDARD_CELL_CHARGE * 10) //Takes one high capacity cells to go from 0 to 100
#define SYNTH_JOULES_PER_NUTRITION (SYNTH_CHARGE_MAX / NUTRITION_LEVEL_FULL)
#define SYNTH_CHARGE_ALMOST_FULL (NUTRITION_LEVEL_ALMOST_FULL * SYNTH_JOULES_PER_NUTRITION)
#define SYNTH_CHARGE_RATE (STANDARD_CELL_RATE * 2.5)
#define SYNTH_CHARGE_RATE (STANDARD_CELL_RATE * 5)
#define SYNTH_APC_MINIMUM_PERCENT 20
/// Mechfab defines
-1
View File
@@ -77,7 +77,6 @@
repairs += servo.tier - 1
for(var/obj/item/stock_parts/power_store/cell in component_parts)
recharge_speed *= cell.maxcharge
recharge_speed *= 4 //SKYRAT EDIT ADDITION
/obj/machinery/recharge_station/examine(mob/user)
. = ..()
+5 -10
View File
@@ -1,15 +1,10 @@
/obj/item/disk/surgery/brainwashing
name = "Surgery Disk" // SKYRAT EDIT CHANGE - ORIGINAL: name = "Brainwashing Surgery Disk" - Finally I can upload the funny surgery disk without letting everyone in the room know about it!
desc = "The disk provides instructions on some kind of surgery, but the label has been scratched off..." //SKYRAT EDIT: Moved to Special Desc.
surgeries = list(
/datum/surgery/advanced/brainwashing,
/datum/surgery/advanced/brainwashing/mechanic,
)
// SKYRAT EDIT ADDITION START - Job specific descriptions
special_desc_requirement = EXAMINE_CHECK_JOB
special_desc_jobs = list("Medical Doctor, Chief Medical Officer, Roboticist")
name = "Surgery Disk" //SKYRAT EDIT: Formerly "Brainwashing Surgery Disk" //Finally I can upload the funny surgery disk without letting everyone in the room know about it!
desc = "The disk provides instructions on some kind of surgery, but the label has been scratched off..." //Skyrat edit: Moved to Special Desc.
surgeries = list(/datum/surgery/advanced/brainwashing)
special_desc_requirement = EXAMINE_CHECK_JOB // SKYRAT EDIT
special_desc_jobs = list("Medical Doctor, Chief Medical Officer, Roboticist") // SKYRAT EDIT CHANGE //You mean to tell me the roles that get this role-exclusive item know what it does?
special_desc = "The disk provides instructions on how to impress an order on a brain, making it the primary objective of the patient."
// SKYRAT EDIT ADDITION END
/datum/surgery/advanced/brainwashing
name = "Brainwashing"
+7 -7
View File
@@ -18,13 +18,6 @@
)
removes_target_bodypart = TRUE // SKYRAT EDIT ADDITION - Surgically unremovable limbs
/datum/surgery/amputation/peg
name = "Detach"
requires_bodypart_type = BODYTYPE_PEG
steps = list(
/datum/surgery_step/sever_limb/peg, //Easy come, easy go
)
/datum/surgery/amputation/mechanic
name = "Disassemble"
requires_bodypart_type = BODYTYPE_ROBOTIC
@@ -34,6 +27,13 @@
/datum/surgery_step/sever_limb/mechanic, //The benefit of being robotic; people can pull you apart in an instant! Wait, that's not a benefit...
)
/datum/surgery/amputation/peg
name = "Detach"
requires_bodypart_type = BODYTYPE_PEG
steps = list(
/datum/surgery_step/sever_limb/peg, //Easy come, easy go
)
/datum/surgery/amputation/can_start(mob/user, mob/living/patient)
if(HAS_TRAIT(patient, TRAIT_NODISMEMBER))
return FALSE
@@ -24,7 +24,7 @@
//HIDDEN CHECKS END
if(owner)
if(!hair_hidden && !owner.get_organ_slot(ORGAN_SLOT_BRAIN) && !HAS_TRAIT(owner, TRAIT_NO_DEBRAIN_OVERLAY) && !istype(src, /obj/item/bodypart/head/synth)) // SKYRAT EDIT CHANGE - ORIGINAL: if(!hair_hidden && !owner.get_organ_slot(ORGAN_SLOT_BRAIN) && !HAS_TRAIT(owner, TRAIT_NO_DEBRAIN_OVERLAY))
if(!hair_hidden && !owner.get_organ_slot(ORGAN_SLOT_BRAIN) && !HAS_TRAIT(owner, TRAIT_NO_DEBRAIN_OVERLAY))
show_debrained = TRUE
else
show_debrained = FALSE
@@ -34,7 +34,7 @@
else
show_eyeless = FALSE
else
if(!hair_hidden && !(locate(/obj/item/organ/internal/brain) in src) && !istype(src, /obj/item/bodypart/head/synth)) // SKYRAT EDIT CHANGE - ORIGINAL: if(!hair_hidden && !(locate(/obj/item/organ/internal/brain) in src))
if(!hair_hidden && !(locate(/obj/item/organ/internal/brain) in src))
show_debrained = TRUE
else
show_debrained = FALSE
+1 -1
View File
@@ -73,7 +73,7 @@
var/obj/item/organ/internal/stomach/target_stomach = target.get_organ_slot(ORGAN_SLOT_STOMACH)
target_human.setOrganLoss(ORGAN_SLOT_STOMACH, 20) // Stomachs have a threshold for being able to even digest food, so I might tweak this number
if(target_stomach)
target_stomach.operated = TRUE // SKYRAT EDIT CHANGE - Not for slimepeople - indents for else block
target_stomach.operated = TRUE
if(target_stomach.organ_flags & ORGAN_EMP) //If our organ is failing due to an EMP, fix that
target_stomach.organ_flags &= ~ORGAN_EMP
display_results(
+1 -1
View File
@@ -72,7 +72,7 @@
var/obj/item/organ/internal/liver/target_liver = target.get_organ_slot(ORGAN_SLOT_LIVER)
human_target.setOrganLoss(ORGAN_SLOT_LIVER, 10) //not bad, not great
if(target_liver)
target_liver.operated = TRUE // SKYRAT EDIT CHANGE - Not for slimepeople - Indents for else block
target_liver.operated = TRUE
if(target_liver.organ_flags & ORGAN_EMP) //If our organ is failing due to an EMP, fix that
target_liver.organ_flags &= ~ORGAN_EMP
display_results(
+1 -8
View File
@@ -68,15 +68,8 @@
if(ishuman(target))
var/mob/living/carbon/human/human_target = target
var/obj/item/organ/internal/lungs/target_lungs = human_target.get_organ_slot(ORGAN_SLOT_LUNGS)
target_lungs.operated = TRUE
human_target.setOrganLoss(ORGAN_SLOT_LUNGS, 60)
if(target_lungs)
//SKYRAT EDIT ADDITION BEGIN - This is so that you can do organ surgeries multiple times on slimepeople.
if(istype(target_lungs, /obj/item/organ/internal/lungs/slime))
addtimer(VARSET_CALLBACK(target_lungs, operated, FALSE), 30 SECONDS)
//SKYRAT EDIT ADDITION END
target_lungs.operated = TRUE
if(target_lungs.organ_flags & ORGAN_EMP) //If our organ is failing due to an EMP, fix that
target_lungs.organ_flags &= ~ORGAN_EMP
display_results(
user,
target,
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

@@ -21,11 +21,7 @@
can_be_surgically_removed = FALSE
bodyshape = parent_type::bodyshape | BODYSHAPE_TAUR
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT)
/obj/item/bodypart/leg/right/synth/taur/generate_icon_key()
RETURN_TYPE(/list)
// We don't want more than one icon for all of the taur legs, because they're going to be invisible.
return list("taur")
show_icon = FALSE
/obj/item/bodypart/leg/left/synth/taur
icon_greyscale = BODYPART_ICON_TAUR
@@ -34,8 +30,4 @@
can_be_surgically_removed = FALSE
bodyshape = parent_type::bodyshape | BODYSHAPE_TAUR
damage_examines = list(BRUTE = ROBOTIC_BRUTE_EXAMINE_TEXT, BURN = ROBOTIC_BURN_EXAMINE_TEXT)
/obj/item/bodypart/leg/left/Synth/taur/generate_icon_key()
RETURN_TYPE(/list)
// We don't want more than one icon for all of the taur legs, because they're going to be invisible.
return list("taur")
show_icon = FALSE
@@ -6,8 +6,8 @@
anchored = TRUE
density = FALSE
circuit = null
heating_energy = parent_type::heating_energy * 2
efficiency = parent_type::efficiency * 2
heating_energy = STANDARD_CELL_RATE * 0.2
efficiency = 30
display_panel = TRUE
cell = null
/// What this repacks into when its wrenched off a wall
@@ -24,8 +24,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/space_heater/wall_mounted, 29)
/obj/machinery/space_heater/wall_mounted/RefreshParts()
. = ..()
heating_energy = src::heating_energy
efficiency = src::efficiency
heating_energy = STANDARD_CELL_RATE * 0.2
efficiency = 30
/obj/machinery/space_heater/wall_mounted/default_deconstruction_crowbar()
return
@@ -1,7 +1,7 @@
/obj/item/organ/internal/brain/synth
name = "compact positronic brain"
slot = ORGAN_SLOT_BRAIN
zone = BODY_ZONE_HEAD
zone = BODY_ZONE_CHEST
organ_flags = ORGAN_ROBOTIC
maxHealth = 2 * STANDARD_ORGAN_THRESHOLD
desc = "A cube of shining metal, four inches to a side and covered in shallow grooves. It has an IPC serial number engraved on the top. It is usually slotted into the chest of synthetic crewmembers."
@@ -98,7 +98,7 @@ Various overrides necessary to get the persocom working, namely ui status, power
var/obj/item/organ/internal/brain/synth/brain_loc = loc
// Battery level is now according to the synth charge
if(istype(brain_loc))
var/charge_level = (brain_loc.owner.nutrition / NUTRITION_LEVEL_FULL) * 100
var/charge_level = (brain_loc.owner.nutrition / NUTRITION_LEVEL_ALMOST_FULL) * 100
switch(charge_level)
if(80 to 110)
data["PC_batteryicon"] = "batt_100.gif"
@@ -149,26 +149,6 @@
TRAIT_RESISTHIGHPRESSURE,
))
/// Add: Slowdown, Confusion - Think Watchers Gaze flash
/obj/item/bodypart/chest/synth/emp_effect(severity, protection)
. = ..()
if(!. || isnull(owner))
return
switch(severity)
if(EMP_HEAVY)
owner.set_jitter_if_lower(SYNTH_BAD_EFFECT_DURATION * SYNTH_HEAVY_EMP_MULTIPLIER)
owner.set_dizzy_if_lower(SYNTH_BAD_EFFECT_DURATION * SYNTH_HEAVY_EMP_MULTIPLIER)
owner.set_derpspeech_if_lower(SYNTH_BAD_EFFECT_DURATION * SYNTH_HEAVY_EMP_MULTIPLIER)
owner.set_confusion_if_lower(SYNTH_BAD_EFFECT_DURATION * 0.5)
if(EMP_LIGHT)
owner.set_jitter_if_lower(SYNTH_BAD_EFFECT_DURATION)
owner.set_dizzy_if_lower(SYNTH_BAD_EFFECT_DURATION)
owner.set_derpspeech_if_lower(SYNTH_BAD_EFFECT_DURATION)
owner.set_confusion_if_lower(SYNTH_BAD_EFFECT_DURATION * 0.25)
/obj/item/bodypart/arm/left/synth
name = "android left arm"
desc = "A custom limb designed for androids, customizable to a degree your wallet agrees with."
@@ -45,7 +45,7 @@
to_chat(user, span_warning("You plug into [target], but nothing happens! It seems you don't have an internal cell to charge."))
return
if(nutrition_level_joules > SYNTH_CHARGE_ALMOST_FULL)
if(nutrition_level_joules >= SYNTH_CHARGE_ALMOST_FULL)
user.balloon_alert(user, "cell fully charged!")
return
@@ -71,6 +71,8 @@
* * user - The human mob draining the power cell.
*/
/obj/item/synth_powercord/proc/do_power_draw(obj/target, mob/living/carbon/human/user)
/// The current user's nutrition level in joules.
var/nutrition_level_joules = user.nutrition * SYNTH_JOULES_PER_NUTRITION
// Draw power from an APC if one was given.
var/obj/machinery/power/apc/target_apc
if(istype(target, /obj/machinery/power/apc))
@@ -83,9 +85,16 @@
user.balloon_alert(user, "APC charge low!")
return
var/wait = SSmachines.wait / (1 SECONDS)
var/energy_needed
while(TRUE)
// Check if the user is nearly fully charged.
// Ensures minimum draw is always lower than this margin.
nutrition_level_joules = user.nutrition * SYNTH_JOULES_PER_NUTRITION
energy_needed = SYNTH_CHARGE_MAX - nutrition_level_joules
if(energy_needed < (SYNTH_CHARGE_MAX - SYNTH_CHARGE_ALMOST_FULL))
user.balloon_alert(user, "cell fully charged!")
break
// Check if the charge level of the cell is below the minimum.
// Prevents synths from overloading the cell.
if(target_cell.percent() < minimum_cell_charge)
@@ -93,30 +102,26 @@
break
// Attempt to drain charge from the cell.
if(!do_after(user, wait SECONDS, target))
if(!do_after(user, SSmachines.wait, target))
break
// Check if the user is nearly fully charged.
// Ensures minimum draw is always lower than this margin.
var/nutrition_level_joules = user.nutrition * SYNTH_JOULES_PER_NUTRITION
energy_needed = SYNTH_CHARGE_MAX - nutrition_level_joules
// Calculate how much to draw from the cell this cycle.
var/current_draw = min(energy_needed, SYNTH_CHARGE_RATE * wait)
var/current_draw = min(energy_needed, SYNTH_CHARGE_RATE * SSmachines.wait)
var/energy_delivered = target_cell.use(current_draw, force = TRUE)
target_cell.update_appearance()
var/energy_delivered = target_cell.use(current_draw)
if(!energy_delivered)
// The cell could be sabotaged, which causes it to explode and qdelete.
if(QDELETED(target_cell))
return
user.balloon_alert(user, "[target_apc ? "APC" : "Cell"] empty!")
user.balloon_alert(user, "APC failure!")
break
// If charging was successful, then increase user nutrition and emit sparks.
var/nutrition_gained = energy_delivered / SYNTH_JOULES_PER_NUTRITION
user.nutrition = min(user.nutrition + nutrition_gained, NUTRITION_LEVEL_FULL)
var/nutrition_gained = (energy_delivered / SYNTH_JOULES_PER_NUTRITION) / SSmachines.wait
user.nutrition += nutrition_gained
do_sparks(1, FALSE, target_cell.loc)
if(user.nutrition > NUTRITION_LEVEL_ALMOST_FULL)
user.balloon_alert(user, "fully charged")
break
// Start APC recharging if power was used and the APC has power available.
if(target_apc && !QDELETED(target_apc) && !QDELETED(target_apc.cell) && target_apc.main_status > APC_NO_POWER)
target_apc.charging = APC_CHARGING
target_apc.update_appearance()
@@ -68,3 +68,9 @@
dummy_cell.charge = owner.nutrition * SYNTH_JOULES_PER_NUTRITION
charge_cell.Invoke(dummy_cell, seconds_per_tick)
owner.nutrition = min(dummy_cell.charge() / SYNTH_JOULES_PER_NUTRITION, NUTRITION_LEVEL_FULL)
QDEL_NULL(dummy_cell)
#undef SYNTH_CHARGE_MAX
#undef SYNTH_JOULES_PER_NUTRITION
#undef SYNTH_CHARGE_RATE
#undef SYNTH_APC_MINIMUM_PERCENT
@@ -4,11 +4,11 @@
/datum/surgery/positronic_restoration
name = "Posibrain Reboot (Revival)"
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/open_hatch,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/pry_off_plating/fullbody,
/datum/surgery_step/weld_plating/fullbody,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/add_plating/fullbody,
/datum/surgery_step/weld_plating/fullbody,
/datum/surgery_step/finalize_positronic_restoration,
/datum/surgery_step/mechanic_close,
)
@@ -16,7 +16,7 @@
possible_locs = list(BODY_ZONE_CHEST)
replaced_by = /datum/surgery
requires_bodypart_type = BODYTYPE_ROBOTIC
surgery_flags = SURGERY_IGNORE_CLOTHES | SURGERY_REQUIRE_RESTING | SURGERY_REQUIRE_LIMB
surgery_flags = SURGERY_IGNORE_CLOTHES | SURGERY_REQUIRE_RESTING | SURGERY_REQUIRE_LIMB | SURGERY_SELF_OPERABLE
/// The step to use in the 4th surgery step.
var/healing_step_type
@@ -0,0 +1,14 @@
/datum/surgery/amputation/mechanic
name = "Disconnect limb"
/datum/surgery/autopsy/mechanic
name = "System Failure Analysis (Autopsy)"
/datum/surgery/organ_manipulation/mechanic
name = "Hardware Manipulation (Organ Manipulation)"
/datum/surgery/organ_manipulation/mechanic/external
name = "Chassis Manipulation (External Manipulation)"
+1
View File
@@ -8430,6 +8430,7 @@
#include "modular_skyrat\modules\synths\code\surgery\robot_liver_surgery.dm"
#include "modular_skyrat\modules\synths\code\surgery\robot_lung_surgery.dm"
#include "modular_skyrat\modules\synths\code\surgery\robot_stomach_surgery.dm"
#include "modular_skyrat\modules\synths\code\surgery\robot_surgery_rename.dm"
#include "modular_skyrat\modules\synths\code\surgery\surgery.dm"
#include "modular_skyrat\modules\tableflip\code\flipped_table.dm"
#include "modular_skyrat\modules\tagline\code\world.dm"