mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 20:47:43 +01:00
Merge pull request #7534 from VOREStation/aro-moverework
Rewrite client/Move() for smoother movement ingame
This commit is contained in:
@@ -1398,7 +1398,7 @@
|
||||
set desc = "Pop a joint back into place. Extremely painful."
|
||||
set src in view(1)
|
||||
|
||||
if(!isliving(usr) || !usr.canClick())
|
||||
if(!isliving(usr) || !usr.checkClickCooldown())
|
||||
return
|
||||
|
||||
usr.setClickCooldown(20)
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
set src in view(1)
|
||||
|
||||
//do_reagent_implant(usr)
|
||||
if(!isliving(usr) || !usr.canClick())
|
||||
if(!isliving(usr) || !usr.checkClickCooldown())
|
||||
return
|
||||
|
||||
if(usr.incapacitated() || usr.stat > CONSCIOUS)
|
||||
|
||||
@@ -127,39 +127,27 @@
|
||||
onclose(user, "mob[name]")
|
||||
return
|
||||
|
||||
/mob/living/ret_grab(obj/effect/list_container/mobl/L as obj, flag)
|
||||
if ((!( istype(l_hand, /obj/item/weapon/grab) ) && !( istype(r_hand, /obj/item/weapon/grab) )))
|
||||
if (!( L ))
|
||||
return null
|
||||
else
|
||||
return L.container
|
||||
else
|
||||
if (!( L ))
|
||||
L = new /obj/effect/list_container/mobl( null )
|
||||
L.container += src
|
||||
L.master = src
|
||||
if (istype(l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = l_hand
|
||||
if (!( L.container.Find(G.affecting) ))
|
||||
L.container += G.affecting
|
||||
if (G.affecting)
|
||||
G.affecting.ret_grab(L, 1)
|
||||
if (istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = r_hand
|
||||
if (!( L.container.Find(G.affecting) ))
|
||||
L.container += G.affecting
|
||||
if (G.affecting)
|
||||
G.affecting.ret_grab(L, 1)
|
||||
if (!( flag ))
|
||||
if (L.master == src)
|
||||
var/list/temp = list( )
|
||||
temp += L.container
|
||||
//L = null
|
||||
qdel(L)
|
||||
return temp
|
||||
else
|
||||
return L.container
|
||||
return
|
||||
/mob/living/ret_grab(var/list/L, var/mobchain_limit = 5)
|
||||
// We're the first!
|
||||
if(!L)
|
||||
L = list()
|
||||
|
||||
// Lefty grab!
|
||||
if (istype(l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = l_hand
|
||||
L |= G.affecting
|
||||
if(mobchain_limit-- > 0)
|
||||
G.affecting?.ret_grab(L, mobchain_limit) // Recurse! They can update the list. It's the same instance as ours.
|
||||
|
||||
// Righty grab!
|
||||
if (istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = r_hand
|
||||
L |= G.affecting
|
||||
if(mobchain_limit-- > 0)
|
||||
G.affecting?.ret_grab(L, mobchain_limit) // Same as lefty!
|
||||
|
||||
// On all but the one not called by us, this will just be ignored. Oh well!
|
||||
return L
|
||||
|
||||
/mob/living/mode()
|
||||
set name = "Activate Held Object"
|
||||
|
||||
@@ -895,7 +895,7 @@ default behaviour is:
|
||||
set name = "Resist"
|
||||
set category = "IC"
|
||||
|
||||
if(!incapacitated(INCAPACITATION_KNOCKOUT) && canClick())
|
||||
if(!incapacitated(INCAPACITATION_KNOCKOUT) && checkClickCooldown())
|
||||
setClickCooldown(20)
|
||||
resist_grab()
|
||||
if(!weakened)
|
||||
@@ -1299,9 +1299,7 @@ default behaviour is:
|
||||
//actually throw it!
|
||||
src.visible_message("<span class='warning'>[src] has thrown [item].</span>")
|
||||
|
||||
if(!src.lastarea)
|
||||
src.lastarea = get_area(src.loc)
|
||||
if((istype(src.loc, /turf/space)) || (src.lastarea.has_gravity == 0))
|
||||
if((istype(src.loc, /turf/space)) || (src.lastarea?.has_gravity == 0))
|
||||
src.inertia_dir = get_dir(target, src)
|
||||
step(src, inertia_dir)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//No longer in use, as mice create a holder/micro object instead
|
||||
/obj/item/weapon/holder/mouse/attack_self(var/mob/U)
|
||||
for(var/mob/living/simple_mob/M in src.contents)
|
||||
if((I_HELP) && U.canClick()) //a little snowflakey, but makes it use the same cooldown as interacting with non-inventory objects
|
||||
if((I_HELP) && U.checkClickCooldown()) //a little snowflakey, but makes it use the same cooldown as interacting with non-inventory objects
|
||||
U.setClickCooldown(U.get_attack_speed()) //if there's a cleaner way in baycode, I'll change this
|
||||
U.visible_message("<span class='notice'>[U] [M.response_help] \the [M].</span>")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user