mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
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:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user