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

Minor QOL things for xeno special structure construction #5201

Merged
merged 6 commits into from
Dec 18, 2023
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: 0 additions & 2 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,7 @@
#define XENO_STRUCTURE_CORE "hive core"
#define XENO_STRUCTURE_CLUSTER "hive cluster"
#define XENO_STRUCTURE_PYLON "hive pylon"
#define XENO_STRUCTURE_POOL "spawn pool"
#define XENO_STRUCTURE_EGGMORPH "egg morpher"
#define XENO_STRUCTURE_EVOPOD "evolution pod"
#define XENO_STRUCTURE_RECOVERY "recovery node"
#define XENO_STRUCTURE_NEST "thick resin nest"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
name = "xenomorph structure"
build_type = /obj/effect/alien/resin/special
crystals_required = 45 * XENO_STRUCTURE_PLASMA_MULTIPLIER
var/datum/hive_status/hive_ref //Who gets what we build
/// The hive that this structure belongs to.
var/datum/hive_status/hive_ref
/// The range around this structure which needs to be clear for it to be constructed.
var/block_range = 1

/datum/construction_template/xenomorph/set_structure_image()
Expand All @@ -24,13 +26,15 @@

/datum/construction_template/xenomorph/core
name = XENO_STRUCTURE_CORE
description = "Heart of the hive, grows hive weeds (which are necessary for other structures), stores larva, spawns lesser drones, and protects the hive from skyfire."
build_type = /obj/effect/alien/resin/special/pylon/core
build_icon_state = "core"
crystals_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/cluster
name = XENO_STRUCTURE_CLUSTER
description = "Remote section of the hive, grows hive weeds, and morphs into a hive pylon when placed near a communications tower."
build_type = /obj/effect/alien/resin/special/cluster
build_icon_state = "hive_cluster"
pixel_y = -8
Expand All @@ -43,23 +47,27 @@

/datum/construction_template/xenomorph/pylon
name = XENO_STRUCTURE_PYLON
description = "Remote section of the hive, grows hive weeds, spawns lesser drones, and protects sisters from air strikes."
build_type = /obj/effect/alien/resin/special/pylon
build_icon_state = "pylon"
crystals_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/eggmorph
name = XENO_STRUCTURE_EGGMORPH
description = "Processes hatched hosts into new facehuggers."
build_type = /obj/effect/alien/resin/special/eggmorph
build_icon_state = "eggmorph_preview"

/datum/construction_template/xenomorph/recovery
name = XENO_STRUCTURE_RECOVERY
description = "Hastily recovers the strength of sisters resting around it."
build_type = /obj/effect/alien/resin/special/recovery
build_icon_state = "recovery"

/datum/construction_template/xenomorph/nest
name = XENO_STRUCTURE_NEST
description = "Strong enough to secure a headhunter for indeterminate durations."
build_type = /obj/effect/alien/resin/special/nest
build_icon_state = "reinforced_nest"

Expand Down Expand Up @@ -101,3 +109,5 @@
xeno_message(SPAN_XENOWARNING("This structure needs to be built directly next to an vertical surface."), 7, XENO_HIVE_NORMAL)
qdel(owner)
qdel(src)

#undef XENO_STRUCTURE_PLASMA_MULTIPLIER
1 change: 0 additions & 1 deletion code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@
linked_hive.hardcore = TRUE
linked_hive.allow_queen_evolve = FALSE
linked_hive.hive_structures_limit[XENO_STRUCTURE_CORE] = 0
linked_hive.hive_structures_limit[XENO_STRUCTURE_POOL] = 0
xeno_announcement("\The [linked_hive.name] has lost their hive core!", "everything", HIGHER_FORCE_ANNOUNCE)

if(linked_hive.hijack_burrowed_surge)
Expand Down
20 changes: 0 additions & 20 deletions code/modules/cm_aliens/structures/special_structure.dm
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
/*
* Special Structures
*/

