Files
CHOMPStation2/code/modules/overmap/ships/computers/shuttle.dm
Leshana 9cbdf184ff Ported Basic Overmap Functionality
- Ports the overmap, ships, sectors, and "landable" ships from baystation.
- Ports necessary computers to control ships and overmap shuttles.
- Shims missing machine and computer functionality pending future enhancements.
- Includes required new sprites and sounds.
2020-03-11 11:11:40 -04:00

46 lines
1.6 KiB
Plaintext

//Shuttle controller computer for shuttles going between sectors
/obj/machinery/computer/shuttle_control/explore
name = "general shuttle control console"
ui_template = "shuttle_control_console_exploration.tmpl"
/obj/machinery/computer/shuttle_control/explore/get_ui_data(var/datum/shuttle/autodock/overmap/shuttle)
. = ..()
if(istype(shuttle))
var/total_gas = 0
for(var/obj/structure/fuel_port/FP in shuttle.fuel_ports) //loop through fuel ports
var/obj/item/weapon/tank/fuel_tank = locate() in FP
if(fuel_tank)
total_gas += fuel_tank.air_contents.total_moles
var/fuel_span = "good"
if(total_gas < shuttle.fuel_consumption * 2)
fuel_span = "bad"
. += list(
"destination_name" = shuttle.get_destination_name(),
"can_pick" = shuttle.moving_status == SHUTTLE_IDLE,
"fuel_usage" = shuttle.fuel_consumption * 100,
"remaining_fuel" = round(total_gas, 0.01) * 100,
"fuel_span" = fuel_span
)
/obj/machinery/computer/shuttle_control/explore/handle_topic_href(var/datum/shuttle/autodock/overmap/shuttle, var/list/href_list)
if(ismob(usr))
var/mob/user = usr
shuttle.operator_skill = user.get_skill_value(/datum/skill/pilot)
if((. = ..()) != null)
return
if(href_list["pick"])
var/list/possible_d = shuttle.get_possible_destinations()
var/D
if(possible_d.len)
D = input("Choose shuttle destination", "Shuttle Destination") as null|anything in possible_d
else
to_chat(usr,"<span class='warning'>No valid landing sites in range.</span>")
possible_d = shuttle.get_possible_destinations()
if(CanInteract(usr, global.default_state) && (D in possible_d))
shuttle.set_destination(possible_d[D])
return TOPIC_REFRESH