Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carrier Eggsac Strain can now place eggs on Regular Weeds, Egg range Bugfix, and QOL notification for Egg generation #3891

Merged
merged 16 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/Xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@
// 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
var/egg_planting_range = 1 //tiles from self you can plant eggs.
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
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.
Expand Down
8 changes: 2 additions & 6 deletions code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
26 changes: 18 additions & 8 deletions code/modules/mob/living/carbon/xenomorph/egg_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -82,13 +85,20 @@
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/any_weeds = null
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
for(var/obj/effect/alien/weeds/Weed in T)
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
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) //must have SOME weeds for eggsac
to_chat(user, SPAN_XENOWARNING("[src] can only be planted on [lowertext(hive.prefix)]hive weeds."))
return

Expand All @@ -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)
Ben10083 marked this conversation as resolved.
Show resolved Hide resolved
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)

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -37,7 +37,7 @@
carrier.huggers_cur = 0
carrier.huggers_max = 0
carrier.eggs_max = 12
carrier.extra_build_dist = 1
carrier.egg_planting_range = 2
return TRUE

/datum/action/xeno_action/active_toggle/generate_egg
Expand Down Expand Up @@ -73,3 +73,4 @@
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]."))
10 changes: 0 additions & 10 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -811,16 +811,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
Expand Down
Loading