Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fastport tg beam datums #6597

Open
wants to merge 4 commits into
base: master220
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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