mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Allow turbolift specific-floor delays
If one floor is 'taller' than the others, or otherwise takes longer to traverse, you can set delay_time on the area to have it wait a different time there. Or, wait even less time, though less than 1 second isn't possible since the controller only fires every second.
This commit is contained in:
@@ -108,7 +108,7 @@
|
|||||||
current_floor = next_floor
|
current_floor = next_floor
|
||||||
control_panel_interior.visible_message("The elevator [moving_upwards ? "rises" : "descends"] smoothly.")
|
control_panel_interior.visible_message("The elevator [moving_upwards ? "rises" : "descends"] smoothly.")
|
||||||
|
|
||||||
return 1
|
return (next_floor.delay_time || move_delay || 30)
|
||||||
|
|
||||||
/datum/turbolift/proc/queue_move_to(var/datum/turbolift_floor/floor)
|
/datum/turbolift/proc/queue_move_to(var/datum/turbolift_floor/floor)
|
||||||
if(!floor || !(floor in floors) || (floor in queued_floors))
|
if(!floor || !(floor in floors) || (floor in queued_floors))
|
||||||
|
|||||||
@@ -9,3 +9,4 @@
|
|||||||
var/lift_floor_name = null
|
var/lift_floor_name = null
|
||||||
var/lift_announce_str = "Ding!"
|
var/lift_announce_str = "Ding!"
|
||||||
var/arrival_sound = 'sound/machines/ding.ogg'
|
var/arrival_sound = 'sound/machines/ding.ogg'
|
||||||
|
var/delay_time
|
||||||
|
|||||||
@@ -123,7 +123,7 @@
|
|||||||
dat += "<a href='?src=\ref[src];emergency_stop=1'>Emergency Stop</a>"
|
dat += "<a href='?src=\ref[src];emergency_stop=1'>Emergency Stop</a>"
|
||||||
dat += "<hr></body></html>"
|
dat += "<hr></body></html>"
|
||||||
|
|
||||||
var/datum/browser/popup = new(user, "turbolift_panel", "Lift Panel", 230, 260)
|
var/datum/browser/popup = new(user, "turbolift_panel", "Lift Panel", 250, 320)
|
||||||
popup.set_content(jointext(dat, null))
|
popup.set_content(jointext(dat, null))
|
||||||
popup.open()
|
popup.open()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
var/name
|
var/name
|
||||||
var/announce_str
|
var/announce_str
|
||||||
var/arrival_sound
|
var/arrival_sound
|
||||||
|
var/delay_time
|
||||||
|
|
||||||
var/list/doors = list()
|
var/list/doors = list()
|
||||||
var/obj/structure/lift/button/ext_panel
|
var/obj/structure/lift/button/ext_panel
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
name = A.lift_floor_name ? A.lift_floor_name : A.name
|
name = A.lift_floor_name ? A.lift_floor_name : A.name
|
||||||
announce_str = A.lift_announce_str
|
announce_str = A.lift_announce_str
|
||||||
arrival_sound = A.arrival_sound
|
arrival_sound = A.arrival_sound
|
||||||
|
delay_time = A.delay_time
|
||||||
|
|
||||||
//called when a lift has queued this floor as a destination
|
//called when a lift has queued this floor as a destination
|
||||||
/datum/turbolift_floor/proc/pending_move(var/datum/turbolift/lift)
|
/datum/turbolift_floor/proc/pending_move(var/datum/turbolift/lift)
|
||||||
|
|||||||
@@ -20,16 +20,17 @@ var/datum/controller/process/turbolift/turbolift_controller
|
|||||||
continue
|
continue
|
||||||
spawn(0)
|
spawn(0)
|
||||||
lift.busy = 1
|
lift.busy = 1
|
||||||
if(!lift.do_move())
|
var/floor_delay
|
||||||
|
if(!(floor_delay = lift.do_move()))
|
||||||
moving_lifts[liftref] = null
|
moving_lifts[liftref] = null
|
||||||
moving_lifts -= liftref
|
moving_lifts -= liftref
|
||||||
if(lift.target_floor)
|
if(lift.target_floor)
|
||||||
lift.target_floor.ext_panel.reset()
|
lift.target_floor.ext_panel.reset()
|
||||||
lift.target_floor = null
|
lift.target_floor = null
|
||||||
else
|
else
|
||||||
lift_is_moving(lift)
|
lift_is_moving(lift,floor_delay)
|
||||||
lift.busy = 0
|
lift.busy = 0
|
||||||
SCHECK
|
SCHECK
|
||||||
|
|
||||||
/datum/controller/process/turbolift/proc/lift_is_moving(var/datum/turbolift/lift)
|
/datum/controller/process/turbolift/proc/lift_is_moving(var/datum/turbolift/lift,var/floor_delay)
|
||||||
moving_lifts["\ref[lift]"] = world.time + lift.move_delay
|
moving_lifts["\ref[lift]"] = world.time + floor_delay
|
||||||
|
|||||||
Reference in New Issue
Block a user