mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
makes facing cardinal angles a helper, removes some beam rifle shitcode (#39162)
* Update beam_rifle.dm * angle2dir_cardinal * Ya learn something new every day * Precision!
This commit is contained in:
committed by
yogstation13-bot
parent
d0b7bec244
commit
8b0d971f7b
@@ -143,6 +143,17 @@
|
||||
if(337.5 to 360)
|
||||
return NORTH
|
||||
|
||||
/proc/angle2dir_cardinal(angle)
|
||||
switch(round(angle, 0.1))
|
||||
if(315.5 to 360, 0 to 45.5)
|
||||
return NORTH
|
||||
if(45.6 to 135.5)
|
||||
return EAST
|
||||
if(135.6 to 225.5)
|
||||
return SOUTH
|
||||
if(225.6 to 315.5)
|
||||
return WEST
|
||||
|
||||
//returns the north-zero clockwise angle in degrees, given a direction
|
||||
/proc/dir2angle(D)
|
||||
switch(D)
|
||||
|
||||
@@ -247,17 +247,7 @@
|
||||
/obj/item/gun/energy/beam_rifle/proc/process_aim()
|
||||
if(istype(current_user) && current_user.client && current_user.client.mouseParams)
|
||||
var/angle = mouse_angle_from_client(current_user.client)
|
||||
switch(angle)
|
||||
if(316 to 360)
|
||||
current_user.setDir(NORTH)
|
||||
if(0 to 45)
|
||||
current_user.setDir(NORTH)
|
||||
if(46 to 135)
|
||||
current_user.setDir(EAST)
|
||||
if(136 to 225)
|
||||
current_user.setDir(SOUTH)
|
||||
if(226 to 315)
|
||||
current_user.setDir(WEST)
|
||||
current_user.setDir(angle2dir_cardinal(angle))
|
||||
var/difference = abs(closer_angle_difference(lastangle, angle))
|
||||
delay_penalty(difference * aiming_time_increase_angle_multiplier)
|
||||
lastangle = angle
|
||||
|
||||
Reference in New Issue
Block a user