/proc/get_xeno_structure_desc(name)
var/message
switch(name)
if(XENO_STRUCTURE_CORE)
message = "<B>[XENO_STRUCTURE_CORE]</B> - Heart of the hive, grows hive weeds (which are necessary for other structures), stores resources and protects the hive from skyfire."
if(XENO_STRUCTURE_PYLON)
message = "<B>[XENO_STRUCTURE_PYLON]</B> - Remote section of the hive, grows hive weeds (which are necessary for other structures), stores resources and protects sisters from skyfire."
if(XENO_STRUCTURE_POOL)
message = "<B>[XENO_STRUCTURE_POOL]</B> - Respawns xenomorphs that fall in battle."
if(XENO_STRUCTURE_EGGMORPH)
message = "<B>[XENO_STRUCTURE_EGGMORPH]</B> - Processes hatched hosts into new eggs."
if(XENO_STRUCTURE_EVOPOD)
message = "<B>[XENO_STRUCTURE_EVOPOD]</B> - Grants an additional 0.2 evolution per tick for all sisters on weeds."
if(XENO_STRUCTURE_RECOVERY)
message = "<B>[XENO_STRUCTURE_RECOVERY]</B> - Hastily recovers the strength of sisters resting around it."
if(XENO_STRUCTURE_NEST)
message = "<B>[XENO_STRUCTURE_NEST]</B> - Strong enough to secure a headhunter for indeterminate durations."
return message

/obj/effect/alien/resin/special
name = "Special Resin Structure"
icon = 'icons/mob/xenos/structures64x64.dmi'
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/Powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@
new_structure.set_template(structure_template)
hive.add_construction(new_structure)

var/max_constructions = hive.hive_structures_limit[structure_template.name]
var/remaining_constructions = max_constructions - hive.get_structure_count(structure_template.name)
visible_message(SPAN_XENONOTICE("A thick substance emerges from the ground and shapes into \a [new_structure]."), \
SPAN_XENONOTICE("We designate a new [structure_template] construction."), null, 5)
SPAN_XENONOTICE("We designate a new [structure_template] construction. ([remaining_constructions]/[max_constructions] remaining)"), null, 5)
playsound(new_structure, "alien_resin_build", 25)

