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
+29 -2
View File
@@ -92,6 +92,7 @@
var/charge_failure_message = " cannot be recharged."
var/held_maptext
var/cleaving = FALSE
var/reach = 1 // Length of tiles it can reach, 1 is adjacent.
@@ -105,6 +106,9 @@
if(armor[type])
AddComponent(/datum/component/armor, armor)
break
if(flags & HELDMAPTEXT)
set_initial_maptext()
check_maptext()
/obj/item/Destroy()
if(ismob(loc))
@@ -341,6 +345,8 @@
/obj/item/proc/pickup(mob/user)
pixel_x = 0
pixel_y = 0
if(flags & HELDMAPTEXT)
addtimer(CALLBACK(src, .proc/check_maptext), 1) // invoke async does not work here
do_pickup_animation(user)
// called when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.
@@ -502,8 +508,8 @@ var/list/global/slot_flags_enumeration = list(
// override for give shenanigans
/obj/item/proc/on_give(var/mob/giver, var/mob/receiver)
return
if(flags & HELDMAPTEXT)
check_maptext()
//This proc is executed when someone clicks the on-screen UI button. To make the UI button show, set the 'icon_action_button' to the icon_state of the image of the button in screen1_action.dmi
//The default action is attack_self().
@@ -885,3 +891,24 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
// this gets called when the item gets chucked by the vending machine
/obj/item/proc/vendor_action(var/obj/machinery/vending/V)
return
/obj/item/proc/set_initial_maptext()
return
/obj/item/proc/check_maptext(var/new_maptext)
if(new_maptext)
held_maptext = new_maptext
if(ismob(loc) || (loc && ismob(loc.loc)))
maptext = held_maptext
else
maptext = ""
/obj/item/throw_at()
..()
if(flags & HELDMAPTEXT)
check_maptext()
/obj/item/dropped()
..()
if(flags & HELDMAPTEXT)
check_maptext()
+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"