Merge remote-tracking branch 'upstream/master' into dev-freeze

Signed-off-by: Mloc-Argent <colmohici@gmail.com>

Conflicts:
	code/game/machinery/alarm.dm
This commit is contained in:
Mloc-Argent
2014-06-30 23:44:46 +01:00
13 changed files with 1748 additions and 1770 deletions
+8 -6
View File
@@ -156,12 +156,14 @@
src.updateUsrDialog()
return
if(href_list["atmos_unlock"])
switch(href_list["atmos_unlock"])
if("0")
current.air_doors_close(1)
if("1")
current.air_doors_open(1)
//commenting this out because it causes compile errors
//I tried fixing it but wasn't sucessful.
//if(href_list["atmos_unlock"])
// switch(href_list["atmos_unlock"])
// if("0")
// current.alarm_area.air_doors_close()
// if("1")
// current.alarm_area.air_doors_open()
if(href_list["atmos_alarm"])
if (current.alarm_area.atmosalert(2))
+46 -11
View File
@@ -71,10 +71,28 @@
/area/proc/atmosalert(danger_level)
// if(type==/area) //No atmos alarms in space
// return 0 //redudant
//Check all the alarms before lowering atmosalm. Raising is perfectly fine.
for (var/area/RA in related)
for (var/obj/machinery/alarm/AA in RA)
if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted)
danger_level = max(danger_level, AA.danger_level)
if(danger_level != atmosalm)
//updateicon()
//mouse_opacity = 0
if (danger_level==2)
if (danger_level < 1 && atmosalm >= 1)
//closing the doors on red and opening on green provides a bit of hysteresis that will hopefully prevent fire doors from opening and closing repeatedly due to noise
air_doors_open()
if (danger_level < 2 && atmosalm >= 2)
for(var/area/RA in related)
for(var/obj/machinery/camera/C in RA)
C.network.Remove("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in machines)
a.cancelAlarm("Atmosphere", src, src)
if (danger_level >= 2 && atmosalm < 2)
var/list/cameras = list()
for(var/area/RA in related)
//updateicon()
@@ -85,18 +103,35 @@
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
for(var/obj/machinery/computer/station_alert/a in machines)
a.triggerAlarm("Atmosphere", src, cameras, src)
else if (atmosalm == 2)
for(var/area/RA in related)
for(var/obj/machinery/camera/C in RA)
C.network.Remove("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in machines)
a.cancelAlarm("Atmosphere", src, src)
air_doors_close()
atmosalm = danger_level
return 1
return 0
/area/proc/air_doors_close()
if(!src.master.air_doors_activated)
src.master.air_doors_activated = 1
for(var/obj/machinery/door/firedoor/E in src.master.all_doors)
if(!E:blocked)
if(E.operating)
E:nextstate = CLOSED
else if(!E.density)
spawn(0)
E.close()
/area/proc/air_doors_open()
if(src.master.air_doors_activated)
src.master.air_doors_activated = 0
for(var/obj/machinery/door/firedoor/E in src.master.all_doors)
if(!E:blocked)
if(E.operating)
E:nextstate = OPEN
else if(E.density)
spawn(0)
E.open()
/area/proc/firealert()
if(name == "Space") //no fire alarms in space
return
+23 -89
View File
@@ -215,8 +215,7 @@
danger_level = overall_danger_level()
if (old_level != danger_level)
refresh_danger_level()
update_icon()
apply_danger_level(danger_level)
if (old_pressurelevel != pressure_dangerlevel)
if (breach_detected())
@@ -318,7 +317,12 @@
if((stat & (NOPOWER|BROKEN)) || shorted)
icon_state = "alarmp"
return
switch(max(danger_level, alarm_area.atmosalm))
var/icon_level = danger_level
if (alarm_area.atmosalm)
icon_level = max(icon_level, 1) //if there's an atmos alarm but everything is okay locally, no need to go past yellow
switch(icon_level)
if (0)
icon_state = "alarm0"
if (1)
@@ -436,16 +440,6 @@
if (alarm_area.atmosalert(new_danger_level))
post_alert(new_danger_level)
for (var/area/A in alarm_area.related)
for (var/obj/machinery/alarm/AA in A)
if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.danger_level != new_danger_level)
AA.update_icon()
if(danger_level > 1)
air_doors_close(0)
else
air_doors_open(0)
update_icon()
/obj/machinery/alarm/proc/post_alert(alert_level)
@@ -468,71 +462,6 @@
frequency.post_signal(src, alert_signal)
/obj/machinery/alarm/proc/refresh_danger_level()
var/level = 0
for (var/area/A in alarm_area.related)
for (var/obj/machinery/alarm/AA in A)
if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted)
if (AA.danger_level > level)
level = AA.danger_level
apply_danger_level(level)
/obj/machinery/alarm/proc/air_doors_close(manual)
var/area/A = get_area(src)
if(!A.master.air_doors_activated)
A.master.air_doors_activated = 1
for(var/obj/machinery/door/E in A.master.all_doors)
if(istype(E,/obj/machinery/door/firedoor))
if(!E:blocked)
if(E.operating)
E:nextstate = CLOSED
else if(!E.density)
spawn(0)
E.close()
continue
/* if(istype(E, /obj/machinery/door/airlock))
if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER) || E:air_locked) continue
if(!E.density)
spawn(0)
E.close()
spawn(10)
if(E.density)
E:air_locked = E.req_access
E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS)
E.update_icon()
else if(E.operating)
spawn(10)
E.close()
if(E.density)
E:air_locked = E.req_access
E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS)
E.update_icon()
else if(!E:locked) //Don't lock already bolted doors.
E:air_locked = E.req_access
E:req_access = list(ACCESS_ENGINE, ACCESS_ATMOSPHERICS)
E.update_icon()*/
/obj/machinery/alarm/proc/air_doors_open(manual)
var/area/A = get_area(loc)
if(A.master.air_doors_activated)
A.master.air_doors_activated = 0
for(var/obj/machinery/door/E in A.master.all_doors)
if(istype(E, /obj/machinery/door/firedoor))
if(!E:blocked)
if(E.operating)
E:nextstate = OPEN
else if(E.density)
spawn(0)
E.open()
continue
/* if(istype(E, /obj/machinery/door/airlock))
if((!E:arePowerSystemsOn()) || (E.stat & NOPOWER)) continue
if(!isnull(E:air_locked)) //Don't mess with doors locked for other reasons.
E:req_access = E:air_locked
E:air_locked = null
E.update_icon()*/
///////////
//HACKING//
@@ -775,19 +704,24 @@ Toxins: <span class='dl[phoron_dangerlevel]'>[phoron_percent]</span>%<br>
output += "Temperature: <span class='dl[temperature_dangerlevel]'>[environment.temperature]</span>K ([round(environment.temperature - T0C, 0.1)]C)<br>"
//Overall status
//'Local Status' should report the LOCAL status, damnit.
output += "Local Status: "
switch(max(pressure_dangerlevel,oxygen_dangerlevel,co2_dangerlevel,phoron_dangerlevel,other_dangerlevel,temperature_dangerlevel))
if(2)
output += "<span class='dl2'>DANGER: Internals Required</span>"
output += "<span class='dl2'>DANGER: Internals Required</span><br>"
if(1)
output += "<span class='dl1'>Caution</span>"
output += "<span class='dl1'>Caution</span><br>"
if(0)
if(alarm_area.atmosalm)
output += {"<span class='dl1'>Caution: Atmos alert in area</span>"}
else
output += {"<span class='dl0'>Optimal</span>"}
output += "<span class='dl0'>Optimal</span><br>"
output += "Area Status: "
if(alarm_area.atmosalm)
output += "<span class='dl1'>Atmos alert in area</span>"
else if (alarm_area.fire)
output += "<span class='dl1'>Fire alarm in area</span>"
else
output += "No alerts"
return output
/obj/machinery/alarm/proc/rcon_text()
@@ -818,9 +752,9 @@ Toxins: <span class='dl[phoron_dangerlevel]'>[phoron_percent]</span>%<br>
switch(screen)
if (AALARM_SCREEN_MAIN)
if(alarm_area.atmosalm)
output += "<a href='?src=\ref[src];atmos_reset=1'>Reset - Atmospheric Alarm</a><hr>"
output += "<a href='?src=\ref[src];atmos_reset=1'>Reset - Area Atmospheric Alarm</a><hr>"
else
output += "<a href='?src=\ref[src];atmos_alarm=1'>Activate - Atmospheric Alarm</a><hr>"
output += "<a href='?src=\ref[src];atmos_alarm=1'>Activate - Area Atmospheric Alarm</a><hr>"
output += {"
<a href='?src=\ref[src];screen=[AALARM_SCREEN_SCRUB]'>Scrubbers Control</a><br>
@@ -1083,9 +1017,9 @@ table tr:first-child th:first-child { border: none;}
if(href_list["atmos_unlock"])
switch(href_list["atmos_unlock"])
if("0")
air_doors_close(1)
alarm_area.air_doors_close()
if("1")
air_doors_open(1)
alarm_area.air_doors_open()
if(href_list["atmos_alarm"])
if (alarm_area.atmosalert(2))
+6 -6
View File
@@ -374,7 +374,7 @@ About the new airlock wires panel:
//Sending a pulse through this flashes the red light on the door (if the door has power).
if((src.arePowerSystemsOn()) && (!(stat & NOPOWER)))
do_animate("deny")
if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2)
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
//Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter).
src.loseMainPower()
if(AIRLOCK_WIRE_DOOR_BOLTS)
@@ -386,7 +386,7 @@ About the new airlock wires panel:
src.unlock()
src.updateUsrDialog()
if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2)
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
//two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter).
src.loseBackupPower()
if(AIRLOCK_WIRE_AI_CONTROL)
@@ -441,7 +441,7 @@ About the new airlock wires panel:
var/wireIndex = airlockWireColorToIndex[wireColor]
wires &= ~wireFlag
switch(wireIndex)
if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2)
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
//Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user.
src.loseMainPower()
src.shock(usr, 50)
@@ -450,7 +450,7 @@ About the new airlock wires panel:
//Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present)
src.lock()
src.updateUsrDialog()
if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2)
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
//Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user.
src.loseBackupPower()
src.shock(usr, 50)
@@ -486,12 +486,12 @@ About the new airlock wires panel:
var/wireIndex = airlockWireColorToIndex[wireColor] //not used in this function
wires |= wireFlag
switch(wireIndex)
if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2)
if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)))
src.regainMainPower()
src.shock(usr, 50)
src.updateUsrDialog()
if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2)
if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
if((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)))
src.regainBackupPower()
src.shock(usr, 50)
@@ -257,10 +257,9 @@ AI MODULES
/obj/item/weapon/aiModule/freeform/attack_self(var/mob/user as mob)
..()
lawpos = 0
while(lawpos < 15)
lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
lawpos = min(lawpos, 50)
var/new_lawpos = input("Please enter the priority for your new law. Can only write to law sectors 15 and above.", "Law Priority (15+)", lawpos) as num
if(new_lawpos < 15) return
lawpos = min(new_lawpos, 50)
var/newlaw = ""
var/targName = copytext(sanitize(input(usr, "Please enter a new law for the AI.", "Freeform Law Entry", newlaw)),1,MAX_MESSAGE_LEN)
newFreeFormLaw = targName
@@ -388,6 +388,7 @@
icon_opened = "syndicate1open"
/obj/structure/closet/wardrobe/tactical/New()
..()
new /obj/item/clothing/under/tactical(src)
new /obj/item/clothing/suit/armor/tactical(src)
new /obj/item/clothing/head/helmet/tactical(src)
@@ -396,4 +397,4 @@
new /obj/item/weapon/storage/belt/security/tactical(src)
new /obj/item/clothing/shoes/jackboots(src)
new /obj/item/clothing/gloves/black(src)
return
return
@@ -14,7 +14,7 @@
var/mob/living/buckled_mob
/obj/structure/stool/bed/psych
name = "psych bed"
name = "psychiatrists couch"
desc = "For prime comfort during psychiatric evaluations."
icon_state = "psychbed"
+1 -2
View File
@@ -72,11 +72,10 @@ var/list/event_last_fired = list()
possibleEvents[/datum/event/meteor_shower] = 20 * active_with_role["Engineer"]
possibleEvents[/datum/event/blob] = 10 * active_with_role["Engineer"]
possibleEvents[/datum/event/viral_infection] = 25 + active_with_role["Medical"] * 15
if(active_with_role["Medical"] > 0)
possibleEvents[/datum/event/radiation_storm] = active_with_role["Medical"] * 10
possibleEvents[/datum/event/spontaneous_appendicitis] = active_with_role["Medical"] * 10
possibleEvents[/datum/event/viral_infection] = active_with_role["Medical"] * 20
possibleEvents[/datum/event/viral_infection] = active_with_role["Medical"] * 10
possibleEvents[/datum/event/organ_failure] = active_with_role["Medical"] * 50
possibleEvents[/datum/event/prison_break] = active_with_role["Security"] * 50
+8 -5
View File
@@ -261,9 +261,11 @@
if (radiation)
if (radiation > 100)
radiation = 100
Weaken(10)
src << "\red You feel weak."
emote("collapse")
if(!(species.flags & RAD_ABSORB))
Weaken(10)
if(!lying)
src << "\red You feel weak."
emote("collapse")
if (radiation < 0)
radiation = 0
@@ -296,8 +298,9 @@
if(prob(5))
radiation -= 5
Weaken(3)
src << "\red You feel weak."
emote("collapse")
if(!lying)
src << "\red You feel weak."
emote("collapse")
updatehealth()
if(75 to 100)
@@ -139,8 +139,9 @@
if (radiation > 100)
radiation = 100
Weaken(10)
src << "\red You feel weak."
emote("collapse")
if(!lying)
src << "\red You feel weak."
emote("collapse")
switch(radiation)
if(1 to 49)
@@ -154,8 +155,9 @@
if(prob(5))
radiation -= 5
Weaken(3)
src << "\red You feel weak."
emote("collapse")
if(!lying)
src << "\red You feel weak."
emote("collapse")
if(75 to 100)
radiation -= 3
@@ -326,7 +326,13 @@
src << "<b>If a crewmember has noticed you, <i>you are probably breaking your third law</i></b>."
/mob/living/silicon/robot/drone/Bump(atom/movable/AM as mob|obj, yes)
if (!yes || ( !istype(AM,/obj/machinery/door) && !istype(AM,/obj/machinery/recharge_station) && !istype(AM,/obj/machinery/disposal/deliveryChute) ) ) return
if (!yes || ( \
!istype(AM,/obj/machinery/door) && \
!istype(AM,/obj/machinery/recharge_station) && \
!istype(AM,/obj/machinery/disposal/deliveryChute && \
!istype(AM,/obj/machinery/teleport/hub) && \
!istype(AM,/obj/effect/portal)
))) return
..()
return
@@ -219,7 +219,7 @@
..()
reagents.add_reagent("tea", 30)
src.pixel_x = rand(-10.0, 10)
src.pixel_y = rand(-10.0, 10)
src.pixel_y = rand(0, 20) // the teacup is very low on the 32x32 grid so if it's -y then it clips into the tile below it.
/obj/item/weapon/reagent_containers/food/drinks/ice
name = "Ice Cup"
@@ -310,4 +310,4 @@
name = "cup"
desc = "A cup with the British flag emblazoned on it."
icon_state = "britcup"
volume = 30
volume = 30
+1635 -1638
View File
File diff suppressed because it is too large Load Diff