Skip to content

Commit

Permalink
Merge branch 'master' into predstuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-byte3D authored Dec 26, 2023
2 parents e89424d + 48aca72 commit 275f17b
Show file tree
Hide file tree
Showing 52 changed files with 196 additions and 193 deletions.
1 change: 0 additions & 1 deletion code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
#define MATERIAL_METAL "metal"
#define MATERIAL_PLASTEEL "plasteel"
#define MATERIAL_WOOD "wood plank"
#define MATERIAL_CRYSTAL "plasmagas"

// SIZES FOR ITEMS, use it for w_class

Expand Down
5 changes: 0 additions & 5 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@
#define XENO_PLASMA_TIER_8 800 * XENO_UNIVERSAL_PLASMAMULT
#define XENO_PLASMA_TIER_10 1000 * XENO_UNIVERSAL_PLASMAMULT

// Resource stockpile bands
#define XENO_CRYSTAL_LOW 50
#define XENO_CRYSTAL_MEDIUM 100
#define XENO_CRYSTAL_HIGH 150

// Plasma gain bands
#define XENO_PLASMA_GAIN_TIER_1 1
#define XENO_PLASMA_GAIN_TIER_2 1.5
Expand Down
42 changes: 9 additions & 33 deletions code/datums/construction/construction_template.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
var/pixel_y = -16
var/pixel_x = -16

var/crystals_required = 0
var/crystals_stored = 0
var/plasma_required = 0
var/plasma_stored = 0
var/materials_required = list() //Example resource requirements i.e. MATERIAL_METAL = 1
var/extras_required = list() //Example extra requirements i.e. /obj/item = 1

