mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Such vines
So mutation
This commit is contained in:
@@ -17,6 +17,107 @@
|
||||
spawn(0) new/obj/effect/spacevine_controller(T) //spawn a controller at turf
|
||||
|
||||
|
||||
/datum/spacevine_mutation
|
||||
var/name = ""
|
||||
var/severity = 1
|
||||
var/hue
|
||||
|
||||
/datum/spacevine_mutation/proc/process_mutation(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_birth(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_grow(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_death(obj/effect/spacevine/holder)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_hit(obj/effect/spacevine/holder, mob/hitter, obj/item/I)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/proc/on_cross(obj/effect/spacevine/holder, mob/crosser)
|
||||
return
|
||||
|
||||
/datum/spacevine_mutation/oxy_eater
|
||||
name = "oxygen consumption"
|
||||
hue = "#ffff00"
|
||||
|
||||
/datum/spacevine_mutation/transparency
|
||||
name = "oxygen consumption"
|
||||
hue = ""
|
||||
|
||||
/datum/spacevine_mutation/transparency/on_grow(obj/effect/spacevine/holder)
|
||||
holder.SetOpacity(0)
|
||||
holder.alpha = 125
|
||||
|
||||
/datum/spacevine_mutation/oxy_eater/process_mutation(obj/effect/spacevine/holder)
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.oxygen = max(0, GM.oxygen - severity * 0.5 * holder.energy)
|
||||
|
||||
/datum/spacevine_mutation/nitro_eater
|
||||
name = "nitrogen consumption"
|
||||
hue = "#ffff00"
|
||||
|
||||
/datum/spacevine_mutation/nitro_eater/process_mutation(obj/effect/spacevine/holder)
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.nitrogen = max(0, GM.nitrogen - severity * 0.5 * holder.energy)
|
||||
|
||||
/datum/spacevine_mutation/carbondioxide_eater
|
||||
name = "CO2 consumption"
|
||||
hue = "#00ffff"
|
||||
|
||||
/datum/spacevine_mutation/carbondioxide_eater/process_mutation(obj/effect/spacevine/holder)
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.carbon_dioxide = max(0, GM.carbon_dioxide - severity * 0.5 * holder.energy)
|
||||
|
||||
/datum/spacevine_mutation/plasma_eater
|
||||
name = "toxins consumption"
|
||||
hue = "#dd00dd"
|
||||
|
||||
/datum/spacevine_mutation/plasma_eater/process_mutation(obj/effect/spacevine/holder)
|
||||
var/turf/simulated/floor/T = holder.loc
|
||||
var/datum/gas_mixture/GM = T.air
|
||||
GM.toxins = max(0, GM.toxins - severity * 0.5 * holder.energy)
|
||||
|
||||
/datum/spacevine_mutation/thorns
|
||||
name = "thorns"
|
||||
hue = "#666666"
|
||||
|
||||
/datum/spacevine_mutation/thorns/on_cross(obj/effect/spacevine/holder, crosser)
|
||||
if(isliving(crosser) && prob(severity))
|
||||
var/mob/living/M = crosser
|
||||
M.adjustBruteLoss(5)
|
||||
M << "<span class='alert'>You cut yourself on all these vines.</span>"
|
||||
|
||||
/datum/spacevine_mutation/thorns/on_hit(obj/effect/spacevine/holder, hitter)
|
||||
if(ismob(hitter) && prob(severity))
|
||||
var/mob/living/M = hitter
|
||||
M.adjustBruteLoss(5)
|
||||
M << "<span class='alert'>You cut yourself on all these vines.</span>"
|
||||
|
||||
/datum/spacevine_mutation/woodening
|
||||
name = "hardening"
|
||||
hue = "#997700"
|
||||
|
||||
/datum/spacevine_mutation/woodening/on_grow(obj/effect/spacevine/holder)
|
||||
if(holder.energy)
|
||||
holder.density = 1
|
||||
|
||||
/datum/spacevine_mutation/woodening/on_hit(obj/effect/spacevine/holder, mob/hitter, obj/item/I)
|
||||
if(hitter)
|
||||
var/chance
|
||||
if(I)
|
||||
chance = I.force
|
||||
else
|
||||
chance = 4
|
||||
if(prob(chance))
|
||||
qdel(holder)
|
||||
return 1
|
||||
|
||||
|
||||
// SPACE VINES (Note that this code is very similar to Biomass code)
|
||||
@@ -32,19 +133,35 @@
|
||||
var/energy = 0
|
||||
var/obj/effect/spacevine_controller/master = null
|
||||
var/mob/living/buckled_mob
|
||||
var/list/mutations = list()
|
||||
|
||||
New()
|
||||
return
|
||||
|
||||
Destroy()
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_death(src)
|
||||
if(master)
|
||||
master.vines -= src
|
||||
master.growth_queue -= src
|
||||
if(!master.vines.len)
|
||||
var/obj/item/seeds/kudzuseed/KZ = new(loc)
|
||||
KZ.mutations |= mutations
|
||||
..()
|
||||
|
||||
|
||||
/obj/effect/spacevine/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (!W || !user || !W.type) return
|
||||
|
||||
var/override = 0
|
||||
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
override += SM.on_hit(src, user)
|
||||
|
||||
if(override)
|
||||
..()
|
||||
return
|
||||
|
||||
switch(W.type)
|
||||
if(/obj/item/weapon/circular_saw) qdel(src)
|
||||
if(/obj/item/weapon/kitchen/utensil/knife) qdel(src)
|
||||
@@ -70,12 +187,20 @@
|
||||
//Plant-b-gone damage is handled in its entry in chemistry-reagents.dm
|
||||
..()
|
||||
|
||||
/obj/effect/spacevine/Crossed(mob/crosser)
|
||||
if(isliving(crosser))
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_cross(src, crosser)
|
||||
|
||||
/obj/effect/spacevine/attack_hand(mob/user as mob)
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_hit(src, user)
|
||||
manual_unbuckle(user)
|
||||
|
||||
|
||||
/obj/effect/spacevine/attack_paw(mob/user as mob)
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_hit(src, user)
|
||||
manual_unbuckle(user)
|
||||
|
||||
/obj/effect/spacevine/proc/unbuckle()
|
||||
@@ -115,25 +240,42 @@
|
||||
var/list/growth_queue = list()
|
||||
var/reached_collapse_size
|
||||
var/reached_slowdown_size
|
||||
var/list/mutations_list = list()
|
||||
var/mutativness = 1
|
||||
//What this does is that instead of having the grow minimum of 1, required to start growing, the minimum will be 0,
|
||||
//meaning if you get the spacevines' size to something less than 20 plots, it won't grow anymore.
|
||||
|
||||
New()
|
||||
New(loc, list/muts, mttv)
|
||||
if(!istype(src.loc,/turf/simulated/floor))
|
||||
qdel(src)
|
||||
|
||||
spawn_spacevine_piece(src.loc)
|
||||
spawn_spacevine_piece(src.loc, , muts)
|
||||
processing_objects.Add(src)
|
||||
init_subtypes(/datum/spacevine_mutation/, mutations_list)
|
||||
if(mttv != null)
|
||||
mutativness = mttv
|
||||
|
||||
Destroy()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
proc/spawn_spacevine_piece(var/turf/location)
|
||||
proc/spawn_spacevine_piece(var/turf/location, obj/effect/spacevine/parent, list/muts)
|
||||
var/obj/effect/spacevine/SV = new(location)
|
||||
growth_queue += SV
|
||||
vines += SV
|
||||
SV.master = src
|
||||
if(muts && muts.len)
|
||||
SV.mutations |= muts
|
||||
if(parent)
|
||||
SV.mutations |= parent.mutations
|
||||
SV.color = parent.color
|
||||
if(prob(mutativness))
|
||||
SV.mutations |= pick(mutations_list)
|
||||
var/datum/spacevine_mutation/randmut = pick(SV.mutations)
|
||||
SV.color = randmut.hue
|
||||
|
||||
for(var/datum/spacevine_mutation/SM in SV.mutations)
|
||||
SM.on_birth(SV)
|
||||
|
||||
process()
|
||||
if(!vines)
|
||||
@@ -165,6 +307,8 @@
|
||||
i++
|
||||
queue_end += SV
|
||||
growth_queue -= SV
|
||||
for(var/datum/spacevine_mutation/SM in SV.mutations)
|
||||
SM.process_mutation(SV)
|
||||
if(SV.energy < 2) //If tile isn't fully grown
|
||||
if(prob(20))
|
||||
SV.grow()
|
||||
@@ -190,6 +334,9 @@
|
||||
src.icon_state = pick("Hvy1", "Hvy2", "Hvy3")
|
||||
energy = 2
|
||||
|
||||
for(var/datum/spacevine_mutation/SM in mutations)
|
||||
SM.on_grow(src)
|
||||
|
||||
/obj/effect/spacevine/proc/buckle_mob()
|
||||
if(!buckled_mob && prob(25))
|
||||
for(var/mob/living/carbon/V in src.loc)
|
||||
@@ -209,7 +356,7 @@
|
||||
if(!locate(/obj/effect/spacevine,F))
|
||||
if(F.Enter(src))
|
||||
if(master)
|
||||
master.spawn_spacevine_piece( F )
|
||||
master.spawn_spacevine_piece(F, src)
|
||||
|
||||
/*
|
||||
/obj/effect/spacevine/proc/Life()
|
||||
|
||||
@@ -1033,12 +1033,13 @@
|
||||
growthstages = 4
|
||||
plant_type = 1
|
||||
rarity = 30
|
||||
var/list/mutations = list()
|
||||
|
||||
/obj/item/seeds/kudzuseed/attack_self(mob/user as mob)
|
||||
if(istype(user.loc,/turf/space))
|
||||
return
|
||||
user << "<span class='notice'>You plant the kudzu. You monster.</span>"
|
||||
new /obj/effect/spacevine_controller(user.loc)
|
||||
new /obj/effect/spacevine_controller(user.loc, mutations, 1)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/seeds/chillighost
|
||||
|
||||
Reference in New Issue
Block a user