POLARIS: Silly piloting helmet animation

Bonk helmet on shuttle computer to link. No, it doesn't work if you're off the shuttle, no remote info transfer.
This commit is contained in:
Arokha Sieyes
2018-02-02 19:06:07 -05:00
parent f5511dc458
commit 4162e35e00
4 changed files with 214 additions and 4 deletions

View File

@@ -127,10 +127,10 @@
depart_time = world.time
on_shuttle_departure(departing)
moving_status = SHUTTLE_INTRANSIT
on_shuttle_departure(departing)
move(departing, interim, direction)
interim.shuttle_arrived()

View File

@@ -16,6 +16,7 @@
var/autopilot_first_delay = null // If your want your shuttle to stay for a different amount of time for the first time, set this.
var/can_rename = TRUE // Lets the pilot rename the shuttle. Only available once.
category = /datum/shuttle/web_shuttle
var/list/obj/item/clothing/head/pilot/helmets
/datum/shuttle/web_shuttle/New()
current_area = locate(current_area)
@@ -27,10 +28,12 @@
autopilot_delay = autopilot_first_delay
if(!visible_name)
visible_name = name
helmets = list()
..()
/datum/shuttle/web_shuttle/Destroy()
qdel(web_master)
helmets.Cut()
return ..()
@@ -42,18 +45,30 @@
..()
last_move = world.time
/datum/shuttle/web_shuttle/short_jump()
. = ..()
update_helmets()
/datum/shuttle/web_shuttle/long_jump()
. = ..()
update_helmets()
/datum/shuttle/web_shuttle/on_shuttle_departure()
..()
. = ..()
web_master.on_shuttle_departure()
update_helmets()
/datum/shuttle/web_shuttle/on_shuttle_arrival()
..()
. = ..()
web_master.on_shuttle_arrival()
update_helmets()
/datum/shuttle/web_shuttle/proc/build_destinations()
return
/datum/shuttle/web_shuttle/process()
update_helmets()
if(moving_status == SHUTTLE_IDLE)
if(web_master.autopath) // We're currently flying a path.
autopilot_say("Continuing route.")
@@ -94,6 +109,20 @@
autopilot_say("Taking off.")
web_master.process_autopath()
/datum/shuttle/web_shuttle/proc/update_helmets()
for(var/helm in helmets)
if(!helm)
helmets -= helm
continue
var/obj/item/clothing/head/pilot/H = helm
if(!H.shuttle_comp || get_area(H.shuttle_comp) != get_area(H))
H.shuttle_comp = null
H.audible_message("<span class='warning'>\The [H] pings as it loses it's connection with the ship.</span>")
H.update_hud("discon")
helmets -= H
else
H.update_hud(moving_status)
/datum/shuttle/web_shuttle/proc/adjust_autopilot(on)
if(on)
if(autopilot)
@@ -131,6 +160,19 @@
icon_keyboard = "flight_center_key"
icon_screen = "flight_center"
/obj/machinery/computer/shuttle_control/web/attackby(obj/I, mob/user)
var/datum/shuttle/web_shuttle/shuttle = shuttle_controller.shuttles[shuttle_tag]
if(shuttle && istype(I,/obj/item/clothing/head/pilot))
var/obj/item/clothing/head/pilot/H = I
H.shuttle_comp = src
shuttle.helmets |= I
to_chat(user,"<span class='notice'>You register the helmet with the ship's console.</span>")
shuttle.update_helmets()
return
return ..()
// Fairly copypasta-y.
/obj/machinery/computer/shuttle_control/web/attack_hand(mob/user)
if(..(user))

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

View File

