mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Bevy of newhydro fixes.
This commit is contained in:
@@ -298,7 +298,17 @@
|
||||
|
||||
// Simple helper to face what you clicked on, in case it should be needed in more than one place
|
||||
/mob/proc/face_atom(var/atom/A)
|
||||
if( stat || (buckled && !buckled.movable) || !A || !x || !y || !A.x || !A.y ) return
|
||||
|
||||
// Snowflake for space vines.
|
||||
var/is_buckled = 0
|
||||
if(buckled)
|
||||
if(istype(buckled))
|
||||
if(!buckled.movable)
|
||||
is_buckled = 1
|
||||
else
|
||||
is_buckled = 0
|
||||
|
||||
if( stat || is_buckled || !A || !x || !y || !A.x || !A.y ) return
|
||||
var/dx = A.x - x
|
||||
var/dy = A.y - y
|
||||
if(!dx && !dy) return
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/active = 1 //No sales pitches if off!
|
||||
var/delay_product_spawn // If set, uses sleep() in product spawn proc (mostly for seeds to retrieve correct names).
|
||||
var/vend_ready = 1 //Are we ready to vend?? Is it time??
|
||||
var/vend_delay = 10 //How long does it take to vend?
|
||||
var/datum/data/vending_product/currently_vending = null // A /datum/data/vending_product instance of what we're paying for right now.
|
||||
@@ -111,7 +112,7 @@
|
||||
|
||||
var/atom/temp = new typepath(null)
|
||||
var/datum/data/vending_product/R = new /datum/data/vending_product()
|
||||
R.product_name = temp.name
|
||||
|
||||
R.product_path = typepath
|
||||
R.amount = amount
|
||||
R.price = price
|
||||
@@ -123,6 +124,13 @@
|
||||
coin_records += R
|
||||
else
|
||||
product_records += R
|
||||
|
||||
if(delay_product_spawn)
|
||||
sleep(1)
|
||||
R.product_name = temp.name
|
||||
else
|
||||
R.product_name = temp.name
|
||||
|
||||
// world << "Added: [R.product_name]] - [R.amount] - [R.product_path]"
|
||||
return
|
||||
|
||||
@@ -814,6 +822,8 @@
|
||||
product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!"
|
||||
product_ads = "We like plants!;Grow some crops!;Grow, baby, growww!;Aw h'yeah son!"
|
||||
icon_state = "seeds"
|
||||
delay_product_spawn = 1
|
||||
|
||||
products = list(/obj/item/seeds/bananaseed = 3,/obj/item/seeds/berryseed = 3,/obj/item/seeds/carrotseed = 3,/obj/item/seeds/chantermycelium = 3,/obj/item/seeds/chiliseed = 3,
|
||||
/obj/item/seeds/cornseed = 3, /obj/item/seeds/eggplantseed = 3, /obj/item/seeds/potatoseed = 3, /obj/item/seeds/replicapod = 3,/obj/item/seeds/soyaseed = 3,
|
||||
/obj/item/seeds/sunflowerseed = 3,/obj/item/seeds/tomatoseed = 3,/obj/item/seeds/towermycelium = 3,/obj/item/seeds/wheatseed = 3,/obj/item/seeds/appleseed = 3,
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
return
|
||||
|
||||
// Advance plant age.
|
||||
age += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
if(prob(25)) age += 1 * HYDRO_SPEED_MULTIPLIER
|
||||
|
||||
// Maintain tray nutrient and water levels.
|
||||
if(seed.nutrient_consumption > 0 && nutrilevel > 0 && prob(25))
|
||||
@@ -380,12 +380,14 @@
|
||||
|
||||
/obj/machinery/portable_atmospherics/hydroponics/proc/mutate(var/severity)
|
||||
|
||||
world << "Tray mutation proc called with [severity]."
|
||||
|
||||
// No seed, no mutations.
|
||||
if(!seed)
|
||||
return
|
||||
|
||||
// Check if we should even bother working on the current seed datum.
|
||||
if(seed.mutants.len && severity > 1 && prob(10+mutation_mod))
|
||||
if(seed.mutants. && seed.mutants.len && severity > 1 && prob(10+mutation_mod))
|
||||
mutate_species()
|
||||
return
|
||||
|
||||
@@ -573,7 +575,7 @@
|
||||
reagent_value = mutagenic_reagents[R.id]+mutation_mod
|
||||
if(reagent_total >= reagent_value)
|
||||
if(prob(min(reagent_total*reagent_value,100)))
|
||||
mutate(reagent_value > 10 ? 2 : 1)
|
||||
mutate(reagent_total > 10 ? 2 : 1)
|
||||
|
||||
S.reagents.clear_reagents()
|
||||
|
||||
@@ -622,7 +624,7 @@
|
||||
update_icon()
|
||||
|
||||
else
|
||||
user << "\red The [src] already has seeds in it!"
|
||||
user << "\red \The [src] already has seeds in it!"
|
||||
|
||||
else if (istype(O, /obj/item/weapon/reagent_containers/spray/plantbgone))
|
||||
if(seed)
|
||||
|
||||
@@ -58,9 +58,9 @@ proc/populate_seed_list()
|
||||
|
||||
//Tolerances.
|
||||
var/requires_nutrients = 1 // The plant can starve.
|
||||
var/nutrient_consumption = 0.1 // Plant eats this much per tick.
|
||||
var/requires_water = 1 // The plant can become dehydrated.
|
||||
var/water_consumption = 1 // Plant drinks this much per tick.
|
||||
var/nutrient_consumption = 0.25 // Plant eats this much per tick.
|
||||
var/requires_water = 3 // The plant can become dehydrated.
|
||||
var/water_consumption = 1 // Plant drinks this much per tick.
|
||||
var/ideal_heat = 293 // Preferred temperature in Kelvin.
|
||||
var/heat_tolerance = 20 // Departure from ideal that is survivable.
|
||||
var/ideal_light = 8 // Preferred light level in luminosity.
|
||||
@@ -104,9 +104,12 @@ proc/populate_seed_list()
|
||||
|
||||
//Mutates the plant overall (randomly).
|
||||
/datum/seed/proc/mutate(var/degree,var/turf/source_turf)
|
||||
|
||||
world << "Seed mutation proc called with [degree]."
|
||||
|
||||
if(!degree || immutable) return
|
||||
|
||||
source_turf.visible_message("[display_name] quivers uneasily!")
|
||||
source_turf.visible_message("\blue \The [display_name] quivers!")
|
||||
|
||||
//This looks like shit, but it's a lot easier to read/change this way.
|
||||
var/total_mutations = rand(1,1+degree)
|
||||
@@ -115,7 +118,7 @@ proc/populate_seed_list()
|
||||
if(0) //Plant cancer!
|
||||
lifespan = max(0,lifespan-rand(1,5))
|
||||
endurance = max(0,endurance-rand(10,20))
|
||||
source_turf.visible_message("[display_name] withers rapidly!")
|
||||
source_turf.visible_message("\red \The [display_name] withers rapidly!")
|
||||
if(1)
|
||||
nutrient_consumption = max(0, min(5, nutrient_consumption + rand(-(degree*0.1),(degree*0.1))))
|
||||
water_consumption = max(0, min(50, water_consumption + rand(-degree,degree)))
|
||||
@@ -134,7 +137,7 @@ proc/populate_seed_list()
|
||||
if(prob(degree*5))
|
||||
carnivorous = max(0, min(2, carnivorous + rand(-degree,degree)))
|
||||
if(carnivorous)
|
||||
source_turf.visible_message("[display_name] shudders hungrily.")
|
||||
source_turf.visible_message("\blue \The [display_name] shudders hungrily.")
|
||||
if(6)
|
||||
weed_tolerance = max(0, min(10, weed_tolerance + (rand(-2,2) * degree)))
|
||||
if(prob(degree*5)) parasite = !parasite
|
||||
@@ -148,7 +151,7 @@ proc/populate_seed_list()
|
||||
potency = max(0, min(200, potency + (rand(-20,20) * degree)))
|
||||
if(prob(degree*5))
|
||||
spread = max(0, min(2, spread + rand(-1,1)))
|
||||
source_turf.visible_message("[display_name] spasms visibly, shifting in the tray.")
|
||||
source_turf.visible_message("\blue \The [display_name] spasms visibly, shifting in the tray.")
|
||||
if(9)
|
||||
maturation = max(0, min(30, maturation + (rand(-1,1) * degree)))
|
||||
if(prob(degree*5))
|
||||
@@ -157,22 +160,22 @@ proc/populate_seed_list()
|
||||
if(prob(degree*2))
|
||||
biolum = !biolum
|
||||
if(biolum)
|
||||
source_turf.visible_message("[display_name] begins to glow!")
|
||||
source_turf.visible_message("\blue \The [display_name] begins to glow!")
|
||||
if(prob(degree*2))
|
||||
biolum_colour = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
|
||||
source_turf.visible_message("[display_name]'s glow <font=[biolum_colour]>changes colour</font>!")
|
||||
source_turf.visible_message("\blue \The [display_name]'s glow <font=[biolum_colour]>changes colour</font>!")
|
||||
else
|
||||
source_turf.visible_message("[display_name]'s glow dims...")
|
||||
source_turf.visible_message("\blue \The [display_name]'s glow dims...")
|
||||
if(11)
|
||||
if(prob(degree*2))
|
||||
flowers = !flowers
|
||||
if(flowers)
|
||||
source_turf.visible_message("[display_name] sprouts a bevy of flowers!")
|
||||
source_turf.visible_message("\blue \The [display_name] sprouts a bevy of flowers!")
|
||||
if(prob(degree*2))
|
||||
flower_colour = "#[pick(list("FF0000","FF7F00","FFFF00","00FF00","0000FF","4B0082","8F00FF"))]"
|
||||
source_turf.visible_message("[display_name]'s flowers <font=[flower_colour]>changes colour</font>!")
|
||||
source_turf.visible_message("\blue \The [display_name]'s flowers <font=[flower_colour]>changes colour</font>!")
|
||||
else
|
||||
source_turf.visible_message("[display_name]'s flowers wither and fall off.")
|
||||
source_turf.visible_message("\blue \The [display_name]'s flowers wither and fall off.")
|
||||
return
|
||||
|
||||
//Mutates a specific trait/set of traits.
|
||||
@@ -368,7 +371,7 @@ proc/populate_seed_list()
|
||||
yield_mod = 0
|
||||
total_yield = yield
|
||||
else
|
||||
total_yield = max(1,rand(1,((yield_mod+yield))))
|
||||
total_yield = max(1,rand(yield_mod,yield_mod+yield))
|
||||
|
||||
currently_querying = list()
|
||||
for(var/i = 0;i<total_yield;i++)
|
||||
|
||||
@@ -3,9 +3,16 @@
|
||||
desc = "A small disk used for carrying data on plant genetics."
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "disk"
|
||||
w_class = 1.0
|
||||
|
||||
var/list/genes = list()
|
||||
var/genesource = "unknown"
|
||||
|
||||
/obj/item/weapon/disk/botany/New()
|
||||
..()
|
||||
pixel_x = rand(-5,5)
|
||||
pixel_y = rand(-5,5)
|
||||
|
||||
/obj/item/weapon/disk/botany/attack_self(var/mob/user as mob)
|
||||
if(genes.len)
|
||||
var/choice = alert(user, "Are you sure you want to wipe the disk?", "Xenobotany Data", "No", "Yes")
|
||||
@@ -24,6 +31,7 @@
|
||||
..()
|
||||
for(var/i = 0;i<7;i++)
|
||||
new /obj/item/weapon/disk/botany(src)
|
||||
|
||||
/obj/machinery/botany
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "hydrotray3"
|
||||
@@ -181,7 +189,7 @@
|
||||
|
||||
if(seed.seed.name == "new line" || isnull(seed_types[seed.seed.name]))
|
||||
seed.seed.uid = seed_types.len + 1
|
||||
seed.seed.name = "[uid]"
|
||||
seed.seed.name = "[seed.seed.uid]"
|
||||
seed_types[seed.seed.name] = seed.seed
|
||||
|
||||
seed.update_seed()
|
||||
@@ -215,6 +223,8 @@
|
||||
|
||||
if(seed && seed.seed)
|
||||
genetics = seed.seed
|
||||
degradation = 0
|
||||
|
||||
del(seed)
|
||||
seed = null
|
||||
|
||||
@@ -233,7 +243,7 @@
|
||||
if(!genetics.roundstart)
|
||||
loaded_disk.genesource += " (variety #[genetics.uid])"
|
||||
|
||||
loaded_disk.name += " ([gene_tag_masks[href_list["get_gene"]]])"
|
||||
loaded_disk.name += " ([gene_tag_masks[href_list["get_gene"]]], #[genetics.uid])"
|
||||
loaded_disk.desc += " The label reads \'gene [gene_tag_masks[href_list["get_gene"]]], sampled from [genetics.display_name]\'."
|
||||
eject_disk = 1
|
||||
|
||||
|
||||
@@ -295,8 +295,8 @@
|
||||
var/limited_growth = 0
|
||||
|
||||
/obj/effect/plant_controller/creeper
|
||||
collapse_limit = 50
|
||||
slowdown_limit = 5
|
||||
collapse_limit = 6
|
||||
slowdown_limit = 3
|
||||
limited_growth = 1
|
||||
|
||||
/obj/effect/plant_controller/New()
|
||||
|
||||
@@ -91,42 +91,51 @@ obj/item/weapon/gun/energy/staff
|
||||
var/charge_tick = 0
|
||||
var/mode = 0 //0 = mutate, 1 = yield boost
|
||||
|
||||
New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
/obj/item/weapon/gun/energy/floragun/New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/item/weapon/gun/energy/floragun/Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
Del()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
/obj/item/weapon/gun/energy/floragun/process()
|
||||
charge_tick++
|
||||
if(charge_tick < 4) return 0
|
||||
charge_tick = 0
|
||||
if(!power_supply) return 0
|
||||
power_supply.give(100)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/floragun/attack_self(mob/living/user as mob)
|
||||
switch(mode)
|
||||
if(0)
|
||||
mode = 1
|
||||
charge_cost = 100
|
||||
user << "\red The [src.name] is now set to increase yield."
|
||||
projectile_type = "/obj/item/projectile/energy/florayield"
|
||||
modifystate = "florayield"
|
||||
if(1)
|
||||
mode = 0
|
||||
charge_cost = 100
|
||||
user << "\red The [src.name] is now set to induce mutations."
|
||||
projectile_type = "/obj/item/projectile/energy/floramut"
|
||||
modifystate = "floramut"
|
||||
update_icon()
|
||||
return
|
||||
|
||||
process()
|
||||
charge_tick++
|
||||
if(charge_tick < 4) return 0
|
||||
charge_tick = 0
|
||||
if(!power_supply) return 0
|
||||
power_supply.give(100)
|
||||
update_icon()
|
||||
return 1
|
||||
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, flag)
|
||||
|
||||
attack_self(mob/living/user as mob)
|
||||
switch(mode)
|
||||
if(0)
|
||||
mode = 1
|
||||
charge_cost = 100
|
||||
user << "\red The [src.name] is now set to increase yield."
|
||||
projectile_type = "/obj/item/projectile/energy/florayield"
|
||||
modifystate = "florayield"
|
||||
if(1)
|
||||
mode = 0
|
||||
charge_cost = 100
|
||||
user << "\red The [src.name] is now set to induce mutations."
|
||||
projectile_type = "/obj/item/projectile/energy/floramut"
|
||||
modifystate = "floramut"
|
||||
update_icon()
|
||||
if(flag && istype(target,/obj/machinery/portable_atmospherics/hydroponics))
|
||||
var/obj/machinery/portable_atmospherics/hydroponics/tray = target
|
||||
if(load_into_chamber())
|
||||
user.visible_message("\red <b> \The [user] fires \the [src] into \the [tray]!</b>")
|
||||
Fire(target,user)
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/meteorgun
|
||||
name = "meteor gun"
|
||||
desc = "For the love of god, make sure you're aiming this the right way!"
|
||||
@@ -224,7 +233,7 @@ obj/item/weapon/gun/energy/staff/focus
|
||||
|
||||
|
||||
/*
|
||||
This is called from
|
||||
This is called from
|
||||
modules/mob/mob_movement.dm if you move you will be zoomed out
|
||||
modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
|
||||
*/
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 160 KiB |
Reference in New Issue
Block a user