Sheet Numbers (#11541)

This commit is contained in:
Geeves
2021-04-19 18:39:02 +02:00
committed by GitHub
parent feef4e4168
commit 0d8128ce1e
7 changed files with 55 additions and 67 deletions
+5 -30
View File
@@ -90,6 +90,7 @@
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "pen"
item_state = "pen"
flags = HELDMAPTEXT
slot_flags = SLOT_BELT | SLOT_EARS
throwforce = 0
w_class = ITEMSIZE_TINY
@@ -101,12 +102,9 @@
maptext_y = 2
var/ready_to_use = TRUE
var/recharge_time = 1 MINUTE
var/held_maptext = "<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: 7px;\">Ready</span>"
/obj/item/syndie/teleporter/Initialize()
. = ..()
if(ismob(loc) || ismob(loc.loc))
maptext = held_maptext
/obj/item/syndie/teleporter/set_initial_maptext()
held_maptext = SMALL_FONTS(7, "Ready")
/obj/item/syndie/teleporter/attack()
return
@@ -134,34 +132,11 @@
user.visible_message("<b>[user]</b> appears out of thin air!", SPAN_NOTICE("You successfully step into your destination."))
use()
/obj/item/syndie/teleporter/proc/check_maptext(var/new_maptext)
if(new_maptext)
held_maptext = new_maptext
if(ismob(loc) || ismob(loc.loc))
maptext = held_maptext
else
maptext = ""
/obj/item/syndie/teleporter/proc/use()
addtimer(CALLBACK(src, .proc/recharge), recharge_time)
ready_to_use = FALSE
check_maptext("<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: 6px;\">Charge</span>")
check_maptext(SMALL_FONTS(6, "Charge"))
/obj/item/syndie/teleporter/proc/recharge()
ready_to_use = TRUE
check_maptext("<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: 7px;\">Ready</span>")
/obj/item/syndie/teleporter/throw_at()
..()
check_maptext()
/obj/item/syndie/teleporter/dropped()
..()
check_maptext()
/obj/item/syndie/teleporter/on_give()
check_maptext()
/obj/item/syndie/teleporter/pickup()
..()
addtimer(CALLBACK(src, .proc/check_maptext), 1) // invoke async does not work here
check_maptext(SMALL_FONTS(7, "Ready"))
@@ -130,18 +130,16 @@ Frequency:
icon_state = "hand_tele"
item_state = "electronic"
throwforce = 5
flags = HELDMAPTEXT
w_class = ITEMSIZE_SMALL
throw_speed = 3
throw_range = 5
origin_tech = list(TECH_MAGNET = 1, TECH_BLUESPACE = 3)
matter = list(DEFAULT_WALL_MATERIAL = 10000)
var/list/active_teleporters = list()
var/held_maptext = "<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: 7px;\">Ready</span>"
/obj/item/hand_tele/Initialize()
. = ..()
if(get(loc, /mob))
maptext = held_maptext
/obj/item/hand_tele/set_initial_maptext()
held_maptext = SMALL_FONTS(7, "Ready")
/obj/item/hand_tele/attack_self(mob/user)
var/turf/current_location = get_turf(user)//What turf is the user on?
@@ -184,36 +182,13 @@ Frequency:
var/obj/effect/portal/P = new /obj/effect/portal(get_turf(src), T, src)
active_teleporters += P
if(length(active_teleporters) >= 3)
check_maptext("<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: 6px;\">Charge</span>")
check_maptext(SMALL_FONTS(6, "Charge"))
add_fingerprint(user)
/obj/item/hand_tele/proc/remove_portal(var/obj/effect/portal/P)
active_teleporters -= P
if(length(active_teleporters) < 3)
check_maptext("<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: 7px;\">Ready</span>")
/obj/item/hand_tele/proc/check_maptext(var/new_maptext)
if(new_maptext)
held_maptext = new_maptext
if(ismob(loc) || ismob(loc.loc))
maptext = held_maptext
else
maptext = ""
/obj/item/hand_tele/throw_at()
..()
check_maptext()
/obj/item/hand_tele/dropped()
..()
check_maptext()
/obj/item/hand_tele/on_give()
check_maptext()
/obj/item/hand_tele/pickup()
..()
addtimer(CALLBACK(src, .proc/check_maptext), 1) // invoke async does not work here
check_maptext(SMALL_FONTS(7, "Ready"))
/obj/item/closet_teleporter
name = "closet teleporter"