This commit is contained in:
silicons
2021-01-09 14:56:29 -08:00
parent bffc43e95e
commit e680d58a03
14 changed files with 69 additions and 27 deletions

View File

@@ -17,7 +17,7 @@ SUBSYSTEM_DEF(processing)
/datum/controller/subsystem/processing/fire(resumed = FALSE) /datum/controller/subsystem/processing/fire(resumed = FALSE)
if (!resumed) if (!resumed)
currentrun = processing.Copy() currentrun = processing.Copy()
var/delta_time = (flags & SS_TICKER)? (wait * world.tick_lag) : (wait * 0.1) var/delta_time = (flags & SS_TICKER)? (wait * world.tick_lag * 0.1) : (wait * 0.1)
//cache for sanic speed (lists are references anyways) //cache for sanic speed (lists are references anyways)
var/list/current_run = currentrun var/list/current_run = currentrun

View File

@@ -47,7 +47,7 @@ SUBSYSTEM_DEF(spacedrift)
var/old_dir = AM.dir var/old_dir = AM.dir
var/old_loc = AM.loc var/old_loc = AM.loc
AM.inertia_moving = TRUE AM.inertia_moving = TRUE
AM.set_glide_size(DELAY_TO_GLIDE_SIZE(AM.inertia_move_delay)) AM.set_glide_size(DELAY_TO_GLIDE_SIZE(AM.inertia_move_delay), FALSE)
step(AM, AM.inertia_dir) step(AM, AM.inertia_dir)
AM.inertia_moving = FALSE AM.inertia_moving = FALSE
AM.inertia_next_move = world.time + AM.inertia_move_delay AM.inertia_next_move = world.time + AM.inertia_move_delay

View File

@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(time_track) SUBSYSTEM_DEF(time_track)
name = "Time Tracking" name = "Time Tracking"
wait = 100 wait = 10
flags = SS_NO_TICK_CHECK flags = SS_NO_TICK_CHECK
init_order = INIT_ORDER_TIMETRACK init_order = INIT_ORDER_TIMETRACK
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
@@ -51,6 +51,10 @@ SUBSYSTEM_DEF(time_track)
var/current_realtime = REALTIMEOFDAY var/current_realtime = REALTIMEOFDAY
var/current_byondtime = world.time var/current_byondtime = world.time
var/current_tickcount = world.time/world.tick_lag var/current_tickcount = world.time/world.tick_lag
GLOB.glide_size_multiplier = (current_byondtime - last_tick_byond_time) / (current_realtime - last_tick_realtime)
if(times_fired % 10) // everything else is once every 10 seconds
return
if (!first_run) if (!first_run)
var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag)) var/tick_drift = max(0, (((current_realtime - last_tick_realtime) - (current_byondtime - last_tick_byond_time)) / world.tick_lag))
@@ -60,7 +64,6 @@ SUBSYSTEM_DEF(time_track)
time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current) time_dilation_avg_fast = MC_AVERAGE_FAST(time_dilation_avg_fast, time_dilation_current)
time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast) time_dilation_avg = MC_AVERAGE(time_dilation_avg, time_dilation_avg_fast)
time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg) time_dilation_avg_slow = MC_AVERAGE_SLOW(time_dilation_avg_slow, time_dilation_avg)
GLOB.glide_size_multiplier = (current_byondtime - last_tick_byond_time) / (current_realtime - last_tick_realtime)
else else
first_run = FALSE first_run = FALSE
last_tick_realtime = current_realtime last_tick_realtime = current_realtime

View File

@@ -58,7 +58,7 @@
var/atom/movable/AM = parent var/atom/movable/AM = parent
if (isnull(dir)) if (isnull(dir))
dir = AM.dir dir = AM.dir
AM.set_glide_size(DELAY_TO_GLIDE_SIZE(vehicle_move_delay)) AM.set_glide_size(DELAY_TO_GLIDE_SIZE(vehicle_move_delay), FALSE)
for(var/i in AM.buckled_mobs) for(var/i in AM.buckled_mobs)
ride_check(i) ride_check(i)
handle_vehicle_offsets(dir) handle_vehicle_offsets(dir)

View File

