Merge pull request #7875 from VOREStation/upstream-merge-7082

[MIRROR] Refactor move/click code and cooldowns
This commit is contained in:
Aronai Sieyes
2020-05-15 20:57:31 -04:00
committed by GitHub
10 changed files with 66 additions and 64 deletions

View File

@@ -54,4 +54,4 @@
//---------------
//#define isturf(D) istype(D, /turf) //Built in
#define isopenspace(A) istype(A, /turf/simulated/open)
#define isspace(A) istype(A, /turf/space)
#define isspace(A) istype(A, /turf/space)

View File

@@ -21,7 +21,7 @@
var/icon_rotation = 0 // Used to rotate icons in update_transform()
var/old_x = 0
var/old_y = 0
var/datum/riding/riding_datum //VOREStation Add - Moved from /obj/vehicle
var/datum/riding/riding_datum = null
var/does_spin = TRUE // Does the atom spin when thrown (of course it does :P)
var/movement_type = NONE

View File

@@ -14,8 +14,8 @@
var/glass = 0 // 0 = glass can be installed. -1 = glass can't be installed. 1 = glass is already installed. Text = mineral plating is installed instead.
var/created_name = null
New()
update_state()
/obj/structure/door_assembly/New()
update_state()
/obj/structure/door_assembly/door_assembly_com
base_icon_state = "com"
@@ -136,23 +136,23 @@
airlock_type = "/multi_tile/glass"
glass = -1 //To prevent bugs in deconstruction process.
New()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
update_state()
/obj/structure/door_assembly/multi_tile/New()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
update_state()
Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
/obj/structure/door_assembly/multi_tile/Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
/obj/structure/door_assembly/proc/rename_door(mob/living/user)
var/t = sanitizeSafe(input(user, "Enter the name for the windoor.", src.name, src.created_name), MAX_NAME_LEN)

View File

@@ -8,45 +8,45 @@
w_class = ITEMSIZE_HUGE
var/obj/item/target/pinned_target // the current pinned target
Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
// Move the pinned target along with the stake
if(pinned_target in view(3, src))
pinned_target.forceMove(loc)
/obj/structure/target_stake/Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
// Move the pinned target along with the stake
if(pinned_target in view(3, src))
pinned_target.forceMove(loc)
else // Sanity check: if the pinned target can't be found in immediate view
pinned_target = null
density = 1
else // Sanity check: if the pinned target can't be found in immediate view
pinned_target = null
density = 1
attackby(obj/item/W as obj, mob/user as mob)
// Putting objects on the stake. Most importantly, targets
if(pinned_target)
return // get rid of that pinned target first!
/obj/structure/target_stake/attackby(obj/item/W as obj, mob/user as mob)
// Putting objects on the stake. Most importantly, targets
if(pinned_target)
return // get rid of that pinned target first!
if(istype(W, /obj/item/target))
density = 0
W.density = 1
user.remove_from_mob(W)
W.loc = loc
W.layer = ABOVE_JUNK_LAYER
pinned_target = W
to_chat(user, "You slide the target into the stake.")
return
if(istype(W, /obj/item/target))
density = 0
W.density = 1
user.remove_from_mob(W)
W.loc = loc
W.layer = ABOVE_JUNK_LAYER
pinned_target = W
to_chat(user, "You slide the target into the stake.")
return
attack_hand(mob/user as mob)
// taking pinned targets off!
if(pinned_target)
density = 1
pinned_target.density = 0
pinned_target.layer = OBJ_LAYER
/obj/structure/target_stake/attack_hand(mob/user as mob)
// taking pinned targets off!
if(pinned_target)
density = 1
pinned_target.density = 0
pinned_target.layer = OBJ_LAYER
pinned_target.loc = user.loc
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hands(pinned_target)
to_chat(user, "You take the target out of the stake.")
else
pinned_target.loc = get_turf(user)
pinned_target.loc = user.loc
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hands(pinned_target)
to_chat(user, "You take the target out of the stake.")
else
pinned_target.loc = get_turf(user)
to_chat(user, "You take the target out of the stake.")
pinned_target = null
pinned_target = null

View File

@@ -1658,7 +1658,7 @@
var/obj/item/organ/external/e = organs_by_name[name]
if(!e)
continue
if((e.status & ORGAN_BROKEN && (!e.splinted || (e.splinted && e.splinted in e.contents && prob(30))) || e.status & ORGAN_BLEEDING) && (getBruteLoss() + getFireLoss() >= 100))
if((e.status & ORGAN_BROKEN && (!e.splinted || (e.splinted in e.contents && prob(30))) || e.status & ORGAN_BLEEDING) && (getBruteLoss() + getFireLoss() >= 100))
return 1
else
return ..()

View File

@@ -785,6 +785,8 @@ default behaviour is:
to_chat(usr, "OOC Metadata is not supported by this server!")
//VOREStation Edit End - Making it so SSD people have prefs with fallback to original style.
return
// Almost all of this handles pulling movables behind us
/mob/living/Move(atom/newloc, direct, movetime)
if(buckled && buckled.loc != newloc) //not updating position
@@ -797,9 +799,8 @@ default behaviour is:
// Prior to our move it's already too far away
if(pullee && get_dist(src, pullee) > 1)
stop_pulling()
// Shenanigans!
// Shenanigans! Pullee closed into locker for eg.
if(pullee && !isturf(pullee.loc) && pullee.loc != loc)
log_debug("[src]'s pull on [pullee] was broken despite [pullee] being in [pullee.loc]. Pull stopped manually.")
stop_pulling()
// Can't pull with no hands
if(restrained())
@@ -1235,7 +1236,7 @@ default behaviour is:
//actually throw it!
src.visible_message("<span class='warning'>[src] has thrown [item].</span>")
if((istype(src.loc, /turf/space)) || (src.lastarea?.has_gravity == 0))
if((isspace(src.loc)) || (src.lastarea?.has_gravity == 0))
src.inertia_dir = get_dir(target, src)
step(src, inertia_dir)

View File

@@ -8,7 +8,10 @@
return !P.can_hit_target(src, P.permutated, src == P.original, TRUE)
return (!mover.density || !density || lying)
/mob/living/SelfMove(turf/n, direct)
/mob/CanZASPass(turf/T, is_zone)
return ATMOS_PASS_YES
/mob/living/SelfMove(turf/n, direct, movetime)
// If on walk intent, don't willingly step into hazardous tiles.
// Unless the walker is confused.
if(m_intent == "walk" && confused <= 0)

View File

@@ -25,7 +25,7 @@
. += ..()
// NEW: Use power while moving.
/mob/living/silicon/robot/SelfMove(turf/n, direct)
/mob/living/silicon/robot/SelfMove(turf/n, direct, movetime)
if (!is_component_functioning("actuator"))
return 0

View File

@@ -193,7 +193,7 @@
. = ..()
to_chat(src,"<b>You are \the [src].</b> [player_msg]")
/mob/living/simple_mob/SelfMove(turf/n, direct)
/mob/living/simple_mob/SelfMove(turf/n, direct, movetime)
var/turf/old_turf = get_turf(src)
var/old_dir = dir
. = ..()

View File

@@ -42,8 +42,6 @@
var/load_offset_y = 0 //pixel_y offset for item overlay
var/mob_offset_y = 0 //pixel_y offset for mob overlay
//var/datum/riding/riding_datum = null //VOREStation Edit - Moved to movables.
//-------------------------------------------
// Standard procs
//-------------------------------------------