Skip to content

Commit

Permalink
Bring Your Pet to Work Day (Veteran Quirk) (#25142)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Nov 27, 2023
1 parent 87a3362 commit c505066
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/~skyrat_defines/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/admin_tooling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
95 changes: 95 additions & 0 deletions modular_skyrat/modules/pet_owner/pet_owner.dm
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { FeatureChoiced, FeatureDropdownInput } from '../../base';

export const pet_owner: FeatureChoiced = {
name: 'Pet Owner',
component: FeatureDropdownInput,
};

0 comments on commit c505066

Please sign in to comment.