From a37aee7fb586fa15ac01522cc37e0faf4fd11d32 Mon Sep 17 00:00:00 2001 From: MadmanMartian Date: Fri, 13 Oct 2017 16:27:15 +0100 Subject: [PATCH] reworks biomass AGAIN, makes scythes function in a similar fashion against them as they do to vines --- code/game/gamemodes/events/biomass.dm | 27 ++++++++++++++++--------- code/modules/hydroponics/hydro_tools.dm | 4 +++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/code/game/gamemodes/events/biomass.dm b/code/game/gamemodes/events/biomass.dm index 0e6900c12ff..0954f54ed67 100644 --- a/code/game/gamemodes/events/biomass.dm +++ b/code/game/gamemodes/events/biomass.dm @@ -12,6 +12,7 @@ pass_flags = PASSTABLE | PASSGRILLE var/energy = 0 var/obj/effect/biomass_controller/master = null + var/health = 15 /obj/effect/biomass/Destroy() unreferenceMaster() @@ -28,21 +29,21 @@ if(prob(30)) user.visible_message("\The [user] cuts through \the [src] with \the [W]'s sharp edge.",\ "You cut through \the [src] with \the [W]'s sharp edge.") - qdel(src) + adjust_health(rand(5,15)) return if(W.sharpness_flags & (SERRATED_BLADE|CHOPWOOD)) //Guaranteed, but takes some work if(do_after(user, src, rand(10,30))) if(prob(30)) user.visible_message("\The [user] chops through \the [src] with \the [W].",\ "You saw through \the [src].") - qdel(src) + adjust_health(rand(25,50)) return if(W.sharpness_flags & HOT_EDGE) if(do_after(user, src, rand(5,15))) //Guaranteed, rarer sharpness flag so less time taken if(prob(30)) user.visible_message("\The [user] sears through \the [src] with \the [W].",\ "You use \the [W]'s hot edge to burn through \the [src].") - qdel(src) + adjust_health(rand(20,35)) return var/weapon_temp = W.is_hot() if(weapon_temp >= AUTOIGNITION_WOOD)//Yes it's not technically wood, but fibrous chitin's pretty close when held above a flame @@ -51,7 +52,7 @@ if(prob(30)) user.visible_message("\The [user] burns away \the [src] with \the [W].",\ "You use \the [W] to burn away \the [src].") - qdel(src) + adjust_health(rand(40,70)) return ..() @@ -59,10 +60,17 @@ if(energy <= 0) icon_state = "stage2" energy = 1 + adjust_health(-30) else icon_state = "stage3" density = 1 energy = 2 + adjust_health(-30) + +/obj/effect/biomass/proc/adjust_health(var/amount) + health -= amount + if(health <= 0) + qdel(src) /obj/effect/biomass/proc/spread() var/location = get_step_rand(src) @@ -80,16 +88,15 @@ /obj/effect/biomass/ex_act(severity) switch(severity) if(1.0) - qdel(src) + adjust_health(100) if(2.0) - if(prob(90)) - qdel(src) + adjust_health(65) if(3.0) - if(prob(50)) - qdel(src) + adjust_health(25) /obj/effect/biomass/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) //hotspots kill biomass - qdel(src) + if(exposed_temperature >= AUTOIGNITION_WOOD) + adjust_health(70) /obj/effect/biomass_controller invisibility = 60 // ghost only diff --git a/code/modules/hydroponics/hydro_tools.dm b/code/modules/hydroponics/hydro_tools.dm index e603a82edd2..a808c0c0dee 100644 --- a/code/modules/hydroponics/hydro_tools.dm +++ b/code/modules/hydroponics/hydro_tools.dm @@ -457,9 +457,11 @@ /obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity) if(!proximity) return - if(istype(A, /obj/effect/plantsegment) || istype(A, /turf/simulated/floor)) + if(istype(A, /obj/effect/plantsegment) || istype(A, /turf/simulated/floor) || istype(A, /obj/effect/biomass)) for(var/obj/effect/plantsegment/B in range(user,1)) B.take_damage(src) + for(var/obj/effect/biomass/BM in range(user,1)) + BM.adjust_health(rand(15,45)) user.delayNextAttack(10) /*var/olddir = user.dir spawn for(var/i=-2, i<=2, i++) //hheeeehehe i'm so dumb