Skip to content

Commit

Permalink
refactor: fastport tg beam datums (#6597) [testmerge][5618d17]
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Mar 1, 2025
1 parent 50abaad commit 2048265
Show file tree
Hide file tree
Showing 14 changed files with 284 additions and 183 deletions.
12 changes: 12 additions & 0 deletions code/__DEFINES/beam.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// Called before beam is redrawn
#define COMSIG_BEAM_BEFORE_DRAW "beam_before_draw"
#define BEAM_CANCEL_DRAW (1 << 0)

/// Sent to a beam when an atom enters any turf the beam covers: (obj/effect/ebeam/hit_beam, atom/movable/entered)
#define COMSIG_BEAM_ENTERED "beam_entered"

/// Sent to a beam when an atom exits any turf the beam covers: (obj/effect/ebeam/hit_beam, atom/movable/exited)
#define COMSIG_BEAM_EXITED "beam_exited"

/// Sent to a beam when any turf the beam covers changes: (list/datum/callback/post_change_callbacks)
#define COMSIG_BEAM_TURFS_CHANGED "beam_turfs_changed"
12 changes: 12 additions & 0 deletions code/__HELPERS/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,15 @@
return "centuple"
else //It gets too tedious to use latin prefixes from here.
return "[number]-tuple"

/// Angle between two arbitrary points and horizontal line same as [/proc/get_angle]
/proc/get_angle_raw(start_x, start_y, start_pixel_x, start_pixel_y, end_x, end_y, end_pixel_x, end_pixel_y)
var/dy = (32 * end_y + end_pixel_y) - (32 * start_y + start_pixel_y)
var/dx = (32 * end_x + end_pixel_x) - (32 * start_x + start_pixel_x)
if(!dy)
return (dx >= 0) ? 90 : 270
. = arctan(dx/dy)
if(dy < 0)
. += 180
else if(dx < 0)
. += 360
Loading

0 comments on commit 2048265

Please sign in to comment.