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:
DamianX
2021-08-25 03:05:33 +02:00
committed by GitHub
parent 25705ebd70
commit a414400f19
6 changed files with 6 additions and 87 deletions

View File

@@ -56,4 +56,6 @@
#define manhattan_distance(a, b) (abs(a.x - b.x) + abs(a.y - b.y))
#define IS_INT(x) (x == round(x))
#define IS_INT(x) (x == round(x))
#define GLIDE_SIZE_OF_A_WALKING_HUMAN 2.4615386

View File

@@ -857,7 +857,7 @@
if(armed)
if(istype(AM, /mob/living/carbon) && !istype(AM, /mob/living/carbon/brain))
var/mob/living/carbon/C = AM
if(C.m_intent != "walk")
if(C.glide_size > GLIDE_SIZE_OF_A_WALKING_HUMAN)
src.visible_message("The [src.name] beeps, \"Running on wet floors is hazardous to your health.\"")
message_admins("[C] triggered the explosive wet floor sign at [loc] ([x], [y], [z]): <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>, last touched by [fingerprintslast].")
log_game("[C] triggered the explosive wet floor sign at [loc]([x], [y], [z]): <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>, last touched by [fingerprintslast].")

View File

@@ -121,7 +121,7 @@ var/list/obj/machinery/flasher/flashers = list()
if(istype(AM, /mob/living/carbon))
var/mob/living/carbon/M = AM
if ((M.m_intent != "walk") && (src.anchored))
if ((M.glide_size > GLIDE_SIZE_OF_A_WALKING_HUMAN) && (src.anchored))
src.flash()
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob)

View File

@@ -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)

View File

@@ -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"

View File

@@ -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)