Expand Down Expand Up @@ -43,47 +43,23 @@
return
if(!xeno.plasma_max)
return
if(crystals_stored >= crystals_required)
if(plasma_stored >= plasma_required)
to_chat(xeno, SPAN_WARNING("\The [name] does not require plasma."))
return
to_chat(xeno, SPAN_NOTICE("You begin adding \the plasma to \the [name]."))
to_chat(xeno, SPAN_NOTICE("We begin adding \the plasma to \the [name]."))
xeno_attack_delay(xeno)
if(!do_after(xeno, 40, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return
//double-check amount required
if(crystals_stored >= crystals_required)
if(plasma_stored >= plasma_required)
to_chat(xeno, SPAN_WARNING("\The [name] has enough plasma."))
return
var/amount_to_use = min(xeno.plasma_stored, (crystals_required - crystals_stored))
crystals_stored += amount_to_use
var/amount_to_use = min(xeno.plasma_stored, (plasma_required - plasma_stored))
plasma_stored += amount_to_use
xeno.plasma_stored -= amount_to_use
to_chat(xeno, SPAN_WARNING("\The [name] requires [crystals_required - crystals_stored] more plasma."))
to_chat(xeno, SPAN_WARNING("\The [name] requires [plasma_required - plasma_stored] more plasma."))
check_completion()

// Xeno ressource collection
/*
/datum/construction_template/proc/add_crystal(mob/living/carbon/xenomorph/M)
if(!istype(M))
return
if(!M.crystal_stored)
to_chat(M, SPAN_WARNING("You have no [MATERIAL_CRYSTAL] stored."))
return
if(crystals_stored >= crystals_required)
to_chat(M, SPAN_WARNING("\The [name] does not require [MATERIAL_CRYSTAL]."))
return
to_chat(M, SPAN_NOTICE("You begin adding \the [MATERIAL_CRYSTAL] to \the [name]."))
if(!do_after(M, 40, INTERRUPT_ALL|BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return
//double-check amount required
if(crystals_stored >= crystals_required)
to_chat(M, SPAN_WARNING("\The [name] has enough [MATERIAL_CRYSTAL]."))
return
var/amount_to_use = min(M.crystal_stored, (crystals_required - crystals_stored))
crystals_stored += amount_to_use
M.crystal_stored -= amount_to_use
to_chat(M, SPAN_WARNING("\The [name] requires [crystals_required - crystals_stored] more [MATERIAL_CRYSTAL]."))
check_completion() */

/datum/construction_template/proc/add_material(mob/user, obj/item/I)
if(isStack(I))
var/obj/item/stack/S = I
Expand Down Expand Up @@ -123,7 +99,7 @@
check_completion()

/datum/construction_template/proc/check_completion()
if(crystals_stored < crystals_required)
if(plasma_stored < plasma_required)
return FALSE
for(var/material_req in materials_required)
if(materials_required[material_req] > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/datum/construction_template/xenomorph
name = "xenomorph structure"
build_type = /obj/effect/alien/resin/special
crystals_required = 45 * XENO_STRUCTURE_PLASMA_MULTIPLIER
plasma_required = 45 * XENO_STRUCTURE_PLASMA_MULTIPLIER
/// 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.
Expand All @@ -29,7 +29,7 @@
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
plasma_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/cluster
Expand All @@ -39,7 +39,7 @@
build_icon_state = "hive_cluster"
pixel_y = -8
pixel_x = -8
crystals_required = 50 * XENO_STRUCTURE_PLASMA_MULTIPLIER
plasma_required = 50 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/cluster/set_structure_image()
Expand All @@ -50,7 +50,7 @@
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
plasma_required = 100 * XENO_STRUCTURE_PLASMA_MULTIPLIER
block_range = 0

/datum/construction_template/xenomorph/eggmorph
Expand Down
6 changes: 3 additions & 3 deletions code/game/bioscans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new)

/datum/bioscan_data/proc/ares_can_bioscan()
var/datum/ares_link/link = GLOB.ares_link
if(!istype(link))
if(!istype(link) || !ares_is_active())
return FALSE
if(link.processor_bioscan && !link.processor_bioscan.inoperable())
return TRUE
Expand All @@ -123,8 +123,8 @@ GLOBAL_DATUM_INIT(bioscan_data, /datum/bioscan_data, new)
message_admins("An ARES Bioscan has failed.")
var/name = "[MAIN_AI_SYSTEM] Bioscan Status"
var/input = "Bioscan failed. \n\nInvestigation into Bioscan subsystem recommended."
log_ares_bioscan(name, input)
if(ares_can_interface())
log_ares_bioscan(name, input, forced)
if(ares_can_interface() || forced)
marine_announcement(input, name, 'sound/misc/interference.ogg', logging = ARES_LOG_NONE)
return
//Adjust the randomness there so everyone gets the same thing
Expand Down
2 changes: 0 additions & 2 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,6 @@ Additional game mode variables.
to_chat(new_queen, "<B>You should start by building a hive core.</B>")
to_chat(new_queen, "Talk in Hivemind using <strong>;</strong> (e.g. ';Hello my children!')")

// Xeno ressource collection
//new_queen.crystal_stored = XENO_STARTING_CRYSTAL
new_queen.update_icons()

//===================================================\\
Expand Down
30 changes: 24 additions & 6 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ GLOBAL_LIST_INIT(maintenance_categories, list(


// ------ ARES Logging Procs ------ //
/proc/ares_is_active()
for(var/mob/living/silicon/decoy/ship_ai/ai in GLOB.ai_mob_list)
if(ai.stat == DEAD)
return FALSE //ARES dead, most other systems also die with it
return TRUE

/proc/ares_apollo_talk(broadcast_message)
var/datum/language/apollo/apollo = GLOB.all_languages[LANGUAGE_APOLLO]
for(var/mob/living/silicon/decoy/ship_ai/ai in GLOB.ai_mob_list)
Expand All @@ -89,33 +95,38 @@ GLOBAL_LIST_INIT(maintenance_categories, list(

/proc/ares_can_interface()
var/obj/structure/machinery/ares/processor/interface/processor = GLOB.ares_link.processor_interface
if(!istype(GLOB.ares_link))
if(!istype(GLOB.ares_link) || !ares_is_active())
return FALSE
if(processor && !processor.inoperable())
return TRUE
return FALSE //interface processor not found or is broken

/proc/ares_can_log()
if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore))
if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore) || !ares_is_active())
return FALSE
var/obj/structure/machinery/ares/cpu/central_processor = GLOB.ares_link.central_processor
if(central_processor && !central_processor.inoperable())
return TRUE
return FALSE //CPU not found or is broken

/proc/log_ares_apollo(speaker, message)
if(!ares_can_log())
/proc/ares_can_apollo()
if(!istype(GLOB.ares_link) || !istype(GLOB.ares_datacore) || !ares_is_active())
return FALSE
var/datum/ares_link/link = GLOB.ares_link
if(!link.processor_apollo || link.processor_apollo.inoperable())
return FALSE
return TRUE

/proc/log_ares_apollo(speaker, message)
if(!ares_can_log() || !ares_can_apollo())
return FALSE
if(!speaker)
speaker = "Unknown"
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.apollo_log.Add("[worldtime2text()]: [speaker], '[message]'")

/proc/log_ares_bioscan(title, input)
if(!ares_can_log())
/proc/log_ares_bioscan(title, input, forced = FALSE)
if(!ares_can_log() && !forced)
return FALSE
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.records_bioscan.Add(new /datum/ares_record/bioscan(title, input))
Expand Down Expand Up @@ -225,6 +236,13 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
conversation.conversation += "[MAIN_AI_SYSTEM] at [worldtime2text()], '[text]'"
// ------ End ARES Interface Procs ------ //

/proc/ares_final_words()
//APOLLO
ares_apollo_talk("APOLLO sub-system shutting down. STOP CODE: 0x000000f4|CRITICAL_PROCESS_DIED")

//GENERAL CREW
shipwide_ai_announcement("A Problem has been detected and the [MAIN_AI_SYSTEM] system has been shutdown. \nTechnical Information: \n\n*** STOP CODE: 0x000000f4|CRITICAL_PROCESS_DIED\n\nPossible caused by: Rapid Unscheduled Disassembly\nContact an AI Service Technician for further assistance.", title = ":(", ares_logging = null)

/obj/structure/machinery/computer/working_joe/get_ares_access(obj/item/card/id/card)
if(ACCESS_ARES_DEBUG in card.access)
return APOLLO_ACCESS_DEBUG
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/ARES/ARES_step_triggers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
broadcast_message = "ALERT: Unauthorized movement detected in [area_name]!"

var/datum/ares_link/link = GLOB.ares_link
if(link.processor_apollo.inoperable())
if(!ares_can_apollo())
return FALSE

to_chat(passer, SPAN_BOLDWARNING("You hear a soft beeping sound as you cross the threshold."))
Expand Down Expand Up @@ -154,7 +154,7 @@
var/broadcast_message = get_broadcast(passer, idcard, failure)

var/datum/ares_link/link = GLOB.ares_link
if(link.processor_apollo.inoperable())
if(!ares_can_apollo())
return FALSE

to_chat(passer, SPAN_BOLDWARNING("You hear a harsh buzzing sound as you cross the threshold!"))
Expand Down
12 changes: 6 additions & 6 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GLOBAL_LIST_INIT(admin_verbs_default, list(
/datum/admins/proc/subtlemessageall,
/datum/admins/proc/alertall,
/datum/admins/proc/imaginary_friend,
/client/proc/toggle_ares_ping,
/client/proc/toggle_admin_pings,
/client/proc/cmd_admin_say, /*staff-only ooc chat*/
/client/proc/cmd_mod_say, /* alternate way of typing asay, no different than cmd_admin_say */
/client/proc/cmd_admin_tacmaps_panel,
Expand Down Expand Up @@ -585,15 +585,15 @@ GLOBAL_LIST_INIT(roundstart_mod_verbs, list(
message_admins("[key_name(usr)] announced a random fact.")
SSticker.mode?.declare_fun_facts()

/client/proc/toggle_ares_ping()
set name = "Toggle ARES notification sound"
set category = "Preferences.Logs"
/client/proc/toggle_admin_pings()
set name = "Toggle StaffIC log sounds"
set category = "Preferences.Sound"

prefs.toggles_sound ^= SOUND_ARES_MESSAGE
if (prefs.toggles_sound & SOUND_ARES_MESSAGE)
to_chat(usr, SPAN_BOLDNOTICE("You will now hear a ping for ARES messages."))
to_chat(usr, SPAN_BOLDNOTICE("You will now hear an audio cue for ARES and Prayer messages."))
else
to_chat(usr, SPAN_BOLDNOTICE("You will no longer hear a ping for ARES messages."))
to_chat(usr, SPAN_BOLDNOTICE("You will no longer hear an audio cue for ARES and Prayer messages."))


#undef MAX_WARNS
Expand Down
26 changes: 18 additions & 8 deletions code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,12 @@

if(!admin_holder || !(admin_holder.rights & R_MOD))
to_chat(src, "Only administrators may use this command.")
return
return FALSE

if(!ares_is_active())
to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is destroyed, and cannot talk!"))
return FALSE

var/input = input(usr, "This is a standard message from the ship's AI. It uses Almayer General channel and won't be heard by humans without access to Almayer General channel (headset or intercom). Check with online staff before you send this. Do not use html.", "What?", "") as message|null
if(!input)
return FALSE
Expand All @@ -579,7 +584,7 @@
var/prompt = tgui_alert(src, "ARES interface processor is offline or destroyed, send the message anyways?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt == "No")
to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is not responding. It's interface processor may be offline or destroyed."))
return
return FALSE

ai_announcement(input)
message_admins("[key_name_admin(src)] has created an AI comms report")
Expand All @@ -592,13 +597,17 @@

if(!admin_holder || !(admin_holder.rights & R_MOD))
to_chat(src, "Only administrators may use this command.")
return
return FALSE

if(!ares_is_active())
to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is destroyed, and cannot talk!"))
return FALSE

var/input = tgui_input_text(usr, "This is a broadcast from the ship AI to Working Joes and Maintenance Drones. Do not use html.", "What?", "")
if(!input)
return FALSE

var/datum/ares_link/link = GLOB.ares_link
if(link.processor_apollo.inoperable())
if(!ares_can_apollo())
var/prompt = tgui_alert(src, "ARES APOLLO processor is offline or destroyed, send the message anyways?", "Choose.", list("Yes", "No"), 20 SECONDS)
if(prompt != "Yes")
to_chat(usr, SPAN_WARNING("[MAIN_AI_SYSTEM] is not responding. It's APOLLO processor may be offline or destroyed."))
Expand Down Expand Up @@ -1007,10 +1016,11 @@
if("Xeno")
GLOB.bioscan_data.qm_bioscan(variance)
if("Marine")
var/force_check = tgui_alert(usr, "Do you wish to force ARES to display the bioscan?", "Display force", list("Yes", "No"), 20 SECONDS)
var/force_status = FALSE
if(force_check == "Yes")
force_status = TRUE
if(!ares_can_interface()) //proc checks if ARES is dead or if ARES cannot do announcements
var/force_check = tgui_alert(usr, "ARES is currently unable to properly display and/or perform the Bioscan, do you wish to force ARES to display the bioscan?", "Display force", list("Yes", "No"), 20 SECONDS)
if(force_check == "Yes")
force_status = TRUE
GLOB.bioscan_data.ares_bioscan(force_status, variance)
if("Yautja")
GLOB.bioscan_data.yautja_bioscan()
Expand Down
27 changes: 12 additions & 15 deletions code/modules/admin/verbs/pray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@
if(src.client.handle_spam_prevention(msg,MUTE_PRAY))
return

var/liaison = 0
if(job == "Corporate Liaison")
liaison = 1
var/prefix = SPAN_PURPLE("PRAY: ")
var/receipt = "Your prayers have been received by the gods."
if(job == JOB_CORPORATE_LIAISON)
prefix = SPAN_PURPLE("LIAISON: ")
receipt = "Your corporate overlords at Weyland-Yutani have received your message."

if(liaison)
msg = "<b><big>[SPAN_STAFF_IC("<font color=purple>LIAISON:</font>")][key_name(src, 1)] [CC_MARK(src)] [ADMIN_PP(src)] [ADMIN_VV(src)] [ADMIN_SM(src)] [ADMIN_JMP_USER(src)] [ADMIN_SC(src)]: [msg]</big></b>"
else
msg = "<b><big>[SPAN_STAFF_IC("<font color=purple>PRAY: </font>")][key_name(src, 1)] [CC_MARK(src)] [ADMIN_PP(src)] [ADMIN_VV(src)] [ADMIN_SM(src)] [ADMIN_JMP_USER(src)] [ADMIN_SC(src)]: [msg]</big></b>"
msg = SPAN_BIGNOTICE("[prefix][key_name(src, 1)] [CC_MARK(src)] [ADMIN_PP(src)] [ADMIN_VV(src)] [ADMIN_SM(src)] [ADMIN_JMP_USER(src)] [ADMIN_SC(src)]: [msg]")
log_admin(msg)
for(var/client/C in GLOB.admins)
if(AHOLD_IS_MOD(C.admin_holder) && C.prefs.toggles_chat & CHAT_PRAYER)
to_chat(C, msg)
C << 'sound/machines/terminal_alert.ogg'
if(liaison)
to_chat(usr, "Your corporate overlords at Weyland-Yutani have received your message.")
else
to_chat(usr, "Your prayers have been received by the gods.")
for(var/client/admin in GLOB.admins)
if(AHOLD_IS_MOD(admin.admin_holder))
to_chat(admin, SPAN_STAFF_IC(msg))
if(admin.prefs.toggles_sound & SOUND_ARES_MESSAGE)
admin << 'sound/machines/terminal_alert.ogg'
to_chat(usr, receipt)

/proc/high_command_announce(text , mob/Sender , iamessage)
var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN)
Expand Down
5 changes: 2 additions & 3 deletions code/modules/cm_aliens/structures/construction_node.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
color = linked_hive.color

/obj/effect/alien/resin/construction/Destroy()
if(template && linked_hive && (template.crystals_stored < template.crystals_required))
linked_hive.crystal_stored += template.crystals_stored
if(template && linked_hive && (template.plasma_stored < template.plasma_required))
linked_hive.remove_construction(src)
template = null
linked_hive = null
Expand All @@ -42,7 +41,7 @@
/obj/effect/alien/resin/construction/get_examine_text(mob/user)
. = ..()
if((isxeno(user) || isobserver(user)) && linked_hive)
var/message = "A [template.name] construction is designated here. It requires [template.crystals_required - template.crystals_stored] more [MATERIAL_CRYSTAL]."
var/message = "A [template.name] construction is designated here. It requires [template.plasma_required - template.plasma_stored] more plasma."
. += message

/obj/effect/alien/resin/construction/attack_alien(mob/living/carbon/xenomorph/M)
Expand Down
Loading

0 comments on commit 275f17b

Please sign in to comment.