Skip to content

Commit

Permalink
fixes and changes, PARTIAL review
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Jul 27, 2023
1 parent b692acb commit ff56b09
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@
#define XENO_BURIED_LARVA_TIME_LIMIT (30 MINUTES)

/// The time when xenos can start taking over comm towers
#define XENO_COMM_ACQUISITION_TIME (90 MINUTES)
#define XENO_COMM_ACQUISITION_TIME (0 MINUTES) //RETURN TO 90 MINUTES BEFORE TM - MORROW

/// The time it takes for a pylon to give one larva while activated
#define XENO_PYLON_ACTIVATION_COOLDOWN (5 MINUTES)
#define XENO_PYLON_ACTIVATION_COOLDOWN (30 SECONDS) //RETURN TO 5 MINUTES BEFORE TM - MORROW

/// The time against away_timer when an AFK xeno larva can be replaced
#define XENO_LEAVE_TIMER_LARVA 80 //80 seconds
Expand Down
14 changes: 9 additions & 5 deletions code/game/machinery/telecomms/presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers)
bound_width = 64
freq_listening = list(COLONY_FREQ)
var/toggle_cooldown = 0

/// Tower has been taken over by xenos, is not usable
var/corrupted = FALSE

/// Held image for the current overlay on the tower from xeno corruption
var/image/corruption_image = null

/obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/Initialize()
Expand Down Expand Up @@ -307,7 +311,7 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers)
if(!weeded_turf.weeds.parent)
return

if(!istypestrict(weeded_turf.weeds.parent, /obj/effect/alien/weeds/node/pylon/cluster))
if(!istype(weeded_turf.weeds.parent, /obj/effect/alien/weeds/node/pylon/cluster))
return

if(ROUND_TIME < XENO_COMM_ACQUISITION_TIME)
Expand All @@ -326,7 +330,7 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers)

qdel(cluster_parent)

var/obj/effect/alien/resin/special/pylon/new_pylon = new(cluster_loc, linked_hive)
var/obj/effect/alien/resin/special/pylon/endgame/new_pylon = new(cluster_loc, linked_hive)
new_pylon.node.children = held_children_weeds

for(var/obj/effect/alien/weeds/weed in new_pylon.node.children)
Expand All @@ -336,10 +340,10 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers)

corrupted = TRUE

corruption_image = image(icon, icon_state = "resin_growing") //seems to start at the end of the loop for some reason?, figure out why before merge - Morrow
corruption_image = image(icon, icon_state = "resin_growing")

flick_overlay(src, corruption_image, (4 SECONDS))
addtimer(CALLBACK(src, PROC_REF(switch_to_idle_corruption)), (4 SECONDS))
flick_overlay(src, corruption_image, (2 SECONDS))
addtimer(CALLBACK(src, PROC_REF(switch_to_idle_corruption)), (2 SECONDS))

new_pylon.comms_relay_connection()

Expand Down
70 changes: 31 additions & 39 deletions code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
var/damaged = FALSE
var/plasma_stored = 0
var/plasma_required_to_repair = 1000
var/activated = FALSE
COOLDOWN_DECLARE(larva_given_time)

var/protection_level = TURF_PROTECTION_CAS

Expand All @@ -39,23 +37,6 @@

if(node)
qdel(node)

if(activated)
if(XENO_STRUCTURE_PYLON in linked_hive.hive_structures)
for(var/obj/effect/alien/resin/special/pylon/pylon as anything in linked_hive.hive_structures[XENO_STRUCTURE_PYLON])
pylon.activated = FALSE

marine_announcement("ALERT.\n\nEnergy build up around communication relays halted.", "[MAIN_AI_SYSTEM] Biological Scanner") // Ask lore team for a better AI system name, honestly a second look for these announcements may be good - Morrow
for(var/hivenumber in GLOB.hive_datum)
var/datum/hive_status/checked_hive = GLOB.hive_datum[hivenumber]
if(!length(checked_hive.totalXenos))
continue

if(checked_hive == linked_hive)
xeno_announcement(SPAN_XENOANNOUNCE("We have lost our control of the tall's communication relays."), hivenumber, XENO_GENERAL_ANNOUNCE)
else
xeno_announcement(SPAN_XENOANNOUNCE("Another hive has lost control of the tall's communication relays."), hivenumber, XENO_GENERAL_ANNOUNCE)

. = ..()

/obj/effect/alien/resin/special/pylon/attack_alien(mob/living/carbon/xenomorph/M)
Expand Down Expand Up @@ -106,20 +87,37 @@
playsound(loc, "alien_resin_build", 25)

/obj/effect/alien/resin/special/pylon/proc/place_node()
var/obj/effect/alien/weeds/node/pylon/W = new node_type(loc, null, null, linked_hive)
W.resin_parent = src
return W
var/obj/effect/alien/weeds/node/pylon/pylon_node = new node_type(loc, null, null, linked_hive)
pylon_node.resin_parent = src
return pylon_node

/obj/effect/alien/resin/special/pylon/proc/comms_relay_connection()
var/check = TRUE
/obj/effect/alien/resin/special/pylon/endgame
cover_range = WEED_RANGE_CORE
var/activated = FALSE

