Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into outpost-power

This commit is contained in:
Atlantiscze
2015-02-24 13:09:05 +01:00
174 changed files with 5440 additions and 6450 deletions

View File

@@ -93,8 +93,10 @@
#include "code\controllers\lighting_controller.dm"
#include "code\controllers\master_controller.dm"
#include "code\controllers\shuttle_controller.dm"
#include "code\controllers\subsystems.dm"
#include "code\controllers\verbs.dm"
#include "code\controllers\voting.dm"
#include "code\controllers\subsystem\alarms.dm"
#include "code\datums\ai_laws.dm"
#include "code\datums\browser.dm"
#include "code\datums\computerfiles.dm"
@@ -238,14 +240,12 @@
#include "code\game\gamemodes\cult\ritual.dm"
#include "code\game\gamemodes\cult\runes.dm"
#include "code\game\gamemodes\cult\talisman.dm"
#include "code\game\gamemodes\events\biomass.dm"
#include "code\game\gamemodes\events\black_hole.dm"
#include "code\game\gamemodes\events\clang.dm"
#include "code\game\gamemodes\events\dust.dm"
#include "code\game\gamemodes\events\miniblob.dm"
#include "code\game\gamemodes\events\power_failure.dm"
#include "code\game\gamemodes\events\space_ninja.dm"
#include "code\game\gamemodes\events\spacevines.dm"
#include "code\game\gamemodes\events\wormholes.dm"
#include "code\game\gamemodes\events\holidays\Christmas.dm"
#include "code\game\gamemodes\events\holidays\Holidays.dm"
@@ -305,8 +305,8 @@
#include "code\game\machinery\autolathe.dm"
#include "code\game\machinery\autolathe_datums.dm"
#include "code\game\machinery\Beacon.dm"
#include "code\game\machinery\bees_apiary.dm"
#include "code\game\machinery\bees_items.dm"
#include "code\game\machinery\biogenerator.dm"
#include "code\game\machinery\bioprinter.dm"
#include "code\game\machinery\buttons.dm"
#include "code\game\machinery\cell_charger.dm"
@@ -452,9 +452,7 @@
#include "code\game\machinery\embedded_controller\embedded_program_base.dm"
#include "code\game\machinery\embedded_controller\simple_docking_controller.dm"
#include "code\game\machinery\kitchen\gibber.dm"
#include "code\game\machinery\kitchen\juicer.dm"
#include "code\game\machinery\kitchen\microwave.dm"
#include "code\game\machinery\kitchen\processor.dm"
#include "code\game\machinery\kitchen\smartfridge.dm"
#include "code\game\machinery\pipe\construction.dm"
#include "code\game\machinery\pipe\pipe_dispenser.dm"
@@ -812,6 +810,13 @@
#include "code\modules\admin\verbs\ticklag.dm"
#include "code\modules\admin\verbs\tripAI.dm"
#include "code\modules\admin\verbs\vox_raiders.dm"
#include "code\modules\alarm\alarm.dm"
#include "code\modules\alarm\alarm_handler.dm"
#include "code\modules\alarm\atmosphere_alarm.dm"
#include "code\modules\alarm\camera_alarm.dm"
#include "code\modules\alarm\fire_alarm.dm"
#include "code\modules\alarm\motion_alarm.dm"
#include "code\modules\alarm\power_alarm.dm"
#include "code\modules\assembly\assembly.dm"
#include "code\modules\assembly\bomb.dm"
#include "code\modules\assembly\helpers.dm"
@@ -918,7 +923,6 @@
#include "code\modules\detectivework\forensics.dm"
#include "code\modules\detectivework\scanner.dm"
#include "code\modules\detectivework\scanning_console.dm"
#include "code\modules\distillery\main.dm"
#include "code\modules\economy\Accounts.dm"
#include "code\modules\economy\Accounts_DB.dm"
#include "code\modules\economy\ATM.dm"
@@ -975,16 +979,27 @@
#include "code\modules\genetics\side_effects.dm"
#include "code\modules\holodeck\HolodeckControl.dm"
#include "code\modules\holodeck\HolodeckObjects.dm"
#include "code\modules\hydroponics\biogenerator.dm"
#include "code\modules\hydroponics\_hydro_setup.dm"
#include "code\modules\hydroponics\grown.dm"
#include "code\modules\hydroponics\grown_inedible.dm"
#include "code\modules\hydroponics\hydro_tools.dm"
#include "code\modules\hydroponics\hydro_tray.dm"
#include "code\modules\hydroponics\grown_predefined.dm"
#include "code\modules\hydroponics\seed.dm"
#include "code\modules\hydroponics\seed_controller.dm"
#include "code\modules\hydroponics\seed_datums.dm"
#include "code\modules\hydroponics\seed_machines.dm"
#include "code\modules\hydroponics\seed_mobs.dm"
#include "code\modules\hydroponics\seed_packets.dm"
#include "code\modules\hydroponics\seed_storage.dm"
#include "code\modules\hydroponics\seeds.dm"
#include "code\modules\hydroponics\vines.dm"
#include "code\modules\hydroponics\spreading\spreading.dm"
#include "code\modules\hydroponics\spreading\spreading_growth.dm"
#include "code\modules\hydroponics\spreading\spreading_response.dm"
#include "code\modules\hydroponics\trays\tray.dm"
#include "code\modules\hydroponics\trays\tray_apiary.dm"
#include "code\modules\hydroponics\trays\tray_process.dm"
#include "code\modules\hydroponics\trays\tray_reagents.dm"
#include "code\modules\hydroponics\trays\tray_soil.dm"
#include "code\modules\hydroponics\trays\tray_tools.dm"
#include "code\modules\hydroponics\trays\tray_update_icons.dm"
#include "code\modules\library\lib_items.dm"
#include "code\modules\library\lib_machines.dm"
#include "code\modules\library\lib_readme.dm"
@@ -1130,7 +1145,6 @@
#include "code\modules\mob\living\carbon\monkey\login.dm"
#include "code\modules\mob\living\carbon\monkey\monkey.dm"
#include "code\modules\mob\living\carbon\monkey\update_icons.dm"
#include "code\modules\mob\living\silicon\alarm.dm"
#include "code\modules\mob\living\silicon\death.dm"
#include "code\modules\mob\living\silicon\laws.dm"
#include "code\modules\mob\living\silicon\login.dm"
@@ -1144,8 +1158,8 @@
#include "code\modules\mob\living\silicon\ai\life.dm"
#include "code\modules\mob\living\silicon\ai\login.dm"
#include "code\modules\mob\living\silicon\ai\logout.dm"
#include "code\modules\mob\living\silicon\ai\nano.dm"
#include "code\modules\mob\living\silicon\ai\say.dm"
#include "code\modules\mob\living\silicon\ai\subsystems.dm"
#include "code\modules\mob\living\silicon\ai\freelook\cameranet.dm"
#include "code\modules\mob\living\silicon\ai\freelook\chunk.dm"
#include "code\modules\mob\living\silicon\ai\freelook\eye.dm"
@@ -1178,6 +1192,7 @@
#include "code\modules\mob\living\silicon\robot\robot_items.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
#include "code\modules\mob\living\silicon\robot\robot_movement.dm"
#include "code\modules\mob\living\silicon\robot\subsystems.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_abilities.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_console.dm"
@@ -1236,6 +1251,7 @@
#include "code\modules\nano\nanomanager.dm"
#include "code\modules\nano\nanomapgen.dm"
#include "code\modules\nano\nanoui.dm"
#include "code\modules\nano\modules\alarm_monitor.dm"
#include "code\modules\nano\modules\crew_monitor.dm"
#include "code\modules\nano\modules\power_monitor.dm"
#include "code\modules\nano\modules\rcon.dm"
@@ -1389,7 +1405,6 @@
#include "code\modules\reagents\reagent_containers\food\drinks\drinkingglass.dm"
#include "code\modules\reagents\reagent_containers\food\drinks\jar.dm"
#include "code\modules\reagents\reagent_containers\food\drinks\bottle\robot.dm"
#include "code\modules\reagents\reagent_containers\food\snacks\grown.dm"
#include "code\modules\reagents\reagent_containers\food\snacks\meat.dm"
#include "code\modules\reagents\reagent_containers\glass\bottle.dm"
#include "code\modules\reagents\reagent_containers\glass\bottle\robot.dm"
@@ -1449,7 +1464,6 @@
#include "code\modules\research\xenoarchaeology\finds\finds_special.dm"
#include "code\modules\research\xenoarchaeology\finds\finds_talkingitem.dm"
#include "code\modules\research\xenoarchaeology\genetics\prehistoric_animals.dm"
#include "code\modules\research\xenoarchaeology\genetics\prehistoric_plants.dm"
#include "code\modules\research\xenoarchaeology\genetics\reconstitutor.dm"
#include "code\modules\research\xenoarchaeology\machinery\artifact_analyser.dm"
#include "code\modules\research\xenoarchaeology\machinery\artifact_harvester.dm"

View File

@@ -491,5 +491,8 @@ datum/projectile_data
temps[direction] = rstats
return temps
/proc/MinutesToTicks(var/minutes as num)
return minutes * 60 * 10
/proc/MinutesToTicks(var/minutes)
return SecondsToTicks(60 * minutes)
/proc/SecondsToTicks(var/seconds)
return seconds * 10

View File

@@ -596,3 +596,7 @@ datum/proc/dd_SortValue()
/obj/machinery/camera/dd_SortValue()
return "[c_tag]"
/datum/alarm/dd_SortValue()
return "[sanitize(last_name)]"

View File

@@ -1378,3 +1378,15 @@ var/list/WALLITEMS = list(
if(istype(arglist,/list))
arglist = list2params(arglist)
return "<a href='?src=\ref[D];[arglist]'>[content]</a>"
/proc/get_random_colour(var/simple, var/lower, var/upper)
var/colour
if(simple)
colour = pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))
else
for(var/i=1;i<=3;i++)
var/temp_col = "[num2hex(rand(lower,upper))]"
if(length(temp_col )<2)
temp_col = "0[temp_col]"
colour += temp_col
return colour

View File

@@ -256,59 +256,99 @@ datum/hud/New(mob/owner)
set name = "F12"
set hidden = 1
if(hud_used)
if(ishuman(src))
if(!client) return
if(client.view != world.view)
return
if(hud_used.hud_shown)
hud_used.hud_shown = 0
if(src.hud_used.adding)
src.client.screen -= src.hud_used.adding
if(src.hud_used.other)
src.client.screen -= src.hud_used.other
if(src.hud_used.hotkeybuttons)
src.client.screen -= src.hud_used.hotkeybuttons
if(src.hud_used.item_action_list)
src.client.screen -= src.hud_used.item_action_list
//Due to some poor coding some things need special treatment:
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
if(!full)
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
else
src.client.screen -= src.healths
src.client.screen -= src.internals
src.client.screen -= src.gun_setting_icon
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
else
hud_used.hud_shown = 1
if(src.hud_used.adding)
src.client.screen += src.hud_used.adding
if(src.hud_used.other && src.hud_used.inventory_shown)
src.client.screen += src.hud_used.other
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
src.client.screen += src.hud_used.hotkeybuttons
if(src.healths)
src.client.screen |= src.healths
if(src.internals)
src.client.screen |= src.internals
if(src.gun_setting_icon)
src.client.screen |= src.gun_setting_icon
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
src.client.screen += src.zone_sel //This one is a special snowflake
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
else
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
else
if(!hud_used)
usr << "\red This mob type does not use a HUD."
return
if(!ishuman(src))
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
return
if(!client) return
if(client.view != world.view)
return
if(hud_used.hud_shown)
hud_used.hud_shown = 0
if(src.hud_used.adding)
src.client.screen -= src.hud_used.adding
if(src.hud_used.other)
src.client.screen -= src.hud_used.other
if(src.hud_used.hotkeybuttons)
src.client.screen -= src.hud_used.hotkeybuttons
if(src.hud_used.item_action_list)
src.client.screen -= src.hud_used.item_action_list
//Due to some poor coding some things need special treatment:
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
if(!full)
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
else
src.client.screen -= src.healths
src.client.screen -= src.internals
src.client.screen -= src.gun_setting_icon
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
else
hud_used.hud_shown = 1
if(src.hud_used.adding)
src.client.screen += src.hud_used.adding
if(src.hud_used.other && src.hud_used.inventory_shown)
src.client.screen += src.hud_used.other
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
src.client.screen += src.hud_used.hotkeybuttons
if(src.healths)
src.client.screen |= src.healths
if(src.internals)
src.client.screen |= src.internals
if(src.gun_setting_icon)
src.client.screen |= src.gun_setting_icon
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
src.client.screen += src.zone_sel //This one is a special snowflake
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
//Similar to button_pressed_F12() but keeps zone_sel, gun_setting_icon, and healths.
/mob/proc/toggle_zoom_hud()
if(!hud_used)
return
if(!ishuman(src))
return
if(!client)
return
if(client.view != world.view)
return
if(hud_used.hud_shown)
hud_used.hud_shown = 0
if(src.hud_used.adding)
src.client.screen -= src.hud_used.adding
if(src.hud_used.other)
src.client.screen -= src.hud_used.other
if(src.hud_used.hotkeybuttons)
src.client.screen -= src.hud_used.hotkeybuttons
if(src.hud_used.item_action_list)
src.client.screen -= src.hud_used.item_action_list
src.client.screen -= src.internals
else
hud_used.hud_shown = 1
if(src.hud_used.adding)
src.client.screen += src.hud_used.adding
if(src.hud_used.other && src.hud_used.inventory_shown)
src.client.screen += src.hud_used.other
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
src.client.screen += src.hud_used.hotkeybuttons
if(src.internals)
src.client.screen |= src.internals
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()

View File

@@ -182,6 +182,8 @@
var/dooc_allowed = 1
var/dsay_allowed = 1
var/starlight = 0 // Whether space turfs have ambient light or not
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/T in L)
@@ -603,6 +605,9 @@
config.event_delay_upper[EVENT_LEVEL_MODERATE] = MinutesToTicks(values[2])
config.event_delay_upper[EVENT_LEVEL_MAJOR] = MinutesToTicks(values[3])
if("starlight")
config.starlight = 1
else
log_misc("Unknown setting in configuration: '[name]'")

View File

@@ -26,6 +26,7 @@ datum/controller/game_controller
var/powernets_cost = 0
var/nano_cost = 0
var/events_cost = 0
var/alarms_cost = 0
var/ticker_cost = 0
var/total_cost = 0
@@ -231,6 +232,11 @@ datum/controller/game_controller/proc/process()
process_events()
events_cost = (world.timeofday - timer) / 10
//ALARMS
timer = world.timeofday
process_alarms()
alarms_cost = (world.timeofday - timer) / 10
//TICKER
timer = world.timeofday
last_thing_processed = ticker.type
@@ -238,7 +244,7 @@ datum/controller/game_controller/proc/process()
ticker_cost = (world.timeofday - timer) / 10
//TIMING
total_cost = air_cost + sun_cost + mobs_cost + diseases_cost + machines_cost + objects_cost + networks_cost + powernets_cost + nano_cost + events_cost + ticker_cost
total_cost = air_cost + sun_cost + mobs_cost + diseases_cost + machines_cost + objects_cost + networks_cost + powernets_cost + nano_cost + events_cost + alarms_cost + ticker_cost
var/end_time = world.timeofday
if(end_time < start_time) //why not just use world.time instead?
@@ -334,9 +340,13 @@ datum/controller/game_controller/proc/process_nano()
nanomanager.processing_uis.Cut(i,i+1)
datum/controller/game_controller/proc/process_events()
last_thing_processed = /datum/event
last_thing_processed = /datum/event_manager
event_manager.process()
datum/controller/game_controller/proc/process_alarms()
last_thing_processed = /datum/subsystem/alarm
alarm_manager.fire()
datum/controller/game_controller/proc/Recover() //Mostly a placeholder for now.
var/msg = "## DEBUG: [time2text(world.timeofday)] MC restarted. Reports:\n"
for(var/varname in master_controller.vars)

View File

@@ -0,0 +1,33 @@
// We manually initialize the alarm handlers instead of looping over all existing types
// to make it possible to write: camera.triggerAlarm() rather than alarm_manager.managers[datum/alarm_handler/camera].triggerAlarm() or a variant thereof.
/var/global/datum/alarm_handler/atmosphere/atmosphere_alarm = new()
/var/global/datum/alarm_handler/camera/camera_alarm = new()
/var/global/datum/alarm_handler/fire/fire_alarm = new()
/var/global/datum/alarm_handler/motion/motion_alarm = new()
/var/global/datum/alarm_handler/power/power_alarm = new()
/datum/subsystem/alarm
name = "Alarm"
var/list/datum/alarm/all_handlers
/datum/subsystem/alarm/New()
all_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm)
/datum/subsystem/alarm/stat_entry()
stat(null,"Alarm-[master_controller.alarms_cost]\t#[number_of_active_alarms()]")
/datum/subsystem/alarm/fire()
for(var/datum/alarm_handler/AH in all_handlers)
AH.process()
/datum/subsystem/alarm/proc/active_alarms()
var/list/all_alarms = new
for(var/datum/alarm_handler/AH in all_handlers)
var/list/alarms = AH.alarms
all_alarms += alarms
return all_alarms
/datum/subsystem/alarm/proc/number_of_active_alarms()
var/list/alarms = active_alarms()
return alarms.len

View File

@@ -0,0 +1,46 @@
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
/datum/subsystem
//things you will want to define
var/name //name of the subsystem
var/priority = 0 //priority affects order of initialization. Higher priorities are initialized first, lower priorities later. Can be decimal and negative values.
var/wait = 20 //time to wait (in deciseconds) between each call to fire(). Must be a positive integer.
//things you will probably want to leave alone
var/can_fire = 0 //prevent fire() calls
var/last_fire = 0 //last world.time we called fire()
var/next_fire = 0 //scheduled world.time for next fire()
var/cpu = 0 //cpu-usage stats (somewhat vague)
var/cost = 0 //average time to execute
var/times_fired = 0 //number of times we have called fire()
//used to initialize the subsystem BEFORE the map has loaded
/datum/subsystem/New()
//previously, this would have been named 'process()' but that name is used everywhere for different things!
//fire() seems more suitable. This is the procedure that gets called every 'wait' deciseconds.
//fire(), and the procs it calls, SHOULD NOT HAVE ANY SLEEP OPERATIONS in them!
//YE BE WARNED!
/datum/subsystem/proc/fire()
can_fire = 0
//used to initialize the subsystem AFTER the map has loaded
/datum/subsystem/proc/Initialize(start_timeofday)
var/time = (world.timeofday - start_timeofday) / 10
var/msg = "Initialized [name] SubSystem within [time] seconds"
world << "<span class='userdanger'>[msg]</span>"
world.log << msg
//hook for printing stats to the "MC" statuspanel for admins to see performance and related stats etc.
/datum/subsystem/proc/stat_entry()
stat(name, "[round(cost,0.001)]ds\t(CPU:[round(cpu,1)]%)")
//could be used to postpone a costly subsystem for one cycle
//for instance, during cpu intensive operations like explosions
/datum/subsystem/proc/postpone()
if(next_fire - world.time < wait)
next_fire += wait
//usually called via datum/subsystem/New() when replacing a subsystem (i.e. due to a recurring crash)
//should attempt to salvage what it can from the old instance of subsystem
/datum/subsystem/proc/Recover()

View File

@@ -56,7 +56,7 @@
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
return
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event"))
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm"))
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
@@ -114,5 +114,11 @@
if("Event")
debug_variables(event_manager)
feedback_add_details("admin_verb", "DEvent")
if("Plants")
debug_variables(plant_controller)
feedback_add_details("admin_verb", "DPlants")
if("Alarm")
debug_variables(alarm_manager)
feedback_add_details("admin_verb", "DAlarm")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
return

View File

@@ -51,7 +51,6 @@
assignment = "Unassigned"
var/id = add_zero(num2hex(rand(1, 1.6777215E7)), 6) //this was the best they could come up with? A large random number? *sigh*
var/icon/front = new(get_id_photo(H), dir = SOUTH)
var/icon/side = new(get_id_photo(H), dir = WEST)
//General Record

View File

@@ -26,52 +26,68 @@
*
* Functions you do not need to call directly but could:
* /datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
* //1=precisely, 0=insufficiently, -1=superfluous
*
* /datum/recipe/proc/check_items(var/obj/container as obj)
* //1=precisely, 0=insufficiently, -1=superfluous
*
* */
/datum/recipe
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
var/list/items // example: =list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
var/result //example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
var/time = 100 // 1/10 part of second
var/list/reagents // example: = list("berryjuice" = 5) // do not list same reagent twice
var/list/items // example: = list(/obj/item/weapon/crowbar, /obj/item/weapon/welder) // place /foo/bar before /foo
var/list/fruit // example: = list("fruit" = 3)
var/result // example: = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
var/time = 100 // 1/10 part of second
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents) //1=precisely, 0=insufficiently, -1=superfluous
/datum/recipe/proc/check_reagents(var/datum/reagents/avail_reagents)
. = 1
for (var/r_r in reagents)
var/aval_r_amnt = avail_reagents.get_reagent_amount(r_r)
if (!(abs(aval_r_amnt - reagents[r_r])<0.5)) //if NOT equals
if (aval_r_amnt>reagents[r_r])
. = -1
. = 0
else
return 0
return -1
if ((reagents?(reagents.len):(0)) < avail_reagents.reagent_list.len)
return -1
return 0
return .
/datum/recipe/proc/check_items(var/obj/container as obj) //1=precisely, 0=insufficiently, -1=superfluous
if (!items)
if (locate(/obj/) in container)
return -1
else
return 1
/datum/recipe/proc/check_fruit(var/obj/container)
. = 1
var/list/checklist = items.Copy()
for (var/obj/O in container)
var/found = 0
for (var/type in checklist)
if (istype(O,type))
checklist-=type
found = 1
break
if (!found)
if(fruit && fruit.len)
var/list/checklist = list()
for(var/fruittype in fruit) // I do not trust Copy().
checklist[fruittype] = fruit[fruittype]
for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in container)
if(!G.seed || !G.seed.kitchen_tag || isnull(checklist[G.seed.kitchen_tag]))
continue
checklist[G.seed.kitchen_tag]--
for(var/ktag in checklist)
if(!isnull(checklist[ktag]))
if(checklist[ktag] < 0)
. = 0
else if(checklist[ktag] > 0)
. = -1
break
return .
/datum/recipe/proc/check_items(var/obj/container as obj)
. = 1
if (items && items.len)
var/list/checklist = list()
for(var/item_type in items)
checklist |= item_type //Still don't trust Copy().
for(var/obj/O in container)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown))
continue // Fruit is handled in check_fruit().
var/found = 0
for(var/item_type in checklist)
if (istype(O,item_type))
checklist-=item_type
found = 1
break
if (!found)
. = 0
if (checklist.len)
. = -1
if (checklist.len)
return 0
return .
//general version
@@ -85,6 +101,9 @@
// food-related
/datum/recipe/proc/make_food(var/obj/container as obj)
if(!result)
world << "<span class='danger'>Recipe [type] is defined without a result, please bug this.</span>"
return
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
if (O.reagents)
@@ -95,26 +114,23 @@
container.reagents.clear_reagents()
return result_obj
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact = 1 as num)
if (!exact)
exact = -1
/proc/select_recipe(var/list/datum/recipe/avaiable_recipes, var/obj/obj as obj, var/exact)
var/list/datum/recipe/possible_recipes = new
var/target = exact ? 0 : 1
for (var/datum/recipe/recipe in avaiable_recipes)
if (recipe.check_reagents(obj.reagents)==exact && recipe.check_items(obj)==exact)
possible_recipes+=recipe
if((recipe.check_reagents(obj.reagents) < target) || (recipe.check_items(obj) < target) || (recipe.check_fruit(obj) < target))
continue
possible_recipes |= recipe
if (possible_recipes.len==0)
return null
else if (possible_recipes.len==1)
return possible_recipes[1]
else //okay, let's select the most complicated recipe
var/r_count = 0
var/i_count = 0
var/highest_count = 0
. = possible_recipes[1]
for (var/datum/recipe/recipe in possible_recipes)
var/N_i = (recipe.items)?(recipe.items.len):0
var/N_r = (recipe.reagents)?(recipe.reagents.len):0
if (N_i > i_count || (N_i== i_count && N_r > r_count ))
r_count = N_r
i_count = N_i
var/count = ((recipe.items)?(recipe.items.len):0) + ((recipe.reagents)?(recipe.reagents.len):0) + ((recipe.fruit)?(recipe.fruit.len):0)
if (count >= highest_count)
highest_count = count
. = recipe
return .

View File

