mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 20:11:04 +01:00
Autofire now continues firing when you hold down on one tile. (#13403)
Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
var/adminobs = null
|
||||
var/area = null
|
||||
var/time_died_as_rat = 0
|
||||
var/list/autofire_aiming_at[2]
|
||||
|
||||
var/adminhelped = NOT_ADMINHELPED
|
||||
|
||||
|
||||
@@ -771,6 +771,9 @@ var/list/localhost_addresses = list(
|
||||
. = ..()
|
||||
|
||||
if(over_object)
|
||||
if(autofire_aiming_at[1])
|
||||
autofire_aiming_at[1] = over_object
|
||||
autofire_aiming_at[2] = params
|
||||
var/mob/living/M = mob
|
||||
if(istype(get_turf(over_object), /atom))
|
||||
var/atom/A = get_turf(over_object)
|
||||
@@ -780,15 +783,35 @@ var/list/localhost_addresses = list(
|
||||
|
||||
if(istype(M) && !M.incapacitated())
|
||||
var/obj/item/I = M.get_active_hand()
|
||||
if(istype(I, /obj/item/gun))
|
||||
var/obj/item/gun/gun = I
|
||||
if(gun.can_autofire())
|
||||
M.set_dir(get_dir(M, over_object))
|
||||
gun.Fire(get_turf(over_object), M, params, (get_dist(over_object, M) <= 1), FALSE)
|
||||
|
||||
if(istype(I, /obj/item/rfd/mining) && isturf(over_object))
|
||||
var/proximity = M.Adjacent(over_object)
|
||||
var/obj/item/rfd/mining/RFDM = I
|
||||
RFDM.afterattack(over_object, M, proximity, params, FALSE)
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
/client/MouseDown(object, location, control, params)
|
||||
var/obj/item/I = mob.get_active_hand()
|
||||
var/obj/O = object
|
||||
if(istype(I, /obj/item/gun))
|
||||
var/obj/item/gun/G = I
|
||||
if(G.can_autofire(object, location, params) && O.is_auto_clickable())
|
||||
autofire_aiming_at[1] = object
|
||||
autofire_aiming_at[2] = params
|
||||
while(autofire_aiming_at[1])
|
||||
G.Fire(autofire_aiming_at[1], mob, autofire_aiming_at[2], (get_dist(mob, location) <= 1), FALSE)
|
||||
mob.set_dir(get_dir(mob, autofire_aiming_at[1]))
|
||||
sleep(G.fire_delay)
|
||||
CHECK_TICK
|
||||
|
||||
/client/MouseUp(object, location, control, params)
|
||||
autofire_aiming_at[1] = null
|
||||
|
||||
/atom/proc/is_auto_clickable()
|
||||
return TRUE
|
||||
|
||||
/obj/screen/is_auto_clickable()
|
||||
return FALSE
|
||||
|
||||
/obj/screen/click_catcher/is_auto_clickable()
|
||||
return TRUE
|
||||
Reference in New Issue
Block a user