Skip to content

Commit

Permalink
Merge remote-tracking branch 'TG/master' into merge-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
AyIong committed Jan 2, 2025
2 parents c2622d3 + 7901bf5 commit 7da87d3
Show file tree
Hide file tree
Showing 51 changed files with 885 additions and 198 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@
// Color priorities for bodyparts
#define LIMB_COLOR_HULK 10
#define LIMB_COLOR_CARP_INFUSION 20
/// Base priority for atom colors, gets atom priorities added to it
#define LIMB_COLOR_ATOM_COLOR 30
2 changes: 2 additions & 0 deletions code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ GLOBAL_LIST_INIT(heretic_path_to_color, list(

// Lowest priority
#define EYE_COLOR_ORGAN_PRIORITY 1
/// Base priority for atom colors, gets atom priorities added to it
#define EYE_COLOR_ATOM_COLOR_PRIORITY 2
#define EYE_COLOR_SPECIES_PRIORITY 10
#define EYE_COLOR_WEED_PRIORITY 20
#define EYE_COLOR_CULT_PRIORITY 30
3 changes: 1 addition & 2 deletions code/controllers/subsystem/persistence/trophy_fishes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
fish.set_custom_materials(mat_list)
fish.persistence_load(data)
fish.name = data[PERSISTENCE_FISH_NAME]
mount.catcher_name = data[PERSISTENCE_FISH_CATCHER]
mount.catch_date = data[PERSISTENCE_FISH_CATCH_DATE]
fish.set_status(FISH_DEAD, silent = TRUE)
mount.add_fish(fish, from_persistence = TRUE, catcher = data[PERSISTENCE_FISH_CATCHER])
mount.catch_date = data[PERSISTENCE_FISH_CATCH_DATE]

/datum/controller/subsystem/persistence/proc/save_trophy_fish(obj/structure/fish_mount/mount)
var/obj/item/fish/fish = mount.mounted_fish
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/polling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ SUBSYSTEM_DEF(polling)
act_never = "[custom_link_style_start]<a href='byond://?src=[REF(poll_alert_button)];never=1'[custom_link_style_end]>\[Never For This Round\]</a>"

if(!duplicate_message_check(alert_poll)) //Only notify people once. They'll notice if there are multiple and we don't want to spam people.
SEND_SOUND(candidate_mob, 'sound/announcer/notice/notice2.ogg')
SEND_SOUND(candidate_mob, sound('sound/misc/prompt.ogg', volume = 70))
var/surrounding_icon
if(chat_text_border_icon)
var/image/surrounding_image
Expand Down
9 changes: 8 additions & 1 deletion code/datums/ai_laws/ai_laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,15 @@ GLOBAL_VAR(round_default_lawset)
/proc/pick_weighted_lawset()
var/datum/ai_laws/lawtype
var/list/law_weights = CONFIG_GET(keyed_list/law_weight)
var/list/specified_law_ids = CONFIG_GET(keyed_list/specified_laws)

if(HAS_TRAIT(SSstation, STATION_TRAIT_UNIQUE_AI))
law_weights -= AI_LAWS_ASIMOV
switch(CONFIG_GET(number/default_laws))
if(CONFIG_ASIMOV)
law_weights -= AI_LAWS_ASIMOV
if(CONFIG_CUSTOM)
law_weights -= specified_law_ids

while(!lawtype && law_weights.len)
var/possible_id = pick_weight(law_weights)
lawtype = lawid_to_type(possible_id)
Expand Down
1 change: 1 addition & 0 deletions code/datums/components/speechmod.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// Used to apply certain speech patterns
/// Can be used on organs, wearables, mutations and mobs
/datum/component/speechmod
dupe_mode = COMPONENT_DUPE_ALLOWED
/// Assoc list for strings/regexes and their replacements. Should be lowercase, as case will be automatically changed
var/list/replacements = list()
/// String added to the end of the message
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/decals/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
var/icon/icon_for_size = icon(icon, icon_state)
var/scale_factor_x = icon_for_size.Width()/ICON_SIZE_X
var/scale_factor_y = icon_for_size.Height()/ICON_SIZE_Y
var/mutable_appearance/blood_splatter = mutable_appearance('icons/effects/blood.dmi', "itemblood", appearance_flags = RESET_COLOR) //MA of the blood that we apply
var/mutable_appearance/blood_splatter = mutable_appearance('icons/effects/blood.dmi', "itemblood", appearance_flags = KEEP_APART|RESET_COLOR) //MA of the blood that we apply
blood_splatter.transform = blood_splatter.transform.Scale(scale_factor_x, scale_factor_y)
blood_splatter.blend_mode = BLEND_INSET_OVERLAY
blood_splatter.color = _color
Expand Down
51 changes: 51 additions & 0 deletions code/datums/elements/food/love_food_buff.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/// Changes a food item's food buff to something else when it has "love" reagent within
/datum/element/love_food_buff
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
/// Buff typepath to add when our food has love within
var/love_buff_type

/datum/element/love_food_buff/Attach(datum/target, love_buff_type)
. = ..()
if(!istype(target, /obj/item/food))
return ELEMENT_INCOMPATIBLE
var/obj/item/food/food = target
if(isnull(food.reagents))
return ELEMENT_INCOMPATIBLE

src.love_buff_type = love_buff_type
RegisterSignals(food.reagents, list(
COMSIG_REAGENTS_ADD_REAGENT,
COMSIG_REAGENTS_CLEAR_REAGENTS,
COMSIG_REAGENTS_DEL_REAGENT,
COMSIG_REAGENTS_NEW_REAGENT,
COMSIG_REAGENTS_REM_REAGENT,
), PROC_REF(on_reagents_changed))
RegisterSignal(food, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))

/datum/element/love_food_buff/Detach(datum/source, ...)
var/obj/item/food/food = source
if(istype(food) && !isnull(food.reagents))
UnregisterSignal(food.reagents, list(
COMSIG_REAGENTS_ADD_REAGENT,
COMSIG_REAGENTS_CLEAR_REAGENTS,
COMSIG_REAGENTS_DEL_REAGENT,
COMSIG_REAGENTS_NEW_REAGENT,
COMSIG_REAGENTS_REM_REAGENT,
))
UnregisterSignal(food, COMSIG_ATOM_EXAMINE)
return ..()

/datum/element/love_food_buff/proc/on_reagents_changed(datum/reagents/source, ...)
SIGNAL_HANDLER

var/obj/item/food/food = source.my_atom
if(!istype(food))
return

food.crafted_food_buff = source.has_reagent(/datum/reagent/love) ? love_buff_type : initial(food.crafted_food_buff)

/datum/element/love_food_buff/proc/on_examine(datum/source, mob/user, list/examine_list)
SIGNAL_HANDLER

examine_list += span_notice("Delivering a chef's kiss to [source] will alter [source.p_their()] effects.")
22 changes: 18 additions & 4 deletions code/datums/status_effects/buffs/food/speech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@

/datum/status_effect/food/speech/italian
alert_type = /atom/movable/screen/alert/status_effect/italian_speech
on_remove_on_mob_delete = TRUE
/// Ref to the component so we can clear it
var/datum/component/speechmod

/datum/status_effect/food/speech/italian/on_apply()
AddComponent( \
. = ..()
speechmod = AddComponent( \
/datum/component/speechmod, \
replacements = strings("italian_replacement.json", "italian"), \
end_string = list(
Expand All @@ -16,7 +20,10 @@
), \
end_string_chance = 3 \
)
return ..()

/datum/status_effect/food/speech/italian/on_remove()
. = ..()
QDEL_NULL(speechmod)

/atom/movable/screen/alert/status_effect/italian_speech
name = "Linguini Embrace"
Expand All @@ -25,9 +32,13 @@

/datum/status_effect/food/speech/french
alert_type = /atom/movable/screen/alert/status_effect/french_speech
on_remove_on_mob_delete = TRUE
/// Ref to the component so we can clear it
var/datum/component/speechmod

/datum/status_effect/food/speech/french/on_apply()
AddComponent( \
. = ..()
speechmod = owner.AddComponent( \
/datum/component/speechmod, \
replacements = strings("french_replacement.json", "french"), \
end_string = list(
Expand All @@ -37,7 +48,10 @@
), \
end_string_chance = 3, \
)
return ..()

/datum/status_effect/food/speech/french/on_remove()
. = ..()
QDEL_NULL(speechmod)

/atom/movable/screen/alert/status_effect/french_speech
name = "Café Chic"
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/dance_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
QDEL_NULL(music_player)
return ..()

/obj/machinery/jukebox/examine(mob/user)
. = ..()
if(music_player.active_song_sound)
. += "Now playing: [music_player.selection.song_name]"

/obj/machinery/jukebox/no_access
req_access = null

Expand Down
6 changes: 6 additions & 0 deletions code/game/objects/effects/spawners/random/trash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
/obj/effect/spawner/random/entertainment/cigar = 1,
/obj/item/stack/ore/gold = 1,
)
/obj/effect/spawner/random/trash/deluxe_garbage/Initialize(mapload)
if(mapload)
var/turf/location = get_turf(loc)
if(location.initial_gas_mix != OPENTURF_DEFAULT_ATMOS && location.initial_gas_mix != OPENTURF_DIRTY_ATMOS)
loot -= /mob/living/basic/mouse
return ..()

/obj/effect/spawner/random/trash/cigbutt
name = "cigarette butt spawner"
Expand Down
38 changes: 8 additions & 30 deletions code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,7 @@
if(isbodypart(target))
var/obj/item/bodypart/limb = target
if(IS_ROBOTIC_LIMB(limb))
context[SCREENTIP_CONTEXT_CTRL_LMB] = "Restyle robotic limb"
else
context[SCREENTIP_CONTEXT_CTRL_LMB] = "Copy color"
context[SCREENTIP_CONTEXT_LMB] = "Restyle robotic limb"

return CONTEXTUAL_SCREENTIP_SET

Expand Down Expand Up @@ -887,16 +885,17 @@
return ..()

/obj/item/toy/crayon/spraycan/use_on(atom/target, mob/user, list/modifiers)
if (LAZYACCESS(modifiers, CTRL_CLICK))
return ctrl_interact(target, user)

if(is_capped)
balloon_alert(user, "take the cap off first!")
return ITEM_INTERACT_BLOCKING

if(check_empty(user))
return ITEM_INTERACT_BLOCKING

if (isbodypart(target))
if (color_limb(target, user))
return ITEM_INTERACT_SUCCESS

if(iscarbon(target))
if(pre_noise || post_noise)
playsound(user.loc, 'sound/effects/spray.ogg', 25, TRUE, 5)
Expand Down Expand Up @@ -994,30 +993,9 @@
user.visible_message(span_notice("[user] coats [target] with spray paint!"), span_notice("You coat [target] with spray paint."))
return ITEM_INTERACT_SUCCESS

/obj/item/toy/crayon/spraycan/proc/ctrl_interact(atom/interacting_with, mob/living/user)
if(is_capped)
if(!interacting_with.color)
// let's be generous and assume if they're trying to match something with no color, while capped,
// we shouldn't be blocking further interactions
return NONE
balloon_alert(user, "take the cap off first!")
return ITEM_INTERACT_BLOCKING

if(check_empty(user))
return ITEM_INTERACT_BLOCKING

if(!isbodypart(interacting_with) || !actually_paints)
if(interacting_with.color)
paint_color = interacting_with.color
balloon_alert(user, "matched colour of target")
update_appearance()
return ITEM_INTERACT_BLOCKING
balloon_alert(user, "can't match those colours!")
return ITEM_INTERACT_BLOCKING

var/obj/item/bodypart/limb = interacting_with
/obj/item/toy/crayon/spraycan/proc/color_limb(obj/item/bodypart/limb, mob/living/user)
if(!IS_ROBOTIC_LIMB(limb))
return ITEM_INTERACT_BLOCKING
return FALSE

var/list/skins = list()
var/static/list/style_list_icons = list(
Expand All @@ -1036,7 +1014,7 @@
if(choice && (use_charges(user, 5, requires_full = FALSE)))
playsound(user.loc, 'sound/effects/spray.ogg', 5, TRUE, 5)
limb.change_appearance(style_list_icons[choice], greyscale = FALSE)
return ITEM_INTERACT_SUCCESS
return TRUE

/obj/item/toy/crayon/spraycan/click_alt(mob/user)
if(!has_cap)
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/food/egg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ GLOBAL_VAR_INIT(chicks_from_eggs, 0)
foodtypes = MEAT | BREAKFAST | DAIRY
venue_value = FOOD_PRICE_CHEAP
crafting_complexity = FOOD_COMPLEXITY_2
crafted_food_buff = /datum/status_effect/food/speech/french

/obj/item/food/omelette/Initialize(mapload)
. = ..()
AddElement(/datum/element/love_food_buff, /datum/status_effect/food/speech/french)

/obj/item/food/omelette/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/kitchen/fork))
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/food/spaghetti.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,7 @@
tastes = list("spaghetti" = 1, "parmigiano reggiano" = 1, "guanciale" = 1)
foodtypes = GRAIN | MEAT | DAIRY
crafting_complexity = FOOD_COMPLEXITY_4
crafted_food_buff = /datum/status_effect/food/speech/italian

/obj/item/food/spaghetti/carbonara/Initialize(mapload)
. = ..()
AddElement(/datum/element/love_food_buff, /datum/status_effect/food/speech/italian)
Loading

0 comments on commit 7da87d3

Please sign in to comment.