Files
Paradise/code/modules/telesci/telepad.dm
T
warriorstar-orionandGitHub 525c68d617 Attack chain, initial setup. (pull *immediately* for *any* TM issues) (#26834)
* refactor: Attack chain, initial setup.

* migrate curtain to make dreamchecker happy

* update thurible

* don't call attacked_by separately for legacy attack chain

* remove duplicate proc

* condense similar code, put allowances for legacy code in new procs

* update docs, include diagram source

* add comment on how to update diagram

* fix admonition

* mindflayer updates

* remove commented out code

* clarify all steps

* after_attack should be overridable

* whoops

* retrofit recent changes

* duh, can't restrict this yet because of tool_acts

* i hate ore bags with the fire of a thousand suns

* return correct value for object attack logic

* Various cleanups.

We don't want to attempt to pull stuff out of `/obj/item/attackby`,
because those pieces are part of the related objects' migrations, not
`/obj/item` itself. Attempting to do this causes knockon effects where
things expected to call e.g. `/obj/item/storage/attackby` in the call
chain were not ferried over to the new item interaction code, because
the related objects hadn't actually been migrated over yet.

I've used refactoring /obj/vehicle as the example for migrating
`attackby` methods instead.

* simplify some argument names

* fuck it

* make it do the thing

* Rename CI module call

* Prove that CI works

* improve test output

* aaand fix it again

* fix curtain tool interactions

* fix compile error

* fix compile error

* Better docs, introduce migration plan tool.
2024-12-02 23:36:36 +00:00

109 lines
3.2 KiB
Plaintext

///SCI TELEPAD///
/obj/machinery/telepad
name = "telepad"
desc = "A bluespace telepad used for teleporting objects to and from a location."
icon = 'icons/obj/telescience.dmi'
icon_state = "pad-idle"
anchored = TRUE
idle_power_consumption = 200
active_power_consumption = 5000
var/efficiency
/obj/machinery/telepad/Initialize(mapload)
. = ..()
component_parts = list()
component_parts += new /obj/item/circuitboard/telesci_pad(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null, 2)
component_parts += new /obj/item/stock_parts/capacitor(null)
component_parts += new /obj/item/stack/sheet/glass(null)
component_parts += new /obj/item/stack/cable_coil(null, 1)
RefreshParts()
/obj/machinery/telepad/upgraded/Initialize(mapload)
. = ..()
component_parts = list()
component_parts += new /obj/item/circuitboard/telesci_pad(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null, 2)
component_parts += new /obj/item/stock_parts/capacitor/super(null)
component_parts += new /obj/item/stack/sheet/glass(null)
component_parts += new /obj/item/stack/cable_coil(null, 1)
RefreshParts()
/obj/machinery/telepad/RefreshParts()
var/E
for(var/obj/item/stock_parts/capacitor/C in component_parts)
E += C.rating
efficiency = E
/obj/machinery/telepad/screwdriver_act(mob/user, obj/item/I)
. = TRUE
default_deconstruction_screwdriver(user, "pad-idle-o", "pad-idle", I)
/obj/machinery/telepad/multitool_act(mob/user, obj/item/I)
if(!panel_open)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
if(!I.multitool_check_buffer(user))
return
var/obj/item/multitool/M = I
M.set_multitool_buffer(user, src)
/obj/machinery/telepad/crowbar_act(mob/user, obj/item/I)
. = TRUE
default_deconstruction_crowbar(user, I)
//CARGO TELEPAD//
/obj/machinery/telepad_cargo
name = "cargo telepad"
desc = "A telepad used by the Rapid Crate Sender."
icon = 'icons/obj/telescience.dmi'
icon_state = "pad-idle"
anchored = TRUE
idle_power_consumption = 20
active_power_consumption = 500
var/stage = 0
/obj/machinery/telepad_cargo/crowbar_act(mob/living/user, obj/item/I)
if(stage != 1)
return
. = TRUE
default_deconstruction_crowbar(user, I)
/obj/machinery/telepad_cargo/screwdriver_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
to_chat(user, "<span class = 'caution'> You [stage ? "screw in" : "unscrew"] the telepad's tracking beacon.</span>")
stage = !stage
/obj/machinery/telepad_cargo/wrench_act(mob/user, obj/item/I)
. = TRUE
default_unfasten_wrench(user, I)
/obj/machinery/telepad_cargo/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
new /obj/item/stack/sheet/metal(loc)
new /obj/item/stack/sheet/glass(loc)
..()
///TELEPAD CALLER///
/obj/item/telepad_beacon
name = "telepad beacon"
desc = "Use to warp in a cargo telepad."
icon = 'icons/obj/radio.dmi'
icon_state = "beacon"
item_state = "signaler"
origin_tech = "bluespace=3"
/obj/item/telepad_beacon/attack_self__legacy__attackchain(mob/user as mob)
if(user)
to_chat(user, "<span class = 'caution'> Locked In</span>")
new /obj/machinery/telepad_cargo(user.loc)
playsound(src, 'sound/effects/pop.ogg', 100, TRUE, 1)
qdel(src)
return