Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhials committed Feb 10, 2024
2 parents c03fead + 4f4b33f commit 0af0721
Show file tree
Hide file tree
Showing 57 changed files with 282 additions and 223 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/uplink.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
///Signal sent to a mob when they purchase an item from their uplink: (datum/uplink_handler/uplink_handler_source, atom/spawned_item, mob/user)
#define COMSIG_ON_UPLINK_PURCHASE "comsig_on_uplink_purchase"
9 changes: 3 additions & 6 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,6 @@
#define ROBOTIC_BRUTE_EXAMINE_TEXT "denting"
#define ROBOTIC_BURN_EXAMINE_TEXT "charring"

// If a mob has a higher threshold than this, the icon shown will be increased to the big fire icon.
#define MOB_BIG_FIRE_STACK_THRESHOLD 3

#define GRAB_PIXEL_SHIFT_PASSIVE 6
#define GRAB_PIXEL_SHIFT_AGGRESSIVE 12
#define GRAB_PIXEL_SHIFT_NECK 16
Expand Down Expand Up @@ -756,8 +753,8 @@ GLOBAL_LIST_INIT(human_heights_to_offsets, list(
#define WOUND_LAYER 3
/// Blood cult ascended halo layer, because there's currently no better solution for adding/removing
#define HALO_LAYER 2
/// Fire layer when you're on fire
#define FIRE_LAYER 1
/// The highest most layer for mob overlays. Unused
#define HIGHEST_LAYER 1

#define UPPER_BODY "upper body"
#define LOWER_BODY "lower body"
Expand Down Expand Up @@ -798,7 +795,7 @@ GLOBAL_LIST_INIT(layers_to_offset, list(
// BODY_BEHIND_LAYER (external organs like wings)
// BODY_FRONT_LAYER (external organs like wings)
// DAMAGE_LAYER (full body)
// FIRE_LAYER (full body)
// HIGHEST_LAYER (full body)
// UNIFORM_LAYER (full body)
// WOUND_LAYER (full body)
))
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/research/anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define MAX_CORES_HALLUCINATION 8
#define MAX_CORES_BIOSCRAMBLER 8
#define MAX_CORES_DIMENSIONAL 8
#define MAX_CORES_ECTOPLASMIC 8

///Defines for the different types of explosion a flux anomaly can have
#define FLUX_NO_EXPLOSION 0
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
/// If the incapacitated status effect will ignore a mob being agressively grabbed
#define IGNORE_GRAB (1<<2)

/// Maxamounts of fire stacks a mob can get
#define MAX_FIRE_STACKS 20
/// If a mob has a higher threshold than this, the icon shown will be increased to the big fire icon.
#define MOB_BIG_FIRE_STACK_THRESHOLD 3

// Grouped effect sources, see also code/__DEFINES/traits.dm

#define STASIS_MACHINE_EFFECT "stasis_machine"
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_TUMOR_SUPPRESSED "brain_tumor_suppressed"
/// Prevents hallucinations from the hallucination brain trauma (RDS)
#define TRAIT_RDS_SUPPRESSED "rds_suppressed"
/// mobs that have this trait cannot be extinguished
#define TRAIT_PERMANENTLY_ONFIRE "permanently_onfire"
/// Mobs that have this trait cannot be extinguished
#define TRAIT_NO_EXTINGUISH "no_extinguish"
/// Indicates if the mob is currently speaking with sign language
#define TRAIT_SIGN_LANG "sign_language"
/// This mob is able to use sign language over the radio.
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NO_DEBRAIN_OVERLAY" = TRAIT_NO_DEBRAIN_OVERLAY,
"TRAIT_NO_DNA_COPY" = TRAIT_NO_DNA_COPY,
"TRAIT_NO_DNA_SCRAMBLE" = TRAIT_NO_DNA_SCRAMBLE,
"TRAIT_NO_EXTINGUISH" = TRAIT_NO_EXTINGUISH,
"TRAIT_NO_FLOATING_ANIM" = TRAIT_NO_FLOATING_ANIM,
"TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE,
"TRAIT_NO_GUN_AKIMBO" = TRAIT_NO_GUN_AKIMBO,
Expand Down Expand Up @@ -353,7 +354,6 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_PASSTABLE" = TRAIT_PASSTABLE,
"TRAIT_PERFECT_ATTACKER" = TRAIT_PERFECT_ATTACKER,
"TRAIT_PERMANENTLY_MORTAL" = TRAIT_PERMANENTLY_MORTAL,
"TRAIT_PERMANENTLY_ONFIRE" = TRAIT_PERMANENTLY_ONFIRE,
"TRAIT_PHOTOGRAPHER" = TRAIT_PHOTOGRAPHER,
"TRAIT_PIERCEIMMUNE" = TRAIT_PIERCEIMMUNE,
"TRAIT_PLANT_SAFE" = TRAIT_PLANT_SAFE,
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/traits/admin_tooling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_NO_AUGMENTS" = TRAIT_NO_AUGMENTS,
"TRAIT_NO_BLOOD_OVERLAY" = TRAIT_NO_BLOOD_OVERLAY,
"TRAIT_NO_DNA_COPY" = TRAIT_NO_DNA_COPY,
"TRAIT_NO_EXTINGUISH" = TRAIT_NO_EXTINGUISH,
"TRAIT_NO_GLIDE" = TRAIT_NO_GLIDE,
"TRAIT_NO_PLASMA_TRANSFORM" = TRAIT_NO_PLASMA_TRANSFORM,
"TRAIT_NO_SLIP_ALL" = TRAIT_NO_SLIP_ALL,
Expand Down Expand Up @@ -162,7 +163,6 @@ GLOBAL_LIST_INIT(admin_visible_traits, list(
"TRAIT_PARALYSIS_R_LEG" = TRAIT_PARALYSIS_R_LEG,
"TRAIT_PASSTABLE" = TRAIT_PASSTABLE,
"TRAIT_PERFECT_ATTACKER" = TRAIT_PERFECT_ATTACKER,
"TRAIT_PERMANENTLY_ONFIRE" = TRAIT_PERMANENTLY_ONFIRE,
"TRAIT_PHOTOGRAPHER" = TRAIT_PHOTOGRAPHER,
"TRAIT_PIERCEIMMUNE" = TRAIT_PIERCEIMMUNE,
"TRAIT_PLANT_SAFE" = TRAIT_PLANT_SAFE,
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ SUBSYSTEM_DEF(research)
/obj/item/assembly/signaler/anomaly/hallucination = MAX_CORES_HALLUCINATION,
/obj/item/assembly/signaler/anomaly/bioscrambler = MAX_CORES_BIOSCRAMBLER,
/obj/item/assembly/signaler/anomaly/dimensional = MAX_CORES_DIMENSIONAL,
/obj/item/assembly/signaler/anomaly/ectoplasm = MAX_CORES_ECTOPLASMIC,
)

/// Lookup list for ordnance briefers.
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai/hunting_behavior/hunting_mouse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
finding_behavior = /datum/ai_behavior/find_hunt_target/mouse_cable
hunt_targets = list(/obj/structure/cable)
hunt_range = 0 // Only look below us
hunt_chance = 5
hunt_chance = 1

// When looking for a cable, we can only bite things we can reach.
/datum/ai_behavior/find_hunt_target/mouse_cable
Expand Down
11 changes: 1 addition & 10 deletions code/datums/components/uplink.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,6 @@
new /obj/effect/decal/cleanable/ash(get_turf(uplink_item))
qdel(uplink_item)

/// Adds telecrystals to the uplink. It is bad practice to use this outside of the component itself.
/datum/component/uplink/proc/add_telecrystals(telecrystals_added)
set_telecrystals(uplink_handler.telecrystals + telecrystals_added)

/// Sets the telecrystals of the uplink. It is bad practice to use this outside of the component itself.
/datum/component/uplink/proc/set_telecrystals(new_telecrystal_amount)
uplink_handler.telecrystals = new_telecrystal_amount
uplink_handler.on_update()

/datum/component/uplink/InheritComponent(datum/component/uplink/uplink)
lockable |= uplink.lockable
active |= uplink.active
Expand All @@ -135,7 +126,7 @@
if(!silent)
to_chat(user, span_notice("You slot [telecrystals] into [parent] and charge its internal uplink."))
var/amt = telecrystals.amount
uplink_handler.telecrystals += amt
uplink_handler.add_telecrystals(amt)
telecrystals.use(amt)
log_uplink("[key_name(user)] loaded [amt] telecrystals into [parent]'s uplink")

Expand Down
26 changes: 26 additions & 0 deletions code/datums/elements/permanent_fire_overlay.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// When applied to a mob, they will always have a fire overlay regardless of if they are *actually* on fire.
/datum/element/perma_fire_overlay

/datum/element/perma_fire_overlay/Attach(atom/target)
. = ..()
if(!isliving(target))
return ELEMENT_INCOMPATIBLE

RegisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(add_fire_overlay))
target.update_appearance(UPDATE_OVERLAYS)
ADD_TRAIT(target, TRAIT_NO_EXTINGUISH, ELEMENT_TRAIT(type))

/datum/element/perma_fire_overlay/Detach(atom/target)
. = ..()
UnregisterSignal(target, COMSIG_ATOM_UPDATE_OVERLAYS)
REMOVE_TRAIT(target, TRAIT_NO_EXTINGUISH, ELEMENT_TRAIT(type))
target.update_appearance(UPDATE_OVERLAYS)

/datum/element/perma_fire_overlay/proc/add_fire_overlay(mob/living/source, list/overlays)
SIGNAL_HANDLER

var/mutable_appearance/created_overlay = source.get_fire_overlay(stacks = MAX_FIRE_STACKS, on_fire = TRUE)
if(isnull(created_overlay))
return

overlays |= created_overlay
7 changes: 4 additions & 3 deletions code/datums/elements/uplink_reimburse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))
RegisterSignal(target, COMSIG_ITEM_ATTEMPT_TC_REIMBURSE, PROC_REF(reimburse))
RegisterSignal(target,COMSIG_TRAITOR_ITEM_USED(target.type), PROC_REF(used))

