Skip to content

Commit 34a15c6

Browse files
Bring your pet to work day! (tgstation#86879)
## About The Pull Request Adds a new neutral station trait where people are able to bring their personal pets to show off to the rest of the crew (or to donate to the chef). Before joining, players will be able to customize their pets https://github.com/user-attachments/assets/5a5cda18-e551-4f87-b649-67a6940ffc6a u can set their name, gender, pet carrier color, and teach them give them a unique dance sequence trick. if players dont wish to opt in, they also have the choice not to ## Why It's Good For The Game adds a new station trait which people can RP around, whether its by competitively comparing pets, or resolving conflicts around pets being killed/kidnapped. Ive also GAGsified pet carriers, so people can now have the option to recolor those too ## Changelog :cl: add: adds a new station trait, "bring your pet to work" day /:cl:
1 parent 3a6007b commit 34a15c6

File tree

28 files changed

+894
-14
lines changed

28 files changed

+894
-14
lines changed

code/__DEFINES/basic_mobs.dm

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
///keeps track of how many gutlunches are born
3434
GLOBAL_VAR_INIT(gutlunch_count, 0)
3535

36+
///Pet customization settings saved for every client
37+
GLOBAL_LIST_EMPTY(customized_pets)
38+
3639
//raptor defines
3740

3841
#define RAPTOR_RED "Red"

code/datums/greyscale/config_types/greyscale_configs/greyscale_items.dm

+15
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,21 @@
229229
icon_file = 'icons/obj/toys/plushes.dmi'
230230
json_config = 'code/datums/greyscale/json_configs/plushie_carp.json'
231231

232+
/datum/greyscale_config/pet_carrier
233+
name = "Pet Carrier"
234+
icon_file = 'icons/obj/pet_carrier.dmi'
235+
json_config = 'code/datums/greyscale/json_configs/pet_carrier.json'
236+
237+
/datum/greyscale_config/pet_carrier_inhands_left
238+
name = "Pet Carrier Left"
239+
icon_file = 'icons/mob/inhands/items_lefthand.dmi'
240+
json_config = 'code/datums/greyscale/json_configs/pet_carrier_inhands.json'
241+
242+
/datum/greyscale_config/pet_carrier_inhands_right
243+
name = "Pet Carrier Right"
244+
icon_file = 'icons/mob/inhands/items_righthand.dmi'
245+
json_config = 'code/datums/greyscale/json_configs/pet_carrier_inhands.json'
246+
232247
/datum/greyscale_config/plush_lizard
233248
name = "Plushie Lizard"
234249
icon_file = 'icons/obj/toys/plushes.dmi'

code/datums/greyscale/json_configs/bandanaskull_inhands.json

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
}
1515
]
1616
}
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"pet_carrier_open": [
3+
{
4+
"type": "icon_state",
5+
"icon_state": "pet_carrier_open",
6+
"blend_mode": "overlay"
7+
},
8+
{
9+
"type": "icon_state",
10+
"icon_state": "pet_carrier_gags",
11+
"blend_mode": "overlay",
12+
"color_ids": [ 1 ]
13+
}
14+
],
15+
"pet_carrier_closed_unlocked": [
16+
{
17+
"type": "icon_state",
18+
"icon_state": "pet_carrier_unlocked",
19+
"blend_mode": "overlay"
20+
},
21+
{
22+
"type": "icon_state",
23+
"icon_state": "pet_carrier_closed",
24+
"blend_mode": "overlay"
25+
},
26+
{
27+
"type": "icon_state",
28+
"icon_state": "pet_carrier_gags",
29+
"blend_mode": "overlay",
30+
"color_ids": [ 1 ]
31+
}
32+
],
33+
"pet_carrier_closed_locked": [
34+
{
35+
"type": "icon_state",
36+
"icon_state": "pet_carrier_locked",
37+
"blend_mode": "overlay"
38+
},
39+
{
40+
"type": "icon_state",
41+
"icon_state": "pet_carrier_closed",
42+
"blend_mode": "overlay"
43+
},
44+
{
45+
"type": "icon_state",
46+
"icon_state": "pet_carrier_gags",
47+
"blend_mode": "overlay",
48+
"color_ids": [ 1 ]
49+
}
50+
],
51+
"pet_carrier_occupied_unlocked": [
52+
{
53+
"type": "icon_state",
54+
"icon_state": "pet_carrier_unlocked",
55+
"blend_mode": "overlay"
56+
},
57+
{
58+
"type": "icon_state",
59+
"icon_state": "pet_carrier_occupied",
60+
"blend_mode": "overlay"
61+
},
62+
{
63+
"type": "icon_state",
64+
"icon_state": "pet_carrier_gags",
65+
"blend_mode": "overlay",
66+
"color_ids": [ 1 ]
67+
}
68+
],
69+
"pet_carrier_occupied_locked": [
70+
{
71+
"type": "icon_state",
72+
"icon_state": "pet_carrier_locked",
73+
"blend_mode": "overlay"
74+
},
75+
{
76+
"type": "icon_state",
77+
"icon_state": "pet_carrier_occupied",
78+
"blend_mode": "overlay"
79+
},
80+
{
81+
"type": "icon_state",
82+
"icon_state": "pet_carrier_gags",
83+
"blend_mode": "overlay",
84+
"color_ids": [ 1 ]
85+
}
86+
]
87+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"pet_carrier": [
3+
{
4+
"type": "icon_state",
5+
"icon_state": "pet_carrier",
6+
"blend_mode": "overlay"
7+
},
8+
{
9+
"type": "icon_state",
10+
"icon_state": "pet_carrier_gags",
11+
"blend_mode": "overlay",
12+
"color_ids": [ 1 ]
13+
}
14+
]
15+
}

