mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-21 12:56:53 +01:00
50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
/mob/verb/toggle_gun_mode()
|
|
set name = "Toggle Gun Mode"
|
|
set desc = "Begin or stop aiming."
|
|
set category = VERB_CATEGORY_IC
|
|
|
|
if(isliving(src))
|
|
var/mob/living/M = src
|
|
if(!M.aiming)
|
|
M.aiming = new(src)
|
|
M.aiming.toggle_active()
|
|
else
|
|
to_chat(src, "<span class='warning'>This verb may only be used by living mobs, sorry.</span>")
|
|
return
|
|
|
|
/mob/living/proc/stop_aiming(obj/item/thing, no_message = FALSE)
|
|
if(!aiming)
|
|
return
|
|
if(thing && aiming.aiming_with != thing)
|
|
return
|
|
aiming.cancel_aiming(no_message)
|
|
|
|
/mob/living/death(gibbed,deathmessage="seizes up and falls limp...")
|
|
if(..())
|
|
stop_aiming(no_message=1)
|
|
|
|
/mob/living/update_mobility(blocked, forced)
|
|
. = ..()
|
|
if(lying)
|
|
stop_aiming(no_message=1)
|
|
|
|
/mob/living/afflict_paralyze(amount)
|
|
stop_aiming(no_message=1)
|
|
..()
|
|
|
|
/turf/Enter(atom/movable/mover, atom/oldloc)
|
|
. = ..()
|
|
if(isliving(mover))
|
|
var/mob/living/mover_living = mover
|
|
if(mover_living.aiming && mover_living.aiming.aiming_at)
|
|
mover_living.aiming.update_aiming()
|
|
if(mover_living.aimed.len)
|
|
mover_living.trigger_aiming(TARGET_CAN_MOVE)
|
|
|
|
/mob/living/forceMove(atom/destination)
|
|
. = ..()
|
|
if(aiming && aiming.aiming_at)
|
|
aiming.update_aiming()
|
|
if(aimed.len)
|
|
trigger_aiming(TARGET_CAN_MOVE)
|