@@ -53,9 +53,8 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
/obj/item/weapon/reagent_containers/food/snacks/tofu,
/obj/item/weapon/reagent_containers/food/snacks/tofu,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/grown/banana,
/obj/item/weapon/reagent_containers/food/snacks/grown/banana)
/obj/item/weapon/reagent_containers/food/snacks/meat
)
cost = 10
containertype = /obj/structure/closet/crate/freezer
containername = "Food crate"
@@ -267,6 +266,8 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
/datum/supply_packs/hydroponics // -- Skie
name = "Hydroponics Supply Crate"
contains = list(/obj/item/weapon/reagent_containers/spray/plantbgone,
/obj/item/weapon/reagent_containers/spray/plantbgone,
/obj/item/weapon/reagent_containers/spray/plantbgone,
/obj/item/weapon/reagent_containers/spray/plantbgone,
/obj/item/weapon/reagent_containers/glass/bottle/ammonia,
/obj/item/weapon/reagent_containers/glass/bottle/ammonia,

View File

@@ -46,7 +46,7 @@ var/const/AALARM_WIRE_AALARM = 16
//world << "Syphon Wire Cut"
if(AALARM_WIRE_AALARM)
if (A.alarm_area.atmosalert(2))
if (A.alarm_area.atmosalert(2, A))
A.post_alert(2)
A.update_icon()
@@ -88,6 +88,6 @@ var/const/AALARM_WIRE_AALARM = 16
if(AALARM_WIRE_AALARM)
// world << "Aalarm wire pulsed"
if (A.alarm_area.atmosalert(0))
if (A.alarm_area.atmosalert(0, A))
A.post_alert(0)
A.update_icon()

View File

@@ -24,17 +24,6 @@
var/mode = 1
w_class = 3.0
/obj/item/weapon/bananapeel
name = "banana peel"
desc = "A peel from a banana."
icon = 'icons/obj/items.dmi'
icon_state = "banana_peel"
item_state = "banana_peel"
w_class = 2.0
throwforce = 0
throw_speed = 4
throw_range = 20
/obj/item/weapon/soap
name = "soap"
desc = "A cheap bar of soap. Doesn't smell."

View File

@@ -110,7 +110,13 @@ var/list/ghostteleportlocs = list()
power_environ = 0
ambience = list('sound/ambience/ambispace.ogg','sound/music/title2.ogg','sound/music/space.ogg','sound/music/main.ogg','sound/music/traitor.ogg')
/area/space/firealert()
area/space/atmosalert()
return
/area/space/fire_alert()
return
/area/space/fire_reset()
return
/area/space/readyalert()

View File

@@ -30,37 +30,14 @@
power_change() // all machines set to current power level, also updates lighting icon
InitializeLighting()
/area/proc/get_cameras()
var/list/cameras = list()
for (var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
cameras += C
return cameras
/area/proc/poweralert(var/state, var/obj/source as obj)
if (state != poweralm)
poweralm = state
if(istype(source)) //Only report power alarms on the z-level where the source is located.
var/list/cameras = list()
for (var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
cameras += C
if(state == 1)
C.network.Remove("Power Alarms")
else
C.network.Add("Power Alarms")
for (var/mob/living/silicon/aiPlayer in player_list)
if(aiPlayer.z == source.z)
if (state == 1)
aiPlayer.cancelAlarm("Power", src, source)
else
aiPlayer.triggerAlarm("Power", src, cameras, source)
for(var/obj/machinery/computer/station_alert/a in machines)
if(a.z == source.z)
if(state == 1)
a.cancelAlarm("Power", src, source)
else
a.triggerAlarm("Power", src, cameras, source)
return
/area/proc/atmosalert(danger_level, var/set_firelocks=1)
// if(type==/area) //No atmos alarms in space
// return 0 //redudant
/area/proc/atmosalert(danger_level, var/alarm_source)
//Check all the alarms before lowering atmosalm. Raising is perfectly fine.
for (var/area/RA in related)
for (var/obj/machinery/alarm/AA in RA)
@@ -68,32 +45,16 @@
danger_level = max(danger_level, AA.danger_level)
if(danger_level != atmosalm)
if (set_firelocks && danger_level < 1 && atmosalm >= 1)
if (danger_level < 1 && atmosalm >= 1)
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
air_doors_open()
else if (danger_level >= 2 && atmosalm < 2)
air_doors_close()
if (danger_level < 2 && atmosalm >= 2)
for(var/area/RA in related)
for(var/obj/machinery/camera/C in RA)
C.network.Remove("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in machines)
a.cancelAlarm("Atmosphere", src, src)
if (danger_level >= 2 && atmosalm < 2)
var/list/cameras = list()
for(var/area/RA in related)
//updateicon()
for(var/obj/machinery/camera/C in RA)
cameras += C
C.network.Add("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
for(var/obj/machinery/computer/station_alert/a in machines)
a.triggerAlarm("Atmosphere", src, cameras, src)
if (set_firelocks)
air_doors_close()
if (danger_level == 0)
atmosphere_alarm.clearAlarm(master, alarm_source)
else
atmosphere_alarm.triggerAlarm(master, alarm_source, severity = danger_level)
atmosalm = danger_level
for(var/area/RA in related)
@@ -107,9 +68,9 @@
if(!src.master.air_doors_activated)
src.master.air_doors_activated = 1
for(var/obj/machinery/door/firedoor/E in src.master.all_doors)
if(!E:blocked)
if(!E.blocked)
if(E.operating)
E:nextstate = CLOSED
E.nextstate = CLOSED
else if(!E.density)
spawn(0)
E.close()
@@ -118,21 +79,21 @@
if(src.master.air_doors_activated)
src.master.air_doors_activated = 0
for(var/obj/machinery/door/firedoor/E in src.master.all_doors)
if(!E:blocked)
if(!E.blocked)
if(E.operating)
E:nextstate = OPEN
E.nextstate = OPEN
else if(E.density)
spawn(0)
E.open()
/area/proc/firealert()
if(name == "Space") //no fire alarms in space
return
if( !fire )
fire = 1
master.fire = 1 //used for firedoor checks
updateicon()
/area/proc/fire_alert()
if(!fire)
master.fire = 1 //used for firedoor checks
master.updateicon()
for(var/area/A in related)
A.fire = 1
A.updateicon()
mouse_opacity = 0
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
@@ -141,22 +102,15 @@
else if(!D.density)
spawn()
D.close()
var/list/cameras = list()
for(var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
cameras.Add(C)
C.network.Add("Fire Alarms")
for (var/mob/living/silicon/ai/aiPlayer in player_list)
aiPlayer.triggerAlarm("Fire", src, cameras, src)
for (var/obj/machinery/computer/station_alert/a in machines)
a.triggerAlarm("Fire", src, cameras, src)
/area/proc/firereset()
/area/proc/fire_reset()
if (fire)
fire = 0
master.fire = 0 //used for firedoor checks
master.fire = 0 //used for firedoor checks
master.updateicon()
for(var/area/A in related)
A.fire = 0
A.updateicon()
mouse_opacity = 0
updateicon()
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
if(D.operating)
@@ -164,13 +118,6 @@
else if(D.density)
spawn(0)
D.open()
for(var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
C.network.Remove("Fire Alarms")
for (var/mob/living/silicon/ai/aiPlayer in player_list)
aiPlayer.cancelAlarm("Fire", src, src)
for (var/obj/machinery/computer/station_alert/a in machines)
a.cancelAlarm("Fire", src, src)
/area/proc/readyalert()
if(!eject)

View File

@@ -28,7 +28,6 @@
recommended_enemies = 4
uplink_welcome = "Nar-Sie Uplink Console:"
uplink_uses = 10
var/datum/mind/sacrifice_target = null
var/finished = 0

View File

@@ -1,176 +0,0 @@
// BIOMASS (Note that this code is very similar to Space Vine code)
/obj/effect/biomass
name = "biomass"
desc = "Space barf from another dimension. It just keeps spreading!"
icon = 'icons/obj/biomass.dmi'
icon_state = "stage1"
anchored = 1
density = 0
layer = 5
pass_flags = PASSTABLE | PASSGRILLE
var/energy = 0
var/obj/effect/biomass_controller/master = null
New()
return
Del()
if(master)
master.vines -= src
master.growth_queue -= src
..()
/obj/effect/biomass/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (!W || !user || !W.type) return
switch(W.type)
if(/obj/item/weapon/circular_saw) del src
if(/obj/item/weapon/kitchen/utensil/knife) del src
if(/obj/item/weapon/scalpel) del src
if(/obj/item/weapon/twohanded/fireaxe) del src
if(/obj/item/weapon/hatchet) del src
if(/obj/item/weapon/melee/energy) del src
if(/obj/item/weapon/pickaxe/plasmacutter) del src
//less effective weapons
if(/obj/item/weapon/wirecutters)
if(prob(25)) del src
if(/obj/item/weapon/shard)
if(prob(25)) del src
else //weapons with subtypes
if(istype(W, /obj/item/weapon/melee/energy/sword)) del src
else if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user)) del src
else
return
..()
/obj/effect/biomass_controller
var/list/obj/effect/biomass/vines = list()
var/list/growth_queue = list()
var/reached_collapse_size
var/reached_slowdown_size
//What this does is that instead of having the grow minimum of 1, required to start growing, the minimum will be 0,
//meaning if you get the biomasssss..s' size to something less than 20 plots, it won't grow anymore.
New()
if(!istype(src.loc,/turf/simulated/floor))
del(src)
spawn_biomass_piece(src.loc)
processing_objects.Add(src)
Del()
processing_objects.Remove(src)
..()
proc/spawn_biomass_piece(var/turf/location)
var/obj/effect/biomass/BM = new(location)
growth_queue += BM
vines += BM
BM.master = src
process()
if(!vines)
del(src) //space vines exterminated. Remove the controller
return
if(!growth_queue)
del(src) //Sanity check
return
if(vines.len >= 250 && !reached_collapse_size)
reached_collapse_size = 1
if(vines.len >= 30 && !reached_slowdown_size )
reached_slowdown_size = 1
var/maxgrowth = 0
if(reached_collapse_size)
maxgrowth = 0
else if(reached_slowdown_size)
if(prob(25))
maxgrowth = 1
else
maxgrowth = 0
else
maxgrowth = 4
var/length = min( 30 , vines.len / 5 )
var/i = 0
var/growth = 0
var/list/obj/effect/biomass/queue_end = list()
for( var/obj/effect/biomass/BM in growth_queue )
i++
queue_end += BM
growth_queue -= BM
if(BM.energy < 2) //If tile isn't fully grown
if(prob(20))
BM.grow()
if(BM.spread())
growth++
if(growth >= maxgrowth)
break
if(i >= length)
break
growth_queue = growth_queue + queue_end
/obj/effect/biomass/proc/grow()
if(!energy)
src.icon_state = "stage2"
energy = 1
src.opacity = 0
src.density = 0
layer = 5
else
src.icon_state = "stage3"
src.opacity = 0
src.density = 1
energy = 2
/obj/effect/biomass/proc/spread()
var/direction = pick(cardinal)
var/step = get_step(src,direction)
if(istype(step,/turf/simulated/floor))
var/turf/simulated/floor/F = step
if(!locate(/obj/effect/biomass,F))
if(F.Enter(src))
if(master)
master.spawn_biomass_piece( F )
return 1
return 0
/obj/effect/biomass/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(90))
del(src)
return
if(3.0)
if (prob(50))
del(src)
return
return
/obj/effect/biomass/fire_act(null, temp, volume) //hotspots kill biomass
del src
/proc/biomass_infestation()
spawn() //to stop the secrets panel hanging
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
var/area/A = locate(areapath)
for(var/area/B in A.related)
for(var/turf/simulated/floor/F in B.contents)
if(!F.contents.len)
turfs += F
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/floor/T = pick(turfs)
new/obj/effect/biomass_controller(T) //spawn a controller at turf
message_admins("\blue Event: Biomass spawned at [T.loc.loc] ([T.x],[T.y],[T.z])")

View File

@@ -1,16 +0,0 @@
//Carn: Spacevines random event.
/proc/spacevine_infestation()
spawn() //to stop the secrets panel hanging
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
var/area/A = locate(areapath)
for(var/area/B in A.related)
for(var/turf/simulated/floor/F in B.contents)
if(!F.contents.len)
turfs += F
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/floor/T = pick(turfs)
new/obj/effect/plant_controller(T) //spawn a controller at turf
message_admins("\blue Event: Spacevines spawned at [T.loc] ([T.x],[T.y],[T.z])")

View File

@@ -30,30 +30,37 @@
var/newscaster_announcements = null
var/ert_disabled = 0
var/uplink_welcome = "Illegal Uplink Console:"
var/uplink_uses = 10
var/uplink_uses = 12
var/list/datum/uplink_item/uplink_items = list(
"Ammunition" = list(
new/datum/uplink_item(/obj/item/ammo_magazine/a357, 2, ".357", "RA"),
new/datum/uplink_item(/obj/item/ammo_magazine/mc9mm, 2, "9mm", "R9"),
new/datum/uplink_item(/obj/item/ammo_magazine/chemdart, 2, "Darts", "AD"),
new/datum/uplink_item(/obj/item/weapon/storage/box/sniperammo, 3, "14.5mm", "RA")
),
"Highly Visible and Dangerous Weapons" = list(
new/datum/uplink_item(/obj/item/ammo_magazine/mc9mm, 2, "Ammo-9mm", "R9"),
new/datum/uplink_item(/obj/item/ammo_magazine/a357, 2, "Ammo-357", "RA"),
new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM"),
new/datum/uplink_item(/obj/item/weapon/melee/energy/sword, 4, "Energy Sword", "ES"),
new/datum/uplink_item(/obj/item/weapon/gun/projectile/dartgun, 5, "Dart Gun", "DG"),
new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/g9mm, 5, "Silenced 9mm", "S9"),
new/datum/uplink_item(/obj/item/mecha_parts/mecha_equipment/weapon/energy/riggedlaser, 6, "Exosuit Rigged Laser", "RL"),
new/datum/uplink_item(/obj/item/weapon/gun/projectile/revolver, 6, "Revolver", "RE"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU")
new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU"),
new/datum/uplink_item(/obj/item/weapon/gun/projectile/heavysniper, 12, "PTRS Rifle", "BU")
),
"Stealthy and Inconspicuous Weapons" = list(
new/datum/uplink_item(/obj/item/weapon/soap/syndie, 1, "Subversive Soap", "SP"),
new/datum/uplink_item(/obj/item/weapon/cane/concealed, 2, "Concealed Cane Sword", "CC"),
new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC"),
new/datum/uplink_item(/obj/item/weapon/pen/paralysis, 3, "Paralysis Pen", "PP"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/cigarette, 4, "Cigarette Kit", "BH")
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/cigarette, 4, "Cigarette Kit", "BH"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/toxin, 4, "Random Toxin - Beaker", "RT")
),
"Stealth and Camouflage Items" = list(
new/datum/uplink_item(/obj/item/weapon/card/id/syndicate, 2, "Agent ID card", "AC"),
new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/spy, 2, "Bug Kit", "SK"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/spy, 2, "Bug Kit", "BK"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP"),
new/datum/uplink_item(/obj/item/clothing/mask/gas/voice, 4, "Voice Changer", "VC"),
@@ -62,11 +69,13 @@
"Devices and Tools" = list(
new/datum/uplink_item(/obj/item/weapon/storage/toolbox/syndicate, 1, "Fully Loaded Toolbox", "ST"),
new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
new/datum/uplink_item(/obj/item/device/encryptionkey/syndicate, 2, "Encrypted Radio Channel Key", "ER"),
new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/clerical, 3, "Morphic Clerical Kit", "CK"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/space, 3, "Space Suit", "SS"),
new/datum/uplink_item(/obj/item/clothing/glasses/thermal/syndi, 3, "Thermal Imaging Glasses", "TM"),
new/datum/uplink_item(/obj/item/clothing/suit/storage/vest/heavy/merc, 4, "Heavy Armor Vest", "HAV"),
new/datum/uplink_item(/obj/item/weapon/aiModule/syndicate, 7, "Hacked AI Upload Module", "AI"),
new/datum/uplink_item(/obj/item/device/powersink, 5, "Powersink (DANGER!)", "PS",),
new/datum/uplink_item(/obj/item/device/radio/beacon/syndicate, 7, "Singularity Beacon (DANGER!)", "SB"),
@@ -78,10 +87,20 @@
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_explosive, 6, "Explosive Implant (DANGER!)", "EI"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI")
),
"Health Aids" = list(
new/datum/uplink_item(/obj/item/weapon/storage/box/donkpockets, 1, "Box of Donk-Pockets", "DP"),
"Medical" = list(
new/datum/uplink_item(/obj/item/weapon/storage/box/donkpockets, 1, "Box of Sin-Pockets", "DP"),
new/datum/uplink_item(/obj/item/weapon/storage/firstaid/surgery, 5, "Surgery kit", "SK"),
new/datum/uplink_item(/obj/item/weapon/storage/firstaid/combat, 5, "Combat medical kit", "CM")
),
"Hardsuit Modules" = list(
new/datum/uplink_item(/obj/item/rig_module/vision/thermal, 2, "Thermal Scanner", "RTS"),
new/datum/uplink_item(/obj/item/rig_module/fabricator/energy_net, 3, "Net Projector", "REN"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/ewar_voice, 4, "Electrowarfare Suite and Voice Synthesiser", "REV"),
new/datum/uplink_item(/obj/item/rig_module/maneuvering_jets, 4, "Maneuvering Jets", "RMJ"),
new/datum/uplink_item(/obj/item/rig_module/mounted/egun, 6, "Mounted Energy Gun", "REG"),
new/datum/uplink_item(/obj/item/rig_module/power_sink, 6, "Power Sink", "RPS"),
new/datum/uplink_item(/obj/item/rig_module/mounted, 8, "Mounted Laser Cannon", "RLC")
),
"(Pointless) Badassery" = list(
new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS"),
new/datum/uplink_item(/obj/item/toy/nanotrasenballoon, 10, "For showing that you love NT SOO much (Useless Balloon)", "NT")
@@ -251,16 +270,6 @@
special_role == "Head Revolutionary" && prob(30))
suspects += man
// If they're a traitor or likewise, give them extra TC in exchange.
var/obj/item/device/uplink/hidden/suplink = man.mind.find_syndicate_uplink()
if(suplink)
var/extra = 4
suplink.uses += extra
man << "\red We have received notice that enemy intelligence suspects you to be linked with us. We have thus invested significant resources to increase your uplink's capacity."
else
// Give them a warning!
man << "\red They are on to you!"
// Some poor people who were just in the wrong place at the wrong time..
else if(prob(10))
suspects += man

View File

@@ -10,7 +10,6 @@
recommended_enemies = 1
uplink_welcome = "Crazy AI Uplink Console:"
uplink_uses = 10
var/const/waittime_l = 600
var/const/waittime_h = 1800 // started at 1800

View File

@@ -9,7 +9,6 @@
votable = 0
uplink_welcome = "EVIL METEOR Uplink Console:"
uplink_uses = 10
/datum/game_mode/meteor/announce()

View File

@@ -9,7 +9,7 @@
recommended_enemies = 3
uplink_welcome = "AntagCorp Uplink Console:"
uplink_uses = 5
uplink_uses = 7
newscaster_announcements = /datum/news_announcement/revolution_inciting_event

View File

@@ -13,7 +13,6 @@
uplink_welcome = "AntagCorp Portable Teleportation Relay:"
uplink_uses = 10
var/const/waittime_l = 600 //lower bound on time before intercept arrives (in tenths of seconds)
var/const/waittime_h = 1800 //upper bound on time before intercept arrives (in tenths of seconds)

View File

@@ -15,7 +15,7 @@
/obj/effect/rend
name = "Tear in the fabric of reality"
desc = "You should run now"
icon = 'icons/obj/biomass.dmi'
icon = 'icons/obj/wizard.dmi'
icon_state = "rift"
density = 1
unacidable = 1

View File

@@ -42,13 +42,13 @@
flag = SCIENTIST
department_flag = MEDSCI
faction = "Station"
total_positions = 6
total_positions = 5
spawn_positions = 3
supervisors = "the research director"
selection_color = "#ffeeff"
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_xenoarch)
minimal_access = list(access_tox, access_tox_storage, access_research, access_xenoarch)
alt_titles = list("Xenoarcheologist", "Anomalist", "Phoron Researcher", "Xenobotanist")
alt_titles = list("Xenoarcheologist", "Anomalist", "Phoron Researcher")
minimal_player_age = 14
@@ -74,12 +74,13 @@
flag = XENOBIOLOGIST
department_flag = MEDSCI
faction = "Station"
total_positions = 2
total_positions = 3
spawn_positions = 2
supervisors = "the research director"
selection_color = "#ffeeff"
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology)
minimal_access = list(access_research, access_xenobiology)
alt_titles = list("Xenobotanist")
minimal_player_age = 14

View File

@@ -117,19 +117,6 @@
first_run()
/obj/machinery/alarm/Del()
//If there's an active alarm, clear it after minute so that alarms don't keep going forver
delayed_reset()
..()
//needed to cancel the alarm after it is deleted
/obj/machinery/alarm/proc/delayed_reset()
var/area/A = alarm_area
src = null
spawn(600)
//It makes sense not to touch firelocks here. The alarm itself is gone, we have no idea what the atmos is like.
A.atmosalert(0, set_firelocks=0)
/obj/machinery/alarm/proc/first_run()
alarm_area = get_area(src)
if (alarm_area.master)
@@ -441,7 +428,7 @@
send_signal(device_id, list("power"= 0) )
/obj/machinery/alarm/proc/apply_danger_level(var/new_danger_level)
if (report_danger_level && alarm_area.atmosalert(new_danger_level))
if (report_danger_level && alarm_area.atmosalert(new_danger_level, src))
post_alert(new_danger_level)
update_icon()
@@ -769,13 +756,13 @@
return 1
if(href_list["atmos_alarm"])
if (alarm_area.atmosalert(2))
if (alarm_area.atmosalert(2, src))
apply_danger_level(2)
update_icon()
return 1
if(href_list["atmos_reset"])
if (alarm_area.atmosalert(0))
if (alarm_area.atmosalert(0, src))
apply_danger_level(0)
update_icon()
return 1
@@ -947,7 +934,6 @@ FIRE ALARM
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
/obj/machinery/firealarm/update_icon()
if(wiresexposed)
switch(buildstage)
if(2)
@@ -981,7 +967,8 @@ FIRE ALARM
return src.alarm()
/obj/machinery/firealarm/emp_act(severity)
if(prob(50/severity)) alarm()
if(prob(50/severity))
alarm(rand(30/severity, 60/severity))
..()
/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
@@ -1080,6 +1067,7 @@ FIRE ALARM
var/d2
if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon))
A = A.loc
A = A.master
if (A.fire)
d1 = text("<A href='?src=\ref[];reset=1'>Reset - Lockdown</A>", src)
@@ -1145,26 +1133,26 @@ FIRE ALARM
/obj/machinery/firealarm/proc/reset()
if (!( src.working ))
return
var/area/A = src.loc
A = A.loc
if (!( istype(A, /area) ))
return
A.firereset()
var/area/area = get_area(src)
for(var/area/A in area.related)
for(var/obj/machinery/firealarm/FA in A)
fire_alarm.clearAlarm(loc, FA)
update_icon()
return
/obj/machinery/firealarm/proc/alarm()
if (!( src.working ))
/obj/machinery/firealarm/proc/alarm(var/duration = 0)
if (!( src.working))
return
var/area/A = src.loc
A = A.loc
if (!( istype(A, /area) ))
return
A.firealert()
var/area/area = get_area(src)
for(var/area/A in area.related)
for(var/obj/machinery/firealarm/FA in A)
fire_alarm.triggerAlarm(loc, FA, duration)
update_icon()
//playsound(src.loc, 'sound/ambience/signal.ogg', 75, 0)
return
/obj/machinery/firealarm/New(loc, dir, building)
..()
@@ -1180,20 +1168,6 @@ FIRE ALARM
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
/obj/machinery/firealarm/Del()
//so fire alarms don't keep going forever
delayed_reset()
..()
//needed to cancel the alarm after it is deleted
/obj/machinery/firealarm/proc/delayed_reset()
var/area/A = get_area(src)
if (!A) return
src = null
spawn(600)
A.firereset()
/obj/machinery/firealarm/initialize()
if(z in config.contact_levels)
if(security_level)

View File

@@ -53,13 +53,6 @@
ASSERT(src.network.len > 0)
..()
/obj/machinery/camera/Del()
if(!alarm_on)
triggerCameraAlarm()
cancelCameraAlarm()
..()
/obj/machinery/camera/emp_act(severity)
if(!isEmpProof())
if(prob(100/severity))
@@ -67,7 +60,7 @@
stat |= EMPED
SetLuminosity(0)
kick_viewers()
triggerCameraAlarm()
triggerCameraAlarm(10 * severity)
update_icon()
spawn(900)
@@ -261,22 +254,16 @@
else
icon_state = initial(icon_state)
/obj/machinery/camera/proc/triggerCameraAlarm()
/obj/machinery/camera/proc/triggerCameraAlarm(var/duration = 0)
alarm_on = 1
if(!get_area(src))
return
for(var/mob/living/silicon/S in mob_list)
S.triggerAlarm("Camera", get_area(src), list(src), src)
camera_alarm.triggerAlarm(loc, src, duration)
/obj/machinery/camera/proc/cancelCameraAlarm()
alarm_on = 0
if(!get_area(src))
if(wires.IsIndexCut(CAMERA_WIRE_ALARM))
return
for(var/mob/living/silicon/S in mob_list)
S.cancelAlarm("Camera", get_area(src), src)
alarm_on = 0
camera_alarm.clearAlarm(loc, src)
//if false, then the camera is listed as DEACTIVATED and cannot be used
/obj/machinery/camera/proc/can_use()
@@ -361,3 +348,13 @@
user.set_machine(src)
wires.Interact(user)
/obj/machinery/camera/proc/nano_structure()
var/cam[0]
cam["name"] = sanitize(c_tag)
cam["deact"] = !can_use()
cam["camera"] = "\ref[src]"
cam["x"] = x
cam["y"] = y
cam["z"] = z
return cam

View File

@@ -45,8 +45,7 @@
if (!status || (stat & NOPOWER))
return 0
if (detectTime == -1)
for (var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.cancelAlarm("Motion", get_area(src), src)
motion_alarm.clearAlarm(loc, src)
detectTime = 0
return 1
@@ -54,8 +53,7 @@
if (!status || (stat & NOPOWER))
return 0
if (!detectTime) return 0
for (var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.triggerAlarm("Motion", get_area(src), list(src), src)
motion_alarm.triggerAlarm(loc, src)
detectTime = -1
return 1

View File

@@ -1,116 +1,85 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
// Converting these to global lists may be a bit laggy when removal procs are called. Consider
// rewriting this properly to fix the update bug, rather than unifying all monitors. ~Z
var/global/list/priority_air_alarms = list()
var/global/list/minor_air_alarms = list()
/obj/machinery/computer/atmos_alert
name = "atmospheric alert computer"
desc = "Used to access the station's atmospheric sensors."
circuit = "/obj/item/weapon/circuitboard/atmos_alert"
icon_state = "alert:0"
var/receive_frequency = 1437
var/datum/radio_frequency/radio_connection
/obj/machinery/computer/atmos_alert/initialize()
/obj/machinery/computer/atmos_alert/New()
..()
set_frequency(receive_frequency)
/obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal)
if(!signal || signal.encryption) return
var/zone = signal.data["zone"]
var/severity = signal.data["alert"]
if(!zone || !severity) return
minor_air_alarms -= zone
priority_air_alarms -= zone
if(severity=="severe")
priority_air_alarms |= zone
else if (severity=="minor")
minor_air_alarms |= zone
update_icon()
return
/obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, receive_frequency)
receive_frequency = new_frequency
radio_connection = radio_controller.add_object(src, receive_frequency, RADIO_ATMOSIA)
atmosphere_alarm.register(src, /obj/machinery/computer/station_alert/update_icon)
/obj/machinery/computer/atmos_alert/Del()
atmosphere_alarm.unregister(src)
..()
/obj/machinery/computer/atmos_alert/attack_hand(mob/user)
if(..(user))
return
user << browse(return_text(),"window=computer")
user.set_machine(src)
onclose(user, "computer")
ui_interact(user)
/obj/machinery/computer/atmos_alert/process()
if(..())
src.updateDialog()
/obj/machinery/computer/atmos_alert/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
var/data[0]
var/major_alarms[0]
var/minor_alarms[0]
for(var/datum/alarm/alarm in atmosphere_alarm.major_alarms())
major_alarms[++major_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "\ref[alarm]")
for(var/datum/alarm/alarm in atmosphere_alarm.minor_alarms())
minor_alarms[++minor_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "\ref[alarm]")
data["priority_alarms"] = major_alarms
data["minor_alarms"] = minor_alarms
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if(!ui)
ui = new(user, src, ui_key, "atmos_alert.tmpl", src.name, 500, 500)
ui.set_initial_data(data)
ui.open()
ui.set_auto_update(1)
/obj/machinery/computer/atmos_alert/update_icon()
..()
if(stat & (NOPOWER|BROKEN))
return
if(priority_air_alarms.len)
var/list/alarms = atmosphere_alarm.major_alarms()
if(alarms.len)
icon_state = "alert:2"
else if(minor_air_alarms.len)
icon_state = "alert:1"
else
icon_state = "alert:0"
alarms = atmosphere_alarm.minor_alarms()
if(alarms.len)
icon_state = "alert:1"
else
icon_state = initial(icon_state)
return
/obj/machinery/computer/atmos_alert/proc/return_text()
var/priority_text
var/minor_text
if(priority_air_alarms.len)
for(var/zone in priority_air_alarms)
priority_text += "<FONT color='red'><B>[zone]</B></FONT> <A href='?src=\ref[src];priority_clear=[ckey(zone)]'>X</A><BR>"
else
priority_text = "No priority alerts detected.<BR>"
if(minor_air_alarms.len)
for(var/zone in minor_air_alarms)
minor_text += "<B>[zone]</B> <A href='?src=\ref[src];minor_clear=[ckey(zone)]'>X</A><BR>"
else
minor_text = "No minor alerts detected.<BR>"
var/output = {"<B>[name]</B><HR>
<B>Priority Alerts:</B><BR>
[priority_text]
<BR>
<HR>
<B>Minor Alerts:</B><BR>
[minor_text]
<BR>"}
return output
/obj/machinery/computer/atmos_alert/Topic(href, href_list)
if(..())
return
return 1
if(href_list["priority_clear"])
var/removing_zone = href_list["priority_clear"]
for(var/zone in priority_air_alarms)
if(ckey(zone) == removing_zone)
priority_air_alarms -= zone
if(href_list["clear_alarm"])
var/datum/alarm/alarm = locate(href_list["clear_alarm"]) in atmosphere_alarm.alarms
if(alarm)
for(var/datum/alarm_source/alarm_source in alarm.sources)
var/obj/machinery/alarm/air_alarm = alarm_source.source
if(istype(air_alarm))
var/list/new_ref = list("atmos_reset" = 1)
air_alarm.Topic(href, new_ref, custom_state = atmos_alert_topic)
return 1
if(href_list["minor_clear"])
var/removing_zone = href_list["minor_clear"]
for(var/zone in minor_air_alarms)
if(ckey(zone) == removing_zone)
minor_air_alarms -= zone
update_icon()
return
var/datum/topic_state/atmos_alert/atmos_alert_topic = new()
/datum/topic_state/atmos_alert
flags = NANO_IGNORE_DISTANCE
/datum/topic_state/air_alarm/href_list(var/mob/user)
var/list/extra_href = list()
extra_href["remote_connection"] = 1
extra_href["remote_access"] = 1
return extra_href

View File

@@ -3,6 +3,8 @@
/proc/invalidateCameraCache()
for(var/obj/machinery/computer/security/s in world)
s.camera_cache = null
for(var/datum/alarm/A in world)
A.cameras = null
/obj/machinery/computer/security
name = "security camera monitor"
@@ -43,33 +45,17 @@
if(!can_access_camera(C))
continue
var/cam[0]
cam["name"] = sanitize(C.c_tag)
cam["deact"] = !C.can_use()
cam["camera"] = "\ref[C]"
cam["x"] = C.x
cam["y"] = C.y
cam["z"] = C.z
var/cam = C.nano_structure()
cameras[++cameras.len] = cam
if(C == current)
data["current"] = cam
var/list/camera_list = list("cameras" = cameras)
camera_cache=list2json(camera_list)
var/list/camera_list = list("cameras" = cameras)
camera_cache=list2json(camera_list)
else
if(current)
var/cam[0]
cam["name"] = current.c_tag
cam["deact"] = !current.can_use()
cam["camera"] = "\ref[current]"
cam["x"] = current.x
cam["y"] = current.y
cam["z"] = current.z
data["current"] = cam
data["current"] = current.nano_structure()
if(ui)

View File

@@ -5,106 +5,42 @@
icon_state = "alert:0"
circuit = "/obj/item/weapon/circuitboard/stationalert"
var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list())
var/obj/nano_module/alarm_monitor/engineering/alarm_monitor
/obj/machinery/computer/station_alert/New()
..()
alarm_monitor = new(src)
alarm_monitor.register(src, /obj/machinery/computer/station_alert/update_icon)
attack_ai(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
/obj/machinery/computer/station_alert/Del()
alarm_monitor.unregister(src)
..()
/obj/machinery/computer/station_alert/attack_ai(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
return
/obj/machinery/computer/station_alert/attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
return
/obj/machinery/computer/station_alert/interact(mob/user)
alarm_monitor.ui_interact(user)
/obj/machinery/computer/station_alert/update_icon()
..()
if(stat & (BROKEN|NOPOWER))
return
attack_hand(mob/user)
add_fingerprint(user)
if(stat & (BROKEN|NOPOWER))
return
interact(user)
return
interact(mob/user)
usr.set_machine(src)
var/dat = "<HEAD><TITLE>Current Station Alerts</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
dat += "<A HREF='?src=\ref[user];mach_close=alerts'>Close</A><br><br>"
for (var/cat in src.alarms)
dat += text("<B>[]</B><BR>\n", cat)
var/list/L = src.alarms[cat]
if (L.len)
for (var/alarm in L)
var/list/alm = L[alarm]
var/area/A = alm[1]
var/list/sources = alm[3]
dat += "<NOBR>"
dat += "&bull; "
dat += "[A.name]"
if (sources.len > 1)
dat += text(" - [] sources", sources.len)
dat += "</NOBR><BR>\n"
else
dat += "-- All Systems Nominal<BR>\n"
dat += "<BR>\n"
user << browse(dat, "window=alerts")
onclose(user, "alerts")
Topic(href, href_list)
if(..())
return
return
proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
if(stat & (BROKEN))
return
var/list/L = src.alarms[class]
for (var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/sources = alarm[3]
if (!(alarmsource in sources))
sources += alarmsource
return 1
var/obj/machinery/camera/C = null
var/list/CL = null
if (O && istype(O, /list))
CL = O
if (CL.len == 1)
C = CL[1]
else if (O && istype(O, /obj/machinery/camera))
C = O
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
return 1
proc/cancelAlarm(var/class, area/A as area, obj/origin)
if(stat & (BROKEN))
return
var/list/L = src.alarms[class]
var/cleared = 0
for (var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/srcs = alarm[3]
if (origin in srcs)
srcs -= origin
if (srcs.len == 0)
cleared = 1
L -= I
return !cleared
process()
if(stat & (BROKEN|NOPOWER))
icon_state = "atmos0"
return
var/active_alarms = 0
for (var/cat in src.alarms)
var/list/L = src.alarms[cat]
if(L.len) active_alarms = 1
if(active_alarms)
icon_state = "alert:2"
else
icon_state = "alert:0"
..()
return
var/list/alarms = alarm_monitor.active_alarms()
if(alarms.len)
icon_state = "alert:2"
else
icon_state = initial(icon_state)
return

View File

@@ -1,172 +0,0 @@
/obj/machinery/juicer
name = "Juicer"
icon = 'icons/obj/kitchen.dmi'
icon_state = "juicer1"
layer = 2.9
density = 0
anchored = 0
use_power = 1
idle_power_usage = 5
active_power_usage = 100
var/obj/item/weapon/reagent_containers/beaker = null
var/global/list/allowed_items = list (
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato = "tomatojuice",
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot = "carrotjuice",
/obj/item/weapon/reagent_containers/food/snacks/grown/berries = "berryjuice",
/obj/item/weapon/reagent_containers/food/snacks/grown/banana = "banana",
/obj/item/weapon/reagent_containers/food/snacks/grown/potato = "potato",
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon = "lemonjuice",
/obj/item/weapon/reagent_containers/food/snacks/grown/orange = "orangejuice",
/obj/item/weapon/reagent_containers/food/snacks/grown/lime = "limejuice",
/obj/item/weapon/reagent_containers/food/snacks/watermelonslice = "watermelonjuice",
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes = "grapejuice",
/obj/item/weapon/reagent_containers/food/snacks/grown/poisonberries = "poisonberryjuice",
)
/obj/machinery/juicer/New()
beaker = new /obj/item/weapon/reagent_containers/glass/beaker/large(src)
/obj/machinery/juicer/update_icon()
icon_state = "juicer"+num2text(!isnull(beaker))
return
/obj/machinery/juicer/attackby(var/obj/item/O as obj, var/mob/user as mob)
if (istype(O,/obj/item/weapon/reagent_containers/glass) || \
istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass))
if (beaker)
return 1
else
user.before_take_item(O)
O.loc = src
beaker = O
src.verbs += /obj/machinery/juicer/verb/detach
update_icon()
src.updateUsrDialog()
return 0
if (!is_type_in_list(O, allowed_items))
user << "It looks as not containing any juice."
return 1
user.before_take_item(O)
O.loc = src
src.updateUsrDialog()
return 0
/obj/machinery/juicer/attack_ai(mob/user as mob)
return 0
/obj/machinery/juicer/attack_hand(mob/user as mob)
user.set_machine(src)
interact(user)
/obj/machinery/juicer/interact(mob/user as mob) // The microwave Menu
var/is_chamber_empty = 0
var/is_beaker_ready = 0
var/processing_chamber = ""
var/beaker_contents = ""
for (var/i in allowed_items)
for (var/obj/item/O in src.contents)
if (!istype(O,i))
continue
processing_chamber+= "some <B>[O]</B><BR>"
break
if (!processing_chamber)
is_chamber_empty = 1
processing_chamber = "Nothing."
if (!beaker)
beaker_contents = "\The [src] has no beaker attached."
else if (!beaker.reagents.total_volume)
beaker_contents = "\The [src] has attached an empty beaker."
is_beaker_ready = 1
else if (beaker.reagents.total_volume < beaker.reagents.maximum_volume)
beaker_contents = "\The [src] has attached a beaker with something."
is_beaker_ready = 1
else
beaker_contents = "\The [src] has attached a beaker and beaker is full!"
var/dat = {"
<b>Processing chamber contains:</b><br>
[processing_chamber]<br>
[beaker_contents]<hr>
"}
if (is_beaker_ready && !is_chamber_empty && !(stat & (NOPOWER|BROKEN)))
dat += "<A href='?src=\ref[src];action=juice'>Turn on!<BR>"
if (beaker)
dat += "<A href='?src=\ref[src];action=detach'>Detach a beaker!<BR>"
user << browse("<HEAD><TITLE>Juicer</TITLE></HEAD><TT>[dat]</TT>", "window=juicer")
onclose(user, "juicer")
return
/obj/machinery/juicer/Topic(href, href_list)
if(..())
return
usr.set_machine(src)
switch(href_list["action"])
if ("juice")
juice()
if ("detach")
detach()
src.updateUsrDialog()
return
/obj/machinery/juicer/verb/detach()
set category = "Object"
set name = "Detach Beaker from the juicer"
set src in oview(1)
if (usr.stat != 0)
return
if (!beaker)
return
src.verbs -= /obj/machinery/juicer/verb/detach
beaker.loc = src.loc
beaker = null
update_icon()
/obj/machinery/juicer/proc/get_juice_id(var/obj/item/weapon/reagent_containers/food/snacks/grown/O)
for (var/i in allowed_items)
if (istype(O, i))
return allowed_items[i]
/obj/machinery/juicer/proc/get_juice_amount(var/obj/item/weapon/reagent_containers/food/snacks/grown/O)
if (!istype(O))
return 5
else if (O.potency == -1)
return 5
else
return round(5*sqrt(O.potency))
/obj/machinery/juicer/proc/juice()
power_change() //it is a portable machine
if(stat & (NOPOWER|BROKEN))
return
if (!beaker || beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
return
playsound(src.loc, 'sound/machines/juicer.ogg', 50, 1)
for (var/obj/item/weapon/reagent_containers/food/snacks/O in src.contents)
var/r_id = get_juice_id(O)
beaker.reagents.add_reagent(r_id,get_juice_amount(O))
del(O)
if (beaker.reagents.total_volume >= beaker.reagents.maximum_volume)
break
/obj/structure/closet/crate/juice
New()
..()
new/obj/machinery/juicer(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/tomato(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/carrot(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/berries(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)

View File

@@ -42,11 +42,11 @@
acceptable_reagents |= reagent
if (recipe.items)
max_n_of_items = max(max_n_of_items,recipe.items.len)
// This will do until I can think of a fun recipe to use dionaea in -
// will also allow anything using the holder item to be microwaved into
// impure carbon. ~Z
acceptable_items |= /obj/item/weapon/holder
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
/*******************
* Item Adding
@@ -274,7 +274,7 @@
cooked.loc = src.loc
return
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num)
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num) // Whoever named this proc is fucking literally Satan. ~ Z
for (var/i=1 to seconds)
if (stat & (NOPOWER|BROKEN))
return 0

View File

@@ -1,148 +0,0 @@
/obj/machinery/processor
name = "Food Processor"
icon = 'icons/obj/kitchen.dmi'
icon_state = "processor"
layer = 2.9
density = 1
anchored = 1
var/broken = 0
var/processing = 0
use_power = 1
idle_power_usage = 5
active_power_usage = 50
/datum/food_processor_process
var/input
var/output
var/time = 40
proc/process(loc, what)
if (src.output && loc)
new src.output(loc)
if (what)
del(what)
/* objs */
meat
input = /obj/item/weapon/reagent_containers/food/snacks/meat
output = /obj/item/weapon/reagent_containers/food/snacks/meatball
potato
input = /obj/item/weapon/reagent_containers/food/snacks/grown/potato
output = /obj/item/weapon/reagent_containers/food/snacks/rawsticks
carrot
input = /obj/item/weapon/reagent_containers/food/snacks/grown/carrot
output = /obj/item/weapon/reagent_containers/food/snacks/carrotfries
soybeans
input = /obj/item/weapon/reagent_containers/food/snacks/grown/soybeans
output = /obj/item/weapon/reagent_containers/food/snacks/soydope
wheat
input = /obj/item/weapon/reagent_containers/food/snacks/grown/wheat
output = /obj/item/weapon/reagent_containers/food/snacks/flour
spaghetti
input = /obj/item/weapon/reagent_containers/food/snacks/flour
output = /obj/item/weapon/reagent_containers/food/snacks/spagetti
/* mobs */
mob
process(loc, what)
..()
slime
input = /mob/living/carbon/slime
output = /obj/item/weapon/reagent_containers/glass/beaker/slime
monkey
process(loc, what)
var/mob/living/carbon/monkey/O = what
if (O.client) //grief-proof
O.loc = loc
O.visible_message("\blue Suddenly [O] jumps out from the processor!", \
"You jump out from the processor", \
"You hear chimp")
return
var/obj/item/weapon/reagent_containers/glass/bucket/bucket_of_blood = new(loc)
var/datum/reagent/blood/B = new()
B.holder = bucket_of_blood
B.volume = 70
//set reagent data
B.data["donor"] = O
for(var/datum/disease/D in O.viruses)
if(D.spread_type != SPECIAL)
B.data["viruses"] += D.Copy()
B.data["blood_DNA"] = copytext(O.dna.unique_enzymes,1,0)
if(O.resistances&&O.resistances.len)
B.data["resistances"] = O.resistances.Copy()
bucket_of_blood.reagents.reagent_list += B
bucket_of_blood.reagents.update_total()
bucket_of_blood.on_reagent_change()
//bucket_of_blood.reagents.handle_reactions() //blood doesn't react
..()
input = /mob/living/carbon/monkey
output = null
/obj/machinery/processor/proc/select_recipe(var/X)
for (var/Type in typesof(/datum/food_processor_process) - /datum/food_processor_process - /datum/food_processor_process/mob)
var/datum/food_processor_process/P = new Type()
if (!istype(X, P.input))
continue
return P
return 0
/obj/machinery/processor/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(src.processing)
user << "\red The processor is in the process of processing."
return 1
if(src.contents.len > 0) //TODO: several items at once? several different items?
user << "\red Something is already in the processing chamber."
return 1
var/what = O
if (istype(O, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = O
what = G.affecting
var/datum/food_processor_process/P = select_recipe(what)
if (!P)
user << "\red That probably won't blend."
return 1
user.visible_message("[user] put [what] into [src].", \
"You put the [what] into [src].")
user.drop_item()
what:loc = src
return
/obj/machinery/processor/attack_hand(var/mob/user as mob)
if (src.stat != 0) //NOPOWER etc
return
if(src.processing)
user << "\red The processor is in the process of processing."
return 1
if(src.contents.len == 0)
user << "\red The processor is empty."
return 1
for(var/O in src.contents)
var/datum/food_processor_process/P = select_recipe(O)
if (!P)
log_admin("DEBUG: [O] in processor havent suitable recipe. How do you put it in?") //-rastaf0
continue
src.processing = 1
user.visible_message("\blue [user] turns on \a [src].", \
"You turn on \a [src].", \
"You hear a food processor.")
playsound(src.loc, 'sound/machines/blender.ogg', 50, 1)
use_power(500)
sleep(P.time)
P.process(src.loc, O)
src.processing = 0
src.visible_message("\blue \the [src] finished processing.", \
"You hear the food processor stopping/")

View File

@@ -1,7 +1,7 @@
/obj/machinery/seed_extractor
name = "seed extractor"
desc = "Extracts and bags seeds from produce."
icon = 'icons/obj/hydroponics.dmi'
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "sextractor"
density = 1
anchored = 1
@@ -16,10 +16,10 @@ obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob
var/datum/seed/new_seed_type
if(istype(O, /obj/item/weapon/grown))
var/obj/item/weapon/grown/F = O
new_seed_type = seed_types[F.plantname]
new_seed_type = plant_controller.seeds[F.plantname]
else
var/obj/item/weapon/reagent_containers/food/snacks/grown/F = O
new_seed_type = seed_types[F.plantname]
new_seed_type = plant_controller.seeds[F.plantname]
if(new_seed_type)
user << "<span class='notice'>You extract some seeds from [O].</span>"

View File

@@ -1,126 +0,0 @@
/*
/obj/effect/biomass
icon = 'icons/obj/biomass.dmi'
icon_state = "stage1"
opacity = 0
density = 0
anchored = 1
layer = 20 //DEBUG
var/health = 10
var/stage = 1
var/obj/effect/rift/originalRift = null //the originating rift of that biomass
var/maxDistance = 15 //the maximum length of a thread
var/newSpreadDistance = 10 //the length of a thread at which new ones are created
var/curDistance = 1 //the current length of a thread
var/continueChance = 3 //weighed chance of continuing in the same direction. turning left or right has 1 weight both
var/spreadDelay = 1 //will change to something bigger later, but right now I want it to spread as fast as possible for testing
/obj/effect/rift
icon = 'icons/obj/biomass.dmi'
icon_state = "rift"
var/list/obj/effect/biomass/linkedBiomass = list() //all the biomass patches that have spread from it
var/newicon = 1 //DEBUG
/obj/effect/rift/New()
set background = 1
..()
for(var/turf/T in orange(1,src))
if(!IsValidBiomassLoc(T))
continue
var/obj/effect/biomass/starting = new /obj/effect/biomass(T)
starting.set_dir(get_dir(src,starting))
starting.originalRift = src
linkedBiomass += starting
spawn(1) //DEBUG
starting.icon_state = "[newicon]"
/obj/effect/rift/Del()
for(var/obj/effect/biomass/biomass in linkedBiomass)
del(biomass)
..()
/obj/effect/biomass/New()
set background = 1
..()
if(!IsValidBiomassLoc(loc,src))
del(src)
return
spawn(1) //so that the dir and stuff can be set by the source first
if(curDistance >= maxDistance)
return
switch(dir)
if(NORTHWEST)
set_dir(NORTH)
if(NORTHEAST)
set_dir(EAST)
if(SOUTHWEST)
set_dir(WEST)
if(SOUTHEAST)
set_dir(SOUTH)
sleep(spreadDelay)
Spread()
/obj/effect/biomass/proc/Spread(var/direction = dir)
set background = 1
var/possibleDirsInt = 0
for(var/newDirection in cardinal)
if(newDirection == turn(direction,180)) //can't go backwards
continue
var/turf/T = get_step(loc,newDirection)
if(!IsValidBiomassLoc(T,src))
continue
possibleDirsInt |= newDirection
var/list/possibleDirs = list()
if(possibleDirsInt & direction)
for(var/i=0 , i<continueChance , i++)
possibleDirs += direction
if(possibleDirsInt & turn(direction,90))
possibleDirs += turn(direction,90)
if(possibleDirsInt & turn(direction,-90))
possibleDirs += turn(direction,-90)
if(!possibleDirs.len)
return
direction = pick(possibleDirs)
var/obj/effect/biomass/newBiomass = new /obj/effect/biomass(get_step(src,direction))
newBiomass.curDistance = curDistance + 1
newBiomass.maxDistance = maxDistance
newBiomass.set_dir(direction)
newBiomass.originalRift = originalRift
newBiomass.icon_state = "[originalRift.newicon]" //DEBUG
originalRift.linkedBiomass += newBiomass
if(!(curDistance%newSpreadDistance))
var/obj/effect/rift/newrift = new /obj/effect/rift(loc)
if(originalRift.newicon <= 3)
newrift.newicon = originalRift.newicon + 1
// NewSpread()
/obj/effect/biomass/proc/NewSpread(maxDistance = 15)
set background = 1
for(var/turf/T in orange(1,src))
if(!IsValidBiomassLoc(T,src))
continue
var/obj/effect/biomass/starting = new /obj/effect/biomass(T)
starting.set_dir(get_dir(src,starting))
starting.maxDistance = maxDistance
/proc/IsValidBiomassLoc(turf/location,obj/effect/biomass/source = null)
set background = 1
for(var/obj/effect/biomass/biomass in location)
if(biomass != source)
return 0
if(istype(location,/turf/space))
return 0
if(location.density)
return 0
return 1
*/

View File

@@ -21,7 +21,18 @@
var/list/targetTurfs
var/list/wallList
var/density
var/show_log = 1
/datum/effect/effect/system/smoke_spread/chem/spores
show_log = 0
var/datum/seed/seed
/datum/effect/effect/system/smoke_spread/chem/spores/New(seed_name)
if(seed_name && plant_controller)
seed = plant_controller.seeds[seed_name]
if(!seed)
del(src)
..()
/datum/effect/effect/system/smoke_spread/chem/New()
..()
@@ -78,16 +89,17 @@
var/where = "[A.name] | [location.x], [location.y]"
var/whereLink = "<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[location.x];Y=[location.y];Z=[location.z]'>[where]</a>"
if(carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = "(<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</a>)"
message_admins("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast][more].", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [carry.my_atom.fingerprintslast].")
else
message_admins("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")
if(show_log)
if(carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = "(<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</a>)"
message_admins("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast][more].", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [carry.my_atom.fingerprintslast].")
else
message_admins("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")
//------------------------------------------
@@ -186,8 +198,14 @@
// Randomizes and spawns the smoke effect.
// Also handles deleting the smoke once the effect is finished.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1)
var/obj/effect/effect/smoke/chem/smoke = new(location)
/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1, var/obj/effect/effect/smoke/chem/passed_smoke)
var/obj/effect/effect/smoke/chem/smoke
if(passed_smoke)
smoke = passed_smoke
else
smoke = new(location)
if(chemholder.reagents.reagent_list.len)
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / dist, safety = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
smoke.icon = I
@@ -202,6 +220,11 @@
fadeOut(smoke)
smoke.delete()
/datum/effect/effect/system/smoke_spread/chem/spores/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1)
var/obj/effect/effect/smoke/chem/spores = new(location)
spores.name = "cloud of [seed.seed_name] [seed.seed_noun]"
..(T, I, dist, spores)
//------------------------------------------
// Fades out the smoke smoothly using it's alpha variable.
//------------------------------------------

View File

@@ -42,7 +42,7 @@ var/global/list/image/splatter_cache=list()
dry()
/obj/effect/decal/cleanable/blood/update_icon()
if(basecolor == "rainbow") basecolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
if(basecolor == "rainbow") basecolor = "#[get_random_colour(1)]"
color = basecolor
/obj/effect/decal/cleanable/blood/Crossed(mob/living/carbon/human/perp)
@@ -165,11 +165,11 @@ var/global/list/image/splatter_cache=list()
var/image/giblets = new(base_icon, "[icon_state]_flesh", dir)
if(!fleshcolor || fleshcolor == "rainbow")
fleshcolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
fleshcolor = "#[get_random_colour(1)]"
giblets.color = fleshcolor
var/icon/blood = new(base_icon,"[icon_state]",dir)
if(basecolor == "rainbow") basecolor = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
if(basecolor == "rainbow") basecolor = "#[get_random_colour(1)]"
blood.Blend(basecolor,ICON_MULTIPLY)
icon = blood

View File

@@ -133,3 +133,13 @@
layer = 2
icon = 'icons/effects/tomatodecal.dmi'
random_icon_states = list("smashed_pie")
/obj/effect/decal/cleanable/fruit_smudge
name = "smudge"
desc = "Some kind of fruit smear."
density = 0
anchored = 1
layer = 2
icon = 'icons/effects/blood.dmi'
icon_state = "mfloor1"
random_icon_states = list("mfloor1", "mfloor2", "mfloor3", "mfloor4", "mfloor5", "mfloor6", "mfloor7")

View File

@@ -17,6 +17,14 @@
icon = 'icons/mob/robots.dmi'
icon_state = "remainsrobot"
/obj/effect/decal/remains/mouse
desc = "They look like the remains of a small rodent."
icon_state = "mouse"
/obj/effect/decal/remains/lizard
desc = "They look like the remains of a small rodent."
icon_state = "lizard"
/obj/effect/decal/remains/attack_hand(mob/user as mob)
user << "<span class='notice'>[src] sinks together into a pile of ash.</span>"
var/turf/simulated/floor/F = get_turf(src)

View File

@@ -1,166 +0,0 @@
//separate dm since hydro is getting bloated already
/obj/effect/glowshroom
name = "glowshroom"
anchored = 1
opacity = 0
density = 0
icon = 'icons/obj/lighting.dmi'
icon_state = "glowshroomf"
layer = 2.1
l_color = "#003300"
var/endurance = 30
var/potency = 30
var/delay = 1200
var/floor = 0
var/yield = 3
var/spreadChance = 40
var/spreadIntoAdjacentChance = 60
var/evolveChance = 2
var/lastTick = 0
var/spreaded = 1
/obj/effect/glowshroom/single
spreadChance = 0
/obj/effect/glowshroom/New()
..()
set_dir(CalcDir())
if(!floor)
switch(dir) //offset to make it be on the wall rather than on the floor
if(NORTH)
pixel_y = 32
if(SOUTH)
pixel_y = -32
if(EAST)
pixel_x = 32
if(WEST)
pixel_x = -32
icon_state = "glowshroom[rand(1,3)]"
else //if on the floor, glowshroom on-floor sprite
icon_state = "glowshroomf"
processing_objects += src
SetLuminosity(round(potency/15))
lastTick = world.timeofday
/obj/effect/glowshroom/Del()
processing_objects -= src
..()
/obj/effect/glowshroom/process()
if(!spreaded)
return
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
lastTick = world.timeofday
spreaded = 0
for(var/i=1,i<=yield,i++)
if(prob(spreadChance))
var/list/possibleLocs = list()
var/spreadsIntoAdjacent = 0
if(prob(spreadIntoAdjacentChance))
spreadsIntoAdjacent = 1
for(var/turf/simulated/floor/plating/airless/asteroid/earth in view(3,src))
if(spreadsIntoAdjacent || !locate(/obj/effect/glowshroom) in view(1,earth))
possibleLocs += earth
if(!possibleLocs.len)
break
var/turf/newLoc = pick(possibleLocs)
var/shroomCount = 0 //hacky
var/placeCount = 1
for(var/obj/effect/glowshroom/shroom in newLoc)
shroomCount++
for(var/wallDir in cardinal)
var/turf/isWall = get_step(newLoc,wallDir)
if(isWall.density)
placeCount++
if(shroomCount >= placeCount)
continue
var/obj/effect/glowshroom/child = new /obj/effect/glowshroom(newLoc)
child.potency = potency
child.yield = yield
child.delay = delay
child.endurance = endurance
spreaded++
if(prob(evolveChance)) //very low chance to evolve on its own
potency += rand(4,6)
/obj/effect/glowshroom/proc/CalcDir(turf/location = loc)
set background = 1
var/direction = 16
for(var/wallDir in cardinal)
var/turf/newTurf = get_step(location,wallDir)
if(newTurf.density)
direction |= wallDir
for(var/obj/effect/glowshroom/shroom in location)
if(shroom == src)
continue
if(shroom.floor) //special
direction &= ~16
else
direction &= ~shroom.dir
var/list/dirList = list()
for(var/i=1,i<=16,i <<= 1)
if(direction & i)
dirList += i
if(dirList.len)
var/newDir = pick(dirList)
if(newDir == 16)
floor = 1
newDir = 1
return newDir
floor = 1
return 1
/obj/effect/glowshroom/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
endurance -= W.force
CheckEndurance()
/obj/effect/glowshroom/ex_act(severity)
switch(severity)
if(1.0)
del(src)
return
if(2.0)
if (prob(50))
del(src)
return
if(3.0)
if (prob(5))
del(src)
return
else
return
/obj/effect/glowshroom/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
endurance -= 5
CheckEndurance()
/obj/effect/glowshroom/proc/CheckEndurance()
if(endurance <= 0)
del(src)

View File

@@ -198,11 +198,7 @@
// apparently called whenever an item is removed from a slot, container, or anything else.
/obj/item/proc/dropped(mob/user as mob)
..()
if(zoom) //binoculars, scope, etc
user.client.view = world.view
user.client.pixel_x = 0
user.client.pixel_y = 0
zoom = 0
if(zoom) zoom() //binoculars, scope, etc
// called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
@@ -660,9 +656,8 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
cannotzoom = 1
if(!zoom && !cannotzoom)
if(!usr.hud_used.hud_shown)
usr.button_pressed_F12(1) // If the user has already limited their HUD this avoids them having a HUD when they zoom in
usr.button_pressed_F12(1)
if(usr.hud_used.hud_shown)
usr.toggle_zoom_hud() // If the user has already limited their HUD this avoids them having a HUD when they zoom in
usr.client.view = viewsize
zoom = 1
@@ -688,7 +683,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
else
usr.client.view = world.view
if(!usr.hud_used.hud_shown)
usr.button_pressed_F12(1)
usr.toggle_zoom_hud()
zoom = 0
usr.client.pixel_x = 0

View File

@@ -28,3 +28,30 @@
new /obj/item/weapon/reagent_containers/pill/zoom( src )
new /obj/item/weapon/reagent_containers/pill/zoom( src )
new /obj/item/weapon/reagent_containers/pill/zoom( src )
/obj/item/weapon/reagent_containers/glass/beaker/vial/random
flags = 0
var/list/random_reagent_list = list(list("water" = 15) = 1, list("cleaner" = 15) = 1)
/obj/item/weapon/reagent_containers/glass/beaker/vial/random/toxin
random_reagent_list = list(
list("mindbreaker" = 10, "space_drugs" = 20) = 3,
list("carpotoxin" = 15) = 2,
list("impedrezene" = 15) = 2,
list("zombiepowder" = 10) = 1)
/obj/item/weapon/reagent_containers/glass/beaker/vial/random/New()
..()
if(is_open_container())
flags ^= OPENCONTAINER
var/list/picked_reagents = pickweight(random_reagent_list)
for(var/reagent in picked_reagents)
reagents.add_reagent(reagent, picked_reagents[reagent])
var/list/names = new
for(var/datum/reagent/R in reagents.reagent_list)
names += R.name
desc = "Contains [english_list(names)]."
update_icon()

View File

@@ -4,7 +4,6 @@ T-RAY
DETECTIVE SCANNER
HEALTH ANALYZER
GAS ANALYZER
PLANT ANALYZER
MASS SPECTROMETER
REAGENT SCANNER
*/

View File

@@ -27,6 +27,15 @@ datum/uplink_item/proc/description()
description = replacetext(initial(temp.desc), "\n", "<br>")
return description
/datum/uplink_item/proc/generate_item(var/newloc)
var/list/L = list()
if(ispath(path))
L += new path(newloc)
else if(islist(path))
for(var/item_path in path)
L += new item_path(newloc)
return L
datum/nano_item_lists
var/list/items_nano
var/list/items_reference
@@ -136,10 +145,11 @@ datum/nano_item_lists
used_TC += UI.cost
feedback_add_details("traitor_uplink_items_bought", reference)
var/obj/I = new UI.path(get_turf(usr))
var/list/L = UI.generate_item(get_turf(usr))
if(ishuman(usr))
var/mob/living/carbon/human/A = usr
A.put_in_any_hand_if_possible(I)
for(var/obj/I in L)
A.put_in_any_hand_if_possible(I)
purchase_log[UI] = purchase_log[UI] + 1

View File

@@ -127,7 +127,7 @@
name = "\improper S'rendarr's Hand leaf"
singular_name = "S'rendarr's Hand leaf"
desc = "A poultice made of soft leaves that is rubbed on bruises."
icon = 'icons/obj/harvest.dmi'
//icon = 'icons/obj/harvest.dmi'
icon_state = "shandp"
heal_brute = 7
@@ -135,7 +135,7 @@
name = "\improper Messa's Tear petals"
singular_name = "Messa's Tear petals"
desc = "A poultice made of cold, blue petals that is rubbed on burns."
icon = 'icons/obj/harvest.dmi'
//icon = 'icons/obj/harvest.dmi'
icon_state = "mtearp"
heal_burn = 7

View File

@@ -440,7 +440,7 @@
/obj/item/toy/waterflower
name = "water flower"
desc = "A seemingly innocent sunflower...with a twist."
icon = 'icons/obj/harvest.dmi'
//icon = 'icons/obj/harvest.dmi'
icon_state = "sunflower"
item_state = "sunflower"
var/empty = 0

View File

@@ -4,7 +4,7 @@
//uncomment when this is updated to match storage update
/*
/obj/item/weapon/seedbag
icon = 'icons/obj/hydroponics.dmi'
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "seedbag"
name = "Seed Bag"
desc = "A small satchel made for organizing seeds."

View File

@@ -88,7 +88,7 @@
/obj/item/weapon/storage/bag/plants
name = "plant bag"
icon = 'icons/obj/hydroponics.dmi'
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "plantbag"
storage_slots = 50; //the number of plant pieces it can carry.
max_combined_w_class = 200 //Doesn't matter what this is, so long as it's more or equal to storage_slots * plants.w_class

View File

@@ -219,8 +219,8 @@
new /obj/item/ammo_casing/shotgun/stunshell(src)
new /obj/item/ammo_casing/shotgun/stunshell(src)
/obj/item/weapon/storage/box/heavysniperammo
name = "box of 14.5mm AP shells"
/obj/item/weapon/storage/box/sniperammo
name = "box of 14.5mm shells"
desc = "It has a picture of a gun and several warning symbols on the front.<br>WARNING: Live ammunition. Misuse may result in serious injury or death."
New()

View File

@@ -128,6 +128,22 @@
new /obj/item/stack/medical/splint(src)
return
/obj/item/weapon/storage/firstaid/surgery
name = "surgery kit"
desc = "Contains tools for surgery."
/obj/item/weapon/storage/firstaid/surgery/New()
..()
if (empty) return
new /obj/item/weapon/bonesetter(src)
new /obj/item/weapon/cautery(src)
new /obj/item/weapon/circular_saw(src)
new /obj/item/weapon/hemostat(src)
new /obj/item/weapon/retractor(src)
new /obj/item/weapon/scalpel(src)
new /obj/item/weapon/surgicaldrill(src)
return
/*
* Pill Bottles
*/

View File

@@ -30,6 +30,7 @@
new /obj/item/ammo_magazine/a357(src)
new /obj/item/weapon/card/emag(src)
new /obj/item/weapon/plastique(src)
new /obj/item/weapon/plastique(src)
return
if("murder")
@@ -47,6 +48,7 @@
return
if("hacker")
new /obj/item/device/encryptionkey/syndicate(src)
new /obj/item/weapon/aiModule/syndicate(src)
new /obj/item/weapon/card/emag(src)
new /obj/item/device/encryptionkey/binary(src)
@@ -62,10 +64,9 @@
return
if("smoothoperator")
new /obj/item/weapon/gun/projectile/pistol(src)
new /obj/item/weapon/silencer(src)
new /obj/item/weapon/soap/syndie(src)
new /obj/item/weapon/storage/box/syndie_kit/g9mm(src)
new /obj/item/weapon/storage/bag/trash(src)
new /obj/item/weapon/soap/syndie(src)
new /obj/item/bodybag(src)
new /obj/item/clothing/under/suit_jacket(src)
new /obj/item/clothing/shoes/laceup(src)
@@ -176,6 +177,15 @@
new /obj/item/weapon/gun/projectile/pistol(src)
new /obj/item/weapon/silencer(src)
/obj/item/weapon/storage/box/syndie_kit/toxin
name = "toxin kit"
desc = "An apple will not be enough to keep the doctor away after this."
/obj/item/weapon/storage/box/syndie_kit/toxin/New()
..()
new /obj/item/weapon/reagent_containers/glass/beaker/vial/random/toxin(src)
new /obj/item/weapon/reagent_containers/syringe(src)
/obj/item/weapon/storage/box/syndie_kit/cigarette
name = "\improper Tricky smokes"
desc = "Comes with the following brands of cigarettes, in this order: 2xFlash, 2xSmoke, 1xMindBreaker, 1xTricordrazine. Avoid mixing them up."
@@ -217,3 +227,11 @@
for(var/reagent in reagents)
C.reagents.add_reagent(reagent, reagents[reagent] * C.storage_slots)
/obj/item/weapon/storage/box/syndie_kit/ewar_voice
name = "Electrowarfare and Voice Synthesiser kit"
desc = "Kit for confounding organic and synthetic entities alike."
/obj/item/weapon/storage/box/syndie_kit/ewar_voice/New()
..()
new /obj/item/rig_module/electrowarfare_suite(src)
new /obj/item/rig_module/voice(src)

View File

@@ -109,10 +109,10 @@
W.relativewall()
for(var/direction in cardinal)
for(var/obj/effect/glowshroom/shroom in get_step(src,direction))
for(var/obj/effect/plant/shroom in get_step(src,direction))
if(!shroom.floor) //shrooms drop to the floor
shroom.floor = 1
shroom.icon_state = "glowshroomf"
shroom.update_icon()
shroom.pixel_x = 0
shroom.pixel_y = 0

View File

@@ -25,11 +25,17 @@
usr << "\red Movement is admin-disabled." //This is to identify lag problems
return
if (istype(A,/mob/living/carbon))
var/mob/living/carbon/M = A
if (istype(A,/mob/living))
var/mob/living/M = A
if(M.lying)
..()
return
// Ugly hack :( Should never have multiple plants in the same tile.
var/obj/effect/plant/plant = locate() in contents
if(plant) plant.trodden_on(M)
// Dirt overlays.
dirt++
var/obj/effect/decal/cleanable/dirt/dirtoverlay = locate(/obj/effect/decal/cleanable/dirt, src)
if (dirt >= 50)
@@ -41,30 +47,21 @@
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(istype(H.shoes, /obj/item/clothing/shoes/clown_shoes))
var/obj/item/clothing/shoes/clown_shoes/O = H.shoes
if(H.m_intent == "run")
if(O.footstep >= 2)
O.footstep = 0
playsound(src, "clownstep", 50, 1) // this will get annoying very fast.
else
O.footstep++
else
playsound(src, "clownstep", 20, 1)
// Tracking blood
var/list/bloodDNA = null
var/bloodcolor=""
if(H.shoes)
var/obj/item/clothing/shoes/S = H.shoes
if(S.track_blood && S.blood_DNA)
bloodDNA = S.blood_DNA
bloodcolor=S.blood_color
S.track_blood--
if(istype(S))
S.handle_movement(src,(H.m_intent == "run" ? 1 : 0))
if(S.track_blood && S.blood_DNA)
bloodDNA = S.blood_DNA
bloodcolor=S.blood_color
S.track_blood--
else
if(H.track_blood && H.feet_blood_DNA)
bloodDNA = H.feet_blood_DNA
bloodcolor=H.feet_blood_color
bloodcolor = H.feet_blood_color
H.track_blood--
if (bloodDNA)
@@ -75,14 +72,11 @@
bloodDNA = null
var/noslip = 0
for (var/obj/structure/bed/chair/C in loc)
if (C.buckled_mob == M)
noslip = 1
if((wet == 1 && M.m_intent == "walk") || noslip)
return // no slipping while sitting in a chair, plz
if(src.wet)
if(M.buckled || (src.wet == 1 && M.m_intent == "walk"))
return
var/slip_dist = 1
var/slip_stun = 6
var/floor_type = "wet"

View File

@@ -51,6 +51,8 @@
/turf/simulated/wall/ChangeTurf(var/newtype)
for(var/obj/effect/E in src) if(E.name == "Wallrot") del E
for(var/obj/effect/plant/plant in range(1))
plant.update_neighbors()
..(newtype)
//Appearance

View File

@@ -14,6 +14,15 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
/turf/space/New()
if(!istype(src, /turf/space/transit))
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
update_starlight()
/turf/space/proc/update_starlight()
if(!config.starlight)
return
if(locate(/turf/simulated) in orange(src,1))
SetLuminosity(3)
else
SetLuminosity(0)
/turf/space/attackby(obj/item/C as obj, mob/user as mob)

View File

@@ -251,6 +251,9 @@
if(air_master)
air_master.mark_for_update(src)
for(var/turf/space/S in range(W,1))
S.update_starlight()
W.levelupdate()
return W
@@ -272,6 +275,9 @@
if(air_master)
air_master.mark_for_update(src)
for(var/turf/space/S in range(W,1))
S.update_starlight()
W.levelupdate()
return W

View File

@@ -174,8 +174,9 @@ var/gravity_is_on = 1
var/join_motd = null
var/forceblob = 0
var/datum/nanomanager/nanomanager = new() // NanoManager, the manager for Nano UIs.
var/datum/event_manager/event_manager = new() // Event Manager, the manager for events.
var/datum/nanomanager/nanomanager = new() // NanoManager, the manager for Nano UIs.
var/datum/event_manager/event_manager = new() // Event Manager, the manager for events.
var/datum/subsystem/alarm/alarm_manager = new() // Alarm Manager, the manager for alarms.
var/list/awaydestinations = list() // Away missions. A list of landmarks that the warpgate can take you to.

View File

@@ -993,6 +993,32 @@ var/global/floorIsLava = 0
else
return "Error: Invalid sabotage target: [target]"
*/
/datum/admins/proc/spawn_fruit()
set category = "Debug"
set desc = "Spawn the product of a seed."
set name = "Spawn Fruit"
if(!check_rights(R_SPAWN)) return
var/seedtype = input("Select a seed type", "Spawn Fruit") as null|anything in plant_controller.seeds
if(!seedtype || !plant_controller.seeds[seedtype])
return
var/datum/seed/S = plant_controller.seeds[seedtype]
S.harvest(usr,0,0,1)
/datum/admins/proc/spawn_plant()
set category = "Debug"
set desc = "Spawn a spreading plant effect."
set name = "Spawn Plant"
if(!check_rights(R_SPAWN)) return
var/seedtype = input("Select a seed type", "Spawn Plant") as null|anything in plant_controller.seeds
if(!seedtype || !plant_controller.seeds[seedtype])
return
new /obj/effect/plant(get_turf(usr), plant_controller.seeds[seedtype])
/datum/admins/proc/spawn_atom(var/object as text)
set category = "Debug"
set desc = "(atom path) Spawn an atom"

View File

@@ -107,6 +107,8 @@ var/list/admin_verbs_fun = list(
/client/proc/editappear
)
var/list/admin_verbs_spawn = list(
/datum/admins/proc/spawn_fruit,
/datum/admins/proc/spawn_plant,
/datum/admins/proc/spawn_atom, /*allows us to spawn instances*/
/client/proc/respawn_character,
/client/proc/FireLaser,

View File

@@ -2432,11 +2432,6 @@
var/show_log = alert(usr, "Show ion message?", "Message", "Yes", "No")
if(show_log == "Yes")
command_announcement.Announce("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert", new_sound = 'sound/AI/ionstorm.ogg')
if("spacevines")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","K")
new /datum/event/spacevine
message_admins("[key_name_admin(usr)] has spawned spacevines", 1)
if("onlyone")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","OO")

View File

@@ -662,7 +662,6 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/chaplain_hoodie(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/bikehorn(M), slot_r_store)
var/obj/item/weapon/card/id/W = new(M)

138
code/modules/alarm/alarm.dm Normal file
View File

@@ -0,0 +1,138 @@
#define ALARM_RESET_DELAY 100 // How long will the alarm/trigger remain active once origin/source has been found to be gone?
/datum/alarm_source
var/source = null // The source trigger
var/source_name = "" // The name of the source should it be lost (for example a destroyed camera)
var/duration = 0 // How long this source will be alarming, 0 for indefinetely.
var/severity = 1 // How severe the alarm from this source is.
var/start_time = 0 // When this source began alarming.
var/end_time = 0 // Use to set when this trigger should clear, in case the source is lost.
/datum/alarm_source/New(var/atom/source)
src.source = source
start_time = world.time
source_name = source.get_source_name()
/datum/alarm
var/atom/origin //Used to identify the alarm area.
var/list/sources = new() //List of sources triggering the alarm. Used to determine when the alarm should be cleared.
var/list/sources_assoc = new() //Associative list of source triggers. Used to efficiently acquire the alarm source.
var/list/cameras //List of cameras that can be switched to, if the player has that capability.
var/area/last_area //The last acquired area, used should origin be lost (for example a destroyed borg containing an alarming camera).
var/area/last_name //The last acquired name, used should origin be lost
var/area/last_camera_area //The last area in which cameras where fetched, used to see if the camera list should be updated.
var/end_time //Used to set when this alarm should clear, in case the origin is lost.
/datum/alarm/New(var/atom/origin, var/atom/source, var/duration, var/severity)
src.origin = origin
cameras() // Sets up both cameras and last alarm area.
set_source_data(source, duration, severity)
/datum/alarm/proc/process()
// Has origin gone missing?
if(!origin && !end_time)
end_time = world.time + ALARM_RESET_DELAY
for(var/datum/alarm_source/AS in sources)
// Has the alarm passed its best before date?
if((AS.end_time && world.time > AS.end_time) || (AS.duration && world.time > (AS.start_time + AS.duration)))
sources -= AS
// Has the source gone missing? Then reset the normal duration and set end_time
if(!AS.source && !AS.end_time) // end_time is used instead of duration to ensure the reset doesn't remain in the future indefinetely.
AS.duration = 0
AS.end_time = world.time + ALARM_RESET_DELAY
/datum/alarm/proc/set_source_data(var/atom/source, var/duration, var/severity)
var/datum/alarm_source/AS = sources_assoc[source]
if(!AS)
AS = new/datum/alarm_source(source)
sources += AS
sources_assoc[source] = AS
// Currently only non-0 durations can be altered (normal alarms VS EMP blasts)
if(AS.duration)
duration = SecondsToTicks(duration)
AS.duration = duration
AS.severity = severity
/datum/alarm/proc/clear(var/source)
var/datum/alarm_source/AS = sources_assoc[source]
sources -= AS
sources_assoc -= source
/datum/alarm/proc/alarm_area()
if(!origin)
return last_area
last_area = origin.get_alarm_area()
return last_area
/datum/alarm/proc/alarm_name()
if(!origin)
return last_name
last_name = origin.get_alarm_name()
return last_name
/datum/alarm/proc/cameras()
// If the alarm origin has changed area, for example a borg containing an alarming camera, reset the list of cameras
if(cameras && (last_camera_area != alarm_area()))
cameras = null
// The list of cameras is also reset by /proc/invalidateCameraCache()
if(!cameras)
cameras = origin ? origin.get_alarm_cameras() : last_area.get_alarm_cameras()
last_camera_area = last_area
return cameras
/datum/alarm/proc/max_severity()
var/max_severity = 0
for(var/datum/alarm_source/AS in sources)
max_severity = max(AS.severity, max_severity)
return max_severity
/******************
* Assisting procs *
******************/
/atom/proc/get_alarm_area()
var/area/A = get_area(src)
return A.master
/area/get_alarm_area()
return src.master
/atom/proc/get_alarm_name()
var/area/A = get_area(src)
return A.master.name
/area/get_alarm_name()
return master.name
/mob/get_alarm_name()
return name
/atom/proc/get_source_name()
return name
/obj/machinery/camera/get_source_name()
return c_tag
/atom/proc/get_alarm_cameras()
var/area/A = get_area(src)
return A.get_cameras()
/area/get_alarm_cameras()
return get_cameras()
/mob/living/silicon/robot/get_alarm_cameras()
var/list/cameras = ..()
if(camera)
cameras += camera
return cameras
/mob/living/silicon/robot/syndicate/get_alarm_cameras()
return list()
#undef ALARM_LOSS_DELAY

View File

@@ -0,0 +1,99 @@
#define ALARM_RAISED 1
#define ALARM_CLEARED 0
/datum/alarm_handler
var/category = ""
var/list/datum/alarm/alarms = new // All alarms, to handle cases when an origin has been deleted with one or more active alarms
var/list/datum/alarm/alarms_assoc = new // Associative list of alarms, to efficiently acquire them based on origin.
var/list/listeners = new // A list of all objects interested in alarm changes.
/datum/alarm_handler/proc/process()
for(var/datum/alarm/A in alarms)
A.process()
check_alarm_cleared(A)
/datum/alarm_handler/proc/triggerAlarm(var/atom/origin, var/atom/source, var/duration = 0, var/severity = 1)
var/new_alarm
//Proper origin and source mandatory
if(!(origin && source))
return
origin = origin.get_alarm_origin()
new_alarm = 0
//see if there is already an alarm of this origin
var/datum/alarm/existing = alarms_assoc[origin]
if(existing)
existing.set_source_data(source, duration, severity)
else
existing = new/datum/alarm(origin, source, duration, severity)
new_alarm = 1
alarms |= existing
alarms_assoc[origin] = existing
if(new_alarm)
alarms = dd_sortedObjectList(alarms)
on_alarm_change(existing, ALARM_RAISED)
return new_alarm
/datum/alarm_handler/proc/clearAlarm(var/atom/origin, var/source)
//Proper origin and source mandatory
if(!(origin && source))
return
origin = origin.get_alarm_origin()
var/datum/alarm/existing = alarms_assoc[origin]
if(existing)
existing.clear(source)
return check_alarm_cleared(existing)
/datum/alarm_handler/proc/major_alarms()
return alarms
/datum/alarm_handler/proc/minor_alarms()
return alarms
/datum/alarm_handler/proc/check_alarm_cleared(var/datum/alarm/alarm)
if ((alarm.end_time && world.time > alarm.end_time) || !alarm.sources.len)
alarms -= alarm
alarms_assoc -= alarm.origin
on_alarm_change(alarm, ALARM_CLEARED)
return 1
return 0
/datum/alarm_handler/proc/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
for(var/obj/machinery/camera/C in alarm.cameras())
if(was_raised)
C.network.Add(category)
invalidateCameraCache()
else
C.network.Remove(category)
notify_listeners(alarm, was_raised)
/datum/alarm_handler/proc/get_alarm_severity_for_origin(var/atom/origin)
if(!origin)
return
origin = origin.get_alarm_origin()
var/datum/alarm/existing = alarms_assoc[origin]
if(!existing)
return
return existing.max_severity()
/atom/proc/get_alarm_origin()
return src
/turf/get_alarm_origin()
var/area/area = get_area(src)
return area.master // Very important to get area.master, as dynamic lightning can and will split areas.
/datum/alarm_handler/proc/register(var/object, var/procName)
listeners[object] = procName
/datum/alarm_handler/proc/unregister(var/object)
listeners -= object
/datum/alarm_handler/proc/notify_listeners(var/alarm, var/was_raised)
for(var/listener in listeners)
call(listener, listeners[listener])(src, alarm, was_raised)

View File

@@ -0,0 +1,19 @@
/datum/alarm_handler/atmosphere
category = "Atmosphere Alarms"
/datum/alarm_handler/atmosphere/triggerAlarm(var/atom/origin, var/atom/source, var/duration = 0, var/severity = 1)
..()
/datum/alarm_handler/atmosphere/major_alarms()
var/list/major_alarms = new()
for(var/datum/alarm/A in alarms)
if(A.max_severity() > 1)
major_alarms.Add(A)
return major_alarms
/datum/alarm_handler/atmosphere/minor_alarms()
var/list/minor_alarms = new()
for(var/datum/alarm/A in alarms)
if(A.max_severity() == 1)
minor_alarms.Add(A)
return minor_alarms

View File

@@ -0,0 +1,2 @@
/datum/alarm_handler/camera
category = "Camera Alarms"

View File

@@ -0,0 +1,11 @@
/datum/alarm_handler/fire
category = "Fire Alarms"
/datum/alarm_handler/fire/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
var/area/A = alarm.origin
if(istype(A))
if(was_raised)
A.fire_alert()
else
A.fire_reset()
..()

View File

@@ -0,0 +1,2 @@
/datum/alarm_handler/motion
category = "Motion Alarms"

View File

@@ -0,0 +1,10 @@
/datum/alarm_handler/power
category = "Power Alarms"
/datum/alarm_handler/power/on_alarm_change(var/datum/alarm/alarm, var/was_raised)
var/area/A = alarm.origin
if(istype(A))
A.power_alert(was_raised)
..()
/area/proc/power_alert(var/alarming)

View File

@@ -360,6 +360,9 @@ BLIND // can't see anything
species_restricted = list("exclude","Unathi","Tajara")
sprite_sheets = list("Vox" = 'icons/mob/species/vox/shoes.dmi')
/obj/item/clothing/shoes/proc/handle_movement(var/turf/walking, var/running)
return
/obj/item/clothing/shoes/update_clothing_icon()
if (ismob(src.loc))
var/mob/M = src.loc

View File

@@ -71,6 +71,16 @@
var/footstep = 1 //used for squeeks whilst walking
species_restricted = null
/obj/item/clothing/shoes/clown_shoes/handle_movement(var/turf/walking, var/running)
if(running)
if(footstep >= 2)
footstep = 0
playsound(src, "clownstep", 50, 1) // this will get annoying very fast.
else
footstep++
else
playsound(src, "clownstep", 20, 1)
/obj/item/clothing/shoes/jackboots
name = "jackboots"
desc = "Nanotrasen-issue Security combat boots for combat scenarios or combat situations. All combat, all the time."

View File

@@ -25,3 +25,10 @@
/obj/item/rig_module/chem_dispenser/combat,
/obj/item/rig_module/fabricator/energy_net
)
//Has most of the modules removed
/obj/item/weapon/rig/merc/empty
initial_modules = list(
/obj/item/rig_module/ai_container,
/obj/item/rig_module/electrowarfare_suite, //might as well
)

View File

@@ -1,268 +0,0 @@
// This dreammaker file includes the food processing machines:
// - I. Mill
// - II. Fermenter
// - III. Still
// - IV. Squeezer
// - V. Centrifuge
// I. The mill is intended to be loaded with produce and returns ground up items. For example: Wheat should become flour and grapes should become raisins.
/obj/machinery/mill
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/milled_item
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Mill"
desc = "It is a machine that grinds produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 1000
/obj/machinery/mill/process()
if (error)
return
if (!busy)
use_power = 1
if (input.len)
milled_item = input[1]
input -= milled_item
progress = 0
busy = 1
use_power = 2
return
progress++
if (progress < 10) // Edit this value to make milling faster or slower.
return // Not done yet.
switch (milled_item.type)
if (/obj/item/weapon/reagent_containers/food/snacks/grown/wheat) // Wheat becomes flour.
var/obj/item/weapon/reagent_containers/food/snacks/flour/F = new(src)
output += F
if (/obj/item/weapon/reagent_containers/food/snacks/flour) // Flour is still flour.
var/obj/item/weapon/reagent_containers/food/snacks/flour/F = new(src)
output += F
else
error = 1
del(milled_item)
busy = 0
/obj/machinery/mill/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if (istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/mill/attack_hand(var/mob/user as mob)
for (var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// II. The fermenter is intended to be loaded with food items and returns medium-strength alcohol items, sucha s wine and beer.
/obj/machinery/fermenter
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/fermenting_item
var/water_level = 0
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Fermenter"
desc = "It is a machine that ferments produce into alcoholic drinks."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 500
/obj/machinery/fermenter/process()
if (error)
return
if (!busy)
use_power = 1
if (input.len)
fermenting_item = input[1]
input -= fermenting_item
progress = 0
busy = 1
use_power = 2
return
if (!water_level)
return
water_level--
progress++
if (progress < 10) // Edit this value to make milling faster or slower.
return // Not done yet.
switch (fermenting_item.type)
if (/obj/item/weapon/reagent_containers/food/snacks/flour) // Flour is still flour.
var/obj/item/weapon/reagent_containers/food/drinks/cans/beer/B = new(src)
output += B
else
error = 1
del(fermenting_item)
busy = 0
/obj/machinery/fermenter/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if (istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/fermenter/attack_hand(var/mob/user as mob)
for (var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// III. The still is a machine that is loaded with food items and returns hard liquor, such as vodka.
/obj/machinery/still
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/distilling_item
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Still"
desc = "It is a machine that produces hard liquor from alcoholic drinks."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 10000
/obj/machinery/still/process()
if (error)
return
if (!busy)
use_power = 1
if (input.len)
distilling_item = input[1]
input -= distilling_item
progress = 0
busy = 1
use_power = 2
return
progress++
if (progress < 10) // Edit this value to make distilling faster or slower.
return // Not done yet.
switch (distilling_item.type)
if (/obj/item/weapon/reagent_containers/food/drinks/cans/beer) // Flour is still flour.
var/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka/V = new(src)
output += V
else
error = 1
del(distilling_item)
busy = 0
/obj/machinery/still/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if (istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/still/attack_hand(var/mob/user as mob)
for (var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// IV. The squeezer is intended to destroy inserted food items, but return some of the reagents they contain.
/obj/machinery/squeezer
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/obj/item/weapon/reagent_containers/food/squeezed_item
var/water_level = 0
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Squeezer"
desc = "It is a machine that squeezes extracts from produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 500
// V. The centrifuge spins inserted food items. It is intended to squeeze out the reagents that are common food catalysts (enzymes currently)
/obj/machinery/centrifuge
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/spinning_item
var/busy = 0
var/progress = 0
var/error = 0
var/enzymes = 0
var/water = 0
name = "\improper Centrifuge"
desc = "It is a machine that spins produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 10000
/obj/machinery/centrifuge/process()
if (error)
return
if (!busy)
use_power = 1
if (input.len)
spinning_item = input[1]
input -= spinning_item
progress = 0
busy = 1
use_power = 2
return
progress++
if (progress < 10) // Edit this value to make milling faster or slower.
return // Not done yet.
var/transfer_enzymes = spinning_item.reagents.get_reagent_amount("enzyme")
if (transfer_enzymes)
enzymes += transfer_enzymes
spinning_item.reagents.remove_reagent("enzyme",transfer_enzymes)
output += spinning_item
busy = 0
/obj/machinery/centrifuge/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if (istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/centrifuge/attack_hand(var/mob/user as mob)
for (var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
while (enzymes >= 50)
enzymes -= 50
new/obj/item/weapon/reagent_containers/food/condiment/enzyme(src.loc)

View File

@@ -1,9 +1,5 @@
/var/global/spacevines_spawned = 0
/datum/event/spacevine/start()
//biomass is basically just a resprited version of space vines
if(prob(50))
spacevine_infestation()
else
biomass_infestation()
spacevine_infestation()
spacevines_spawned = 1

View File

@@ -34,24 +34,11 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/boiledegg
/datum/recipe/dionaroast
fruit = list("apple" = 1)
reagents = list("pacid" = 5) //It dissolves the carapace. Still poisonous, though.
items = list(
/obj/item/weapon/holder/diona,
/obj/item/weapon/reagent_containers/food/snacks/grown/apple
)
items = list(/obj/item/weapon/holder/diona)
result = /obj/item/weapon/reagent_containers/food/snacks/dionaroast
/*
/datum/recipe/bananaphone
reagents = list("psilocybin" = 5) //Trippin' balls, man.
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/banana,
/obj/item/device/radio
)
result = /obj/item/weapon/reagent_containers/food/snacks/bananaphone
*/
/datum/recipe/jellydonut
reagents = list("berryjuice" = 5, "sugar" = 5)
items = list(
@@ -80,7 +67,7 @@ I said no!
)
result = /obj/item/weapon/reagent_containers/food/snacks/donut/normal
/datum/recipe/human/burger
/datum/recipe/humanburger
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat/human,
/obj/item/weapon/reagent_containers/food/snacks/bun
@@ -110,7 +97,7 @@ I said no!
/datum/recipe/roburger
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/bun,
/obj/item/robot_parts/head
)
result = /obj/item/weapon/reagent_containers/food/snacks/roburger
@@ -146,8 +133,7 @@ I said no!
/datum/recipe/clownburger
items = list(
/obj/item/weapon/reagent_containers/food/snacks/bun,
/obj/item/clothing/mask/gas/clown_hat,
/* /obj/item/weapon/reagent_containers/food/snacks/grown/banana, */
/obj/item/clothing/mask/gas/clown_hat
)
result = /obj/item/weapon/reagent_containers/food/snacks/clownburger
@@ -241,12 +227,12 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/xenomeatbread
/datum/recipe/bananabread
fruit = list("banana" = 1)
reagents = list("milk" = 5, "sugar" = 15)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/grown/banana,
/obj/item/weapon/reagent_containers/food/snacks/dough
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/bananabread
@@ -267,64 +253,26 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/muffin
/datum/recipe/eggplantparm
fruit = list("eggplant" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant
)
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
)
result = /obj/item/weapon/reagent_containers/food/snacks/eggplantparm
/datum/recipe/soylenviridians
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/grown/soybeans
)
fruit = list("soybeans" = 1)
reagents = list("flour" = 10)
result = /obj/item/weapon/reagent_containers/food/snacks/soylenviridians
/datum/recipe/soylentgreen
reagents = list("flour" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/meat/human,
/obj/item/weapon/reagent_containers/food/snacks/meat/human,
/obj/item/weapon/reagent_containers/food/snacks/meat/human
)
result = /obj/item/weapon/reagent_containers/food/snacks/soylentgreen
/datum/recipe/carrotcake
reagents = list("milk" = 5, "sugar" = 15)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/carrotcake
/datum/recipe/cheesecake
reagents = list("milk" = 5, "sugar" = 15)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesecake
/datum/recipe/plaincake
reagents = list("milk" = 5, "sugar" = 15)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake
/datum/recipe/meatpie
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
@@ -347,25 +295,23 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/xemeatpie
/datum/recipe/pie
fruit = list("banana" = 1)
reagents = list("sugar" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/banana,
)
items = list(/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough)
result = /obj/item/weapon/reagent_containers/food/snacks/pie
/datum/recipe/cherrypie
fruit = list("cherries" = 1)
reagents = list("sugar" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/cherries,
)
result = /obj/item/weapon/reagent_containers/food/snacks/cherrypie
/datum/recipe/berryclafoutis
fruit = list("berries" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/berries,
)
result = /obj/item/weapon/reagent_containers/food/snacks/berryclafoutis
@@ -383,7 +329,7 @@ I said no!
)
result = /obj/item/weapon/reagent_containers/food/snacks/donut/chaos
/datum/recipe/human/kabob
/datum/recipe/humankabob
items = list(
/obj/item/stack/rods,
/obj/item/weapon/reagent_containers/food/snacks/meat/human,
@@ -430,10 +376,8 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/tofubread
/datum/recipe/loadedbakedpotato
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/potato,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
)
fruit = list("potato" = 1)
items = list(/obj/item/weapon/reagent_containers/food/snacks/cheesewedge)
result = /obj/item/weapon/reagent_containers/food/snacks/loadedbakedpotato
/datum/recipe/cheesyfries
@@ -444,20 +388,17 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/cheesyfries
/datum/recipe/cubancarp
fruit = list("chili" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/grown/chili,
/obj/item/weapon/reagent_containers/food/snacks/carpmeat,
/obj/item/weapon/reagent_containers/food/snacks/carpmeat
)
result = /obj/item/weapon/reagent_containers/food/snacks/cubancarp
/datum/recipe/popcorn
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/corn
)
fruit = list("corn" = 1)
result = /obj/item/weapon/reagent_containers/food/snacks/popcorn
/datum/recipe/cookie
reagents = list("milk" = 5, "sugar" = 5)
items = list(
@@ -490,91 +431,69 @@ I said no!
/datum/recipe/meatsteak
reagents = list("sodiumchloride" = 1, "blackpepper" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat
)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meat)
result = /obj/item/weapon/reagent_containers/food/snacks/meatsteak
/datum/recipe/syntisteak
reagents = list("sodiumchloride" = 1, "blackpepper" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh
)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh)
result = /obj/item/weapon/reagent_containers/food/snacks/meatsteak
/datum/recipe/pizzamargherita
fruit = list("tomato" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/margherita
/datum/recipe/meatpizza
fruit = list("tomato" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza
/datum/recipe/syntipizza
fruit = list("tomato" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
/obj/item/weapon/reagent_containers/food/snacks/meat/syntiflesh,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza
/datum/recipe/mushroompizza
fruit = list("mushroom" = 5, "tomato" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/mushroompizza
/datum/recipe/vegetablepizza
fruit = list("eggplant" = 1, "carrot" = 1, "corn" = 1, "tomato" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/corn,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/vegetablepizza
/datum/recipe/spacylibertyduff
reagents = list("water" = 5, "vodka" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap,
)
reagents = list("water" = 5, "vodka" = 5, "psilocybin" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/spacylibertyduff
/datum/recipe/amanitajelly
reagents = list("water" = 5, "vodka" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita,
)
reagents = list("water" = 5, "vodka" = 5, "amatoxin" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/amanitajelly
make_food(var/obj/container as obj)
var/obj/item/weapon/reagent_containers/food/snacks/amanitajelly/being_cooked = ..(container)
@@ -582,30 +501,21 @@ I said no!
return being_cooked
/datum/recipe/meatballsoup
fruit = list("carrot" = 1, "potato" = 1)
reagents = list("water" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meatball ,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/potato,
)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meatball)
result = /obj/item/weapon/reagent_containers/food/snacks/meatballsoup
/datum/recipe/vegetablesoup
fruit = list("carrot" = 1, "potato" = 1, "corn" = 1, "eggplant" = 1)
reagents = list("water" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/corn,
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant,
/obj/item/weapon/reagent_containers/food/snacks/grown/potato,
)
result = /obj/item/weapon/reagent_containers/food/snacks/vegetablesoup
/datum/recipe/nettlesoup
fruit = list("nettle" = 1, "potato" = 1)
reagents = list("water" = 10)
items = list(
/obj/item/weapon/grown/nettle,
/obj/item/weapon/reagent_containers/food/snacks/grown/potato,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg
)
result = /obj/item/weapon/reagent_containers/food/snacks/nettlesoup
@@ -614,33 +524,23 @@ I said no!
result= /obj/item/weapon/reagent_containers/food/snacks/wishsoup
/datum/recipe/hotchili
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/grown/chili,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
)
fruit = list("chili" = 1, "tomato" = 1)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meat)
result = /obj/item/weapon/reagent_containers/food/snacks/hotchili
/datum/recipe/coldchili
items = list(
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/grown/icepepper,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
)
fruit = list("icechili" = 1, "tomato" = 1)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meat)
result = /obj/item/weapon/reagent_containers/food/snacks/coldchili
/datum/recipe/amanita_pie
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/amanita,
)
reagents = list("amatoxin" = 5)
items = list(/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough)
result = /obj/item/weapon/reagent_containers/food/snacks/amanita_pie
/datum/recipe/plump_pie
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet,
)
fruit = list("plumphelmet" = 1)
items = list(/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough)
result = /obj/item/weapon/reagent_containers/food/snacks/plump_pie
/datum/recipe/spellburger
@@ -668,30 +568,24 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/bigbiteburger
/datum/recipe/enchiladas
items = list(
/obj/item/weapon/reagent_containers/food/snacks/cutlet,
/obj/item/weapon/reagent_containers/food/snacks/grown/chili,
/obj/item/weapon/reagent_containers/food/snacks/grown/chili,
/obj/item/weapon/reagent_containers/food/snacks/grown/corn,
)
fruit = list("chili" = 2, "corn" = 1)
items = list(/obj/item/weapon/reagent_containers/food/snacks/cutlet)
result = /obj/item/weapon/reagent_containers/food/snacks/enchiladas
/datum/recipe/creamcheesebread
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/creamcheesebread
/datum/recipe/monkeysdelight
reagents = list("sodiumchloride" = 1, "blackpepper" = 1)
fruit = list("banana" = 1)
reagents = list("sodiumchloride" = 1, "blackpepper" = 1, "flour" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/monkeycube,
/obj/item/weapon/reagent_containers/food/snacks/grown/banana,
/obj/item/weapon/reagent_containers/food/snacks/monkeycube
)
result = /obj/item/weapon/reagent_containers/food/snacks/monkeysdelight
@@ -710,16 +604,6 @@ I said no!
)
result = /obj/item/weapon/reagent_containers/food/snacks/fishandchips
/datum/recipe/birthdaycake
reagents = list("milk" = 5, "sugar" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/clothing/head/cakehat
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/birthdaycake
/datum/recipe/bread
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
@@ -751,11 +635,8 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/grilledcheese
/datum/recipe/tomatosoup
fruit = list("tomato" = 2)
reagents = list("water" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
)
result = /obj/item/weapon/reagent_containers/food/snacks/tomatosoup
/datum/recipe/rofflewaffles
@@ -767,15 +648,9 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/rofflewaffles
/datum/recipe/stew
fruit = list("potato" = 1, "tomato" = 1, "carrot" = 1, "eggplant" = 1, "mushroom" = 1)
reagents = list("water" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/grown/potato,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/eggplant,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom,
)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meat)
result = /obj/item/weapon/reagent_containers/food/snacks/stew
/datum/recipe/slimetoast
@@ -803,11 +678,10 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/milosoup
/datum/recipe/stewedsoymeat
fruit = list("carrot" = 1, "tomato" = 1)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/soydope,
/obj/item/weapon/reagent_containers/food/snacks/soydope,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/soydope
)
result = /obj/item/weapon/reagent_containers/food/snacks/stewedsoymeat
@@ -833,19 +707,14 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/ricepudding
/datum/recipe/pastatomato
fruit = list("tomato" = 2)
reagents = list("water" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/spagetti,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
)
items = list(/obj/item/weapon/reagent_containers/food/snacks/spagetti)
result = /obj/item/weapon/reagent_containers/food/snacks/pastatomato
/datum/recipe/poppypretzel
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/poppy,
/obj/item/weapon/reagent_containers/food/snacks/dough,
)
fruit = list("poppy" = 1)
items = list(/obj/item/weapon/reagent_containers/food/snacks/dough)
result = /obj/item/weapon/reagent_containers/food/snacks/poppypretzel
/datum/recipe/meatballspagetti
@@ -869,42 +738,27 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/spesslaw
/datum/recipe/superbiteburger
fruit = list("tomato" = 1)
reagents = list("sodiumchloride" = 5, "blackpepper" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/bigbiteburger,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/boiledegg,
)
result = /obj/item/weapon/reagent_containers/food/snacks/superbiteburger
/datum/recipe/candiedapple
fruit = list("apple" = 1)
reagents = list("water" = 5, "sugar" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/apple
)
result = /obj/item/weapon/reagent_containers/food/snacks/candiedapple
/datum/recipe/applepie
items = list(
/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,
/obj/item/weapon/reagent_containers/food/snacks/grown/apple,
)
fruit = list("apple" = 1)
items = list(/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough)
result = /obj/item/weapon/reagent_containers/food/snacks/applepie
/datum/recipe/applecake
reagents = list("milk" = 5, "sugar" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/grown/apple,
/obj/item/weapon/reagent_containers/food/snacks/grown/apple,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/applecake
/datum/recipe/slimeburger
reagents = list("slimejelly" = 5)
items = list(
@@ -943,68 +797,8 @@ I said no!
)
result = /obj/item/weapon/reagent_containers/food/snacks/jellysandwich/cherry
/datum/recipe/orangecake
reagents = list("milk" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/grown/orange,
/obj/item/weapon/reagent_containers/food/snacks/grown/orange,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/orangecake
/datum/recipe/limecake
reagents = list("milk" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/grown/lime,
/obj/item/weapon/reagent_containers/food/snacks/grown/lime,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/limecake
/datum/recipe/lemoncake
reagents = list("milk" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon,
/obj/item/weapon/reagent_containers/food/snacks/grown/lemon,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/lemoncake
/datum/recipe/chocolatecake
reagents = list("milk" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar,
/obj/item/weapon/reagent_containers/food/snacks/chocolatebar,
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/chocolatecake
/datum/recipe/bloodsoup
reagents = list("blood" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/bloodtomato,
/obj/item/weapon/reagent_containers/food/snacks/grown/bloodtomato,
)
reagents = list("blood" = 30)
result = /obj/item/weapon/reagent_containers/food/snacks/bloodsoup
/datum/recipe/slimesoup
@@ -1019,19 +813,6 @@ I said no!
)
result = /obj/item/weapon/reagent_containers/food/snacks/boiledslimecore
/datum/recipe/braincake
reagents = list("milk" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/organ/brain
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/braincake
/datum/recipe/chocolateegg
items = list(
/obj/item/weapon/reagent_containers/food/snacks/egg,
@@ -1047,9 +828,8 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/sausage
/datum/recipe/fishfingers
reagents = list("flour" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/carpmeat,
)
@@ -1066,84 +846,53 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/mysterysoup
/datum/recipe/pumpkinpie
reagents = list("milk" = 5, "sugar" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/grown/pumpkin,
/obj/item/weapon/reagent_containers/food/snacks/egg,
)
fruit = list("pumpkin" = 1)
reagents = list("milk" = 5, "sugar" = 5, "egg" = 3, "flour" = 10)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/pumpkinpie
/datum/recipe/plumphelmetbiscuit
reagents = list("water" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/plumphelmet,
)
fruit = list("plumphelmet" = 1)
reagents = list("water" = 5, "flour" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/plumphelmetbiscuit
/datum/recipe/mushroomsoup
fruit = list("mushroom" = 1)
reagents = list("water" = 5, "milk" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle,
)
result = /obj/item/weapon/reagent_containers/food/snacks/mushroomsoup
/datum/recipe/chawanmushi
fruit = list("mushroom" = 1)
reagents = list("water" = 5, "soysauce" = 5)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle,
/obj/item/weapon/reagent_containers/food/snacks/egg
)
result = /obj/item/weapon/reagent_containers/food/snacks/chawanmushi
/datum/recipe/beetsoup
fruit = list("whitebeet" = 1, "cabbage" = 1)
reagents = list("water" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/whitebeet,
/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage,
)
result = /obj/item/weapon/reagent_containers/food/snacks/beetsoup
/datum/recipe/appletart
reagents = list("sugar" = 5, "milk" = 5)
fruit = list("goldapple" = 1)
reagents = list("sugar" = 5, "milk" = 5, "flour" = 10)
items = list(
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/flour,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/grown/goldapple,
/obj/item/weapon/reagent_containers/food/snacks/egg
)
result = /obj/item/weapon/reagent_containers/food/snacks/appletart
/datum/recipe/tossedsalad
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage,
/obj/item/weapon/reagent_containers/food/snacks/grown/cabbage,
/obj/item/weapon/reagent_containers/food/snacks/grown/tomato,
/obj/item/weapon/reagent_containers/food/snacks/grown/carrot,
/obj/item/weapon/reagent_containers/food/snacks/grown/apple,
)
fruit = list("cabbage" = 2, "tomato" = 1, "carrot" = 1, "apple" = 1)
result = /obj/item/weapon/reagent_containers/food/snacks/tossedsalad
/datum/recipe/aesirsalad
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus,
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus,
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus,
/obj/item/weapon/reagent_containers/food/snacks/grown/goldapple,
)
fruit = list("goldapple" = 1, "ambrosiadeus" = 1)
result = /obj/item/weapon/reagent_containers/food/snacks/aesirsalad
/datum/recipe/validsalad
items = list(
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris,
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris,
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris,
/obj/item/weapon/reagent_containers/food/snacks/grown/potato,
/obj/item/weapon/reagent_containers/food/snacks/meatball,
)
fruit = list("potato" = 1, "ambrosia" = 3)
items = list(/obj/item/weapon/reagent_containers/food/snacks/meatball)
result = /obj/item/weapon/reagent_containers/food/snacks/validsalad
make_food(var/obj/container as obj)
var/obj/item/weapon/reagent_containers/food/snacks/validsalad/being_cooked = ..(container)
@@ -1226,3 +975,50 @@ I said no!
result = /obj/item/weapon/reagent_containers/food/snacks/mint
// Cakes.
/datum/recipe/cake
reagents = list("milk" = 5, "flour" = 15, "sugar" = 15, "egg" = 9)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/plaincake
/datum/recipe/cake/carrot
fruit = list("carrot" = 3)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/carrotcake
/datum/recipe/cake/cheese
items = list(
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge,
/obj/item/weapon/reagent_containers/food/snacks/cheesewedge
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesecake
/datum/recipe/cake/orange
fruit = list("orange" = 1)
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "orangejuice" = 3, "sugar" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/orangecake
/datum/recipe/cake/lime
fruit = list("lime" = 1)
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "limejuice" = 3, "sugar" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/limecake
/datum/recipe/cake/lemon
fruit = list("lemon" = 1)
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "lemonjuice" = 3, "sugar" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/lemoncake
/datum/recipe/cake/chocolate
items = list(/obj/item/weapon/reagent_containers/food/snacks/chocolatebar)
reagents = list("milk" = 5, "flour" = 15, "egg" = 9, "coco" = 4, "sugar" = 5)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/chocolatecake
/datum/recipe/cake/birthday
items = list(/obj/item/clothing/head/cakehat)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/birthdaycake
/datum/recipe/cake/apple
fruit = list("apple" = 2)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/applecake
/datum/recipe/cake/brain
items = list(/obj/item/organ/brain)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/braincake

View File

@@ -0,0 +1,58 @@
//Misc
#define DEAD_PLANT_COLOUR "#C2A180"
// Definitions for genes (trait groupings)
#define GENE_BIOCHEMISTRY "biochemistry"
#define GENE_HARDINESS "hardiness"
#define GENE_ENVIRONMENT "environment"
#define GENE_METABOLISM "metabolism"
#define GENE_STRUCTURE "appearance"
#define GENE_DIET "diet"
#define GENE_PIGMENT "pigment"
#define GENE_OUTPUT "output"
#define GENE_ATMOSPHERE "atmosphere"
#define GENE_VIGOUR "vigour"
#define GENE_FRUIT "fruit"
#define GENE_SPECIAL "special"
#define ALL_GENES list(GENE_BIOCHEMISTRY,GENE_HARDINESS,GENE_ENVIRONMENT,GENE_METABOLISM,GENE_STRUCTURE,GENE_DIET,GENE_PIGMENT,GENE_OUTPUT,GENE_ATMOSPHERE,GENE_VIGOUR,GENE_FRUIT,GENE_SPECIAL)
//Definitions for traits (individual descriptors)
#define TRAIT_CHEMS 1
#define TRAIT_EXUDE_GASSES 2
#define TRAIT_ALTER_TEMP 3
#define TRAIT_POTENCY 4
#define TRAIT_HARVEST_REPEAT 5
#define TRAIT_PRODUCES_POWER 6
#define TRAIT_JUICY 7
#define TRAIT_PRODUCT_ICON 8
#define TRAIT_PLANT_ICON 0
#define TRAIT_CONSUME_GASSES 10
#define TRAIT_REQUIRES_NUTRIENTS 11
#define TRAIT_NUTRIENT_CONSUMPTION 12
#define TRAIT_REQUIRES_WATER 13
#define TRAIT_WATER_CONSUMPTION 14
#define TRAIT_CARNIVOROUS 15
#define TRAIT_PARASITE 16
#define TRAIT_STINGS 17
#define TRAIT_IDEAL_HEAT 18
#define TRAIT_HEAT_TOLERANCE 19
#define TRAIT_IDEAL_LIGHT 20
#define TRAIT_LIGHT_TOLERANCE 21
#define TRAIT_LOWKPA_TOLERANCE 22
#define TRAIT_HIGHKPA_TOLERANCE 23
#define TRAIT_EXPLOSIVE 24
#define TRAIT_TOXINS_TOLERANCE 25
#define TRAIT_PEST_TOLERANCE 26
#define TRAIT_WEED_TOLERANCE 27
#define TRAIT_ENDURANCE 28
#define TRAIT_YIELD 29
#define TRAIT_SPREAD 30
#define TRAIT_MATURATION 31
#define TRAIT_PRODUCTION 32
#define TRAIT_TELEPORTING 33
#define TRAIT_PLANT_COLOUR 34
#define TRAIT_PRODUCT_COLOUR 35
#define TRAIT_BIOLUM 36
#define TRAIT_BIOLUM_COLOUR 37
#define TRAIT_IMMUTABLE 38

View File

@@ -0,0 +1,352 @@
//Grown foods.
/obj/item/weapon/reagent_containers/food/snacks/grown
name = "fruit"
icon = 'icons/obj/hydroponics_products.dmi'
icon_state = "blank"
desc = "Nutritious! Probably."
var/plantname
var/datum/seed/seed
var/potency = -1
/obj/item/weapon/reagent_containers/food/snacks/grown/New(newloc,planttype)
..()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
// Fill the object up with the appropriate reagents.
if(planttype)
plantname = planttype
if(!plantname)
return
if(!plant_controller)
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
return
seed = plant_controller.seeds[plantname]
if(!seed)
return
name = "[seed.seed_name]"
update_icon()
if(!seed.chems)
return
potency = seed.get_trait(TRAIT_POTENCY)
for(var/rid in seed.chems)
var/list/reagent_data = seed.chems[rid]
if(reagent_data && reagent_data.len)
var/rtotal = reagent_data[1]
if(reagent_data.len > 1 && potency > 0)
rtotal += round(potency/reagent_data[2])
reagents.add_reagent(rid,max(1,rtotal))
update_desc()
if(reagents.total_volume > 0)
bitesize = 1+round(reagents.total_volume / 2, 1)
/obj/item/weapon/reagent_containers/food/snacks/grown/proc/update_desc()
if(!seed)
return
if(!plant_controller)
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
return
if(plant_controller.product_descs["[seed.uid]"])
desc = plant_controller.product_descs["[seed.uid]"]
else
var/list/descriptors = list()
if(reagents.has_reagent("sugar") || reagents.has_reagent("cherryjelly") || reagents.has_reagent("honey") || reagents.has_reagent("berryjuice"))
descriptors |= "sweet"
if(reagents.has_reagent("anti_toxin"))
descriptors |= "astringent"
if(reagents.has_reagent("frostoil"))
descriptors |= "numbing"
if(reagents.has_reagent("nutriment"))
descriptors |= "nutritious"
if(reagents.has_reagent("condensedcapsaicin") || reagents.has_reagent("capsaicin"))
descriptors |= "spicy"
if(reagents.has_reagent("coco"))
descriptors |= "bitter"
if(reagents.has_reagent("orangejuice") || reagents.has_reagent("lemonjuice") || reagents.has_reagent("limejuice"))
descriptors |= "sweet-sour"
if(reagents.has_reagent("radium") || reagents.has_reagent("uranium"))
descriptors |= "radioactive"
if(reagents.has_reagent("amatoxin") || reagents.has_reagent("toxin"))
descriptors |= "poisonous"
if(reagents.has_reagent("psilocybin") || reagents.has_reagent("space_drugs"))
descriptors |= "hallucinogenic"
if(reagents.has_reagent("bicaridine"))
descriptors |= "medicinal"
if(reagents.has_reagent("gold"))
descriptors |= "shiny"
if(reagents.has_reagent("lube"))
descriptors |= "slippery"
if(reagents.has_reagent("pacid") || reagents.has_reagent("sacid"))
descriptors |= "acidic"
if(seed.get_trait(TRAIT_JUICY))
descriptors |= "juicy"
if(seed.get_trait(TRAIT_STINGS))
descriptors |= "stinging"
if(seed.get_trait(TRAIT_TELEPORTING))
descriptors |= "glowing"
if(seed.get_trait(TRAIT_EXPLOSIVE))
descriptors |= "bulbous"
var/descriptor_num = rand(2,4)
var/descriptor_count = descriptor_num
desc = "A"
while(descriptors.len && descriptor_num > 0)
var/chosen = pick(descriptors)
descriptors -= chosen
desc += "[(descriptor_count>1 && descriptor_count!=descriptor_num) ? "," : "" ] [chosen]"
descriptor_num--
if(seed.seed_noun == "spores")
desc += " mushroom"
else
desc += " fruit"
plant_controller.product_descs["[seed.uid]"] = desc
desc += ". Delicious! Probably."
/obj/item/weapon/reagent_containers/food/snacks/grown/update_icon()
if(!seed || !plant_controller || !plant_controller.plant_icon_cache)
return
overlays.Cut()
var/image/plant_icon
var/icon_key = "fruit-[seed.get_trait(TRAIT_PRODUCT_ICON)]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"
if(plant_controller.plant_icon_cache[icon_key])
plant_icon = plant_controller.plant_icon_cache[icon_key]
else
plant_icon = image('icons/obj/hydroponics_products.dmi',"blank")
var/image/fruit_base = image('icons/obj/hydroponics_products.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]-product")
fruit_base.color = "[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"
plant_icon.overlays |= fruit_base
if("[seed.get_trait(TRAIT_PRODUCT_ICON)]-leaf" in icon_states('icons/obj/hydroponics_products.dmi'))
var/image/fruit_leaves = image('icons/obj/hydroponics_products.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]-leaf")
fruit_leaves.color = "[seed.get_trait(TRAIT_PLANT_COLOUR)]"
plant_icon.overlays |= fruit_leaves
plant_controller.plant_icon_cache[icon_key] = plant_icon
overlays |= plant_icon
/obj/item/weapon/reagent_containers/food/snacks/grown/Crossed(var/mob/living/M)
if(seed && seed.get_trait(TRAIT_JUICY) == 2)
if(istype(M))
if(M.buckled)
return
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(H.shoes && H.shoes.flags & NOSLIP)
return
M.stop_pulling()
M << "<span class='notice'>You slipped on the [name]!</span>"
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
M.Stun(8)
M.Weaken(5)
seed.thrown_at(src,M)
sleep(-1)
if(src) del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom)
..()
if(seed) seed.thrown_at(src,hit_atom)
/obj/item/weapon/reagent_containers/food/snacks/grown/attackby(var/obj/item/weapon/W, var/mob/user)
if(seed)
if(seed.get_trait(TRAIT_PRODUCES_POWER) && istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if(C.use(5))
//TODO: generalize this.
user << "<span class='notice'>You add some cable to the [src.name] and slide it inside the battery casing.</span>"
var/obj/item/weapon/cell/potato/pocell = new /obj/item/weapon/cell/potato(get_turf(user))
if(src.loc == user && !(user.l_hand && user.r_hand) && istype(user,/mob/living/carbon/human))
user.put_in_hands(pocell)
pocell.maxcharge = src.potency * 10
pocell.charge = pocell.maxcharge
del(src)
return
else if(W.sharp)
if(seed.kitchen_tag == "pumpkin") // Ugggh these checks are awful.
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
new /obj/item/clothing/head/pumpkinhead (user.loc)
del(src)
return
else if(seed.chems)
if(istype(W,/obj/item/weapon/hatchet) && !isnull(seed.chems["woodpulp"]))
user.show_message("<span class='notice'>You make planks out of \the [src]!</span>", 1)
for(var/i=0,i<2,i++)
var/obj/item/stack/sheet/wood/NG = new (user.loc)
NG.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
for (var/obj/item/stack/sheet/wood/G in user.loc)
if(G==NG)
continue
if(G.amount>=G.max_amount)
continue
G.attackby(NG, user)
user << "You add the newly-formed wood to the stack. It now contains [NG.amount] planks."
del(src)
return
else if(!isnull(seed.chems["potato"]))
user << "You slice \the [src] into sticks."
new /obj/item/weapon/reagent_containers/food/snacks/rawsticks(get_turf(src))
del(src)
return
else if(!isnull(seed.chems["carrotjuice"]))
user << "You slice \the [src] into sticks."
new /obj/item/weapon/reagent_containers/food/snacks/carrotfries(get_turf(src))
del(src)
return
else if(!isnull(seed.chems["soymilk"]))
user << "You roughly chop up \the [src]."
new /obj/item/weapon/reagent_containers/food/snacks/soydope(get_turf(src))
del(src)
return
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/attack(var/mob/living/carbon/M, var/mob/user, var/def_zone)
if(user == M)
return ..()
if(user.a_intent == "hurt")
// This is being copypasted here because reagent_containers (WHY DOES FOOD DESCEND FROM THAT) overrides it completely.
// TODO: refactor all food paths to be less horrible and difficult to work with in this respect. ~Z
if(!istype(M) || (can_operate(M) && do_surgery(M,user,src))) return 0
user.lastattacked = M
M.lastattacker = user
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/hit = H.attacked_by(src, user, def_zone)
if(hit && hitsound)
playsound(loc, hitsound, 50, 1, -1)
return hit
else
if(attack_verb.len)
user.visible_message("<span class='danger'>[M] has been [pick(attack_verb)] with [src] by [user]!</span>")
else
user.visible_message("<span class='danger'>[M] has been attacked with [src] by [user]!</span>")
if (hitsound)
playsound(loc, hitsound, 50, 1, -1)
switch(damtype)
if("brute")
M.take_organ_damage(force)
if(prob(33))
var/turf/simulated/location = get_turf(M)
if(istype(location)) location.add_blood_floor(M)
if("fire")
if (!(COLD_RESISTANCE in M.mutations))
M.take_organ_damage(0, force)
M.updatehealth()
if(seed && seed.get_trait(TRAIT_STINGS))
if(!reagents || reagents.total_volume <= 0)
return
reagents.remove_any(rand(1,3))
seed.thrown_at(src,M)
sleep(-1)
if(!src)
return
if(prob(35))
if(user)
user << "<span class='danger'>\The [src] has fallen to bits.</span>"
user.drop_from_inventory(src)
del(src)
add_fingerprint(user)
return 1
else
..()
/obj/item/weapon/reagent_containers/food/snacks/grown/attack_self(mob/user as mob)
if(!seed)
return
if(istype(user.loc,/turf/space))
return
if(user.a_intent == "hurt")
user.visible_message("<span class='danger'>\The [user] squashes \the [src]!</span>")
seed.thrown_at(src,user)
sleep(-1)
if(src) del(src)
return
if(seed.get_trait(TRAIT_SPREAD) > 0)
user << "<span class='notice'>You plant the [src.name].</span>"
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(user),src.seed)
del(src)
return
if(seed.kitchen_tag)
switch(seed.kitchen_tag)
if("shand")
var/obj/item/stack/medical/bruise_pack/tajaran/poultice = new /obj/item/stack/medical/bruise_pack/tajaran(user.loc)
poultice.heal_brute = potency
user << "<span class='notice'>You mash the leaves into a poultice.</span>"
del(src)
return
if("mtear")
var/obj/item/stack/medical/ointment/tajaran/poultice = new /obj/item/stack/medical/ointment/tajaran(user.loc)
poultice.heal_burn = potency
user << "<span class='notice'>You mash the petals into a poultice.</span>"
del(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/pickup(mob/user)
..()
if(!seed)
return
if(seed.get_trait(TRAIT_BIOLUM))
user.SetLuminosity(user.luminosity + seed.get_trait(TRAIT_BIOLUM))
SetLuminosity(0)
if(seed.get_trait(TRAIT_STINGS))
var/mob/living/carbon/human/H = user
if(istype(H) && H.gloves)
return
if(!reagents || reagents.total_volume <= 0)
return
reagents.remove_any(rand(1,3)) //Todo, make it actually remove the reagents the seed uses.
seed.do_thorns(H,src)
seed.do_sting(H,src,pick("r_hand","l_hand"))
/obj/item/weapon/reagent_containers/food/snacks/grown/dropped(mob/user)
if(!..() || !seed)
return
if(seed.get_trait(TRAIT_BIOLUM))
user.SetLuminosity(user.luminosity - seed.get_trait(TRAIT_BIOLUM))
SetLuminosity(seed.get_trait(TRAIT_BIOLUM))
// Predefined types for placing on the map.
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/libertycap
plantname = "libertycap"
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
plantname = "ambrosia"

View File

@@ -8,7 +8,7 @@
var/plantname
var/potency = 1
/obj/item/weapon/grown/New()
/obj/item/weapon/grown/New(newloc,planttype)
..()
@@ -17,158 +17,25 @@
R.my_atom = src
//Handle some post-spawn var stuff.
spawn(1)
// Fill the object up with the appropriate reagents.
if(!isnull(plantname))
var/datum/seed/S = seed_types[plantname]
if(!S || !S.chems)
return
potency = S.potency
for(var/rid in S.chems)
var/list/reagent_data = S.chems[rid]
var/rtotal = reagent_data[1]
if(reagent_data.len > 1 && potency > 0)
rtotal += round(potency/reagent_data[2])
reagents.add_reagent(rid,max(1,rtotal))
/obj/item/weapon/grown/log
name = "towercap"
name = "tower-cap log"
desc = "It's better than bad, it's good!"
icon = 'icons/obj/harvest.dmi'
icon_state = "logs"
force = 5
throwforce = 5
w_class = 3.0
throw_speed = 3
throw_range = 3
origin_tech = "materials=1"
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || (istype(W, /obj/item/weapon/twohanded/fireaxe) && W:wielded) || istype(W, /obj/item/weapon/melee/energy))
user.show_message("<span class='notice'>You make planks out of \the [src]!</span>", 1)
for(var/i=0,i<2,i++)
var/obj/item/stack/sheet/wood/NG = new (user.loc)
for (var/obj/item/stack/sheet/wood/G in user.loc)
if(G==NG)
continue
if(G.amount>=G.max_amount)
continue
G.attackby(NG, user)
usr << "You add the newly-formed wood to the stack. It now contains [NG.amount] planks."
del(src)
if(planttype)
plantname = planttype
var/datum/seed/S = plant_controller.seeds[plantname]
if(!S || !S.chems)
return
/obj/item/weapon/grown/sunflower // FLOWER POWER!
plantname = "sunflowers"
name = "sunflower"
desc = "It's beautiful! A certain person might beat you to death if you trample these."
icon = 'icons/obj/harvest.dmi'
icon_state = "sunflower"
damtype = "fire"
force = 0
throwforce = 1
w_class = 1.0
throw_speed = 1
throw_range = 3
potency = S.get_trait(TRAIT_POTENCY)
/obj/item/weapon/grown/sunflower/attack(mob/M as mob, mob/user as mob)
M << "<font color='green'><b> [user] smacks you with a sunflower!</font><font color='yellow'><b>FLOWER POWER<b></font>"
user << "<font color='green'> Your sunflower's </font><font color='yellow'><b>FLOWER POWER</b></font><font color='green'> strikes [M]</font>"
/obj/item/weapon/grown/nettle // -- Skie
plantname = "nettle"
desc = "It's probably <B>not</B> wise to touch it with bare hands..."
icon = 'icons/obj/weapons.dmi'
name = "nettle"
icon_state = "nettle"
damtype = "fire"
force = 15
throwforce = 1
w_class = 2.0
throw_speed = 1
throw_range = 3
origin_tech = "combat=1"
attack_verb = list("stung")
hitsound = ""
var/potency_divisior = 5
/obj/item/weapon/grown/nettle/New()
..()
spawn(5)
force = round((5+potency/potency_divisior), 1)
/obj/item/weapon/grown/nettle/pickup(mob/living/carbon/human/user as mob)
if(istype(user) && !user.gloves)
user << "\red The nettle burns your bare hand!"
if(istype(user, /mob/living/carbon/human))
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/organ/external/affecting = user.get_organ(organ)
if(affecting.take_damage(0,force))
user.UpdateDamageIcon()
else
user.take_organ_damage(0,force)
return 1
return 0
/obj/item/weapon/grown/nettle/proc/lose_leaves(var/mob/user)
if(force > 0)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
force -= rand(1,(force/3)+1) // When you whack someone with it, leaves fall off
sleep(1)
if(force <= 0)
if(user)
user << "All the leaves have fallen off \the [src] from violent whacking."
user.drop_from_inventory(src)
del(src)
/obj/item/weapon/grown/nettle/death // -- Skie
plantname = "deathnettle"
desc = "The \red glowing \black nettle incites \red<B>rage</B>\black in you just from looking at it!"
name = "deathnettle"
icon_state = "deathnettle"
origin_tech = "combat=3"
potency_divisior = 2.5
/obj/item/weapon/grown/nettle/death/pickup(mob/living/carbon/human/user as mob)
if(..() && prob(50))
user.Paralyse(5)
user << "\red You are stunned by the deathnettle when you try picking it up!"
/obj/item/weapon/grown/nettle/attack(mob/living/carbon/M as mob, mob/user as mob)
if(!..()) return
lose_leaves(user)
/obj/item/weapon/grown/nettle/death/attack(mob/living/carbon/M as mob, mob/user as mob)
if(!..()) return
if(istype(M, /mob/living))
M << "\red You are stunned by the powerful acid of the deathnettle!"
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Had the [src.name] used on them by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] on [M.name] ([M.ckey])</font>")
msg_admin_attack("[user.name] ([user.ckey]) used the [src.name] on [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
M.eye_blurry += force/7
if(prob(20))
M.Paralyse(force/6)
M.Weaken(force/15)
M.drop_item()
for(var/rid in S.chems)
var/list/reagent_data = S.chems[rid]
var/rtotal = reagent_data[1]
if(reagent_data.len > 1 && potency > 0)
rtotal += round(potency/reagent_data[2])
reagents.add_reagent(rid,max(1,rtotal))
/obj/item/weapon/corncob
name = "corn cob"
desc = "A reminder of meals gone by."
icon = 'icons/obj/harvest.dmi'
icon = 'icons/obj/trash.dmi'
icon_state = "corncob"
item_state = "corncob"
w_class = 2.0
@@ -183,3 +50,14 @@
new /obj/item/clothing/mask/smokable/pipe/cobpipe (user.loc)
del(src)
return
/obj/item/weapon/bananapeel
name = "banana peel"
desc = "A peel from a banana."
icon = 'icons/obj/items.dmi'
icon_state = "banana_peel"
item_state = "banana_peel"
w_class = 2.0
throwforce = 0
throw_speed = 4
throw_range = 20

View File

@@ -0,0 +1,5 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris
plantname = "ambrosia"
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus
plantname = "ambrosiadeus"

View File

@@ -1,366 +0,0 @@
//Analyzer, pestkillers, weedkillers, nutrients, hatchets, cutters.
/obj/item/weapon/wirecutters/clippers
name = "plant clippers"
desc = "A tool used to take samples from plants."
/obj/item/device/analyzer/plant_analyzer
name = "plant analyzer"
icon = 'icons/obj/device.dmi'
icon_state = "hydro"
item_state = "analyzer"
/obj/item/device/analyzer/plant_analyzer/attack_self(mob/user as mob)
return 0
/obj/item/device/analyzer/plant_analyzer/afterattack(obj/target, mob/user, flag)
if(!flag) return
var/datum/seed/grown_seed
var/datum/reagents/grown_reagents
if(istype(target,/obj/structure/table))
return ..()
else if(istype(target,/obj/item/weapon/reagent_containers/food/snacks/grown))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = target
grown_seed = seed_types[G.plantname]
grown_reagents = G.reagents
else if(istype(target,/obj/item/weapon/grown))
var/obj/item/weapon/grown/G = target
grown_seed = seed_types[G.plantname]
grown_reagents = G.reagents
else if(istype(target,/obj/item/seeds))
var/obj/item/seeds/S = target
grown_seed = S.seed
else if(istype(target,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/H = target
grown_seed = H.seed
grown_reagents = H.reagents
if(!grown_seed)
user << "\red [src] can tell you nothing about [target]."
return
var/dat = "<h3>Plant data for [target]</h3>"
user.visible_message("\blue [user] runs the scanner over [target].")
dat += "<h2>General Data</h2>"
dat += "<table>"
dat += "<tr><td><b>Endurance</b></td><td>[grown_seed.endurance]</td></tr>"
dat += "<tr><td><b>Yield</b></td><td>[grown_seed.yield]</td></tr>"
dat += "<tr><td><b>Lifespan</b></td><td>[grown_seed.lifespan]</td></tr>"
dat += "<tr><td><b>Maturation time</b></td><td>[grown_seed.maturation]</td></tr>"
dat += "<tr><td><b>Production time</b></td><td>[grown_seed.production]</td></tr>"
dat += "<tr><td><b>Potency</b></td><td>[grown_seed.potency]</td></tr>"
dat += "</table>"
if(grown_reagents && grown_reagents.reagent_list && grown_reagents.reagent_list.len)
dat += "<h2>Reagent Data</h2>"
dat += "<br>This sample contains: "
for(var/datum/reagent/R in grown_reagents.reagent_list)
dat += "<br>- [R.id], [grown_reagents.get_reagent_amount(R.id)] unit(s)"
dat += "<h2>Other Data</h2>"
if(grown_seed.harvest_repeat)
dat += "This plant can be harvested repeatedly.<br>"
if(grown_seed.immutable == -1)
dat += "This plant is highly mutable.<br>"
else if(grown_seed.immutable > 0)
dat += "This plant does not possess genetics that are alterable.<br>"
if(grown_seed.products && grown_seed.products.len)
dat += "The mature plant will produce [grown_seed.products.len == 1 ? "fruit" : "[grown_seed.products.len] varieties of fruit"].<br>"
if(grown_seed.requires_nutrients)
if(grown_seed.nutrient_consumption < 0.05)
dat += "It consumes a small amount of nutrient fluid.<br>"
else if(grown_seed.nutrient_consumption > 0.2)
dat += "It requires a heavy supply of nutrient fluid.<br>"
else
dat += "It requires a supply of nutrient fluid.<br>"
if(grown_seed.requires_water)
if(grown_seed.water_consumption < 1)
dat += "It requires very little water.<br>"
else if(grown_seed.water_consumption > 5)
dat += "It requires a large amount of water.<br>"
else
dat += "It requires a stable supply of water.<br>"
if(grown_seed.mutants && grown_seed.mutants.len)
dat += "It exhibits a high degree of potential subspecies shift.<br>"
dat += "It thrives in a temperature of [grown_seed.ideal_heat] Kelvin."
if(grown_seed.lowkpa_tolerance < 20)
dat += "<br>It is well adapted to low pressure levels."
if(grown_seed.highkpa_tolerance > 220)
dat += "<br>It is well adapted to high pressure levels."
if(grown_seed.heat_tolerance > 30)
dat += "<br>It is well adapted to a range of temperatures."
else if(grown_seed.heat_tolerance < 10)
dat += "<br>It is very sensitive to temperature shifts."
dat += "<br>It thrives in a light level of [grown_seed.ideal_light] lumen\s."
if(grown_seed.light_tolerance > 10)
dat += "<br>It is well adapted to a range of light levels."
else if(grown_seed.light_tolerance < 3)
dat += "<br>It is very sensitive to light level shifts."
if(grown_seed.toxins_tolerance < 3)
dat += "<br>It is highly sensitive to toxins."
else if(grown_seed.toxins_tolerance > 6)
dat += "<br>It is remarkably resistant to toxins."
if(grown_seed.pest_tolerance < 3)
dat += "<br>It is highly sensitive to pests."
else if(grown_seed.pest_tolerance > 6)
dat += "<br>It is remarkably resistant to pests."
if(grown_seed.weed_tolerance < 3)
dat += "<br>It is highly sensitive to weeds."
else if(grown_seed.weed_tolerance > 6)
dat += "<br>It is remarkably resistant to weeds."
switch(grown_seed.spread)
if(1)
dat += "<br>It is capable of growing beyond the confines of a tray."
if(2)
dat += "<br>It is a robust and vigorous vine that will spread rapidly."
switch(grown_seed.carnivorous)
if(1)
dat += "<br>It is carniovorous and will eat tray pests for sustenance."
if(2)
dat += "<br>It is carnivorous and poses a significant threat to living things around it."
if(grown_seed.parasite)
dat += "<br>It is capable of parisitizing and gaining sustenance from tray weeds."
if(grown_seed.alter_temp)
dat += "<br>It will periodically alter the local temperature by [grown_seed.alter_temp] degrees Kelvin."
if(grown_seed.biolum)
dat += "<br>It is [grown_seed.biolum_colour ? "<font color='[grown_seed.biolum_colour]'>bio-luminescent</font>" : "bio-luminescent"]."
if(grown_seed.flowers)
dat += "<br>It has [grown_seed.flower_colour ? "<font color='[grown_seed.flower_colour]'>flowers</font>" : "flowers"]."
if(dat)
user << browse(dat,"window=plant_analyzer")
return
// *************************************
// Hydroponics Tools
// *************************************
/obj/item/weapon/plantspray
icon = 'icons/obj/hydroponics.dmi'
item_state = "spray"
flags = NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 4
w_class = 2.0
throw_speed = 2
throw_range = 10
var/toxicity = 4
var/pest_kill_str = 0
var/weed_kill_str = 0
/obj/item/weapon/plantspray/weeds // -- Skie
name = "weed-spray"
desc = "It's a toxic mixture, in spray form, to kill small weeds."
icon_state = "weedspray"
weed_kill_str = 6
/obj/item/weapon/plantspray/pests
name = "pest-spray"
desc = "It's some pest eliminator spray! <I>Do not inhale!</I>"
icon_state = "pestspray"
pest_kill_str = 6
/obj/item/weapon/plantspray/pests/old
name = "bottle of pestkiller"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
/obj/item/weapon/plantspray/pests/old/carbaryl
name = "bottle of carbaryl"
icon_state = "bottle16"
toxicity = 4
pest_kill_str = 2
/obj/item/weapon/plantspray/pests/old/lindane
name = "bottle of lindane"
icon_state = "bottle18"
toxicity = 6
pest_kill_str = 4
/obj/item/weapon/plantspray/pests/old/phosmet
name = "bottle of phosmet"
icon_state = "bottle15"
toxicity = 8
pest_kill_str = 7
/obj/item/weapon/minihoe // -- Numbers
name = "mini hoe"
desc = "It's used for removing weeds or scratching your back."
icon = 'icons/obj/weapons.dmi'
icon_state = "hoe"
item_state = "hoe"
flags = CONDUCT | NOBLUDGEON
force = 5.0
throwforce = 7.0
w_class = 2.0
matter = list("metal" = 50)
attack_verb = list("slashed", "sliced", "cut", "clawed")
// *************************************
// Weedkiller defines for hydroponics
// *************************************
/obj/item/weedkiller
name = "bottle of weedkiller"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
var/toxicity = 0
var/weed_kill_str = 0
/obj/item/weedkiller/triclopyr
name = "bottle of glyphosate"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
toxicity = 4
weed_kill_str = 2
/obj/item/weedkiller/lindane
name = "bottle of triclopyr"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle18"
toxicity = 6
weed_kill_str = 4
/obj/item/weedkiller/D24
name = "bottle of 2,4-D"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle15"
toxicity = 8
weed_kill_str = 7
// *************************************
// Nutrient defines for hydroponics
// *************************************
/obj/item/weapon/reagent_containers/glass/fertilizer
name = "fertilizer bottle"
desc = "A small glass bottle. Can hold up to 10 units."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4"
flags = 0
possible_transfer_amounts = null
w_class = 2.0
var/fertilizer //Reagent contained, if any.
//Like a shot glass!
amount_per_transfer_from_this = 10
volume = 10
/obj/item/weapon/reagent_containers/glass/fertilizer/New()
..()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
if(fertilizer)
reagents.add_reagent(fertilizer,10)
update_icon()
/obj/item/weapon/reagent_containers/glass/fertilizer/ez
name = "bottle of E-Z-Nutrient"
icon_state = "bottle-4"
fertilizer = "eznutrient"
/obj/item/weapon/reagent_containers/glass/fertilizer/l4z
name = "bottle of Left 4 Zed"
icon_state = "bottle-4"
fertilizer = "left4zed"
/obj/item/weapon/reagent_containers/glass/fertilizer/rh
name = "bottle of Robust Harvest"
icon_state = "bottle-4"
fertilizer = "robustharvest"
//Hatchets and things to kill kudzu
/obj/item/weapon/hatchet
name = "hatchet"
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
icon = 'icons/obj/weapons.dmi'
icon_state = "hatchet"
flags = CONDUCT
force = 12.0
w_class = 2.0
throwforce = 15.0
throw_speed = 4
throw_range = 4
sharp = 1
edge = 1
matter = list("metal" = 15000)
origin_tech = "materials=2;combat=1"
attack_verb = list("chopped", "torn", "cut")
/obj/item/weapon/hatchet/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
//If it's a hatchet it goes here. I guess
/obj/item/weapon/hatchet/unathiknife
name = "duelling knife"
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
icon = 'icons/obj/weapons.dmi'
icon_state = "unathiknife"
attack_verb = list("ripped", "torn", "cut")
/obj/item/weapon/hatchet/tacknife
name = "tactical knife"
desc = "You'd be killing loads of people if this was Medal of Valor: Heroes of Nyx."
icon = 'icons/obj/weapons.dmi'
icon_state = "tacknife"
item_state = "knife"
attack_verb = list("stabbed", "chopped", "cut")
/obj/item/weapon/scythe
icon_state = "scythe0"
name = "scythe"
desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow."
force = 13.0
throwforce = 5.0
throw_speed = 1
throw_range = 3
w_class = 4.0
flags = NOSHIELD
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity) return
if(istype(A, /obj/effect/plantsegment))
for(var/obj/effect/plantsegment/B in orange(A,1))
if(prob(80))
del B
del A

View File

@@ -0,0 +1,733 @@
/datum/plantgene
var/genetype // Label used when applying trait.
var/list/values // Values to copy into the target seed datum.
/datum/seed
//Tracking.
var/uid // Unique identifier.
var/name // Index for global list.
var/seed_name // Plant name for seed packet.
var/seed_noun = "seeds" // Descriptor for packet.
var/display_name // Prettier name.
var/roundstart // If set, seed will not display variety number.
var/mysterious // Only used for the random seed packets.
var/can_self_harvest = 0 // Mostly used for living mobs.
var/growth_stages = 0 // Number of stages the plant passes through before it is mature.
var/list/traits = list() // Initialized in New()
var/list/mutants // Possible predefined mutant varieties, if any.
var/list/chems // Chemicals that plant produces in products/injects into victim.
var/list/consume_gasses // The plant will absorb these gasses during its life.
var/list/exude_gasses // The plant will exude these gasses during its life.
var/kitchen_tag // Used by the reagent grinder.
var/trash_type // Garbage item produced when eaten.
var/splat_type = /obj/effect/decal/cleanable/fruit_smudge // Graffiti decal.
var/has_mob_product
/datum/seed/New()
set_trait(TRAIT_IMMUTABLE, 0) // If set, plant will never mutate. If -1, plant is highly mutable.
set_trait(TRAIT_HARVEST_REPEAT, 0) // If 1, this plant will fruit repeatedly.
set_trait(TRAIT_PRODUCES_POWER, 0) // Can be used to make a battery.
set_trait(TRAIT_JUICY, 0) // When thrown, causes a splatter decal.
set_trait(TRAIT_EXPLOSIVE, 0) // When thrown, acts as a grenade.
set_trait(TRAIT_CARNIVOROUS, 0) // 0 = none, 1 = eat pests in tray, 2 = eat living things (when a vine).
set_trait(TRAIT_PARASITE, 0) // 0 = no, 1 = gain health from weed level.
set_trait(TRAIT_STINGS, 0) // Can cause damage/inject reagents when thrown or handled.
set_trait(TRAIT_YIELD, 0) // Amount of product.
set_trait(TRAIT_SPREAD, 0) // 0 limits plant to tray, 1 = creepers, 2 = vines.
set_trait(TRAIT_MATURATION, 0) // Time taken before the plant is mature.
set_trait(TRAIT_PRODUCTION, 0) // Time before harvesting can be undertaken again.
set_trait(TRAIT_TELEPORTING, 0) // Uses the bluespace tomato effect.
set_trait(TRAIT_BIOLUM, 0) // Plant is bioluminescent.
set_trait(TRAIT_ALTER_TEMP, 0) // If set, the plant will periodically alter local temp by this amount.
set_trait(TRAIT_PRODUCT_ICON, 0) // Icon to use for fruit coming from this plant.
set_trait(TRAIT_PLANT_ICON, 0) // Icon to use for the plant growing in the tray.
set_trait(TRAIT_PRODUCT_COLOUR, 0) // Colour to apply to product icon.
set_trait(TRAIT_BIOLUM_COLOUR, 0) // The colour of the plant's radiance.
set_trait(TRAIT_POTENCY, 1) // General purpose plant strength value.
set_trait(TRAIT_REQUIRES_NUTRIENTS, 1) // The plant can starve.
set_trait(TRAIT_REQUIRES_WATER, 1) // The plant can become dehydrated.
set_trait(TRAIT_WATER_CONSUMPTION, 3) // Plant drinks this much per tick.
set_trait(TRAIT_LIGHT_TOLERANCE, 5) // Departure from ideal that is survivable.
set_trait(TRAIT_TOXINS_TOLERANCE, 5) // Resistance to poison.
set_trait(TRAIT_PEST_TOLERANCE, 5) // Threshold for pests to impact health.
set_trait(TRAIT_WEED_TOLERANCE, 5) // Threshold for weeds to impact health.
set_trait(TRAIT_IDEAL_LIGHT, 8) // Preferred light level in luminosity.
set_trait(TRAIT_HEAT_TOLERANCE, 20) // Departure from ideal that is survivable.
set_trait(TRAIT_LOWKPA_TOLERANCE, 25) // Low pressure capacity.
set_trait(TRAIT_ENDURANCE, 100) // Maximum plant HP when growing.
set_trait(TRAIT_HIGHKPA_TOLERANCE, 200) // High pressure capacity.
set_trait(TRAIT_IDEAL_HEAT, 293) // Preferred temperature in Kelvin.
set_trait(TRAIT_NUTRIENT_CONSUMPTION, 0.25) // Plant eats this much per tick.
set_trait(TRAIT_PLANT_COLOUR, "#6EF86A") // Colour of the plant icon.
spawn(5)
sleep(-1)
update_growth_stages()
/datum/seed/proc/get_trait(var/trait)
return traits["[trait]"]
/datum/seed/proc/set_trait(var/trait,var/nval,var/ubound,var/lbound, var/degrade)
if(!isnull(degrade)) nval *= degrade
if(!isnull(ubound)) nval = min(nval,ubound)
if(!isnull(lbound)) nval = max(nval,lbound)
traits["[trait]"] = nval
/datum/seed/proc/create_spores(var/turf/T)
if(!T)
return
if(!istype(T))
T = get_turf(T)
if(!T)
return
var/datum/reagents/R = new/datum/reagents(100)
if(chems.len)
for(var/rid in chems)
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/3))
R.add_reagent(rid,injecting)
var/datum/effect/effect/system/smoke_spread/chem/spores/S = new(name)
S.attach(T)
S.set_up(R, round(get_trait(TRAIT_POTENCY)/4), 0, T)
S.start()
// Does brute damage to a target.
/datum/seed/proc/do_thorns(var/mob/living/carbon/human/target, var/obj/item/fruit, var/target_limb)
if(!get_trait(TRAIT_CARNIVOROUS))
return
if(!istype(target))
if(istype(target, /mob/living/simple_animal/mouse))
new /obj/effect/decal/remains/mouse(get_turf(target))
del(target)
else if(istype(target, /mob/living/simple_animal/lizard))
new /obj/effect/decal/remains/lizard(get_turf(target))
del(target)
return
if(!target_limb) target_limb = pick("l_foot","r_foot","l_leg","r_leg","l_hand","r_hand","l_arm", "r_arm","head","chest","groin")
var/datum/organ/external/affecting = target.get_organ(target_limb)
var/damage = 0
if(get_trait(TRAIT_CARNIVOROUS))
if(get_trait(TRAIT_CARNIVOROUS) == 2)
if(affecting)
target << "<span class='danger'>\The [fruit]'s thorns pierce your [affecting.display_name] greedily!</span>"
else
target << "<span class='danger'>\The [fruit]'s thorns pierce your flesh greedily!</span>"
damage = get_trait(TRAIT_POTENCY)/2
else
if(affecting)
target << "<span class='danger'>\The [fruit]'s thorns dig deeply into your [affecting.display_name]!</span>"
else
target << "<span class='danger'>\The [fruit]'s thorns dig deeply into your flesh!</span>"
damage = get_trait(TRAIT_POTENCY)/5
else
return
if(affecting)
affecting.take_damage(damage, 0)
affecting.add_autopsy_data("Thorns",damage)
else
target.adjustBruteLoss(damage)
target.UpdateDamageIcon()
target.updatehealth()
// Adds reagents to a target.
/datum/seed/proc/do_sting(var/mob/living/carbon/human/target, var/obj/item/fruit)
if(!get_trait(TRAIT_STINGS))
return
if(chems && chems.len)
target << "<span class='danger'>You are stung by \the [fruit]!</span>"
for(var/rid in chems)
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/5))
target.reagents.add_reagent(rid,injecting)
//Splatter a turf.
/datum/seed/proc/splatter(var/turf/T,var/obj/item/thrown)
if(splat_type)
var/obj/effect/plant/splat = new splat_type(T, src)
if(!istype(splat)) // Plants handle their own stuff.
splat.name = "[thrown.name] [pick("smear","smudge","splatter")]"
if(get_trait(TRAIT_BIOLUM))
if(get_trait(TRAIT_BIOLUM_COLOUR))
splat.l_color = get_trait(TRAIT_BIOLUM_COLOUR)
splat.SetLuminosity(get_trait(TRAIT_BIOLUM))
if(get_trait(TRAIT_PRODUCT_COLOUR))
splat.color = get_trait(TRAIT_PRODUCT_COLOUR)
if(chems)
for(var/mob/living/M in T.contents)
if(!M.reagents)
continue
for(var/chem in chems)
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/3))
M.reagents.add_reagent(chem,injecting)
//Applies an effect to a target atom.
/datum/seed/proc/thrown_at(var/obj/item/thrown,var/atom/target, var/force_explode)
var/splatted
var/turf/origin_turf = get_turf(target)
if(force_explode || get_trait(TRAIT_EXPLOSIVE))
create_spores(origin_turf)
var/flood_dist = min(10,max(1,get_trait(TRAIT_POTENCY)/15))
var/list/open_turfs = list()
var/list/closed_turfs = list()
var/list/valid_turfs = list()
open_turfs |= origin_turf
// Flood fill to get affected turfs.
while(open_turfs.len)
var/turf/T = pick(open_turfs)
open_turfs -= T
closed_turfs |= T
valid_turfs |= T
for(var/dir in alldirs)
var/turf/neighbor = get_step(T,dir)
if(!neighbor || (neighbor in closed_turfs) || (neighbor in open_turfs))
continue
if(neighbor.density || get_dist(neighbor,origin_turf) > flood_dist || istype(neighbor,/turf/space))
closed_turfs |= neighbor
continue
// Check for windows.
var/no_los
var/turf/last_turf = origin_turf
for(var/turf/target_turf in getline(origin_turf,neighbor))
if(!last_turf.Enter(target_turf) || target_turf.density)
no_los = 1
break
last_turf = target_turf
if(!no_los && !origin_turf.Enter(neighbor))
no_los = 1
if(no_los)
closed_turfs |= neighbor
continue
open_turfs |= neighbor
for(var/turf/T in valid_turfs)
for(var/mob/living/M in T.contents)
apply_special_effect(M)
splatter(T,thrown)
origin_turf.visible_message("<span class='danger'>The [thrown.name] explodes!</span>")
del(thrown)
return
if(istype(target,/mob/living))
splatted = apply_special_effect(target,thrown)
else if(istype(target,/turf))
splatted = 1
for(var/mob/living/M in target.contents)
apply_special_effect(M)
if(get_trait(TRAIT_JUICY) && splatted)
splatter(origin_turf,thrown)
origin_turf.visible_message("<span class='danger'>The [thrown.name] splatters against [target]!</span>")
del(thrown)
/datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/check_only)
var/health_change = 0
// Handle gas consumption.
if(consume_gasses && consume_gasses.len)
var/missing_gas = 0
for(var/gas in consume_gasses)
if(environment && environment.gas && environment.gas[gas] && \
environment.gas[gas] >= consume_gasses[gas])
if(!check_only)
environment.adjust_gas(gas,-consume_gasses[gas],1)
else
missing_gas++
if(missing_gas > 0)
health_change += missing_gas * HYDRO_SPEED_MULTIPLIER
// Process it.
var/pressure = environment.return_pressure()
if(pressure < get_trait(TRAIT_LOWKPA_TOLERANCE)|| pressure > get_trait(TRAIT_HIGHKPA_TOLERANCE))
health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER
if(abs(environment.temperature - get_trait(TRAIT_IDEAL_HEAT)) > get_trait(TRAIT_HEAT_TOLERANCE))
health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER
// Handle gas production.
if(exude_gasses && exude_gasses.len && !check_only)
for(var/gas in exude_gasses)
environment.adjust_gas(gas, max(1,round((exude_gasses[gas]*(get_trait(TRAIT_POTENCY)/5))/exude_gasses.len)))
// Handle light requirements.
if(!light_supplied)
var/area/A = get_area(current_turf)
if(A)
if(A.lighting_use_dynamic)
light_supplied = max(0,min(10,current_turf.lighting_lumcount)-5)
else
light_supplied = 5
if(light_supplied)
if(abs(light_supplied - get_trait(TRAIT_IDEAL_LIGHT)) > get_trait(TRAIT_LIGHT_TOLERANCE))
health_change += rand(1,3) * HYDRO_SPEED_MULTIPLIER
return health_change
/datum/seed/proc/apply_special_effect(var/mob/living/target,var/obj/item/thrown)
var/impact = 1
do_sting(target,thrown)
do_thorns(target,thrown)
// Bluespace tomato code copied over from grown.dm.
if(get_trait(TRAIT_TELEPORTING))
//Plant potency determines radius of teleport.
var/outer_teleport_radius = get_trait(TRAIT_POTENCY)/5
var/inner_teleport_radius = get_trait(TRAIT_POTENCY)/15
var/list/turfs = list()
if(inner_teleport_radius > 0)
for(var/turf/T in orange(target,outer_teleport_radius))
if(get_dist(target,T) >= inner_teleport_radius)
turfs |= T
if(turfs.len)
// Moves the mob, causes sparks.
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, get_turf(target))
s.start()
var/turf/picked = get_turf(pick(turfs)) // Just in case...
new/obj/effect/decal/cleanable/molten_item(get_turf(target)) // Leave a pile of goo behind for dramatic effect...
target.loc = picked // And teleport them to the chosen location.
impact = 1
return impact
//Creates a random seed. MAKE SURE THE LINE HAS DIVERGED BEFORE THIS IS CALLED.
/datum/seed/proc/randomize()
roundstart = 0
seed_name = "strange plant" // TODO: name generator.
display_name = "strange plants" // TODO: name generator.
mysterious = 1
seed_noun = pick("spores","nodes","cuttings","seeds")
set_trait(TRAIT_POTENCY,rand(5,30),200,0)
set_trait(TRAIT_PRODUCT_ICON,pick(plant_controller.plant_product_sprites))
set_trait(TRAIT_PLANT_ICON,pick(plant_controller.plant_sprites))
set_trait(TRAIT_PLANT_COLOUR,"#[get_random_colour(0,75,190)]")
set_trait(TRAIT_PRODUCT_COLOUR,"#[get_random_colour(0,75,190)]")
update_growth_stages()
if(prob(20))
set_trait(TRAIT_HARVEST_REPEAT,1)
if(prob(15))
if(prob(15))
set_trait(TRAIT_JUICY,2)
else
set_trait(TRAIT_JUICY,1)
if(prob(5))
set_trait(TRAIT_STINGS,1)
if(prob(5))
set_trait(TRAIT_PRODUCES_POWER,1)
if(prob(1))
set_trait(TRAIT_EXPLOSIVE,1)
else if(prob(1))
set_trait(TRAIT_TELEPORTING,1)
if(prob(5))
consume_gasses = list()
var/gas = pick("oxygen","nitrogen","phoron","carbon_dioxide")
consume_gasses[gas] = rand(3,9)
if(prob(5))
exude_gasses = list()
var/gas = pick("oxygen","nitrogen","phoron","carbon_dioxide")
exude_gasses[gas] = rand(3,9)
chems = list()
if(prob(80))
chems["nutriment"] = list(rand(1,10),rand(10,20))
var/additional_chems = rand(0,5)
if(additional_chems)
var/list/possible_chems = list(
"woodpulp",
"bicaridine",
"hyperzine",
"cryoxadone",
"blood",
"water",
"potassium",
"plasticide",
"mutationtoxin",
"amutationtoxin",
"inaprovaline",
"space_drugs",
"paroxetine",
"mercury",
"sugar",
"radium",
"ryetalyn",
"alkysine",
"thermite",
"tramadol",
"cryptobiolin",
"dermaline",
"dexalin",
"phoron",
"synaptizine",
"impedrezene",
"hyronalin",
"peridaxon",
"toxin",
"rezadone",
"ethylredoxrazine",
"slimejelly",
"cyanide",
"mindbreaker",
"stoxin"
)
for(var/x=1;x<=additional_chems;x++)
if(!possible_chems.len)
break
var/new_chem = pick(possible_chems)
possible_chems -= new_chem
chems[new_chem] = list(rand(1,10),rand(10,20))
if(prob(90))
set_trait(TRAIT_REQUIRES_NUTRIENTS,1)
set_trait(TRAIT_NUTRIENT_CONSUMPTION,rand(25)/25)
else
set_trait(TRAIT_REQUIRES_NUTRIENTS,0)
if(prob(90))
set_trait(TRAIT_REQUIRES_WATER,1)
set_trait(TRAIT_WATER_CONSUMPTION,rand(10))
else
set_trait(TRAIT_REQUIRES_WATER,0)
set_trait(TRAIT_IDEAL_HEAT, rand(100,400))
set_trait(TRAIT_HEAT_TOLERANCE, rand(10,30))
set_trait(TRAIT_IDEAL_LIGHT, rand(2,10))
set_trait(TRAIT_LIGHT_TOLERANCE, rand(2,7))
set_trait(TRAIT_TOXINS_TOLERANCE, rand(2,7))
set_trait(TRAIT_PEST_TOLERANCE, rand(2,7))
set_trait(TRAIT_WEED_TOLERANCE, rand(2,7))
set_trait(TRAIT_LOWKPA_TOLERANCE, rand(10,50))
set_trait(TRAIT_HIGHKPA_TOLERANCE,rand(100,300))
if(prob(5))
set_trait(TRAIT_ALTER_TEMP,rand(-5,5))
if(prob(1))
set_trait(TRAIT_IMMUTABLE,-1)
var/carnivore_prob = rand(100)
if(carnivore_prob < 5)
set_trait(TRAIT_CARNIVOROUS,2)
else if(carnivore_prob < 10)
set_trait(TRAIT_CARNIVOROUS,1)
if(prob(10))
set_trait(TRAIT_PARASITE,1)
var/vine_prob = rand(100)
if(vine_prob < 5)
set_trait(TRAIT_SPREAD,2)
else if(vine_prob < 10)
set_trait(TRAIT_SPREAD,1)
if(prob(5))
set_trait(TRAIT_BIOLUM,1)
set_trait(TRAIT_BIOLUM_COLOUR,"#[get_random_colour(0,75,190)]")
set_trait(TRAIT_ENDURANCE,rand(60,100))
set_trait(TRAIT_YIELD,rand(3,15))
set_trait(TRAIT_MATURATION,rand(5,15))
set_trait(TRAIT_PRODUCTION,get_trait(TRAIT_MATURATION)+rand(2,5))
//Returns a key corresponding to an entry in the global seed list.
/datum/seed/proc/get_mutant_variant()
if(!mutants || !mutants.len || get_trait(TRAIT_IMMUTABLE) > 0) return 0
return pick(mutants)
//Mutates the plant overall (randomly).
/datum/seed/proc/mutate(var/degree,var/turf/source_turf)
if(!degree || get_trait(TRAIT_IMMUTABLE) > 0) return
source_turf.visible_message("<span class='notice'>\The [display_name] quivers!</span>")
//This looks like shit, but it's a lot easier to read/change this way.
var/total_mutations = rand(1,1+degree)
for(var/i = 0;i<total_mutations;i++)
switch(rand(0,11))
if(0) //Plant cancer!
set_trait(TRAIT_ENDURANCE,get_trait(TRAIT_ENDURANCE)-rand(10,20),null,0)
source_turf.visible_message("<span class='danger'>\The [display_name] withers rapidly!</span>")
if(1)
set_trait(TRAIT_NUTRIENT_CONSUMPTION,get_trait(TRAIT_NUTRIENT_CONSUMPTION)+rand(-(degree*0.1),(degree*0.1)),5,0)
set_trait(TRAIT_WATER_CONSUMPTION, get_trait(TRAIT_WATER_CONSUMPTION) +rand(-degree,degree),50,0)
set_trait(TRAIT_JUICY, !get_trait(TRAIT_JUICY))
set_trait(TRAIT_STINGS, !get_trait(TRAIT_STINGS))
if(2)
set_trait(TRAIT_IDEAL_HEAT, get_trait(TRAIT_IDEAL_HEAT) + (rand(-5,5)*degree),800,70)
set_trait(TRAIT_HEAT_TOLERANCE, get_trait(TRAIT_HEAT_TOLERANCE) + (rand(-5,5)*degree),800,70)
set_trait(TRAIT_LOWKPA_TOLERANCE, get_trait(TRAIT_LOWKPA_TOLERANCE)+ (rand(-5,5)*degree),80,0)
set_trait(TRAIT_HIGHKPA_TOLERANCE, get_trait(TRAIT_HIGHKPA_TOLERANCE)+(rand(-5,5)*degree),500,110)
set_trait(TRAIT_EXPLOSIVE,1)
if(3)
set_trait(TRAIT_IDEAL_LIGHT, get_trait(TRAIT_IDEAL_LIGHT)+(rand(-1,1)*degree),30,0)
set_trait(TRAIT_LIGHT_TOLERANCE, get_trait(TRAIT_LIGHT_TOLERANCE)+(rand(-2,2)*degree),10,0)
if(4)
set_trait(TRAIT_TOXINS_TOLERANCE, get_trait(TRAIT_TOXINS_TOLERANCE)+(rand(-2,2)*degree),10,0)
if(5)
set_trait(TRAIT_WEED_TOLERANCE, get_trait(TRAIT_WEED_TOLERANCE)+(rand(-2,2)*degree),10, 0)
if(prob(degree*5))
set_trait(TRAIT_CARNIVOROUS, get_trait(TRAIT_CARNIVOROUS)+rand(-degree,degree),2, 0)
if(get_trait(TRAIT_CARNIVOROUS))
source_turf.visible_message("<span class='notice'>\The [display_name] shudders hungrily.</span>")
if(6)
set_trait(TRAIT_WEED_TOLERANCE, get_trait(TRAIT_WEED_TOLERANCE)+(rand(-2,2)*degree),10, 0)
if(prob(degree*5))
set_trait(TRAIT_PARASITE,!get_trait(TRAIT_PARASITE))
if(7)
if(get_trait(TRAIT_YIELD) != -1)
set_trait(TRAIT_YIELD, get_trait(TRAIT_YIELD)+(rand(-2,2)*degree),10,0)
if(8)
set_trait(TRAIT_ENDURANCE, get_trait(TRAIT_ENDURANCE)+(rand(-5,5)*degree),100,10)
set_trait(TRAIT_PRODUCTION, get_trait(TRAIT_PRODUCTION)+(rand(-1,1)*degree),10, 1)
set_trait(TRAIT_POTENCY, get_trait(TRAIT_POTENCY)+(rand(-20,20)*degree),200, 0)
if(prob(degree*5))
set_trait(TRAIT_SPREAD, get_trait(TRAIT_SPREAD)+rand(-1,1),2, 0)
source_turf.visible_message("<span class='notice'>\The [display_name] spasms visibly, shifting in the tray.</span>")
if(9)
set_trait(TRAIT_MATURATION, get_trait(TRAIT_MATURATION)+(rand(-1,1)*degree),30, 0)
if(prob(degree*5))
set_trait(TRAIT_HARVEST_REPEAT, !get_trait(TRAIT_HARVEST_REPEAT))
if(10)
if(prob(degree*2))
set_trait(TRAIT_BIOLUM, !get_trait(TRAIT_BIOLUM))
if(get_trait(TRAIT_BIOLUM))
source_turf.visible_message("<span class='notice'>\The [display_name] begins to glow!</span>")
if(prob(degree*2))
set_trait(TRAIT_BIOLUM_COLOUR,"#[get_random_colour(0,75,190)]")
source_turf.visible_message("<span class='notice'>\The [display_name]'s glow </span><font color='[get_trait(TRAIT_BIOLUM_COLOUR)]'>changes colour</font>!")
else
source_turf.visible_message("<span class='notice'>\The [display_name]'s glow dims...</span>")
if(11)
set_trait(TRAIT_TELEPORTING,1)
return
//Mutates a specific trait/set of traits.
/datum/seed/proc/apply_gene(var/datum/plantgene/gene)
if(!gene || !gene.values || get_trait(TRAIT_IMMUTABLE) > 0) return
// Splicing products has some detrimental effects on yield and lifespan.
// We handle this before we do the rest of the looping, as normal traits don't really include lists.
switch(gene.genetype)
if(GENE_BIOCHEMISTRY)
for(var/trait in list(TRAIT_YIELD, TRAIT_ENDURANCE))
if(get_trait(trait) > 0) set_trait(trait,get_trait(trait),null,1,0.85)
if(!chems) chems = list()
var/list/gene_value = gene.values["[TRAIT_CHEMS]"]
for(var/rid in gene_value)
var/list/gene_chem = gene_value[rid]
if(!chems[rid])
chems[rid] = gene_chem.Copy()
continue
for(var/i=1;i<=gene_chem.len;i++)
if(isnull(gene_chem[i])) gene_chem[i] = 0
if(chems[rid][i])
chems[rid][i] = max(1,round((gene_chem[i] + chems[rid][i])/2))
else
chems[rid][i] = gene_chem[i]
var/list/new_gasses = gene.values["[TRAIT_EXUDE_GASSES]"]
if(islist(new_gasses))
if(!exude_gasses) exude_gasses = list()
exude_gasses |= new_gasses
for(var/gas in exude_gasses)
exude_gasses[gas] = max(1,round(exude_gasses[gas]*0.8))
gene.values["[TRAIT_EXUDE_GASSES]"] = null
gene.values["[TRAIT_CHEMS]"] = null
if(GENE_DIET)
var/list/new_gasses = gene.values["[TRAIT_CONSUME_GASSES]"]
consume_gasses |= new_gasses
gene.values["[TRAIT_CONSUME_GASSES]"] = null
if(GENE_METABOLISM)
has_mob_product = gene.values["mob_product"]
gene.values["mob_product"] = null
for(var/trait in gene.values)
set_trait(trait,gene.values["[trait]"])
update_growth_stages()
//Returns a list of the desired trait values.
/datum/seed/proc/get_gene(var/genetype)
if(!genetype) return 0
var/list/traits_to_copy
var/datum/plantgene/P = new()
P.genetype = genetype
P.values = list()
switch(genetype)
if(GENE_BIOCHEMISTRY)
P.values["[TRAIT_CHEMS]"] = chems
P.values["[TRAIT_EXUDE_GASSES]"] = exude_gasses
traits_to_copy = list(TRAIT_POTENCY)
if(GENE_OUTPUT)
traits_to_copy = list(TRAIT_PRODUCES_POWER,TRAIT_BIOLUM)
if(GENE_ATMOSPHERE)
traits_to_copy = list(TRAIT_HEAT_TOLERANCE,TRAIT_LOWKPA_TOLERANCE,TRAIT_HIGHKPA_TOLERANCE)
if(GENE_HARDINESS)
traits_to_copy = list(TRAIT_TOXINS_TOLERANCE,TRAIT_PEST_TOLERANCE,TRAIT_WEED_TOLERANCE,TRAIT_ENDURANCE)
if(GENE_METABOLISM)
P.values["mob_product"] = has_mob_product
traits_to_copy = list(TRAIT_REQUIRES_NUTRIENTS,TRAIT_REQUIRES_WATER,TRAIT_ALTER_TEMP)
if(GENE_VIGOUR)
traits_to_copy = list(TRAIT_PRODUCTION,TRAIT_MATURATION,TRAIT_YIELD,TRAIT_SPREAD)
if(GENE_DIET)
P.values["[TRAIT_CONSUME_GASSES]"] = consume_gasses
traits_to_copy = list(TRAIT_CARNIVOROUS,TRAIT_PARASITE,TRAIT_NUTRIENT_CONSUMPTION,TRAIT_WATER_CONSUMPTION)
if(GENE_ENVIRONMENT)
traits_to_copy = list(TRAIT_IDEAL_HEAT,TRAIT_IDEAL_LIGHT,TRAIT_LIGHT_TOLERANCE)
if(GENE_PIGMENT)
traits_to_copy = list(TRAIT_PLANT_COLOUR,TRAIT_PRODUCT_COLOUR,TRAIT_BIOLUM_COLOUR)
if(GENE_STRUCTURE)
traits_to_copy = list(TRAIT_PLANT_ICON,TRAIT_PRODUCT_ICON,TRAIT_HARVEST_REPEAT)
if(GENE_FRUIT)
traits_to_copy = list(TRAIT_STINGS,TRAIT_EXPLOSIVE,TRAIT_JUICY)
if(GENE_SPECIAL)
traits_to_copy = list(TRAIT_TELEPORTING)
for(var/trait in traits_to_copy)
P.values["[trait]"] = get_trait(trait)
return (P ? P : 0)
//Place the plant products at the feet of the user.
/datum/seed/proc/harvest(var/mob/user,var/yield_mod,var/harvest_sample,var/force_amount)
if(!user)
return
if(!force_amount && get_trait(TRAIT_YIELD) == 0 && !harvest_sample)
if(istype(user)) user << "<span class='danger'>You fail to harvest anything useful.</span>"
else
if(istype(user)) user << "You [harvest_sample ? "take a sample" : "harvest"] from the [display_name]."
//This may be a new line. Update the global if it is.
if(name == "new line" || !(name in plant_controller.seeds))
uid = plant_controller.seeds.len + 1
name = "[uid]"
plant_controller.seeds[name] = src
if(harvest_sample)
var/obj/item/seeds/seeds = new(get_turf(user))
seeds.seed_type = name
seeds.update_seed()
return
var/total_yield = 0
if(!isnull(force_amount))
total_yield = force_amount
else
if(get_trait(TRAIT_YIELD) > -1)
if(isnull(yield_mod) || yield_mod < 1)
yield_mod = 0
total_yield = get_trait(TRAIT_YIELD)
else
total_yield = get_trait(TRAIT_YIELD) + rand(yield_mod)
total_yield = max(1,total_yield)
currently_querying = list()
for(var/i = 0;i<total_yield;i++)
var/obj/item/product
if(has_mob_product)
product = new has_mob_product(get_turf(user),name)
else
product = new /obj/item/weapon/reagent_containers/food/snacks/grown(get_turf(user),name)
if(get_trait(TRAIT_PRODUCT_COLOUR))
product.color = get_trait(TRAIT_PRODUCT_COLOUR)
if(istype(product,/obj/item/weapon/reagent_containers/food))
var/obj/item/weapon/reagent_containers/food/food = product
food.filling_color = get_trait(TRAIT_PRODUCT_COLOUR)
if(mysterious)
product.name += "?"
product.desc += " On second thought, something about this one looks strange."
if(get_trait(TRAIT_BIOLUM))
if(get_trait(TRAIT_BIOLUM_COLOUR))
product.l_color = get_trait(TRAIT_BIOLUM_COLOUR)
product.SetLuminosity(get_trait(TRAIT_BIOLUM))
//Handle spawning in living, mobile products (like dionaea).
if(istype(product,/mob/living))
product.visible_message("<span class='notice'>The pod disgorges [product]!</span>")
handle_living_product(product)
if(istype(product,/mob/living/simple_animal/mushroom)) // Gross.
var/mob/living/simple_animal/mushroom/mush = product
mush.seed = src
// When the seed in this machine mutates/is modified, the tray seed value
// is set to a new datum copied from the original. This datum won't actually
// be put into the global datum list until the product is harvested, though.
/datum/seed/proc/diverge(var/modified)
if(get_trait(TRAIT_IMMUTABLE) > 0) return
//Set up some basic information.
var/datum/seed/new_seed = new
new_seed.name = "new line"
new_seed.uid = 0
new_seed.roundstart = 0
new_seed.can_self_harvest = can_self_harvest
new_seed.kitchen_tag = kitchen_tag
new_seed.trash_type = trash_type
new_seed.has_mob_product = has_mob_product
//Copy over everything else.
if(mutants) new_seed.mutants = mutants.Copy()
if(chems) new_seed.chems = chems.Copy()
if(consume_gasses) new_seed.consume_gasses = consume_gasses.Copy()
if(exude_gasses) new_seed.exude_gasses = exude_gasses.Copy()
new_seed.seed_name = "[(roundstart ? "[(modified ? "modified" : "mutant")] " : "")][seed_name]"
new_seed.display_name = "[(roundstart ? "[(modified ? "modified" : "mutant")] " : "")][display_name]"
new_seed.seed_noun = seed_noun
new_seed.traits = traits.Copy()
new_seed.update_growth_stages()
return new_seed
/datum/seed/proc/update_growth_stages()
if(get_trait(TRAIT_PLANT_ICON))
growth_stages = plant_controller.plant_sprites[get_trait(TRAIT_PLANT_ICON)]
else
growth_stages = 0

View File

@@ -0,0 +1,148 @@
// Attempts to offload processing for the spreading plants from the MC.
// Processes vines/spreading plants.
#define PLANTS_PER_TICK 500 // Cap on number of plant segments processed.
#define PLANT_TICK_TIME 25 // Number of ticks between the plant processor cycling.
// Debug for testing seed genes.
/client/proc/show_plant_genes()
set category = "Debug"
set name = "Show Plant Genes"
set desc = "Prints the round's plant gene masks."
if(!holder) return
if(!plant_controller || !plant_controller.gene_tag_masks)
usr << "Gene masks not set."
return
for(var/mask in plant_controller.gene_tag_masks)
usr << "[mask]: [plant_controller.gene_tag_masks[mask]]"
var/global/datum/controller/plants/plant_controller // Set in New().
/datum/controller/plants
var/plants_per_tick = PLANTS_PER_TICK
var/plant_tick_time = PLANT_TICK_TIME
var/list/product_descs = list() // Stores generated fruit descs.
var/list/plant_queue = list() // All queued plants.
var/list/seeds = list() // All seed data stored here.
var/list/gene_tag_masks = list() // Gene obfuscation for delicious trial and error goodness.
var/list/plant_icon_cache = list() // Stores images of growth, fruits and seeds.
var/list/plant_sprites = list() // List of all harvested product sprites.
var/list/plant_product_sprites = list() // List of all growth sprites plus number of growth stages.
var/processing = 0 // Off/on.
/datum/controller/plants/New()
if(plant_controller && plant_controller != src)
log_debug("Rebuilding plant controller.")
del(plant_controller)
plant_controller = src
setup()
process()
// Predefined/roundstart varieties use a string key to make it
// easier to grab the new variety when mutating. Post-roundstart
// and mutant varieties use their uid converted to a string instead.
// Looks like shit but it's sort of necessary.
/datum/controller/plants/proc/setup()
// Build the icon lists.
for(var/icostate in icon_states('icons/obj/hydroponics_growing.dmi'))
var/split = findtext(icostate,"-")
if(!split)
// invalid icon_state
continue
var/ikey = copytext(icostate,(split+1))
if(ikey == "dead")
// don't count dead icons
continue
ikey = text2num(ikey)
var/base = copytext(icostate,1,split)
if(!(plant_sprites[base]) || (plant_sprites[base]<ikey))
plant_sprites[base] = ikey
for(var/icostate in icon_states('icons/obj/hydroponics_products.dmi'))
plant_product_sprites |= icostate
// Populate the global seed datum list.
for(var/type in typesof(/datum/seed)-/datum/seed)
var/datum/seed/S = new type
seeds[S.name] = S
S.uid = "[seeds.len]"
S.roundstart = 1
// Make sure any seed packets that were mapped in are updated
// correctly (since the seed datums did not exist a tick ago).
for(var/obj/item/seeds/S in world)
S.update_seed()
//Might as well mask the gene types while we're at it.
var/list/used_masks = list()
var/list/plant_traits = ALL_GENES
while(plant_traits && plant_traits.len)
var/gene_tag = pick(plant_traits)
var/gene_mask = "[uppertext(num2hex(rand(0,255)))]"
while(gene_mask in used_masks)
gene_mask = "[uppertext(num2hex(rand(0,255)))]"
used_masks += gene_mask
plant_traits -= gene_tag
gene_tag_masks[gene_tag] = gene_mask
// Proc for creating a random seed type.
/datum/controller/plants/proc/create_random_seed(var/survive_on_station)
var/datum/seed/seed = new()
seed.randomize()
seed.uid = plant_controller.seeds.len + 1
seed.name = "[seed.uid]"
seeds[seed.name] = seed
if(survive_on_station)
if(seed.consume_gasses)
seed.consume_gasses["phoron"] = null
seed.consume_gasses["carbon_dioxide"] = null
if(seed.chems && !isnull(seed.chems["pacid"]))
seed.chems["pacid"] = null // Eating through the hull will make these plants completely inviable, albeit very dangerous.
seed.chems -= null // Setting to null does not actually remove the entry, which is weird.
seed.set_trait(TRAIT_IDEAL_HEAT,293)
seed.set_trait(TRAIT_HEAT_TOLERANCE,20)
seed.set_trait(TRAIT_IDEAL_LIGHT,8)
seed.set_trait(TRAIT_LIGHT_TOLERANCE,5)
seed.set_trait(TRAIT_LOWKPA_TOLERANCE,25)
seed.set_trait(TRAIT_HIGHKPA_TOLERANCE,200)
return seed
/datum/controller/plants/proc/process()
processing = 1
spawn(0)
set background = 1
var/processed = 0
while(1)
if(!processing)
sleep(plant_tick_time)
else
processed = 0
if(plant_queue.len)
var/target_to_process = min(plant_queue.len,plants_per_tick)
for(var/x=0;x<target_to_process;x++)
if(!plant_queue.len)
break
var/obj/effect/plant/plant = pick(plant_queue)
plant_queue -= plant
if(!istype(plant))
continue
plant.process()
processed++
sleep(1) // Stagger processing out so previous tick can resolve (overlapping plant segments etc)
sleep(max(1,(plant_tick_time-processed)))
/datum/controller/plants/proc/add_plant(var/obj/effect/plant/plant)
plant_queue |= plant
/datum/controller/plants/proc/remove_plant(var/obj/effect/plant/plant)
plant_queue -= plant

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/obj/item/weapon/disk/botany
name = "flora data disk"
desc = "A small disk used for carrying data on plant genetics."
icon = 'icons/obj/hydroponics.dmi'
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "disk"
w_class = 1.0
@@ -16,7 +16,7 @@
/obj/item/weapon/disk/botany/attack_self(var/mob/user as mob)
if(genes.len)
var/choice = alert(user, "Are you sure you want to wipe the disk?", "Xenobotany Data", "No", "Yes")
if(src && user && genes && choice == "Yes")
if(src && user && genes && choice && choice == "Yes" && user.Adjacent(get_turf(src)))
user << "You wipe the disk data."
name = initial(name)
desc = initial(name)
@@ -33,7 +33,7 @@
new /obj/item/weapon/disk/botany(src)
/obj/machinery/botany
icon = 'icons/obj/hydroponics.dmi'
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "hydrotray3"
density = 1
anchored = 1
@@ -44,7 +44,7 @@
var/open = 0
var/active = 0
var/action_time = 50
var/action_time = 5
var/last_action = 0
var/eject_disk = 0
var/failed_task = 0
@@ -85,7 +85,7 @@
user << "There is already a seed loaded."
return
var/obj/item/seeds/S =W
if(S.seed && S.seed.immutable > 0)
if(S.seed && S.seed.get_trait(TRAIT_IMMUTABLE) > 0)
user << "That seed is not compatible with our genetics technology."
else
user.drop_item(W)
@@ -96,7 +96,7 @@
if(istype(W,/obj/item/weapon/screwdriver))
open = !open
user << "\blue You [open ? "open" : "close"] the maintenance panel."
user << "<span class='notice'>You [open ? "open" : "close"] the maintenance panel.</span>"
return
if(open)
@@ -144,8 +144,8 @@
var/list/data = list()
var/list/geneMasks[0]
for(var/gene_tag in gene_tag_masks)
geneMasks.Add(list(list("tag" = gene_tag, "mask" = gene_tag_masks[gene_tag])))
for(var/gene_tag in plant_controller.gene_tag_masks)
geneMasks.Add(list(list("tag" = gene_tag, "mask" = plant_controller.gene_tag_masks[gene_tag])))
data["geneMasks"] = geneMasks
data["activity"] = active
@@ -186,10 +186,10 @@
if(!seed) return
seed.loc = get_turf(src)
if(seed.seed.name == "new line" || isnull(seed_types[seed.seed.name]))
seed.seed.uid = seed_types.len + 1
if(seed.seed.name == "new line" || isnull(plant_controller.seeds[seed.seed.name]))
seed.seed.uid = plant_controller.seeds.len + 1
seed.seed.name = "[seed.seed.uid]"
seed_types[seed.seed.name] = seed.seed
plant_controller.seeds[seed.seed.name] = seed.seed
seed.update_seed()
visible_message("\icon[src] [src] beeps and spits out [seed].")
@@ -242,8 +242,8 @@
if(!genetics.roundstart)
loaded_disk.genesource += " (variety #[genetics.uid])"
loaded_disk.name += " ([gene_tag_masks[href_list["get_gene"]]], #[genetics.uid])"
loaded_disk.desc += " The label reads \'gene [gene_tag_masks[href_list["get_gene"]]], sampled from [genetics.display_name]\'."
loaded_disk.name += " ([plant_controller.gene_tag_masks[href_list["get_gene"]]], #[genetics.uid])"
loaded_disk.desc += " The label reads \'gene [plant_controller.gene_tag_masks[href_list["get_gene"]]], sampled from [genetics.display_name]\'."
eject_disk = 1
degradation += rand(20,60)
@@ -288,7 +288,7 @@
for(var/datum/plantgene/P in loaded_disk.genes)
if(data["locus"] != "") data["locus"] += ", "
data["locus"] += "[gene_tag_masks[P.genetype]]"
data["locus"] += "[plant_controller.gene_tag_masks[P.genetype]]"
else
data["disk"] = 0
@@ -318,7 +318,7 @@
last_action = world.time
active = 1
if(!isnull(seed_types[seed.seed.name]))
if(!isnull(plant_controller.seeds[seed.seed.name]))
seed.seed = seed.seed.diverge(1)
seed.seed_type = seed.seed.name
seed.update_seed()

View File

@@ -1,5 +1,4 @@
/datum/seed
var/product_requires_player // If yes, product will ask for a player among the ghosts.
var/list/currently_querying // Used to avoid asking the same ghost repeatedly.
// The following procs are used to grab players for mobs produced by a seed (mostly for dionaea).
@@ -7,20 +6,21 @@
if(!host || !istype(host)) return
if(product_requires_player)
spawn(0)
request_player(host)
spawn(75)
if(!host.ckey && !host.client)
host.death() // This seems redundant, but a lot of mobs don't
host.stat = 2 // handle death() properly. Better safe than etc.
host.visible_message("\red <b>[host] is malformed and unable to survive. It expires pitifully, leaving behind some seeds.")
spawn(0)
request_player(host)
if(istype(host,/mob/living/simple_animal))
return
spawn(75)
if(!host.ckey && !host.client)
host.death() // This seems redundant, but a lot of mobs don't
host.stat = 2 // handle death() properly. Better safe than etc.
host.visible_message("<span class='danger'>[host] is malformed and unable to survive. It expires pitifully, leaving behind some seeds.</span>")
var/total_yield = rand(1,3)
for(var/j = 0;j<=total_yield;j++)
var/obj/item/seeds/S = new(get_turf(host))
S.seed_type = name
S.update_seed()
var/total_yield = rand(1,3)
for(var/j = 0;j<=total_yield;j++)
var/obj/item/seeds/S = new(get_turf(host))
S.seed_type = name
S.update_seed()
/datum/seed/proc/request_player(var/mob/living/host)
if(!host) return

View File

@@ -1,8 +1,10 @@
var/global/list/plant_seed_sprites = list()
//Seed packet object/procs.
/obj/item/seeds
name = "packet of seeds"
icon = 'icons/obj/seeds.dmi'
icon_state = "seed"
icon_state = "blank"
w_class = 2.0
var/seed_type
@@ -15,16 +17,45 @@
//Grabs the appropriate seed datum from the global list.
/obj/item/seeds/proc/update_seed()
if(!seed && seed_type && !isnull(seed_types) && seed_types[seed_type])
seed = seed_types[seed_type]
if(!seed && seed_type && !isnull(plant_controller.seeds) && plant_controller.seeds[seed_type])
seed = plant_controller.seeds[seed_type]
update_appearance()
//Updates strings and icon appropriately based on seed datum.
/obj/item/seeds/proc/update_appearance()
if(!seed) return
icon_state = seed.packet_icon
src.name = "packet of [seed.seed_name] [seed.seed_noun]"
src.desc = "It has a picture of [seed.display_name] on the front."
// Update icon.
overlays.Cut()
var/is_seeds = ((seed.seed_noun in list("seeds","pits","nodes")) ? 1 : 0)
var/image/seed_mask
var/seed_base_key = "base-[is_seeds ? seed.get_trait(TRAIT_PLANT_COLOUR) : "spores"]"
if(plant_seed_sprites[seed_base_key])
seed_mask = plant_seed_sprites[seed_base_key]
else
seed_mask = image('icons/obj/seeds.dmi',"[is_seeds ? "seed" : "spore"]-mask")
if(is_seeds) // Spore glass bits aren't coloured.
seed_mask.color = seed.get_trait(TRAIT_PLANT_COLOUR)
plant_seed_sprites[seed_base_key] = seed_mask
var/image/seed_overlay
var/seed_overlay_key = "[seed.get_trait(TRAIT_PRODUCT_ICON)]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"
if(plant_seed_sprites[seed_overlay_key])
seed_overlay = plant_seed_sprites[seed_overlay_key]
else
seed_overlay = image('icons/obj/seeds.dmi',"[seed.get_trait(TRAIT_PRODUCT_ICON)]")
seed_overlay.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
plant_seed_sprites[seed_overlay_key] = seed_overlay
overlays |= seed_mask
overlays |= seed_overlay
if(is_seeds)
src.name = "packet of [seed.seed_name] [seed.seed_noun]"
src.desc = "It has a picture of [seed.display_name] on the front."
else
src.name = "sample of [seed.seed_name] [seed.seed_noun]"
src.desc = "It's labelled as coming from [seed.display_name]."
/obj/item/seeds/examine(mob/user)
..(user)
@@ -43,13 +74,8 @@
seed_type = null
/obj/item/seeds/random/New()
seed = new()
seed.randomize()
seed.uid = seed_types.len + 1
seed.name = "[seed.uid]"
seed_types[seed.name] = seed
seed = plant_controller.create_random_seed()
seed_type = seed.name
update_seed()
/obj/item/seeds/replicapod
@@ -91,9 +117,6 @@
/obj/item/seeds/eggplantseed
seed_type = "eggplant"
/obj/item/seeds/eggyseed
seed_type = "realeggplant"
/obj/item/seeds/bloodtomatoseed
seed_type = "bloodtomato"
@@ -234,3 +257,24 @@
/obj/item/seeds/kudzuseed
seed_type = "kudzu"
/obj/item/seeds/jurlmah
seed_type = "jurlmah"
/obj/item/seeds/amauri
seed_type = "amauri"
/obj/item/seeds/gelthi
seed_type = "gelthi"
/obj/item/seeds/vale
seed_type = "vale"
/obj/item/seeds/surik
seed_type = "surik"
/obj/item/seeds/telriis
seed_type = "telriis"
/obj/item/seeds/thaadra
seed_type = "thaadra"

View File

@@ -34,7 +34,7 @@
/obj/machinery/seed_storage/random // This is mostly for testing, but I guess admins could spawn it
name = "Random seed storage"
scanner = list("stats", "produce", "soil", "temperature", "light", "mutants")
scanner = list("stats", "produce", "soil", "temperature", "light")
starting_seeds = list(/obj/item/seeds/random = 50)
/obj/machinery/seed_storage/garden
@@ -44,7 +44,7 @@
/obj/machinery/seed_storage/xenobotany
name = "Xenobotany seed storage"
scanner = list("stats", "produce", "soil", "temperature", "light", "mutants")
scanner = list("stats", "produce", "soil", "temperature", "light")
starting_seeds = list(/obj/item/seeds/ambrosiavulgarisseed = 3, /obj/item/seeds/appleseed = 3, /obj/item/seeds/amanitamycelium = 2, /obj/item/seeds/bananaseed = 3, /obj/item/seeds/berryseed = 3, /obj/item/seeds/cabbageseed = 3, /obj/item/seeds/carrotseed = 3, /obj/item/seeds/chantermycelium = 3, /obj/item/seeds/cherryseed = 3, /obj/item/seeds/chiliseed = 3, /obj/item/seeds/cocoapodseed = 3, /obj/item/seeds/cornseed = 3, /obj/item/seeds/replicapod = 3, /obj/item/seeds/eggplantseed = 3, /obj/item/seeds/glowshroom = 2, /obj/item/seeds/grapeseed = 3, /obj/item/seeds/grassseed = 3, /obj/item/seeds/lemonseed = 3, /obj/item/seeds/libertymycelium = 2, /obj/item/seeds/limeseed = 3, /obj/item/seeds/mtearseed = 2, /obj/item/seeds/nettleseed = 2, /obj/item/seeds/orangeseed = 3, /obj/item/seeds/peanutseed = 3, /obj/item/seeds/plastiseed = 3, /obj/item/seeds/plumpmycelium = 3, /obj/item/seeds/poppyseed = 3, /obj/item/seeds/potatoseed = 3, /obj/item/seeds/pumpkinseed = 3, /obj/item/seeds/reishimycelium = 2, /obj/item/seeds/riceseed = 3, /obj/item/seeds/soyaseed = 3, /obj/item/seeds/sugarcaneseed = 3, /obj/item/seeds/sunflowerseed = 3, /obj/item/seeds/shandseed = 2, /obj/item/seeds/tobaccoseed = 3, /obj/item/seeds/tomatoseed = 3, /obj/item/seeds/towermycelium = 3, /obj/item/seeds/watermelonseed = 3, /obj/item/seeds/wheatseed = 3, /obj/item/seeds/whitebeetseed = 3)
/obj/machinery/seed_storage/attack_hand(mob/user as mob)
@@ -69,12 +69,10 @@
if (piles.len == 0)
dat += "<font color='red'>No seeds</font>"
else
dat += "<table style='text-align:center;'><tr><td>Name</td>"
dat += "<table style='text-align:center;border-style:solid;border-width:1px;padding:4px'><tr><td>Name</td>"
dat += "<td>Variety</td>"
if ("stats" in scanner)
dat += "<td>E</td><td>Y</td><td>L</td><td>M</td><td>Pr</td><td>Pt</td><td>Harvest</td>"
if ("produce" in scanner)
dat += "<td>Produce</td>"
dat += "<td>E</td><td>Y</td><td>M</td><td>Pr</td><td>Pt</td><td>Harvest</td>"
if ("temperature" in scanner)
dat += "<td>Temp</td>"
if ("light" in scanner)
@@ -84,38 +82,35 @@
dat += "<td>Notes</td><td>Amount</td><td></td></tr>"
for (var/datum/seed_pile/S in piles)
var/datum/seed/seed = S.seed_type
if(!seed)
continue
dat += "<tr>"
dat += "<td>[S.name]</td>"
dat += "<td>[seed.seed_name]</td>"
dat += "<td>#[seed.uid]</td>"
if ("stats" in scanner)
dat += "<td>[seed.endurance]</td><td>[seed.yield]</td><td>[seed.lifespan]</td><td>[seed.maturation]</td><td>[seed.production]</td><td>[seed.potency]</td>"
if(seed.harvest_repeat)
dat += "<td>[seed.get_trait(TRAIT_ENDURANCE)]</td><td>[seed.get_trait(TRAIT_YIELD)]</td><td>[seed.get_trait(TRAIT_MATURATION)]</td><td>[seed.get_trait(TRAIT_PRODUCTION)]</td><td>[seed.get_trait(TRAIT_POTENCY)]</td>"
if(seed.get_trait(TRAIT_HARVEST_REPEAT))
dat += "<td>Multiple</td>"
else
dat += "<td>Single</td>"
if ("produce" in scanner)
if (seed.products && seed.products.len)
dat += "<td>Fruit: [seed.products.len]</td>"
else
dat += "<td>N/A</td>"
if ("temperature" in scanner)
dat += "<td>[seed.ideal_heat] K</td>"
dat += "<td>[seed.get_trait(TRAIT_IDEAL_HEAT)] K</td>"
if ("light" in scanner)
dat += "<td>[seed.ideal_light] L</td>"
dat += "<td>[seed.get_trait(TRAIT_IDEAL_LIGHT)] L</td>"
if ("soil" in scanner)
if(seed.requires_nutrients)
if(seed.nutrient_consumption < 0.05)
if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS))
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) < 0.05)
dat += "<td>Low</td>"
else if(seed.nutrient_consumption > 0.2)
else if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS) > 0.2)
dat += "<td>High</td>"
else
dat += "<td>Norm</td>"
else
dat += "<td>No</td>"
if(seed.requires_water)
if(seed.water_consumption < 1)
if(seed.get_trait(TRAIT_REQUIRES_WATER))
if(seed.get_trait(TRAIT_WATER_CONSUMPTION) < 1)
dat += "<td>Low</td>"
else if(seed.water_consumption > 5)
else if(seed.get_trait(TRAIT_WATER_CONSUMPTION) > 5)
dat += "<td>High</td>"
else
dat += "<td>Norm</td>"
@@ -123,61 +118,52 @@
dat += "<td>No</td>"
dat += "<td>"
if ("mutants" in scanner)
if(seed.mutants && seed.mutants.len)
dat += "SUBSP "
if(seed.immutable == -1)
dat += "MUT "
else if(seed.immutable > 0)
dat += "NOMUT "
switch(seed.carnivorous)
switch(seed.get_trait(TRAIT_CARNIVOROUS))
if(1)
dat += "CARN "
if(2)
dat += "<font color='red'>CARN </font>"
switch(seed.spread)
switch(seed.get_trait(TRAIT_SPREAD))
if(1)
dat += "VINE "
if(2)
dat += "<font color='red'>VINE </font>"
if ("pressure" in scanner)
if(seed.lowkpa_tolerance < 20)
if(seed.get_trait(TRAIT_LOWKPA_TOLERANCE) < 20)
dat += "LP "
if(seed.highkpa_tolerance > 220)
if(seed.get_trait(TRAIT_HIGHKPA_TOLERANCE) > 220)
dat += "HP "
if ("temperature" in scanner)
if(seed.heat_tolerance > 30)
if(seed.get_trait(TRAIT_HEAT_TOLERANCE) > 30)
dat += "TEMRES "
else if(seed.heat_tolerance < 10)
else if(seed.get_trait(TRAIT_HEAT_TOLERANCE) < 10)
dat += "TEMSEN "
if ("light" in scanner)
if(seed.light_tolerance > 10)
if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) > 10)
dat += "LIGRES "
else if(seed.light_tolerance < 3)
else if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) < 3)
dat += "LIGSEN "
if(seed.toxins_tolerance < 3)
if(seed.get_trait(TRAIT_TOXINS_TOLERANCE) < 3)
dat += "TOXSEN "
else if(seed.toxins_tolerance > 6)
else if(seed.get_trait(TRAIT_TOXINS_TOLERANCE) > 6)
dat += "TOXRES "
if(seed.pest_tolerance < 3)
if(seed.get_trait(TRAIT_PEST_TOLERANCE) < 3)
dat += "PESTSEN "
else if(seed.pest_tolerance > 6)
else if(seed.get_trait(TRAIT_PEST_TOLERANCE) > 6)
dat += "PESTRES "
if(seed.weed_tolerance < 3)
if(seed.get_trait(TRAIT_WEED_TOLERANCE) < 3)
dat += "WEEDSEN "
else if(seed.weed_tolerance > 6)
else if(seed.get_trait(TRAIT_WEED_TOLERANCE) > 6)
dat += "WEEDRES "
if(seed.parasite)
if(seed.get_trait(TRAIT_PARASITE))
dat += "PAR "
if ("temperature" in scanner)
if(seed.alter_temp > 0)
if(seed.get_trait(TRAIT_ALTER_TEMP) > 0)
dat += "TEMP+ "
if(seed.alter_temp < 0)
if(seed.get_trait(TRAIT_ALTER_TEMP) < 0)
dat += "TEMP- "
if(seed.biolum)
if(seed.get_trait(TRAIT_BIOLUM))
dat += "LUM "
if(seed.flowers)
dat += "<br>[seed.flower_colour ? "<font color='[seed.flower_colour]'>FLOW</font>" : "FLOW"]."
dat += "</td>"
dat += "<td>[S.amount]</td>"
dat += "<td><a href='byond://?src=\ref[src];task=vend;id=[S.ID]'>Vend</a> <a href='byond://?src=\ref[src];task=purge;id=[S.ID]'>Purge</a></td>"

View File

@@ -0,0 +1,259 @@
#define DEFAULT_SEED "glowshroom"
#define VINE_GROWTH_STAGES 5
/proc/spacevine_infestation()
spawn() //to stop the secrets panel hanging
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
var/area/A = locate(areapath)
for(var/area/B in A.related)
for(var/turf/simulated/floor/F in B.contents)
if(!F.contents.len)
turfs += F
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/floor/T = pick(turfs)
var/datum/seed/seed = plant_controller.create_random_seed(1)
seed.set_trait(TRAIT_SPREAD,2) // So it will function properly as vines.
seed.set_trait(TRAIT_POTENCY,rand(70,100)) // Guarantee a wide spread and powerful effects.
new /obj/effect/plant(T,seed)
message_admins("<span class='notice'>Event: Spacevines spawned at [T.loc] ([T.x],[T.y],[T.z])</span>")
/obj/effect/dead_plant
anchored = 1
opacity = 0
density = 0
color = DEAD_PLANT_COLOUR
/obj/effect/dead_plant/attack_hand()
del(src)
/obj/effect/dead_plant/attackby()
..()
for(var/obj/effect/plant/neighbor in range(1))
neighbor.update_neighbors()
del(src)
/obj/effect/plant
name = "plant"
anchored = 1
opacity = 0
density = 0
icon = 'icons/obj/hydroponics_growing.dmi'
icon_state = "bush4-1"
layer = 3
pass_flags = PASSTABLE
var/health = 10
var/max_health = 100
var/growth_threshold = 0
var/growth_type = 0
var/max_growth = 0
var/list/neighbors = list()
var/obj/effect/plant/parent
var/datum/seed/seed
var/floor = 0
var/spread_chance = 40
var/spread_distance = 3
var/evolve_chance = 2
var/last_tick = 0
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/plant
/obj/effect/plant/Del()
if(plant_controller)
plant_controller.remove_plant(src)
for(var/obj/effect/plant/neighbor in range(1,src))
plant_controller.add_plant(neighbor)
..()
/obj/effect/plant/single
spread_chance = 0
/obj/effect/plant/New(var/newloc, var/datum/seed/newseed, var/obj/effect/plant/newparent)
..()
if(!newparent)
parent = src
else
parent = newparent
if(!plant_controller)
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
return
if(!istype(newseed))
newseed = plant_controller.seeds[DEFAULT_SEED]
seed = newseed
if(!seed)
del(src)
return
name = seed.display_name
max_health = round(seed.get_trait(TRAIT_ENDURANCE)/2)
if(seed.get_trait(TRAIT_SPREAD)==2)
max_growth = VINE_GROWTH_STAGES
growth_threshold = max_health/VINE_GROWTH_STAGES
icon = 'icons/obj/hydroponics_vines.dmi'
growth_type = 2 // Vines by default.
if(seed.get_trait(TRAIT_CARNIVOROUS) == 2)
growth_type = 1 // WOOOORMS.
else if(!(seed.seed_noun in list("seeds","pits")))
if(seed.seed_noun == "nodes")
growth_type = 3 // Biomass
else
growth_type = 4 // Mold
else
max_growth = seed.growth_stages
growth_threshold = max_health/seed.growth_stages
if(max_growth > 2 && prob(50))
max_growth-- //Ensure some variation in final sprite, makes the carpet of crap look less wonky.
spread_chance = seed.get_trait(TRAIT_POTENCY)
spread_distance = ((growth_type>0) ? round(spread_chance*0.6) : round(spread_chance*0.3))
update_icon()
spawn(1) // Plants will sometimes be spawned in the turf adjacent to the one they need to end up in, for the sake of correct dir/etc being set.
set_dir(calc_dir())
update_icon()
plant_controller.add_plant(src)
// Some plants eat through plating.
if(!isnull(seed.chems["pacid"]))
var/turf/T = get_turf(src)
T.ex_act(prob(80) ? 3 : 2)
/obj/effect/plant/update_icon()
//TODO: should really be caching this.
refresh_icon()
if(growth_type == 0 && !floor)
src.transform = null
var/matrix/M = matrix()
// should make the plant flush against the wall it's meant to be growing from.
M.Translate(0,-(rand(12,14)))
switch(dir)
if(WEST)
M.Turn(90)
if(NORTH)
M.Turn(180)
if(EAST)
M.Turn(270)
src.transform = M
var/icon_colour = seed.get_trait(TRAIT_PLANT_COLOUR)
if(icon_colour)
color = icon_colour
// Apply colour and light from seed datum.
if(seed.get_trait(TRAIT_BIOLUM))
SetLuminosity(1+round(seed.get_trait(TRAIT_POTENCY)/20))
if(seed.get_trait(TRAIT_BIOLUM_COLOUR))
l_color = seed.get_trait(TRAIT_BIOLUM_COLOUR)
else
l_color = null
return
else
SetLuminosity(0)
/obj/effect/plant/proc/refresh_icon()
var/growth = min(max_growth,round(health/growth_threshold))
var/at_fringe = get_dist(src,parent)
if(spread_distance > 5)
if(at_fringe >= (spread_distance-3))
max_growth--
if(at_fringe >= (spread_distance-2))
max_growth--
max_growth = max(1,max_growth)
if(growth_type > 0)
switch(growth_type)
if(1)
icon_state = "worms"
if(2)
icon_state = "vines-[growth]"
if(3)
icon_state = "mass-[growth]"
if(4)
icon_state = "mold-[growth]"
else
icon_state = "[seed.get_trait(TRAIT_PLANT_ICON)]-[growth]"
if(growth>2 && growth == max_growth)
layer = 5
opacity = 1
if(!isnull(seed.chems["woodpulp"]))
density = 1
else
layer = 3
density = 0
/obj/effect/plant/proc/calc_dir(turf/location = loc)
set background = 1
var/direction = 16
for(var/wallDir in cardinal)
var/turf/newTurf = get_step(location,wallDir)
if(newTurf.density)
direction |= wallDir
for(var/obj/effect/plant/shroom in location)
if(shroom == src)
continue
if(shroom.floor) //special
direction &= ~16
else
direction &= ~shroom.dir
var/list/dirList = list()
for(var/i=1,i<=16,i <<= 1)
if(direction & i)
dirList += i
if(dirList.len)
var/newDir = pick(dirList)
if(newDir == 16)
floor = 1
newDir = 1
return newDir
floor = 1
return 1
/obj/effect/plant/attackby(var/obj/item/weapon/W, var/mob/user)
plant_controller.add_plant(src)
if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
if(!seed)
user << "There is nothing to take a sample from."
return
seed.harvest(user,0,1)
health -= (rand(3,5)*10)
else
..()
if(W.force)
health -= W.force
check_health()
/obj/effect/plant/ex_act(severity)
switch(severity)
if(1.0)
die_off()
return
if(2.0)
if (prob(50))
die_off()
return
if(3.0)
if (prob(5))
die_off()
return
else
return
/obj/effect/plant/proc/check_health()
if(health <= 0)
die_off()
/obj/effect/plant/proc/is_mature()
return (health >= (max_health/3))

View File

@@ -0,0 +1,89 @@
#define NEIGHBOR_REFRESH_TIME 100
/obj/effect/plant/proc/update_neighbors()
// Update our list of valid neighboring turfs.
neighbors = list()
for(var/turf/simulated/floor/floor in range(1,src))
if(get_dist(parent, floor) > spread_distance)
continue
if((locate(/obj/effect/plant) in floor.contents) || (locate(/obj/effect/dead_plant) in floor.contents) )
continue
if(floor.density)
if(!isnull(seed.chems["pacid"]))
spawn(rand(5,25)) floor.ex_act(3)
continue
else if(!floor.Enter(src))
continue
neighbors |= floor
// Update all of our friends.
var/turf/T = get_turf(src)
for(var/obj/effect/plant/neighbor in range(1,src))
neighbor.neighbors -= T
/obj/effect/plant/process()
// Something is very wrong, kill ourselves.
if(!seed)
die_off()
return 0
// Handle life.
var/turf/simulated/T = get_turf(src)
if(istype(T))
health -= seed.handle_environment(T,T.return_air(),null,1)
if(health < max_health)
health += rand(3,5)
refresh_icon()
if(health > max_health)
health = max_health
else if(health == max_health && !plant)
plant = new(T,seed)
plant.dir = src.dir
plant.transform = src.transform
plant.age = seed.get_trait(TRAIT_MATURATION)-1
plant.update_icon()
if(growth_type==0) //Vines do not become invisible.
invisibility = INVISIBILITY_MAXIMUM
else
plant.layer = layer + 0.1
if(buckled_mob)
seed.do_sting(buckled_mob,src)
if(seed.get_trait(TRAIT_CARNIVOROUS))
seed.do_thorns(buckled_mob,src)
if(world.time >= last_tick+NEIGHBOR_REFRESH_TIME)
last_tick = world.time
update_neighbors()
if(is_mature() && neighbors.len && prob(spread_chance))
for(var/i=1,i<=seed.get_trait(TRAIT_YIELD),i++)
if(prob(spread_chance))
sleep(rand(3,5))
if(!neighbors.len)
break
var/turf/target_turf = pick(neighbors)
var/obj/effect/plant/child = new(get_turf(src),seed,parent)
spawn(1) // This should do a little bit of animation.
child.loc = target_turf
child.update_icon()
// Update neighboring squares.
for(var/obj/effect/plant/neighbor in range(1,target_turf))
neighbor.neighbors -= target_turf
// We shouldn't have spawned if the controller doesn't exist.
check_health()
if(neighbors.len || health != max_health)
plant_controller.add_plant(src)
/obj/effect/plant/proc/die_off()
// Kill off our plant.
if(plant) plant.die()
// This turf is clear now, let our buddies know.
var/turf/T = get_turf(src)
for(var/obj/effect/plant/neighbor in range(1,src))
neighbor.neighbors |= T
plant_controller.add_plant(neighbor)
spawn(1) if(src) del(src)
#undef NEIGHBOR_REFRESH_TIME

View File

@@ -0,0 +1,70 @@
/obj/effect/plant/HasProximity(var/atom/movable/AM)
if(!is_mature() || seed.get_trait(TRAIT_SPREAD) != 2)
return
var/mob/living/M = AM
if(!istype(M))
return
if(!buckled_mob && !M.buckled && !M.anchored && (M.small || prob(round(seed.get_trait(TRAIT_POTENCY)/2))))
entangle(M)
/obj/effect/plant/attack_hand(mob/user as mob)
// Todo, cause damage.
manual_unbuckle(user)
/obj/effect/plant/proc/trodden_on(var/mob/living/victim)
if(!is_mature())
return
var/mob/living/carbon/human/H = victim
if(istype(H) && H.shoes)
return
seed.do_thorns(victim,src)
seed.do_sting(victim,src,pick("r_foot","l_foot","r_leg","l_leg"))
/obj/effect/plant/proc/unbuckle()
if(buckled_mob)
if(buckled_mob.buckled == src)
buckled_mob.buckled = null
buckled_mob.anchored = initial(buckled_mob.anchored)
buckled_mob.update_canmove()
buckled_mob = null
return
/obj/effect/plant/proc/manual_unbuckle(mob/user as mob)
if(buckled_mob)
if(prob(seed ? min(max(0,100 - seed.get_trait(TRAIT_POTENCY)/2),100) : 50))
if(buckled_mob.buckled == src)
if(buckled_mob != user)
buckled_mob.visible_message(\
"<span class='notice'>[user.name] frees [buckled_mob.name] from \the [src].</span>",\
"<span class='notice'>[user.name] frees you from \the [src].</span>",\
"<span class='warning'>You hear shredding and ripping.</span>")
else
buckled_mob.visible_message(\
"<span class='notice'>[buckled_mob.name] struggles free of \the [src].</span>",\
"<span class='notice'>You untangle \the [src] from around yourself.</span>",\
"<span class='warning'>You hear shredding and ripping.</span>")
unbuckle()
else
var/text = pick("rip","tear","pull")
user.visible_message(\
"<span class='notice'>[user.name] [text]s at \the [src].</span>",\
"<span class='notice'>You [text] at \the [src].</span>",\
"<span class='warning'>You hear shredding and ripping.</span>")
return
/obj/effect/plant/proc/entangle(var/mob/living/victim)
if(buckled_mob)
return
victim.buckled = src
victim.update_canmove()
buckled_mob = victim
if(victim.loc != src.loc)
src.visible_message("<span class='danger'>Tendrils lash out from \the [src] and drag \the [victim] in!</span>")
victim.loc = src.loc
victim << "<span class='danger'>Tendrils [pick("wind", "tangle", "tighten")] around you!</span>"

View File

@@ -1,15 +1,14 @@
#define HYDRO_SPEED_MULTIPLIER 1
/obj/machinery/portable_atmospherics/hydroponics
name = "hydroponics tray"
icon = 'icons/obj/hydroponics.dmi'
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "hydrotray3"
density = 1
anchored = 1
flags = OPENCONTAINER
volume = 100
var/draw_warnings = 1 //Set to 0 to stop it from drawing the alert lights.
var/mechanical = 1 // Set to 0 to stop it from drawing the alert lights.
var/base_name = "tray"
// Plant maintenance vars.
var/waterlevel = 100 // Water (max 100)
@@ -21,13 +20,14 @@
var/dead = 0 // Is it dead?
var/harvest = 0 // Is it ready to harvest?
var/age = 0 // Current plant age
var/sampled = 0 // Have wa taken a sample?
var/sampled = 0 // Have we taken a sample?
// Harvest/mutation mods.
var/yield_mod = 0 // Modifier to yield
var/mutation_mod = 0 // Modifier to mutation chance
var/toxins = 0 // Toxicity in the tray?
var/mutation_level = 0 // When it hits 100, the plant mutates.
var/tray_light = 1 // Supplied lighting.
// Mechanical concerns.
var/health = 0 // Plant health.
@@ -37,6 +37,7 @@
var/closed_system // If set, the tray will attempt to take atmos from a pipe.
var/force_update // Set this to bypass the cycle time check.
var/obj/temp_chem_holder // Something to hold reagents during process_reagents()
var/labelled
// Seed details/line data.
var/datum/seed/seed = null // The currently planted seed
@@ -122,6 +123,12 @@
"mutagen" = 15
)
/obj/machinery/portable_atmospherics/hydroponics/AltClick()
if(mechanical && !usr.stat && !usr.lying && Adjacent(usr))
close_lid(usr)
return
return ..()
/obj/machinery/portable_atmospherics/hydroponics/attack_generic(var/mob/user)
if(istype(user,/mob/living/carbon/alien/diona))
var/mob/living/carbon/alien/diona/nymph = user
@@ -146,13 +153,14 @@
temp_chem_holder = new()
temp_chem_holder.create_reagents(10)
create_reagents(200)
connect()
if(mechanical)
connect()
update_icon()
/obj/machinery/portable_atmospherics/hydroponics/bullet_act(var/obj/item/projectile/Proj)
//Don't act on seeds like dionaea that shouldn't change.
if(seed && seed.immutable > 0)
if(seed && seed.get_trait(TRAIT_IMMUTABLE) > 0)
return
//Override for somatoray projectiles.
@@ -173,174 +181,18 @@
else
return 0
/obj/machinery/portable_atmospherics/hydroponics/process()
//Do this even if we're not ready for a plant cycle.
process_reagents()
// Update values every cycle rather than every process() tick.
if(force_update)
force_update = 0
else if(world.time < (lastcycle + cycledelay))
return
lastcycle = world.time
// Mutation level drops each main tick.
mutation_level -= rand(2,4)
// Weeds like water and nutrients, there's a chance the weed population will increase.
// Bonus chance if the tray is unoccupied.
if(waterlevel > 10 && nutrilevel > 2 && prob(isnull(seed) ? 5 : 1))
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
// There's a chance for a weed explosion to happen if the weeds take over.
// Plants that are themselves weeds (weed_tolerance > 10) are unaffected.
if (weedlevel >= 10 && prob(10))
if(!seed || weedlevel >= seed.weed_tolerance)
weed_invasion()
// If there is no seed data (and hence nothing planted),
// or the plant is dead, process nothing further.
if(!seed || dead)
if(draw_warnings) update_icon() //Harvesting would fail to set alert icons properly.
return
// Advance plant age.
if(prob(30)) age += 1 * HYDRO_SPEED_MULTIPLIER
//Highly mutable plants have a chance of mutating every tick.
if(seed.immutable == -1)
var/mut_prob = rand(1,100)
if(mut_prob <= 5) mutate(mut_prob == 1 ? 2 : 1)
// Other plants also mutate if enough mutagenic compounds have been added.
if(!seed.immutable)
if(prob(min(mutation_level,100)))
mutate((rand(100) < 15) ? 2 : 1)
mutation_level = 0
// Maintain tray nutrient and water levels.
if(seed.nutrient_consumption > 0 && nutrilevel > 0 && prob(25))
nutrilevel -= max(0,seed.nutrient_consumption * HYDRO_SPEED_MULTIPLIER)
if(seed.water_consumption > 0 && waterlevel > 0 && prob(25))
waterlevel -= max(0,seed.water_consumption * HYDRO_SPEED_MULTIPLIER)
// Make sure the plant is not starving or thirsty. Adequate
// water and nutrients will cause a plant to become healthier.
var/healthmod = rand(1,3) * HYDRO_SPEED_MULTIPLIER
if(seed.requires_nutrients && prob(35))
health += (nutrilevel < 2 ? -healthmod : healthmod)
if(seed.requires_water && prob(35))
health += (waterlevel < 10 ? -healthmod : healthmod)
// Check that pressure, heat and light are all within bounds.
// First, handle an open system or an unconnected closed system.
var/turf/T = loc
var/datum/gas_mixture/environment
// If we're closed, take from our internal sources.
if(closed_system && (connected_port || holding))
environment = air_contents
// If atmos input is not there, grab from turf.
if(!environment)
if(istype(T))
environment = T.return_air()
if(!environment) return
// Handle gas consumption.
if(seed.consume_gasses && seed.consume_gasses.len)
var/missing_gas = 0
for(var/gas in seed.consume_gasses)
if(environment && environment.gas && environment.gas[gas] && \
environment.gas[gas] >= seed.consume_gasses[gas])
environment.adjust_gas(gas,-seed.consume_gasses[gas],1)
else
missing_gas++
if(missing_gas > 0)
health -= missing_gas * HYDRO_SPEED_MULTIPLIER
// Process it.
var/pressure = environment.return_pressure()
if(pressure < seed.lowkpa_tolerance || pressure > seed.highkpa_tolerance)
health -= healthmod
if(abs(environment.temperature - seed.ideal_heat) > seed.heat_tolerance)
health -= healthmod
// Handle gas production.
if(seed.exude_gasses && seed.exude_gasses.len)
for(var/gas in seed.exude_gasses)
environment.adjust_gas(gas, max(1,round((seed.exude_gasses[gas]*seed.potency)/seed.exude_gasses.len)))
// If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses
if (closed_system && connected_port)
update_connected_network()
// Handle light requirements.
var/area/A = T.loc
if(A)
var/light_available
if(A.lighting_use_dynamic)
light_available = max(0,min(10,T.lighting_lumcount)-5)
else
light_available = 5
if(abs(light_available - seed.ideal_light) > seed.light_tolerance)
health -= healthmod
// Toxin levels beyond the plant's tolerance cause damage, but
// toxins are sucked up each tick and slowly reduce over time.
if(toxins > 0)
var/toxin_uptake = max(1,round(toxins/10))
if(toxins > seed.toxins_tolerance)
health -= toxin_uptake
toxins -= toxin_uptake
// Check for pests and weeds.
// Some carnivorous plants happily eat pests.
if(pestlevel > 0)
if(seed.carnivorous)
health += HYDRO_SPEED_MULTIPLIER
pestlevel -= HYDRO_SPEED_MULTIPLIER
else if (pestlevel >= seed.pest_tolerance)
health -= HYDRO_SPEED_MULTIPLIER
// Some plants thrive and live off of weeds.
if(weedlevel > 0)
if(seed.parasite)
health += HYDRO_SPEED_MULTIPLIER
weedlevel -= HYDRO_SPEED_MULTIPLIER
else if (weedlevel >= seed.weed_tolerance)
health -= HYDRO_SPEED_MULTIPLIER
// Handle life and death.
// If the plant is too old, it loses health fast.
if(age > seed.lifespan)
health -= rand(3,5) * HYDRO_SPEED_MULTIPLIER
// When the plant dies, weeds thrive and pests die off.
if(health <= 0)
dead = 1
mutation_level = 0
harvest = 0
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
pestlevel = 0
// If enough time (in cycles, not ticks) has passed since the plant was harvested, we're ready to harvest again.
else if(seed.products && seed.products.len && age > seed.production && \
(age - lastproduce) > seed.production && (!harvest && !dead))
harvest = 1
lastproduce = age
if(prob(3)) // On each tick, there's a chance the pest population will increase
pestlevel += 0.1 * HYDRO_SPEED_MULTIPLIER
/obj/machinery/portable_atmospherics/hydroponics/proc/check_health()
if(seed && !dead && health <= 0)
die()
check_level_sanity()
update_icon()
return
/obj/machinery/portable_atmospherics/hydroponics/proc/die()
dead = 1
mutation_level = 0
harvest = 0
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
pestlevel = 0
//Process reagents being input into the tray.
/obj/machinery/portable_atmospherics/hydroponics/proc/process_reagents()
@@ -391,27 +243,29 @@
toxins -= round(water_added/4)
temp_chem_holder.reagents.clear_reagents()
check_level_sanity()
update_icon()
check_health()
//Harvests the product of a plant.
/obj/machinery/portable_atmospherics/hydroponics/proc/harvest(var/mob/user)
//Harvest the product of the plant,
if(!seed || !harvest || !user)
if(!seed || !harvest)
return
if(closed_system)
user << "You can't harvest from the plant while the lid is shut."
if(user) user << "You can't harvest from the plant while the lid is shut."
return
seed.harvest(user,yield_mod)
if(user)
seed.harvest(user,yield_mod)
else
seed.harvest(get_turf(src),yield_mod)
// Reset values.
harvest = 0
lastproduce = age
if(!seed.harvest_repeat)
if(!seed.get_trait(TRAIT_HARVEST_REPEAT))
yield_mod = 0
seed = null
dead = 0
@@ -419,8 +273,7 @@
sampled = 0
mutation_mod = 0
check_level_sanity()
update_icon()
check_health()
return
//Clears out a dead plant.
@@ -438,85 +291,28 @@
yield_mod = 0
mutation_mod = 0
user << "You remove the dead plant from the [src]."
check_level_sanity()
update_icon()
user << "You remove the dead plant."
check_health()
return
//Refreshes the icon and sets the luminosity
/obj/machinery/portable_atmospherics/hydroponics/update_icon()
overlays.Cut()
// Updates the plant overlay.
if(!isnull(seed))
if(draw_warnings && health <= (seed.endurance / 2))
overlays += "over_lowhealth3"
if(dead)
overlays += "[seed.plant_icon]-dead"
else if(harvest)
overlays += "[seed.plant_icon]-harvest"
else if(age < seed.maturation)
var/t_growthstate
if(age >= seed.maturation)
t_growthstate = seed.growth_stages
else
t_growthstate = round(seed.maturation / seed.growth_stages)
overlays += "[seed.plant_icon]-grow[t_growthstate]"
lastproduce = age
else
overlays += "[seed.plant_icon]-grow[seed.growth_stages]"
//Draw the cover.
if(closed_system)
overlays += "hydrocover"
//Updated the various alert icons.
if(draw_warnings)
if(waterlevel <= 10)
overlays += "over_lowwater3"
if(nutrilevel <= 2)
overlays += "over_lownutri3"
if(weedlevel >= 5 || pestlevel >= 5 || toxins >= 40)
overlays += "over_alert3"
if(harvest)
overlays += "over_harvest3"
// Update bioluminescence.
if(seed)
if(seed.biolum)
SetLuminosity(round(seed.potency/10))
if(seed.biolum_colour)
l_color = seed.biolum_colour
else
l_color = null
return
SetLuminosity(0)
return
// If a weed growth is sufficient, this proc is called.
// If a weed growth is sufficient, this proc is called.
/obj/machinery/portable_atmospherics/hydroponics/proc/weed_invasion()
//Remove the seed if something is already planted.
if(seed) seed = null
seed = seed_types[pick(list("reishi","nettles","amanita","mushrooms","plumphelmet","towercap","harebells","weeds"))]
seed = plant_controller.seeds[pick(list("reishi","nettles","amanita","mushrooms","plumphelmet","towercap","harebells","weeds"))]
if(!seed) return //Weed does not exist, someone fucked up.
dead = 0
age = 0
health = seed.endurance
health = seed.get_trait(TRAIT_ENDURANCE)
lastcycle = world.time
harvest = 0
weedlevel = 0
pestlevel = 0
sampled = 0
update_icon()
visible_message("\blue [src] has been overtaken by [seed.display_name].")
visible_message("<span class='notice'>[src] has been overtaken by [seed.display_name].</span>")
return
@@ -534,16 +330,40 @@
// We need to make sure we're not modifying one of the global seed datums.
// If it's not in the global list, then no products of the line have been
// harvested yet and it's safe to assume it's restricted to this tray.
if(!isnull(seed_types[seed.name]))
if(!isnull(plant_controller.seeds[seed.name]))
seed = seed.diverge()
seed.mutate(severity,get_turf(src))
return
/obj/machinery/portable_atmospherics/hydroponics/verb/remove_label()
set name = "Remove Label"
set category = "Object"
set src in view(1)
if(labelled)
usr << "You remove the label."
labelled = null
update_icon()
else
usr << "There is no label to remove."
return
/obj/machinery/portable_atmospherics/hydroponics/verb/set_light()
set name = "Set Light"
set category = "Object"
set src in view(1)
var/new_light = input("Specify a light level.") as null|anything in list(0,1,2,3,4,5,6,7,8,9,10)
if(new_light)
tray_light = new_light
usr << "You set the tray to a light level of [tray_light] lumens."
/obj/machinery/portable_atmospherics/hydroponics/proc/check_level_sanity()
//Make sure various values are sane.
if(seed)
health = max(0,min(seed.endurance,health))
health = max(0,min(seed.get_trait(TRAIT_ENDURANCE),health))
else
health = 0
dead = 0
@@ -559,21 +379,21 @@
var/previous_plant = seed.display_name
var/newseed = seed.get_mutant_variant()
if(newseed in seed_types)
seed = seed_types[newseed]
if(newseed in plant_controller.seeds)
seed = plant_controller.seeds[newseed]
else
return
dead = 0
mutate(1)
age = 0
health = seed.endurance
health = seed.get_trait(TRAIT_ENDURANCE)
lastcycle = world.time
harvest = 0
weedlevel = 0
update_icon()
visible_message("\red The \blue [previous_plant] \red has suddenly mutated into \blue [seed.display_name]!")
visible_message("<span class='danger'>The </span><span class='notice'>[previous_plant]</span><span class='danger'> has suddenly mutated into </span><span class='notice'>[seed.display_name]!</span>")
return
@@ -604,7 +424,7 @@
sampled = 1
// Bookkeeping.
check_level_sanity()
check_health()
force_update = 1
process()
@@ -641,42 +461,28 @@
return
user << "You plant the [S.seed.seed_name] [S.seed.seed_noun]."
if(S.seed.spread == 1)
msg_admin_attack("[key_name(user)] has planted a creeper packet.")
var/obj/effect/plant_controller/creeper/PC = new(get_turf(src))
if(PC)
PC.seed = S.seed
else if(S.seed.spread == 2)
msg_admin_attack("[key_name(user)] has planted a spreading vine packet.")
var/obj/effect/plant_controller/PC = new(get_turf(src))
if(PC)
PC.seed = S.seed
else
seed = S.seed //Grab the seed datum.
dead = 0
age = 1
//Snowflakey, maybe move this to the seed datum
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.endurance/rand(2,5)) : seed.endurance)
lastcycle = world.time
seed = S.seed //Grab the seed datum.
dead = 0
age = 1
//Snowflakey, maybe move this to the seed datum
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
lastcycle = world.time
del(O)
check_level_sanity()
update_icon()
check_health()
else
user << "\red \The [src] already has seeds in it!"
user << "<span class='danger'>\The [src] already has seeds in it!</span>"
else if (istype(O, /obj/item/weapon/minihoe)) // The minihoe
if(weedlevel > 0)
user.visible_message("\red [user] starts uprooting the weeds.", "\red You remove the weeds from the [src].")
user.visible_message("<span class='danger'>[user] starts uprooting the weeds.</span>", "<span class='danger'>You remove the weeds from the [src].</span>")
weedlevel = 0
update_icon()
else
user << "\red This plot is completely devoid of weeds. It doesn't need uprooting."
user << "<span class='danger'>This plot is completely devoid of weeds. It doesn't need uprooting.</span>"
else if (istype(O, /obj/item/weapon/storage/bag/plants))
@@ -698,11 +504,9 @@
user << "You spray [src] with [O]."
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
del(O)
check_health()
check_level_sanity()
update_icon()
else if(istype(O, /obj/item/weapon/wrench))
else if(mechanical && istype(O, /obj/item/weapon/wrench))
//If there's a connector here, the portable_atmospherics setup can handle it.
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)
@@ -715,7 +519,7 @@
else if(istype(O, /obj/item/apiary))
if(seed)
user << "\red [src] is already occupied!"
user << "<span class='danger'>[src] is already occupied!</span>"
else
user.drop_item()
del(O)
@@ -725,15 +529,18 @@
A.icon_state = src.icon_state
A.hydrotray_type = src.type
del(src)
else if(O.force && seed)
user.visible_message("<span class='danger'>\The [seed.display_name] has been attacked by [user] with \the [O]!</span>")
if(!dead)
health -= O.force
check_health()
return
/obj/machinery/portable_atmospherics/hydroponics/attack_tk(mob/user as mob)
if(harvest)
harvest(user)
else if(dead)
if(dead)
remove_dead(user)
else if(harvest)
harvest(user)
/obj/machinery/portable_atmospherics/hydroponics/attack_hand(mob/user as mob)
@@ -745,76 +552,66 @@
else if(dead)
remove_dead(user)
else
if(seed && !dead)
usr << "[src] has \blue [seed.display_name] \black planted."
if(health <= (seed.endurance / 2))
usr << "The plant looks \red unhealthy."
else
usr << "[src] is empty."
usr << "Water: [round(waterlevel,0.1)]/100"
usr << "Nutrient: [round(nutrilevel,0.1)]/10"
if(weedlevel >= 5)
usr << "[src] is \red filled with weeds!"
if(pestlevel >= 5)
usr << "[src] is \red filled with tiny worms!"
/obj/machinery/portable_atmospherics/hydroponics/examine()
if(!istype(src,/obj/machinery/portable_atmospherics/hydroponics/soil))
..()
var/turf/T = loc
var/datum/gas_mixture/environment
if(!seed)
usr << "[src] is empty."
return
if(closed_system && (connected_port || holding))
environment = air_contents
usr << "<span class='notice'>[seed.display_name]</span> are growing here.</span>"
if(!environment)
if(istype(T))
environment = T.return_air()
if(!Adjacent(usr))
return
if(!environment) //We're in a crate or nullspace, bail out.
return
usr << "Water: [round(waterlevel,0.1)]/100"
usr << "Nutrient: [round(nutrilevel,0.1)]/10"
var/area/A = T.loc
var/light_available
if(A)
if(A.lighting_use_dynamic)
light_available = max(0,min(10,T.lighting_lumcount)-5)
else
light_available = 5
if(weedlevel >= 5)
usr << "\The [src] is <span class='danger'>infested with weeds</span>!"
if(pestlevel >= 5)
usr << "\The [src] is <span class='danger'>infested with tiny worms</span>!"
usr << "The tray's sensor suite is reporting a light level of [light_available] lumens and a temperature of [environment.temperature]K."
if(dead)
usr << "<span class='danger'>The plant is dead.</span>"
else if(health <= (seed.get_trait(TRAIT_ENDURANCE)/ 2))
usr << "The plant looks <span class='danger'>unhealthy</span>."
/obj/machinery/portable_atmospherics/hydroponics/verb/close_lid()
if(mechanical)
var/turf/T = loc
var/datum/gas_mixture/environment
if(closed_system && (connected_port || holding))
environment = air_contents
if(!environment)
if(istype(T))
environment = T.return_air()
if(!environment) //We're in a crate or nullspace, bail out.
return
var/area/A = T.loc
var/light_available
if(A)
if(A.lighting_use_dynamic)
light_available = max(0,min(10,T.lighting_lumcount)-5)
else
light_available = 5
usr << "The tray's sensor suite is reporting a light level of [light_available] lumens and a temperature of [environment.temperature]K."
/obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb()
set name = "Toggle Tray Lid"
set category = "Object"
set src in view(1)
close_lid(usr)
if(!usr || usr.stat || usr.restrained())
/obj/machinery/portable_atmospherics/hydroponics/proc/close_lid(var/mob/living/user)
if(!user || user.stat || user.restrained())
return
closed_system = !closed_system
usr << "You [closed_system ? "close" : "open"] the tray's lid."
user << "You [closed_system ? "close" : "open"] the tray's lid."
update_icon()
/obj/machinery/portable_atmospherics/hydroponics/soil
name = "soil"
icon = 'icons/obj/hydroponics.dmi'
icon_state = "soil"
density = 0
use_power = 0
draw_warnings = 0
/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/shovel))
user << "You clear up [src]!"
del(src)
else if(istype(O,/obj/item/weapon/shovel) || istype(O,/obj/item/weapon/tank))
return
else
..()
/obj/machinery/portable_atmospherics/hydroponics/soil/New()
..()
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid
#undef HYDRO_SPEED_MULTIPLIER

