Fix alarms triggering on non-contact levels, spectral blade ghost fix, assigning outfits runtime fix

This commit is contained in:
Mark van Alphen
2019-06-03 17:39:23 +02:00
parent 264f019658
commit 94eb652f15
11 changed files with 106 additions and 97 deletions
@@ -763,7 +763,7 @@
/obj/effect/turf_decal/tile/brown{
dir = 4
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -1683,7 +1683,7 @@
/turf/simulated/floor/plating,
/area/ruin/unpowered/syndicate_lava_base/testlab)
"dT" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -1996,7 +1996,7 @@
/obj/machinery/light/small{
dir = 8
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -2201,7 +2201,7 @@
/turf/simulated/floor/plasteel/dark,
/area/ruin/unpowered/syndicate_lava_base/testlab)
"eM" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 1;
pixel_y = -24
},
@@ -2513,7 +2513,7 @@
/obj/item/clothing/glasses/hud/health,
/obj/structure/disposalpipe/segment,
/obj/effect/decal/cleanable/dirt,
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 4;
pixel_x = 26
},
@@ -3613,7 +3613,7 @@
/turf/simulated/wall/mineral/plastitanium/nodiagonal,
/area/ruin/unpowered/syndicate_lava_base/main)
"hZ" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -3921,7 +3921,7 @@
/obj/machinery/light/small{
dir = 1
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 2;
pixel_y = 24
},
@@ -3958,7 +3958,7 @@
/turf/simulated/floor/plasteel/dark,
/area/ruin/unpowered/syndicate_lava_base/dormitories)
"iG" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -5194,7 +5194,7 @@
/turf/simulated/floor/plasteel/dark,
/area/ruin/unpowered/syndicate_lava_base/bar)
"kM" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 4;
pixel_x = 26
},
@@ -5281,7 +5281,7 @@
/obj/structure/chair{
dir = 1
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -5763,7 +5763,7 @@
/turf/simulated/floor/plasteel,
/area/ruin/unpowered/syndicate_lava_base/medbay)
"mg" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -5871,7 +5871,7 @@
/obj/structure/bed/roller,
/obj/machinery/iv_drip,
/obj/item/reagent_containers/iv_bag/blood/OMinus,
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -6546,7 +6546,7 @@
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
dir = 4
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 2;
pixel_y = 24
},
@@ -6649,7 +6649,7 @@
/turf/simulated/floor/plasteel/white/side,
/area/ruin/unpowered/syndicate_lava_base/medbay)
"oh" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/syndicate{
dir = 8;
pixel_x = -26
},
@@ -3608,7 +3608,7 @@
name = "MO19 Research"
})
"fj" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 2;
pixel_y = 24
},
@@ -5104,7 +5104,7 @@
pixel_y = 0;
tag = ""
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 28
},
@@ -5267,7 +5267,7 @@
pixel_x = -4;
pixel_y = 2
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 2;
pixel_y = 24
},
@@ -5413,7 +5413,7 @@
pixel_x = 0;
pixel_y = 0
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 28
},
@@ -6594,7 +6594,7 @@
name = "MO19 Arrivals"
})
"jp" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
@@ -7560,7 +7560,7 @@
name = "MO19 Arrivals"
})
"kK" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_y = -24
},
@@ -8028,7 +8028,7 @@
name = "MO19 Arrivals"
})
"lt" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
@@ -8649,7 +8649,7 @@
name = "MO19 Arrivals"
})
"mw" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
@@ -8898,7 +8898,7 @@
name = "MO19 Arrivals"
})
"mS" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
@@ -812,7 +812,7 @@
name = "UO45 Central Hall"
})
"by" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
@@ -1841,7 +1841,7 @@
name = "UO45 Central Hall"
})
"do" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 2;
pixel_x = 0;
pixel_y = 24
@@ -2133,7 +2133,7 @@
/obj/structure/disposalpipe/segment{
dir = 4
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 2;
pixel_x = 0;
pixel_y = 24
@@ -3590,7 +3590,7 @@
name = "UO45 Central Hall"
})
"fW" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -4205,7 +4205,7 @@
name = "UO45 Research"
})
"gZ" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 2;
pixel_x = 0;
pixel_y = 24
@@ -4314,7 +4314,7 @@
/obj/machinery/light/small{
dir = 8
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 8;
pixel_x = -24
},
@@ -5061,7 +5061,7 @@
name = "UO45 Crew Quarters"
})
"iq" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 8;
pixel_x = -24
},
@@ -5827,7 +5827,7 @@
name = "UO45 Crew Quarters"
})
"jw" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 8;
pixel_x = -24
},
@@ -6511,7 +6511,7 @@
initialize_directions = 11;
tag = "icon-manifold-r-f (EAST)"
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
@@ -7046,7 +7046,7 @@
name = "UO45 Crew Quarters"
})
"lg" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -7409,7 +7409,7 @@
pixel_x = 0;
tag = ""
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -7594,7 +7594,7 @@
icon_state = "pipe-j1";
tag = "icon-pipe-j1 (EAST)"
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -7668,7 +7668,7 @@
name = "UO45 Research"
})
"lN" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -8181,7 +8181,7 @@
})
"mz" = (
/obj/machinery/atmospherics/pipe/simple/hidden/supply,
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 8;
pixel_x = -24
},
@@ -8241,7 +8241,7 @@
name = "UO45 Gateway"
})
"mE" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -9938,7 +9938,7 @@
scrub_N2O = 0;
scrub_Toxins = 0
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -10347,7 +10347,7 @@
/obj/machinery/light/small{
dir = 8
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 8;
pixel_x = -24
},
@@ -10384,7 +10384,7 @@
/obj/machinery/light/small{
dir = 4
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
@@ -11386,7 +11386,7 @@
/obj/item/storage/toolbox/mechanical{
pixel_y = 5
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 2;
pixel_x = 0;
pixel_y = 24
@@ -11735,7 +11735,7 @@
name = "UO45 Engineering"
})
"rj" = (
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 2;
pixel_x = 0;
pixel_y = 24
@@ -12914,7 +12914,7 @@
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
dir = 4
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -15179,7 +15179,7 @@
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
dir = 4
},
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 1;
pixel_x = 0;
pixel_y = -24
@@ -16281,7 +16281,7 @@
})
"xp" = (
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,
/obj/machinery/firealarm{
/obj/machinery/firealarm/no_alarm{
dir = 4;
pixel_x = 24
},
+1 -1
View File
@@ -624,7 +624,7 @@ var/record_id_num = 1001
clothes_s = new /icon('icons/mob/uniform.dmi', "syndicate_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/hands.dmi', "swat_gl"), ICON_UNDERLAY)
else if(H.mind.assigned_role in get_all_centcom_jobs())
else if(H.mind && H.mind.assigned_role in get_all_centcom_jobs())
clothes_s = new /icon('icons/mob/uniform.dmi', "officer_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "laceups"), ICON_UNDERLAY)
else
+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
+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)
@@ -72,7 +72,7 @@
var/mob/dead/observer/current_spirits = list()
for(var/mob/dead/observer/O in GLOB.player_list)
if(is_type_in_list(O.following, contents))
if((O.following in contents))
ghost_counter++
O.invisibility = 0
current_spirits |= O
+8 -8
View File
@@ -99,7 +99,7 @@
var/indestructible = 0 // If set, prevents aliens from destroying it
var/keep_preset_name = 0
var/report_power_alarm = 1
var/report_power_alarm = TRUE
var/shock_proof = 0 //if set to 1, this APC will not arc bolts of electricity if it's overloaded.
@@ -117,11 +117,11 @@
operating = 0
/obj/machinery/power/apc/noalarm
report_power_alarm = 0
report_power_alarm = FALSE
/obj/machinery/power/apc/syndicate //general syndicate access
req_access = list(access_syndicate)
report_power_alarm = 0
report_power_alarm = FALSE
/obj/item/apc_electronics
name = "power control module"
@@ -1171,14 +1171,14 @@
lighting = autoset(lighting, 1)
environ = autoset(environ, 1)
autoflag = 3
if(report_power_alarm)
if(report_power_alarm && is_station_contact(z))
SSalarms.power_alarm.clearAlarm(loc, src)
else if(cell.charge < 1250 && cell.charge > 750 && longtermpower < 0) // <30%, turn off equipment
if(autoflag != 2)
equipment = autoset(equipment, 2)
lighting = autoset(lighting, 1)
environ = autoset(environ, 1)
if(report_power_alarm)
if(report_power_alarm && is_station_contact(z))
SSalarms.power_alarm.triggerAlarm(loc, src)
autoflag = 2
else if(cell.charge < 750 && cell.charge > 10) // <15%, turn off lighting & equipment
@@ -1186,7 +1186,7 @@
equipment = autoset(equipment, 2)
lighting = autoset(lighting, 2)
environ = autoset(environ, 1)
if(report_power_alarm)
if(report_power_alarm && is_station_contact(z))
SSalarms.power_alarm.triggerAlarm(loc, src)
autoflag = 1
else if(cell.charge <= 0) // zero charge, turn all off
@@ -1194,7 +1194,7 @@
equipment = autoset(equipment, 0)
lighting = autoset(lighting, 0)
environ = autoset(environ, 0)
if(report_power_alarm)
if(report_power_alarm && is_station_contact(z))
SSalarms.power_alarm.triggerAlarm(loc, src)
autoflag = 0
@@ -1250,7 +1250,7 @@
equipment = autoset(equipment, 0)
lighting = autoset(lighting, 0)
environ = autoset(environ, 0)
if(report_power_alarm)
if(report_power_alarm && is_station_contact(z))
SSalarms.power_alarm.triggerAlarm(loc, src)
autoflag = 0
+4 -6
View File
@@ -82,11 +82,10 @@
var/heal_burn = 0
var/heal_oxy = 0
/obj/item/organ/internal/heart/cursed/attack(mob/living/carbon/human/H, mob/living/carbon/human/user, obj/target)
if(H == user && istype(H))
if(NO_BLOOD in H.dna.species.species_traits)
to_chat(H, "<span class = 'userdanger'>\The [src] is not compatible with your form!</span>")
to_chat(H, "<span class='userdanger'>[src] is not compatible with your form!</span>")
return
playsound(user,'sound/effects/singlebeat.ogg', 40, 1)
user.drop_item()
@@ -111,17 +110,16 @@
if(owner)
to_chat(owner, "<span class='userdanger'>Your heart has been replaced with a cursed one, you have to pump this one manually otherwise you'll die!</span>")
/datum/action/item_action/organ_action/cursed_heart
name = "pump your blood"
//You are now brea- pumping blood manually
/datum/action/item_action/organ_action/cursed_heart/Trigger()
. = ..()
if(. && istype(target,/obj/item/organ/internal/heart/cursed))
if(. && istype(target, /obj/item/organ/internal/heart/cursed))
var/obj/item/organ/internal/heart/cursed/cursed_heart = target
if(world.time < (cursed_heart.last_pump + (cursed_heart.pump_delay-10))) //no spam
if(world.time < (cursed_heart.last_pump + (cursed_heart.pump_delay - 10))) //no spam
to_chat(owner, "<span class='userdanger'>Too soon!</span>")
return
@@ -132,7 +130,7 @@
var/mob/living/carbon/human/H = owner
if(istype(H))
if(!(NO_BLOOD in H.dna.species.species_traits))
H.blood_volume = min(H.blood_volume + cursed_heart.blood_loss*0.5, BLOOD_VOLUME_NORMAL)
H.blood_volume = min(H.blood_volume + cursed_heart.blood_loss * 0.5, BLOOD_VOLUME_NORMAL)
if(owner.client)
owner.client.color = ""