/datum/element/uplink_reimburse/Detach(datum/target)
UnregisterSignal(target, list(COMSIG_ATOM_EXAMINE, COMSIG_TRAITOR_ITEM_USED(target.type), COMSIG_ITEM_ATTEMPT_TC_REIMBURSE))

Expand All @@ -47,10 +47,11 @@

to_chat(user, span_notice("You tap [uplink_comp.uplink_handler] with [refund_item], and a moment after [refund_item] disappears in a puff of red smoke!"))
do_sparks(2, source = uplink_comp.uplink_handler)
uplink_comp.add_telecrystals(refundable_tc)
uplink_comp.uplink_handler.add_telecrystals(refundable_tc)
qdel(refund_item)

/// If the item is used, it needs to no longer be refundable
/datum/element/uplink_reimburse/proc/used(datum/target)
SIGNAL_HANDLER

Detach(target)
11 changes: 8 additions & 3 deletions code/datums/mind/_mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,14 @@
if(check_rights(R_FUN))
var/datum/component/uplink/U = find_syndicate_uplink()
if(U)
var/crystals = input("Amount of telecrystals for [key]","Syndicate uplink", U.uplink_handler.telecrystals) as null | num
if(!isnull(crystals))
U.uplink_handler.telecrystals = crystals
var/crystals = tgui_input_number(
user = usr,
message = "Amount of telecrystals for [key]",
title = "Syndicate uplink",
default = U.uplink_handler.telecrystals,
)
if(crystals && isnum(crystals))
U.uplink_handler.set_telecrystals(crystals)
message_admins("[key_name_admin(usr)] changed [current]'s telecrystal count to [crystals].")
log_admin("[key_name(usr)] changed [current]'s telecrystal count to [crystals].")
if("progression")
Expand Down
40 changes: 19 additions & 21 deletions code/datums/status_effects/debuffs/fire_stacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/// Current amount of stacks we have
var/stacks
/// Maximum of stacks that we could possibly get
var/stack_limit = 20
var/stack_limit = MAX_FIRE_STACKS
/// What status effect types do we remove uppon being applied. These are just deleted without any deduction from our or their stacks when forced.
var/list/enemy_types
/// What status effect types do we merge into if they exist. Ignored when forced.
Expand Down Expand Up @@ -116,12 +116,8 @@
owner.clear_alert(ALERT_FIRE)
else if(!was_on_fire && owner.on_fire)
owner.throw_alert(ALERT_FIRE, /atom/movable/screen/alert/fire)