@@ -4,7 +4,7 @@
/datum/proc/can_vv_get(var_name) /datum/proc/can_vv_get(var_name)
return TRUE return TRUE
/datum/proc/vv_edit_var(var_name, var_value) //called whenever a var is edited /datum/proc/vv_edit_var(var_name, var_value, massedit) //called whenever a var is edited
if(var_name == NAMEOF(src, vars)) if(var_name == NAMEOF(src, vars))
return FALSE return FALSE
vars[var_name] = var_value vars[var_name] = var_value

View File

@@ -149,7 +149,7 @@
return FALSE return FALSE
return T.zPassOut(src, direction, destination) && destination.zPassIn(src, direction, T) return T.zPassOut(src, direction, destination) && destination.zPassIn(src, direction, T)
/atom/movable/vv_edit_var(var_name, var_value) /atom/movable/vv_edit_var(var_name, var_value, massedit)
var/static/list/banned_edits = list("step_x" = TRUE, "step_y" = TRUE, "step_size" = TRUE, "bounds" = TRUE) var/static/list/banned_edits = list("step_x" = TRUE, "step_y" = TRUE, "step_size" = TRUE, "bounds" = TRUE)
var/static/list/careful_edits = list("bound_x" = TRUE, "bound_y" = TRUE, "bound_width" = TRUE, "bound_height" = TRUE) var/static/list/careful_edits = list("bound_x" = TRUE, "bound_y" = TRUE, "bound_width" = TRUE, "bound_height" = TRUE)
if(banned_edits[var_name]) if(banned_edits[var_name])
@@ -161,24 +161,24 @@
if(NAMEOF(src, x)) if(NAMEOF(src, x))
var/turf/T = locate(var_value, y, z) var/turf/T = locate(var_value, y, z)
if(T) if(T)
forceMove(T) admin_teleport(T, !massedit)
return TRUE return TRUE
return FALSE return FALSE
if(NAMEOF(src, y)) if(NAMEOF(src, y))
var/turf/T = locate(x, var_value, z) var/turf/T = locate(x, var_value, z)
if(T) if(T)
forceMove(T) admin_teleport(T, !massedit)
return TRUE return TRUE
return FALSE return FALSE
if(NAMEOF(src, z)) if(NAMEOF(src, z))
var/turf/T = locate(x, y, var_value) var/turf/T = locate(x, y, var_value)
if(T) if(T)
forceMove(T) admin_teleport(T, !massedit)
return TRUE return TRUE
return FALSE return FALSE
if(NAMEOF(src, loc)) if(NAMEOF(src, loc))
if(isatom(var_value) || isnull(var_value)) if(isatom(var_value) || isnull(var_value))
forceMove(var_value) admin_teleport(var_value, !massedit)
return TRUE return TRUE
return FALSE return FALSE
if(NAMEOF(src, anchored)) if(NAMEOF(src, anchored))
@@ -270,6 +270,19 @@
pulling.Move(get_step(pulling.loc, move_dir), move_dir, glide_size) pulling.Move(get_step(pulling.loc, move_dir), move_dir, glide_size)
return TRUE return TRUE
/**
* Recursively set glide size for atom's pulled things
*/
/atom/movable/proc/recursive_pulled_glidesize_update()
var/list/ran = list()
var/atom/movable/updating = pulling
while(updating)
if(ran[updating])
return
updating.set_glide_size(glide_size, FALSE)
ran[updating] = TRUE
updating = updating.pulling
/atom/movable/proc/check_pulling() /atom/movable/proc/check_pulling()
if(pulling) if(pulling)
var/atom/movable/pullee = pulling var/atom/movable/pullee = pulling
@@ -289,15 +302,19 @@
if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1) //separated from our puller and not in the middle of a diagonal move. if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1) //separated from our puller and not in the middle of a diagonal move.
pulledby.stop_pulling() pulledby.stop_pulling()
/atom/movable/proc/set_glide_size(target = 8, recursive = TRUE)
/atom/movable/proc/set_glide_size(target = 8)
// SEND_SIGNAL(src, COMSIG_MOVABLE_UPDATE_GLIDE_SIZE, target) // SEND_SIGNAL(src, COMSIG_MOVABLE_UPDATE_GLIDE_SIZE, target)
glide_size = target glide_size = target
if(ismob(src) && src:client)
to_chat(world, "DEBUG: [src] ([REF(src)]) setting glide size to [target]")
for(var/m in buckled_mobs) for(var/m in buckled_mobs)
var/mob/buckled_mob = m var/mob/buckled_mob = m
buckled_mob.set_glide_size(target) buckled_mob.set_glide_size(target)
if(recursive)
recursive_pulled_glidesize_update()
///Sets the anchored var and returns if it was sucessfully changed or not. ///Sets the anchored var and returns if it was sucessfully changed or not.
/atom/movable/proc/set_anchored(anchorvalue) /atom/movable/proc/set_anchored(anchorvalue)
SHOULD_CALL_PARENT(TRUE) SHOULD_CALL_PARENT(TRUE)

