Skip to content

Commit

Permalink
[MIRROR] adds prefrences to transhumanist (#1840)
Browse files Browse the repository at this point in the history
* adds preferences to transhumanist (#82435)

## About The Pull Request
You may remember this, that's because I accidentally deleted it before
while trying to change things. Anyways!
Adds drop-down selections and new options to transhumanist. also fixes a
minor typo
Previously, you could choose your replaced limb by taking prosthetic
limb, setting what you want changed, and then switching to
transhumanist, since they used the same preference previously.

## Why It's Good For The Game

Transhumanist felt strange because it was hypothetically a voluntary
operation, but the augmentation clinic just spun the wheel on what you
got replaced. From a role-playing perspective, being unable to choose is
uninteresting and confusing. Also it always says your limb being was
being replaced with a robotic arm and that annoyed me. Now that you are
able to select your replacement part, I've added two new options, the
robotic voice box, good for a more prominent change then a limb that
will be hidden for most of a round, and flashlight eyes, for when you
are truly committed to being rushed directly to robotics seeing the
bright future ahead of humanity!

## Changelog
:cl:
add: Transhumanist now allows you to select your augmentation
add: Transhumanist can now provide a robotic voice box, or flashlight
eyes
spellcheck: Transhumanist's roundstart text has been re-written to not
be wrong
/:cl:

---------

Co-authored-by: san7890 <[email protected]>

* adds prefrences to transhumanist

---------

Co-authored-by: Skeleton-In-Disguise <[email protected]>
Co-authored-by: san7890 <[email protected]>
  • Loading branch information
3 people authored and StealsThePRs committed Apr 7, 2024
1 parent 9f6e117 commit c51b119
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 16 deletions.
6 changes: 5 additions & 1 deletion code/_globalvars/lists/quirks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ GLOBAL_LIST_INIT(limb_choice, list(
"Right Leg" = /obj/item/bodypart/leg/right/robot/surplus,
))


///Transhumanist quirk
GLOBAL_LIST_INIT(limb_choice_transhuman, list(
GLOBAL_LIST_INIT(part_choice_transhuman, list(
"Left Arm" = /obj/item/bodypart/arm/left/robot,
"Right Arm" = /obj/item/bodypart/arm/right/robot,
"Left Leg" = /obj/item/bodypart/leg/left/robot,
"Right Leg" = /obj/item/bodypart/leg/right/robot,
"Robotic Voice Box" = /obj/item/organ/internal/tongue/robot,
"Flashlights for Eyes" = /obj/item/organ/internal/eyes/robotic/flashlight,
))

///Hemiplegic Quirk
GLOBAL_LIST_INIT(side_choice_hemiplegic, list(
"Left Side" = /datum/brain_trauma/severe/paralysis/hemiplegic/left,
Expand Down
63 changes: 48 additions & 15 deletions code/datums/quirks/neutral_quirks/transhumanist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/datum/quirk/transhumanist
name = "Transhumanist"
desc = "You see silicon life as the perfect lifeform and despise organic flesh. You are happier around silicons, but get frustrated when around organics. You seek to replace your fleshy limbs with their silicon counterparts. You start with a robotic limb."
desc = "You see silicon life as the perfect lifeform and despise organic flesh. You are happier around silicons, but get frustrated when around organics. You seek to replace your failing flesh with perfect silicon. You start with a robotic augmentation."
icon = FA_ICON_ROBOT
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_PROCESSES|QUIRK_MOODLET_BASED
value = 0
Expand All @@ -29,7 +29,8 @@
/obj/item/toy/figure/borg,
)
var/slot_string
var/obj/item/bodypart/old_limb
var/obj/item/old_part


/datum/quirk/transhumanist/add(client/client_source)
RegisterSignal(quirk_holder, COMSIG_CARBON_POST_ATTACH_LIMB, PROC_REF(calculate_bodypart_score))
Expand Down Expand Up @@ -100,27 +101,59 @@
if(-INFINITY to 0)
quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART, /datum/mood_event/very_organic)

/datum/quirk_constant_data/transhumanist
associated_typepath = /datum/quirk/transhumanist
customization_options = list(/datum/preference/choiced/trans_prosthetic)

/datum/quirk/transhumanist/add_unique(client/client_source)
var/limb_type = GLOB.limb_choice_transhuman[client_source?.prefs?.read_preference(/datum/preference/choiced/prosthetic)]
if(isnull(limb_type)) //Client gone or they chose a random prosthetic
limb_type = GLOB.limb_choice_transhuman[pick(GLOB.limb_choice_transhuman)]
var/part_type = GLOB.part_choice_transhuman[client_source?.prefs?.read_preference(/datum/preference/choiced/trans_prosthetic)]
if(isnull(part_type)) //Client gone or they chose a random part
part_type = GLOB.part_choice_transhuman[pick(GLOB.part_choice_transhuman)]

var/mob/living/carbon/human/human_holder = quirk_holder
var/obj/item/bodypart/new_part = new limb_type()

slot_string = "[new_part.plaintext_zone]"
old_limb = human_holder.return_and_replace_bodypart(new_part, special = TRUE)
var/obj/item/new_part = new part_type()
if(isbodypart(new_part))
var/obj/item/bodypart/new_bodypart = new_part
slot_string = new_bodypart.plaintext_zone
old_part = human_holder.return_and_replace_bodypart(new_bodypart, special = TRUE)
else if(isorgan(new_part))
var/obj/item/organ/new_organ = new_part
old_part = human_holder.get_organ_slot(new_organ.slot)
if(new_organ.Insert(human_holder, special = TRUE))
old_part.moveToNullspace()
STOP_PROCESSING(SSobj, old_part)
slot_string = new_organ.name

/datum/quirk/transhumanist/post_add()
if(slot_string)
to_chat(quirk_holder, span_boldannounce("Your [slot_string] has been replaced with a robot arm. You need to use a welding tool and cables to repair it, instead of sutures and regenerative meshes."))
if(!slot_string)
return
if(isbodypart(old_part))
to_chat(quirk_holder, span_boldannounce("Your [slot_string] has been replaced with a robotic limb. You need to use a welding tool and cables to repair it, instead of sutures and regenerative meshes."))
else if (old_part.name == "eyes")
to_chat(quirk_holder, span_boldannounce("You replaced your eyes with flashlights, not cameras. You can't see a thing!"))
else if (isorgan(old_part))
to_chat(quirk_holder, span_boldannounce("Your [slot_string] brings you one step closer to silicon perfection, but you feel you're not quite there yet."))

/datum/quirk/transhumanist/remove()
if(old_limb)
var/mob/living/carbon/human/human_holder = quirk_holder
human_holder.del_and_replace_bodypart(old_limb, special = TRUE)
old_limb = null
if(isnull(old_part))
quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART)
quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE)
return

var/mob/living/carbon/human/human_holder = quirk_holder
if(isbodypart(old_part))
var/obj/item/bodypart/old_bodypart = old_part
human_holder.del_and_replace_bodypart(old_bodypart, special = TRUE)
old_bodypart = null
else if(isorgan(old_part))
var/obj/item/organ/old_organ = old_part
old_part = human_holder.get_organ_slot(ORGAN_SLOT_TONGUE)
old_organ.Insert(quirk_holder, special = TRUE)
old_part.moveToNullspace()
STOP_PROCESSING(SSobj, old_part)
old_organ = null
old_part = null

quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART)
quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE)