/**
* Used to update owner's effect overlay
*/

/datum/status_effect/fire_handler/proc/update_overlay()
owner.update_appearance(UPDATE_OVERLAYS)
update_particles()

/datum/status_effect/fire_handler/fire_stacks
id = "fire_stacks" //fire_stacks and wet_stacks should have different IDs or else has_status_effect won't work
Expand All @@ -132,8 +128,6 @@

/// If we're on fire
var/on_fire = FALSE
/// Stores current fire overlay icon state, for optimisation purposes
var/last_icon_state
/// Reference to the mob light emitter itself
var/obj/effect/dummy/lighting_obj/moblight
/// Type of mob light emitter we use when on fire
Expand All @@ -160,8 +154,6 @@
return TRUE

deal_damage(seconds_between_ticks)
update_overlay()
update_particles()

/datum/status_effect/fire_handler/fire_stacks/update_particles()
if(on_fire)
Expand Down Expand Up @@ -239,8 +231,6 @@
moblight = new moblight_type(owner)

cache_stacks()
update_overlay()
update_particles()
SEND_SIGNAL(owner, COMSIG_LIVING_IGNITED, owner)
return TRUE

Expand All @@ -254,25 +244,33 @@
owner.clear_mood_event("on_fire")
SEND_SIGNAL(owner, COMSIG_LIVING_EXTINGUISHED, owner)
cache_stacks()
update_overlay()
update_particles()
for(var/obj/item/equipped in owner.get_equipped_items())
equipped.extinguish()

