Skip to content

Commit

Permalink
Some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
blackcrystall committed Jun 30, 2024
1 parent 34baba3 commit f08bb63
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 299 deletions.
23 changes: 10 additions & 13 deletions code/__DEFINES/typecheck/xenos.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,21 @@
if(!istype(attempt_harm_mob))
return FALSE

if(!hive)
hive = GLOB.hive_datum[hivenumber]

if(!hive)
if(!faction)
return FALSE

if(hivenumber == XENO_HIVE_RENEGADE)
var/datum/hive_status/corrupted/renegade/renegade_hive = hive
return renegade_hive.iff_protection_check(src, attempt_harm_mob)
if(faction.faction_flags == HARD_IFF_LOCK)
return faction.iff_protection_check(src, attempt_harm_mob)

return hive.is_ally(attempt_harm_mob)
return attempt_harm_mob.ally(faction)

// need this to set the data for walls/eggs/huggers when they are initialized
/proc/set_hive_data(atom/focused_atom, hivenumber)
var/datum/hive_status/hive = GLOB.hive_datum[hivenumber]
if (hive.color)
focused_atom.color = hive.color
focused_atom.name = "[lowertext(hive.prefix)][focused_atom.name]"
/proc/set_hive_data(atom/focused_atom, datum/faction/faction)
if(!faction)
return
if(faction.color)
focused_atom.color = faction.color
focused_atom.name = "[lowertext(faction.prefix)][focused_atom.name]"

/proc/get_xeno_stun_duration(mob/stun_mob, duration)
if(iscarbonsizexeno(stun_mob))
Expand Down
22 changes: 10 additions & 12 deletions code/controllers/subsystem/hijack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,20 @@ SUBSYSTEM_DEF(hijack)
if(marine_warning_areas)
marine_warning_areas = copytext(marine_warning_areas, 1, -2)

var/datum/hive_status/hive
for(var/hivenumber in GLOB.hive_datum)
hive = GLOB.hive_datum[hivenumber]
if(!length(hive.totalXenos))
for(var/faction_to_get in FACTION_LIST_XENOMORPH)
var/datum/faction/faction = GLOB.faction_datum[faction_to_get]
if(!length(faction.totalMobs))
continue

switch(announce)
if(1)
xeno_announcement(SPAN_XENOANNOUNCE("The talls are a quarter of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), hive.hivenumber, XENO_HIJACK_ANNOUNCE)
xeno_announcement(SPAN_XENOANNOUNCE("The talls are a quarter of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), faction, XENO_HIJACK_ANNOUNCE)
if(2)
xeno_announcement(SPAN_XENOANNOUNCE("The talls are half way towards their goals. Disable the following areas: [xeno_warning_areas]"), hive.hivenumber, XENO_HIJACK_ANNOUNCE)
xeno_announcement(SPAN_XENOANNOUNCE("The talls are half way towards their goals. Disable the following areas: [xeno_warning_areas]"), faction, XENO_HIJACK_ANNOUNCE)
if(3)
xeno_announcement(SPAN_XENOANNOUNCE("The talls are three quarters of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), hive.hivenumber, XENO_HIJACK_ANNOUNCE)
xeno_announcement(SPAN_XENOANNOUNCE("The talls are three quarters of the way towards their goals. Disable the following areas: [xeno_warning_areas]"), faction, XENO_HIJACK_ANNOUNCE)
if(4)
xeno_announcement(SPAN_XENOANNOUNCE("The talls have completed their goals!"), hive.hivenumber, XENO_HIJACK_ANNOUNCE)
xeno_announcement(SPAN_XENOANNOUNCE("The talls have completed their goals!"), faction, XENO_HIJACK_ANNOUNCE)

switch(announce)
if(1)
Expand Down Expand Up @@ -306,13 +305,12 @@ SUBSYSTEM_DEF(hijack)

if(!generator_ever_overloaded)
generator_ever_overloaded = TRUE
var/datum/hive_status/hive
for(var/hivenumber in GLOB.hive_datum)
hive = GLOB.hive_datum[hivenumber]
for(var/faction_to_get in FACTION_LIST_XENOMORPH)
var/datum/faction/faction = GLOB.faction_datum[faction_to_get]
if(!length(hive.totalXenos))
continue

xeno_announcement(SPAN_XENOANNOUNCE("The talls may be attempting to take their ship down with them in Engineering, stop them!"), hive.hivenumber, XENO_HIJACK_ANNOUNCE)
xeno_announcement(SPAN_XENOANNOUNCE("The talls may be attempting to take their ship down with them in Engineering, stop them!"), faction, XENO_HIJACK_ANNOUNCE)

adjust_generator_overload_count(new_overloading ? 1 : -1)

Expand Down
Loading

0 comments on commit f08bb63

Please sign in to comment.