Skip to content

Commit

Permalink
Merge pull request #9160 from MistakeNot4892/doona
Browse files Browse the repository at this point in the history
Doona stuff.
  • Loading branch information
Atermonera authored Jul 23, 2023
2 parents 7629a80 + d5e6216 commit 8022c69
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 42 deletions.
70 changes: 38 additions & 32 deletions code/modules/hydroponics/seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@

/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/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 // Mob products. (Dionaea, Walking Mushrooms, Angry Tomatoes)
var/apply_color_to_mob = TRUE // Do we color the mob to match the plant?
var/has_item_product // Item products. (Eggy)
var/has_mob_product // Mob products. (Dionaea, Walking Mushrooms, Angry Tomatoes)
var/mob_product_requires_player = FALSE // Whether or not the mob product requires a player.
var/apply_color_to_mob = TRUE // Do we color the mob to match the plant?
var/has_item_product // Item products. (Eggy)
var/force_layer

// Making the assumption anything in HYDRO-ponics is capable of processing water, and nutrients commonly associated with it, leaving us with the below to be tweaked.
Expand Down Expand Up @@ -545,6 +546,7 @@
if(prob(5))
if(prob(30))
has_mob_product = pickweight(GLOB.plant_mob_products)
mob_product_requires_player = FALSE
else
has_item_product = pickweight(GLOB.plant_item_products)

Expand Down Expand Up @@ -708,9 +710,11 @@
consume_gasses |= new_gasses
gene.values["[TRAIT_CONSUME_GASSES]"] = null
if(GENE_METABOLISM)
has_mob_product = gene.values["mob_product"]
has_item_product = gene.values["item_product"]
gene.values["mob_product"] = null
has_mob_product = gene.values["mob_product"]
mob_product_requires_player = gene.values["mob_product_requires_player"]
has_item_product = gene.values["item_product"]
gene.values["mob_product"] = null
gene.values["mob_product_requires_player"] = null

for(var/trait in gene.values)
set_trait(trait,gene.values["[trait]"])
Expand Down Expand Up @@ -739,8 +743,9 @@
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
P.values["item_product"] = has_item_product
P.values["mob_product"] = has_mob_product
P.values["mob_product_requires_player"] = mob_product_requires_player
P.values["item_product"] = has_item_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)
Expand Down Expand Up @@ -843,14 +848,15 @@

//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
new_seed.has_item_product = has_item_product
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
new_seed.mob_product_requires_player = mob_product_requires_player
new_seed.has_item_product = has_item_product

//Copy over everything else.
if(mutants) new_seed.mutants = mutants.Copy()
Expand Down
21 changes: 11 additions & 10 deletions code/modules/hydroponics/seed_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
var/datum/ghosttrap/plant/P = get_ghost_trap("living plant")
P.request_player(host, "Someone is harvesting [display_name]. ")

spawn(75)
if(!host.ckey && !host.client)
host.death() // This seems redundant, but a lot of mobs don't
host.set_stat(DEAD) // 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>")
if(mob_product_requires_player)
spawn(75)
if(!host.ckey && !host.client)
host.death() // This seems redundant, but a lot of mobs don't
host.set_stat(DEAD) // 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()
15 changes: 15 additions & 0 deletions code/modules/mob/living/carbon/nymph/diona.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var/global/list/_nymph_default_emotes = list(
name = "diona nymph"
voice_name = "diona nymph"
speak_emote = list("chirrups")
icon = 'icons/mob/alien.dmi'
icon_state = "nymph"
item_state = "nymph"
species_language = LANGUAGE_ROOTLOCAL
Expand Down Expand Up @@ -128,3 +129,17 @@ var/global/list/_nymph_default_emotes = list(

/mob/living/carbon/diona/death(gibbed)
return ..(gibbed,death_msg)


/mob/living/carbon/diona/attack_ghost(mob/observer/dead/user)
if(client || key || ckey)
to_chat(user, SPAN_WARNING("\The [src] already has a player."))
if(alert(user, "Do you wish to take control of \the [src]?", "Chirp Time", "No", "Yes") == "No")
return
if(QDELETED(src) || QDELETED(user) || !user.client)
return
if(client || key || ckey)
to_chat(user, SPAN_WARNING("\The [src] already has a player."))
var/datum/ghosttrap/plant/P = get_ghost_trap("living plant")
if(P.assess_candidate(user))
P.transfer_personality(user, src)

0 comments on commit 8022c69

Please sign in to comment.