Formatting improvement

This commit is contained in:
variableundefined
2018-10-12 07:57:58 +08:00
parent 6b1b38d4f1
commit 108ebfed3a
10 changed files with 45 additions and 58 deletions
+2 -4
View File
@@ -14,8 +14,7 @@
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/telesci_pad(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null, 2)
component_parts += new /obj/item/stock_parts/capacitor(null)
component_parts += new /obj/item/stock_parts/console_screen(null)
component_parts += new /obj/item/stack/cable_coil(null, 1)
@@ -25,8 +24,7 @@
..()
component_parts = list()
component_parts += new /obj/item/circuitboard/telesci_pad(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null)
component_parts += new /obj/item/stack/ore/bluespace_crystal/artificial(null, 2)
component_parts += new /obj/item/stock_parts/capacitor/super(null)
component_parts += new /obj/item/stock_parts/console_screen(null)
component_parts += new /obj/item/stack/cable_coil(null, 1)
+15 -18
View File
@@ -26,9 +26,8 @@
var/teleport_cooldown = 0 // every index requires a bluespace crystal
var/list/power_options = list(5, 10, 20, 25, 30, 40, 50, 80)
var/teleporting = 0
var/starting_crystals = 0
var/crystals = 0
var/max_crystals = 4
var/list/crystals = list()
var/obj/item/gps/inserted_gps
/obj/machinery/computer/telescience/New()
@@ -44,29 +43,27 @@
/obj/machinery/computer/telescience/examine(mob/user)
..(user)
to_chat(user, "There are [crystals.len ? crystals.len : "no"] bluespace crystal\s in the crystal slots.")
to_chat(user, "There are [crystals ? crystals : "no"] bluespace crystal\s in the crystal slots.")
/obj/machinery/computer/telescience/Initialize()
..()
for(var/i = 1; i <= starting_crystals; i++)
crystals += new /obj/item/stack/ore/bluespace_crystal/artificial(null) // starting crystals
/obj/machinery/computer/telescience/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stack/ore/bluespace_crystal))
if(crystals.len >= max_crystals)
var/obj/item/stack/ore/bluespace_crystal/B = W
if(crystals >= max_crystals)
to_chat(user, "<span class='warning'>There are not enough crystal slots.</span>")
return
user.drop_item()
crystals += W
W.loc = null
user.visible_message("<span class='notice'>[user] inserts [W] into \the [src]'s crystal slot.</span>")
crystals += 1
user.visible_message("<span class='notice'>[user] inserts a [B.singular_name] into [src]'s crystal slot.</span>")
B.use(1)
updateUsrDialog()
else if(istype(W, /obj/item/gps))
if(!inserted_gps)
inserted_gps = W
user.unEquip(W)
W.loc = src
user.visible_message("<span class='notice'>[user] inserts [W] into \the [src]'s GPS device slot.</span>")
user.visible_message("<span class='notice'>[user] inserts [W] into [src]'s GPS device slot.</span>")
updateUsrDialog()
else if(istype(W, /obj/item/multitool))
var/obj/item/multitool/M = W
@@ -115,7 +112,7 @@
t += "<div class='statusDisplay'>"
for(var/i = 1; i <= power_options.len; i++)
if(crystals.len + telepad.efficiency < i)
if(crystals + telepad.efficiency < i)
t += "<span class='linkOff'>[power_options[i]]</span>"
continue
if(power == power_options[i])
@@ -322,11 +319,11 @@
return
/obj/machinery/computer/telescience/proc/eject()
for(var/obj/item/I in crystals)
I.loc = loc
I.pixel_y = -9
crystals -= I
var/to_eject
for(var/i in 1 to crystals)
to_eject += 1
crystals -= 1
new /obj/item/stack/ore/bluespace_crystal/artificial(drop_location(), to_eject)
power = 0
/obj/machinery/computer/telescience/Topic(href, href_list)
@@ -355,7 +352,7 @@
var/index = href_list["setpower"]
index = text2num(index)
if(index != null && power_options[index])
if(crystals.len + telepad.efficiency >= index)
if(crystals + telepad.efficiency >= index)
power = power_options[index]
if(href_list["setz"])