Adds holoplants, and to cargo

Courtesy of CEV Eris SS13 server (plus a bunch of additional code to make them real machines)
This commit is contained in:
Arokha Sieyes
2018-02-20 19:36:11 -05:00
parent d498beffdb
commit beba012f5a
4 changed files with 113 additions and 0 deletions

View File

@@ -70,3 +70,10 @@
cost = 10
containertype = "/obj/structure/closet/crate"
containername = "Webbing crate"
/datum/supply_packs/misc/holoplant
name = "Holoplant Pot"
contains = list()
cost = 15
containertype = /obj/machinery/holoplant/shipped
containername = "holoplant"

View File

@@ -0,0 +1,105 @@
/obj/machinery/holoplant
name = "holoplant"
desc = "One of those Ward-Takahashi holoplants! Give your space a bit of the comfort of being outdoors, by buying this blue buddy. A rugged case guarantees that your flower will outlive you, and variety of plant types won't let you to get bored along the way!"
icon = 'icons/obj/holoplants.dmi'
icon_state = "holopot"
light_color = "#3C94C5"
anchored = TRUE
idle_power_usage = 0
active_power_usage = 5
var/interference = FALSE
var/icon/plant = null
var/global/list/possible_plants = list(
"plant-1",
"plant-10",
"plant-09",
"plant-15",
"plant-13"
)
/obj/machinery/holoplant/initialize()
. = ..()
activate()
/obj/machinery/holoplant/attack_hand(var/mob/living/user)
if(!istype(user) || interference)
return
if(!anchored)
to_chat(user,"<span class='warning'>\The [src] must be anchored before activation!</span>")
return
if(!plant)
activate()
else
deactivate()
/obj/machinery/holoplant/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(default_unfasten_wrench(user, O, 10))
deactivate()
return
. = ..()
/obj/machinery/holoplant/proc/activate()
if(!anchored || stat & (NOPOWER|BROKEN))
return
plant = prepare_icon(emagged ? "emagged" : null)
overlays += plant
set_light(2)
use_power = 2
/obj/machinery/holoplant/proc/deactivate()
overlays -= plant
qdel_null(plant)
set_light(0)
use_power = 0
/obj/machinery/holoplant/power_change()
..()
if(stat & NOPOWER)
deactivate()
else
activate()
/obj/machinery/holoplant/proc/flicker()
interference = TRUE
spawn(0)
overlays -= plant
set_light(0)
sleep(rand(2,4))
overlays += plant
set_light(2)
sleep(rand(2,4))
overlays -= plant
set_light(0)
sleep(rand(2,4))
overlays += plant
set_light(2)
interference = FALSE
/obj/machinery/holoplant/proc/prepare_icon(var/state)
if(!state)
state = pick(possible_plants)
var/plant_icon = icon(icon, state)
return getHologramIcon(plant_icon, 0)
/obj/machinery/holoplant/emag_act()
if(emagged)
return
emagged = TRUE
if(plant)
deactivate()
activate()
/obj/machinery/holoplant/Crossed(var/mob/living/L)
if(!interference && plant && istype(L))
flicker()
/obj/machinery/holoplant/shipped
anchored = FALSE
/obj/machinery/holoplant/shipped/initialize()
. = ..()

BIN
icons/obj/holoplants.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -1032,6 +1032,7 @@
#include "code\game\objects\structures\girders.dm"
#include "code\game\objects\structures\gravemarker.dm"
#include "code\game\objects\structures\grille.dm"
#include "code\game\objects\structures\holoplant.dm"
#include "code\game\objects\structures\inflatable.dm"
#include "code\game\objects\structures\janicart.dm"
#include "code\game\objects\structures\kitchen_spike.dm"