Skip to content

Commit

Permalink
apples and mortars
Browse files Browse the repository at this point in the history
the tree now drops apples with the bacteria and mortars more like big
  • Loading branch information
FalloutFalcon committed Aug 20, 2023
1 parent 62040d0 commit a446053
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 67 deletions.
3 changes: 2 additions & 1 deletion code/game/objects/items/manuals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,13 @@
The simplest way I have found of making them is crafting them with a chunk of glass, plasma, and a welder.<br>

<h2> Bacteria </h2>
A speical speices of bacteria native to Illestern is what allows Trickwines form.<br>
A speical speices of bacteria native to Illestren is what allows Trickwines form.<br>
Now we use a special distiller that keeps just enough bacertia alive to ferment without turning the batch sour.<br>
Now you should still have one on board but if you dont its fine.<br>
It just so happens we have trees on board our ships host to the Bacteria.<br>
To get enough Bacteria your going to need to feed it anything that would help a plant.<br>
Water, Fertilizer, Ashwine are all good options.<br>
Soon it will drops some apples and you can grind them for the bacteria.<br>
Once you have enough you can fabricate it the same way you would a normal barrel.<br>

<h2> Ashwine </h2>
Expand Down
65 changes: 34 additions & 31 deletions code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -726,33 +726,35 @@
bound_height = 64
var/health = 0
var/lastcycle = 0
//Decides where the apple gets dropped
var/apple_direction = SOUTH
//Determines the health gained/lost when feeding the tree this chem
var/list/healthchems = list(
/datum/reagent/consumable/ethanol/ash_wine = 0.08,
/datum/reagent/water = 0.01,
/datum/reagent/plantnutriment = 0.02,
/datum/reagent/medicine/earthsblood = 0.1,
/datum/reagent/water/holywater = 0.08,
/datum/reagent/medicine/cryoxadone = 0.03,
/datum/reagent/ammonia = 0.04,
/datum/reagent/saltpetre = 0.05,
/datum/reagent/ash = 0.02,
/datum/reagent/diethylamine = 0.05,
/datum/reagent/consumable/nutriment = 0.01,
/datum/reagent/consumable/virus_food = 0.01,
/datum/reagent/blood = -0.01,
/datum/reagent/consumable/ethanol = -0.01,
/datum/reagent/toxin = -0.02,
/datum/reagent/fluorine = -0.03,
/datum/reagent/chlorine = -0.03,
/datum/reagent/toxin/acid = -0.03,
/datum/reagent/toxin/acid/fluacid = -0.04,
/datum/reagent/toxin/plantbgone = -0.05,
/datum/reagent/napalm = -0.06,
/datum/reagent/hellwater = -0.1,
/datum/reagent/liquidgibs = -0.02,
/datum/reagent/consumable/ethanol/demonsblood = -0.08,
/datum/reagent/medicine/soulus = -0.02
/datum/reagent/consumable/ethanol/ash_wine = 0.8,
/datum/reagent/water = 0.1,
/datum/reagent/plantnutriment = 0.2,
/datum/reagent/medicine/earthsblood = 1,
/datum/reagent/water/holywater = 0.8,
/datum/reagent/medicine/cryoxadone = 0.3,
/datum/reagent/ammonia = 0.4,
/datum/reagent/saltpetre = 0.5,
/datum/reagent/ash = 0.2,
/datum/reagent/diethylamine = 0.5,
/datum/reagent/consumable/nutriment = 0.1,
/datum/reagent/consumable/virus_food = 0.1,
/datum/reagent/blood = -0.1,
/datum/reagent/consumable/ethanol = -0.1,
/datum/reagent/toxin = -0.2,
/datum/reagent/fluorine = -0.3,
/datum/reagent/chlorine = -0.3,
/datum/reagent/toxin/acid = -0.3,
/datum/reagent/toxin/acid/fluacid = -0.4,
/datum/reagent/toxin/plantbgone = -0.5,
/datum/reagent/napalm = -0.6,
/datum/reagent/hellwater = -1,
/datum/reagent/liquidgibs = -0.2,
/datum/reagent/consumable/ethanol/demonsblood = -0.8,
/datum/reagent/medicine/soulus = -0.2
)

/obj/structure/flora/tree/srm/Initialize()
Expand All @@ -772,13 +774,14 @@
gainedhealth += reagents.get_reagent_amount(reagent) * healthchems[reagent]
health += gainedhealth
reagents.remove_reagent(reagent, reagents.get_reagent_amount(reagent))
if(health > 10)
if(prob(25))
var/obj/item/reagent_containers/food/snacks/grown/apple/apple = new
apple.name = "Illestern" + initial(src.name)
reagents.clear_reagents()
if(health > 25)
if(prob(50))
var/obj/item/reagent_containers/food/snacks/grown/apple/apple = new(get_step(get_turf(src), apple_direction))
apple.name = "Illestren Apple"
apple.reagents.add_reagent(/datum/reagent/srm_bacteria, 10)
visible_message("<span class='green'> An [apple] falls from the tree.</span>")
health -= 10
visible_message("<span class='green'>An [apple] falls from the tree.</span>")
health -= 25
//Clean up the air a bit
if(isopenturf(loc))
var/turf/open/T = src.loc
Expand Down
6 changes: 1 addition & 5 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2789,8 +2789,4 @@
name = "Illestren Bacteria"
description = "Bacteria native to the Saint-Roumain Militia home planet."
color = "#5a4f42"
taste_description = "vomit inducing"

