From 514d9436dc1ea56f22a98f4c197c6b15fe7e0f79 Mon Sep 17 00:00:00 2001 From: Alphas00 <154434082+Alphas00@users.noreply.github.com> Date: Fri, 14 Jun 2024 21:11:59 +0200 Subject: [PATCH] Kudzu Update Added stable, prickly and timid kudzu mutations. Space drugs now cause kudzu in trays to develop mutations --- GainStation13/code/mechanics/water_sponge.dm | 13 ++-- code/modules/events/spacevine.dm | 66 ++++++++++++++++---- code/modules/hydroponics/grown/kudzu.dm | 63 +++++++++++++------ 3 files changed, 106 insertions(+), 36 deletions(-) diff --git a/GainStation13/code/mechanics/water_sponge.dm b/GainStation13/code/mechanics/water_sponge.dm index 73f815ab..b349a9cc 100644 --- a/GainStation13/code/mechanics/water_sponge.dm +++ b/GainStation13/code/mechanics/water_sponge.dm @@ -43,12 +43,13 @@ /mob/living/carbon/proc/water_check(datum/gas_mixture/breath) if(HAS_TRAIT(src, TRAIT_WATER_SPONGE)) - if(breath.gases) - var/breath_gases = breath.gases - if(breath_gases[/datum/gas/water_vapor]) - var/H2O_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/water_vapor]) - reagents.add_reagent(/datum/reagent/water, H2O_pp/10) - breath_gases[/datum/gas/water_vapor] -= H2O_pp + if(breath) + if(breath.gases) + var/breath_gases = breath.gases + if(breath_gases[/datum/gas/water_vapor]) + var/H2O_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/water_vapor]) + reagents.add_reagent(/datum/reagent/water, H2O_pp/10) + breath_gases[/datum/gas/water_vapor] -= H2O_pp /obj/structure/sink var/mob/living/attached diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index d037adcc..f239b93b 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -159,6 +159,7 @@ /datum/spacevine_mutation/transparency/on_grow(obj/structure/spacevine/holder) holder.set_opacity(0) holder.alpha = 125 + holder.layer = BELOW_OPEN_DOOR_LAYER /datum/spacevine_mutation/oxy_eater name = "oxygen consuming" @@ -270,6 +271,40 @@ if(prob(25)) holder.entangle(crosser) +/datum/spacevine_mutation/stable + name = "stable" + hue = "#2a8352" + quality = POSITIVE + +/datum/spacevine_mutation/prickle //prickle reagent needs fixing + name = "prickly" + hue = "#797777" + severity = 10 + quality = MINOR_NEGATIVE + +/datum/spacevine_mutation/prickle/on_cross(obj/structure/spacevine/holder, mob/living/crosser) + if(prob(5)) + var/datum/reagent/PR = holder.prickle_reagent + if(PR && istype(PR) && iscarbon(crosser)) + var/mob/living/carbon/M = crosser + M.reagents.add_reagent(PR.type, 1) + to_chat(M, "You feel a prickle as you cross the vines.") + +/datum/spacevine_mutation/prickle/process_mutation(obj/structure/spacevine/holder) + if(holder.has_buckled_mobs()) + var/datum/reagent/PR = holder.prickle_reagent + if(PR && istype(PR)) + for(var/mob/living/carbon/C in holder.buckled_mobs) + C.reagents.add_reagent(PR.type, 2) + to_chat(C, "The vines prickle you!") + +/datum/spacevine_mutation/timid + name = "timid" + hue = "#2dad67" + quality = POSITIVE + +/datum/spacevine_mutation/timid/on_buckle(obj/structure/spacevine/holder, mob/living/buckled) + holder.unbuckle_all_mobs() // SPACE VINES (Note that this code is very similar to Biomass code) /obj/structure/spacevine @@ -286,6 +321,7 @@ var/energy = 0 var/datum/spacevine_controller/master = null var/list/mutations = list() + var/prickle_reagent /obj/structure/spacevine/Initialize() . = ..() @@ -378,10 +414,10 @@ var/list/vine_mutations_list var/mutativeness = 1 -/datum/spacevine_controller/New(turf/location, list/muts, potency, production) +/datum/spacevine_controller/New(turf/location, list/muts, potency, production, areagent) vines = list() growth_queue = list() - spawn_spacevine_piece(location, null, muts) + spawn_spacevine_piece(location, null, muts, areagent) START_PROCESSING(SSobj, src) vine_mutations_list = list() init_subtypes(/datum/spacevine_mutation/, vine_mutations_list) @@ -408,22 +444,28 @@ STOP_PROCESSING(SSobj, src) return ..() -/datum/spacevine_controller/proc/spawn_spacevine_piece(turf/location, obj/structure/spacevine/parent, list/muts) +/datum/spacevine_controller/proc/spawn_spacevine_piece(turf/location, obj/structure/spacevine/parent, list/muts, thereagent) var/obj/structure/spacevine/SV = new(location) growth_queue += SV vines += SV SV.master = src - if(muts && muts.len) - for(var/datum/spacevine_mutation/M in muts) - M.add_mutation_to_vinepiece(SV) - return if(parent) SV.mutations |= parent.mutations + SV.prickle_reagent = parent.prickle_reagent var/parentcolor = parent.atom_colours[FIXED_COLOUR_PRIORITY] SV.add_atom_colour(parentcolor, FIXED_COLOUR_PRIORITY) if(prob(mutativeness)) + for(var/datum/spacevine_mutation/stable/SM in SV.mutations) + return var/datum/spacevine_mutation/randmut = pick(vine_mutations_list - SV.mutations) randmut.add_mutation_to_vinepiece(SV) + else + for(var/A in muts) + var/datum/spacevine_mutation/M = A + SV.mutations |= M + SV.prickle_reagent = thereagent + SV.add_atom_colour(M.hue, FIXED_COLOUR_PRIORITY) + return for(var/datum/spacevine_mutation/SM in SV.mutations) SM.on_birth(SV) @@ -436,6 +478,7 @@ if(!vines.len) var/obj/item/seeds/kudzu/KZ = new(S.loc) KZ.mutations |= S.mutations + KZ.prickle_reagent = S.prickle_reagent KZ.set_potency(mutativeness * 10) KZ.set_production((spread_cap / initial(spread_cap)) * 5) qdel(src) @@ -466,8 +509,7 @@ if(prob(20)) SV.grow() else //If tile is fully grown - SV.entangle_mob() - + SV.entangle_mob() SV.spread() if(i >= length) break @@ -497,11 +539,11 @@ /obj/structure/spacevine/proc/entangle(mob/living/V) if(!V || isvineimmune(V)) return - for(var/datum/spacevine_mutation/SM in mutations) - SM.on_buckle(src, V) if((V.stat != DEAD) && (V.buckled != src)) //not dead or captured to_chat(V, "The vines [pick("wind", "tangle", "tighten")] around you!") buckle_mob(V, 1) + for(var/datum/spacevine_mutation/SM in mutations) + SM.on_buckle(src, V) /obj/structure/spacevine/proc/spread() var/direction = pick(GLOB.cardinals) @@ -512,7 +554,7 @@ stepturf = get_step(src,direction) //in case turf changes, to make sure no runtimes happen if(!locate(/obj/structure/spacevine, stepturf)) if(master) - master.spawn_spacevine_piece(stepturf, src) + master.spawn_spacevine_piece(stepturf, src, null, prickle_reagent) /obj/structure/spacevine/ex_act(severity, target) if(istype(target, type)) //if its agressive spread vine dont do anything diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm index ef78b972..73f672bf 100644 --- a/code/modules/hydroponics/grown/kudzu.dm +++ b/code/modules/hydroponics/grown/kudzu.dm @@ -16,9 +16,18 @@ var/list/mutations = list() reagents_add = list(/datum/reagent/medicine/charcoal = 0.04, /datum/reagent/consumable/nutriment = 0.02) + var/list/muts_list = list() + var/prickle_reagent + +/obj/item/seeds/kudzu/Initialize(mapload, nogenes) + . = ..() + for(var/A in subtypesof(/datum/spacevine_mutation)) + muts_list += new A() + /obj/item/seeds/kudzu/Copy() var/obj/item/seeds/kudzu/S = ..() S.mutations = mutations.Copy() + S.prickle_reagent = prickle_reagent return S /obj/item/seeds/kudzu/suicide_act(mob/user) @@ -38,7 +47,7 @@ to_chat(user, "You plant [src].") message_admins("Kudzu planted by [ADMIN_LOOKUPFLW(user)] at [ADMIN_VERBOSEJMP(user)]") investigate_log("was planted by [key_name(user)] at [AREACOORD(user)]", INVESTIGATE_BOTANY) - new /datum/spacevine_controller(get_turf(user), mutations, potency, production) + new /datum/spacevine_controller(get_turf(user), mutations, potency, production, prickle_reagent) qdel(src) /obj/item/seeds/kudzu/attack_self(mob/user) @@ -50,50 +59,61 @@ /obj/item/seeds/kudzu/get_analyzer_text() var/text = ..() var/text_string = "" - for(var/datum/spacevine_mutation/SM in mutations) + for(var/A in mutations) + var/datum/spacevine_mutation/SM = A text_string += "[(text_string == "") ? "" : ", "][SM.name]" text += "\n- Plant Mutations: [(text_string == "") ? "None" : text_string]" + if(prickle_reagent) + text += "\n- Plant Chemical: [prickle_reagent]" return text /obj/item/seeds/kudzu/on_chem_reaction(datum/reagents/S) var/list/temp_mut_list = list() if(S.has_reagent(/datum/reagent/space_cleaner/sterilizine, 5)) - for(var/datum/spacevine_mutation/SM in mutations) + for(var/A in mutations) + var/datum/spacevine_mutation/SM = A if(SM.quality == NEGATIVE) temp_mut_list += SM if(prob(20) && temp_mut_list.len) mutations.Remove(pick(temp_mut_list)) temp_mut_list.Cut() - - if(S.has_reagent(/datum/reagent/fuel, 5)) - for(var/datum/spacevine_mutation/SM in mutations) + else if(S.has_reagent(/datum/reagent/fuel, 5)) + for(var/A in mutations) + var/datum/spacevine_mutation/SM = A if(SM.quality == POSITIVE) temp_mut_list += SM if(prob(20) && temp_mut_list.len) mutations.Remove(pick(temp_mut_list)) temp_mut_list.Cut() - - if(S.has_reagent(/datum/reagent/phenol, 5)) - for(var/datum/spacevine_mutation/SM in mutations) + else if(S.has_reagent(/datum/reagent/phenol, 5)) + for(var/A in mutations) + var/datum/spacevine_mutation/SM = A if(SM.quality == MINOR_NEGATIVE) temp_mut_list += SM if(prob(20) && temp_mut_list.len) mutations.Remove(pick(temp_mut_list)) temp_mut_list.Cut() - - if(S.has_reagent(/datum/reagent/blood, 15)) + else if(S.has_reagent(/datum/reagent/blood, 15)) adjust_production(rand(15, -5)) - - if(S.has_reagent(/datum/reagent/toxin/amatoxin, 5)) + else if(S.has_reagent(/datum/reagent/toxin/amatoxin, 5)) adjust_production(rand(5, -15)) - - if(S.has_reagent(/datum/reagent/toxin/plasma, 5)) + else if(S.has_reagent(/datum/reagent/toxin/plasma, 5)) adjust_potency(rand(5, -15)) - - if(S.has_reagent(/datum/reagent/water/holywater, 10)) + else if(S.has_reagent(/datum/reagent/water/holywater, 10)) adjust_potency(rand(15, -5)) - + else + if(S.has_reagent(/datum/reagent/drug/space_drugs, 5)) + if(prob(20) && (muts_list - mutations).len > 0) + var/datum/spacevine_mutation/mut = pick(muts_list - mutations) + if(!(mut in mutations)) + mutations |= mut + src.visible_message("[src.plantname] seems to react with the chemical...") + return + if(S.reagent_list.len > 0) + prickle_reagent = S.get_master_reagent().type + prickle_reagent = new prickle_reagent() + src.visible_message("[src.plantname] seems to absorb the chemical...") /obj/item/reagent_containers/food/snacks/grown/kudzupod seed = /obj/item/seeds/kudzu @@ -105,3 +125,10 @@ foodtype = VEGETABLES | GROSS tastes = list("kudzu" = 1) wine_power = 20 + +/*/obj/item/seeds/kudzu/test + potency = 100 + yield = 10 + maturation = 1 + production = 1 + mutations = list(new /datum/spacevine_mutation/prickle(), new /datum/spacevine_mutation/stable())*/