Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Balloon plants & more! #172

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/datums/chemistry/tools/balloons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

proc/update_icon()
if (src.reagents && src.reagents.total_volume > 0)
if (src.reagents.has_reagent("helium"))
if (src.reagents.has_reagent("helium") || src.reagents.has_reagent("hydrogen"))
src.icon_state = "balloon_[src.balloon_color]_inflated"
src.item_state = "balloon_[src.balloon_color]_inflated"
else
Expand All @@ -50,7 +50,7 @@
if (!src.reagents)
return
if (!ohshit)
ohshit = (src.reagents.total_volume / 30) * 33
ohshit = (src.reagents.total_volume / (src.reagents.maximum_volume - 10)) * 33
if (prob(ohshit))
smash()
if (user)
Expand Down
39 changes: 38 additions & 1 deletion code/datums/hydroponics/plant_mutations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,43 @@
crop = /obj/item/reagent_containers/food/snacks/plant/melon/george
assoc_reagents = list("george_melonium")

/datum/plantmutation/melon/balloon
name = "Balloon... Melons?"
crop = /obj/item/reagent_containers/balloon
iconmod = "balloon"
assoc_reagents = list("helium")

/datum/plantmutation/melon/hindenballoon
name = "Balloon... Melons?"
crop = /obj/item/reagent_containers/balloon
iconmod = "balloon"
assoc_reagents = list("hydrogen")

/datum/plantmutation/melon/bowling
name = "Bowling Melons"
crop = /obj/item/reagent_containers/food/snacks/plant/melon/bowling
ENrange = list(20,null)
chance = 20
special_proc_override = 1

HYPspecial_proc_M(var/obj/machinery/plantpot/POT)
..()
if (.) return
var/datum/plantgenes/DNA = POT.plantgenes

var/thud_prob = max(0,min(100, DNA.endurance / 2))

if (prob(thud_prob))
playsound(POT.loc, "sound/effects/exlow.ogg", 30, 1)
var/wiggle = 4
while(wiggle > 0)
wiggle--
POT.pixel_x = rand(-2,2)
POT.pixel_y = rand(-2,2)
sleep(1)
POT.pixel_x = 0
POT.pixel_y = 0

// Chili Mutations

/datum/plantmutation/chili/chilly
Expand Down Expand Up @@ -351,4 +388,4 @@
name = "Money Tree"
iconmod = "Cash"
crop = /obj/item/spacecash
chance = 20
chance = 20
17 changes: 15 additions & 2 deletions code/datums/hydroponics/plants_fruit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,21 @@
genome = 19
assoc_reagents = list("water")
nectarlevel = 15
mutations = list(/datum/plantmutation/melon/george)
mutations = list(/datum/plantmutation/melon/george, /datum/plantmutation/melon/bowling)
commuts = list(/datum/plant_gene_strain/immortal,/datum/plant_gene_strain/seedless)
special_proc = 1 // my sincerest apologies for this, it's there only for a dumb effect on the bowling melons

HYPinfusionP(var/obj/item/seed/S,var/reagent)
..()
var/datum/plantgenes/DNA = S.plantgenes
if (!DNA) return
switch(reagent)
if("helium")
if (prob(50))
DNA.mutation = HY_get_mutation_from_path(/datum/plantmutation/melon/balloon)
if("hydrogen")
if (prob(50))
DNA.mutation = HY_get_mutation_from_path(/datum/plantmutation/melon/hindenballoon)

/datum/plant/chili
name = "Chili"
Expand Down Expand Up @@ -231,4 +244,4 @@
endurance = 1
genome = 18
nectarlevel = 10
assoc_reagents = list("juice_strawberry")
assoc_reagents = list("juice_strawberry")
120 changes: 119 additions & 1 deletion code/obj/item/food/plants.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,20 @@
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
var/amount_per_slice = 0
if(src.reagents)
amount_per_slice = src.reagents.total_volume / makeslices
src.reagents.inert = 1
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/plant/melonslice/P = new(T)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
if(src.reagents)
P.reagents = new
P.reagents.inert = 1 // no stacking of potassium + water explosions on cutting
src.reagents.trans_to(P, amount_per_slice)
P.reagents.inert = 0
makeslices -= 1
qdel (src)
..()
Expand Down Expand Up @@ -284,11 +293,20 @@
var/turf/T = get_turf(src)
user.visible_message("[user] cuts [src] into slices.", "You cut [src] into slices.")
var/makeslices = 6
var/amount_per_slice = 0
if(src.reagents)
amount_per_slice = src.reagents.total_volume / makeslices
src.reagents.inert = 1
while (makeslices > 0)
var/obj/item/reagent_containers/food/snacks/plant/melonslice/george/P = new(T)
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = P.plantgenes
HYPpassplantgenes(DNA,PDNA)
if(src.reagents)
P.reagents = new
P.reagents.inert = 1 // no stacking of potassium + water explosions on cutting
src.reagents.trans_to(P, amount_per_slice)
P.reagents.inert = 0
makeslices -= 1
qdel (src)
..()
Expand Down Expand Up @@ -319,7 +337,107 @@

