From 3808550798a6cab31c648a60efb2090cc4e8279f Mon Sep 17 00:00:00 2001 From: Drulikar Date: Thu, 29 Jun 2023 02:15:45 -0700 Subject: [PATCH 1/4] Weed nodes now check density Refactoring --- .../xenomorph/abilities/general_powers.dm | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index 692fa31c72e7..a9e63508935d 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -4,58 +4,62 @@ // Plant weeds /datum/action/xeno_action/onclick/plant_weeds/use_ability(atom/A) - var/mob/living/carbon/xenomorph/X = owner + var/mob/living/carbon/xenomorph/xeno = owner if(!action_cooldown_check()) return - if(!X.check_state()) + if(!xeno.check_state()) return - if(X.burrow) + if(xeno.burrow) return - var/turf/T = X.loc + var/turf/turf = xeno.loc - if(!istype(T)) - to_chat(X, SPAN_WARNING("You can't do that here.")) + if(!istype(turf)) + to_chat(xeno, SPAN_WARNING("You can't do that here.")) return - var/is_weedable = T.is_weedable() + if(turf.density) + to_chat(xeno, SPAN_WARNING("You can't do that here.")) + return + + var/is_weedable = turf.is_weedable() if(!is_weedable) - to_chat(X, SPAN_WARNING("Bad place for a garden!")) + to_chat(xeno, SPAN_WARNING("Bad place for a garden!")) return if(!plant_on_semiweedable && is_weedable < FULLY_WEEDABLE) - to_chat(X, SPAN_WARNING("Bad place for a garden!")) + to_chat(xeno, SPAN_WARNING("Bad place for a garden!")) return - var/obj/effect/alien/weeds/node/N = locate() in T - if(N && N.weed_strength >= X.weed_level) - to_chat(X, SPAN_WARNING("There's a pod here already!")) + var/obj/effect/alien/weeds/node/node = locate() in turf + if(node && node.weed_strength >= xeno.weed_level) + to_chat(xeno, SPAN_WARNING("There's a pod here already!")) return - var/obj/effect/alien/resin/trap/resin_trap = locate() in T + var/obj/effect/alien/resin/trap/resin_trap = locate() in turf if(resin_trap) - to_chat(X, SPAN_WARNING("You can't weed on top of a trap!")) + to_chat(xeno, SPAN_WARNING("You can't weed on top of a trap!")) return - var/list/to_convert - if(N) - to_convert = N.children.Copy() - - var/obj/effect/alien/weeds/W = locate(/obj/effect/alien/weeds) in T - if (W && W.weed_strength >= WEED_LEVEL_HIVE) - to_chat(X, SPAN_WARNING("These weeds are too strong to plant a node on!")) + var/obj/effect/alien/weeds/weed = node || locate() in turf + if (weed && weed.weed_strength >= WEED_LEVEL_HIVE) + to_chat(xeno, SPAN_WARNING("These weeds are too strong to plant a node on!")) return - var/area/AR = get_area(T) - if(isnull(AR) || !(AR.is_resin_allowed)) - to_chat(X, SPAN_XENOWARNING("It's too early to spread the hive this far.")) + var/area/area = get_area(turf) + if(isnull(area) || !(area.is_resin_allowed)) + to_chat(xeno, SPAN_XENOWARNING("It's too early to spread the hive this far.")) return - if (!check_and_use_plasma_owner()) + if(!check_and_use_plasma_owner()) return - X.visible_message(SPAN_XENONOTICE("\The [X] regurgitates a pulsating node and plants it on the ground!"), \ + var/list/to_convert + if(node) + to_convert = node.children.Copy() + + xeno.visible_message(SPAN_XENONOTICE("\The [xeno] regurgitates a pulsating node and plants it on the ground!"), \ SPAN_XENONOTICE("You regurgitate a pulsating node and plant it on the ground!"), null, 5) - var/obj/effect/alien/weeds/node/new_node = new node_type(X.loc, src, X) + var/obj/effect/alien/weeds/node/new_node = new node_type(xeno.loc, src, xeno) if(to_convert) for(var/weed in to_convert) @@ -64,7 +68,7 @@ new /obj/effect/alien/weeds(target_turf, new_node) qdel(weed) - playsound(X.loc, "alien_resin_build", 25) + playsound(xeno.loc, "alien_resin_build", 25) apply_cooldown() return ..() From 1d618b8189bf3a74c9c2f0942edf600cfd92f418 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Thu, 29 Jun 2023 03:08:45 -0700 Subject: [PATCH 2/4] 515 you're weird --- .../living/carbon/xenomorph/abilities/general_powers.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index 2d8077c4b201..5cbe84004d13 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -41,7 +41,7 @@ return var/obj/effect/alien/weeds/weed = node || locate() in turf - if (weed && weed.weed_strength >= WEED_LEVEL_HIVE) + if(weed && weed.weed_strength >= WEED_LEVEL_HIVE) to_chat(xeno, SPAN_WARNING("These weeds are too strong to plant a node on!")) return @@ -65,11 +65,11 @@ var/obj/effect/alien/weeds/node/new_node = new node_type(xeno.loc, src, xeno) if(to_convert) - for(var/weed in to_convert) - var/turf/target_turf = get_turf(weed) + for(var/cur_weed in to_convert) + var/turf/target_turf = get_turf(cur_weed) if(target_turf && !target_turf.density) new /obj/effect/alien/weeds(target_turf, new_node) - qdel(weed) + qdel(cur_weed) playsound(xeno.loc, "alien_resin_build", 25) apply_cooldown() From 9fd4faa81565da1e1b35ab0575d7a1ae6b4834a2 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Fri, 30 Jun 2023 00:26:56 -0700 Subject: [PATCH 3/4] No window frames --- .../mob/living/carbon/xenomorph/abilities/general_powers.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index 5cbe84004d13..a71a7f271ec9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -45,6 +45,11 @@ to_chat(xeno, SPAN_WARNING("These weeds are too strong to plant a node on!")) return + var/obj/structure/window_frame/window = locate() in turf + if(window && window.density) + to_chat(xeno, SPAN_WARNING("You can't do that here.")) + return + var/area/area = get_area(turf) if(isnull(area) || !(area.is_resin_allowed)) if(area.flags_area & AREA_UNWEEDABLE) From e8097b476ca156fd03fa0c9761b223946642b147 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Fri, 30 Jun 2023 01:25:03 -0700 Subject: [PATCH 4/4] Test structure density instead (Why is this check normally also tested against ON_BORDER?) --- .../living/carbon/xenomorph/abilities/general_powers.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index a71a7f271ec9..fbf7d993a067 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -45,10 +45,10 @@ to_chat(xeno, SPAN_WARNING("These weeds are too strong to plant a node on!")) return - var/obj/structure/window_frame/window = locate() in turf - if(window && window.density) - to_chat(xeno, SPAN_WARNING("You can't do that here.")) - return + for(var/obj/structure/struct in turf) + if(struct.density && !(struct.flags_atom & ON_BORDER)) // Not sure exactly if we need to test against ON_BORDER though + to_chat(xeno, SPAN_WARNING("You can't do that here.")) + return var/area/area = get_area(turf) if(isnull(area) || !(area.is_resin_allowed))