EVERYBODY HURTS

This commit is contained in:
Aurorablade
2016-08-03 23:51:13 -04:00
parent b4f28c1cd5
commit 79c9b690ac
15 changed files with 6663 additions and 5952 deletions
+17 -5
View File
@@ -603,20 +603,32 @@
/obj/docking_port/mobile/proc/roadkill(list/L, dir, x, y)
for(var/turf/T in L)
for(var/atom/movable/AM in T)
if(ismob(AM))
if(istype(AM, /mob/living))
if(isliving(AM))
if(ishuman(AM))
var/mob/living/M = AM
M.visible_message("<span class='warning'>[M] is hit by \
a bluespace ripple and thrown clear!</span>",
"<span class='userdanger'>You feel an immense \
crushing pressure as the space around you ripples.\
</span>")
M.Paralyse(10)
M.take_organ_damage(80)
M.apply_damage(60, BRUTE, "chest")
M.apply_damage(60, BRUTE, "head")
M.anchored = 0
else
var/mob/M = AM
M.visible_message("<span class='warning'>[M] is hit by \
a bluespace ripple and is torn into pieces!</span>",
"<span class='userdanger'>You are torn into pieces by \
bluespace churn.</span>")
M.gib()
continue
if(!AM.anchored)
step(AM, dir)
else
if(AM.simulated) //lighting overlays are static
qdel(AM)
qdel(AM)
/*
//used to check if atom/A is within the shuttle's bounding box
/obj/docking_port/mobile/proc/onShuttleCheck(atom/A)
+253 -2
View File
@@ -1,3 +1,7 @@
#define SHUTTLE_MANIPULATOR_STATUS 1
#define SHUTTLE_MANIPULATOR_TEMPLATE 2
#define SHUTTLE_MANIPULATOR_MOD 3
/obj/machinery/shuttle_manipulator
name = "shuttle manipulator"
desc = "I shall be telling this with a sigh\n\
@@ -6,8 +10,255 @@
I took the one less traveled by,\n\
And that has made all the difference."
//icon = 'icons/obj/machines/dominator.dmi'
// icon_state = "dominator-blue"
icon = 'icons/obj/machines/shuttle_manipulator.dmi'
icon_state = "holograph_on"
// UI state variables
var/datum/map_template/shuttle/selected
var/obj/docking_port/mobile/existing_shuttle
var/obj/docking_port/mobile/preview_shuttle
var/datum/map_template/shuttle/preview_template
/obj/machinery/shuttle_manipulator/New()
. = ..()
update_icon()
/obj/machinery/shuttle_manipulator/update_icon()
overlays.Cut()
var/image/hologram_projection = image(icon, "hologram_on")
hologram_projection.pixel_y = 22
var/image/hologram_ship = image(icon, "hologram_whiteship")
hologram_ship.pixel_y = 27
overlays += hologram_projection
overlays += hologram_ship
/obj/machinery/shuttle_manipulator/process()
return
/datum/shuttle_manipulator
var/current_tab = SHUTTLE_MANIPULATOR_STATUS
var/busy
/datum/shuttle_manipulator/proc/showMenu(mob/user)
for(var/shuttle_id in shuttle_templates)
var/datum/map_template/shuttle/S = shuttle_templates[shuttle_id]
if(!templates[S.port_id])
templates[S.port_id] = list(
"port_id" = S.port_id,
"templates" = list())
var/list/L = list()
L["name"] = S.name
L["shuttle_id"] = S.shuttle_id
L["port_id"] = S.port_id
L["description"] = S.description
L["admin_notes"] = S.admin_notes
if(selected == S)
data["selected"] = L
templates[S.port_id]["templates"] += list(L)
// Status panel
for(var/i in shuttle_master.mobile)
var/obj/docking_port/mobile/M = i
var/list/L = list()
L["name"] = M.name
L["id"] = M.id
L["timer"] = M.timer
L["timeleft"] = M.getTimerStr()
L["mode"] = capitalize(M.mode)
L["status"] = M.getStatusText()
if(M == existing_shuttle)
data["existing_shuttle"] = L
data["shuttles"] += list(L)
var/dat = ""
dat += "<center>"
dat += "<a href='?_src_=prefs;preference=tab;tab=[SHUTTLE_MANIPULATOR_STATUS]' [current_tab == SHUTTLE_MANIPULATOR_STATUS ? "class='linkOn'" : ""]>Status</a>"
dat += "<a href='?_src_=prefs;preference=tab;tab=[SHUTTLE_MANIPULATOR_TEMPLATE]' [current_tab == SHUTTLE_MANIPULATOR_TEMPLATE ? "class='linkOn'" : ""]>Templates</a>"
dat += "<a href='?_src_=prefs;preference=tab;tab=[SHUTTLE_MANIPULATOR_MOD]' [current_tab == SHUTTLE_MANIPULATOR_MOD ? "class='linkOn'" : ""]>Modification</a>"
dat += "</center>"
dat += "<HR>"
if(busy)
dat += "<div class='statusDisplay'>Shuttle Manipulation in progress...</div>"
else
dat += "<div class='statusDisplay'>"
switch(current_tab)
if(SHUTTLE_MANIPULATOR_STATUS)
dat += "html goes here"
if(SHUTTLE_MANIPULATOR_TEMPLATE)
dat += "html goes here"
if(SHUTTLE_MANIPULATOR_MOD)
dat += "html goes here"
return data
/obj/machinery/shuttle_manipulator/ui_act(action, params)
if(..())
return
var/mob/user = usr
// Preload some common parameters
var/shuttle_id = params["shuttle_id"]
var/datum/map_template/shuttle/S = shuttle_templates[shuttle_id]
switch(action)
if("select_template")
if(S)
existing_shuttle = shuttle_master.getShuttle(S.port_id)
selected = S
. = TRUE
if("jump_to")
if(params["type"] == "mobile")
. = TRUE
for(var/i in shuttle_master.mobile)
var/obj/docking_port/mobile/M = i
if(M.id == params["id"])
user.forceMove(get_turf(M))
break
if("preview")
if(S)
. = TRUE
unload_preview()
load_template(S)
if(preview_shuttle)
preview_template = S
user.forceMove(get_turf(preview_shuttle))
if("load")
if(existing_shuttle == SSshuttle.backup_shuttle)
// TODO make the load button disabled
WARNING("The shuttle that the selected shuttle will replace \
is the backup shuttle. Backup shuttle is required to be \
intact for round sanity.")
else if(S)
. = TRUE
// If successful, returns the mobile docking port
var/mdp = action_load(S)
if(mdp)
user.forceMove(get_turf(mdp))
update_icon()
/obj/machinery/shuttle_manipulator/proc/action_load(
datum/map_template/shuttle/loading_template)
// Check for an existing preview
if(preview_shuttle && (loading_template != preview_template))
preview_shuttle.jumpToNullSpace()
preview_shuttle = null
preview_template = null
if(!preview_shuttle)
load_template(loading_template)
preview_template = loading_template
// get the existing shuttle information, if any
var/timer = 0
var/mode = SHUTTLE_IDLE
var/obj/docking_port/stationary/D
if(existing_shuttle)
timer = existing_shuttle.timer
mode = existing_shuttle.mode
D = existing_shuttle.get_docked()
else
D = preview_shuttle.findRoundstartDock()
if(!D)
var/m = "No dock found for preview shuttle, aborting."
WARNING(m)
throw EXCEPTION(m)
var/result = preview_shuttle.canDock(D)
// truthy value means that it cannot dock for some reason
// but we can ignore the someone else docked error because we'll
// be moving into their place shortly
if(result && (result != SHUTTLE_SOMEONE_ELSE_DOCKED))
var/m = "Unsuccessful dock of [preview_shuttle] ([result])."
WARNING(m)
return
existing_shuttle.jumpToNullSpace()
preview_shuttle.dock(D)
. = preview_shuttle
// Shuttle state involves a mode and a timer based on world.time, so
// plugging the existing shuttles old values in works fine.
preview_shuttle.timer = timer
preview_shuttle.mode = mode
preview_shuttle.register()
// TODO indicate to the user that success happened, rather than just
// blanking the modification tab
preview_shuttle = null
preview_template = null
existing_shuttle = null
selected = null
return preview_shuttle
/obj/machinery/shuttle_manipulator/proc/load_template(
datum/map_template/shuttle/S)
// load shuttle template, centred at shuttle import landmark,
var/turf/landmark_turf = get_turf(locate("landmark*Shuttle Import"))
S.load(landmark_turf, centered = TRUE)
var/affected = S.get_affected_turfs(landmark_turf, centered=TRUE)
var/found = 0
// Search the turfs for docking ports
// - We need to find the mobile docking port because that is the heart of
// the shuttle.
// - We need to check that no additional ports have slipped in from the
// template, because that causes unintended behaviour.
for(var/T in affected)
for(var/obj/docking_port/P in T)
if(istype(P, /obj/docking_port/mobile))
var/obj/docking_port/mobile/M = P
found++
if(found > 1)
qdel(P, force=TRUE)
world.log << "Map warning: Shuttle Template [S.mappath] \
has multiple mobile docking ports."
else if(!M.timid)
// The shuttle template we loaded isn't "timid" which means
// it's already registered with the shuttles subsystem.
// This is a bad thing.
var/m = "Template [S] is non-timid! Unloading."
WARNING(m)
M.jumpToNullSpace()
return
else
preview_shuttle = P
if(istype(P, /obj/docking_port/stationary))
world.log << "Map warning: Shuttle Template [S.mappath] has a \
stationary docking port."
if(!found)
var/msg = "load_template(): Shuttle Template [S.mappath] has no \
mobile docking port. Aborting import."
for(var/T in affected)
var/turf/T0 = T
T0.empty()
message_admins(msg)
WARNING(msg)
/obj/machinery/shuttle_manipulator/proc/unload_preview()
if(preview_shuttle)
preview_shuttle.jumpToNullSpace()
preview_shuttle = null