Skip to content

Commit

Permalink
Merge upstream 27.11.24 (#822)
Browse files Browse the repository at this point in the history
## About The Pull Request
Мерге
  • Loading branch information
larentoun authored Nov 27, 2024
2 parents 4343a80 + f148aff commit f663542
Show file tree
Hide file tree
Showing 92 changed files with 654 additions and 226 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/ai/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

///For JPS pathing, the maximum length of a path we'll try to generate. Should be modularized depending on what we're doing later on
#define AI_MAX_PATH_LENGTH 30 // 30 is possibly overkill since by default we lose interest after 14 tiles of distance, but this gives wiggle room for weaving around obstacles
#define AI_BOT_PATH_LENGTH 75
#define AI_BOT_PATH_LENGTH 60

// How far should we, by default, be looking for interesting things to de-idle?
#define AI_DEFAULT_INTERESTING_DIST 10
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/ai/bot_keys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ DEFINE_BITFIELD(repairbot_flags, list(
#define BB_RADIO_CHANNEL "radio_channel"
///list of unreachable things we will temporarily ignore
#define BB_TEMPORARY_IGNORE_LIST "temporary_ignore_list"
///penalty cooldown if we are unable to path to any beacons
#define BB_BOT_BEACON_COOLDOWN "bot_beacon_cooldown"

// medbot keys
///the patient we must heal
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#define span_blue(str) ("<span class='blue'>" + str + "</span>")
#define span_blueteamradio(str) ("<span class='blueteamradio'>" + str + "</span>")
#define span_bold(str) ("<span class='bold'>" + str + "</span>")
/// This span outputs to OOC, it's meant for OOC announcements
/// Use span_bolddanger for IC danger messages, it's identical to this
#define span_boldannounce(str) ("<span class='boldannounce'>" + str + "</span>")
#define span_bolddanger(str) ("<span class='bolddanger'>" + str + "</span>")
#define span_bolditalic(str) ("<span class='bolditalic'>" + str + "</span>")
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/maths.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///Calculate the angle between two movables and the west|east coordinate
/proc/get_angle(atom/movable/start, atom/movable/end)//For beams.
/proc/get_angle(atom/movable/start, atom/movable/end)
if(!start || !end)
return 0
var/dy =(ICON_SIZE_Y * end.y + end.pixel_y) - (ICON_SIZE_Y * start.y + start.pixel_y)
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystem/dynamic/dynamic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ SUBSYSTEM_DEF(dynamic)
failed = TRUE //AFK client
if(!failed && L.stat)
if(HAS_TRAIT(L, TRAIT_SUICIDED)) //Suicider
msg += "<b>[L.name]</b> ([L.key]), the [L.job] ([span_boldannounce("Suicide")])\n"
msg += "<b>[L.name]</b> ([L.key]), the [L.job] ([span_bolddanger("Suicide")])\n"
failed = TRUE //Disconnected client
if(!failed && (L.stat == UNCONSCIOUS || L.stat == HARD_CRIT))
msg += "<b>[L.name]</b> ([L.key]), the [L.job] (Dying)\n"
Expand All @@ -670,7 +670,7 @@ SUBSYSTEM_DEF(dynamic)
if(D.mind && D.mind.current == L)
if(L.stat == DEAD)
if(HAS_TRAIT(L, TRAIT_SUICIDED)) //Suicider
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] ([span_boldannounce("Suicide")])\n"
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] ([span_bolddanger("Suicide")])\n"
continue //Disconnected client
else
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] (Dead)\n"
Expand All @@ -679,7 +679,7 @@ SUBSYSTEM_DEF(dynamic)
if(D.can_reenter_corpse)
continue //Adminghost, or cult/wizard ghost
else
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] ([span_boldannounce("Ghosted")])\n"
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] ([span_bolddanger("Ghosted")])\n"
continue //Ghosted while alive

var/concatenated_message = msg.Join()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai/movement/ai_movement_jps.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

/datum/ai_movement/jps/bot/travel_to_beacon
maximum_length = AI_BOT_PATH_LENGTH
max_pathing_attempts = 20
max_pathing_attempts = 10

/datum/ai_movement/jps/modsuit
maximum_length = MOD_AI_RANGE
4 changes: 2 additions & 2 deletions code/datums/components/irradiated.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@

if (isliving(source))
var/mob/living/living_source = source
to_chat(user, span_boldannounce("[icon2html(geiger_counter, user)] Subject is irradiated. Contamination traces back to roughly [DisplayTimeText(world.time - beginning_of_irradiation, 5)] ago. Current toxin levels: [living_source.getToxLoss()]."))
to_chat(user, span_bolddanger("[icon2html(geiger_counter, user)] Subject is irradiated. Contamination traces back to roughly [DisplayTimeText(world.time - beginning_of_irradiation, 5)] ago. Current toxin levels: [living_source.getToxLoss()]."))
else
// In case the green wasn't obvious enough...
to_chat(user, span_boldannounce("[icon2html(geiger_counter, user)] Target is irradiated."))
to_chat(user, span_bolddanger("[icon2html(geiger_counter, user)] Target is irradiated."))

