Skip to content

Commit

Permalink
Merge branch 'project/ares/holderperk' into project/ares/tm_holder
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Jun 17, 2024
2 parents 5f4b469 + fbe9109 commit 0e47485
Show file tree
Hide file tree
Showing 8 changed files with 630 additions and 13 deletions.
4 changes: 2 additions & 2 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ GLOBAL_LIST_INIT(ROLES_CIC, list(JOB_CO, JOB_XO, JOB_SO, JOB_WO_CO, JOB_WO_XO))
GLOBAL_LIST_INIT(ROLES_AUXIL_SUPPORT, list(JOB_AUXILIARY_OFFICER, JOB_INTEL, JOB_CAS_PILOT, JOB_DROPSHIP_PILOT, JOB_DROPSHIP_CREW_CHIEF, JOB_WO_CHIEF_POLICE, JOB_WO_SO, JOB_WO_CREWMAN, JOB_WO_POLICE, JOB_WO_PILOT))
GLOBAL_LIST_INIT(ROLES_MISC, list(JOB_SYNTH, JOB_WORKING_JOE, JOB_SEA, JOB_CORPORATE_LIAISON, JOB_COMBAT_REPORTER, JOB_MESS_SERGEANT, JOB_WO_CORPORATE_LIAISON, JOB_WO_SYNTH))
GLOBAL_LIST_INIT(ROLES_POLICE, list(JOB_CHIEF_POLICE, JOB_WARDEN, JOB_POLICE))
GLOBAL_LIST_INIT(ROLES_ENGINEERING, list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH))
GLOBAL_LIST_INIT(ROLES_ENGINEERING, list(JOB_CHIEF_ENGINEER, JOB_ORDNANCE_TECH, JOB_MAINT_TECH, JOB_WO_CHIEF_ENGINEER, JOB_WO_ORDNANCE_TECH, JOB_AI_TECH))
GLOBAL_LIST_INIT(ROLES_REQUISITION, list(JOB_CHIEF_REQUISITION, JOB_CARGO_TECH, JOB_WO_CHIEF_REQUISITION, JOB_WO_REQUISITION))
GLOBAL_LIST_INIT(ROLES_MEDICAL, list(JOB_CMO, JOB_RESEARCHER, JOB_DOCTOR, JOB_NURSE, JOB_WO_CMO, JOB_WO_RESEARCHER, JOB_WO_DOCTOR))
GLOBAL_LIST_INIT(ROLES_MARINES, list(JOB_SQUAD_LEADER, JOB_SQUAD_TEAM_LEADER, JOB_SQUAD_SPECIALIST, JOB_SQUAD_SMARTGUN, JOB_SQUAD_MEDIC, JOB_SQUAD_ENGI, JOB_SQUAD_MARINE))
Expand All @@ -138,7 +138,7 @@ GLOBAL_LIST_INIT(ROLES_WO, list(JOB_WO_CO, JOB_WO_XO, JOB_WO_CORPORATE_LIAISON,

//Groundside roles
GLOBAL_LIST_INIT(ROLES_XENO, list(JOB_XENOMORPH_QUEEN, JOB_XENOMORPH))
GLOBAL_LIST_INIT(ROLES_WHITELISTED, list(JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR, JOB_AI_TECH))
GLOBAL_LIST_INIT(ROLES_WHITELISTED, list(JOB_SYNTH_SURVIVOR, JOB_CO_SURVIVOR, JOB_PREDATOR))
GLOBAL_LIST_INIT(ROLES_SPECIAL, list(JOB_SURVIVOR))

GLOBAL_LIST_INIT(ROLES_USCM, ROLES_CIC + GLOB.ROLES_POLICE + GLOB.ROLES_AUXIL_SUPPORT + GLOB.ROLES_MISC + GLOB.ROLES_ENGINEERING + GLOB.ROLES_REQUISITION + GLOB.ROLES_MEDICAL + GLOB.ROLES_MARINES - ROLES_WO)
Expand Down
4 changes: 2 additions & 2 deletions code/game/jobs/job/special/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
supervisors = "the acting commanding officer"
total_positions = 1
spawn_positions = 1
flags_startup_parameters = ROLE_WHITELISTED
flags_startup_parameters = ROLE_WHITELISTED|ROLE_ADD_TO_DEFAULT
gear_preset = /datum/equipment_preset/uscm_event/ai_tech

// job option
Expand All @@ -47,7 +47,7 @@
return FALSE

/datum/job/special/uscm/ai_tech/generate_entry_message()
entry_message_body = "You are a [corporate ? FACTION_WY : FACTION_MARINE] AI Service Technician temporarily assigned to the [MAIN_SHIP_NAME]. Your goal is to ensure the onboard AI, [MAIN_AI_SYSTEM], is operating effectively. Your job involves heavy roleplay and requires you to behave like [corporate ? "a senior corporate representative, remaining in character at all times.<br>As a Weyland Yutani Technician you have access to the Corporate Office aboard the USS Almayer. Although you should cooperate with the onboard Liaison, you are not their subordinate nor they yours. You should help The Company interests where applicable but do not abuse your access to the AI Systems." : "an officer and to stay in character at all times. You are required to adhere to and obey <a href='"+LAW_PLACEHOLDER+"'>Marine Law</a>. Failure to do so may result in punitive action against you. Godspeed."]"
entry_message_body = "You are a [corporate ? FACTION_WY : FACTION_MARINE] AI Service Technician temporarily assigned to the [MAIN_SHIP_NAME]. Your goal is to ensure the onboard AI, [MAIN_AI_SYSTEM], is operating effectively. Your job involves heavy roleplay and requires you to behave like [corporate ? "a senior corporate representative, remaining in character at all times.<br>As a Weyland Yutani Technician you have access to the Corporate Office aboard the USS Almayer. Although you should cooperate with the onboard Liaison, you are not their subordinate nor they yours. You should help The Company interests where applicable but do not abuse your access to the AI Systems." : "an officer and to stay in character at all times. You are required to adhere to and obey <a href='"+LAW_PLACEHOLDER+"'>Marine Law</a>. Failure to do so may result in punitive action against you. Godspeed.\n\nThe access code for APOLLO Interface is [GLOB.ares_link.code_apollo].\nThe access code for ARES Interface is [GLOB.ares_link.code_interface]."]"
return ..()

/obj/effect/landmark/start/aist
Expand Down
8 changes: 8 additions & 0 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
var/list/faction_options = list(FACTION_MARINE, FACTION_WY, "USCM-WY", FACTION_ARES)
var/list/core_sentries = list()

var/code_apollo = 1
var/code_interface = 1
var/code_debug = 1

/datum/ares_link/New()
admin_interface = new
datacore = GLOB.ares_datacore

code_apollo = "[pick(GLOB.alphabet_uppercase)][rand(1000, 9999)][pick(GLOB.alphabet_uppercase)][pick(GLOB.alphabet_uppercase)]"
code_interface = "[pick(GLOB.alphabet_uppercase)][rand(1000, 9999)][pick(GLOB.alphabet_uppercase)][pick(GLOB.alphabet_uppercase)]"
code_debug = "X[rand(1000, 9999)][pick(GLOB.alphabet_uppercase)][pick(GLOB.alphabet_uppercase)]"

/datum/ares_link/Destroy()
qdel(admin_interface)
for(var/obj/structure/machinery/ares/link in linked_systems)
Expand Down
308 changes: 308 additions & 0 deletions code/game/machinery/ARES/debug_data.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
/obj/item/device/ai_tech_pda/ui_data(mob/user)
if(!link.interface)
to_chat(user, SPAN_WARNING("ARES ADMIN DATA LINK FAILED"))
return FALSE
var/list/data = list()

data["is_pda"] = TRUE
data["admin_login"] = "[logged_in], AI Service Technician"
data["admin_access_log"] = access_list

data["current_menu"] = current_menu
data["last_page"] = last_menu

data["logged_in"] = logged_in
data["access_level"] = authentication
data["sudo"] = FALSE

var/admin_remote_access_text = "[link.interface.sudo_holder ? "(SUDO)," : ""] access level [link.interface.authentication], [link.interface.ares_auth_to_text(link.interface.authentication)]."
if(set_ui == "AresAdmin")
data["access_text"] = admin_remote_access_text
data["logged_in"] = link.interface.last_login
data["access_level"] = link.interface.authentication
data["sudo"] = link.interface.sudo_holder ? TRUE : FALSE
else if(set_ui == "WorkingJoe")
data["access_text"] = " access level [authentication], [apollo_auth_to_text(authentication)]."
else if(set_ui == "AresInterface")
data["access_text"] = " access level [authentication], [ares_auth_to_text(authentication)]."

data["alert_level"] = GLOB.security_level
data["evac_status"] = SShijack.evac_status
data["worldtime"] = world.time

data["access_log"] = datacore.interface_access_list
data["apollo_log"] = datacore.apollo_log

data["deleted_conversation"] = deleted_1to1

data["distresstime"] = datacore.ares_distress_cooldown
data["distresstimelock"] = DISTRESS_TIME_LOCK
data["quarterstime"] = datacore.ares_quarters_cooldown
data["mission_failed"] = SSticker.mode.is_in_endgame
data["nuketimelock"] = NUCLEAR_TIME_LOCK
data["nuke_available"] = datacore.nuke_available

data["printer_cooldown"] = !COOLDOWN_FINISHED(src, printer_cooldown)

var/list/logged_announcements = list()
for(var/datum/ares_record/announcement/broadcast as anything in datacore.records_announcement)
var/list/current_broadcast = list()
current_broadcast["time"] = broadcast.time
current_broadcast["title"] = broadcast.title
current_broadcast["details"] = broadcast.details
current_broadcast["ref"] = "\ref[broadcast]"
logged_announcements += list(current_broadcast)
data["records_announcement"] = logged_announcements

var/list/logged_alerts = list()
for(var/datum/ares_record/security/security_alert as anything in datacore.records_security)
var/list/current_alert = list()
current_alert["time"] = security_alert.time
current_alert["title"] = security_alert.title
current_alert["details"] = security_alert.details
current_alert["ref"] = "\ref[security_alert]"
logged_alerts += list(current_alert)
data["records_security"] = logged_alerts

var/list/logged_flights = list()
for(var/datum/ares_record/flight/flight_log as anything in datacore.records_flight)
var/list/current_flight = list()
current_flight["time"] = flight_log.time
current_flight["title"] = flight_log.title
current_flight["details"] = flight_log.details
current_flight["user"] = flight_log.user
current_flight["ref"] = "\ref[flight_log]"
logged_flights += list(current_flight)
data["records_flight"] = logged_flights

var/list/logged_bioscans = list()
for(var/datum/ares_record/bioscan/scan as anything in datacore.records_bioscan)
var/list/current_scan = list()
current_scan["time"] = scan.time
current_scan["title"] = scan.title
current_scan["details"] = scan.details
current_scan["ref"] = "\ref[scan]"
logged_bioscans += list(current_scan)
data["records_bioscan"] = logged_bioscans

var/list/logged_bombs = list()
for(var/datum/ares_record/bombardment/bomb as anything in datacore.records_bombardment)
var/list/current_bomb = list()
current_bomb["time"] = bomb.time
current_bomb["title"] = bomb.title
current_bomb["details"] = bomb.details
current_bomb["user"] = bomb.user
current_bomb["ref"] = "\ref[bomb]"
logged_bombs += list(current_bomb)
data["records_bombardment"] = logged_bombs

var/list/logged_deletes = list()
for(var/datum/ares_record/deletion/deleted as anything in datacore.records_deletion)
if(!istype(deleted))
continue
var/list/current_delete = list()
current_delete["time"] = deleted.time
current_delete["title"] = deleted.title
current_delete["details"] = deleted.details
current_delete["user"] = deleted.user
current_delete["ref"] = "\ref[deleted]"
logged_deletes += list(current_delete)
data["records_deletion"] = logged_deletes

var/list/logged_discussions = list()
for(var/datum/ares_record/deleted_talk/deleted_convo as anything in datacore.records_deletion)
if(!istype(deleted_convo))
continue
var/list/deleted_disc = list()
deleted_disc["time"] = deleted_convo.time
deleted_disc["title"] = deleted_convo.title
deleted_disc["ref"] = "\ref[deleted_convo]"
logged_discussions += list(deleted_disc)
data["deleted_discussions"] = logged_discussions

var/list/logged_orders = list()
for(var/datum/ares_record/requisition_log/req_order as anything in datacore.records_asrs)
if(!istype(req_order))
continue
var/list/current_order = list()
current_order["time"] = req_order.time
current_order["details"] = req_order.details
current_order["title"] = req_order.title
current_order["user"] = req_order.user
current_order["ref"] = "\ref[req_order]"
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
for(var/datum/ares_record/talk_log/log as anything in datacore.records_talking)
if(!istype(log))
continue
if(log.user == link.interface.last_login)
active_convo = log.conversation
active_ref = "\ref[log]"

var/list/current_convo = list()
current_convo["user"] = log.user
current_convo["ref"] = "\ref[log]"
current_convo["conversation"] = log.conversation
logged_convos += list(current_convo)

data["active_convo"] = active_convo
data["active_ref"] = active_ref
data["conversations"] = logged_convos

var/list/logged_maintenance = list()
for(var/datum/ares_ticket/maintenance/maint_ticket as anything in link.tickets_maintenance)
if(!istype(maint_ticket))
continue
var/lock_status = TICKET_OPEN
switch(maint_ticket.ticket_status)
if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_COMPLETED)
lock_status = TICKET_CLOSED

var/list/current_maint = list()
current_maint["id"] = maint_ticket.ticket_id
current_maint["time"] = maint_ticket.ticket_time
current_maint["priority_status"] = maint_ticket.ticket_priority
current_maint["category"] = maint_ticket.ticket_name
current_maint["details"] = maint_ticket.ticket_details
current_maint["status"] = maint_ticket.ticket_status
current_maint["submitter"] = maint_ticket.ticket_submitter
current_maint["assignee"] = maint_ticket.ticket_assignee
current_maint["lock_status"] = lock_status
current_maint["ref"] = "\ref[maint_ticket]"
logged_maintenance += list(current_maint)
data["maintenance_tickets"] = logged_maintenance

var/list/logged_access = list()
var/list/requesting_access = list()
for(var/datum/ares_ticket/access/access_ticket as anything in link.tickets_access)
var/lock_status = TICKET_OPEN
switch(access_ticket.ticket_status)
if(TICKET_REJECTED, TICKET_CANCELLED, TICKET_REVOKED)
lock_status = TICKET_CLOSED

var/list/current_ticket = list()
current_ticket["id"] = access_ticket.ticket_id
current_ticket["time"] = access_ticket.ticket_time
current_ticket["priority_status"] = access_ticket.ticket_priority
current_ticket["title"] = access_ticket.ticket_name
current_ticket["details"] = access_ticket.ticket_details
current_ticket["status"] = access_ticket.ticket_status
current_ticket["submitter"] = access_ticket.ticket_submitter
current_ticket["assignee"] = access_ticket.ticket_assignee
current_ticket["lock_status"] = lock_status
current_ticket["ref"] = "\ref[access_ticket]"
logged_access += list(current_ticket)

if(lock_status == TICKET_OPEN)
requesting_access += access_ticket.ticket_name
data["access_tickets"] = logged_access

data["notify_sounds"] = notify_sounds
data["security_vents"] = link.get_ares_vents()
data["sentry_setting"] = link.faction_label
data["faction_options"] = link.faction_options

return data



/obj/item/device/ai_tech_pda/proc/get_apollo_access(obj/item/card/id/card)
if(ACCESS_ARES_DEBUG in card.access)
return APOLLO_ACCESS_DEBUG
switch(card.assignment)
if(JOB_WORKING_JOE)
return APOLLO_ACCESS_JOE
if(JOB_CHIEF_ENGINEER, JOB_SYNTH, JOB_CO)
return APOLLO_ACCESS_AUTHED
if(ACCESS_MARINE_AI in card.access)
return APOLLO_ACCESS_AUTHED
if(ACCESS_MARINE_AI_TEMP in card.access)
return APOLLO_ACCESS_TEMP
if((ACCESS_MARINE_SENIOR in card.access ) || (ACCESS_MARINE_ENGINEERING in card.access) || (ACCESS_WY_GENERAL in card.access))
return APOLLO_ACCESS_REPORTER
else
return APOLLO_ACCESS_REQUEST

/obj/item/device/ai_tech_pda/proc/apollo_auth_to_text(access_level)
switch(access_level)
if(APOLLO_ACCESS_LOGOUT)//0
return "Logged Out"
if(APOLLO_ACCESS_REQUEST)//1
return "Unauthorized Personnel"
if(APOLLO_ACCESS_REPORTER)//2
return "Validated Incident Reporter"
if(APOLLO_ACCESS_TEMP)//3
return "Authorized Visitor"
if(APOLLO_ACCESS_AUTHED)//4
return "Certified Personnel"
if(APOLLO_ACCESS_JOE)//5
return "Working Joe"
if(APOLLO_ACCESS_DEBUG)//6
return "AI Service Technician"

/obj/item/device/ai_tech_pda/proc/get_ares_access(obj/item/card/id/card)
if(ACCESS_ARES_DEBUG in card.access)
return ARES_ACCESS_DEBUG
switch(card.assignment)
if(JOB_WORKING_JOE)
return ARES_ACCESS_JOE
if(JOB_CHIEF_ENGINEER)
return ARES_ACCESS_CE
if(JOB_SYNTH)
return ARES_ACCESS_SYNTH
if(card.paygrade in GLOB.wy_highcom_paygrades)
return ARES_ACCESS_WY_COMMAND
if(card.paygrade in GLOB.uscm_highcom_paygrades)
return ARES_ACCESS_HIGH
if(card.paygrade in GLOB.co_paygrades)
return ARES_ACCESS_CO
if(ACCESS_MARINE_SENIOR in card.access)
return ARES_ACCESS_SENIOR
if(ACCESS_WY_GENERAL in card.access)
return ARES_ACCESS_CORPORATE
if(ACCESS_MARINE_COMMAND in card.access)
return ARES_ACCESS_COMMAND
else
return ARES_ACCESS_BASIC

/obj/item/device/ai_tech_pda/proc/ares_auth_to_text(access_level)
switch(access_level)
if(ARES_ACCESS_LOGOUT)
return "Logged Out"
if(ARES_ACCESS_BASIC)
return "Authorized"
if(ARES_ACCESS_COMMAND)
return "[MAIN_SHIP_NAME] Command"
if(ARES_ACCESS_JOE)
return "Working Joe"
if(ARES_ACCESS_CORPORATE)
return "Weyland-Yutani"
if(ARES_ACCESS_SENIOR)
return "[MAIN_SHIP_NAME] Senior Command"
if(ARES_ACCESS_CE)
return "Chief Engineer"
if(ARES_ACCESS_SYNTH)
return "USCM Synthetic"
if(ARES_ACCESS_CO)
return "[MAIN_SHIP_NAME] Commanding Officer"
if(ARES_ACCESS_HIGH)
return "USCM High Command"
if(ARES_ACCESS_WY_COMMAND)
return "Weyland-Yutani Directorate"
if(ARES_ACCESS_DEBUG)
return "AI Service Technician"
Loading

0 comments on commit 0e47485

Please sign in to comment.