Exploration Expansion 1: Or, How I Learned To Love The Tree

This commit is contained in:
Mechoid
2019-08-21 17:23:07 -04:00
committed by VirgoBot
parent de7aa33a5e
commit ae48659a68
67 changed files with 2229 additions and 94 deletions
+92 -3
View File
@@ -1,14 +1,82 @@
/obj/structure/flora
name = "flora"
desc = "A perfectly generic plant."
anchored = TRUE // Usually, plants don't move. Usually.
plane = DECAL_PLANE
layer = BELOW_MOB_LAYER
var/randomize_size = FALSE
var/max_x_scale = 1.25
var/max_y_scale = 1.25
var/min_x_scale = 0.9
var/min_y_scale = 0.9
var/harvest_tool = null // The type of item used to harvest the plant.
var/harvest_count = 0
var/randomize_harvest_count = TRUE
var/max_harvests = 0
var/min_harvests = -1
var/list/harvest_loot = null // Should be an associative list for things to spawn, and their weights. An example would be a branch from a tree.
/obj/structure/flora/Initialize()
..()
if(randomize_size)
icon_scale_x = rand(min_x_scale * 100, max_x_scale * 100) / 100
icon_scale_y = rand(min_y_scale * 100, max_y_scale * 100) / 100
if(prob(50))
icon_scale_x *= -1
update_transform()
if(randomize_harvest_count)
max_harvests = max(0, rand(min_harvests, max_harvests)) // Incase you want to weight it more toward 'not harvestable', set min_harvests to a negative value.
/obj/structure/flora/examine(mob/user)
. = ..(user)
if(harvest_count < max_harvests)
to_chat(user, "<span class='notice'>\The [src] seems to have something hanging from it.</span>")
/obj/structure/flora/attackby(var/obj/item/weapon/W, var/mob/living/user)
if(can_harvest(W))
var/harvest_spawn = pickweight(harvest_loot)
var/atom/movable/AM = spawn_harvest(harvest_spawn, user)
if(!AM)
to_chat(user, "<span class='notice'>You fail to harvest anything from \the [src].</span>")
else
to_chat(user, "<span class='notice'>You harvest \the [AM] from \the [src].</span>")
return
..(W, user)
/obj/structure/flora/proc/can_harvest(var/obj/item/I)
. = FALSE
if(harvest_tool && istype(I, harvest_tool) && harvest_loot && harvest_loot.len && harvest_count < max_harvests)
. = TRUE
return .
/obj/structure/flora/proc/spawn_harvest(var/path = null, var/mob/user = null)
if(!ispath(path))
return 0
var/turf/Target = get_turf(src)
if(user)
Target = get_turf(user)
var/atom/movable/AM = new path(Target)
harvest_count++
return AM
//bushes
/obj/structure/flora/bush
name = "bush"
icon = 'icons/obj/flora/snowflora.dmi'
icon_state = "snowbush1"
anchored = 1
/obj/structure/flora/bush/New()
..()
@@ -20,6 +88,7 @@
icon = 'icons/obj/plants.dmi'
icon_state = "plant-26"
anchored = FALSE
//newbushes
@@ -27,7 +96,6 @@
name = "bush"
icon = 'icons/obj/flora/ausflora.dmi'
icon_state = "firstbush_1"
anchored = 1
/obj/structure/flora/ausbushes/New()
..()
@@ -144,6 +212,7 @@
icon_state = "hangskele"
desc = "It's an anatomical model of a human skeletal system made of plaster."
plane = OBJ_PLANE
//potted plants credit: Flashkirby
/obj/structure/flora/pottedplant
@@ -152,6 +221,8 @@
icon = 'icons/obj/plants.dmi'
icon_state = "plant-01"
plane = OBJ_PLANE
/obj/structure/flora/pottedplant/large
name = "large potted plant"
desc = "This is a large plant. Three branches support pairs of waxy leaves."
@@ -348,4 +419,22 @@
/obj/structure/flora/sif/eyes/Initialize()
icon_state = "[initial(icon_state)][rand(1,3)]"
. = ..()
. = ..()
/datum/category_item/catalogue/flora/mosstendrils
name = "Sivian Flora - Moss Stalks"
desc = "A plant native to Sif. The plant is most closely related to the common, dense moss found covering Sif's terrain. \
It has evolved a method of camouflage utilizing white hairs on its dorsal sides to make it appear as a small mound of snow from \
above. It has no known use, though it is a common furnishing in contemporary homes."
value = CATALOGUER_REWARD_TRIVIAL
/obj/structure/flora/sif/tendrils
name = "stocky tendrils"
desc = "A 'plant' made up of hardened moss. It has tiny hairs that bunch together to look like snow."
icon_state = "grass"
randomize_size = TRUE
catalogue_data = list(/datum/category_item/catalogue/flora/mosstendrils)
/obj/structure/flora/sif/tendrils/Initialize()
icon_state = "[initial(icon_state)][rand(1,3)]"
. = ..()
+18 -9
View File
@@ -14,19 +14,10 @@
var/product_amount = 10 // How much of a stack you get, if the above is defined.
var/is_stump = FALSE // If true, suspends damage tracking and most other effects.
var/indestructable = FALSE // If true, the tree cannot die.
var/randomize_size = FALSE // If true, the tree will choose a random scale in the X and Y directions to stretch.
/obj/structure/flora/tree/Initialize()
icon_state = choose_icon_state()
if(randomize_size)
icon_scale_x = rand(90, 125) / 100
icon_scale_y = rand(90, 125) / 100
if(prob(50))
icon_scale_x *= -1
update_transform()
return ..()
/obj/structure/flora/tree/update_transform()
@@ -39,7 +30,17 @@
/obj/structure/flora/tree/proc/choose_icon_state()
return icon_state
/obj/structure/flora/tree/can_harvest(var/obj/item/I)
. = FALSE
if(!is_stump && harvest_tool && istype(I, harvest_tool) && harvest_loot && harvest_loot.len && harvest_count < max_harvests)
. = TRUE
return .
/obj/structure/flora/tree/attackby(var/obj/item/weapon/W, var/mob/living/user)
if(can_harvest(W))
..(W, user)
return
if(!istype(W))
return ..()
@@ -267,6 +268,14 @@
product = /obj/item/stack/material/log/sif
catalogue_data = list(/datum/category_item/catalogue/flora/sif_tree)
randomize_size = TRUE
harvest_tool = /obj/item/weapon/material/knife
max_harvests = 2
min_harvests = -4
harvest_loot = list(
/obj/item/weapon/reagent_containers/food/snacks/siffruit = 5
)
var/light_shift = 0
/obj/structure/flora/tree/sif/choose_icon_state()
+25 -1
View File
@@ -105,4 +105,28 @@
**16/FEB/2562**<BR>
<B>Something chitters.</B><BR>
<B>End of transcript.</B>
"}
"}
/obj/structure/prop/blackbox/xenofrigate
catalogue_data = list(/datum/category_item/catalogue/information/blackbox/xenofrigate)
/datum/category_item/catalogue/information/blackbox/xenofrigate
name = "Black Box Data - MBT-540"
desc = {"
<BR>
<B>Begin Log</B>
<B>@$&@$& Human ##:##:##:</B> Attention unidentified vessel, state your designation and intent.<BR>
<B>!#@$&&^ Human ##:##:##:</B> Commander I don't think they're going to stop.<BR>
<B>@$&@$& Human ##:##:##:</B> Unidentified vessel, you have until the count of three before we engage weapon-<BR>
<B>!#@$&&^ Human ##:##:##:</B> Commander! Think about what you're-<BR>
<B>A repeating clicking, before silence.</B><BR>
<B>End of first log.</B><BR>
**<BR>
<B>Begin Log</B><BR>
<B>#!#^@$& Skrell ##:##:##:</B> Director, I think you should see this.<BR>
<B>^@$& Skrell ##:##:##:</B> Yes? What is it?<BR>
<B>#!#^@$& Skrell ##:##:##:</B> Another one of those ships has appeared near th-462$^ ---n colonies. I would strongly advise pursuing it.<BR>
<B>^@$& Skrell ##:##:##:</B> A wise decision. If it is damaged like the last one, we may be able to finally see what is - What?<BR>
<B>A repeating ping, before silence.</B><BR>
<B>End of second log.</B>
"}