From 4b3140e1fc8ef7da09612dc614d71d42a9d440b1 Mon Sep 17 00:00:00 2001 From: Ben <91219575+Ben10083@users.noreply.github.com> Date: Mon, 24 Jul 2023 18:57:04 -0400 Subject: [PATCH] Carrier Eggsac Strain can now place eggs on Regular Weeds, Egg range Bugfix, and QOL notification for Egg generation (#3891) # About the pull request Eggsac Strain can now place eggs on regular weeds instead of only hive weeds, notified when they generate an egg, and fixes #3869 # Explain why it's good for the game The eggsac strain is designed to be a mobile egg factory, able to place eggs closer to front for player huggers/general captures. However with limitations on only hiveweeds, it really limited the ability of the eggsac strain to utilize their strain's abilities, and the risk of losing a egg to marines forced them to stay at hive, making it a unpopular pick. This gives more purpose to the eggsac, allowing them to place eggs much closer to frontline for ghosts to spawn into/general captures, as well as an improv trap for approaching marines. They still have the risk of giving eggs to marines however, which I feel balances out this buff. Also bugs bad # Testing Photographs and Procedure Things I have tested:
- Carrier no strain range at 1 - Carrier Eggsac strain range at 3 - Drone has appropriate egg range - Queen ovi has longer egg plant range - Queen deovi back to basic 1 egg plant range
# Changelog :cl: balance: Carriers with Eggsac strain can now place eggs on regular weeds. fix: Extra egg planting range now properly applied for Eggsac strain and Queen on ovi qol: Eggsac Carriers now notified when they generate a egg. code: new variable to xenomorphs to dictate egg planting distance, and removal of unused procs /:cl: --- .../mob/living/carbon/xenomorph/Xenomorph.dm | 39 ++++++++++++------- .../living/carbon/xenomorph/castes/Queen.dm | 8 +--- .../mob/living/carbon/xenomorph/egg_item.dm | 28 ++++++++----- .../mutators/strains/carrier/eggsac.dm | 5 ++- .../living/carbon/xenomorph/xeno_defines.dm | 10 ----- 5 files changed, 50 insertions(+), 40 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm index 5586da3765dc..aea1ce9a5906 100644 --- a/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm +++ b/code/modules/mob/living/carbon/xenomorph/Xenomorph.dm @@ -271,27 +271,40 @@ // ////////////////////////////////////////////////////////////////// var/tunnel = FALSE - var/stealth = FALSE // for check on lurker invisibility + /// for check on lurker invisibility + var/stealth = FALSE var/burrow = FALSE var/fortify = FALSE var/crest_defense = FALSE - var/agility = FALSE // 0 - upright, 1 - all fours + /// 0/FALSE - upright, 1/TRUE - all fours + var/agility = FALSE var/ripping_limb = FALSE var/steelcrest = FALSE - // Related to zooming out (primarily queen and boiler) - var/devour_timer = 0 // The world.time at which we will regurgitate our currently-vored victim - var/extra_build_dist = 0 // For drones/hivelords. Extends the maximum build range they have + /// The world.time at which we will regurgitate our currently-vored victim + var/devour_timer = 0 + /// For drones/hivelords. Extends the maximum build range they have + var/extra_build_dist = 0 + /// tiles from self you can plant eggs. + var/egg_planting_range = 1 var/can_stack_builds = FALSE var/list/resin_build_order - var/selected_resin // Which resin structure to build when we secrete resin, defaults to null. - var/selected_construction = XENO_STRUCTURE_CORE //which special structure to build when we place constructions - var/selected_mark // If leader what mark you will place when you make one - var/datum/ammo/xeno/ammo = null //The ammo datum for our spit projectiles. We're born with this, it changes sometimes. + /// Which resin structure to build when we secrete resin, defaults to null. + var/selected_resin + /// which special structure to build when we place constructions + var/selected_construction = XENO_STRUCTURE_CORE + /// If leader what mark you will place when you make one + var/selected_mark + /// The ammo datum for our spit projectiles. We're born with this, it changes sometimes. + var/datum/ammo/xeno/ammo = null var/tunnel_delay = 0 - var/list/available_fruits = list() // List of placeable the xenomorph has access to. - var/list/current_fruits = list() // If we have current_fruits that are limited, e.g. fruits - var/max_placeable = 0 // Limit to that amount - var/obj/effect/alien/resin/fruit/selected_fruit = null // the typepath of the placeable we wanna put down + /// List of placeable the xenomorph has access to. + var/list/available_fruits = list() + /// If we have current_fruits that are limited, e.g. fruits + var/list/current_fruits = list() + /// Limit to that amount + var/max_placeable = 0 + /// the typepath of the placeable we wanna put down + var/obj/effect/alien/resin/fruit/selected_fruit = null var/list/built_structures = list() var/icon_xeno diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index ac975835b21f..f3a354b42ad0 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -276,7 +276,6 @@ var/queen_ability_cooldown = 0 var/egg_amount = 0 //amount of eggs inside the queen var/screech_sound_effect_list = list('sound/voice/alien_queen_screech.ogg') //the noise the Queen makes when she screeches. Done this way for VV purposes. - var/egg_planting_range = 3 // in ovipositor queen can plant egg up to this amount of tiles away from her position var/queen_ovipositor_icon var/queen_standing_icon @@ -832,6 +831,7 @@ ADD_TRAIT(src, TRAIT_ABILITY_OVIPOSITOR, TRAIT_SOURCE_ABILITY("Ovipositor")) extra_build_dist = IGNORE_BUILD_DISTANCE + egg_planting_range = 3 anchored = TRUE resting = FALSE update_canmove() @@ -883,6 +883,7 @@ egg_amount = 0 extra_build_dist = initial(extra_build_dist) + egg_planting_range = initial(egg_planting_range) for(var/datum/action/xeno_action/action in actions) if(istype(action, /datum/action/xeno_action/onclick/grow_ovipositor)) var/datum/action/xeno_action/onclick/grow_ovipositor/ovi_ability = action @@ -917,11 +918,6 @@ if(ovipositor) return "Queen_ovipositor_[severity]" // I don't actually have it, but maybe one day. -/mob/living/carbon/xenomorph/queen/proc/in_egg_plant_range(turf/T) - if(!ovipositor) - return FALSE // can't range plant while not in ovi... but who the fuck cares, we can't plant anyways - return get_dist(src, T) <= egg_planting_range - /mob/living/carbon/xenomorph/queen/gib(datum/cause_data/cause = create_cause_data("gibbing", src)) death(cause, 1) diff --git a/code/modules/mob/living/carbon/xenomorph/egg_item.dm b/code/modules/mob/living/carbon/xenomorph/egg_item.dm index 4a70cff368b6..b4d423bec364 100644 --- a/code/modules/mob/living/carbon/xenomorph/egg_item.dm +++ b/code/modules/mob/living/carbon/xenomorph/egg_item.dm @@ -37,8 +37,11 @@ if(istype(target, /obj/effect/alien/resin/special/eggmorph)) return //We tried storing the hugger from the egg, no need to try to plant it (we know the turf is occupied!) if(isxeno(user)) + var/mob/living/carbon/xenomorph/xeno = user var/turf/T = get_turf(target) - plant_egg(user, T, proximity) + if(get_dist(xeno, T) <= xeno.egg_planting_range) + proximity = TRUE + plant_egg(xeno, T, proximity) if(proximity && ishuman(user)) var/turf/T = get_turf(target) plant_egg_human(user, T) @@ -81,14 +84,21 @@ if(!user.check_plasma(30)) return - var/obj/effect/alien/weeds/hive_weeds = null - for(var/obj/effect/alien/weeds/W in T) - if(W.weed_strength >= WEED_LEVEL_HIVE && W.linked_hive.hivenumber == hivenumber) - hive_weeds = W + var/obj/effect/alien/weeds/hive_weeds + var/obj/effect/alien/weeds/any_weeds + for(var/obj/effect/alien/weeds/weed in T) + if(weed.weed_strength >= WEED_LEVEL_HIVE && weed.linked_hive.hivenumber == hivenumber) + hive_weeds = weed break + if(weed.weed_strength >= WEED_LEVEL_WEAK && weed.linked_hive.hivenumber == hivenumber) //check for ANY weeds + any_weeds = weed - if(!hive_weeds) - var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] + var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] + if(!any_weeds && !hive_weeds) //you need at least some weeds to plant on. + to_chat(user, SPAN_XENOWARNING("[src] must be planted on [lowertext(hive.prefix)]weeds.")) + return + + if(!hive_weeds && user.mutation_type != CARRIER_EGGSAC) to_chat(user, SPAN_XENOWARNING("[src] can only be planted on [lowertext(hive.prefix)]hive weeds.")) return @@ -106,8 +116,8 @@ if(!user.check_plasma(30)) return - for(var/obj/effect/alien/weeds/W in T) - if(W.weed_strength >= WEED_LEVEL_HIVE) + for(var/obj/effect/alien/weeds/weed in T) + if(weed.weed_strength >= WEED_LEVEL_HIVE || user.mutation_type == CARRIER_EGGSAC) user.use_plasma(30) var/obj/effect/alien/egg/newegg = new /obj/effect/alien/egg(T, hivenumber) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm index 436adb79e5aa..7e5773e5aec5 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm @@ -1,6 +1,6 @@ /datum/xeno_mutator/eggsac name = "STRAIN: Carrier - Eggsac" - description = "In exchange for your ability to store huggers and place traps, you gain larger plasma stores, strong pheromones, and the ability to lay eggs by using your plasma stores. In addition, you can now carry twelve eggs at once and can place eggs one pace further than normal." + description = "In exchange for your ability to store huggers and place traps, you gain larger plasma stores, strong pheromones, and the ability to lay eggs by using your plasma stores. In addition, you can now carry twelve eggs at once, can plant eggs of non-hive weeds, and can place eggs one pace further than normal" flavor_description = "An egg is always an adventure; the next one may be different." cost = MUTATOR_COST_EXPENSIVE individual_only = TRUE @@ -39,7 +39,7 @@ carrier.update_hugger_overlays() carrier.update_eggsac_overlays() carrier.eggs_max = 12 - carrier.extra_build_dist = 1 + carrier.egg_planting_range = 2 return TRUE /datum/action/xeno_action/active_toggle/generate_egg @@ -75,4 +75,5 @@ if(egg_generation_progress >= 15) egg_generation_progress = 0 xeno.eggs_cur++ + to_chat(xeno, SPAN_XENONOTICE("You generate a egg. Now sheltering: [xeno.eggs_cur] / [xeno.eggs_max].")) xeno.update_icons() diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm index eaff5a66309e..69fd2793c406 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_defines.dm @@ -812,16 +812,6 @@ #undef OPEN_SLOTS #undef GUARANTEED_SLOTS -// returns if that location can be used to plant eggs -/datum/hive_status/proc/in_egg_plant_range(turf/T) - if(!istype(living_xeno_queen)) - return TRUE // xenos already dicked without queen. Let them plant whereever - - if(!living_xeno_queen.ovipositor) - return FALSE // ovid queen only - - return get_dist(living_xeno_queen, T) <= egg_planting_range - /datum/hive_status/proc/can_build_structure(structure_name) if(!structure_name || !hive_structures_limit[structure_name]) return FALSE