mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Replaces world.icon_size (and some magic numbers) with defines (#86819)
## About The Pull Request All usages of world.icon_size in code have been replaced with new `ICONSIZE_X`, `ICONSIZE_Y` and `ICONSIZE_ALL` defines depending on context Replaces some "32" magic numbers with the defines A few bits of code have been modified to split up x/y math as well ## Why It's Good For The Game Magic number bad, code more readable, code more flexible and I'm told there's an access cost to doing world.icon_size so minor performance gains ## Changelog 🆑 tonty code: made some code relating to the world's icon size more readable /🆑 --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
// Stuff that is relatively "core" and is used in other defines/helpers
|
||||
|
||||
/**
|
||||
* The game's world.icon_size. \
|
||||
* Ideally divisible by 16. \
|
||||
* Ideally a number, but it
|
||||
* can be a string ("32x32"), so more exotic coders
|
||||
* will be sad if you use this in math.
|
||||
*/
|
||||
#define ICON_SIZE_ALL 32
|
||||
/// The X/Width dimension of ICON_SIZE. This will more than likely be the bigger axis.
|
||||
#define ICON_SIZE_X 32
|
||||
/// The Y/Height dimension of ICON_SIZE. This will more than likely be the smaller axis.
|
||||
#define ICON_SIZE_Y 32
|
||||
|
||||
//Returns the hex value of a decimal number
|
||||
//len == length of returned string
|
||||
#define num2hex(X, len) num2text(X, len, 16)
|
||||
|
||||
@@ -330,4 +330,4 @@ GLOBAL_LIST_INIT(book_types, typecacheof(list(
|
||||
#define is_unassigned_job(job_type) (istype(job_type, /datum/job/unassigned))
|
||||
|
||||
#define isprojectilespell(thing) (istype(thing, /datum/action/cooldown/spell/pointed/projectile))
|
||||
#define is_multi_tile_object(atom) (atom.bound_width > world.icon_size || atom.bound_height > world.icon_size)
|
||||
#define is_multi_tile_object(atom) (atom.bound_width > ICON_SIZE_X || atom.bound_height > ICON_SIZE_Y)
|
||||
|
||||
+10
-10
@@ -188,21 +188,21 @@
|
||||
var/pixel_x = 0
|
||||
var/pixel_y = 0
|
||||
for(var/i in 1 to increments)
|
||||
pixel_x += sin(angle)+16*sin(angle)*2
|
||||
pixel_y += cos(angle)+16*cos(angle)*2
|
||||
pixel_x += sin(angle)+(ICON_SIZE_X/2)*sin(angle)*2
|
||||
pixel_y += cos(angle)+(ICON_SIZE_Y/2)*cos(angle)*2
|
||||
var/new_x = starting.x
|
||||
var/new_y = starting.y
|
||||
while(pixel_x > 16)
|
||||
pixel_x -= 32
|
||||
while(pixel_x > (ICON_SIZE_X/2))
|
||||
pixel_x -= ICON_SIZE_X
|
||||
new_x++
|
||||
while(pixel_x < -16)
|
||||
pixel_x += 32
|
||||
while(pixel_x < -(ICON_SIZE_X/2))
|
||||
pixel_x += ICON_SIZE_X
|
||||
new_x--
|
||||
while(pixel_y > 16)
|
||||
pixel_y -= 32
|
||||
while(pixel_y > (ICON_SIZE_Y/2))
|
||||
pixel_y -= ICON_SIZE_Y
|
||||
new_y++
|
||||
while(pixel_y < -16)
|
||||
pixel_y += 32
|
||||
while(pixel_y < -(ICON_SIZE_Y/2))
|
||||
pixel_y += ICON_SIZE_Y
|
||||
new_y--
|
||||
new_x = clamp(new_x, 1, world.maxx)
|
||||
new_y = clamp(new_y, 1, world.maxy)
|
||||
|
||||
@@ -2,21 +2,21 @@
|
||||
#define MIN_GLIDE_SIZE 1
|
||||
/// The maximum for glide_size to be clamped to.
|
||||
/// This shouldn't be higher than the icon size, and generally you shouldn't be changing this, but it's here just in case.
|
||||
#define MAX_GLIDE_SIZE 32
|
||||
#define MAX_GLIDE_SIZE ICON_SIZE_ALL
|
||||
|
||||
/// Compensating for time dilation
|
||||
GLOBAL_VAR_INIT(glide_size_multiplier, 1.0)
|
||||
|
||||
///Broken down, here's what this does:
|
||||
/// divides the world icon_size (32) by delay divided by ticklag to get the number of pixels something should be moving each tick.
|
||||
/// divides the world icon_size by delay divided by ticklag to get the number of pixels something should be moving each tick.
|
||||
/// The division result is given a min value of 1 to prevent obscenely slow glide sizes from being set
|
||||
/// Then that's multiplied by the global glide size multiplier. 1.25 by default feels pretty close to spot on. This is just to try to get byond to behave.
|
||||
/// The whole result is then clamped to within the range above.
|
||||
/// Not very readable but it works
|
||||
#define DELAY_TO_GLIDE_SIZE(delay) (clamp(((world.icon_size / max((delay) / world.tick_lag, 1)) * GLOB.glide_size_multiplier), MIN_GLIDE_SIZE, MAX_GLIDE_SIZE))
|
||||
#define DELAY_TO_GLIDE_SIZE(delay) (clamp(((ICON_SIZE_ALL / max((delay) / world.tick_lag, 1)) * GLOB.glide_size_multiplier), MIN_GLIDE_SIZE, MAX_GLIDE_SIZE))
|
||||
|
||||
///Similar to DELAY_TO_GLIDE_SIZE, except without the clamping, and it supports piping in an unrelated scalar
|
||||
#define MOVEMENT_ADJUSTED_GLIDE_SIZE(delay, movement_disparity) (world.icon_size / ((delay) / world.tick_lag) * movement_disparity * GLOB.glide_size_multiplier)
|
||||
#define MOVEMENT_ADJUSTED_GLIDE_SIZE(delay, movement_disparity) (ICON_SIZE_ALL / ((delay) / world.tick_lag) * movement_disparity * GLOB.glide_size_multiplier)
|
||||
|
||||
//Movement loop priority. Only one loop can run at a time, this dictates that
|
||||
// Higher numbers beat lower numbers
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
return get_dir(start, end) & (rand() * (dx+dy) < dy ? 3 : 12)
|
||||
|
||||
/**
|
||||
* Finds the distance between two atoms, in pixels
|
||||
* centered = FALSE counts from turf edge to edge
|
||||
* centered = TRUE counts from turf center to turf center
|
||||
* Finds the distance between two atoms, in pixels \
|
||||
* centered = FALSE counts from turf edge to edge \
|
||||
* centered = TRUE counts from turf center to turf center \
|
||||
* of course mathematically this is just adding world.icon_size on again
|
||||
**/
|
||||
/proc/get_pixel_distance(atom/start, atom/end, centered = TRUE)
|
||||
@@ -95,7 +95,7 @@
|
||||
return 0
|
||||
. = bounds_dist(start, end) + sqrt((((start.pixel_x + end.pixel_x) ** 2) + ((start.pixel_y + end.pixel_y) ** 2)))
|
||||
if(centered)
|
||||
. += world.icon_size
|
||||
. += ICON_SIZE_ALL
|
||||
|
||||
/**
|
||||
* Check if there is already a wall item on the turf loc
|
||||
@@ -336,6 +336,6 @@ rough example of the "cone" made by the 3 dirs checked
|
||||
var/icon_width = icon_dimensions["width"]
|
||||
var/icon_height = icon_dimensions["height"]
|
||||
return list(
|
||||
"x" = icon_width > world.icon_size && pixel_x != 0 ? (icon_width - world.icon_size) * 0.5 : 0,
|
||||
"y" = icon_height > world.icon_size && pixel_y != 0 ? (icon_height - world.icon_size) * 0.5 : 0,
|
||||
"x" = icon_width > ICON_SIZE_X && pixel_x != 0 ? (icon_width - ICON_SIZE_X) * 0.5 : 0,
|
||||
"y" = icon_height > ICON_SIZE_Y && pixel_y != 0 ? (icon_height - ICON_SIZE_Y) * 0.5 : 0,
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ GLOBAL_LIST_INIT(master_filter_info, list(
|
||||
)
|
||||
),
|
||||
// Not implemented, but if this isn't uncommented some windows will just error
|
||||
// Needs either a proper matrix editor, or just a hook to our existing one
|
||||
// Needs either a proper matrix editor, or just a hook to our existing one
|
||||
// Issue is filterrific assumes variables will have the same value type if they share the same name, which this violates
|
||||
// Gotta refactor this sometime
|
||||
"color" = list(
|
||||
@@ -169,7 +169,7 @@ GLOBAL_LIST_INIT(master_filter_info, list(
|
||||
if(!isnull(space))
|
||||
.["space"] = space
|
||||
|
||||
/proc/displacement_map_filter(icon, render_source, x, y, size = 32)
|
||||
/proc/displacement_map_filter(icon, render_source, x, y, size = ICON_SIZE_ALL)
|
||||
. = list("type" = "displace")
|
||||
if(!isnull(icon))
|
||||
.["icon"] = icon
|
||||
|
||||
+21
-21
@@ -1038,7 +1038,7 @@ GLOBAL_LIST_EMPTY(friendly_animal_types)
|
||||
var/icon/target_icon = target
|
||||
var/icon_base64 = icon2base64(target_icon)
|
||||
|
||||
if (target_icon.Height() > world.icon_size || target_icon.Width() > world.icon_size)
|
||||
if (target_icon.Height() > ICON_SIZE_Y || target_icon.Width() > ICON_SIZE_X)
|
||||
var/icon_md5 = md5(icon_base64)
|
||||
icon_base64 = bicon_cache[icon_md5]
|
||||
if (!icon_base64) // Doesn't exist yet, make it.
|
||||
@@ -1092,14 +1092,14 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
|
||||
var/top_part_filter = filter(type="alpha",icon=icon('icons/effects/alphacolors.dmi',"white"),y=0)
|
||||
filters += top_part_filter
|
||||
var/filter_index = length(filters)
|
||||
animate(filters[filter_index],y=-32,time=time)
|
||||
animate(filters[filter_index],y=-ICON_SIZE_Y,time=time)
|
||||
//Appearing part
|
||||
var/obj/effect/overlay/appearing_part = new
|
||||
appearing_part.appearance = result_appearance
|
||||
appearing_part.appearance_flags |= KEEP_TOGETHER | KEEP_APART
|
||||
appearing_part.vis_flags = VIS_INHERIT_ID
|
||||
appearing_part.filters = filter(type="alpha",icon=icon('icons/effects/alphacolors.dmi',"white"),y=0,flags=MASK_INVERSE)
|
||||
animate(appearing_part.filters[1],y=-32,time=time)
|
||||
animate(appearing_part.filters[1],y=-ICON_SIZE_Y,time=time)
|
||||
transformation_objects += appearing_part
|
||||
//Transform effect thing
|
||||
if(transform_appearance)
|
||||
@@ -1146,19 +1146,19 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
|
||||
if(!x_dimension || !y_dimension)
|
||||
return
|
||||
|
||||
if((x_dimension == world.icon_size) && (y_dimension == world.icon_size))
|
||||
if((x_dimension == ICON_SIZE_X) && (y_dimension == ICON_SIZE_Y))
|
||||
return image_to_center
|
||||
|
||||
//Offset the image so that its bottom left corner is shifted this many pixels
|
||||
//This makes it infinitely easier to draw larger inhands/images larger than world.iconsize
|
||||
//but still use them in game
|
||||
var/x_offset = -((x_dimension / world.icon_size) - 1) * (world.icon_size * 0.5)
|
||||
var/y_offset = -((y_dimension / world.icon_size) - 1) * (world.icon_size * 0.5)
|
||||
var/x_offset = -((x_dimension / ICON_SIZE_X) - 1) * (ICON_SIZE_X * 0.5)
|
||||
var/y_offset = -((y_dimension / ICON_SIZE_Y) - 1) * (ICON_SIZE_Y * 0.5)
|
||||
|
||||
//Correct values under world.icon_size
|
||||
if(x_dimension < world.icon_size)
|
||||
//Correct values under icon_size
|
||||
if(x_dimension < ICON_SIZE_X)
|
||||
x_offset *= -1
|
||||
if(y_dimension < world.icon_size)
|
||||
if(y_dimension < ICON_SIZE_Y)
|
||||
y_offset *= -1
|
||||
|
||||
image_to_center.pixel_x = x_offset
|
||||
@@ -1216,7 +1216,7 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
|
||||
*/
|
||||
/proc/get_size_in_tiles(obj/target)
|
||||
var/icon/size_check = icon(target.icon, target.icon_state)
|
||||
var/size = size_check.Width() / world.icon_size
|
||||
var/size = size_check.Width() / ICON_SIZE_X
|
||||
|
||||
return size
|
||||
|
||||
@@ -1229,11 +1229,11 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
|
||||
var/size = get_size_in_tiles(src)
|
||||
|
||||
if(dir in list(NORTH, SOUTH))
|
||||
bound_width = size * world.icon_size
|
||||
bound_height = world.icon_size
|
||||
bound_width = size * ICON_SIZE_X
|
||||
bound_height = ICON_SIZE_Y
|
||||
else
|
||||
bound_width = world.icon_size
|
||||
bound_height = size * world.icon_size
|
||||
bound_width = ICON_SIZE_X
|
||||
bound_height = size * ICON_SIZE_Y
|
||||
|
||||
/// Returns a list containing the width and height of an icon file
|
||||
/proc/get_icon_dimensions(icon_path)
|
||||
@@ -1261,15 +1261,15 @@ GLOBAL_LIST_EMPTY(transformation_animation_objects)
|
||||
var/width = icon_dimensions["width"]
|
||||
var/height = icon_dimensions["height"]
|
||||
|
||||
if(width > world.icon_size)
|
||||
alert_overlay.pixel_x = -(world.icon_size / 2) * ((width - world.icon_size) / world.icon_size)
|
||||
if(height > world.icon_size)
|
||||
alert_overlay.pixel_y = -(world.icon_size / 2) * ((height - world.icon_size) / world.icon_size)
|
||||
if(width > world.icon_size || height > world.icon_size)
|
||||
if(width > ICON_SIZE_X)
|
||||
alert_overlay.pixel_x = -(ICON_SIZE_X / 2) * ((width - ICON_SIZE_X) / ICON_SIZE_X)
|
||||
if(height > ICON_SIZE_Y)
|
||||
alert_overlay.pixel_y = -(ICON_SIZE_Y / 2) * ((height - ICON_SIZE_Y) / ICON_SIZE_Y)
|
||||
if(width > ICON_SIZE_X || height > ICON_SIZE_Y)
|
||||
if(width >= height)
|
||||
scale = world.icon_size / width
|
||||
scale = ICON_SIZE_X / width
|
||||
else
|
||||
scale = world.icon_size / height
|
||||
scale = ICON_SIZE_Y / height
|
||||
alert_overlay.transform = alert_overlay.transform.Scale(scale)
|
||||
|
||||
return alert_overlay
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
/proc/get_angle(atom/movable/start, atom/movable/end)//For beams.
|
||||
if(!start || !end)
|
||||
return 0
|
||||
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)
|
||||
var/dy =(ICON_SIZE_Y * end.y + end.pixel_y) - (ICON_SIZE_Y * start.y + start.pixel_y)
|
||||
var/dx =(ICON_SIZE_X * end.x + end.pixel_x) - (ICON_SIZE_X * start.x + start.pixel_x)
|
||||
return delta_to_angle(dx, dy)
|
||||
|
||||
/// Calculate the angle produced by a pair of x and y deltas
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
/// 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)
|
||||
var/dy = (ICON_SIZE_Y * end_y + end_pixel_y) - (ICON_SIZE_Y * start_y + start_pixel_y)
|
||||
var/dx = (ICON_SIZE_X * end_x + end_pixel_x) - (ICON_SIZE_X * start_x + start_pixel_x)
|
||||
if(!dy)
|
||||
return (dx >= 0) ? 90 : 270
|
||||
. = arctan(dx/dy)
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
var/x = (text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32)
|
||||
var/y = (text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32)
|
||||
var/list/screenview = getviewsize(client.view)
|
||||
var/screenviewX = screenview[1] * world.icon_size
|
||||
var/screenviewY = screenview[2] * world.icon_size
|
||||
var/screenviewX = screenview[1] * ICON_SIZE_X
|
||||
var/screenviewY = screenview[2] * ICON_SIZE_Y
|
||||
var/ox = round(screenviewX/2) - client.pixel_x //"origin" x
|
||||
var/oy = round(screenviewY/2) - client.pixel_y //"origin" y
|
||||
var/angle = SIMPLIFY_DEGREES(ATAN2(y - oy, x - ox))
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
if(findtext(screen_loc, "EAST")) // If you're starting from the east, we start from the east too
|
||||
x += view_size[1]
|
||||
if(findtext(screen_loc, "WEST")) // HHHHHHHHHHHHHHHHHHHHHH WEST is technically a 1 tile offset from the start. Shoot me please
|
||||
x += world.icon_size
|
||||
x += ICON_SIZE_X
|
||||
if(findtext(screen_loc, "NORTH"))
|
||||
y += view_size[2]
|
||||
if(findtext(screen_loc, "SOUTH"))
|
||||
y += world.icon_size
|
||||
y += ICON_SIZE_Y
|
||||
|
||||
var/list/x_and_y = splittext(screen_loc, ",")
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
x_coord = text2num(cut_relative_direction(x_coord))
|
||||
y_coord = text2num(cut_relative_direction(y_coord))
|
||||
|
||||
x += x_coord * world.icon_size
|
||||
y += y_coord * world.icon_size
|
||||
x += x_coord * ICON_SIZE_X
|
||||
y += y_coord * ICON_SIZE_Y
|
||||
|
||||
if(length(x_pack) > 1)
|
||||
x += text2num(x_pack[2])
|
||||
@@ -51,14 +51,14 @@
|
||||
/proc/offset_to_screen_loc(x_offset, y_offset, view = null)
|
||||
if(view)
|
||||
var/list/view_bounds = view_to_pixels(view)
|
||||
x_offset = clamp(x_offset, world.icon_size, view_bounds[1])
|
||||
y_offset = clamp(y_offset, world.icon_size, view_bounds[2])
|
||||
x_offset = clamp(x_offset, ICON_SIZE_X, view_bounds[1])
|
||||
y_offset = clamp(y_offset, ICON_SIZE_Y, view_bounds[2])
|
||||
|
||||
// Round with no argument is floor, so we get the non pixel offset here
|
||||
var/x = round(x_offset / world.icon_size)
|
||||
var/pixel_x = x_offset % world.icon_size
|
||||
var/y = round(y_offset / world.icon_size)
|
||||
var/pixel_y = y_offset % world.icon_size
|
||||
var/x = round(x_offset / ICON_SIZE_X)
|
||||
var/pixel_x = x_offset % ICON_SIZE_X
|
||||
var/y = round(y_offset / ICON_SIZE_Y)
|
||||
var/pixel_y = y_offset % ICON_SIZE_Y
|
||||
|
||||
var/list/generated_loc = list()
|
||||
generated_loc += "[x]"
|
||||
@@ -88,9 +88,9 @@
|
||||
// Bias to the right, down, left, and then finally up
|
||||
if(base_x + target_offset < view_size[1])
|
||||
return offset_to_screen_loc(base_x + target_offset, base_y, view)
|
||||
if(base_y - target_offset > world.icon_size)
|
||||
if(base_y - target_offset > ICON_SIZE_Y)
|
||||
return offset_to_screen_loc(base_x, base_y - target_offset, view)
|
||||
if(base_x - target_offset > world.icon_size)
|
||||
if(base_x - target_offset > ICON_SIZE_X)
|
||||
return offset_to_screen_loc(base_x - target_offset, base_y, view)
|
||||
if(base_y + target_offset < view_size[2])
|
||||
return offset_to_screen_loc(base_x, base_y + target_offset, view)
|
||||
@@ -104,12 +104,12 @@
|
||||
|
||||
/// Returns a screen_loc format for a tiling screen objects from start and end positions. Start should be bottom left corner, and end top right corner.
|
||||
/proc/spanning_screen_loc(start_px, start_py, end_px, end_py)
|
||||
var/starting_tile_x = round(start_px / 32)
|
||||
start_px -= starting_tile_x * 32
|
||||
var/starting_tile_y = round(start_py/ 32)
|
||||
start_py -= starting_tile_y * 32
|
||||
var/ending_tile_x = round(end_px / 32)
|
||||
end_px -= ending_tile_x * 32
|
||||
var/ending_tile_y = round(end_py / 32)
|
||||
end_py -= ending_tile_y * 32
|
||||
var/starting_tile_x = round(start_px / ICON_SIZE_X)
|
||||
start_px -= starting_tile_x * ICON_SIZE_X
|
||||
var/starting_tile_y = round(start_py/ ICON_SIZE_Y)
|
||||
start_py -= starting_tile_y * ICON_SIZE_Y
|
||||
var/ending_tile_x = round(end_px / ICON_SIZE_X)
|
||||
end_px -= ending_tile_x * ICON_SIZE_X
|
||||
var/ending_tile_y = round(end_py / ICON_SIZE_Y)
|
||||
end_py -= ending_tile_y * ICON_SIZE_Y
|
||||
return "[starting_tile_x]:[start_px],[starting_tile_y]:[start_py] to [ending_tile_x]:[end_px],[ending_tile_y]:[end_py]"
|
||||
|
||||
@@ -211,37 +211,49 @@
|
||||
for(var/obj/item/radio/radio as anything in radios)
|
||||
. |= get_hearers_in_LOS(radio.canhear_range, radio, FALSE)
|
||||
|
||||
//Used when converting pixels to tiles to make them accurate
|
||||
#define OFFSET_X (0.5 / ICON_SIZE_X)
|
||||
#define OFFSET_Y (0.5 / ICON_SIZE_Y)
|
||||
|
||||
///Calculate if two atoms are in sight, returns TRUE or FALSE
|
||||
/proc/inLineOfSight(X1,Y1,X2,Y2,Z=1,PX1=16.5,PY1=16.5,PX2=16.5,PY2=16.5)
|
||||
var/turf/T
|
||||
var/turf/current_turf
|
||||
if(X1 == X2)
|
||||
if(Y1 == Y2)
|
||||
return TRUE //Light cannot be blocked on same tile
|
||||
else
|
||||
var/s = SIGN(Y2-Y1)
|
||||
Y1+=s
|
||||
var/sign = SIGN(Y2-Y1)
|
||||
Y1 += sign
|
||||
while(Y1 != Y2)
|
||||
T=locate(X1,Y1,Z)
|
||||
if(IS_OPAQUE_TURF(T))
|
||||
current_turf = locate(X1, Y1, Z)
|
||||
if(IS_OPAQUE_TURF(current_turf))
|
||||
return FALSE
|
||||
Y1+=s
|
||||
Y1 += sign
|
||||
else
|
||||
var/m=(32*(Y2-Y1)+(PY2-PY1))/(32*(X2-X1)+(PX2-PX1))
|
||||
var/b=(Y1+PY1/32-0.015625)-m*(X1+PX1/32-0.015625) //In tiles
|
||||
//This looks scary but we're just calculating a linear function (y = mx + b)
|
||||
|
||||
//m = y/x
|
||||
var/m = (ICON_SIZE_Y*(Y2-Y1) + (PY2-PY1)) / (ICON_SIZE_X*(X2-X1) + (PX2-PX1))//In pixels
|
||||
|
||||
//b = y - mx
|
||||
var/b = (Y1 + PY1/ICON_SIZE_Y - OFFSET_Y) - m*(X1 + PX1/ICON_SIZE_X - OFFSET_X)//In tiles
|
||||
|
||||
var/signX = SIGN(X2-X1)
|
||||
var/signY = SIGN(Y2-Y1)
|
||||
if(X1<X2)
|
||||
b+=m
|
||||
if(X1 < X2)
|
||||
b += m
|
||||
while(X1 != X2 || Y1 != Y2)
|
||||
if(round(m*X1+b-Y1))
|
||||
Y1+=signY //Line exits tile vertically
|
||||
if(round(m*X1 + b - Y1)) // Basically, if y >= mx+b
|
||||
Y1 += signY //Line exits tile vertically
|
||||
else
|
||||
X1+=signX //Line exits tile horizontally
|
||||
T=locate(X1,Y1,Z)
|
||||
if(IS_OPAQUE_TURF(T))
|
||||
X1 += signX //Line exits tile horizontally
|
||||
current_turf = locate(X1, Y1, Z)
|
||||
if(IS_OPAQUE_TURF(current_turf))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
#undef OFFSET_X
|
||||
#undef OFFSET_Y
|
||||
|
||||
/proc/is_in_sight(atom/first_atom, atom/second_atom)
|
||||
var/turf/first_turf = get_turf(first_atom)
|
||||
|
||||
@@ -237,9 +237,9 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
var/list/icon_dimensions = get_icon_dimensions(checked_atom.icon)
|
||||
var/checked_atom_icon_height = icon_dimensions["height"]
|
||||
var/checked_atom_icon_width = icon_dimensions["width"]
|
||||
if(checked_atom_icon_height != world.icon_size || checked_atom_icon_width != world.icon_size)
|
||||
pixel_x_offset += ((checked_atom_icon_width / world.icon_size) - 1) * (world.icon_size * 0.5)
|
||||
pixel_y_offset += ((checked_atom_icon_height / world.icon_size) - 1) * (world.icon_size * 0.5)
|
||||
if(checked_atom_icon_height != ICON_SIZE_Y || checked_atom_icon_width != ICON_SIZE_X)
|
||||
pixel_x_offset += ((checked_atom_icon_width / ICON_SIZE_X) - 1) * (ICON_SIZE_X * 0.5)
|
||||
pixel_y_offset += ((checked_atom_icon_height / ICON_SIZE_Y) - 1) * (ICON_SIZE_Y * 0.5)
|
||||
|
||||
return list(pixel_x_offset, pixel_y_offset)
|
||||
|
||||
@@ -248,8 +248,8 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
**/
|
||||
/proc/pixel_offset_turf(turf/offset_from, list/offsets)
|
||||
//DY and DX
|
||||
var/rough_x = round(round(offsets[1], world.icon_size) / world.icon_size)
|
||||
var/rough_y = round(round(offsets[2], world.icon_size) / world.icon_size)
|
||||
var/rough_x = round(round(offsets[1], ICON_SIZE_X) / ICON_SIZE_X)
|
||||
var/rough_y = round(round(offsets[2], ICON_SIZE_Y) / ICON_SIZE_Y)
|
||||
|
||||
var/final_x = clamp(offset_from.x + rough_x, 1, world.maxx)
|
||||
var/final_y = clamp(offset_from.y + rough_y, 1, world.maxy)
|
||||
@@ -275,8 +275,8 @@ Turf and target are separate in case you want to teleport some distance from a t
|
||||
click_turf_y = origin.y + text2num(click_turf_y[1]) - round(actual_view[2] / 2) - 1
|
||||
|
||||
var/turf/click_turf = locate(clamp(click_turf_x, 1, world.maxx), clamp(click_turf_y, 1, world.maxy), click_turf_z)
|
||||
LAZYSET(modifiers, ICON_X, "[(click_turf_px - click_turf.pixel_x) + ((click_turf_x - click_turf.x) * world.icon_size)]")
|
||||
LAZYSET(modifiers, ICON_Y, "[(click_turf_py - click_turf.pixel_y) + ((click_turf_y - click_turf.y) * world.icon_size)]")
|
||||
LAZYSET(modifiers, ICON_X, "[(click_turf_px - click_turf.pixel_x) + ((click_turf_x - click_turf.x) * ICON_SIZE_X)]")
|
||||
LAZYSET(modifiers, ICON_Y, "[(click_turf_py - click_turf.pixel_y) + ((click_turf_y - click_turf.y) * ICON_SIZE_Y)]")
|
||||
return click_turf
|
||||
|
||||
///Almost identical to the params_to_turf(), but unused (remove?)
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
if(!view)
|
||||
return list(0, 0)
|
||||
var/list/view_info = getviewsize(view)
|
||||
view_info[1] *= world.icon_size
|
||||
view_info[2] *= world.icon_size
|
||||
view_info[1] *= ICON_SIZE_X
|
||||
view_info[2] *= ICON_SIZE_Y
|
||||
return view_info
|
||||
|
||||
/**
|
||||
|
||||
@@ -400,15 +400,15 @@
|
||||
mouse_opacity = MOUSE_OPACITY_OPAQUE
|
||||
screen_loc = "CENTER"
|
||||
|
||||
#define MAX_SAFE_BYOND_ICON_SCALE_TILES (MAX_SAFE_BYOND_ICON_SCALE_PX / world.icon_size)
|
||||
#define MAX_SAFE_BYOND_ICON_SCALE_PX (33 * 32) //Not using world.icon_size on purpose.
|
||||
#define MAX_SAFE_BYOND_ICON_SCALE_TILES (MAX_SAFE_BYOND_ICON_SCALE_PX / ICON_SIZE_ALL)
|
||||
#define MAX_SAFE_BYOND_ICON_SCALE_PX (33 * 32) //Not using world.icon_size on purpose. //Ok well I trust you
|
||||
|
||||
/atom/movable/screen/click_catcher/proc/UpdateGreed(view_size_x = 15, view_size_y = 15)
|
||||
var/icon/newicon = icon('icons/hud/screen_gen.dmi', "catcher")
|
||||
var/ox = min(MAX_SAFE_BYOND_ICON_SCALE_TILES, view_size_x)
|
||||
var/oy = min(MAX_SAFE_BYOND_ICON_SCALE_TILES, view_size_y)
|
||||
var/px = view_size_x * world.icon_size
|
||||
var/py = view_size_y * world.icon_size
|
||||
var/px = view_size_x * ICON_SIZE_X
|
||||
var/py = view_size_y * ICON_SIZE_Y
|
||||
var/sx = min(MAX_SAFE_BYOND_ICON_SCALE_PX, px)
|
||||
var/sy = min(MAX_SAFE_BYOND_ICON_SCALE_PX, py)
|
||||
newicon.Scale(sx, sy)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#define CREDIT_ROLL_SPEED 125
|
||||
#define CREDIT_SPAWN_SPEED 10
|
||||
#define CREDIT_ANIMATE_HEIGHT (14 * world.icon_size)
|
||||
#define CREDIT_ANIMATE_HEIGHT (14 * ICON_SIZE_Y)
|
||||
#define CREDIT_EASE_DURATION 22
|
||||
#define CREDITS_PATH "[global.config.directory]/contributors.dmi"
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
parent = P
|
||||
icon_state = credited
|
||||
maptext = MAPTEXT_PIXELLARI(credited)
|
||||
maptext_x = world.icon_size + 8
|
||||
maptext_y = (world.icon_size / 2) - 4
|
||||
maptext_width = world.icon_size * 3
|
||||
maptext_x = ICON_SIZE_X + 8
|
||||
maptext_y = (ICON_SIZE_Y / 2) - 4
|
||||
maptext_width = ICON_SIZE_X * 3
|
||||
var/matrix/M = matrix(transform)
|
||||
M.Translate(0, CREDIT_ANIMATE_HEIGHT)
|
||||
animate(src, transform = M, time = CREDIT_ROLL_SPEED)
|
||||
|
||||
@@ -548,7 +548,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
if(!our_client)
|
||||
position_action(button, button.linked_action.default_button_position)
|
||||
return
|
||||
button.screen_loc = get_valid_screen_location(relative_to.screen_loc, world.icon_size, our_client.view_size.getView()) // Asks for a location adjacent to our button that won't overflow the map
|
||||
button.screen_loc = get_valid_screen_location(relative_to.screen_loc, ICON_SIZE_ALL, our_client.view_size.getView()) // Asks for a location adjacent to our button that won't overflow the map
|
||||
|
||||
button.location = relative_to.location
|
||||
|
||||
@@ -712,14 +712,14 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
// We're primarially concerned about width here, if someone makes us 1x2000 I wish them a swift and watery death
|
||||
var/furthest_screen_loc = ButtonNumberToScreenCoords(column_max - 1)
|
||||
var/list/offsets = screen_loc_to_offset(furthest_screen_loc, owner_view)
|
||||
if(offsets[1] > world.icon_size && offsets[1] < view_size[1] && offsets[2] > world.icon_size && offsets[2] < view_size[2]) // We're all good
|
||||
if(offsets[1] > ICON_SIZE_X && offsets[1] < view_size[1] && offsets[2] > ICON_SIZE_Y && offsets[2] < view_size[2]) // We're all good
|
||||
return
|
||||
|
||||
for(column_max in column_max - 1 to 1 step -1) // Yes I could do this by unwrapping ButtonNumberToScreenCoords, but I don't feel like it
|
||||
var/tested_screen_loc = ButtonNumberToScreenCoords(column_max)
|
||||
offsets = screen_loc_to_offset(tested_screen_loc, owner_view)
|
||||
// We've found a valid max length, pack it in
|
||||
if(offsets[1] > world.icon_size && offsets[1] < view_size[1] && offsets[2] > world.icon_size && offsets[2] < view_size[2])
|
||||
if(offsets[1] > ICON_SIZE_X && offsets[1] < view_size[1] && offsets[2] > ICON_SIZE_Y && offsets[2] < view_size[2])
|
||||
break
|
||||
// Use our newly resized column max
|
||||
refresh_actions()
|
||||
|
||||
@@ -105,8 +105,8 @@
|
||||
if(!popup_name)
|
||||
return
|
||||
clear_map("[popup_name]_map")
|
||||
var/x_value = world.icon_size * tilesize * width
|
||||
var/y_value = world.icon_size * tilesize * height
|
||||
var/x_value = ICON_SIZE_X * tilesize * width
|
||||
var/y_value = ICON_SIZE_Y * tilesize * height
|
||||
var/map_name = create_popup(popup_name, title, x_value, y_value)
|
||||
|
||||
var/atom/movable/screen/background/background = new
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
var/client/our_client = usr.client
|
||||
var/list/offset = screen_loc_to_offset(LAZYACCESS(modifiers, SCREEN_LOC))
|
||||
if(snap2grid) //Discard Pixel Values
|
||||
offset[1] = FLOOR(offset[1], world.icon_size) // drops any pixel offset
|
||||
offset[2] = FLOOR(offset[2], world.icon_size) // drops any pixel offset
|
||||
offset[1] = FLOOR(offset[1], ICON_SIZE_X) // drops any pixel offset
|
||||
offset[2] = FLOOR(offset[2], ICON_SIZE_Y) // drops any pixel offset
|
||||
else //Normalise Pixel Values (So the object drops at the center of the mouse, not 16 pixels off)
|
||||
offset[1] += x_off
|
||||
offset[2] += y_off
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
if(!offset_x && !offset_y && !force)
|
||||
return
|
||||
|
||||
var/glide_rate = round(world.icon_size / screenmob.glide_size * world.tick_lag, world.tick_lag)
|
||||
var/glide_rate = round(ICON_SIZE_ALL / screenmob.glide_size * world.tick_lag, world.tick_lag)
|
||||
C.previous_turf = posobj
|
||||
|
||||
var/largest_change = max(abs(offset_x), abs(offset_y))
|
||||
@@ -297,8 +297,8 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
|
||||
/atom/movable/screen/parallax_layer/proc/update_o(view)
|
||||
if (!view)
|
||||
view = world.view
|
||||
|
||||
var/static/parallax_scaler = world.icon_size / 480
|
||||
var/static/pixel_grid_size = ICON_SIZE_ALL * 15
|
||||
var/static/parallax_scaler = ICON_SIZE_ALL / pixel_grid_size
|
||||
|
||||
// Turn the view size into a grid of correctly scaled overlays
|
||||
var/list/viewscales = getviewsize(view)
|
||||
@@ -311,8 +311,8 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/parallax_layer)
|
||||
if(x == 0 && y == 0)
|
||||
continue
|
||||
var/mutable_appearance/texture_overlay = mutable_appearance(icon, icon_state)
|
||||
texture_overlay.pixel_w += 480 * x
|
||||
texture_overlay.pixel_z += 480 * y
|
||||
texture_overlay.pixel_w += pixel_grid_size * x
|
||||
texture_overlay.pixel_z += pixel_grid_size * y
|
||||
new_overlays += texture_overlay
|
||||
cut_overlays()
|
||||
add_overlay(new_overlays)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
move_tab.icon_state = "move"
|
||||
move_tab.plane = HUD_PLANE
|
||||
var/matrix/M = matrix()
|
||||
M.Translate(0, (height + 0.25) * world.icon_size)
|
||||
M.Translate(0, (height + 0.25) * ICON_SIZE_Y)
|
||||
move_tab.transform = M
|
||||
add_overlay(move_tab)
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
MA.plane = HUD_PLANE
|
||||
button_x.appearance = MA
|
||||
M = matrix()
|
||||
M.Translate((max(4, width) - 0.75) * world.icon_size, (height + 0.25) * world.icon_size)
|
||||
M.Translate((max(4, width) - 0.75) * ICON_SIZE_X, (height + 0.25) * ICON_SIZE_Y)
|
||||
button_x.transform = M
|
||||
vis_contents += button_x
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
MA.plane = HUD_PLANE
|
||||
button_expand.appearance = MA
|
||||
M = matrix()
|
||||
M.Translate(world.icon_size, (height + 0.25) * world.icon_size)
|
||||
M.Translate(ICON_SIZE_X, (height + 0.25) * ICON_SIZE_Y)
|
||||
button_expand.transform = M
|
||||
vis_contents += button_expand
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
MA.plane = HUD_PLANE
|
||||
button_shrink.appearance = MA
|
||||
M = matrix()
|
||||
M.Translate(2 * world.icon_size, (height + 0.25) * world.icon_size)
|
||||
M.Translate(2 * ICON_SIZE_X, (height + 0.25) * ICON_SIZE_Y)
|
||||
button_shrink.transform = M
|
||||
vis_contents += button_shrink
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
if((width > 0) && (height > 0))
|
||||
var/matrix/M = matrix()
|
||||
M.Scale(width + 0.5, height + 0.5)
|
||||
M.Translate((width-1)/2 * world.icon_size, (height-1)/2 * world.icon_size)
|
||||
M.Translate((width-1)/2 * ICON_SIZE_X, (height-1)/2 * ICON_SIZE_Y)
|
||||
standard_background.transform = M
|
||||
add_overlay(standard_background)
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
src.width = width
|
||||
src.height = height
|
||||
|
||||
y_off = -height * world.icon_size - 16
|
||||
y_off = (-height * ICON_SIZE_Y) - (ICON_SIZE_Y / 2)
|
||||
|
||||
cut_overlays()
|
||||
add_background()
|
||||
|
||||
@@ -388,8 +388,8 @@ GLOBAL_LIST_EMPTY(radial_menus)
|
||||
if (user_space)
|
||||
var/turf/user_turf = get_turf(user)
|
||||
var/turf/anchor_turf = get_turf(anchor)
|
||||
offset_x = (anchor_turf.x - user_turf.x) * world.icon_size + anchor.pixel_x - user.pixel_x
|
||||
offset_y = (anchor_turf.y - user_turf.y) * world.icon_size + anchor.pixel_y - user.pixel_y
|
||||
offset_x = (anchor_turf.x - user_turf.x) * ICON_SIZE_X + anchor.pixel_x - user.pixel_x
|
||||
offset_y = (anchor_turf.y - user_turf.y) * ICON_SIZE_Y + anchor.pixel_y - user.pixel_y
|
||||
menu.show_to(user, offset_x, offset_y)
|
||||
menu.wait(user, anchor, require_near)
|
||||
var/answer = menu.selected_choice
|
||||
|
||||
@@ -396,7 +396,7 @@
|
||||
var/obj/visual = image('icons/hud/screen_gen.dmi', our_tile, "arrow", FLY_LAYER)
|
||||
|
||||
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay_global), visual, group_clients(), 2.5 SECONDS)
|
||||
animate(visual, pixel_x = (tile.x - our_tile.x) * world.icon_size + pointed_atom.pixel_x, pixel_y = (tile.y - our_tile.y) * world.icon_size + pointed_atom.pixel_y, time = 1.7, easing = EASE_OUT)
|
||||
animate(visual, pixel_x = (tile.x - our_tile.x) * ICON_SIZE_X + pointed_atom.pixel_x, pixel_y = (tile.y - our_tile.y) * ICON_SIZE_Y + pointed_atom.pixel_y, time = 1.7, easing = EASE_OUT)
|
||||
|
||||
/mob/camera/imaginary_friend/create_thinking_indicator()
|
||||
if(active_thinking_indicator || active_typing_indicator || !HAS_TRAIT(src, TRAIT_THINKING_IN_CHARACTER))
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
/// Adds the cog to the user, visible by other players
|
||||
/datum/cogbar/proc/add_cog_to_user()
|
||||
cog = SSvis_overlays.add_vis_overlay(user,
|
||||
cog = SSvis_overlays.add_vis_overlay(user,
|
||||
icon = 'icons/effects/progressbar.dmi',
|
||||
iconstate = "cog",
|
||||
plane = HIGH_GAME_PLANE,
|
||||
@@ -52,7 +52,7 @@
|
||||
unique = TRUE,
|
||||
alpha = 0,
|
||||
)
|
||||
cog.pixel_y = world.icon_size + offset_y
|
||||
cog.pixel_y = ICON_SIZE_Y + offset_y
|
||||
animate(cog, alpha = 255, time = COGBAR_ANIMATION_TIME)
|
||||
|
||||
if(isnull(user_client))
|
||||
@@ -61,7 +61,7 @@
|
||||
blank = image('icons/blanks/32x32.dmi', cog, "nothing")
|
||||
SET_PLANE_EXPLICIT(blank, HIGH_GAME_PLANE, user)
|
||||
blank.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA
|
||||
blank.override = TRUE
|
||||
blank.override = TRUE
|
||||
|
||||
user_client.images += blank
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
animate(cog, alpha = 0, time = COGBAR_ANIMATION_TIME)
|
||||
|
||||
QDEL_IN(src, COGBAR_ANIMATION_TIME)
|
||||
QDEL_IN(src, COGBAR_ANIMATION_TIME)
|
||||
|
||||
|
||||
/// When the user is deleted, remove the cog
|
||||
@@ -82,6 +82,6 @@
|
||||
SIGNAL_HANDLER
|
||||
|
||||
qdel(src)
|
||||
|
||||
|
||||
|
||||
#undef COGBAR_ANIMATION_TIME
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
color = colorize_string(creator.GetVoice(), 2, 0.9)
|
||||
update_appearance()
|
||||
var/turf/target_loc = get_turf(target)
|
||||
animate(src, pixel_x = (target_loc.x - loc.x) * world.icon_size + target.pixel_x, pixel_y = (target_loc.y - loc.y) * world.icon_size + target.pixel_y, time = 0.2 SECONDS, easing = EASE_OUT)
|
||||
animate(src, pixel_x = (target_loc.x - loc.x) * ICON_SIZE_X + target.pixel_x, pixel_y = (target_loc.y - loc.y) * ICON_SIZE_Y + target.pixel_y, time = 0.2 SECONDS, easing = EASE_OUT)
|
||||
|
||||
/datum/callout_option
|
||||
var/name = "ERROR"
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
return
|
||||
holder.icon_state = "hud[RoundHealth(host)]"
|
||||
var/icon/size_check = icon(mob_parent.icon, mob_parent.icon_state, mob_parent.dir)
|
||||
holder.pixel_y = size_check.Height() - world.icon_size
|
||||
holder.pixel_y = size_check.Height() - ICON_SIZE_Y
|
||||
|
||||
/// Update our vital status on the medical hud
|
||||
/datum/component/life_link/proc/update_med_hud_status(mob/living/mob_parent)
|
||||
@@ -136,7 +136,7 @@
|
||||
if(isnull(holder))
|
||||
return
|
||||
var/icon/size_check = icon(mob_parent.icon, mob_parent.icon_state, mob_parent.dir)
|
||||
holder.pixel_y = size_check.Height() - world.icon_size
|
||||
holder.pixel_y = size_check.Height() - ICON_SIZE_Y
|
||||
if(host.stat == DEAD || HAS_TRAIT(host, TRAIT_FAKEDEATH))
|
||||
holder.icon_state = "huddead"
|
||||
else
|
||||
|
||||
@@ -246,18 +246,18 @@
|
||||
if(isnull(icon_x))
|
||||
icon_x = text2num(LAZYACCESS(modifiers, ICON_X))
|
||||
if(isnull(icon_x))
|
||||
icon_x = view_list[1]*world.icon_size/2
|
||||
icon_x = view_list[1]*ICON_SIZE_X/2
|
||||
var/icon_y = text2num(LAZYACCESS(modifiers, VIS_Y))
|
||||
if(isnull(icon_y))
|
||||
icon_y = text2num(LAZYACCESS(modifiers, ICON_Y))
|
||||
if(isnull(icon_y))
|
||||
icon_y = view_list[2]*world.icon_size/2
|
||||
var/x_cap = range_modifier * view_list[1]*world.icon_size / 2
|
||||
var/y_cap = range_modifier * view_list[2]*world.icon_size / 2
|
||||
var/uncapped_x = round(range_modifier * (icon_x - view_list[1]*world.icon_size/2) * MOUSE_POINTER_OFFSET_MULT)
|
||||
var/uncapped_y = round(range_modifier * (icon_y - view_list[2]*world.icon_size/2) * MOUSE_POINTER_OFFSET_MULT)
|
||||
icon_y = view_list[2]*ICON_SIZE_Y/2
|
||||
var/x_cap = range_modifier * view_list[1]*ICON_SIZE_X / 2
|
||||
var/y_cap = range_modifier * view_list[2]*ICON_SIZE_Y / 2
|
||||
var/uncapped_x = round(range_modifier * (icon_x - view_list[1]*ICON_SIZE_X/2) * MOUSE_POINTER_OFFSET_MULT)
|
||||
var/uncapped_y = round(range_modifier * (icon_y - view_list[2]*ICON_SIZE_Y/2) * MOUSE_POINTER_OFFSET_MULT)
|
||||
given_x = clamp(uncapped_x, -x_cap, x_cap)
|
||||
given_y = clamp(uncapped_y, -y_cap, y_cap)
|
||||
given_turf = locate(owner.x+round(given_x/world.icon_size, 1),owner.y+round(given_y/world.icon_size, 1),owner.z)
|
||||
given_turf = locate(owner.x+round(given_x/ICON_SIZE_X, 1),owner.y+round(given_y/ICON_SIZE_Y, 1),owner.z)
|
||||
|
||||
#undef MOUSE_POINTER_OFFSET_MULT
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
var/atom/parent_atom = parent
|
||||
|
||||
sticker_overlay = mutable_appearance(icon = our_sticker.icon, icon_state = our_sticker.icon_state, layer = parent_atom.layer + 0.01, appearance_flags = RESET_COLOR)
|
||||
sticker_overlay.pixel_w = px - world.icon_size / 2
|
||||
sticker_overlay.pixel_z = py - world.icon_size / 2
|
||||
sticker_overlay.pixel_w = px - ICON_SIZE_X / 2
|
||||
sticker_overlay.pixel_z = py - ICON_SIZE_Y / 2
|
||||
|
||||
parent_atom.add_overlay(sticker_overlay)
|
||||
stick_callback?.Invoke(parent)
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
if(ignore_next_glide)
|
||||
ignore_next_glide = FALSE
|
||||
return
|
||||
var/glide_delay = round(world.icon_size / glide_size, 1) * world.tick_lag
|
||||
var/glide_delay = round(ICON_SIZE_ALL / glide_size, 1) * world.tick_lag
|
||||
drifting_loop.pause_for(glide_delay)
|
||||
delayed = TRUE
|
||||
|
||||
|
||||
@@ -106,8 +106,8 @@
|
||||
if(ISDIAGONALDIR(climbed_thing.dir) && same_loc)
|
||||
if(params) //we check the icon x and y parameters of the click-drag to determine step_dir.
|
||||
var/list/modifiers = params2list(params)
|
||||
var/x_dist = (text2num(LAZYACCESS(modifiers, ICON_X)) - world.icon_size/2) * (climbed_thing.dir & WEST ? -1 : 1)
|
||||
var/y_dist = (text2num(LAZYACCESS(modifiers, ICON_Y)) - world.icon_size/2) * (climbed_thing.dir & SOUTH ? -1 : 1)
|
||||
var/x_dist = (text2num(LAZYACCESS(modifiers, ICON_X)) - ICON_SIZE_X/2) * (climbed_thing.dir & WEST ? -1 : 1)
|
||||
var/y_dist = (text2num(LAZYACCESS(modifiers, ICON_Y)) - ICON_SIZE_Y/2) * (climbed_thing.dir & SOUTH ? -1 : 1)
|
||||
dir_step = (x_dist >= y_dist ? (EAST|WEST) : (NORTH|SOUTH)) & climbed_thing.dir
|
||||
else
|
||||
dir_step = get_dir(user, get_step(climbed_thing, climbed_thing.dir))
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
icon = I.icon
|
||||
icon_state = I.icon_state
|
||||
var/icon/icon_for_size = icon(icon, icon_state)
|
||||
var/scale_factor_x = icon_for_size.Width()/world.icon_size
|
||||
var/scale_factor_y = icon_for_size.Height()/world.icon_size
|
||||
var/scale_factor_x = icon_for_size.Width()/ICON_SIZE_X
|
||||
var/scale_factor_y = icon_for_size.Height()/ICON_SIZE_Y
|
||||
var/mutable_appearance/blood_splatter = mutable_appearance('icons/effects/blood.dmi', "itemblood", appearance_flags = RESET_COLOR) //MA of the blood that we apply
|
||||
blood_splatter.transform = blood_splatter.transform.Scale(scale_factor_x, scale_factor_y)
|
||||
blood_splatter.blend_mode = BLEND_INSET_OVERLAY
|
||||
|
||||
@@ -142,8 +142,8 @@
|
||||
*/
|
||||
/datum/element/immerse/proc/add_immerse_overlay(atom/movable/movable)
|
||||
var/list/icon_dimensions = get_icon_dimensions(movable.icon)
|
||||
var/width = icon_dimensions["width"] || world.icon_size
|
||||
var/height = icon_dimensions["height"] || world.icon_size
|
||||
var/width = icon_dimensions["width"] || ICON_SIZE_X
|
||||
var/height = icon_dimensions["height"] || ICON_SIZE_Y
|
||||
|
||||
var/is_below_water = movable.layer < WATER_LEVEL_LAYER ? "underwater-" : ""
|
||||
|
||||
@@ -184,19 +184,19 @@
|
||||
* but since we want the appearance to stay where it should be,
|
||||
* we have to counteract this one.
|
||||
*/
|
||||
var/extra_width = (width - world.icon_size) * 0.5
|
||||
var/extra_height = (height - world.icon_size) * 0.5
|
||||
var/extra_width = (width - ICON_SIZE_X) * 0.5
|
||||
var/extra_height = (height - ICON_SIZE_Y) * 0.5
|
||||
var/mutable_appearance/overlay_appearance = new()
|
||||
var/icon/immerse_icon = generated_immerse_icons["[icon]-[icon_state]-[mask_icon]"]
|
||||
var/last_i = width/world.icon_size
|
||||
var/last_i = width/ICON_SIZE_X
|
||||
for(var/i in -1 to last_i)
|
||||
var/mutable_appearance/underwater = mutable_appearance(icon, icon_state)
|
||||
underwater.pixel_x = world.icon_size * i - extra_width
|
||||
underwater.pixel_y = -world.icon_size - extra_height
|
||||
underwater.pixel_x = ICON_SIZE_X * i - extra_width
|
||||
underwater.pixel_y = -ICON_SIZE_Y - extra_height
|
||||
overlay_appearance.overlays += underwater
|
||||
|
||||
var/mutable_appearance/water_level = is_below_water ? underwater : mutable_appearance(immerse_icon)
|
||||
water_level.pixel_x = world.icon_size * i - extra_width
|
||||
water_level.pixel_x = ICON_SIZE_X * i - extra_width
|
||||
water_level.pixel_y = -extra_height
|
||||
overlay_appearance.overlays += water_level
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
var/turf/northeast = locate(clamp(x + (direction & EAST ? range : 0), 1, world.maxx), clamp(y + (direction & NORTH ? range : 0), 1, world.maxy), z)
|
||||
holder.vis_contents += block(southwest, northeast)
|
||||
if(direction & SOUTH)
|
||||
holder.pixel_y -= world.icon_size * range
|
||||
holder.pixel_y -= ICON_SIZE_Y * range
|
||||
if(direction & WEST)
|
||||
holder.pixel_x -= world.icon_size * range
|
||||
holder.pixel_x -= ICON_SIZE_X * range
|
||||
|
||||
/datum/element/mirage_border/Detach(atom/movable/target)
|
||||
. = ..()
|
||||
|
||||
@@ -91,9 +91,9 @@
|
||||
|
||||
/datum/point/proc/initialize_location(tile_x, tile_y, tile_z, p_x = 0, p_y = 0)
|
||||
if(!isnull(tile_x))
|
||||
x = ((tile_x - 1) * world.icon_size) + world.icon_size * 0.5 + p_x + 1
|
||||
x = ((tile_x - 1) * ICON_SIZE_X) + ICON_SIZE_X * 0.5 + p_x + 1
|
||||
if(!isnull(tile_y))
|
||||
y = ((tile_y - 1) * world.icon_size) + world.icon_size * 0.5 + p_y + 1
|
||||
y = ((tile_y - 1) * ICON_SIZE_Y) + ICON_SIZE_Y * 0.5 + p_y + 1
|
||||
if(!isnull(tile_z))
|
||||
z = tile_z
|
||||
|
||||
@@ -107,23 +107,23 @@
|
||||
AM.pixel_y = return_py()
|
||||
|
||||
/datum/point/proc/return_turf()
|
||||
return locate(CEILING(x / world.icon_size, 1), CEILING(y / world.icon_size, 1), z)
|
||||
return locate(CEILING(x / ICON_SIZE_X, 1), CEILING(y / ICON_SIZE_Y, 1), z)
|
||||
|
||||
/datum/point/proc/return_coordinates() //[turf_x, turf_y, z]
|
||||
return list(CEILING(x / world.icon_size, 1), CEILING(y / world.icon_size, 1), z)
|
||||
return list(CEILING(x / ICON_SIZE_X, 1), CEILING(y / ICON_SIZE_Y, 1), z)
|
||||
|
||||
/datum/point/proc/return_position()
|
||||
return new /datum/position(src)
|
||||
|
||||
/datum/point/proc/return_px()
|
||||
return MODULUS(x, world.icon_size) - 16 - 1
|
||||
return MODULUS(x, ICON_SIZE_X) - (ICON_SIZE_X/2) - 1
|
||||
|
||||
/datum/point/proc/return_py()
|
||||
return MODULUS(y, world.icon_size) - 16 - 1
|
||||
return MODULUS(y, ICON_SIZE_Y) - (ICON_SIZE_Y/2) - 1
|
||||
|
||||
/datum/point/vector
|
||||
/// Pixels per iteration
|
||||
var/speed = 32
|
||||
var/speed = ICON_SIZE_ALL
|
||||
var/iteration = 0
|
||||
var/angle = 0
|
||||
/// Calculated x movement amounts to prevent having to do trig every step.
|
||||
@@ -149,9 +149,9 @@
|
||||
/// Same effect as initiliaze_location, but without setting the starting_x/y/z
|
||||
/datum/point/vector/proc/set_location(tile_x, tile_y, tile_z, p_x = 0, p_y = 0)
|
||||
if(!isnull(tile_x))
|
||||
x = ((tile_x - 1) * world.icon_size) + world.icon_size * 0.5 + p_x + 1
|
||||
x = ((tile_x - 1) * ICON_SIZE_X) + ICON_SIZE_X * 0.5 + p_x + 1
|
||||
if(!isnull(tile_y))
|
||||
y = ((tile_y - 1) * world.icon_size) + world.icon_size * 0.5 + p_y + 1
|
||||
y = ((tile_y - 1) * ICON_SIZE_Y) + ICON_SIZE_Y * 0.5 + p_y + 1
|
||||
if(!isnull(tile_z))
|
||||
z = tile_z
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@
|
||||
continue
|
||||
progress_bar.listindex--
|
||||
|
||||
progress_bar.bar.pixel_y = world.icon_size + offset_y + (PROGRESSBAR_HEIGHT * (progress_bar.listindex - 1))
|
||||
var/dist_to_travel = world.icon_size + offset_y + (PROGRESSBAR_HEIGHT * (progress_bar.listindex - 1)) - PROGRESSBAR_HEIGHT
|
||||
progress_bar.bar.pixel_y = ICON_SIZE_Y + offset_y + (PROGRESSBAR_HEIGHT * (progress_bar.listindex - 1))
|
||||
var/dist_to_travel = ICON_SIZE_Y + offset_y + (PROGRESSBAR_HEIGHT * (progress_bar.listindex - 1)) - PROGRESSBAR_HEIGHT
|
||||
animate(progress_bar.bar, pixel_y = dist_to_travel, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING)
|
||||
|
||||
LAZYREMOVEASSOC(user.progressbars, bar_loc, src)
|
||||
@@ -123,7 +123,7 @@
|
||||
bar.pixel_y = 0
|
||||
bar.alpha = 0
|
||||
user_client.images += bar
|
||||
animate(bar, pixel_y = world.icon_size + offset_y + (PROGRESSBAR_HEIGHT * (listindex - 1)), alpha = 255, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING)
|
||||
animate(bar, pixel_y = ICON_SIZE_Y + offset_y + (PROGRESSBAR_HEIGHT * (listindex - 1)), alpha = 255, time = PROGRESSBAR_ANIMATION_TIME, easing = SINE_EASING)
|
||||
|
||||
|
||||
///Updates the progress bar image visually.
|
||||
|
||||
@@ -123,9 +123,9 @@
|
||||
var/icon_height = I.Height()
|
||||
status_overlay.pixel_x = -owner.pixel_x
|
||||
status_overlay.pixel_y = FLOOR(icon_height * 0.25, 1)
|
||||
status_overlay.transform = matrix() * (icon_height/world.icon_size) //scale the status's overlay size based on the target's icon size
|
||||
status_overlay.transform = matrix() * (icon_height/ICON_SIZE_Y) //scale the status's overlay size based on the target's icon size
|
||||
status_underlay.pixel_x = -owner.pixel_x
|
||||
status_underlay.transform = matrix() * (icon_height/world.icon_size) * 3
|
||||
status_underlay.transform = matrix() * (icon_height/ICON_SIZE_Y) * 3
|
||||
status_underlay.alpha = 40
|
||||
owner.add_overlay(status_overlay)
|
||||
owner.underlays += status_underlay
|
||||
|
||||
+1
-1
@@ -134,7 +134,7 @@
|
||||
_y = -offset
|
||||
if(WEST)
|
||||
_x = -offset
|
||||
animate(chief, pixel_x = world.icon_size*_x, pixel_y = world.icon_size*_y, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW)
|
||||
animate(chief, pixel_x = ICON_SIZE_X*_x, pixel_y = ICON_SIZE_Y*_y, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW)
|
||||
//Ready for this one?
|
||||
setTo(radius)
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@
|
||||
var/static/list/not_falsey_edits = list(NAMEOF_STATIC(src, bound_width) = TRUE, NAMEOF_STATIC(src, bound_height) = TRUE)
|
||||
if(banned_edits[var_name])
|
||||
return FALSE //PLEASE no.
|
||||
if(careful_edits[var_name] && (var_value % world.icon_size) != 0)
|
||||
if(careful_edits[var_name] && (var_value % ICON_SIZE_ALL) != 0)
|
||||
return FALSE
|
||||
if(not_falsey_edits[var_name] && !var_value)
|
||||
return FALSE
|
||||
@@ -1127,7 +1127,7 @@
|
||||
RESOLVE_ACTIVE_MOVEMENT
|
||||
|
||||
var/atom/oldloc = loc
|
||||
var/is_multi_tile = bound_width > world.icon_size || bound_height > world.icon_size
|
||||
var/is_multi_tile = bound_width > ICON_SIZE_X || bound_height > ICON_SIZE_Y
|
||||
|
||||
SET_ACTIVE_MOVEMENT(oldloc, NONE, TRUE, null)
|
||||
|
||||
@@ -1150,8 +1150,8 @@
|
||||
var/list/new_locs = block(
|
||||
destination,
|
||||
locate(
|
||||
min(world.maxx, destination.x + ROUND_UP(bound_width / 32)),
|
||||
min(world.maxy, destination.y + ROUND_UP(bound_height / 32)),
|
||||
min(world.maxx, destination.x + ROUND_UP(bound_width / ICON_SIZE_X)),
|
||||
min(world.maxy, destination.y + ROUND_UP(bound_height / ICON_SIZE_Y)),
|
||||
destination.z
|
||||
)
|
||||
)
|
||||
|
||||
+24
-24
@@ -175,7 +175,7 @@ Medical HUD! Basic mode needs suit sensors on.
|
||||
|
||||
holder.icon_state = "hud[RoundHealth(src)]"
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
|
||||
//for carbon suit sensors
|
||||
/mob/living/carbon/med_hud_set_health()
|
||||
@@ -188,7 +188,7 @@ Medical HUD! Basic mode needs suit sensors on.
|
||||
return
|
||||
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH)))
|
||||
holder.icon_state = "huddead"
|
||||
else
|
||||
@@ -201,7 +201,7 @@ Medical HUD! Basic mode needs suit sensors on.
|
||||
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
var/virus_threat = check_virus()
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(HAS_TRAIT(src, TRAIT_XENO_HOST))
|
||||
holder.icon_state = "hudxeno"
|
||||
else if(stat == DEAD || (HAS_TRAIT(src, TRAIT_FAKEDEATH)))
|
||||
@@ -244,7 +244,7 @@ FAN HUDs! For identifying other fans on-sight.
|
||||
/mob/living/carbon/human/proc/fan_hud_set_fandom()
|
||||
var/image/holder = hud_list[FAN_HUD]
|
||||
var/icon/hud_icon = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = hud_icon.Height() - world.icon_size
|
||||
holder.pixel_y = hud_icon.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = "hudfan_no"
|
||||
|
||||
var/obj/item/clothing/under/undershirt = w_uniform
|
||||
@@ -275,7 +275,7 @@ Security HUDs! Basic mode shows only the job.
|
||||
/mob/living/carbon/human/proc/sec_hud_set_ID()
|
||||
var/image/holder = hud_list[ID_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
var/sechud_icon_state = wear_id?.get_sechud_job_icon_state()
|
||||
if(!sechud_icon_state || HAS_TRAIT(src, TRAIT_UNKNOWN))
|
||||
sechud_icon_state = "hudno_id"
|
||||
@@ -296,7 +296,7 @@ Security HUDs! Basic mode shows only the job.
|
||||
if(1)
|
||||
holder = hud_list[IMPSEC_FIRST_HUD]
|
||||
var/icon/IC = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = IC.Height() - world.icon_size
|
||||
holder.pixel_y = IC.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = current_implant.hud_icon_state
|
||||
set_hud_image_active(IMPSEC_FIRST_HUD)
|
||||
security_slot++
|
||||
@@ -304,22 +304,22 @@ Security HUDs! Basic mode shows only the job.
|
||||
if(2) //Theoretically if we somehow get multiple sec implants, whatever the most recently implanted implant is will take over the 2nd position
|
||||
holder = hud_list[IMPSEC_SECOND_HUD]
|
||||
var/icon/IC = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = IC.Height() - world.icon_size
|
||||
holder.pixel_x = initial(holder.pixel_x) + 7 //Adds an offset that mirrors the hud blip to the other side of the mob.
|
||||
holder.pixel_y = IC.Height() - ICON_SIZE_Y
|
||||
holder.pixel_x = initial(holder.pixel_x) + (ICON_SIZE_X / 4 - 1) //Adds an offset that mirrors the hud blip to the other side of the mob.
|
||||
holder.icon_state = current_implant.hud_icon_state
|
||||
set_hud_image_active(IMPSEC_SECOND_HUD)
|
||||
|
||||
if(HAS_TRAIT(src, TRAIT_MINDSHIELD))
|
||||
holder = hud_list[IMPLOYAL_HUD]
|
||||
var/icon/IC = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = IC.Height() - world.icon_size
|
||||
holder.pixel_y = IC.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = "hud_imp_loyal"
|
||||
set_hud_image_active(IMPLOYAL_HUD)
|
||||
|
||||
/mob/living/carbon/human/proc/sec_hud_set_security_status()
|
||||
var/image/holder = hud_list[WANTED_HUD]
|
||||
var/icon/sec_icon = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = sec_icon.Height() - world.icon_size
|
||||
holder.pixel_y = sec_icon.Height() - ICON_SIZE_Y
|
||||
|
||||
if (HAS_TRAIT(src, TRAIT_ALWAYS_WANTED))
|
||||
holder.icon_state = "hudwanted"
|
||||
@@ -396,7 +396,7 @@ Diagnostic HUDs!
|
||||
/mob/living/silicon/proc/diag_hud_set_health()
|
||||
var/image/holder = hud_list[DIAG_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(stat == DEAD)
|
||||
holder.icon_state = "huddiagdead"
|
||||
else
|
||||
@@ -405,7 +405,7 @@ Diagnostic HUDs!
|
||||
/mob/living/silicon/proc/diag_hud_set_status()
|
||||
var/image/holder = hud_list[DIAG_STAT_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
switch(stat)
|
||||
if(CONSCIOUS)
|
||||
holder.icon_state = "hudstat"
|
||||
@@ -418,7 +418,7 @@ Diagnostic HUDs!
|
||||
/mob/living/silicon/robot/proc/diag_hud_set_borgcell()
|
||||
var/image/holder = hud_list[DIAG_BATT_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(cell)
|
||||
var/chargelvl = (cell.charge/cell.maxcharge)
|
||||
holder.icon_state = "hudbatt[RoundDiagBar(chargelvl)]"
|
||||
@@ -429,7 +429,7 @@ Diagnostic HUDs!
|
||||
/mob/living/silicon/robot/proc/diag_hud_set_aishell() //Shows tracking beacons on the mech
|
||||
var/image/holder = hud_list[DIAG_TRACK_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(!shell) //Not an AI shell
|
||||
holder.icon_state = null
|
||||
set_hud_image_inactive(DIAG_TRACK_HUD)
|
||||
@@ -444,7 +444,7 @@ Diagnostic HUDs!
|
||||
/mob/living/silicon/ai/proc/diag_hud_set_deployed() //Shows tracking beacons on the mech
|
||||
var/image/holder = hud_list[DIAG_TRACK_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(!deployed_shell)
|
||||
holder.icon_state = null
|
||||
set_hud_image_inactive(DIAG_TRACK_HUD)
|
||||
@@ -458,14 +458,14 @@ Diagnostic HUDs!
|
||||
/obj/vehicle/sealed/mecha/proc/diag_hud_set_mechhealth()
|
||||
var/image/holder = hud_list[DIAG_MECH_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = "huddiag[RoundDiagBar(atom_integrity/max_integrity)]"
|
||||
|
||||
|
||||
/obj/vehicle/sealed/mecha/proc/diag_hud_set_mechcell()
|
||||
var/image/holder = hud_list[DIAG_BATT_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(cell)
|
||||
var/chargelvl = cell.charge/cell.maxcharge
|
||||
holder.icon_state = "hudbatt[RoundDiagBar(chargelvl)]"
|
||||
@@ -475,7 +475,7 @@ Diagnostic HUDs!
|
||||
/obj/vehicle/sealed/mecha/proc/diag_hud_set_mechstat()
|
||||
var/image/holder = hud_list[DIAG_STAT_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(internal_damage)
|
||||
holder.icon_state = "hudwarn"
|
||||
set_hud_image_active(DIAG_STAT_HUD)
|
||||
@@ -487,7 +487,7 @@ Diagnostic HUDs!
|
||||
/obj/vehicle/sealed/mecha/proc/diag_hud_set_mechtracking()
|
||||
var/image/holder = hud_list[DIAG_TRACK_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
var/new_icon_state //This var exists so that the holder's icon state is set only once in the event of multiple mech beacons.
|
||||
for(var/obj/item/mecha_parts/mecha_tracking/T in trackers)
|
||||
if(T.ai_beacon) //Beacon with AI uplink
|
||||
@@ -501,7 +501,7 @@ Diagnostic HUDs!
|
||||
/obj/vehicle/sealed/mecha/proc/diag_hud_set_camera()
|
||||
var/image/holder = hud_list[DIAG_CAMERA_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(chassis_camera?.is_emp_scrambled)
|
||||
holder.icon_state = "hudcamera_empd"
|
||||
return
|
||||
@@ -513,13 +513,13 @@ Diagnostic HUDs!
|
||||
/mob/living/simple_animal/bot/proc/diag_hud_set_bothealth()
|
||||
var/image/holder = hud_list[DIAG_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = "huddiag[RoundDiagBar(health/maxHealth)]"
|
||||
|
||||
/mob/living/simple_animal/bot/proc/diag_hud_set_botstat() //On (With wireless on or off), Off, EMP'ed
|
||||
var/image/holder = hud_list[DIAG_STAT_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(bot_mode_flags & BOT_MODE_ON)
|
||||
holder.icon_state = "hudstat"
|
||||
else if(stat) //Generally EMP causes this
|
||||
@@ -530,7 +530,7 @@ Diagnostic HUDs!
|
||||
/mob/living/simple_animal/bot/proc/diag_hud_set_botmode() //Shows a bot's current operation
|
||||
var/image/holder = hud_list[DIAG_BOT_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(client) //If the bot is player controlled, it will not be following mode logic!
|
||||
holder.icon_state = "hudsentient"
|
||||
return
|
||||
@@ -552,7 +552,7 @@ Diagnostic HUDs!
|
||||
/mob/living/simple_animal/bot/mulebot/proc/diag_hud_set_mulebotcell()
|
||||
var/image/holder = hud_list[DIAG_BATT_HUD]
|
||||
var/icon/I = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(cell)
|
||||
var/chargelvl = (cell.charge/cell.maxcharge)
|
||||
holder.icon_state = "hudbatt[RoundDiagBar(chargelvl)]"
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
playsound(src, 'sound/machines/terminal/terminal_error.ogg', 70, TRUE)
|
||||
return FALSE
|
||||
|
||||
if(mugshot.picture.psize_x > world.icon_size || mugshot.picture.psize_y > world.icon_size)
|
||||
if(mugshot.picture.psize_x > ICON_SIZE_X || mugshot.picture.psize_y > ICON_SIZE_Y)
|
||||
balloon_alert(user, "photo too large!")
|
||||
playsound(src, 'sound/machines/terminal/terminal_error.ogg', 70, TRUE)
|
||||
return FALSE
|
||||
|
||||
@@ -60,8 +60,8 @@
|
||||
var/icon_y = text2num(LAZYACCESS(modifiers, VIS_Y))
|
||||
if(isnull(icon_y))
|
||||
icon_y = text2num(LAZYACCESS(modifiers, ICON_Y))
|
||||
var/our_x = round(icon_x / world.icon_size)
|
||||
var/our_y = round(icon_y / world.icon_size)
|
||||
var/our_x = round(icon_x / ICON_SIZE_X)
|
||||
var/our_y = round(icon_y / ICON_SIZE_Y)
|
||||
given_turf = locate(owner.x + our_x - round(view_list[1]/2), owner.y + our_y - round(view_list[2]/2), owner.z)
|
||||
given_x = round(icon_x - world.icon_size * our_x, 1)
|
||||
given_y = round(icon_y - world.icon_size * our_y, 1)
|
||||
given_x = round(icon_x - ICON_SIZE_X * our_x, 1)
|
||||
given_y = round(icon_y - ICON_SIZE_Y * our_y, 1)
|
||||
|
||||
@@ -441,7 +441,7 @@
|
||||
if(size_calc_target)
|
||||
layer = size_calc_target.layer + 0.01
|
||||
var/icon/I = icon(size_calc_target.icon, size_calc_target.icon_state, size_calc_target.dir)
|
||||
size_matrix = matrix() * (I.Height()/world.icon_size)
|
||||
size_matrix = matrix() * (I.Height()/ICON_SIZE_Y)
|
||||
transform = size_matrix //scale the bleed overlay's size based on the target's icon size
|
||||
var/matrix/M = transform
|
||||
if(shrink)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
var/obj/effect/projectile/tracer/PB = new beam_type
|
||||
if(isnull(light_color_override))
|
||||
light_color_override = color
|
||||
PB.apply_vars(angle_between_points(starting, ending), midpoint.return_px(), midpoint.return_py(), color, pixel_length_between_points(starting, ending) / world.icon_size, midpoint.return_turf(), 0)
|
||||
PB.apply_vars(angle_between_points(starting, ending), midpoint.return_px(), midpoint.return_py(), color, pixel_length_between_points(starting, ending) / ICON_SIZE_ALL, midpoint.return_turf(), 0)
|
||||
. = PB
|
||||
if(light_range > 0 && light_intensity > 0)
|
||||
var/list/turf/line = get_line(starting.return_turf(), ending.return_turf())
|
||||
|
||||
@@ -504,8 +504,8 @@
|
||||
var/clicky
|
||||
|
||||
if(LAZYACCESS(modifiers, ICON_X) && LAZYACCESS(modifiers, ICON_Y))
|
||||
clickx = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
clicky = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
clickx = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(ICON_SIZE_X/2), ICON_SIZE_X/2)
|
||||
clicky = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(ICON_SIZE_Y/2), ICON_SIZE_Y/2)
|
||||
|
||||
if(!instant)
|
||||
to_chat(user, span_notice("You start drawing a [temp] on the [target.name]..."))
|
||||
|
||||
@@ -130,9 +130,9 @@ GLOBAL_VAR_INIT(chicks_from_eggs, 0)
|
||||
return ITEM_INTERACT_BLOCKING
|
||||
var/atom/broken_egg = new /obj/item/food/rawegg(interacting_with.loc)
|
||||
if(LAZYACCESS(modifiers, ICON_X))
|
||||
broken_egg.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
broken_egg.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(ICON_SIZE_X/2), ICON_SIZE_X/2)
|
||||
if(LAZYACCESS(modifiers, ICON_Y))
|
||||
broken_egg.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
broken_egg.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(ICON_SIZE_Y/2), ICON_SIZE_Y/2)
|
||||
playsound(user, 'sound/items/sheath.ogg', 40, TRUE)
|
||||
reagents.copy_to(broken_egg, reagents.total_volume)
|
||||
|
||||
|
||||
@@ -44,6 +44,6 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/sign/poster/party_game, 32)
|
||||
var/list/modifiers = params2list(params)
|
||||
if(!LAZYACCESS(modifiers, ICON_X) || !LAZYACCESS(modifiers, ICON_Y))
|
||||
return
|
||||
I.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(ICON_SIZE_X/2), ICON_SIZE_X/2)
|
||||
I.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(ICON_SIZE_Y/2), ICON_SIZE_Y/2)
|
||||
return TRUE
|
||||
|
||||
@@ -1562,7 +1562,7 @@ GLOBAL_LIST_EMPTY(intento_players)
|
||||
#define DISARM "disarm"
|
||||
#define GRAB "grab"
|
||||
#define HARM "harm"
|
||||
#define ICON_SPLIT world.icon_size/2
|
||||
#define ICON_SPLIT ICON_SIZE_ALL/2
|
||||
|
||||
// These states do not have any associated processing.
|
||||
#define STATE_AWAITING_PLAYER_INPUT "awaiting_player_input"
|
||||
|
||||
@@ -1200,8 +1200,8 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
user.do_attack_animation(target, "nothing")
|
||||
var/list/modifiers = params2list(params)
|
||||
var/damage_mod = 1
|
||||
var/x_slashed = text2num(modifiers[ICON_X]) || world.icon_size/2 //in case we arent called by a client
|
||||
var/y_slashed = text2num(modifiers[ICON_Y]) || world.icon_size/2 //in case we arent called by a client
|
||||
var/x_slashed = text2num(modifiers[ICON_X]) || ICON_SIZE_X/2 //in case we arent called by a client
|
||||
var/y_slashed = text2num(modifiers[ICON_Y]) || ICON_SIZE_Y/2 //in case we arent called by a client
|
||||
new /obj/effect/temp_visual/slash(get_turf(target), target, x_slashed, y_slashed, slash_color)
|
||||
if(target == previous_target?.resolve()) //if the same target, we calculate a damage multiplier if you swing your mouse around
|
||||
var/x_mod = previous_x - x_slashed
|
||||
@@ -1249,7 +1249,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
var/matrix/new_transform = matrix()
|
||||
new_transform.Turn(rand(1, 360)) // Random slash angle
|
||||
var/datum/decompose_matrix/decomp = target.transform.decompose()
|
||||
new_transform.Translate((x_slashed - world.icon_size/2) * decomp.scale_x, (y_slashed - world.icon_size/2) * decomp.scale_y) // Move to where we clicked
|
||||
new_transform.Translate((x_slashed - ICON_SIZE_X/2) * decomp.scale_x, (y_slashed - ICON_SIZE_Y/2) * decomp.scale_y) // Move to where we clicked
|
||||
//Follow target's transform while ignoring scaling
|
||||
new_transform.Turn(decomp.rotation)
|
||||
new_transform.Translate(decomp.shift_x, decomp.shift_y)
|
||||
|
||||
@@ -73,8 +73,8 @@
|
||||
if(!LAZYACCESS(modifiers, ICON_X) || !LAZYACCESS(modifiers, ICON_Y))
|
||||
return
|
||||
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
|
||||
used_item.pixel_x = used_item.base_pixel_x + clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
used_item.pixel_y = used_item.base_pixel_y + clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
used_item.pixel_x = used_item.base_pixel_x + clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(ICON_SIZE_X/2), ICON_SIZE_X/2)
|
||||
used_item.pixel_y = used_item.base_pixel_y + clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(ICON_SIZE_Y/2), ICON_SIZE_Y/2)
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -309,8 +309,8 @@
|
||||
// Items are centered by default, but we move them if click ICON_X and ICON_Y are available
|
||||
if(LAZYACCESS(modifiers, ICON_X) && LAZYACCESS(modifiers, ICON_Y))
|
||||
// Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
|
||||
tool.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(world.icon_size*0.5), world.icon_size*0.5)
|
||||
tool.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(world.icon_size*0.5), world.icon_size*0.5)
|
||||
tool.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(ICON_SIZE_X*0.5), ICON_SIZE_X*0.5)
|
||||
tool.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(ICON_SIZE_Y*0.5), ICON_SIZE_Y*0.5)
|
||||
AfterPutItemOnTable(tool, user)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
return
|
||||
var/image/holder = owner.hud_list[GLAND_HUD]
|
||||
var/icon/I = icon(owner.icon, owner.icon_state, owner.dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
if(active_mind_control)
|
||||
holder.icon_state = "hudgland_active"
|
||||
else if(mind_control_uses)
|
||||
|
||||
@@ -990,11 +990,11 @@
|
||||
var/icon/final_icon = render_preview_outfit(/datum/outfit/changeling)
|
||||
var/icon/split_icon = render_preview_outfit(/datum/outfit/job/engineer)
|
||||
|
||||
final_icon.Shift(WEST, world.icon_size / 2)
|
||||
final_icon.Shift(EAST, world.icon_size / 2)
|
||||
final_icon.Shift(WEST, ICON_SIZE_X / 2)
|
||||
final_icon.Shift(EAST, ICON_SIZE_X / 2)
|
||||
|
||||
split_icon.Shift(EAST, world.icon_size / 2)
|
||||
split_icon.Shift(WEST, world.icon_size / 2)
|
||||
split_icon.Shift(EAST, ICON_SIZE_X / 2)
|
||||
split_icon.Shift(WEST, ICON_SIZE_X / 2)
|
||||
|
||||
final_icon.Blend(split_icon, ICON_OVERLAY)
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
if(hud_icon)
|
||||
var/image/holder = user.hud_list[ID_HUD]
|
||||
var/icon/I = icon(user.icon, user.icon_state, user.dir)
|
||||
holder.pixel_y = I.Height() - world.icon_size
|
||||
holder.pixel_y = I.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = hud_icon
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(!moving_button)
|
||||
continue
|
||||
var/first_available_slot = position_list[1]
|
||||
var/our_x = position[1] + first_available_slot * world.icon_size // Offset any new buttons into our list
|
||||
var/our_x = position[1] + first_available_slot * ICON_SIZE_X // Offset any new buttons into our list
|
||||
hud.position_action(moving_button, offset_to_screen_loc(our_x, position[2], our_view))
|
||||
blood_spell.positioned = first_available_slot
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@
|
||||
var/icon/teammate = render_preview_outfit(preview_outfit_behind)
|
||||
teammate.Blend(rgb(128, 128, 128, 128), ICON_MULTIPLY)
|
||||
|
||||
final_icon.Blend(teammate, ICON_UNDERLAY, -world.icon_size / 4, 0)
|
||||
final_icon.Blend(teammate, ICON_UNDERLAY, world.icon_size / 4, 0)
|
||||
final_icon.Blend(teammate, ICON_UNDERLAY, -ICON_SIZE_X / 4, 0)
|
||||
final_icon.Blend(teammate, ICON_UNDERLAY, ICON_SIZE_X / 4, 0)
|
||||
|
||||
if (!isnull(nuke_icon_state))
|
||||
var/icon/nuke = icon('icons/obj/machines/nuke.dmi', nuke_icon_state)
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
var/icon/pandora = icon('icons/mob/simple/lavaland/lavaland_elites.dmi', "pandora")
|
||||
pandora.Blend(rgb(128, 128, 128, 128), ICON_MULTIPLY)
|
||||
final_icon.Blend(pandora, ICON_UNDERLAY, -world.icon_size / 4, 0)
|
||||
final_icon.Blend(pandora, ICON_UNDERLAY, -ICON_SIZE_X / 4, 0)
|
||||
|
||||
var/icon/rat = icon('icons/mob/simple/animal.dmi', "regalrat")
|
||||
rat.Blend(rgb(128, 128, 128, 128), ICON_MULTIPLY)
|
||||
final_icon.Blend(rat, ICON_UNDERLAY, world.icon_size / 4, 0)
|
||||
final_icon.Blend(rat, ICON_UNDERLAY, ICON_SIZE_X / 4, 0)
|
||||
|
||||
final_icon.Scale(ANTAGONIST_PREVIEW_ICON_SIZE, ANTAGONIST_PREVIEW_ICON_SIZE)
|
||||
return final_icon
|
||||
|
||||
@@ -348,7 +348,7 @@ Moving interrupts
|
||||
//How long whole process takes
|
||||
var/sculpting_time = 30 SECONDS
|
||||
//Single interruptible progress period
|
||||
var/sculpting_period = round(sculpting_time / world.icon_size) //this is just so it reveals pixels line by line for each.
|
||||
var/sculpting_period = round(sculpting_time / ICON_SIZE_Y) //this is just so it reveals pixels line by line for each.
|
||||
var/interrupted = FALSE
|
||||
var/remaining_time = sculpting_time - (prepared_block.completion * sculpting_time)
|
||||
|
||||
@@ -473,7 +473,7 @@ Moving interrupts
|
||||
return FALSE
|
||||
//No big icon things
|
||||
var/list/icon_dimensions = get_icon_dimensions(target.icon)
|
||||
if(icon_dimensions["width"] != world.icon_size || icon_dimensions["height"] != world.icon_size)
|
||||
if(icon_dimensions["width"] != ICON_SIZE_X || icon_dimensions["height"] != ICON_SIZE_Y)
|
||||
user.balloon_alert(user, "sculpt target is too big!")
|
||||
return FALSE
|
||||
return TRUE
|
||||
@@ -509,7 +509,7 @@ Moving interrupts
|
||||
remove_filter("partial_uncover")
|
||||
target_appearance_with_filters = null
|
||||
else
|
||||
var/mask_offset = min(world.icon_size,round(completion * world.icon_size))
|
||||
var/mask_offset = min(ICON_SIZE_Y,round(completion * ICON_SIZE_Y))
|
||||
remove_filter("partial_uncover")
|
||||
add_filter("partial_uncover", 1, alpha_mask_filter(icon = white, y = -mask_offset))
|
||||
target_appearance_with_filters.filters = filter(type="alpha",icon=white,y=-mask_offset,flags=MASK_INVERSE)
|
||||
|
||||
@@ -255,15 +255,15 @@
|
||||
var/x_move = 0
|
||||
var/y_move = 0
|
||||
if(movement_dir & NORTH)
|
||||
y_move = -32
|
||||
y_move = -ICON_SIZE_Y
|
||||
else if(movement_dir & SOUTH)
|
||||
y_move = 32
|
||||
y_move = ICON_SIZE_Y
|
||||
if(movement_dir & WEST)
|
||||
x_move = 32
|
||||
x_move = ICON_SIZE_X
|
||||
else if(movement_dir & EAST)
|
||||
x_move = -32
|
||||
x_move = -ICON_SIZE_X
|
||||
|
||||
var/fake_glide_time = round(world.icon_size / glide_size * world.tick_lag, world.tick_lag)
|
||||
var/fake_glide_time = round(ICON_SIZE_ALL / glide_size * world.tick_lag, world.tick_lag)
|
||||
for(var/obj/effect/ebeam/beam as anything in active_beam?.elements)
|
||||
var/matrix/base_transform = matrix(beam.transform)
|
||||
beam.transform = beam.transform.Translate(x_move, y_move)
|
||||
|
||||
@@ -614,8 +614,8 @@
|
||||
our_client.set_eye(target_move)
|
||||
// Let's smooth out that movement with an animate yeah?
|
||||
// If the new x is greater (move is left to right) we get a negative offset. vis versa
|
||||
our_client.pixel_x = (x - target_move.x) * world.icon_size
|
||||
our_client.pixel_y = (y - target_move.y) * world.icon_size
|
||||
our_client.pixel_x = (x - target_move.x) * ICON_SIZE_X
|
||||
our_client.pixel_y = (y - target_move.y) * ICON_SIZE_Y
|
||||
animate(our_client, pixel_x = 0, pixel_y = 0, time = 0.05 SECONDS)
|
||||
our_client.move_delay = world.time + 0.05 SECONDS
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
if (isnull(viewer_client))
|
||||
return
|
||||
|
||||
var/bound_width = world.icon_size
|
||||
var/bound_width = ICON_SIZE_X
|
||||
if (ismovable(src))
|
||||
var/atom/movable/movable_source = src
|
||||
bound_width = movable_source.bound_width
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
animate(
|
||||
balloon_alert,
|
||||
pixel_y = world.icon_size * 1.2,
|
||||
pixel_y = ICON_SIZE_Y * 1.2,
|
||||
time = BALLOON_TEXT_TOTAL_LIFETIME(length_mult),
|
||||
easing = SINE_EASING | EASE_OUT,
|
||||
)
|
||||
|
||||
@@ -398,11 +398,11 @@ For inspiration, here is changeling's:
|
||||
var/icon/final_icon = render_preview_outfit(/datum/outfit/changeling)
|
||||
var/icon/split_icon = render_preview_outfit(/datum/outfit/job/engineer)
|
||||
|
||||
final_icon.Shift(WEST, world.icon_size / 2)
|
||||
final_icon.Shift(EAST, world.icon_size / 2)
|
||||
final_icon.Shift(WEST, ICON_SIZE_X / 2)
|
||||
final_icon.Shift(EAST, ICON_SIZE_X / 2)
|
||||
|
||||
split_icon.Shift(EAST, world.icon_size / 2)
|
||||
split_icon.Shift(WEST, world.icon_size / 2)
|
||||
split_icon.Shift(EAST, ICON_SIZE_X / 2)
|
||||
split_icon.Shift(WEST, ICON_SIZE_X / 2)
|
||||
|
||||
final_icon.Blend(split_icon, ICON_OVERLAY)
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
var/icon/icons = GLOB.available_ui_styles[value]
|
||||
|
||||
var/icon/icon = icon(icons, "hand_r")
|
||||
icon.Crop(1, 1, world.icon_size * 2, world.icon_size)
|
||||
icon.Blend(icon(icons, "hand_l"), ICON_OVERLAY, world.icon_size)
|
||||
icon.Crop(1, 1, ICON_SIZE_X * 2, ICON_SIZE_Y)
|
||||
icon.Blend(icon(icons, "hand_l"), ICON_OVERLAY, ICON_SIZE_X)
|
||||
|
||||
return icon
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ ADMIN_VERB(reset_ooc_color, R_FUN, "Reset Player OOC Color", "Returns player OOC
|
||||
|
||||
var/desired_width = 0
|
||||
if(zoom_value)
|
||||
desired_width = round(view_size[1] * zoom_value * world.icon_size)
|
||||
desired_width = round(view_size[1] * zoom_value * ICON_SIZE_X)
|
||||
else
|
||||
|
||||
// Looks like we expect mapwindow.size to be "ixj" where i and j are numbers.
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
/obj/item/clothing/shoes/proc/restore_offsets(mob/user)
|
||||
equipped_before_drop = FALSE
|
||||
user.pixel_y -= offset
|
||||
worn_y_dimension = world.icon_size
|
||||
worn_y_dimension = ICON_SIZE_Y
|
||||
|
||||
/obj/item/clothing/shoes/dropped(mob/user)
|
||||
var/atom/movable/screen/alert/our_alert = our_alert_ref?.resolve()
|
||||
|
||||
@@ -73,8 +73,8 @@
|
||||
return
|
||||
if(user.transferItemToLoc(I, src, silent = FALSE))
|
||||
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
|
||||
I.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(world.icon_size/2), world.icon_size/2)
|
||||
I.pixel_x = clamp(text2num(LAZYACCESS(modifiers, ICON_X)) - 16, -(ICON_SIZE_X/2), ICON_SIZE_X/2)
|
||||
I.pixel_y = clamp(text2num(LAZYACCESS(modifiers, ICON_Y)) - 16, -(ICON_SIZE_Y/2), ICON_SIZE_Y/2)
|
||||
to_chat(user, span_notice("You place [I] on [src]."))
|
||||
AddToGrill(I, user)
|
||||
else
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
return
|
||||
// this gets badly murdered by sidemap
|
||||
soup_smoke = new(parent, particle_type)
|
||||
soup_smoke.set_particle_position(container_x, round(world.icon_size * 0.66), 0)
|
||||
soup_smoke.set_particle_position(container_x, round(ICON_SIZE_Y * 0.66), 0)
|
||||
return
|
||||
|
||||
QDEL_NULL(soup_smoke)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
var/obj/visual = image('icons/hud/screen_gen.dmi', mother.loc, "arrow", FLY_LAYER)
|
||||
|
||||
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(flick_overlay_global), visual, list(hallucinator.client), 2.5 SECONDS)
|
||||
animate(visual, pixel_x = (tile.x - mother.x) * world.icon_size, pixel_y = (tile.y - mother.y) * world.icon_size, time = 1.7, easing = EASE_OUT)
|
||||
animate(visual, pixel_x = (tile.x - mother.x) * ICON_SIZE_X, pixel_y = (tile.y - mother.y) * ICON_SIZE_Y, time = 1.7, easing = EASE_OUT)
|
||||
|
||||
/datum/hallucination/your_mother/proc/talk(text)
|
||||
var/plus_runechat = hallucinator.client?.prefs.read_preference(/datum/preference/toggle/enable_runechat)
|
||||
|
||||
@@ -201,8 +201,8 @@
|
||||
var/list/hand_back
|
||||
if(!(get_offset.light_flags & LIGHT_IGNORE_OFFSET))
|
||||
hand_back = get_visual_offset(get_offset)
|
||||
hand_back[1] = -hand_back[1] / world.icon_size
|
||||
hand_back[2] = -hand_back[2] / world.icon_size
|
||||
hand_back[1] = -hand_back[1] / ICON_SIZE_X
|
||||
hand_back[2] = -hand_back[2] / ICON_SIZE_Y
|
||||
else
|
||||
hand_back = list(0, 0)
|
||||
|
||||
|
||||
@@ -160,10 +160,10 @@
|
||||
var/y = width - round((id - 1) / width)
|
||||
var/x = ((id - 1) % width) + 1
|
||||
|
||||
var/x_start = 1 + (x - 1) * world.icon_size
|
||||
var/x_end = x_start + world.icon_size - 1
|
||||
var/y_start = 1 + ((y - 1) * world.icon_size)
|
||||
var/y_end = y_start + world.icon_size - 1
|
||||
var/x_start = 1 + (x - 1) * ICON_SIZE_X
|
||||
var/x_end = x_start + ICON_SIZE_X - 1
|
||||
var/y_start = 1 + ((y - 1) * ICON_SIZE_Y)
|
||||
var/y_end = y_start + ICON_SIZE_Y - 1
|
||||
|
||||
var/icon/T = new(base_icon)
|
||||
T.Crop(x_start,y_start,x_end,y_end)
|
||||
|
||||
@@ -483,7 +483,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
var/list/icon_dimensions = get_icon_dimensions(target.icon)
|
||||
var/orbitsize = (icon_dimensions["width"] + icon_dimensions["height"]) * 0.5
|
||||
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
|
||||
orbitsize -= (orbitsize/ICON_SIZE_ALL)*(ICON_SIZE_ALL*0.25)
|
||||
|
||||
var/rot_seg
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/mob/living/basic/bot/proc/diag_hud_set_bothealth()
|
||||
var/image/holder = hud_list[DIAG_HUD]
|
||||
var/icon/icon_image = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = icon_image.Height() - world.icon_size
|
||||
holder.pixel_y = icon_image.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = "huddiag[RoundDiagBar(health/maxHealth)]"
|
||||
|
||||
/mob/living/basic/bot/proc/diag_hud_set_botstat() //On (With wireless on or off), Off, EMP'ed
|
||||
var/image/holder = hud_list[DIAG_STAT_HUD]
|
||||
var/icon/our_icon = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = our_icon.Height() - world.icon_size
|
||||
holder.pixel_y = our_icon.Height() - ICON_SIZE_Y
|
||||
if(bot_mode_flags & BOT_MODE_ON)
|
||||
holder.icon_state = "hudstat"
|
||||
return
|
||||
@@ -19,7 +19,7 @@
|
||||
/mob/living/basic/bot/proc/diag_hud_set_botmode() //Shows a bot's current operation
|
||||
var/image/holder = hud_list[DIAG_BOT_HUD]
|
||||
var/icon/icon_image = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = icon_image.Height() - world.icon_size
|
||||
holder.pixel_y = icon_image.Height() - ICON_SIZE_Y
|
||||
if(client) //If the bot is player controlled, it will not be following mode logic!
|
||||
holder.icon_state = "hudsentient"
|
||||
return
|
||||
|
||||
@@ -221,13 +221,13 @@
|
||||
/mob/living/basic/drone/med_hud_set_health()
|
||||
var/image/holder = hud_list[DIAG_HUD]
|
||||
var/icon/hud_icon = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = hud_icon.Height() - world.icon_size
|
||||
holder.pixel_y = hud_icon.Height() - ICON_SIZE_Y
|
||||
holder.icon_state = "huddiag[RoundDiagBar(health/maxHealth)]"
|
||||
|
||||
/mob/living/basic/drone/med_hud_set_status()
|
||||
var/image/holder = hud_list[DIAG_STAT_HUD]
|
||||
var/icon/hud_icon = icon(icon, icon_state, dir)
|
||||
holder.pixel_y = hud_icon.Height() - world.icon_size
|
||||
holder.pixel_y = hud_icon.Height() - ICON_SIZE_Y
|
||||
if(stat == DEAD)
|
||||
holder.icon_state = "huddead2"
|
||||
else if(incapacitated)
|
||||
|
||||
@@ -98,8 +98,8 @@
|
||||
|
||||
var/turf/my_turf = get_turf(src)
|
||||
dir = get_dir(spawn_from, my_turf)
|
||||
var/move_x = (my_turf.x - spawn_from.x) * world.icon_size
|
||||
var/move_y = (my_turf.y - spawn_from.y) * world.icon_size
|
||||
var/move_x = (my_turf.x - spawn_from.x) * ICON_SIZE_X
|
||||
var/move_y = (my_turf.y - spawn_from.y) * ICON_SIZE_Y
|
||||
pixel_x = -move_x
|
||||
pixel_y = -move_y
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
var/happiness_percentage = my_raptor.ai_controller?.blackboard[BB_BASIC_HAPPINESS]
|
||||
var/obj/effect/overlay/happiness_overlay/display = new
|
||||
display.set_hearts(happiness_percentage)
|
||||
display.pixel_y = world.icon_size * 0.5
|
||||
display.pixel_y = ICON_SIZE_Y * 0.5
|
||||
data["raptor_happiness"] = icon2base64(getFlatIcon(display))
|
||||
qdel(display)
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@
|
||||
|
||||
var/list/icon_dimensions = get_icon_dimensions(target.icon)
|
||||
var/orbitsize = (icon_dimensions["width"] + icon_dimensions["height"]) * 0.5
|
||||
orbitsize -= (orbitsize / world.icon_size) * (world.icon_size * 0.25)
|
||||
orbitsize -= (orbitsize / ICON_SIZE_ALL) * (ICON_SIZE_ALL * 0.25)
|
||||
orbit(target, orbitsize)
|
||||
|
||||
/mob/living/basic/revenant/adjust_health(amount, updating_health = TRUE, forced = FALSE)
|
||||
|
||||
@@ -832,7 +832,7 @@
|
||||
if(!livingdoll.filtered)
|
||||
livingdoll.filtered = TRUE
|
||||
var/icon/mob_mask = icon(icon, icon_state)
|
||||
if(mob_mask.Height() > world.icon_size || mob_mask.Width() > world.icon_size)
|
||||
if(mob_mask.Height() > ICON_SIZE_Y || mob_mask.Width() > ICON_SIZE_X)
|
||||
var/health_doll_icon_state = health_doll_icon ? health_doll_icon : "megasprite"
|
||||
mob_mask = icon('icons/hud/screen_gen.dmi', health_doll_icon_state) //swap to something generic if they have no special doll
|
||||
livingdoll.add_filter("mob_shape_mask", 1, alpha_mask_filter(icon = mob_mask))
|
||||
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
// I'd like to make this scale with the steps we take, but it like, just can't
|
||||
// So we're doin this instead
|
||||
eyeobj.glide_size = world.icon_size
|
||||
eyeobj.glide_size = ICON_SIZE_ALL
|
||||
|
||||
last_moved = world.timeofday
|
||||
if(acceleration)
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
if((width > 0) && (height > 0))
|
||||
var/matrix/M = matrix()
|
||||
M.Scale(width + 0.5, height + 0.5)
|
||||
M.Translate((width-1)/2 * world.icon_size, (height-1)/2 * world.icon_size)
|
||||
M.Translate((width-1)/2 * ICON_SIZE_X, (height-1)/2 * ICON_SIZE_Y)
|
||||
highlighted_background.transform = M
|
||||
standard_background.transform = M
|
||||
add_overlay(highlighted ? highlighted_background : standard_background)
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
if(catcher && catcher.given_turf)
|
||||
catcher.calculate_params()
|
||||
/// Take the target and subtract self for relative grid position. Then take the pixel x on the tile and divide by the tiles pixel size, and add 0.5 so it's fired from the center
|
||||
var/sneeze_x = catcher.given_turf.x - x + catcher.given_x / world.icon_size - 0.5
|
||||
var/sneeze_y = catcher.given_turf.y - y + catcher.given_y / world.icon_size - 0.5
|
||||
var/sneeze_x = catcher.given_turf.x - x + catcher.given_x / ICON_SIZE_X - 0.5
|
||||
var/sneeze_y = catcher.given_turf.y - y + catcher.given_y / ICON_SIZE_Y - 0.5
|
||||
angle = ATAN2(sneeze_y, sneeze_x)
|
||||
|
||||
// Check if we're within the sneeze cone, otherwise just sneeze straight
|
||||
|
||||
@@ -167,19 +167,21 @@
|
||||
var/client/C = M.client
|
||||
var/oldx = C.pixel_x
|
||||
var/oldy = C.pixel_y
|
||||
var/max = strength*world.icon_size
|
||||
var/min = -(strength*world.icon_size)
|
||||
var/max_x = strength*ICON_SIZE_X
|
||||
var/max_y = strength*ICON_SIZE_Y
|
||||
var/min_x = -(strength*ICON_SIZE_X)
|
||||
var/min_y = -(strength*ICON_SIZE_Y)
|
||||
|
||||
//How much time to allot for each pixel moved
|
||||
var/time_scalar = (1 / world.icon_size) * TILES_PER_SECOND
|
||||
var/time_scalar = (1 / ICON_SIZE_ALL) * TILES_PER_SECOND
|
||||
var/last_x = oldx
|
||||
var/last_y = oldy
|
||||
|
||||
var/time_spent = 0
|
||||
while(time_spent < duration)
|
||||
//Get a random pos in our box
|
||||
var/x_pos = rand(min, max) + oldx
|
||||
var/y_pos = rand(min, max) + oldy
|
||||
var/x_pos = rand(min_x, max_x) + oldx
|
||||
var/y_pos = rand(min_y, max_y) + oldy
|
||||
|
||||
//We take the smaller of our two distances so things still have the propencity to feel somewhat jerky
|
||||
var/time = round(max(min(abs(last_x - x_pos), abs(last_y - y_pos)) * time_scalar, 1))
|
||||
|
||||
@@ -81,12 +81,12 @@
|
||||
return
|
||||
mod.wearer.setDir(get_dir(mod.wearer, grabbed_atom))
|
||||
if(grabbed_atom.loc == kinesis_catcher.given_turf)
|
||||
if(grabbed_atom.pixel_x == kinesis_catcher.given_x - world.icon_size/2 && grabbed_atom.pixel_y == kinesis_catcher.given_y - world.icon_size/2)
|
||||
if(grabbed_atom.pixel_x == kinesis_catcher.given_x - ICON_SIZE_X/2 && grabbed_atom.pixel_y == kinesis_catcher.given_y - ICON_SIZE_Y/2)
|
||||
return //spare us redrawing if we are standing still
|
||||
animate(grabbed_atom, 0.2 SECONDS, pixel_x = grabbed_atom.base_pixel_x + kinesis_catcher.given_x - world.icon_size/2, pixel_y = grabbed_atom.base_pixel_y + kinesis_catcher.given_y - world.icon_size/2)
|
||||
animate(grabbed_atom, 0.2 SECONDS, pixel_x = grabbed_atom.base_pixel_x + kinesis_catcher.given_x - ICON_SIZE_X/2, pixel_y = grabbed_atom.base_pixel_y + kinesis_catcher.given_y - ICON_SIZE_Y/2)
|
||||
kinesis_beam.redrawing()
|
||||
return
|
||||
animate(grabbed_atom, 0.2 SECONDS, pixel_x = grabbed_atom.base_pixel_x + kinesis_catcher.given_x - world.icon_size/2, pixel_y = grabbed_atom.base_pixel_y + kinesis_catcher.given_y - world.icon_size/2)
|
||||
animate(grabbed_atom, 0.2 SECONDS, pixel_x = grabbed_atom.base_pixel_x + kinesis_catcher.given_x - ICON_SIZE_X/2, pixel_y = grabbed_atom.base_pixel_y + kinesis_catcher.given_y - ICON_SIZE_Y/2)
|
||||
kinesis_beam.redrawing()
|
||||
var/turf/next_turf = get_step_towards(grabbed_atom, kinesis_catcher.given_turf)
|
||||
if(grabbed_atom.Move(next_turf, get_dir(grabbed_atom, next_turf), 8))
|
||||
@@ -100,13 +100,13 @@
|
||||
var/pixel_y_change = 0
|
||||
var/direction = get_dir(grabbed_atom, next_turf)
|
||||
if(direction & NORTH)
|
||||
pixel_y_change = world.icon_size/2
|
||||
pixel_y_change = ICON_SIZE_Y/2
|
||||
else if(direction & SOUTH)
|
||||
pixel_y_change = -world.icon_size/2
|
||||
pixel_y_change = -ICON_SIZE_Y/2
|
||||
if(direction & EAST)
|
||||
pixel_x_change = world.icon_size/2
|
||||
pixel_x_change = ICON_SIZE_X/2
|
||||
else if(direction & WEST)
|
||||
pixel_x_change = -world.icon_size/2
|
||||
pixel_x_change = -ICON_SIZE_X/2
|
||||
animate(grabbed_atom, 0.2 SECONDS, pixel_x = grabbed_atom.base_pixel_x + pixel_x_change, pixel_y = grabbed_atom.base_pixel_y + pixel_y_change)
|
||||
kinesis_beam.redrawing()
|
||||
if(!isitem(grabbed_atom) || !COOLDOWN_FINISHED(src, hit_cooldown))
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/label/proc/stick_to_atom(atom/applying_to, stick_px = world.icon_size / 2, stick_py = world.icon_size / 2)
|
||||
/obj/item/label/proc/stick_to_atom(atom/applying_to, stick_px = ICON_SIZE_X / 2, stick_py = ICON_SIZE_Y / 2)
|
||||
applying_to.AddComponent( \
|
||||
/datum/component/sticker, \
|
||||
stickering_atom = src, \
|
||||
|
||||
@@ -226,8 +226,8 @@
|
||||
dead_spotted += mob
|
||||
desc += mob.get_photo_description(src)
|
||||
|
||||
var/psize_x = (size_x * 2 + 1) * world.icon_size
|
||||
var/psize_y = (size_y * 2 + 1) * world.icon_size
|
||||
var/psize_x = (size_x * 2 + 1) * ICON_SIZE_X
|
||||
var/psize_y = (size_y * 2 + 1) * ICON_SIZE_Y
|
||||
var/icon/get_icon = camera_get_icon(turfs, target_turf, psize_x, psize_y, clone_area, size_x, size_y, (size_x * 2 + 1), (size_y * 2 + 1))
|
||||
qdel(clone_area)
|
||||
get_icon.Blend("#000", ICON_UNDERLAY)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
step_y = AM.step_y
|
||||
. = ..()
|
||||
|
||||
#define PHYSICAL_POSITION(atom) ((atom.y * world.icon_size) + (atom.pixel_y))
|
||||
#define PHYSICAL_POSITION(atom) ((atom.y * ICON_SIZE_Y) + (atom.pixel_y))
|
||||
|
||||
/obj/item/camera/proc/camera_get_icon(list/turfs, turf/center, psize_x = 96, psize_y = 96, datum/turf_reservation/clone_area, size_x, size_y, total_x, total_y)
|
||||
var/list/atoms = list()
|
||||
@@ -99,8 +99,8 @@
|
||||
|
||||
if(!skip_normal) //these are not clones
|
||||
for(var/atom/A in sorted)
|
||||
var/xo = (A.x - center.x) * world.icon_size + A.pixel_x + xcomp
|
||||
var/yo = (A.y - center.y) * world.icon_size + A.pixel_y + ycomp
|
||||
var/xo = (A.x - center.x) * ICON_SIZE_X + A.pixel_x + xcomp
|
||||
var/yo = (A.y - center.y) * ICON_SIZE_Y + A.pixel_y + ycomp
|
||||
if(ismovable(A))
|
||||
var/atom/movable/AM = A
|
||||
xo += AM.step_x
|
||||
@@ -116,9 +116,9 @@
|
||||
CHECK_TICK
|
||||
continue
|
||||
// Center of the image in X
|
||||
var/xo = (clone.x - center.x) * world.icon_size + clone.pixel_x + xcomp + clone.step_x
|
||||
var/xo = (clone.x - center.x) * ICON_SIZE_X + clone.pixel_x + xcomp + clone.step_x
|
||||
// Center of the image in Y
|
||||
var/yo = (clone.y - center.y) * world.icon_size + clone.pixel_y + ycomp + clone.step_y
|
||||
var/yo = (clone.y - center.y) * ICON_SIZE_Y + clone.pixel_y + ycomp + clone.step_y
|
||||
|
||||
if(clone.transform) // getFlatIcon doesn't give a snot about transforms.
|
||||
var/datum/decompose_matrix/decompose = clone.transform.decompose()
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_MOVABLE_POINTED, pointed_atom, visual, intentional)
|
||||
|
||||
animate(visual, pixel_x = (tile.x - our_tile.x) * world.icon_size + pointed_atom.pixel_x, pixel_y = (tile.y - our_tile.y) * world.icon_size + pointed_atom.pixel_y, time = 1.7, easing = EASE_OUT)
|
||||
animate(visual, pixel_x = (tile.x - our_tile.x) * ICON_SIZE_X + pointed_atom.pixel_x, pixel_y = (tile.y - our_tile.y) * ICON_SIZE_Y + pointed_atom.pixel_y, time = 1.7, easing = EASE_OUT)
|
||||
return TRUE
|
||||
|
||||
/mob/point_at(atom/pointed_atom, intentional = FALSE)
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
light_range = 6
|
||||
move_resist = INFINITY
|
||||
obj_flags = CAN_BE_HIT | DANGEROUS_POSSESSION
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
pixel_x = -ICON_SIZE_X
|
||||
pixel_y = -ICON_SIZE_Y
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF | SHUTTLE_CRUSH_PROOF
|
||||
flags_1 = SUPERMATTER_IGNORES_1
|
||||
|
||||
@@ -78,8 +78,8 @@
|
||||
var/list/shocking_info = list()
|
||||
tesla_zap(source = src, zap_range = 3, power = TESLA_DEFAULT_ENERGY, shocked_targets = shocking_info)
|
||||
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
pixel_x = -ICON_SIZE_X
|
||||
pixel_y = -ICON_SIZE_Y
|
||||
for (var/ball in orbiting_balls)
|
||||
var/range = rand(1, clamp(orbiting_balls.len, 2, 3))
|
||||
var/list/temp_shock = list()
|
||||
@@ -149,7 +149,7 @@
|
||||
var/list/icon_dimensions = get_icon_dimensions(icon)
|
||||
|
||||
var/orbitsize = (icon_dimensions["width"] + icon_dimensions["height"]) * pick(0.4, 0.5, 0.6, 0.7, 0.8)
|
||||
orbitsize -= (orbitsize / world.icon_size) * (world.icon_size * 0.25)
|
||||
orbitsize -= (orbitsize / ICON_SIZE_ALL) * (ICON_SIZE_ALL * 0.25)
|
||||
miniball.orbit(src, orbitsize, pick(FALSE, TRUE), rand(10, 25), pick(3, 4, 5, 6, 36))
|
||||
|
||||
/obj/energy_ball/Bump(atom/A)
|
||||
|
||||
@@ -1020,14 +1020,14 @@
|
||||
*/
|
||||
/proc/calculate_projectile_angle_and_pixel_offsets(atom/source, atom/target, modifiers)
|
||||
var/angle = 0
|
||||
var/p_x = LAZYACCESS(modifiers, ICON_X) ? text2num(LAZYACCESS(modifiers, ICON_X)) : world.icon_size / 2 // ICON_(X|Y) are measured from the bottom left corner of the icon.
|
||||
var/p_y = LAZYACCESS(modifiers, ICON_Y) ? text2num(LAZYACCESS(modifiers, ICON_Y)) : world.icon_size / 2 // This centers the target if modifiers aren't passed.
|
||||
var/p_x = LAZYACCESS(modifiers, ICON_X) ? text2num(LAZYACCESS(modifiers, ICON_X)) : ICON_SIZE_X / 2 // ICON_(X|Y) are measured from the bottom left corner of the icon.
|
||||
var/p_y = LAZYACCESS(modifiers, ICON_Y) ? text2num(LAZYACCESS(modifiers, ICON_Y)) : ICON_SIZE_Y / 2 // This centers the target if modifiers aren't passed.
|
||||
|
||||
if(target)
|
||||
var/turf/source_loc = get_turf(source)
|
||||
var/turf/target_loc = get_turf(target)
|
||||
var/dx = ((target_loc.x - source_loc.x) * world.icon_size) + (target.pixel_x - source.pixel_x) + (p_x - (world.icon_size / 2))
|
||||
var/dy = ((target_loc.y - source_loc.y) * world.icon_size) + (target.pixel_y - source.pixel_y) + (p_y - (world.icon_size / 2))
|
||||
var/dx = ((target_loc.x - source_loc.x) * ICON_SIZE_X) + (target.pixel_x - source.pixel_x) + (p_x - (ICON_SIZE_X / 2))
|
||||
var/dy = ((target_loc.y - source_loc.y) * ICON_SIZE_Y) + (target.pixel_y - source.pixel_y) + (p_y - (ICON_SIZE_Y / 2))
|
||||
|
||||
angle = ATAN2(dy, dx)
|
||||
return list(angle, p_x, p_y)
|
||||
@@ -1046,8 +1046,8 @@
|
||||
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
|
||||
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
|
||||
|
||||
var/tx = (text2num(screen_loc_X[1]) - 1) * world.icon_size + text2num(screen_loc_X[2])
|
||||
var/ty = (text2num(screen_loc_Y[1]) - 1) * world.icon_size + text2num(screen_loc_Y[2])
|
||||
var/tx = (text2num(screen_loc_X[1]) - 1) * ICON_SIZE_X + text2num(screen_loc_X[2])
|
||||
var/ty = (text2num(screen_loc_Y[1]) - 1) * ICON_SIZE_Y + text2num(screen_loc_Y[2])
|
||||
|
||||
//Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average.
|
||||
var/list/screenview = view_to_pixels(user.client.view)
|
||||
|
||||
@@ -33,9 +33,9 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
|
||||
//Owerride non zero bound_x, bound_y, pixel_x, pixel_y to zero.
|
||||
//Dont take in account starting bound_x, bound_y, pixel_x, pixel_y.
|
||||
//So it can unintentionally shift physical bounds of things that starts with non zero bound_x, bound_y.
|
||||
if(((bound_height != world.icon_size) || (bound_width != world.icon_size)) && (bound_x == 0) && (bound_y == 0)) //Dont shift things that have non zero bound_x and bound_y, or it move somewhere. Now it BSA and Gateway.
|
||||
pixel_x = dir & (NORTH|EAST) ? -bound_width+world.icon_size : 0
|
||||
pixel_y = dir & (NORTH|WEST) ? -bound_width+world.icon_size : 0
|
||||
if(((bound_height != ICON_SIZE_Y) || (bound_width != ICON_SIZE_X)) && (bound_x == 0) && (bound_y == 0)) //Dont shift things that have non zero bound_x and bound_y, or it move somewhere. Now it BSA and Gateway.
|
||||
pixel_x = dir & (NORTH|EAST) ? -bound_width+ICON_SIZE_X : 0
|
||||
pixel_y = dir & (NORTH|WEST) ? -bound_width+ICON_SIZE_X : 0 //?
|
||||
bound_x = pixel_x
|
||||
bound_y = pixel_y
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ Notes:
|
||||
|
||||
|
||||
/datum/tooltip/proc/show(atom/movable/thing, params = null, title = null, content = null, theme = "default", special = "none")
|
||||
if (!thing || !params || (!title && !content) || !owner || !isnum(world.icon_size))
|
||||
if (!thing || !params || (!title && !content) || !owner || !isnum(ICON_SIZE_ALL))
|
||||
return FALSE
|
||||
|
||||
if (!isnull(last_target))
|
||||
@@ -50,7 +50,7 @@ Notes:
|
||||
if (!init)
|
||||
//Initialize some vars
|
||||
init = 1
|
||||
owner << output(list2params(list(world.icon_size, control)), "[control]:tooltip.init")
|
||||
owner << output(list2params(list(ICON_SIZE_ALL, control)), "[control]:tooltip.init")
|
||||
|
||||
showing = 1
|
||||
|
||||
|
||||
@@ -225,11 +225,11 @@
|
||||
|
||||
for(var/y in first_y to last_y)
|
||||
|
||||
var/y_pixel_offset = world.icon_size * y
|
||||
var/y_pixel_offset = ICON_SIZE_Y * y
|
||||
|
||||
for(var/x in first_x to last_x)
|
||||
|
||||
var/x_pixel_offset = world.icon_size * x
|
||||
var/x_pixel_offset = ICON_SIZE_X * x
|
||||
|
||||
var/turf/set_turf = locate(x + min_x, y + min_y, z)
|
||||
|
||||
@@ -294,8 +294,8 @@
|
||||
destination = travel_direction
|
||||
travel_direction = get_dir_multiz(loc, travel_direction)
|
||||
|
||||
var/x_offset = ROUND_UP(bound_width / 32) - 1 //how many tiles our horizontally farthest edge is from us
|
||||
var/y_offset = ROUND_UP(bound_height / 32) - 1 //how many tiles our vertically farthest edge is from us
|
||||
var/x_offset = ROUND_UP(bound_width / ICON_SIZE_X) - 1 //how many tiles our horizontally farthest edge is from us
|
||||
var/y_offset = ROUND_UP(bound_height / ICON_SIZE_Y) - 1 //how many tiles our vertically farthest edge is from us
|
||||
|
||||
//the x coordinate of the edge furthest from our future destination, which would be our right hand side
|
||||
var/back_edge_x = destination.x + x_offset//if we arent multitile this should just be destination.x
|
||||
|
||||
@@ -135,11 +135,11 @@
|
||||
var/list/origin_offsets = screen_loc_to_offset(initial_screen_loc, view)
|
||||
|
||||
// A little offset to the right
|
||||
var/matrix/origin_transform = TRANSLATE_MATRIX(origin_offsets[1] - world.icon_size * 0.5, origin_offsets[2] - world.icon_size * 1.5)
|
||||
var/matrix/origin_transform = TRANSLATE_MATRIX(origin_offsets[1] - ICON_SIZE_X * 0.5, origin_offsets[2] - ICON_SIZE_Y * 1.5)
|
||||
|
||||
var/list/target_offsets = screen_loc_to_offset(target_screen_loc, view)
|
||||
// `- world.icon_Size * 0.5` to patch over a likely bug in screen_loc_to_offset with CENTER, needs more looking at
|
||||
var/matrix/animate_to_transform = TRANSLATE_MATRIX(target_offsets[1] - world.icon_size * 1.5, target_offsets[2] - world.icon_size)
|
||||
var/matrix/animate_to_transform = TRANSLATE_MATRIX(target_offsets[1] - ICON_SIZE_X * 1.5, target_offsets[2] - ICON_SIZE_Y)
|
||||
|
||||
preview.transform = origin_transform
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
var/view = client?.view_size.getView()
|
||||
maptext_width = view ? view_to_pixels(view)[1] : 480
|
||||
pixel_x = (maptext_width - world.icon_size) * -0.5
|
||||
pixel_x = (maptext_width - ICON_SIZE_X) * -0.5
|
||||
|
||||
change_message(message)
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
for(var/mutable_appearance/light_underlay as anything in test_subject.underlays)
|
||||
if(light_underlay.icon == 'icons/effects/light_overlays/light_cone.dmi')
|
||||
// The light cone icon is 96x96, so we have to shift it over to have it match our sprites. x = 1, y = 1 is the lower left corner so we shift 32 pixels opposite to that.
|
||||
final_icon.Blend(get_flat_icon_for_all_directions(light_underlay, no_anim = FALSE), ICON_UNDERLAY, -world.icon_size + 1, -world.icon_size + 1)
|
||||
final_icon.Blend(get_flat_icon_for_all_directions(light_underlay, no_anim = FALSE), ICON_UNDERLAY, -ICON_SIZE_X + 1, -ICON_SIZE_Y + 1)
|
||||
return final_icon
|
||||
|
||||
#undef UPDATE_EYES_LEFT
|
||||
|
||||
Reference in New Issue
Block a user