mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 15:08:02 +01:00
Refactor closet and RCS code. Can't put items in closets on modes other than help (#13464)
* Refactor closet and RCS code. Can't put items in closets on modes other than help * Undef * Styling tweaks * Github reviews and extra * glob.machines
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
var/opened = FALSE
|
||||
var/welded = FALSE
|
||||
var/locked = FALSE
|
||||
var/large = TRUE
|
||||
var/can_be_emaged = FALSE
|
||||
var/wall_mounted = 0 //never solid (You can always pass over it)
|
||||
var/lastbang
|
||||
var/sound = 'sound/machines/click.ogg'
|
||||
@@ -143,84 +145,21 @@
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/rcs) && !opened)
|
||||
if(user in contents) //to prevent self-teleporting.
|
||||
return
|
||||
var/obj/item/rcs/E = W
|
||||
if(E.rcell && (E.rcell.charge >= E.chargecost))
|
||||
if(!is_level_reachable(z))
|
||||
to_chat(user, "<span class='warning'>The rapid-crate-sender can't locate any telepads!</span>")
|
||||
return
|
||||
if(E.mode == 0)
|
||||
if(!E.teleporting)
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
for(var/obj/machinery/telepad_cargo/R in GLOB.machines)
|
||||
if(R.stage == 0)
|
||||
var/turf/T = get_turf(R)
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
var/desc = input("Please select a telepad.", "RCS") in L
|
||||
E.pad = L[desc]
|
||||
if(!Adjacent(user))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, too far from crate.</span>")
|
||||
return
|
||||
playsound(E.loc, E.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>Teleporting [name]...</span>")
|
||||
E.teleporting = 1
|
||||
if(!do_after(user, 50 * E.toolspeed, target = src))
|
||||
E.teleporting = 0
|
||||
return
|
||||
E.teleporting = 0
|
||||
if(user in contents)
|
||||
to_chat(user, "<span class='warning'>Error: User located in container--aborting for safety.</span>")
|
||||
playsound(E.loc, 'sound/machines/buzz-sigh.ogg', 50, 1)
|
||||
return
|
||||
if(!(E.rcell && E.rcell.use(E.chargecost)))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, insufficient charge.</span>")
|
||||
return
|
||||
do_sparks(5, 1, src)
|
||||
do_teleport(src, E.pad, 0)
|
||||
to_chat(user, "<span class='notice'>Teleport successful. [round(E.rcell.charge/E.chargecost)] charge\s left.</span>")
|
||||
return
|
||||
else
|
||||
E.rand_x = rand(50,200)
|
||||
E.rand_y = rand(50,200)
|
||||
var/L = locate(E.rand_x, E.rand_y, 6)
|
||||
if(!Adjacent(user))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, too far from crate.</span>")
|
||||
return
|
||||
playsound(E.loc, E.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>Teleporting [name]...</span>")
|
||||
E.teleporting = 1
|
||||
if(!do_after(user, 50, E.toolspeed, target = src))
|
||||
E.teleporting = 0
|
||||
return
|
||||
E.teleporting = 0
|
||||
if(user in contents)
|
||||
to_chat(user, "<span class='warning'>Error: User located in container--aborting for safety.</span>")
|
||||
playsound(E.loc, 'sound/machines/buzz-sigh.ogg', 50, 1)
|
||||
return
|
||||
if(!(E.rcell && E.rcell.use(E.chargecost)))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, insufficient charge.</span>")
|
||||
return
|
||||
do_sparks(5, 1, src)
|
||||
do_teleport(src, L)
|
||||
to_chat(user, "<span class='notice'>Teleport successful. [round(E.rcell.charge/E.chargecost)] charge\s left.</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Out of charges.</span>")
|
||||
return
|
||||
E.try_send_container(user, src)
|
||||
return
|
||||
|
||||
if(opened)
|
||||
if(istype(W, /obj/item/grab))
|
||||
MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
|
||||
if(istype(W,/obj/item/tk_grab))
|
||||
var/obj/item/grab/G = W
|
||||
if(large)
|
||||
MouseDrop_T(G.affecting, user) //act like they were dragged onto the closet
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] is too small to stuff [G.affecting] into!</span>")
|
||||
if(istype(W, /obj/item/tk_grab))
|
||||
return FALSE
|
||||
if(user.a_intent != INTENT_HELP) // Stops you from putting your baton in the closet on accident
|
||||
return
|
||||
if(isrobot(user))
|
||||
return
|
||||
if(!user.drop_item()) //couldn't drop the item
|
||||
@@ -228,13 +167,20 @@
|
||||
return
|
||||
if(W)
|
||||
W.forceMove(loc)
|
||||
return TRUE // It's resolved. No afterattack needed. Stops you from emagging lockers when putting in an emag
|
||||
else if(can_be_emaged && (istype(W, /obj/item/card/emag) || istype(W, /obj/item/melee/energy/blade) && !broken))
|
||||
emag_act(user)
|
||||
else if(istype(W, /obj/item/stack/packageWrap))
|
||||
return
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
attack_hand(user)
|
||||
closed_item_click(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
// What happens when the closet is attacked by a random item not on harm mode
|
||||
/obj/structure/closet/proc/closed_item_click(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/structure/closet/welder_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
if(!opened && user.loc == src)
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
opened = 0
|
||||
locked = 1
|
||||
broken = 0
|
||||
can_be_emaged = TRUE
|
||||
max_integrity = 250
|
||||
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
|
||||
damage_deflection = 20
|
||||
var/large = 1
|
||||
icon_closed = "secure"
|
||||
var/icon_locked = "secure1"
|
||||
icon_opened = "secureopen"
|
||||
@@ -66,31 +66,8 @@
|
||||
else
|
||||
to_chat(user, "<span class='notice'>Access Denied</span>")
|
||||
|
||||
/obj/structure/closet/secure_closet/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/rcs))
|
||||
return ..()
|
||||
|
||||
if(opened)
|
||||
if(istype(W, /obj/item/grab))
|
||||
if(large)
|
||||
MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
|
||||
else
|
||||
to_chat(user, "<span class='notice'>The locker is too small to stuff [W:affecting] into!</span>")
|
||||
if(isrobot(user))
|
||||
return
|
||||
if(!user.drop_item()) //couldn't drop the item
|
||||
to_chat(user, "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in \the [src]!</span>")
|
||||
return
|
||||
if(W)
|
||||
W.forceMove(loc)
|
||||
else if((istype(W, /obj/item/card/emag)||istype(W, /obj/item/melee/energy/blade)) && !broken)
|
||||
emag_act(user)
|
||||
else if(istype(W,/obj/item/stack/packageWrap) || istype(W,/obj/item/weldingtool))
|
||||
return ..(W, user)
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
togglelock(user)
|
||||
else
|
||||
return ..()
|
||||
/obj/structure/closet/secure_closet/closed_item_click(mob/user)
|
||||
togglelock(user)
|
||||
|
||||
/obj/structure/closet/secure_closet/emag_act(mob/user)
|
||||
if(!broken)
|
||||
|
||||
@@ -426,7 +426,7 @@
|
||||
icon_off = "wall-lockeroff"
|
||||
|
||||
//too small to put a man in
|
||||
large = 0
|
||||
large = FALSE
|
||||
|
||||
/obj/structure/closet/secure_closet/wall/update_icon()
|
||||
if(broken)
|
||||
|
||||
@@ -79,111 +79,42 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/crate/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/rcs) && !src.opened)
|
||||
var/obj/item/rcs/E = W
|
||||
if(E.rcell && (E.rcell.charge >= E.chargecost))
|
||||
if(!is_level_reachable(src.z)) // This is inconsistent with the closet sending code
|
||||
to_chat(user, "<span class='warning'>The rapid-crate-sender can't locate any telepads!</span>")
|
||||
return
|
||||
if(E.mode == 0)
|
||||
if(!E.teleporting)
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
for(var/obj/machinery/telepad_cargo/R in GLOB.machines)
|
||||
if(R.stage == 0)
|
||||
var/turf/T = get_turf(R)
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
var/desc = input("Please select a telepad.", "RCS") in L
|
||||
E.pad = L[desc]
|
||||
if(!Adjacent(user))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, too far from crate.</span>")
|
||||
return
|
||||
playsound(E.loc, E.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>Teleporting [src.name]...</span>")
|
||||
E.teleporting = TRUE
|
||||
if(!do_after(user, 50 * E.toolspeed, target = src))
|
||||
E.teleporting = 0
|
||||
return
|
||||
E.teleporting = 0
|
||||
if(!(E.rcell && E.rcell.use(E.chargecost)))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, insufficient charge.</span>")
|
||||
return
|
||||
do_sparks(5, 1, src)
|
||||
do_teleport(src, E.pad, 0)
|
||||
to_chat(user, "<span class='notice'>Teleport successful. [round(E.rcell.charge/E.chargecost)] charge\s left.</span>")
|
||||
return
|
||||
|
||||
else
|
||||
E.rand_x = rand(50,200)
|
||||
E.rand_y = rand(50,200)
|
||||
var/L = locate(E.rand_x, E.rand_y, 6)
|
||||
if(!Adjacent(user))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, too far from crate.</span>")
|
||||
return
|
||||
playsound(E.loc, E.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>Teleporting [src.name]...</span>")
|
||||
E.teleporting = TRUE
|
||||
if(!do_after(user, 50 * E.toolspeed, target = src))
|
||||
E.teleporting = FALSE
|
||||
return
|
||||
E.teleporting = 0
|
||||
if(!(E.rcell && E.rcell.use(E.chargecost)))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, insufficient charge.</span>")
|
||||
return
|
||||
do_sparks(5, 1, src)
|
||||
do_teleport(src, L)
|
||||
to_chat(user, "<span class='notice'>Teleport successful. [round(E.rcell.charge/E.chargecost)] charge\s left.</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Out of charges.</span>")
|
||||
return
|
||||
|
||||
if(opened)
|
||||
if(isrobot(user))
|
||||
return
|
||||
if(!user.drop_item()) //couldn't drop the item
|
||||
to_chat(user, "<span class='notice'>\The [W] is stuck to your hand, you cannot put it in \the [src]!</span>")
|
||||
return
|
||||
if(W)
|
||||
W.forceMove(loc)
|
||||
else if(istype(W, /obj/item/stack/packageWrap))
|
||||
if(!opened && try_rig(W, user))
|
||||
return
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/proc/try_rig(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/C = W
|
||||
if(rigged)
|
||||
to_chat(user, "<span class='notice'>[src] is already rigged!</span>")
|
||||
return
|
||||
return TRUE
|
||||
if(C.use(15))
|
||||
to_chat(user, "<span class='notice'>You rig [src].</span>")
|
||||
rigged = TRUE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need atleast 15 wires to rig [src]!</span>")
|
||||
return
|
||||
else if(istype(W, /obj/item/radio/electropack))
|
||||
return TRUE
|
||||
if(istype(W, /obj/item/radio/electropack))
|
||||
if(rigged)
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>[W] seems to be stuck to your hand!</span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You attach [W] to [src].</span>")
|
||||
user.drop_item()
|
||||
W.forceMove(src)
|
||||
return
|
||||
else if(istype(W, /obj/item/wirecutters))
|
||||
if(rigged)
|
||||
to_chat(user, "<span class='notice'>You cut away the wiring.</span>")
|
||||
playsound(loc, W.usesound, 100, 1)
|
||||
rigged = FALSE
|
||||
return
|
||||
else if(user.a_intent != INTENT_HARM)
|
||||
attack_hand(user)
|
||||
else
|
||||
return ..()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/singularity_act()
|
||||
dump_contents()
|
||||
..()
|
||||
/obj/structure/closet/crate/wirecutter_act(mob/living/user, obj/item/I)
|
||||
if(opened)
|
||||
return
|
||||
if(!rigged)
|
||||
return
|
||||
|
||||
if(I.use_tool(src, user))
|
||||
to_chat(user, "<span class='notice'>You cut away the wiring.</span>")
|
||||
playsound(loc, I.usesound, 100, 1)
|
||||
rigged = FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/crate/welder_act()
|
||||
return
|
||||
@@ -229,9 +160,10 @@
|
||||
max_integrity = 500
|
||||
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
|
||||
damage_deflection = 25
|
||||
var/tamperproof = 0
|
||||
broken = 0
|
||||
locked = 1
|
||||
var/tamperproof = FALSE
|
||||
broken = FALSE
|
||||
locked = TRUE
|
||||
can_be_emaged = TRUE
|
||||
|
||||
/obj/structure/closet/crate/secure/update_icon()
|
||||
..()
|
||||
@@ -306,17 +238,8 @@
|
||||
else
|
||||
src.toggle(user)
|
||||
|
||||
|
||||
/obj/structure/closet/crate/secure/attackby(obj/item/W, mob/user, params)
|
||||
if(is_type_in_list(W, list(/obj/item/stack/packageWrap, /obj/item/stack/cable_coil, /obj/item/radio/electropack, /obj/item/wirecutters,/obj/item/rcs)))
|
||||
return ..()
|
||||
if((istype(W, /obj/item/card/emag) || istype(W, /obj/item/melee/energy/blade)))
|
||||
emag_act(user)
|
||||
return
|
||||
if(!opened)
|
||||
src.togglelock(user)
|
||||
return
|
||||
return ..()
|
||||
/obj/structure/closet/crate/secure/closed_item_click(mob/user)
|
||||
togglelock(user)
|
||||
|
||||
/obj/structure/closet/crate/secure/emag_act(mob/user)
|
||||
if(locked)
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
#define RCS_MODE_CALIBRATED 0
|
||||
#define RCS_MODE_UNCALIBRATED 1
|
||||
|
||||
/obj/item/rcs
|
||||
name = "rapid-crate-sender (RCS)"
|
||||
desc = "A device used to teleport crates and closets to cargo telepads."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "rcs"
|
||||
item_state = "rcd"
|
||||
flags = CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 10.0
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
toolspeed = 1
|
||||
usesound = 'sound/machines/click.ogg'
|
||||
var/obj/item/stock_parts/cell/high/rcell = null
|
||||
var/obj/machinery/pad = null
|
||||
var/mode = RCS_MODE_CALIBRATED
|
||||
var/rand_x = 0
|
||||
var/rand_y = 0
|
||||
var/emagged = FALSE
|
||||
var/teleporting = FALSE
|
||||
var/chargecost = 1000
|
||||
|
||||
/obj/item/rcs/get_cell()
|
||||
return rcell
|
||||
|
||||
/obj/item/rcs/New()
|
||||
..()
|
||||
rcell = new(src)
|
||||
|
||||
/obj/item/rcs/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>There are [round(rcell.charge/chargecost)] charge\s left.</span>"
|
||||
|
||||
/obj/item/rcs/Destroy()
|
||||
QDEL_NULL(rcell)
|
||||
return ..()
|
||||
|
||||
/obj/item/rcs/attack_self(mob/user)
|
||||
if(!emagged)
|
||||
return
|
||||
if(mode == RCS_MODE_CALIBRATED)
|
||||
mode = RCS_MODE_UNCALIBRATED
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
to_chat(user, "<span class='caution'>The telepad locator has become uncalibrated.</span>")
|
||||
else
|
||||
mode = RCS_MODE_CALIBRATED
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
to_chat(user, "<span class='caution'>You calibrate the telepad locator.</span>")
|
||||
|
||||
/obj/item/rcs/emag_act(user as mob)
|
||||
if(!emagged)
|
||||
emagged = TRUE
|
||||
do_sparks(5, 1, src)
|
||||
to_chat(user, "<span class='caution'>You emag the RCS. Activate it to toggle between modes.</span>")
|
||||
return
|
||||
|
||||
/obj/item/rcs/proc/try_send_container(mob/user, obj/structure/closet/C)
|
||||
if(teleporting)
|
||||
to_chat(user, "<span class='warning'>You're already using [src]!</span>")
|
||||
return
|
||||
if(user in C.contents) //to prevent self-teleporting.
|
||||
return
|
||||
if(!rcell || (rcell.charge < chargecost))
|
||||
to_chat(user, "<span class='warning'>Out of charges.</span>")
|
||||
return
|
||||
|
||||
if(!is_level_reachable(C.z))
|
||||
to_chat(user, "<span class='warning'>The rapid-crate-sender can't locate any telepads!</span>")
|
||||
return
|
||||
|
||||
if(mode == RCS_MODE_CALIBRATED)
|
||||
var/list/L = list()
|
||||
var/list/areaindex = list()
|
||||
for(var/obj/machinery/telepad_cargo/R in GLOB.machines)
|
||||
if(R.stage)
|
||||
continue
|
||||
var/turf/T = get_turf(R)
|
||||
var/tmpname = T.loc.name
|
||||
if(areaindex[tmpname])
|
||||
tmpname = "[tmpname] ([++areaindex[tmpname]])"
|
||||
else
|
||||
areaindex[tmpname] = 1
|
||||
L[tmpname] = R
|
||||
|
||||
var/desc = input("Please select a telepad.", "RCS") in L
|
||||
pad = L[desc]
|
||||
try_teleport(user, C, pad)
|
||||
else
|
||||
rand_x = rand(50,200)
|
||||
rand_y = rand(50,200)
|
||||
var/L = locate(rand_x, rand_y, 6)
|
||||
try_teleport(user, C, L)
|
||||
|
||||
/obj/item/rcs/proc/try_teleport(mob/user, obj/structure/closet/C, target)
|
||||
if(!C.Adjacent(user))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, too far from [C].</span>")
|
||||
return
|
||||
var/turf/ownTurf = get_turf(src)
|
||||
playsound(ownTurf, usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>Teleporting [C]...</span>")
|
||||
teleporting = TRUE
|
||||
if(!do_after(user, 50 * toolspeed, target = C))
|
||||
teleporting = FALSE
|
||||
return
|
||||
teleporting = FALSE
|
||||
if(user in C.contents)
|
||||
to_chat(user, "<span class='warning'>Error: User located in container--aborting for safety.</span>")
|
||||
playsound(ownTurf, 'sound/machines/buzz-sigh.ogg', 50, 1)
|
||||
return
|
||||
if(!(rcell && rcell.use(chargecost)))
|
||||
to_chat(user, "<span class='notice'>Unable to teleport, insufficient charge.</span>")
|
||||
return
|
||||
do_sparks(5, 1, C)
|
||||
do_teleport(C, target)
|
||||
to_chat(user, "<span class='notice'>Teleport successful. [round(rcell.charge/chargecost)] charge\s left.</span>")
|
||||
|
||||
#undef RCS_MODE_CALIBRATED
|
||||
#undef RCS_MODE_UNCALIBRATED
|
||||
@@ -88,7 +88,7 @@
|
||||
/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))
|
||||
@@ -113,59 +113,3 @@
|
||||
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
///HANDHELD TELEPAD USER///
|
||||
/obj/item/rcs
|
||||
name = "rapid-crate-sender (RCS)"
|
||||
desc = "A device used to teleport crates and closets to cargo telepads."
|
||||
icon = 'icons/obj/telescience.dmi'
|
||||
icon_state = "rcs"
|
||||
item_state = "rcd"
|
||||
flags = CONDUCT
|
||||
force = 10.0
|
||||
throwforce = 10.0
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
toolspeed = 1
|
||||
usesound = 'sound/machines/click.ogg'
|
||||
var/obj/item/stock_parts/cell/high/rcell = null
|
||||
var/obj/machinery/pad = null
|
||||
var/mode = 0
|
||||
var/rand_x = 0
|
||||
var/rand_y = 0
|
||||
var/emagged = 0
|
||||
var/teleporting = 0
|
||||
var/chargecost = 1000
|
||||
|
||||
/obj/item/rcs/get_cell()
|
||||
return rcell
|
||||
|
||||
/obj/item/rcs/New()
|
||||
..()
|
||||
rcell = new(src)
|
||||
|
||||
/obj/item/rcs/examine(mob/user)
|
||||
. = ..()
|
||||
. += "There are [round(rcell.charge/chargecost)] charge\s left."
|
||||
|
||||
/obj/item/rcs/Destroy()
|
||||
QDEL_NULL(rcell)
|
||||
return ..()
|
||||
|
||||
/obj/item/rcs/attack_self(mob/user)
|
||||
if(emagged)
|
||||
if(mode == 0)
|
||||
mode = 1
|
||||
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
|
||||
to_chat(user, "<span class = 'caution'> The telepad locator has become uncalibrated.</span>")
|
||||
else
|
||||
mode = 0
|
||||
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
|
||||
to_chat(user, "<span class = 'caution'> You calibrate the telepad locator.</span>")
|
||||
|
||||
/obj/item/rcs/emag_act(user as mob)
|
||||
if(!emagged)
|
||||
emagged = 1
|
||||
do_sparks(5, 1, src)
|
||||
to_chat(user, "<span class = 'caution'> You emag the RCS. Activate it to toggle between modes.</span>")
|
||||
return
|
||||
|
||||
@@ -2469,6 +2469,7 @@
|
||||
#include "code\modules\surgery\organs\subtypes\xenos.dm"
|
||||
#include "code\modules\telesci\bscrystal.dm"
|
||||
#include "code\modules\telesci\gps.dm"
|
||||
#include "code\modules\telesci\rcs.dm"
|
||||
#include "code\modules\telesci\telepad.dm"
|
||||
#include "code\modules\telesci\telesci_computer.dm"
|
||||
#include "code\modules\tooltip\tooltip.dm"
|
||||
|
||||
Reference in New Issue
Block a user