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

Removes evolution fade in. Xeno ruler announcement is now correct. Some experimental tweaks. #707

Merged
merged 6 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion code/_onclick/hud/screen_objects/menu_text_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
update_text()

/atom/movable/screen/text/lobby/clickable/join_game/update_text()
var/mob/new_player/player = hud.mymob
if(SSticker?.current_state > GAME_STATE_PREGAME)
maptext = "<span class='maptext' style=font-size:8px>ПРИСОЕДИНИТЬСЯ</span>"
icon_state = "join"
return
var/mob/new_player/player = hud.mymob
maptext = "<span class='maptext' style=font-size:8px>ВЫ: [player.ready ? "" : "НЕ "]ГОТОВЫ</span>"
icon_state = player.ready ? "ready" : "unready"

Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/xenomorph/evolution.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@

///Actually changes the xenomorph to another caste
/mob/living/carbon/xenomorph/proc/finish_evolve(new_mob_type)
var/mob/living/carbon/xenomorph/new_xeno = new new_mob_type(get_turf(src))
var/mob/living/carbon/xenomorph/new_xeno = new new_mob_type(get_turf(src), TRUE)

if(!istype(new_xeno))
//Something went horribly wrong!
Expand All @@ -148,7 +148,6 @@
return

SEND_SIGNAL(src, COMSIG_XENOMORPH_EVOLVED, new_xeno)

for(var/obj/item/W in contents) //Drop stuff
dropItemToGround(W)

Expand All @@ -168,6 +167,8 @@
qdel(new_xeno.hunter_data)
new_xeno.hunter_data = hunter_data
hunter_data = null
new_xeno.generate_name() // This is specifically for numbered xenos who want to keep their previous number instead of a random new one.
new_xeno.hive?.update_ruler() // Since ruler wasn't set during initialization, update ruler now.
transfer_observers_to(new_xeno)

if(new_xeno.health - getBruteLoss(src) - getFireLoss(src) > 0) //Cmon, don't kill the new one! Shouldnt be possible though
Expand Down Expand Up @@ -221,7 +222,6 @@
selector?.set_selected_zone(zone_selected, new_xeno)
qdel(src)
INVOKE_ASYNC(new_xeno, TYPE_PROC_REF(/atom, do_jitter_animation), 1000)
new_xeno.overlay_fullscreen_timer(2 SECONDS, 20, "roundstart2", /atom/movable/screen/fullscreen/spawning_in)

///Check if the xeno is currently able to evolve
/mob/living/carbon/xenomorph/proc/generic_evolution_checks()
Expand Down
32 changes: 22 additions & 10 deletions code/modules/mob/living/carbon/xenomorph/hive_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@
// *********** Adding xenos
// ***************************************
/datum/hive_status/proc/add_xeno(mob/living/carbon/xenomorph/X) // should only be called by add_to_hive below
if(isnull(X)) // don't add nulls please
return FALSE

if(X.stat == DEAD)
dead_xenos += X
else
Expand All @@ -429,7 +432,7 @@

return TRUE

/mob/living/carbon/xenomorph/proc/add_to_hive(datum/hive_status/HS, force=FALSE)
/mob/living/carbon/xenomorph/proc/add_to_hive(datum/hive_status/HS, force=FALSE, prevent_ruler=FALSE)
if(!force && hivenumber != XENO_HIVE_NONE)
CRASH("trying to do a dirty add_to_hive")

Expand All @@ -446,24 +449,30 @@
SSdirection.start_tracking(HS.hivenumber, src)
hive.update_tier_limits() //Update our tier limits.

/mob/living/carbon/xenomorph/queen/add_to_hive(datum/hive_status/HS, force=FALSE) // override to ensure proper queen/hive behaviour
/mob/living/carbon/xenomorph/queen/add_to_hive(datum/hive_status/HS, force=FALSE, prevent_ruler=FALSE) // override to ensure proper queen/hive behaviour
. = ..()
if(HS.living_xeno_queen) // theres already a queen
return

HS.living_xeno_queen = src

if(prevent_ruler)
return

HS.update_ruler()


/mob/living/carbon/xenomorph/shrike/add_to_hive(datum/hive_status/HS, force = FALSE) // override to ensure proper queen/hive behaviour
/mob/living/carbon/xenomorph/shrike/add_to_hive(datum/hive_status/HS, force = FALSE, prevent_ruler=FALSE) // override to ensure proper queen/hive behaviour
. = ..()

