Refactors screen objects to /atom/movable (#24068)

* introduce helper + remove unused proc

* we love compatibility

* Update code/_onclick/hud/action_button.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/action_button.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/alert.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/blob_overmind.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/blob_overmind.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/blob_overmind.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/martial_arts/martial.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mining/lavaland/loot/tendril_loot.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mob/living/carbon/human/species/shadow.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mob/living/carbon/human/species/shadow.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mob/living/living_update_status.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/screen_objects.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/screen_objects.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/_onclick/hud/screen_objects.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/objects/items/weapons/storage/internal.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/machinery/computer/camera_advanced.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/machinery/computer/camera_advanced.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/objects/items/weapons/storage/internal.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/mecha/mecha.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* deconflict

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Contrabang
2024-03-03 12:37:51 -05:00
committed by GitHub
parent cc433a3794
commit 87a318a7de
125 changed files with 1036 additions and 1047 deletions
+4 -4
View File
@@ -12,7 +12,7 @@
var/desc = null
var/obj/target = null
var/check_flags = 0
var/obj/screen/movable/action_button/button = null
var/atom/movable/screen/movable/action_button/button = null
var/button_icon = 'icons/mob/actions/actions.dmi'
var/background_icon_state = "bg_default"
var/buttontooltipstyle = ""
@@ -129,7 +129,7 @@
img.plane = FLOAT_PLANE + 1
button.add_overlay(img)
/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button)
/datum/action/proc/ApplyIcon(atom/movable/screen/movable/action_button/current_button)
current_button.cut_overlays()
if(icon_icon && button_icon_state)
var/image/img = image(icon_icon, current_button, button_icon_state)
@@ -165,7 +165,7 @@
I.ui_action_click(owner, type, left_click)
return TRUE
/datum/action/item_action/ApplyIcon(obj/screen/movable/action_button/current_button)
/datum/action/item_action/ApplyIcon(atom/movable/screen/movable/action_button/current_button)
if(use_itemicon)
if(target)
var/obj/item/I = target
@@ -436,7 +436,7 @@
owner.research_scanner = FALSE
..()
/datum/action/item_action/toggle_research_scanner/ApplyIcon(obj/screen/movable/action_button/current_button)
/datum/action/item_action/toggle_research_scanner/ApplyIcon(atom/movable/screen/movable/action_button/current_button)
current_button.cut_overlays()
if(button_icon && button_icon_state)
var/image/img = image(button_icon, current_button, "scan_mode")
+2 -2
View File
@@ -8,8 +8,8 @@
/datum/click_intercept
/// A reference to the client which is assigned this click intercept datum.
var/client/holder = null
/// Any `obj/screen/buttons` the client is meant to receive when assigned this click intercept datum.
var/list/obj/screen/buttons = list()
/// Any `atom/movable/screen/buttons` the client is meant to receive when assigned this click intercept datum.
var/list/atom/movable/screen/buttons = list()
/datum/click_intercept/New(client/C)
create_buttons()
+1 -1
View File
@@ -168,7 +168,7 @@
if(!C.check_has_body_select())
return
var/obj/screen/zone_sel/selector = C.mob.hud_used.zone_select
var/atom/movable/screen/zone_sel/selector = C.mob.hud_used.zone_select
selector.set_selected_zone(body_part, C.mob)
/datum/keybinding/mob/target/head
+1 -1
View File
@@ -19,7 +19,7 @@
var/perfect_disguise = FALSE
var/static/list/black_listed_form_types = list(
/obj/screen,
/atom/movable/screen,
/obj/singularity,
/obj/effect,
/mob/living/simple_animal/hostile/megafauna,
+2 -2
View File
@@ -1,5 +1,5 @@
/datum/status_effect/blob_burst
alert_type = /obj/screen/alert/status_effect/blob_burst
alert_type = /atom/movable/screen/alert/status_effect/blob_burst
var/datum/callback/blob_burst_callback
/datum/status_effect/blob_burst/on_creation(mob/living/new_owner, duration = 120 SECONDS, datum/callback/burst_callback)
@@ -20,7 +20,7 @@
/datum/status_effect/blob_burst/on_timeout()
blob_burst_callback.Invoke()
/obj/screen/alert/status_effect/blob_burst
/atom/movable/screen/alert/status_effect/blob_burst
name = "Blob burst"
desc = "You're about to burst into a blob, be sure to find a safe place before that you burst!"
icon = 'icons/mob/blob.dmi'
+25 -25
View File
@@ -4,18 +4,18 @@
id = "his_grace"
duration = -1
tick_interval = 4
alert_type = /obj/screen/alert/status_effect/his_grace
alert_type = /atom/movable/screen/alert/status_effect/his_grace
var/bloodlust = 0
/// Attached His Grace toolbox
var/obj/item/his_grace/toolbox
/obj/screen/alert/status_effect/his_grace
/atom/movable/screen/alert/status_effect/his_grace
name = "His Grace"
desc = "His Grace hungers, and you must feed Him."
icon_state = "his_grace"
alerttooltipstyle = "hisgrace"
/obj/screen/alert/status_effect/his_grace/MouseEntered(location, control, params)
/atom/movable/screen/alert/status_effect/his_grace/MouseEntered(location, control, params)
desc = initial(desc)
var/datum/status_effect/his_grace/HG = attached_effect
desc += "<br><font size=3><b>Current Bloodthirst: [HG.bloodlust]</b></font>\
@@ -61,9 +61,9 @@
/datum/status_effect/shadow_mend
id = "shadow_mend"
duration = 3 SECONDS
alert_type = /obj/screen/alert/status_effect/shadow_mend
alert_type = /atom/movable/screen/alert/status_effect/shadow_mend
/obj/screen/alert/status_effect/shadow_mend
/atom/movable/screen/alert/status_effect/shadow_mend
name = "Shadow Mend"
desc = "Shadowy energies wrap around your wounds, sealing them at a price. After healing, you will slowly lose health every three seconds for thirty seconds."
icon_state = "shadow_mend"
@@ -88,10 +88,10 @@
duration = 30 SECONDS
tick_interval = 3 SECONDS
status_type = STATUS_EFFECT_REFRESH
alert_type = /obj/screen/alert/status_effect/void_price
alert_type = /atom/movable/screen/alert/status_effect/void_price
var/price = 3 //This is how much hp you lose per tick. Each time the buff is refreshed, it increased by 1. Healing too much in a short period of time will cause your swift demise
/obj/screen/alert/status_effect/void_price
/atom/movable/screen/alert/status_effect/void_price
name = "Void Price"
desc = "Black tendrils cinch tightly against you, digging wicked barbs into your flesh."
icon_state = "shadow_mend"
@@ -108,10 +108,10 @@
id = "blooddrunk"
duration = 10
tick_interval = 0
alert_type = /obj/screen/alert/status_effect/blooddrunk
alert_type = /atom/movable/screen/alert/status_effect/blooddrunk
var/blooddrunk_damage_mod_remove = 4 // Damage is multiplied by this at the end of the status effect. Modify this one, it changes the _add
/obj/screen/alert/status_effect/blooddrunk
/atom/movable/screen/alert/status_effect/blooddrunk
name = "Blood-Drunk"
desc = "You are drunk on blood! Your pulse thunders in your ears! Nothing can harm you!" //not true, and the item description mentions its actual effect
icon_state = "blooddrunk"
@@ -147,7 +147,7 @@
if(islist(owner.stun_absorption) && owner.stun_absorption["blooddrunk"])
owner.remove_stun_absorption("blooddrunk")
/obj/screen/alert/status_effect/dash
/atom/movable/screen/alert/status_effect/dash
name = "Dash"
desc = "Your have the ability to dash!"
icon = 'icons/mob/actions/actions.dmi'
@@ -157,16 +157,16 @@
id = "dash"
duration = 5 SECONDS
tick_interval = 0
alert_type = /obj/screen/alert/status_effect/dash
alert_type = /atom/movable/screen/alert/status_effect/dash
/datum/status_effect/bloodswell
id = "bloodswell"
duration = 30 SECONDS
tick_interval = 0
alert_type = /obj/screen/alert/status_effect/blood_swell
alert_type = /atom/movable/screen/alert/status_effect/blood_swell
var/bonus_damage_applied = FALSE
/obj/screen/alert/status_effect/blood_swell
/atom/movable/screen/alert/status_effect/blood_swell
name = "Blood Swell"
desc = "Your body has been infused with crimson magics, your resistance to attacks has greatly increased!"
icon = 'icons/mob/actions/actions.dmi'
@@ -206,9 +206,9 @@
id = "vampire_gladiator"
duration = 30 SECONDS
tick_interval = 1 SECONDS
alert_type = /obj/screen/alert/status_effect/vampire_gladiator
alert_type = /atom/movable/screen/alert/status_effect/vampire_gladiator
/obj/screen/alert/status_effect/vampire_gladiator
/atom/movable/screen/alert/status_effect/vampire_gladiator
name = "Gladiatorial Resilience"
desc = "Roused by the thrill of the fight, your body has become more resistant to breaking!"
icon = 'icons/mob/actions/actions.dmi'
@@ -408,7 +408,7 @@
if(!heal_points)
return
/obj/screen/alert/status_effect/regenerative_core
/atom/movable/screen/alert/status_effect/regenerative_core
name = "Reinforcing Tendrils"
desc = "You can move faster than your broken body could normally handle!"
icon_state = "regenerative_core"
@@ -418,7 +418,7 @@
id = "Regenerative Core"
duration = 1 MINUTES
status_type = STATUS_EFFECT_REPLACE
alert_type = /obj/screen/alert/status_effect/regenerative_core
alert_type = /atom/movable/screen/alert/status_effect/regenerative_core
/datum/status_effect/regenerative_core/on_apply()
ADD_TRAIT(owner, TRAIT_IGNOREDAMAGESLOWDOWN, id)
@@ -551,9 +551,9 @@
id = "chainsaw_slaying"
duration = 5 SECONDS
status_type = STATUS_EFFECT_REFRESH
alert_type = /obj/screen/alert/status_effect/chainsaw
alert_type = /atom/movable/screen/alert/status_effect/chainsaw
/obj/screen/alert/status_effect/chainsaw
/atom/movable/screen/alert/status_effect/chainsaw
name = "Revved up!"
desc = "<span class='danger'>... guts, huge guts! Kill them... must kill them all!</span>"
icon_state = "chainsaw"
@@ -585,9 +585,9 @@
duration = -1
tick_interval = 2 SECONDS
status_type = STATUS_EFFECT_UNIQUE
alert_type = /obj/screen/alert/status_effect/hope
alert_type = /atom/movable/screen/alert/status_effect/hope
/obj/screen/alert/status_effect/hope
/atom/movable/screen/alert/status_effect/hope
name = "Hope."
desc = "A ray of hope beyond dispair."
icon_state = "hope"
@@ -640,13 +640,13 @@
return ..()
/datum/status_effect/drill_payback/on_apply()
owner.overlay_fullscreen("payback", /obj/screen/fullscreen/payback, 0)
owner.overlay_fullscreen("payback", /atom/movable/screen/fullscreen/payback, 0)
addtimer(CALLBACK(src, PROC_REF(payback_phase_2)), 2.7 SECONDS)
return TRUE
/datum/status_effect/drill_payback/proc/payback_phase_2()
owner.clear_fullscreen("payback")
owner.overlay_fullscreen("payback", /obj/screen/fullscreen/payback, 1)
owner.overlay_fullscreen("payback", /atom/movable/screen/fullscreen/payback, 1)
/datum/status_effect/drill_payback/tick() //They are not staying down. This will be a fight.
if(!drilled_successfully && (get_dist(owner, drilled) >= 9)) //We don't want someone drilling the safe at arivals then raiding bridge with the buff
@@ -752,9 +752,9 @@
id = "bearserker rage"
duration = 5 SECONDS
status_type = STATUS_EFFECT_REFRESH
alert_type = /obj/screen/alert/status_effect/bearserker_rage
alert_type = /atom/movable/screen/alert/status_effect/bearserker_rage
/obj/screen/alert/status_effect/bearserker_rage
/atom/movable/screen/alert/status_effect/bearserker_rage
name = "Bearserker Rage"
desc = "<span class='danger'>Blood flows between your fingers, and Foh'Sie roars; \"MORE BLOOD!\"</span>"
icon_state = "bearserker"
+17 -17
View File
@@ -5,9 +5,9 @@
id = "his_wrath"
duration = -1
tick_interval = 4
alert_type = /obj/screen/alert/status_effect/his_wrath
alert_type = /atom/movable/screen/alert/status_effect/his_wrath
/obj/screen/alert/status_effect/his_wrath
/atom/movable/screen/alert/status_effect/his_wrath
name = "His Wrath"
desc = "You fled from His Grace instead of feeding Him, and now you suffer."
icon_state = "his_grace"
@@ -188,10 +188,10 @@
id = "teleportation sickness"
duration = 30 SECONDS
status_type = STATUS_EFFECT_REFRESH
alert_type = /obj/screen/alert/status_effect/teleport_sickness
alert_type = /atom/movable/screen/alert/status_effect/teleport_sickness
var/teleports = 1
/obj/screen/alert/status_effect/teleport_sickness
/atom/movable/screen/alert/status_effect/teleport_sickness
name = "Teleportation sickness"
desc = "You feel like you are going to throw up with all this teleporting."
icon_state = "bluespace"
@@ -464,7 +464,7 @@
owner.Slur(actual_strength)
if(!alert_thrown)
alert_thrown = TRUE
owner.throw_alert("drunk", /obj/screen/alert/drunk)
owner.throw_alert("drunk", /atom/movable/screen/alert/drunk)
owner.sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC
// THRESHOLD_BRAWLING (60 SECONDS)
if(M)
@@ -1011,7 +1011,7 @@
/datum/status_effect/bubblegum_curse
id = "bubblegum curse"
alert_type = /obj/screen/alert/status_effect/bubblegum_curse
alert_type = /atom/movable/screen/alert/status_effect/bubblegum_curse
duration = -1 //Kill it. There is no other option.
tick_interval = 1 SECONDS
/// The damage the status effect does per tick.
@@ -1023,7 +1023,7 @@
/datum/status_effect/bubblegum_curse/on_creation(mob/living/new_owner, mob/living/source)
. = ..()
source_UID = source.UID()
owner.overlay_fullscreen("Bubblegum", /obj/screen/fullscreen/fog, 1)
owner.overlay_fullscreen("Bubblegum", /atom/movable/screen/fullscreen/fog, 1)
/datum/status_effect/bubblegum_curse/tick()
var/mob/living/simple_animal/hostile/megafauna/bubblegum/attacker = locateUID(source_UID)
@@ -1031,7 +1031,7 @@
qdel(src)
if(attacker.health <= attacker.maxHealth / 2)
owner.clear_fullscreen("Bubblegum")
owner.overlay_fullscreen("Bubblegum", /obj/screen/fullscreen/fog, 2)
owner.overlay_fullscreen("Bubblegum", /atom/movable/screen/fullscreen/fog, 2)
if(!coward_checking)
if(owner.z != attacker.z)
addtimer(CALLBACK(src, PROC_REF(onstation_coward_callback)), 12 SECONDS)
@@ -1123,20 +1123,20 @@
playsound(targetturf, 'sound/misc/exit_blood.ogg', 100, TRUE, -1)
addtimer(CALLBACK(attacker, TYPE_PROC_REF(/mob/living/simple_animal/hostile/megafauna/bubblegum, FindTarget), list(owner), 1), 2)
/obj/screen/alert/status_effect/bubblegum_curse
/atom/movable/screen/alert/status_effect/bubblegum_curse
name = "I SEE YOU"
desc = "YOUR SOUL WILL BE MINE FOR YOUR INSOLENCE"
icon_state = "bubblegumjumpscare"
/obj/screen/alert/status_effect/bubblegum_curse/Initialize(mapload)
/atom/movable/screen/alert/status_effect/bubblegum_curse/Initialize(mapload)
. = ..()
START_PROCESSING(SSobj, src)
/obj/screen/alert/status_effect/bubblegum_curse/Destroy()
/atom/movable/screen/alert/status_effect/bubblegum_curse/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/screen/alert/status_effect/bubblegum_curse/process()
/atom/movable/screen/alert/status_effect/bubblegum_curse/process()
var/new_filter = isnull(get_filter("ray"))
ray_filter_helper(1, 40,"#ce3030", 6, 20)
if(new_filter)
@@ -1146,10 +1146,10 @@
/datum/status_effect/abductor_cooldown
id = "abductor_cooldown"
alert_type = /obj/screen/alert/status_effect/abductor_cooldown
alert_type = /atom/movable/screen/alert/status_effect/abductor_cooldown
duration = 10 SECONDS
/obj/screen/alert/status_effect/abductor_cooldown
/atom/movable/screen/alert/status_effect/abductor_cooldown
name = "Teleportation cooldown"
desc = "Per article A-113, all experimentors must wait 10000 milliseconds between teleports in order to ensure no long term genetic or mental damage happens to experimentor or test subjects."
icon_state = "bluespace"
@@ -1160,7 +1160,7 @@
/// Purposebuilt for cursed slot machines.
/datum/status_effect/cursed
id = "cursed"
alert_type = /obj/screen/alert/status_effect/cursed
alert_type = /atom/movable/screen/alert/status_effect/cursed
/// The max number of curses a target can incur with this status effect.
var/max_curse_count = DEFAULT_MAX_CURSE_COUNT
/// The amount of times we have been "applied" to the target.
@@ -1304,12 +1304,12 @@
oxy = (curse_count * ticked_coefficient),
)
/obj/screen/alert/status_effect/cursed
/atom/movable/screen/alert/status_effect/cursed
name = "Cursed!"
desc = "The brand on your hand reminds you of your greed, yet you seem to be okay otherwise."
icon_state = "cursed_by_slots"
/obj/screen/alert/status_effect/cursed/update_desc()
/atom/movable/screen/alert/status_effect/cursed/update_desc()
. = ..()
var/datum/status_effect/cursed/linked_effect = attached_effect
var/curses = linked_effect.curse_count
+2 -2
View File
@@ -2,11 +2,11 @@
id = "frozen"
duration = 100
status_type = STATUS_EFFECT_UNIQUE
alert_type = /obj/screen/alert/status_effect/freon
alert_type = /atom/movable/screen/alert/status_effect/freon
var/icon/cube
var/can_melt = TRUE
/obj/screen/alert/status_effect/freon
/atom/movable/screen/alert/status_effect/freon
name = "Frozen Solid"
desc = "You're frozen inside an ice cube, and cannot move! You can still do stuff, like shooting. Resist out of the cube!"
icon_state = "frozen"
+2 -2
View File
@@ -2,11 +2,11 @@
id = "magic_disguise"
duration = -1
tick_interval = -1
alert_type = /obj/screen/alert/status_effect/magic_disguise
alert_type = /atom/movable/screen/alert/status_effect/magic_disguise
status_type = STATUS_EFFECT_REPLACE
var/datum/icon_snapshot/disguise
/obj/screen/alert/status_effect/magic_disguise
/atom/movable/screen/alert/status_effect/magic_disguise
name = "Disguised"
desc = "You are disguised as a crewmember."
icon = 'icons/mob/actions/actions.dmi'
+5 -5
View File
@@ -10,8 +10,8 @@
var/status_type = STATUS_EFFECT_UNIQUE //How many of the effect can be on one mob, and what happens when you try to add another
var/on_remove_on_mob_delete = FALSE //if we call on_remove() when the mob is deleted
var/examine_text //If defined, this text will appear when the mob is examined - to use he, she etc. use "SUBJECTPRONOUN" and replace it in the examines themselves
var/alert_type = /obj/screen/alert/status_effect //the alert thrown by the status effect, contains name and description
var/obj/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists
var/alert_type = /atom/movable/screen/alert/status_effect //the alert thrown by the status effect, contains name and description
var/atom/movable/screen/alert/status_effect/linked_alert = null //the alert itself, if it exists
/datum/status_effect/New(list/arguments)
on_creation(arglist(arguments))
@@ -28,7 +28,7 @@
duration = world.time + duration
tick_interval = world.time + tick_interval
if(alert_type)
var/obj/screen/alert/status_effect/A = owner.throw_alert(id, alert_type)
var/atom/movable/screen/alert/status_effect/A = owner.throw_alert(id, alert_type)
A.attached_effect = src //so the alert can reference us, if it needs to
linked_alert = A //so we can reference the alert, if we need to
if(duration > 0 || initial(tick_interval) > 0) //don't process if we don't care
@@ -89,12 +89,12 @@
// ALERT HOOK //
////////////////
/obj/screen/alert/status_effect
/atom/movable/screen/alert/status_effect
name = "Curse of Mundanity"
desc = "You don't feel any different..."
var/datum/status_effect/attached_effect
/obj/screen/alert/status_effect/Destroy()
/atom/movable/screen/alert/status_effect/Destroy()
if(attached_effect)
attached_effect.linked_alert = null
attached_effect = null