"
+*/
+
/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/traitor.dm b/code/game/antagonist/station/traitor.dm
index 8813c41fe5..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(!..())
@@ -148,8 +148,7 @@ var/datum/antagonist/traitor/traitors
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
+ 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."
@@ -158,8 +157,7 @@ var/datum/antagonist/traitor/traitors
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..eaf6da4a0d 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
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index dccc9e9dbf..007bb79c10 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -227,7 +227,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 +260,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 +288,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 854d83d0c0..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
@@ -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..5bc8cc9941 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
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/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/runes.dm b/code/game/gamemodes/cult/runes.dm
index ff5b7ff880..5060b964ca 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -592,6 +592,7 @@ 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]"
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 c6b86d1670..143c37553d 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,8 @@ 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()
+ if(main_antags.candidates.len >= required_enemies)
return 1
return 0
@@ -271,8 +181,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 +202,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 +219,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 +261,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 +401,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 +487,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)
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/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..0812c51429 100644
--- a/code/game/gamemodes/wizard/wizard.dm
+++ b/code/game/gamemodes/wizard/wizard.dm
@@ -6,7 +6,5 @@
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..05b7173323 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
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..834f3f3749 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -518,8 +518,8 @@
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)
+ 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"]
@@ -919,7 +919,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 +946,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()
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/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 1d71196073..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
@@ -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/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 55a5f1862a..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))
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/lapvend.dm b/code/game/machinery/computer3/lapvend.dm
index b2e84f1cd2..0c038b6c87 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
@@ -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/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 a2bfb1b6c2..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 ..()
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 9f5a831b16..13aa4f9ebc 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -199,10 +199,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 +216,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 +269,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 +284,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)
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 02b6ea7f4c..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)
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/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 55cf5cdc15..709f4b4626 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -176,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..c7e5c3f404 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
@@ -395,34 +413,19 @@
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 +474,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 +502,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 +522,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 +542,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 +562,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 +610,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 +624,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 +704,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 +796,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 +833,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 +851,7 @@
finish_name = t
return
+
..()
@@ -855,32 +877,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/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 2c69a461ba..ac561009b6 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -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/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..a1e2287f58 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))
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 23d165bc08..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."
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 c1cadaef5c..6cec144132 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -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 ..()
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index 2b17096547..91e544cf25 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -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/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/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 31df448ed7..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
@@ -153,7 +156,7 @@
if(temp && !temp.is_usable())
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/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 643965fea0..65e8a560df 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -94,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 b0de5e3da1..bc0f836487 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -67,12 +67,8 @@
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."
return
@@ -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/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index f8689208e9..ca2f6300e2 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
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 1974b4bdd2..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 = ""
@@ -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/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 d486cf64ad..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()
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/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/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index 95e1875d40..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
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/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/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 827deda0a1..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
// -----------------------------
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/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/tools.dm b/code/game/objects/items/weapons/tools.dm
index 7c21c9e9f5..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.
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/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 2d593e6e4a..061798be0b 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/girders.dm b/code/game/objects/structures/girders.dm
index d217b10197..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 ..()
@@ -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
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 008d86d8ad..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
@@ -154,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 cac56d23b9..17957cc589 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -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 fe667b5b79..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)
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index ace39fafff..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,7 +166,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 )))
@@ -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/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 3fac8f0978..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
@@ -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/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 dd16c429c4..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
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/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 176cb4f973..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
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 b415a317fc..94bbf16415 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,
diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm
index c5a54694c8..4a28ece915 100644
--- a/code/modules/admin/player_notes.dm
+++ b/code/modules/admin/player_notes.dm
@@ -1,147 +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 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.
-
+//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 (!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
-
+ 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]%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
+
+ 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 += "