if(hive.living_xeno_queen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,46 +627,43 @@
to_chat(X, SPAN_WARNING("The weeds are still recovering from the death of the hive core, wait until the weeds have recovered!"))
return FALSE
if(X.hive.has_structure(XENO_STRUCTURE_CORE) || !X.hive.can_build_structure(XENO_STRUCTURE_CORE))
choice = tgui_input_list(X, "Choose a structure to build", "Build structure", X.hive.hive_structure_types + "help", theme="hive_status")
choice = tgui_input_list(X, "Choose a structure to build", "Build structure", X.hive.hive_structure_types + "help", theme = "hive_status")
if(!choice)
return
if(choice == "help")
var/message = "<br>Placing a construction node creates a template for special structures that can benefit the hive, which require the insertion of [MATERIAL_CRYSTAL] to construct the following:<br>"
var/message = "Placing a construction node creates a template for special structures that can benefit the hive, which require the insertion of [MATERIAL_CRYSTAL] to construct the following:<br>"
for(var/structure_name in X.hive.hive_structure_types)
message += "[get_xeno_structure_desc(structure_name)]<br>"
var/datum/construction_template/xenomorph/structure_type = X.hive.hive_structure_types[structure_name]
message += "<b>[capitalize_first_letters(structure_name)]</b> - [initial(structure_type.description)]<br>"
to_chat(X, SPAN_NOTICE(message))
return TRUE
if(!X.check_state(TRUE) || !X.check_plasma(400))
return FALSE
var/structure_type = X.hive.hive_structure_types[choice]
var/datum/construction_template/xenomorph/structure_template = new structure_type()

if(!spacecheck(X,T,structure_template))
if(!spacecheck(X, T, structure_template))
return FALSE

if(!do_after(X, XENO_STRUCTURE_BUILD_TIME, INTERRUPT_NO_NEEDHAND|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return FALSE

if(!spacecheck(X,T,structure_template)) //doublechecking
if(!spacecheck(X, T, structure_template)) //doublechecking
return FALSE

if((choice == XENO_STRUCTURE_CORE) && isqueen(X) && X.hive.has_structure(XENO_STRUCTURE_CORE))
if(X.hive.hive_location.hardcore || world.time > XENOMORPH_PRE_SETUP_CUTOFF)
to_chat(X, SPAN_WARNING("We can't rebuild this structure!"))
return
return FALSE
if(alert(X, "Are we sure that we want to move the hive and destroy the old hive core?", , "Yes", "No") != "Yes")
return
return FALSE
qdel(X.hive.hive_location)
else if(!X.hive.can_build_structure(choice))
to_chat(X, SPAN_WARNING("We can't build any more [choice]s for the hive."))
return FALSE

if(!X.hive.can_build_structure(structure_template.name) && !(choice == XENO_STRUCTURE_CORE))
to_chat(X, SPAN_WARNING("We cannot build any more [structure_template.name]!"))
qdel(structure_template)
return FALSE

if (QDELETED(T))
if(QDELETED(T))
to_chat(X, SPAN_WARNING("We cannot build here!"))
qdel(structure_template)
return FALSE
Expand Down
17 changes: 4 additions & 13 deletions code/modules/mob/living/carbon/xenomorph/hive_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@
var/list/hive_structures_limit = list(
XENO_STRUCTURE_CORE = 1,
XENO_STRUCTURE_CLUSTER = 8,
XENO_STRUCTURE_POOL = 1,
XENO_STRUCTURE_EGGMORPH = 6,
XENO_STRUCTURE_EVOPOD = 2,
XENO_STRUCTURE_RECOVERY = 6,
XENO_STRUCTURE_PYLON = 2,
)
Expand Down Expand Up @@ -627,15 +625,13 @@
/datum/hive_status/proc/can_build_structure(structure_name)
if(!structure_name || !hive_structures_limit[structure_name])
return FALSE
var/total_count = 0
if(hive_structures[structure_name])
total_count += hive_structures[structure_name].len
if(hive_constructions[structure_name])
total_count += hive_constructions[structure_name].len
if(total_count >= hive_structures_limit[structure_name])
if(get_structure_count(structure_name) >= hive_structures_limit[structure_name])
return FALSE
return TRUE

/datum/hive_status/proc/get_structure_count(structure_name)
return length(hive_structures[structure_name]) + length(hive_constructions[structure_name])

/datum/hive_status/proc/has_structure(structure_name)
if(!structure_name)
return FALSE
Expand Down Expand Up @@ -1107,7 +1103,6 @@
/datum/hive_status/corrupted/tamed/New()
. = ..()
hive_structures_limit[XENO_STRUCTURE_EGGMORPH] = 0
hive_structures_limit[XENO_STRUCTURE_EVOPOD] = 0

/datum/hive_status/corrupted/tamed/proc/make_leader(mob/living/carbon/human/H)
if(!istype(H))
Expand Down Expand Up @@ -1168,7 +1163,6 @@
/datum/hive_status/corrupted/renegade/New()
. = ..()
hive_structures_limit[XENO_STRUCTURE_EGGMORPH] = 0
hive_structures_limit[XENO_STRUCTURE_EVOPOD] = 0
for(var/faction in FACTION_LIST_HUMANOID) //renegades allied to all humanoids, but it mostly affects structures. Their ability to attack humanoids and other xenos (including of the same hive) depends on iff settings
allies[faction] = TRUE

Expand Down Expand Up @@ -1351,6 +1345,3 @@
name = "Attack"
desc = "Attack the enemy here!"
icon_state = "attack"