mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Renamed some files, did some path replacements
This commit is contained in:
@@ -1,166 +0,0 @@
|
||||
//separate dm since hydro is getting bloated already
|
||||
|
||||
/obj/effect/glowshroom
|
||||
name = "glowshroom"
|
||||
anchored = 1
|
||||
opacity = 0
|
||||
density = 0
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "glowshroomf"
|
||||
layer = 2.1
|
||||
l_color = "#003300"
|
||||
|
||||
var/endurance = 30
|
||||
var/potency = 30
|
||||
var/delay = 1200
|
||||
var/floor = 0
|
||||
var/yield = 3
|
||||
var/spreadChance = 40
|
||||
var/spreadIntoAdjacentChance = 60
|
||||
var/evolveChance = 2
|
||||
var/lastTick = 0
|
||||
var/spreaded = 1
|
||||
|
||||
/obj/effect/glowshroom/single
|
||||
spreadChance = 0
|
||||
|
||||
/obj/effect/glowshroom/New()
|
||||
|
||||
..()
|
||||
|
||||
set_dir(CalcDir())
|
||||
|
||||
if(!floor)
|
||||
switch(dir) //offset to make it be on the wall rather than on the floor
|
||||
if(NORTH)
|
||||
pixel_y = 32
|
||||
if(SOUTH)
|
||||
pixel_y = -32
|
||||
if(EAST)
|
||||
pixel_x = 32
|
||||
if(WEST)
|
||||
pixel_x = -32
|
||||
icon_state = "glowshroom[rand(1,3)]"
|
||||
else //if on the floor, glowshroom on-floor sprite
|
||||
icon_state = "glowshroomf"
|
||||
|
||||
processing_objects += src
|
||||
|
||||
SetLuminosity(round(potency/15))
|
||||
lastTick = world.timeofday
|
||||
|
||||
/obj/effect/glowshroom/Del()
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/effect/glowshroom/process()
|
||||
if(!spreaded)
|
||||
return
|
||||
|
||||
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
|
||||
lastTick = world.timeofday
|
||||
spreaded = 0
|
||||
|
||||
for(var/i=1,i<=yield,i++)
|
||||
if(prob(spreadChance))
|
||||
var/list/possibleLocs = list()
|
||||
var/spreadsIntoAdjacent = 0
|
||||
|
||||
if(prob(spreadIntoAdjacentChance))
|
||||
spreadsIntoAdjacent = 1
|
||||
|
||||
for(var/turf/simulated/floor/plating/airless/asteroid/earth in view(3,src))
|
||||
if(spreadsIntoAdjacent || !locate(/obj/effect/glowshroom) in view(1,earth))
|
||||
possibleLocs += earth
|
||||
|
||||
if(!possibleLocs.len)
|
||||
break
|
||||
|
||||
var/turf/newLoc = pick(possibleLocs)
|
||||
|
||||
var/shroomCount = 0 //hacky
|
||||
var/placeCount = 1
|
||||
for(var/obj/effect/glowshroom/shroom in newLoc)
|
||||
shroomCount++
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/isWall = get_step(newLoc,wallDir)
|
||||
if(isWall.density)
|
||||
placeCount++
|
||||
if(shroomCount >= placeCount)
|
||||
continue
|
||||
|
||||
var/obj/effect/glowshroom/child = new /obj/effect/glowshroom(newLoc)
|
||||
child.potency = potency
|
||||
child.yield = yield
|
||||
child.delay = delay
|
||||
child.endurance = endurance
|
||||
|
||||
spreaded++
|
||||
|
||||
if(prob(evolveChance)) //very low chance to evolve on its own
|
||||
potency += rand(4,6)
|
||||
|
||||
/obj/effect/glowshroom/proc/CalcDir(turf/location = loc)
|
||||
set background = 1
|
||||
var/direction = 16
|
||||
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/newTurf = get_step(location,wallDir)
|
||||
if(newTurf.density)
|
||||
direction |= wallDir
|
||||
|
||||
for(var/obj/effect/glowshroom/shroom in location)
|
||||
if(shroom == src)
|
||||
continue
|
||||
if(shroom.floor) //special
|
||||
direction &= ~16
|
||||
else
|
||||
direction &= ~shroom.dir
|
||||
|
||||
var/list/dirList = list()
|
||||
|
||||
for(var/i=1,i<=16,i <<= 1)
|
||||
if(direction & i)
|
||||
dirList += i
|
||||
|
||||
if(dirList.len)
|
||||
var/newDir = pick(dirList)
|
||||
if(newDir == 16)
|
||||
floor = 1
|
||||
newDir = 1
|
||||
return newDir
|
||||
|
||||
floor = 1
|
||||
return 1
|
||||
|
||||
/obj/effect/glowshroom/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
endurance -= W.force
|
||||
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/glowshroom/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/effect/glowshroom/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
endurance -= 5
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/glowshroom/proc/CheckEndurance()
|
||||
if(endurance <= 0)
|
||||
del(src)
|
||||
@@ -109,7 +109,7 @@
|
||||
W.relativewall()
|
||||
|
||||
for(var/direction in cardinal)
|
||||
for(var/obj/effect/glowshroom/shroom in get_step(src,direction))
|
||||
for(var/obj/effect/shroom/glow/shroom in get_step(src,direction))
|
||||
if(!shroom.floor) //shrooms drop to the floor
|
||||
shroom.floor = 1
|
||||
shroom.icon_state = "glowshroomf"
|
||||
|
||||
@@ -168,12 +168,12 @@ proc/populate_seed_list()
|
||||
M.reagents.add_reagent(chem,injecting)
|
||||
|
||||
//Applies an effect to a target atom.
|
||||
/datum/seed/proc/thrown_at(var/obj/item/thrown,var/atom/target)
|
||||
/datum/seed/proc/thrown_at(var/obj/item/thrown,var/atom/target, var/force_explode)
|
||||
|
||||
var/splatted
|
||||
var/turf/origin_turf = get_turf(target)
|
||||
|
||||
if(get_trait(TRAIT_EXPLOSIVE))
|
||||
if(force_explode || get_trait(TRAIT_EXPLOSIVE))
|
||||
|
||||
var/flood_dist = min(10,max(1,get_trait(TRAIT_POTENCY)/15))
|
||||
var/list/open_turfs = list()
|
||||
@@ -243,7 +243,7 @@ proc/populate_seed_list()
|
||||
for(var/mob/living/M in T.contents)
|
||||
apply_special_effect(M)
|
||||
splatter(T,thrown)
|
||||
origin_turf.visible_message("<span class='danger'>The [thrown.name] violently explodes against [target]!</span>")
|
||||
origin_turf.visible_message("<span class='danger'>The [thrown.name] explodes!</span>")
|
||||
del(thrown)
|
||||
return
|
||||
|
||||
@@ -709,9 +709,11 @@ proc/populate_seed_list()
|
||||
|
||||
//Handle spawning in living, mobile products (like dionaea).
|
||||
if(istype(product,/mob/living))
|
||||
|
||||
product.visible_message("<span class='notice'>The pod disgorges [product]!</span>")
|
||||
handle_living_product(product)
|
||||
if(istype(product,/mob/living/simple_animal/mushroom)) // Gross.
|
||||
var/mob/living/simple_animal/mushroom/mush = product
|
||||
mush.seed = src
|
||||
|
||||
// When the seed in this machine mutates/is modified, the tray seed value
|
||||
// is set to a new datum copied from the original. This datum won't actually
|
||||
@@ -1130,6 +1132,7 @@ proc/populate_seed_list()
|
||||
products = list(/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/chanterelle)
|
||||
mutants = list("reishi","amanita","plumphelmet")
|
||||
chems = list("nutriment" = list(1,25))
|
||||
splat_type = /obj/effect/shroom
|
||||
|
||||
/datum/seed/mushroom/New()
|
||||
..()
|
||||
@@ -1292,7 +1295,6 @@ proc/populate_seed_list()
|
||||
products = list(/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom)
|
||||
mutants = null
|
||||
chems = list("radium" = list(1,20))
|
||||
splat_type = /obj/effect/glowshroom
|
||||
|
||||
/datum/seed/mushroom/glowshroom/New()
|
||||
..()
|
||||
|
||||
166
code/modules/hydroponics/spread_plant.dm
Normal file
166
code/modules/hydroponics/spread_plant.dm
Normal file
@@ -0,0 +1,166 @@
|
||||
//separate dm since hydro is getting bloated already
|
||||
|
||||
/obj/effect/glowshroom
|
||||
name = "glowshroom"
|
||||
anchored = 1
|
||||
opacity = 0
|
||||
density = 0
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "glowshroomf"
|
||||
layer = 2.1
|
||||
l_color = "#003300"
|
||||
|
||||
var/endurance = 30
|
||||
var/potency = 30
|
||||
var/delay = 1200
|
||||
var/floor = 0
|
||||
var/yield = 3
|
||||
var/spreadChance = 40
|
||||
var/spreadIntoAdjacentChance = 60
|
||||
var/evolveChance = 2
|
||||
var/lastTick = 0
|
||||
var/spreaded = 1
|
||||
|
||||
/obj/effect/glowshroom/single
|
||||
spreadChance = 0
|
||||
|
||||
/obj/effect/glowshroom/New()
|
||||
|
||||
..()
|
||||
|
||||
set_dir(CalcDir())
|
||||
|
||||
if(!floor)
|
||||
switch(dir) //offset to make it be on the wall rather than on the floor
|
||||
if(NORTH)
|
||||
pixel_y = 32
|
||||
if(SOUTH)
|
||||
pixel_y = -32
|
||||
if(EAST)
|
||||
pixel_x = 32
|
||||
if(WEST)
|
||||
pixel_x = -32
|
||||
icon_state = "glowshroom[rand(1,3)]"
|
||||
else //if on the floor, glowshroom on-floor sprite
|
||||
icon_state = "glowshroomf"
|
||||
|
||||
processing_objects += src
|
||||
|
||||
SetLuminosity(round(potency/15))
|
||||
lastTick = world.timeofday
|
||||
|
||||
/obj/effect/glowshroom/Del()
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/effect/glowshroom/process()
|
||||
if(!spreaded)
|
||||
return
|
||||
|
||||
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
|
||||
lastTick = world.timeofday
|
||||
spreaded = 0
|
||||
|
||||
for(var/i=1,i<=yield,i++)
|
||||
if(prob(spreadChance))
|
||||
var/list/possibleLocs = list()
|
||||
var/spreadsIntoAdjacent = 0
|
||||
|
||||
if(prob(spreadIntoAdjacentChance))
|
||||
spreadsIntoAdjacent = 1
|
||||
|
||||
for(var/turf/simulated/floor/plating/airless/asteroid/earth in view(3,src))
|
||||
if(spreadsIntoAdjacent || !locate(/obj/effect/glowshroom) in view(1,earth))
|
||||
possibleLocs += earth
|
||||
|
||||
if(!possibleLocs.len)
|
||||
break
|
||||
|
||||
var/turf/newLoc = pick(possibleLocs)
|
||||
|
||||
var/shroomCount = 0 //hacky
|
||||
var/placeCount = 1
|
||||
for(var/obj/effect/glowshroom/shroom in newLoc)
|
||||
shroomCount++
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/isWall = get_step(newLoc,wallDir)
|
||||
if(isWall.density)
|
||||
placeCount++
|
||||
if(shroomCount >= placeCount)
|
||||
continue
|
||||
|
||||
var/obj/effect/glowshroom/child = new /obj/effect/glowshroom(newLoc)
|
||||
child.potency = potency
|
||||
child.yield = yield
|
||||
child.delay = delay
|
||||
child.endurance = endurance
|
||||
|
||||
spreaded++
|
||||
|
||||
if(prob(evolveChance)) //very low chance to evolve on its own
|
||||
potency += rand(4,6)
|
||||
|
||||
/obj/effect/glowshroom/proc/CalcDir(turf/location = loc)
|
||||
set background = 1
|
||||
var/direction = 16
|
||||
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/newTurf = get_step(location,wallDir)
|
||||
if(newTurf.density)
|
||||
direction |= wallDir
|
||||
|
||||
for(var/obj/effect/glowshroom/shroom in location)
|
||||
if(shroom == src)
|
||||
continue
|
||||
if(shroom.floor) //special
|
||||
direction &= ~16
|
||||
else
|
||||
direction &= ~shroom.dir
|
||||
|
||||
var/list/dirList = list()
|
||||
|
||||
for(var/i=1,i<=16,i <<= 1)
|
||||
if(direction & i)
|
||||
dirList += i
|
||||
|
||||
if(dirList.len)
|
||||
var/newDir = pick(dirList)
|
||||
if(newDir == 16)
|
||||
floor = 1
|
||||
newDir = 1
|
||||
return newDir
|
||||
|
||||
floor = 1
|
||||
return 1
|
||||
|
||||
/obj/effect/glowshroom/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
endurance -= W.force
|
||||
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/glowshroom/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/effect/glowshroom/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
endurance -= 5
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/glowshroom/proc/CheckEndurance()
|
||||
if(endurance <= 0)
|
||||
del(src)
|
||||
@@ -13,4 +13,42 @@
|
||||
response_help = "pets"
|
||||
response_disarm = "gently pushes aside"
|
||||
response_harm = "whacks"
|
||||
harm_intent_damage = 5
|
||||
harm_intent_damage = 5
|
||||
var/datum/seed/seed
|
||||
|
||||
/mob/living/simple_animal/mushroom
|
||||
|
||||
set name = "Explode"
|
||||
set category = "Abilities"
|
||||
set desc = "Spread your spores!"
|
||||
set src = usr
|
||||
|
||||
if(stat == 2)
|
||||
usr << "<span class='danger'>You are dead; it is too late for that.</span>"
|
||||
return
|
||||
|
||||
if(!seed)
|
||||
usr << "<span class='danger'>You are sterile!</span>
|
||||
return
|
||||
|
||||
spore_explode()
|
||||
|
||||
/mob/living/simple_animal/mushroom/death()
|
||||
if(prob(30))
|
||||
spore_explode()
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/mushroom/proc/spore_explode()
|
||||
|
||||
if(!seed)
|
||||
return
|
||||
|
||||
var/list/target_turfs = list()
|
||||
for(var/turf/new_turf in orange(1,src))
|
||||
if(prob(60) && !new_turf.density && src.Adjacent(new_turf)) target_turfs |= new_turf
|
||||
for(var/turf/target_turf in target_turfs)
|
||||
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(target_turf,seed)
|
||||
seed.thrown_at(src,get_turf(src),1)
|
||||
if(src)
|
||||
gib()
|
||||
|
||||
@@ -12,4 +12,7 @@
|
||||
response_help = "prods"
|
||||
response_disarm = "pushes aside"
|
||||
response_harm = "smacks"
|
||||
harm_intent_damage = 5
|
||||
harm_intent_damage = 5
|
||||
melee_damage_upper = 15
|
||||
melee_damage_lower = 10
|
||||
attacktext = "mauled"
|
||||
@@ -1844,7 +1844,7 @@ datum
|
||||
var/obj/effect/alien/weeds/alien_weeds = O
|
||||
alien_weeds.health -= rand(15,35) // Kills alien weeds pretty fast
|
||||
alien_weeds.healthcheck()
|
||||
else if(istype(O,/obj/effect/glowshroom)) //even a small amount is enough to kill it
|
||||
else if(istype(O,/obj/effect/shroom)) //even a small amount is enough to kill it
|
||||
del(O)
|
||||
else if(istype(O,/obj/effect/plantsegment))
|
||||
if(prob(50)) del(O) //Kills kudzu too.
|
||||
@@ -2075,7 +2075,7 @@ datum
|
||||
M.take_organ_damage(min(6*toxpwr, volume * toxpwr))
|
||||
|
||||
reaction_obj(var/obj/O, var/volume)
|
||||
if((istype(O,/obj/item) || istype(O,/obj/effect/glowshroom)) && prob(meltprob * 3))
|
||||
if((istype(O,/obj/item) || istype(O,/obj/effect/shroom/glow)) && prob(meltprob * 3))
|
||||
if(!O.unacidable)
|
||||
var/obj/effect/decal/cleanable/molten_item/I = new/obj/effect/decal/cleanable/molten_item(O.loc)
|
||||
I.desc = "Looks like this was \an [O] some time ago."
|
||||
|
||||
Reference in New Issue
Block a user