Expand Down
17 changes: 17 additions & 0 deletions code/modules/client/preferences/trans_prosthetic.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/datum/preference/choiced/trans_prosthetic
category = PREFERENCE_CATEGORY_MANUALLY_RENDERED
savefile_key = "trans_prosthetic"
savefile_identifier = PREFERENCE_CHARACTER

/datum/preference/choiced/trans_prosthetic/init_possible_values()
return list("Random") + GLOB.part_choice_transhuman

/datum/preference/choiced/trans_prosthetic/is_accessible(datum/preferences/preferences)
. = ..()
if (!.)
return FALSE

return "Transhumanist" in preferences.all_quirks

/datum/preference/choiced/trans_prosthetic/apply_to_human(mob/living/carbon/human/target, value)
return
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3771,6 +3771,7 @@
#include "code\modules\client\preferences\statpanel.dm"
#include "code\modules\client\preferences\tgui.dm"
#include "code\modules\client\preferences\tooltips.dm"
#include "code\modules\client\preferences\trans_prosthetic.dm"
#include "code\modules\client\preferences\ui_style.dm"
#include "code\modules\client\preferences\underwear_color.dm"
#include "code\modules\client\preferences\uplink_location.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { FeatureChoiced, FeatureDropdownInput } from '../base';

export const trans_prosthetic: FeatureChoiced = {
name: 'Augment',
component: FeatureDropdownInput,
};

0 comments on commit c51b119

Please sign in to comment.