/datum/status_effect/fire_handler/fire_stacks/on_remove()
if(on_fire)
extinguish()
set_stacks(0)
update_overlay()
update_particles()
UnregisterSignal(owner, COMSIG_ATOM_UPDATE_OVERLAYS)
owner.update_appearance(UPDATE_OVERLAYS)
return ..()

/datum/status_effect/fire_handler/fire_stacks/update_overlay()
last_icon_state = owner.update_fire_overlay(stacks, on_fire, last_icon_state)

/datum/status_effect/fire_handler/fire_stacks/on_apply()
. = ..()
update_overlay()
RegisterSignal(owner, COMSIG_ATOM_UPDATE_OVERLAYS, PROC_REF(add_fire_overlay))
owner.update_appearance(UPDATE_OVERLAYS)

/datum/status_effect/fire_handler/fire_stacks/proc/add_fire_overlay(mob/living/source, list/overlays)
SIGNAL_HANDLER

if(stacks <= 0 || !on_fire)
return

var/mutable_appearance/created_overlay = owner.get_fire_overlay(stacks, on_fire)
if(isnull(created_overlay))
return

overlays |= created_overlay

/obj/effect/dummy/lighting_obj/moblight/fire
name = "fire"
Expand Down
5 changes: 3 additions & 2 deletions code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@

flick("autolathe_[item_inserted.has_material_type(/datum/material/glass) ? "r" : "o"]", src)

