From 106ae949ed2b69b0c0cada244ae67fef196473da Mon Sep 17 00:00:00 2001 From: cuberound <122645057+cuberound@users.noreply.github.com> Date: Mon, 5 May 2025 13:39:58 +0200 Subject: [PATCH 1/3] weedability refactor (#9182) # About the pull request refactors is_weedable from getter to var # Explain why it's good for the game I need it for another project and it can allows possibly for more player side weedability interactions # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: refactor:changes is_weedable from getter to var /:cl: --------- Co-authored-by: vincibrv --- code/game/turfs/auto_turf.dm | 17 ++++--- code/game/turfs/closed.dm | 5 +- code/game/turfs/floor_types.dm | 12 ++--- code/game/turfs/floors/desert.dm | 16 ++----- code/game/turfs/hunter_turf.dm | 4 +- code/game/turfs/hybrisa.dm | 13 ++---- code/game/turfs/open.dm | 22 ++++----- code/game/turfs/open_space.dm | 4 +- code/game/turfs/shale.dm | 4 +- code/game/turfs/snow.dm | 4 ++ code/game/turfs/space.dm | 1 + code/game/turfs/strata.dm | 18 ++------ code/game/turfs/turf.dm | 46 ++++--------------- code/game/turfs/walls/wall_types.dm | 5 +- code/game/turfs/walls/walls.dm | 4 ++ code/modules/cm_aliens/hivebuffs/hivebuff.dm | 6 +-- code/modules/cm_aliens/weeds.dm | 5 +- .../xenomorph/abilities/general_powers.dm | 6 +-- .../xenomorph/abilities/queen/queen_powers.dm | 2 +- .../carbon/xenomorph/resin_constructions.dm | 2 +- 20 files changed, 72 insertions(+), 124 deletions(-) diff --git a/code/game/turfs/auto_turf.dm b/code/game/turfs/auto_turf.dm index e965323d86ed..f22a5c11756a 100644 --- a/code/game/turfs/auto_turf.dm +++ b/code/game/turfs/auto_turf.dm @@ -11,9 +11,6 @@ /turf/open/auto_turf/insert_self_into_baseturfs() baseturfs += type -/turf/open/auto_turf/is_weedable()//for da xenos - return FULLY_WEEDABLE - /turf/open/auto_turf/get_dirt_type() return DIRT_TYPE_GROUND //automatically diggable I guess @@ -166,6 +163,15 @@ icon_prefix = "snow" layer_name = list("icy dirt", "shallow snow", "deep snow", "very deep snow", "rock filled snow") +/turf/open/auto_turf/snow/Initialize(mapload, ...) + . = ..() + is_weedable = bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE + +/turf/open/auto_turf/snow/changing_layer(new_layer) + . = ..() + is_weedable = bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE + + /turf/open/auto_turf/snow/insert_self_into_baseturfs() baseturfs += /turf/open/auto_turf/snow/layer0 @@ -175,9 +181,6 @@ else return DIRT_TYPE_GROUND -/turf/open/auto_turf/snow/is_weedable() - return bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE - /turf/open/auto_turf/snow/attackby(obj/item/I, mob/user) //Light Stick if(istype(I, /obj/item/lightstick)) @@ -351,7 +354,9 @@ /turf/open/auto_turf/shale/layer1 icon_state = "shale_1" bleed_layer = 1 + is_weedable = SEMI_WEEDABLE /turf/open/auto_turf/shale/layer2 icon_state = "shale_2" bleed_layer = 2 + is_weedable = SEMI_WEEDABLE diff --git a/code/game/turfs/closed.dm b/code/game/turfs/closed.dm index 214b02d2ca9e..a13d67b943a0 100644 --- a/code/game/turfs/closed.dm +++ b/code/game/turfs/closed.dm @@ -286,8 +286,9 @@ icon = 'icons/turf/shuttle.dmi' layer = ABOVE_TURF_LAYER -/turf/closed/shuttle/is_weedable() - return FULLY_WEEDABLE +/turf/closed/shuttle/Initialize(mapload) + . = ..() + is_weedable = FULLY_WEEDABLE /turf/closed/shuttle/dropship icon = 'icons/turf/walls/walls.dmi' diff --git a/code/game/turfs/floor_types.dm b/code/game/turfs/floor_types.dm index 1c55ce3b73ef..6adc56f68fb9 100644 --- a/code/game/turfs/floor_types.dm +++ b/code/game/turfs/floor_types.dm @@ -210,9 +210,7 @@ /turf/open/floor/plating/almayer/no_build allow_construction = FALSE - -/turf/open/floor/plating/almayer/no_build/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/floor/plating/airless icon_state = "plating" @@ -1886,9 +1884,7 @@ desc = "There seems to be an awful lot of machinery down below..." icon = 'icons/turf/floors/floors.dmi' icon_state = "black" - -/turf/open/floor/almayer/empty/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/floor/almayer/empty/ex_act(severity) //Should make it indestructible return @@ -2152,9 +2148,7 @@ name = "hull" turf_flags = TURF_HULL allow_construction = FALSE - -/turf/open/floor/almayer_hull/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/floor/almayer_hull/outerhull_dir icon_state = "outerhull_dir" diff --git a/code/game/turfs/floors/desert.dm b/code/game/turfs/floors/desert.dm index bef9fd77318e..893079fc9a0e 100644 --- a/code/game/turfs/floors/desert.dm +++ b/code/game/turfs/floors/desert.dm @@ -23,9 +23,7 @@ /turf/open/desert/dirt name = "desert" icon_state = "desert1" - -/turf/open/desert/dirt/is_weedable() - return FULLY_WEEDABLE + is_weedable = FULLY_WEEDABLE /turf/open/desert/dirt/desert_transition_edge1 icon_state = "desert_transition_edge1" @@ -86,9 +84,7 @@ /turf/open/desert/rock name = "rock" icon_state = "rock1" - -/turf/open/desert/rock/is_weedable() - return FULLY_WEEDABLE + is_weedable = FULLY_WEEDABLE /turf/open/desert/rock/edge1 name = "desert" @@ -168,6 +164,7 @@ icon_state = "shore1" var/toxic = 0 supports_surgery = FALSE + is_weedable = NOT_WEEDABLE /turf/open/desert/desert_shore/update_icon() ..() @@ -182,9 +179,6 @@ set_light(1) icon = 'icons/turf/floors/desert_water_transition.dmi' -/turf/open/desert/desert_shore/is_weedable() - return NOT_WEEDABLE - /turf/open/desert/desert_shore/desert_shore1 name = "shore" icon_state = "shore1" @@ -324,9 +318,7 @@ icon_overlay = "_shallow" var/toxic = 0 default_name = "water" - -/turf/open/gm/river/desert/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/gm/river/desert/update_icon() ..() diff --git a/code/game/turfs/hunter_turf.dm b/code/game/turfs/hunter_turf.dm index fd6a3c76ce08..e4b628251fb9 100644 --- a/code/game/turfs/hunter_turf.dm +++ b/code/game/turfs/hunter_turf.dm @@ -274,9 +274,7 @@ icon = 'icons/turf/floors/hunter_floors.dmi' icon_state = "outerhull" allow_construction = FALSE - -/turf/open/floor/predship/hull/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/floor/predship/hull/non_weedable_hull icon_state = "outerhull_dir" diff --git a/code/game/turfs/hybrisa.dm b/code/game/turfs/hybrisa.dm index 2368033c8f59..cde93beb899a 100644 --- a/code/game/turfs/hybrisa.dm +++ b/code/game/turfs/hybrisa.dm @@ -177,10 +177,7 @@ icon = 'icons/turf/floors/floors.dmi' icon_state = "bcircuit" allow_construction = FALSE - - -/turf/open/hybrisa/street/underground_unweedable/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE // Engineer Ship Hull @@ -190,9 +187,7 @@ icon = 'icons/turf/floors/engineership.dmi' icon_state = "engineerwallfloor1" allow_construction = FALSE - -/turf/open/floor/hybrisa/engineership/ship_hull/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/floor/hybrisa/engineership/ship_hull/non_weedable_hull icon_state = "outerhull_dir" @@ -1034,9 +1029,7 @@ desc = "A strange metal pillar, unlike any metal you've seen before." icon_state = "eng_pillar1" allow_construction = FALSE - -/turf/open/floor/hybrisa/engineership/pillars/is_weedable() - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/floor/hybrisa/engineership/pillars/north/pillar1 icon_state = "eng_pillar1" diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 103b216b31d1..30f953ed790c 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -157,14 +157,12 @@ mouse_opacity = FALSE can_bloody = FALSE supports_surgery = FALSE + is_weedable = NOT_WEEDABLE /turf/open/void/vehicle density = TRUE opacity = TRUE -/turf/open/void/is_weedable() - return NOT_WEEDABLE - /turf/open/river can_bloody = FALSE supports_surgery = FALSE @@ -187,6 +185,7 @@ icon_state = "mars_sand_1" is_groundmap_turf = TRUE minimap_color = MINIMAP_MARS_DIRT + is_weedable = SEMI_WEEDABLE /turf/open/mars_cave @@ -486,6 +485,7 @@ icon_state = "grass1" baseturfs = /turf/open/gm/grass scorchable = "grass1" + is_weedable = SEMI_WEEDABLE /turf/open/gm/grass/grass1 icon_state = "grass1" @@ -546,6 +546,7 @@ icon_state = "grassdirt_edge" baseturfs = /turf/open/gm/dirtgrassborder scorchable = "grass1" + is_weedable = SEMI_WEEDABLE /turf/open/gm/dirtgrassborder/north dir = NORTH @@ -653,6 +654,7 @@ baseturfs = /turf/open/gm/river supports_surgery = FALSE minimap_color = MINIMAP_WATER + is_weedable = NOT_WEEDABLE /turf/open/gm/river/Initialize(mapload, ...) . = ..() @@ -805,6 +807,7 @@ icon_state = "beach" baseturfs = /turf/open/gm/coast supports_surgery = FALSE + is_weedable = NOT_WEEDABLE /turf/open/gm/coast/north @@ -881,11 +884,7 @@ icon_state = "black" density = TRUE supports_surgery = FALSE - -/turf/open/gm/empty/is_weedable() - return NOT_WEEDABLE - - + is_weedable = NOT_WEEDABLE //Nostromo turfs @@ -912,10 +911,8 @@ . = ..() setDir(pick(NORTH,SOUTH,EAST,WEST,NORTHEAST,NORTHWEST,SOUTHEAST,SOUTHWEST)) -/turf/open/ice/noweed/is_weedable() //used for new prison ice block xenos - return NOT_WEEDABLE - - +/turf/open/ice/noweed //used for new prison ice block xenos + is_weedable = NOT_WEEDABLE // Colony tiles /turf/open/asphalt @@ -1028,6 +1025,7 @@ icon_state = "grass1" var/icon_spawn_state = "grass1" baseturfs = /turf/open/jungle + is_weedable = NOT_WEEDABLE /turf/open/jungle/Initialize(mapload, ...) . = ..() diff --git a/code/game/turfs/open_space.dm b/code/game/turfs/open_space.dm index 917d6eff94ec..0122c0f85dad 100644 --- a/code/game/turfs/open_space.dm +++ b/code/game/turfs/open_space.dm @@ -13,6 +13,7 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr icon_state = "transparent" baseturfs = /turf/open_space plane = OPEN_SPACE_PLANE_START + is_weedable = NOT_WEEDABLE /turf/open_space/Initialize() ADD_TRAIT(src, TURF_Z_TRANSPARENT_TRAIT, TRAIT_SOURCE_INHERENT) @@ -64,6 +65,3 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr user.forceMove(below) return - -/turf/open_space/is_weedable() - return NOT_WEEDABLE diff --git a/code/game/turfs/shale.dm b/code/game/turfs/shale.dm index 0bdf8ed30aab..9a11ede5de59 100644 --- a/code/game/turfs/shale.dm +++ b/code/game/turfs/shale.dm @@ -2,9 +2,7 @@ /turf/open/shale icon = 'icons/turf/floors/auto_shale.dmi' icon_state = "shale_0" - -/turf/open/shale/is_weedable() - return TRUE + is_weedable = SEMI_WEEDABLE /turf/open/shale/get_dirt_type() return DIRT_TYPE_SHALE diff --git a/code/game/turfs/snow.dm b/code/game/turfs/snow.dm index e6954fc9cd38..f068a7bc6349 100644 --- a/code/game/turfs/snow.dm +++ b/code/game/turfs/snow.dm @@ -40,6 +40,7 @@ /turf/open/snow/Initialize(mapload, ...) . = ..() update_icon(1,1) + is_weedable = bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE /turf/open/snow/Entered(atom/movable/AM) if(bleed_layer > 0) @@ -117,6 +118,9 @@ I.layer = layer + 0.001 + bleed_layer * 0.0001 overlays += I + //a bit odd to have it here but weedability should be linked to visual show of snow + is_weedable = bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE + //Explosion act /turf/open/snow/ex_act(severity) diff --git a/code/game/turfs/space.dm b/code/game/turfs/space.dm index 0af7ffee3be4..f7aea53de902 100644 --- a/code/game/turfs/space.dm +++ b/code/game/turfs/space.dm @@ -11,6 +11,7 @@ can_bloody = FALSE layer = UNDER_TURF_LAYER supports_surgery = FALSE + is_weedable = NOT_WEEDABLE /turf/open/space/basic/New() //Do not convert to Initialize //This is used to optimize the map loader diff --git a/code/game/turfs/strata.dm b/code/game/turfs/strata.dm index 3d49cf05dc07..e319d8a2db37 100644 --- a/code/game/turfs/strata.dm +++ b/code/game/turfs/strata.dm @@ -1,29 +1,21 @@ //Special Strata (Carp Lake) Weedable Jungle/Grass turfs.// -/turf/open/gm/grass/weedable/ //inherit from general turfs - -/turf/open/gm/grass/weedable/is_weedable() - return FULLY_WEEDABLE +/turf/open/gm/grass/weedable //inherit from general turfs + is_weedable = FULLY_WEEDABLE //just in case /turf/open/gm/grass/grass1/weedable //inherit from general turfs - -/turf/open/gm/grass/grass1/weedable/is_weedable() - return FULLY_WEEDABLE + is_weedable = FULLY_WEEDABLE /turf/open/gm/dirtgrassborder/weedable - -/turf/open/gm/dirtgrassborder/weedable/is_weedable() //Gotta have our sexy grass borders be weedable. - return FULLY_WEEDABLE + is_weedable = FULLY_WEEDABLE /turf/open/gm/dirtgrassborder/weedable/grass1 icon_state = "grass1" /turf/closed/gm/dense/weedable - -/turf/closed/gm/dense/weedable/is_weedable() //Weed-able jungle walls. Notably crushers can slam through this, so that might cause overlay issues. 3 months later, yeah it causes overlay issues, so return FALSE! - return NOT_WEEDABLE + is_weedable = NOT_WEEDABLE /turf/open/floor/strata //Instance me! icon = 'icons/turf/floors/strata_floor.dmi' diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index a5aaf5aa5d46..62f5adef9b97 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -67,6 +67,9 @@ /// Is fishing allowed on this turf var/fishing_allowed = FALSE + /// Can xenomorph weeds grow on the tile + var/is_weedable = FULLY_WEEDABLE + /turf/Initialize(mapload) SHOULD_CALL_PARENT(FALSE) // this doesn't parent call for optimisation reasons if(flags_atom & INITIALIZED) @@ -114,6 +117,11 @@ if(opacity) directional_opacity = ALL_CARDINALS + //dense turfs stop weeds + if(density) + is_weedable = NOT_WEEDABLE + + if(istransparentturf(src)) return INITIALIZE_HINT_LATELOAD else @@ -676,44 +684,6 @@ ////////////////////////////////////////////////////////// -//Check if you can plant weeds on that turf. -//Does NOT return a message, just a 0 or 1. -/turf/proc/is_weedable() - return density ? NOT_WEEDABLE : FULLY_WEEDABLE - -/turf/open/space/is_weedable() - return NOT_WEEDABLE - -/turf/open/gm/grass/is_weedable() - return SEMI_WEEDABLE - -/turf/open/gm/dirtgrassborder/is_weedable() - return SEMI_WEEDABLE - -/turf/open/gm/river/is_weedable() - return NOT_WEEDABLE - -/turf/open/gm/coast/is_weedable() - return NOT_WEEDABLE - -/turf/open/snow/is_weedable() - return bleed_layer ? NOT_WEEDABLE : FULLY_WEEDABLE - -/turf/open/mars/is_weedable() - return SEMI_WEEDABLE - -/turf/open/jungle/is_weedable() - return NOT_WEEDABLE - -/turf/open/auto_turf/shale/layer1/is_weedable() - return SEMI_WEEDABLE - -/turf/open/auto_turf/shale/layer2/is_weedable() - return SEMI_WEEDABLE - -/turf/closed/wall/is_weedable() - return FULLY_WEEDABLE //so we can spawn weeds on the walls - /turf/proc/can_dig_xeno_tunnel() return FALSE diff --git a/code/game/turfs/walls/wall_types.dm b/code/game/turfs/walls/wall_types.dm index c26262e5ef25..2e9a4e1cc963 100644 --- a/code/game/turfs/walls/wall_types.dm +++ b/code/game/turfs/walls/wall_types.dm @@ -481,8 +481,9 @@ walltype = WALL_BONE_RESIN turf_flags = TURF_HULL -/turf/closed/wall/mineral/bone/is_weedable() - return NOT_WEEDABLE + +/turf/closed/wall/mineral/bone + is_weedable = NOT_WEEDABLE //Misc walls diff --git a/code/game/turfs/walls/walls.dm b/code/game/turfs/walls/walls.dm index 004262248df1..3d65566063d5 100644 --- a/code/game/turfs/walls/walls.dm +++ b/code/game/turfs/walls/walls.dm @@ -5,6 +5,7 @@ icon_state = "0" opacity = TRUE layer = WALL_LAYER + is_weedable = FULLY_WEEDABLE /// 1 = Can't be deconstructed by tools or thermite. Used for Sulaco walls var/walltype = WALL_METAL /// when walls smooth with one another, the type of junction each wall is. @@ -50,6 +51,8 @@ /turf/closed/wall/Initialize(mapload, ...) . = ..() + is_weedable = initial(is_weedable) //so we can spawn weeds on the wall + // Defer updating based on neighbors while we're still loading map if(mapload && . != INITIALIZE_HINT_QDEL) return INITIALIZE_HINT_LATELOAD @@ -58,6 +61,7 @@ if(. != INITIALIZE_HINT_LATELOAD) update_icon() + /turf/closed/wall/LateInitialize() . = ..() // By default this assumes being used for map late init diff --git a/code/modules/cm_aliens/hivebuffs/hivebuff.dm b/code/modules/cm_aliens/hivebuffs/hivebuff.dm index 49ea62cedf22..5ce150a0bb13 100644 --- a/code/modules/cm_aliens/hivebuffs/hivebuff.dm +++ b/code/modules/cm_aliens/hivebuffs/hivebuff.dm @@ -430,7 +430,7 @@ if(turf_to_check.density) failed = TRUE break - if(!turf_to_check.is_weedable()) + if(!turf_to_check.is_weedable) failed = TRUE break var/area/target_area = get_area(turf_to_check) @@ -479,7 +479,7 @@ if(xeno.caste.fire_immunity == FIRE_IMMUNITY_NONE) RegisterSignal(xeno, list(COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED), PROC_REF(flamer_crossed_immune)) - + /datum/hivebuff/fire/remove_buff_effects(mob/living/carbon/xenomorph/xeno) if(!(xeno.caste.fire_immunity & FIRE_IMMUNITY_NO_IGNITE)) @@ -524,7 +524,7 @@ if(get_action(xeno, /datum/action/xeno_action/onclick/transmute)) return - + add_verb(xeno, /mob/living/carbon/xenomorph/proc/transmute_verb) var/datum/action/xeno_action/onclick/transmute/transmute_action = new() transmute_action.give_to(xeno) diff --git a/code/modules/cm_aliens/weeds.dm b/code/modules/cm_aliens/weeds.dm index 1c5c07893766..08875210a959 100644 --- a/code/modules/cm_aliens/weeds.dm +++ b/code/modules/cm_aliens/weeds.dm @@ -223,10 +223,9 @@ var/turf/T = get_step(src, dirn) if(!istype(T)) continue - var/is_weedable = T.is_weedable() - if(!is_weedable) + if(!T.is_weedable) continue - if(!spread_on_semiweedable && is_weedable < FULLY_WEEDABLE) + if(!spread_on_semiweedable && T.is_weedable < FULLY_WEEDABLE) continue T.clean_cleanables() 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 0289a3fcfa83..a127f03c6f1f 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -22,7 +22,7 @@ to_chat(xeno, SPAN_WARNING("We can't do that here.")) return - var/is_weedable = turf.is_weedable() + var/is_weedable = turf.is_weedable if(!is_weedable) to_chat(xeno, SPAN_WARNING("Bad place for a garden!")) return @@ -563,7 +563,7 @@ return ..() /turf/proc/check_xeno_trap_placement(mob/living/carbon/xenomorph/xeno) - if(is_weedable() < FULLY_WEEDABLE || !can_xeno_build(src)) + if(is_weedable < FULLY_WEEDABLE || !can_xeno_build(src)) to_chat(xeno, SPAN_XENOWARNING("We can't do that here.")) return FALSE @@ -724,7 +724,7 @@ qdel(structure_template) return FALSE - if(T.is_weedable() < FULLY_WEEDABLE) + if(T.is_weedable < FULLY_WEEDABLE) to_chat(X, SPAN_WARNING("\The [T] can't support a [structure_template.name]!")) qdel(structure_template) return FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm index f5e0338cbede..f3313a49f86a 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm @@ -710,7 +710,7 @@ var/turf/turf_to_get = get_turf(atom) - if(!turf_to_get || turf_to_get.is_weedable() < FULLY_WEEDABLE || turf_to_get.density || (turf_to_get.z != xeno.z)) + if(!turf_to_get || turf_to_get.is_weedable < FULLY_WEEDABLE || turf_to_get.density || (turf_to_get.z != xeno.z)) to_chat(xeno, SPAN_XENOWARNING("You can't do that here.")) return diff --git a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm index c91344c34d4a..7f69086ac4b2 100644 --- a/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm +++ b/code/modules/mob/living/carbon/xenomorph/resin_constructions.dm @@ -26,7 +26,7 @@ to_chat(X, SPAN_WARNING("Can't do that with [blocker] in the way!")) return FALSE - if(!istype(T) || T.is_weedable() < FULLY_WEEDABLE) + if(!istype(T) || T.is_weedable < FULLY_WEEDABLE) to_chat(X, SPAN_WARNING("You can't do that here.")) return FALSE From e0f17ea56cfa48505dfafbdfd0e376e0065d24df Mon Sep 17 00:00:00 2001 From: Sean <111566851+seanlol092@users.noreply.github.com> Date: Mon, 5 May 2025 19:56:59 +0800 Subject: [PATCH 2/3] Toggleable Tripwire Sensitivity / Spitting now triggers mine (#8707) # About the pull request Xeno projectile can now trigger claymores.
Spit test Queen test: Neuro/Acid / Boiler test: Bombard x Acid Spray / Acid Shotgun x (They hit but doesn't trigger) Prae test: Acid Spit / Acid Ball x Spray Acid x Rav Shard test: Spike Shield (no test) Fire Spikes x (They hit but doesn't trigger) Spike Shed x Spitter test: Acid Spit / Spray acid x Sentinel test: Slowing spit / Scattered spit /
Hitting a claymore with a wirecutter switch its tripwire's sensitivity (default is high). # Explain why it's good for the game This prevents hugger and lesser drones from triggering mines. A hugger or lesser drone triggering a minefield by thier own (one person clearing the minefield) shouldnt be possible. They could still trigger proxy claymores. Add a new way to "disarm" claymore for xenos in long range since currently you have to be in dangerously close to the claymore to slash it (will still trigger). # Testing Photographs and Procedure
T0 not triggering Mines https://github.com/user-attachments/assets/9f688002-a896-47bb-bf09-21bea565d92d
Spitting twice triggers mines https://github.com/user-attachments/assets/88535101-ce98-49da-a58f-756f10612c07
Sensitivity https://github.com/user-attachments/assets/8549ac1b-25b9-4dea-bfdc-1b83480867cf
# Changelog :cl: qol: Custom mines tell you what sensitivity it is when examined balance: Claymores can now switch to low sensitive mode / high sensitive mode using a wirecutter balance: When on less sensitive mode: Claymores cant be trigger by huggers and Lesser drones balance: Claymores can be triggered by two xeno spits, but cannot be slashed by Lesser drones balance: Claymores now layer above lying mobs /:cl: --------- Co-authored-by: Drulikar Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/game/objects/items/explosives/mine.dm | 87 +++++++++++++++------- 1 file changed, 59 insertions(+), 28 deletions(-) diff --git a/code/game/objects/items/explosives/mine.dm b/code/game/objects/items/explosives/mine.dm index 7da5809bbfd7..ab4a1f8901c8 100644 --- a/code/game/objects/items/explosives/mine.dm +++ b/code/game/objects/items/explosives/mine.dm @@ -8,7 +8,7 @@ icon_state = "m20" force = 5 w_class = SIZE_SMALL - //layer = MOB_LAYER - 0.1 //You can't just randomly hide claymores under boxes. Booby-trapping bodies is fine though + layer = ABOVE_LYING_MOB_LAYER //You can't just randomly hide claymores under boxes. Booby-trapping bodies is fine though throwforce = 5 throw_range = 6 throw_speed = SPEED_VERY_FAST @@ -23,10 +23,15 @@ ) shrapnel_spread = 60 use_dir = TRUE + var/iff_signal = FACTION_MARINE var/triggered = FALSE var/hard_iff_lock = FALSE var/obj/effect/mine_tripwire/tripwire + /// Whether this mine will ignore MOB_SIZE_XENO_VERY_SMALL or smaller xenos - only configureable if customizeable + var/ignore_small_xeno = FALSE + /// How many times a xeno projectile has hit this mine + var/spit_hit_count = 0 var/map_deployed = FALSE @@ -61,6 +66,10 @@ to_chat(user, SPAN_WARNING("It's too cramped in here to deploy \a [src].")) return TRUE +/obj/item/explosive/mine/get_examine_text(mob/user) + . = ..() + if(customizable && !isxeno(user)) + . += " The sensitivity dial is turned [ignore_small_xeno ? "down" : "up"]" //Arming @@ -111,9 +120,8 @@ update_icon() -//Disarming -/obj/item/explosive/mine/attackby(obj/item/W, mob/user) - if(HAS_TRAIT(W, TRAIT_TOOL_MULTITOOL)) +/obj/item/explosive/mine/attackby(obj/item/tool, mob/user) + if(HAS_TRAIT(tool, TRAIT_TOOL_MULTITOOL)) if(active) if(user.action_busy) return @@ -121,7 +129,7 @@ user.visible_message(SPAN_NOTICE("[user] starts disarming [src]."), SPAN_NOTICE("You start disarming [src].")) else - user.visible_message(SPAN_NOTICE("[user] starts fiddling with \the [src], trying to disarm it."), + user.visible_message(SPAN_NOTICE("[user] starts fiddling with [src], trying to disarm it."), SPAN_NOTICE("You start disarming [src], but you don't know its IFF data. This might end badly...")) if(!do_after(user, 30, INTERRUPT_NO_NEEDHAND, BUSY_ICON_FRIENDLY)) user.visible_message(SPAN_WARNING("[user] stops disarming [src]."), @@ -131,7 +139,7 @@ if(prob(75)) triggered = TRUE if(tripwire) - var/direction = GLOB.reverse_dir[src.dir] + var/direction = GLOB.reverse_dir[dir] var/step_direction = get_step(src, direction) tripwire.forceMove(step_direction) prime() @@ -140,6 +148,16 @@ user.visible_message(SPAN_NOTICE("[user] finishes disarming [src]."), SPAN_NOTICE("You finish disarming [src].")) disarm() + else if(HAS_TRAIT(tool, TRAIT_TOOL_WIRECUTTERS)) + if(customizable) + if(ignore_small_xeno) + to_chat(user, SPAN_NOTICE("You have reverted [src] to its original sensitivity.")) + else + to_chat(user, SPAN_NOTICE("You have adjusted [src] to be less sensitive.")) + ignore_small_xeno = !ignore_small_xeno + return + to_chat(user, SPAN_NOTICE("[src] has no sensitivity dial to adjust.")) + return else return ..() @@ -186,32 +204,32 @@ //Mine can also be triggered if you "cross right in front of it" (same tile) -/obj/item/explosive/mine/Crossed(atom/A) +/obj/item/explosive/mine/Crossed(atom/movable/target) ..() - if(isliving(A)) - var/mob/living/L = A - if(!L.stat == DEAD)//so dragged corpses don't trigger mines. - return - else - try_to_prime(A) + try_to_prime(target) -/obj/item/explosive/mine/Collided(atom/movable/AM) - try_to_prime(AM) +/obj/item/explosive/mine/Collided(atom/movable/target) + try_to_prime(target) -/obj/item/explosive/mine/proc/try_to_prime(mob/living/L) +/obj/item/explosive/mine/proc/try_to_prime(mob/living/enemy) if(!active || triggered || (customizable && !detonator)) return - if(!istype(L)) + if(!istype(enemy)) return - if(L.stat == DEAD) + if(enemy.stat == DEAD) return - if(L.get_target_lock(iff_signal)) + if(ignore_small_xeno && isxeno(enemy)) + var/mob/living/carbon/xenomorph/xeno = enemy + if(xeno.mob_size <= MOB_SIZE_XENO_VERY_SMALL) + return + if(enemy.get_target_lock(iff_signal)) return - if(HAS_TRAIT(L, TRAIT_ABILITY_BURROWED)) + if(HAS_TRAIT(enemy, TRAIT_ABILITY_BURROWED)) return - L.visible_message(SPAN_DANGER("[icon2html(src, viewers(src))] The [name] clicks as [L] moves in front of it."), - SPAN_DANGER("[icon2html(src, L)] The [name] clicks as you move in front of it."), + + enemy.visible_message(SPAN_DANGER("[icon2html(src, viewers(src))] The [name] clicks as [enemy] moves in front of it."), + SPAN_DANGER("[icon2html(src, enemy)] The [name] clicks as you move in front of it."), SPAN_DANGER("You hear a click.")) triggered = TRUE @@ -233,17 +251,21 @@ if(!QDELETED(src)) disarm() - -/obj/item/explosive/mine/attack_alien(mob/living/carbon/xenomorph/M) +/obj/item/explosive/mine/attack_alien(mob/living/carbon/xenomorph/xeno) if(triggered) //Mine is already set to go off return XENO_NO_DELAY_ACTION - if(M.a_intent == INTENT_HELP) - to_chat(M, SPAN_XENONOTICE("If you hit this hard enough, it would probably explode.")) + if(xeno.a_intent == INTENT_HELP) + to_chat(xeno, SPAN_XENONOTICE("If you hit this hard enough, it would probably explode.")) return XENO_NO_DELAY_ACTION - M.animation_attack_on(src) - M.visible_message(SPAN_DANGER("[M] has slashed [src]!"), + if(tripwire) + if(xeno.mob_size <= MOB_SIZE_XENO_VERY_SMALL) + to_chat(xeno, SPAN_XENONOTICE("Slashing that would be suicide!")) + return XENO_NO_DELAY_ACTION + + xeno.animation_attack_on(src) + xeno.visible_message(SPAN_DANGER("[xeno] has slashed [src]!"), SPAN_DANGER("You slash [src]!")) playsound(loc, 'sound/weapons/slice.ogg', 25, 1) @@ -264,6 +286,15 @@ if(!QDELETED(src)) disarm() +/obj/item/explosive/mine/bullet_act(obj/projectile/xeno_projectile) + if(!triggered && istype(xeno_projectile.ammo, /datum/ammo/xeno)) //xeno projectile + spit_hit_count++ + if(spit_hit_count >= 2) // Check if hit two times + visible_message(SPAN_DANGER("[src] is hit by [xeno_projectile] and violently detonates!")) // Acid is hot for claymore + triggered = TRUE + prime() + if(!QDELETED(src)) + disarm() /obj/effect/mine_tripwire name = "claymore tripwire" From 19b1608adacb02b87f9fe5c461e652cd60a11307 Mon Sep 17 00:00:00 2001 From: "cmss13-ci[bot]" <180991813+cmss13-ci[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 12:04:50 +0000 Subject: [PATCH 3/3] Automatic changelog for PR #8707 [ci skip] --- html/changelogs/AutoChangeLog-pr-8707.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-8707.yml diff --git a/html/changelogs/AutoChangeLog-pr-8707.yml b/html/changelogs/AutoChangeLog-pr-8707.yml new file mode 100644 index 000000000000..7206235acc3c --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-8707.yml @@ -0,0 +1,8 @@ +author: "seanlol092" +delete-after: True +changes: + - qol: "Custom mines tell you what sensitivity it is when examined" + - balance: "Claymores can now switch to low sensitive mode / high sensitive mode using a wirecutter" + - balance: "When on less sensitive mode: Claymores cant be trigger by huggers and Lesser drones" + - balance: "Claymores can be triggered by two xeno spits, but cannot be slashed by Lesser drones" + - balance: "Claymores now layer above lying mobs" \ No newline at end of file