Pen Charge (#12144)

This commit is contained in:
Geeves
2021-07-09 13:37:07 -03:00
committed by GitHub
parent 784748bdcf
commit 190b9e3f20
3 changed files with 20 additions and 0 deletions
+7
View File
@@ -658,3 +658,10 @@
if(ending && !correct_punctuation[ending])
string += "."
return string
/proc/num2loadingbar(percent as num, numSquares = 20, reverse = FALSE)
var/loadstring = ""
var/limit = reverse ? numSquares - percent*numSquares : percent*numSquares
for (var/i in 1 to numSquares)
loadstring += i <= limit ? "█" : "░"
return "\[[loadstring]\]"
@@ -102,6 +102,12 @@
maptext_y = 2
var/ready_to_use = TRUE
var/recharge_time = 1 MINUTE
var/when_recharge = 0
/obj/item/syndie/teleporter/examine(mob/user, distance)
. = ..()
if(!ready_to_use && burglars.is_antagonist(user.mind))
to_chat(user, SPAN_NOTICE("Charging: [num2loadingbar(world.time / when_recharge)]"))
/obj/item/syndie/teleporter/set_initial_maptext()
held_maptext = SMALL_FONTS(7, "Ready")
@@ -136,6 +142,7 @@
addtimer(CALLBACK(src, .proc/recharge), recharge_time)
ready_to_use = FALSE
check_maptext(SMALL_FONTS(6, "Charge"))
when_recharge = world.time + recharge_time
/obj/item/syndie/teleporter/proc/recharge()
ready_to_use = TRUE
+6
View File
@@ -0,0 +1,6 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Burglars can now inspect their pens to see how far their pen has charged via a loading bar."