diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm index 07e93bebcf3..47f5b748599 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_silicon.dm @@ -3,8 +3,6 @@ ///sent from borg mobs to itself, for tools to catch an upcoming destroy() due to safe decon (rather than detonation) #define COMSIG_BORG_SAFE_DECONSTRUCT "borg_safe_decon" ///called from /obj/item/borg/cyborghug/attack proc -#define COMSIG_BORG_TOUCH_MOB "borg_touch_mob" -///called from /obj/item/borg/cyborghug/attack proc #define COMSIG_BORG_HUG_MOB "borg_hug_mob" ///returned if this action was handled by signal handler. #define COMSIG_BORG_HUG_HANDLED 1 diff --git a/code/_globalvars/lists/quirks.dm b/code/_globalvars/lists/quirks.dm index 30fce3e295b..1af746a0215 100644 --- a/code/_globalvars/lists/quirks.dm +++ b/code/_globalvars/lists/quirks.dm @@ -17,3 +17,10 @@ GLOBAL_LIST_INIT(limb_choice, list( "Left Leg" = /obj/item/bodypart/leg/left/robot/surplus, "Right Leg" = /obj/item/bodypart/leg/right/robot/surplus, )) + +GLOBAL_LIST_INIT(limb_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, +)) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index 59ef8e952b2..7facefdfe37 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -12,7 +12,7 @@ GLOBAL_LIST_INIT_TYPED(quirk_blacklist, /list/datum/quirk, list( list(/datum/quirk/item_quirk/clown_enjoyer, /datum/quirk/item_quirk/mime_fan, /datum/quirk/item_quirk/pride_pin), list(/datum/quirk/bad_touch, /datum/quirk/friendly), list(/datum/quirk/extrovert, /datum/quirk/introvert), - list(/datum/quirk/prosthetic_limb, /datum/quirk/quadruple_amputee, /datum/quirk/body_purist), + list(/datum/quirk/prosthetic_limb, /datum/quirk/quadruple_amputee, /datum/quirk/transhumanist, /datum/quirk/body_purist), list(/datum/quirk/prosthetic_organ, /datum/quirk/tin_man, /datum/quirk/body_purist), list(/datum/quirk/quadruple_amputee, /datum/quirk/paraplegic, /datum/quirk/hemiplegic), list(/datum/quirk/quadruple_amputee, /datum/quirk/frail), diff --git a/code/datums/mood_events/needs_events.dm b/code/datums/mood_events/needs_events.dm index ceee687918e..dd710554d8d 100644 --- a/code/datums/mood_events/needs_events.dm +++ b/code/datums/mood_events/needs_events.dm @@ -76,3 +76,47 @@ description = "There's nothing like the feeling of a freshly laundered jumpsuit." mood_change = 2 timeout = 10 MINUTES + +/datum/mood_event/surrounded_by_silicon + description = "I'm surrounded by perfect lifeforms!!" + mood_change = 8 + +/datum/mood_event/around_many_silicon + description = "So many silicon lifeforms near me!" + mood_change = 4 + +/datum/mood_event/around_silicon + description = "The silicon lifeforms near me are absolutely perfect." + mood_change = 2 + +/datum/mood_event/around_organic + description = "The organics near me remind me of the inferiority of flesh." + mood_change = -2 + +/datum/mood_event/around_many_organic + description = "So many disgusting organics!" + mood_change = -4 + +/datum/mood_event/surrounded_by_organic + description = "I'm surrounded by disgusting organics!!" + mood_change = -8 + +/datum/mood_event/completely_robotic + description = "I've abandoned my feeble flesh, my form is perfect!!" + mood_change = 8 + +/datum/mood_event/very_robotic + description = "I'm more robot than organic!" + mood_change = 4 + +/datum/mood_event/balanced_robotic + description = "I'm part machine, part organic." + mood_change = 0 + +/datum/mood_event/very_organic + description = "I hate this feeble and weak flesh!" + mood_change = -4 + +/datum/mood_event/completely_organic + description = "I'm completely organic, this is miserable!!" + mood_change = -8 diff --git a/code/datums/quirks/neutral_quirks/transhumanist.dm b/code/datums/quirks/neutral_quirks/transhumanist.dm new file mode 100644 index 00000000000..b2cf60143a2 --- /dev/null +++ b/code/datums/quirks/neutral_quirks/transhumanist.dm @@ -0,0 +1,174 @@ +#define MOOD_CATEGORY_TRANSHUMANIST_PEOPLE "transhumanist_people" +#define MOOD_CATEGORY_TRANSHUMANIST_BODYPART "transhumanist_bodypart" +// The number of silicons minus the number of organics determines the level +#define TRANSHUMANIST_LEVEL_ECSTATIC 4 +#define TRANSHUMANIST_LEVEL_HAPPY 1 +#define TRANSHUMANIST_LEVEL_NEUTRAL 0 +#define TRANSHUMANIST_LEVEL_UNHAPPY -2 +#define TRANSHUMANIST_LEVEL_ANGRY -5 + +#define BODYPART_SCORE_ORGANIC 1 +#define BODYPART_SCORE_SILICON 2 +#define BODYPART_SCORE_OTHER_BODYTYPES 3 +#define BODYPART_SCORE_OVERALL 4 + + +/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." + icon = FA_ICON_ROBOT + quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_PROCESSES|QUIRK_MOODLET_BASED + value = 0 + gain_text = span_notice("You have a desire to ditch your feeble organic flesh and surround yourself with robots.") + lose_text = span_danger("Robots don't seem all that great anymore.") + medical_record_text = "Patient reports hating pathetic creatures of meat and bone." + mail_goodies = list( + /obj/item/stock_parts/cell/potato, + /obj/item/stack/cable_coil, + /obj/item/toy/talking/ai, + /obj/item/toy/figure/borg, + ) + var/slot_string + var/obj/item/bodypart/old_limb + +/datum/quirk/transhumanist/add(client/client_source) + RegisterSignal(quirk_holder, COMSIG_CARBON_POST_ATTACH_LIMB, PROC_REF(calculate_bodypart_score)) + RegisterSignal(quirk_holder, COMSIG_CARBON_POST_REMOVE_LIMB, PROC_REF(calculate_bodypart_score)) + RegisterSignal(quirk_holder, COMSIG_CARBON_GAIN_ORGAN, PROC_REF(calculate_bodypart_score)) + RegisterSignal(quirk_holder, COMSIG_CARBON_LOSE_ORGAN, PROC_REF(calculate_bodypart_score)) + calculate_bodypart_score() + +/datum/quirk/transhumanist/remove() + UnregisterSignal(quirk_holder, list(COMSIG_CARBON_REMOVE_LIMB, COMSIG_CARBON_ATTACH_LIMB)) + +/datum/quirk/transhumanist/proc/get_bodypart_score(mob/living/carbon/target, limbs_only = FALSE) + var/organic_bodytypes = 0 + var/silicon_bodytypes = 0 + var/other_bodytypes = FALSE + for(var/obj/item/bodypart/part as anything in target.bodyparts) + if(part.bodytype & BODYTYPE_ROBOTIC) + silicon_bodytypes += 1 + else if(part.bodytype & BODYTYPE_ORGANIC) + organic_bodytypes += 0.1 + else + other_bodytypes = TRUE + + if(!limbs_only) + for(var/obj/item/organ/organ as anything in target.organs) + if(organ.organ_flags & ORGAN_ROBOTIC) + silicon_bodytypes += 0.25 + else if(organ.organ_flags & ORGAN_ORGANIC) + organic_bodytypes += 0.02 + + return list( + BODYPART_SCORE_ORGANIC = organic_bodytypes, + BODYPART_SCORE_SILICON = silicon_bodytypes, + BODYPART_SCORE_OTHER_BODYTYPES = other_bodytypes, + BODYPART_SCORE_OVERALL = silicon_bodytypes - organic_bodytypes + ) + + +/datum/quirk/transhumanist/proc/calculate_bodypart_score() + SIGNAL_HANDLER + var/list/score = get_bodypart_score(quirk_holder) + var/organic_bodytypes = score[BODYPART_SCORE_ORGANIC] + var/silicon_bodytypes = score[BODYPART_SCORE_SILICON] + var/other_bodytypes = score[BODYPART_SCORE_OTHER_BODYTYPES] + + if(!other_bodytypes) + if(organic_bodytypes <= 0.02) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART, /datum/mood_event/completely_robotic) + return + else if(silicon_bodytypes == 0) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART, /datum/mood_event/completely_organic) + return + else if(silicon_bodytypes == 0 && organic_bodytypes == 0) + quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART) + return + + var/bodypart_score = score[BODYPART_SCORE_OVERALL] + switch(bodypart_score) + if(3 to INFINITY) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART, /datum/mood_event/very_robotic) + if(0 to 3) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART, /datum/mood_event/balanced_robotic) + if(-INFINITY to 0) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART, /datum/mood_event/very_organic) + + +/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/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) + +/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.")) + +/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 + quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_BODYPART) + quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE) + +/datum/quirk/transhumanist/process(seconds_per_tick) + var/organics_nearby = 0 + var/silicons_nearby = 0 + + // Only cares about things that are nearby + var/list/mobs = get_hearers_in_LOS(3, quirk_holder) + + for(var/mob/living/target in mobs) + if(!isturf(target.loc) || target == quirk_holder || target.alpha <= 128 || target.invisibility > quirk_holder.see_invisible) + continue + + if(target.mob_biotypes & MOB_ORGANIC) + var/list/score = get_bodypart_score(target, limbs_only = TRUE) + // For an average human, they'll need 2 augmented limbs to not get counted as an organic nor a silicon. + // If some monstrosity has 20-30 organic limbs, they'll likely need more. + if(score[BODYPART_SCORE_OVERALL] < 1) + organics_nearby += 1 + else if(score[BODYPART_SCORE_ORGANIC] == 0) + silicons_nearby += 1 + else if(target.mob_biotypes & MOB_ROBOTIC) + // Dead silicons don't count, they're basically just machinery + if(target.stat != DEAD) + silicons_nearby += 1 + + var/mood_result = silicons_nearby - organics_nearby + + switch(mood_result) + if(TRANSHUMANIST_LEVEL_ECSTATIC to INFINITY) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE, /datum/mood_event/surrounded_by_silicon) + if(TRANSHUMANIST_LEVEL_HAPPY to TRANSHUMANIST_LEVEL_ECSTATIC) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE, /datum/mood_event/around_many_silicon) + if(TRANSHUMANIST_LEVEL_NEUTRAL + 0.01 to TRANSHUMANIST_LEVEL_HAPPY) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE, /datum/mood_event/around_silicon) + if(TRANSHUMANIST_LEVEL_NEUTRAL) + quirk_holder.clear_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE) + if(TRANSHUMANIST_LEVEL_UNHAPPY to TRANSHUMANIST_LEVEL_NEUTRAL - 0.01) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE, /datum/mood_event/around_organic) + if(TRANSHUMANIST_LEVEL_ANGRY to TRANSHUMANIST_LEVEL_UNHAPPY) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE, /datum/mood_event/around_many_organic) + if(-INFINITY to TRANSHUMANIST_LEVEL_ANGRY) + quirk_holder.add_mood_event(MOOD_CATEGORY_TRANSHUMANIST_PEOPLE, /datum/mood_event/surrounded_by_organic) + +#undef MOOD_CATEGORY_TRANSHUMANIST_PEOPLE +#undef MOOD_CATEGORY_TRANSHUMANIST_BODYPART +#undef TRANSHUMANIST_LEVEL_ECSTATIC +#undef TRANSHUMANIST_LEVEL_HAPPY +#undef TRANSHUMANIST_LEVEL_NEUTRAL +#undef TRANSHUMANIST_LEVEL_UNHAPPY +#undef TRANSHUMANIST_LEVEL_ANGRY +#undef BODYPART_SCORE_ORGANIC +#undef BODYPART_SCORE_SILICON +#undef BODYPART_SCORE_OTHER_BODYTYPES +#undef BODYPART_SCORE_OVERALL diff --git a/code/datums/quirks/positive_quirks/cyborg_lover.dm b/code/datums/quirks/positive_quirks/cyborg_lover.dm deleted file mode 100644 index 8c75ab143b6..00000000000 --- a/code/datums/quirks/positive_quirks/cyborg_lover.dm +++ /dev/null @@ -1,45 +0,0 @@ -/datum/quirk/cyborg_lover - name = "Cyborg Lover" - desc = "You find silicon life forms fascinating! You like inspecting and touching their hulls and robo-bodies, as well you like being touched by their manipulators." - icon = FA_ICON_ROBOT - value = 2 - gain_text = span_notice("You are fascinated by silicon life forms.") - lose_text = span_danger("Cyborgs and other silicons aren't cool anymore.") - medical_record_text = "Patient reports being fascinated by silicon life forms." - mail_goodies = list( - /obj/item/stock_parts/cell/potato, - /obj/item/stack/cable_coil, - /obj/item/toy/talking/ai, - /obj/item/toy/figure/borg, - ) - -/datum/quirk/cyborg_lover/add(client/client_source) - var/datum/atom_hud/fan = GLOB.huds[DATA_HUD_FAN] - fan.show_to(quirk_holder) - -/datum/quirk/cyborg_lover/add_to_holder(mob/living/new_holder, quirk_transfer, client/client_source) - . = ..() - RegisterSignal(new_holder, COMSIG_MOB_PAT_BORG, PROC_REF(pat_cyborg), override = TRUE) - RegisterSignal(new_holder, COMSIG_BORG_TOUCH_MOB, PROC_REF(touched_by_cyborg), override = TRUE) - RegisterSignal(new_holder, COMSIG_BORG_HUG_MOB, PROC_REF(hugged_by_cyborg), override = TRUE) - -/datum/quirk/cyborg_lover/remove_from_current_holder(quirk_transfer) - UnregisterSignal(quirk_holder, list(COMSIG_MOB_PAT_BORG, COMSIG_BORG_TOUCH_MOB, COMSIG_BORG_HUG_MOB)) - return ..() - -/datum/quirk/cyborg_lover/proc/pat_cyborg() - SIGNAL_HANDLER - quirk_holder.add_mood_event("pat_borg", /datum/mood_event/pat_borg) - -/datum/quirk/cyborg_lover/proc/touched_by_cyborg() - SIGNAL_HANDLER - quirk_holder.add_mood_event("borg_touch", /datum/mood_event/borg_touch) - -/datum/quirk/cyborg_lover/proc/hugged_by_cyborg(borghugitem, mob/living/silicon/robot/hugger) - SIGNAL_HANDLER - hugger.visible_message( - span_notice("[hugger] hugs [quirk_holder] in a firm bear-hug! [quirk_holder] looks satisfied!"), - span_notice("You hug [quirk_holder] firmly to make [quirk_holder.p_them()] feel better! [quirk_holder] looks satisfied!"), - ) - quirk_holder.add_mood_event("borg_hug", /datum/mood_event/borg_hug) - return COMSIG_BORG_HUG_HANDLED diff --git a/code/game/objects/items/robot/items/generic.dm b/code/game/objects/items/robot/items/generic.dm index ee3583d5ee6..7ebd87408f6 100644 --- a/code/game/objects/items/robot/items/generic.dm +++ b/code/game/objects/items/robot/items/generic.dm @@ -9,21 +9,6 @@ #define HARM_ALARM_NO_SAFETY_COOLDOWN (60 SECONDS) #define HARM_ALARM_SAFETY_COOLDOWN (20 SECONDS) -/datum/mood_event/borg_touch - description = "Being touched by those manipulators is nice." - mood_change = 2 - timeout = 2 MINUTES - -/datum/mood_event/borg_hug - description = "Those robo-hugs were really nice!" - mood_change = 4 - timeout = 3 MINUTES - -/datum/mood_event/pat_borg - description = "There is something really special about touching my robotic friends!" - mood_change = 4 - timeout = 1 MINUTES - /obj/item/borg icon = 'icons/mob/silicon/robot_items.dmi' @@ -126,12 +111,11 @@ span_notice("You playfully boop [attacked_mob] on the head!"), ) user.do_attack_animation(attacked_mob, ATTACK_EFFECT_BOOP) - SEND_SIGNAL(attacked_mob, COMSIG_BORG_TOUCH_MOB) playsound(loc, 'sound/weapons/tap.ogg', 50, TRUE, -1) else if(ishuman(attacked_mob)) if(user.body_position == LYING_DOWN) user.visible_message( - span_notice("[user] shakes [attacked_mob] trying to get [attacked_mob.p_them()] up!"), + span_notice("[user] shakes [attacked_mob] trying to get [attacked_mob.p_them()] up!"), span_notice("You shake [attacked_mob] trying to get [attacked_mob.p_them()] up!"), ) else @@ -139,7 +123,6 @@ span_notice("[user] hugs [attacked_mob] to make [attacked_mob.p_them()] feel better!"), span_notice("You hug [attacked_mob] to make [attacked_mob.p_them()] feel better!"), ) - SEND_SIGNAL(attacked_mob, COMSIG_BORG_TOUCH_MOB) if(attacked_mob.resting) attacked_mob.set_resting(FALSE, TRUE) else @@ -160,7 +143,6 @@ user.visible_message(span_warning("[user] bops [attacked_mob] on the head!"), span_warning("You bop [attacked_mob] on the head!"), ) - SEND_SIGNAL(attacked_mob, COMSIG_BORG_TOUCH_MOB) user.do_attack_animation(attacked_mob, ATTACK_EFFECT_PUNCH) else if(!(SEND_SIGNAL(attacked_mob, COMSIG_BORG_HUG_MOB, user) & COMSIG_BORG_HUG_HANDLED)) diff --git a/tgstation.dme b/tgstation.dme index 79d741afc77..9065b3f5208 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1672,12 +1672,12 @@ #include "code\datums\quirks\neutral_quirks\pride_pin.dm" #include "code\datums\quirks\neutral_quirks\shifty_eyes.dm" #include "code\datums\quirks\neutral_quirks\snob.dm" +#include "code\datums\quirks\neutral_quirks\transhumanist.dm" #include "code\datums\quirks\neutral_quirks\vegetarian.dm" #include "code\datums\quirks\positive_quirks\alcohol_tolerance.dm" #include "code\datums\quirks\positive_quirks\apathetic.dm" #include "code\datums\quirks\positive_quirks\bilingual.dm" #include "code\datums\quirks\positive_quirks\clown_enjoyer.dm" -#include "code\datums\quirks\positive_quirks\cyborg_lover.dm" #include "code\datums\quirks\positive_quirks\drunk_healing.dm" #include "code\datums\quirks\positive_quirks\empath.dm" #include "code\datums\quirks\positive_quirks\freerunning.dm"