mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Merge pull request #7875 from VOREStation/upstream-merge-7082
[MIRROR] Refactor move/click code and cooldowns
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
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()
|
||||
/obj/structure/door_assembly/New()
|
||||
update_state()
|
||||
|
||||
/obj/structure/door_assembly/door_assembly_com
|
||||
@@ -136,7 +136,7 @@
|
||||
airlock_type = "/multi_tile/glass"
|
||||
glass = -1 //To prevent bugs in deconstruction process.
|
||||
|
||||
New()
|
||||
/obj/structure/door_assembly/multi_tile/New()
|
||||
if(dir in list(EAST, WEST))
|
||||
bound_width = width * world.icon_size
|
||||
bound_height = world.icon_size
|
||||
@@ -145,7 +145,7 @@
|
||||
bound_height = width * world.icon_size
|
||||
update_state()
|
||||
|
||||
Moved(atom/old_loc, direction, forced = FALSE)
|
||||
/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
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
w_class = ITEMSIZE_HUGE
|
||||
var/obj/item/target/pinned_target // the current pinned target
|
||||
|
||||
Moved(atom/old_loc, direction, forced = FALSE)
|
||||
/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))
|
||||
@@ -18,7 +18,7 @@
|
||||
pinned_target = null
|
||||
density = 1
|
||||
|
||||
attackby(obj/item/W as obj, mob/user as mob)
|
||||
/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!
|
||||
@@ -33,7 +33,7 @@
|
||||
to_chat(user, "You slide the target into the stake.")
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
/obj/structure/target_stake/attack_hand(mob/user as mob)
|
||||
// taking pinned targets off!
|
||||
if(pinned_target)
|
||||
density = 1
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
. = ..()
|
||||
|
||||
@@ -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
|
||||
//-------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user