code/datums/station_traits/neutral_traits.dm

+44
Original file line numberDiff line numberDiff line change
@@ -544,3 +544,47 @@
544544
dynamic_category = RULESET_CATEGORY_NO_WITTING_CREW_ANTAGONISTS
545545
threat_reduction = 15
546546
dynamic_threat_id = "Background Checks"
547+
548+
549+
/datum/station_trait/pet_day
550+
name = "Bring Your Pet To Work Day"
551+
trait_type = STATION_TRAIT_NEUTRAL
552+
show_in_report = FALSE
553+
weight = 2
554+
sign_up_button = TRUE
555+
556+
/datum/station_trait/pet_day/New()
557+
. = ..()
558+
RegisterSignal(SSdcs, COMSIG_GLOB_JOB_AFTER_SPAWN, PROC_REF(on_job_after_spawn))
559+
560+
/datum/station_trait/pet_day/setup_lobby_button(atom/movable/screen/lobby/button/sign_up/lobby_button)
561+
lobby_button.desc = "Want to bring your innocent pet to a giant metal deathtrap? Click here to customize it!"
562+
RegisterSignal(lobby_button, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(on_lobby_button_update_overlays))
563+
return ..()
564+
565+
/datum/station_trait/pet_day/can_display_lobby_button(client/player)
566+
return sign_up_button
567+
568+
/datum/station_trait/pet_day/on_round_start()
569+
return
570+
571+
/datum/station_trait/pet_day/on_lobby_button_click(atom/movable/screen/lobby/button/sign_up/lobby_button, updates)
572+
var/mob/our_player = lobby_button.get_mob()
573+
var/client/player_client = our_player.client
574+
if(isnull(player_client))
575+
return
576+
var/datum/pet_customization/customization = GLOB.customized_pets[REF(player_client)]
577+
if(isnull(customization))
578+
customization = new(player_client)
579+
INVOKE_ASYNC(customization, TYPE_PROC_REF(/datum, ui_interact), our_player)
580+
581+
/datum/station_trait/pet_day/proc/on_job_after_spawn(datum/source, datum/job/job, mob/living/spawned, client/player_client)
582+
SIGNAL_HANDLER
583+
584+
var/datum/pet_customization/customization = GLOB.customized_pets[REF(player_client)]
585+
if(isnull(customization))
586+
return
587+
INVOKE_ASYNC(customization, TYPE_PROC_REF(/datum/pet_customization, create_pet), spawned, player_client)
588+
589+
/datum/station_trait/pet_day/proc/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays)
590+
overlays += "select_pet"

code/game/objects/items/pet_carrier.dm

+9-7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
inhand_icon_state = "pet_carrier"
1212
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
1313
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
14+
greyscale_config = /datum/greyscale_config/pet_carrier
15+
greyscale_config_inhand_left = /datum/greyscale_config/pet_carrier_inhands_left
16+
greyscale_config_inhand_right = /datum/greyscale_config/pet_carrier_inhands_right
17+
greyscale_colors = COLOR_BLUE
1418
force = 5
1519
attack_verb_continuous = list("bashes", "carries")
1620
attack_verb_simple = list("bash", "carry")
@@ -19,7 +23,6 @@
1923
throw_range = 3
2024
custom_materials = list(/datum/material/iron = HALF_SHEET_MATERIAL_AMOUNT * 7.5, /datum/material/glass = SMALL_MATERIAL_AMOUNT)
2125
interaction_flags_mouse_drop = NEED_DEXTERITY
22-
2326
var/open = TRUE
2427
var/locked = FALSE
2528
var/list/occupants = list()
@@ -147,14 +150,9 @@
147150
if(open)
148151
icon_state = initial(icon_state)
149152
return ..()
150-
icon_state = "[base_icon_state]_[!occupants.len ? "closed" : "occupied"]"
153+
icon_state = "[base_icon_state]_[!occupants.len ? "closed" : "occupied"]_[locked ? "locked" : "unlocked"]"
151154
return ..()
152155