View File

@@ -3,7 +3,7 @@
/obj/machinery/apiary
name = "apiary tray"
icon = 'icons/obj/hydroponics.dmi'
icon = 'icons/obj/hydroponics_machines.dmi'
icon_state = "hydrotray3"
density = 1
anchored = 1
@@ -188,9 +188,7 @@
if(prob(10))
H.lastcycle -= 5
if(prob(10))
H.seed.lifespan = max(initial(H.seed.lifespan) * 1.5, H.seed.lifespan + 1)
if(prob(10))
H.seed.endurance = max(initial(H.seed.endurance) * 1.5, H.seed.endurance + 1)
H.seed.set_trait(TRAIT_ENDURANCE,max(H.seed.get_trait(TRAIT_ENDURANCE)*1.5,H.seed.get_trait(TRAIT_ENDURANCE)+1))
if(H.toxins && prob(10))
H.toxins = min(0, H.toxins - 1)
toxic++

View File

@@ -0,0 +1,126 @@
/obj/machinery/portable_atmospherics/hydroponics/process()
//Do this even if we're not ready for a plant cycle.
process_reagents()
// Update values every cycle rather than every process() tick.
if(force_update)
force_update = 0
else if(world.time < (lastcycle + cycledelay))
return
lastcycle = world.time
// Mutation level drops each main tick.
mutation_level -= rand(2,4)
// Weeds like water and nutrients, there's a chance the weed population will increase.
// Bonus chance if the tray is unoccupied.
if(waterlevel > 10 && nutrilevel > 2 && prob(isnull(seed) ? 5 : 1))
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
// There's a chance for a weed explosion to happen if the weeds take over.
// Plants that are themselves weeds (weed_tolerance > 10) are unaffected.
if (weedlevel >= 10 && prob(10))
if(!seed || weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
weed_invasion()
// If there is no seed data (and hence nothing planted),
// or the plant is dead, process nothing further.
if(!seed || dead)
if(mechanical) update_icon() //Harvesting would fail to set alert icons properly.
return
// Advance plant age.
if(prob(30)) age += 1 * HYDRO_SPEED_MULTIPLIER
//Highly mutable plants have a chance of mutating every tick.
if(seed.get_trait(TRAIT_IMMUTABLE) == -1)
var/mut_prob = rand(1,100)
if(mut_prob <= 5) mutate(mut_prob == 1 ? 2 : 1)
// Other plants also mutate if enough mutagenic compounds have been added.
if(!seed.get_trait(TRAIT_IMMUTABLE))
if(prob(min(mutation_level,100)))
mutate((rand(100) < 15) ? 2 : 1)
mutation_level = 0
// Maintain tray nutrient and water levels.
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25))
nutrilevel -= max(0,seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
if(seed.get_trait(TRAIT_WATER_CONSUMPTION) > 0 && waterlevel > 0 && prob(25))
waterlevel -= max(0,seed.get_trait(TRAIT_WATER_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
// Make sure the plant is not starving or thirsty. Adequate
// water and nutrients will cause a plant to become healthier.
var/healthmod = rand(1,3) * HYDRO_SPEED_MULTIPLIER
if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS) && prob(35))
health += (nutrilevel < 2 ? -healthmod : healthmod)
if(seed.get_trait(TRAIT_REQUIRES_WATER) && prob(35))
health += (waterlevel < 10 ? -healthmod : healthmod)
// Check that pressure, heat and light are all within bounds.
// First, handle an open system or an unconnected closed system.
var/turf/T = loc
var/datum/gas_mixture/environment
// If we're closed, take from our internal sources.
if(closed_system && (connected_port || holding))
environment = air_contents
// If atmos input is not there, grab from turf.
if(!environment && istype(T)) environment = T.return_air()
if(!environment) return
// Seed datum handles gasses, light and pressure.
if(mechanical && closed_system)
health -= seed.handle_environment(T,environment,tray_light)
else
health -= seed.handle_environment(T,environment)
// If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses
if (closed_system && connected_port)
update_connected_network()
// Toxin levels beyond the plant's tolerance cause damage, but
// toxins are sucked up each tick and slowly reduce over time.
if(toxins > 0)
var/toxin_uptake = max(1,round(toxins/10))
if(toxins > seed.get_trait(TRAIT_TOXINS_TOLERANCE))
health -= toxin_uptake
toxins -= toxin_uptake
// Check for pests and weeds.
// Some carnivorous plants happily eat pests.
if(pestlevel > 0)
if(seed.get_trait(TRAIT_CARNIVOROUS))
health += HYDRO_SPEED_MULTIPLIER
pestlevel -= HYDRO_SPEED_MULTIPLIER
else if (pestlevel >= seed.get_trait(TRAIT_PEST_TOLERANCE))
health -= HYDRO_SPEED_MULTIPLIER
// Some plants thrive and live off of weeds.
if(weedlevel > 0)
if(seed.get_trait(TRAIT_PARASITE))
health += HYDRO_SPEED_MULTIPLIER
weedlevel -= HYDRO_SPEED_MULTIPLIER
else if (weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
health -= HYDRO_SPEED_MULTIPLIER
// Handle life and death.
// When the plant dies, weeds thrive and pests die off.
check_health()
// If enough time (in cycles, not ticks) has passed since the plant was harvested, we're ready to harvest again.
if((age > seed.get_trait(TRAIT_MATURATION)) && \
((age - lastproduce) > seed.get_trait(TRAIT_PRODUCTION)) && \
(!harvest && !dead))
harvest = 1
lastproduce = age
if(prob(3)) // On each tick, there's a chance the pest population will increase
pestlevel += 0.1 * HYDRO_SPEED_MULTIPLIER
// Some seeds will self-harvest if you don't keep a lid on them.
if(seed && seed.can_self_harvest && harvest && !closed_system && prob(5))
harvest()
check_health()
return

View File

@@ -0,0 +1,138 @@
/obj/item/weapon/plantspray
icon = 'icons/obj/hydroponics_machines.dmi'
item_state = "spray"
flags = NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 4
w_class = 2.0
throw_speed = 2
throw_range = 10
var/toxicity = 4
var/pest_kill_str = 0
var/weed_kill_str = 0
/obj/item/weapon/plantspray/weeds // -- Skie
name = "weed-spray"
desc = "It's a toxic mixture, in spray form, to kill small weeds."
icon_state = "weedspray"
weed_kill_str = 6
/obj/item/weapon/plantspray/pests
name = "pest-spray"
desc = "It's some pest eliminator spray! <I>Do not inhale!</I>"
icon_state = "pestspray"
pest_kill_str = 6
/obj/item/weapon/plantspray/pests/old
name = "bottle of pestkiller"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
/obj/item/weapon/plantspray/pests/old/carbaryl
name = "bottle of carbaryl"
icon_state = "bottle16"
toxicity = 4
pest_kill_str = 2
/obj/item/weapon/plantspray/pests/old/lindane
name = "bottle of lindane"
icon_state = "bottle18"
toxicity = 6
pest_kill_str = 4
/obj/item/weapon/plantspray/pests/old/phosmet
name = "bottle of phosmet"
icon_state = "bottle15"
toxicity = 8
pest_kill_str = 7
/obj/item/weapon/minihoe // -- Numbers
name = "mini hoe"
desc = "It's used for removing weeds or scratching your back."
icon = 'icons/obj/weapons.dmi'
icon_state = "hoe"
item_state = "hoe"
flags = CONDUCT | NOBLUDGEON
force = 5.0
throwforce = 7.0
w_class = 2.0
matter = list("metal" = 50)
attack_verb = list("slashed", "sliced", "cut", "clawed")
// *************************************
// Weedkiller defines for hydroponics
// *************************************
/obj/item/weedkiller
name = "bottle of weedkiller"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
var/toxicity = 0
var/weed_kill_str = 0
/obj/item/weedkiller/triclopyr
name = "bottle of glyphosate"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
toxicity = 4
weed_kill_str = 2
/obj/item/weedkiller/lindane
name = "bottle of triclopyr"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle18"
toxicity = 6
weed_kill_str = 4
/obj/item/weedkiller/D24
name = "bottle of 2,4-D"
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle15"
toxicity = 8
weed_kill_str = 7
// *************************************
// Nutrient defines for hydroponics
// *************************************
/obj/item/weapon/reagent_containers/glass/fertilizer
name = "fertilizer bottle"
desc = "A small glass bottle. Can hold up to 10 units."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle16"
flags = OPENCONTAINER
possible_transfer_amounts = null
w_class = 2.0
var/fertilizer //Reagent contained, if any.
//Like a shot glass!
amount_per_transfer_from_this = 10
volume = 10
/obj/item/weapon/reagent_containers/glass/fertilizer/New()
..()
src.pixel_x = rand(-5.0, 5)
src.pixel_y = rand(-5.0, 5)
if(fertilizer)
reagents.add_reagent(fertilizer,10)
/obj/item/weapon/reagent_containers/glass/fertilizer/ez
name = "bottle of E-Z-Nutrient"
icon_state = "bottle16"
fertilizer = "eznutrient"
/obj/item/weapon/reagent_containers/glass/fertilizer/l4z
name = "bottle of Left 4 Zed"
icon_state = "bottle18"
fertilizer = "left4zed"
/obj/item/weapon/reagent_containers/glass/fertilizer/rh
name = "bottle of Robust Harvest"
icon_state = "bottle15"
fertilizer = "robustharvest"

View File

@@ -0,0 +1,67 @@
/obj/machinery/portable_atmospherics/hydroponics/soil
name = "soil"
icon_state = "soil"
density = 0
use_power = 0
mechanical = 0
tray_light = 0
/obj/machinery/portable_atmospherics/hydroponics/soil/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O,/obj/item/weapon/tank))
return
else
..()
/obj/machinery/portable_atmospherics/hydroponics/soil/New()
..()
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/close_lid_verb
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/remove_label
verbs -= /obj/machinery/portable_atmospherics/hydroponics/verb/set_light
/obj/machinery/portable_atmospherics/hydroponics/soil/CanPass()
return 1
// Holder for vine plants.
// Icons for plants are generated as overlays, so setting it to invisible wouldn't work.
// Hence using a blank icon.
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible
name = "plant"
icon = 'icons/obj/seeds.dmi'
icon_state = "blank"
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/New(var/newloc,var/datum/seed/newseed)
..()
seed = newseed
dead = 0
age = 1
health = seed.get_trait(TRAIT_ENDURANCE)
lastcycle = world.time
pixel_y = rand(-5,5)
check_health()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/remove_dead()
..()
del(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest()
..()
if(!seed) // Repeat harvests are a thing.
del(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/die()
del(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/process()
if(!seed)
del(src)
return
else if(name=="plant")
name = seed.display_name
..()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Del()
// Check if we're masking a decal that needs to be visible again.
for(var/obj/effect/plant/plant in get_turf(src))
if(plant.invisibility == INVISIBILITY_MAXIMUM)
plant.invisibility = initial(plant.invisibility)
..()

View File

@@ -0,0 +1,271 @@
//Analyzer, pestkillers, weedkillers, nutrients, hatchets, cutters.
/obj/item/weapon/wirecutters/clippers
name = "plant clippers"
desc = "A tool used to take samples from plants."
/obj/item/device/analyzer/plant_analyzer
name = "plant analyzer"
icon = 'icons/obj/device.dmi'
icon_state = "hydro"
item_state = "analyzer"
var/form_title
var/last_data
/obj/item/device/analyzer/plant_analyzer/proc/print_report_verb()
set name = "Print Plant Report"
set category = "Object"
set src = usr
if(usr.stat || usr.restrained() || usr.lying)
return
print_report(usr)
/obj/item/device/analyzer/plant_analyzer/Topic(href, href_list)
if(..())
return
if(href_list["print"])
print_report(usr)
/obj/item/device/analyzer/plant_analyzer/proc/print_report(var/mob/living/user)
if(!last_data)
user << "There is no scan data to print."
return
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(get_turf(src))
P.name = "paper - [form_title]"
P.info = "[last_data]"
if(istype(user,/mob/living/carbon/human) && !(user.l_hand && user.r_hand))
user.put_in_hands(P)
user.visible_message("\The [src] spits out a piece of paper.")
return
/obj/item/device/analyzer/plant_analyzer/attack_self(mob/user as mob)
print_report(user)
return 0
/obj/item/device/analyzer/plant_analyzer/afterattack(obj/target, mob/user, flag)
if(!flag) return
var/datum/seed/grown_seed
var/datum/reagents/grown_reagents
if(istype(target,/obj/structure/table))
return ..()
else if(istype(target,/obj/item/weapon/reagent_containers/food/snacks/grown))
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = target
grown_seed = plant_controller.seeds[G.plantname]
grown_reagents = G.reagents
else if(istype(target,/obj/item/weapon/grown))
var/obj/item/weapon/grown/G = target
grown_seed = plant_controller.seeds[G.plantname]
grown_reagents = G.reagents
else if(istype(target,/obj/item/seeds))
var/obj/item/seeds/S = target
grown_seed = S.seed
else if(istype(target,/obj/machinery/portable_atmospherics/hydroponics))
var/obj/machinery/portable_atmospherics/hydroponics/H = target
grown_seed = H.seed
grown_reagents = H.reagents
if(!grown_seed)
user << "<span class='danger'>[src] can tell you nothing about \the [target].</span>"
return
form_title = "[grown_seed.seed_name] (#[grown_seed.uid])"
var/dat = "<h3>Plant data for [form_title]</h3>"
user.visible_message("<span class='notice'>[user] runs the scanner over \the [target].</span>")
dat += "<h2>General Data</h2>"
dat += "<table>"
dat += "<tr><td><b>Endurance</b></td><td>[grown_seed.get_trait(TRAIT_ENDURANCE)]</td></tr>"
dat += "<tr><td><b>Yield</b></td><td>[grown_seed.get_trait(TRAIT_YIELD)]</td></tr>"
dat += "<tr><td><b>Maturation time</b></td><td>[grown_seed.get_trait(TRAIT_MATURATION)]</td></tr>"
dat += "<tr><td><b>Production time</b></td><td>[grown_seed.get_trait(TRAIT_PRODUCTION)]</td></tr>"
dat += "<tr><td><b>Potency</b></td><td>[grown_seed.get_trait(TRAIT_POTENCY)]</td></tr>"
dat += "</table>"
if(grown_reagents && grown_reagents.reagent_list && grown_reagents.reagent_list.len)
dat += "<h2>Reagent Data</h2>"
dat += "<br>This sample contains: "
for(var/datum/reagent/R in grown_reagents.reagent_list)
dat += "<br>- [R.id], [grown_reagents.get_reagent_amount(R.id)] unit(s)"
dat += "<h2>Other Data</h2>"
if(grown_seed.get_trait(TRAIT_HARVEST_REPEAT))
dat += "This plant can be harvested repeatedly.<br>"
if(grown_seed.get_trait(TRAIT_IMMUTABLE) == -1)
dat += "This plant is highly mutable.<br>"
else if(grown_seed.get_trait(TRAIT_IMMUTABLE) > 0)
dat += "This plant does not possess genetics that are alterable.<br>"
if(grown_seed.get_trait(TRAIT_REQUIRES_NUTRIENTS))
if(grown_seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) < 0.05)
dat += "It consumes a small amount of nutrient fluid.<br>"
else if(grown_seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0.2)
dat += "It requires a heavy supply of nutrient fluid.<br>"
else
dat += "It requires a supply of nutrient fluid.<br>"
if(grown_seed.get_trait(TRAIT_REQUIRES_WATER))
if(grown_seed.get_trait(TRAIT_WATER_CONSUMPTION) < 1)
dat += "It requires very little water.<br>"
else if(grown_seed.get_trait(TRAIT_WATER_CONSUMPTION) > 5)
dat += "It requires a large amount of water.<br>"
else
dat += "It requires a stable supply of water.<br>"
if(grown_seed.mutants && grown_seed.mutants.len)
dat += "It exhibits a high degree of potential subspecies shift.<br>"
dat += "It thrives in a temperature of [grown_seed.get_trait(TRAIT_IDEAL_HEAT)] Kelvin."
if(grown_seed.get_trait(TRAIT_LOWKPA_TOLERANCE) < 20)
dat += "<br>It is well adapted to low pressure levels."
if(grown_seed.get_trait(TRAIT_HIGHKPA_TOLERANCE) > 220)
dat += "<br>It is well adapted to high pressure levels."
if(grown_seed.get_trait(TRAIT_HEAT_TOLERANCE) > 30)
dat += "<br>It is well adapted to a range of temperatures."
else if(grown_seed.get_trait(TRAIT_HEAT_TOLERANCE) < 10)
dat += "<br>It is very sensitive to temperature shifts."
dat += "<br>It thrives in a light level of [grown_seed.get_trait(TRAIT_IDEAL_LIGHT)] lumen[grown_seed.get_trait(TRAIT_IDEAL_LIGHT) == 1 ? "" : "s"]."
if(grown_seed.get_trait(TRAIT_LIGHT_TOLERANCE) > 10)
dat += "<br>It is well adapted to a range of light levels."
else if(grown_seed.get_trait(TRAIT_LIGHT_TOLERANCE) < 3)
dat += "<br>It is very sensitive to light level shifts."
if(grown_seed.get_trait(TRAIT_TOXINS_TOLERANCE) < 3)
dat += "<br>It is highly sensitive to toxins."
else if(grown_seed.get_trait(TRAIT_TOXINS_TOLERANCE) > 6)
dat += "<br>It is remarkably resistant to toxins."
if(grown_seed.get_trait(TRAIT_PEST_TOLERANCE) < 3)
dat += "<br>It is highly sensitive to pests."
else if(grown_seed.get_trait(TRAIT_PEST_TOLERANCE) > 6)
dat += "<br>It is remarkably resistant to pests."
if(grown_seed.get_trait(TRAIT_WEED_TOLERANCE) < 3)
dat += "<br>It is highly sensitive to weeds."
else if(grown_seed.get_trait(TRAIT_WEED_TOLERANCE) > 6)
dat += "<br>It is remarkably resistant to weeds."
switch(grown_seed.get_trait(TRAIT_SPREAD))
if(1)
dat += "<br>It is able to be planted outside of a tray."
if(2)
dat += "<br>It is a robust and vigorous vine that will spread rapidly."
switch(grown_seed.get_trait(TRAIT_CARNIVOROUS))
if(1)
dat += "<br>It is carniovorous and will eat tray pests for sustenance."
if(2)
dat += "<br>It is carnivorous and poses a significant threat to living things around it."
if(grown_seed.get_trait(TRAIT_PARASITE))
dat += "<br>It is capable of parisitizing and gaining sustenance from tray weeds."
if(grown_seed.get_trait(TRAIT_ALTER_TEMP))
dat += "<br>It will periodically alter the local temperature by [grown_seed.get_trait(TRAIT_ALTER_TEMP)] degrees Kelvin."
if(grown_seed.get_trait(TRAIT_BIOLUM))
dat += "<br>It is [grown_seed.get_trait(TRAIT_BIOLUM_COLOUR) ? "<font color='[grown_seed.get_trait(TRAIT_BIOLUM_COLOUR)]'>bio-luminescent</font>" : "bio-luminescent"]."
if(grown_seed.get_trait(TRAIT_PRODUCES_POWER))
dat += "<br>The fruit will function as a battery if prepared appropriately."
if(grown_seed.get_trait(TRAIT_STINGS))
dat += "<br>The fruit is covered in stinging spines."
if(grown_seed.get_trait(TRAIT_JUICY) == 1)
dat += "<br>The fruit is soft-skinned and juicy."
else if(grown_seed.get_trait(TRAIT_JUICY) == 2)
dat += "<br>The fruit is excessively juicy."
if(grown_seed.get_trait(TRAIT_EXPLOSIVE))
dat += "<br>The fruit is internally unstable."
if(grown_seed.get_trait(TRAIT_TELEPORTING))
dat += "<br>The fruit is temporal/spatially unstable."
dat += "<br><br>\[<a href='?src=\ref[src];print=1'>print report</a>\]"
if(dat)
user << browse(dat,"window=plant_analyzer")
last_data = dat
return
/obj/item/weapon/minihoe // -- Numbers
name = "mini hoe"
desc = "It's used for removing weeds or scratching your back."
icon = 'icons/obj/weapons.dmi'
icon_state = "hoe"
item_state = "hoe"
flags = CONDUCT | NOBLUDGEON
force = 5.0
throwforce = 7.0
w_class = 2.0
matter = list("metal" = 50)
attack_verb = list("slashed", "sliced", "cut", "clawed")
//Hatchets and things to kill kudzu
/obj/item/weapon/hatchet
name = "hatchet"
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
icon = 'icons/obj/weapons.dmi'
icon_state = "hatchet"
flags = CONDUCT
force = 12.0
w_class = 2.0
throwforce = 15.0
throw_speed = 4
throw_range = 4
sharp = 1
edge = 1
matter = list("metal" = 15000)
origin_tech = "materials=2;combat=1"
attack_verb = list("chopped", "torn", "cut")
/obj/item/weapon/hatchet/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
//If it's a hatchet it goes here. I guess
/obj/item/weapon/hatchet/unathiknife
name = "duelling knife"
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
icon = 'icons/obj/weapons.dmi'
icon_state = "unathiknife"
attack_verb = list("ripped", "torn", "cut")
/obj/item/weapon/scythe
icon_state = "scythe0"
name = "scythe"
desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow."
force = 13.0
throwforce = 5.0
throw_speed = 1
throw_range = 3
w_class = 4.0
flags = NOSHIELD
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity) return
if(istype(A, /obj/effect/plant))
for(var/obj/effect/plant/B in orange(A,1))
if(prob(80))
B.die_off(1)
del A

View File

@@ -0,0 +1,83 @@
//Refreshes the icon and sets the luminosity
/obj/machinery/portable_atmospherics/hydroponics/update_icon()
// Update name.
if(seed)
if(mechanical)
name = "[base_name] (#[seed.uid])"
else
name = "[seed.seed_name]"
else
name = initial(name)
if(labelled)
name += " ([labelled])"
overlays.Cut()
// Updates the plant overlay.
if(!isnull(seed))
if(mechanical && health <= (seed.get_trait(TRAIT_ENDURANCE) / 2))
overlays += "over_lowhealth3"
if(dead)
var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-dead"
var/image/dead_overlay = plant_controller.plant_icon_cache["[ikey]"]
if(!dead_overlay)
dead_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]")
dead_overlay.color = DEAD_PLANT_COLOUR
overlays |= dead_overlay
else
if(!seed.growth_stages)
seed.update_growth_stages()
if(!seed.growth_stages)
world << "<span class='danger'>Seed type [seed.get_trait(TRAIT_PLANT_ICON)] cannot find a growth stage value.</span>"
return
var/overlay_stage = 1
if(age >= seed.get_trait(TRAIT_MATURATION))
overlay_stage = seed.growth_stages
else
overlay_stage = max(1,round(age/round(seed.get_trait(TRAIT_MATURATION)/seed.growth_stages)))
var/ikey = "[seed.get_trait(TRAIT_PLANT_ICON)]-[overlay_stage]"
var/image/plant_overlay = plant_controller.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"]
if(!plant_overlay)
plant_overlay = image('icons/obj/hydroponics_growing.dmi', "[ikey]")
plant_overlay.color = seed.get_trait(TRAIT_PLANT_COLOUR)
plant_controller.plant_icon_cache["[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"] = plant_overlay
overlays |= plant_overlay
if(harvest && overlay_stage == seed.growth_stages)
ikey = "[seed.get_trait(TRAIT_PRODUCT_ICON)]"
var/image/harvest_overlay = plant_controller.plant_icon_cache["product-[ikey]-[seed.get_trait(TRAIT_PLANT_COLOUR)]"]
if(!harvest_overlay)
harvest_overlay = image('icons/obj/hydroponics_products.dmi', "[ikey]")
harvest_overlay.color = seed.get_trait(TRAIT_PRODUCT_COLOUR)
plant_controller.plant_icon_cache["product-[ikey]-[seed.get_trait(TRAIT_PRODUCT_COLOUR)]"] = harvest_overlay
overlays |= harvest_overlay
//Draw the cover.
if(closed_system)
overlays += "hydrocover"
//Updated the various alert icons.
if(mechanical)
if(waterlevel <= 10)
overlays += "over_lowwater3"
if(nutrilevel <= 2)
overlays += "over_lownutri3"
if(weedlevel >= 5 || pestlevel >= 5 || toxins >= 40)
overlays += "over_alert3"
if(harvest)
overlays += "over_harvest3"
// Update bioluminescence.
if(seed)
if(seed.get_trait(TRAIT_BIOLUM))
SetLuminosity(round(seed.get_trait(TRAIT_POTENCY)/10))
if(seed.get_trait(TRAIT_BIOLUM_COLOUR))
l_color = seed.get_trait(TRAIT_BIOLUM_COLOUR)
else
l_color = null
return
SetLuminosity(0)
return

Some files were not shown because too many files have changed in this diff Show More