From c505066935307a71ac57659d97b6e286cde3fa94 Mon Sep 17 00:00:00 2001 From: Thlumyn <102194057+Thlumyn@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:54:29 -0700 Subject: [PATCH] Bring Your Pet to Work Day (Veteran Quirk) (#25142) * add pet owner quirk * add mini pet carrier * alphabetize and fix carrier * fix parrot typepath * remove rare/dangerous animals * Fixing this merge conflict for you merry thanksgiving --------- Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com> --- .../~skyrat_defines/traits/declarations.dm | 2 + code/_globalvars/traits/_traits.dm | 1 + code/_globalvars/traits/admin_tooling.dm | 1 + modular_skyrat/modules/pet_owner/pet_owner.dm | 95 +++++++++++++++++++ tgstation.dme | 1 + .../skyrat/pet_owner.tsx | 6 ++ 6 files changed, 106 insertions(+) create mode 100644 modular_skyrat/modules/pet_owner/pet_owner.dm create mode 100644 tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/pet_owner.tsx diff --git a/code/__DEFINES/~skyrat_defines/traits/declarations.dm b/code/__DEFINES/~skyrat_defines/traits/declarations.dm index 02fd3f4157a..cad3083144d 100644 --- a/code/__DEFINES/~skyrat_defines/traits/declarations.dm +++ b/code/__DEFINES/~skyrat_defines/traits/declarations.dm @@ -29,6 +29,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// This makes trait makes it so that the person cannot be infected by the zombie virus. #define TRAIT_MUTANT_IMMUNE "mutant_immune" #define TRAIT_HYDRA_HEADS "hydrahead" +/// Trait to spawn with a pet in a pet carrier (veteran only) +#define TRAIT_PET_OWNER "pet_owner" /// adds -6 quirk to negative quirks for free points. #define TRAIT_GIFTED "gifted" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index e88ffbee11f..94ef9b1c55e 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -597,6 +597,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_OVERSIZED" = TRAIT_OVERSIZED, "TRAIT_OXYIMMUNE" = TRAIT_OXYIMMUNE, "TRAIT_PERSONALSPACE" = TRAIT_PERSONALSPACE, + "TRAIT_PET_OWNER" = TRAIT_PET_OWNER, "TRAIT_R_UNIQUEWRECK" = TRAIT_R_UNIQUEWRECK, "TRAIT_R_UNIQUETIP" = TRAIT_R_UNIQUETIP, "TRAIT_R_WIDE" = TRAIT_R_WIDE, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index c6147516da4..3e061e884af 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -317,6 +317,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_OVERSIZED" = TRAIT_OVERSIZED, "TRAIT_OXYIMMUNE" = TRAIT_OXYIMMUNE, "TRAIT_PERSONALSPACE" = TRAIT_PERSONALSPACE, + "TRAIT_PET_OWNER" = TRAIT_PET_OWNER, "TRAIT_R_UNIQUEWRECK" = TRAIT_R_UNIQUEWRECK, "TRAIT_R_UNIQUETIP" = TRAIT_R_UNIQUETIP, "TRAIT_R_WIDE" = TRAIT_R_WIDE, diff --git a/modular_skyrat/modules/pet_owner/pet_owner.dm b/modular_skyrat/modules/pet_owner/pet_owner.dm new file mode 100644 index 00000000000..17931d6b842 --- /dev/null +++ b/modular_skyrat/modules/pet_owner/pet_owner.dm @@ -0,0 +1,95 @@ +/datum/quirk/item_quirk/pet_owner + name = "Pet Owner" + desc = "You bring your pet to work with you so that it, too, can experience the dangers of station life." + icon = FA_ICON_HORSE + value = 4 + mob_trait = TRAIT_PET_OWNER + veteran_only = TRUE + gain_text = span_notice("You brought your pet with you to work.") + lose_text = span_danger("You feel lonely, as if leaving somebody behind...") + medical_record_text = "Patient mentions their fondness for their pet." + mail_goodies = list( + /obj/item/clothing/neck/petcollar + ) + var/pet_type = NONE + +/datum/quirk_constant_data/pet_owner + associated_typepath = /datum/quirk/item_quirk/pet_owner + customization_options = list(/datum/preference/choiced/pet_owner) + +/datum/quirk/item_quirk/pet_owner/add_unique(client/client_source) + var/desired_pet = client_source?.prefs.read_preference(/datum/preference/choiced/pet_owner) || "Random" + + if(desired_pet != "Random") + pet_type = GLOB.possible_player_pet[desired_pet] + + if(pet_type == NONE) // Pet not set, we're picking one for them. + pet_type = pick(flatten_list(GLOB.possible_player_pet)) + + var/obj/item/pet_carrier/carrier = new /obj/item/pet_carrier(get_turf(quirk_holder)) + var/mob/living/simple_animal/pet/pet = new pet_type(carrier) + carrier.add_occupant(pet) + give_item_to_holder( + carrier, + list( + LOCATION_HANDS = ITEM_SLOT_HANDS + ), + flavour_text = "Looks tightly packed - you might not be able to put the pet back in once they're out.", + ) + +/datum/preference/choiced/pet_owner + category = PREFERENCE_CATEGORY_MANUALLY_RENDERED + savefile_key = "pet_owner" + savefile_identifier = PREFERENCE_CHARACTER + can_randomize = FALSE + +GLOBAL_LIST_INIT(possible_player_pet, list( + "Axolotl" = /mob/living/basic/axolotl, + "Baby Penguin" = /mob/living/basic/pet/penguin/baby/permanent, + "Bat" = /mob/living/basic/bat, + "Bull terrier" = /mob/living/basic/pet/dog/bullterrier, + "Butterfly" = /mob/living/basic/butterfly, + "Cat" = /mob/living/simple_animal/pet/cat, + "Chick" = /mob/living/basic/chick/permanent, + "Chicken" = /mob/living/basic/chicken, + "Chinchilla (dark)" = /mob/living/basic/pet/chinchilla/black, + "Chinchilla (white)" = /mob/living/basic/pet/chinchilla/white, + "Corgi" = /mob/living/basic/pet/dog/corgi, + "Corgi puppy" = /mob/living/basic/pet/dog/corgi/puppy, + "Cockroach" = /mob/living/basic/cockroach, + "Crab" = /mob/living/basic/crab, + "Deer" = /mob/living/basic/deer, + "Dobermann" = /mob/living/basic/pet/dog/dobermann, + "Fox" = /mob/living/basic/pet/fox/docile, + "Frog" = /mob/living/basic/frog, + "Giant ant" = /mob/living/basic/ant, + "Kitten" = /mob/living/simple_animal/pet/cat/kitten, + "Kiwi" = /mob/living/basic/kiwi, + "Mothroach" = /mob/living/basic/mothroach, + "Mouse (white)" = /mob/living/basic/mouse/white, + "Mouse (gray)" = /mob/living/basic/mouse/gray, + "Mouse (brown)" = /mob/living/basic/mouse/brown, + "Penguin" = /mob/living/basic/pet/penguin/emperor/neuter, + "Pig" = /mob/living/basic/pig, + "Pug" = /mob/living/basic/pet/dog/pug, + "Rabbit" = /mob/living/basic/rabbit, + "Sloth" = /mob/living/basic/sloth, + "Snake" = /mob/living/basic/snake, + "Spider" = /mob/living/basic/spider/maintenance, + "Tegu" = /mob/living/basic/lizard/tegu, +)) //some of these are too big to be put back into the pet carrier once taken out, so I put a warning on the carrier. + +/datum/preference/choiced/pet_owner/init_possible_values() + return list("Random") + assoc_to_keys(GLOB.possible_player_pet) + +/datum/preference/choiced/pet_owner/create_default_value() + return "Random" + +/datum/preference/choiced/pet_owner/is_accessible(datum/preferences/preferences) + if (!..()) + return FALSE + + return "Pet Owner" in preferences.all_quirks + +/datum/preference/choiced/pet_owner/apply_to_human(mob/living/carbon/human/target, value) + return diff --git a/tgstation.dme b/tgstation.dme index 5079712ce35..5a85f640032 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -7730,6 +7730,7 @@ #include "modular_skyrat\modules\paycheck_rations\code\reagents.dm" #include "modular_skyrat\modules\paycheck_rations\code\ticket_book.dm" #include "modular_skyrat\modules\paycheck_rations\code\tickets.dm" +#include "modular_skyrat\modules\pet_owner\pet_owner.dm" #include "modular_skyrat\modules\pixel_shift\code\pixel_shift_component.dm" #include "modular_skyrat\modules\pixel_shift\code\pixel_shift_keybind.dm" #include "modular_skyrat\modules\pixel_shift\code\pixel_shift_mob.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/pet_owner.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/pet_owner.tsx new file mode 100644 index 00000000000..3ac734ba84a --- /dev/null +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/skyrat/pet_owner.tsx @@ -0,0 +1,6 @@ +import { FeatureChoiced, FeatureDropdownInput } from '../../base'; + +export const pet_owner: FeatureChoiced = { + name: 'Pet Owner', + component: FeatureDropdownInput, +};