153-
/obj/item/pet_carrier/update_overlays()
154-
. = ..()
155-
if(!open)
156-
. += "[base_icon_state]_[locked ? "" : "un"]locked"
157-
158156
/obj/item/pet_carrier/mouse_drop_dragged(atom/over_atom, mob/user, src_location, over_location, params)
159157
if(isopenturf(over_atom) && open && occupants.len)
160158
user.visible_message(span_notice("[user] unloads [src]."), \
@@ -202,5 +200,9 @@
202200
base_icon_state = "biopod"
203201
icon_state = "biopod_open"
204202
inhand_icon_state = "biopod"
203+
greyscale_config = null
204+
greyscale_config_inhand_left = null
205+
greyscale_config_inhand_right = null
206+
greyscale_colors = null
205207

206208
#undef pet_carrier_full

code/modules/mob/living/basic/pets/cat/cat.dm

+15
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545
/obj/item/food/deadmouse,
4646
/obj/item/food/fishmeat,
4747
)
48+
///list of pet commands we follow
49+
var/static/list/pet_commands = list(
50+
/datum/pet_command/idle,
51+
/datum/pet_command/free,
52+
/datum/pet_command/follow,
53+
/datum/pet_command/perform_trick_sequence,
54+
)
55+
4856
///item we are currently holding
4957
var/obj/item/held_food
5058
///mutable appearance for held item
@@ -74,6 +82,7 @@
7482

7583
/mob/living/basic/pet/cat/Initialize(mapload)
7684
. = ..()
85+
AddComponent(/datum/component/obeys_commands, pet_commands)
7786
AddElement(/datum/element/cultist_pet, pet_cult_icon_state = cult_icon_state)
7887
AddElement(/datum/element/wears_collar, collar_icon_state = collar_icon_state, collar_resting_icon_state = TRUE)
7988
AddElement(/datum/element/ai_retaliate)
@@ -224,3 +233,9 @@
224233
name = "Jerry"
225234
desc = "Tom is VERY amused."
226235
gender = MALE
236+
237+
/mob/living/basic/pet/cat/tabby
238+
icon_state = "cat"
239+
icon_living = "cat"
240+
icon_dead = "cat_dead"
241+
held_state = "cat"