@@ -18,6 +18,174 @@
max_heat_protection_temperature = HELMET_MAX_HEAT_PROTECTION_TEMPERATURE
w_class = ITEMSIZE_NORMAL
var/obj/machinery/computer/shuttle_control/web/shuttle_comp
var/obj/screen/pilot_hud
var/list/images
var/list/raw_images
var/last_status
/obj/item/clothing/head/pilot/initialize()
. = ..()
images = list()
raw_images = list()
pilot_hud = new(src)
pilot_hud.screen_loc = "1,1"
pilot_hud.icon = 'icons/obj/piloting_overlay.dmi'
pilot_hud.icon_state = "dimmer"
pilot_hud.layer = SCREEN_LAYER
pilot_hud.plane = PLANE_FULLSCREEN
pilot_hud.mouse_opacity = 0
pilot_hud.alpha = 0
var/image/I
I = image(pilot_hud.icon,pilot_hud,"top_bar",layer=SCREEN_LAYER+1)
I.appearance_flags = RESET_ALPHA
I.alpha = 145
images["top_bar"] = I
raw_images += I
I = image(pilot_hud.icon,pilot_hud,"top_dots",layer=SCREEN_LAYER+1)
I.appearance_flags = RESET_ALPHA
I.alpha = 200
images["topdots"] = I
raw_images += I
I = image(pilot_hud.icon,pilot_hud,"words_discon",layer=SCREEN_LAYER+1) //words_standby, words_flying, words_spool, words_discon
I.appearance_flags = RESET_ALPHA
I.alpha = 200
images["top_words"] = I
raw_images += I
I = image(pilot_hud.icon,pilot_hud,"",layer=SCREEN_LAYER+1)
I.appearance_flags = RESET_ALPHA
I.alpha = 200
images["charging"] = I
raw_images += I
I = image(pilot_hud.icon,pilot_hud,"left_bar",layer=SCREEN_LAYER+1)
I.appearance_flags = RESET_ALPHA
I.alpha = 0
images["left_bar"] = I
raw_images += I
I = image(pilot_hud.icon,pilot_hud,"right_bar",layer=SCREEN_LAYER+1)
I.appearance_flags = RESET_ALPHA
I.alpha = 0
images["right_bar"] = I
raw_images += I
I = image(pilot_hud.icon,pilot_hud,"flyboxes",layer=SCREEN_LAYER+1)
I.appearance_flags = RESET_ALPHA
I.alpha = 0
images["flyboxes"] = I
raw_images += I
I = image(pilot_hud.icon,pilot_hud,"horizon",layer=SCREEN_LAYER+1)
I.appearance_flags = RESET_ALPHA
I.alpha = 0
images["horizon"] = I
raw_images += I
/obj/item/clothing/head/pilot/proc/update_hud(var/status)
if(last_status == status)
return
last_status = status
if(status == SHUTTLE_INTRANSIT)
var/image/I = images["top_words"]
I.icon_state = "words_flying"
I = images["left_bar"]
I.alpha = 200
I = images["right_bar"]
I.alpha = 200
I = images["flyboxes"]
I.alpha = 200
I = images["horizon"]
I.alpha = 200
I = images["charging"]
I.icon_state = ""
animate(pilot_hud,alpha=255,time=3 SECONDS)
else if(status == SHUTTLE_IDLE)
var/image/I = images["top_words"]
I.icon_state = "words_standby"
I = images["left_bar"]
I.alpha = 0
I = images["right_bar"]
I.alpha = 0
I = images["flyboxes"]
I.alpha = 0
I = images["horizon"]
I.alpha = 0
I = images["charging"]
I.icon_state = ""
animate(pilot_hud,alpha=0,time=3 SECONDS)
else if(status == SHUTTLE_WARMUP)
var/image/I = images["top_words"]
I.icon_state = "words_spool"
I = images["left_bar"]
I.alpha = 200
I = images["right_bar"]
I.alpha = 200
I = images["flyboxes"]
I.alpha = 0
I = images["horizon"]
I.alpha = 0
I = images["charging"]
I.icon_state = "charging"
animate(pilot_hud,alpha=255,time=3 SECONDS)
else if(status == "discon")
var/image/I = images["top_words"]
I.icon_state = "words_discon"
I = images["left_bar"]
I.alpha = 0
I = images["right_bar"]
I.alpha = 0
I = images["flyboxes"]
I.alpha = 0
I = images["horizon"]
I.alpha = 0
I = images["charging"]
I.icon_state = ""
animate(pilot_hud,alpha=0,time=3 SECONDS)
/obj/item/clothing/head/pilot/verb/hud_colors()
set name = "Alter HUD color"
set desc = "Change the color of the piloting HUD."
set category = "Object"
set src in usr
var/newcolor = input(usr,"Pick a color!","HUD Color") as null|color
if(newcolor)
for(var/img in list("top_words","left_bar","right_bar","flyboxes"))
var/image/I = images[img]
I.color = newcolor
/obj/item/clothing/head/pilot/Destroy()
for(var/img in raw_images)
var/image/I = img
I.loc = null
shuttle_comp = null
qdel(pilot_hud)
return ..()
/obj/item/clothing/head/pilot/equipped(var/mob/user,var/slot)
. = ..()
if(slot == slot_head && user.client)
user.client.screen |= pilot_hud
user.client.images |= raw_images
/obj/item/clothing/head/pilot/dropped(var/mob/user)
. = ..()
if(user.client)
user.client.screen -= pilot_hud
user.client.images -= raw_images
/obj/item/clothing/head/pilot/alt
name = "pilot helmet"
desc = "Standard pilot gear. Protects the head from impacts. This one has a retractable visor"