View File

@@ -61,7 +61,7 @@
var/atom/oldloc = loc var/atom/oldloc = loc
//Early override for some cases like diagonal movement //Early override for some cases like diagonal movement
if(glide_size_override) if(glide_size_override)
set_glide_size(glide_size_override) set_glide_size(glide_size_override, FALSE)
if(loc != newloc) if(loc != newloc)
if (!(direct & (direct - 1))) //Cardinal move if (!(direct & (direct - 1))) //Cardinal move
@@ -142,7 +142,7 @@
//glide_size strangely enough can change mid movement animation and update correctly while the animation is playing //glide_size strangely enough can change mid movement animation and update correctly while the animation is playing
//This means that if you don't override it late like this, it will just be set back by the movement update that's called when you move turfs. //This means that if you don't override it late like this, it will just be set back by the movement update that's called when you move turfs.
if(glide_size_override) if(glide_size_override)
set_glide_size(glide_size_override) set_glide_size(glide_size_override, FALSE)
last_move = direct last_move = direct
setDir(direct) setDir(direct)

View File

@@ -782,7 +782,7 @@ GLOBAL_DATUM_INIT(sdql2_vv_statobj, /obj/effect/statclick/SDQL2_VV_all, new(null
if(temp.vars.Find(v)) if(temp.vars.Find(v))
temp.vars[v] = SDQL_expression(d, set_list[sets]) temp.vars[v] = SDQL_expression(d, set_list[sets])
else else
temp.vv_edit_var(v, SDQL_expression(d, set_list[sets])) temp.vv_edit_var(v, SDQL_expression(d, set_list[sets]), TRUE)
break break
if(temp.vars.Find(v) && (istype(temp.vars[v], /datum) || istype(temp.vars[v], /client))) if(temp.vars.Find(v) && (istype(temp.vars[v], /datum) || istype(temp.vars[v], /client)))
temp = temp.vars[v] temp = temp.vars[v]

View File

@@ -158,3 +158,19 @@
else else
to_chat(src, "Failed to move mob to a valid location.", confidential = TRUE) to_chat(src, "Failed to move mob to a valid location.", confidential = TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Send Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! SSblackbox.record_feedback("tally", "admin_verb", 1, "Send Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/// Proc to hook user-enacted teleporting behavior and keep logging of the event.
/atom/movable/proc/admin_teleport(atom/new_location, message = TRUE)
if(isnull(new_location))
log_admin("[key_name(usr)] teleported [key_name(src)] to nullspace")
moveToNullspace()
else
log_admin("[key_name(usr)] teleported [key_name(src)] to [AREACOORD(loc)]")
forceMove(new_location)
/mob/admin_teleport(atom/new_location, message = TRUE)
var/msg = "[key_name_admin(usr)] teleported [ADMIN_LOOKUPFLW(src)] to [isnull(new_location) ? "nullspace" : ADMIN_VERBOSEJMP(loc)]"
if(message)
message_admins(msg)
admin_ticket_log(src, msg)
return ..()

View File

@@ -104,7 +104,7 @@
if (!thing) if (!thing)
continue continue
var/datum/D = thing var/datum/D = thing
if (D.vv_edit_var(variable, initial(D.vars[variable])) != FALSE) if (D.vv_edit_var(variable, initial(D.vars[variable]), TRUE) != FALSE)
accepted++ accepted++
else else
rejected++ rejected++
@@ -135,7 +135,7 @@
for(var/V in varsvars) for(var/V in varsvars)
new_value = replacetext(new_value,"\[[V]]","[D.vars[V]]") new_value = replacetext(new_value,"\[[V]]","[D.vars[V]]")
if (D.vv_edit_var(variable, new_value) != FALSE) if (D.vv_edit_var(variable, new_value, TRUE) != FALSE)
accepted++ accepted++
else else
rejected++ rejected++
@@ -161,7 +161,7 @@
if(many && !new_value) if(many && !new_value)
new_value = new type() new_value = new type()
if (D.vv_edit_var(variable, new_value) != FALSE) if (D.vv_edit_var(variable, new_value, TRUE) != FALSE)
accepted++ accepted++
else else
rejected++ rejected++
@@ -176,7 +176,7 @@
if (!thing) if (!thing)
continue continue
var/datum/D = thing var/datum/D = thing
if (D.vv_edit_var(variable, new_value) != FALSE) if (D.vv_edit_var(variable, new_value, TRUE) != FALSE)
accepted++ accepted++
else else
rejected++ rejected++

View File

@@ -9,11 +9,6 @@
return return
return considering return considering
/mob/living/carbon/human/movement_delay()
. = ..()
if (m_intent == MOVE_INTENT_WALK && HAS_TRAIT(src, TRAIT_SPEEDY_STEP))
. -= 1.5
/mob/living/carbon/human/slip(knockdown_amount, obj/O, lube) /mob/living/carbon/human/slip(knockdown_amount, obj/O, lube)
if(HAS_TRAIT(src, TRAIT_NOSLIPALL)) if(HAS_TRAIT(src, TRAIT_NOSLIPALL))
return 0 return 0

View File

@@ -16,6 +16,9 @@
attack_hand_unwieldlyness = CLICK_CD_MELEE attack_hand_unwieldlyness = CLICK_CD_MELEE
attack_hand_speed = 0 attack_hand_speed = 0
/// Was our last move diagonal
var/last_move_diagonal = FALSE
/// What receives our keyboard input. src by default. /// What receives our keyboard input. src by default.
var/datum/focus var/datum/focus

View File

@@ -73,7 +73,7 @@
return FALSE return FALSE
//We are now going to move //We are now going to move
var/add_delay = mob.movement_delay() var/add_delay = mob.movement_delay()
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay * ( (NSCOMPONENT(direction) && EWCOMPONENT(direction)) ? 2 : 1 ) )) // set it now in case of pulled objects mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay * ( (NSCOMPONENT(direction) && EWCOMPONENT(direction)) ? 2 : 1 ) ), FALSE) // set it now in case of pulled objects
if(old_move_delay + (add_delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time) if(old_move_delay + (add_delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
move_delay = old_move_delay move_delay = old_move_delay
else else
@@ -96,7 +96,10 @@
if((direction & (direction - 1)) && mob.loc == n) //moved diagonally successfully if((direction & (direction - 1)) && mob.loc == n) //moved diagonally successfully
add_delay *= 2 add_delay *= 2
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay)) mob.last_move_diagonal = TRUE
else
mob.last_move_diagonal = FALSE
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay), FALSE)
move_delay += add_delay move_delay += add_delay
if(.) // If mob is null here, we deserve the runtime if(.) // If mob is null here, we deserve the runtime
if(mob.throwing) if(mob.throwing)

View File

@@ -62,6 +62,11 @@
var/mod = CONFIG_GET(number/movedelay/walk_delay) var/mod = CONFIG_GET(number/movedelay/walk_delay)
multiplicative_slowdown = isnum(mod)? mod : initial(multiplicative_slowdown) multiplicative_slowdown = isnum(mod)? mod : initial(multiplicative_slowdown)
/datum/movespeed_modifier/config_wak_run/walk/apply_multiplicative(existing, mob/target)
. = ..()
if(HAS_TRAIT(target, TRAIT_SPEEDY_STEP))
. -= 1.25
/datum/movespeed_modifier/config_walk_run/run/sync() /datum/movespeed_modifier/config_walk_run/run/sync()
var/mod = CONFIG_GET(number/movedelay/run_delay) var/mod = CONFIG_GET(number/movedelay/run_delay)
multiplicative_slowdown = isnum(mod)? mod : initial(multiplicative_slowdown) multiplicative_slowdown = isnum(mod)? mod : initial(multiplicative_slowdown)