code/modules/mob/living/basic/pets/cat/cat_ai.dm

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/datum/ai_controller/basic_controller/cat
22
blackboard = list(
33
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
4+
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/not_friends,
45
BB_HOSTILE_MEOWS = list("Mawwww", "Mrewwww", "mhhhhng..."),
56
BB_BABIES_PARTNER_TYPES = list(/mob/living/basic/pet/cat),
67
BB_BABIES_CHILD_TYPES = list(/mob/living/basic/pet/cat/kitten),
@@ -9,6 +10,7 @@
910
ai_movement = /datum/ai_movement/basic_avoidance
1011
idle_behavior = /datum/idle_behavior/idle_random_walk
1112
planning_subtrees = list(
13+
/datum/ai_planning_subtree/pet_planning,
1214
/datum/ai_planning_subtree/reside_in_home,
1315
/datum/ai_planning_subtree/flee_target/from_flee_key/cat_struggle,
1416
/datum/ai_planning_subtree/find_and_hunt_target/hunt_mice,

code/modules/mob/living/basic/pets/cat/kitten_ai.dm

+2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
blackboard = list(
44
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
55
BB_HUNGRY_MEOW = list("mrrp...", "mraw..."),
6+
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/not_friends,
67
BB_MAX_DISTANCE_TO_FOOD = 2,
78
)
89

910
planning_subtrees = list(
11+
/datum/ai_planning_subtree/pet_planning,
1012
/datum/ai_planning_subtree/target_retaliate,
1113
/datum/ai_planning_subtree/flee_target,
1214
/datum/ai_planning_subtree/beg_human,

code/modules/mob/living/basic/pets/dog/_dog.dm

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
/datum/pet_command/free,
4141
/datum/pet_command/good_boy/dog,
4242
/datum/pet_command/follow/dog,
43+
/datum/pet_command/perform_trick_sequence,
4344
/datum/pet_command/point_targeting/attack/dog,
4445
/datum/pet_command/point_targeting/fetch,
4546
/datum/pet_command/play_dead,

code/modules/mob/living/basic/pets/fox.dm

+12
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,19 @@
2828
attack_sound = 'sound/items/weapons/bite.ogg'
2929
attack_vis_effect = ATTACK_EFFECT_BITE
3030
ai_controller = /datum/ai_controller/basic_controller/fox
31+
///list of our pet commands we follow
32+
var/static/list/pet_commands = list(
33+
/datum/pet_command/idle,
34+
/datum/pet_command/free,
35+
/datum/pet_command/follow,
36+
/datum/pet_command/point_targeting/attack,
37+
/datum/pet_command/perform_trick_sequence,
38+
)
39+
3140

3241
/mob/living/basic/pet/fox/Initialize(mapload)
3342
. = ..()
43+
AddComponent(/datum/component/obeys_commands, pet_commands)
3444
AddElement(/datum/element/cultist_pet)
3545
AddElement(/datum/element/wears_collar)
3646
AddElement(/datum/element/pet_bonus, "pants and yaps happily!")
@@ -42,12 +52,14 @@
4252
blackboard = list(
4353
BB_ALWAYS_IGNORE_FACTION = TRUE,
4454
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic/of_size/ours_or_smaller,
55+
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/not_friends,
4556
BB_FLEE_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
4657
)
4758

4859
ai_movement = /datum/ai_movement/basic_avoidance
4960
idle_behavior = /datum/idle_behavior/idle_random_walk
5061
planning_subtrees = list(
62+
/datum/ai_planning_subtree/pet_planning,
5163
/datum/ai_planning_subtree/target_retaliate/to_flee,
5264
/datum/ai_planning_subtree/flee_target/from_flee_key,
5365
/datum/ai_planning_subtree/simple_find_target/not_while_observed,

code/modules/mob/living/basic/pets/parrot/_parrot.dm

+8-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(
7676
var/static/list/edibles = list(
7777
/obj/item/food/cracker,
7878
)
79+
///list of commands we follow
80+
var/static/list/pet_commands = list(
81+
/datum/pet_command/idle,
82+
/datum/pet_command/free,
83+
/datum/pet_command/follow,
84+
/datum/pet_command/perform_trick_sequence,
85+
)
7986

8087
/// Tracks the times when we send a phrase through either being pet or attack to ensure it's not abused to flood
8188
COOLDOWN_DECLARE(forced_speech_cooldown)
@@ -92,7 +99,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list(
9299
AddElement(/datum/element/simple_flying)
93100
AddComponent(/datum/component/listen_and_repeat, desired_phrases = get_static_list_of_phrases(), blackboard_key = BB_PARROT_REPEAT_STRING)
94101
AddComponent(/datum/component/tameable, food_types = edibles, tame_chance = 100, bonus_tame_chance = 0)
95-
102+
AddComponent(/datum/component/obeys_commands, pet_commands)
96103
RegisterSignal(src, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, PROC_REF(pre_attacking))
97104
RegisterSignal(src, COMSIG_MOB_CLICKON, PROC_REF(on_click))
98105
RegisterSignal(src, COMSIG_ATOM_ATTACKBY_SECONDARY, PROC_REF(on_attacked)) // this means we could have a peaceful interaction, like getting a cracker

code/modules/mob/living/basic/pets/parrot/parrot_ai/_parrot_controller.dm

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/datum/ai_controller/basic_controller/parrot
22
blackboard = list(
33
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic/allow_items,
4+
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/not_friends,
45
BB_HOARD_LOCATION_RANGE = 9,
56
)
67

@@ -9,11 +10,12 @@
910
idle_behavior = /datum/idle_behavior/idle_random_walk/parrot
1011

1112
planning_subtrees = list(
13+
/datum/ai_planning_subtree/parrot_as_in_repeat, // always get a witty oneliner in when you can
14+
/datum/ai_planning_subtree/pet_planning,
1215
/datum/ai_planning_subtree/target_retaliate,
1316
/datum/ai_planning_subtree/perch_on_target,
1417
/datum/ai_planning_subtree/basic_melee_attack_subtree,
1518
/datum/ai_planning_subtree/hoard_items,
16-
/datum/ai_planning_subtree/parrot_as_in_repeat, // always get a witty oneliner in when you can
1719
)
1820

1921
/datum/idle_behavior/idle_random_walk/parrot

0 commit comments

Comments
 (0)