Skip to content

Commit

Permalink
ship blacklisting in the event of someone doing something horrible
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeguyManperson committed Feb 20, 2024
1 parent b479208 commit 0a24547
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
24 changes: 24 additions & 0 deletions code/controllers/subsystem/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,30 @@ SUBSYSTEM_DEF(shuttle)
user.client.debug_variables(port.current_ship)
return TRUE

if("blist")
var/obj/docking_port/mobile/port = locate(params["id"]) in mobile
if(!port || !port.current_ship)
return
var/datum/overmap/ship/controlled/port_ship = port.current_ship
var/temp_loc = input(user, "Select outpost to modify ship blacklist status for", "Get Em Outta Here") as null|anything in SSovermap.outposts
if(!temp_loc)
return
var/datum/overmap/outpost/please_leave = temp_loc
if(please_leave in port_ship.blacklisted)
if(tgui_alert(user, "Rescind ship blacklist?", "Maybe They Aren't So Bad", list("Yes", "No")) == "Yes")
port_ship.blacklisted &= ~please_leave
message_admins("[key_name_admin(user)] unblocked [port_ship] from [please_leave].")
log_admin("[key_name_admin(user)] unblocked [port_ship] from [please_leave].")
return TRUE
var/reason = input(user, "Provide a reason for blacklisting, which will be displayed on docking attempts", "Bar Them From The Pearly Gates", "Contact local law enforcement for more information.")
if(please_leave in port_ship.blacklisted) //in the event two admins are blacklisting a ship at the same time
if(tgui_alert(user, "Ship is already blacklisted, overwrite current reason with your own?", "I call the shots here", list("Yes", "No")) != "Yes")
return TRUE
port_ship.blacklisted[please_leave] = reason
message_admins("[key_name_admin(user)] blacklisted [port_ship] from landing at [please_leave] with reason: [reason]")
log_admin("[key_name_admin(user)] blacklisted [port_ship] from landing at [please_leave] with reason: [reason]")
return TRUE

if("fly")
for(var/obj/docking_port/mobile/M as anything in mobile)
if(REF(M) == params["id"])
Expand Down
3 changes: 3 additions & 0 deletions code/modules/overmap/objects/outpost/outpost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
)
return FALSE

if(src in dock_requester.blacklisted)
return new /datum/docking_ticket(_docking_error = "Docking request denied: [dock_requester.blacklisted[src]]")

adjust_dock_to_shuttle(h_dock, dock_requester.shuttle_port)
return new /datum/docking_ticket(h_dock, src, dock_requester)

Expand Down
4 changes: 4 additions & 0 deletions code/modules/overmap/ships/controlled_ship_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
///Time that next job slot change can occur
COOLDOWN_DECLARE(job_slot_adjustment_cooldown)

///Stations the ship has been blacklisted from landing at, associative station = reason
var/list/blacklisted = list()

/datum/overmap/ship/controlled/Rename(new_name, force = FALSE)
var/oldname = name
if(!..() || (!COOLDOWN_FINISHED(src, rename_cooldown) && !force))
Expand Down Expand Up @@ -128,6 +131,7 @@
QDEL_NULL(shipkey)
QDEL_LIST(manifest)
job_slots.Cut()
blacklisted.Cut()
for(var/a_key in applications)
if(isnull(applications[a_key]))
continue
Expand Down
9 changes: 9 additions & 0 deletions tgui/packages/tgui/interfaces/ShuttleManipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ export const ShuttleManipulatorStatus = (props, context) => {
})
}
/>
<Button
content="BLIST"
key={shuttle.id}
onClick={() =>
act('blist', {
id: shuttle.id,
})
}
/>
</Table.Cell>
<Table.Cell>{shuttle.name}</Table.Cell>
<Table.Cell>{shuttle.type}</Table.Cell>
Expand Down

0 comments on commit 0a24547

Please sign in to comment.