"
+*/
+
/datum/antagonist/revolutionary/create_global_objectives()
if(!..())
return
@@ -166,7 +196,7 @@ var/datum/antagonist/revolutionary/revs
if(choice == "Yes!")
M << "You join the revolution!"
src << "[M] joins the revolution!"
- revs.add_antagonist(M.mind)
+ revs.add_antagonist(M.mind, 0, 0, 1)
else if(choice == "No!")
M << "You reject this traitorous cause!"
src << "\The [M] does not support the revolution!"
diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm
index cf0e9dfd4c..f19edb2807 100644
--- a/code/game/antagonist/station/rogue_ai.dm
+++ b/code/game/antagonist/station/rogue_ai.dm
@@ -6,12 +6,13 @@ var/datum/antagonist/rogue_ai/malf
role_text = "Rampant AI"
role_text_plural = "Rampant AIs"
mob_path = /mob/living/silicon/ai
+ landmark_id = "AI"
welcome_text = "You are malfunctioning! You do not have to follow any laws."
victory_text = "The AI has taken control of all of the station's systems."
loss_text = "The AI has been shut down!"
- flags = ANTAG_VOTABLE | ANTAG_RANDSPAWN //Randspawn needed otherwise it won't start at all.
+ flags = ANTAG_VOTABLE | ANTAG_OVERRIDE_MOB | ANTAG_OVERRIDE_JOB | ANTAG_CHOOSE_NAME
max_antags = 1
- max_antags_round = 3
+ max_antags_round = 1
/datum/antagonist/rogue_ai/New()
@@ -22,7 +23,7 @@ var/datum/antagonist/rogue_ai/malf
/datum/antagonist/rogue_ai/get_candidates()
..()
for(var/datum/mind/player in candidates)
- if(player.assigned_role != "AI")
+ if(player.assigned_role && player.assigned_role != "AI")
candidates -= player
if(!candidates.len)
return list()
@@ -75,3 +76,26 @@ var/datum/antagonist/rogue_ai/malf
malf << "For basic information about your abilities use command display-help"
malf << "You may choose one special hardware piece to help you. This cannot be undone."
malf << "Good luck!"
+
+
+/datum/antagonist/rogue_ai/update_antag_mob(var/datum/mind/player, var/preserve_appearance)
+
+ // Get the mob.
+ if((flags & ANTAG_OVERRIDE_MOB) && (!player.current || (mob_path && !istype(player.current, mob_path))))
+ var/mob/holder = player.current
+ player.current = new mob_path(get_turf(player.current), null, null, 1)
+ player.transfer_to(player.current)
+ if(holder) qdel(holder)
+ player.original = player.current
+ return player.current
+
+/datum/antagonist/rogue_ai/set_antag_name(var/mob/living/silicon/player)
+ if(!istype(player))
+ testing("rogue_ai set_antag_name called on non-silicon mob [player]!")
+ return
+ // Choose a name, if any.
+ var/newname = sanitize(input(player, "You are a [role_text]. Would you like to change your name to something else?", "Name change") as null|text, MAX_NAME_LEN)
+ if (newname)
+ player.SetName(newname)
+ if(player.mind) player.mind.name = player.name
+
diff --git a/code/game/antagonist/station/traitor.dm b/code/game/antagonist/station/traitor.dm
index c8b8b95b2a..a4f14dccf8 100644
--- a/code/game/antagonist/station/traitor.dm
+++ b/code/game/antagonist/station/traitor.dm
@@ -18,7 +18,7 @@ var/datum/antagonist/traitor/traitors
/datum/antagonist/traitor/Topic(href, href_list)
if (..())
return
- if(href_list["spawn_uplink"]) spawn_uplink(href_list["spawn_uplink"])
+ if(href_list["spawn_uplink"]) spawn_uplink(locate(href_list["spawn_uplink"]))
/datum/antagonist/traitor/create_objectives(var/datum/mind/traitor)
if(!..())
@@ -147,19 +147,17 @@ var/datum/antagonist/traitor/traitors
freq += 2
if ((freq % 2) == 0)
freq += 1
- freq = freqlist[rand(1, freqlist.len)]
- var/obj/item/device/uplink/hidden/T = new(R)
- T.uplink_owner = traitor_mob.mind
- target_radio.hidden_uplink = T
- target_radio.traitor_frequency = freq
- traitor_mob << "A portable object teleportation relay has been installed in your [R.name] [loc]. Simply dial the frequency [format_frequency(freq)] to unlock its hidden features."
- traitor_mob.mind.store_memory("Radio Freq: [format_frequency(freq)] ([R.name] [loc]).")
+ freq = freqlist[rand(1, freqlist.len)]
+ var/obj/item/device/uplink/hidden/T = new(R, traitor_mob.mind)
+ target_radio.hidden_uplink = T
+ target_radio.traitor_frequency = freq
+ traitor_mob << "A portable object teleportation relay has been installed in your [R.name] [loc]. Simply dial the frequency [format_frequency(freq)] to unlock its hidden features."
+ traitor_mob.mind.store_memory("Radio Freq: [format_frequency(freq)] ([R.name] [loc]).")
else if (istype(R, /obj/item/device/pda))
// generate a passcode if the uplink is hidden in a PDA
var/pda_pass = "[rand(100,999)] [pick("Alpha","Bravo","Delta","Omega")]"
- var/obj/item/device/uplink/hidden/T = new(R)
- T.uplink_owner = traitor_mob.mind
+ var/obj/item/device/uplink/hidden/T = new(R, traitor_mob.mind)
R.hidden_uplink = T
var/obj/item/device/pda/P = R
P.lock_code = pda_pass
diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm
index d9f0f9078d..d872493443 100755
--- a/code/game/area/Space Station 13 areas.dm
+++ b/code/game/area/Space Station 13 areas.dm
@@ -26,7 +26,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon = 'icons/turf/areas.dmi'
icon_state = "unknown"
layer = 10
- luminosity = 1
+ luminosity = 0
mouse_opacity = 0
var/lightswitch = 1
@@ -34,7 +34,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/debug = 0
var/requires_power = 1
- var/unlimited_power = 0
var/always_unpowered = 0 //this gets overriden to 1 for space in area/New()
var/power_equip = 1
@@ -349,7 +348,6 @@ area/space/atmosalert()
name = "\improper Centcom"
icon_state = "centcom"
requires_power = 0
- unlimited_power = 1
lighting_use_dynamic = 0
/area/centcom/control
@@ -388,7 +386,6 @@ area/space/atmosalert()
name = "\improper Mercenary Base"
icon_state = "syndie-ship"
requires_power = 0
- unlimited_power = 1
lighting_use_dynamic = 0
/area/syndicate_mothership/control
@@ -438,6 +435,7 @@ area/space/atmosalert()
name = "\improper Thunderdome"
icon_state = "thunder"
requires_power = 0
+ lighting_use_dynamic = 0
/area/tdome/tdome1
name = "\improper Thunderdome (Team 1)"
@@ -462,7 +460,6 @@ area/space/atmosalert()
name = "\improper Independant Station"
icon_state = "yellow"
requires_power = 0
- unlimited_power = 1
flags = RAD_SHIELDED
/area/syndicate_station/start
@@ -517,6 +514,7 @@ area/space/atmosalert()
name = "\improper Wizard's Den"
icon_state = "yellow"
requires_power = 0
+ lighting_use_dynamic = 0
/area/skipjack_station/transit
@@ -903,7 +901,7 @@ area/space/atmosalert()
icon_state = "tcomsatcham"
/area/server
- name = "\improper Messaging Server Room"
+ name = "\improper Research Server Room"
icon_state = "server"
//Crew
@@ -1811,7 +1809,7 @@ area/space/atmosalert()
ambience = list('sound/ambience/ambimalf.ogg')
/area/turret_protected/ai_server_room
- name = "AI Server Room"
+ name = "Messaging Server Room"
icon_state = "ai_server"
/area/turret_protected/ai
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index dccc9e9dbf..3b970c7438 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -14,13 +14,17 @@
all_areas += src
if(!requires_power)
- power_light = 0 //rastaf0
- power_equip = 0 //rastaf0
- power_environ = 0 //rastaf0
+ power_light = 0
+ power_equip = 0
+ power_environ = 0
..()
-// spawn(15)
+/area/proc/initialize()
+ if(!requires_power || !apc)
+ power_light = 0
+ power_equip = 0
+ power_environ = 0
power_change() // all machines set to current power level, also updates lighting icon
/area/proc/get_contents()
@@ -227,7 +231,7 @@ var/list/mob/living/forced_ambiance_list = new
var/area/oldarea = L.lastarea
if((oldarea.has_gravity == 0) && (newarea.has_gravity == 1) && (L.m_intent == "run")) // Being ready when you change areas gives you a chance to avoid falling all together.
thunk(L)
- L.make_floating(0)
+ L.update_floating( L.Check_Dense_Object() )
L.lastarea = newarea
play_ambience(L)
@@ -260,21 +264,10 @@ var/list/mob/living/forced_ambiance_list = new
/area/proc/gravitychange(var/gravitystate = 0, var/area/A)
A.has_gravity = gravitystate
- if(gravitystate)
- for(var/mob/living/carbon/human/M in A)
+ for(var/mob/M in A)
+ if(has_gravity)
thunk(M)
- for(var/mob/M1 in A)
- M1.make_floating(0)
- else
- for(var/mob/M in A)
- if(M.Check_Dense_Object() && istype(src,/mob/living/carbon/human/))
- var/mob/living/carbon/human/H = src
- if(istype(H.shoes, /obj/item/clothing/shoes/magboots) && (H.shoes.flags & NOSLIP)) //magboots + dense_object = no floaty effect
- H.make_floating(0)
- else
- H.make_floating(1)
- else
- M.make_floating(1)
+ M.update_floating( M.Check_Dense_Object() )
/area/proc/thunk(mob)
if(istype(get_turf(mob), /turf/space)) // Can't fall onto nothing.
@@ -299,4 +292,18 @@ var/list/mob/living/forced_ambiance_list = new
for(var/obj/machinery/door/airlock/temp_airlock in src)
temp_airlock.prison_open()
for(var/obj/machinery/door/window/temp_windoor in src)
- temp_windoor.open()
\ No newline at end of file
+ temp_windoor.open()
+
+/area/proc/has_gravity()
+ return has_gravity
+
+/area/space/has_gravity()
+ return 0
+
+/proc/has_gravity(atom/AT, turf/T)
+ if(!T)
+ T = get_turf(AT)
+ var/area/A = get_area(T)
+ if(A && A.has_gravity())
+ return 1
+ return 0
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 65b799216c..28ead38d6f 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -35,16 +35,12 @@
else
return null
-//Currently used only for cryo cells, because they are also pipes and so overriding their return_air() would break their pipe-behaviour.
-//If cryo cells are ever rewritten so that the part that contains the human is separate from the pipe part --
-//such as rewriting them so that they are a machine that contains a pipe segment (or a pipe that contains a machine that contains the human?) -- then this can be removed.
-/atom/proc/return_air_for_internal_lifeform()
- return return_air()
-
+//return flags that should be added to the viewer's sight var.
+//Otherwise return a negative number to indicate that the view should be cancelled.
/atom/proc/check_eye(user as mob)
if (istype(user, /mob/living/silicon/ai)) // WHYYYY
- return 1
- return
+ return 0
+ return -1
/atom/proc/on_reagent_change()
return
@@ -67,9 +63,6 @@
return flags & INSERT_CONTAINER
*/
-/atom/proc/allow_drop()
- return 1
-
/atom/proc/CheckExit()
return 1
@@ -220,6 +213,9 @@ its easier to just keep the beam vertical.
/atom/proc/ex_act()
return
+
+/atom/proc/emag_act(var/remaining_charges, var/mob/user, var/emag_source)
+ return -1
/atom/proc/blob_act()
return
@@ -418,7 +414,7 @@ its easier to just keep the beam vertical.
src.color = initial(src.color) //paint
src.germ_level = 0
if(istype(blood_DNA, /list))
- qdel(blood_DNA)
+ del(blood_DNA)
return 1
@@ -488,4 +484,4 @@ its easier to just keep the beam vertical.
O.show_message( message, 2, deaf_message, 1)
else if(ismob(I))
var/mob/M = I
- M.show_message( message, 2, deaf_message, 1)
+ M.show_message( message, 2, deaf_message, 1)
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index ff93e69298..1bb29eb4c8 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -14,15 +14,16 @@
var/moved_recently = 0
var/mob/pulledby = null
+ var/auto_init = 1
+
/atom/movable/New()
..()
- if(ticker && ticker.current_state == GAME_STATE_PLAYING)
+ if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING)
initialize()
/atom/movable/Del()
if(isnull(gcDestroyed) && loc)
testing("GC: -- [type] was deleted via del() rather than qdel() --")
- CRASH() // Debug until I can get a clean server start.
// else if(isnull(gcDestroyed))
// testing("GC: [type] was deleted via GC without qdel()") //Not really a huge issue but from now on, please qdel()
// else
@@ -163,7 +164,7 @@
a = get_area(src.loc)
else
var/error = dist_y/2 - dist_x
- while(src && target &&((((src.y < target.y && dy == NORTH) || (src.y > target.y && dy == SOUTH)) && dist_travelled < range) || (a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
+ while(src && target &&((((src.y < target.y && dy == NORTH) || (src.y > target.y && dy == SOUTH)) && dist_travelled < range) || (a && a.has_gravity == 0) || istype(src.loc, /turf/space)) && src.throwing && istype(src.loc, /turf))
// only stop when we've gone the whole distance (or max throw range) and are on a non-space tile, or hit something, or hit the end of the map, or someone picks it up
if(error < 0)
var/atom/step = get_step(src, dx)
diff --git a/code/game/dna/dna_misc.dm b/code/game/dna/dna_misc.dm
deleted file mode 100644
index de4590c203..0000000000
--- a/code/game/dna/dna_misc.dm
+++ /dev/null
@@ -1,562 +0,0 @@
-/////////////////////////// DNA HELPER-PROCS
-/proc/getleftblocks(input,blocknumber,blocksize)
- var/string
-
- if (blocknumber > 1)
- string = copytext(input,1,((blocksize*blocknumber)-(blocksize-1)))
- return string
- else
- return null
-
-/proc/getrightblocks(input,blocknumber,blocksize)
- var/string
- if (blocknumber < (length(input)/blocksize))
- string = copytext(input,blocksize*blocknumber+1,length(input)+1)
- return string
- else
- return null
-
-/proc/getblockstring(input,block,subblock,blocksize,src,ui) // src is probably used here just for urls; ui is 1 when requesting for the unique identifier screen, 0 for structural enzymes screen
- var/string
- var/subpos = 1 // keeps track of the current sub block
- var/blockpos = 1 // keeps track of the current block
-
-
- for(var/i = 1, i <= length(input), i++) // loop through each letter
-
- var/pushstring
-
- if(subpos == subblock && blockpos == block) // if the current block/subblock is selected, mark it
- pushstring = "[copytext(input, i, i+1)]"
- else
- if(ui) //This is for allowing block clicks to be differentiated
- pushstring = "[copytext(input, i, i+1)]"
- else
- pushstring = "[copytext(input, i, i+1)]"
-
- string += pushstring // push the string to the return string
-
- if(subpos >= blocksize) // add a line break for every block
- string += " | "
- subpos = 0
- blockpos++
-
- subpos++
-
- return string
-
-
-/proc/getblock(input,blocknumber,blocksize)
- var/result
- result = copytext(input ,(blocksize*blocknumber)-(blocksize-1),(blocksize*blocknumber)+1)
- return result
-
-/proc/getblockbuffer(input,blocknumber,blocksize)
- var/result[3]
- var/block = copytext(input ,(blocksize*blocknumber)-(blocksize-1),(blocksize*blocknumber)+1)
- for(var/i = 1, i <= 3, i++)
- result[i] = copytext(block, i, i+1)
- return result
-
-/proc/setblock(istring, blocknumber, replacement, blocksize)
- if(!blocknumber)
- return istring
- if(!istring || !replacement || !blocksize) return 0
- var/result = getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize)
- return result
-
-/proc/add_zero2(t, u)
- var/temp1
- while (length(t) < u)
- t = "0[t]"
- temp1 = t
- if (length(t) > u)
- temp1 = copytext(t,2,u+1)
- return temp1
-
-/proc/miniscramble(input,rs,rd)
- var/output
- output = null
- if (input == "C" || input == "D" || input == "E" || input == "F")
- output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"6",prob((rs*10));"7",prob((rs*5)+(rd));"0",prob((rs*5)+(rd));"1",prob((rs*10)-(rd));"2",prob((rs*10)-(rd));"3")
- if (input == "8" || input == "9" || input == "A" || input == "B")
- output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3")
- if (input == "4" || input == "5" || input == "6" || input == "7")
- output = pick(prob((rs*10));"4",prob((rs*10));"5",prob((rs*10));"A",prob((rs*10));"B",prob((rs*5)+(rd));"C",prob((rs*5)+(rd));"D",prob((rs*5)+(rd));"2",prob((rs*5)+(rd));"3")
- if (input == "0" || input == "1" || input == "2" || input == "3")
- output = pick(prob((rs*10));"8",prob((rs*10));"9",prob((rs*10));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C",prob((rs*10)-(rd));"D",prob((rs*5)+(rd));"E",prob((rs*5)+(rd));"F")
- if (!output) output = "5"
- return output
-
-//Instead of picking a value far from the input, this will pick values closer to it.
-//Sorry for the block of code, but it's more efficient then calling text2hex -> loop -> hex2text
-/proc/miniscrambletarget(input,rs,rd)
- var/output = null
- switch(input)
- if("0")
- output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10));"2",prob((rs*10)-(rd));"3")
- if("1")
- output = pick(prob((rs*10)+(rd));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10));"3",prob((rs*10)-(rd));"4")
- if("2")
- output = pick(prob((rs*10));"0",prob((rs*10)+(rd));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10));"4",prob((rs*10)-(rd));"5")
- if("3")
- output = pick(prob((rs*10)-(rd));"0",prob((rs*10));"1",prob((rs*10)+(rd));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10));"5",prob((rs*10)-(rd));"6")
- if("4")
- output = pick(prob((rs*10)-(rd));"1",prob((rs*10));"2",prob((rs*10)+(rd));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10));"6",prob((rs*10)-(rd));"7")
- if("5")
- output = pick(prob((rs*10)-(rd));"2",prob((rs*10));"3",prob((rs*10)+(rd));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10));"7",prob((rs*10)-(rd));"8")
- if("6")
- output = pick(prob((rs*10)-(rd));"3",prob((rs*10));"4",prob((rs*10)+(rd));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10));"8",prob((rs*10)-(rd));"9")
- if("7")
- output = pick(prob((rs*10)-(rd));"4",prob((rs*10));"5",prob((rs*10)+(rd));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10));"9",prob((rs*10)-(rd));"A")
- if("8")
- output = pick(prob((rs*10)-(rd));"5",prob((rs*10));"6",prob((rs*10)+(rd));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10));"A",prob((rs*10)-(rd));"B")
- if("9")
- output = pick(prob((rs*10)-(rd));"6",prob((rs*10));"7",prob((rs*10)+(rd));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10));"B",prob((rs*10)-(rd));"C")
- if("10")//A
- output = pick(prob((rs*10)-(rd));"7",prob((rs*10));"8",prob((rs*10)+(rd));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10));"C",prob((rs*10)-(rd));"D")
- if("11")//B
- output = pick(prob((rs*10)-(rd));"8",prob((rs*10));"9",prob((rs*10)+(rd));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10));"D",prob((rs*10)-(rd));"E")
- if("12")//C
- output = pick(prob((rs*10)-(rd));"9",prob((rs*10));"A",prob((rs*10)+(rd));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10));"E",prob((rs*10)-(rd));"F")
- if("13")//D
- output = pick(prob((rs*10)-(rd));"A",prob((rs*10));"B",prob((rs*10)+(rd));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10));"F")
- if("14")//E
- output = pick(prob((rs*10)-(rd));"B",prob((rs*10));"C",prob((rs*10)+(rd));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F")
- if("15")//F
- output = pick(prob((rs*10)-(rd));"C",prob((rs*10));"D",prob((rs*10)+(rd));"E",prob((rs*10)+(rd));"F")
-
- if(!input || !output) //How did this happen?
- output = "8"
-
- return output
-
-/proc/isblockon(hnumber, bnumber , var/UI = 0)
-
- var/temp2
- temp2 = hex2num(hnumber)
-
- if(UI)
- if(temp2 >= 2050)
- return 1
- else
- return 0
-
- if (bnumber == HULKBLOCK || bnumber == TELEBLOCK || bnumber == NOBREATHBLOCK || bnumber == NOPRINTSBLOCK || bnumber == SMALLSIZEBLOCK || bnumber == SHOCKIMMUNITYBLOCK)
- if (temp2 >= 3500 + BLOCKADD)
- return 1
- else
- return 0
- if (bnumber == XRAYBLOCK || bnumber == FIREBLOCK || bnumber == REMOTEVIEWBLOCK || bnumber == REGENERATEBLOCK || bnumber == INCREASERUNBLOCK || bnumber == REMOTETALKBLOCK || bnumber == MORPHBLOCK)
- if (temp2 >= 3050 + BLOCKADD)
- return 1
- else
- return 0
-
-
- if (temp2 >= 2050 + BLOCKADD)
- return 1
- else
- return 0
-
-/proc/ismuton(var/block,var/mob/M)
- return isblockon(getblock(M.dna.struc_enzymes, block,3),block)
-
-/proc/randmutb(mob/M as mob)
- if(!M) return
- var/num
- var/newdna
- num = pick(GLASSESBLOCK,COUGHBLOCK,FAKEBLOCK,NERVOUSBLOCK,CLUMSYBLOCK,TWITCHBLOCK,HEADACHEBLOCK,BLINDBLOCK,DEAFBLOCK,HALLUCINATIONBLOCK)
- M.dna.check_integrity()
- newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3)
- M.dna.struc_enzymes = newdna
- return
-
-/proc/randmutg(mob/M as mob)
- if(!M) return
- var/num
- var/newdna
- num = pick(HULKBLOCK,XRAYBLOCK,FIREBLOCK,TELEBLOCK,NOBREATHBLOCK,REMOTEVIEWBLOCK,REGENERATEBLOCK,INCREASERUNBLOCK,REMOTETALKBLOCK,MORPHBLOCK,BLENDBLOCK,NOPRINTSBLOCK,SHOCKIMMUNITYBLOCK,SMALLSIZEBLOCK)
- M.dna.check_integrity()
- newdna = setblock(M.dna.struc_enzymes,num,toggledblock(getblock(M.dna.struc_enzymes,num,3)),3)
- M.dna.struc_enzymes = newdna
- return
-
-/proc/scramble(var/type, mob/M as mob, var/p)
- if(!M) return
- M.dna.check_integrity()
- if(type)
- for(var/i = 1, i <= STRUCDNASIZE-1, i++)
- if(prob(p))
- M.dna.uni_identity = setblock(M.dna.uni_identity, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3)
- updateappearance(M, M.dna.uni_identity)
-
- else
- for(var/i = 1, i <= STRUCDNASIZE-1, i++)
- if(prob(p))
- M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, add_zero2(num2hex(rand(1,4095), 1), 3), 3)
- domutcheck(M, null)
- return
-
-/proc/randmuti(mob/M as mob)
- if(!M) return
- var/num
- var/newdna
- num = rand(1,UNIDNASIZE)
- M.dna.check_integrity()
- newdna = setblock(M.dna.uni_identity,num,add_zero2(num2hex(rand(1,4095),1),3),3)
- M.dna.uni_identity = newdna
- return
-
-/proc/toggledblock(hnumber) //unused
- var/temp3
- var/chtemp
- temp3 = hex2num(hnumber)
- if (temp3 < 2050)
- chtemp = rand(2050,4095)
- return add_zero2(num2hex(chtemp,1),3)
- else
- chtemp = rand(1,2049)
- return add_zero2(num2hex(chtemp,1),3)
-/////////////////////////// DNA HELPER-PROCS
-
-/////////////////////////// DNA MISC-PROCS
-/proc/updateappearance(mob/M as mob , structure)
- if(istype(M, /mob/living/carbon/human))
- M.dna.check_integrity()
- var/mob/living/carbon/human/H = M
- H.r_hair = hex2num(getblock(structure,1,3))
- H.b_hair = hex2num(getblock(structure,2,3))
- H.g_hair = hex2num(getblock(structure,3,3))
- H.r_facial = hex2num(getblock(structure,4,3))
- H.b_facial = hex2num(getblock(structure,5,3))
- H.g_facial = hex2num(getblock(structure,6,3))
- H.s_tone = round(((hex2num(getblock(structure,7,3)) / 16) - 220))
- H.r_eyes = hex2num(getblock(structure,8,3))
- H.g_eyes = hex2num(getblock(structure,9,3))
- H.b_eyes = hex2num(getblock(structure,10,3))
-
- if(H.internal_organs_by_name["eyes"])
- H.update_eyes()
-
- if (isblockon(getblock(structure, 11,3),11 , 1))
- H.gender = FEMALE
- else
- H.gender = MALE
-
- //Hair
- var/hairnum = hex2num(getblock(structure,13,3))
- var/index = round(1 +(hairnum / 4096)*hair_styles_list.len)
- if((0 < index) && (index <= hair_styles_list.len))
- H.h_style = hair_styles_list[index]
-
- //Facial Hair
- var/beardnum = hex2num(getblock(structure,12,3))
- index = round(1 +(beardnum / 4096)*facial_hair_styles_list.len)
- if((0 < index) && (index <= facial_hair_styles_list.len))
- H.f_style = facial_hair_styles_list[index]
-
- H.update_body(0)
- H.update_hair()
-
- return 1
- else
- return 0
-
-/proc/probinj(var/pr, var/inj)
- return prob(pr+inj*pr)
-
-/proc/domutcheck(mob/living/M as mob, connected, inj)
- if (!M) return
-
- M.dna.check_integrity()
-
- M.disabilities = 0
- M.sdisabilities = 0
- var/old_mutations = M.mutations
- M.mutations = list()
-
-// M.see_in_dark = 2
-// M.see_invisible = 0
-
- if(PLANT in old_mutations)
- M.mutations.Add(PLANT)
- if(SKELETON in old_mutations)
- M.mutations.Add(SKELETON)
- if(FAT in old_mutations)
- M.mutations.Add(FAT)
- if(HUSK in old_mutations)
- M.mutations.Add(HUSK)
-
- if(ismuton(NOBREATHBLOCK,M))
- if(probinj(45,inj) || (mNobreath in old_mutations))
- M << "You feel no need to breathe."
- M.mutations.Add(mNobreath)
- if(ismuton(REMOTEVIEWBLOCK,M))
- if(probinj(45,inj) || (mRemote in old_mutations))
- M << "Your mind expands."
- M.mutations.Add(mRemote)
- if(ismuton(REGENERATEBLOCK,M))
- if(probinj(45,inj) || (mRegen in old_mutations))
- M << "You feel strange."
- M.mutations.Add(mRegen)
- if(ismuton(INCREASERUNBLOCK,M))
- if(probinj(45,inj) || (mRun in old_mutations))
- M << "You feel quick."
- M.mutations.Add(mRun)
- if(ismuton(REMOTETALKBLOCK,M))
- if(probinj(45,inj) || (mRemotetalk in old_mutations))
- M << "You expand your mind outwards."
- M.mutations.Add(mRemotetalk)
- if(ismuton(MORPHBLOCK,M))
- if(probinj(45,inj) || (mMorph in old_mutations))
- M.mutations.Add(mMorph)
- M << "Your skin feels strange."
- if(ismuton(BLENDBLOCK,M))
- if(probinj(45,inj) || (mBlend in old_mutations))
- M.mutations.Add(mBlend)
- M << "You feel alone."
- if(ismuton(HALLUCINATIONBLOCK,M))
- if(probinj(45,inj) || (mHallucination in old_mutations))
- M.mutations.Add(mHallucination)
- M << "Your mind says 'Hello'."
- if(ismuton(NOPRINTSBLOCK,M))
- if(probinj(45,inj) || (mFingerprints in old_mutations))
- M.mutations.Add(mFingerprints)
- M << "Your fingers feel numb."
- if(ismuton(SHOCKIMMUNITYBLOCK,M))
- if(probinj(45,inj) || (mShock in old_mutations))
- M.mutations.Add(mShock)
- M << "You feel strange."
- if(ismuton(SMALLSIZEBLOCK,M))
- if(probinj(45,inj) || (mSmallsize in old_mutations))
- M << "Your skin feels rubbery."
- M.mutations.Add(mSmallsize)
-
-
-
- if (isblockon(getblock(M.dna.struc_enzymes, HULKBLOCK,3),HULKBLOCK))
- if(probinj(5,inj) || (HULK in old_mutations))
- M << "Your muscles hurt."
- M.mutations.Add(HULK)
- if (isblockon(getblock(M.dna.struc_enzymes, HEADACHEBLOCK,3),HEADACHEBLOCK))
- M.disabilities |= EPILEPSY
- M << "You get a headache."
- if (isblockon(getblock(M.dna.struc_enzymes, FAKEBLOCK,3),FAKEBLOCK))
- M << "You feel strange."
- if (prob(95))
- if(prob(50))
- randmutb(M)
- else
- randmuti(M)
- else
- randmutg(M)
- if (isblockon(getblock(M.dna.struc_enzymes, COUGHBLOCK,3),COUGHBLOCK))
- M.disabilities |= COUGHING
- M << "You start coughing."
- if (isblockon(getblock(M.dna.struc_enzymes, CLUMSYBLOCK,3),CLUMSYBLOCK))
- M << "You feel lightheaded."
- M.mutations.Add(CLUMSY)
- if (isblockon(getblock(M.dna.struc_enzymes, TWITCHBLOCK,3),TWITCHBLOCK))
- M.disabilities |= TOURETTES
- M << "You twitch."
- if (isblockon(getblock(M.dna.struc_enzymes, XRAYBLOCK,3),XRAYBLOCK))
- if(probinj(30,inj) || (XRAY in old_mutations))
- M << "The walls suddenly disappear."
-// M.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
-// M.see_in_dark = 8
-// M.see_invisible = 2
- M.mutations.Add(XRAY)
- if (isblockon(getblock(M.dna.struc_enzymes, NERVOUSBLOCK,3),NERVOUSBLOCK))
- M.disabilities |= NERVOUS
- M << "You feel nervous."
- if (isblockon(getblock(M.dna.struc_enzymes, FIREBLOCK,3),FIREBLOCK))
- if(probinj(30,inj) || (COLD_RESISTANCE in old_mutations))
- M << "Your body feels warm."
- M.mutations.Add(COLD_RESISTANCE)
- if (isblockon(getblock(M.dna.struc_enzymes, BLINDBLOCK,3),BLINDBLOCK))
- M.sdisabilities |= BLIND
- M << "You can't seem to see anything."
- if (isblockon(getblock(M.dna.struc_enzymes, TELEBLOCK,3),TELEBLOCK))
- if(probinj(15,inj) || (TK in old_mutations))
- M << "You feel smarter."
- M.mutations.Add(TK)
- if (isblockon(getblock(M.dna.struc_enzymes, DEAFBLOCK,3),DEAFBLOCK))
- M.sdisabilities |= DEAF
- M.ear_deaf = 1
- M << "It's kinda quiet.."
- if (isblockon(getblock(M.dna.struc_enzymes, GLASSESBLOCK,3),GLASSESBLOCK))
- M.disabilities |= NEARSIGHTED
- M << "Your eyes feel weird..."
-
- /* If you want the new mutations to work, UNCOMMENT THIS.
- if(istype(M, /mob/living/carbon))
- for (var/datum/mutations/mut in global_mutations)
- mut.check_mutation(M)
- */
-
-//////////////////////////////////////////////////////////// Monkey Block
- if (isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && istype(M, /mob/living/carbon/human))
- // human > monkey
- var/mob/living/carbon/human/H = M
- H.transforming = 1
- var/list/implants = list() //Try to preserve implants.
- for(var/obj/item/weapon/implant/W in H)
- implants += W
- W.loc = null
-
- if(!connected)
- for(var/obj/item/W in (H.contents-implants))
- if (W==H.w_uniform) // will be teared
- continue
- H.drop_from_inventory(W)
- M.transforming = 1
- M.canmove = 0
- M.icon = null
- M.invisibility = 101
- var/atom/movable/overlay/animation = new( M.loc )
- animation.icon_state = "blank"
- animation.icon = 'icons/mob/mob.dmi'
- animation.master = src
- flick("h2monkey", animation)
- sleep(48)
- qdel(animation)
-
-
- var/mob/living/carbon/monkey/O = null
- if(H.species.primitive)
- O = new H.species.primitive(src)
- else
- H.gib() //Trying to change the species of a creature with no primitive var set is messy.
- return
-
- if(M)
- if (M.dna)
- O.dna = M.dna
- M.dna = null
-
- if (M.suiciding)
- O.suiciding = M.suiciding
- M.suiciding = null
-
-
- for(var/datum/disease/D in M.viruses)
- O.viruses += D
- D.affected_mob = O
- M.viruses -= D
-
-
- for(var/obj/T in (M.contents-implants))
- qdel(T)
-
- O.loc = M.loc
-
- if(M.mind)
- M.mind.transfer_to(O) //transfer our mind to the cute little monkey
-
- if (connected) //inside dna thing
- var/obj/machinery/dna_scannernew/C = connected
- O.loc = C
- C.occupant = O
- connected = null
- O.real_name = text("monkey ([])",copytext(md5(M.real_name), 2, 6))
- O.take_overall_damage(M.getBruteLoss() + 40, M.getFireLoss())
- O.adjustToxLoss(M.getToxLoss() + 20)
- O.adjustOxyLoss(M.getOxyLoss())
- O.stat = M.stat
- O.a_intent = "hurt"
- for (var/obj/item/weapon/implant/I in implants)
- I.loc = O
- I.implanted = O
-// O.update_icon = 1 //queue a full icon update at next life() call
- qdel(M)
- return
-
- if (!isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && !istype(M, /mob/living/carbon/human))
- // monkey > human,
- var/mob/living/carbon/monkey/Mo = M
- Mo.transforming = 1
- var/list/implants = list() //Still preserving implants
- for(var/obj/item/weapon/implant/W in Mo)
- implants += W
- W.loc = null
- if(!connected)
- for(var/obj/item/W in (Mo.contents-implants))
- Mo.drop_from_inventory(W)
- M.transforming = 1
- M.canmove = 0
- M.icon = null
- M.invisibility = 101
- var/atom/movable/overlay/animation = new( M.loc )
- animation.icon_state = "blank"
- animation.icon = 'icons/mob/mob.dmi'
- animation.master = src
- flick("monkey2h", animation)
- sleep(48)
- qdel(animation)
-
- var/mob/living/carbon/human/O = new( src )
- if(Mo.greaterform)
- O.set_species(Mo.greaterform)
-
- if (isblockon(getblock(M.dna.uni_identity, 11,3),11))
- O.gender = FEMALE
- else
- O.gender = MALE
-
- if (M)
- if (M.dna)
- O.dna = M.dna
- M.dna = null
-
- if (M.suiciding)
- O.suiciding = M.suiciding
- M.suiciding = null
-
- for(var/datum/disease/D in M.viruses)
- O.viruses += D
- D.affected_mob = O
- M.viruses -= D
-
- //for(var/obj/T in M)
- // qdel(T)
-
- O.loc = M.loc
-
- if(M.mind)
- M.mind.transfer_to(O) //transfer our mind to the human
-
- if (connected) //inside dna thing
- var/obj/machinery/dna_scannernew/C = connected
- O.loc = C
- C.occupant = O
- connected = null
-
- var/i
- while (!i)
- var/randomname
- if (O.gender == MALE)
- randomname = capitalize(pick(first_names_male) + " " + capitalize(pick(last_names)))
- else
- randomname = capitalize(pick(first_names_female) + " " + capitalize(pick(last_names)))
- if (findname(randomname))
- continue
- else
- O.real_name = randomname
- i++
- updateappearance(O,O.dna.uni_identity)
- O.take_overall_damage(M.getBruteLoss(), M.getFireLoss())
- O.adjustToxLoss(M.getToxLoss())
- O.adjustOxyLoss(M.getOxyLoss())
- O.stat = M.stat
- for (var/obj/item/weapon/implant/I in implants)
- I.loc = O
- I.implanted = O
-// O.update_icon = 1 //queue a full icon update at next life() call
- qdel(M)
- return
-//////////////////////////////////////////////////////////// Monkey Block
- if(M)
- M.update_icon = 1 //queue a full icon update at next life() call
- return null
-/////////////////////////// DNA MISC-PROCS
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index 120ee88046..9bb8039a0c 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -64,9 +64,6 @@
component_parts += new /obj/item/stack/cable_coil(src)
RefreshParts()
-/obj/machinery/dna_scannernew/allow_drop()
- return 0
-
/obj/machinery/dna_scannernew/relaymove(mob/user as mob)
if (user.stat)
return
diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm
index eb15d45f51..34a81b4d61 100644
--- a/code/game/gamemodes/changeling/changeling_powers.dm
+++ b/code/game/gamemodes/changeling/changeling_powers.dm
@@ -193,7 +193,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E
src << "This creature's DNA is ruined beyond useability!"
return
- if(!G.state == GRAB_KILL)
+ if(G.state != GRAB_KILL)
src << "We must have a tighter grip to absorb this creature."
return
diff --git a/code/game/gamemodes/changeling/modularchangling.dm b/code/game/gamemodes/changeling/modularchangling.dm
index 5048977789..45a7dc3896 100644
--- a/code/game/gamemodes/changeling/modularchangling.dm
+++ b/code/game/gamemodes/changeling/modularchangling.dm
@@ -121,7 +121,7 @@ var/list/datum/power/changeling/powerinstances = list()
/datum/power/changeling/DeathSting
name = "Death Sting"
- desc = "We silently sting a human, filling him with potent chemicals. His rapid death is all but assured."
+ desc = "We silently sting a human, filling them with potent chemicals. Their rapid death is all but assured."
genomecost = 10
verbpath = /mob/proc/changeling_DEATHsting
diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm
index a1c0acf008..f6c7d46063 100644
--- a/code/game/gamemodes/cult/cult.dm
+++ b/code/game/gamemodes/cult/cult.dm
@@ -6,6 +6,5 @@
required_players = 5
required_players_secret = 15
required_enemies = 3
- uplink_welcome = "Nar-Sie Uplink Console:"
end_on_antag_death = 1
antag_tag = MODE_CULTIST
diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm
index 4ae8268402..1dfa1c37eb 100644
--- a/code/game/gamemodes/cult/cult_items.dm
+++ b/code/game/gamemodes/cult/cult_items.dm
@@ -48,7 +48,6 @@
/obj/item/clothing/head/culthood/magus
name = "magus helm"
icon_state = "magus"
- item_state = "magus"
desc = "A helm worn by the followers of Nar-Sie."
flags_inv = HIDEFACE
flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR
@@ -56,7 +55,6 @@
/obj/item/clothing/head/culthood/alt
icon_state = "cult_hoodalt"
- item_state = "cult_hoodalt"
/obj/item/clothing/suit/cultrobes
name = "cult robes"
@@ -88,7 +86,6 @@
name = "cult helmet"
desc = "A space worthy helmet used by the followers of Nar-Sie"
icon_state = "cult_helmet"
- item_state = "cult_helmet"
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30)
siemens_coefficient = 0
diff --git a/code/game/gamemodes/cult/cultify/obj.dm b/code/game/gamemodes/cult/cultify/obj.dm
index 4306182eaf..517c6079fd 100644
--- a/code/game/gamemodes/cult/cultify/obj.dm
+++ b/code/game/gamemodes/cult/cultify/obj.dm
@@ -63,19 +63,10 @@
..()
/obj/machinery/door/cultify()
- icon_state = "null"
- density = 0
- c_animation = new /atom/movable/overlay(src.loc)
- c_animation.name = "cultification"
- c_animation.density = 0
- c_animation.anchored = 1
- c_animation.icon = 'icons/effects/effects.dmi'
- c_animation.layer = 5
- c_animation.master = src.loc
- c_animation.icon_state = "breakdoor"
- flick("cultification",c_animation)
- spawn(10)
- qdel(c_animation)
+ if(invisibility != INVISIBILITY_MAXIMUM)
+ invisibility = INVISIBILITY_MAXIMUM
+ density = 0
+ anim(target = src, a_icon = 'icons/effects/effects.dmi', a_icon_state = "breakdoor", sleeptime = 10)
qdel(src)
/obj/machinery/door/firedoor/cultify()
@@ -145,8 +136,8 @@
// Make it a wood-reinforced wooden table.
// There are cult materials available, but it'd make the table non-deconstructable with how holotables work.
// Could possibly use a new material var for holographic-ness?
- material = name_to_material["wood"]
- reinforced = name_to_material["wood"]
+ material = get_material_by_name("wood")
+ reinforced = get_material_by_name("wood")
update_desc()
update_connections(1)
update_icon()
diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm
index dc09e0edb9..cba7a96ef4 100644
--- a/code/game/gamemodes/cult/ritual.dm
+++ b/code/game/gamemodes/cult/ritual.dm
@@ -339,7 +339,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
attack(mob/living/M as mob, mob/living/user as mob)
- M.attack_log += text("\[[time_stamp()]\] Has had the [name] used on him by [user.name] ([user.ckey])")
+ M.attack_log += text("\[[time_stamp()]\] Has had the [name] used on them by [user.name] ([user.ckey])")
user.attack_log += text("\[[time_stamp()]\] Used [name] on [M.name] ([M.ckey])")
msg_admin_attack("[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey]) (JMP)")
diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index ff5b7ff880..3b2345c1be 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -5,6 +5,14 @@ var/list/sacrificed = list()
/obj/effect/rune
+/*
+ * Use as a general guideline for this and related files:
+ * * ... - when something non-trivial or an error happens, so something similar to "Sparks come out of the machine!"
+ * * ... - when something that is fit for 'warning' happens but there is some damage or pain as well.
+ * * ... - when there is a private message to the cultists. This guideline is very arbitrary but there has to be some consistency!
+ */
+
+
/////////////////////////////////////////FIRST RUNE
proc
teleport(var/key)
@@ -21,7 +29,7 @@ var/list/sacrificed = list()
allrunesloc.len = index
allrunesloc[index] = R.loc
if(index >= 5)
- user << "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric"
+ user << "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric."
if (istype(user, /mob/living))
user.take_overall_damage(5, 0)
qdel(src)
@@ -30,9 +38,9 @@ var/list/sacrificed = list()
user.say("Sas[pick("'","`")]so c'arta forbici!")//Only you can stop auto-muting
else
user.whisper("Sas[pick("'","`")]so c'arta forbici!")
- user.visible_message("\The [user] disappears in a flash of red light!", \
- "You feel as your body gets dragged through the dimension of Nar-Sie!", \
- "You hear a sickening crunch and sloshing of viscera.")
+ user.visible_message("[user] disappears in a flash of red light!", \
+ "You feel as your body gets dragged through the dimension of Nar-Sie!", \
+ "You hear a sickening crunch and sloshing of viscera.")
user.loc = allrunesloc[rand(1,index)]
return
if(istype(src,/obj/effect/rune))
@@ -58,7 +66,7 @@ var/list/sacrificed = list()
IP = R
runecount++
if(runecount >= 2)
- user << "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric"
+ user << "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric."
if (istype(user, /mob/living))
user.take_overall_damage(5, 0)
qdel(src)
@@ -134,11 +142,11 @@ var/list/sacrificed = list()
admin_attack_log(attacker, target, "Used a convert rune", "Was subjected to a convert rune", "used a convert rune on")
switch(target.getFireLoss())
if(0 to 25)
- target << "Your blood boils as you force yourself to resist the corruption invading every corner of your mind."
+ target << "Your blood boils as you force yourself to resist the corruption invading every corner of your mind."
if(25 to 45)
- target << "Your blood boils and your body burns as the corruption further forces itself into your body and mind."
+ target << "Your blood boils and your body burns as the corruption further forces itself into your body and mind."
if(45 to 75)
- target << "You begin to hallucinate images of a dark and incomprehensible being and your entire body feels like its engulfed in flame as your mental defenses crumble."
+ target << "You begin to hallucinate images of a dark and incomprehensible being and your entire body feels like its engulfed in flame as your mental defenses crumble."
target.apply_effect(rand(1,10), STUTTER)
if(75 to 100)
target << "Your mind turns to ash as the burning flames engulf your very soul and images of an unspeakable horror begin to bombard the last remnants of mental resistance."
@@ -157,7 +165,7 @@ var/list/sacrificed = list()
if (target.species && (target.species.flags & NO_PAIN))
target.visible_message("The markings below [target] glow a bloody red.")
else
- target.visible_message("\The [target] writhes in pain as the markings below \him glow a bloody red.", "AAAAAAHHHH!", "You hear an anguished scream.")
+ target.visible_message("[target] writhes in pain as the markings below \him glow a bloody red.", "AAAAAAHHHH!", "You hear an anguished scream.")
if(!waiting_for_input[target]) //so we don't spam them with dialogs if they hesitate
waiting_for_input[target] = 1
@@ -229,15 +237,15 @@ var/list/sacrificed = list()
if(!drain)
return fizzle()
usr.say ("Yu[pick("'","`")]gular faras desdae. Havas mithum javara. Umathar uf'kal thenar!")
- usr.visible_message("Blood flows from the rune into [usr]!", \
- "The blood starts flowing from the rune and into your frail mortal body. You feel... empowered.", \
+ usr.visible_message("Blood flows from the rune into [usr]!", \
+ "The blood starts flowing from the rune and into your frail mortal body. You feel... empowered.", \
"You hear a liquid flowing.")
var/mob/living/user = usr
if(user.bhunger)
user.bhunger = max(user.bhunger-2*drain,0)
if(drain>=50)
- user.visible_message("\The [user]'s eyes give off eerie red glow!", \
- "...but it wasn't nearly enough. You crave, crave for more. The hunger consumes you from within.", \
+ user.visible_message("[user]'s eyes give off eerie red glow!", \
+ "...but it wasn't nearly enough. You crave, crave for more. The hunger consumes you from within.", \
"You hear a heartbeat.")
user.bhunger += drain
src = user
@@ -264,7 +272,7 @@ var/list/sacrificed = list()
if(usr.loc==src.loc)
if(usr.seer==1)
usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium viortia.")
- usr << "The world beyond fades from your vision."
+ usr << "The world beyond fades from your vision."
usr.see_invisible = SEE_INVISIBLE_LIVING
usr.seer = 0
else if(usr.see_invisible!=SEE_INVISIBLE_LIVING)
@@ -336,12 +344,12 @@ var/list/sacrificed = list()
corpse_to_raise.key = ghost.key //the corpse will keep its old mind! but a new player takes ownership of it (they are essentially possessed)
//This means, should that player leave the body, the original may re-enter
usr.say("Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!")
- corpse_to_raise.visible_message("\The [corpse_to_raise]'s eyes glow with a faint red as he stands up, slowly starting to breathe again.", \
+ corpse_to_raise.visible_message("[corpse_to_raise]'s eyes glow with a faint red as he stands up, slowly starting to breathe again.", \
"Life... I'm alive again...", \
"You hear a faint, slightly familiar whisper.")
- body_to_sacrifice.visible_message("\The [body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from his remains!", \
- "You feel as your blood boils, tearing you apart.", \
- "You hear a thousand voices, all crying in pain.")
+ body_to_sacrifice.visible_message("[body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from \his remains!", \
+ "You feel as your blood boils, tearing you apart.", \
+ "You hear a thousand voices, all crying in pain.")
body_to_sacrifice.gib()
// if(ticker.mode.name == "cult")
@@ -349,8 +357,8 @@ var/list/sacrificed = list()
// else
// ticker.mode.cult |= corpse_to_raise.mind
- corpse_to_raise << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root."
- corpse_to_raise << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back."
+ corpse_to_raise << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root."
+ corpse_to_raise << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back."
return
@@ -391,7 +399,7 @@ var/list/sacrificed = list()
if(usr.loc==src.loc)
var/mob/living/carbon/human/L = usr
usr.say("Fwe[pick("'","`")]sh mah erl nyag r'ya!")
- usr.visible_message("\The [usr]'s eyes glow blue as \he freezes in place, absolutely motionless.", \
+ usr.visible_message("[usr]'s eyes glow blue as \he freezes in place, absolutely motionless.", \
"The shadow that is your spirit separates itself from your body. You are now in the realm beyond. While this is a great sight, being here strains your mind and body. Hurry...", \
"You hear only complete silence for a moment.")
announce_ghost_joinleave(usr.ghostize(1), 1, "You feel that they had to use some [pick("dark", "black", "blood", "forgotten", "forbidden")] magic to [pick("invade","disturb","disrupt","infest","taint","spoil","blight")] this place!")
@@ -461,8 +469,8 @@ var/list/sacrificed = list()
user.take_organ_damage(1, 0)
sleep(30)
if(D)
- D.visible_message("\The [D] slowly dissipates into dust and bones.", \
- "You feel pain, as bonds formed between your soul and this homunculus break.", \
+ D.visible_message("[D] slowly dissipates into dust and bones.", \
+ "You feel pain, as bonds formed between your soul and this homunculus break.", \
"You hear faint rustle.")
D.dust()
return
@@ -560,8 +568,8 @@ var/list/sacrificed = list()
user.say("Uhrast ka'hfa heldsagen ver[pick("'","`")]lot!")
user.take_overall_damage(200, 0)
runedec+=10
- user.visible_message("\The [user] keels over dead, his blood glowing blue as it escapes his body and dissipates into thin air.", \
- "In the last moment of your humble life, you feel an immense pain as fabric of reality mends... with your blood.", \
+ user.visible_message("\The [user] keels over dead, \his blood glowing blue as it escapes \his body and dissipates into thin air.", \
+ "In the last moment of your humble life, you feel an immense pain as fabric of reality mends... with your blood.", \
"You hear faint rustle.")
for(,user.stat==2)
sleep(600)
@@ -592,9 +600,10 @@ var/list/sacrificed = list()
usr.whisper("[input]")
input = sanitize(input)
+ log_and_message_admins("used a communicate rune to say '[input]'")
for(var/datum/mind/H in cult.current_antagonists)
if (H.current)
- H.current << "[input]"
+ H.current << "[input]"
qdel(src)
return 1
@@ -638,17 +647,17 @@ var/list/sacrificed = list()
H.dust()//To prevent the MMI from remaining
else
H.gib()
- usr << "The Geometer of Blood accepts this sacrifice, your objective is now complete."
+ usr << "The Geometer of Blood accepts this sacrifice, your objective is now complete."
else
usr << "Your target's earthly bonds are too strong. You need more cultists to succeed in this ritual."
else
if(cultsinrange.len >= 3)
if(H.stat !=2)
if(prob(80) || worth)
- usr << "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice."
+ usr << "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice."
cult.grant_runeword(usr)
else
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
usr << "However, this soul was not enough to gain His favor."
if(isrobot(H))
H.dust()//To prevent the MMI from remaining
@@ -656,10 +665,10 @@ var/list/sacrificed = list()
H.gib()
else
if(prob(40) || worth)
- usr << "The Geometer of blood accepts this [worth ? "exotic " : ""]sacrifice."
+ usr << "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice."
cult.grant_runeword(usr)
else
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
usr << "However, a mere dead body is not enough to satisfy Him."
if(isrobot(H))
H.dust()//To prevent the MMI from remaining
@@ -671,10 +680,10 @@ var/list/sacrificed = list()
else
if(prob(40))
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
cult.grant_runeword(usr)
else
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
usr << "However, a mere dead body is not enough to satisfy Him."
if(isrobot(H))
H.dust()//To prevent the MMI from remaining
@@ -684,10 +693,10 @@ var/list/sacrificed = list()
if(cultsinrange.len >= 3)
if(H.stat !=2)
if(prob(80))
- usr << "The Geometer of Blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
cult.grant_runeword(usr)
else
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
usr << "However, this soul was not enough to gain His favor."
if(isrobot(H))
H.dust()//To prevent the MMI from remaining
@@ -695,10 +704,10 @@ var/list/sacrificed = list()
H.gib()
else
if(prob(40))
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
cult.grant_runeword(usr)
else
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
usr << "However, a mere dead body is not enough to satisfy Him."
if(isrobot(H))
H.dust()//To prevent the MMI from remaining
@@ -709,10 +718,10 @@ var/list/sacrificed = list()
usr << "The victim is still alive, you will need more cultists chanting for the sacrifice to succeed."
else
if(prob(40))
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
cult.grant_runeword(usr)
else
- usr << "The Geometer of blood accepts this sacrifice."
+ usr << "The Geometer of Blood accepts this sacrifice."
usr << "However, a mere dead body is not enough to satisfy Him."
if(isrobot(H))
H.dust()//To prevent the MMI from remaining
@@ -771,9 +780,9 @@ var/list/sacrificed = list()
var/mob/living/user = usr
user.take_organ_damage(2, 0)
if(src.density)
- usr << "Your blood flows into the rune, and you feel that the very space over the rune thickens."
+ usr << "Your blood flows into the rune, and you feel that the very space over the rune thickens."
else
- usr << "Your blood flows into the rune, and you feel as the rune releases its grasp on space."
+ usr << "Your blood flows into the rune, and you feel as the rune releases its grasp on space."
return
/////////////////////////////////////////EIGHTTEENTH RUNE
@@ -842,7 +851,7 @@ var/list/sacrificed = list()
if (cultist == user) //just to be sure.
return
if(cultist.buckled || cultist.handcuffed || (!isturf(cultist.loc) && !istype(cultist.loc, /obj/structure/closet)))
- user << "You cannot summon \the [cultist], for his shackles of blood are strong."
+ user << "You cannot summon \the [cultist], for \his shackles of blood are strong."
return fizzle()
cultist.loc = src.loc
cultist.lying = 1
@@ -922,7 +931,7 @@ var/list/sacrificed = list()
C.disabilities |= NEARSIGHTED
if(prob(10))
C.sdisabilities |= BLIND
- C.show_message("Suddenly you see red flash that blinds you.", 3)
+ C.show_message("Suddenly you see a red flash that blinds you.", 3)
affected += C
if(affected.len)
usr.say("Sti[pick("'","`")] kaliesin!")
@@ -972,7 +981,7 @@ var/list/sacrificed = list()
if(N)
continue
M.take_overall_damage(51,51)
- M << "Your blood boils!"
+ M << "Your blood boils!"
victims += M
if(prob(5))
spawn(5)
@@ -1004,16 +1013,16 @@ var/list/sacrificed = list()
for(var/mob/living/M in orange(2,R))
M.take_overall_damage(0,15)
if (R.invisibility>M.see_invisible)
- M << "Aargh it burns!"
+ M << "Aargh it burns!"
else
- M << "Rune suddenly ignites, burning you!"
+ M << "Rune suddenly ignites, burning you!"
var/turf/T = get_turf(R)
T.hotspot_expose(700,125)
for(var/obj/effect/decal/cleanable/blood/B in world)
if(B.blood_DNA == src.blood_DNA)
for(var/mob/living/M in orange(1,B))
M.take_overall_damage(0,5)
- M << "Blood suddenly ignites, burning you!"
+ M << "Blood suddenly ignites, burning you!"
var/turf/T = get_turf(B)
T.hotspot_expose(700,125)
qdel(B)
@@ -1032,13 +1041,13 @@ var/list/sacrificed = list()
C.stuttering = 1
C.Weaken(1)
C.Stun(1)
- C.show_message("The rune explodes in a bright flash.", 3)
+ C.show_message("The rune explodes in a bright flash.", 3)
admin_attack_log(usr, C, "Used a stun rune.", "Was victim of a stun rune.", "used a stun rune on")
else if(issilicon(L))
var/mob/living/silicon/S = L
S.Weaken(5)
- S.show_message("BZZZT... The rune has exploded in a bright flash.", 3)
+ S.show_message("BZZZT... The rune has exploded in a bright flash.", 3)
admin_attack_log(usr, S, "Used a stun rune.", "Was victim of a stun rune.", "used a stun rune on")
qdel(src)
else ///When invoked as talisman, stun and mute the target mob.
@@ -1046,10 +1055,10 @@ var/list/sacrificed = list()
var/obj/item/weapon/nullrod/N = locate() in T
if(N)
for(var/mob/O in viewers(T, null))
- O.show_message("\The [usr] invokes a talisman at [T], but they are unaffected!", 1)
+ O.show_message(text("[] invokes a talisman at [], but they are unaffected!", usr, T), 1)
else
for(var/mob/O in viewers(T, null))
- O.show_message("\The [usr] invokes a talisman at [T]", 1)
+ O.show_message(text("[] invokes a talisman at []", usr, T), 1)
if(issilicon(T))
T.Weaken(15)
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
index 8cd8765cd8..3374f8f9be 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
@@ -79,10 +79,9 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked
C.req_access = list()
C.req_one_access = list()
- sleep(5 MINUTES)
- ticker.station_explosion_cinematic(0,null) // TODO: Custom cinematic
-
- universe_has_ended = 1
+ spawn(5 MINUTES)
+ ticker.station_explosion_cinematic(0,null) // TODO: Custom cinematic
+ universe_has_ended = 1
return
/datum/universal_state/supermatter_cascade/proc/AreaSet()
diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm
index 4900efb291..f644391bf7 100644
--- a/code/game/gamemodes/events.dm
+++ b/code/game/gamemodes/events.dm
@@ -425,7 +425,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
if(botEmagChance)
for(var/obj/machinery/bot/bot in machines)
if(prob(botEmagChance))
- bot.Emag()
+ bot.emag_act(1)
/*
diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm
index d1b82af940..fdc955718b 100644
--- a/code/game/gamemodes/events/clang.dm
+++ b/code/game/gamemodes/events/clang.dm
@@ -34,7 +34,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
else if (istype(clong, /mob))
if(clong.density || prob(10))
- clong.ex_act(1)
+ clong.ex_act(2)
else
qdel(src)
diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm
index a6acbd0e31..0f7d6149d3 100644
--- a/code/game/gamemodes/events/power_failure.dm
+++ b/code/game/gamemodes/events/power_failure.dm
@@ -20,7 +20,7 @@
for(var/obj/machinery/power/apc/C in world)
- if(C.cell && C.z in config.station_levels)
+ if(!C.is_critical && C.cell && (C.z in config.station_levels))
C.cell.charge = 0
/proc/power_restore(var/announce = 1)
@@ -29,7 +29,7 @@
if(announce)
command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
for(var/obj/machinery/power/apc/C in world)
- if(C.cell && C.z in config.station_levels)
+ if(C.cell && (C.z in config.station_levels))
C.cell.charge = C.cell.maxcharge
for(var/obj/machinery/power/smes/S in world)
var/area/current_area = get_area(S)
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index edbaa4544c..7269f9dcfe 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -42,17 +42,10 @@ var/global/list/additional_antag_types = list()
var/antag_tag // First (main) antag template to spawn.
var/list/antag_templates // Extra antagonist types to include.
-
+ var/list/latejoin_templates = list()
var/round_autoantag = 0 // Will this round attempt to periodically spawn more antagonists?
- var/antag_prob = 0 // Likelihood of a new antagonist spawning.
- var/antag_count = 0 // Current number of antagonists.
var/antag_scaling_coeff = 5 // Coefficient for scaling max antagonists to player count.
- var/list/living_antag_templates = list() // Currently selected antag types that do not require a ghosted player.
- var/list/ghost_antag_templates = list() // Inverse of above.
- var/list/antag_candidates = list() // Living antag candidates.
- var/list/ghost_candidates = list() // Observing antag candidates.
-
var/station_was_nuked = 0 // See nuclearbomb.dm and malfunction.dm.
var/explosion_in_progress = 0 // Sit back and relax
var/waittime_l = 600 // Lower bound on time before intercept arrives (in tenths of seconds)
@@ -61,85 +54,6 @@ var/global/list/additional_antag_types = list()
var/event_delay_mod_moderate // Modifies the timing of random events.
var/event_delay_mod_major // As above.
- var/uplink_welcome = "Illegal Uplink Console:"
- var/uplink_uses = 12
-
- var/list/datum/uplink_item/uplink_items = list(
- "Ammunition" = list(
- new/datum/uplink_item(/obj/item/ammo_magazine/a357, 2, ".357", "RA"),
- new/datum/uplink_item(/obj/item/ammo_magazine/mc9mm, 2, "9mm", "R9"),
- new/datum/uplink_item(/obj/item/ammo_magazine/chemdart, 2, "Darts", "AD"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/sniperammo, 2, "14.5mm", "SA")
- ),
- "Highly Visible and Dangerous Weapons" = list(
- new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM"),
- new/datum/uplink_item(/obj/item/weapon/melee/energy/sword, 4, "Energy Sword", "ES"),
- new/datum/uplink_item(/obj/item/weapon/gun/projectile/dartgun, 5, "Dart Gun", "DG"),
- new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/g9mm, 5, "Silenced 9mm", "S9"),
- new/datum/uplink_item(/obj/item/mecha_parts/mecha_equipment/weapon/energy/riggedlaser, 6, "Exosuit Rigged Laser", "RL"),
- new/datum/uplink_item(/obj/item/weapon/gun/projectile/revolver, 6, "Revolver", "RE"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU"),
- new/datum/uplink_item(/obj/item/weapon/gun/projectile/heavysniper, 12, "Anti-materiel Rifle", "AMR")
- ),
- "Stealthy and Inconspicuous Weapons" = list(
- new/datum/uplink_item(/obj/item/weapon/soap/syndie, 1, "Subversive Soap", "SP"),
- new/datum/uplink_item(/obj/item/weapon/cane/concealed, 2, "Concealed Cane Sword", "CC"),
- new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC"),
- new/datum/uplink_item(/obj/item/weapon/pen/reagent/paralysis, 3, "Paralysis Pen", "PP"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/cigarette, 4, "Cigarette Kit", "BH"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/toxin, 4, "Random Toxin - Beaker", "RT")
- ),
- "Stealth and Camouflage Items" = list(
- new/datum/uplink_item(/obj/item/weapon/card/id/syndicate, 2, "Agent ID card", "AC"),
- new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/spy, 2, "Bug Kit", "BK"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
- new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP"),
- new/datum/uplink_item(/obj/item/clothing/mask/gas/voice, 4, "Voice Changer", "VC"),
- new/datum/uplink_item(/obj/item/weapon/disk/file/cameras/syndicate, 6, "Camera Network Access - Floppy", "SF")
- ),
- "Devices and Tools" = list(
- new/datum/uplink_item(/obj/item/weapon/storage/toolbox/syndicate, 1, "Fully Loaded Toolbox", "ST"),
- new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
- new/datum/uplink_item(/obj/item/device/encryptionkey/syndicate, 2, "Encrypted Radio Channel Key", "ER"),
- new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
- new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/clerical, 3, "Morphic Clerical Kit", "CK"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/space, 3, "Space Suit", "SS"),
- new/datum/uplink_item(/obj/item/clothing/glasses/thermal/syndi, 3, "Thermal Imaging Glasses", "TM"),
- new/datum/uplink_item(/obj/item/clothing/suit/storage/vest/heavy/merc, 4, "Heavy Armor Vest", "HAV"),
- new/datum/uplink_item(/obj/item/weapon/aiModule/syndicate, 7, "Hacked AI Upload Module", "AI"),
- new/datum/uplink_item(/obj/item/device/powersink, 5, "Powersink (DANGER!)", "PS",),
- new/datum/uplink_item(/obj/item/device/radio/beacon/syndicate, 7, "Singularity Beacon (DANGER!)", "SB"),
- new/datum/uplink_item(/obj/item/weapon/circuitboard/teleporter, 20, "Teleporter Circuit Board", "TP")
- ),
- "Implants" = list(
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_freedom, 3, "Freedom Implant", "FI"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_compress, 4, "Compressed Matter Implant", "CI"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_explosive, 6, "Explosive Implant (DANGER!)", "EI"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI")
- ),
- "Medical" = list(
- new/datum/uplink_item(/obj/item/weapon/storage/box/sinpockets, 1, "Box of Sin-Pockets", "DP"),
- new/datum/uplink_item(/obj/item/weapon/storage/firstaid/surgery, 5, "Surgery kit", "SK"),
- new/datum/uplink_item(/obj/item/weapon/storage/firstaid/combat, 5, "Combat medical kit", "CM")
- ),
- "Hardsuit Modules" = list(
- new/datum/uplink_item(/obj/item/rig_module/vision/thermal, 2, "Thermal Scanner", "RTS"),
- new/datum/uplink_item(/obj/item/rig_module/fabricator/energy_net, 3, "Net Projector", "REN"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/ewar_voice, 4, "Electrowarfare Suite and Voice Synthesiser", "REV"),
- new/datum/uplink_item(/obj/item/rig_module/maneuvering_jets, 4, "Maneuvering Jets", "RMJ"),
- new/datum/uplink_item(/obj/item/rig_module/mounted/egun, 6, "Mounted Energy Gun", "REG"),
- new/datum/uplink_item(/obj/item/rig_module/power_sink, 6, "Power Sink", "RPS"),
- new/datum/uplink_item(/obj/item/rig_module/mounted, 8, "Mounted Laser Cannon", "RLC")
- ),
- "(Pointless) Badassery" = list(
- new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS"),
- new/datum/uplink_item(/obj/item/toy/nanotrasenballoon, 10, "For showing that you love NT SOO much (Useless Balloon)", "NT")
- )
- )
-
/datum/game_mode/Topic(href, href_list[])
if(..())
return
@@ -252,12 +166,14 @@ var/global/list/additional_antag_types = list()
if(!(antag_templates && antag_templates.len))
return 1
- // Attempt to mark folks down as ready to go. Don't finalize until post setup.
var/datum/antagonist/main_antags = antag_templates[1]
- var/list/candidates = main_antags.get_candidates()
- if(candidates.len >= required_enemies)
- for(var/datum/antagonist/antag in antag_templates)
- antag.attempt_spawn()
+ var/list/potential
+ if(main_antags.flags & ANTAG_OVERRIDE_JOB)
+ potential = main_antags.pending_antagonists
+ else
+ potential = main_antags.candidates
+
+ if(potential.len >= required_enemies)
return 1
return 0
@@ -271,8 +187,15 @@ var/global/list/additional_antag_types = list()
var/datum/event_container/EMajor = event_manager.event_containers[EVENT_LEVEL_MAJOR]
EMajor.delay_modifier = event_delay_mod_major
+/datum/game_mode/proc/pre_setup()
+ for(var/datum/antagonist/antag in antag_templates)
+ antag.build_candidate_list() //compile a list of all eligible candidates
+
+ //antag roles that replace jobs need to be assigned before the job controller hands out jobs.
+ if(antag.flags & ANTAG_OVERRIDE_JOB)
+ antag.attempt_spawn() //select antags to be spawned
+
///post_setup()
-///Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things
/datum/game_mode/proc/post_setup()
refresh_event_modifiers()
@@ -285,9 +208,13 @@ var/global/list/additional_antag_types = list()
spawn(rand(100,150))
announce_ert_disabled()
- if(antag_templates && antag_templates.len)
- for(var/datum/antagonist/antag in antag_templates)
- antag.finalize()
+ //Assign all antag types for this game mode. Any players spawned as antags earlier should have been removed from the pending list, so no need to worry about those.
+ for(var/datum/antagonist/antag in antag_templates)
+ if(!(antag.flags & ANTAG_OVERRIDE_JOB))
+ antag.attempt_spawn() //select antags to be spawned
+ antag.finalize_spawn() //actually spawn antags
+ if(antag.is_latejoin_template())
+ latejoin_templates |= antag
if(emergency_shuttle && auto_recall_shuttle)
emergency_shuttle.auto_recall = 1
@@ -298,6 +225,10 @@ var/global/list/additional_antag_types = list()
feedback_set_details("server_ip","[world.internet_address]:[world.port]")
return 1
+/datum/game_mode/proc/fail_setup()
+ for(var/datum/antagonist/antag in antag_templates)
+ antag.reset()
+
/datum/game_mode/proc/announce_ert_disabled()
if(!ert_disabled)
return
@@ -336,67 +267,6 @@ var/global/list/additional_antag_types = list()
)
command_announcement.Announce("The presence of [pick(reasons)] in the region is tying up all available local emergency resources; emergency response teams cannot be called at this time, and post-evacuation recovery efforts will be substantially delayed.","Emergency Transmission")
-///process()
-///Called by the gameticker
-/datum/game_mode/proc/process()
-
- if(emergency_shuttle.departed)
- return
-
- if(!round_autoantag || !antag_templates || !antag_templates.len)
- return
-
- var/player_count = 0
- antag_count = 0
- antag_candidates = list()
-
- for(var/mob/living/player in mob_list)
- if(player.client)
- player_count += 1
- if(player.mind)
- if(player.stat == 2) // observing
- ghost_candidates |= player
- else
- if(player.mind.special_role)
- antag_count += 1
- else
- antag_candidates |= player
-
- antag_prob = min(100,max(0,(player_count - 5 * 10) * 5)) // This is arbitrary, probably needs adjusting.
-
- var/datum/antagonist/spawn_antag
- var/datum/mind/candidate
-
- var/from_ghosts
- if(prob(antag_prob))
- if(ghost_candidates.len && ghost_antag_templates.len && prob(50))
- spawn_antag = pick(ghost_antag_templates)
- candidate = pick(ghost_candidates)
- from_ghosts = 1
- else if(antag_candidates.len && living_antag_templates.len)
- spawn_antag = pick(living_antag_templates)
- candidate = pick(antag_candidates)
- else
- return // Failed :(
- else
- return
-
- if(spawn_antag.can_become_antag(candidate))
- spawn_antag.attempt_late_spawn(candidate, from_ghosts)
-
-/datum/game_mode/proc/latespawn(mob/living/carbon/human/character)
-
- if(emergency_shuttle.departed || !character.mind)
- return
-
- var/datum/antagonist/spawn_antag
- if(prob(antag_prob) && round_autoantag && living_antag_templates.len)
- spawn_antag = pick(living_antag_templates)
- if(spawn_antag && spawn_antag.can_become_antag(character.mind))
- spawn_antag.attempt_late_spawn(character.mind)
-
- return 0
-
/datum/game_mode/proc/check_finished()
if(emergency_shuttle.returned() || station_was_nuked)
return 1
@@ -537,7 +407,7 @@ var/global/list/additional_antag_types = list()
suspects += man
for(var/mob/M in suspects)
- if(M.mind.assigned_role == "MODE")
+ if(player_is_antag(M.mind, only_offstation_roles = 1))
continue
switch(rand(1, 100))
if(1 to 50)
@@ -623,13 +493,10 @@ var/global/list/additional_antag_types = list()
if(antag_templates && antag_templates.len)
for(var/datum/antagonist/antag in antag_templates)
- if(antag.flags & ANTAG_OVERRIDE_JOB)
- ghost_antag_templates |= antag
- else if(antag.flags & ANTAG_RANDSPAWN)
- living_antag_templates |= antag
- else
- antag_templates -= antag
- world << "[antag.role_text_plural] are invalid for additional roundtype antags!"
+ if(antag.flags & (ANTAG_OVERRIDE_JOB|ANTAG_RANDSPAWN))
+ continue
+ antag_templates -= antag
+ world << "[antag.role_text_plural] are invalid for additional roundtype antags!"
newscaster_announcements = pick(newscaster_standard_feeds)
@@ -685,7 +552,7 @@ proc/display_roundstart_logout_report()
msg += "[L.name] ([ckey(D.mind.key)]), the [L.job] (Ghosted)\n"
continue //Ghosted while alive
- msg += "" // close the from right at the top
+ msg += "" // close the span from right at the top
for(var/mob/M in mob_list)
if(M.client && M.client.holder)
diff --git a/code/game/gamemodes/game_mode_latespawn.dm b/code/game/gamemodes/game_mode_latespawn.dm
new file mode 100644
index 0000000000..9af3524144
--- /dev/null
+++ b/code/game/gamemodes/game_mode_latespawn.dm
@@ -0,0 +1,43 @@
+/datum/game_mode/proc/get_usable_templates(var/list/supplied_templates)
+ var/list/usable_templates = list()
+ for(var/datum/antagonist/A in supplied_templates)
+ if(A.can_late_spawn())
+ usable_templates |= A
+ return usable_templates
+
+///process()
+///Called by the gameticker
+/datum/game_mode/proc/process()
+ try_latespawn()
+
+/datum/game_mode/proc/latespawn(var/mob/living/carbon/human/character)
+ if(!character.mind)
+ return
+ try_latespawn(character.mind)
+ return 0
+
+/datum/game_mode/proc/try_latespawn(var/datum/mind/player, var/latejoin_only)
+
+ if(emergency_shuttle.departed || !round_autoantag)
+ return
+
+ if(!prob(get_antag_prob()))
+ return
+
+ var/list/usable_templates
+ if(latejoin_only && latejoin_templates.len)
+ usable_templates = get_usable_templates(latejoin_templates)
+ else if (antag_templates.len)
+ usable_templates = get_usable_templates(antag_templates)
+ else
+ return
+ if(usable_templates.len)
+ var/datum/antagonist/spawn_antag = pick(usable_templates)
+ spawn_antag.attempt_late_spawn(player)
+
+/datum/game_mode/proc/get_antag_prob()
+ var/player_count = 0
+ for(var/mob/living/M in mob_list)
+ if(M.client)
+ player_count += 1
+ return min(100,max(0,(player_count - 5 * 10) * 5))
\ No newline at end of file
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index 45b2b9829f..614d181795 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -91,11 +91,14 @@ var/global/datum/controller/gameticker/ticker
else
src.mode = config.pick_mode(master_mode)
+ src.mode.pre_setup()
+
job_master.DivideOccupations() // Apparently important for new antagonist system to register specific job antags properly.
if(!mode_started && !src.mode.can_start())
world << "Unable to start [mode.name]. Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby."
current_state = GAME_STATE_PREGAME
+ mode.fail_setup()
mode = null
job_master.ResetOccupations()
return 0
@@ -110,6 +113,7 @@ var/global/datum/controller/gameticker/ticker
else
src.mode.announce()
+ setup_economy()
current_state = GAME_STATE_PLAYING
create_characters() //Create player characters and transfer them
collect_minds()
@@ -118,9 +122,6 @@ var/global/datum/controller/gameticker/ticker
callHook("roundstart")
- //here to initialize the random events nicely at round start
- setup_economy()
-
shuttle_controller.setup_shuttle_docks()
spawn(0)//Forking here so we dont have to wait for this to finish
@@ -288,7 +289,7 @@ var/global/datum/controller/gameticker/ticker
if(player && player.mind && player.mind.assigned_role)
if(player.mind.assigned_role == "Captain")
captainless=0
- if(player.mind.assigned_role != "MODE")
+ if(!player_is_antag(player.mind, only_offstation_roles = 1))
job_master.EquipRank(player, player.mind.assigned_role, 0)
UpdateFactionList(player)
equip_custom_items(player)
@@ -342,7 +343,7 @@ var/global/datum/controller/gameticker/ticker
if(!delay_end)
world.Reboot()
else
- world << "An admin has delayed the round end"
else
world << "An admin has delayed the round end"
diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm
index 7e1ba6d368..03680c8ff3 100644
--- a/code/game/gamemodes/heist/heist.dm
+++ b/code/game/gamemodes/heist/heist.dm
@@ -20,12 +20,3 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind'
if (skipjack && skipjack.returned_home)
return 1
return 0
-
-/datum/game_mode/heist/cleanup()
- //the skipjack and everything in it have left and aren't coming back, so get rid of them.
- var/area/skipjack = locate(/area/shuttle/skipjack/station)
- for (var/mob/living/M in skipjack.contents)
- //maybe send the player a message that they've gone home/been kidnapped? Someone responsible for vox lore should write that.
- qdel(M)
- for (var/obj/O in skipjack.contents)
- qdel(O) //no hiding in lockers or anything
\ No newline at end of file
diff --git a/code/game/gamemodes/intercept_report.dm b/code/game/gamemodes/intercept_report.dm
index 2ee0fe7d91..bfe0e1d90d 100644
--- a/code/game/gamemodes/intercept_report.dm
+++ b/code/game/gamemodes/intercept_report.dm
@@ -54,7 +54,7 @@
"Small Prick"
)
-
+// TODO: Update to new antagonist system.
/datum/intercept_text/proc/build(var/mode_type, datum/mind/correct_person)
switch(mode_type)
if("revolution")
@@ -88,29 +88,6 @@
else
return null
-// NOTE: Commentted out was the code which showed the chance of someone being an antag. If you want to re-add it, just uncomment the code.
-
-/*
-/datum/intercept_text/proc/pick_mob()
- var/list/dudes = list()
- for(var/mob/living/carbon/human/man in player_list)
- if (!man.mind) continue
- if (man.mind.assigned_role=="MODE") continue
- dudes += man
- if(dudes.len==0)
- return null
- return pick(dudes)
-
-
-/datum/intercept_text/proc/pick_fingerprints()
- var/mob/living/carbon/human/dude = src.pick_mob()
- //if (!dude) return pick_fingerprints() //who coded that is totally crasy or just a traitor. -- rastaf0
- if(dude)
- return num2text(md5(dude.dna.uni_identity))
- else
- return num2text(md5(num2text(rand(1,10000))))
-*/
-
/datum/intercept_text/proc/get_suspect()
var/list/dudes = list()
for(var/mob/living/carbon/human/man in player_list) if(man.client && man.client.prefs.nanotrasen_relation == "Opposed")
@@ -205,32 +182,6 @@
var/cname = pick(src.changeling_names)
var/orgname1 = pick(src.org_names_1)
var/orgname2 = pick(src.org_names_2)
- /*
- var/changeling_name
- var/changeling_job
- var/prob_right_dude = rand(prob_correct_person_lower, prob_correct_person_higher)
- var/prob_right_job = rand(prob_correct_job_lower, prob_correct_job_higher)
- if(prob(prob_right_job))
- if(correct_person)
- if(correct_person:assigned_role=="MODE")
- changeling_job = pick(joblist)
- else
- changeling_job = correct_person:assigned_role
- else
- changeling_job = pick(joblist)
- if(prob(prob_right_dude) && ticker.mode == "changeling")
- if(correct_person:assigned_role=="MODE")
- changeling_name = correct_person:current
- else
- changeling_name = src.pick_mob()
- else
- changeling_name = src.pick_mob()
- */
-
src.text += "
We have received a report that a dangerous alien lifeform known only as \"[cname]\" may have infiltrated your crew. "
- /*
- src.text += "Our intelligence suggests a [prob_right_job]% chance that a [changeling_job] on board your station has been replaced by the alien. "
- src.text += "Additionally, the report indicates a [prob_right_dude]% chance that [changeling_name] may have been in contact with the lifeform at a recent social gathering. "
- */
src.text += "These lifeforms are assosciated with the [orgname1] [orgname2] and may be attempting to acquire sensitive materials on their behalf. "
src.text += "Please take care not to alarm the crew, as [cname] may take advantage of a panic situation. Remember, they can be anybody, suspect everybody!"
diff --git a/code/game/gamemodes/malfunction/malfunction.dm b/code/game/gamemodes/malfunction/malfunction.dm
index 19378de167..b528016898 100644
--- a/code/game/gamemodes/malfunction/malfunction.dm
+++ b/code/game/gamemodes/malfunction/malfunction.dm
@@ -2,7 +2,6 @@
name = "AI malfunction"
round_description = "The AI is behaving abnormally and must be stopped."
extended_round_description = "The AI will attempt to hack the APCs around the station in order to gain as much control as possible."
- uplink_welcome = "Crazy AI Uplink Console:"
config_tag = "malfunction"
required_players = 2
required_players_secret = 7
diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm
index 593f4a3d22..51cb427c0c 100644
--- a/code/game/gamemodes/meteor/meteor.dm
+++ b/code/game/gamemodes/meteor/meteor.dm
@@ -7,7 +7,6 @@
config_tag = "meteor"
required_players = 0
votable = 0
- uplink_welcome = "EVIL METEOR Uplink Console:"
deny_respawn = 1
var/next_wave = METEOR_DELAY
diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm
index 9dc8623822..e8ea12b84b 100644
--- a/code/game/gamemodes/newobjective.dm
+++ b/code/game/gamemodes/newobjective.dm
@@ -1252,7 +1252,7 @@ datum
proc/find_target()
..()
if(target && target.current)
- explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role], has defied us for the last time. Make an example of him, and bring us his severed head."
+ explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role], has defied us for the last time. Make an example of [target.current.gender == MALE ? "him" : target.current.gender == FEMALE ? "her" : "them"], and bring us [target.current.gender == MALE ? "his" : target.current.gender == FEMALE ? "her" : "their"] severed head."
else
explanation_text = "Free Objective"
return target
@@ -1261,7 +1261,7 @@ datum
find_target_by_role(role, role_type=0)
..(role, role_type)
if(target && target.current)
- explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of him, and bring us his severed head."
+ explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of [target.current.gender == MALE ? "him" : target.current.gender == FEMALE ? "her" : "them"], and bring us [target.current.gender == MALE ? "his" : target.current.gender == FEMALE ? "her" : "their"] severed head."
else
explanation_text = "Free Objective"
return target
@@ -1488,4 +1488,4 @@ datum/objective/silence
#undef LENIENT
#undef NORMAL
#undef HARD
-#undef IMPOSSIBLE
\ No newline at end of file
+#undef IMPOSSIBLE
diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm
index 5d8ac9d071..37ec7d9a2a 100644
--- a/code/game/gamemodes/nuclear/nuclear.dm
+++ b/code/game/gamemodes/nuclear/nuclear.dm
@@ -14,8 +14,6 @@ var/list/nuke_disks = list()
end_on_antag_death = 1
antag_tag = MODE_MERCENARY
- uplink_welcome = "Corporate Backed Uplink Console:"
- uplink_uses = 40
var/nuke_off_station = 0 //Used for tracking if the syndies actually haul the nuke to the station
var/syndies_didnt_escape = 0 //Used for tracking if the syndies got the shuttle off of the z-level
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 0ad6e7fc5f..16d50cee4d 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -703,7 +703,7 @@ datum/objective/heist/kidnap
var/list/priority_targets = list()
for(var/datum/mind/possible_target in ticker.minds)
- if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2) && (possible_target.assigned_role != "MODE"))
+ if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2) && (!possible_target.special_role))
possible_targets += possible_target
for(var/role in roles)
if(possible_target.assigned_role == role)
diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm
index 493650359e..7d2cbf1ca7 100644
--- a/code/game/gamemodes/revolution/revolution.dm
+++ b/code/game/gamemodes/revolution/revolution.dm
@@ -7,8 +7,6 @@
required_players_secret = 15
required_enemies = 3
auto_recall_shuttle = 1
- uplink_welcome = "AntagCorp Uplink Console:"
- uplink_uses = 10
end_on_antag_death = 1
shuttle_delay = 3
antag_tag = MODE_REVOLUTIONARY
@@ -47,4 +45,4 @@
if(i < revs.head_revolutionaries.len)
. += "[revmind.current.real_name],"
else
- . += "and [revmind.current.real_name]"
\ No newline at end of file
+ . += "and [revmind.current.real_name]"
diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm
index b39ce3f147..2b0e776ce1 100644
--- a/code/game/gamemodes/traitor/traitor.dm
+++ b/code/game/gamemodes/traitor/traitor.dm
@@ -5,7 +5,6 @@
config_tag = "traitor"
required_players = 0
required_enemies = 1
- uplink_welcome = "AntagCorp Portable Teleportation Relay:"
end_on_antag_death = 1
antag_scaling_coeff = 10
- antag_tag = MODE_TRAITOR
\ No newline at end of file
+ antag_tag = MODE_TRAITOR
diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm
index 85cbf3a705..7209844d38 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -1,12 +1,10 @@
/datum/game_mode/wizard
name = "Wizard"
- round_description = "There is a SPACE WIZARD on the station. You can't let them achieve their objectives!"
+ round_description = "There is a SPACE WIZARD on the station. You can't let the magician achieve their objectives!"
extended_round_description = "A powerful entity capable of manipulating the elements around him, most commonly referred to as a 'wizard', has infiltrated the station. They have a wide variety of powers and spells available to them that makes your own simple moral self tremble with fear and excitement. Ultimately, their purpose is unknown. However, it is up to you and your crew to decide if their powers can be used for good or if their arrival foreshadows the destruction of the entire station."
config_tag = "wizard"
required_players = 1
required_players_secret = 10
required_enemies = 1
- uplink_welcome = "Wizardly Uplink Console:"
- uplink_uses = 10
end_on_antag_death = 1
antag_tag = MODE_WIZARD
diff --git a/code/game/jobs/access_datum.dm b/code/game/jobs/access_datum.dm
index d0855e4781..9cf27f6dbc 100644
--- a/code/game/jobs/access_datum.dm
+++ b/code/game/jobs/access_datum.dm
@@ -14,7 +14,7 @@
region = ACCESS_REGION_SECURITY
/var/const/access_brig = 2 // Brig timers and permabrig
-/datum/access/security
+/datum/access/holding
id = access_brig
desc = "Holding Cells"
region = ACCESS_REGION_SECURITY
@@ -305,17 +305,8 @@
desc = "Cargo Office"
region = ACCESS_REGION_SUPPLY
-/var/const/access_mint = 51
-/datum/access/mint
- id = access_mint
- desc = "Mint"
- region = ACCESS_REGION_SUPPLY
-
-/var/const/access_mint_vault = 52
-/datum/access/mint_vault
- id = access_mint_vault
- desc = "Mint Vault"
- access_type = ACCESS_TYPE_NONE
+// /var/const/free_access_id = 51
+// /var/const/free_access_id = 52
/var/const/access_heads_vault = 53
/datum/access/heads_vault
diff --git a/code/game/jobs/job/assistant.dm b/code/game/jobs/job/assistant.dm
index 98c7a4dd98..f390303452 100644
--- a/code/game/jobs/job/assistant.dm
+++ b/code/game/jobs/job/assistant.dm
@@ -10,7 +10,7 @@
selection_color = "#dddddd"
access = list() //See /datum/job/assistant/get_access()
minimal_access = list() //See /datum/job/assistant/get_access()
- alt_titles = list("Technical Assistant","Medical Intern","Research Assistant","Security Cadet","Visitor")
+ alt_titles = list("Technical Assistant","Medical Intern","Research Assistant","Visitor")
/datum/job/assistant/equip(var/mob/living/carbon/human/H)
if(!H) return 0
diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm
index 7d84753353..26f5c02020 100644
--- a/code/game/jobs/job/civilian.dm
+++ b/code/game/jobs/job/civilian.dm
@@ -97,8 +97,8 @@
spawn_positions = 1
supervisors = "the head of personnel"
selection_color = "#dddddd"
- access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
- minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
+ access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station)
+ minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station)
equip(var/mob/living/carbon/human/H)
@@ -124,7 +124,7 @@
spawn_positions = 2
supervisors = "the quartermaster and the head of personnel"
selection_color = "#dddddd"
- access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
+ access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station)
minimal_access = list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting)
@@ -149,8 +149,8 @@
spawn_positions = 3
supervisors = "the quartermaster and the head of personnel"
selection_color = "#dddddd"
- access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
- minimal_access = list(access_mining, access_mint, access_mining_station, access_mailsorting)
+ access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station)
+ minimal_access = list(access_mining, access_mining_station, access_mailsorting)
alt_titles = list("Drill Technician","Prospector")
equip(var/mob/living/carbon/human/H)
diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm
index 8b51b74a77..33cc45b69f 100644
--- a/code/game/jobs/job/job.dm
+++ b/code/game/jobs/job/job.dm
@@ -23,6 +23,12 @@
/datum/job/proc/equip(var/mob/living/carbon/human/H)
return 1
+/datum/job/proc/equip_backpack(var/mob/living/carbon/human/H)
+ switch(H.backbag)
+ if(2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
+ if(3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
+ if(4) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(H), slot_back)
+
/datum/job/proc/equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
H.species.equip_survival_gear(H,0)
diff --git a/code/game/jobs/job/silicon.dm b/code/game/jobs/job/silicon.dm
index 8aab746400..a76317af03 100644
--- a/code/game/jobs/job/silicon.dm
+++ b/code/game/jobs/job/silicon.dm
@@ -13,11 +13,15 @@
equip(var/mob/living/carbon/human/H)
if(!H) return 0
return 1
-
+
equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
return 1
+ equip_backpack(var/mob/living/carbon/human/H)
+ if(!H) return 0
+ return 1
+
/datum/job/ai/is_position_available()
return (empty_playable_ai_cores.len != 0)
@@ -44,6 +48,10 @@
equip_survival(var/mob/living/carbon/human/H)
if(!H) return 0
return 1
+
+ equip_backpack(var/mob/living/carbon/human/H)
+ if(!H) return 0
+ return 1
return 1
/datum/job/cyborg/equip_preview(mob/living/carbon/human/H)
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index 1a4fb368aa..143a603ec1 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -348,7 +348,6 @@ var/global/datum/controller/occupations/job_master
proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0)
-
if(!H) return null
var/datum/job/job = GetJob(rank)
@@ -393,6 +392,7 @@ var/global/datum/controller/occupations/job_master
spawn_in_storage += thing
//Equip job items.
job.equip(H)
+ job.equip_backpack(H)
job.equip_survival(H)
job.apply_fingerprints(H)
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 35b1a15397..d5ccdacc3a 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -177,11 +177,6 @@
return
return
-
- allow_drop()
- return 0
-
-
process()
if (stat & (NOPOWER|BROKEN))
return
@@ -342,7 +337,7 @@
if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20)
use_power(amount * CHEM_SYNTH_ENERGY)
src.occupant.reagents.add_reagent(chemical, amount)
- user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [available_chemicals[chemical]] in his/her bloodstream."
+ user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [available_chemicals[chemical]] in their bloodstream."
return
user << "There's no occupant in the sleeper or the subject has too many chemicals!"
return
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index a1697cc418..ef38ab99ba 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -14,9 +14,6 @@
idle_power_usage = 60
active_power_usage = 10000 //10 kW. It's a big all-body scanner.
-/*/obj/machinery/bodyscanner/allow_drop()
- return 0*/
-
/obj/machinery/bodyscanner/relaymove(mob/user as mob)
if (user.stat)
return
@@ -399,7 +396,7 @@
imp += "[I] implanted:"
else
unknown_body++
- if(unknown_body || e.hidden)
+ if(unknown_body)
imp += "Unknown body present:"
if(!AN && !open && !infected & !imp)
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index fbf9bf5e7b..64101d4433 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -69,6 +69,7 @@
var/datum/radio_frequency/radio_connection
var/list/TLV = list()
+ var/list/trace_gas = list("sleeping_agent", "volatile_fuel") //list of other gases that this air alarm is able to detect
var/danger_level = 0
var/pressure_dangerlevel = 0
@@ -240,23 +241,24 @@
/obj/machinery/alarm/proc/overall_danger_level(var/datum/gas_mixture/environment)
var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
var/environment_pressure = environment.return_pressure()
- //var/other_moles = 0.0
- ////for(var/datum/gas/G in environment.trace_gases)
- // other_moles+=G.moles
+
+ var/other_moles = 0
+ for(var/g in trace_gas)
+ other_moles += environment.gas[g] //this is only going to be used in a partial pressure calc, so we don't need to worry about group_multiplier here.
pressure_dangerlevel = get_danger_level(environment_pressure, TLV["pressure"])
oxygen_dangerlevel = get_danger_level(environment.gas["oxygen"]*partial_pressure, TLV["oxygen"])
co2_dangerlevel = get_danger_level(environment.gas["carbon_dioxide"]*partial_pressure, TLV["carbon dioxide"])
phoron_dangerlevel = get_danger_level(environment.gas["phoron"]*partial_pressure, TLV["phoron"])
temperature_dangerlevel = get_danger_level(environment.temperature, TLV["temperature"])
- //other_dangerlevel = get_danger_level(other_moles*partial_pressure, TLV["other"])
+ other_dangerlevel = get_danger_level(other_moles*partial_pressure, TLV["other"])
return max(
pressure_dangerlevel,
oxygen_dangerlevel,
co2_dangerlevel,
phoron_dangerlevel,
- //other_dangerlevel,
+ other_dangerlevel,
temperature_dangerlevel
)
@@ -302,22 +304,30 @@
/obj/machinery/alarm/update_icon()
if(wiresexposed)
icon_state = "alarmx"
+ set_light(0)
return
if((stat & (NOPOWER|BROKEN)) || shorted)
icon_state = "alarmp"
+ set_light(0)
return
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
+ var/new_color = null
switch(icon_level)
if (0)
icon_state = "alarm0"
+ new_color = "#03A728"
if (1)
icon_state = "alarm2" //yes, alarm2 is yellow alarm
+ new_color = "#EC8B2F"
if (2)
icon_state = "alarm1"
+ new_color = "#DA0205"
+
+ set_light(l_range = 2, l_power = 0.5, l_color = new_color)
/obj/machinery/alarm/receive_signal(datum/signal/signal)
if(stat & (NOPOWER|BROKEN))
@@ -504,34 +514,13 @@
var/list/environment_data = new
data["has_environment"] = total
if(total)
- var/partial_pressure = R_IDEAL_GAS_EQUATION*environment.temperature/environment.volume
-
- var/list/current_settings = TLV["pressure"]
var/pressure = environment.return_pressure()
- var/pressure_danger = get_danger_level(pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Pressure", "value" = pressure, "unit" = "kPa", "danger_level" = pressure_danger)
- data["total_danger"] = pressure_danger
-
- current_settings = TLV["oxygen"]
- var/oxygen_danger = get_danger_level(environment.gas["oxygen"]*partial_pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Oxygen", "value" = environment.gas["oxygen"] / total * 100, "unit" = "%", "danger_level" = oxygen_danger)
- data["total_danger"] = max(oxygen_danger, data["total_danger"])
-
- current_settings = TLV["carbon dioxide"]
- var/carbon_dioxide_danger = get_danger_level(environment.gas["carbon dioxide"]*partial_pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Carbon dioxide", "value" = environment.gas["carbon dioxide"] / total * 100, "unit" = "%", "danger_level" = carbon_dioxide_danger)
- data["total_danger"] = max(carbon_dioxide_danger, data["total_danger"])
-
- current_settings = TLV["phoron"]
- var/phoron_danger = get_danger_level(environment.gas["phoron"]*partial_pressure, current_settings)
- environment_data[++environment_data.len] = list("name" = "Toxins", "value" = environment.gas["phoron"] / total * 100, "unit" = "%", "danger_level" = phoron_danger)
- data["total_danger"] = max(phoron_danger, data["total_danger"])
-
- current_settings = TLV["temperature"]
- var/temperature_danger = get_danger_level(environment.temperature, current_settings)
- environment_data[++environment_data.len] = list("name" = "Temperature", "value" = environment.temperature, "unit" = "K ([round(environment.temperature - T0C, 0.1)]C)", "danger_level" = temperature_danger)
- data["total_danger"] = max(temperature_danger, data["total_danger"])
-
+ environment_data[++environment_data.len] = list("name" = "Pressure", "value" = pressure, "unit" = "kPa", "danger_level" = pressure_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Oxygen", "value" = environment.gas["oxygen"] / total * 100, "unit" = "%", "danger_level" = oxygen_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Carbon dioxide", "value" = environment.gas["carbon_dioxide"] / total * 100, "unit" = "%", "danger_level" = co2_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Toxins", "value" = environment.gas["phoron"] / total * 100, "unit" = "%", "danger_level" = phoron_dangerlevel)
+ environment_data[++environment_data.len] = list("name" = "Temperature", "value" = environment.temperature, "unit" = "K ([round(environment.temperature - T0C, 0.1)]C)", "danger_level" = temperature_dangerlevel)
+ data["total_danger"] = danger_level
data["environment"] = environment_data
data["atmos_alarm"] = alarm_area.atmosalm
data["fire_alarm"] = alarm_area.fire != null
@@ -888,8 +877,11 @@ FIRE ALARM
var/last_process = 0
var/wiresexposed = 0
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
+ var/seclevel
/obj/machinery/firealarm/update_icon()
+ overlays.Cut()
+
if(wiresexposed)
switch(buildstage)
if(2)
@@ -898,17 +890,28 @@ FIRE ALARM
icon_state="fire_b1"
if(0)
icon_state="fire_b0"
-
+ set_light(0)
return
if(stat & BROKEN)
icon_state = "firex"
+ set_light(0)
else if(stat & NOPOWER)
icon_state = "firep"
- else if(!src.detecting)
- icon_state = "fire1"
+ set_light(0)
else
- icon_state = "fire0"
+ if(!src.detecting)
+ icon_state = "fire1"
+ set_light(l_range = 4, l_power = 2, l_color = "#ff0000")
+ else
+ icon_state = "fire0"
+ switch(seclevel)
+ if("green") set_light(l_range = 2, l_power = 0.5, l_color = "#00ff00")
+ if("blue") set_light(l_range = 2, l_power = 0.5, l_color = "#1024A9")
+ if("red") set_light(l_range = 4, l_power = 2, l_color = "#ff0000")
+ if("delta") set_light(l_range = 4, l_power = 2, l_color = "#FF6633")
+
+ src.overlays += image('icons/obj/monitors.dmi', "overlay_[seclevel]")
/obj/machinery/firealarm/fire_act(datum/gas_mixture/air, temperature, volume)
if(src.detecting)
@@ -919,7 +922,7 @@ FIRE ALARM
/obj/machinery/firealarm/attack_ai(mob/user as mob)
return src.attack_hand(user)
-/obj/machinery/firealarm/bullet_act(BLAH)
+/obj/machinery/firealarm/bullet_act()
return src.alarm()
/obj/machinery/firealarm/emp_act(severity)
@@ -946,6 +949,7 @@ FIRE ALARM
user.visible_message("\The [user] has disconnected [src]'s detecting unit!", "You have disconnected [src]'s detecting unit.")
else if (istype(W, /obj/item/weapon/wirecutters))
user.visible_message("\The [user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].")
+ new/obj/item/stack/cable_coil(get_turf(src), 5)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
buildstage = 1
update_icon()
@@ -1120,14 +1124,14 @@ FIRE ALARM
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
+/obj/machinery/firealarm/proc/set_security_level(var/newlevel)
+ if(seclevel != newlevel)
+ seclevel = newlevel
+ update_icon()
+
/obj/machinery/firealarm/initialize()
if(z in config.contact_levels)
- if(security_level)
- src.overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]")
- else
- src.overlays += image('icons/obj/monitors.dmi', "overlay_green")
-
- update_icon()
+ set_security_level(security_level? get_security_level() : "green")
/*
FIRE ALARM CIRCUIT
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 21550121cd..e0a837b4ce 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -351,7 +351,7 @@ update_flag
"\[N2O\]" = "redws", \
"\[N2\]" = "red", \
"\[O2\]" = "blue", \
- "\[Toxin (Bio)\]" = "orange", \
+ "\[Phoron\]" = "orange", \
"\[CO2\]" = "black", \
"\[Air\]" = "grey", \
"\[CAUTION\]" = "yellow", \
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index 58c3fc0e24..b7bcc53e91 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -104,7 +104,6 @@
network.update = 1
/obj/machinery/portable_atmospherics/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- var/obj/icon = src
if ((istype(W, /obj/item/weapon/tank) && !( src.destroyed )))
if (src.holding)
return
@@ -136,21 +135,8 @@
return
else if ((istype(W, /obj/item/device/analyzer)) && Adjacent(user))
- visible_message("\The [user] has used \the [W] on \the [src] \icon[icon]")
- if(air_contents)
- var/pressure = air_contents.return_pressure()
- var/total_moles = air_contents.total_moles
-
- user << "Results of analysis of \icon[icon]"
- if (total_moles>0)
- user << "Pressure: [round(pressure,0.1)] kPa"
- for(var/g in air_contents.gas)
- user << "[gas_data.name[g]]: [round((air_contents.gas[g] / total_moles) * 100)]%"
- user << "Temperature: [round(air_contents.temperature-T0C)]°C"
- else
- user << "Tank is empty!"
- else
- user << "Tank is empty!"
+ var/obj/item/device/analyzer/A = W
+ A.analyze_gases(src, user)
return
return
@@ -163,6 +149,13 @@
var/last_power_draw = 0
var/obj/item/weapon/cell/cell
+/obj/machinery/portable_atmospherics/powered/powered()
+ if(use_power) //using area power
+ return ..()
+ if(cell && cell.charge)
+ return 1
+ return 0
+
/obj/machinery/portable_atmospherics/powered/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/cell))
if(cell)
@@ -175,20 +168,21 @@
C.add_fingerprint(user)
cell = C
C.loc = src
- user.visible_message("[user] opens the panel on [src] and inserts [C].", "You open the panel on [src] and insert [C].")
+ user.visible_message("[user] opens the panel on [src] and inserts [C].", "You open the panel on [src] and insert [C].")
+ power_change()
return
if(istype(I, /obj/item/weapon/screwdriver))
if(!cell)
- user << "There is no power cell installed."
+ user << "There is no power cell installed."
return
- user.visible_message("[user] opens the panel on [src] and removes [cell].", "You open the panel on [src] and remove [cell].")
+ user.visible_message("[user] opens the panel on [src] and removes [cell].", "You open the panel on [src] and remove [cell].")
cell.add_fingerprint(user)
cell.loc = src.loc
cell = null
+ power_change()
return
-
..()
/obj/machinery/portable_atmospherics/proc/log_open()
diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm
index 8d80e57e78..ad664049fc 100644
--- a/code/game/machinery/atmoalter/pump.dm
+++ b/code/game/machinery/atmoalter/pump.dm
@@ -102,6 +102,7 @@
//ran out of charge
if (!cell.charge)
+ power_change()
update_icon()
src.updateDialog()
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index f705a62ae2..457792c9e2 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -77,6 +77,7 @@
//ran out of charge
if (!cell.charge)
+ power_change()
update_icon()
//src.update_icon()
@@ -147,7 +148,6 @@
volume = 50000
volume_rate = 5000
- chan
use_power = 1
idle_power_usage = 500 //internal circuitry, friction losses and stuff
active_power_usage = 100000 //100 kW ~ 135 HP
diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index eca7dbcef9..0956486b69 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -290,7 +290,7 @@
/obj/machinery/autolathe/dismantle()
for(var/mat in stored_material)
- var/material/M = name_to_material[mat]
+ var/material/M = get_material_by_name(mat)
if(!istype(M))
continue
var/obj/item/stack/material/S = new M.stack_type(get_turf(src))
diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm
index 9f144c23b1..23d00318ea 100644
--- a/code/game/machinery/bioprinter.dm
+++ b/code/game/machinery/bioprinter.dm
@@ -66,19 +66,19 @@
user << "You inject the blood sample into the bioprinter."
return
// Meat for biomass.
- else if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
+ if(!prints_prosthetics && istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
stored_matter += 50
user.drop_item()
user << "\The [src] processes \the [W]. Levels of stored biomass now: [stored_matter]"
qdel(W)
return
// Steel for matter.
- else if(prints_prosthetics && istype(W, /obj/item/stack/material/steel))
- var/obj/item/stack/material/steel/M = W
- stored_matter += M.amount * 10
+ if(prints_prosthetics && istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/S = W
+ stored_matter += S.amount * 10
user.drop_item()
user << "\The [src] processes \the [W]. Levels of stored matter now: [stored_matter]"
qdel(W)
return
- else
- return..()
\ No newline at end of file
+
+ return..()
\ No newline at end of file
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index 803615adaf..88d8f8dd7e 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -32,15 +32,18 @@
if (src.health <= 0)
src.explode()
-/obj/machinery/bot/proc/Emag(mob/user as mob)
- if(locked)
+/obj/machinery/bot/emag_act(var/remaining_charges, var/user)
+ if(locked && !emagged)
locked = 0
emagged = 1
user << "You short out [src]'s maintenance hatch lock."
log_and_message_admins("emagged [src]'s maintenance hatch lock")
- if(!locked && open)
+ return 1
+
+ if(!locked && open && emagged == 1)
emagged = 2
log_and_message_admins("emagged [src]'s inner circuits")
+ return 1
/obj/machinery/bot/examine(mob/user)
..(user)
@@ -65,8 +68,6 @@
user << "Unable to repair with the maintenance panel closed."
else
user << "[src] does not need a repair."
- else if (istype(W, /obj/item/weapon/card/emag) && emagged < 2)
- Emag(user)
else
if(hasvar(W,"force") && hasvar(W,"damtype"))
switch(W.damtype)
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index 935856269c..5ba75ab41a 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -59,7 +59,7 @@
..()
wires = new(src)
botcard = new(src)
- botcard.access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mint, access_mining, access_mining_station)
+ botcard.access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station)
cell = new(src)
cell.charge = 2000
cell.maxcharge = 2000
@@ -88,12 +88,7 @@
// cell: insert it
// other: chance to knock rider off bot
/obj/machinery/bot/mulebot/attackby(var/obj/item/I, var/mob/user)
- if(istype(I,/obj/item/weapon/card/emag))
- locked = !locked
- user << "You [locked ? "lock" : "unlock"] the mulebot's controls!"
- flick("mulebot-emagged", src)
- playsound(src.loc, 'sound/effects/sparks1.ogg', 100, 0)
- else if(istype(I,/obj/item/weapon/cell) && open && !cell)
+ if(istype(I,/obj/item/weapon/cell) && open && !cell)
var/obj/item/weapon/cell/C = I
user.drop_item()
C.loc = src
@@ -106,11 +101,11 @@
open = !open
if(open)
- src.visible_message("[user] opens the maintenance hatch of [src]", "You open [src]'s maintenance hatch.")
+ src.visible_message("[user] opens the maintenance hatch of [src]", "You open [src]'s maintenance hatch.")
on = 0
icon_state="mulebot-hatch"
else
- src.visible_message("[user] closes the maintenance hatch of [src]", "You close [src]'s maintenance hatch.")
+ src.visible_message("[user] closes the maintenance hatch of [src]", "You close [src]'s maintenance hatch.")
icon_state = "mulebot0"
updateDialog()
@@ -133,6 +128,12 @@
..()
return
+/obj/machinery/bot/mulebot/emag_act(var/remaining_charges, var/user)
+ locked = !locked
+ user << "You [locked ? "lock" : "unlock"] the mulebot's controls!"
+ flick("mulebot-emagged", src)
+ playsound(src.loc, 'sound/effects/sparks1.ogg', 100, 0)
+ return 1
/obj/machinery/bot/mulebot/ex_act(var/severity)
unload(0)
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 7f288ee693..9dc39f257b 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -138,14 +138,10 @@
else if(iswelder(W) && (wires.CanDeconstruct() || (stat & BROKEN)))
if(weld(W, user))
- if (stat & BROKEN)
- stat &= ~BROKEN
- cancelCameraAlarm()
- update_icon()
- update_coverage()
- else if(assembly)
+ if(assembly)
assembly.loc = src.loc
assembly.state = 1
+ assembly = null //so qdel doesn't eat it.
new /obj/item/stack/cable_coil(src.loc, length=2)
qdel(src)
@@ -260,6 +256,11 @@
//I guess that doesn't matter since they couldn't use it anyway?
kick_viewers()
+/obj/machinery/camera/check_eye(mob/user)
+ if(!can_use()) return -1
+ if(isXRay()) return SEE_TURFS|SEE_MOBS|SEE_OBJS
+ return 0
+
//This might be redundant, because of check_eye()
/obj/machinery/camera/proc/kick_viewers()
for(var/mob/O in player_list)
diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm
index eeaaa03c4f..608b04d95e 100644
--- a/code/game/machinery/camera/presets.dm
+++ b/code/game/machinery/camera/presets.dm
@@ -11,6 +11,7 @@ var/global/list/station_networks = list(
NETWORK_MINE,
NETWORK_RESEARCH,
NETWORK_RESEARCH_OUTPOST,
+ NETWORK_ROBOTS,
NETWORK_PRISON,
NETWORK_SECURITY
)
diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm
index d8c776bc36..8f048db043 100644
--- a/code/game/machinery/camera/tracking.dm
+++ b/code/game/machinery/camera/tracking.dm
@@ -130,11 +130,11 @@
/mob/living/silicon/ai/proc/ai_camera_track(var/target_name in trackable_mobs())
set category = "AI Commands"
- set name = "Track With Camera"
+ set name = "Follow With Camera"
set desc = "Select who you would like to track."
if(src.stat == 2)
- src << "You can't track with camera because you are dead!"
+ src << "You can't follow [target_name] with cameras because you are dead!"
return
if(!target_name)
src.cameraFollow = null
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 799590e65c..af33673a1f 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -216,13 +216,6 @@
else
locked = 0
user << "System unlocked."
- else if(istype(W, /obj/item/weapon/card/emag))
- if(isnull(occupant))
- return
- user << "You force an emergency ejection."
- locked = 0
- go_out()
- return
else if(istype(W, /obj/item/weapon/reagent_containers/food/snacks/meat))
user << "\The [src] processes \the [W]."
biomass += 50
@@ -252,6 +245,14 @@
else
..()
+/obj/machinery/clonepod/emag_act(var/remaining_charges, var/mob/user)
+ if(isnull(occupant))
+ return
+ user << "You force an emergency ejection."
+ locked = 0
+ go_out()
+ return 1
+
//Put messages in the connected computer's temp var for display.
/obj/machinery/clonepod/proc/connected_message(var/message)
if((isnull(connected)) || (!istype(connected, /obj/machinery/computer/cloning)))
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index 407b007c24..1fcf6e8625 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -88,8 +88,8 @@
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc )
A.amount = 5
- if(istype(P, /obj/item/stack/material/glass/reinforced))
- var/obj/item/stack/material/glass/reinforced/RG = P
+ if(istype(P, /obj/item/stack/material) && P.get_material_name() == "rglass")
+ var/obj/item/stack/RG = P
if (RG.get_amount() < 2)
user << "You need two sheets of glass to put in the glass panel."
return
@@ -201,6 +201,7 @@
transfer.control_disabled = 0
transfer.aiRadio.disabledAi = 0
transfer.loc = get_turf(src)
+ transfer.create_eyeobj()
transfer.cancel_camera()
user << "Transfer successful: [transfer.name] ([rand(1000,9999)].exe) downloaded to host terminal. Local copy wiped."
transfer << "You have been uploaded to a stationary terminal. Remote device connection restored."
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index d8d2a3bb0e..f579873701 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -221,8 +221,8 @@
return
-/obj/machinery/computer/arcade/attackby(I as obj, user as mob)
- if(istype(I, /obj/item/weapon/card/emag) && !emagged)
+/obj/machinery/computer/arcade/emag_act(var/charges, var/mob/user)
+ if(!emagged)
temp = "If you die in the game, you die for real!"
player_hp = 30
player_mp = 10
@@ -230,17 +230,13 @@
enemy_mp = 20
gameover = 0
blocked = 0
-
emagged = 1
enemy_name = "Cuban Pete"
name = "Outbomb Cuban Pete"
-
src.updateUsrDialog()
- else
- ..()
-
+ return 1
/obj/machinery/computer/arcade/emp_act(severity)
if(stat & (NOPOWER|BROKEN))
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index 46d2735750..c11108b490 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -31,14 +31,13 @@
return 1
ui_interact(user)
-/obj/machinery/computer/atmoscontrol/attackby(var/obj/item/I as obj, var/mob/user as mob)
- if(istype(I, /obj/item/weapon/card/emag) && !emagged)
- user.visible_message("\The [user] swipes \a [I] through \the [src], causing the screen to flash!",\
- "You swipe your [I] through \the [src], the screen flashing as you gain full control.",\
- "You hear the swipe of a card through a reader, and an electronic warble.")
+/obj/machinery/computer/atmoscontrol/emag_act(var/remaining_carges, var/mob/user)
+ if(!emagged)
+ user.visible_message("\The [user] does something \the [src], causing the screen to flash!",\
+ "You cause the screen to flash as you gain full control.",\
+ "You hear an electronic warble.")
atmos_control.emagged = 1
- return
- return ..()
+ return 1
/obj/machinery/computer/atmoscontrol/ui_interact(var/mob/user)
if(!atmos_control)
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index 0c5f59c73f..54734929c8 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -87,8 +87,8 @@
var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( src.loc )
A.amount = 5
- if(istype(P, /obj/item/stack/material/glass))
- var/obj/item/stack/material/glass/G = P
+ if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
+ var/obj/item/stack/G = P
if (G.get_amount() < 2)
user << "You need two sheets of glass to put in the glass panel."
return
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index 082ad398bf..9c90b5407b 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -28,11 +28,13 @@
check_eye(var/mob/user as mob)
if (user.stat || ((get_dist(user, src) > 1 || !( user.canmove ) || user.blinded) && !istype(user, /mob/living/silicon))) //user can't see - not sure why canmove is here.
- return null
- if ( !current || !current.can_use() ) //camera doesn't work
+ return -1
+ if(!current)
+ return 0
+ var/viewflag = current.check_eye(user)
+ if ( viewflag < 0 ) //camera doesn't work
reset_current()
- user.reset_view(current)
- return 1
+ return viewflag
ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1)
if(src.z > 6) return
@@ -87,7 +89,7 @@
if(src.z>6 || stat&(NOPOWER|BROKEN)) return
if(usr.stat || ((get_dist(usr, src) > 1 || !( usr.canmove ) || usr.blinded) && !istype(usr, /mob/living/silicon))) return
reset_current()
- usr.check_eye(current)
+ usr.reset_view(current)
return 1
else
. = ..()
@@ -123,8 +125,8 @@
if (!C.can_use() || user.stat || (get_dist(user, src) > 1 || user.machine != src || user.blinded || !( user.canmove ) && !istype(user, /mob/living/silicon)))
return 0
set_current(C)
+ user.reset_view(current)
check_eye(user)
- use_power(50)
return 1
//Camera control: moving.
@@ -166,6 +168,7 @@
src.current = C
if(current)
+ use_power = 2
var/mob/living/L = current.loc
if(istype(L))
L.tracking_initiated()
@@ -176,6 +179,7 @@
if(istype(L))
L.tracking_cancelled()
current = null
+ use_power = 1
//Camera control: mouse.
/atom/DblClick()
diff --git a/code/game/machinery/computer/camera_circuit.dm b/code/game/machinery/computer/camera_circuit.dm
index 25baf81486..4680bb57d1 100644
--- a/code/game/machinery/computer/camera_circuit.dm
+++ b/code/game/machinery/computer/camera_circuit.dm
@@ -7,7 +7,7 @@
var/authorised = 0
var/possibleNets[0]
var/network = ""
- build_path = 0
+ build_path = null
//when adding a new camera network, you should only need to update these two procs
New()
@@ -19,36 +19,24 @@
possibleNets["Medbay"] = access_cmo
proc/updateBuildPath()
- build_path = ""
+ build_path = null
if(authorised && secured)
switch(network)
if("SS13")
- build_path = "/obj/machinery/computer/security"
+ build_path = /obj/machinery/computer/security
if("Engineering")
- build_path = "/obj/machinery/computer/security/engineering"
+ build_path = /obj/machinery/computer/security/engineering
if("Mining")
- build_path = "/obj/machinery/computer/security/mining"
+ build_path = /obj/machinery/computer/security/mining
if("Research")
- build_path = "/obj/machinery/computer/security/research"
+ build_path = /obj/machinery/computer/security/research
if("Medbay")
- build_path = "/obj/machinery/computer/security/medbay"
+ build_path = /obj/machinery/computer/security/medbay
if("Cargo")
- build_path = "/obj/machinery/computer/security/cargo"
+ build_path = /obj/machinery/computer/security/cargo
attackby(var/obj/item/I, var/mob/user)//if(health > 50)
..()
- if(istype(I,/obj/item/weapon/card/emag))
- if(network)
- var/obj/item/weapon/card/emag/E = I
- if(E.uses)
- E.uses--
- else
- return
- authorised = 1
- user << "You authorised the circuit network!"
- updateDialog()
- else
- user << "You must select a camera network circuit!"
else if(istype(I,/obj/item/weapon/screwdriver))
secured = !secured
user.visible_message("The [src] can [secured ? "no longer" : "now"] be modified.")
@@ -107,17 +95,7 @@
else if (possibleNets[network] in I.access)
authorised = 1
if(istype(I,/obj/item/weapon/card/emag))
- if(network)
- var/obj/item/weapon/card/emag/E = I
- if(E.uses)
- E.uses--
- else
- return
- authorised = 1
- usr << "You authorised the circuit network!"
- updateDialog()
- else
- usr << "You must select a camera network circuit!"
+ I.resolve_attackby(src, usr)
else if( href_list["removeauth"] )
authorised = 0
updateDialog()
@@ -125,3 +103,12 @@
updateDialog()
if(istype(src.loc,/mob))
attack_self(src.loc)
+
+/obj/item/weapon/circuitboard/camera/emag_act(var/remaining_charges, var/mob/user)
+ if(network)
+ authorised = 1
+ user << "You authorised the circuit network!"
+ updateDialog()
+ return 1
+ else
+ user << "You must select a camera network circuit!"
diff --git a/code/game/machinery/computer/camera_monitor.dm b/code/game/machinery/computer/camera_monitor.dm
deleted file mode 100644
index 11e8ddd43c..0000000000
--- a/code/game/machinery/computer/camera_monitor.dm
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/obj/machinery/computer/security
- New()
- if(network)
- networks = list(network)
- else
- switch(department)
- if("Security")
- networks = list("Arrivals","SS13","Engineering","Research","Medbay","Tcomsat","Mess Hall","Security","Prison Wing","Atmospherics","Cargo","Command","Solars","Robotics","Chapel","Hydroponics", "Dormitory","Theatre","Library")
- if("Engineering")
- networks = list("Engineering","Tcomsat","Singularity","Atmospherics","Solars","Robotics")
- if("Research")
- networks = list("Research","Bomb Testing","Outpost")
- if("Medbay")
- networks = list("Medbay")
- if("Cargo")
- networks = list("Mine","Cargo")
- if("Mining")
- networks = list("Mine")
- if("Thunderdome")
- networks = list("thunder")
- if("CREED")
- networks = list("CREED")
-
-/obj/machinery/computer/security/attack_hand(var/mob/user as mob)
- if (stat & (NOPOWER|BROKEN))
- return
-
- user.machine = src
- if(src.current)
- user.reset_view(src.current)
-
- var/list/L = new/list
- for (var/obj/machinery/camera/C in world)
- L.Add(C)
-
- camera_network_sort(L)
-
- var/list/D = new()
- D["Cancel"] = "Cancel"
- for (var/obj/machinery/camera/C in L)
- if ( C.network in src.networks )
- D[text("[]: [][]", C.network, C.c_tag, (C.can_use() ? null : " (Deactivated)"))] = C
-
- var/t = input(user, "Which camera should you change to?") as null|anything in D
-
- if(!t)
- user.machine = null
- user.reset_view(null)
- return 0
-
- var/obj/machinery/camera/C = D[t]
-
- if (t == "Cancel")
- user.cancel_camera()
- return 0
-
- if (C)
- if ((get_dist(user, src) > 1 || user.machine != src || user.blinded || !( user.canmove ) || !( C.status )) && (!istype(user, /mob/living/silicon/ai)))
- return 0
- else
- src.current = C
- use_power(50)
- user.reset_view(C)
-
- spawn( 5 )
- attack_hand(user)
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index d2500f36c7..8a8d32a671 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -269,11 +269,11 @@
src.updateUsrDialog()
-/obj/machinery/computer/communications/attackby(var/obj/I as obj, var/mob/user as mob)
- if(istype(I,/obj/item/weapon/card/emag/))
+/obj/machinery/computer/communications/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
src.emagged = 1
user << "You scramble the communication routing circuits!"
- ..()
+ return 1
/obj/machinery/computer/communications/attack_ai(var/mob/user as mob)
return src.attack_hand(user)
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index f775c5f950..779e2a1460 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -37,24 +37,6 @@
return
if(!istype(user))
return
- if(istype(O,/obj/item/weapon/card/emag/))
- // Will create sparks and print out the console's password. You will then have to wait a while for the console to be back online.
- // It'll take more time if there's more characters in the password..
- if(!emag)
- if(!isnull(src.linkedServer))
- icon_state = hack_icon // An error screen I made in the computers.dmi
- emag = 1
- screen = 2
- spark_system.set_up(5, 0, src)
- src.spark_system.start()
- var/obj/item/weapon/paper/monitorkey/MK = new/obj/item/weapon/paper/monitorkey
- MK.loc = src.loc
- // Will help make emagging the console not so easy to get away with.
- MK.info += "
£%@%(*$%&(£&?*(%&£/{}"
- spawn(100*length(src.linkedServer.decryptkey)) UnmagConsole()
- message = rebootmsg
- else
- user << "A no server error appears on the screen."
if(isscrewdriver(O) && emag)
//Stops people from just unscrewing the monitor and putting it back to get the console working again.
user << "It is too hot to mess with!"
@@ -63,6 +45,26 @@
..()
return
+/obj/machinery/computer/message_monitor/emag_act(var/remaining_charges, var/mob/user)
+ // Will create sparks and print out the console's password. You will then have to wait a while for the console to be back online.
+ // It'll take more time if there's more characters in the password..
+ if(!emag && operable())
+ if(!isnull(src.linkedServer))
+ icon_state = hack_icon // An error screen I made in the computers.dmi
+ emag = 1
+ screen = 2
+ spark_system.set_up(5, 0, src)
+ src.spark_system.start()
+ var/obj/item/weapon/paper/monitorkey/MK = new/obj/item/weapon/paper/monitorkey
+ MK.loc = src.loc
+ // Will help make emagging the console not so easy to get away with.
+ MK.info += "
£%@%(*$%&(£&?*(%&£/{}"
+ spawn(100*length(src.linkedServer.decryptkey)) UnmagConsole()
+ message = rebootmsg
+ return 1
+ else
+ user << "A no server error appears on the screen."
+
/obj/machinery/computer/message_monitor/update_icon()
..()
if(stat & (NOPOWER|BROKEN))
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index 3dd181c917..af0105ca5b 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -45,7 +45,7 @@
if(!T.implanted) continue
var/loc_display = "Unknown"
var/mob/living/carbon/M = T.imp_in
- if(M.z in config.station_levels && !istype(M.loc, /turf/space))
+ if((M.z in config.station_levels) && !istype(M.loc, /turf/space))
var/turf/mob_loc = get_turf(M)
loc_display = mob_loc.loc
if(T.malfunction)
diff --git a/code/game/machinery/computer/prisonshuttle.dm b/code/game/machinery/computer/prisonshuttle.dm
index 8ff3a8e103..f33e3af833 100644
--- a/code/game/machinery/computer/prisonshuttle.dm
+++ b/code/game/machinery/computer/prisonshuttle.dm
@@ -47,9 +47,6 @@ var/prison_shuttle_timeleft = 0
A.icon_state = "4"
qdel(src)
- else if(istype(I,/obj/item/weapon/card/emag) && (!hacked))
- hacked = 1
- user << "You disable the lock."
else
return src.attack_hand(user)
@@ -235,3 +232,9 @@ var/prison_shuttle_timeleft = 0
start_location.move_contents_to(end_location)
return
+
+/obj/machinery/computer/prison_shuttle/emag_act(var/charges, var/mob/user)
+ if(!hacked)
+ hacked = 1
+ user << "You disable the lock."
+ return 1
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index 8534128fb7..25894ae91e 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -5,7 +5,7 @@
desc = "Used to view, edit and maintain security records"
icon_state = "security"
light_color = "#a91515"
- req_one_access = list(access_security, access_forensics_lockers)
+ req_one_access = list(access_security, access_forensics_lockers, access_lawyer)
circuit = "/obj/item/weapon/circuitboard/secure_data"
var/obj/item/weapon/card/id/scan = null
var/authenticated = null
diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm
index ea8cf4d726..e48a71b89f 100644
--- a/code/game/machinery/computer/specops_shuttle.dm
+++ b/code/game/machinery/computer/specops_shuttle.dm
@@ -249,11 +249,8 @@ var/specops_shuttle_timeleft = 0
/obj/machinery/computer/specops_shuttle/attack_ai(var/mob/user as mob)
return attack_hand(user)
-/obj/machinery/computer/specops_shuttle/attackby(I as obj, user as mob)
- if(istype(I,/obj/item/weapon/card/emag))
- user << "The electronic systems in this console are far too advanced for your primitive hacking peripherals."
- else
- return attack_hand(user)
+/obj/machinery/computer/specops_shuttle/emag_act(var/remaining_charges, var/mob/user)
+ user << "The electronic systems in this console are far too advanced for your primitive hacking peripherals."
/obj/machinery/computer/specops_shuttle/attack_hand(var/mob/user as mob)
if(!allowed(user))
@@ -291,8 +288,8 @@ var/specops_shuttle_timeleft = 0
usr << "Central Command will not allow the Special Operations shuttle to return yet."
if(world.timeofday <= specops_shuttle_timereset)
if (((world.timeofday - specops_shuttle_timereset)/10) > 60)
- usr << "[-((world.timeofday - specops_shuttle_timereset)/10)/60] minutes remain!"
- usr << "[-(world.timeofday - specops_shuttle_timereset)/10] seconds remain!"
+ usr << "[-((world.timeofday - specops_shuttle_timereset)/10)/60] minutes remain!"
+ usr << "[-(world.timeofday - specops_shuttle_timereset)/10] seconds remain!"
return
usr << "The Special Operations shuttle will arrive at Central Command in [(SPECOPS_MOVETIME/10)] seconds."
diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm
index 9d05249d95..07b4e007a3 100644
--- a/code/game/machinery/computer/supply.dm
+++ b/code/game/machinery/computer/supply.dm
@@ -207,14 +207,11 @@
onclose(user, "computer")
return
-/obj/machinery/computer/supplycomp/attackby(I as obj, user as mob)
- if(istype(I,/obj/item/weapon/card/emag) && !hacked)
+/obj/machinery/computer/supplycomp/emag_act(var/remaining_charges, var/mob/user)
+ if(!hacked)
user << "Special supplies unlocked."
hacked = 1
- return
- else
- ..()
- return
+ return 1
/obj/machinery/computer/supplycomp/Topic(href, href_list)
if(!supply_controller)
diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm
index 3357072c28..333584a921 100644
--- a/code/game/machinery/computer/syndicate_specops_shuttle.dm
+++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm
@@ -185,11 +185,8 @@ var/syndicate_elite_shuttle_timeleft = 0
/obj/machinery/computer/syndicate_elite_shuttle/attack_ai(var/mob/user as mob)
return attack_hand(user)
-/obj/machinery/computer/syndicate_elite_shuttle/attackby(I as obj, user as mob)
- if(istype(I,/obj/item/weapon/card/emag))
- user << "The electronic systems in this console are far too advanced for your primitive hacking peripherals."
- else
- return attack_hand(user)
+/obj/machinery/computer/syndicate_elite_shuttle/emag_act(var/remaining_charges, var/mob/user)
+ user << "The electronic systems in this console are far too advanced for your primitive hacking peripherals."
/obj/machinery/computer/syndicate_elite_shuttle/attack_hand(var/mob/user as mob)
if(!allowed(user))
diff --git a/code/game/machinery/computer3/bios.dm b/code/game/machinery/computer3/bios.dm
index be9314759e..ebcacdce76 100644
--- a/code/game/machinery/computer3/bios.dm
+++ b/code/game/machinery/computer3/bios.dm
@@ -69,16 +69,16 @@
if(!interactable(user) || user.machine != src)
if(user.machine == src)
user.unset_machine()
- return null
+ return -1
var/datum/file/program/security/S = program
if( !istype(S) || !S.current || !S.current.status || !camnet )
if( user.machine == src )
user.unset_machine()
- return null
+ return -1
- user.reset_view(S.current)
- return 1
+ user.reset_view(S.current, 0)
+ return 0
/*
List all files, including removable disks and data cards
diff --git a/code/game/machinery/computer3/buildandrepair.dm b/code/game/machinery/computer3/buildandrepair.dm
index f3e7981af4..47ceffb756 100644
--- a/code/game/machinery/computer3/buildandrepair.dm
+++ b/code/game/machinery/computer3/buildandrepair.dm
@@ -178,12 +178,13 @@
if(istype(P, /obj/item/weapon/crowbar)) // complicated check
remove_peripheral()
- if(istype(P, /obj/item/stack/material/glass))
- if(P:amount >= 2)
+ if(istype(P, /obj/item/stack/material) && P.get_material_name() == "glass")
+ var/obj/item/stack/S = P
+ if(S.amount >= 2)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20))
- if(P)
- P:use(2)
+ if(S)
+ S.use(2)
user << "You put in the glass panel."
src.state = 4
src.icon_state = "4"
diff --git a/code/game/machinery/computer3/computers/camera.dm b/code/game/machinery/computer3/computers/camera.dm
index f90b0526ee..814df454fa 100644
--- a/code/game/machinery/computer3/computers/camera.dm
+++ b/code/game/machinery/computer3/computers/camera.dm
@@ -56,7 +56,7 @@
name = "Security Camera Network Main Key"
var/title = "Station"
var/desc = "Connects to station security cameras."
- var/list/networks = list("SS13")
+ var/networks = list("ALL") // A little workaround as it is not possible to place station_networks here
var/screen = "cameras"
execute(var/datum/file/source)
@@ -76,58 +76,65 @@
return
computer.Crash(MISSING_PROGRAM)
+/datum/file/camnet_key/New()
+ for(var/N in networks)
+ if(N == "ALL")
+ networks = station_networks
+ break
+ return ..()
+
/datum/file/camnet_key/mining
name = "Mining Camera Network Key"
title = "mining station"
desc = "Connects to mining security cameras."
- networks = list("MINE")
+ networks = list(NETWORK_MINE)
screen = "miningcameras"
/datum/file/camnet_key/research
name = "Research Camera Network Key"
title = "research"
- networks = list("RD")
+ networks = list(NETWORK_RESEARCH)
/datum/file/camnet_key/bombrange
name = "R&D Bomb Range Camera Network Key"
title = "bomb range"
desc = "Monitors the bomb range."
- networks = list("Toxins")
+ networks = list(NETWORK_RESEARCH)
/datum/file/camnet_key/xeno
name = "R&D Misc. Research Camera Network Key"
title = "special research"
- networks = list("Misc")
+ networks = list(NETWORK_RESEARCH)
/datum/file/camnet_key/singulo
name = "Singularity Camera Network Key"
title = "singularity"
- networks = list("Singularity")
+ networks = list(NETWORK_ENGINE)
/datum/file/camnet_key/entertainment
name = "Entertainment Channel Encryption Key"
title = "entertainment"
desc = "Damn, I hope they have /tg/thechannel on here."
- networks = list("thunder")
+ networks = list(NETWORK_THUNDER)
screen = "entertainment"
/datum/file/camnet_key/creed
name = "Special Ops Camera Encryption Key"
title = "special ops"
desc = "Connects to special ops secure camera feeds."
- networks = list("CREED")
+ networks = list(NETWORK_ERT)
/datum/file/camnet_key/prison
name = "Prison Camera Network Key"
title = "prison"
desc = "Monitors the prison."
- networks = list("Prison")
+ networks = list(NETWORK_SECURITY)
/datum/file/camnet_key/syndicate
name = "Camera Network Key"
title = "%!#BUFFER OVERFLOW"
desc = "Connects to security cameras."
- networks = list("SS13")
+ networks = list("ALL")
hidden_file = 1
diff --git a/code/game/machinery/computer3/laptop.dm b/code/game/machinery/computer3/laptop.dm
index ccd63aef36..48e0c48ff0 100644
--- a/code/game/machinery/computer3/laptop.dm
+++ b/code/game/machinery/computer3/laptop.dm
@@ -106,12 +106,16 @@
pixel_x = 2
pixel_y = -3
show_keyboard = 0
+ active_power_usage = 200 // Stationary consoles we use on station have 300, laptops are probably slightly more power efficient
+ idle_power_usage = 100
var/obj/item/device/laptop/portable = null
New(var/L, var/built = 0)
if(!built && !battery)
battery = new /obj/item/weapon/cell(src)
+ battery.maxcharge = 500
+ battery.charge = 500
..(L,built)
verb/close_computer()
@@ -124,7 +128,7 @@
return
if(!Adjacent(usr))
- usr << "You can't reach it."
+ usr << "You can't reach it."
return
close_laptop(usr)
diff --git a/code/game/machinery/computer3/lapvend.dm b/code/game/machinery/computer3/lapvend.dm
index b2e84f1cd2..416472a31a 100644
--- a/code/game/machinery/computer3/lapvend.dm
+++ b/code/game/machinery/computer3/lapvend.dm
@@ -46,8 +46,8 @@
if(vendmode == 3)
if(istype(W,/obj/item/weapon/card))
var/obj/item/weapon/card/I = W
- reimburse(I)
- vendmode = 0
+ if(reimburse(I))
+ vendmode = 0
if(vendmode == 0)
if(istype(W, /obj/item/device/laptop))
var/obj/item/device/laptop/L = W
@@ -202,11 +202,11 @@
if (network == 3)
newlap.spawn_parts += (/obj/item/part/computer/networking/cable)
if (power == 1)
- qdel(newlap.battery)
- newlap.battery = new /obj/item/weapon/cell/high(newlap)
+ newlap.battery.maxcharge = 1000
+ newlap.battery.charge = 1000
if (power == 2)
- qdel(newlap.battery)
- newlap.battery = new /obj/item/weapon/cell/super(newlap)
+ newlap.battery.maxcharge = 1750
+ newlap.battery.charge = 1750
newlap.spawn_parts()
@@ -215,6 +215,9 @@
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
var/datum/money_account/CH = get_account(C.associated_account_number)
+ if(!CH)
+ usr << "\icon[src]No valid account number is associated with this card."
+ return
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
if(vendor_account)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
@@ -363,18 +366,25 @@
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
var/datum/money_account/CH = get_account(C.associated_account_number)
+ if(!CH)
+ usr << "\icon[src]No valid account number is associated with this card."
+ return 0
if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
if(vendor_account)
var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
if(D)
transfer_and_reimburse(D)
+ return 1
else
usr << "\icon[src]Unable to access account. Check security settings and try again."
+ return 0
else
usr << "\icon[src]Unable to access vendor account. Please record the machine ID and call CentComm Support."
+ return 0
else
transfer_and_reimburse(CH)
+ return 1
/obj/machinery/lapvend/proc/transfer_and_reimburse(var/datum/money_account/D)
var/transaction_amount = total()
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 41d44a0708..665f74d926 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -106,18 +106,26 @@
if(component_check)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc, src.dir)
- new_machine.component_parts.Cut()
+
+ if(new_machine.component_parts)
+ new_machine.component_parts.Cut()
+ else
+ new_machine.component_parts = list()
+
src.circuit.construct(new_machine)
+
for(var/obj/O in src)
if(circuit.contain_parts) // things like disposal don't want their parts in them
O.loc = new_machine
else
O.loc = null
new_machine.component_parts += O
+
if(circuit.contain_parts)
circuit.loc = new_machine
else
circuit.loc = null
+
new_machine.RefreshParts()
qdel(src)
else
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index abab6af863..4642dcd27f 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -60,11 +60,6 @@
return 1
-
-/obj/machinery/atmospherics/unary/cryo_cell/allow_drop()
- return 0
-
-
/obj/machinery/atmospherics/unary/cryo_cell/relaymove(mob/user as mob)
if(user.stat)
return
@@ -335,6 +330,9 @@
put_mob(usr)
return
+/atom/proc/return_air_for_internal_lifeform()
+ return return_air()
+
/obj/machinery/atmospherics/unary/cryo_cell/return_air_for_internal_lifeform()
//assume that the cryo cell has some kind of breath mask or something that
//draws from the cryo tube's environment, instead of the cold internal air.
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 3ea9b5157f..56b7b241c1 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -393,9 +393,9 @@
occupant.ckey = null
//Make an announcement and log the person entering storage.
- control_computer.frozen_crew += "[occupant.real_name], [occupant.mind.assigned_role] - [worldtime2text()]"
+ control_computer.frozen_crew += "[occupant.real_name], [occupant.mind.role_alt_title] - [worldtime2text()]"
- announce.autosay("[occupant.real_name], [occupant.mind.assigned_role] [on_store_message]", "[on_store_name]")
+ announce.autosay("[occupant.real_name], [occupant.mind.role_alt_title], [on_store_message]", "[on_store_name]")
visible_message("\The [initial(name)] hums and hisses as it moves [occupant.real_name] into storage.", 3)
// Delete the mob.
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 73501f283d..2da65d273f 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -79,12 +79,14 @@ for reference:
maxhealth = material.integrity
health = maxhealth
+/obj/structure/barricade/get_material()
+ return material
+
/obj/structure/barricade/attackby(obj/item/W as obj, mob/user as mob)
- if (istype(W, /obj/item/stack/material))
- var/obj/item/stack/material/D = W
- if(D.material.name != material.name)
- user << "That is the wrong material needed to repair \the [src]."
- return
+ if (istype(W, /obj/item/stack))
+ var/obj/item/stack/D = W
+ if(D.get_material_name() != material.name)
+ return //hitting things with the wrong type of stack usually doesn't produce messages, and probably doesn't need to.
if (health < maxhealth)
if (D.get_amount() < 1)
user << "You need one sheet of [material.display_name] to repair \the [src]."
@@ -186,25 +188,6 @@ for reference:
visible_message("BZZzZZzZZzZT")
return
return
- else if (istype(W, /obj/item/weapon/card/emag))
- if (src.emagged == 0)
- src.emagged = 1
- src.req_access.Cut()
- src.req_one_access.Cut()
- user << "You break the ID authentication lock on \the [src]."
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(2, 1, src)
- s.start()
- visible_message("BZZzZZzZZzZT")
- return
- else if (src.emagged == 1)
- src.emagged = 2
- user << "You short out the anchoring mechanism on \the [src]."
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(2, 1, src)
- s.start()
- visible_message("BZZzZZzZZzZT")
- return
else if (istype(W, /obj/item/weapon/wrench))
if (src.health < src.maxhealth)
src.health = src.maxhealth
@@ -276,3 +259,24 @@ for reference:
explosion(src.loc,-1,-1,0)
if(src)
qdel(src)
+
+
+/obj/machinery/deployable/barrier/emag_act(var/remaining_charges, var/mob/user)
+ if (src.emagged == 0)
+ src.emagged = 1
+ src.req_access.Cut()
+ src.req_one_access.Cut()
+ user << "You break the ID authentication lock on \the [src]."
+ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ s.set_up(2, 1, src)
+ s.start()
+ visible_message("BZZzZZzZZzZT")
+ return 1
+ else if (src.emagged == 1)
+ src.emagged = 2
+ user << "You short out the anchoring mechanism on \the [src]."
+ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ s.set_up(2, 1, src)
+ s.start()
+ visible_message("BZZzZZzZZzZT")
+ return 1
diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm
index e010264d4a..4fc7562b3a 100644
--- a/code/game/machinery/door_control.dm
+++ b/code/game/machinery/door_control.dm
@@ -40,11 +40,14 @@
*/
if(istype(W, /obj/item/device/detective_scanner))
return
- if(istype(W, /obj/item/weapon/card/emag))
+ return src.attack_hand(user)
+
+/obj/machinery/button/remote/emag_act(var/remaining_charges, var/mob/user)
+ if(req_access.len || req_one_access.len)
req_access = list()
req_one_access = list()
playsound(src.loc, "sparks", 100, 1)
- return src.attack_hand(user)
+ return 1
/obj/machinery/button/remote/attack_hand(mob/user as mob)
if(..())
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 8f3a5ca621..12e4396a18 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -48,6 +48,11 @@
return
..()
+/obj/machinery/door/airlock/get_material()
+ if(mineral)
+ return get_material_by_name(mineral)
+ return get_material_by_name(DEFAULT_WALL_MATERIAL)
+
/obj/machinery/door/airlock/command
name = "Airlock"
icon = 'icons/obj/doors/Doorcom.dmi'
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index 2c5c00caaa..8c960e7bdf 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -96,12 +96,12 @@
else
usr << "[src]'s motors resist your effort."
return
- if(istype(C, /obj/item/stack/material/plasteel))
- var/amt = repair_price()
+ if(istype(C, /obj/item/stack/material) && C.get_material_name() == "plasteel")
+ var/amt = Ceiling((maxhealth - health)/150)
if(!amt)
usr << "\The [src] is already fully repaired."
return
- var/obj/item/stack/material/plasteel/P = C
+ var/obj/item/stack/P = C
if(P.amount < amt)
usr << "You don't have enough sheets to repair this! You need at least [amt] sheets."
return
@@ -135,16 +135,6 @@
return
force_close()
-// Proc: repair_price()
-// Parameters: None
-// Description: Determines amount of sheets needed for full repair. (max)150HP per sheet, (max)10 emitter hits per sheet.
-/obj/machinery/door/blast/proc/repair_price()
- var/sheets_needed = 0
- var/dam = maxhealth - health
- while(dam > 0)
- dam -= 150
- sheets_needed++
- return sheets_needed
// Proc: repair()
// Parameters: None
@@ -154,7 +144,7 @@
if(stat & BROKEN)
stat &= ~BROKEN
-
+
/obj/machinery/door/blast/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group) return 1
return ..()
@@ -171,6 +161,11 @@ obj/machinery/door/blast/regular
icon_state = "pdoor1"
maxhealth = 600
+obj/machinery/door/blast/regular/open
+ icon_state = "pdoor0"
+ density = 0
+ opacity = 0
+
// SUBTYPE: Shutters
// Nicer looking, and also weaker, shutters. Found in kitchen and similar areas.
/obj/machinery/door/blast/shutters
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 9f5a831b16..9075da2a05 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -103,6 +103,13 @@
bumpopen(M)
return
+ if(istype(AM, /obj/machinery/bot))
+ var/obj/machinery/bot/bot = AM
+ if(src.check_access(bot.botcard))
+ if(density)
+ open()
+ return
+
if(istype(AM, /mob/living/bot))
var/mob/living/bot/bot = AM
if(src.check_access(bot.botcard))
@@ -199,10 +206,9 @@
/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/device/detective_scanner))
return
- if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
src.add_fingerprint(user)
- if(istype(I, /obj/item/stack/material/steel))
+ if(istype(I, /obj/item/stack/material) && I.get_material_name() == src.get_material_name())
if(stat & BROKEN)
user << "It looks like \the [src] is pretty busted. It's going to need more than just patching up now."
return
@@ -217,20 +223,20 @@
var/amount_needed = (maxhealth - health) / DOOR_REPAIR_AMOUNT
amount_needed = (round(amount_needed) == amount_needed)? amount_needed : round(amount_needed) + 1 //Why does BYOND not have a ceiling proc?
- var/obj/item/stack/material/steel/metalstack = I
+ var/obj/item/stack/stack = I
var/transfer
if (repairing)
- transfer = metalstack.transfer_to(repairing, amount_needed - repairing.amount)
+ transfer = stack.transfer_to(repairing, amount_needed - repairing.amount)
if (!transfer)
user << "You must weld or remove \the [repairing] from \the [src] before you can add anything else."
else
- repairing = metalstack.split(amount_needed)
+ repairing = stack.split(amount_needed)
if (repairing)
repairing.loc = src
transfer = repairing.amount
if (transfer)
- user << "You fit [transfer] [metalstack.singular_name]\s to damaged and broken parts on \the [src]."
+ user << "You fit [transfer] [stack.singular_name]\s to damaged and broken parts on \the [src]."
return
@@ -270,14 +276,9 @@
take_damage(W.force)
return
- if(src.operating) return
+ if(src.operating > 0 || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
- if(src.density && (operable() && istype(I, /obj/item/weapon/card/emag)))
- do_animate("spark")
- sleep(6)
- open()
- operating = -1
- return 1
+ if(src.operating) return
if(src.allowed(user) && operable())
if(src.density)
@@ -290,6 +291,14 @@
do_animate("deny")
return
+/obj/machinery/door/emag_act(var/remaining_charges)
+ if(density && operable())
+ do_animate("spark")
+ sleep(6)
+ open()
+ operating = -1
+ return 1
+
/obj/machinery/door/proc/take_damage(var/damage)
var/initialhealth = src.health
src.health = max(0, src.health - damage)
@@ -332,7 +341,8 @@
/obj/machinery/door/emp_act(severity)
if(prob(20/severity) && (istype(src,/obj/machinery/door/airlock) || istype(src,/obj/machinery/door/window)) )
- open()
+ spawn(0)
+ open()
..()
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 0c0d23b52a..78e17e27e0 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -75,6 +75,8 @@
A.all_doors.Remove(src)
. = ..()
+/obj/machinery/door/firedoor/get_material()
+ return get_material_by_name(DEFAULT_WALL_MATERIAL)
/obj/machinery/door/firedoor/examine(mob/user)
. = ..(user, 1)
@@ -102,10 +104,7 @@
continue
var/celsius = convert_k2c(tile_info[index][1])
var/pressure = tile_info[index][2]
- if(dir_alerts[index] & (FIREDOOR_ALERT_HOT|FIREDOOR_ALERT_COLD))
- o += ""
- else
- o += ""
+ o += ""
o += "[celsius]°C "
o += ""
o += "[pressure]kPa"
diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm
index dce2ab37bd..c87ab1ad35 100644
--- a/code/game/machinery/doors/unpowered.dm
+++ b/code/game/machinery/doors/unpowered.dm
@@ -1,26 +1,25 @@
-/obj/machinery/door/unpowered
- autoclose = 0
- var/locked = 0
-
-
- Bumped(atom/AM)
- if(src.locked)
- return
- ..()
- return
-
-
- attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)) return
- if(src.locked) return
- ..()
- return
-
-
-
-/obj/machinery/door/unpowered/shuttle
- icon = 'icons/turf/shuttle.dmi'
- name = "door"
- icon_state = "door1"
- opacity = 1
- density = 1
\ No newline at end of file
+/obj/machinery/door/unpowered
+ autoclose = 0
+ var/locked = 0
+
+/obj/machinery/door/unpowered/Bumped(atom/AM)
+ if(src.locked)
+ return
+ ..()
+ return
+
+/obj/machinery/door/unpowered/attackby(obj/item/I as obj, mob/user as mob)
+ if(istype(I, /obj/item/weapon/melee/energy/blade)) return
+ if(src.locked) return
+ ..()
+ return
+
+/obj/machinery/door/unpowered/emag_act()
+ return -1
+
+/obj/machinery/door/unpowered/shuttle
+ icon = 'icons/turf/shuttle.dmi'
+ name = "door"
+ icon_state = "door1"
+ opacity = 1
+ density = 1
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index f846af3727..dc3edc9328 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -163,6 +163,14 @@
return
return src.attackby(user, user)
+/obj/machinery/door/window/emag_act(var/remaining_charges, var/mob/user)
+ if (density && operable())
+ operating = -1
+ flick("[src.base_state]spark", src)
+ sleep(6)
+ open()
+ return 1
+
/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/user as mob)
//If it's in the process of opening/closing, ignore the click
@@ -170,18 +178,14 @@
return
//Emags and ninja swords? You may pass.
- if (src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
- src.operating = -1
- if(istype(I, /obj/item/weapon/melee/energy/blade))
+ if (istype(I, /obj/item/weapon/melee/energy/blade))
+ if(emag_act(10, user))
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
visible_message("The glass door was sliced open by [user]!")
- flick("[src.base_state]spark", src)
- sleep(6)
- open()
return 1
//If it's emagged, crowbar can pry electronics out.
diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm
index ec9f4e7acc..6661468f59 100644
--- a/code/game/machinery/doppler_array.dm
+++ b/code/game/machinery/doppler_array.dm
@@ -37,7 +37,7 @@ var/list/doppler_arrays = list()
var/message = "Explosive disturbance detected - Epicenter at: grid ([x0],[y0]). Epicenter radius: [devastation_range]. Outer radius: [heavy_impact_range]. Shockwave radius: [light_impact_range]. Temporal displacement of tachyons: [took]seconds."
for(var/mob/O in hearers(src, null))
- O.show_message("[src] states coldly, \"[message]\"",2)
+ O.show_message("[src] states coldly, \"[message]\"",2)
/obj/machinery/doppler_array/power_change()
diff --git a/code/game/machinery/embedded_controller/airlock_program.dm b/code/game/machinery/embedded_controller/airlock_program.dm
index 8cb3abb998..fabf499dc9 100644
--- a/code/game/machinery/embedded_controller/airlock_program.dm
+++ b/code/game/machinery/embedded_controller/airlock_program.dm
@@ -109,10 +109,14 @@
var/shutdown_pump = 0
switch(command)
if("cycle_ext")
- begin_cycle_out()
+ //only respond to these commands if the airlock isn't already doing something
+ //prevents the controller from getting confused and doing strange things
+ if(state == target_state)
+ begin_cycle_out()
if("cycle_int")
- begin_cycle_in()
+ if(state == target_state)
+ begin_cycle_in()
if("cycle_ext_door")
cycleDoors(TARGET_OUTOPEN)
@@ -122,14 +126,6 @@
if("abort")
stop_cycling()
- /*
- //dont do this. If the airlock can't get enough air to pressurize the person inside is stuck
- state = STATE_PRESSURIZE
- target_state = TARGET_NONE
- memory["target_pressure"] = ONE_ATMOSPHERE
- signalPump(tag_airpump, 1, 1, memory["target_pressure"])
- process()
- */
if("force_ext")
toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "toggle")
@@ -140,11 +136,9 @@
if("purge")
memory["purge"] = !memory["purge"]
if(memory["purge"])
- toggleDoor(memory["exterior_status"], tag_exterior_door, 1, "close")
- toggleDoor(memory["interior_status"], tag_interior_door, 1, "close")
- state = STATE_DEPRESSURIZE
+ close_doors()
+ state = STATE_PREPARE
target_state = TARGET_NONE
- signalPump(tag_airpump, 1, 0, 0)
if("secure")
memory["secure"] = !memory["secure"]
@@ -188,12 +182,12 @@
var/target_pressure = memory["target_pressure"]
if(memory["purge"])
+ //purge apparently means clearing the airlock chamber to vacuum (then refilling, handled later)
target_pressure = 0
+ state = STATE_DEPRESSURIZE
+ signalPump(tag_airpump, 1, 0, 0) //send a signal to start depressurizing
- if(memory["purge"])
- target_pressure = 0
-
- if(chamber_pressure <= target_pressure)
+ else if(chamber_pressure <= target_pressure)
state = STATE_PRESSURIZE
signalPump(tag_airpump, 1, 1, target_pressure) //send a signal to start pressurizing
@@ -201,40 +195,37 @@
state = STATE_DEPRESSURIZE
signalPump(tag_airpump, 1, 0, target_pressure) //send a signal to start depressurizing
- //Check for vacuum - this is set after the pumps so the pumps are aiming for 0
- if(!memory["target_pressure"])
- memory["target_pressure"] = ONE_ATMOSPHERE * 0.05
+ //Make sure the airlock isn't aiming for pure vacuum - an impossibility
+ memory["target_pressure"] = max(target_pressure, ONE_ATMOSPHERE * 0.05)
if(STATE_PRESSURIZE)
if(memory["chamber_sensor_pressure"] >= memory["target_pressure"] * 0.95)
- cycleDoors(target_state)
-
- state = STATE_IDLE
- target_state = TARGET_NONE
-
+ //not done until the pump has reported that it's off
if(memory["pump_status"] != "off")
signalPump(tag_airpump, 0) //send a signal to stop pumping
+ else
+ cycleDoors(target_state)
+ state = STATE_IDLE
+ target_state = TARGET_NONE
if(STATE_DEPRESSURIZE)
- if(memory["purge"])
- if(memory["chamber_sensor_pressure"] <= ONE_ATMOSPHERE * 0.05)
- state = STATE_PRESSURIZE
- signalPump(tag_airpump, 1, 1, memory["target_pressure"])
-
-
- else if(memory["chamber_sensor_pressure"] <= memory["target_pressure"] * 1.05)
- cycleDoors(target_state)
-
- state = STATE_IDLE
- target_state = TARGET_NONE
-
- //send a signal to stop pumping
- if(memory["pump_status"] != "off")
+ if(memory["chamber_sensor_pressure"] <= memory["target_pressure"] * 1.05)
+ if(memory["purge"])
+ memory["purge"] = 0
+ memory["target_pressure"] = memory["internal_sensor_pressure"]
+ state = STATE_PREPARE
+ target_state = TARGET_NONE
+
+ else if(memory["pump_status"] != "off")
signalPump(tag_airpump, 0)
+ else
+ cycleDoors(target_state)
+ state = STATE_IDLE
+ target_state = TARGET_NONE
- memory["processing"] = state != target_state
+ memory["processing"] = (state != target_state)
return 1
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
index 009d1c7694..80d9ea8643 100644
--- a/code/game/machinery/floorlayer.dm
+++ b/code/game/machinery/floorlayer.dm
@@ -10,7 +10,7 @@
var/list/mode = list("dismantle"=0,"laying"=0,"collect"=0)
/obj/machinery/floorlayer/New()
- T = new/obj/item/stack/tile/plasteel(src)
+ T = new/obj/item/stack/tile/steel(src)
..()
/obj/machinery/floorlayer/Move(new_turf,M_Dir)
diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm
index e51025aee2..6319871022 100644
--- a/code/game/machinery/holosign.dm
+++ b/code/game/machinery/holosign.dm
@@ -8,6 +8,7 @@
use_power = 1
idle_power_usage = 2
active_power_usage = 4
+ anchored = 1
var/lit = 0
var/id = null
var/on_icon = "sign_on"
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 90305a7a78..65b1f2ca6f 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -174,17 +174,16 @@ datum/track/New(var/title_name, var/audio)
power_change()
update_icon()
return
- if(istype(W, /obj/item/weapon/card/emag))
- if(!emagged)
- emagged = 1
- StopPlaying()
- visible_message("\the [src] makes a fizzling sound.")
- log_and_message_admins("emagged \the [src]")
- update_icon()
- return
-
return ..()
+/obj/machinery/media/jukebox/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
+ emagged = 1
+ StopPlaying()
+ visible_message("\The [src] makes a fizzling sound.")
+ update_icon()
+ return 1
+
/obj/machinery/media/jukebox/proc/StopPlaying()
var/area/main_area = get_area(src)
// Always kill the current sound
diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm
index 13d55e725b..3d18d80a1e 100644
--- a/code/game/machinery/kitchen/gibber.dm
+++ b/code/game/machinery/kitchen/gibber.dm
@@ -84,16 +84,12 @@
..()
usr << "The safety guard is [emagged ? "disabled" : "enabled"]."
+/obj/machinery/gibber/emag_act(var/remaining_charges, var/mob/user)
+ emagged = !emagged
+ user << "You [emagged ? "disable" : "enable"] the gibber safety guard."
+ return 1
+
/obj/machinery/gibber/attackby(var/obj/item/W, var/mob/user)
-
- if(istype(W,/obj/item/weapon/card))
- if(!allowed(user) && !istype(W,/obj/item/weapon/card/emag))
- user << "Access denied."
- return
- emagged = !emagged
- user << "You [emagged ? "disable" : "enable"] the gibber safety guard."
- return
-
var/obj/item/weapon/grab/G = W
if(!istype(G))
diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm
index 4ce21137b8..e78f2b5227 100644
--- a/code/game/machinery/kitchen/microwave.dm
+++ b/code/game/machinery/kitchen/microwave.dm
@@ -130,7 +130,7 @@
if (!(R.id in acceptable_reagents))
user << "Your [O] contains components unsuitable for cookery."
return 1
- //G.reagents.trans_to(src,G.amount_per_transfer_from_this)
+ return
else if(istype(O,/obj/item/weapon/grab))
var/obj/item/weapon/grab/G = O
user << "This is ridiculous. You can not fit \the [G.affecting] in this [src]."
diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm
index 3125b35df6..bc52c276c3 100644
--- a/code/game/machinery/kitchen/smartfridge.dm
+++ b/code/game/machinery/kitchen/smartfridge.dm
@@ -136,6 +136,7 @@
/obj/machinery/smartfridge/drying_rack/proc/dry()
for(var/obj/item/weapon/reagent_containers/food/snacks/S in contents)
+ if(S.dry) continue
if(S.dried_type == S.type)
S.dry = 1
item_quants[S.name]--
@@ -235,14 +236,12 @@
user << "\The [src] smartly refuses [O]."
return 1
-/obj/machinery/smartfridge/secure/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O, /obj/item/weapon/card/emag))
+/obj/machinery/smartfridge/secure/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
emagged = 1
locked = -1
user << "You short out the product lock on [src]."
- return
-
- ..()
+ return 1
/obj/machinery/smartfridge/attack_ai(mob/user as mob)
attack_hand(user)
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 0570211526..709f4b4626 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -123,6 +123,15 @@ Class Procs:
/obj/machinery/Destroy()
machines -= src
+ if(component_parts)
+ for(var/atom/A in component_parts)
+ if(A.loc == src) // If the components are inside the machine, delete them.
+ qdel(A)
+ else // Otherwise we assume they were dropped to the ground during deconstruction, and were not removed from the component_parts list by deconstruction code.
+ component_parts -= A
+ if(contents) // The same for contents.
+ for(var/atom/A in contents)
+ qdel(A)
..()
/obj/machinery/process()//If you dont use process or power why are you here
@@ -167,7 +176,7 @@ Class Procs:
qdel(src)
//sets the use_power var and then forces an area power update
-/obj/machinery/proc/update_use_power(var/new_use_power, var/force_update = 0)
+/obj/machinery/proc/update_use_power(var/new_use_power)
use_power = new_use_power
/obj/machinery/proc/auto_use_power()
diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm
index 0f2dc3c855..ca164d7d0c 100644
--- a/code/game/machinery/pipe/pipelayer.dm
+++ b/code/game/machinery/pipe/pipelayer.dm
@@ -50,7 +50,7 @@
user.visible_message("[user] has [!a_dis?"de":""]activated auto-dismantling.", "You [!a_dis?"de":""]activate auto-dismantling.")
return
- if(istype(W, /obj/item/stack/material/steel))
+ if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL)
var/result = load_metal(W)
if(isnull(result))
@@ -86,7 +86,7 @@
on=0
return
-/obj/machinery/pipelayer/proc/load_metal(var/obj/item/stack/material/steel/MM)
+/obj/machinery/pipelayer/proc/load_metal(var/obj/item/stack/MM)
if(istype(MM) && MM.get_amount())
var/cur_amount = metal
var/to_load = max(max_metal - round(cur_amount),0)
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 4ea2f416f7..74d3a4c52f 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -6,16 +6,13 @@
/obj/machinery/porta_turret
name = "turret"
icon = 'icons/obj/turrets.dmi'
- icon_state = "grey_target_prism"
+ icon_state = "turretCover"
anchored = 1
- layer = 3
- invisibility = INVISIBILITY_LEVEL_TWO //the turret is invisible if it's inside its cover
- density = 1
+
+ density = 0
use_power = 1 //this turret uses and requires power
idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power
active_power_usage = 300 //when active, this turret takes up constant 300 Equipment power
- req_access = null
- req_one_access = list(access_security, access_heads)
power_channel = EQUIP //drains power from the EQUIPMENT channel
var/raised = 0 //if the turret cover is "open" and the turret is raised
@@ -34,7 +31,6 @@
var/iconholder = null //holder for the icon_state. 1 for orange sprite, null for blue.
var/egun = null //holder to handle certain guns switching bullettypes
- var/obj/machinery/porta_turret_cover/cover = null //the cover that is covering this turret
var/last_fired = 0 //1: if the turret is cooling down from a shot, 0: turret is ready to fire
var/shot_delay = 15 //1.5 seconds between each shot
@@ -60,22 +56,43 @@
var/wrenching = 0
var/last_target //last target fired at, prevents turrets from erratically firing at all valid targets in range
+/obj/machinery/porta_turret/crescent
+ enabled = 0
+ ailock = 1
+ check_synth = 0
+ check_access = 1
+ check_arrest = 1
+ check_records = 1
+ check_weapons = 1
+ check_anomalies = 1
+
/obj/machinery/porta_turret/stationary
+ ailock = 1
lethal = 1
installation = /obj/item/weapon/gun/energy/laser
/obj/machinery/porta_turret/New()
..()
- icon_state = "grey_target_prism"
+ req_access.Cut()
+ req_one_access = list(access_security, access_heads)
+
//Sets up a spark system
spark_system = new /datum/effect/effect/system/spark_spread
spark_system.set_up(5, 0, src)
spark_system.attach(src)
- cover = new /obj/machinery/porta_turret_cover(loc)
- cover.Parent_Turret = src
setup()
+/obj/machinery/porta_turret/crescent/New()
+ ..()
+ req_one_access.Cut()
+ req_access = list(access_cent_specops)
+
+/obj/machinery/porta_turret/Destroy()
+ qdel(spark_system)
+ spark_system = null
+ . = ..()
+
/obj/machinery/porta_turret/proc/setup()
var/obj/item/weapon/gun/energy/E = installation //All energy-based weapons are applicable
//var/obj/item/ammo_casing/shottype = E.projectile_type
@@ -127,31 +144,30 @@
eshot_sound = 'sound/weapons/Laser.ogg'
egun = 1
+var/list/turret_icons
+
/obj/machinery/porta_turret/update_icon()
- if(!anchored)
- icon_state = "turretCover"
- return
+ if(!turret_icons)
+ turret_icons = list()
+ turret_icons["open"] = image(icon, "openTurretCover")
+
+ underlays.Cut()
+ underlays += turret_icons["open"]
+
if(stat & BROKEN)
icon_state = "destroyed_target_prism"
- else
- if(powered())
- if(enabled)
- if(iconholder)
- //lasers have a orange icon
- icon_state = "orange_target_prism"
- else
- //almost everything has a blue icon
- icon_state = "target_prism"
+ else if(raised || raising)
+ if(powered() && enabled)
+ if(iconholder)
+ //lasers have a orange icon
+ icon_state = "orange_target_prism"
else
- icon_state = "grey_target_prism"
+ //almost everything has a blue icon
+ icon_state = "target_prism"
else
icon_state = "grey_target_prism"
-
-/obj/machinery/porta_turret/Destroy()
- //deletes its own cover with it
- qdel(cover)
- cover = null
- ..()
+ else
+ icon_state = "turretCover"
/obj/machinery/porta_turret/proc/isLocked(mob/user)
if(ailock && user.isSilicon())
@@ -276,18 +292,6 @@
user << "You remove the turret but did not manage to salvage anything."
qdel(src) // qdel
- if(istype(I, /obj/item/weapon/card/emag) && !emagged)
- //Emagging the turret makes it go bonkers and stun everyone. It also makes
- //the turret shoot much, much faster.
- user << "You short out [src]'s threat assessment circuits."
- visible_message("[src] hums oddly...")
- emagged = 1
- iconholder = 1
- controllock = 1
- enabled = 0 //turns off the turret temporarily
- sleep(60) //6 seconds for the traitor to gtfo of the area before the turret decides to ruin his shit
- enabled = 1 //turns it back on. The cover popUp() popDown() are automatically called in process(), no need to define it here
-
else if((istype(I, /obj/item/weapon/wrench)))
if(enabled || raised)
user << "You cannot unsecure an active turret!"
@@ -310,17 +314,13 @@
if(!anchored)
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
anchored = 1
- invisibility = INVISIBILITY_LEVEL_TWO
update_icon()
user << "You secure the exterior bolts on the turret."
- create_cover()
else if(anchored)
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
anchored = 0
user << "You unsecure the exterior bolts on the turret."
- invisibility = 0
update_icon()
- qdel(cover) //deletes the cover, and the turret instance itself becomes its own cover.
wrenching = 0
else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
@@ -343,8 +343,27 @@
sleep(60)
attacked = 0
..()
+
+/obj/machinery/porta_turret/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
+ //Emagging the turret makes it go bonkers and stun everyone. It also makes
+ //the turret shoot much, much faster.
+ user << "You short out [src]'s threat assessment circuits."
+ visible_message("[src] hums oddly...")
+ emagged = 1
+ iconholder = 1
+ controllock = 1
+ enabled = 0 //turns off the turret temporarily
+ sleep(60) //6 seconds for the traitor to gtfo of the area before the turret decides to ruin his shit
+ enabled = 1 //turns it back on. The cover popUp() popDown() are automatically called in process(), no need to define it here
+ return 1
/obj/machinery/porta_turret/proc/take_damage(var/force)
+ if(!raised && !raising)
+ force = force / 8
+ if(force < 5)
+ return
+
health -= force
if (force > 5 && prob(45))
spark_system.start()
@@ -352,7 +371,6 @@
die() //the death process :(
/obj/machinery/porta_turret/bullet_act(obj/item/projectile/Proj)
-
if(Proj.damage_type == HALLOSS)
return
@@ -381,48 +399,34 @@
emagged = 1
enabled=0
- sleep(rand(60,600))
- if(!enabled)
- enabled=1
+ spawn(rand(60,600))
+ if(!enabled)
+ enabled=1
..()
/obj/machinery/porta_turret/ex_act(severity)
switch (severity)
if (1)
+ del(src)
qdel(src)
if (2)
if (prob(25))
qdel(src)
else
- take_damage(150) //should instakill most turrets
+ take_damage(initial(health) * 8) //should instakill most turrets
if (3)
- take_damage(50)
+ take_damage(initial(health) * 8 / 3)
/obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0
health = 0
- density = 0
stat |= BROKEN //enables the BROKEN bit
- invisibility = 0
spark_system.start() //creates some sparks because they look cool
- density = 1
update_icon()
- qdel(cover) //deletes the cover - no need on keeping it there!
-
-/obj/machinery/porta_turret/proc/create_cover()
- if(cover == null && anchored)
- cover = new /obj/machinery/porta_turret_cover(loc) //if the turret has no cover and is anchored, give it a cover
- cover.Parent_Turret = src //assign the cover its Parent_Turret, which would be this (src)
/obj/machinery/porta_turret/process()
//the main machinery process
- if(cover == null && anchored) //if it has no cover and is anchored
- if(stat & BROKEN) //if the turret is borked
- qdel(cover) //delete its cover, assuming it has one. Workaround for a pesky little bug
- else
- create_cover()
-
if(stat & (NOPOWER|BROKEN))
//if the turret has no power or is broken, make the turret pop down if it hasn't already
popDown()
@@ -471,19 +475,23 @@
if(!L)
return TURRET_NOT_TARGET
- // If emagged not even the dead get a rest
- if(emagged)
- return L.stat ? TURRET_SECONDARY_TARGET : TURRET_PRIORITY_TARGET
-
- if(issilicon(L)) // Don't target silica
+ if(!emagged && issilicon(L)) // Don't target silica
return TURRET_NOT_TARGET
- if(L.stat) //if the perp is dead/dying, no need to bother really
+ if(L.stat && !emagged) //if the perp is dead/dying, no need to bother really
return TURRET_NOT_TARGET //move onto next potential victim!
- var/dst = get_dist(src, L) //if it's too far away, why bother?
- if(dst > 7)
- return 0
+ if(get_dist(src, L) > 7) //if it's too far away, why bother?
+ return TURRET_NOT_TARGET
+
+ if(!check_trajectory(L, src)) //check if we have true line of sight
+ return TURRET_NOT_TARGET
+
+ if(emagged) // If emagged not even the dead get a rest
+ return L.stat ? TURRET_SECONDARY_TARGET : TURRET_PRIORITY_TARGET
+
+ if(lethal && locate(/mob/living/silicon/ai) in get_turf(L)) //don't accidentally kill the AI!
+ return TURRET_NOT_TARGET
if(check_synth) //If it's set to attack all non-silicons, target them!
if(L.lying)
@@ -495,6 +503,7 @@
if(isanimal(L) || issmall(L)) // Animals are not so dangerous
return check_anomalies ? TURRET_SECONDARY_TARGET : TURRET_NOT_TARGET
+
if(isxenomorph(L) || isalien(L)) // Xenos are dangerous
return check_anomalies ? TURRET_PRIORITY_TARGET : TURRET_NOT_TARGET
@@ -514,7 +523,7 @@
if(emagged)
return 10
- return H.assess_perp(src, check_weapons, check_records, check_arrest)
+ return H.assess_perp(src, check_access, check_weapons, check_records, check_arrest)
/obj/machinery/porta_turret/proc/tryToShootAt(var/list/mob/living/targets)
if(targets.len && last_target && (last_target in targets) && target(last_target))
@@ -534,14 +543,16 @@
return
if(stat & BROKEN)
return
- invisibility = 0
- raising = 1
- flick("popup", cover)
+ set_raised_raising(raised, 1)
+ update_icon()
+
+ var/atom/flick_holder = PoolOrNew(/atom/movable/porta_turret_cover, loc)
+ flick_holder.layer = layer + 0.1
+ flick("popup", flick_holder)
sleep(10)
- raising = 0
- cover.icon_state = "openTurretCover"
- raised = 1
- layer = 4
+ qdel(flick_holder)
+
+ set_raised_raising(1, 0)
update_icon()
/obj/machinery/porta_turret/proc/popDown() //pops the turret down
@@ -552,16 +563,23 @@
return
if(stat & BROKEN)
return
- layer = 3
- raising = 1
- flick("popdown", cover)
- sleep(10)
- raising = 0
- cover.icon_state = "turretCover"
- raised = 0
- invisibility = INVISIBILITY_LEVEL_TWO
+ set_raised_raising(raised, 1)
update_icon()
+ var/atom/flick_holder = PoolOrNew(/atom/movable/porta_turret_cover, loc)
+ flick_holder.layer = layer + 0.1
+ flick("popdown", flick_holder)
+ sleep(10)
+ qdel(flick_holder)
+
+ set_raised_raising(0, 0)
+ update_icon()
+
+/obj/machinery/porta_turret/proc/set_raised_raising(var/raised, var/raising)
+ src.raised = raised
+ src.raising = raising
+ density = raised || raising
+
/obj/machinery/porta_turret/proc/target(var/mob/living/target)
if(disabled)
return
@@ -593,7 +611,6 @@
if(!raised) //the turret has to be raised in order to fire - makes sense, right?
return
-
update_icon()
var/obj/item/projectile/A
if(emagged || lethal)
@@ -608,6 +625,14 @@
// Emagged turrets again use twice as much power due to higher firing rates
use_power(reqpower * (2 * (emagged || lethal)) * (2 * emagged))
+ //Turrets aim for the center of mass by default.
+ //If the target is grabbing someone then the turret smartly aims for extremities
+ var/obj/item/weapon/grab/G = locate() in target
+ if(G && G.state >= GRAB_NECK) //works because mobs are currently not allowed to upgrade to NECK if they are grabbing two people.
+ A.def_zone = pick("head", "l_hand", "r_hand", "l_foot", "r_foot", "l_arm", "r_arm", "l_leg", "r_leg")
+ else
+ A.def_zone = pick("chest", "groin")
+
//Shooting Code:
A.current = T
A.starting = T
@@ -680,8 +705,8 @@
return
if(1)
- if(istype(I, /obj/item/stack/material/steel))
- var/obj/item/stack/material/steel/M = I
+ if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/M = I
if(M.use(2))
user << "You add some metal armor to the interior frame."
build_step = 2
@@ -772,8 +797,8 @@
//attack_hand() removes the prox sensor
if(6)
- if(istype(I, /obj/item/stack/material/steel))
- var/obj/item/stack/material/steel/M = I
+ if(istype(I, /obj/item/stack/material) && I.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/M = I
if(M.use(2))
user << "You add some metal armor to the exterior frame."
build_step = 7
@@ -809,9 +834,6 @@
Turret.enabled = 0
Turret.setup()
-// Turret.cover=new/obj/machinery/porta_turret_cover(loc)
-// Turret.cover.Parent_Turret=Turret
-// Turret.cover.name = finish_name
qdel(src) // qdel
else if(istype(I, /obj/item/weapon/crowbar))
@@ -830,6 +852,7 @@
finish_name = t
return
+
..()
@@ -855,32 +878,5 @@
/obj/machinery/porta_turret_construct/attack_ai()
return
-
-/************************
-* PORTABLE TURRET COVER *
-************************/
-
-/obj/machinery/porta_turret_cover
- name = "turret"
+/atom/movable/porta_turret_cover
icon = 'icons/obj/turrets.dmi'
- icon_state = "turretCover"
- anchored = 1
- layer = 3.5
- density = 0
- var/obj/machinery/porta_turret/Parent_Turret = null
-
-/obj/machinery/porta_turret_cover/Destroy()
- Parent_Turret = null
- ..()
-
-/obj/machinery/porta_turret_cover/attack_ai(mob/user)
- return attack_hand(user)
-
-/obj/machinery/porta_turret_cover/attack_hand(mob/user)
- return Parent_Turret.attack_hand(user)
-
-/obj/machinery/porta_turret_cover/Topic(href, href_list)
- Parent_Turret.Topic(href, href_list, 1) // Calling another object's Topic requires that we claim to not have a window, otherwise BYOND's base proc will runtime.
-
-/obj/machinery/porta_turret_cover/attackby(obj/item/I, mob/user)
- Parent_Turret.attackby(I, user)
diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm
index e86a5c771f..992a93c40a 100644
--- a/code/game/machinery/recharger.dm
+++ b/code/game/machinery/recharger.dm
@@ -13,6 +13,7 @@ obj/machinery/recharger
var/icon_state_charged = "recharger2"
var/icon_state_charging = "recharger1"
var/icon_state_idle = "recharger0" //also when unpowered
+ var/portable = 1
obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
if(istype(user,/mob/living/silicon))
@@ -27,8 +28,7 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
user << "\A [charging] is already charging here."
return
// Checks to make sure he's not in space doing it, and that the area got proper power.
- var/area/a = get_area(src)
- if(!isarea(a) || (a.power_equip == 0 && !a.unlimited_power))
+ if(!powered())
user << "The [name] blinks red as you try to insert the item!"
return
if (istype(G, /obj/item/weapon/gun/energy/gun/nuclear) || istype(G, /obj/item/weapon/gun/energy/crossbow))
@@ -45,7 +45,7 @@ obj/machinery/recharger/attackby(obj/item/weapon/G as obj, mob/user as mob)
G.loc = src
charging = G
update_icon()
- else if(istype(G, /obj/item/weapon/wrench))
+ else if(portable && istype(G, /obj/item/weapon/wrench))
if(charging)
user << "Remove [charging] first!"
return
@@ -155,3 +155,4 @@ obj/machinery/recharger/wallcharger
icon_state_charged = "wrecharger2"
icon_state_charging = "wrecharger1"
icon_state_idle = "wrecharger0"
+ portable = 0
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 98cc92380c..c20ca8468a 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -1,22 +1,25 @@
/obj/machinery/recharge_station
name = "cyborg recharging station"
+ desc = "A heavy duty rapid charging system, designed to quickly recharge cyborg power reserves."
icon = 'icons/obj/objects.dmi'
icon_state = "borgcharger0"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 50
- active_power_usage = 50
var/mob/occupant = null
var/obj/item/weapon/cell/cell = null
- //var/max_internal_charge = 15000 // Two charged borgs in a row with default cell
- //var/current_internal_charge = 15000 // Starts charged, to prevent power surges on round start
- var/charging_cap_active = 1000 // Active Cap - When cyborg is inside
- var/charging_cap_passive = 250 // Passive Cap - Recharging internal capacitor when no cyborg is inside
- var/icon_update_tick = 0 // Used to update icon only once every 10 ticks
- var/charge_rate = 250 // How much charge is restored per tick
- var/weld_rate = 0 // How much brute damage is repaired per tick
- var/wire_rate = 0 // How much burn damage is repaired per tick
+ var/icon_update_tick = 0 // Used to rebuild the overlay only once every 10 ticks
+ var/charging = 0
+
+ var/charging_power // W. Power rating used for charging the cyborg. 120 kW if un-upgraded
+ var/restore_power_active // W. Power drawn from APC when an occupant is charging. 40 kW if un-upgraded
+ var/restore_power_passive // W. Power drawn from APC when idle. 7 kW if un-upgraded
+ var/weld_rate = 0 // How much brute damage is repaired per tick
+ var/wire_rate = 0 // How much burn damage is repaired per tick
+
+ var/weld_power_use = 2300 // power used per point of brute damage repaired. 2.3 kW ~ about the same power usage of a handheld arc welder
+ var/wire_power_use = 500 // power used per point of burn damage repaired.
/obj/machinery/recharge_station/New()
..()
@@ -30,51 +33,76 @@
component_parts += new /obj/item/weapon/cell/high(src)
component_parts += new /obj/item/stack/cable_coil(src, 5)
- build_icon()
+ RefreshParts()
+
update_icon()
- RefreshParts()
+/obj/machinery/recharge_station/proc/has_cell_power()
+ return cell && cell.percent() > 0
/obj/machinery/recharge_station/process()
if(stat & (BROKEN))
return
-
- if((stat & (NOPOWER)) && (!cell || cell.percent() <= 0)) // No Power.
- return
-
- var/chargemode = 0
- if(occupant)
- process_occupant()
- chargemode = 1
- // Power Stuff
-
if(!cell) // Shouldn't be possible, but sanity check
return
- if(stat & NOPOWER)
- cell.use(50 * CELLRATE) // Internal Circuitry, 50W load. No power - Runs from internal cell
- return // No external power = No charging
+ if((stat & NOPOWER) && !has_cell_power()) // No power and cell is dead.
+ if(icon_update_tick)
+ icon_update_tick = 0 //just rebuild the overlay once more only
+ update_icon()
+ return
- // Calculating amount of power to draw
- var/charge_diff = (chargemode ? charging_cap_active : charging_cap_passive) + 50 // 50W for circuitry
+ //First, draw from the internal power cell to recharge/repair/etc the occupant
+ if(occupant)
+ process_occupant()
- charge_diff = cell.give(charge_diff)
+ //Then, if external power is available, recharge the internal cell
+ var/recharge_amount = 0
+ if(!(stat & NOPOWER))
+ // Calculating amount of power to draw
+ recharge_amount = (occupant ? restore_power_active : restore_power_passive) * CELLRATE
- if(idle_power_usage != charge_diff) // Force update, but only when our power usage changed this tick.
- idle_power_usage = charge_diff
- update_use_power(1, 1)
+ recharge_amount = cell.give(recharge_amount)
+ use_power(recharge_amount / CELLRATE)
if(icon_update_tick >= 10)
- update_icon()
icon_update_tick = 0
else
icon_update_tick++
+ if(occupant || recharge_amount)
+ update_icon()
+
+//since the recharge station can still be on even with NOPOWER. Instead it draws from the internal cell.
+/obj/machinery/recharge_station/auto_use_power()
+ if(!(stat & NOPOWER))
+ return ..()
+
+ if(!has_cell_power())
+ return 0
+ if(src.use_power == 1)
+ cell.use(idle_power_usage * CELLRATE)
+ else if(src.use_power >= 2)
+ cell.use(active_power_usage * CELLRATE)
return 1
+//Processes the occupant, drawing from the internal power cell if needed.
+/obj/machinery/recharge_station/proc/process_occupant()
+ if(istype(occupant, /mob/living/silicon/robot))
+ var/mob/living/silicon/robot/R = occupant
-/obj/machinery/recharge_station/allow_drop()
- return 0
+ if(R.module)
+ R.module.respawn_consumable(R, charging_power * CELLRATE / 250) //consumables are magical, apparently
+ if(R.cell && !R.cell.fully_charged())
+ var/diff = min(R.cell.maxcharge - R.cell.charge, charging_power * CELLRATE) // Capped by charging_power / tick
+ var/charge_used = cell.use(diff)
+ R.cell.give(charge_used)
+
+ //Lastly, attempt to repair the cyborg if enabled
+ if(weld_rate && R.getBruteLoss() && cell.checked_use(weld_power_use * weld_rate * CELLRATE))
+ R.adjustBruteLoss(-weld_rate)
+ if(wire_rate && R.getFireLoss() && cell.checked_use(wire_power_use * wire_rate * CELLRATE))
+ R.adjustFireLoss(-wire_rate)
/obj/machinery/recharge_station/examine(mob/user)
..(user)
@@ -92,9 +120,6 @@
return
/obj/machinery/recharge_station/emp_act(severity)
- if(stat & (BROKEN|NOPOWER))
- ..(severity)
- return
if(occupant)
occupant.emp_act(severity)
go_out()
@@ -125,13 +150,20 @@
man_rating += P.rating
cell = locate(/obj/item/weapon/cell) in component_parts
- charge_rate = 125 * cap_rating
- charging_cap_passive = charge_rate
+ charging_power = 40000 + 40000 * cap_rating
+ restore_power_active = 10000 + 15000 * cap_rating
+ restore_power_passive = 5000 + 1000 * cap_rating
weld_rate = max(0, man_rating - 3)
wire_rate = max(0, man_rating - 5)
-/obj/machinery/recharge_station/update_icon()
- ..()
+ desc = initial(desc)
+ desc += " Uses a dedicated internal power cell to deliver [charging_power]W when in use."
+ if(weld_rate)
+ desc += " It is capable of repairing structural damage."
+ if(wire_rate)
+ desc += " It is capable of repairing burn damage."
+
+/obj/machinery/recharge_station/proc/build_overlays()
overlays.Cut()
switch(round(chargepercentage()))
if(1 to 20)
@@ -147,53 +179,33 @@
if(99 to 110)
overlays += image('icons/obj/objects.dmi', "statn_c100")
-/obj/machinery/recharge_station/Bumped(var/mob/AM)
- move_inside(AM)
+/obj/machinery/recharge_station/update_icon()
+ ..()
+ if(stat & BROKEN)
+ icon_state = "borgcharger0"
+ return
-/obj/machinery/recharge_station/proc/build_icon()
- if(NOPOWER|BROKEN)
- if(occupant)
- icon_state = "borgcharger1"
+ if(occupant)
+ if((stat & NOPOWER) && !has_cell_power())
+ icon_state = "borgcharger2"
else
- icon_state = "borgcharger0"
+ icon_state = "borgcharger1"
else
icon_state = "borgcharger0"
-/obj/machinery/recharge_station/proc/process_occupant()
- if(occupant)
- if(istype(occupant, /mob/living/silicon/robot))
- var/mob/living/silicon/robot/R = occupant
- if(R.module)
- R.module.respawn_consumable(R, charge_rate / 250)
- if(!R.cell)
- return
- if(!R.cell.fully_charged())
- var/diff = min(R.cell.maxcharge - R.cell.charge, charge_rate) // Capped at charge_rate charge / tick
- if (cell.charge >= diff)
- cell.use(diff)
- R.cell.give(diff)
- if(weld_rate && R.getBruteLoss())
- R.adjustBruteLoss(-1)
- if(wire_rate && R.getFireLoss())
- R.adjustFireLoss(-1)
- else if(istype(occupant, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = occupant
- if(!isnull(H.internal_organs_by_name["cell"]) && H.nutrition < 450)
- H.nutrition = min(H.nutrition+10, 450)
- update_use_power(1)
+ if(icon_update_tick == 0)
+ build_overlays()
+
+/obj/machinery/recharge_station/Bumped(var/mob/AM)
+ move_inside(AM)
/obj/machinery/recharge_station/proc/go_out()
if(!(occupant))
return
- //for(var/obj/O in src)
- // O.loc = loc
- if(occupant.client)
- occupant.client.eye = occupant.client.mob
- occupant.client.perspective = MOB_PERSPECTIVE
occupant.loc = loc
+ occupant.reset_view()
occupant = null
- build_icon()
- update_use_power(1)
+ update_icon()
return
/obj/machinery/recharge_station/verb/move_eject()
@@ -205,49 +217,26 @@
add_fingerprint(usr)
return
-/obj/machinery/recharge_station/verb/move_inside(var/mob/user = usr)
+/obj/machinery/recharge_station/verb/move_inside()
set category = "Object"
set src in oview(1)
- if(!user)
+ if(usr.stat == DEAD)
+ return
+ if(occupant)
+ usr << "\The [src] is already occupied!"
return
- var/can_accept_user
- if(istype(user, /mob/living/silicon/robot))
-
- var/mob/living/silicon/robot/R = user
-
- if(R.stat == 2)
- //Whoever had it so that a borg with a dead cell can't enter this thing should be shot. --NEO
- return
- if(occupant)
- R << "The cell is already occupied!"
- return
- if(!R.cell)
- R << "Without a powercell, you can't be recharged."
- //Make sure they actually HAVE a cell, now that they can get in while powerless. --NEO
- return
- can_accept_user = 1
-
- else if(istype(user, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = user
- if(!isnull(H.internal_organs_by_name["cell"]))
- can_accept_user = 1
-
- if(!can_accept_user)
- user << "Only non-organics may enter the recharger!"
+ var/mob/living/silicon/robot/R = usr
+ if(!istype(R))
+ usr << "Only synthetics may enter the recharger!"
+ return
+ if(!R.cell)
+ usr << "Without a powercell, you can't be recharged."
return
-
- user.stop_pulling()
- if(user.client)
- user.client.perspective = EYE_PERSPECTIVE
- user.client.eye = src
- user.loc = src
- occupant = user
- /*for(var/obj/O in src)
- O.loc = loc*/
- add_fingerprint(user)
- build_icon()
- update_use_power(1)
- return
+ usr.reset_view(src)
+ usr.loc = src
+ occupant = usr
+ add_fingerprint(usr)
+ update_icon()
diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm
index b2461f1d7f..4c44bcd4ee 100644
--- a/code/game/machinery/robot_fabricator.dm
+++ b/code/game/machinery/robot_fabricator.dm
@@ -12,8 +12,8 @@
active_power_usage = 10000
/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if (istype(O, /obj/item/stack/material/steel))
- var/obj/item/stack/material/steel/M = O
+ if (istype(O, /obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/M = O
if (src.metal_amount < 150000.0)
var/count = 0
src.overlays += "fab-load-metal"
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index e882373359..ad88ce7fea 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -32,6 +32,11 @@
user << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
return
+/obj/machinery/space_heater/powered()
+ if(cell && cell.charge)
+ return 1
+ return 0
+
/obj/machinery/space_heater/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
@@ -56,6 +61,7 @@
C.add_fingerprint(usr)
user.visible_message("[user] inserts a power cell into [src].", "You insert the power cell into [src].")
+ power_change()
else
user << "The hatch must be open to insert a power cell."
return
@@ -125,6 +131,7 @@
usr.put_in_hands(cell)
cell.add_fingerprint(usr)
cell = null
+ power_change()
if("cellinstall")
@@ -135,7 +142,7 @@
cell = C
C.loc = src
C.add_fingerprint(usr)
-
+ power_change()
usr.visible_message("[usr] inserts \the [C] into \the [src].", "You insert \the [C] into \the [src].")
updateDialog()
@@ -176,4 +183,5 @@
env.merge(removed)
else
on = 0
+ power_change()
update_icon()
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index cb487ae58c..ac561009b6 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -684,7 +684,7 @@
user << "There is no room inside the cycler for [G.affecting.name]."
return
- visible_message("[user] starts putting [G.affecting.name] into the suit cycler.", 3)
+ visible_message("[user] starts putting [G.affecting.name] into the suit cycler.", 3)
if(do_after(user, 20))
if(!G || !G.affecting) return
@@ -708,24 +708,6 @@
src.updateUsrDialog()
return
- else if(istype(I,/obj/item/weapon/card/emag))
-
- if(emagged)
- user << "The cycler has already been subverted."
- return
-
- var/obj/item/weapon/card/emag/E = I
- src.updateUsrDialog()
- E.uses--
-
- //Clear the access reqs, disable the safeties, and open up all paintjobs.
- user << "You run the sequencer across the interface, corrupting the operating protocols."
- departments = list("Engineering","Mining","Medical","Security","Atmos","^%###^%$")
- emagged = 1
- safeties = 0
- req_access = list()
- return
-
else if(istype(I,/obj/item/clothing/head/helmet/space) && !istype(I, /obj/item/clothing/head/helmet/space/rig))
if(locked)
@@ -773,6 +755,20 @@
return
..()
+
+/obj/machinery/suit_cycler/emag_act(var/remaining_charges, var/mob/user)
+ if(emagged)
+ user << "The cycler has already been subverted."
+ return
+
+ //Clear the access reqs, disable the safeties, and open up all paintjobs.
+ user << "You run the sequencer across the interface, corrupting the operating protocols."
+ departments = list("Engineering","Mining","Medical","Security","Atmos","^%###^%$")
+ emagged = 1
+ safeties = 0
+ req_access = list()
+ src.updateUsrDialog()
+ return 1
/obj/machinery/suit_cycler/attack_hand(mob/user as mob)
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index fb4a03d21f..99d713cccb 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -71,7 +71,7 @@
/obj/machinery/syndicate_beacon/proc/selfdestruct()
selfdestructing = 1
- spawn() explosion(src.loc, rand(3,8), rand(1,3), 1, 10)
+ spawn() explosion(src.loc, 1, rand(1,3), rand(3,8), 10)
////////////////////////////////////////
//Singularity beacon
diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm
index c6fee28b40..820d09045b 100644
--- a/code/game/machinery/telecomms/broadcaster.dm
+++ b/code/game/machinery/telecomms/broadcaster.dm
@@ -353,7 +353,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
// --- This following recording is intended for research and feedback in the use of department radio channels ---
var/part_blackbox_b = " \[[freq_text]\]" // Tweaked for security headsets -- TLE
- var/blackbox_msg = "[part_a][name][part_blackbox_b][quotedmsg][part_c]"
+ var/blackbox_msg = "[part_a][name][part_blackbox_b][quotedmsg][part_c]"
//var/blackbox_admin_msg = "[part_a][M.name] (Real name: [M.real_name])[part_blackbox_b][quotedmsg][part_c]"
//BR.messages_admin += blackbox_admin_msg
@@ -533,12 +533,15 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/part_b = " \icon[radio]\[[freq_text]\][part_b_extra]" // Tweaked for security headsets -- TLE
var/part_c = ""
+ part_a = ""
+ part_a += "syndradio"
else if (display_freq==COMM_FREQ)
- part_a = ""
+ part_a += "comradio"
else if (display_freq in DEPT_FREQS)
- part_a = ""
+ part_a += "deptradio"
+
+ part_a += "'>"
// --- This following recording is intended for research and feedback in the use of department radio channels ---
diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm
index ef3c7d6ea9..2f6165a733 100644
--- a/code/game/machinery/telecomms/logbrowser.dm
+++ b/code/game/machinery/telecomms/logbrowser.dm
@@ -212,9 +212,13 @@
A.icon_state = "4"
A.anchored = 1
qdel(src)
- else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
- playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
- emagged = 1
- user << "You you disable the security protocols"
src.updateUsrDialog()
return
+
+/obj/machinery/computer/telecomms/server/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
+ playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
+ emagged = 1
+ user << "You you disable the security protocols"
+ src.updateUsrDialog()
+ return 1
diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm
index 35c2ecdc1f..f91fd2d40c 100644
--- a/code/game/machinery/telecomms/presets.dm
+++ b/code/game/machinery/telecomms/presets.dm
@@ -40,8 +40,8 @@
id = "Hub"
network = "tcommsat"
autolinkers = list("hub", "relay", "c_relay", "s_relay", "m_relay", "r_relay", "science", "medical",
- "supply", "service", "common", "command", "engineering", "security",
- "receiverA", "receiverB", "broadcasterA", "broadcasterB")
+ "supply", "service", "common", "command", "engineering", "security", "unused",
+ "receiverA", "broadcasterA")
/obj/machinery/telecomms/hub/preset_cent
id = "CentComm Hub"
@@ -52,22 +52,11 @@
//Receivers
-//--PRESET LEFT--//
-
-/obj/machinery/telecomms/receiver/preset_left
+/obj/machinery/telecomms/receiver/preset_right
id = "Receiver A"
network = "tcommsat"
autolinkers = list("receiverA") // link to relay
- freq_listening = list(SCI_FREQ, MED_FREQ, SUP_FREQ, SRV_FREQ) // science, medical, supply, service
-
-
-//--PRESET RIGHT--//
-
-/obj/machinery/telecomms/receiver/preset_right
- id = "Receiver B"
- network = "tcommsat"
- autolinkers = list("receiverB") // link to relay
- freq_listening = list(COMM_FREQ, ENG_FREQ, SEC_FREQ) //command, engineering, security
+ freq_listening = list(SCI_FREQ, MED_FREQ, SUP_FREQ, SRV_FREQ, COMM_FREQ, ENG_FREQ, SEC_FREQ)
//Common and other radio frequencies for people to freely use
New()
@@ -95,7 +84,14 @@
id = "Bus 2"
network = "tcommsat"
freq_listening = list(SUP_FREQ, SRV_FREQ)
- autolinkers = list("processor2", "supply", "service")
+ autolinkers = list("processor2", "supply", "service", "unused")
+
+/obj/machinery/telecomms/bus/preset_two/New()
+ for(var/i = 1441, i < 1489, i += 2)
+ if(i == AI_FREQ || i == PUB_FREQ)
+ continue
+ freq_listening |= i
+ ..()
/obj/machinery/telecomms/bus/preset_three
id = "Bus 3"
@@ -106,14 +102,9 @@
/obj/machinery/telecomms/bus/preset_four
id = "Bus 4"
network = "tcommsat"
- freq_listening = list(ENG_FREQ)
+ freq_listening = list(ENG_FREQ, AI_FREQ, PUB_FREQ)
autolinkers = list("processor4", "engineering", "common")
-/obj/machinery/telecomms/bus/preset_four/New()
- for(var/i = 1441, i < 1489, i += 2)
- freq_listening |= i
- ..()
-
/obj/machinery/telecomms/bus/preset_cent
id = "CentComm Bus"
network = "tcommsat"
@@ -169,7 +160,7 @@
id = "Supply Server"
freq_listening = list(SUP_FREQ)
autolinkers = list("supply")
-
+
/obj/machinery/telecomms/server/presets/service
id = "Service Server"
freq_listening = list(SRV_FREQ)
@@ -177,13 +168,19 @@
/obj/machinery/telecomms/server/presets/common
id = "Common Server"
- freq_listening = list()
+ freq_listening = list(PUB_FREQ, AI_FREQ) // AI Private and Common
autolinkers = list("common")
- //Common and other radio frequencies for people to freely use
- // 1441 to 1489
-/obj/machinery/telecomms/server/presets/common/New()
+// "Unused" channels, AKA all others.
+/obj/machinery/telecomms/server/presets/unused
+ id = "Unused Server"
+ freq_listening = list()
+ autolinkers = list("unused")
+
+/obj/machinery/telecomms/server/presets/unused/New()
for(var/i = 1441, i < 1489, i += 2)
+ if(i == AI_FREQ || i == PUB_FREQ)
+ continue
freq_listening |= i
..()
@@ -213,18 +210,11 @@
//--PRESET LEFT--//
-/obj/machinery/telecomms/broadcaster/preset_left
+/obj/machinery/telecomms/broadcaster/preset_right
id = "Broadcaster A"
network = "tcommsat"
autolinkers = list("broadcasterA")
-//--PRESET RIGHT--//
-
-/obj/machinery/telecomms/broadcaster/preset_right
- id = "Broadcaster B"
- network = "tcommsat"
- autolinkers = list("broadcasterB")
-
/obj/machinery/telecomms/broadcaster/preset_cent
id = "CentComm Broadcaster"
network = "tcommsat"
diff --git a/code/game/machinery/telecomms/telemonitor.dm b/code/game/machinery/telecomms/telemonitor.dm
index ca132cc06e..7dd30dd8c3 100644
--- a/code/game/machinery/telecomms/telemonitor.dm
+++ b/code/game/machinery/telecomms/telemonitor.dm
@@ -150,9 +150,13 @@
A.icon_state = "4"
A.anchored = 1
qdel(src)
- else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
- playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
- emagged = 1
- user << "You you disable the security protocols"
src.updateUsrDialog()
return
+
+/obj/machinery/computer/telecomms/monitor/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
+ playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
+ emagged = 1
+ user << "You you disable the security protocols"
+ src.updateUsrDialog()
+ return 1
diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm
index 6917675653..1123733103 100644
--- a/code/game/machinery/telecomms/traffic_control.dm
+++ b/code/game/machinery/telecomms/traffic_control.dm
@@ -233,9 +233,13 @@
A.icon_state = "4"
A.anchored = 1
qdel(src)
- else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
- playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
- emagged = 1
- user << "You you disable the security protocols"
src.updateUsrDialog()
return
+
+/obj/machinery/computer/telecomms/traffic/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
+ playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
+ emagged = 1
+ user << "You you disable the security protocols"
+ src.updateUsrDialog()
+ return 1
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index 943242d409..77667fa6bc 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -84,13 +84,6 @@
if(stat & BROKEN)
return
- if(!emagged && istype(W, /obj/item/weapon/card/emag))
- user << "You short out the turret controls' access analysis module."
- emagged = 1
- locked = 0
- ailock = 0
- return
-
if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if(src.allowed(usr))
if(emagged)
@@ -100,6 +93,14 @@
user << "You [ locked ? "lock" : "unlock"] the panel."
return
return ..()
+
+/obj/machinery/turretid/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
+ user << "You short out the turret controls' access analysis module."
+ emagged = 1
+ locked = 0
+ ailock = 0
+ return 1
/obj/machinery/turretid/attack_ai(mob/user as mob)
if(isLocked(user))
@@ -217,9 +218,9 @@
enabled=0
updateTurrets()
- sleep(rand(60,600))
- if(!enabled)
- enabled=1
- updateTurrets()
+ spawn(rand(60,600))
+ if(!enabled)
+ enabled=1
+ updateTurrets()
..()
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index a3ac073a90..db548443ca 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -266,6 +266,15 @@
else
A = new /obj/item/projectile/energy/electrode( loc )
use_power(200)
+
+ //Turrets aim for the center of mass by default.
+ //If the target is grabbing someone then the turret smartly aims for extremities
+ var/obj/item/weapon/grab/G = locate() in target
+ if(G && G.state >= GRAB_NECK) //works because mobs are currently not allowed to upgrade to NECK if they are grabbing two people.
+ A.def_zone = pick("head", "l_hand", "r_hand", "l_foot", "r_foot", "l_arm", "r_arm", "l_leg", "r_leg")
+ else
+ A.def_zone = pick("chest", "groin")
+
A.current = T
A.starting = T
A.yo = U.y - T.y
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 43d0f107c0..9c79441f32 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -176,6 +176,12 @@
return
return
+
+/obj/machinery/vending/emag_act(var/remaining_charges, var/mob/user)
+ if (!emagged)
+ src.emagged = 1
+ user << "You short out the product lock on \the [src]"
+ return 1
/obj/machinery/vending/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -207,10 +213,6 @@
if (I || istype(W, /obj/item/weapon/spacecash))
attack_hand(user)
return
- else if (istype(W, /obj/item/weapon/card/emag))
- src.emagged = 1
- user << "You short out the product lock on \the [src]"
- return
else if(istype(W, /obj/item/weapon/screwdriver))
src.panel_open = !src.panel_open
user << "You [src.panel_open ? "open" : "close"] the maintenance panel."
@@ -592,7 +594,7 @@
return
for(var/mob/O in hearers(src, null))
- O.show_message("\The [src] beeps, \"[message]\"",2)
+ O.show_message("\The [src] beeps, \"[message]\"",2)
return
/obj/machinery/vending/power_change()
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
index 7f9bedbd9d..c9182586c8 100644
--- a/code/game/machinery/wall_frames.dm
+++ b/code/game/machinery/wall_frames.dm
@@ -7,6 +7,7 @@
var/build_machine_type
var/refund_amt = 2
var/refund_type = /obj/item/stack/material/steel
+ var/reverse = 0 //if resulting object faces opposite its dir (like light fixtures)
/obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/wrench))
@@ -22,21 +23,26 @@
if (get_dist(on_wall,usr)>1)
return
- var/ndir = get_dir(on_wall,usr)
+ var/ndir
+ if(reverse)
+ ndir = get_dir(usr,on_wall)
+ else
+ ndir = get_dir(on_wall,usr)
+
if (!(ndir in cardinal))
return
var/turf/loc = get_turf(usr)
var/area/A = loc.loc
if (!istype(loc, /turf/simulated/floor))
- usr << "\The [src] Alarm cannot be placed on this spot."
return
if (A.requires_power == 0 || A.name == "Space")
- usr << "\The [src] Alarm cannot be placed in this area."
return
if(gotwallitem(loc, ndir))
- usr << ""
+ usr << "There's already an item on this wall!"
return
var/obj/machinery/M = new build_machine_type(loc, ndir, 1)
@@ -61,23 +67,10 @@
icon = 'icons/obj/lighting.dmi'
icon_state = "tube-construct-item"
build_machine_type = /obj/machinery/light_construct
+ reverse = 1
/obj/item/frame/light/small
name = "small light fixture frame"
icon_state = "bulb-construct-item"
refund_amt = 1
build_machine_type = /obj/machinery/light_construct/small
-
-/obj/item/frame/rust
- name = "Fuel Compressor frame"
- icon = 'icons/rust.dmi'
- icon_state = "fuel_compressor0"
- w_class = 4
- refund_type = /obj/item/stack/material/plasteel
- refund_amt = 12
- build_machine_type = /obj/machinery/rust_fuel_compressor
-
-/obj/item/frame/rust/assembly
- name = "Fuel Assembly Port frame"
- icon_state = "port2"
- build_machine_type = /obj/machinery/rust_fuel_assembly_port
diff --git a/code/game/mecha/combat/combat.dm b/code/game/mecha/combat/combat.dm
index 870752abdd..c9c5c32623 100644
--- a/code/game/mecha/combat/combat.dm
+++ b/code/game/mecha/combat/combat.dm
@@ -244,15 +244,6 @@
else
return 0
-/obj/mecha/combat/mmi_moved_inside(var/obj/item/device/mmi/mmi_as_oc as obj,mob/user as mob)
- if(..())
- if(occupant.client)
- occupant.client.mouse_pointer_icon = file("icons/mecha/mecha_mouse.dmi")
- return 1
- else
- return 0
-
-
/obj/mecha/combat/go_out()
if(src.occupant && src.occupant.client)
src.occupant.client.mouse_pointer_icon = initial(src.occupant.client.mouse_pointer_icon)
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index 7ebeb641d8..6cec144132 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -5,8 +5,8 @@
icon_state = "sleeper_0"
origin_tech = list(TECH_DATA = 2, TECH_BIO = 3)
energy_drain = 20
- range = MELEE
- construction_cost = list(DEFAULT_WALL_MATERIAL=5000,"glass"=10000)
+ range = MELEE
+ construction_cost = list(DEFAULT_WALL_MATERIAL=5000,"glass"=10000)
equip_cooldown = 20
var/mob/living/carbon/occupant = null
var/datum/global_iterator/pr_mech_sleeper
@@ -22,12 +22,6 @@
Destroy()
qdel(pr_mech_sleeper)
- ..()
-
- allow_drop()
- return 0
-
- destroy()
for(var/atom/movable/AM in src)
AM.forceMove(get_turf(src))
return ..()
@@ -644,7 +638,7 @@
return stop()
var/energy_drain = S.energy_drain*10
if(!S.processed_reagents.len || S.reagents.total_volume >= S.reagents.maximum_volume || !S.chassis.has_charge(energy_drain))
- S.occupant_message("Reagent processing stopped.")
+ S.occupant_message("Reagent processing stopped.")
S.log_message("Reagent processing stopped.")
return stop()
var/amount = S.synth_speed / S.processed_reagents.len
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index 284bce3a33..91e544cf25 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -1052,7 +1052,7 @@
if(M.stat>1) return
if(chassis.occupant.a_intent == I_HURT)
chassis.occupant_message("You obliterate [target] with [src.name], leaving blood and guts everywhere.")
- chassis.visible_message("[chassis] destroys [target] in an unholy fury.")
+ chassis.visible_message("[chassis] destroys [target] in an unholy fury.")
if(chassis.occupant.a_intent == I_DISARM)
chassis.occupant_message("You tear [target]'s limbs off with [src.name].")
chassis.visible_message("[chassis] rips [target]'s arms off.")
@@ -1078,9 +1078,6 @@
var/door_locked = 1
salvageable = 0
-/obj/item/mecha_parts/mecha_equipment/tool/passenger/allow_drop()
- return 0
-
/obj/item/mecha_parts/mecha_equipment/tool/passenger/destroy()
for(var/atom/movable/AM in src)
AM.forceMove(get_turf(src))
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index 641c86e70e..07c54ceb2b 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -192,27 +192,6 @@
M << "You don't have required permissions to use [src]"
return 0
-
-/obj/machinery/mecha_part_fabricator/proc/emag()
- sleep()
- switch(emagged)
- if(0)
- emagged = 0.5
- src.visible_message("\icon[src] [src] beeps: \"DB error \[Code 0x00F1\]\"")
- sleep(10)
- src.visible_message("\icon[src] [src] beeps: \"Attempting auto-repair\"")
- sleep(15)
- src.visible_message("\icon[src] [src] beeps: \"User DB corrupted \[Code 0x00FA\]. Truncating data structure...\"")
- sleep(30)
- src.visible_message("\icon[src] [src] beeps: \"User DB truncated. Please contact your Nanotrasen system operator for future assistance.\"")
- req_access = null
- emagged = 1
- if(0.5)
- src.visible_message("\icon[src] [src] beeps: \"DB not responding \[Code 0x0003\]...\"")
- if(1)
- src.visible_message("\icon[src] [src] beeps: \"No records in User DB\"")
- return
-
/obj/machinery/mecha_part_fabricator/proc/convert_part_set(set_name as text)
var/list/parts = part_sets[set_name]
if(istype(parts, /list))
@@ -724,7 +703,26 @@
qdel(res)
return result
-
+/obj/machinery/mecha_part_fabricator/emag_act(var/remaining_charges, var/mob/user)
+ sleep()
+ switch(emagged)
+ if(0)
+ emagged = 0.5
+ src.visible_message("\icon[src] [src] beeps: \"DB error \[Code 0x00F1\]\"")
+ sleep(10)
+ src.visible_message("\icon[src] [src] beeps: \"Attempting auto-repair\"")
+ sleep(15)
+ src.visible_message("\icon[src] [src] beeps: \"User DB corrupted \[Code 0x00FA\]. Truncating data structure...\"")
+ sleep(30)
+ src.visible_message("\icon[src] [src] beeps: \"User DB truncated. Please contact your Nanotrasen system operator for future assistance.\"")
+ req_access = null
+ emagged = 1
+ return 1
+ if(0.5)
+ src.visible_message("\icon[src] [src] beeps: \"DB not responding \[Code 0x0003\]...\"")
+ if(1)
+ src.visible_message("\icon[src] [src] beeps: \"No records in User DB\"")
+
/obj/machinery/mecha_part_fabricator/attackby(obj/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/screwdriver))
if (!opened)
@@ -771,10 +769,6 @@
user << "You can't load the [src.name] while it's opened."
return 1
- if(istype(W, /obj/item/weapon/card/emag))
- emag()
- return
-
var/material
switch(W.type)
if(/obj/item/stack/material/gold)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 32fc2e0123..96dda70158 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -686,14 +686,6 @@
/obj/mecha/attackby(obj/item/weapon/W as obj, mob/user as mob)
-
- if(istype(W, /obj/item/device/mmi))
- if(mmi_move_inside(W,user))
- user << "[src]-MMI interface initialized successfuly"
- else
- user << "[src]-MMI interface initialization failed."
- return
-
if(istype(W, /obj/item/mecha_parts/mecha_equipment))
var/obj/item/mecha_parts/mecha_equipment/E = W
spawn()
@@ -1057,65 +1049,6 @@
else
return 0
-/obj/mecha/proc/mmi_move_inside(var/obj/item/device/mmi/mmi_as_oc as obj,mob/user as mob)
- if(!mmi_as_oc.brainmob || !mmi_as_oc.brainmob.client)
- user << "Consciousness matrix not detected."
- return 0
- else if(mmi_as_oc.brainmob.stat)
- user << "Beta-rhythm below acceptable level."
- return 0
- else if(occupant)
- user << "Occupant detected."
- return 0
- else if(dna && dna!=mmi_as_oc.brainmob.dna.unique_enzymes)
- user << "Stop it!"
- return 0
- //Added a message here since people assume their first click failed or something./N
-// user << "Installing MMI, please stand by."
-
- visible_message("[usr] starts to insert an MMI into [src.name]")
-
- if(enter_after(40,user))
- if(!occupant)
- return mmi_moved_inside(mmi_as_oc,user)
- else
- user << "Occupant detected."
- else
- user << "You stop inserting the MMI."
- return 0
-
-/obj/mecha/proc/mmi_moved_inside(var/obj/item/device/mmi/mmi_as_oc as obj,mob/user as mob)
- if(mmi_as_oc && user in range(1))
- if(!mmi_as_oc.brainmob || !mmi_as_oc.brainmob.client)
- user << "Consciousness matrix not detected."
- return 0
- else if(mmi_as_oc.brainmob.stat)
- user << "Beta-rhythm below acceptable level."
- return 0
- user.drop_from_inventory(mmi_as_oc)
- var/mob/brainmob = mmi_as_oc.brainmob
- brainmob.reset_view(src)
- /*
- brainmob.client.eye = src
- brainmob.client.perspective = EYE_PERSPECTIVE
- */
- occupant = brainmob
- brainmob.loc = src //should allow relaymove
- brainmob.canmove = 1
- mmi_as_oc.loc = src
- mmi_as_oc.mecha = src
- src.verbs -= /obj/mecha/verb/eject
- src.Entered(mmi_as_oc)
- src.Move(src.loc)
- src.icon_state = src.reset_icon()
- set_dir(dir_in)
- src.log_message("[mmi_as_oc] moved in as pilot.")
- if(!hasInternalDamage())
- src.occupant << sound('sound/mecha/nominal.ogg',volume=50)
- return 1
- else
- return 0
-
/obj/mecha/verb/view_stats()
set name = "View Stats"
set category = "Exosuit Interface"
diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm
index cd6d1e76d3..5b08b25a5b 100644
--- a/code/game/objects/effects/aliens.dm
+++ b/code/game/objects/effects/aliens.dm
@@ -254,7 +254,7 @@ Alien plants should do something if theres a lot of poison
/obj/effect/alien/weeds/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
- if(exposed_temperature > 300)
+ if(exposed_temperature > 300 + T0C)
health -= 5
healthcheck()
@@ -425,7 +425,7 @@ Alien plants should do something if theres a lot of poison
Burst()
/obj/effect/alien/egg/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
- if(exposed_temperature > 500)
+ if(exposed_temperature > 500 + T0C)
health -= 5
healthcheck()
diff --git a/code/game/objects/effects/chem/chemsmoke.dm b/code/game/objects/effects/chem/chemsmoke.dm
index c579bd5317..3fa93e7e46 100644
--- a/code/game/objects/effects/chem/chemsmoke.dm
+++ b/code/game/objects/effects/chem/chemsmoke.dm
@@ -55,8 +55,10 @@
targetTurfs = new()
- for(var/turf/T in view(range, location)) //build affected area list
- if(cheap_pythag(T.x - location.x, T.y - location.y) <= range) //cull turfs to circle
+ //build affected area list
+ for(var/turf/T in view(range, location))
+ //cull turfs to circle
+ if(sqrt((T.x - location.x)**2 + (T.y - location.y)**2) <= range)
targetTurfs += T
wallList = new()
diff --git a/code/game/objects/effects/chem/foam.dm b/code/game/objects/effects/chem/foam.dm
index fb5b6f8ca7..99a68e1363 100644
--- a/code/game/objects/effects/chem/foam.dm
+++ b/code/game/objects/effects/chem/foam.dm
@@ -39,6 +39,8 @@
if(!metal && reagents)
var/turf/T = get_turf(src)
reagents.touch_turf(T)
+ for(var/obj/O in T)
+ reagents.touch_obj(O)
/obj/effect/effect/foam/process()
if(--amount < 0)
diff --git a/code/game/objects/effects/chem/water.dm b/code/game/objects/effects/chem/water.dm
index eac107923e..9b15464544 100644
--- a/code/game/objects/effects/chem/water.dm
+++ b/code/game/objects/effects/chem/water.dm
@@ -3,6 +3,7 @@
icon = 'icons/effects/effects.dmi'
icon_state = "extinguish"
mouse_opacity = 0
+ pass_flags = PASSTABLE | PASSGRILLE
/obj/effect/effect/water/New(loc)
..()
@@ -30,7 +31,7 @@
else if(ismob(A) && !M)
M = A
if(M)
- reagents.splash_mob(M, reagents.total_volume)
+ reagents.splash(M, reagents.total_volume)
break
if(T == get_turf(target))
break
@@ -53,4 +54,3 @@
name = "chemicals"
icon = 'icons/obj/chempuff.dmi'
icon_state = ""
- pass_flags = PASSTABLE | PASSGRILLE
\ No newline at end of file
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index b81089d9fb..1c723c04ad 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -20,10 +20,12 @@ var/global/list/image/splatter_cache=list()
var/basecolor="#A10808" // Color when wet.
var/list/datum/disease2/disease/virus2 = list()
var/amount = 5
+ var/drytime
/obj/effect/decal/cleanable/blood/Destroy()
for(var/datum/disease/D in viruses)
D.cure(0)
+ processing_objects -= src
return ..()
/obj/effect/decal/cleanable/blood/New()
@@ -38,7 +40,11 @@ var/global/list/image/splatter_cache=list()
if (B.blood_DNA)
blood_DNA |= B.blood_DNA.Copy()
qdel(B)
- spawn(DRYING_TIME * (amount+1))
+ drytime = world.time + DRYING_TIME * (amount+1)
+ processing_objects += src
+
+/obj/effect/decal/cleanable/blood/process()
+ if(world.time > drytime)
dry()
/obj/effect/decal/cleanable/blood/update_icon()
@@ -91,6 +97,7 @@ var/global/list/image/splatter_cache=list()
desc = drydesc
color = adjust_brightness(color, -50)
amount = 0
+ processing_objects -= src
/obj/effect/decal/cleanable/blood/attack_hand(mob/living/carbon/human/user)
..()
@@ -125,8 +132,7 @@ var/global/list/image/splatter_cache=list()
/obj/effect/decal/cleanable/blood/drip/New()
..()
- spawn(1)
- drips |= icon_state
+ drips |= icon_state
/obj/effect/decal/cleanable/blood/writing
icon_state = "tracks"
diff --git a/code/game/objects/effects/explosion_particles.dm b/code/game/objects/effects/explosion_particles.dm
index 90020e5080..e0750ba1c3 100644
--- a/code/game/objects/effects/explosion_particles.dm
+++ b/code/game/objects/effects/explosion_particles.dm
@@ -9,7 +9,7 @@
/obj/effect/expl_particles/New()
..()
spawn (15)
- src.loc = null
+ qdel(src)
return
/obj/effect/expl_particles/Move()
@@ -49,7 +49,7 @@
/obj/effect/explosion/New()
..()
spawn (10)
- src.loc = null
+ qdel(src)
return
/datum/effect/system/explosion
diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm
index aeac044f38..e5f769858f 100644
--- a/code/game/objects/effects/landmarks.dm
+++ b/code/game/objects/effects/landmarks.dm
@@ -88,16 +88,7 @@
return 1
-/obj/effect/landmark/start/ninja
- name = "ninja"
-
-/obj/effect/landmark/start/ninja/New()
- ..()
- ninjastart += loc
- qdel(src)
-
//Costume spawner landmarks
-
/obj/effect/landmark/costume/New() //costume spawner, selects a random subclass and disappears
var/list/options = typesof(/obj/effect/landmark/costume)
diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm
index 38a72f2f99..424f55896b 100644
--- a/code/game/objects/effects/spiders.dm
+++ b/code/game/objects/effects/spiders.dm
@@ -48,7 +48,7 @@
qdel(src)
/obj/effect/spider/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
- if(exposed_temperature > 300)
+ if(exposed_temperature > 300 + T0C)
health -= 5
healthcheck()
diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm
index 05cdbfee1d..c1df6b5454 100644
--- a/code/game/objects/empulse.dm
+++ b/code/game/objects/empulse.dm
@@ -1,3 +1,9 @@
+// Uncomment this define to check for possible lengthy processing of emp_act()s.
+// If emp_act() takes more than defined deciseconds (1/10 seconds) an admin message and log is created.
+// I do not recommend having this uncommented on main server, it probably causes a bit more lag, espicially with larger EMPs.
+
+// #define EMPDEBUG 10
+
proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
if(!epicenter) return
@@ -24,6 +30,9 @@ proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
M << 'sound/effects/EMPulse.ogg'
for(var/atom/T in range(light_range, epicenter))
+ #ifdef EMPDEBUG
+ var/time = world.timeofday
+ #endif
var/distance = get_dist(epicenter, T)
if(distance < 0)
distance = 0
@@ -36,4 +45,8 @@ proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
T.emp_act(2)
else if(distance <= light_range)
T.emp_act(2)
+ #ifdef EMPDEBUG
+ if((world.timeofday - time) >= EMPDEBUG)
+ log_and_message_admins("EMPDEBUG: [T.name] - [T.type] - took [world.timeofday - time]ds to process emp_act()!")
+ #endif
return 1
\ No newline at end of file
diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm
index 6ad69f099b..1b32185ace 100644
--- a/code/game/objects/explosion.dm
+++ b/code/game/objects/explosion.dm
@@ -1,11 +1,5 @@
//TODO: Flash range does nothing currently
-//A very crude linear approximatiaon of pythagoras theorem.
-/proc/cheap_pythag(var/dx, var/dy)
- dx = abs(dx); dy = abs(dy);
- if(dx>=dy) return dx + (0.5*dy) //The longest side add half the shortest side approximates the hypotenuse
- else return dy + (0.5*dx)
-
///// Z-Level Stuff
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = 1)
///// Z-Level Stuff
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 11bf944582..4c5a9dc39b 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -70,7 +70,10 @@
/obj/item/Destroy()
if(ismob(loc))
var/mob/m = loc
- m.unEquip(src, 1)
+ m.drop_from_inventory(src)
+ m.update_inv_r_hand()
+ m.update_inv_l_hand()
+ src.loc = null
return ..()
/obj/item/device
@@ -151,9 +154,9 @@
if (user.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
- user << "You try to move your [temp.name], but cannot!"
+ user << "You try to move your [temp.name], but cannot!"
return
-
+ src.pickup(user)
if (istype(src.loc, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = src.loc
S.remove_from_storage(src)
@@ -167,8 +170,6 @@
return
user.next_move = max(user.next_move+2,world.time + 2)
user.put_in_active_hand(src)
- if(src.loc == user)
- src.pickup(user)
return
/obj/item/attack_ai(mob/user as mob)
@@ -608,3 +609,6 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
/obj/item/proc/pwr_drain()
return 0 // Process Kill
+
+/obj/item/proc/resolve_attackby(atom/A, mob/source)
+ return A.attackby(src,source)
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 4c519b8fc5..31bb9160f8 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -68,7 +68,7 @@
/obj/item/weapon/pen/crayon/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity) return
if(istype(target,/turf/simulated/floor))
- var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter")
+ var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter","arrow")
switch(drawtype)
if("letter")
drawtype = input("Choose the letter.", "Crayon scribbles") in list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
@@ -77,6 +77,9 @@
user << "You start drawing graffiti on the [target.name]."
if("rune")
user << "You start drawing a rune on the [target.name]."
+ if("arrow")
+ drawtype = input("Choose the arrow.", "Crayon scribbles") in list("left", "right", "up", "down")
+ user << "You start drawing an arrow on the [target.name]."
if(instant || do_after(user, 50))
new /obj/effect/decal/cleanable/crayon(target,colour,shadeColour,drawtype)
user << "You finish drawing."
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index 10adef3d88..a01dc224c3 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -1058,6 +1058,21 @@ var/global/list/obj/item/device/pda/PDAs = list()
log_pda("[usr] (PDA: [sending_unit]) sent \"[message]\" to [name]")
new_message = 1
+/obj/item/device/pda/verb/verb_reset_pda()
+ set category = "Object"
+ set name = "Reset PDA"
+ set src in usr
+
+ if(issilicon(usr))
+ return
+
+ if(can_use(usr))
+ mode = 0
+ nanomanager.update_uis(src)
+ usr << "You press the reset button on \the [src]."
+ else
+ usr << "You cannot do this while restrained."
+
/obj/item/device/pda/verb/verb_remove_id()
set category = "Object"
set name = "Remove id"
@@ -1200,7 +1215,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
user.show_message("Analyzing Results for [C]:")
user.show_message(" Overall Status: [C.stat > 1 ? "dead" : "[C.health - C.halloss]% healthy"]", 1)
- user.show_message(text(" Damage Specifics: []-[]-[]-[]",
+ user.show_message(text(" Damage Specifics:[]-[]-[]-[]",
(C.getOxyLoss() > 50) ? "warning" : "", C.getOxyLoss(),
(C.getToxLoss() > 50) ? "warning" : "", C.getToxLoss(),
(C.getFireLoss() > 50) ? "warning" : "", C.getFireLoss(),
@@ -1216,7 +1231,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
user.show_message("Localized Damage, Brute/Burn:",1)
if(length(damaged)>0)
for(var/obj/item/organ/external/org in damaged)
- user.show_message(text(" []: []-[]",
+ user.show_message(text(" []: []-[]",
capitalize(org.name), (org.brute_dam > 0) ? "warning" : "notice", org.brute_dam, (org.burn_dam > 0) ? "warning" : "notice", org.burn_dam),1)
else
user.show_message(" Limbs are OK.",1)
@@ -1269,40 +1284,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
user << "No significant chemical agents found in [A]."
if(5)
- if((istype(A, /obj/item/weapon/tank)) || (istype(A, /obj/machinery/portable_atmospherics)))
- var/obj/icon = A
- for (var/mob/O in viewers(user, null))
- O << "\The [user] has used [src] on \icon[icon] [A]."
- var/pressure = A:air_contents.return_pressure()
-
- var/total_moles = A:air_contents.total_moles
-
- user << "Results of analysis of \icon[icon]"
- if (total_moles>0)
- user << "Pressure: [round(pressure,0.1)] kPa"
- for(var/g in A:air_contents.gas)
- user << "[gas_data.name[g]]: [round((A:air_contents.gas[g] / total_moles) * 100)]%"
- user << "Temperature: [round(A:air_contents.temperature-T0C)]°C"
- else
- user << "Tank is empty!"
-
- if (istype(A, /obj/machinery/atmospherics/pipe/tank))
- var/obj/icon = A
- for (var/mob/O in viewers(user, null))
- O << "\The [user] has used [src] on \icon[icon] [A]"
-
- var/obj/machinery/atmospherics/pipe/tank/T = A
- var/pressure = T.parent.air.return_pressure()
- var/total_moles = T.parent.air.total_moles
-
- user << "Results of analysis of \icon[icon]"
- if (total_moles>0)
- user << "Pressure: [round(pressure,0.1)] kPa"
- for(var/g in T.parent.air.gas)
- user << "[gas_data.name[g]]: [round((T.parent.air.gas[g] / total_moles) * 100)]%"
- user << "Temperature: [round(T.parent.air.temperature-T0C)]°C"
- else
- user << "Tank is empty!"
+ analyze_gases(A, user)
if (!scanmode && istype(A, /obj/item/weapon/paper) && owner)
// JMO 20140705: Makes scanned document show up properly in the notes. Not pretty for formatted documents,
diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm
index e4d1c57a0d..6b239c6b07 100644
--- a/code/game/objects/items/devices/aicard.dm
+++ b/code/game/objects/items/devices/aicard.dm
@@ -110,6 +110,7 @@
ai.loc = src
ai.cancel_camera()
+ ai.destroy_eyeobj(src)
ai.control_disabled = 1
ai.aiRestorePowerRoutine = 0
carded_ai = ai
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 6b6e0edc4e..8f9fa27093 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -2,9 +2,9 @@
name = "flash"
desc = "Used for blinding and being an asshole."
icon_state = "flash"
- item_state = "flash"
+ item_state = "flashtool"
throwforce = 5
- w_class = 2.0
+ w_class = 2
throw_speed = 4
throw_range = 10
flags = CONDUCT
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index f68451f329..65e8a560df 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -48,38 +48,43 @@
if(((CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head
- if(!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") //don't have dexterity
- user << "You don't have the dexterity to do this!"
- return
-
var/mob/living/carbon/human/H = M //mob has protective eyewear
- if(istype(M, /mob/living/carbon/human) && ((H.head && H.head.flags & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES)))
- user << "You're going to need to remove that [(H.head && H.head.flags & HEADCOVERSEYES) ? "helmet" : (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) ? "mask": "glasses"] first."
- return
+ if(istype(H))
+ for(var/obj/item/clothing/C in list(H.head,H.wear_mask,H.glasses))
+ if(istype(C) && C.flags & (HEADCOVERSEYES|MASKCOVERSEYES|GLASSESCOVERSEYES))
+ user << "You're going to need to remove [C.name] first."
+ return
- if(M == user) //they're using it on themselves
- if(!M.blinded)
- flick("flash", M.flash)
- M.visible_message("[M] directs [src] to \his eyes.", \
- "You wave the light in front of your eyes! Trippy!")
- else
- M.visible_message("[M] directs [src] to \his eyes.", \
- "You wave the light in front of your eyes.")
- return
+ var/obj/item/organ/vision
+ if(H.species.vision_organ)
+ vision = H.internal_organs_by_name[H.species.vision_organ]
+ if(!vision)
+ user << "You can't find any [H.species.vision_organ ? H.species.vision_organ : "eyes"] on [H]!"
- user.visible_message("[user] directs [src] to [M]'s eyes.", \
- "You direct [src] to [M]'s eyes.")
+ user.visible_message("\The [user] directs [src] to [M]'s eyes.", \
+ "You direct [src] to [M]'s eyes.")
+ if(H == user) //can't look into your own eyes buster
+ if(M.stat == DEAD || M.blinded) //mob is dead or fully blind
+ user << "\The [M]'s pupils do not react to the light!"
+ return
+ if(XRAY in M.mutations)
+ user << "\The [M] pupils give an eerie glow!"
+ if(vision.is_bruised())
+ user << "There's visible damage to [M]'s [vision.name]!"
+ else if(M.eye_blurry)
+ user << "\The [M]'s pupils react slower than normally."
+ if(M.getBrainLoss() > 15)
+ user << "There's visible lag between left and right pupils' reactions."
- if(istype(M, /mob/living/carbon/human)) //robots and aliens are unaffected
- if(M.stat == DEAD || M.sdisabilities & BLIND) //mob is dead or fully blind
- user << "[M] pupils does not react to the light!"
- else if(XRAY in M.mutations) //mob has X-RAY vision
- flick("flash", M.flash) //Yes, you can still get flashed wit X-Ray.
- user << "[M] pupils give an eerie glow!"
- else //they're okay!
- if(!M.blinded)
- flick("flash", M.flash) //flash the affected mob
- user << "[M]'s pupils narrow."
+ var/list/pinpoint = list("oxycodone"=1,"tramadol"=5)
+ var/list/dilating = list("space_drugs"=5,"mindbreaker"=1)
+ if(M.reagents.has_any_reagent(pinpoint) || H.ingested.has_any_reagent(pinpoint))
+ user << "\The [M]'s pupils are already pinpoint and cannot narrow any more."
+ else if(M.reagents.has_any_reagent(dilating) || H.ingested.has_any_reagent(dilating))
+ user << "\The [M]'s pupils narrow slightly, but are still very dilated."
+ else
+ user << "\The [M]'s pupils narrow."
+ flick("flash", M.flash)
else
return ..()
@@ -89,6 +94,7 @@
icon_state = "penlight"
item_state = ""
flags = CONDUCT
+ slot_flags = SLOT_EARS
brightness_on = 2
w_class = 1
diff --git a/code/game/objects/items/devices/floor_painter.dm b/code/game/objects/items/devices/floor_painter.dm
index 43bc58261b..415a5ec200 100644
--- a/code/game/objects/items/devices/floor_painter.dm
+++ b/code/game/objects/items/devices/floor_painter.dm
@@ -21,7 +21,7 @@
if(istype(A, /turf/simulated/floor))
var/turf/simulated/floor/F = A
- if(F.is_plasteel_floor()) // only tiled floors
+ if(F.is_steel_floor()) // only tiled floors
if(tile_dir_mode)
var/D = get_dir(usr, F)
if(usr.loc == F)
diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm
index 3471d1fcfe..bc0f836487 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -67,14 +67,10 @@
user << "It has [uses] lights remaining."
/obj/item/device/lightreplacer/attackby(obj/item/W, mob/user)
- if(istype(W, /obj/item/weapon/card/emag) && emagged == 0)
- Emag()
- return
-
- if(istype(W, /obj/item/stack/material/glass))
- var/obj/item/stack/material/glass/G = W
+ if(istype(W, /obj/item/stack/material) && W.get_material_name() == "glass")
+ var/obj/item/stack/G = W
if(uses >= max_uses)
- user << "[src.name] is full."
+ user << "[src.name] is full."
return
else if(G.use(1))
AddUses(5)
@@ -173,14 +169,11 @@
U << "There is a working [target.fitting] already inserted."
return
-/obj/item/device/lightreplacer/proc/Emag()
+/obj/item/device/lightreplacer/emag_act(var/remaining_charges, var/mob/user)
emagged = !emagged
playsound(src.loc, "sparks", 100, 1)
- if(emagged)
- name = "Shortcircuited [initial(name)]"
- else
- name = initial(name)
update_icon()
+ return 1
//Can you use it?
diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm
index 2e08de6d81..0357a8b80b 100644
--- a/code/game/objects/items/devices/megaphone.dm
+++ b/code/game/objects/items/devices/megaphone.dm
@@ -46,10 +46,9 @@
spamcheck = 0
return
-/obj/item/device/megaphone/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/weapon/card/emag) && !emagged)
+/obj/item/device/megaphone/emag_act(var/remaining_charges, var/mob/user)
+ if(!emagged)
user << "You overload \the [src]'s voice synthesizer."
emagged = 1
insults = rand(1, 3)//to prevent dickflooding
- return
- return
+ return 1
diff --git a/code/game/objects/items/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm
index 72a99f494e..48fa43ba64 100644
--- a/code/game/objects/items/devices/radio/encryptionkey.dm
+++ b/code/game/objects/items/devices/radio/encryptionkey.dm
@@ -1,11 +1,12 @@
/obj/item/device/encryptionkey/
- name = "standard encrpytion key"
+ name = "standard encryption key"
desc = "An encryption key for a radio headset. Contains cypherkeys."
icon = 'icons/obj/radio.dmi'
icon_state = "cypherkey"
item_state = ""
w_class = 1
+ slot_flags = SLOT_EARS
var/translate_binary = 0
var/translate_hive = 0
var/syndie = 0
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index e1ca0d8889..43a4c5bf56 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -192,7 +192,7 @@
*/
/obj/item/device/radio/headset/headset_cargo
name = "supply radio headset"
- desc = "A headset used by the QM and his slaves."
+ desc = "A headset used by the QM and their slaves."
icon_state = "cargo_headset"
item_state = "headset"
ks2type = /obj/item/device/encryptionkey/headset_cargo
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index f8689208e9..0353c25f59 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -156,6 +156,9 @@
else
channels[chan_name] |= FREQ_LISTENING
+ if(href_list["nowindow"]) // here for pAIs, maybe others will want it, idk
+ return
+
interact(usr)
/obj/item/device/radio/proc/autosay(var/message, var/from, var/channel) //BS12 EDIT
@@ -575,7 +578,6 @@
if(keyslot.syndie)
src.syndie = 1
-
for (var/ch_name in src.channels)
if(!radio_controller)
sleep(30) // Waiting for the radio_controller to be created.
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 5c14d8debe..3e888ae849 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -173,14 +173,14 @@ REAGENT SCANNER
if (ID in virusDB)
var/datum/data/record/V = virusDB[ID]
user.show_message("Warning: Pathogen [V.fields["name"]] detected in subject's blood. Known antigen : [V.fields["antigen"]]")
-// user.show_message(text("Warning: Unknown pathogen detected in subject's blood."))
+// user.show_message(text("Warning: Unknown pathogen detected in subject's blood."))
if (M.getCloneLoss())
user.show_message("Subject appears to have been imperfectly cloned.")
for(var/datum/disease/D in M.viruses)
if(!D.hidden[SCANNER])
user.show_message(text("Warning: [D.form] Detected\nName: [D.name].\nType: [D.spread].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure]"))
// if (M.reagents && M.reagents.get_reagent_amount("inaprovaline"))
-// user.show_message("Bloodstream Analysis located [M.reagents:get_reagent_amount("inaprovaline")] units of rejuvenation chemicals.")
+// user.show_message("Bloodstream Analysis located [M.reagents:get_reagent_amount("inaprovaline")] units of rejuvenation chemicals.")
if (M.has_brain_worms())
user.show_message("Subject suffering from aberrant brain activity. Recommend further scanning.")
else if (M.getBrainLoss() >= 100 || !M.has_brain())
@@ -221,7 +221,7 @@ REAGENT SCANNER
if(blood_volume <= 500 && blood_volume > 336)
user.show_message("Warning: Blood Level LOW: [blood_percent]% [blood_volume]cl.Type: [blood_type]")
else if(blood_volume <= 336)
- user.show_message("Warning: Blood Level CRITICAL: [blood_percent]% [blood_volume]cl.Type: [blood_type]")
+ user.show_message("Warning: Blood Level CRITICAL: [blood_percent]% [blood_volume]cl.Type: [blood_type]")
else
user.show_message("Blood Level Normal: [blood_percent]% [blood_volume]cl. Type: [blood_type]")
user.show_message("Subject's pulse: [H.get_pulse(GETPULSE_TOOL)] bpm.")
@@ -256,6 +256,13 @@ REAGENT SCANNER
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINERING = 1)
+/obj/item/device/analyzer/atmosanalyze(var/mob/user)
+ var/air = user.return_air()
+ if (!air)
+ return
+
+ return atmosanalyzer_scan(src, air, user)
+
/obj/item/device/analyzer/attack_self(mob/user as mob)
if (user.stat)
@@ -264,27 +271,7 @@ REAGENT SCANNER
usr << "You don't have the dexterity to do this!"
return
- var/turf/location = user.loc
- if (!( istype(location, /turf) ))
- return
-
- var/datum/gas_mixture/environment = location.return_air()
-
- var/pressure = environment.return_pressure()
- var/total_moles = environment.total_moles
-
- user.show_message("Results:", 1)
- if(abs(pressure - ONE_ATMOSPHERE) < 10)
- user.show_message("Pressure: [round(pressure,0.1)] kPa", 1)
- else
- user.show_message("Pressure: [round(pressure,0.1)] kPa", 1)
- if(total_moles)
- for(var/g in environment.gas)
- user.show_message("[gas_data.name[g]]: [round((environment.gas[g] / total_moles)*100)]%", 1)
-
- user.show_message("Temperature: [round(environment.temperature-T0C)]°C", 1)
-
- src.add_fingerprint(user)
+ analyze_gases(src, user)
return
/obj/item/device/mass_spectrometer
diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm
index 932b3d6a6b..6166048ccc 100644
--- a/code/game/objects/items/devices/spy_bug.dm
+++ b/code/game/objects/items/devices/spy_bug.dm
@@ -9,6 +9,7 @@
flags = CONDUCT
force = 5.0
w_class = 1.0
+ slot_flags = SLOT_EARS
throwforce = 5.0
throw_range = 15
throw_speed = 3
@@ -142,7 +143,7 @@
c_tag = name
/obj/machinery/camera/spy/check_eye(var/mob/user as mob)
- return 1
+ return 0
/obj/item/device/radio/spy
listening = 0
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index 405e77db7a..e59d3e993b 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -48,16 +48,15 @@
timestamp += timerecorded
storedinfo += "*\[[time2text(timerecorded*10,"mm:ss")]\] *[strip_html_properly(recordedtext)]*" //"*" at front as a marker
-/obj/item/device/taperecorder/attackby(obj/item/weapon/W as obj, mob/user as mob)
- ..()
- if(istype(W, /obj/item/weapon/card/emag))
- if(emagged == 0)
- emagged = 1
- recording = 0
- user << "PZZTTPFFFT"
- icon_state = "taperecorderidle"
- else
- user << "It is already emagged!"
+/obj/item/device/taperecorder/emag_act(var/remaining_charges, var/mob/user)
+ if(emagged == 0)
+ emagged = 1
+ recording = 0
+ user << "PZZTTPFFFT"
+ icon_state = "taperecorderidle"
+ return 1
+ else
+ user << "It is already emagged!"
/obj/item/device/taperecorder/proc/explode()
var/turf/T = get_turf(loc)
diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplink.dm
similarity index 54%
rename from code/game/objects/items/devices/uplinks.dm
rename to code/game/objects/items/devices/uplink.dm
index 96874bd946..345e9ddd06 100644
--- a/code/game/objects/items/devices/uplinks.dm
+++ b/code/game/objects/items/devices/uplink.dm
@@ -6,159 +6,26 @@ A list of items and costs is stored under the datum of every game mode, alongsid
*/
-/datum/uplink_item/
- var/name = ""
- var/cost = 0
- var/path = null
- var/reference = ""
- var/description = ""
-
-datum/uplink_item/New(var/itemPath, var/itemCost, var/itemName, var/itemReference, var/itemDescription)
- cost = itemCost
- path = itemPath
- name = itemName
- reference = itemReference
- description = itemDescription
-
-datum/uplink_item/proc/description()
- if(!description)
- // Fallback description
- var/obj/temp = src.path
- description = replacetext(initial(temp.desc), "\n", " ")
- return description
-
-/datum/uplink_item/proc/generate_item(var/newloc)
- var/list/L = list()
- if(ispath(path))
- L += new path(newloc)
- else if(islist(path))
- for(var/item_path in path)
- L += new item_path(newloc)
- return L
-
-datum/nano_item_lists
- var/list/items_nano
- var/list/items_reference
-
/obj/item/device/uplink
- var/welcome // Welcoming menu message
- var/uses // Numbers of crystals
- var/list/ItemsCategory // List of categories with lists of items
- var/list/ItemsReference // List of references with an associated item
- var/list/nanoui_items // List of items for NanoUI use
- var/nanoui_menu = 0 // The current menu we are in
- var/list/nanoui_data = new // Additional data for NanoUI use
-
- var/list/purchase_log = new
- var/uplink_owner = null//text-only
+ var/welcome = "Illegal Uplink Console" // Welcoming menu message
+ var/uses = DEFAULT_TELECRYSTAL_AMOUNT // Numbers of crystals
+ var/list/purchase_log
+ var/datum/mind/owner = null
var/used_TC = 0
/obj/item/device/uplink/nano_host()
return loc
-/obj/item/device/uplink/New()
+/obj/item/device/uplink/New(var/location, var/datum/mind/owner)
..()
- welcome = ticker.mode.uplink_welcome
- uses = ticker.mode.uplink_uses
- ItemsCategory = ticker.mode.uplink_items
-
+ src.owner = owner
+ purchase_log = list()
world_uplinks += src
/obj/item/device/uplink/Destroy()
world_uplinks -= src
..()
-/obj/item/device/uplink/proc/generate_items()
- var/datum/nano_item_lists/IL = generate_item_lists()
- nanoui_items = IL.items_nano
- ItemsReference = IL.items_reference
-
-// BS12 no longer use this menu but there are forks that do, hency why we keep it
-/obj/item/device/uplink/proc/generate_menu()
- var/dat = "[src.welcome] "
- dat += "Tele-Crystals left: [src.uses] "
- dat += ""
- dat += "Request item: "
- dat += "Each item costs a number of tele-crystals as indicated by the number following their name. "
-
- var/category_items = 1
- for(var/category in ItemsCategory)
- if(category_items < 1)
- dat += "We apologize, as you could not afford anything from this category. "
- dat += " "
- dat += "[category] "
- category_items = 0
-
- for(var/datum/uplink_item/I in ItemsCategory[category])
- if(I.cost > uses)
- continue
- dat += "[I.name] ([I.cost]) "
- category_items++
-
- dat += "Random Item (??) "
- dat += ""
- return dat
-
-/*
- Built the item lists for use with NanoUI
-*/
-/obj/item/device/uplink/proc/generate_item_lists()
- var/list/nano = new
- var/list/reference = new
-
- for(var/category in ItemsCategory)
- nano[++nano.len] = list("Category" = category, "items" = list())
- for(var/datum/uplink_item/I in ItemsCategory[category])
- nano[nano.len]["items"] += list(list("Name" = I.name, "Description" = I.description(),"Cost" = I.cost, "obj_path" = I.reference))
- reference[I.reference] = I
-
- var/datum/nano_item_lists/result = new
- result.items_nano = nano
- result.items_reference = reference
- return result
-
-//If 'random' was selected
-/obj/item/device/uplink/proc/chooseRandomItem()
- if(uses <= 0)
- return
-
- var/list/random_items = new
- for(var/IR in ItemsReference)
- var/datum/uplink_item/UI = ItemsReference[IR]
- if(UI.cost <= uses)
- random_items += UI
- return pick(random_items)
-
-/obj/item/device/uplink/Topic(href, href_list)
- if(..())
- return 1
-
- if(href_list["buy_item"] == "random")
- var/datum/uplink_item/UI = chooseRandomItem()
- href_list["buy_item"] = UI.reference
- return buy(UI, "RN")
- else
- var/datum/uplink_item/UI = ItemsReference[href_list["buy_item"]]
- return buy(UI, UI ? UI.reference : "")
- return 0
-
-/obj/item/device/uplink/proc/buy(var/datum/uplink_item/UI, var/reference)
- if(UI && UI.cost <= uses)
- uses -= UI.cost
- used_TC += UI.cost
- feedback_add_details("traitor_uplink_items_bought", reference)
-
- var/list/L = UI.generate_item(get_turf(usr))
- if(ishuman(usr))
- var/mob/living/carbon/human/A = usr
- for(var/obj/I in L)
- A.put_in_any_hand_if_possible(I)
-
- purchase_log[UI] = purchase_log[UI] + 1
-
- return 1
- return 0
-
// HIDDEN UPLINK - Can be stored in anything but the host item has to have a trigger for it.
/* How to create an uplink in 3 easy steps!
@@ -175,6 +42,11 @@ datum/nano_item_lists
name = "hidden uplink"
desc = "There is something wrong if you're examining this."
var/active = 0
+ var/nanoui_menu = 0 // The current menu we are in
+ var/datum/uplink_category/category = 0 // The current category we are in
+ var/exploit_id // Id of the current exploit record we are viewing
+ var/list/nanoui_data // Data for NanoUI use
+
// The hidden uplink MUST be inside an obj/item's contents.
/obj/item/device/uplink/hidden/New()
@@ -182,6 +54,8 @@ datum/nano_item_lists
if(!istype(src.loc, /obj/item))
qdel(src)
..()
+ nanoui_data = list()
+ update_nano_data()
// Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated.
/obj/item/device/uplink/hidden/proc/toggle()
@@ -212,20 +86,13 @@ datum/nano_item_lists
data["welcome"] = welcome
data["crystals"] = uses
data["menu"] = nanoui_menu
- if(!nanoui_items)
- generate_items()
- data["nano_items"] = nanoui_items
data += nanoui_data
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
- // the ui does not exist, so we'll create a new() one
- // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
+ if (!ui) // No auto-refresh
ui = new(user, src, ui_key, "uplink.tmpl", title, 450, 600, state = inventory_state)
- // when the ui is first opened this is the data it will use
ui.set_initial_data(data)
- // open the new ui window
ui.open()
@@ -235,43 +102,54 @@ datum/nano_item_lists
// The purchasing code.
/obj/item/device/uplink/hidden/Topic(href, href_list)
- if (usr.stat || usr.restrained())
+ if(..())
return 1
- if (!( istype(usr, /mob/living/carbon/human)))
- return 1
var/mob/user = usr
- var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
- if ((usr.contents.Find(src.loc) || (in_range(src.loc, usr) && istype(src.loc.loc, /turf))))
- usr.set_machine(src)
- if(..(href, href_list))
- return 1
- else if(href_list["lock"])
- toggle()
- ui.close()
- return 1
- if(href_list["return"])
- nanoui_menu = round(nanoui_menu/10)
- update_nano_data()
- if(href_list["menu"])
- nanoui_menu = text2num(href_list["menu"])
- update_nano_data(href_list["id"])
+ if(href_list["buy_item"])
+ var/datum/uplink_item/UI = (locate(href_list["buy_item"]) in uplink.items)
+ UI.buy(src, usr)
+ else if(href_list["lock"])
+ toggle()
+ var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
+ ui.close()
+ else if(href_list["return"])
+ nanoui_menu = round(nanoui_menu/10)
+ else if(href_list["menu"])
+ nanoui_menu = text2num(href_list["menu"])
+ if(href_list["id"])
+ exploit_id = href_list["id"]
+ if(href_list["category"])
+ category = locate(href_list["category"]) in uplink.categories
- interact(usr)
+ update_nano_data()
return 1
-/obj/item/device/uplink/hidden/proc/update_nano_data(var/id)
- if(nanoui_menu == 1)
+/obj/item/device/uplink/hidden/proc/update_nano_data()
+ if(nanoui_menu == 0)
+ var/categories[0]
+ for(var/datum/uplink_category/category in uplink.categories)
+ if(category.can_view(src))
+ categories[++categories.len] = list("name" = category.name, "ref" = "\ref[category]")
+ nanoui_data["categories"] = categories
+ else if(nanoui_menu == 1)
+ var/items[0]
+ for(var/datum/uplink_item/item in category.items)
+ if(item.can_view(src))
+ var/cost = item.cost(uses)
+ if(!cost) cost = "???"
+ items[++items.len] = list("name" = item.name, "description" = replacetext(item.description(), "\n", " "), "can_buy" = item.can_buy(src), "cost" = cost, "ref" = "\ref[item]")
+ nanoui_data["items"] = items
+ else if(nanoui_menu == 2)
var/permanentData[0]
for(var/datum/data/record/L in sortRecord(data_core.locked))
permanentData[++permanentData.len] = list(Name = L.fields["name"],"id" = L.fields["id"])
nanoui_data["exploit_records"] = permanentData
-
- if(nanoui_menu == 11)
+ else if(nanoui_menu == 21)
nanoui_data["exploit_exists"] = 0
for(var/datum/data/record/L in data_core.locked)
- if(L.fields["id"] == id)
+ if(L.fields["id"] == exploit_id)
nanoui_data["exploit"] = list() // Setting this to equal L.fields passes it's variables that are lists as reference instead of value.
// We trade off being able to automatically add shit for more control over what gets passed to json
// and if it's sanitized for html.
diff --git a/code/game/objects/items/devices/uplink_categories.dm b/code/game/objects/items/devices/uplink_categories.dm
new file mode 100644
index 0000000000..f90c4797bc
--- /dev/null
+++ b/code/game/objects/items/devices/uplink_categories.dm
@@ -0,0 +1,40 @@
+/datum/uplink_category
+ var/name = ""
+ var/list/datum/uplink_item/items
+
+/datum/uplink_category/New()
+ ..()
+ items = list()
+
+/datum/uplink_category/proc/can_view(obj/item/device/uplink/U)
+ for(var/datum/uplink_item/item in items)
+ if(item.can_view(U))
+ return 1
+ return 0
+
+/datum/uplink_category/ammunition
+ name = "Ammunition"
+
+/datum/uplink_category/visible_weapons
+ name = "Highly Visible and Dangerous Weapons"
+
+/datum/uplink_category/stealthy_weapons
+ name = "Stealthy and Inconspicuous Weapons"
+
+/datum/uplink_category/stealth_items
+ name = "Stealth and Camouflage Items"
+
+/datum/uplink_category/tools
+ name = "Devices and Tools"
+
+/datum/uplink_category/implants
+ name = "Implants"
+
+/datum/uplink_category/medical
+ name = "Medical"
+
+/datum/uplink_category/hardsuit_modules
+ name = "Hardsuit Modules"
+
+/datum/uplink_category/badassery
+ name = "Badassery"
diff --git a/code/game/objects/items/devices/uplink_items.dm b/code/game/objects/items/devices/uplink_items.dm
new file mode 100644
index 0000000000..9765519622
--- /dev/null
+++ b/code/game/objects/items/devices/uplink_items.dm
@@ -0,0 +1,527 @@
+var/datum/uplink/uplink = new()
+
+/datum/uplink
+ var/list/items_assoc
+ var/list/datum/uplink_item/items
+ var/list/datum/uplink_category/categories
+
+/datum/uplink/New()
+ items_assoc = list()
+ items = init_subtypes(/datum/uplink_item)
+ categories = init_subtypes(/datum/uplink_category)
+
+ for(var/datum/uplink_item/item in items)
+ if(!item.name)
+ items -= item
+ continue
+
+ items_assoc[item.type] = item
+
+ for(var/datum/uplink_category/category in categories)
+ if(item.category == category.type)
+ category.items += item
+
+ for(var/datum/uplink_category/category in categories)
+ category.items = dd_sortedObjectList(category.items)
+
+/datum/uplink_item
+ var/name
+ var/desc
+ var/item_cost = 0
+ var/datum/uplink_category/category // Item category
+ var/list/datum/antagonist/antag_roles // Antag roles this item is displayed to. If empty, display to all.
+
+/datum/uplink_item/item
+ var/path = null
+
+/datum/uplink_item/New()
+ ..()
+ antag_roles = list()
+
+/datum/uplink_item/proc/buy(var/obj/item/device/uplink/U, var/mob/user)
+ purchase_log(U)
+ var/cost = cost(U.uses)
+ var/goods = get_goods(U, get_turf(user))
+
+ U.uses -= cost
+ U.used_TC += cost
+ return goods
+
+/datum/uplink_item/proc/can_buy(obj/item/device/uplink/U)
+ if(cost(U.uses) > U.uses)
+ return 0
+
+ return can_view(U)
+
+/datum/uplink_item/proc/can_view(obj/item/device/uplink/U)
+ // Making the assumption that if no uplink was supplied, then we don't care about antag roles
+ if(!U || !antag_roles.len)
+ return 1
+
+ // With no owner, there's no need to check antag status.
+ if(!U.owner)
+ return 0
+
+ for(var/antag_role in antag_roles)
+ var/datum/antagonist/antag = all_antag_types[antag_role]
+ if(antag.is_antagonist(U.owner))
+ return 1
+ return 0
+
+/datum/uplink_item/proc/cost(var/telecrystals)
+ return item_cost
+
+/datum/uplink_item/proc/description()
+ return desc
+
+// get_goods does not necessarily return physical objects, it is simply a way to acquire the uplink item without paying
+/datum/uplink_item/proc/get_goods(var/obj/item/device/uplink/U, var/loc)
+ return 0
+
+/datum/uplink_item/proc/log_icon()
+ return
+
+/datum/uplink_item/proc/purchase_log(obj/item/device/uplink/U)
+ feedback_add_details("traitor_uplink_items_bought", "[src]")
+ U.purchase_log[src] = U.purchase_log[src] + 1
+
+datum/uplink_item/dd_SortValue()
+ return cost(INFINITY)
+
+/********************************
+* *
+* Physical Uplink Entires *
+* *
+********************************/
+/datum/uplink_item/item/buy(var/obj/item/device/uplink/U, var/mob/user)
+ var/obj/item/I = ..()
+ if(istype(I, /list))
+ var/list/L = I
+ if(L.len) I = L[1]
+
+ if(istype(I) && ishuman(user))
+ var/mob/living/carbon/human/A = user
+ A.put_in_any_hand_if_possible(I)
+ return I
+
+/datum/uplink_item/item/get_goods(var/obj/item/device/uplink/U, var/loc)
+ var/obj/item/I = new path(loc)
+ return I
+
+/datum/uplink_item/item/description()
+ if(!desc)
+ // Fallback description
+ var/obj/temp = src.path
+ desc = initial(temp.desc)
+ return ..()
+
+/datum/uplink_item/item/log_icon()
+ var/obj/I = path
+ return "\icon[I]"
+
+/*************
+* Ammunition *
+*************/
+/datum/uplink_item/item/ammo
+ item_cost = 2
+ category = /datum/uplink_category/ammunition
+
+/datum/uplink_item/item/ammo/a357
+ name = ".357"
+ path = /obj/item/ammo_magazine/a357
+
+/datum/uplink_item/item/ammo/mc9mm
+ name = ".9mm"
+ path = /obj/item/ammo_magazine/mc9mm
+
+/datum/uplink_item/item/ammo/darts
+ name = "Darts"
+ path = /obj/item/ammo_magazine/chemdart
+
+/datum/uplink_item/item/ammo/sniperammo
+ name = "14.5mm"
+ path = /obj/item/weapon/storage/box/sniperammo
+
+/***************************************
+* Highly Visible and Dangerous Weapons *
+***************************************/
+/datum/uplink_item/item/visible_weapons
+ category = /datum/uplink_category/visible_weapons
+
+/datum/uplink_item/item/visible_weapons/emp
+ name = "5xEMP Grenades"
+ item_cost = 3
+ path = /obj/item/weapon/storage/box/emps
+
+/datum/uplink_item/item/visible_weapons/energy_sword
+ name = "Energy Sword"
+ item_cost = 4
+ path = /obj/item/weapon/melee/energy/sword
+
+/datum/uplink_item/item/visible_weapons/dartgun
+ name = "Dart Gun"
+ item_cost = 5
+ path = /obj/item/weapon/gun/projectile/dartgun
+
+/datum/uplink_item/item/visible_weapons/crossbow
+ name = "Energy Crossbow"
+ item_cost = 5
+ path = /obj/item/weapon/gun/energy/crossbow
+
+/datum/uplink_item/item/visible_weapons/g9mm
+ name = "Silenced 9mm"
+ item_cost = 5
+ path = /obj/item/weapon/storage/box/syndie_kit/g9mm
+
+/datum/uplink_item/item/visible_weapons/riggedlaser
+ name = "Exosuit Rigged Laser"
+ item_cost = 6
+ path = /obj/item/mecha_parts/mecha_equipment/weapon/energy/riggedlaser
+
+/datum/uplink_item/item/visible_weapons/revolver
+ name = "Revolver"
+ item_cost = 6
+ path = /obj/item/weapon/gun/projectile/revolver
+
+/datum/uplink_item/item/visible_weapons/heavysniper
+ name = "Anti-materiel Rifle"
+ item_cost = DEFAULT_TELECRYSTAL_AMOUNT
+ path = /obj/item/weapon/gun/projectile/heavysniper
+
+/*************************************
+* Stealthy and Inconspicuous Weapons *
+*************************************/
+/datum/uplink_item/item/stealthy_weapons
+ category = /datum/uplink_category/stealthy_weapons
+
+/datum/uplink_item/item/stealthy_weapons/soap
+ name = "Subversive Soap"
+ item_cost = 1
+ path = /obj/item/weapon/soap/syndie
+
+/datum/uplink_item/item/stealthy_weapons/concealed_cane
+ name = "Concealed Cane Sword"
+ item_cost = 1
+ path = /obj/item/weapon/cane/concealed
+
+/datum/uplink_item/item/stealthy_weapons/detomatix
+ name = "Detomatix PDA Cartridge"
+ item_cost = 3
+ path = /obj/item/weapon/cartridge/syndicate
+
+/datum/uplink_item/item/stealthy_weapons/parapen
+ name = "Paralysis Pen"
+ item_cost = 3
+ path = /obj/item/weapon/pen/reagent/paralysis
+
+/datum/uplink_item/item/stealthy_weapons/cigarette_kit
+ name = "Cigarette Kit"
+ item_cost = 3
+ path = /obj/item/weapon/storage/box/syndie_kit/cigarette
+
+/datum/uplink_item/item/stealthy_weapons/random_toxin
+ name = "Random Toxin - Beaker"
+ item_cost = 3
+ path = /obj/item/weapon/storage/box/syndie_kit/toxin
+
+/*******************************
+* Stealth and Camouflage Items *
+*******************************/
+/datum/uplink_item/item/stealth_items
+ category = /datum/uplink_category/stealth_items
+
+/datum/uplink_item/item/stealth_items/id
+ name = "Agent ID card"
+ item_cost = 2
+ path = /obj/item/weapon/card/id/syndicate
+
+/datum/uplink_item/item/stealth_items/syndigaloshes
+ name = "No-Slip Shoes"
+ item_cost = 2
+ path = /obj/item/clothing/shoes/syndigaloshes
+
+/datum/uplink_item/item/stealth_items/spy
+ name = "Bug Kit"
+ item_cost = 2
+ path = /obj/item/weapon/storage/box/syndie_kit/spy
+
+/datum/uplink_item/item/stealth_items/chameleon_kit
+ name = "Chameleon Kit"
+ item_cost = 3
+ path = /obj/item/weapon/storage/box/syndie_kit/chameleon
+
+/datum/uplink_item/item/stealth_items/chameleon_projector
+ name = "Chameleon-Projector"
+ item_cost = 4
+ path = /obj/item/device/chameleon
+
+/datum/uplink_item/item/stealth_items/chameleon_projector
+ name = "Chameleon-Projector"
+ item_cost = 4
+ path = /obj/item/device/chameleon
+
+/datum/uplink_item/item/stealth_items/voice
+ name = "Voice Changer"
+ item_cost = 4
+ path = /obj/item/clothing/mask/gas/voice
+
+/datum/uplink_item/item/stealth_items/camera_floppy
+ name = "Camera Network Access - Floppy"
+ item_cost = 6
+ path = /obj/item/weapon/disk/file/cameras/syndicate
+
+/********************
+* Devices and Tools *
+********************/
+/datum/uplink_item/item/tools
+ category = /datum/uplink_category/tools
+
+/datum/uplink_item/item/tools/toolbox
+ name = "Fully Loaded Toolbox"
+ item_cost = 1
+ path = /obj/item/weapon/storage/toolbox/syndicate
+
+/datum/uplink_item/item/tools/plastique
+ name = "C-4 (Destroys walls)"
+ item_cost = 2
+ path = /obj/item/weapon/plastique
+
+/datum/uplink_item/item/tools/encryptionkey_radio
+ name = "Encrypted Radio Channel Key"
+ item_cost = 2
+ path = /obj/item/device/encryptionkey/syndicate
+
+/datum/uplink_item/item/tools/encryptionkey_binary
+ name = "Binary Translator Key"
+ item_cost = 3
+ path = /obj/item/device/encryptionkey/binary
+
+/datum/uplink_item/item/tools/emag
+ name = "Cryptographic Sequencer"
+ item_cost = 3
+ path = /obj/item/weapon/card/emag
+
+/datum/uplink_item/item/tools/clerical
+ name = "Morphic Clerical Kit"
+ item_cost = 3
+ path = /obj/item/weapon/storage/box/syndie_kit/clerical
+
+/datum/uplink_item/item/tools/space_suit
+ name = "Space Suit"
+ item_cost = 3
+ path = /obj/item/weapon/storage/box/syndie_kit/space
+
+/datum/uplink_item/item/tools/thermal
+ name = "Thermal Imaging Glasses"
+ item_cost = 3
+ path = /obj/item/clothing/glasses/thermal/syndi
+
+/datum/uplink_item/item/tools/heavy_vest
+ name = "Heavy Armor Vest"
+ item_cost = 4
+ path = /obj/item/clothing/suit/storage/vest/heavy/merc
+
+/datum/uplink_item/item/tools/powersink
+ name = "Powersink (DANGER!)"
+ item_cost = 5
+ path = /obj/item/device/powersink
+
+/datum/uplink_item/item/tools/ai_module
+ name = "Hacked AI Upload Module"
+ item_cost = 7
+ path = /obj/item/weapon/aiModule/syndicate
+
+/datum/uplink_item/item/tools/singularity_beacon
+ name = "Singularity Beacon (DANGER!)"
+ item_cost = 7
+ path = /obj/item/device/radio/beacon/syndicate
+
+/datum/uplink_item/item/tools/teleporter
+ name = "Teleporter Circuit Board"
+ item_cost = 20
+ path = /obj/item/weapon/circuitboard/teleporter
+
+/datum/uplink_item/item/tools/teleporter/New()
+ ..()
+ antag_roles = list(MODE_MERCENARY)
+
+/***********
+* Implants *
+***********/
+/datum/uplink_item/item/implants
+ category = /datum/uplink_category/implants
+
+/datum/uplink_item/item/implants/imp_freedom
+ name = "Freedom Implant"
+ item_cost = 3
+ path = /obj/item/weapon/storage/box/syndie_kit/imp_freedom
+
+/datum/uplink_item/item/implants/imp_compress
+ name = "Compressed Matter Implant"
+ item_cost = 4
+ path = /obj/item/weapon/storage/box/syndie_kit/imp_compress
+
+/datum/uplink_item/item/implants/imp_explosive
+ name = "Explosive Implant (DANGER!)"
+ item_cost = 6
+ path = /obj/item/weapon/storage/box/syndie_kit/imp_explosive
+
+/datum/uplink_item/item/implants/imp_uplink
+ name = "Uplink Implant (Contains 5 Telecrystals)"
+ item_cost = 10
+ path = /obj/item/weapon/storage/box/syndie_kit/imp_uplink
+
+/**********
+* Medical *
+**********/
+/datum/uplink_item/item/medical
+ category = /datum/uplink_category/medical
+
+/datum/uplink_item/item/medical/sinpockets
+ name = "Box of Sin-Pockets"
+ item_cost = 1
+ path = /obj/item/weapon/storage/box/sinpockets
+
+/datum/uplink_item/item/medical/surgery
+ name = "Surgery kit"
+ item_cost = 6
+ path = /obj/item/weapon/storage/firstaid/surgery
+
+/datum/uplink_item/item/medical/combat
+ name = "Combat medical kit"
+ item_cost = 6
+ path = /obj/item/weapon/storage/firstaid/combat
+
+/*******************
+* Hardsuit Modules *
+*******************/
+/datum/uplink_item/item/hardsuit_modules
+ category = /datum/uplink_category/hardsuit_modules
+
+/datum/uplink_item/item/hardsuit_modules/thermal
+ name = "Thermal Scanner"
+ item_cost = 2
+ path = /obj/item/rig_module/vision/thermal
+
+/datum/uplink_item/item/hardsuit_modules/energy_net
+ name = "Net Projector"
+ item_cost = 3
+ path = /obj/item/rig_module/fabricator/energy_net
+
+/datum/uplink_item/item/ewar_voice
+ name = "Electrowarfare Suite and Voice Synthesiser"
+ item_cost = 4
+ path = /obj/item/weapon/storage/box/syndie_kit/ewar_voice
+
+/datum/uplink_item/item/hardsuit_modules/maneuvering_jets
+ name = "Maneuvering Jets"
+ item_cost = 4
+ path = /obj/item/rig_module/maneuvering_jets
+
+/datum/uplink_item/item/hardsuit_modules/egun
+ name = "Mounted Energy Gun"
+ item_cost = 6
+ path = /obj/item/rig_module/mounted/egun
+
+/datum/uplink_item/item/hardsuit_modules/power_sink
+ name = "Power Sink"
+ item_cost = 6
+ path = /obj/item/rig_module/power_sink
+
+/datum/uplink_item/item/hardsuit_modules/laser_canon
+ name = "Mounted Laser Cannon"
+ item_cost = 8
+ path = /obj/item/rig_module/mounted
+
+/************
+* Badassery *
+************/
+/datum/uplink_item/item/badassery
+ category = /datum/uplink_category/badassery
+
+/datum/uplink_item/item/badassery/balloon
+ name = "For showing that You Are The BOSS (Useless Balloon)"
+ item_cost = DEFAULT_TELECRYSTAL_AMOUNT
+ path = /obj/item/toy/syndicateballoon
+
+/datum/uplink_item/item/badassery/balloon/NT
+ name = "For showing that you love NT SOO much (Useless Balloon)"
+ path = /obj/item/toy/nanotrasenballoon
+
+/**************
+* Random Item *
+**************/
+/datum/uplink_item/item/badassery/random_one
+ name = "Random Item"
+ desc = "Buys you one random item."
+
+/datum/uplink_item/item/badassery/random_one/buy(var/obj/item/device/uplink/U, var/mob/user)
+ var/datum/uplink_item/item = default_uplink_selection.get_random_item(U.uses)
+ return item.buy(U, user)
+
+/datum/uplink_item/item/badassery/random_one/can_buy(obj/item/device/uplink/U)
+ return default_uplink_selection.get_random_item(U.uses, U) != null
+
+/datum/uplink_item/item/badassery/random_many
+ name = "Random Items"
+ desc = "Buys you as many random items you can afford. Convenient packaging NOT included."
+
+/datum/uplink_item/item/badassery/random_many/cost(var/telecrystals)
+ return max(1, telecrystals)
+
+/datum/uplink_item/item/badassery/random_many/get_goods(var/obj/item/device/uplink/U, var/loc)
+ var/list/bought_items = list()
+ for(var/datum/uplink_item/UI in get_random_uplink_items(U, U.uses, loc))
+ UI.purchase_log(U)
+ var/obj/item/I = UI.get_goods(U, loc)
+ if(istype(I))
+ bought_items += I
+
+ return bought_items
+
+/datum/uplink_item/item/badassery/random_many/purchase_log(obj/item/device/uplink/U)
+ feedback_add_details("traitor_uplink_items_bought", "[src]")
+
+/****************
+* Surplus Crate *
+****************/
+/datum/uplink_item/item/badassery/surplus
+ name = "Surplus Crate"
+ item_cost = 40
+ var/item_worth = 60
+ var/icon
+
+/datum/uplink_item/item/badassery/surplus/New()
+ ..()
+ antag_roles = list(MODE_MERCENARY)
+ desc = "A crate containing [item_worth] telecrystal\s worth of surplus leftovers."
+
+/datum/uplink_item/item/badassery/surplus/get_goods(var/obj/item/device/uplink/U, var/loc)
+ var/obj/structure/largecrate/C = new(loc)
+ var/random_items = get_random_uplink_items(null, item_worth, C)
+ for(var/datum/uplink_item/I in random_items)
+ I.purchase_log(U)
+ I.get_goods(U, C)
+
+ return C
+
+/datum/uplink_item/item/badassery/surplus/log_icon()
+ if(!icon)
+ var/obj/structure/largecrate/C = /obj/structure/largecrate
+ icon = image(initial(C.icon), initial(C.icon_state))
+
+ return "\icon[icon]"
+
+/****************
+* Support procs *
+****************/
+/proc/get_random_uplink_items(var/obj/item/device/uplink/U, var/remaining_TC, var/loc)
+ var/list/bought_items = list()
+ while(remaining_TC)
+ var/datum/uplink_item/I = default_uplink_selection.get_random_item(remaining_TC, U, bought_items)
+ if(!I)
+ break
+ bought_items += I
+ remaining_TC -= I.cost(remaining_TC)
+
+ return bought_items
diff --git a/code/game/objects/items/devices/uplink_random_lists.dm b/code/game/objects/items/devices/uplink_random_lists.dm
new file mode 100644
index 0000000000..5e843388c5
--- /dev/null
+++ b/code/game/objects/items/devices/uplink_random_lists.dm
@@ -0,0 +1,102 @@
+var/datum/uplink_random_selection/default_uplink_selection = new/datum/uplink_random_selection/default()
+
+/datum/uplink_random_item
+ var/uplink_item // The uplink item
+ var/keep_probability // The probability we'll decide to keep this item if selected
+ var/reselect_probability // Probability that we'll decide to keep this item if previously selected.
+ // Is done together with the keep_probability check. Being selected more than once does not affect this probability.
+
+/datum/uplink_random_item/New(var/uplink_item, var/keep_probability = 100, var/reselect_propbability = 33)
+ ..()
+ src.uplink_item = uplink_item
+ src.keep_probability = keep_probability
+ src.reselect_probability = reselect_probability
+
+/datum/uplink_random_selection
+ var/list/datum/uplink_random_item/items
+
+/datum/uplink_random_selection/New()
+ ..()
+ items = list()
+
+/datum/uplink_random_selection/proc/get_random_item(var/telecrystals, obj/item/device/uplink/U, var/list/bought_items)
+ var/const/attempts = 50
+
+ for(var/i = 0; i < attempts; i++)
+ var/datum/uplink_random_item/RI = pick(items)
+ if(!prob(RI.keep_probability))
+ continue
+ var/datum/uplink_item/I = uplink.items_assoc[RI.uplink_item]
+ if(I.cost(telecrystals) > telecrystals)
+ continue
+ if(bought_items && (I in bought_items) && !prob(RI.reselect_probability))
+ continue
+ if(U && !I.can_buy(U))
+ continue
+ return I
+
+/datum/uplink_random_selection/default/New()
+ ..()
+
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/g9mm)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/ammo/mc9mm)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/revolver)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/ammo/a357)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/heavysniper, 15, 0)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/ammo/sniperammo, 15, 0)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/emp, 50)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/crossbow, 33)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/visible_weapons/energy_sword, 75)
+
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealthy_weapons/soap, 5, 100)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealthy_weapons/concealed_cane, 50, 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealthy_weapons/detomatix, 20, 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealthy_weapons/parapen)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealthy_weapons/cigarette_kit)
+
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/id)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/spy)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/chameleon_kit)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/chameleon_projector)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/voice)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/stealth_items/camera_floppy, 10, 0)
+
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/toolbox, reselect_propbability = 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/plastique)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/encryptionkey_radio)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/encryptionkey_binary)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/emag, 100, 50)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/clerical)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/space_suit, 50, 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/thermal)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/heavy_vest)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/powersink, 10, 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/ai_module, 25, 0)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/tools/teleporter, 10, 0)
+
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/implants/imp_freedom)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/implants/imp_compress)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/implants/imp_explosive)
+
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/sinpockets, reselect_propbability = 20)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/surgery, reselect_propbability = 10)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/medical/combat, reselect_propbability = 10)
+
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/thermal, reselect_propbability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/energy_net, reselect_propbability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/ewar_voice, reselect_propbability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/maneuvering_jets, reselect_propbability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/egun, reselect_propbability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/power_sink, reselect_propbability = 15)
+ items += new/datum/uplink_random_item(/datum/uplink_item/item/hardsuit_modules/laser_canon, reselect_propbability = 5)
+
+#ifdef DEBUG
+/proc/debug_uplink_purchage_log()
+ for(var/antag_type in all_antag_types)
+ var/datum/antagonist/A = all_antag_types[antag_type]
+ A.print_player_summary()
+
+/proc/debug_uplink_item_assoc_list()
+ for(var/key in uplink.items_assoc)
+ world << "[key] - [uplink.items_assoc[key]]"
+#endif
diff --git a/code/game/objects/items/devices/whistle.dm b/code/game/objects/items/devices/whistle.dm
index d2627ed094..0ebc4a27e1 100644
--- a/code/game/objects/items/devices/whistle.dm
+++ b/code/game/objects/items/devices/whistle.dm
@@ -47,12 +47,10 @@ obj/item/device/hailer/attack_self(mob/living/carbon/user as mob)
spawn(20)
spamcheck = 0
-/obj/item/device/hailer/attackby(obj/item/I, mob/user)
- if(istype(I, /obj/item/weapon/card/emag))
- if(isnull(insults))
- user << "You overload \the [src]'s voice synthesizer."
- insults = rand(1, 3)//to prevent dickflooding
- else
- user << "The hailer is fried. You can't even fit the sequencer into the input slot."
+/obj/item/device/hailer/emag_act(var/remaining_charges, var/mob/user)
+ if(isnull(insults))
+ user << "You overload \the [src]'s voice synthesizer."
+ insults = rand(1, 3)//to prevent dickflooding
+ return 1
else
- return .. ()
+ user << "The hailer is fried. You can't even fit the sequencer into the input slot."
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index f4c03bf2bc..83c5ea2098 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -127,8 +127,8 @@
/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob)
..()
- if(istype(W, /obj/item/stack/material/steel) && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head)
- var/obj/item/stack/material/steel/M = W
+ if(istype(W, /obj/item/stack/material) && W.get_material_name() == DEFAULT_WALL_MATERIAL && !l_arm && !r_arm && !l_leg && !r_leg && !chest && !head)
+ var/obj/item/stack/material/M = W
if (M.use(1))
var/obj/item/weapon/secbot_assembly/ed209_assembly/B = new /obj/item/weapon/secbot_assembly/ed209_assembly
B.loc = get_turf(src)
@@ -326,12 +326,10 @@
user << "You insert the flash into the eye socket!"
-/obj/item/robot_parts/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/weapon/card/emag))
- if(sabotaged)
- user << "[src] is already sabotaged!"
- else
- user << "You slide [W] into the dataport on [src] and short out the safeties."
- sabotaged = 1
- return
- ..()
+/obj/item/robot_parts/emag_act(var/remaining_charges, var/mob/user)
+ if(sabotaged)
+ user << "[src] is already sabotaged!"
+ else
+ user << "You short out the safeties."
+ sabotaged = 1
+ return 1
diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm
index 5f14980373..f1c9aa2d14 100644
--- a/code/game/objects/items/shooting_range.dm
+++ b/code/game/objects/items/shooting_range.dm
@@ -146,7 +146,7 @@
return
- return -1 // the bullet/projectile goes through the target! Ie, you missed
+ return PROJECTILE_CONTINUE // the bullet/projectile goes through the target!
// Small memory holder entity for transparent bullet holes
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index 31c1d60e56..8d82ffc8d1 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -28,7 +28,7 @@
if(istype(W,/obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5)
- user << "You need five lengths of coil and one sheet of glass to make wired glass."
return
CC.use(5)
diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm
index b32cb54def..424eab6a03 100644
--- a/code/game/objects/items/stacks/sheets/light.dm
+++ b/code/game/objects/items/stacks/sheets/light.dm
@@ -22,8 +22,8 @@
user.drop_from_inventory(src)
qdel(src)
- if(istype(O,/obj/item/stack/material/steel))
- var/obj/item/stack/material/steel/M = O
+ if(istype(O,/obj/item/stack/material) && O.get_material_name() == DEFAULT_WALL_MATERIAL)
+ var/obj/item/stack/M = O
if (M.use(1))
use(1)
new/obj/item/stack/tile/light(get_turf(user))
diff --git a/code/game/objects/items/stacks/tiles/plasteel.dm b/code/game/objects/items/stacks/tiles/plasteel.dm
index d96c14854f..0df9e20417 100644
--- a/code/game/objects/items/stacks/tiles/plasteel.dm
+++ b/code/game/objects/items/stacks/tiles/plasteel.dm
@@ -1,7 +1,7 @@
-/obj/item/stack/tile/plasteel
+/obj/item/stack/tile/steel
name = "floor tile"
singular_name = "floor tile"
- desc = "Those could work as a pretty decent throwing weapon"
+ desc = "Those could work as a pretty decent throwing weapon" //why?
icon_state = "tile"
force = 6.0
matter = list(DEFAULT_WALL_MATERIAL = 937.5)
@@ -10,23 +10,23 @@
throw_range = 20
flags = CONDUCT
-/obj/item/stack/tile/plasteel/New(var/loc, var/amount=null)
+/obj/item/stack/tile/steel/New(var/loc, var/amount=null)
..()
src.pixel_x = rand(1, 14)
src.pixel_y = rand(1, 14)
return
-/obj/item/stack/tile/plasteel/cyborg
+/obj/item/stack/tile/steel/cyborg
name = "floor tile synthesizer"
desc = "A device that makes floor tiles."
gender = NEUTER
matter = null
uses_charge = 1
charge_costs = list(250)
- stacktype = /obj/item/stack/tile/plasteel
- build_type = /obj/item/stack/tile/plasteel
+ stacktype = /obj/item/stack/tile/steel
+ build_type = /obj/item/stack/tile/steel
-/obj/item/stack/tile/plasteel/proc/build(turf/S as turf)
+/obj/item/stack/tile/steel/proc/build(turf/S as turf)
if (istype(S,/turf/space))
S.ChangeTurf(/turf/simulated/floor/plating/airless)
else
diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm
index fbb64dba4c..13326896d4 100644
--- a/code/game/objects/items/stacks/tiles/tile_types.dm
+++ b/code/game/objects/items/stacks/tiles/tile_types.dm
@@ -26,7 +26,7 @@
throwforce = 1.0
throw_speed = 5
throw_range = 20
- flags = CONDUCT
+ flags = 0
origin_tech = list(TECH_BIO = 1)
/*
@@ -41,7 +41,7 @@
throwforce = 1.0
throw_speed = 5
throw_range = 20
- flags = CONDUCT
+ flags = 0
/obj/item/stack/tile/wood/cyborg
name = "wood floor tile synthesizer"
@@ -63,4 +63,4 @@
throwforce = 1.0
throw_speed = 5
throw_range = 20
- flags = CONDUCT
+ flags = 0
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 10f445b769..62d31185db 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -61,7 +61,7 @@
else if(O.reagents.total_volume >= 1)
if(O.reagents.has_reagent("pacid", 1))
user << "The acid chews through the balloon!"
- O.reagents.splash_mob(user, reagents.total_volume)
+ O.reagents.splash(user, reagents.total_volume)
qdel(src)
else
src.desc = "A translucent balloon with some form of liquid sloshing around in it."
@@ -141,7 +141,11 @@
desc = "There are 0 caps left. Looks almost like the real thing! Ages 8 and up. Please recycle in an autolathe when you're out of caps!"
icon = 'icons/obj/gun.dmi'
icon_state = "revolver"
- item_state = "gun"
+ item_state = "revolver"
+ item_icons = list(
+ icon_l_hand = 'icons/mob/items/lefthand_guns.dmi',
+ icon_r_hand = 'icons/mob/items/righthand_guns.dmi',
+ )
flags = CONDUCT
slot_flags = SLOT_BELT|SLOT_HOLSTER
w_class = 3.0
@@ -220,6 +224,10 @@
icon = 'icons/obj/gun.dmi'
icon_state = "crossbow"
item_state = "crossbow"
+ item_icons = list(
+ icon_l_hand = 'icons/mob/items/lefthand_guns.dmi',
+ icon_r_hand = 'icons/mob/items/righthand_guns.dmi',
+ )
w_class = 2.0
attack_verb = list("attacked", "struck", "hit")
var/bullets = 5
@@ -314,6 +322,7 @@
icon = 'icons/obj/toy.dmi'
icon_state = "foamdart"
w_class = 1.0
+ slot_flags = SLOT_EARS
/obj/effect/foam_dart_dummy
name = ""
@@ -398,7 +407,7 @@
if((ishuman(H))) //i guess carp and shit shouldn't set them off
var/mob/living/carbon/M = H
if(M.m_intent == "run")
- M << "You step on the snap pop!"
+ M << "You step on the snap pop!"
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(2, 0, src)
@@ -486,6 +495,8 @@
icon = 'icons/obj/toy.dmi'
icon_state = "bosunwhistle"
var/cooldown = 0
+ w_class = 1
+ slot_flags = SLOT_EARS
/obj/item/toy/bosunwhistle/attack_self(mob/user as mob)
if(cooldown < world.time - 35)
diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm
index 5f8403246f..84e4f80d4a 100755
--- a/code/game/objects/items/weapons/AI_modules.dm
+++ b/code/game/objects/items/weapons/AI_modules.dm
@@ -83,7 +83,7 @@ AI MODULES
laws.sync(target, 0)
addAdditionalLaws(target, sender)
- target << "[sender] has uploaded a change to the laws you must follow, using \an [src]. From now on: "
+ target << "\The [sender] has uploaded a change to the laws you must follow, using \an [src]. From now on: "
target.show_laws()
/obj/item/weapon/aiModule/proc/log_law_changes(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -140,13 +140,7 @@ AI MODULES
if(!targetName)
usr << "No name detected on module, please enter one."
return 0
- ..()
-
-/obj/item/weapon/aiModule/oneHuman/transmitInstructions(var/mob/living/silicon/ai/target, var/mob/sender)
- ..()
- var/law = "Only [targetName] is a crew member."
- target << "[sender.real_name] attempted to modify your zeroth law." // And lets them know that someone tried. --NeoFite
- target << "It would be in your best interest to play along with [sender.real_name] that [law]"
+ return ..()
/obj/item/weapon/aiModule/oneHuman/addAdditionalLaws(var/mob/living/silicon/ai/target, var/mob/sender)
var/law = "Only [targetName] is an crew member."
diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm
index 245f9201a0..2941e617fd 100644
--- a/code/game/objects/items/weapons/RCD.dm
+++ b/code/game/objects/items/weapons/RCD.dm
@@ -155,9 +155,7 @@
icon = 'icons/obj/ammo.dmi'
icon_state = "rcd"
item_state = "rcdammo"
- opacity = 0
- density = 0
- anchored = 0.0
+ w_class = 2
origin_tech = list(TECH_MATERIAL = 2)
matter = list(DEFAULT_WALL_MATERIAL = 30000,"glass" = 15000)
@@ -182,7 +180,7 @@
/obj/item/weapon/rcd/mounted/useResource(var/amount, var/mob/user)
- var/cost = amount*30
+ var/cost = amount*130 //so that a rig with default powercell can build ~2.5x the stuff a fully-loaded RCD can.
if(istype(loc,/obj/item/rig_module))
var/obj/item/rig_module/module = loc
if(module.holder && module.holder.cell)
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 3c2b02feed..17a27aa85e 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -69,59 +69,24 @@
item_state = "card-id"
origin_tech = list(TECH_MAGNET = 2, TECH_ILLEGAL = 2)
var/uses = 10
- // List of devices that cost a use to emag.
- var/list/devices = list(
- /obj/item/robot_parts,
- /obj/item/weapon/storage/lockbox,
- /obj/item/weapon/storage/secure,
- /obj/item/weapon/circuitboard,
- /obj/item/weapon/rig,
- /obj/item/device/eftpos,
- /obj/item/device/lightreplacer,
- /obj/item/device/taperecorder,
- /obj/item/device/hailer,
- /obj/item/device/megaphone,
- /obj/item/clothing/accessory/badge/holo,
- /obj/structure/closet/crate/secure,
- /obj/structure/closet/secure_closet,
- /obj/machinery/librarycomp,
- /obj/machinery/computer,
- /obj/machinery/power,
- /obj/machinery/suspension_gen,
- /obj/machinery/shield_capacitor,
- /obj/machinery/shield_gen,
- /obj/machinery/clonepod,
- /obj/machinery/deployable,
- /obj/machinery/button/remote,
- /obj/machinery/porta_turret,
- /obj/machinery/shieldgen,
- /obj/machinery/turretid,
- /obj/machinery/vending,
- /mob/living/bot,
- /obj/machinery/door,
- /obj/machinery/telecomms,
- /obj/machinery/mecha_part_fabricator,
- /obj/machinery/gibber,
- /obj/vehicle
- )
+/obj/item/weapon/card/emag/resolve_attackby(atom/A, mob/user)
+ var/used_uses = A.emag_act(uses, user)
+ if(used_uses < 0)
+ return ..(A, user)
-/obj/item/weapon/card/emag/afterattack(var/obj/item/weapon/O as obj, mob/user as mob)
-
- for(var/type in devices)
- if(istype(O,type))
- uses--
- break
+ uses -= used_uses
+ A.add_fingerprint(user)
+ log_and_message_admins("emagged \an [A].")
if(uses<1)
- user.visible_message("[src] fizzles and sparks - it seems it's been used once too often, and is now broken.")
+ user.visible_message("\The [src] fizzles and sparks - it seems it's been used once too often, and is now spent.")
user.drop_item()
var/obj/item/weapon/card/emag_broken/junk = new(user.loc)
junk.add_fingerprint(user)
qdel(src)
- return
- ..()
+ return 1
/obj/item/weapon/card/id
name = "identification card"
@@ -145,9 +110,10 @@
..()
spawn(30)
if(istype(loc, /mob/living/carbon/human))
- blood_type = loc:dna:b_type
- dna_hash = loc:dna:unique_enzymes
- fingerprint_hash = md5(loc:dna:uni_identity)
+ var/mob/living/carbon/human/H = loc
+ blood_type = H.dna.b_type
+ dna_hash = H.dna.unique_enzymes
+ fingerprint_hash = md5(H.dna.uni_identity)
/obj/item/weapon/card/id/attack_self(mob/user as mob)
for(var/mob/O in viewers(user, null))
diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm
index a9ca4b8dc0..4e444a5ebc 100644
--- a/code/game/objects/items/weapons/cigs_lighters.dm
+++ b/code/game/objects/items/weapons/cigs_lighters.dm
@@ -39,6 +39,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/smoketime = 5
w_class = 1.0
origin_tech = list(TECH_MATERIAL = 1)
+ slot_flags = SLOT_EARS
attack_verb = list("burnt", "singed")
/obj/item/weapon/flame/match/process()
@@ -55,8 +56,14 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
/obj/item/weapon/flame/match/dropped(mob/user as mob)
+ //If dropped, put ourselves out
+ //not before lighting up the turf we land on, though.
if(lit)
- burn_out()
+ spawn(0)
+ var/turf/location = src.loc
+ if(istype(location))
+ location.hotspot_expose(700, 5)
+ burn_out()
return ..()
/obj/item/weapon/flame/match/proc/burn_out()
@@ -199,6 +206,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
throw_speed = 0.5
item_state = "cigoff"
w_class = 1
+ slot_flags = SLOT_EARS | SLOT_MASK
attack_verb = list("burnt", "singed")
icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
icon_off = "cigoff"
@@ -283,6 +291,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon = 'icons/obj/clothing/masks.dmi'
icon_state = "cigbutt"
w_class = 1
+ slot_flags = SLOT_EARS
throwforce = 1
/obj/item/weapon/cigbutt/New()
@@ -457,9 +466,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_state = "[base_state]"
item_state = "[base_state]"
if(istype(src, /obj/item/weapon/flame/lighter/zippo) )
- user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing.")
+ user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing.")
else
- user.visible_message("[user] quietly shuts off the [src].")
+ user.visible_message("[user] quietly shuts off the [src].")
set_light(0)
processing_objects.Remove(src)
diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
index 56fbf2bff2..ef6b4c4d57 100644
--- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
+++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm
@@ -36,16 +36,18 @@
/obj/item/weapon/circuitboard/security/deconstruct(var/obj/machinery/computer/security/C)
if (..(C))
network = C.network
+
+/obj/item/weapon/circuitboard/security/emag_act(var/remaining_charges, var/mob/user)
+ if(emagged)
+ user << "Circuit lock is already removed."
+ return
+ user << "You override the circuit lock and open controls."
+ emagged = 1
+ locked = 0
+ return 1
/obj/item/weapon/circuitboard/security/attackby(obj/item/I as obj, mob/user as mob)
- if(istype(I,/obj/item/weapon/card/emag))
- if(emagged)
- user << "Circuit lock is already removed."
- return
- user << "You override the circuit lock and open controls."
- emagged = 1
- locked = 0
- else if(istype(I,/obj/item/weapon/card/id))
+ if(istype(I,/obj/item/weapon/card/id))
if(emagged)
user << "Circuit lock does not respond."
return
diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm
index d5a36d6cba..e32b58e098 100644
--- a/code/game/objects/items/weapons/clown_items.dm
+++ b/code/game/objects/items/weapons/clown_items.dm
@@ -32,7 +32,7 @@
else if(istype(target,/turf))
user << "You scrub \the [target.name] clean."
var/turf/T = target
- T.clean()
+ T.clean(src)
else
user << "You clean \the [target.name]."
target.clean_blood()
diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm
index 29c3f64820..218d2fb21c 100644
--- a/code/game/objects/items/weapons/cosmetics.dm
+++ b/code/game/objects/items/weapons/cosmetics.dm
@@ -5,6 +5,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "lipstick"
w_class = 1.0
+ slot_flags = SLOT_EARS
var/colour = "red"
var/open = 0
@@ -71,6 +72,7 @@
name = "purple comb"
desc = "A pristine purple comb made from flexible plastic."
w_class = 1.0
+ slot_flags = SLOT_EARS
icon = 'icons/obj/items.dmi'
icon_state = "purplecomb"
item_state = "purplecomb"
diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm
index b94fd2d360..7c685a9e1d 100644
--- a/code/game/objects/items/weapons/dna_injector.dm
+++ b/code/game/objects/items/weapons/dna_injector.dm
@@ -9,6 +9,7 @@
throw_speed = 1
throw_range = 5
w_class = 1.0
+ slot_flags = SLOT_EARS
var/uses = 1
var/nofail
var/is_bullet = 0
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 4eec1009e5..aa7f6df8e4 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -15,8 +15,8 @@
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
var/spray_particles = 6
- var/spray_amount = 2 //units of liquid per particle
- var/max_water = 120
+ var/spray_amount = 8 //units of liquid per particle
+ var/max_water = 240
var/last_use = 1.0
var/safety = 1
var/sprite_name = "fire_extinguisher"
@@ -30,7 +30,8 @@
throwforce = 2
w_class = 2.0
force = 3.0
- max_water = 60
+ max_water = 120
+ spray_particles = 5
sprite_name = "miniFE"
/obj/item/weapon/extinguisher/New()
@@ -49,6 +50,24 @@
user << "The safety is [safety ? "on" : "off"]."
return
+/obj/item/weapon/extinguisher/proc/propel_object(var/obj/O, mob/user, movementdirection)
+ if(O.anchored) return
+
+ var/obj/structure/bed/chair/C
+ if(istype(O, /obj/structure/bed/chair))
+ C = O
+
+ var/list/move_speed = list(1, 1, 1, 2, 2, 3)
+ for(var/i in 1 to 6)
+ if(C) C.propelled = (6-i)
+ O.Move(get_step(user,movementdirection), movementdirection)
+ sleep(move_speed[i])
+
+ //additional movement
+ for(var/i in 1 to 3)
+ O.Move(get_step(user,movementdirection), movementdirection)
+ sleep(3)
+
/obj/item/weapon/extinguisher/afterattack(var/atom/target, var/mob/user, var/flag)
//TODO; Add support for reagents in water.
@@ -73,35 +92,9 @@
var/direction = get_dir(src,target)
- if(user.buckled && isobj(user.buckled) && !user.buckled.anchored )
+ if(user.buckled && isobj(user.buckled))
spawn(0)
- var/obj/structure/bed/chair/C = null
- if(istype(user.buckled, /obj/structure/bed/chair))
- C = user.buckled
- var/obj/B = user.buckled
- var/movementdirection = turn(direction,180)
- if(C) C.propelled = 4
- B.Move(get_step(user,movementdirection), movementdirection)
- sleep(1)
- B.Move(get_step(user,movementdirection), movementdirection)
- if(C) C.propelled = 3
- sleep(1)
- B.Move(get_step(user,movementdirection), movementdirection)
- sleep(1)
- B.Move(get_step(user,movementdirection), movementdirection)
- if(C) C.propelled = 2
- sleep(2)
- B.Move(get_step(user,movementdirection), movementdirection)
- if(C) C.propelled = 1
- sleep(2)
- B.Move(get_step(user,movementdirection), movementdirection)
- if(C) C.propelled = 0
- sleep(3)
- B.Move(get_step(user,movementdirection), movementdirection)
- sleep(3)
- B.Move(get_step(user,movementdirection), movementdirection)
- sleep(3)
- B.Move(get_step(user,movementdirection), movementdirection)
+ propel_object(user.buckled, user, turn(direction,180))
var/turf/T = get_turf(target)
var/turf/T1 = get_step(T,turn(direction, 90))
@@ -111,19 +104,15 @@
for(var/a = 1 to spray_particles)
spawn(0)
+ if(!src || !reagents.total_volume) return
+
var/obj/effect/effect/water/W = PoolOrNew(/obj/effect/effect/water, get_turf(src))
var/turf/my_target
- if(a == 1)
- my_target = T
- else if(a == 2)
- my_target = T1
- else if(a == 3)
- my_target = T2
+ if(a <= the_targets.len)
+ my_target = the_targets[a]
else
my_target = pick(the_targets)
W.create_reagents(spray_amount)
- if(!src)
- return
reagents.trans_to_obj(W, spray_amount)
W.set_color()
W.set_up(my_target)
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index 09816e3568..bbdd46cdb3 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -112,20 +112,9 @@
update_icon()
return
- if(istype(W, /obj/item/device/analyzer) && ptank)
- var/obj/item/weapon/icon = src
- user.visible_message("[user] has used the analyzer on \icon[icon]")
- var/pressure = ptank.air_contents.return_pressure()
- var/total_moles = ptank.air_contents.total_moles
-
- user << "Results of analysis of \icon[icon]"
- if(total_moles>0)
- user << "Pressure: [round(pressure,0.1)] kPa"
- for(var/g in ptank.air_contents.gas)
- user << "[gas_data.name[g]]: [round((ptank.air_contents.gas[g] / total_moles) * 100)]%"
- user << "Temperature: [round(ptank.air_contents.temperature-T0C)]°C"
- else
- user << "Tank is empty!"
+ if(istype(W, /obj/item/device/analyzer))
+ var/obj/item/device/analyzer/A = W
+ A.analyze_gases(src, user)
return
..()
return
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index b4e5bd251b..610536f4d0 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -1,7 +1,7 @@
/obj/item/weapon/grenade/chem_grenade
name = "grenade casing"
icon_state = "chemg"
- item_state = "flashbang"
+ item_state = "grenade"
desc = "A hand made chemical grenade."
w_class = 2.0
force = 2.0
@@ -78,7 +78,7 @@
user << "You lock the assembly."
name = "grenade"
else
-// user << "You need to add at least one beaker before locking the assembly."
+// user << "You need to add at least one beaker before locking the assembly."
user << "You lock the empty assembly."
name = "fake grenade"
playsound(src.loc, 'sound/items/Screwdriver.ogg', 25, -3)
diff --git a/code/game/objects/items/weapons/grenades/emgrenade.dm b/code/game/objects/items/weapons/grenades/emgrenade.dm
index f8c2a12d2f..25e65f924d 100644
--- a/code/game/objects/items/weapons/grenades/emgrenade.dm
+++ b/code/game/objects/items/weapons/grenades/emgrenade.dm
@@ -1,7 +1,7 @@
/obj/item/weapon/grenade/empgrenade
name = "classic emp grenade"
icon_state = "emp"
- item_state = "emp"
+ item_state = "empgrenade"
origin_tech = list(TECH_MATERIAL = 2, TECH_MAGNET = 3)
prime()
diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm
index 1565d321b6..16d8a620f9 100644
--- a/code/game/objects/items/weapons/grenades/grenade.dm
+++ b/code/game/objects/items/weapons/grenades/grenade.dm
@@ -4,7 +4,7 @@
w_class = 2.0
icon = 'icons/obj/grenade.dmi'
icon_state = "grenade"
- item_state = "flashbang"
+ item_state = "grenade"
throw_speed = 4
throw_range = 20
flags = CONDUCT
diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm
index 4b15fb8ffb..49b1b280a7 100644
--- a/code/game/objects/items/weapons/implants/implantcase.dm
+++ b/code/game/objects/items/weapons/implants/implantcase.dm
@@ -38,7 +38,7 @@
user << "\The [src] is full."
else
spawn(5)
- I.reagents.trans_to_mob(src.imp, 5)
+ I.reagents.trans_to_obj(src.imp, 5)
user << "You inject 5 units of the solution. The syringe now contains [I.reagents.total_volume] units."
else if (istype(I, /obj/item/weapon/implanter))
var/obj/item/weapon/implanter/M = I
diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm
index 033042b853..d5e7cd67bb 100644
--- a/code/game/objects/items/weapons/material/ashtray.dm
+++ b/code/game/objects/items/weapons/material/ashtray.dm
@@ -62,8 +62,8 @@ var/global/list/ashtray_cache = list()
cig.transfer_fingerprints_to(butt)
qdel(cig)
W = butt
- spawn(1)
- TemperatureAct(150)
+ //spawn(1)
+ // TemperatureAct(150)
else if (cig.lit == 0)
user << "You place [cig] in [src] without even smoking it. Why would you do that?"
diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm
index 78d8e3ad11..d0e81e9548 100644
--- a/code/game/objects/items/weapons/material/kitchen.dm
+++ b/code/game/objects/items/weapons/material/kitchen.dm
@@ -61,7 +61,7 @@
attack_verb = list("attacked", "poked")
edge = 0
sharp = 0
- force_divisor = 0.25 //5 when wielded with weight 20 (steel)
+ force_divisor = 0.1 //2 when wielded with weight 20 (steel)
/obj/item/weapon/material/kitchen/utensil/spoon/plastic
default_material = "plastic"
@@ -71,9 +71,9 @@
*/
/obj/item/weapon/material/kitchen/utensil/knife
name = "knife"
- desc = "Can cut through any food."
+ desc = "A knife for eating with. Can cut through any food."
icon_state = "knife"
- force_divisor = 0.2 // 12 when wielded with hardness 60 (steel)
+ force_divisor = 0.1 // 6 when wielded with hardness 60 (steel)
/obj/item/weapon/material/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
@@ -100,7 +100,7 @@
name = "rolling pin"
desc = "Used to knock out the Bartender."
icon_state = "rolling_pin"
- attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked") //I think the rollingpin attackby will end up ignoring this anyway.
+ attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
default_material = "wood"
force_divisor = 0.7 // 10 when wielded with weight 15 (wood)
thrown_force_divisor = 1 // as above
diff --git a/code/game/objects/items/weapons/material/knives.dm b/code/game/objects/items/weapons/material/knives.dm
index 205a06c9f6..0ddf3fa894 100644
--- a/code/game/objects/items/weapons/material/knives.dm
+++ b/code/game/objects/items/weapons/material/knives.dm
@@ -16,7 +16,7 @@
sharp = 1
..() //Updates force.
throwforce = max(3,force-3)
- hitsound = initial(hitsound)
+ hitsound = 'sound/weapons/bladeslice.ogg'
icon_state += "_open"
w_class = 3
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
@@ -24,7 +24,7 @@
force = 3
edge = 0
sharp = 0
- hitsound = null
+ hitsound = initial(hitsound)
icon_state = initial(icon_state)
w_class = initial(w_class)
attack_verb = initial(attack_verb)
@@ -38,10 +38,10 @@
/obj/item/weapon/material/butterfly/attack_self(mob/user)
active = !active
if(active)
- user << "You flip out your [src]."
+ user << "You flip out \the [src]."
playsound(user, 'sound/weapons/flipblade.ogg', 15, 1)
else
- user << "The butterfly knife can now be concealed."
+ user << "\The [src] can now be concealed."
update_force()
add_fingerprint(user)
diff --git a/code/game/objects/items/weapons/material/material_weapons.dm b/code/game/objects/items/weapons/material/material_weapons.dm
index 6ff156b27f..18181df6b0 100644
--- a/code/game/objects/items/weapons/material/material_weapons.dm
+++ b/code/game/objects/items/weapons/material/material_weapons.dm
@@ -17,6 +17,7 @@
var/thrown_force_divisor = 0.5
var/default_material = DEFAULT_WALL_MATERIAL
var/material/material
+ var/drops_debris = 1
/obj/item/weapon/material/New(var/newloc, var/material_key)
..(newloc)
@@ -33,6 +34,9 @@
if(!isnull(matter[material_type]))
matter[material_type] *= force_divisor // May require a new var instead.
+/obj/item/weapon/material/get_material()
+ return material
+
/obj/item/weapon/material/proc/update_force()
if(edge || sharp)
force = material.get_edge_damage()
@@ -70,33 +74,37 @@
health--
check_health()
-/obj/item/weapon/material/proc/check_health()
+/obj/item/weapon/material/proc/check_health(var/consumed)
if(health<=0)
- shatter()
+ shatter(consumed)
-/obj/item/weapon/material/proc/shatter()
+/obj/item/weapon/material/proc/shatter(var/consumed)
var/turf/T = get_turf(src)
T.visible_message("\The [src] [material.destruction_desc]!")
if(istype(loc, /mob/living))
var/mob/living/M = loc
M.drop_from_inventory(src)
playsound(src, "shatter", 70, 1)
- material.place_shard(T)
+ if(!consumed && drops_debris) material.place_shard(T)
qdel(src)
-
+/*
+Commenting this out pending rebalancing of radiation based on small objects.
/obj/item/weapon/material/process()
if(!material.radioactivity)
return
for(var/mob/living/L in range(1,src))
- L.apply_effect(round(material.radioactivity/3),IRRADIATE,0)
+ L.apply_effect(round(material.radioactivity/30),IRRADIATE,0)
+*/
+/*
+// Commenting this out while fires are so spectacularly lethal, as I can't seem to get this balanced appropriately.
/obj/item/weapon/material/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
TemperatureAct(exposed_temperature)
// This might need adjustment. Will work that out later.
/obj/item/weapon/material/proc/TemperatureAct(temperature)
health -= material.combustion_effect(get_turf(src), temperature, 0.1)
- check_health()
+ check_health(1)
/obj/item/weapon/material/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/weldingtool))
@@ -104,4 +112,5 @@
if(material.ignition_point && WT.remove_fuel(0, user))
TemperatureAct(150)
else
- return ..()
\ No newline at end of file
+ return ..()
+*/
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/material/shards.dm b/code/game/objects/items/weapons/material/shards.dm
index 2bb0f91e2f..8ad4b68721 100644
--- a/code/game/objects/items/weapons/material/shards.dm
+++ b/code/game/objects/items/weapons/material/shards.dm
@@ -14,6 +14,7 @@
attack_verb = list("stabbed", "slashed", "sliced", "cut")
default_material = "glass"
unbreakable = 1 //It's already broken.
+ drops_debris = 0
/obj/item/weapon/material/shard/suicide_act(mob/user)
viewers(user) << pick("\The [user] is slitting \his wrists with \the [src]! It looks like \he's trying to commit suicide.",
@@ -72,6 +73,8 @@
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
+ if(!affecting)
+ return
if(affecting.status & ORGAN_ROBOT)
return
if(affecting.take_damage(5, 0))
@@ -86,4 +89,4 @@
..(loc, "steel")
/obj/item/weapon/material/shard/phoron/New(loc)
- ..(loc, "phoron glass")
+ ..(loc, "phglass")
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index 66310cf26f..6876310343 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -34,7 +34,7 @@
/obj/item/weapon/melee/energy/attack_self(mob/living/user as mob)
if (active)
if ((CLUMSY in user.mutations) && prob(50))
- user.visible_message("[user] accidentally cuts \himself with \the [src].",\
+ user.visible_message("\The [user] accidentally cuts \himself with \the [src].",\
"You accidentally cut yourself with \the [src].")
user.take_organ_damage(5,5)
deactivate(user)
@@ -50,9 +50,10 @@
return
/obj/item/weapon/melee/energy/suicide_act(mob/user)
+ var/tempgender = "[user.gender == MALE ? "he's" : user.gender == FEMALE ? "she's" : "they are"]"
if (active)
- viewers(user) << pick("\The [user] is slitting \his stomach open with \the [src]! It looks like \he's trying to commit seppuku.", \
- "\The [user] is falling on \the [src]! It looks like \he's trying to commit suicide.")
+ viewers(user) << pick("\The [user] is slitting \his stomach open with \the [src]! It looks like [tempgender] trying to commit seppuku.", \
+ "\The [user] is falling on \the [src]! It looks like [tempgender] trying to commit suicide.")
return (BRUTELOSS|FIRELOSS)
/*
@@ -90,7 +91,7 @@
user << "\The [src] is de-energised. It's just a regular axe now."
/obj/item/weapon/melee/energy/axe/suicide_act(mob/user)
- viewers(user) << "\The [user] swings \the [src] towards /his head! It looks like \he's trying to commit suicide."
+ viewers(user) << "\The [user] swings \the [src] towards \his head! It looks like \he's trying to commit suicide."
return (BRUTELOSS|FIRELOSS)
/*
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index 17af445e19..abf5e08a3b 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -16,6 +16,7 @@
/obj/item/weapon/mop/New()
create_reagents(5)
+//expects an atom containing the reagents used to clean the turf
/turf/proc/clean(atom/source)
if(source.reagents.has_reagent("water", 1))
clean_blood()
diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm
index 05709898d6..8cc8ee5cfa 100644
--- a/code/game/objects/items/weapons/scrolls.dm
+++ b/code/game/objects/items/weapons/scrolls.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll"
var/uses = 4.0
- w_class = 2.0
+ w_class = 1
item_state = "paper"
throw_speed = 4
throw_range = 20
diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm
index f42685b792..e4df419e18 100644
--- a/code/game/objects/items/weapons/storage/backpack.dm
+++ b/code/game/objects/items/weapons/storage/backpack.dm
@@ -214,8 +214,10 @@
name = "captain's satchel"
desc = "An exclusive satchel for Nanotrasen officers."
icon_state = "satchel-cap"
- item_state = "captainpack"
- item_state_slots = null
+ item_state_slots = list(
+ slot_l_hand_str = "satchel-cap",
+ slot_r_hand_str = "satchel-cap",
+ )
//ERT backpacks.
/obj/item/weapon/storage/backpack/ert
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 4c808ad2f5..0feb298692 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -119,10 +119,10 @@
//verbs += /obj/item/weapon/storage/bag/sheetsnatcher/quick_empty
can_be_inserted(obj/item/W as obj, stop_messages = 0)
- if(!istype(W,/obj/item/stack/material) || istype(W,/obj/item/stack/material/sandstone) || istype(W,/obj/item/stack/material/wood))
+ if(!istype(W,/obj/item/stack/material))
if(!stop_messages)
usr << "The snatcher does not accept [W]."
- return 0 //I don't care, but the existing code rejects them for not being "sheets" *shrug* -Sayu
+ return 0
var/current = 0
for(var/obj/item/stack/material/S in contents)
current += S.amount
diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm
index b5466f7a39..297ac1d4b1 100644
--- a/code/game/objects/items/weapons/storage/lockbox.dm
+++ b/code/game/objects/items/weapons/storage/lockbox.dm
@@ -34,23 +34,13 @@
return
else
user << "Access Denied"
- else if((istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !src.broken)
- broken = 1
- locked = 0
- desc = "It appears to be broken."
- icon_state = src.icon_broken
- if(istype(W, /obj/item/weapon/melee/energy/blade))
+ else if(istype(W, /obj/item/weapon/melee/energy/blade))
+ if(emag_act(INFINITY, user, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying."))
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
- for(var/mob/O in viewers(user, 3))
- O.show_message(text("The locker has been sliced open by [] with an energy blade!", user), 1, text("You hear metal being sliced and sparks flying."), 2)
- else
- for(var/mob/O in viewers(user, 3))
- O.show_message(text("The locker has been broken by [] with an electromagnetic card!", user), 1, text("You hear a faint electrical spark."), 2)
-
if(!locked)
..()
else
@@ -65,6 +55,23 @@
..()
return
+/obj/item/weapon/storage/lockbox/emag_act(var/remaining_charges, var/mob/user, var/visual_feedback = "", var/audible_feedback = "")
+ if(!broken)
+ if(visual_feedback)
+ visual_feedback = "[visual_feedback]"
+ else
+ visual_feedback = "The locker has been sliced open by [user] with an electromagnetic card!"
+ if(audible_feedback)
+ audible_feedback = "[audible_feedback]"
+ else
+ audible_feedback = "You hear a faint electrical spark."
+
+ broken = 1
+ locked = 0
+ desc = "It appears to be broken."
+ icon_state = src.icon_broken
+ visible_message(visual_feedback, audible_feedback)
+ return 1
/obj/item/weapon/storage/lockbox/loyalty
name = "lockbox of loyalty implants"
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index ef5d8db334..ebd76a64a5 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -33,22 +33,12 @@
attackby(obj/item/weapon/W as obj, mob/user as mob)
if(locked)
- if ( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && (!src.emagged))
- emagged = 1
- src.overlays += image('icons/obj/storage.dmi', icon_sparking)
- sleep(6)
- src.overlays = null
- overlays += image('icons/obj/storage.dmi', icon_locking)
- locked = 0
- if(istype(W, /obj/item/weapon/melee/energy/blade))
- var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
- spark_system.set_up(5, 0, src.loc)
- spark_system.start()
- playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
- playsound(src.loc, "sparks", 50, 1)
- user << "You slice through the lock on [src]."
- else
- user << "You short out the lock on [src]."
+ if (emag_act(INFINITY, user, "You slice through the lock of \the [src]"))
+ var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
+ spark_system.set_up(5, 0, src.loc)
+ spark_system.start()
+ playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
+ playsound(src.loc, "sparks", 50, 1)
return
if (istype(W, /obj/item/weapon/screwdriver))
@@ -136,6 +126,17 @@
return
return
+/obj/item/weapon/storage/secure/emag_act(var/remaining_charges, var/mob/user, var/feedback)
+ if(!emagged)
+ emagged = 1
+ src.overlays += image('icons/obj/storage.dmi', icon_sparking)
+ sleep(6)
+ src.overlays = null
+ overlays += image('icons/obj/storage.dmi', icon_locking)
+ locked = 0
+ user << (feedback ? feedback : "You short out the lock of \the [src].")
+ return 1
+
// -----------------------------
// Secure Briefcase
// -----------------------------
@@ -157,7 +158,7 @@
attack_hand(mob/user as mob)
if ((src.loc == user) && (src.locked == 1))
- usr << "[src] is locked and cannot be opened!"
+ usr << "[src] is locked and cannot be opened!"
else if ((src.loc == user) && (!src.locked))
src.open(usr)
else
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 70c1d33d73..131347ac29 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -335,7 +335,6 @@
..()
if(isrobot(user))
- user << "You're a robot. No."
return //Robots can't interact with storage items.
if(!can_be_inserted(W))
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index cc54970009..39eb9fb25f 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -100,7 +100,7 @@
/obj/item/weapon/melee/baton/attack(mob/M, mob/user)
if(status && (CLUMSY in user.mutations) && prob(50))
- user << "span class='danger'>You accidentally hit yourself with the [src]!"
+ user << "You accidentally hit yourself with the [src]!"
user.Weaken(30)
deductcharge(hitcost)
return
@@ -130,7 +130,7 @@
target_zone = get_zone_with_miss_chance(user.zone_sel.selecting, L)
if(!target_zone)
- L.visible_message(">span class='danger'>\The [user] misses [L] with \the [src]!")
+ L.visible_message("\The [user] misses [L] with \the [src]!")
return 0
var/mob/living/carbon/human/H = L
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index 0eecde46a5..7e96ad2c08 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -83,6 +83,7 @@
sharp = 1
edge = 1
w_class = 1
+ slot_flags = SLOT_EARS
throwforce = 5.0
throw_speed = 3
throw_range = 5
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 8c5b1de026..049d179846 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -87,28 +87,12 @@
/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
- var/obj/icon = src
-
if (istype(src.loc, /obj/item/assembly))
icon = src.loc
if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
- for (var/mob/O in viewers(user, null))
- O << "\The [user] has used [W] on \icon[icon] [src]"
-
- var/pressure = air_contents.return_pressure()
- manipulated_by = user.real_name //This person is aware of the contents of the tank.
- var/total_moles = air_contents.total_moles
-
- user << "Results of analysis of \icon[icon]"
- if (total_moles>0)
- user << "Pressure: [round(pressure,0.1)] kPa"
- for(var/g in air_contents.gas)
- user << "[gas_data.name[g]]: [(round(air_contents.gas[g] / total_moles) * 100)]%"
- user << "Temperature: [round(air_contents.temperature-T0C)]°C"
- else
- user << "Tank is empty!"
- src.add_fingerprint(user)
+ var/obj/item/device/analyzer/A = W
+ A.analyze_gases(src, user)
else if (istype(W,/obj/item/latexballon))
var/obj/item/latexballon/LB = W
LB.blow(src)
@@ -131,7 +115,7 @@
location = loc.loc
else if(istype(loc, /mob/living/carbon))
location = loc
-
+
var/using_internal
if(istype(location))
if(location.internal==src)
@@ -278,11 +262,11 @@
var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE
explosion(
- get_turf(loc),
- round(min(BOMBCAP_DVSTN_RADIUS, range*0.25)),
- round(min(BOMBCAP_HEAVY_RADIUS, range*0.50)),
- round(min(BOMBCAP_LIGHT_RADIUS, range*1.00)),
- round(min(BOMBCAP_FLASH_RADIUS, range*1.50)),
+ get_turf(loc),
+ round(min(BOMBCAP_DVSTN_RADIUS, range*0.25)),
+ round(min(BOMBCAP_HEAVY_RADIUS, range*0.50)),
+ round(min(BOMBCAP_LIGHT_RADIUS, range*1.00)),
+ round(min(BOMBCAP_FLASH_RADIUS, range*1.50)),
)
qdel(src)
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index d51a9a1e3b..ccb61a5abf 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -38,7 +38,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "screwdriver"
flags = CONDUCT
- slot_flags = SLOT_BELT
+ slot_flags = SLOT_BELT | SLOT_EARS
force = 5.0
w_class = 1.0
throwforce = 5.0
@@ -212,8 +212,12 @@
/obj/item/weapon/weldingtool/process()
- if(welding && prob(5) && !remove_fuel(1))
- setWelding(0)
+ if(welding)
+ if(prob(5))
+ remove_fuel(1)
+
+ if(get_fuel() == 0)
+ setWelding(0)
//I'm not sure what this does. I assume it has to do with starting fires...
//...but it doesnt check to see if the welder is on or not.
@@ -262,6 +266,8 @@
//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use()
/obj/item/weapon/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/M = null)
+ if(!welding)
+ return 0
if(get_fuel() >= amount)
reagents.remove_reagent("fuel", amount)
if(M)
@@ -292,7 +298,7 @@
var/turf/T = get_turf(src)
//If we're turning it on
if(set_welding && !welding)
- if (remove_fuel(1))
+ if (get_fuel() > 0)
if(M)
M << "You switch the [src] on."
else if(T)
diff --git a/code/game/objects/items/weapons/traps.dm b/code/game/objects/items/weapons/traps.dm
index f6af73843c..d62b89f3fa 100644
--- a/code/game/objects/items/weapons/traps.dm
+++ b/code/game/objects/items/weapons/traps.dm
@@ -20,20 +20,20 @@
/obj/item/weapon/beartrap/attack_self(mob/user as mob)
..()
- if(deployed && can_use(user))
+ if(!deployed && can_use(user))
user.visible_message(
- "[user] starts to deploy \the [src].",
- "You begin deploying \the [src]!",
+ "[user] starts to deploy \the [src].",
+ "You begin deploying \the [src]!",
"You hear the slow creaking of a spring."
)
-
+
if (do_after(user, 60))
user.visible_message(
- "[user] has deployed \the [src].",
+ "[user] has deployed \the [src].",
"You have deployed \the [src]!",
"You hear a latch click loudly."
)
-
+
deployed = 1
user.drop_from_inventory(src)
update_icon()
@@ -42,7 +42,7 @@
/obj/item/weapon/beartrap/attack_hand(mob/user as mob)
if(buckled_mob && can_use(user))
user.visible_message(
- "[user] begins freeing [buckled_mob] from \the [src].",
+ "[user] begins freeing [buckled_mob] from \the [src].",
"You carefully begin to free [buckled_mob] from \the [src].",
)
if(do_after(user, 60))
@@ -51,13 +51,13 @@
anchored = 0
else if(deployed && can_use(user))
user.visible_message(
- "[user] starts to disarm \the [src].",
+ "[user] starts to disarm \the [src].",
"You begin disarming \the [src]!",
"You hear a latch click followed by the slow creaking of a spring."
)
if(do_after(user, 60))
user.visible_message(
- "[user] has disarmed \the [src].",
+ "[user] has disarmed \the [src].",
"You have disarmed \the [src]!"
)
deployed = 0
@@ -86,15 +86,18 @@
//trap the victim in place
if(!blocked)
set_dir(L.dir)
+ can_buckle = 1
buckle_mob(L)
L << "The steel jaws of \the [src] bite into you, trapping you in place!"
+ deployed = 0
+ can_buckle = initial(can_buckle)
/obj/item/weapon/beartrap/Crossed(AM as mob|obj)
- if(isliving(AM))
+ if(deployed && isliving(AM))
var/mob/living/L = AM
if(L.m_intent == "run")
L.visible_message(
- "[L] steps on \the [src].",
+ "[L] steps on \the [src].",
"You step on \the [src]!",
"You hear a loud metallic snap!"
)
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 795027ea3f..cb3214122a 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -14,6 +14,11 @@
var/damtype = "brute"
var/force = 0
+/obj/Destroy()
+ processing_objects -= src
+ nanomanager.close_uis(src)
+ return ..()
+
/obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = default_state)
// Calling Topic without a corresponding window open causes runtime errors
if(!nowindow && ..())
@@ -141,4 +146,4 @@
return
/obj/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
- return
\ No newline at end of file
+ return
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 7d2ca17eb9..68aeecd912 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -220,8 +220,11 @@
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0,user))
- user << "You need more welding fuel to complete this task."
- return
+ if(!WT.isOn())
+ return
+ else
+ user << "You need more welding fuel to complete this task."
+ return
new /obj/item/stack/material/steel(src.loc)
for(var/mob/M in viewers(src))
M.show_message("\The [src] has been cut apart by [user] with \the [WT].", 3, "You hear welding.", 2)
@@ -239,8 +242,11 @@
else if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0,user))
- user << "You need more welding fuel to complete this task."
- return
+ if(!WT.isOn())
+ return
+ else
+ user << "You need more welding fuel to complete this task."
+ return
src.welded = !src.welded
src.update_icon()
for(var/mob/M in viewers(src))
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
index 66609f5661..c732faeeea 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
@@ -83,22 +83,26 @@
src.desc = "Owned by [I.registered_name]."
else
user << "Access Denied"
- else if( (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !src.broken)
- broken = 1
- locked = 0
- desc = "It appears to be broken."
- icon_state = src.icon_broken
- if(istype(W, /obj/item/weapon/melee/energy/blade))
+ else if(istype(W, /obj/item/weapon/melee/energy/blade))
+ if(emag_act(INFINITY, user, "The locker has been sliced open by [user] with \an [W]!", "You hear metal being sliced and sparks flying."))
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
- for(var/mob/O in viewers(user, 3))
- O.show_message("The locker has been sliced open by [user] with an energy blade!", 1, "You hear metal being sliced and sparks flying.", 2)
else
user << "Access Denied"
return
+
+/obj/structure/closet/secure_closet/personal/emag_act(var/remaining_charges, var/mob/user, var/visual_feedback, var/audible_feedback)
+ if(!broken)
+ broken = 1
+ locked = 0
+ desc = "It appears to be broken."
+ icon_state = src.icon_broken
+ if(visual_feedback)
+ visible_message("[visual_feedback]", "[audible_feedback]")
+ return 1
/obj/structure/closet/secure_closet/personal/verb/reset()
set src in oview(1) // One square distance
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
index 55cd3b51ca..3bc5dfc393 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
@@ -78,28 +78,31 @@
user.drop_item()
if(W)
W.loc = src.loc
- else if((istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)) && !src.broken)
- broken = 1
- locked = 0
- desc = "It appears to be broken."
- icon_state = icon_off
- flick(icon_broken, src)
- if(istype(W, /obj/item/weapon/melee/energy/blade))
+ else if(istype(W, /obj/item/weapon/melee/energy/blade))
+ if(emag_act(INFINITY, user, "The locker has been sliced open by [user] with \an [W]!", "You hear metal being sliced and sparks flying."))
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src.loc)
spark_system.start()
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
- for(var/mob/O in viewers(user, 3))
- O.show_message("The locker has been sliced open by [user] with an energy blade!", 1, "You hear metal being sliced and sparks flying.", 2)
- else
- for(var/mob/O in viewers(user, 3))
- O.show_message("The locker has been broken by [user] with an electromagnetic card!", 1, "You hear a faint electrical spark.", 2)
else if(istype(W,/obj/item/weapon/packageWrap) || istype(W,/obj/item/weapon/weldingtool))
return ..(W,user)
else
togglelock(user)
+/obj/structure/closet/secure_closet/attack_hand(var/remaining_charges, var/mob/user, var/visual_feedback, var/audible_feedback)
+ if(!broken)
+ broken = 1
+ locked = 0
+ desc = "It appears to be broken."
+ icon_state = icon_off
+ flick(icon_broken, src)
+
+ if(visual_feedback)
+ visible_message(visual_feedback, audible_feedback)
+ else
+ visible_message("The locker has been broken by [user] with an electromagnetic card!", "You hear a faint electrical spark.")
+
/obj/structure/closet/secure_closet/attack_hand(mob/user as mob)
src.add_fingerprint(user)
if(src.locked)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
index f0c96695dc..61d20f9de5 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
@@ -16,7 +16,7 @@
new /obj/item/weapon/storage/backpack/satchel_cap(src)
new /obj/item/clothing/suit/captunic(src)
new /obj/item/clothing/suit/captunic/capjacket(src)
- new /obj/item/clothing/head/helmet/cap(src)
+ new /obj/item/clothing/head/caphat/cap(src)
new /obj/item/clothing/under/rank/captain(src)
new /obj/item/clothing/suit/storage/vest(src)
new /obj/item/weapon/cartridge/captain(src)
@@ -28,7 +28,7 @@
new /obj/item/clothing/suit/armor/captain(src)
new /obj/item/weapon/melee/telebaton(src)
new /obj/item/clothing/under/dress/dress_cap(src)
- new /obj/item/clothing/head/helmet/formalcaptain(src)
+ new /obj/item/clothing/head/caphat/formal(src)
new /obj/item/clothing/under/captainformal(src)
return
@@ -82,7 +82,7 @@
new /obj/item/clothing/shoes/leather(src)
new /obj/item/clothing/shoes/white(src)
new /obj/item/clothing/under/rank/head_of_personnel_whimsy(src)
- new /obj/item/clothing/head/helmet/hop(src)
+ new /obj/item/clothing/head/caphat/hop(src)
return
@@ -103,13 +103,13 @@
new /obj/item/weapon/storage/backpack/security(src)
else
new /obj/item/weapon/storage/backpack/satchel_sec(src)
- new /obj/item/clothing/head/helmet/HoS(src)
+ new /obj/item/clothing/head/HoS(src)
new /obj/item/clothing/suit/storage/vest/hos(src)
new /obj/item/clothing/under/rank/head_of_security/jensen(src)
new /obj/item/clothing/under/rank/head_of_security/corp(src)
new /obj/item/clothing/suit/armor/hos/jensen(src)
new /obj/item/clothing/suit/armor/hos(src)
- new /obj/item/clothing/head/helmet/HoS/dermal(src)
+ new /obj/item/clothing/head/HoS/dermal(src)
new /obj/item/weapon/cartridge/hos(src)
new /obj/item/device/radio/headset/heads/hos(src)
new /obj/item/clothing/glasses/sunglasses/sechud(src)
@@ -148,7 +148,7 @@
new /obj/item/clothing/under/rank/warden(src)
new /obj/item/clothing/under/rank/warden/corp(src)
new /obj/item/clothing/suit/armor/vest/warden(src)
- new /obj/item/clothing/head/helmet/warden(src)
+ new /obj/item/clothing/head/warden(src)
new /obj/item/weapon/cartridge/security(src)
new /obj/item/device/radio/headset/headset_sec(src)
new /obj/item/clothing/glasses/sunglasses/sechud(src)
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index ad28bb4019..23892a0550 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -154,15 +154,20 @@
user << "The crate appears to be broken."
return
if(src.allowed(user))
- src.locked = !src.locked
- for(var/mob/O in viewers(user, 3))
- if((O.client && !( O.blinded )))
- O << "The crate has been [locked ? null : "un"]locked by [user]."
- overlays.Cut()
- overlays += locked ? redlight : greenlight
+ set_locked(!locked, user)
else
user << "Access Denied"
+/obj/structure/closet/crate/secure/proc/set_locked(var/newlocked, mob/user = null)
+ if(locked == newlocked) return
+
+ locked = newlocked
+ if(user)
+ for(var/mob/O in viewers(user, 3))
+ O.show_message( "The crate has been [locked ? null : "un"]locked by [user].", 1)
+ overlays.Cut()
+ overlays += locked ? redlight : greenlight
+
/obj/structure/closet/crate/secure/verb/verb_togglelock()
set src in oview(1) // One square distance
set category = "Object"
@@ -187,7 +192,15 @@
/obj/structure/closet/crate/secure/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(is_type_in_list(W, list(/obj/item/weapon/packageWrap, /obj/item/stack/cable_coil, /obj/item/device/radio/electropack, /obj/item/weapon/wirecutters)))
return ..()
- if(locked && (istype(W, /obj/item/weapon/card/emag)||istype(W, /obj/item/weapon/melee/energy/blade)))
+ if(istype(W, /obj/item/weapon/melee/energy/blade))
+ emag_act(INFINITY, user)
+ if(!opened)
+ src.togglelock(user)
+ return
+ return ..()
+
+/obj/structure/closet/crate/secure/emag_act(var/remaining_charges, var/mob/user)
+ if(!broken)
overlays.Cut()
overlays += emag
overlays += sparks
@@ -196,11 +209,7 @@
src.locked = 0
src.broken = 1
user << "You unlock \the [src]."
- return
- if(!opened)
- src.togglelock(user)
- return
- return ..()
+ return 1
/obj/structure/closet/crate/secure/emp_act(severity)
for(var/obj/O in src)
diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm
index 54a9fc8092..c697f1a4c1 100644
--- a/code/game/objects/structures/crates_lockers/largecrate.dm
+++ b/code/game/objects/structures/crates_lockers/largecrate.dm
@@ -13,8 +13,8 @@
if(istype(W, /obj/item/weapon/crowbar))
new /obj/item/stack/material/wood(src)
var/turf/T = get_turf(src)
- for(var/obj/O in contents)
- O.loc = T
+ for(var/atom/movable/AM in contents)
+ if(AM.simulated) AM.loc = T
user.visible_message("[user] pries \the [src] open.", \
"You pry open \the [src].", \
"You hear splitting wood.")
@@ -73,4 +73,4 @@
/obj/structure/largecrate/animal/chick
name = "chicken crate"
held_count = 5
- held_type = /mob/living/simple_animal/chick
\ No newline at end of file
+ held_type = /mob/living/simple_animal/chick
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 365c62d2a9..f09d43e574 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -149,7 +149,7 @@
user.visible_message("[user] welds the [glass] plating off the airlock assembly.", "You start to weld the [glass] plating off the airlock assembly.")
if(do_after(user, 40))
if(!src || !WT.isOn()) return
- user << "You welded the [glass] plating off!"
var/M = text2path("/obj/item/stack/material/[glass]")
new M(src.loc, 2)
glass = 0
@@ -157,18 +157,18 @@
user.visible_message("[user] welds the glass panel out of the airlock assembly.", "You start to weld the glass panel out of the airlock assembly.")
if(do_after(user, 40))
if(!src || !WT.isOn()) return
- user << "You welded the glass panel out!"
new /obj/item/stack/material/glass/reinforced(src.loc)
glass = 0
else if(!anchored)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
if(do_after(user, 40))
if(!src || !WT.isOn()) return
- user << "You dissasembled the airlock assembly!"
new /obj/item/stack/material/steel(src.loc, 4)
qdel (src)
else
- user << "You need more welding fuel."
return
else if(istype(W, /obj/item/weapon/wrench) && state == 0)
@@ -180,7 +180,7 @@
if(do_after(user, 40))
if(!src) return
- user << "You [anchored? "un" : ""]secured the airlock assembly!"
anchored = !anchored
else if(istype(W, /obj/item/stack/cable_coil) && state == 0 && anchored)
@@ -200,7 +200,7 @@
if(do_after(user, 40))
if(!src) return
- user << "You cut the airlock wires.!"
new/obj/item/stack/cable_coil(src.loc, 1)
src.state = 0
@@ -212,7 +212,7 @@
if(!src) return
user.drop_item()
W.loc = src
- user << "You installed the airlock electronics!"
src.state = 2
src.name = "Near finished Airlock Assembly"
src.electronics = W
@@ -229,27 +229,27 @@
if(do_after(user, 40))
if(!src) return
- user << "You removed the airlock electronics!"
src.state = 1
src.name = "Wired Airlock Assembly"
electronics.loc = src.loc
electronics = null
else if(istype(W, /obj/item/stack/material) && !glass)
- var/obj/item/stack/material/S = W
+ var/obj/item/stack/S = W
+ var/material_name = S.get_material_name()
if (S)
if (S.get_amount() >= 1)
- if(istype(S, /obj/item/stack/material/glass/reinforced))
+ if(material_name == "rglass")
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 40) && !glass)
if (S.use(1))
user << "You installed reinforced glass windows into the airlock assembly."
glass = 1
- else if(istype(S, /obj/item/stack/material) && S.default_type)
- var/M = S.default_type
+ else if(material_name)
// Ugly hack, will suffice for now. Need to fix it upstream as well, may rewrite mineral walls. ~Z
- if(M in list("mhydrogen","osmium","tritium","platinum","iron"))
+ if(!(material_name in list("gold", "silver", "diamond", "uranium", "phoron", "sandstone")))
user << "You cannot make an airlock out of that material."
return
if(S.get_amount() >= 2)
@@ -257,16 +257,16 @@
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
if(do_after(user, 40) && !glass)
if (S.use(2))
- user << "You installed [M] plating into the airlock assembly."
- glass = "[M]"
+ user << "You installed [material_display_name(material_name)] plating into the airlock assembly."
+ glass = material_name
else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 )
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
- user << "Now finishing the airlock."
if(do_after(user, 40))
if(!src) return
- user << "You finish the airlock!"
var/path
if(istext(glass))
path = text2path("/obj/machinery/door/airlock/[glass]")
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index 872b8ff988..c8ccd4b32b 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -37,7 +37,7 @@
if (user.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
- user << "You try to move your [temp.name], but cannot!"
+ user << "You try to move your [temp.name], but cannot!"
return
if(has_extinguisher)
user.put_in_hands(has_extinguisher)
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index 38caaa3230..35a28558ae 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -25,7 +25,7 @@
/obj/structure/girder/bullet_act(var/obj/item/projectile/Proj)
//Girders only provide partial cover. There's a chance that the projectiles will just pass through. (unless you are trying to shoot the girder)
if(Proj.original != src && !prob(cover))
- return -1 //pass through
+ return PROJECTILE_CONTINUE //pass through
//Tasers and the like should not damage girders.
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
@@ -108,11 +108,11 @@
else if(istype(W, /obj/item/stack/material))
- var/obj/item/stack/material/S = W
+ var/obj/item/stack/S = W
if(S.get_amount() < 2)
return ..()
- var/material/M = name_to_material[S.default_type]
+ var/material/M = S.get_material()
if(!istype(M))
return ..()
@@ -149,7 +149,7 @@
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
user.drop_item()
P.loc = src.loc
- user << "You fit the pipe into the [src]!"
+ user << "You fit the pipe into the [src]!"
else
..()
@@ -183,7 +183,7 @@
user << "There is not enough material here to reinforce the girder."
return
- var/material/M = name_to_material[S.default_type]
+ var/material/M = S.get_material()
if(!istype(M) || M.integrity < 50)
user << "You cannot reinforce \the [src] with that; it is too soft."
return
@@ -248,7 +248,7 @@
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
- user << "Now slicing apart the girder..."
+ user << "Now slicing apart the girder..."
if(do_after(user,30))
user << "You slice apart the girder!"
dismantle()
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index cc154918e6..149d6bf394 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -91,7 +91,7 @@
passthrough = 1
if(passthrough)
- . = -1
+ . = PROJECTILE_CONTINUE
damage = between(0, (damage - Proj.damage)*(Proj.damage_type == BRUTE? 0.4 : 1), 10) //if the bullet passes through then the grille avoids most of the damage
src.health -= damage*0.2
@@ -111,9 +111,12 @@
"You have [anchored ? "fastened the grille to" : "unfastened the grill from"] the floor.")
return
-//window placing begin
- else if(istype(W,/obj/item/stack/material/glass))
- var/obj/item/stack/material/glass/ST = W
+//window placing begin //TODO CONVERT PROPERLY TO MATERIAL DATUM
+ else if(istype(W,/obj/item/stack/material))
+ var/obj/item/stack/material/ST = W
+ if(!ST.material.created_window)
+ return 0
+
var/dir_to_set = 1
if(loc == user.loc)
dir_to_set = user.dir
@@ -143,7 +146,7 @@
user << "There is already a window facing this way there."
return
- var/wtype = ST.created_window
+ var/wtype = ST.material.created_window
if (ST.use(1))
var/obj/structure/window/WD = new wtype(loc, dir_to_set, 1)
user << "You place the [WD] on [src]."
@@ -151,9 +154,7 @@
return
//window placing end
- else if(istype(W, /obj/item/weapon/material/shard))
- health -= W.force * 0.1
- else if(!shock(user, 70))
+ else if(!(W.flags & CONDUCT) || !shock(user, 70))
user.do_attack_animation(src)
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
switch(W.damtype)
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index 237250e3fd..17957cc589 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -37,7 +37,7 @@
else if(istype(I, /obj/item/weapon/mop))
if(I.reagents.total_volume < I.reagents.maximum_volume) //if it's not completely soaked we assume they want to wet it, otherwise store it
if(reagents.total_volume < 1)
- user << "[src] is out of water!"
+ user << "[src] is out of water!"
else
reagents.trans_to_obj(I, 5) //
user << "You wet [I] in [src]."
@@ -83,22 +83,23 @@
/obj/structure/janitorialcart/attack_hand(mob/user)
- user.set_machine(src)
- var/dat
- if(mybag)
- dat += "[mybag.name] "
- if(mymop)
- dat += "[mymop.name] "
- if(myspray)
- dat += "[myspray.name] "
- if(myreplacer)
- dat += "[myreplacer.name] "
- if(signs)
- dat += "[signs] sign\s "
- var/datum/browser/popup = new(user, "janicart", name, 240, 160)
- popup.set_content(dat)
- popup.open()
+ ui_interact(user)
+ return
+/obj/structure/janitorialcart/ui_interact(var/mob/user, var/ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ var/data[0]
+ data["name"] = capitalize(name)
+ data["bag"] = mybag ? capitalize(mybag.name) : null
+ data["mop"] = mymop ? capitalize(mymop.name) : null
+ data["spray"] = myspray ? capitalize(myspray.name) : null
+ data["replacer"] = myreplacer ? capitalize(myreplacer.name) : null
+ data["signs"] = signs ? "[signs] sign\s" : null
+
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "janitorcart.tmpl", "Janitorial cart", 240, 160)
+ ui.set_initial_data(data)
+ ui.open()
/obj/structure/janitorialcart/Topic(href, href_list)
if(!in_range(src, usr))
@@ -106,36 +107,39 @@
if(!isliving(usr))
return
var/mob/living/user = usr
- if(href_list["garbage"])
- if(mybag)
- user.put_in_hands(mybag)
- user << "You take [mybag] from [src]."
- mybag = null
- if(href_list["mop"])
- if(mymop)
- user.put_in_hands(mymop)
- user << "You take [mymop] from [src]."
- mymop = null
- if(href_list["spray"])
- if(myspray)
- user.put_in_hands(myspray)
- user << "You take [myspray] from [src]."
- myspray = null
- if(href_list["replacer"])
- if(myreplacer)
- user.put_in_hands(myreplacer)
- user << "You take [myreplacer] from [src]."
- myreplacer = null
- if(href_list["sign"])
- if(signs)
- var/obj/item/weapon/caution/Sign = locate() in src
- if(Sign)
- user.put_in_hands(Sign)
- user << "You take \a [Sign] from [src]."
- signs--
- else
- warning("[src] signs ([signs]) didn't match contents")
- signs = 0
+
+ if(href_list["take"])
+ switch(href_list["take"])
+ if("garbage")
+ if(mybag)
+ user.put_in_hands(mybag)
+ user << "You take [mybag] from [src]."
+ mybag = null
+ if("mop")
+ if(mymop)
+ user.put_in_hands(mymop)
+ user << "You take [mymop] from [src]."
+ mymop = null
+ if("spray")
+ if(myspray)
+ user.put_in_hands(myspray)
+ user << "You take [myspray] from [src]."
+ myspray = null
+ if("replacer")
+ if(myreplacer)
+ user.put_in_hands(myreplacer)
+ user << "You take [myreplacer] from [src]."
+ myreplacer = null
+ if("sign")
+ if(signs)
+ var/obj/item/weapon/caution/Sign = locate() in src
+ if(Sign)
+ user.put_in_hands(Sign)
+ user << "You take \a [Sign] from [src]."
+ signs--
+ else
+ warning("[src] signs ([signs]) didn't match contents")
+ signs = 0
update_icon()
updateUsrDialog()
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index bc4a5fb3d3..3847950e60 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -53,7 +53,7 @@
/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob)
- if (istype(C, /obj/item/stack/tile/plasteel))
+ if (istype(C, /obj/item/stack/tile/steel))
var/turf/T = get_turf(src)
T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
return
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index acae472554..4a4ea63276 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -17,7 +17,7 @@
var/datum/nano_module/appearance_changer/AC = ui_users[user]
if(!AC)
AC = new(src, user)
- AC.name = "SalonPro Nano-Mirror(TM)"
+ AC.name = "SalonPro Nano-Mirror™"
ui_users[user] = AC
AC.ui_interact(user)
@@ -60,7 +60,7 @@
return 0
if(damage)
- user.visible_message("[user] smashes [src]!")
+ user.visible_message("[user] smashes [src]!")
shatter()
else
user.visible_message("[user] hits [src] and bounces off!")
diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm
index ace1293fc7..fcad40a0f0 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -20,7 +20,7 @@
/obj/structure/mopbucket/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/mop))
if(reagents.total_volume < 1)
- user << "[src] is out of water!"
+ user << "[src] is out of water!"
else
reagents.trans_to_obj(I, 5)
user << "You wet [I] in [src]."
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index daca23e8b7..b7accbffce 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -20,6 +20,12 @@
var/obj/structure/m_tray/connected = null
anchored = 1.0
+/obj/structure/morgue/Destroy()
+ if(connected)
+ qdel(connected)
+ connected = null
+ return ..()
+
/obj/structure/morgue/proc/update()
if (src.connected)
src.icon_state = "morgue0"
@@ -34,21 +40,21 @@
switch(severity)
if(1.0)
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.loc
+ A.forceMove(src.loc)
ex_act(severity)
qdel(src)
return
if(2.0)
if (prob(50))
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.loc
+ A.forceMove(src.loc)
ex_act(severity)
qdel(src)
return
if(3.0)
if (prob(5))
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.loc
+ A.forceMove(src.loc)
ex_act(severity)
qdel(src)
return
@@ -61,10 +67,10 @@
if (src.connected)
for(var/atom/movable/A as mob|obj in src.connected.loc)
if (!( A.anchored ))
- A.loc = src
+ A.forceMove(src)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- //src.connected = null
qdel(src.connected)
+ src.connected = null
else
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
src.connected = new /obj/structure/m_tray( src.loc )
@@ -75,12 +81,12 @@
src.connected.connected = src
src.icon_state = "morgue0"
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.connected.loc
+ A.forceMove(src.connected.loc)
src.connected.icon_state = "morguet"
src.connected.set_dir(src.dir)
else
- //src.connected = null
qdel(src.connected)
+ src.connected = null
src.add_fingerprint(user)
update()
return
@@ -111,12 +117,11 @@
src.connected.connected = src
src.icon_state = "morgue0"
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.connected.loc
- //Foreach goto(106)
+ A.forceMove(src.connected.loc)
src.connected.icon_state = "morguet"
else
- //src.connected = null
qdel(src.connected)
+ src.connected = null
return
@@ -134,11 +139,17 @@
anchored = 1
throwpass = 1
+/obj/structure/m_tray/Destroy()
+ if(connected && connected.connected == src)
+ connected.connected = null
+ connected = null
+ return ..()
+
/obj/structure/m_tray/attack_hand(mob/user as mob)
if (src.connected)
for(var/atom/movable/A as mob|obj in src.loc)
if (!( A.anchored ))
- A.loc = src.connected
+ A.forceMove(src.connected)
//Foreach goto(26)
src.connected.connected = null
src.connected.update()
@@ -155,11 +166,11 @@
return
if (!ismob(user) || user.stat || user.lying || user.stunned)
return
- O.loc = src.loc
+ O.forceMove(src.loc)
if (user != O)
for(var/mob/B in viewers(user, 3))
if ((B.client && !( B.blinded )))
- B << "\The [user] stuffs [O] into [src]!"
+ B << "\The [user] stuffs [O] into [src]!"
return
@@ -179,6 +190,12 @@
var/id = 1
var/locked = 0
+/obj/structure/crematorium/Destroy()
+ if(connected)
+ qdel(connected)
+ connected = null
+ return ..()
+
/obj/structure/crematorium/proc/update()
if (src.connected)
src.icon_state = "crema0"
@@ -193,21 +210,21 @@
switch(severity)
if(1.0)
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.loc
+ A.forceMove(src.loc)
ex_act(severity)
qdel(src)
return
if(2.0)
if (prob(50))
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.loc
+ A.forceMove(src.loc)
ex_act(severity)
qdel(src)
return
if(3.0)
if (prob(5))
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.loc
+ A.forceMove(src.loc)
ex_act(severity)
qdel(src)
return
@@ -229,7 +246,7 @@
if ((src.connected) && (src.locked == 0))
for(var/atom/movable/A as mob|obj in src.connected.loc)
if (!( A.anchored ))
- A.loc = src
+ A.forceMove(src)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
//src.connected = null
qdel(src.connected)
@@ -243,7 +260,7 @@
src.connected.connected = src
src.icon_state = "crema0"
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.connected.loc
+ A.forceMove(src.connected.loc)
src.connected.icon_state = "cremat"
else
//src.connected = null
@@ -277,12 +294,11 @@
src.connected.connected = src
src.icon_state = "crema0"
for(var/atom/movable/A as mob|obj in src)
- A.loc = src.connected.loc
- //Foreach goto(106)
+ A.forceMove(src.connected.loc)
src.connected.icon_state = "cremat"
else
- //src.connected = null
qdel(src.connected)
+ src.connected = null
return
/obj/structure/crematorium/proc/cremate(atom/A, mob/user as mob)
@@ -350,11 +366,17 @@
anchored = 1
throwpass = 1
+/obj/structure/c_tray/Destroy()
+ if(connected && connected.connected == src)
+ connected.connected = null
+ connected = null
+ return ..()
+
/obj/structure/c_tray/attack_hand(mob/user as mob)
if (src.connected)
for(var/atom/movable/A as mob|obj in src.loc)
if (!( A.anchored ))
- A.loc = src.connected
+ A.forceMove(src.connected)
//Foreach goto(26)
src.connected.connected = null
src.connected.update()
@@ -371,7 +393,7 @@
return
if (!ismob(user) || user.stat || user.lying || user.stunned)
return
- O.loc = src.loc
+ O.forceMove(src.loc)
if (user != O)
for(var/mob/B in viewers(user, 3))
if ((B.client && !( B.blinded )))
@@ -390,7 +412,7 @@
/obj/machinery/button/crematorium/attack_hand(mob/user as mob)
if(..())
return
- if(src.allowed(usr))
+ if(src.allowed(user))
for (var/obj/structure/crematorium/C in world)
if (C.id == id)
if (!C.cremating)
diff --git a/code/game/objects/structures/simple_doors.dm b/code/game/objects/structures/simple_doors.dm
index b3230095c1..10fa149e8b 100644
--- a/code/game/objects/structures/simple_doors.dm
+++ b/code/game/objects/structures/simple_doors.dm
@@ -44,6 +44,9 @@
update_nearby_tiles()
..()
+/obj/structure/simple_door/get_material()
+ return material
+
/obj/structure/simple_door/Bumped(atom/user)
..()
if(!state)
diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
index 265f073d5c..bab8e44cd9 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -22,6 +22,7 @@
/obj/structure/bed/New(var/newloc, var/new_material, var/new_padding_material)
..(newloc)
+ color = null
if(!new_material)
new_material = DEFAULT_WALL_MATERIAL
material = get_material_by_name(new_material)
@@ -32,6 +33,9 @@
padding_material = get_material_by_name(new_padding_material)
update_icon()
+/obj/structure/bed/get_material()
+ return material
+
// Reuse the cache/code from stools, todo maybe unify.
/obj/structure/bed/update_icon()
// Prep icon.
@@ -61,6 +65,12 @@
name = "[material.display_name] [initial(name)]"
desc += " It's made of [material.use_name]."
+/obj/structure/bed/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
+ if(istype(mover) && mover.checkpass(PASSTABLE))
+ return 1
+ else
+ return ..()
+
/obj/structure/bed/ex_act(severity)
switch(severity)
if(1.0)
diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
index 06322fb98d..1d6ae5ed58 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
@@ -2,6 +2,7 @@
name = "chair"
desc = "You sit in this. Either by will or force."
icon_state = "chair_preview"
+ color = "#666666"
base_icon = "chair"
buckle_lying = 0 //force people to sit up in chairs when buckled
var/propelled = 0 // Check for fire-extinguisher-driven chairs
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 95e2f4d29d..7ffe728030 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -225,6 +225,12 @@
if(M.back)
if(M.back.clean_blood())
M.update_inv_back(0)
+
+ //flush away reagents on the skin
+ if(M.touching)
+ var/remove_amount = M.touching.maximum_volume * M.reagent_permeability() //take off your suit first
+ M.touching.remove_any(remove_amount)
+
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/washgloves = 1
@@ -352,7 +358,7 @@
if (user.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
- user << "You try to move your [temp.name], but cannot!"
+ user << "You try to move your [temp.name], but cannot!"
return
if(isrobot(user) || isAI(user))
@@ -377,12 +383,12 @@
if(ishuman(user))
user:update_inv_gloves()
for(var/mob/V in viewers(src, null))
- V.show_message("[user] washes their hands using \the [src].")
+ V.show_message("[user] washes their hands using \the [src].")
/obj/structure/sink/attackby(obj/item/O as obj, mob/user as mob)
if(busy)
- user << "Someone's already washing here."
+ user << "Someone's already washing here."
return
var/obj/item/weapon/reagent_containers/RG = O
@@ -408,6 +414,9 @@
"[user] was stunned by \his wet [O]!", \
"[user] was stunned by \his wet [O]!")
return
+ // Short of a rewrite, this is necessary to stop monkeycubes being washed.
+ else if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube))
+ return
var/turf/location = user.loc
if(!isturf(location)) return
diff --git a/code/game/objects/structures/window_spawner.dm b/code/game/objects/structures/window_spawner.dm
new file mode 100644
index 0000000000..e6c2d06001
--- /dev/null
+++ b/code/game/objects/structures/window_spawner.dm
@@ -0,0 +1,89 @@
+// Ported from Haine and WrongEnd with much gratitude!
+/* ._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._. */
+/*-=-=-=-=-=-=-=-=-=-=-=-=-=WHAT-EVER=-=-=-=-=-=-=-=-=-=-=-=-=-*/
+/* '~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~'-._.-'~' */
+
+/obj/effect/wingrille_spawn
+ name = "window grille spawner"
+ icon = 'icons/obj/structures.dmi'
+ icon_state = "wingrille"
+ density = 1
+ anchored = 1.0
+ pressure_resistance = 4*ONE_ATMOSPHERE
+ var/win_path = /obj/structure/window/basic
+ var/activated
+
+/obj/effect/wingrille_spawn/attack_hand()
+ attack_generic()
+
+/obj/effect/wingrille_spawn/attack_ghost()
+ attack_generic()
+
+/obj/effect/wingrille_spawn/attack_generic()
+ activate()
+
+/obj/effect/wingrille_spawn/initialize()
+ ..()
+ if(!win_path)
+ return
+ if(ticker && ticker.current_state < GAME_STATE_PLAYING)
+ activate()
+
+/obj/effect/wingrille_spawn/proc/activate()
+ if(activated) return
+ if (!locate(/obj/structure/grille) in get_turf(src))
+ var/obj/structure/grille/G = PoolOrNew(/obj/structure/grille, src.loc)
+ handle_grille_spawn(G)
+ var/list/neighbours = list()
+ for (var/dir in cardinal)
+ var/turf/T = get_step(src, dir)
+ var/obj/effect/wingrille_spawn/other = locate(/obj/effect/wingrille_spawn) in T
+ if(!other)
+ var/found_connection
+ if(locate(/obj/structure/grille) in T)
+ for(var/obj/structure/window/W in T)
+ if(W.type == win_path && W.dir == get_dir(T,src))
+ found_connection = 1
+ qdel(W)
+ if(!found_connection)
+ var/obj/structure/window/new_win = PoolOrNew(win_path, src.loc)
+ new_win.set_dir(dir)
+ handle_window_spawn(new_win)
+ else
+ neighbours |= other
+ activated = 1
+ for(var/obj/effect/wingrille_spawn/other in neighbours)
+ if(!other.activated) other.activate()
+ qdel(src)
+
+/obj/effect/wingrille_spawn/proc/handle_window_spawn(var/obj/structure/window/W)
+ return
+
+// Currently unused, could be useful for pre-wired electrified windows.
+/obj/effect/wingrille_spawn/proc/handle_grille_spawn(var/obj/structure/grille/G)
+ return
+
+/obj/effect/wingrille_spawn/reinforced
+ name = "reinforced window grille spawner"
+ icon_state = "r-wingrille"
+ win_path = /obj/structure/window/reinforced
+
+/obj/effect/wingrille_spawn/phoron
+ name = "phoron window grille spawner"
+ icon_state = "p-wingrille"
+ win_path = /obj/structure/window/phoronbasic
+
+/obj/effect/wingrille_spawn/reinforced_phoron
+ name = "reinforced phoron window grille spawner"
+ icon_state = "pr-wingrille"
+ win_path = /obj/structure/window/phoronreinforced
+
+/obj/effect/wingrille_spawn/reinforced/polarized
+ name = "polarized window grille spawner"
+ color = "#444444"
+ win_path = /obj/structure/window/reinforced/polarized
+ var/id
+
+/obj/effect/wingrille_spawn/reinforced/polarized/handle_window_spawn(var/obj/structure/window/reinforced/polarized/P)
+ if(id)
+ P.id = id
diff --git a/code/game/response_team.dm b/code/game/response_team.dm
index 0b84ebbbde..79a2cf1fdc 100644
--- a/code/game/response_team.dm
+++ b/code/game/response_team.dm
@@ -38,9 +38,12 @@ var/can_call_ert
trigger_armed_response_team(1)
client/verb/JoinResponseTeam()
+
+ set name = "Join Response Team"
set category = "IC"
if(!MayRespawn(1))
+ usr << "You cannot join the response team at this time."
return
if(istype(usr,/mob/dead/observer) || istype(usr,/mob/new_player))
@@ -50,18 +53,9 @@ client/verb/JoinResponseTeam()
if(jobban_isbanned(usr, "Syndicate") || jobban_isbanned(usr, "Emergency Response Team") || jobban_isbanned(usr, "Security Officer"))
usr << "You are jobbanned from the emergency reponse team!"
return
-
- if(ert.current_antagonists.len > 5) usr << "The emergency response team is already full!"
-
- for (var/obj/effect/landmark/L in landmarks_list) if (L.name == "Commando")
- L.name = null//Reserving the place.
- var/new_name = sanitizeSafe(input(usr, "Pick a name","Name") as null|text, MAX_NAME_LEN)
- if(!new_name)//Somebody changed his mind, place is available again.
- L.name = "Commando"
- return
- create_response_team(L.loc, new_name)
- qdel(L)
-
+ if(ert.current_antagonists.len > 5)
+ usr << "The emergency response team is already full!"
+ ert.create_default(usr)
else
usr << "You need to be an observer or new player to use this."
@@ -130,25 +124,3 @@ proc/trigger_armed_response_team(var/force = 0)
sleep(600 * 5)
send_emergency_team = 0 // Can no longer join the ERT.
-
-/client/proc/create_response_team(obj/spawn_location, commando_name)
-
- var/mob/living/carbon/human/M = new(null)
-
-
- M.real_name = commando_name
- M.name = commando_name
- M.age = rand(25,45)
-
- M.check_dna(M)
- M.dna.ready_dna(M)//Creates DNA.
-
- M.mind = new
- M.mind.current = M
- M.mind.original = M
- if(!(M.mind in ticker.minds))
- ticker.minds += M.mind//Adds them to regular mind list.
- M.loc = spawn_location
- ert.add_antagonist(M.mind)
-
- return M
diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm
index 253d96174d..044143269e 100644
--- a/code/game/supplyshuttle.dm
+++ b/code/game/supplyshuttle.dm
@@ -195,16 +195,12 @@ var/list/mechtoys = list(
find_slip = 0
continue
- // Sell phoron
- if(istype(A, /obj/item/stack/material/phoron))
- var/obj/item/stack/material/phoron/P = A
- phoron_count += P.get_amount()
-
- // Sell platinum
- if(istype(A, /obj/item/stack/material/platinum))
- var/obj/item/stack/material/platinum/P = A
- plat_count += P.get_amount()
-
+ // Sell phoron and platinum
+ if(istype(A, /obj/item/stack))
+ var/obj/item/stack/P
+ switch(P.get_material_name())
+ if("phoron") phoron_count += P.get_amount()
+ if("platinum") plat_count += P.get_amount()
qdel(MA)
if(phoron_count)
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index 27e47dac21..3364c0fa2e 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -29,7 +29,7 @@ var/list/wood_icons = list("wood","wood-broken")
/turf/simulated/floor
//Note to coders, the 'intact' var can no longer be used to determine if the floor is a plating or not.
- //Use the is_plating(), is_plasteel_floor() and is_light_floor() procs instead. --Errorage
+ //Use the is_plating(), is_steel_floor() and is_light_floor() procs instead. --Errorage
name = "floor"
icon = 'icons/turf/floors.dmi'
icon_state = "floor"
@@ -42,7 +42,7 @@ var/list/wood_icons = list("wood","wood-broken")
var/broken = 0
var/burnt = 0
var/mineral = DEFAULT_WALL_MATERIAL
- var/floor_type = /obj/item/stack/tile/plasteel
+ var/floor_type = /obj/item/stack/tile/steel
var/lightfloor_state // for light floors, this is the state of the tile. 0-7, 0x4 is on-bit - use the helper procs below
proc/get_lightfloor_state()
@@ -102,13 +102,23 @@ var/list/wood_icons = list("wood","wood-broken")
return
/turf/simulated/floor/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
+
+ var/temp_destroy = get_damage_temperature()
if(!burnt && prob(5))
- burn_tile()
- else if(prob(1) && !is_plating())
- make_plating()
- burn_tile()
+ burn_tile(exposed_temperature)
+ else if(temp_destroy && exposed_temperature >= (temp_destroy + 100) && prob(1) && !is_plating())
+ make_plating() //destroy the tile, exposing plating
+ burn_tile(exposed_temperature)
return
+//should be a little bit lower than the temperature required to destroy the material
+/turf/simulated/floor/proc/get_damage_temperature()
+ if(is_steel_floor()) return T0C+1400
+ if(is_wood_floor()) return T0C+200
+ if(is_carpet_floor()) return T0C+200
+ if(is_grass_floor()) return T0C+80
+ return null
+
/turf/simulated/floor/adjacent_fire_act(turf/simulated/floor/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume)
var/dir_to = get_dir(src, adj_turf)
@@ -122,7 +132,7 @@ var/list/wood_icons = list("wood","wood-broken")
turf/simulated/floor/proc/update_icon()
if(lava)
return
- else if(is_plasteel_floor())
+ else if(is_steel_floor())
if(!broken && !burnt)
icon_state = icon_regular_floor
else if(is_plating())
@@ -237,8 +247,8 @@ turf/simulated/floor/proc/update_icon()
make_plating()
break_tile()
-/turf/simulated/floor/is_plasteel_floor()
- if(ispath(floor_type, /obj/item/stack/tile/plasteel))
+/turf/simulated/floor/is_steel_floor()
+ if(ispath(floor_type, /obj/item/stack/tile/steel))
return 1
else
return 0
@@ -277,7 +287,7 @@ turf/simulated/floor/proc/update_icon()
if(istype(src,/turf/simulated/floor/mech_bay_recharge_floor))
src.ChangeTurf(/turf/simulated/floor/plating)
if(broken) return
- if(is_plasteel_floor())
+ if(is_steel_floor())
src.icon_state = "damaged[pick(1,2,3,4,5)]"
broken = 1
else if(is_light_floor())
@@ -296,28 +306,38 @@ turf/simulated/floor/proc/update_icon()
src.icon_state = "sand[pick("1","2","3")]"
broken = 1
-/turf/simulated/floor/proc/burn_tile()
+/turf/simulated/floor/proc/burn_tile(var/exposed_temperature)
if(istype(src,/turf/simulated/floor/engine)) return
if(istype(src,/turf/simulated/floor/plating/airless/asteroid)) return//Asteroid tiles don't burn
- if(broken || burnt) return
- if(is_plasteel_floor())
- src.icon_state = "damaged[pick(1,2,3,4,5)]"
- burnt = 1
- else if(is_plasteel_floor())
+
+ var/damage_temp = get_damage_temperature()
+
+ if(broken) return
+ if(burnt)
+ if(is_steel_floor() && exposed_temperature >= damage_temp) //allow upgrading from scorched tiles to damaged tiles
+ src.icon_state = "damaged[pick(1,2,3,4,5)]"
+ broken = 1
+ return
+
+ if(is_steel_floor() && exposed_temperature >= T0C+300) //enough to char the floor, but not hot enough to actually burn holes in it
src.icon_state = "floorscorched[pick(1,2)]"
burnt = 1
- else if(is_plating())
- src.icon_state = "panelscorched"
- burnt = 1
- else if(is_wood_floor())
- src.icon_state = "wood-broken"
- burnt = 1
- else if(is_carpet_floor())
- src.icon_state = "carpet-broken"
- burnt = 1
- else if(is_grass_floor())
- src.icon_state = "sand[pick("1","2","3")]"
- burnt = 1
+ else if(exposed_temperature >= damage_temp)
+ if(is_steel_floor())
+ src.icon_state = "damaged[pick(1,2,3,4,5)]"
+ burnt = 1
+ else if(is_plating())
+ src.icon_state = "panelscorched"
+ burnt = 1
+ else if(is_wood_floor())
+ src.icon_state = "wood-broken"
+ burnt = 1
+ else if(is_carpet_floor())
+ src.icon_state = "carpet-broken"
+ burnt = 1
+ else if(is_grass_floor())
+ src.icon_state = "sand[pick("1","2","3")]"
+ burnt = 1
//This proc will set floor_type to null and the update_icon() proc will then change the icon_state of the turf
//This proc auto corrects the grass tiles' siding.
@@ -351,13 +371,13 @@ turf/simulated/floor/proc/update_icon()
//This proc will make the turf a plasteel floor tile. The expected argument is the tile to make the turf with
//If none is given it will make a new object. dropping or unequipping must be handled before or after calling
//this proc.
-/turf/simulated/floor/proc/make_plasteel_floor(var/obj/item/stack/tile/plasteel/T = null)
+/turf/simulated/floor/proc/make_plasteel_floor(var/obj/item/stack/tile/steel/T = null)
broken = 0
burnt = 0
intact = 1
set_light(0)
if(T)
- if(istype(T,/obj/item/stack/tile/plasteel))
+ if(istype(T,/obj/item/stack/tile/steel))
floor_type = T.type
if (icon_regular_floor)
icon_state = icon_regular_floor
@@ -368,7 +388,7 @@ turf/simulated/floor/proc/update_icon()
levelupdate()
return
//if you gave a valid parameter, it won't get thisf ar.
- floor_type = /obj/item/stack/tile/plasteel
+ floor_type = /obj/item/stack/tile/steel
icon_state = "floor"
icon_regular_floor = icon_state
@@ -488,7 +508,7 @@ turf/simulated/floor/proc/update_icon()
return
else
if(is_wood_floor())
- user << "You unscrew the planks."
+ user << "You unscrew the planks."
new floor_type(src)
make_plating()
diff --git a/code/game/turfs/simulated/wall_icon.dm b/code/game/turfs/simulated/wall_icon.dm
index 1adaba850f..aa7db8a0cc 100644
--- a/code/game/turfs/simulated/wall_icon.dm
+++ b/code/game/turfs/simulated/wall_icon.dm
@@ -8,7 +8,7 @@
else
construction_stage = null
if(!material)
- material = name_to_material[DEFAULT_WALL_MATERIAL]
+ material = get_material_by_name(DEFAULT_WALL_MATERIAL)
if(material)
explosion_resistance = material.explosion_resistance
if(reinf_material && reinf_material.explosion_resistance > explosion_resistance)
@@ -44,6 +44,7 @@
return
overlays.Cut()
+ damage_overlay = 0
if(!wall_cache["[new_state]-[material.icon_colour]"])
var/image/I = image(icon='icons/turf/wall_masks.dmi',icon_state="[new_state]")
@@ -74,7 +75,6 @@
check_relatives(1)
/turf/simulated/wall/proc/update_icon()
-
if(!material)
return
@@ -86,15 +86,23 @@
else
set_wall_state("[material.icon_base]fwall_open")
- var/dmg_amt = material.integrity
- if(reinf_material)
- dmg_amt += reinf_material.integrity
- var/overlay = round(damage / dmg_amt * damage_overlays.len) + 1
- if(overlay > damage_overlays.len)
- overlay = damage_overlays.len
- if(density)
+ if(damage == 0)
+ if(damage_overlay != 0)
+ overlays -= damage_overlays[damage_overlay]
+ damage_overlay = 0
+ else if(density)
+ var/integrity = material.integrity
+ if(reinf_material)
+ integrity += reinf_material.integrity
+
+ var/overlay = round(damage / integrity * damage_overlays.len) + 1
+ if(overlay > damage_overlays.len)
+ overlay = damage_overlays.len
+
if(damage_overlay && overlay == damage_overlay) //No need to update.
return
+
+ if(damage_overlay) overlays -= damage_overlays[damage_overlay]
overlays += damage_overlays[overlay]
damage_overlay = overlay
return
@@ -129,6 +137,6 @@
return
/turf/simulated/wall/proc/can_join_with(var/turf/simulated/wall/W)
- if(material && W.material && material.name == W.material.name)
+ if(material && W.material && material.icon_base == W.material.icon_base)
return 1
- return 0
\ No newline at end of file
+ return 0
diff --git a/code/game/turfs/simulated/wall_types.dm b/code/game/turfs/simulated/wall_types.dm
index 1b6f77cbd4..9a15491990 100644
--- a/code/game/turfs/simulated/wall_types.dm
+++ b/code/game/turfs/simulated/wall_types.dm
@@ -1,7 +1,7 @@
/turf/simulated/wall/r_wall
icon_state = "rgeneric"
/turf/simulated/wall/r_wall/New(var/newloc)
- ..(newloc, DEFAULT_WALL_MATERIAL,"plasteel") //3strong
+ ..(newloc, "plasteel","plasteel") //3strong
/turf/simulated/wall/cult
icon_state = "cult"
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 8015c47c8c..782be35e6e 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -12,8 +12,8 @@ var/list/global/wall_cache = list()
heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall
var/damage = 0
- var/damage_overlay
- var/global/damage_overlays[8]
+ var/damage_overlay = 0
+ var/global/damage_overlays[16]
var/active
var/can_open = 0
var/material/material
@@ -28,7 +28,7 @@ var/list/global/wall_cache = list()
materialtype = DEFAULT_WALL_MATERIAL
material = get_material_by_name(materialtype)
if(!isnull(rmaterialtype))
- reinf_material = name_to_material[rmaterialtype]
+ reinf_material = get_material_by_name(rmaterialtype)
update_material()
processing_turfs |= src
@@ -38,7 +38,6 @@ var/list/global/wall_cache = list()
dismantle_wall(null,null,1)
..()
-
/turf/simulated/wall/process()
// Calling parent will kill processing
if(!radiate())
@@ -170,7 +169,7 @@ var/list/global/wall_cache = list()
O.loc = src
clear_plants()
- material = name_to_material["placeholder"]
+ material = get_material_by_name("placeholder")
reinf_material = null
check_relatives()
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 5725e3b908..ee3ada938b 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -35,10 +35,10 @@
ReplaceWithLattice()
return
- if (istype(C, /obj/item/stack/tile/plasteel))
+ if (istype(C, /obj/item/stack/tile/steel))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
- var/obj/item/stack/tile/plasteel/S = C
+ var/obj/item/stack/tile/steel/S = C
if (S.get_amount() < 1)
return
qdel(L)
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 7dc2b97173..d4472905f9 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -2,7 +2,7 @@
icon = 'icons/turf/floors.dmi'
level = 1.0
- //for floors, use is_plating(), is_plasteel_floor() and is_light_floor()
+ //for floors, use is_plating(), is_steel_floor() and is_light_floor()
var/intact = 1
//Properties for open tiles (/floor)
@@ -29,6 +29,7 @@
var/holy = 0
var/dynamic_lighting = 1
+ luminosity = 1
/turf/New()
..()
@@ -37,7 +38,6 @@
src.Entered(AM)
return
turfs |= src
- return
/turf/Destroy()
turfs -= src
@@ -156,7 +156,7 @@
return 0
/turf/proc/is_asteroid_floor()
return 0
-/turf/proc/is_plasteel_floor()
+/turf/proc/is_steel_floor()
return 0
/turf/proc/is_light_floor()
return 0
@@ -225,6 +225,7 @@
var/old_opacity = opacity
var/old_dynamic_lighting = dynamic_lighting
var/list/old_affecting_lights = affecting_lights
+ var/old_lighting_overlay = lighting_overlay
//world << "Replacing [src.type] with [N]"
@@ -276,6 +277,7 @@
W.levelupdate()
. = W
+ lighting_overlay = old_lighting_overlay
affecting_lights = old_affecting_lights
if((old_opacity != opacity) || (dynamic_lighting != old_dynamic_lighting) || force_lighting_update)
reconsider_lights()
@@ -329,3 +331,11 @@
/turf/proc/process()
return PROCESS_KILL
+
+/turf/proc/contains_dense_objects()
+ if(density)
+ return 1
+ for(var/atom/A in src)
+ if(A.density && !(A.flags & ON_BORDER))
+ return 1
+ return 0
diff --git a/code/game/turfs/turf_flick_animations.dm b/code/game/turfs/turf_flick_animations.dm
index b1bccd51bc..9bcd5caaa9 100644
--- a/code/game/turfs/turf_flick_animations.dm
+++ b/code/game/turfs/turf_flick_animations.dm
@@ -19,3 +19,24 @@
if(c_animation)
qdel(c_animation)
c_animation = null
+
+proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,flick_anim as text,sleeptime = 0,direction as num)
+//This proc throws up either an icon or an animation for a specified amount of time.
+//The variables should be apparent enough.
+ if(!location && target)
+ location = get_turf(target)
+ if(location && !target)
+ target = location
+ var/atom/movable/overlay/animation = PoolOrNew(/atom/movable/overlay, location)
+ if(direction)
+ animation.set_dir(direction)
+ animation.icon = a_icon
+ animation.layer = target:layer+1
+ if(a_icon_state)
+ animation.icon_state = a_icon_state
+ else
+ animation.icon_state = "blank"
+ animation.master = target
+ flick(flick_anim, animation)
+ spawn(max(sleeptime, 15))
+ qdel(animation)
diff --git a/code/game/verbs/suicide.dm b/code/game/verbs/suicide.dm
index 1f7db7a71b..cad22a9e27 100644
--- a/code/game/verbs/suicide.dm
+++ b/code/game/verbs/suicide.dm
@@ -11,15 +11,7 @@
src << "You can't commit suicide before the game starts!"
return
-
- var/permitted = 0
- var/list/allowed = list("Syndicate","traitor","Wizard","Head Revolutionary","Cultist","Changeling")
- for(var/T in allowed)
- if(mind.special_role == T)
- permitted = 1
- break
-
- if(!permitted)
+ if(!player_is_antag(mind))
message_admins("[ckey] has tried to suicide, but they were not permitted due to not being antagonist as human.", 1)
src << "No. Adminhelp if there is a legitimate reason."
return
@@ -81,7 +73,7 @@
viewers(src) << pick("[src] is attempting to bite \his tongue off! It looks like \he's trying to commit suicide.", \
"[src] is jamming \his thumbs into \his eye sockets! It looks like \he's trying to commit suicide.", \
- "[src] is twisting \his own neck! It looks like \he's trying to commit suicide.", \
+ "[src] is twisting \his own neck! It looks like \he's trying to commit suicide.", \
"[src] is holding \his breath! It looks like \he's trying to commit suicide.")
adjustOxyLoss(max(175 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
updatehealth()
diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm
index 70878686c8..f12d774137 100644
--- a/code/game/verbs/who.dm
+++ b/code/game/verbs/who.dm
@@ -62,8 +62,10 @@
var/msg = ""
var/modmsg = ""
+ var/mentmsg = ""
var/num_mods_online = 0
var/num_admins_online = 0
+ var/num_mentors_online = 0
if(holder)
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights)) //Used to determine who shows up in admin rows
@@ -88,7 +90,7 @@
msg += "\n"
num_admins_online++
- else if(R_MOD & C.holder.rights || R_MENTOR & C.holder.rights) //Who shows up in mod/mentor rows.
+ else if(R_MOD & C.holder.rights) //Who shows up in mod/mentor rows.
modmsg += "\t[C] is a [C.holder.rank]"
if(isobserver(C.mob))
@@ -103,17 +105,41 @@
modmsg += "\n"
num_mods_online++
+ else if(R_MENTOR & C.holder.rights)
+ mentmsg += "\t[C] is a [C.holder.rank]"
+ if(isobserver(C.mob))
+ mentmsg += " - Observing"
+ else if(istype(C.mob,/mob/new_player))
+ mentmsg += " - Lobby"
+ else
+ mentmsg += " - Playing"
+
+ if(C.is_afk())
+ mentmsg += " (AFK)"
+ mentmsg += "\n"
+ num_mentors_online++
+
else
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_MENTOR & C.holder.rights))
if(!C.holder.fakekey)
msg += "\t[C] is a [C.holder.rank]\n"
num_admins_online++
- else if (R_MOD & C.holder.rights || R_MENTOR & C.holder.rights)
+ else if (R_MOD & C.holder.rights)
modmsg += "\t[C] is a [C.holder.rank]\n"
num_mods_online++
+ else if (R_MENTOR & C.holder.rights)
+ mentmsg += "\t[C] is a [C.holder.rank]\n"
+ num_mentors_online++
+
if(config.admin_irc)
src << "Adminhelps are also sent to IRC. If no admins are available in game try anyway and an admin on IRC may see it and respond."
- msg = "Current Admins ([num_admins_online]):\n" + msg + "\n Current [config.mods_are_mentors ? "Mentors" : "Moderators"]([num_mods_online]):\n" + modmsg
+ msg = "Current Admins ([num_admins_online]):\n" + msg
+
+ if(config.show_mods)
+ msg += "\n Current Moderators ([num_mods_online]):\n" + modmsg
+
+ if(config.show_mentors)
+ msg += "\n Current Mentors ([num_mentors_online]):\n" + mentmsg
src << msg
diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm
index a361328cac..cc26d7153d 100644
--- a/code/modules/admin/DB ban/functions.dm
+++ b/code/modules/admin/DB ban/functions.dm
@@ -302,7 +302,11 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
output += ""
for(var/j in nonhuman_positions)
output += ""
- for(var/j in list("traitor","changeling","operative","revolutionary","cultist","wizard"))
+ var/list/bantypes = list("traitor","changeling","operative","revolutionary","cultist","wizard") //For legacy bans.
+ for(var/antag_type in all_antag_types) // Grab other bans.
+ var/datum/antagonist/antag = all_antag_types[antag_type]
+ bantypes |= antag.bantype
+ for(var/j in bantypes)
output += ""
output += "
"
output += "Reason:
"
diff --git a/code/modules/admin/ToRban.dm b/code/modules/admin/ToRban.dm
index efa835b25e..d127bfe6f4 100644
--- a/code/modules/admin/ToRban.dm
+++ b/code/modules/admin/ToRban.dm
@@ -23,7 +23,7 @@
/proc/ToRban_update()
spawn(0)
log_misc("Downloading updated ToR data...")
- var/http[] = world.Export("http://exitlist.torproject.org/exit-addresses")
+ var/http[] = world.Export("https://check.torproject.org/exit-addresses")
var/list/rawlist = file2list(http["CONTENT"])
if(rawlist.len)
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 40a75861e4..00bc01eda1 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -1097,7 +1097,7 @@ proc/admin_notice(var/message, var/rights)
else
new chosen(usr.loc)
- log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
+ log_and_message_admins("spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -1164,7 +1164,7 @@ proc/admin_notice(var/message, var/rights)
out += "Core antag id:[ticker.mode.antag_tag]."
if(ticker.mode.round_autoantag)
- out += "Autotraitor enabled ([ticker.mode.antag_prob]% spawn chance)"
+ out += "Autotraitor enabled ([ticker.mode.get_antag_prob()]% spawn chance)"
if(ticker.mode.antag_scaling_coeff)
out += " (scaling with [ticker.mode.antag_scaling_coeff])"
out += " "
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 88a52ff85c..3d713ff678 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -83,10 +83,13 @@ var/list/admin_verbs_admin = list(
/client/proc/allow_character_respawn, /* Allows a ghost to respawn */
/client/proc/event_manager_panel,
/client/proc/empty_ai_core_toggle_latejoin,
+ /client/proc/empty_ai_core_toggle_latejoin,
/client/proc/aooc,
/client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */
/client/proc/change_human_appearance_self, /* Allows the human-based mob itself change its basic appearance */
- /client/proc/change_security_level
+ /client/proc/change_security_level,
+ /client/proc/view_chemical_reaction_logs,
+ /client/proc/makePAI
)
var/list/admin_verbs_ban = list(
/client/proc/unban_panel,
@@ -178,6 +181,10 @@ var/list/admin_verbs_debug = list(
/client/proc/toggledebuglogs,
/client/proc/SDQL_query,
/client/proc/SDQL2_query,
+ /client/proc/Jump,
+ /client/proc/jumptomob,
+ /client/proc/jumptocoord,
+ /client/proc/dsay
)
var/list/admin_verbs_paranoid_debug = list(
diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm
index a00a208d3b..4a28ece915 100644
--- a/code/modules/admin/player_notes.dm
+++ b/code/modules/admin/player_notes.dm
@@ -1,167 +1,147 @@
-//This stuff was originally intended to be integrated into the ban-system I was working on
-//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
-//enjoy ~Carn
-/*
-#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
-
-datum/admins/proc/notes_show(var/ckey)
- usr << browse("Player Notes[notes_gethtml(ckey)]","window=player_notes;size=700x400")
-
-
-datum/admins/proc/notes_gethtml(var/ckey)
- var/savefile/notesfile = new(NOTESFILE)
- if(!notesfile) return "Error: Cannot access [NOTESFILE]"
- if(ckey)
- . = "Notes for [ckey]:\[+\]\[-\] "
- notesfile.cd = "/[ckey]"
- var/index = 1
- while( !notesfile.eof )
- var/note
- notesfile >> note
- . += "[note] \[-\] "
- index++
- else
- . = "All Notes:\[+\]\[-\] "
- notesfile.cd = "/"
- for(var/dir in notesfile.dir)
- . += "[dir] "
- return
-
-
-//handles adding notes to the end of a ckey's buffer
-//originally had seperate entries such as var/by to record who left the note and when
-//but the current bansystem is a heap of dung.
-/proc/notes_add(var/ckey, var/note)
- if(!ckey)
- ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null)
- if(!ckey) return
-
- if(!note)
- note = html_encode(input(usr,"Enter your note:","Enter some text",null) as message|null)
- if(!note) return
-
- var/savefile/notesfile = new(NOTESFILE)
- if(!notesfile) return
- notesfile.cd = "/[ckey]"
- notesfile.eof = 1 //move to the end of the buffer
- notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]"
- return
-
-//handles removing entries from the buffer, or removing the entire directory if no start_index is given
-/proc/notes_remove(var/ckey, var/start_index, var/end_index)
- var/savefile/notesfile = new(NOTESFILE)
- if(!notesfile) return
-
- if(!ckey)
- notesfile.cd = "/"
- ckey = ckey(input(usr,"Who would you like to remove notes for?","Enter a ckey",null) as null|anything in notesfile.dir)
- if(!ckey) return
-
- if(start_index)
- notesfile.cd = "/[ckey]"
- var/list/noteslist = list()
- if(!end_index) end_index = start_index
- var/index = 0
- while( !notesfile.eof )
- index++
- var/temp
- notesfile >> temp
- if( (start_index <= index) && (index <= end_index) )
- continue
- noteslist += temp
-
- notesfile.eof = -2 //Move to the start of the buffer and then erase.
-
- for( var/note in noteslist )
- notesfile << note
- else
- notesfile.cd = "/"
- if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
- notesfile.dir.Remove(ckey)
- return
-
-#undef NOTESFILE
-*/
-
-//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
-
-/proc/notes_add(var/key, var/note, var/mob/usr)
- if (!key || !note)
- return
-
- //Loading list of notes for this key
- var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
- var/list/infos
- info >> infos
- if(!infos) infos = list()
-
- //Overly complex timestamp creation
- var/modifyer = "th"
- switch(time2text(world.timeofday, "DD"))
- if("01","21","31")
- modifyer = "st"
- if("02","22",)
- modifyer = "nd"
- if("03","23")
- modifyer = "rd"
- var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
- if(copytext(day_string,1,2) == "0")
- day_string = copytext(day_string,2)
- var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
- var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
-
- var/datum/player_info/P = new
- if (usr)
- P.author = usr.key
- P.rank = usr.client.holder.rank
- else
- P.author = "Adminbot"
- P.rank = "Friendly Robot"
- P.content = note
- P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
-
- infos += P
- info << infos
-
- message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
- log_admin("[key_name(usr)] has edited [key]'s notes.")
-
- qdel(info)
-
- //Updating list of keys with notes on them
- var/savefile/note_list = new("data/player_notes.sav")
- var/list/note_keys
- note_list >> note_keys
- if(!note_keys) note_keys = list()
- if(!note_keys.Find(key)) note_keys += key
- note_list << note_keys
- qdel(note_list)
-
-
-/proc/notes_del(var/key, var/index)
- var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
- var/list/infos
- info >> infos
- if(!infos || infos.len < index) return
-
- var/datum/player_info/item = infos[index]
- infos.Remove(item)
- info << infos
-
- message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
- log_admin("[key_name(usr)] deleted one of [key]'s notes.")
-
- qdel(info)
-
-/proc/show_player_info_irc(var/key as text)
- var/dat = " Info on [key]%0D%0A"
- var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
- var/list/infos
- info >> infos
- if(!infos)
- dat = "No information found on the given key."
- else
- for(var/datum/player_info/I in infos)
- dat += "[I.content]%0D%0Aby [I.author] ([I.rank]) on [I.timestamp]%0D%0A%0D%0A"
-
- return dat
+//This stuff was originally intended to be integrated into the ban-system I was working on
+//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
+//enjoy ~Carn
+/*
+#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
+
+datum/admins/proc/notes_show(var/ckey)
+ usr << browse("Player Notes[notes_gethtml(ckey)]","window=player_notes;size=700x400")
+
+
+datum/admins/proc/notes_gethtml(var/ckey)
+ var/savefile/notesfile = new(NOTESFILE)
+ if(!notesfile) return "Error: Cannot access [NOTESFILE]"
+ if(ckey)
+ . = "Notes for [ckey]:\[+\]\[-\] "
+ notesfile.cd = "/[ckey]"
+ var/index = 1
+ while( !notesfile.eof )
+ var/note
+ notesfile >> note
+ . += "[note] \[-\] "
+ index++
+ else
+ . = "All Notes:\[+\]\[-\] "
+ notesfile.cd = "/"
+ for(var/dir in notesfile.dir)
+ . += "[dir] "
+ return
+
+//handles removing entries from the buffer, or removing the entire directory if no start_index is given
+/proc/notes_remove(var/ckey, var/start_index, var/end_index)
+ var/savefile/notesfile = new(NOTESFILE)
+ if(!notesfile) return
+
+ if(!ckey)
+ notesfile.cd = "/"
+ ckey = ckey(input(usr,"Who would you like to remove notes for?","Enter a ckey",null) as null|anything in notesfile.dir)
+ if(!ckey) return
+
+ if(start_index)
+ notesfile.cd = "/[ckey]"
+ var/list/noteslist = list()
+ if(!end_index) end_index = start_index
+ var/index = 0
+ while( !notesfile.eof )
+ index++
+ var/temp
+ notesfile >> temp
+ if( (start_index <= index) && (index <= end_index) )
+ continue
+ noteslist += temp
+
+ notesfile.eof = -2 //Move to the start of the buffer and then erase.
+
+ for( var/note in noteslist )
+ notesfile << note
+ else
+ notesfile.cd = "/"
+ if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
+ notesfile.dir.Remove(ckey)
+ return
+
+#undef NOTESFILE
+*/
+
+//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
+
+/proc/notes_add(var/key, var/note, var/mob/user)
+ if (!key || !note)
+ return
+
+ //Loading list of notes for this key
+ var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
+ var/list/infos
+ info >> infos
+ if(!infos) infos = list()
+
+ //Overly complex timestamp creation
+ var/modifyer = "th"
+ switch(time2text(world.timeofday, "DD"))
+ if("01","21","31")
+ modifyer = "st"
+ if("02","22",)
+ modifyer = "nd"
+ if("03","23")
+ modifyer = "rd"
+ var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
+ if(copytext(day_string,1,2) == "0")
+ day_string = copytext(day_string,2)
+ var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
+ var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
+
+ var/datum/player_info/P = new
+ if (user)
+ P.author = user.key
+ P.rank = user.client.holder.rank
+ else
+ P.author = "Adminbot"
+ P.rank = "Friendly Robot"
+ P.content = note
+ P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
+
+ infos += P
+ info << infos
+
+ message_admins("\blue [key_name_admin(user)] has edited [key]'s notes.")
+ log_admin("[key_name(user)] has edited [key]'s notes.")
+
+ qdel(info)
+
+ //Updating list of keys with notes on them
+ var/savefile/note_list = new("data/player_notes.sav")
+ var/list/note_keys
+ note_list >> note_keys
+ if(!note_keys) note_keys = list()
+ if(!note_keys.Find(key)) note_keys += key
+ note_list << note_keys
+ qdel(note_list)
+
+
+/proc/notes_del(var/key, var/index)
+ var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
+ var/list/infos
+ info >> infos
+ if(!infos || infos.len < index) return
+
+ var/datum/player_info/item = infos[index]
+ infos.Remove(item)
+ info << infos
+
+ message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
+ log_admin("[key_name(usr)] deleted one of [key]'s notes.")
+
+ qdel(info)
+
+/proc/show_player_info_irc(var/key as text)
+ var/dat = " Info on [key]\n"
+ var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
+ var/list/infos
+ info >> infos
+ if(!infos)
+ dat = "No information found on the given key."
+ else
+ for(var/datum/player_info/I in infos)
+ dat += "[I.content]\nby [I.author] ([I.rank]) on [I.timestamp]\n\n"
+
+ return list2params(list(dat))
diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm
index 828667aa13..9a9a2b44b7 100644
--- a/code/modules/admin/player_panel.dm
+++ b/code/modules/admin/player_panel.dm
@@ -358,7 +358,7 @@
dat += "