Make Kosmicheskaya Stantsiya 13 great again (#45965)

About The Pull Request

Drone shells have been refactored to use mob spawners, and now show up in the ghost spawner menu. Seasonal hats were sacrificed in the process. The spawners are also anchored to prevent players moving them off the derelict.

The derelict drone flavor text and laws have been relaxed slightly, and made more clear as to whats allowed for derelict drones in particular. Effectively: drones are not allowed to leave KS13, the no interaction restriction has been limited to sentient beings, and interaction is now allowed while on KS13. Going to the main station for any reason is explicitly disallowed.
image

The derelict itself has gotten a slight overhaul to make fixing it slightly more feasible. There is a vault you can get into after setting up power which contains materials to help fix KS13. The amount of air mix has been greatly increased.
Why It's Good For The Game

The derelict has great potential for allowing players to learn about construction, as well as taking up the challenge of properly fixing the station. These changes makes that more realistically achievable without relying on random asteroid spawns close by that you werent really supposed to go harvest from.
Fixes #30379
Changelog

cl Skoglol & Naloac
tweak: Make Kosmicheskaya Stantsiya 13 great again! No I mean it, go do it. The derelict has gotten a slight overhaul, and it is now more feasible.
tweak: Derelict drones has had their laws laxed slightly while on the derelict. It should now be harder to be forced into breaking them.
refactor: Drone shells are now mob spawners and show up in the ghost spawner window.
/cl
This commit is contained in:
skoglol
2019-08-26 20:39:20 +12:00
committed by oranges
parent 58fd5ff8a4
commit 725597cd12
9 changed files with 781 additions and 443 deletions
@@ -16,4 +16,151 @@
name = "unfinished paper scrap"
desc = "Looks like someone started shakily writing a will in space common, but were interrupted by something bloody..."
info = "I, Victor Belyakov, do hereby leave my _- "
/obj/item/paper/fluff/ruins/thederelict/vaultraider
name = "Vault Raider Objectives"
info = "<b>Objectives #1</b>: Find out what is hidden in Kosmicheskaya Stantsiya 13s Vault"
/// Vault controller for use on the derelict/KS13.
/obj/machinery/computer/vaultcontroller
name = "vault controller"
desc = "It seems to be powering and controlling the vault locks."
icon_screen = "power"
icon_keyboard = "power_key"
light_color = LIGHT_COLOR_YELLOW
use_power = NO_POWER_USE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/obj/structure/cable/attached_cable
var/obj/machinery/door/airlock/vault/derelict/door1
var/obj/machinery/door/airlock/vault/derelict/door2
var/locked = TRUE
var/siphoned_power = 0
var/siphon_max = 1e7
/obj/machinery/computer/monitor/examine(mob/user)
. = ..()
. += "<span class='notice'>It appears to be powered via a cable connector.</span>"
//Checks for cable connection, charges if possible.
/obj/machinery/computer/vaultcontroller/process()
if(siphoned_power >= siphon_max)
return
update_cable()
if(attached_cable)
attempt_siphon()
///Looks for a cable connection beneath the machine.
/obj/machinery/computer/vaultcontroller/proc/update_cable()
var/turf/T = get_turf(src)
attached_cable = locate(/obj/structure/cable) in T
///Initializes airlock links.
/obj/machinery/computer/vaultcontroller/proc/find_airlocks()
for(var/obj/machinery/door/airlock/A in GLOB.airlocks)
if(A.id_tag == "derelictvault")
if(!door1)
door1 = A
continue
if(door1 && !door2)
door2 = A
break
///Tries to charge from powernet excess, no upper limit except max charge.
/obj/machinery/computer/vaultcontroller/proc/attempt_siphon()
var/surpluspower = CLAMP(attached_cable.surplus(), 0, (siphon_max - siphoned_power))
if(surpluspower)
attached_cable.add_load(surpluspower)
siphoned_power += surpluspower
///Handles the doors closing
/obj/machinery/computer/vaultcontroller/proc/cycle_close(obj/machinery/door/airlock/A)
A.safe = FALSE //Make sure its forced closed, always
A.unbolt()
A.close()
A.bolt()
///Handles the doors opening
/obj/machinery/computer/vaultcontroller/proc/cycle_open(obj/machinery/door/airlock/A)
A.unbolt()
A.open()
A.bolt()
///Attempts to lock the vault doors
/obj/machinery/computer/vaultcontroller/proc/lock_vault()
if(door1 && !door1.density)
cycle_close(door1)
if(door2 && !door2.density)
cycle_close(door2)
if(door1.density && door1.locked && door2.density && door2.locked)
locked = TRUE
///Attempts to unlock the vault doors
/obj/machinery/computer/vaultcontroller/proc/unlock_vault()
if(door1 && door1.density)
cycle_open(door1)
if(door2 && door2.density)
cycle_open(door2)
if(!door1.density && door1.locked && !door2.density && door2.locked)
locked = FALSE
///Attempts to lock/unlock vault doors, if machine is charged.
/obj/machinery/computer/vaultcontroller/proc/activate_lock()
if(siphoned_power < siphon_max)
return
if(!door1 || !door2)
find_airlocks()
if(locked)
unlock_vault()
else
lock_vault()
/obj/machinery/computer/vaultcontroller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "vault_controller", name, 300, 150, master_ui, state)
ui.open()
/obj/machinery/computer/vaultcontroller/ui_act(action, params)
if(..())
return
switch(action)
if("togglelock")
activate_lock()
/obj/machinery/computer/vaultcontroller/ui_data()
var/list/data = list()
data["stored"] = siphoned_power
data["max"] = siphon_max
data["doorstatus"] = locked
return data
///Airlock that can't be deconstructed, broken or hacked.
/obj/machinery/door/airlock/vault/derelict
locked = TRUE
move_resist = INFINITY
use_power = NO_POWER_USE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
id_tag = "derelictvault"
///Overrides screwdriver attack to prevent all deconstruction and hacking.
/obj/machinery/door/airlock/vault/derelict/attackby(obj/item/C, mob/user, params)
if(C.tool_behaviour == TOOL_SCREWDRIVER)
return
..()