mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 20:47:43 +01:00
Tilt code (#19641)
* Add variables for tilting * Add reset logic for pixel tilt * Add tilt logic * Add keybinds to skin * Add checks and a define to stop tilt from breaking * Simplified checks using incapacitated() proc * Removed hardcoded number * reset tilt before lie down transform * Use update_transform() --------- Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
b4bd74d09e
commit
707483128d
@@ -882,6 +882,8 @@
|
||||
|
||||
resting = !resting
|
||||
to_chat(src, span_notice("You are now [resting ? "resting" : "getting up"]."))
|
||||
allowtilttime = world.time + TILT_INCAPACITATED_WAITTIME
|
||||
how_tilted = 0
|
||||
update_canmove()
|
||||
|
||||
//called when the mob receives a bright flash
|
||||
@@ -1162,7 +1164,8 @@
|
||||
else
|
||||
unbuckle_mob(L)
|
||||
L.Stun(5)
|
||||
|
||||
if(!canmove)
|
||||
allowtilttime = world.time + TILT_INCAPACITATED_WAITTIME
|
||||
return canmove
|
||||
|
||||
// Mob holders in these slots will be spilled if the mob goes prone.
|
||||
|
||||
@@ -270,6 +270,8 @@ default behaviour is:
|
||||
pixel_y = default_pixel_y
|
||||
layer = initial(layer)
|
||||
plane = initial(plane)
|
||||
how_tilted = 0
|
||||
update_transform()
|
||||
|
||||
if(pulling) // we were pulling a thing and didn't lose it during our move.
|
||||
var/pull_dir = get_dir(src, pulling)
|
||||
|
||||
@@ -1189,6 +1189,28 @@
|
||||
pixel_x++
|
||||
is_shifted = TRUE
|
||||
|
||||
/mob/verb/tiltcounterclock()
|
||||
set hidden = TRUE
|
||||
if(world.time <= allowtilttime) //This is a sloppy "wait" fix to work around tilting durring the get-up animation
|
||||
return FALSE
|
||||
if(!canface() || incapacitated(INCAPACITATION_ALL))
|
||||
return FALSE
|
||||
if(how_tilted >= -maximum_tilt)
|
||||
transform = turn(transform, -5)
|
||||
how_tilted = how_tilted - 5
|
||||
is_shifted = TRUE
|
||||
|
||||
/mob/verb/tiltclock()
|
||||
set hidden = TRUE
|
||||
if(world.time <= allowtilttime) //This is a sloppy "wait" fix to work around tilting durring the get-up animation
|
||||
return FALSE
|
||||
if(!canface() || incapacitated(INCAPACITATION_ALL))
|
||||
return FALSE
|
||||
if(how_tilted <= maximum_tilt)
|
||||
transform = turn(transform, 5)
|
||||
how_tilted = how_tilted + 5
|
||||
is_shifted = TRUE
|
||||
|
||||
/mob/verb/planeup()
|
||||
set hidden = TRUE
|
||||
if(!canface())
|
||||
|
||||
@@ -117,8 +117,11 @@
|
||||
var/resting = 0 //Carbon
|
||||
var/lying = 0
|
||||
var/lying_prev = 0
|
||||
var/is_shifted = FALSE // VoreStation Edit; pixel shifting
|
||||
var/is_shifted = FALSE // VoreStation Edit; pixel shifting + tilting
|
||||
var/how_tilted = 0
|
||||
var/maximum_tilt = 45
|
||||
var/canmove = 1
|
||||
var/allowtilttime = 0 //This is the waiting timer for getting up after falling, lying, buckling, or otherwise being animated.
|
||||
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
|
||||
var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas.
|
||||
var/list/pinned = list() // List of things pinning this creature to walls (see living_defense.dm)
|
||||
@@ -273,6 +276,7 @@
|
||||
var/datum/click_intercept
|
||||
|
||||
var/datum/focus //What receives our keyboard inputs. src by default
|
||||
|
||||
/// dict of custom stat tabs with data
|
||||
var/list/list/misc_tabs = list()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user