Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

CAS Ammo updates and cleanup #5604

Merged
merged 4 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ Sprites added in commit d407e97e26ee5e6bb1daf945a8eb3bd9a6b11976 are CC-BY-NC 3.

All sounds added/remixed in the PR https://github.com/tgstation/TerraGov-Marine-Corps/pull/5261 are licensed under CC-BY-NC-SA 3.0

Sound added in PR https://github.com/tgstation/TerraGov-Marine-Corps/pull/5603 is taken from https://freesound.org/people/nicStage/sounds/127731/ (CC Attribution)

The TGS DMAPI API is licensed as a subproject under the MIT license.
43 changes: 0 additions & 43 deletions code/__HELPERS/movable.dm

This file was deleted.

20 changes: 0 additions & 20 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1008,26 +1008,6 @@ GLOBAL_LIST_INIT(common_tools, typecacheof(list(
#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )


/proc/reverse_direction(direction)
switch(direction)
if(NORTH)
return SOUTH
if(NORTHEAST)
return SOUTHWEST
if(EAST)
return WEST
if(SOUTHEAST)
return NORTHWEST
if(SOUTH)
return NORTH
if(SOUTHWEST)
return NORTHEAST
if(WEST)
return EAST
if(NORTHWEST)
return SOUTHEAST


/proc/reverse_nearby_direction(direction)
switch(direction)
if(NORTH)
Expand Down
45 changes: 45 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -922,3 +922,48 @@
/atom/movable/proc/CanPassThrough(atom/blocker, turf/target, blocker_opinion)
SHOULD_CALL_PARENT(TRUE)
return blocker_opinion

///returns FALSE if there isnt line of sight to target within view dist and TRUE if there is
/atom/movable/proc/line_of_sight(atom/target, view_dist = WORLD_VIEW_NUM)
if(QDELETED(target))
return FALSE

if(z != target.z) //No multi-z.
return FALSE

var/total_distance = get_dist(src, target)

if(total_distance > view_dist)
return FALSE

switch(total_distance)
if(-1)
if(target == src) //We can see ourselves alright.
return TRUE
else //Standard get_dist() error condition.
return FALSE
if(null) //Error, does not compute.
CRASH("get_dist returned null on line_of_sight() with [src] as src and [target] as target")
if(0, 1) //We can see our own tile and the next one regardless.
return TRUE

var/turf/turf_to_check = get_turf(src)
var/turf/target_turf = get_turf(target)

for(var/i in 1 to total_distance - 1)
turf_to_check = get_step(turf_to_check, get_dir(turf_to_check, target_turf))
if(IS_OPAQUE_TURF(turf_to_check))
return FALSE //First and last turfs' opacity don't matter, but the ones in-between do.
for(var/obj/stuff_in_turf in turf_to_check)
if(!stuff_in_turf.opacity)
continue //Transparent, we can see through it.
if(!CHECK_BITFIELD(stuff_in_turf.flags_atom, ON_BORDER))
return FALSE //Opaque and not on border. We can't see through this tile, it's over.
if(ISDIAGONALDIR(stuff_in_turf.dir))
return FALSE //Opaque fulltile window.
if(CHECK_BITFIELD(dir, stuff_in_turf.dir))
return FALSE //Same direction and opaque, blocks our view.
if(CHECK_BITFIELD(dir, REVERSE_DIR(stuff_in_turf.dir)))
return FALSE //Doesn't block this tile, but it does block the next, and this is not the last pass.

return TRUE
20 changes: 20 additions & 0 deletions code/game/objects/effects/temporary_visuals/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,23 @@
name = "transfer plasma"
icon_state = "transfer_plasma"
duration = 0.5 SECONDS


/obj/effect/temp_visual/xenomorph/runner_afterimage
name = "runner afterimage"
desc = "It has become speed.."
icon = 'icons/Xeno/2x2_Xenos.dmi' //They are now like, 2x1 or something
icon_state = "Runner Walking"
layer = MOB_LAYER
alpha = 64 //Translucent
duration = 0.5 SECONDS
density = FALSE
opacity = FALSE
anchored = FALSE
animate_movement = SLIDE_STEPS

/obj/effect/temp_visual/heavyimpact
name = "heavy impact"
icon = 'icons/effects/heavyimpact.dmi'
icon_state = "heavyimpact"
duration = 13
12 changes: 0 additions & 12 deletions code/game/objects/effects/temporary_visuals/temporary_visual.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,3 @@
setDir(set_dir)
return ..()

/obj/effect/temp_visual/xenomorph/runner_afterimage
name = "runner afterimage"
desc = "It has become speed.."
icon = 'icons/Xeno/2x2_Xenos.dmi' //They are now like, 2x1 or something
icon_state = "Runner Walking"
layer = MOB_LAYER
alpha = 64 //Translucent
duration = 0.5 SECONDS
density = FALSE
opacity = FALSE
anchored = FALSE
animate_movement = SLIDE_STEPS
2 changes: 1 addition & 1 deletion code/game/objects/machinery/camera/camera_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

user.visible_message("[user] begins attaching [src] to the wall.", "You being attaching [src] to the wall.")
playsound(loc, 'sound/machines/click.ogg', 15, 1)
var/constrdir = reverse_direction(user.dir)
var/constrdir = REVERSE_DIR(user.dir)
var/constrloc = user.loc

if(!do_after(user, 30, TRUE, wall, BUSY_ICON_BUILD))
Expand Down
Loading