Skip to content

Commit

Permalink
Merge upstream 02.12.24 (#831)
Browse files Browse the repository at this point in the history
## About The Pull Request
Мерге
  • Loading branch information
larentoun authored Dec 1, 2024
2 parents 5d76957 + 5678260 commit d479a6b
Show file tree
Hide file tree
Showing 48 changed files with 304 additions and 130 deletions.
7 changes: 7 additions & 0 deletions code/__DEFINES/dcs/signals/signals_shuttle.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Shuttle signals. this file is empty because shuttle code is ancient, feel free to
// add more signals where its appropriate to have them

/// Called when the shuttle tries to move. Do not return anything to continue with default behaviour (always allow) : ()
#define COMSIG_SHUTTLE_SHOULD_MOVE "shuttle_should_move"
/// Return this when the shuttle move should be blocked.
#define BLOCK_SHUTTLE_MOVE (1<<0)
2 changes: 1 addition & 1 deletion code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
#define DOOR_CRUSH_DAMAGE 15 //the amount of damage that airlocks deal when they crush you

#define HUNGER_FACTOR 0.05 //factor at which mob nutrition decreases
#define ETHEREAL_DISCHARGE_RATE (8e-4 * STANDARD_CELL_CHARGE) // Rate at which ethereal stomach charge decreases
#define ETHEREAL_DISCHARGE_RATE (8e-3 * STANDARD_CELL_CHARGE) // Rate at which ethereal stomach charge decreases
/// How much nutrition eating clothes as moth gives and drains
#define CLOTHING_NUTRITION_GAIN 15
#define REAGENTS_METABOLISM 0.2 //How many units of reagent are consumed per second, by default.
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
///Trait given to mobs that can dig
#define TRAIT_MOB_CAN_DIG "mob_can_dig"

/// This atom has a tether attached to it
#define TRAIT_TETHER_ATTACHED "tether_attached"

/**
*
* This trait is used in some interactions very high in the interaction chain to allow
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 @@ -34,6 +34,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_STICKERED" = TRAIT_STICKERED,
"TRAIT_UNHITTABLE_BY_PROJECTILES" = TRAIT_UNHITTABLE_BY_PROJECTILES,
"TRAIT_UNLINKABLE_FISHING_SPOT" = TRAIT_UNLINKABLE_FISHING_SPOT,
"TRAIT_TETHER_ATTACHED" = TRAIT_TETHER_ATTACHED,
),
/atom/movable = list(
"TRAIT_ACTIVE_STORAGE" = TRAIT_ACTIVE_STORAGE,
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/processing/fishing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ PROCESSING_SUBSYSTEM_DEF(fishing)
unknown_icon.Blend(questionmark, ICON_OVERLAY, x = width, y = height)
cached_unknown_fish_icons[fish_type] = icon2base64(unknown_icon)

var/obj/item/fish/fish = new fish_type(null, FALSE)
var/obj/item/fish/fish = new fish_type
spawned_fish += fish
var/list/properties = list()
fish_properties[fish_type] = properties
Expand Down
32 changes: 29 additions & 3 deletions code/datums/components/tether.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@
var/datum/beam/tether_beam
/// Tether module if we were created by one
var/obj/item/mod/module/tether/parent_module
/// Source, if any, for TRAIT_TETHER_ATTACHED we add
var/tether_trait_source
/// If TRUE, only add TRAIT_TETHER_ATTACHED to our parent
var/no_target_trait

/datum/component/tether/Initialize(atom/tether_target, max_dist = 7, tether_name, atom/embed_target = null, start_distance = null, parent_module = null)
/datum/component/tether/Initialize(atom/tether_target, max_dist = 7, tether_name, atom/embed_target = null, start_distance = null, \
parent_module = null, tether_trait_source = null, no_target_trait = FALSE)
if(!ismovable(parent) || !istype(tether_target) || !tether_target.loc)
return COMPONENT_INCOMPATIBLE

src.tether_target = tether_target
src.embed_target = embed_target
src.max_dist = max_dist
src.parent_module = parent_module
src.tether_trait_source = tether_trait_source
src.no_target_trait = no_target_trait
cur_dist = max_dist
if (start_distance != null)
cur_dist = start_distance
Expand All @@ -34,6 +41,10 @@
src.tether_name = initial(tmp.name)
else
src.tether_name = tether_name
if (!isnull(tether_trait_source))
ADD_TRAIT(parent, TRAIT_TETHER_ATTACHED, tether_trait_source)
if (!no_target_trait)
ADD_TRAIT(tether_target, TRAIT_TETHER_ATTACHED, tether_trait_source)

/datum/component/tether/RegisterWithParent()
RegisterSignal(parent, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(check_tether))
Expand All @@ -54,8 +65,12 @@

/datum/component/tether/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_MOVABLE_PRE_MOVE, COMSIG_MOVABLE_MOVED))
if (!isnull(tether_trait_source))
REMOVE_TRAIT(parent, TRAIT_TETHER_ATTACHED, tether_trait_source)
if (!QDELETED(tether_target))
UnregisterSignal(tether_target, list(COMSIG_MOVABLE_PRE_MOVE, COMSIG_MOVABLE_MOVED, COMSIG_QDELETING))
if (!isnull(tether_trait_source) && !no_target_trait)
REMOVE_TRAIT(tether_target, TRAIT_TETHER_ATTACHED, tether_trait_source)
if (!QDELETED(tether_beam))
UnregisterSignal(tether_beam.visuals, list(COMSIG_CLICK, COMSIG_QDELETING))
qdel(tether_beam)
Expand Down Expand Up @@ -143,12 +158,23 @@
INVOKE_ASYNC(src, PROC_REF(process_beam_click), source, location, params, user)

/datum/component/tether/proc/process_beam_click(atom/source, atom/location, params, mob/user)
if (!location.can_interact(user))
var/turf/nearest_turf
for (var/turf/line_turf in get_line(get_turf(parent), get_turf(tether_target)))
if (user.CanReach(line_turf))
nearest_turf = line_turf
break

if (isnull(nearest_turf))
return

if (!user.can_perform_action(nearest_turf))
nearest_turf.balloon_alert(user, "cannot reach!")
return

var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, CTRL_CLICK))
location.balloon_alert(user, "cutting the tether...")
if (!do_after(user, 1 SECONDS, user))
if (!do_after(user, 2 SECONDS, user))
return

qdel(src)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/looping_sounds/projectiles.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/looping_sound/moon_parade
mid_sounds = list('sound/effects/moon_parade_soundloop.ogg' = 1)
mid_length = 0
mid_length = 2 SECONDS
volume = 20
12 changes: 6 additions & 6 deletions code/game/objects/effects/step_triggers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
/obj/effect/step_trigger/proc/Trigger(atom/movable/A)
return 0

/obj/effect/step_trigger/proc/on_entered(datum/source, H as mob|obj)
/obj/effect/step_trigger/proc/on_entered(datum/source, atom/movable/entering)
SIGNAL_HANDLER
if(!H || H == src)
if(!entering || entering == src || entering.invisibility >= INVISIBILITY_ABSTRACT || istype(entering, /atom/movable/mirage_holder)) //dont teleport ourselves, abstract objects, and mirage holders due to init shenanigans
return
if(isobserver(H) && !affect_ghosts)
if(isobserver(entering) && !affect_ghosts)
return
if(!ismob(H) && mobs_only)
if(!ismob(entering) && mobs_only)
return
INVOKE_ASYNC(src, PROC_REF(Trigger), H)
INVOKE_ASYNC(src, PROC_REF(Trigger), entering)


/obj/effect/step_trigger/singularity_act()
Expand Down Expand Up @@ -144,7 +144,7 @@
var/teleport_x_offset = 0
var/teleport_y_offset = 0

/obj/effect/step_trigger/teleporter/offset/on_entered(datum/source, H as mob|obj, atom/old_loc)
/obj/effect/step_trigger/teleporter/offset/on_entered(datum/source, atom/movable/entered, atom/old_loc)
if(!old_loc?.Adjacent(loc)) // prevents looping, if we were teleported into this then the old loc is usually not adjacent
return
return ..()
Expand Down
31 changes: 17 additions & 14 deletions code/game/objects/items/food/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -366,25 +366,27 @@
foodtypes = DAIRY
w_class = WEIGHT_CLASS_SMALL
dog_fashion = /datum/dog_fashion/head/butter
var/can_stick = TRUE

/obj/item/food/butter/examine(mob/user)
. = ..()
. += span_notice("If you had a rod you could make <b>butter on a stick</b>.")
if (can_stick)
. += span_notice("If you had a rod you could make <b>butter on a stick</b>.")

/obj/item/food/butter/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/stack/rods))
var/obj/item/stack/rods/rods = item
if(!rods.use(1))//borgs can still fail this if they have no metal
to_chat(user, span_warning("You do not have enough iron to put [src] on a stick!"))
return ..()
to_chat(user, span_notice("You stick the rod into the stick of butter."))
var/obj/item/food/butter/on_a_stick/new_item = new(usr.loc)
var/replace = (user.get_inactive_held_item() == rods)
if(!rods && replace)
user.put_in_hands(new_item)
qdel(src)
return TRUE
..()
if(!istype(item, /obj/item/stack/rods) || !can_stick)
return ..()
var/obj/item/stack/rods/rods = item
if(!rods.use(1))//borgs can still fail this if they have no metal
to_chat(user, span_warning("You do not have enough iron to put [src] on a stick!"))
return ..()
to_chat(user, span_notice("You stick the rod into the stick of butter."))
user.temporarilyRemoveItemFromInventory(src)
var/obj/item/food/butter/on_a_stick/new_item = new(drop_location())
if (user.CanReach(new_item))
user.put_in_hands(new_item)
qdel(src)
return TRUE

/obj/item/food/butter/on_a_stick //there's something so special about putting it on a stick.
name = "butter on a stick"
Expand All @@ -393,6 +395,7 @@
trash_type = /obj/item/stack/rods
food_flags = FOOD_FINGER_FOOD
venue_value = FOOD_PRICE_CHEAP
can_stick = FALSE

/obj/item/food/butter/make_processable()
AddElement(/datum/element/processable, TOOL_KNIFE, /obj/item/food/butterslice, 3, 3 SECONDS, table_required = TRUE, screentip_verb = "Slice")
Expand Down
5 changes: 3 additions & 2 deletions code/game/objects/items/puzzle_pieces.dm
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/puzzle/password, 32)
"green",
"blue",
"yellow",
"orange",
"brown",
COLOR_ORANGE, // orange is also not valid
COLOR_BROWN, // brown is NOT a valid byond color
"gray",
"purple",
)
for(var/digit in 0 to 9)
digit_to_color["[digit]"] = pick_n_take(possible_colors)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/structures/grille.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@

/obj/structure/grille/examine(mob/user)
. = ..()

if(resistance_flags & INDESTRUCTIBLE)
return
if(anchored)
. += span_notice("It's secured in place with <b>screws</b>. The rods look like they could be <b>cut</b> through.")
else
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,9 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0)
return FALSE

/obj/structure/window/reinforced/attackby_secondary(obj/item/tool, mob/user, params)
if(resistance_flags & INDESTRUCTIBLE)
balloon_alert(user, "too resilient!")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
switch(state)
if(RWINDOW_SECURE)
if(tool.tool_behaviour == TOOL_WELDER)
Expand Down Expand Up @@ -591,7 +594,8 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/window/unanchored/spawner, 0)

/obj/structure/window/reinforced/examine(mob/user)
. = ..()

if(resistance_flags & INDESTRUCTIBLE)
return
switch(state)
if(RWINDOW_SECURE)
. += span_notice("It's been screwed in with one way screws, you'd need to <b>heat them</b> to have any chance of backing them out.")
Expand Down
11 changes: 3 additions & 8 deletions code/modules/awaymissions/mission_code/murderdome.dm
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@

/obj/structure/window/reinforced/fulltile/indestructible
name = "robust window"
move_resist = MOVE_FORCE_OVERPOWERING
flags_1 = PREVENT_CLICK_UNDER_1
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF

/obj/structure/window/reinforced/fulltile/indestructible/screwdriver_act(mob/living/user, obj/item/tool)
return NONE

/obj/structure/window/reinforced/fulltile/indestructible/wrench_act(mob/living/user, obj/item/tool)
return NONE

/obj/structure/window/reinforced/fulltile/indestructible/crowbar_act(mob/living/user, obj/item/tool)
return NONE

/obj/structure/grille/indestructible
desc = "A STRONG framework of hardened plasteel rods, that you cannot possibly get through. If you were an engineer you would be drooling over its construction right now."
move_resist = MOVE_FORCE_OVERPOWERING
obj_flags = CONDUCTS_ELECTRICITY
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF

Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/under/jobs/centcom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
desc = "A dark colored uniform worn by CentCom's conscripted military forces."
icon_state = "military"
inhand_icon_state = "bl_suit"
can_adjust = FALSE
armor_type = /datum/armor/clothing_under/centcom_military

/datum/armor/clothing_under/centcom_military
Expand Down
4 changes: 2 additions & 2 deletions code/modules/fishing/fishing_rod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -830,19 +830,19 @@
/obj/projectile/fishing_cast
name = "fishing hook"
icon = 'icons/obj/fishing.dmi'
icon_state = "hook_projectile"
icon_state = "hook"
damage = 0
range = 5
suppressed = SUPPRESSED_VERY
can_hit_turfs = TRUE
projectile_angle = 180

var/obj/item/fishing_rod/owner
var/datum/beam/our_line

/obj/projectile/fishing_cast/fire(angle, atom/direct_target)
if(owner.hook)
icon_state = owner.hook.icon_state
transform = transform.Scale(1, -1)
. = ..()
if(!QDELETED(src))
our_line = owner.create_fishing_line(src, firer)
Expand Down
Loading

0 comments on commit d479a6b

Please sign in to comment.