return COMSIG_GEIGER_COUNTER_SCAN_SUCCESSFUL

Expand Down
135 changes: 135 additions & 0 deletions code/datums/components/tug_towards.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/// "Tugs" an atom towards another atom. That is to say, it will visually
/// pixel offset to look like it is close to the point it's tugging to,
/// but not actually move position.
/datum/component/tug_towards
// If multiple are specified, will tug in between them.
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS

VAR_PRIVATE
/// atom -> strength
list/list/tugging_to_targets = list()


current_tug_offset_x = 0
current_tug_offset_y = 0

/datum/component/tug_towards/Initialize(
/// The atom we are tugging towards.
atom/tugging_to,

/// Strength of the tug, as a number 0 through 1.
/// 0 means no tug, 1 means that if you're on an adjacent tile
/// you will be directly at the corner of the tugging_to_target.
/// Default is 0.8, which provides a healthy amount of
/// distance.
strength
)
if (!isatom(parent))
return COMPONENT_INCOMPATIBLE

ASSERT(istype(tugging_to))

add_tugging_to_target(tugging_to, strength)

RegisterSignals(parent, list(
COMSIG_MOVABLE_MOVED,
COMSIG_MOB_BUCKLED,
COMSIG_MOB_UNBUCKLED,
), PROC_REF(update_tug))

/datum/component/tug_towards/Destroy(force)
tugging_to_targets.Cut()

animate(
parent,
pixel_x = -current_tug_offset_x,
pixel_y = -current_tug_offset_y,
time = 0.2 SECONDS,
flags = ANIMATION_RELATIVE
)

return ..()

/datum/component/tug_towards/InheritComponent(
datum/component/tug_towards/new_tug_towards,
i_am_original,

atom/tugging_to,
strength,
)
add_tugging_to_target(tugging_to, strength)

/datum/component/tug_towards/proc/remove_tug_target(atom/target)
tugging_to_targets -= target

if (tugging_to_targets.len == 0)
qdel(src)
else
update_tug()

/datum/component/tug_towards/proc/add_tugging_to_target(
atom/tugging_to,
strength = 0.8,
)
PRIVATE_PROC(TRUE)

tugging_to_targets[tugging_to] = strength
RegisterSignal(tugging_to, COMSIG_PREQDELETED, PROC_REF(on_tugging_to_qdeleting))
RegisterSignal(tugging_to, COMSIG_MOVABLE_MOVED, PROC_REF(update_tug))

update_tug()

/datum/component/tug_towards/proc/on_tugging_to_qdeleting(datum/target)
SIGNAL_HANDLER
PRIVATE_PROC(TRUE)

tugging_to_targets -= target
if (tugging_to_targets.len == 0)
qdel(src)
else
update_tug()

/datum/component/tug_towards/proc/update_tug()
SIGNAL_HANDLER
PRIVATE_PROC(TRUE)

var/atom/atom_parent = parent
var/mob/mob_parent = parent

var/total_tug_x = 0
var/total_tug_y = 0

if (!istype(mob_parent) || !mob_parent.buckled)
var/tuggers = 0

for (var/atom/target as anything in tugging_to_targets)
if (target.z != atom_parent.z)
continue

tuggers += 1
var/strength = tugging_to_targets[target]
total_tug_x += SIGN(target.x - atom_parent.x) * strength
total_tug_y += SIGN(target.y - atom_parent.y) * strength

// Intentionally not trig--something at a corner with a strength of 1 should have
// you at the corner, rather than root(2).
total_tug_x /= tuggers
total_tug_y /= tuggers

var/half_size = world.icon_size * 0.5
total_tug_x *= half_size
total_tug_y *= half_size

if (total_tug_x == current_tug_offset_x && total_tug_y == current_tug_offset_y)
return

animate(
atom_parent,
pixel_x = -current_tug_offset_x + total_tug_x,
pixel_y = -current_tug_offset_y + total_tug_y,
time = 0.2 SECONDS,
flags = ANIMATION_RELATIVE
)

current_tug_offset_x = total_tug_x
current_tug_offset_y = total_tug_y
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/prosthetic_limb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
old_limb = human_holder.return_and_replace_bodypart(surplus, special = TRUE)