if(HS.living_xeno_ruler)
return
if(prevent_ruler)
return

HS.update_ruler()

/mob/living/carbon/xenomorph/hivemind/add_to_hive(datum/hive_status/HS, force = FALSE)
/mob/living/carbon/xenomorph/hivemind/add_to_hive(datum/hive_status/HS, force = FALSE, prevent_ruler=FALSE)
. = ..()
if(!GLOB.xeno_structures_by_hive[HS.hivenumber])
GLOB.xeno_structures_by_hive[HS.hivenumber] = list()
Expand All @@ -484,23 +493,26 @@
hive_core.name = "[HS.hivenumber == XENO_HIVE_NORMAL ? "" : "[HS.name] "]hivemind core"
hive_core.color = HS.color

/mob/living/carbon/xenomorph/king/add_to_hive(datum/hive_status/HS, force = FALSE)
/mob/living/carbon/xenomorph/king/add_to_hive(datum/hive_status/HS, force = FALSE, prevent_ruler=FALSE)
. = ..()

if(HS.living_xeno_ruler)
return
if(prevent_ruler)
return

HS.update_ruler()

/mob/living/carbon/xenomorph/proc/add_to_hive_by_hivenumber(hivenumber, force=FALSE) // helper function to add by given hivenumber
/mob/living/carbon/xenomorph/proc/add_to_hive_by_hivenumber(hivenumber, force=FALSE, prevent_ruler=FALSE) // helper function to add by given hivenumber
if(!GLOB.hive_datums[hivenumber])
CRASH("add_to_hive_by_hivenumber called with invalid hivenumber")
var/datum/hive_status/HS = GLOB.hive_datums[hivenumber]
add_to_hive(HS, force)
add_to_hive(HS, force, prevent_ruler)
hive.update_tier_limits() //Update our tier limits.

// This is a special proc called only when a xeno is first created to set their hive and name properly
/mob/living/carbon/xenomorph/proc/set_initial_hivenumber()
add_to_hive_by_hivenumber(hivenumber, force=TRUE)
/mob/living/carbon/xenomorph/proc/set_initial_hivenumber(prevent_ruler=FALSE)
add_to_hive_by_hivenumber(hivenumber, force=TRUE, prevent_ruler=prevent_ruler)

// ***************************************
// *********** Removing xenos
Expand Down Expand Up @@ -1016,7 +1028,7 @@ to_chat will check for valid clients itself already so no need to double check f
/datum/hive_status/proc/set_all_xeno_trackers(atom/target)
for(var/mob/living/carbon/xenomorph/X AS in get_all_xenos())
X.set_tracked(target)
to_chat(X, span_notice(" Now tracking [target.name]"))
to_chat(X, span_notice("Now tracking [target.name]"))

// ***************************************
// *********** Normal Xenos
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//Just about ALL the procs are tied to the parent, not to the children
//This is so they can be easily transferred between them without copypasta

/mob/living/carbon/xenomorph/Initialize(mapload)
/mob/living/carbon/xenomorph/Initialize(mapload, do_not_set_as_ruler)
if(mob_size == MOB_SIZE_BIG)
move_resist = MOVE_FORCE_EXTREMELY_STRONG
move_force = MOVE_FORCE_EXTREMELY_STRONG
Expand All @@ -28,7 +28,7 @@
if(is_centcom_level(z) && hivenumber == XENO_HIVE_NORMAL)
hivenumber = XENO_HIVE_ADMEME //so admins can safely spawn xenos in Thunderdome for tests.

set_initial_hivenumber()
set_initial_hivenumber(prevent_ruler=do_not_set_as_ruler)

switch(stat)
if(CONSCIOUS)
Expand Down
4 changes: 1 addition & 3 deletions code/modules/mob/living/carbon/xenomorph/xenoprocs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,7 @@
if(locate(/turf/closed/wall/resin) in loc)
to_chat(src, span_warning("We decide not to drop [F] after all."))
return

. = ..()

return ..()

//When the Queen's pheromones are updated, or we add/remove a leader, update leader pheromones
/mob/living/carbon/xenomorph/proc/handle_xeno_leader_pheromones(mob/living/carbon/xenomorph/queen/Q)
Expand Down
Loading