mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 00:21:11 +01:00
Merge branch 'master' into development
This commit is contained in:
@@ -838,11 +838,6 @@
|
||||
if(wearer.transforming || !wearer.canmove)
|
||||
return
|
||||
|
||||
if(locate(/obj/effect/stop/, wearer.loc))
|
||||
for(var/obj/effect/stop/S in wearer.loc)
|
||||
if(S.victim == wearer)
|
||||
return
|
||||
|
||||
if(!wearer.lastarea)
|
||||
wearer.lastarea = get_area(wearer.loc)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// This is the define used to calculate falloff.
|
||||
#define LUM_FALLOFF(C, T) (1 - CLAMP01(sqrt((C.x - T.x) ** 2 + (C.y - T.y) ** 2 + LIGHTING_HEIGHT) / max(1, light_range)))
|
||||
#define LUM_FALLOFF_XY(Cx,Cy,Tx,Ty) (1 - CLAMP01(sqrt(((Cx) - (Tx)) ** 2 + ((Cy) - (Ty)) ** 2 + LIGHTING_HEIGHT) / max(1, light_range)))
|
||||
#define LUM_FALLOFF(C, T) (1 - CLAMP01(sqrt((C.x - T.x) ** 2 + (C.y - T.y) ** 2 + LIGHTING_HEIGHT) / max(1, actual_range)))
|
||||
#define LUM_FALLOFF_XY(Cx,Cy,Tx,Ty) (1 - CLAMP01(sqrt(((Cx) - (Tx)) ** 2 + ((Cy) - (Ty)) ** 2 + LIGHTING_HEIGHT) / max(1, actual_range)))
|
||||
|
||||
// Macro that applies light to a new corner.
|
||||
// It is a macro in the interest of speed, yet not having to copy paste it.
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
var/tmp/targ_sign // The sign to test the point against.
|
||||
var/tmp/test_x_offset // How much the X coord should be offset due to direction.
|
||||
var/tmp/test_y_offset // How much the Y coord should be offset due to direction.
|
||||
var/tmp/facing_opaque = FALSE
|
||||
|
||||
var/list/datum/lighting_corner/effect_str // List used to store how much we're affecting corners.
|
||||
var/list/turf/affecting_turfs
|
||||
@@ -159,46 +160,41 @@
|
||||
if (T.x == cached_origin_x && T.y == cached_origin_y && old_direction == top_atom.dir)
|
||||
return
|
||||
|
||||
var/do_offset = TRUE
|
||||
var/turf/front = get_step(T, top_atom.dir)
|
||||
if (front && front.has_opaque_atom)
|
||||
do_offset = FALSE
|
||||
|
||||
cached_origin_x = T.x
|
||||
test_x_offset = cached_origin_x
|
||||
cached_origin_y = T.y
|
||||
test_y_offset = cached_origin_y
|
||||
|
||||
if (istype(top_atom, /mob) && top_atom:facing_dir)
|
||||
old_direction = top_atom:facing_dir
|
||||
else
|
||||
old_direction = top_atom.dir
|
||||
|
||||
var/turf/front = get_step(T, old_direction)
|
||||
facing_opaque = (front && front.has_opaque_atom)
|
||||
|
||||
cached_origin_x = test_x_offset = T.x
|
||||
cached_origin_y = test_y_offset = T.y
|
||||
|
||||
if (facing_opaque)
|
||||
return
|
||||
|
||||
var/angle = light_angle / 2
|
||||
switch (old_direction)
|
||||
if (NORTH)
|
||||
limit_a_t = angle + 90
|
||||
limit_b_t = -(angle) + 90
|
||||
if (do_offset)
|
||||
test_y_offset += 1
|
||||
++test_y_offset
|
||||
|
||||
if (SOUTH)
|
||||
limit_a_t = (angle) - 90
|
||||
limit_b_t = -(angle) - 90
|
||||
if (do_offset)
|
||||
test_y_offset -= 1
|
||||
--test_y_offset
|
||||
|
||||
if (EAST)
|
||||
limit_a_t = angle
|
||||
limit_b_t = -(angle)
|
||||
if (do_offset)
|
||||
test_x_offset += 1
|
||||
++test_x_offset
|
||||
|
||||
if (WEST)
|
||||
limit_a_t = angle + 180
|
||||
limit_b_t = -(angle) - 180
|
||||
if (do_offset)
|
||||
test_x_offset -= 1
|
||||
--test_x_offset
|
||||
|
||||
// Convert our angle + range into a vector.
|
||||
limit_a_x = POLAR_TO_CART_X(light_range + ARBITRARY_NUMBER, limit_a_t)
|
||||
@@ -255,6 +251,8 @@
|
||||
REMOVE_CORNER(C,now)
|
||||
effect_str[C] = 0
|
||||
|
||||
var/actual_range = light_range
|
||||
|
||||
APPLY_CORNER(C,now)
|
||||
UNSETEMPTY(effect_str)
|
||||
|
||||
@@ -331,10 +329,12 @@
|
||||
var/list/Tcorners
|
||||
var/Sx = source_turf.x
|
||||
var/Sy = source_turf.y
|
||||
var/use_reduced = (light_angle && facing_opaque)
|
||||
var/actual_range = use_reduced ? light_range * LIGHTING_BLOCKED_FACTOR : light_range
|
||||
|
||||
FOR_DVIEW(T, Ceiling(light_range), source_turf, 0)
|
||||
FOR_DVIEW(T, Ceiling(actual_range), source_turf, 0)
|
||||
check_t:
|
||||
if (light_angle && check_light_cone(T.x, T.y))
|
||||
if (light_angle && !facing_opaque && check_light_cone(T.x, T.y))
|
||||
continue
|
||||
|
||||
if (T.dynamic_lighting || T.light_sources)
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
var/list/Tcorners
|
||||
var/Sx = source_turf.x
|
||||
var/Sy = source_turf.y
|
||||
var/actual_range = light_range // novis sources don't support directional lighting.
|
||||
|
||||
// We don't need no damn vis checks!
|
||||
for (Tthing in RANGE_TURFS(Ceiling(light_range), source_turf))
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
/mob/living/carbon/swap_hand()
|
||||
var/obj/item/item_in_hand = src.get_active_hand()
|
||||
if(item_in_hand) //this segment checks if the item in your hand is twohanded.
|
||||
if(istype(item_in_hand,/obj/item/weapon/material/twohanded))
|
||||
if(istype(item_in_hand,/obj/item/weapon/material/twohanded) || istype(item_in_hand,/obj/item/weapon/gun) || istype(item_in_hand,/obj/item/weapon/pickaxe))
|
||||
if(item_in_hand:wielded == 1)
|
||||
usr << "<span class='warning'>Your other hand is too busy holding the [item_in_hand.name]</span>"
|
||||
return
|
||||
|
||||
@@ -319,7 +319,11 @@
|
||||
/mob/proc/clear_point()
|
||||
QDEL_NULL(pointing_effect)
|
||||
|
||||
/mob/proc/ret_grab(obj/effect/list_container/mobl/L as obj, flag)
|
||||
/datum/mobl // I have no idea what the fuck this is, but it's better for it to be a datum than an /obj/effect.
|
||||
var/list/container = list()
|
||||
var/master
|
||||
|
||||
/mob/proc/ret_grab(datum/mobl/L, flag)
|
||||
if ((!( istype(l_hand, /obj/item/weapon/grab) ) && !( istype(r_hand, /obj/item/weapon/grab) )))
|
||||
if (!( L ))
|
||||
return null
|
||||
@@ -327,26 +331,24 @@
|
||||
return L.container
|
||||
else
|
||||
if (!( L ))
|
||||
L = new /obj/effect/list_container/mobl( null )
|
||||
L = new /datum/mobl
|
||||
L.container += src
|
||||
L.master = src
|
||||
if (istype(l_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = l_hand
|
||||
if (!( L.container.Find(G.affecting) ))
|
||||
if (!(L.container.Find(G.affecting)))
|
||||
L.container += G.affecting
|
||||
if (G.affecting)
|
||||
G.affecting.ret_grab(L, 1)
|
||||
if (istype(r_hand, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = r_hand
|
||||
if (!( L.container.Find(G.affecting) ))
|
||||
if (!(L.container.Find(G.affecting)))
|
||||
L.container += G.affecting
|
||||
if (G.affecting)
|
||||
G.affecting.ret_grab(L, 1)
|
||||
if (!( flag ))
|
||||
if (L.master == src)
|
||||
var/list/temp = list( )
|
||||
temp += L.container
|
||||
//L = null
|
||||
var/list/temp = L.container.Copy()
|
||||
qdel(L)
|
||||
return temp
|
||||
else
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
user << "<span class='notice'>You [anchored ? "unfasten" : "fasten"] [src] to the flooring.</span>"
|
||||
anchored = !anchored
|
||||
if(!anchored)
|
||||
disconnect_from_network()
|
||||
else
|
||||
connect_to_network()
|
||||
anchored = !anchored
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(user, W)
|
||||
|
||||
Reference in New Issue
Block a user