mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Things that used to check if you were walking now check your movement speed instead (#30018)
* help me * slightly less horrible code * removed slipping test
This commit is contained in:
@@ -534,7 +534,7 @@
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/CheckSlip(slip_on_walking = FALSE, overlay_type = TURF_WET_WATER, slip_on_magbooties = FALSE)
|
||||
var/walking_factor = (!slip_on_walking && m_intent == M_INTENT_WALK)
|
||||
var/walking_factor = (!slip_on_walking && glide_size <= GLIDE_SIZE_OF_A_WALKING_HUMAN)
|
||||
return (on_foot()) && !locked_to && !lying && !unslippable && !walking_factor
|
||||
|
||||
/mob/living/carbon/teleport_to(var/atom/A)
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "lazy_events.dm"
|
||||
#include "names.dm"
|
||||
#include "reagent_recipe_collisions.dm"
|
||||
#include "slipping.dm"
|
||||
#include "turretid.dm"
|
||||
#include "outfit_datums.dm"
|
||||
#include "ray.dm"
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
#define RESULT_RUN 1
|
||||
#define RESULT_WALK 2
|
||||
#define RESULT_NOSLIP 3
|
||||
#define RESULT_MAGBOOTS 4
|
||||
|
||||
#define TURF_WET_WATER_STR "1" // Byond doesn't like integers in assoc list :-(
|
||||
#define TURF_WET_LUBE_STR "2"
|
||||
|
||||
/datum/unit_test/slipping
|
||||
|
||||
|
||||
/*
|
||||
We spawn an item, make an human run on it, and check if he slipped or not
|
||||
The list is of the form :
|
||||
item_to_spawn = list(RESULT_RUN, RESULT_WALK, RESULT_NOSLIP, RESULT_MAGBOOTS)
|
||||
*/
|
||||
|
||||
var/list/items_and_result_humans = list(
|
||||
/obj/item/weapon/reagent_containers/food/snacks/butter = list(TRUE, FALSE, FALSE, FALSE),
|
||||
/obj/item/weapon/bananapeel/ = list(TRUE, TRUE, FALSE, FALSE),
|
||||
/obj/item/weapon/soap/ = list(TRUE, TRUE, FALSE, FALSE),
|
||||
/obj/item/device/pda/clown = list(TRUE, TRUE, FALSE, FALSE),
|
||||
)
|
||||
|
||||
/* overlay_to_spawn = list(RESULT_RUN, RESULT_WALK, RESULT_NOSLIP, RESULT_MAGBOOTS) */
|
||||
|
||||
var/list/overlays_and_results = list(
|
||||
TURF_WET_WATER_STR = list(TRUE, FALSE, FALSE, FALSE),
|
||||
TURF_WET_LUBE_STR = list(TRUE, TRUE, TRUE, TRUE),
|
||||
)
|
||||
|
||||
/datum/unit_test/slipping/start()
|
||||
// Items
|
||||
|
||||
var/turf/centre = locate(100, 100, 1) // Nice place with a good atmosphere and shit
|
||||
var/turf/simulated/T_test = locate(centre.x, centre.y + 1, centre.z)
|
||||
for (var/type in items_and_result_humans)
|
||||
for (var/i = 1 to 4)
|
||||
var/mob/living/carbon/human/H = new(centre)
|
||||
sleep(1) // Poor human needs to handle his birth (and the spawn() involved). Be patien
|
||||
var/obj/O = new type(T_test)
|
||||
switch (i)
|
||||
if (RESULT_RUN)
|
||||
// Nothing
|
||||
if (RESULT_WALK)
|
||||
H.m_intent = "walk"
|
||||
if (RESULT_NOSLIP)
|
||||
var/obj/item/clothing/shoes/syndigaloshes/S = new
|
||||
H.equip_or_collect(S, slot_shoes)
|
||||
if (RESULT_MAGBOOTS)
|
||||
var/obj/item/clothing/shoes/magboots/M = new
|
||||
H.equip_or_collect(M, slot_shoes)
|
||||
M.togglemagpulse(H)
|
||||
H.Move(T_test, NORTH)
|
||||
if (H.isStunned() != items_and_result_humans[type][i])
|
||||
fail("Slipping test failed at [type], step [i] ; expected [items_and_result_humans[type][i]], got [H.isStunned()]")
|
||||
qdel(H)
|
||||
qdel(O)
|
||||
// Overlays
|
||||
for (var/wetness in overlays_and_results)
|
||||
for (var/j = 1 to 4)
|
||||
var/mob/living/carbon/human/H = new(centre)
|
||||
sleep(1) // Poor human needs to handle his birth (and the spawn() involved). Be patient
|
||||
var/wet_fac = text2num(wetness)
|
||||
T_test.wet(10 SECONDS, wet_fac)
|
||||
switch (j)
|
||||
if (RESULT_RUN)
|
||||
// Nothing
|
||||
if (RESULT_WALK)
|
||||
H.m_intent = "walk"
|
||||
if (RESULT_NOSLIP)
|
||||
var/obj/item/clothing/shoes/syndigaloshes/S = new
|
||||
H.equip_or_collect(S, slot_shoes)
|
||||
if (RESULT_MAGBOOTS)
|
||||
var/obj/item/clothing/shoes/magboots/M = new
|
||||
H.equip_or_collect(M, slot_shoes)
|
||||
M.togglemagpulse(H)
|
||||
H.Move(T_test, NORTH)
|
||||
if (H.isStunned() != overlays_and_results[wetness][j])
|
||||
fail("Slipping test failed at [wetness], step [j] ; expected [overlays_and_results[wetness][j]], got [H.isStunned()]")
|
||||
qdel(H)
|
||||
T_test.dry(TURF_WET_LUBE)
|
||||
Reference in New Issue
Block a user