Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Drathek <[email protected]>
  • Loading branch information
PhantomEpicness and Drulikar committed May 11, 2024
1 parent 25b980b commit 724b824
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/XenoProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@
else
to_chat(src, SPAN_WARNING("There's nothing in our belly that needs regurgitating."))

/// Checks if the target object can be obscured by other objects within the same time. Used for Eggs
/mob/living/carbon/xenomorph/proc/check_if_can_be_obscured(turf/target_turf, obj/checked_obj)
/// Returns true if the object would be obscured by other objects in the same turf. Used for Eggs
/mob/living/carbon/xenomorph/proc/check_if_obscured(turf/target_turf, obj/checked_obj)
for(var/obj/object in target_turf.contents)
if(object.layer > checked_obj.layer)
return TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,6 @@

/datum/action/xeno_action/onclick/egg_autoplant/give_to(mob/living/carbon/xenomorph/queen/Q)
. = ..()
button.icon_state = Q.egg_autoplant ? "template_active" : "template"
if(!Q.ovipositor)
hide_from(Q)
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,9 @@
else
egg_autoplant = TRUE
to_chat(src, SPAN_XENONOTICE("You enable automatic egg planting."))
var/datum/action/xeno_action/onclick/egg_autoplant/ability = get_xeno_action_by_type(src, /datum/action/xeno_action/onclick/egg_autoplant)
if(ability)
ability.button.icon_state = egg_autoplant ? "template_active" : "template"

/datum/action/xeno_action/onclick/egg_autoplant/use_ability()
var/mob/living/carbon/xenomorph/queen/queen = owner
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,11 @@
if(suitable_turfs.len == 0)
to_chat(src, SPAN_XENONOTICE("There is no more suitable ground to plant eggs! Automatic planting disabled!"))
egg_autoplant = FALSE
var/datum/action/xeno_action/onclick/egg_autoplant/ability = get_xeno_action_by_type(src, /datum/action/xeno_action/onclick/egg_autoplant)
if(ability)
ability.button.icon_state = "template"
return
if(!src.check_plasma(30)) // Skip this cycle if we don't have enough plasma
if(!check_plasma(30)) // Skip this cycle if we don't have enough plasma
return

if(!do_after(src, 1 SECONDS, INTERRUPT_INCAPACITATED, BUSY_ICON_BUILD)) // mostly intended as a visual effect
Expand Down

0 comments on commit 724b824

Please sign in to comment.