/datum/quirk/prosthetic_limb/post_add()
to_chat(quirk_holder, span_boldannounce("Your [slot_string] has been replaced with a surplus prosthetic. It has almost no muscle force, and makes you unhealthier by just having it. Additionally, \
to_chat(quirk_holder, span_bolddanger("Your [slot_string] has been replaced with a surplus prosthetic. It has almost no muscle force, and makes you unhealthier by just having it. Additionally, \
you need to use a welding tool and cables to repair it, instead of sutures and regenerative meshes."))

/datum/quirk/prosthetic_limb/remove()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/prosthetic_organ.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
STOP_PROCESSING(SSobj, old_organ)

/datum/quirk/prosthetic_organ/post_add()
to_chat(quirk_holder, span_boldannounce("Your [slot_string] has been replaced with a surplus organ. It is weak and highly unstable. \
to_chat(quirk_holder, span_bolddanger("Your [slot_string] has been replaced with a surplus organ. It is weak and highly unstable. \
Additionally, any EMP will make it stop working entirely."))

/datum/quirk/prosthetic_organ/remove()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/quadruple_amputee.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
human_holder.del_and_replace_bodypart(new /obj/item/bodypart/leg/right/robot/surplus, special = TRUE)

/datum/quirk/quadruple_amputee/post_add()
to_chat(quirk_holder, span_boldannounce("All your limbs have been replaced with surplus prosthetics. They are fragile and will easily come apart under duress. \
to_chat(quirk_holder, span_bolddanger("All your limbs have been replaced with surplus prosthetics. They are fragile and will easily come apart under duress. \
Additionally, you need to use a welding tool and cables to repair them, instead of bruise packs and ointment."))
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/tin_man.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
new_organ.Insert(human_holder, special = TRUE, movement_flags = DELETE_IF_REPLACED)

/datum/quirk/tin_man/post_add()
to_chat(quirk_holder, span_boldannounce("Most of your internal organs have been replaced with surplus prosthetics. They are fragile and will easily come apart under duress. \
to_chat(quirk_holder, span_bolddanger("Most of your internal organs have been replaced with surplus prosthetics. They are fragile and will easily come apart under duress. \
Additionally, any EMP will make them stop working entirely."))
2 changes: 1 addition & 1 deletion code/datums/quirks/neutral_quirks/monochromatic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/datum/quirk/monochromatic/post_add()
if(is_detective_job(quirk_holder.mind.assigned_role))
to_chat(quirk_holder, span_boldannounce("Mmm. Nothing's ever clear on this station. It's all shades of gray..."))
to_chat(quirk_holder, span_bolddanger("Mmm. Nothing's ever clear on this station. It's all shades of gray..."))
quirk_holder.playsound_local(quirk_holder, 'sound/ambience/security/ambidet1.ogg', 50, FALSE)

/datum/quirk/monochromatic/remove()
Expand Down
6 changes: 3 additions & 3 deletions code/datums/quirks/neutral_quirks/transhumanist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@
if(!slot_string)
return
if(isbodypart(old_part))
to_chat(quirk_holder, span_boldannounce("Your [slot_string] has been replaced with a robotic limb. You need to use a welding tool and cables to repair it, instead of sutures and regenerative meshes."))
to_chat(quirk_holder, span_bolddanger("Your [slot_string] has been replaced with a robotic limb. You need to use a welding tool and cables to repair it, instead of sutures and regenerative meshes."))
else if (old_part.name == "eyes")
to_chat(quirk_holder, span_boldannounce("You replaced your eyes with flashlights, not cameras. You can't see a thing!"))
to_chat(quirk_holder, span_bolddanger("You replaced your eyes with flashlights, not cameras. You can't see a thing!"))
else if (isorgan(old_part))
to_chat(quirk_holder, span_boldannounce("Your [slot_string] brings you one step closer to silicon perfection, but you feel you're not quite there yet."))
to_chat(quirk_holder, span_bolddanger("Your [slot_string] brings you one step closer to silicon perfection, but you feel you're not quite there yet."))

/datum/quirk/transhumanist/remove()
if(isnull(old_part))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/quirks/positive_quirks/chip_connector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
connector.Insert(carbon_holder, special = TRUE)

/datum/quirk/chip_connector/post_add()
to_chat(quirk_holder, span_boldannounce(desc)) // efficiency is clever laziness
to_chat(quirk_holder, span_bolddanger(desc)) // efficiency is clever laziness

/datum/quirk/chip_connector/remove()
qdel(connector)
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/ash_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
weather_duration_upper = 1200
weather_overlay = "ash_storm"

end_message = span_boldannounce("The shrieking wind whips away the last of the ash and falls to its usual murmur. It should be safe to go outside now.")
end_message = span_bolddanger("The shrieking wind whips away the last of the ash and falls to its usual murmur. It should be safe to go outside now.")
end_duration = 300
end_overlay = "light_ash"

Expand Down
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/snow_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use_glow = FALSE

end_duration = 100
end_message = span_boldannounce("The snowfall dies down, it should be safe to go outside again.")
end_message = span_bolddanger("The snowfall dies down, it should be safe to go outside again.")

area_type = /area
protect_indoors = TRUE
Expand Down
Loading

0 comments on commit f663542

Please sign in to comment.