Skip to content

Commit

Permalink
TGS Test Merge (#5006)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Mar 26, 2024
2 parents 4c4fb6f + 1f2b803 commit 4f130c7
Show file tree
Hide file tree
Showing 17 changed files with 389 additions and 51 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define ARES_RECORD_MAINTENANCE "Maintenance Ticket"
#define ARES_RECORD_ACCESS "Access Ticket"
#define ARES_RECORD_FLIGHT "Flight Record"
#define ARES_RECORD_TECH "Tech Control Record"

/// Not by ARES logged through marine_announcement()
#define ARES_LOG_NONE 0
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/objectives_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ SUBSYSTEM_DEF(objectives)

ai_silent_announcement(message, ":v", TRUE)
ai_silent_announcement(message, ":t", TRUE)
log_ares_tech(MAIN_AI_SYSTEM, FALSE, "TECH REPORT", "[round(tree.points, 0.1)] points available.", 0)
tree.total_points_last_sitrep = tree.total_points

next_sitrep = world.time + SITREP_INTERVAL
Expand Down
18 changes: 18 additions & 0 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,17 @@
logged_orders += list(current_order)
data["records_requisition"] = logged_orders

var/list/logged_techs = list()
for(var/datum/ares_record/tech/tech_unlock as anything in datacore.records_tech)
var/list/current_tech = list()
current_tech["time"] = tech_unlock.time
current_tech["details"] = tech_unlock.details
current_tech["user"] = tech_unlock.user
current_tech["tier_changer"] = tech_unlock.is_tier
current_tech["ref"] = "\ref[tech_unlock]"
logged_techs += list(current_tech)
data["records_tech"] = logged_techs

var/list/logged_convos = list()
var/list/active_convo = list()
var/active_ref
Expand Down Expand Up @@ -317,6 +328,9 @@
if("page_deleted_1to1")
last_menu = current_menu
current_menu = "deleted_talks"
if("page_tech")
last_menu = current_menu
current_menu = "tech_log"

// -- Delete Button -- //
if("delete_record")
Expand Down Expand Up @@ -345,6 +359,10 @@
new_title = "[record.title] at [record.time]"
new_details = "[record.details] Launched by [record.user]."
datacore.records_bombardment -= record
if(ARES_RECORD_TECH)
new_title = "[record.title] at [record.time]"
new_details = record.details
datacore.records_tech -= record

new_delete.details = new_details
new_delete.user = last_login
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/ARES/ARES_interface_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@
if("page_deleted_1to1")
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "deleted_talks"
if("page_tech")
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "tech_log"
if("page_access_management")
admin_interface.last_menu = admin_interface.current_menu
admin_interface.current_menu = "access_management"
Expand Down
12 changes: 12 additions & 0 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
var/list/records_security = list()
/// Holds all (/datum/ares_record/flight)s
var/list/records_flight = list()
/// Holds all (/datum/ares_record/tech)s
var/list/records_tech = list()
/// Is nuke request usable or not?
var/nuke_available = TRUE

Expand Down Expand Up @@ -177,6 +179,16 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
return FALSE
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.records_flight.Add(new /datum/ares_record/flight(details, user_name))

/proc/log_ares_tech(user_name, tier_tech = FALSE, title, details, point_cost, current_points)
if(!ares_can_log())
return FALSE
var/new_details = "[title] - [details]"
if(point_cost)
new_details += " - Used [point_cost] INT of [current_points]."
var/datum/ares_datacore/datacore = GLOB.ares_datacore
datacore.records_tech.Add(new /datum/ares_record/tech(title, new_details, user_name, tier_tech))

// ------ End ARES Logging Procs ------ //

// ------ ARES Interface Procs ------ //
Expand Down
12 changes: 12 additions & 0 deletions code/game/machinery/ARES/ARES_records.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@
src.details = details
src.user = user

/datum/ares_record/tech
record_name = ARES_RECORD_TECH
/// If this tech unlock changed the tier.
var/is_tier = FALSE

/datum/ares_record/tech/New(title, details, user, tier_tech)
time = worldtime2text()
src.title = title
src.details = details
src.user = user
is_tier = tier_tech

/datum/ares_record/deletion
record_name = ARES_RECORD_DELETED

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/camera/presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

/obj/structure/machinery/camera/autoname/almayer/containment/ares
name = "ares core camera"
network = list(CAMERA_NET_ALMAYER, CAMERA_NET_ARES)
network = list(CAMERA_NET_ARES)

//used by the landing camera dropship equipment. Do not place them right under where the dropship lands.
//Should place them near each corner of your LZs.
Expand Down
13 changes: 11 additions & 2 deletions code/modules/cm_tech/tech.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
var/background_icon = "background"
var/background_icon_locked = "marine"

var/announce_name
var/announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED"
var/announce_message

var/is_tier_changer = FALSE

/datum/tech/proc/can_unlock(mob/M)
SHOULD_CALL_PARENT(TRUE)

Expand Down Expand Up @@ -58,6 +60,7 @@

return TRUE


/** Called when a tech is unlocked. Usually, benefits can be applied here
* however, the purchase can still be cancelled by returning FALSE
*
Expand All @@ -69,11 +72,17 @@
unlocked = TRUE
to_chat(user, SPAN_HELPFUL("You have purchased the '[name]' tech node."))
log_admin("[key_name_admin(user)] has bought '[name]' via tech points.")
if(!is_tier_changer)
var/log_details = announce_message
if(!log_details)
log_details = name
var/current_points = holder.points
log_ares_tech(user.real_name, is_tier_changer, announce_name, log_details, required_points, current_points)
holder.spend_points(required_points)
update_icon(node)

if(!(tech_flags & TECH_FLAG_NO_ANNOUNCE) && announce_message && announce_name)
marine_announcement(announce_message, announce_name, 'sound/misc/notice2.ogg')
marine_announcement(announce_message, announce_name, 'sound/misc/notice2.ogg', logging = ARES_LOG_NONE)

return TRUE

Expand Down
7 changes: 6 additions & 1 deletion code/modules/cm_tech/techs/abstract/transitory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var/datum/tier/next

var/techs_to_unlock = 0
is_tier_changer = TRUE

/datum/tech/transitory/check_tier_level(mob/M)
if(before && before != holder.tier.type)
Expand All @@ -22,7 +23,7 @@

return TRUE

/datum/tech/transitory/on_unlock()
/datum/tech/transitory/on_unlock(mob/user)
. = ..()
if(!next)
return
Expand All @@ -31,6 +32,10 @@
if(next_tier)
holder.tier = next_tier
holder.on_tier_change(previous_tier)
if(flags & TREE_FLAG_MARINE)
/// Due to calling parent, points will have already been spent by now.
var/current_points = holder.points + required_points
log_ares_tech(user.real_name, is_tier_changer, "ALMAYER DEFCON LEVEL INCREASED", "THREAT ASSESSMENT LEVEL INCREASED TO LEVEL [next_tier.tier].\n\nLEVEL [next_tier.tier] assets have been authorised to handle the situation.", required_points, current_points)

/datum/tech/transitory/get_tier_overlay()
if(!next)
Expand Down
1 change: 0 additions & 1 deletion code/modules/cm_tech/techs/marine/tier1/points.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
icon_state = "budget_ds"
desc = "Distributes resources to the dropship fabricator."

announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED"
announce_message = "Additional dropship part fabricator points have been authorised for this operation."

required_points = 12
Expand Down
2 changes: 0 additions & 2 deletions code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

tier = /datum/tier/two

announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED"

var/type_to_give

/datum/tech/repeatable/ob/on_unlock()
Expand Down
1 change: 0 additions & 1 deletion code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
desc = "Wakes up an additional specialist to fight against any threats."
icon_state = "overshield"

announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED"
announce_message = "An additional specialist is being taken out of cryo."

required_points = 8
Expand Down
1 change: 0 additions & 1 deletion code/modules/cm_tech/techs/marine/tier3/cryorine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
desc = "Wakes up additional troops to fight against any threats."
icon_state = "cryotroops"

announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED"
announce_message = "Additional troops are being taken out of cryo."

required_points = 6
Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_tech/trees/marine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ GLOBAL_LIST_EMPTY(tech_controls_marine)
return //No need to announce tier updates for tier 1
var/name = "ALMAYER DEFCON LEVEL INCREASED"
var/input = "THREAT ASSESSMENT LEVEL INCREASED TO LEVEL [tier.tier].\n\nLEVEL [tier.tier] assets have been authorised to handle the situation."
marine_announcement(input, name, 'sound/AI/commandreport.ogg')
marine_announcement(input, name, 'sound/AI/commandreport.ogg', logging = ARES_LOG_NONE)
Loading

0 comments on commit 4f130c7

Please sign in to comment.