Refactors the examine proc to return a list of strings (#12280)

This commit is contained in:
farie82
2019-09-25 22:05:01 -07:00
committed by variableundefined
parent 40a4cd1b75
commit 0e8ddb2afe
210 changed files with 808 additions and 830 deletions
@@ -127,25 +127,25 @@
/obj/structure/beebox/examine(mob/user)
..()
. = ..()
if(!queen_bee)
to_chat(user, "<span class='warning'>There is no queen bee! There won't bee any honeycomb without a queen!</span>")
. += "<span class='warning'>There is no queen bee! There won't bee any honeycomb without a queen!</span>"
var/half_bee = get_max_bees()*0.5
if(half_bee && (bees.len >= half_bee))
to_chat(user, "<span class='notice'>This place is a BUZZ with activity... there are lots of bees!</span>")
. += "<span class='notice'>This place is a BUZZ with activity... there are lots of bees!</span>"
to_chat(user, "<span class='notice'>[bee_resources]/100 resource supply.</span>")
to_chat(user, "<span class='notice'>[bee_resources]% towards a new honeycomb.</span>")
to_chat(user, "<span class='notice'>[bee_resources*2]% towards a new bee.</span>")
. += "<span class='notice'>[bee_resources]/100 resource supply.</span>"
. += "<span class='notice'>[bee_resources]% towards a new honeycomb.</span>"
. += "<span class='notice'>[bee_resources*2]% towards a new bee.</span>"
if(honeycombs.len)
var/plural = honeycombs.len > 1
to_chat(user, "<span class='notice'>There [plural? "are" : "is"] [honeycombs.len] uncollected honeycomb[plural ? "s":""] in the apiary.</span>")
. += "<span class='notice'>There [plural? "are" : "is"] [honeycombs.len] uncollected honeycomb[plural ? "s":""] in the apiary.</span>"
if(honeycombs.len >= get_max_honeycomb())
to_chat(user, "<span class='warning'>there's no room for more honeycomb!</span>")
. += "<span class='warning'>there's no room for more honeycomb!</span>"
/obj/structure/beebox/attackby(obj/item/I, mob/user, params)
@@ -17,7 +17,7 @@
/obj/structure/fermenting_barrel/examine(mob/user)
. = ..()
to_chat(user, "<span class='notice'>It is currently [open ? "open, letting you pour liquids in." : "closed, letting you draw liquids from the tap."] </span>")
. += "<span class='notice'>It is currently [open ? "open, letting you pour liquids in." : "closed, letting you draw liquids from the tap."] </span>"
/obj/structure/fermenting_barrel/proc/makeWine(obj/item/reagent_containers/food/snacks/grown/G)
if(G.reagents)
+2 -2
View File
@@ -479,8 +479,8 @@
to_chat(user, "<span class='notice'>You flip the write-protect tab to [read_only ? "protected" : "unprotected"].</span>")
/obj/item/disk/plantgene/examine(mob/user)
..()
to_chat(user, "The write-protect tab is set to [read_only ? "protected" : "unprotected"].")
. = ..()
. += "The write-protect tab is set to [read_only ? "protected" : "unprotected"]."
/*
+2 -2
View File
@@ -55,11 +55,11 @@
return 0
/obj/item/reagent_containers/food/snacks/grown/examine(user)
..()
. = ..()
if(seed)
for(var/datum/plant_gene/trait/T in seed.genes)
if(T.examine_line)
to_chat(user, T.examine_line)
. += T.examine_line
/obj/item/reagent_containers/food/snacks/grown/attackby(obj/item/O, mob/user, params)
..()
+13 -13
View File
@@ -339,32 +339,32 @@
/obj/machinery/hydroponics/examine(user)
..()
. = ..()
if(myseed)
to_chat(user, "<span class='info'>It has <span class='name'>[myseed.plantname]</span> planted.</span>")
. += "<span class='info'>It has <span class='name'>[myseed.plantname]</span> planted.</span>"
if (dead)
to_chat(user, "<span class='warning'>It's dead!</span>")
. += "<span class='warning'>It's dead!</span>"
else if (harvest)
to_chat(user, "<span class='info'>It's ready to harvest.</span>")
. += "<span class='info'>It's ready to harvest.</span>"
else if (plant_health <= (myseed.endurance / 2))
to_chat(user, "<span class='warning'>It looks unhealthy.</span>")
. += "<span class='warning'>It looks unhealthy.</span>"
else
to_chat(user, "<span class='info'>[src] is empty.</span>")
. += "<span class='info'>[src] is empty.</span>"
if(!self_sustaining)
to_chat(user, "<span class='info'>Water: [waterlevel]/[maxwater]</span>")
to_chat(user, "<span class='info'>Nutrient: [nutrilevel]/[maxnutri]</span>")
. += "<span class='info'>Water: [waterlevel]/[maxwater]</span>"
. += "<span class='info'>Nutrient: [nutrilevel]/[maxnutri]</span>"
if(self_sufficiency_progress > 0)
var/percent_progress = round(self_sufficiency_progress * 100 / self_sufficiency_req)
to_chat(user, "<span class='info'>Treatment for self-sustenance are [percent_progress]% complete.</span>")
. += "<span class='info'>Treatment for self-sustenance are [percent_progress]% complete.</span>"
else
to_chat(user, "<span class='info'>It doesn't require any water or nutrients.</span>")
. += "<span class='info'>It doesn't require any water or nutrients.</span>"
if(weedlevel >= 5)
to_chat(user, "<span class='warning'>[src] is filled with weeds!</span>")
. += "<span class='warning'>[src] is filled with weeds!</span>"
if(pestlevel >= 5)
to_chat(user, "<span class='warning'>[src] is filled with tiny worms!</span>")
to_chat(user, "") // Empty line for readability.
. += "<span class='warning'>[src] is filled with tiny worms!</span>"
. += "" // Empty line for readability.
/obj/machinery/hydroponics/proc/weedinvasion() // If a weed growth is sufficient, this happens.