/datum/reagent/srm_bacteria/on_mob_life(mob/living/carbon/M)
if(prob(10))
M.vomit()
taste_description = "sour"
103 changes: 73 additions & 30 deletions code/modules/reagents/reagent_containers/mortar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Originally in glass.dm, moved here
to accommodate additional materials.
\*/

#define MORTAR_STAMINA_MINIMUM 50 //What is the amount of stam damage that we prevent mortar use at
#define MORTAR_STAMINA_USE 40 //How much stam damage is given to people when the mortar is used

/obj/item/pestle
name = "pestle"
desc = "An ancient, simple tool used in conjunction with a mortar to grind or juice items."
Expand Down Expand Up @@ -33,41 +36,81 @@ to accommodate additional materials.
grinded = null
to_chat(user, "<span class='notice'>You eject the item inside.</span>")

/obj/item/reagent_containers/glass/mortar/attackby(obj/item/I, mob/living/carbon/human/user)
/obj/item/reagent_containers/glass/mortar/attackby(obj/item/attacking_item, mob/living/carbon/human/user)
..()
if(istype(I,/obj/item/pestle))
if(grinded)
if(user.getStaminaLoss() > 50)
to_chat(user, "<span class='warning'>You are too tired to work!</span>")
return
to_chat(user, "<span class='notice'>You start grinding...</span>")
if((do_after(user, 25, target = src)) && grinded)
user.adjustStaminaLoss(40)
if(grinded.juice_results) //prioritize juicing
grinded.on_juice()
reagents.add_reagent_list(grinded.juice_results)
to_chat(user, "<span class='notice'>You juice [grinded] into a fine liquid.</span>")
QDEL_NULL(grinded)
return
grinded.on_grind()
reagents.add_reagent_list(grinded.grind_results)
if(grinded.reagents) //food and pills
grinded.reagents.trans_to(src, grinded.reagents.total_volume, transfered_by = user)
to_chat(user, "<span class='notice'>You break [grinded] into powder.</span>")
QDEL_NULL(grinded)
return
if(istype(attacking_item, /obj/item/pestle))
if(!grinded)
balloon_alert(user, "nothing to grind")
return
else
to_chat(user, "<span class='warning'>There is nothing to grind!</span>")

if(user.getStaminaLoss() > MORTAR_STAMINA_MINIMUM)
balloon_alert(user, "too tired")
return
if(grinded)
to_chat(user, "<span class='warning'>There is something inside already!</span>")

var/list/choose_options = list(
"Grind" = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_grind"),
"Juice" = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_juice")
)
var/picked_option = show_radial_menu(user, src, choose_options, radius = 38, require_near = TRUE)

if(!grinded || !in_range(src, user) || !user.is_holding(attacking_item) && !picked_option)
return

balloon_alert(user, "grinding...")
if(!do_after(user, grind_speed, target = src))
balloon_alert(user, "stopped grinding")
return

user.adjustStaminaLoss(MORTAR_STAMINA_USE)
switch(picked_option)
if("Juice")
if(grinded.juice_results)
juice_target_item(grinded, user)
else
grind_target_item(grinded, user)

if("Grind")
if(grinded.grind_results)
grind_target_item(grinded, user)
else
juice_target_item(grinded, user)
return
if(I.juice_results || I.grind_results)
I.forceMove(src)
grinded = I

if(!attacking_item.juice_results && !attacking_item.grind_results)
balloon_alert(user, "can't grind this")
return ..()

if(grinded)
balloon_alert(user, "already full")
return
to_chat(user, "<span class='warning'>You can't grind this!</span>")

attacking_item.forceMove(src)
grinded = attacking_item

///Juices the passed target item, and transfers any contained chems to the mortar as well
/obj/item/reagent_containers/glass/mortar/proc/juice_target_item(obj/item/to_be_juiced, mob/living/carbon/human/user)
to_be_juiced.on_juice()
reagents.add_reagent_list(to_be_juiced.juice_results)

if(to_be_juiced.reagents) //If juiced item has reagents within, transfer them to the mortar
to_be_juiced.reagents.trans_to(src, to_be_juiced.reagents.total_volume, transfered_by = user)

to_chat(user, span_notice("You juice [to_be_juiced] into a fine liquid."))
QDEL_NULL(to_be_juiced)

///Grinds the passed target item, and transfers any contained chems to the mortar as well
/obj/item/reagent_containers/glass/mortar/proc/grind_target_item(obj/item/to_be_ground, mob/living/carbon/human/user)
to_be_ground.on_grind()
reagents.add_reagent_list(to_be_ground.grind_results)

if(to_be_ground.reagents) //If grinded item has reagents within, transfer them to the mortar
to_be_ground.reagents.trans_to(src, to_be_ground.reagents.total_volume, transfered_by = user)

to_chat(user, span_notice("You break [to_be_ground] into powder."))
QDEL_NULL(to_be_ground)

#undef MORTAR_STAMINA_MINIMUM
#undef MORTAR_STAMINA_USE

/obj/item/reagent_containers/glass/mortar/glass //mmm yes... this glass is made of glass
icon_state = "mortar_glass"
Expand Down

0 comments on commit a446053

Please sign in to comment.