New()
..()
reagents.add_reagent("george_melonium",25)
reagents.add_reagent("george_melonium",20)


/obj/item/reagent_containers/food/snacks/plant/melon/bowling
name = "bowling melon"
desc = "Just keep rollin' rollin'."
icon = 'icons/obj/items.dmi'
icon_state = "bowling_melon"
var/base_icon_state = "bowling_melon"
var/already_burst = 0
w_class = 3.0
force = 5
throw_speed = 1

proc/damage(var/mob/hitMob, damMin, damMax, var/mob/living/carbon/human/user)
if(user.w_uniform && istype(user.w_uniform, /obj/item/clothing/under/gimmick/bowling))
hitMob.weakened = max(damMax-10, hitMob.weakened)
hitMob.stuttering = max(damMax-5, hitMob.stuttering)
//hitMob.stunned = max(damMax-10, hitMob.stunned) // I'd rather just not have this be strictly better bowling balls? idk, uncomment if you want them to stun with the suit
hitMob.TakeDamage("chest", rand(damMin, damMax), 0)
else
// kyle wanted to add disorient here I think?
hitMob.stuttering = max(damMax-5, hitMob.stuttering)
hitMob.TakeDamage("chest", rand(damMin, damMax), 0)

throw_at(atom/target, range, speed)
throw_unlimited = 1
if(target.x > src.x || (target.x == src.x && target.y > src.y))
src.icon_state = "[base_icon_state]_spin_right"
else
src.icon_state = "[base_icon_state]_spin_left"
..(target, range, speed)

attack_hand(mob/user as mob)
..()
if(user)
src.icon_state = base_icon_state

proc/hitWeak(var/mob/hitMob, var/mob/user)
hitMob.visible_message("<span style=\"color:red\">[hitMob] is hit by [user]'s [src]!</span>")
// look these numbers are pulled out of my ass, change them if things are too broken / too weak
var/dmg = min(12, src.plantgenes.endurance / 7)
src.damage(hitMob, dmg, dmg + 5, user)

proc/hitHard(var/mob/hitMob, var/mob/user)
hitMob.visible_message("<span style=\"color:red\">[hitMob] is knocked over by [user]'s [src]!</span>")
var/dmg = min(20, src.plantgenes.endurance / 5 + 3)
src.damage(hitMob, dmg, dmg + 5, user)

throw_impact(atom/hit_atom)
var/mob/living/carbon/human/user = usr

if(hit_atom)
playsound(src.loc, "sound/effects/exlow.ogg", 65, 1)
if (ismob(hit_atom))
var/mob/hitMob = hit_atom
if (ishuman(hitMob))
spawn( 0 )
if (istype(user))
if (user.w_uniform && istype(user.w_uniform, /obj/item/clothing/under/gimmick/bowling))
src.hitHard(hitMob, user)

if(!(hitMob == user))
user.say(pick("Who's the kingpin now, baby?", "STRIIIKE!", "Watch it, pinhead!", "Ten points!"))
else
src.hitWeak(hitMob, user)
else
src.hitWeak(hitMob, user)
if(already_burst)
return
already_burst = 1
src.icon_state = "[base_icon_state]_burst"
sleep(1)
var/n_slices = rand(1, 5)
var/amount_per_slice = 0
if(src.reagents)
amount_per_slice = src.reagents.total_volume / 5
src.reagents.inert = 1
while(n_slices)
var/obj/item/reagent_containers/food/snacks/plant/melonslice/slice = new(get_turf(src))
if(src.reagents)
slice.reagents = new
// temporary inert is here so this doesn't hit people with 5 potassium + water explosions at once
slice.reagents.inert = 1
src.reagents.trans_to(slice, amount_per_slice)
slice.reagents.inert = 0
var/datum/plantgenes/DNA = src.plantgenes
var/datum/plantgenes/PDNA = slice.plantgenes
HYPpassplantgenes(DNA,PDNA)
if(istype(hit_atom, /mob/living) && prob(1))
var/mob/living/dork = hit_atom
boutput(slice, "A melon slice hits [dork] right in the mouth!")
slice.Eat(dork, dork)
else
var/target = get_turf(pick(orange(4, src)))
spawn(0)
slice.throw_at(target, rand(0, 10), range(1, 4))
n_slices--
sleep(1)
qdel(src)
return