directly_use_power(round((amount_inserted / SHEET_MATERIAL_AMOUNT) * active_power_usage * 0.0025))
//we use initial(active_power_usage) because higher tier parts will have higher active usage but we have no benifit from it
directly_use_power(ROUND_UP((amount_inserted / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * 0.01 * initial(active_power_usage)))

/obj/machinery/autolathe/ui_interact(mob/user, datum/tgui/ui)
if(!is_operational)
Expand Down Expand Up @@ -273,7 +274,7 @@
var/charge_per_item = 0
for(var/material in design.materials)
charge_per_item += design.materials[material]
charge_per_item = min(active_power_usage, round(charge_per_item * material_cost_coefficient))
charge_per_item = ROUND_UP((charge_per_item / (MAX_STACK_SIZE * SHEET_MATERIAL_AMOUNT)) * material_cost_coefficient * 0.05 * active_power_usage)
var/build_time_per_item = (design.construction_time * design.lathe_time_factor) ** 0.8

//do the printing sequentially
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/stacks/telecrystal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

var/datum/component/uplink/hidden_uplink = uplink.GetComponent(/datum/component/uplink)
if(hidden_uplink)
hidden_uplink.add_telecrystals(amount)
hidden_uplink.uplink_handler.add_telecrystals(amount)
use(amount)
to_chat(user, span_notice("You press [src] onto yourself and charge your hidden uplink."))
return ITEM_INTERACT_SUCCESS
Expand Down
7 changes: 3 additions & 4 deletions code/game/turfs/open/lava.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

/turf/open/lava/Destroy()
for(var/mob/living/leaving_mob in contents)
REMOVE_TRAIT(leaving_mob, TRAIT_PERMANENTLY_ONFIRE, TURF_TRAIT)
leaving_mob.RemoveElement(/datum/element/perma_fire_overlay)
return ..()

/turf/open/lava/update_overlays()
Expand Down Expand Up @@ -144,7 +144,7 @@
/turf/open/lava/Exited(atom/movable/gone, direction)
. = ..()
if(isliving(gone) && !islava(gone.loc))
REMOVE_TRAIT(gone, TRAIT_PERMANENTLY_ONFIRE, TURF_TRAIT)
gone.RemoveElement(/datum/element/perma_fire_overlay)

/turf/open/lava/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(burn_stuff(AM))
Expand Down Expand Up @@ -311,10 +311,9 @@
return

var/mob/living/burn_living = burn_target
ADD_TRAIT(burn_living, TRAIT_PERMANENTLY_ONFIRE, TURF_TRAIT)
burn_living.AddElement(/datum/element/perma_fire_overlay)
burn_living.ignite_mob()
burn_living.adjust_fire_stacks(lava_firestacks * seconds_per_tick)
burn_living.update_fire()
burn_living.adjustFireLoss(lava_damage * seconds_per_tick)

/turf/open/lava/can_cross_safely(atom/movable/crossing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ GLOBAL_LIST_EMPTY(jam_on_wardec)
var/tc_per_nukie = round(tc_to_distribute / (length(orphans)+length(uplinks)))

for (var/datum/component/uplink/uplink in uplinks)
uplink.add_telecrystals(tc_per_nukie)
uplink.uplink_handler.add_telecrystals(tc_per_nukie)
tc_to_distribute -= tc_per_nukie

for (var/mob/living/L in orphans)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/antagonists/nukeop/nukeop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
var/extra_tc = CEILING(GLOB.joined_player_list.len/5, 5)
var/datum/component/uplink/uplink = owner.find_syndicate_uplink()
if (uplink)
uplink.add_telecrystals(extra_tc)
uplink.uplink_handler.add_telecrystals(extra_tc)

var/datum/component/uplink/uplink = owner.find_syndicate_uplink()
if(uplink)
Expand Down Expand Up @@ -617,7 +617,7 @@
nukie.mind.add_antag_datum(antag_datum, src)

var/datum/component/uplink/uplink = nukie.mind.find_syndicate_uplink()
uplink?.set_telecrystals(tc_to_spawn)
uplink?.uplink_handler.set_telecrystals(tc_to_spawn)

// add some pizzazz
do_sparks(4, FALSE, spawn_loc)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/space_dragon/space_dragon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
players_to_carp_taken[carpy.key] += 1
var/list = ""
for(var/carp_user in players_to_carp_taken)
list += "<li><b>[carp_user]<b>, who played <b>[players_to_carp_taken[carp_user]]</b> space carps.</li>"
list += "<li><b>[carp_user]</b>, who played <b>[players_to_carp_taken[carp_user]]</b> space carps.</li>"
parts += list
parts += "</ul>"

Expand Down
Loading

0 comments on commit 0af0721

Please sign in to comment.