mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Merge pull request #2178 from tigercat2000/heart-tg-
Pixel-coords laserpointer
This commit is contained in:
@@ -66,9 +66,9 @@
|
||||
/obj/item/device/laser_pointer/afterattack(var/atom/target, var/mob/living/user, flag, params)
|
||||
if(flag) //we're placing the object on a table or in backpack
|
||||
return
|
||||
laser_act(target, user)
|
||||
laser_act(target, user, params)
|
||||
|
||||
/obj/item/device/laser_pointer/proc/laser_act(var/atom/target, var/mob/living/user)
|
||||
/obj/item/device/laser_pointer/proc/laser_act(var/atom/target, var/mob/living/user, var/params)
|
||||
if( !(user in (viewers(7,target))) )
|
||||
return
|
||||
if (!diode)
|
||||
@@ -173,12 +173,19 @@
|
||||
//laser pointer image
|
||||
icon_state = "pointer_[pointer_icon_state]"
|
||||
var/list/showto = list()
|
||||
for(var/mob/M in range(7,targloc))
|
||||
for(var/mob/M in viewers(7,targloc))
|
||||
if(M.client)
|
||||
showto.Add(M.client)
|
||||
var/image/I = image('icons/obj/projectiles.dmi',targloc,pointer_icon_state,10)
|
||||
I.pixel_x = target.pixel_x + rand(-5,5)
|
||||
I.pixel_y = target.pixel_y + rand(-5,5)
|
||||
var/list/click_params = params2list(params)
|
||||
if(click_params)
|
||||
if(click_params["icon-x"])
|
||||
I.pixel_x = (text2num(click_params["icon-x"]) - 16)
|
||||
if(click_params["icon-y"])
|
||||
I.pixel_y = (text2num(click_params["icon-y"]) - 16)
|
||||
else
|
||||
I.pixel_x = target.pixel_x + rand(-5,5)
|
||||
I.pixel_y = target.pixel_y + rand(-5,5)
|
||||
|
||||
if(outmsg)
|
||||
user << outmsg
|
||||
|
||||
Reference in New Issue
Block a user