mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
APC & Machinery Refactor + Local Powernets (#19991)
* local powernet and machine power refactor * some fixes * more tweaks + powerchange() refactor * fixes var edited apcs on meatpackers.dmm * fixes issue with power channels * Reviews * delta fix * Update code/game/machinery/portable_turret.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * removed area power change proc * damn morgues * requested changes * request changes * deconfliction * mapping fixes * some fixes from TM --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
icon = 'icons/obj/lavaland/artefacts.dmi'
|
||||
icon_state = "anomaly_crystal"
|
||||
light_range = 8
|
||||
use_power = NO_POWER_USE
|
||||
power_state = NO_POWER_USE
|
||||
density = TRUE
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
var/activation_method = "touch"
|
||||
|
||||
@@ -153,21 +153,22 @@
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/power_change()
|
||||
..()
|
||||
if(!..())
|
||||
return
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
if(inserted_id && !powered())
|
||||
if(inserted_id && !(stat & NOPOWER))
|
||||
visible_message("<span class='notice'>The ID slot indicator light flickers on [src] as it spits out a card before powering down.</span>")
|
||||
inserted_id.forceMove(get_turf(src))
|
||||
inserted_id = null
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/update_icon_state()
|
||||
if(powered())
|
||||
if(has_power())
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
icon_state = "[initial(icon_state)]-off"
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/process()
|
||||
if(panel_open || !powered())
|
||||
if(panel_open || !has_power())
|
||||
return
|
||||
// Check if the input turf has a [/obj/structure/ore_box] to draw ore from. Otherwise suck ore from the turf
|
||||
var/atom/input = get_step(src, input_dir)
|
||||
@@ -194,7 +195,7 @@
|
||||
/obj/machinery/mineral/ore_redemption/attackby(obj/item/I, mob/user, params)
|
||||
if(exchange_parts(user, I))
|
||||
return
|
||||
if(!powered())
|
||||
if(!has_power())
|
||||
return ..()
|
||||
|
||||
if(istype(I, /obj/item/card/id))
|
||||
@@ -221,7 +222,7 @@
|
||||
if(!panel_open)
|
||||
return
|
||||
. = TRUE
|
||||
if(!powered())
|
||||
if(!has_power())
|
||||
return
|
||||
if(!I.tool_start_check(src, user, 0))
|
||||
return
|
||||
|
||||
@@ -94,14 +94,15 @@
|
||||
prize_list["Extra"] = list() // Used in child vendors
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/power_change()
|
||||
..()
|
||||
if(!..())
|
||||
return
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
if(inserted_id && !powered())
|
||||
if(inserted_id && !(stat & NOPOWER))
|
||||
visible_message("<span class='notice'>The ID slot indicator light flickers on \the [src] as it spits out a card before powering down.</span>")
|
||||
inserted_id.forceMove(loc)
|
||||
|
||||
/obj/machinery/mineral/equipment_vendor/update_icon_state()
|
||||
if(powered())
|
||||
if(has_power())
|
||||
icon_state = initial(icon_state)
|
||||
else
|
||||
icon_state = "[initial(icon_state)]-off"
|
||||
@@ -207,12 +208,12 @@
|
||||
default_deconstruction_crowbar(user, I)
|
||||
return TRUE
|
||||
if(istype(I, /obj/item/mining_voucher))
|
||||
if(!powered())
|
||||
if(!has_power())
|
||||
return
|
||||
redeem_voucher(I, user)
|
||||
return
|
||||
if(istype(I, /obj/item/card/id))
|
||||
if(!powered())
|
||||
if(!has_power())
|
||||
return
|
||||
var/obj/item/card/id/C = user.get_active_hand()
|
||||
if(istype(C) && !istype(inserted_id))
|
||||
|
||||
Reference in New Issue
Block a user