Merge pull request #11664 from Markolie/swarmerfix

Lavaland fixes, Mark V
This commit is contained in:
Crazy Lemon
2019-06-05 21:06:16 -07:00
committed by GitHub
64 changed files with 807 additions and 695 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
var/last_bumped = 0
var/pass_flags = 0
var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom.
var/simulated = 1 //filter for actions - used by lighting overlays
var/simulated = TRUE //filter for actions - used by lighting overlays
var/atom_say_verb = "says"
var/dont_save = 0 // For atoms that are temporary by necessity - like lighting overlays
+6 -9
View File
@@ -380,23 +380,20 @@
//Overlays
/atom/movable/overlay
var/atom/master = null
anchored = 1
anchored = TRUE
simulated = FALSE
/atom/movable/overlay/New()
verbs.Cut()
return
/atom/movable/overlay/attackby(a, b, c)
if(src.master)
return src.master.attackby(a, b, c)
return
if(master)
return master.attackby(a, b, c)
/atom/movable/overlay/attack_hand(a, b, c)
if(src.master)
return src.master.attack_hand(a, b, c)
return
if(master)
return master.attack_hand(a, b, c)
/atom/movable/proc/water_act(volume, temperature, source, method = TOUCH) //amount of water acting : temperature of water in kelvin : object that called it (for shennagins)
return TRUE
@@ -181,9 +181,19 @@
S.Integrate(src)
return FALSE
/atom/movable/lighting_object/swarmer_act()
/atom/movable/swarmer_act()
if(!simulated)
return FALSE
return ..()
/obj/effect/swarmer_act()
return FALSE
/obj/effect/decal/cleanable/robot_debris/swarmer_act(mob/living/simple_animal/hostile/swarmer/S)
S.DisIntegrate(src)
qdel(src)
return TRUE
/obj/item/gun/swarmer_act()//Stops you from eating the entire armory
return FALSE
+4 -2
View File
@@ -295,10 +295,12 @@
to_chat(O, "The screen bursts into static.")
/obj/machinery/camera/proc/triggerCameraAlarm()
SSalarms.camera_alarm.triggerAlarm(loc, src)
if(is_station_contact(z))
SSalarms.camera_alarm.triggerAlarm(loc, src)
/obj/machinery/camera/proc/cancelCameraAlarm()
SSalarms.camera_alarm.clearAlarm(loc, src)
if(is_station_contact(z))
SSalarms.camera_alarm.clearAlarm(loc, src)
/obj/machinery/camera/proc/can_use()
if(!status)
+7 -6
View File
@@ -43,19 +43,20 @@
/obj/machinery/camera/proc/cancelAlarm()
if(!status || (stat & NOPOWER))
return 0
if(detectTime == -1)
return FALSE
if(detectTime == -1 && is_station_contact(z))
SSalarms.motion_alarm.clearAlarm(loc, src)
detectTime = 0
return 1
return TRUE
/obj/machinery/camera/proc/triggerAlarm()
if(!status || (stat & NOPOWER))
return 0
if(!detectTime) return 0
return FALSE
if(!detectTime || !is_station_contact(z))
return FALSE
SSalarms.motion_alarm.triggerAlarm(loc, src)
detectTime = -1
return 1
return TRUE
/obj/machinery/camera/HasProximity(atom/movable/AM as mob|obj)
// Motion cameras outside of an "ai monitored" area will use this to detect stuff.
+23 -15
View File
@@ -21,6 +21,16 @@ FIRE ALARM
var/wiresexposed = 0
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
var/report_fire_alarms = TRUE // Should triggered fire alarms also trigger an actual alarm?
var/show_alert_level = TRUE // Should fire alarms display the current alert level?
/obj/machinery/firealarm/no_alarm
report_fire_alarms = FALSE
/obj/machinery/firealarm/syndicate
report_fire_alarms = FALSE
show_alert_level = FALSE
/obj/machinery/firealarm/update_icon()
if(wiresexposed)
@@ -215,40 +225,38 @@ FIRE ALARM
time = min(max(round(time), 0), 120)
/obj/machinery/firealarm/proc/reset()
if(!( working ))
if(!working)
return
var/area/A = get_area(src)
A.fire_reset()
for(var/obj/machinery/firealarm/FA in A)
SSalarms.fire_alarm.clearAlarm(loc, FA)
return
if(is_station_contact(z) && FA.report_fire_alarms)
SSalarms.fire_alarm.clearAlarm(loc, FA)
/obj/machinery/firealarm/proc/alarm(var/duration = 0)
if(!( working))
if(!working)
return
var/area/A = get_area(src)
for(var/obj/machinery/firealarm/FA in A)
SSalarms.fire_alarm.triggerAlarm(loc, FA, duration)
if(is_station_contact(z) && FA.report_fire_alarms)
SSalarms.fire_alarm.triggerAlarm(loc, FA, duration)
else
A.fire_alert() // Manually trigger alarms if the alarm isn't reported
update_icon()
//playsound(loc, 'sound/ambience/signal.ogg', 75, 0)
return
/obj/machinery/firealarm/New(location, direction, building)
..()
if(location)
loc = location
if(direction)
dir = direction
if(building)
buildstage = 0
wiresexposed = 1
wiresexposed = TRUE
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
if(is_station_contact(z))
if(is_station_contact(z) && show_alert_level)
if(security_level)
overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]")
else
+7 -7
View File
@@ -348,28 +348,28 @@ Class Procs:
return attack_hand(user)
/obj/machinery/attack_hand(mob/user as mob)
if(user.lying || user.stat)
return 1
if(user.incapacitated())
return TRUE
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
return TRUE
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.getBrainLoss() >= 60)
visible_message("<span class='warning'>[H] stares cluelessly at [src] and drools.</span>")
return 1
return TRUE
else if(prob(H.getBrainLoss()))
to_chat(user, "<span class='warning'>You momentarily forget how to use [src].</span>")
return 1
return TRUE
if(panel_open)
add_fingerprint(user)
return 0
return FALSE
if(!interact_offline && stat & (NOPOWER|BROKEN|MAINT))
return 1
return TRUE
add_fingerprint(user)
+28 -19
View File
@@ -20,13 +20,36 @@
var/list/linkedmist = list() //Used to keep track of created mist
var/deep_water = FALSE //set to 1 to drown even standing people
/obj/machinery/poolcontroller/invisible
invisibility = INVISIBILITY_MAXIMUM
name = "Water Controller"
desc = "An invisible water controller. Players shouldn't see this."
/obj/machinery/poolcontroller/New() //This proc automatically happens on world start
/obj/machinery/poolcontroller/invisible/sea
name = "Sea Controller"
desc = "A controller for the underwater portion of the sea. Players shouldn't see this."
deep_water = TRUE
/obj/machinery/poolcontroller/Initialize(mapload)
var/contents_loop = linked_area
if(!linked_area)
for(var/turf/simulated/floor/beach/water/W in range(srange,src)) //Search for /turf/simulated/floor/beach/water in the range of var/srange
linkedturfs += W //Add found pool turfs to the central list.
W.linkedcontroller = src // And add the linked controller to itself.
..() //Changed to call parent as per MarkvA's recommendation
contents_loop = range(srange, src)
for(var/turf/T in contents_loop)
if(istype(T, /turf/simulated/floor/beach/water))
var/turf/simulated/floor/beach/water/W = T
W.linkedcontroller = src
linkedturfs += T
else if(istype(T, /turf/unsimulated/beach/water))
var/turf/unsimulated/beach/water/W = T
W.linkedcontroller = src
linkedturfs += T
. = ..()
/obj/machinery/poolcontroller/invisible/Initialize(mapload)
linked_area = get_area(src)
. = ..()
/obj/machinery/poolcontroller/emag_act(user as mob) //Emag_act, this is called when it is hit with a cryptographic sequencer.
if(!emagged) //If it is not already emagged, emag it.
@@ -190,20 +213,6 @@
return 1
/obj/machinery/poolcontroller/seacontroller
invisibility = 101
unacidable = 1
name = "Sea Controller"
desc = "A controller for the underwater portion of the sea. Players shouldn't see this."
deep_water = TRUE //deep sea is deep water
/obj/machinery/poolcontroller/seacontroller/Initialize()
linked_area = get_area(src)
for(var/turf/unsimulated/beach/water/W in linked_area)
linkedturfs += W //Add found pool turfs to the central list.
W.linkedcontroller = src // And add the linked controller to itself.
..()
#undef FRIGID
#undef COOL
#undef NORMAL
+79 -27
View File
@@ -3,68 +3,120 @@
desc = "Looks unstable. Best to test it with the clown."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "portal"
density = 1
unacidable = 1//Can't destroy energy portals.
var/failchance = 5
density = TRUE
unacidable = TRUE
anchored = TRUE
var/obj/item/target = null
var/creator = null
anchored = 1
var/precision = 1 // how close to the portal you will teleport. 0 = on the portal, 1 = adjacent
var/can_multitool_to_remove = 0
var/failchance = 5
var/fail_icon = "portal1"
var/precision = TRUE // how close to the portal you will teleport. FALSE = on the portal, TRUE = adjacent
var/can_multitool_to_remove = FALSE
var/ignore_tele_proof_area_setting = FALSE
/obj/effect/portal/Bumped(mob/M as mob|obj)
teleport(M)
/obj/effect/portal/New(loc, turf/target, creator=null, lifespan=300)
/obj/effect/portal/New(loc, turf/target, creator = null, lifespan = 300)
..()
GLOB.portals += src
src.loc = loc
src.target = target
src.creator = creator
if(lifespan > 0)
spawn(lifespan)
qdel(src)
/obj/effect/portal/Destroy()
GLOB.portals -= src
if(istype(creator, /obj))
if(isobj(creator))
var/obj/O = creator
O.portal_destroyed(src)
creator = null
target = null
return ..()
/obj/effect/portal/proc/teleport(atom/movable/M as mob|obj)
if(istype(M, /obj/effect)) //sparks don't teleport
/obj/effect/portal/singularity_pull()
return
/obj/effect/portal/singularity_act()
return
/obj/effect/portal/Crossed(atom/movable/AM)
if(isobserver(AM))
return ..()
if(!teleport(AM))
return ..()
/obj/effect/portal/attack_tk(mob/user)
return
/obj/effect/portal/attack_hand(mob/user)
. = ..()
if(.)
return
if(M.anchored&&istype(M, /obj/mecha))
return
if(!( target ))
qdel(src)
return
if(istype(M, /atom/movable))
if(prob(failchance))
src.icon_state = "portal1"
if(!do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to deep space.
invalid_teleport()
else
if(!do_teleport(M, target, precision, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to a turf adjacent to target.
invalid_teleport()
if(get_turf(user) == get_turf(src))
teleport(user)
if(Adjacent(user))
user.forceMove(get_turf(src))
/obj/effect/portal/attack_ghost(mob/dead/observer/O)
if(target)
O.forceMove(target)
/obj/effect/portal/attackby(obj/item/A, mob/user)
if(istype(A, /obj/item/multitool) && can_multitool_to_remove)
if(ismultitool(A) && can_multitool_to_remove)
qdel(src)
else if(user && Adjacent(user))
user.forceMove(get_turf(src))
return TRUE
/obj/effect/portal/proc/teleport(atom/movable/M, force = FALSE)
if(!istype(M))
return FALSE
if(!M.simulated || iseffect(M))
return FALSE
if(M.anchored && ismecha(M))
return FALSE
if(!target)
qdel(src)
return FALSE
if(ismegafauna(M))
message_admins("[M] has used a portal at [ADMIN_VERBOSEJMP(src)] made by [key_name_admin(usr)].")
if(prob(failchance))
icon_state = fail_icon
if(!do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to deep space.
invalid_teleport()
return FALSE
else
if(!do_teleport(M, target, precision, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to a turf adjacent to target.
invalid_teleport()
return FALSE
return TRUE
/obj/effect/portal/proc/invalid_teleport()
visible_message("<span class='warning'>[src] flickers and fails due to bluespace interference!</span>")
do_sparks(5, 0, loc)
qdel(src)
/obj/effect/portal/redspace
name = "redspace portal"
desc = "A portal capable of bypassing bluespace interference."
icon_state = "portal1"
failchance = 0
precision = 0
ignore_tele_proof_area_setting = TRUE
ignore_tele_proof_area_setting = TRUE
+12 -12
View File
@@ -93,14 +93,14 @@ GLOBAL_LIST_INIT(captain_display_cases, list())
icon = 'icons/obj/stationobjs.dmi'
icon_state = "glassbox20"
desc = "A display case for prized possessions. It taunts you to kick it."
density = 1
anchored = 1
unacidable = 1 //Dissolving the case would also delete the contents.
density = TRUE
anchored = TRUE
unacidable = TRUE //Dissolving the case would also delete the contents.
var/health = 30
var/obj/item/occupant = null
var/destroyed = 0
var/locked = 0
var/burglar_alarm = 0
var/destroyed = FALSE
var/locked = FALSE
var/burglar_alarm = FALSE
var/ue = null
var/image/occupant_overlay = null
var/obj/item/airlock_electronics/circuit
@@ -116,8 +116,8 @@ GLOBAL_LIST_INIT(captain_display_cases, list())
/obj/structure/displaycase/captains_laser
name = "captain's display case"
desc = "A display case for the captain's antique laser gun. Hooked up with an anti-theft system."
burglar_alarm = 1
locked = 1
burglar_alarm = TRUE
locked = TRUE
req_access = list(access_captain)
start_showpiece_type = /obj/item/gun/energy/laser/captain
@@ -205,7 +205,7 @@ GLOBAL_LIST_INIT(captain_display_cases, list())
return
/obj/structure/displaycase/proc/burglar_alarm()
if(burglar_alarm)
if(burglar_alarm && is_station_contact(z))
var/area/alarmed = get_area(src)
alarmed.burglaralert(src)
visible_message("<span class='danger'>The burglar alarm goes off!</span>")
@@ -215,10 +215,10 @@ GLOBAL_LIST_INIT(captain_display_cases, list())
sleep(74) // 7.4 seconds long
/obj/structure/displaycase/update_icon()
if(src.destroyed)
src.icon_state = "glassbox2b"
if(destroyed)
icon_state = "glassbox2b"
else
src.icon_state = "glassbox2[locked]"
icon_state = "glassbox2[locked]"
overlays = 0
if(occupant)
var/icon/occupant_icon=getFlatIcon(occupant)
@@ -18,9 +18,6 @@
if(prob(floor_variance))
icon_state = "[environment_type][rand(0,12)]"
/turf/simulated/floor/plating/asteroid/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/simulated/floor/plating/asteroid/burn_tile()
return
@@ -95,12 +92,6 @@
slowdown = 0
return
/turf/simulated/floor/plating/asteroid/singularity_act()
return
/turf/simulated/floor/plating/asteroid/singularity_pull(S, current_size)
return
/turf/simulated/floor/plating/asteroid/basalt
name = "volcanic floor"
baseturf = /turf/simulated/floor/plating/asteroid/basalt
+2 -2
View File
@@ -8,7 +8,7 @@
canSmoothWith = list(/turf/simulated/floor/chasm)
density = TRUE //This will prevent hostile mobs from pathing into chasms, while the canpass override will still let it function like an open turf
var/static/list/falling_atoms = list() //Atoms currently falling into the chasm
var/static/list/forbidden_types = typecacheof(list(/obj/effect/portal, /obj/singularity, /obj/structure/stone_tile, /obj/item/projectile, /obj/effect/temp_visual, /obj/effect/collapse, /obj/effect/collapse, /atom/movable/lighting_object))
var/static/list/forbidden_types = typecacheof(list(/obj/effect/portal, /obj/singularity, /obj/structure/stone_tile, /obj/item/projectile, /obj/effect/temp_visual, /obj/effect/collapse, /obj/effect/collapse))
var/drop_x = 1
var/drop_y = 1
var/drop_z = 1
@@ -75,7 +75,7 @@
return FALSE
if(!isliving(AM) && !isobj(AM))
return FALSE
if(is_type_in_typecache(AM, forbidden_types) || AM.throwing)
if(!AM.simulated || is_type_in_typecache(AM, forbidden_types) || AM.throwing)
return FALSE
//Flies right over the chasm
if(isliving(AM))
+4 -4
View File
@@ -53,13 +53,13 @@
return FALSE
var/thing_to_check = src
if (AM)
if(AM)
thing_to_check = list(AM)
for(var/thing in thing_to_check)
if(istype(thing, /atom/movable/lighting_object) || istype(thing, /atom/movable/overlay))
continue
if(isobj(thing))
var/obj/O = thing
if(!O.simulated)
continue
if((O.resistance_flags & (LAVA_PROOF|INDESTRUCTIBLE)) || O.throwing)
continue
. = 1
@@ -71,7 +71,7 @@
O.resistance_flags &= ~FIRE_PROOF
O.fire_act(10000, 1000)
else if (isliving(thing))
else if(isliving(thing))
. = 1
var/mob/living/L = thing
if(L.flying)
@@ -254,6 +254,3 @@
/turf/simulated/floor/plating/abductor2/burn_tile()
return //unburnable
/turf/simulated/floor/plating/abductor2/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
@@ -43,6 +43,9 @@
name = "beach"
icon = 'icons/misc/beach.dmi'
/turf/simulated/floor/beach/pry_tile(obj/item/C, mob/user, silent = FALSE)
return
/turf/simulated/floor/beach/sand
name = "sand"
icon_state = "sand"
@@ -67,10 +70,6 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/obj/machinery/poolcontroller/linkedcontroller = null
/turf/simulated/floor/beach/water/pry_tile(obj/item/C, mob/user, silent = FALSE)
return //cannot pry off tiles of water
/turf/simulated/floor/beach/water/New()
..()
var/image/overlay_image = image('icons/misc/beach.dmi', icon_state = "water5", layer = ABOVE_MOB_LAYER)
+5 -7
View File
@@ -2,7 +2,7 @@
name = "plating"
icon_state = "plating"
icon = 'icons/turf/floors/plating.dmi'
intact = 0
intact = FALSE
floor_tile = null
broken_states = list("damaged1", "damaged2", "damaged3", "damaged4", "damaged5")
burnt_states = list("floorscorched1", "floorscorched2")
@@ -103,7 +103,7 @@
/turf/simulated/floor/engine/attack_hand(mob/user as mob)
user.Move_Pulled(src)
/turf/simulated/floor/engine/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
/turf/simulated/floor/engine/pry_tile(obj/item/C, mob/user, silent = FALSE)
return
/turf/simulated/floor/engine/attackby(obj/item/C as obj, mob/user as mob, params)
@@ -224,7 +224,7 @@
/turf/simulated/floor/snow/ex_act(severity)
return
/turf/simulated/floor/snow/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
/turf/simulated/floor/snow/pry_tile(obj/item/C, mob/user, silent = FALSE)
return
/turf/simulated/floor/plating/metalfoam
@@ -243,12 +243,10 @@
if(MFOAM_IRON)
icon_state = "ironfoam"
/turf/simulated/floor/plating/metalfoam/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/simulated/floor/plating/metalfoam/attackby(var/obj/item/C, mob/user, params)
if(..())
return 1
return TRUE
if(istype(C) && C.force)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
+1 -1
View File
@@ -136,7 +136,7 @@
var/obj/structure/sign/poster/P = O
P.roll_and_drop(src)
else
O.loc = src
O.forceMove(src)
ChangeTurf(/turf/simulated/floor/plating)
+1 -1
View File
@@ -88,7 +88,7 @@
/turf/space/transit/Entered(atom/movable/AM, atom/OldLoc, ignoreRest = 0)
if(!AM)
return
if(istype(AM, /obj/docking_port) || !AM.simulated)
if(!AM.simulated || istype(AM, /obj/docking_port))
return //this was fucking hilarious, the docking ports were getting thrown to random Z-levels
var/max = world.maxx-TRANSITIONEDGE
var/min = 1+TRANSITIONEDGE
+2 -4
View File
@@ -491,16 +491,14 @@
var/turf/T0 = src
for(var/X in T0.GetAllContents())
var/atom/A = X
if(!A.simulated)
continue
if(istype(A, /mob/dead))
continue
if(istype(A, /obj/effect/landmark))
continue
if(istype(A, /obj/docking_port))
continue
if(istype(A, /atom/movable/lighting_object))
continue
if(!A.simulated)
continue
qdel(A, force=TRUE)
T0.ChangeTurf(turf_type)