mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-30 00:30:06 +01:00
Merge branch 'master' into pol-moved
This commit is contained in:
@@ -160,18 +160,32 @@
|
||||
#define WEED_NODE_BASE "nodebase"
|
||||
|
||||
/obj/effect/alien/weeds
|
||||
name = "weeds"
|
||||
desc = "Weird purple weeds."
|
||||
name = "growth"
|
||||
desc = "Weird organic growth."
|
||||
icon_state = "weeds"
|
||||
|
||||
anchored = 1
|
||||
density = 0
|
||||
plane = TURF_PLANE
|
||||
layer = ABOVE_TURF_LAYER
|
||||
|
||||
var/health = 15
|
||||
var/obj/effect/alien/weeds/node/linked_node = null
|
||||
var/static/list/weedImageCache
|
||||
|
||||
/obj/effect/alien/weeds/Initialize(var/mapload, var/node, var/newcolor)
|
||||
. = ..()
|
||||
if(isspace(loc))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
linked_node = node
|
||||
if(newcolor)
|
||||
color = newcolor
|
||||
|
||||
if(icon_state == "weeds")
|
||||
icon_state = pick("weeds", "weeds1", "weeds2")
|
||||
|
||||
fullUpdateWeedOverlays()
|
||||
|
||||
/obj/effect/alien/weeds/Destroy()
|
||||
var/turf/T = get_turf(src)
|
||||
// To not mess up the overlay updates.
|
||||
@@ -181,50 +195,43 @@
|
||||
W.updateWeedOverlays()
|
||||
|
||||
linked_node = null
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/effect/alien/weeds/node
|
||||
icon_state = "weednode"
|
||||
name = "purple sac"
|
||||
desc = "Weird purple octopus-like thing."
|
||||
name = "glowing growth"
|
||||
desc = "Weird glowing organic growth."
|
||||
layer = ABOVE_TURF_LAYER+0.01
|
||||
light_range = NODERANGE
|
||||
|
||||
var/node_range = NODERANGE
|
||||
var/set_color = "#321D37"
|
||||
|
||||
var/set_color = null
|
||||
/obj/effect/alien/weeds/node/Initialize(var/mapload, var/node, var/newcolor)
|
||||
. = ..()
|
||||
|
||||
/obj/effect/alien/weeds/node/New()
|
||||
..(src.loc, src)
|
||||
for(var/obj/effect/alien/weeds/existing in loc)
|
||||
if(existing == src)
|
||||
continue
|
||||
else
|
||||
qdel(existing)
|
||||
|
||||
/obj/effect/alien/weeds/node/Initialize()
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
if(newcolor)
|
||||
set_color = newcolor
|
||||
if(set_color)
|
||||
color = set_color
|
||||
|
||||
spawn(1 SECOND)
|
||||
if(color)
|
||||
set_color = color
|
||||
START_PROCESSING(SSobj, src) // Only the node processes in a subsystem, the rest are process()'d by the node
|
||||
|
||||
/obj/effect/alien/weeds/node/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
..()
|
||||
|
||||
/obj/effect/alien/weeds/New(pos, node)
|
||||
..()
|
||||
if(istype(loc, /turf/space))
|
||||
qdel(src)
|
||||
return
|
||||
linked_node = node
|
||||
if(icon_state == "weeds")icon_state = pick("weeds", "weeds1", "weeds2")
|
||||
|
||||
fullUpdateWeedOverlays()
|
||||
return ..()
|
||||
|
||||
/obj/effect/alien/weeds/proc/updateWeedOverlays()
|
||||
cut_overlays()
|
||||
|
||||
overlays.Cut()
|
||||
|
||||
if(!weedImageCache || !weedImageCache.len)
|
||||
if(!weedImageCache)
|
||||
weedImageCache = list()
|
||||
// weedImageCache.len = 4
|
||||
weedImageCache[WEED_NORTH_EDGING] = image('icons/mob/alien.dmi', "weeds_side_n", layer=2.11, pixel_y = -32)
|
||||
weedImageCache[WEED_SOUTH_EDGING] = image('icons/mob/alien.dmi', "weeds_side_s", layer=2.11, pixel_y = 32)
|
||||
weedImageCache[WEED_EAST_EDGING] = image('icons/mob/alien.dmi', "weeds_side_e", layer=2.11, pixel_x = -32)
|
||||
@@ -234,18 +241,14 @@
|
||||
var/turf/S = get_step(src, SOUTH)
|
||||
var/turf/E = get_step(src, EAST)
|
||||
var/turf/W = get_step(src, WEST)
|
||||
if(!locate(/obj/effect/alien) in N.contents)
|
||||
if(istype(N, /turf/simulated/floor))
|
||||
overlays += weedImageCache[WEED_SOUTH_EDGING]
|
||||
if(!locate(/obj/effect/alien) in S.contents)
|
||||
if(istype(S, /turf/simulated/floor))
|
||||
overlays += weedImageCache[WEED_NORTH_EDGING]
|
||||
if(!locate(/obj/effect/alien) in E.contents)
|
||||
if(istype(E, /turf/simulated/floor))
|
||||
overlays += weedImageCache[WEED_WEST_EDGING]
|
||||
if(!locate(/obj/effect/alien) in W.contents)
|
||||
if(istype(W, /turf/simulated/floor))
|
||||
overlays += weedImageCache[WEED_EAST_EDGING]
|
||||
if(istype(N, /turf/simulated/floor) && !locate(/obj/effect/alien) in N.contents)
|
||||
add_overlay(weedImageCache[WEED_SOUTH_EDGING])
|
||||
if(istype(S, /turf/simulated/floor) && !locate(/obj/effect/alien) in S.contents)
|
||||
add_overlay(weedImageCache[WEED_NORTH_EDGING])
|
||||
if(istype(E, /turf/simulated/floor) && !locate(/obj/effect/alien) in E.contents)
|
||||
add_overlay(weedImageCache[WEED_WEST_EDGING])
|
||||
if(istype(W, /turf/simulated/floor) && !locate(/obj/effect/alien) in W.contents)
|
||||
add_overlay(weedImageCache[WEED_EAST_EDGING])
|
||||
|
||||
/obj/effect/alien/weeds/proc/fullUpdateWeedOverlays()
|
||||
for (var/obj/effect/alien/weeds/W in range(1,src))
|
||||
@@ -253,70 +256,51 @@
|
||||
|
||||
return
|
||||
|
||||
// NB: This is not actually called by a processing subsystem, it's called by the node processing
|
||||
/obj/effect/alien/weeds/process()
|
||||
set background = 1
|
||||
var/turf/U = get_turf(src)
|
||||
/*
|
||||
if (locate(/obj/movable, U))
|
||||
U = locate(/obj/movable, U)
|
||||
if(U.density == 1)
|
||||
qdel(src)
|
||||
return
|
||||
Alien plants should do something if theres a lot of poison
|
||||
if(U.poison> 200000)
|
||||
health -= round(U.poison/200000)
|
||||
update()
|
||||
return
|
||||
*/
|
||||
if (istype(U, /turf/space))
|
||||
|
||||
if(isspace(U))
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(!linked_node || (get_dist(linked_node, src) > linked_node.node_range) )
|
||||
if(!linked_node)
|
||||
return
|
||||
|
||||
if(linked_node != src)
|
||||
color = linked_node.set_color
|
||||
if(get_dist(linked_node, src) > linked_node.node_range)
|
||||
return
|
||||
|
||||
direction_loop:
|
||||
for(var/dirn in cardinal)
|
||||
var/turf/T = get_step(src, dirn)
|
||||
for(var/dirn in cardinal)
|
||||
var/turf/T1 = get_turf(src)
|
||||
var/turf/T2 = get_step(src, dirn)
|
||||
|
||||
if (!istype(T) || T.density || locate(/obj/effect/alien/weeds) in T || istype(T.loc, /area/arrival) || istype(T, /turf/space))
|
||||
continue
|
||||
if(!istype(T2) || locate(/obj/effect/alien/weeds) in T2 || istype(T2.loc, /area/arrival) || isspace(T2))
|
||||
continue
|
||||
|
||||
// if (locate(/obj/movable, T)) // don't propogate into movables
|
||||
// continue
|
||||
if(T1.c_airblock(T2) == BLOCKED)
|
||||
continue
|
||||
|
||||
for(var/obj/O in T)
|
||||
if(!O.CanZASPass(U))
|
||||
continue direction_loop
|
||||
new /obj/effect/alien/weeds(T2, linked_node, color)
|
||||
|
||||
var/obj/effect/E = new /obj/effect/alien/weeds(T, linked_node)
|
||||
/obj/effect/alien/weeds/node/process()
|
||||
set background = 1
|
||||
. = ..()
|
||||
|
||||
E.color = color
|
||||
var/list/nearby_weeds = list()
|
||||
for(var/obj/effect/alien/weeds/W in orange(node_range, src))
|
||||
nearby_weeds |= W
|
||||
|
||||
if(istype(src, /obj/effect/alien/weeds/node))
|
||||
var/obj/effect/alien/weeds/node/N = src
|
||||
var/list/nearby_weeds = list()
|
||||
for(var/obj/effect/alien/weeds/W in range(N.node_range,src))
|
||||
nearby_weeds |= W
|
||||
for(var/nbw in nearby_weeds)
|
||||
var/obj/effect/alien/weeds/W = nbw
|
||||
|
||||
for(var/obj/effect/alien/weeds/W in nearby_weeds)
|
||||
if(!W)
|
||||
continue
|
||||
if(!W.linked_node)
|
||||
W.linked_node = src
|
||||
|
||||
if(!W.linked_node)
|
||||
W.linked_node = src
|
||||
|
||||
W.color = W.linked_node.set_color
|
||||
|
||||
if(W == src)
|
||||
continue
|
||||
|
||||
if(prob(max(10, 40 - (5 * nearby_weeds.len))))
|
||||
W.process()
|
||||
W.color = W.linked_node.set_color
|
||||
|
||||
if(prob(max(10, 40 - (5 * nearby_weeds.len))))
|
||||
W.process()
|
||||
|
||||
/obj/effect/alien/weeds/ex_act(severity)
|
||||
switch(severity)
|
||||
|
||||
@@ -159,8 +159,8 @@ var/global/list/image/splatter_cache=list()
|
||||
icon_state = "writing1"
|
||||
|
||||
/obj/effect/decal/cleanable/blood/writing/examine(mob/user)
|
||||
..(user)
|
||||
to_chat(user, "It reads: <font color='[basecolor]'>\"[message]\"</font>")
|
||||
. = ..()
|
||||
. += "It reads: <font color='[basecolor]'>\"[message]\"</font>"
|
||||
|
||||
/obj/effect/decal/cleanable/blood/gibs
|
||||
name = "gibs"
|
||||
|
||||
@@ -49,6 +49,9 @@
|
||||
if(triggered)
|
||||
return
|
||||
|
||||
if(istype(M, /obj/mecha))
|
||||
explode(M)
|
||||
|
||||
if(istype(M, /mob/living/))
|
||||
if(!M.hovering)
|
||||
explode(M)
|
||||
@@ -79,7 +82,7 @@
|
||||
triggered = 1
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
if(M)
|
||||
if(istype(M))
|
||||
M.radiation += 50
|
||||
randmutb(M)
|
||||
domutcheck(M,null)
|
||||
@@ -96,7 +99,7 @@
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread()
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
if(M)
|
||||
if(istype(M))
|
||||
M.Stun(30)
|
||||
visible_message("\The [src.name] flashes violently before disintegrating!")
|
||||
spawn(0)
|
||||
@@ -136,7 +139,10 @@
|
||||
triggered = 1
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
if(M)
|
||||
if(istype(M, /obj/mecha))
|
||||
var/obj/mecha/E = M
|
||||
M = E.occupant
|
||||
if(istype(M))
|
||||
qdel(M.client)
|
||||
spawn(0)
|
||||
qdel(s)
|
||||
@@ -195,7 +201,7 @@
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread()
|
||||
s.set_up(3, 1, src)
|
||||
s.start()
|
||||
if(M)
|
||||
if(istype(M))
|
||||
M.adjust_fire_stacks(5)
|
||||
M.fire_act()
|
||||
visible_message("\The [src.name] bursts into flames!")
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
light_power = 0.5
|
||||
light_color = "#8837A3"
|
||||
|
||||
/obj/effect/projectile/tungsten/impact
|
||||
/obj/effect/projectile/impact/tungsten
|
||||
icon_state = "impact_mhd_laser"
|
||||
light_range = 4
|
||||
light_power = 3
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
light_power = 0.5
|
||||
light_color = "#FF0D00"
|
||||
|
||||
/obj/effect/projectile/tungsten/muzzle
|
||||
/obj/effect/projectile/muzzle/tungsten
|
||||
icon_state = "muzzle_mhd_laser"
|
||||
light_range = 4
|
||||
light_power = 3
|
||||
|
||||
@@ -109,8 +109,14 @@
|
||||
light_power = 0.5
|
||||
light_color = "#0066FF"
|
||||
|
||||
/obj/effect/projectile/tungsten/tracer
|
||||
/obj/effect/projectile/tracer/tungsten
|
||||
icon_state = "mhd_laser"
|
||||
light_range = 4
|
||||
light_power = 3
|
||||
light_color = "#3300ff"
|
||||
|
||||
/obj/effect/projectile/tracer/cannon
|
||||
icon_state = "cannon"
|
||||
light_range = 1
|
||||
light_power = 0.5
|
||||
light_color = "#f6f2b6"
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
anchored = 1
|
||||
density = 0
|
||||
opacity = 0
|
||||
can_atmos_pass = ATMOS_PASS_PROC
|
||||
|
||||
/obj/effect/zone_divider/CanZASPass(turf/T, is_zone)
|
||||
// Special case to prevent us from being part of a zone during the first air master tick.
|
||||
@@ -15,5 +16,5 @@
|
||||
if(air_master && air_master.current_cycle == 0)
|
||||
spawn(1)
|
||||
air_master.mark_for_update(get_turf(src))
|
||||
return ATMOS_PASS_NO
|
||||
return is_zone ? ATMOS_PASS_NO : ATMOS_PASS_YES // Anything except zones can pass
|
||||
return FALSE
|
||||
return is_zone ? FALSE : TRUE // Anything except zones can pass
|
||||
|
||||
Reference in New Issue
Block a user