/obj/effect/alien/resin/special/pylon/endgame/Destroy()
if(activated)
if(XENO_STRUCTURE_PYLON in linked_hive.hive_structures)
for(var/obj/effect/alien/resin/special/pylon/endgame/pylon as anything in linked_hive.hive_structures[XENO_STRUCTURE_PYLON])
pylon.activated = FALSE

marine_announcement("ALERT.\n\nEnergy build up around communication relays halted.", "[MAIN_AI_SYSTEM] Biological Scanner") // Ask lore team for a better AI system name, honestly a second look for these announcements may be good - Morrow
for(var/hivenumber in GLOB.hive_datum)
var/datum/hive_status/checked_hive = GLOB.hive_datum[hivenumber]
if(!length(checked_hive.totalXenos))
continue

if(checked_hive == linked_hive)
xeno_announcement(SPAN_XENOANNOUNCE("We have lost our control of the tall's communication relays."), hivenumber, XENO_GENERAL_ANNOUNCE)
else
xeno_announcement(SPAN_XENOANNOUNCE("Another hive has lost control of the tall's communication relays."), hivenumber, XENO_GENERAL_ANNOUNCE)

. = ..()

/obj/effect/alien/resin/special/pylon/endgame/proc/comms_relay_connection()
for(var/obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/checked_comms_relay in GLOB.all_static_telecomms_towers)
if(!checked_comms_relay.corrupted)
check = FALSE
break

if(!check)
return FALSE
return

marine_announcement("ALERT.\n\nIrregular build up of energy around communication relays.", "[MAIN_AI_SYSTEM] Biological Scanner") // Ask lore team for a better AI system name, honestly a second look for these announcements may be good - Morrow
for(var/hivenumber in GLOB.hive_datum)
Expand All @@ -132,25 +130,19 @@
else
xeno_announcement(SPAN_XENOANNOUNCE("Another hive has harnessed the tall's communication relays.[linked_hive.faction_is_ally(checked_hive.name) ? "" : " Stop them!"]"), hivenumber, XENO_GENERAL_ANNOUNCE)

for(var/obj/effect/alien/resin/special/pylon/structure as anything in linked_hive.hive_structures[XENO_STRUCTURE_PYLON])
for(var/obj/effect/alien/resin/special/pylon/endgame/structure in linked_hive.hive_structures[XENO_STRUCTURE_PYLON])
structure.activated = TRUE
addtimer(CALLBACK(structure, PROC_REF(give_larva)), XENO_PYLON_ACTIVATION_COOLDOWN)
addtimer(CALLBACK(structure, PROC_REF(give_larva)), XENO_PYLON_ACTIVATION_COOLDOWN, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_LOOP|TIMER_DELETE_ME)

/obj/effect/alien/resin/special/pylon/proc/give_larva()
/obj/effect/alien/resin/special/pylon/endgame/proc/give_larva()
if(!activated)
return

if(!COOLDOWN_FINISHED(src, larva_given_time)) //Somehow out of sync or doubled timers so we kill this "recursion"
return

if(!linked_hive.hive_location || !linked_hive.living_xeno_queen) //without a queen and a hive core we do not give larva but we don't deactivate either
addtimer(CALLBACK(src, PROC_REF(give_larva)), XENO_PYLON_ACTIVATION_COOLDOWN)
if(!linked_hive.hive_location || !linked_hive.living_xeno_queen)
return

linked_hive.stored_larva++
linked_hive.hive_ui.update_burrowed_larva()
COOLDOWN_START(src, larva_given_time, (XENO_PYLON_ACTIVATION_COOLDOWN - 1)) //Hypothetically stops any stacked timers, there is probably a better way to do this but I'm having a brain fart, ask Harry - Morrow
addtimer(CALLBACK(src, PROC_REF(give_larva)), XENO_PYLON_ACTIVATION_COOLDOWN)

//Hive Core - Generates strong weeds, supports other buildings
/obj/effect/alien/resin/special/pylon/core
Expand Down
6 changes: 5 additions & 1 deletion code/modules/cm_aliens/weeds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
linked_hive = GLOB.hive_datum[hivenumber]

set_hive_data(src, hivenumber)
if(spread_on_semiweedable)
if(spread_on_semiweedable && weed_strength < WEED_LEVEL_HIVE)
if(color)
var/list/RGB = ReadRGB(color)
RGB[1] = Clamp(RGB[1] + 35, 0, 255)
Expand Down Expand Up @@ -588,6 +588,7 @@
weed_strength = WEED_LEVEL_HIVE
node_range = WEED_RANGE_PYLON
overlay_node = FALSE
spread_on_semiweedable = TRUE
var/obj/effect/alien/resin/special/resin_parent

/obj/effect/alien/weeds/node/pylon/proc/set_parent_damaged()
Expand Down Expand Up @@ -619,6 +620,9 @@
/obj/effect/alien/weeds/node/pylon/acid_spray_act()
return

/obj/effect/alien/weeds/node/pylon/cluster
spread_on_semiweedable = FALSE

/obj/effect/alien/weeds/node/pylon/cluster/set_parent_damaged()
if(!resin_parent)
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
XENO_STRUCTURE_EGGMORPH = 6,
XENO_STRUCTURE_EVOPOD = 2,
XENO_STRUCTURE_RECOVERY = 6,
XENO_STRUCTURE_PYLON = 10,
XENO_STRUCTURE_PYLON = 2,
)

var/global/list/hive_structure_types = list(
Expand Down

0 comments on commit ff56b09

Please sign in to comment.