From a367240477a15d9d19dd55858478ae24bd886bf2 Mon Sep 17 00:00:00 2001 From: Alberyk Date: Tue, 16 Jan 2018 11:14:59 -0200 Subject: [PATCH] Returns old alien weeds (#4075) This update returns the alien weeds to their old behavior, instead of just being regular vines that turns any alien round into a giant clusterfuck. Also fixes alien acid being unable to melt the floor. --- code/game/objects/effects/aliens.dm | 5 + code/game/objects/structures/alien/node.dm | 114 +++++++++++++++--- .../human/species/xenomorphs/alien_powers.dm | 3 +- .../human/species/xenomorphs/alien_species.dm | 7 +- .../Chemistry-Reagents-Toxins.dm | 6 +- html/changelogs/alberyk-alienweeds.yml | 5 + 6 files changed, 120 insertions(+), 20 deletions(-) create mode 100644 html/changelogs/alberyk-alienweeds.yml diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 6c9a3b651f2..78f255f5a5d 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -35,6 +35,11 @@ if(istype(target, /turf/simulated/wall)) // I hate turf code. var/turf/simulated/wall/W = target W.dismantle_wall(1) + + if(istype(target, /turf/simulated/floor)) + var/turf/simulated/floor/F = target + F.ChangeTurf(F.baseturf) + else qdel(target) qdel(src) diff --git a/code/game/objects/structures/alien/node.dm b/code/game/objects/structures/alien/node.dm index c7e1ceb1871..e69e798084b 100644 --- a/code/game/objects/structures/alien/node.dm +++ b/code/game/objects/structures/alien/node.dm @@ -1,19 +1,105 @@ -/obj/structure/alien/node - name = "alien weed node" - desc = "Some kind of strange, pulsating structure." +#define NODERANGE 3 + +/obj/structure/alien/weeds + name = "weeds" + desc = "Weird purple weeds." + icon_state = "weeds" + anchored = 1 + density = 0 + health = 15 + var/obj/structure/alien/weeds/node/linked_node = null + var/list/dirs_left + +/obj/structure/alien/weeds/node icon_state = "weednode" - health = 100 - layer = 3.1 + name = "purple sac" + desc = "Weird purple octopus-like thing." + light_range = NODERANGE + var/node_range = NODERANGE -/obj/structure/alien/node/Initialize() - . = ..() - START_PROCESSING(SSprocessing, src) - -/obj/structure/alien/node/Destroy() +/obj/structure/alien/weeds/Destroy() STOP_PROCESSING(SSprocessing, src) return ..() -/obj/structure/alien/node/process() - if(locate(/obj/effect/plant) in loc) - return - new /obj/effect/plant(get_turf(src), SSplants.seeds["xenomorph"]) +/obj/structure/alien/weeds/Initialize(pos, node) + . = ..() + if(istype(loc, /turf/space)) + return INITIALIZE_HINT_QDEL + linked_node = node + if(icon_state == "weeds")icon_state = pick("weeds", "weeds1", "weeds2") + + START_PROCESSING(SSprocessing, src) + + dirs_left = cardinal.Copy() + +/obj/structure/alien/weeds/process() + var/turf/U = get_turf(src) + + if (istype(U, /turf/space)) + qdel(src) + return PROCESS_KILL + + if (!dirs_left.len || !linked_node || get_dist(linked_node, src) > linked_node.node_range) + return PROCESS_KILL + + for (var/D in dirs_left) + var/turf/T = get_step(src, D) + + if (!isturf(T) || T.is_hole || T.is_space() || locate(/obj/structure/alien/weeds, T)) + dirs_left -= D + continue + + if (T.density) + continue + + var/spawn_new = TRUE + for (var/aa in T) + var/atom/A = aa + if (istype(/obj/structure/alien/weeds, A)) + dirs_left -= D + spawn_new = FALSE + break + + else if (A.density) + spawn_new = FALSE + + if (spawn_new) + new /obj/structure/alien/weeds(T, linked_node) + + +/obj/structure/alien/weeds/ex_act(severity) + switch(severity) + if(1.0) + qdel(src) + if(2.0) + if (prob(50)) + qdel(src) + if(3.0) + if (prob(5)) + qdel(src) + return + +/obj/structure/alien/weeds/attackby(var/obj/item/weapon/W, var/mob/user) + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + + visible_message("\The [src] have been attacked with \the [W][(user ? " by [user]." : ".")]") + + var/damage = W.force / 4.0 + + if(iswelder(W)) + var/obj/item/weapon/weldingtool/WT = W + + if(WT.remove_fuel(0, user)) + damage = 15 + playsound(loc, 'sound/items/Welder.ogg', 100, 1) + + health -= damage + healthcheck() + + +/obj/structure/alien/weeds/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) + if(exposed_temperature > 300 + T0C) + health -= 5 + healthcheck() + +#undef NODERANGE \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm index bdc0005f2f5..5016600acef 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_powers.dm @@ -121,7 +121,8 @@ if(check_alien_ability(50,1,"resin spinner")) visible_message("[src] has planted some alien weeds!") - new /obj/structure/alien/node(loc) + var/obj/structure/alien/weeds/node/new_node = new(get_turf(src)) + new_node.linked_node = new_node return /mob/living/carbon/human/proc/corrosive_acid(O as obj|turf in oview(1)) //If they right click to corrode, an error will flash if its an invalid target./N diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm index f02bd634ec2..3e324c5306e 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/alien_species.dm @@ -125,10 +125,9 @@ var/datum/gas_mixture/environment = T.return_air() if(!environment) return - var/obj/effect/plant/plant = locate() in T - if((environment.gas["phoron"] > 0 || (plant && plant.seed && plant.seed.name == "xenomorph")) && !regenerate(H)) - var/obj/item/organ/xenos/plasmavessel/P = H.internal_organs_by_name["plasma vessel"] - if(istype(P)) + if(environment.gas["phoron"] > 0 || locate(/obj/structure/alien/weeds) in T) + if(!regenerate(H)) + var/obj/item/organ/xenos/plasmavessel/P = H.internal_organs_by_name["plasma vessel"] P.stored_plasma += weeds_plasma_rate P.stored_plasma = min(max(P.stored_plasma,0),P.max_plasma) ..() diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 91a86c59b49..513b8fd0512 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -234,7 +234,11 @@ W.visible_message("The fungi are completely dissolved by the solution!") /datum/reagent/toxin/plantbgone/touch_obj(var/obj/O, var/volume) - if(istype(O, /obj/effect/plant)) + if(istype(O, /obj/structure/alien/weeds)) + var/obj/structure/alien/weeds/alien_weeds = O + alien_weeds.health -= rand(15, 35) + alien_weeds.healthcheck() + else if(istype(O, /obj/effect/plant)) qdel(O) /datum/reagent/toxin/plantbgone/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) diff --git a/html/changelogs/alberyk-alienweeds.yml b/html/changelogs/alberyk-alienweeds.yml new file mode 100644 index 00000000000..0f88fb54c9f --- /dev/null +++ b/html/changelogs/alberyk-alienweeds.yml @@ -0,0 +1,5 @@ +author: Alberyk +delete-after: True +changes: + - rscadd: "Return alien weeds to their old format, replacing the vines." + - bugfix: "Alien acid should now be able to melt floors."