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

This commit is contained in:
Vetinari
2014-02-21 20:01:33 +11:00
69 changed files with 2240 additions and 2952 deletions

View File

@@ -6,7 +6,7 @@
alert(usr,"Master_controller or air_master not found.","Air Report")
return
var/active_groups = air_master.active_zones.len
var/active_groups = air_master.active_zones
var/inactive_groups = air_master.zones.len - active_groups
var/hotspots = 0
@@ -18,7 +18,7 @@
for(var/zone/zone in air_master.zones)
var/turf/simulated/turf = locate() in zone.contents
if(turf && turf.z == 1)
if(zone.status)
if(zone.needs_update)
active_on_main_station++
else
inactive_on_main_station++

View File

@@ -124,49 +124,146 @@ var/intercom_range_display_status = 0
del(F)
feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
var/list/debug_verbs = list (
/client/proc/do_not_use_these
,/client/proc/camera_view
,/client/proc/sec_camera_report
,/client/proc/intercom_view
,/client/proc/air_status
,/client/proc/Cell
,/client/proc/atmosscan
,/client/proc/powerdebug
,/client/proc/count_objects_on_z_level
,/client/proc/count_objects_all
,/client/proc/cmd_assume_direct_control
,/client/proc/jump_to_dead_group
,/client/proc/startSinglo
,/client/proc/ticklag
,/client/proc/cmd_admin_grantfullaccess
,/client/proc/kaboom
,/client/proc/splash
,/client/proc/cmd_admin_areatest
,/client/proc/cmd_admin_rejuvenate
,/datum/admins/proc/show_traitor_panel
,/client/proc/print_jobban_old
,/client/proc/print_jobban_old_filter
,/client/proc/forceEvent
,/client/proc/break_all_air_groups
,/client/proc/regroup_all_air_groups
,/client/proc/kill_pipe_processing
,/client/proc/kill_air_processing
,/client/proc/disable_communication
,/client/proc/disable_movement
,/client/proc/Zone_Info
,/client/proc/Test_ZAS_Connection
,/client/proc/ZoneTick
,/client/proc/hide_debug_verbs
,/client/proc/testZAScolors
,/client/proc/testZAScolors_remove
)
/client/proc/enable_debug_verbs()
set category = "Debug"
set name = "Debug verbs"
if(!check_rights(R_DEBUG)) return
src.verbs += /client/proc/do_not_use_these //-errorage
src.verbs += /client/proc/camera_view //-errorage
src.verbs += /client/proc/sec_camera_report //-errorage
src.verbs += /client/proc/intercom_view //-errorage
src.verbs += /client/proc/air_status //Air things
src.verbs += /client/proc/Cell //More air things
src.verbs += /client/proc/atmosscan //check plumbing
src.verbs += /client/proc/powerdebug //check power
src.verbs += /client/proc/count_objects_on_z_level
src.verbs += /client/proc/count_objects_all
src.verbs += /client/proc/cmd_assume_direct_control //-errorage
src.verbs += /client/proc/jump_to_dead_group
src.verbs += /client/proc/startSinglo
src.verbs += /client/proc/ticklag //allows you to set the ticklag.
src.verbs += /client/proc/cmd_admin_grantfullaccess
src.verbs += /client/proc/kaboom
src.verbs += /client/proc/splash
src.verbs += /client/proc/cmd_admin_areatest
src.verbs += /client/proc/cmd_admin_rejuvenate
src.verbs += /datum/admins/proc/show_traitor_panel
src.verbs += /client/proc/print_jobban_old
src.verbs += /client/proc/print_jobban_old_filter
src.verbs += /client/proc/forceEvent
src.verbs += /client/proc/break_all_air_groups
src.verbs += /client/proc/regroup_all_air_groups
src.verbs += /client/proc/kill_pipe_processing
src.verbs += /client/proc/kill_air_processing
src.verbs += /client/proc/disable_communication
src.verbs += /client/proc/disable_movement
src.verbs += /client/proc/Zone_Info
src.verbs += /client/proc/Test_ZAS_Connection
src.verbs += /client/proc/ZoneTick
src.verbs += /client/proc/TestZASRebuild
//src.verbs += /client/proc/cmd_admin_rejuvenate
verbs += debug_verbs
feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/hide_debug_verbs()
set category = "Debug"
set name = "Hide Debug verbs"
if(!check_rights(R_DEBUG)) return
verbs -= debug_verbs
feedback_add_details("admin_verb","hDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/var/list/testZAScolors_turfs = list()
/client/var/list/testZAScolors_zones = list()
/client/var/usedZAScolors = 0
/client/var/list/image/ZAScolors = list()
/client/proc/recurse_zone(var/zone/Z, var/recurse_level =1)
testZAScolors_zones += Z
if(recurse_level > 10)
return
var/icon/yellow = new('icons/misc/debug_group.dmi', "yellow")
for(var/turf/T in Z.contents)
images += image(yellow, T, "zasdebug", TURF_LAYER)
testZAScolors_turfs += T
for(var/zone/connected in Z.connected_zones)
if(connected in testZAScolors_zones)
continue
recurse_zone(connected,recurse_level+1)
/client/proc/testZAScolors()
set category = "ZAS"
set name = "Check ZAS connections"
if(!check_rights(R_DEBUG)) return
testZAScolors_remove()
var/turf/location = get_turf(usr)
if(!istype(location, /turf/simulated)) // We're in space, let's not cause runtimes.
usr << "\red this debug tool cannot be used from space"
return
var/icon/red = new('icons/misc/debug_group.dmi', "red") //created here so we don't have to make thousands of these.
var/icon/green = new('icons/misc/debug_group.dmi', "green")
var/icon/blue = new('icons/misc/debug_group.dmi', "blue")
if(!usedZAScolors)
usr << "ZAS Test Colors"
usr << "Green = Zone you are standing in"
usr << "Blue = Connected zone to the zone you are standing in"
usr << "Yellow = A zone that is connected but not one adjacent to your connected zone"
usr << "Red = Not connected"
usedZAScolors = 1
testZAScolors_zones += location.zone
for(var/turf/T in location.zone.contents)
images += image(green, T,"zasdebug", TURF_LAYER)
testZAScolors_turfs += T
for(var/zone/Z in location.zone.connected_zones)
testZAScolors_zones += Z
for(var/turf/T in Z.contents)
images += image(blue, T,"zasdebug",TURF_LAYER)
testZAScolors_turfs += T
for(var/zone/connected in Z.connected_zones)
if(connected in testZAScolors_zones)
continue
recurse_zone(connected,1)
for(var/turf/T in range(25,location))
if(!istype(T))
continue
if(T in testZAScolors_turfs)
continue
images += image(red, T, "zasdebug", TURF_LAYER)
testZAScolors_turfs += T
/client/proc/testZAScolors_remove()
set category = "ZAS"
set name = "Remove ZAS connection colors"
testZAScolors_turfs.Cut()
testZAScolors_zones.Cut()
if(images.len)
for(var/image/i in images)
if(i.icon_state == "zasdebug")
images.Remove(i)
/client/proc/count_objects_on_z_level()
set category = "Mapping"
set name = "Count Objects On Level"
@@ -181,7 +278,7 @@ var/intercom_range_display_status = 0
var/type_path = text2path(type_text)
if(!type_path) return
var/count = 0
var/count = 1
var/list/atom/atom_list = list()
@@ -312,4 +409,4 @@ var/global/movement_disabled_exception //This is the client that calls the proc,
message_admins("[src.ckey] used 'Disable all movement', killing all movement.")
movement_disabled_exception = usr.ckey
else
message_admins("[src.ckey] used 'Disable all movement', restoring all movement.")*/
message_admins("[src.ckey] used 'Disable all movement', restoring all movement.")*/

View File

@@ -247,7 +247,7 @@ datum/preferences
dat += "<b>UI Style:</b> <a href='?_src_=prefs;preference=ui'><b>[UI_style]</b></a><br>"
dat += "<b>Custom UI</b>(recommended for White UI):<br>"
dat += "-Color: <a href='?_src_=prefs;preference=UIcolor'><b>[UI_style_color]</b></a> <table style='display:inline;' bgcolor='[UI_style_color]'><tr><td>__</td></tr></table><br>"
dat += "-Alpha(transparence): <a href='?_src_=prefs;preference=UIalpha'><b>[UI_style_alpha]</b></a><br>"
dat += "-Alpha(transparency): <a href='?_src_=prefs;preference=UIalpha'><b>[UI_style_alpha]</b></a><br>"
dat += "<b>Play admin midis:</b> <a href='?_src_=prefs;preference=hear_midis'><b>[(toggles & SOUND_MIDI) ? "Yes" : "No"]</b></a><br>"
dat += "<b>Play lobby music:</b> <a href='?_src_=prefs;preference=lobby_music'><b>[(toggles & SOUND_LOBBY) ? "Yes" : "No"]</b></a><br>"
dat += "<b>Ghost ears:</b> <a href='?_src_=prefs;preference=ghost_ears'><b>[(toggles & CHAT_GHOSTEARS) ? "Nearest Creatures" : "All Speech"]</b></a><br>"

View File

@@ -38,13 +38,15 @@
// Type 1 (Visual) emotes are sent to anyone in view of the item
if (m_type & 1)
for (var/mob/O in viewers(src, null))
var/list/can_see = get_mobs_in_view(1,src) //Allows silicon & mmi mobs carried around to see the emotes of the person carrying them around.
can_see |= viewers(src,null)
for (var/mob/O in can_see)
O.show_message(message, m_type)
// Type 2 (Audible) emotes are sent to anyone in hear range
// of the *LOCATION* -- this is important for pAIs to be heard
else if (m_type & 2)
for (var/mob/O in hearers(get_turf(src), null))
for (var/mob/O in get_mobs_in_view(7,src))
O.show_message(message, m_type)
/mob/proc/emote_dead(var/message)

View File

@@ -6,6 +6,7 @@
icon_state = "body_m_s"
var/list/hud_list = list()
var/datum/species/species //Contains icon generation and language information, set during New().
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
@@ -46,6 +47,7 @@
if(!dna)
dna = new /datum/dna(null)
dna.species=species.name
for(var/i=0;i<7;i++) // 2 for medHUDs and 5 for secHUDs
hud_list += image('icons/mob/hud.dmi', src, "hudunknown")
@@ -1184,8 +1186,14 @@
/mob/living/carbon/human/proc/set_species(var/new_species)
if(!new_species)
new_species = "Human"
if(!dna)
if(!new_species)
new_species = "Human"
else
if(!new_species)
new_species = dna.species
else
dna.species = new_species
if(species && (species.name && species.name == new_species))
return

View File

@@ -251,6 +251,7 @@ This function restores all organs.
if( (damage > (10*W.w_class)) && ( (sharp && !ismob(W.loc)) || prob(damage/W.w_class) ) )
organ.implants += W
visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
embedded_flag = 1
src.verbs += /mob/proc/yank_out_object
W.add_blood(src)
if(ismob(W.loc))
@@ -258,4 +259,4 @@ This function restores all organs.
H.drop_item()
W.loc = src
return 1
return 1

View File

@@ -99,6 +99,7 @@ emp_act
(SP.loc) = organ
organ.implants += SP
visible_message("<span class='danger'>The projectile sticks in the wound!</span>")
embedded_flag = 1
src.verbs += /mob/proc/yank_out_object
SP.add_blood(src)

View File

@@ -6,7 +6,8 @@
if (istype(loc, /turf/space)) return -1 // It's hard to be slowed down in space by... anything
handle_embedded_objects() //Moving with objects stuck in you can cause bad times.
if(embedded_flag)
handle_embedded_objects() //Moving with objects stuck in you can cause bad times.
if(reagents.has_reagent("hyperzine")) return -1

View File

@@ -105,7 +105,7 @@
handle_environment(environment)
//Status updates, death etc.
handle_regular_status_updates() //TODO: optimise ~Carn
handle_regular_status_updates() //TODO: optimise ~Carn NO SHIT ~Ccomp
update_canmove()
//Update our name based on whether our face is obscured/disfigured
@@ -1067,6 +1067,13 @@
if(halloss > 0)
adjustHalLoss(-1)
if(embedded_flag && !(life_tick % 10))
var/list/E
E = get_visible_implants(0)
if(!E.len)
embedded_flag = 0
//Eyes
if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1

View File

@@ -14,7 +14,7 @@
//var/uni_append = "12C4E2" // Small appearance modifier for different species.
var/list/uni_append = list(0x12C,0x4E2) // Same as above for DNA2.
var/update_muts = 1 // Monkey gene must be set at start.
var/alien = 0 //Used for reagent metabolism.
var/alien = 0 //Used for reagent metabolism.
/mob/living/carbon/monkey/tajara
name = "farwa"

View File

@@ -302,7 +302,7 @@ var/list/department_radio_keys = list(
var/list/listening
listening = get_mobs_in_view(message_range, src)
var/list/onscreen = get_mobs_in_view(7, src)
var/list/onscreen = viewers()
for(var/mob/M in player_list)
if (!M.client)
continue //skip monkeys and leavers

View File

@@ -643,5 +643,12 @@
dat += "</li>"
dat += "</ul>"
dat += "<br><br>"
dat += "Messages: <hr> [pda.tnote]"
return dat
for(var/index in pda.tnote)
if(index["sent"])
dat += addtext("<i><b>&rarr; To <a href='byond://?src=\ref[src];software=pdamessage;target=",index["src"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
else
dat += addtext("<i><b>&larr; From <a href='byond://?src=\ref[src];software=pdamessage;target=",index["target"],"'>", index["owner"],"</a>:</b></i><br>", index["message"], "<br>")
return dat

View File

@@ -3,7 +3,33 @@
#define APC_WIRE_MAIN_POWER2 3
#define APC_WIRE_AI_CONTROL 4
#define APC_UPDATE_ICON_COOLDOWN 200 // 20 seconds
//update_state
#define UPSTATE_CELL_IN 1
#define UPSTATE_OPENED1 2
#define UPSTATE_OPENED2 4
#define UPSTATE_MAINT 8
#define UPSTATE_BROKE 16
#define UPSTATE_BLUESCREEN 32
#define UPSTATE_WIREEXP 64
#define UPSTATE_ALLGOOD 128
//update_overlay
#define APC_UPOVERLAY_CHARGEING0 1
#define APC_UPOVERLAY_CHARGEING1 2
#define APC_UPOVERLAY_CHARGEING2 4
#define APC_UPOVERLAY_EQUIPMENT0 8
#define APC_UPOVERLAY_EQUIPMENT1 16
#define APC_UPOVERLAY_EQUIPMENT2 32
#define APC_UPOVERLAY_LIGHTING0 64
#define APC_UPOVERLAY_LIGHTING1 128
#define APC_UPOVERLAY_LIGHTING2 256
#define APC_UPOVERLAY_ENVIRON0 512
#define APC_UPOVERLAY_ENVIRON1 1024
#define APC_UPOVERLAY_ENVIRON2 2048
#define APC_UPOVERLAY_LOCKED 4096
#define APC_UPDATE_ICON_COOLDOWN 100 // 10 seconds
// the Area Power Controller (APC), formerly Power Distribution Unit (PDU)
// one per area, needs wire conection to power network
@@ -18,7 +44,6 @@
/obj/machinery/power/apc
name = "area power controller"
icon_state = "apc0"
anchored = 1
use_power = 0
@@ -64,8 +89,16 @@
"Yellow" = 4,
)
var/longtermpower = 10
var/update_state = -1
var/update_overlay = -1
var/global/status_overlays = 0
var/updating_icon = 0
//var/debug = 0
var/global/list/status_overlays_lock
var/global/list/status_overlays_charging
var/global/list/status_overlays_equipment
var/global/list/status_overlays_lighting
var/global/list/status_overlays_environ
/proc/RandomAPCWires()
//to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
@@ -175,36 +208,162 @@
else
usr << "The cover is closed."
// update the APC icon to show the three base states
// also add overlays for indicator lights
/obj/machinery/power/apc/update_icon()
if (!status_overlays)
status_overlays = 1
status_overlays_lock = new
status_overlays_charging = new
status_overlays_equipment = new
status_overlays_lighting = new
status_overlays_environ = new
overlays.Cut()
if(opened)
var/basestate = "apc[ cell ? "2" : "1" ]" // if opened, show cell if it's inserted
if (opened==1)
if (stat & (MAINT|BROKEN))
icon_state = "apcmaint" //disassembled APC cannot hold cell
else
icon_state = basestate
else if (opened == 2)
icon_state = "[basestate]-nocover"
else if (stat & BROKEN)
icon_state = "apc-b"
else if(emagged || malfai)
icon_state = "apcemag"
else if(wiresexposed)
icon_state = "apcewires"
else
icon_state = "apc0"
// if closed, update overlays for channel status
if(!(stat & (BROKEN|MAINT)))
overlays.Add("apcox-[locked]","apco3-[charging]") // 0=blue 1=red // 0=red, 1=yellow/black 2=green
status_overlays_lock.len = 2
status_overlays_charging.len = 3
status_overlays_equipment.len = 4
status_overlays_lighting.len = 4
status_overlays_environ.len = 4
status_overlays_lock[1] = image(icon, "apcox-0") // 0=blue 1=red
status_overlays_lock[2] = image(icon, "apcox-1")
status_overlays_charging[1] = image(icon, "apco3-0")
status_overlays_charging[2] = image(icon, "apco3-1")
status_overlays_charging[3] = image(icon, "apco3-2")
status_overlays_equipment[1] = image(icon, "apco0-0") // 0=red, 1=green, 2=blue
status_overlays_equipment[2] = image(icon, "apco0-1")
status_overlays_equipment[3] = image(icon, "apco0-2")
status_overlays_equipment[4] = image(icon, "apco0-3")
status_overlays_lighting[1] = image(icon, "apco1-0")
status_overlays_lighting[2] = image(icon, "apco1-1")
status_overlays_lighting[3] = image(icon, "apco1-2")
status_overlays_lighting[4] = image(icon, "apco1-3")
status_overlays_environ[1] = image(icon, "apco2-0")
status_overlays_environ[2] = image(icon, "apco2-1")
status_overlays_environ[3] = image(icon, "apco2-2")
status_overlays_environ[4] = image(icon, "apco2-3")
var/update = check_updates() //returns 0 if no need to update icons.
// 1 if we need to update the icon_state
// 2 if we need to update the overlays
if(!update)
return
if(update & 1) // Updating the icon state
if(update_state & UPSTATE_ALLGOOD)
icon_state = "apc0"
else if(update_state & (UPSTATE_OPENED1|UPSTATE_OPENED2))
var/basestate = "apc[ cell ? "2" : "1" ]"
if(update_state & UPSTATE_OPENED1)
if(update_state & (UPSTATE_MAINT|UPSTATE_BROKE))
icon_state = "apcmaint" //disabled APC cannot hold cell
else
icon_state = basestate
else if(update_state & UPSTATE_OPENED2)
icon_state = "[basestate]-nocover"
else if(update_state & UPSTATE_BROKE)
icon_state = "apc-b"
else if(update_state & UPSTATE_BLUESCREEN)
icon_state = "apcemag"
else if(update_state & UPSTATE_WIREEXP)
icon_state = "apcewires"
if(!(update_state & UPSTATE_ALLGOOD))
if(overlays.len)
overlays = 0
return
if(update & 2)
if(overlays.len)
overlays = 0
if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
overlays += status_overlays_lock[locked+1]
overlays += status_overlays_charging[charging+1]
if(operating)
overlays.Add("apco0-[equipment]","apco1-[lighting]","apco2-[environ]") // 0=red, 1=green, 2=blue
overlays += status_overlays_equipment[equipment+1]
overlays += status_overlays_lighting[lighting+1]
overlays += status_overlays_environ[environ+1]
/obj/machinery/power/apc/proc/check_updates()
var/last_update_state = update_state
var/last_update_overlay = update_overlay
update_state = 0
update_overlay = 0
if(cell)
update_state |= UPSTATE_CELL_IN
if(stat & BROKEN)
update_state |= UPSTATE_BROKE
if(stat & MAINT)
update_state |= UPSTATE_MAINT
if(opened)
if(opened==1)
update_state |= UPSTATE_OPENED1
if(opened==2)
update_state |= UPSTATE_OPENED2
else if(emagged || malfai)
update_state |= UPSTATE_BLUESCREEN
else if(wiresexposed)
update_state |= UPSTATE_WIREEXP
if(update_state <= 1)
update_state |= UPSTATE_ALLGOOD
if(update_state & UPSTATE_ALLGOOD)
if(locked)
update_overlay |= APC_UPOVERLAY_LOCKED
if(!charging)
update_overlay |= APC_UPOVERLAY_CHARGEING0
else if(charging == 1)
update_overlay |= APC_UPOVERLAY_CHARGEING1
else if(charging == 2)
update_overlay |= APC_UPOVERLAY_CHARGEING2
if (!equipment)
update_overlay |= APC_UPOVERLAY_EQUIPMENT0
else if(equipment == 1)
update_overlay |= APC_UPOVERLAY_EQUIPMENT1
else if(equipment == 2)
update_overlay |= APC_UPOVERLAY_EQUIPMENT2
if(!lighting)
update_overlay |= APC_UPOVERLAY_LIGHTING0
else if(lighting == 1)
update_overlay |= APC_UPOVERLAY_LIGHTING1
else if(lighting == 2)
update_overlay |= APC_UPOVERLAY_LIGHTING2
if(!environ)
update_overlay |= APC_UPOVERLAY_ENVIRON0
else if(environ==1)
update_overlay |= APC_UPOVERLAY_ENVIRON1
else if(environ==2)
update_overlay |= APC_UPOVERLAY_ENVIRON2
var/results = 0
if(last_update_state == update_state && last_update_overlay == update_overlay)
return 0
if(last_update_state != update_state)
results += 1
if(last_update_overlay != update_overlay && update_overlay != 0)
results += 2
return results
// Used in process so it doesn't update the icon too much
/obj/machinery/power/apc/proc/queue_icon_update()
if(!updating_icon)
@@ -214,6 +373,7 @@
update_icon()
updating_icon = 0
//attack with an item - open/close cover, insert cell, or (un)lock interface
/obj/machinery/power/apc/attackby(obj/item/W, mob/user)
@@ -1143,8 +1303,6 @@
update()
else if (last_ch != charging)
queue_icon_update()
//src.updateDialog()
src.updateDialog()
// val 0=off, 1=off(auto) 2=on 3=on(auto)
@@ -1267,4 +1425,4 @@
else
return 0
#undef APC_UPDATE_ICON_COOLDOWN
#undef APC_UPDATE_ICON_COOLDOWN

View File

@@ -452,13 +452,13 @@ datum
id = "chemsmoke"
result = null
required_reagents = list("potassium" = 1, "sugar" = 1, "phosphorus" = 1)
result_amount = null
result_amount = 0.4
secondary = 1
on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
var/datum/effect/effect/system/smoke_spread/chem/S = new /datum/effect/effect/system/smoke_spread/chem
S.attach(location)
S.set_up(holder, created_volume/7.5, 0, location)
S.set_up(holder, created_volume, 0, location)
playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3)
spawn(0)
S.start()

View File

@@ -93,6 +93,9 @@
if(!istype(L)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
return //Yeah just stop.
if(istype(L, /turf/space)) // Stop processing this stuff if we've been ejected.
return
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY)
var/stability = num2text(round((damage / explosion_point) * 100))