mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Cherry picks the unicode part 2 PR from TG * Things * drop 512 support * TAN --> tan * Manually does the things that was in renamed files * CLAMP --> clamp * ismovableatom -> ismovable * bugfixes, tg is bad * Ports sanitize_name * Bumps checks * Fixes new linter errors (#48126) About The Pull Request This fixes the errors raised by the new feature I'm adding to the linter: SpaceManiac/SpacemanDMM#119 * Update SpacemanDMM suite to 1.2 (#48785) * Update SpacemanDMM suite to 1.2 * Fix new lint errors * Removes unreachable code (#48143) About The Pull Request As detected by SpaceManiac/SpacemanDMM#123 * casually fixes 50 bugs * stoopid evil dreamchecker * stoopid evil dreamchecker * stoopid evil dreamchecker * almost the same thing * Makes all UIs UTF-8 * Fixes bugs * Fixes runtimes, some related to 513, some not * Fixes agent ids Co-authored-by: MrPerson <spamtaffic@gmail.com> Co-authored-by: alexkar598 <> Co-authored-by: spookydonut <github@spooksoftware.com>
43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
/datum/component/mirage_border
|
|
can_transfer = TRUE
|
|
var/obj/effect/abstract/mirage_holder/holder
|
|
|
|
/datum/component/mirage_border/Initialize(turf/target, direction, range=world.view)
|
|
if(!isturf(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
if(!target || !istype(target) || !direction)
|
|
. = COMPONENT_INCOMPATIBLE
|
|
CRASH("[type] improperly instanced with the following args: target=\[[target]\], direction=\[[direction]\], range=\[[range]\]")
|
|
|
|
holder = new(parent)
|
|
|
|
var/x = target.x
|
|
var/y = target.y
|
|
var/z = target.z
|
|
var/turf/southwest = locate(clamp(x - (direction & WEST ? range : 0), 1, world.maxx), clamp(y - (direction & SOUTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
|
|
var/turf/northeast = locate(clamp(x + (direction & EAST ? range : 0), 1, world.maxx), clamp(y + (direction & NORTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
|
|
//holder.vis_contents += block(southwest, northeast) // This doesnt work because of beta bug memes
|
|
for(var/i in block(southwest, northeast))
|
|
holder.vis_contents += i
|
|
if(direction & SOUTH)
|
|
holder.pixel_y -= world.icon_size * range
|
|
if(direction & WEST)
|
|
holder.pixel_x -= world.icon_size * range
|
|
|
|
/datum/component/mirage_border/Destroy()
|
|
QDEL_NULL(holder)
|
|
return ..()
|
|
|
|
/datum/component/mirage_border/PreTransfer()
|
|
holder.moveToNullspace()
|
|
|
|
/datum/component/mirage_border/PostTransfer()
|
|
if(!isturf(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
holder.forceMove(parent)
|
|
|
|
/obj/effect/abstract/mirage_holder
|
|
name = "Mirage holder"
|
|
anchored = TRUE
|
|
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|