Merge remote-tracking branch 'upstream/master'

This commit is contained in:
BongaTheProto
2023-03-23 19:37:34 -05:00
6 changed files with 90 additions and 12 deletions

View File

@@ -99,3 +99,5 @@
- tweak: Hypnotic Gaze consent prompt now includes additional information
- tweak: Brainwashed victims are no longer shown in the round-end panel
- admin: Hypnotic Gaze quirk can now be added and removed mid-round
- balance: Mech fabricators now use their access restrictions
- balance: Removed access requirements for maintenance and off-station mech fabricators

View File

@@ -1,6 +1,6 @@
//Command
/datum/job/captain
alt_titles = list("Colony Overseer")
alt_titles = list("Colony Overseer", "Senator", "Consul")
/datum/job/chief_engineer
alt_titles = list("Senior Engineer")
@@ -9,7 +9,7 @@
alt_titles = list("Crew Resource Officer", "Executive Officer")
/datum/job/hos
alt_titles = list("Chief of Security", "Sheriff")
alt_titles = list("Chief of Security", "Sheriff", "Praetor")
/datum/job/qm
alt_titles = list("Resource Manager", "Logistics Supervisor")
@@ -32,7 +32,7 @@
alt_titles = list("Barista")
/datum/job/chaplain
alt_titles = list("Priest", "Cult Leader", "Pope", "Bishop")
alt_titles = list("Priest", "Cult Leader", "Pope", "Bichop", "Pontiff")
/datum/job/clown //The most useless role in the game, delet this
alt_titles = list("Entertainer")

View File

@@ -28,7 +28,11 @@
/mob/proc/set_thirst(change)
thirst = max(0, change)
/mob/proc/can_use_production(obj/machinery/rnd/production/machine_target)
/mob/proc/can_use_production(obj/machinery/machine_target)
// Check if access is required
if(!machine_target.req_access)
return TRUE
// Check if server is NOT using minimal access
// This is intended for low populations
if((!PROTOLOCK_DURING_LOWPOP) && (!JOB_MINIMAL_ACCESS))
@@ -97,5 +101,42 @@
// Default to false
return FALSE
/mob/proc/can_use_mechfab_topic(obj/machinery/mecha_part_fabricator/machine_target, action, var/list/params)
// Basic actions that are always permitted
if(action == "sync_rnd")
return TRUE
// Define user's access type
var/user_access = usr.can_use_production(machine_target)
// Switch result based on access type
// This currently doesn't do anything special
switch(user_access)
// Type: Low population
if(PROTOLOCK_ACCESS_LOWPOP)
return TRUE
// Type: Standard
if(PROTOLOCK_ACCESS_NORMAL)
return TRUE
// Type: Captain
if(PROTOLOCK_ACCESS_CAPTAIN)
return TRUE
// Type: Mineral / ORM
if(PROTOLOCK_ACCESS_MINERAL)
// Check if permitted topic
if(action == "remove_mat")
return TRUE
// Topic prohibited
// Deny usage
else
return FALSE
// Default to false
return FALSE
#undef JOB_MINIMAL_ACCESS
#undef PROTOLOCK_DURING_LOWPOP

View File

@@ -5,10 +5,6 @@
gen_access()
/obj/machinery/rnd/production/ui_interact(mob/user)
// Check if access is required
if(!req_access)
return ..()
// Check if user can use machine
if(!user.can_use_production(src))
// Warn in local chat and return
@@ -19,10 +15,6 @@
. = ..()
/obj/machinery/rnd/production/Topic(raw, ls)
// Check if access is required
if(!req_access)
return ..()
// Check if user can use machine
if(!usr.can_use_production_topic(src, raw, ls))
// Alert in local chat

View File

@@ -0,0 +1,42 @@
/obj/machinery/mecha_part_fabricator/maint
req_access = null
/obj/machinery/mecha_part_fabricator/offstation
req_access = null
/obj/machinery/mecha_part_fabricator/ui_interact(mob/user, datum/tgui/ui)
// Check if user can use machine
if(!user.can_use_production(src))
// Check if UI doesn't exist
if(!ui)
// Send normal warning
say("Access denied: No valid credentials detected.")
// UI does exist
else
// Close UI
ui.close()
// Send alternate warning
say("Access revoked: Valid credentials no longer detected.")
// Return
return
// Return normally
. = ..()
/obj/machinery/mecha_part_fabricator/ui_act(action, var/list/params)
// Check if user can use machine
if(!usr.can_use_mechfab_topic(src, action, params))
// Alert in local chat
usr.visible_message(span_warning("[usr] pushes a button on [src], causing it to chime with the familiar sound of rejection."), span_warning("The machine buzzes with a soft chime. It seems you don't have access to that button."))
// Play sound
playsound(loc, 'sound/machines/uplinkerror.ogg', 70, 0)
// Return
return
// Return normally
. = ..()

View File

@@ -4285,6 +4285,7 @@
#include "modular_sand\code\modules\tgs\custom_procs.dm"
#include "modular_sand\code\modules\uplink\uplink_items.dm"
#include "modular_sand\code\modules\uplink\uplink_roles.dm"
#include "modular_sand\code\modules\vehicles\mecha\mech_fabricator.dm"
#include "modular_sand\code\modules\vending\autodrobe.dm"
#include "modular_sand\code\modules\vending\clothesmate.dm"
#include "modular_sand\code\modules\vending\kinkmate.dm"