Committed Rolan7's patch to add more convenience to Hydroponics. The feature list includes:

* Makes grass auto-stack when harvested
* Allows seeds to be extracted from grass
* Allows the smart-fridge and plant bags to accept seeds.
* Lays the groundwork for a seeds-only version of the smart fridge, to eventually replace the existing seed vender (not yet hackable, though)

-Fixed window doors not opening when you click on them.
-Added a reset button for the job selection screen.
-Fixed a bug with the traitor panel which leaves ex-changelings with the evolution menu.
-I re-added the variables for the intercept report but commented them out.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5276 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-12-07 13:27:33 +00:00
parent d0ad3e0570
commit 69fcf61ed3
9 changed files with 117 additions and 26 deletions
+1
View File
@@ -640,6 +640,7 @@ datum/mind
ticker.mode.changelings -= src
special_role = null
current.remove_changeling_powers()
current.verbs -= /datum/changeling/proc/EvolutionMenu
if(changeling) del(changeling)
current << "<FONT color='red' size = 3><B>You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!</B></FONT>"
log_admin("[key_name_admin(usr)] has de-changeling'ed [current].")
+10
View File
@@ -1,5 +1,15 @@
/datum/intercept_text
var/text
/*
var/prob_correct_person_lower = 20
var/prob_correct_person_higher = 80
var/prob_correct_job_lower = 20
var/prob_correct_job_higher = 80
var/prob_correct_prints_lower = 20
var/prob_correct_print_higher = 80
var/prob_correct_objective_lower = 20
var/prob_correct_objective_higher = 80
*/
var/list/org_names_1 = list(
"Blighted",
"Defiled",
+1 -1
View File
@@ -231,7 +231,7 @@
return
/obj/machinery/door/proc/requiresID()
return 0
return 1
/obj/machinery/door/proc/update_nearby_tiles(need_rebuild)
if(!air_master) return 0
+10
View File
@@ -812,6 +812,16 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
parent.update_tray()
/obj/item/seeds/grassseed/harvest(mob/user = usr)
var/obj/machinery/hydroponics/parent = loc //for ease of access
var/t_yield = round(yield*parent.yieldmod)
if(t_yield > 0)
var/obj/item/stack/tile/grass/new_grass = new/obj/item/stack/tile/grass(user.loc)
new_grass.amount = t_yield
parent.update_tray()
/obj/item/seeds/gibtomato/harvest(mob/user = usr)
var/produce = text2path(productname)
var/obj/machinery/hydroponics/parent = loc //for ease of access
+41 -16
View File
@@ -12,23 +12,42 @@
active_power_usage = 100
flags = NOREACT
var/global/max_n_of_items = 999 // Sorry but the BYOND infinite loop detector doesn't look things over 1000.
var/icon_on = "smartfridge"
var/icon_off = "smartfridge-off"
var/item_quants = list()
var/ispowered = 1 //starts powered
var/isbroken = 0
/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
return 1
return 0
/obj/machinery/smartfridge/seeds
name = "\improper MegaSeed Servitor"
desc = "When you need seeds fast!"
icon = 'icons/obj/vending.dmi'
icon_state = "seeds"
icon_on = "seeds"
icon_off = "seeds-off"
/obj/machinery/smartfridge/seeds/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/seeds/))
return 1
return 0
/obj/machinery/smartfridge/power_change()
if( powered() )
src.ispowered = 1
stat &= ~NOPOWER
if(!isbroken)
icon_state = "smartfridge"
icon_state = icon_on
else
spawn(rand(0, 15))
src.ispowered = 0
stat |= NOPOWER
if(!isbroken)
icon_state = "smartfridge-off"
icon_state = icon_off
/*******************
@@ -40,7 +59,7 @@
user << "<span class='notice'>\The [src] is unpowered and useless.</span>"
return
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/))
if(accept_check(O))
if(contents.len >= max_n_of_items)
user << "<span class='notice'>\The [src] is full.</span>"
return 1
@@ -55,19 +74,25 @@
"<span class='notice'>You add \the [O] to \the [src].")
else if(istype(O, /obj/item/weapon/plantbag))
user.visible_message("<span class='notice'>[user] loads \the [src] with \the [O].</span>", \
"<span class='notice'>You load \the [src] with \the [O].</span>")
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in O.contents)
if(contents.len >= max_n_of_items)
user << "<span class='notice'>\The [src] is full.</span>"
return 1
else
O.contents -= G
G.loc = src
if(item_quants[G.name])
item_quants[G.name]++
var/plants_loaded = 0
for(var/obj/G in O.contents)
if(accept_check(G))
if(contents.len >= max_n_of_items)
user << "<span class='notice'>\The [src] is full.</span>"
return 1
else
item_quants[G.name] = 1
O.contents -= G
G.loc = src
if(item_quants[G.name])
item_quants[G.name]++
else
item_quants[G.name] = 1
plants_loaded++
if(plants_loaded)
user.visible_message("<span class='notice'>[user] loads \the [src] with \the [O].</span>", \
"<span class='notice'>You load \the [src] with \the [O].</span>")
if(O.contents.len > 0)
user << "<span class='notice'>Some items are refused.</span>"
else
user << "<span class='notice'>\The [src] smartly refuses [O].</span>"
@@ -110,7 +135,7 @@
dat += "<br>"
dat += "</TT>"
user << browse("<HEAD><TITLE>SmartFridge Supplies</TITLE></HEAD><TT>[dat]</TT>", "window=smartfridge")
user << browse("<HEAD><TITLE>[src] Supplies</TITLE></HEAD><TT>[dat]</TT>", "window=smartfridge")
onclose(user, "smartfridge")
return
+6
View File
@@ -45,4 +45,10 @@ obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob
t_amount++
del(O)
else if(istype(O, /obj/item/stack/tile/grass))
var/obj/item/stack/tile/grass/S = O
user << "<span class='notice'>You extract some seeds from the [S.name].</span>"
S.use(1)
new /obj/item/seeds/grassseed(loc)
return
@@ -21,7 +21,7 @@
w_class = 1
/obj/item/weapon/plantbag/attack_self(mob/user as mob)
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/O in contents)
for (var/obj/item/O in contents)
contents -= O
O.loc = user.loc
user << "\blue You empty the plant bag."
+18 -1
View File
@@ -221,7 +221,7 @@ datum/preferences
var/HTML = "<body>"
HTML += "<tt><center>"
HTML += "<b>Choose occupation chances</b><br>Unavailable occupations are in red.<br><br>"
HTML += "<a align='center' href='?_src_=prefs;preference=job;task=close'>\[Done\]</a><br><br>" // Easier to press up here.
HTML += "<center><a href='?_src_=prefs;preference=job;task=reset'>\[Reset\]</a> - <a href='?_src_=prefs;preference=job;task=close'>\[Done\]</a></center><br><br>" // Easier to press up here.
HTML += "<table width='100%' cellpadding='1' cellspacing='0'><tr><td width='20%'>" // Table within a table for alignment, also allows you to easily add more colomns.
HTML += "<table width='100%' cellpadding='1' cellspacing='0'>"
var/index = -1
@@ -317,6 +317,20 @@ datum/preferences
SetChoices(user)
return 1
proc/ResetJobs()
job_civilian_high = 0
job_civilian_med = 0
job_civilian_low = 0
job_medsci_high = 0
job_medsci_med = 0
job_medsci_low = 0
job_engsec_high = 0
job_engsec_med = 0
job_engsec_low = 0
proc/GetJobDepartment(var/datum/job/job, var/level)
if(!job || !level) return 0
@@ -407,6 +421,9 @@ datum/preferences
if("close")
user << browse(null, "window=mob_occupation")
ShowChoices(user)
if("reset")
ResetJobs()
SetChoices(user)
if("random")
userandomjob = !userandomjob
SetChoices(user)
@@ -52,13 +52,33 @@
if (istype(O, /obj/item/weapon/plantbag))
var/obj/item/weapon/plantbag/S = O
if (S.mode == 1)
for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(src.x,src.y,src.z))
if (S.contents.len < S.capacity)
S.contents += G;
else
user << "\blue The plant bag is full."
return
user << "\blue You pick up all the plants."
for(var/obj/item/G in get_turf(src))
if(istype(G, /obj/item/seeds) || istype(G, /obj/item/weapon/reagent_containers/food/snacks/grown))
if (S.contents.len < S.capacity)
S.contents += G
else
user << "\blue The plant bag is full."
return
user << "\blue You pick up all the plants and seeds."
else
if (S.contents.len < S.capacity)
S.contents += src;
else
user << "\blue The plant bag is full."
return
/obj/item/seeds/attackby(var/obj/item/O as obj, var/mob/user as mob)
if (istype(O, /obj/item/weapon/plantbag))
var/obj/item/weapon/plantbag/S = O
if (S.mode == 1)
for(var/obj/item/G in get_turf(src))
if(istype(G, /obj/item/seeds) || istype(G, /obj/item/weapon/reagent_containers/food/snacks/grown))
if (S.contents.len < S.capacity)
S.contents += G
else
user << "\blue The plant bag is full."
return
user << "\blue You pick up all the plants and seeds."
else
if (S.contents.len < S.capacity)
S.contents += src;
@@ -852,6 +872,7 @@
// Putting these at the bottom so they don't clutter the list up. -Cheridan
// *************************************
/*
//This object is just a transition object. All it does is make a grass tile and delete itself.
/obj/item/weapon/reagent_containers/food/snacks/grown/grass
seed = "/obj/item/seeds/grassseed"
@@ -863,6 +884,7 @@
new/obj/item/stack/tile/grass(src.loc)
spawn(5) //Workaround to keep harvesting from working weirdly.
del(src)
*/
//This object is just a transition object. All it does is make dosh and delete itself. -Cheridan
/obj/item/weapon/reagent_containers/food/snacks/grown/money