Replace color macros and stream operator with style and to_chat

This commit is contained in:
Leshana
2017-04-21 10:44:45 -04:00
parent f614de8387
commit 30d2f16b04

View File

@@ -48,7 +48,7 @@ var/list/possible_cable_coil_colours = list(
anchored =1
var/datum/powernet/powernet
name = "power cable"
desc = "A flexible superconducting cable for heavy-duty power transfer"
desc = "A flexible superconducting cable for heavy-duty power transfer."
icon = 'icons/obj/power_cond_white.dmi'
icon_state = "0-1"
var/d1 = 0
@@ -116,9 +116,9 @@ var/list/possible_cable_coil_colours = list(
user.examinate(src)
// following code taken from attackby (multitool)
if(powernet && (powernet.avail > 0))
user << "<span class='warning'>[powernet.avail]W in power network.</span>"
to_chat(user, "<span class='warning'>[powernet.avail]W in power network.</span>")
else
user << "<span class='warning'>The cable is not powered.</span>"
to_chat(user, "<span class='warning'>The cable is not powered.</span>")
return
///////////////////////////////////
@@ -164,7 +164,7 @@ var/list/possible_cable_coil_colours = list(
return
if(breaker_box)
user << "\red This cable is connected to nearby breaker box. Use breaker box to interact with it."
to_chat(user, "<span class='warning'>This cable is connected to nearby breaker box. Use breaker box to interact with it.</span>")
return
if (shock(user, 50))
@@ -194,17 +194,17 @@ var/list/possible_cable_coil_colours = list(
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
if (coil.get_amount() < 1)
user << "Not enough cable"
to_chat(user, "Not enough cable")
return
coil.cable_join(src, user)
else if(istype(W, /obj/item/device/multitool))
if(powernet && (powernet.avail > 0)) // is it powered?
user << "<span class='warning'>[powernet.avail]W in power network.</span>"
to_chat(user, "<span class='warning'>[powernet.avail]W in power network.</span>")
else
user << "<span class='warning'>The cable is not powered.</span>"
to_chat(user, "<span class='warning'>The cable is not powered.</span>")
shock(user, 5, 0.2)
@@ -556,7 +556,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
final_color = possible_cable_coil_colours["Red"]
selected_color = "red"
color = final_color
user << "<span class='notice'>You change \the [src]'s color to [lowertext(selected_color)].</span>"
to_chat(user, "<span class='notice'>You change \the [src]'s color to [lowertext(selected_color)].</span>")
/obj/item/stack/cable_coil/proc/update_wclass()
if(amount == 1)
@@ -569,11 +569,11 @@ obj/structure/cable/proc/cableColor(var/colorC)
return
if(get_amount() == 1)
user << "A short piece of power cable."
to_chat(user, "A short piece of power cable.")
else if(get_amount() == 2)
user << "A piece of power cable."
to_chat(user, "A piece of power cable.")
else
user << "A coil of power cable. There are [get_amount()] lengths of cable in the coil."
to_chat(user, "A coil of power cable. There are [get_amount()] lengths of cable in the coil.")
/obj/item/stack/cable_coil/verb/make_restraint()
@@ -584,14 +584,14 @@ obj/structure/cable/proc/cableColor(var/colorC)
if(ishuman(M) && !M.restrained() && !M.stat && !M.paralysis && ! M.stunned)
if(!istype(usr.loc,/turf)) return
if(src.amount <= 14)
usr << "\red You need at least 15 lengths to make restraints!"
to_chat(usr, "<span class='warning'>You need at least 15 lengths to make restraints!</span>")
return
var/obj/item/weapon/handcuffs/cable/B = new /obj/item/weapon/handcuffs/cable(usr.loc)
B.color = color
usr << "<span class='notice'>You wind some cable together to make some restraints.</span>"
to_chat(usr, "<span class='notice'>You wind some cable together to make some restraints.</span>")
src.use(15)
else
usr << "\blue You cannot do that."
to_chat(usr, "<span class='notice'>You cannot do that.</span>")
..()
/obj/item/stack/cable_coil/cyborg/verb/set_colour()