mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Merge pull request #5064 from VOREStation/vs-port-3142
[PORT] Improved playsound and drop_location() from /tg
This commit is contained in:
@@ -143,7 +143,12 @@
|
||||
vtext = "<a href='?_src_=vars;Vars=\ref[C]'>\ref[C]</a> - [C] ([C.type])"
|
||||
else if(islist(value))
|
||||
var/list/L = value
|
||||
vtext = "/list ([L.len])"
|
||||
var/removed = 0
|
||||
if(varname == "contents")
|
||||
var/list/original = value
|
||||
L = original.Copy() //We'll take a copy to manipulate
|
||||
removed = D.view_variables_filter_contents(L)
|
||||
vtext = "/list ([L.len]+[removed]H)"
|
||||
if(!(varname in view_variables_dont_expand) && L.len > 0 && L.len < 100)
|
||||
extra = "<ul>"
|
||||
var/index = 1
|
||||
@@ -158,3 +163,21 @@
|
||||
vtext = "[value]"
|
||||
|
||||
return "<li>[ecm][varname] = <span class='value'>[vtext]</span>[extra]</li>"
|
||||
|
||||
//Allows us to mask out some contents when it's not necessary to show them
|
||||
//For example, organs on humans, as the organs are stored in other lists which will also be present
|
||||
//So there's really no need to list them twice.
|
||||
/datum/proc/view_variables_filter_contents(list/L)
|
||||
return 0 //Return how many items you removed.
|
||||
|
||||
/mob/living/carbon/human/view_variables_filter_contents(list/L)
|
||||
. = ..()
|
||||
L -= ability_master
|
||||
.++
|
||||
|
||||
/mob/living/carbon/human/view_variables_filter_contents(list/L)
|
||||
. = ..()
|
||||
var/len_before = L.len
|
||||
L -= organs
|
||||
L -= internal_organs
|
||||
. += len_before - L.len
|
||||
|
||||
@@ -208,7 +208,7 @@ var/list/slot_equipment_priority = list( \
|
||||
if(target)
|
||||
I.forceMove(target)
|
||||
else
|
||||
I.dropInto(loc)
|
||||
I.dropInto(drop_location())
|
||||
I.dropped(src)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -1169,6 +1169,20 @@ default behaviour is:
|
||||
|
||||
item.throw_at(target, throw_range, item.throw_speed, src)
|
||||
|
||||
/mob/living/get_sound_env(var/pressure_factor)
|
||||
if (hallucination)
|
||||
return PSYCHOTIC
|
||||
else if (druggy)
|
||||
return DRUGGED
|
||||
else if (drowsyness)
|
||||
return DIZZY
|
||||
else if (confused)
|
||||
return DIZZY
|
||||
else if (sleeping)
|
||||
return UNDERWATER
|
||||
else
|
||||
return ..()
|
||||
|
||||
//Add an entry to overlays, assuming it exists
|
||||
/mob/living/proc/apply_hud(cache_index, var/image/I)
|
||||
hud_list[cache_index] = I
|
||||
@@ -1186,4 +1200,4 @@ default behaviour is:
|
||||
return I
|
||||
|
||||
/mob/living/proc/make_hud_overlays()
|
||||
return
|
||||
return
|
||||
|
||||
@@ -629,6 +629,13 @@ var/global/image/backplane
|
||||
|
||||
return TRUE
|
||||
|
||||
/mob/proc/get_sound_env(var/pressure_factor)
|
||||
if (pressure_factor < 0.5)
|
||||
return SPACE
|
||||
else
|
||||
var/area/A = get_area(src)
|
||||
return A.sound_env
|
||||
|
||||
/mob/proc/position_hud_item(var/obj/item/item, var/slot)
|
||||
if(!istype(hud_used) || !slot || !LAZYLEN(hud_used.slot_info))
|
||||
return
|
||||
|
||||
@@ -60,11 +60,13 @@
|
||||
return TRUE
|
||||
|
||||
// If you need an event to occur when the shuttle jumps in short or long jump, override this.
|
||||
/datum/shuttle/proc/on_shuttle_departure()
|
||||
/datum/shuttle/proc/on_shuttle_departure(var/area/origin)
|
||||
origin.shuttle_departed()
|
||||
return
|
||||
|
||||
// Similar to above, but when it finishes moving to the target. Short jump generally makes this occur immediately after the above proc.
|
||||
/datum/shuttle/proc/on_shuttle_arrival()
|
||||
/datum/shuttle/proc/on_shuttle_arrival(var/area/destination)
|
||||
destination.shuttle_arrived()
|
||||
return
|
||||
|
||||
/datum/shuttle/proc/short_jump(var/area/origin,var/area/destination)
|
||||
@@ -94,7 +96,7 @@
|
||||
move(origin, destination)
|
||||
moving_status = SHUTTLE_IDLE
|
||||
|
||||
on_shuttle_arrival()
|
||||
on_shuttle_arrival(destination)
|
||||
|
||||
make_sounds(destination, HYPERSPACE_END)
|
||||
|
||||
@@ -125,11 +127,12 @@
|
||||
|
||||
depart_time = world.time
|
||||
|
||||
on_shuttle_departure()
|
||||
on_shuttle_departure(departing)
|
||||
|
||||
moving_status = SHUTTLE_INTRANSIT
|
||||
|
||||
move(departing, interim, direction)
|
||||
interim.shuttle_arrived()
|
||||
|
||||
var/last_progress_sound = 0
|
||||
var/made_warning = FALSE
|
||||
@@ -144,10 +147,11 @@
|
||||
create_warning_effect(destination)
|
||||
sleep(5)
|
||||
|
||||
interim.shuttle_departed()
|
||||
move(interim, destination, direction)
|
||||
moving_status = SHUTTLE_IDLE
|
||||
|
||||
on_shuttle_arrival()
|
||||
on_shuttle_arrival(destination)
|
||||
|
||||
make_sounds(destination, HYPERSPACE_END)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user