/obj/item/reagent_containers/food/snacks/plant/chili/
Expand Down
16 changes: 11 additions & 5 deletions code/obj/machinery/plantpot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,10 @@
UpdateOverlays(null, "health_display")

var/planticon = null
if (growing.sprite)
planticon = "[growing.sprite]-G[src.grow_level]"
else if (MUT && MUT.iconmod)
if (MUT && MUT.iconmod)
planticon = "[MUT.iconmod]-G[src.grow_level]"
else if (growing.sprite)
planticon = "[growing.sprite]-G[src.grow_level]"
else if (growing.special_icon)
planticon = "[growing.special_icon]-G[src.grow_level]"
else
Expand Down Expand Up @@ -965,6 +965,11 @@
var/obj/item/organ/heart/H = CROP
H.quality = quality_score

else if (istype(CROP,/obj/item/reagent_containers/balloon))
var/obj/item/reagent_containers/balloon/B = CROP
B.reagents.maximum_volume = B.reagents.maximum_volume + DNA.endurance // more endurance = larger and more sturdy balloons!
HYPadd_harvest_reagents(CROP,growing,DNA,quality_status)

if (((growing.isgrass || growing.force_seed_on_harvest) && prob(80)) && !istype(CROP,/obj/item/seed/) && !HYPCheckCommut(DNA,/datum/plant_gene_strain/seedless))
// Same shit again. This isn't so much the crop as it is giving you seeds
// incase you couldn't get them otherwise, though.
Expand Down Expand Up @@ -1232,7 +1237,8 @@ proc/HYPadd_harvest_reagents(var/obj/item/I,var/datum/plant/growing,var/datum/pl
if (special_condition == "jumbo")
basecapacity *= 2

I.reagents.maximum_volume = basecapacity + DNA.potency
var/to_add = basecapacity + DNA.potency
I.reagents.maximum_volume = max(basecapacity + DNA.potency, I.reagents.maximum_volume)
if (I.reagents.maximum_volume < 1)
I.reagents.maximum_volume = 1
// Now we add the plant's potency to their max reagent capacity. If this causes it to fall
Expand All @@ -1251,7 +1257,7 @@ proc/HYPadd_harvest_reagents(var/obj/item/I,var/datum/plant/growing,var/datum/pl
putreagents |= R.reagents_to_add

if (putreagents.len && I.reagents.maximum_volume)
var/putamount = round(I.reagents.maximum_volume / putreagents.len)
var/putamount = round(to_add / putreagents.len)
for(var/X in putreagents)
I.reagents.add_reagent(X,putamount,,, 1)
// And finally put them in there. We figure out the max volume and add an even amount of
Expand Down
26 changes: 13 additions & 13 deletions code/obj/submachine/seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -371,18 +371,6 @@
// Cap probability between 0 and 100
splice_chance = max(0,min(splice_chance,100))
if (prob(splice_chance)) // We're good, so start splicing!
// Create the new seed
var/obj/item/seed/S = new /obj/item/seed(src)
var/datum/plant/P = new /datum/plant(S)
var/datum/plantgenes/DNA = new /datum/plantgenes(S)
S.planttype = P
S.plantgenes = DNA
P.hybrid = 1
if (seed1.generation > seed2.generation)
S.generation = seed1.generation + 1
else
S.generation = seed2.generation + 2

var/datum/plantgenes/P1DNA = seed1.plantgenes
var/datum/plantgenes/P2DNA = seed2.plantgenes

Expand All @@ -405,6 +393,18 @@
else
dominantspecies = P2
dominantDNA = P2DNA
// Create the new seed
var/obj/item/seed/S = new /obj/item/seed(src)
var/datum/plant/P = new dominantspecies.type(S)
var/datum/plantgenes/DNA = new /datum/plantgenes(S)
S.planttype = P
S.plantgenes = DNA
P.hybrid = 1
if (seed1.generation > seed2.generation)
S.generation = seed1.generation + 1
else
S.generation = seed2.generation + 2


// Set up the base variables first
if (!dominantspecies.hybrid)
Expand Down Expand Up @@ -1120,4 +1120,4 @@
else src.malfunction = 1
if (WIRE_POWER)
if (src.working) src.working = 0
else src.working = 1
else src.working = 1
Binary file modified icons/obj/hydroponics/hydro_mutants.dmi
Binary file not shown.
Binary file modified icons/obj/items.dmi
Binary file not shown.