diff --git a/baystation12.dme b/baystation12.dme
index f0f28d7b61..a1074dc190 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -16,7 +16,7 @@
#include "code\setup.dm"
#include "code\stylesheet.dm"
#include "code\world.dm"
-#include "code\__HELPERS\atom_pool.dm"
+#include "code\__HELPERS\datum_pool.dm"
#include "code\__HELPERS\files.dm"
#include "code\__HELPERS\game.dm"
#include "code\__HELPERS\global_lists.dm"
@@ -85,15 +85,12 @@
#include "code\ATMOSPHERICS\components\unary\unary_base.dm"
#include "code\ATMOSPHERICS\components\unary\vent_pump.dm"
#include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm"
-#include "code\controllers\_DynamicAreaLighting_TG.dm"
#include "code\controllers\autotransfer.dm"
#include "code\controllers\communications.dm"
#include "code\controllers\configuration.dm"
#include "code\controllers\emergency_shuttle_controller.dm"
-#include "code\controllers\failsafe.dm"
#include "code\controllers\hooks-defs.dm"
#include "code\controllers\hooks.dm"
-#include "code\controllers\lighting_controller.dm"
#include "code\controllers\master_controller.dm"
#include "code\controllers\shuttle_controller.dm"
#include "code\controllers\subsystems.dm"
@@ -106,7 +103,6 @@
#include "code\controllers\Processes\event.dm"
#include "code\controllers\Processes\garbage.dm"
#include "code\controllers\Processes\inactivity.dm"
-#include "code\controllers\Processes\lighting.dm"
#include "code\controllers\Processes\machinery.dm"
#include "code\controllers\Processes\mob.dm"
#include "code\controllers\Processes\nanoui.dm"
@@ -214,7 +210,6 @@
#include "code\game\response_team.dm"
#include "code\game\shuttle_engines.dm"
#include "code\game\skincmd.dm"
-#include "code\game\smoothwall.dm"
#include "code\game\sound.dm"
#include "code\game\supplyshuttle.dm"
#include "code\game\antagonist\antagonist.dm"
@@ -328,6 +323,7 @@
#include "code\game\machinery\bioprinter.dm"
#include "code\game\machinery\bluespacerelay.dm"
#include "code\game\machinery\buttons.dm"
+#include "code\game\machinery\CableLayer.dm"
#include "code\game\machinery\cell_charger.dm"
#include "code\game\machinery\cloning.dm"
#include "code\game\machinery\constructable_frame.dm"
@@ -338,6 +334,7 @@
#include "code\game\machinery\doppler_array.dm"
#include "code\game\machinery\flasher.dm"
#include "code\game\machinery\floodlight.dm"
+#include "code\game\machinery\floorlayer.dm"
#include "code\game\machinery\hologram.dm"
#include "code\game\machinery\holosign.dm"
#include "code\game\machinery\igniter.dm"
@@ -370,6 +367,7 @@
#include "code\game\machinery\turret_control.dm"
#include "code\game\machinery\turrets.dm"
#include "code\game\machinery\vending.dm"
+#include "code\game\machinery\wall_frames.dm"
#include "code\game\machinery\washing_machine.dm"
#include "code\game\machinery\wishgranter.dm"
#include "code\game\machinery\atmoalter\area_atmos_computer.dm"
@@ -379,12 +377,7 @@
#include "code\game\machinery\atmoalter\pump.dm"
#include "code\game\machinery\atmoalter\scrubber.dm"
#include "code\game\machinery\bots\bots.dm"
-#include "code\game\machinery\bots\cleanbot.dm"
-#include "code\game\machinery\bots\ed209bot.dm"
-#include "code\game\machinery\bots\floorbot.dm"
-#include "code\game\machinery\bots\medbot.dm"
#include "code\game\machinery\bots\mulebot.dm"
-#include "code\game\machinery\bots\secbot.dm"
#include "code\game\machinery\camera\camera.dm"
#include "code\game\machinery\camera\camera_assembly.dm"
#include "code\game\machinery\camera\motion.dm"
@@ -476,6 +469,7 @@
#include "code\game\machinery\kitchen\smartfridge.dm"
#include "code\game\machinery\pipe\construction.dm"
#include "code\game\machinery\pipe\pipe_dispenser.dm"
+#include "code\game\machinery\pipe\pipelayer.dm"
#include "code\game\machinery\telecomms\broadcaster.dm"
#include "code\game\machinery\telecomms\logbrowser.dm"
#include "code\game\machinery\telecomms\machine_interactions.dm"
@@ -707,7 +701,6 @@
#include "code\game\objects\structures\door_assembly.dm"
#include "code\game\objects\structures\electricchair.dm"
#include "code\game\objects\structures\extinguisher.dm"
-#include "code\game\objects\structures\false_walls.dm"
#include "code\game\objects\structures\flora.dm"
#include "code\game\objects\structures\girders.dm"
#include "code\game\objects\structures\grille.dm"
@@ -771,10 +764,10 @@
#include "code\game\turfs\unsimulated.dm"
#include "code\game\turfs\simulated\floor.dm"
#include "code\game\turfs\simulated\floor_types.dm"
+#include "code\game\turfs\simulated\wall_attacks.dm"
+#include "code\game\turfs\simulated\wall_icon.dm"
+#include "code\game\turfs\simulated\wall_types.dm"
#include "code\game\turfs\simulated\walls.dm"
-#include "code\game\turfs\simulated\walls_mineral.dm"
-#include "code\game\turfs\simulated\walls_misc.dm"
-#include "code\game\turfs\simulated\walls_reinforced.dm"
#include "code\game\turfs\space\space.dm"
#include "code\game\turfs\space\transit.dm"
#include "code\game\turfs\unsimulated\beach.dm"
@@ -817,6 +810,7 @@
#include "code\modules\admin\verbs\deadsay.dm"
#include "code\modules\admin\verbs\debug.dm"
#include "code\modules\admin\verbs\diagnostics.dm"
+#include "code\modules\admin\verbs\dice.dm"
#include "code\modules\admin\verbs\getlogs.dm"
#include "code\modules\admin\verbs\icarus.dm"
#include "code\modules\admin\verbs\mapping.dm"
@@ -954,8 +948,10 @@
#include "code\modules\economy\Events.dm"
#include "code\modules\economy\Events_Mundane.dm"
#include "code\modules\economy\TradeDestinations.dm"
+#include "code\modules\events\apc_damage.dm"
#include "code\modules\events\blob.dm"
#include "code\modules\events\brand_intelligence.dm"
+#include "code\modules\events\camera_damage.dm"
#include "code\modules\events\carp_migration.dm"
#include "code\modules\events\comms_blackout.dm"
#include "code\modules\events\communications_blackout.dm"
@@ -989,6 +985,7 @@
#include "code\modules\examine\descriptions\engineering.dm"
#include "code\modules\examine\descriptions\medical.dm"
#include "code\modules\examine\descriptions\mobs.dm"
+#include "code\modules\examine\descriptions\paperwork.dm"
#include "code\modules\examine\descriptions\stacks.dm"
#include "code\modules\examine\descriptions\structures.dm"
#include "code\modules\examine\descriptions\turfs.dm"
@@ -1003,6 +1000,7 @@
#include "code\modules\genetics\side_effects.dm"
#include "code\modules\holodeck\HolodeckControl.dm"
#include "code\modules\holodeck\HolodeckObjects.dm"
+#include "code\modules\holodeck\HolodeckPrograms.dm"
#include "code\modules\hydroponics\_hydro_setup.dm"
#include "code\modules\hydroponics\grown.dm"
#include "code\modules\hydroponics\grown_inedible.dm"
@@ -1027,11 +1025,20 @@
#include "code\modules\library\lib_items.dm"
#include "code\modules\library\lib_machines.dm"
#include "code\modules\library\lib_readme.dm"
+#include "code\modules\lighting\_lighting_defs.dm"
+#include "code\modules\lighting\light_source.dm"
+#include "code\modules\lighting\lighting_atom.dm"
+#include "code\modules\lighting\lighting_overlay.dm"
+#include "code\modules\lighting\lighting_process.dm"
+#include "code\modules\lighting\lighting_system.dm"
+#include "code\modules\lighting\lighting_turf.dm"
+#include "code\modules\lighting\~lighting_undefs.dm"
#include "code\modules\liquid\splash_simulation.dm"
#include "code\modules\maps\dmm_suite.dm"
#include "code\modules\maps\reader.dm"
#include "code\modules\maps\swapmaps.dm"
#include "code\modules\maps\writer.dm"
+#include "code\modules\materials\materials.dm"
#include "code\modules\mining\abandonedcrates.dm"
#include "code\modules\mining\alloys.dm"
#include "code\modules\mining\coins.dm"
@@ -1041,7 +1048,7 @@
#include "code\modules\mining\machine_unloading.dm"
#include "code\modules\mining\mine_items.dm"
#include "code\modules\mining\mine_turfs.dm"
-#include "code\modules\mining\minerals.dm"
+#include "code\modules\mining\mineral_effect.dm"
#include "code\modules\mining\mint.dm"
#include "code\modules\mining\money_bag.dm"
#include "code\modules\mining\ore.dm"
@@ -1102,11 +1109,19 @@
#include "code\modules\mob\living\logout.dm"
#include "code\modules\mob\living\say.dm"
#include "code\modules\mob\living\blob\blob.dm"
+#include "code\modules\mob\living\bot\bot.dm"
+#include "code\modules\mob\living\bot\cleanbot.dm"
+#include "code\modules\mob\living\bot\ed209bot.dm"
+#include "code\modules\mob\living\bot\farmbot.dm"
+#include "code\modules\mob\living\bot\floorbot.dm"
+#include "code\modules\mob\living\bot\medbot.dm"
+#include "code\modules\mob\living\bot\secbot.dm"
#include "code\modules\mob\living\carbon\breathe.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
#include "code\modules\mob\living\carbon\carbon_defines.dm"
#include "code\modules\mob\living\carbon\carbon_powers.dm"
#include "code\modules\mob\living\carbon\give.dm"
+#include "code\modules\mob\living\carbon\resist.dm"
#include "code\modules\mob\living\carbon\shock.dm"
#include "code\modules\mob\living\carbon\viruses.dm"
#include "code\modules\mob\living\carbon\alien\alien.dm"
@@ -1202,7 +1217,6 @@
#include "code\modules\mob\living\silicon\ai\login.dm"
#include "code\modules\mob\living\silicon\ai\logout.dm"
#include "code\modules\mob\living\silicon\ai\say.dm"
-#include "code\modules\mob\living\silicon\ai\subsystems.dm"
#include "code\modules\mob\living\silicon\decoy\death.dm"
#include "code\modules\mob\living\silicon\decoy\decoy.dm"
#include "code\modules\mob\living\silicon\decoy\life.dm"
@@ -1294,8 +1308,11 @@
#include "code\modules\nano\interaction\contained.dm"
#include "code\modules\nano\interaction\default.dm"
#include "code\modules\nano\interaction\inventory.dm"
+#include "code\modules\nano\interaction\physical.dm"
+#include "code\modules\nano\interaction\self.dm"
#include "code\modules\nano\interaction\zlevel.dm"
#include "code\modules\nano\modules\alarm_monitor.dm"
+#include "code\modules\nano\modules\atmos_control.dm"
#include "code\modules\nano\modules\crew_monitor.dm"
#include "code\modules\nano\modules\human_appearance.dm"
#include "code\modules\nano\modules\law_manager.dm"
@@ -1433,11 +1450,16 @@
#include "code\modules\reagents\Chemistry-Holder.dm"
#include "code\modules\reagents\Chemistry-Machinery.dm"
#include "code\modules\reagents\Chemistry-Readme.dm"
-#include "code\modules\reagents\Chemistry-Reagents-Antidepressants.dm"
#include "code\modules\reagents\Chemistry-Reagents.dm"
#include "code\modules\reagents\Chemistry-Recipes.dm"
#include "code\modules\reagents\reagent_containers.dm"
#include "code\modules\reagents\reagent_dispenser.dm"
+#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Core.dm"
+#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Dispenser.dm"
+#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Food-Drinks.dm"
+#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Medicine.dm"
+#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Other.dm"
+#include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Toxins.dm"
#include "code\modules\reagents\dispenser\_defines.dm"
#include "code\modules\reagents\dispenser\cartridge.dm"
#include "code\modules\reagents\dispenser\cartridge_presets.dm"
diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
index 7d57ea6c8f..37985034b1 100644
--- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
@@ -44,15 +44,15 @@ obj/machinery/atmospherics/binary
return null
- Del()
+ Destroy()
loc = null
if(node1)
node1.disconnect(src)
- del(network1)
+ qdel(network1)
if(node2)
node2.disconnect(src)
- del(network2)
+ qdel(network2)
node1 = null
node2 = null
@@ -123,11 +123,11 @@ obj/machinery/atmospherics/binary
disconnect(obj/machinery/atmospherics/reference)
if(reference==node1)
- del(network1)
+ qdel(network1)
node1 = null
else if(reference==node2)
- del(network2)
+ qdel(network2)
node2 = null
update_icon()
diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
index a4b720302b..6627d15d73 100644
--- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
@@ -112,10 +112,10 @@
else
if(node1)
node1.disconnect(src)
- del(network1)
+ qdel(network1)
if(node2)
node2.disconnect(src)
- del(network2)
+ qdel(network2)
node1 = null
node2 = null
diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
index b0ef990145..7604f33063 100644
--- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
@@ -258,4 +258,4 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
diff --git a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
index 6923b6d31e..aead60a382 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
@@ -38,15 +38,15 @@
if(WEST)
initialize_directions = NORTH|SOUTH
- Del()
+ Destroy()
loc = null
if(node1)
node1.disconnect(src)
- del(network1)
+ qdel(network1)
if(node2)
node2.disconnect(src)
- del(network2)
+ qdel(network2)
node1 = null
node2 = null
@@ -110,10 +110,10 @@
else
if(node1)
node1.disconnect(src)
- del(network1)
+ qdel(network1)
if(node2)
node2.disconnect(src)
- del(network2)
+ qdel(network2)
node1 = null
node2 = null
@@ -216,11 +216,11 @@
disconnect(obj/machinery/atmospherics/reference)
if(reference==node1)
- del(network1)
+ qdel(network1)
node1 = null
else if(reference==node2)
- del(network2)
+ qdel(network2)
node2 = null
return null
diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm
index 87eaf9250d..079dfb76cd 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm
@@ -235,4 +235,4 @@ Thus, the two variables affect pump operation are set in New():
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
diff --git a/code/ATMOSPHERICS/components/omni_devices/filter.dm b/code/ATMOSPHERICS/components/omni_devices/filter.dm
index 3478f0f142..b2966ef431 100644
--- a/code/ATMOSPHERICS/components/omni_devices/filter.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/filter.dm
@@ -24,7 +24,7 @@
for(var/datum/omni_port/P in ports)
P.air.volume = ATMOS_DEFAULT_VOLUME_FILTER
-/obj/machinery/atmospherics/omni/filter/Del()
+/obj/machinery/atmospherics/omni/filter/Destroy()
input = null
output = null
filters.Cut()
diff --git a/code/ATMOSPHERICS/components/omni_devices/mixer.dm b/code/ATMOSPHERICS/components/omni_devices/mixer.dm
index 970a33feee..f52269ee60 100644
--- a/code/ATMOSPHERICS/components/omni_devices/mixer.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/mixer.dm
@@ -49,7 +49,7 @@
for(var/datum/omni_port/P in ports)
P.air.volume = ATMOS_DEFAULT_VOLUME_MIXER
-/obj/machinery/atmospherics/omni/mixer/Del()
+/obj/machinery/atmospherics/omni/mixer/Destroy()
inputs.Cut()
output = null
..()
diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
index 3d259ad941..52ab44fa74 100644
--- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
@@ -98,7 +98,7 @@
"\blue You have unfastened \the [src].", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
/obj/machinery/atmospherics/omni/attack_hand(user as mob)
if(..())
@@ -231,13 +231,13 @@
return null
-/obj/machinery/atmospherics/omni/Del()
+/obj/machinery/atmospherics/omni/Destroy()
loc = null
for(var/datum/omni_port/P in ports)
if(P.node)
P.node.disconnect(src)
- del(P.network)
+ qdel(P.network)
P.node = null
..()
@@ -292,7 +292,7 @@
/obj/machinery/atmospherics/omni/disconnect(obj/machinery/atmospherics/reference)
for(var/datum/omni_port/P in ports)
if(reference == P.node)
- del(P.network)
+ qdel(P.network)
P.node = null
P.update = 1
break
diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm
index 315de2ce7c..c33ff79967 100644
--- a/code/ATMOSPHERICS/components/portables_connector.dm
+++ b/code/ATMOSPHERICS/components/portables_connector.dm
@@ -60,7 +60,7 @@
return null
-/obj/machinery/atmospherics/portables_connector/Del()
+/obj/machinery/atmospherics/portables_connector/Destroy()
loc = null
if(connected_device)
@@ -68,7 +68,7 @@
if(node)
node.disconnect(src)
- del(network)
+ qdel(network)
node = null
@@ -122,7 +122,7 @@
/obj/machinery/atmospherics/portables_connector/disconnect(obj/machinery/atmospherics/reference)
if(reference==node)
- del(network)
+ qdel(network)
node = null
update_underlays()
@@ -152,4 +152,4 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
index 7a5fca0fa7..0921d1d0aa 100755
--- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
@@ -54,9 +54,6 @@
air2.volume = ATMOS_DEFAULT_VOLUME_FILTER
air3.volume = ATMOS_DEFAULT_VOLUME_FILTER
- if(radio_controller)
- initialize()
-
/obj/machinery/atmospherics/trinary/filter/update_icon()
if(istype(src, /obj/machinery/atmospherics/trinary/filter/m_filter))
icon_state = "m"
@@ -148,7 +145,7 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
/obj/machinery/atmospherics/trinary/filter/attack_hand(user as mob) // -- TLE
diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
index c6f5b17613..a200de25a0 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
@@ -120,7 +120,7 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
/obj/machinery/atmospherics/trinary/mixer/attack_hand(user as mob)
if(..())
diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
index ff46b9b55f..3f5d66f262 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
@@ -52,18 +52,18 @@ obj/machinery/atmospherics/trinary
return null
- Del()
+ Destroy()
loc = null
if(node1)
node1.disconnect(src)
- del(network1)
+ qdel(network1)
if(node2)
node2.disconnect(src)
- del(network2)
+ qdel(network2)
if(node3)
node3.disconnect(src)
- del(network3)
+ qdel(network3)
node1 = null
node2 = null
@@ -153,15 +153,15 @@ obj/machinery/atmospherics/trinary
disconnect(obj/machinery/atmospherics/reference)
if(reference==node1)
- del(network1)
+ qdel(network1)
node1 = null
else if(reference==node2)
- del(network2)
+ qdel(network2)
node2 = null
else if(reference==node3)
- del(network3)
+ qdel(network3)
node3 = null
update_underlays()
diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm
index 68a1036a78..42556232bd 100644
--- a/code/ATMOSPHERICS/components/tvalve.dm
+++ b/code/ATMOSPHERICS/components/tvalve.dm
@@ -101,18 +101,18 @@
return null
-/obj/machinery/atmospherics/tvalve/Del()
+/obj/machinery/atmospherics/tvalve/Destroy()
loc = null
if(node1)
node1.disconnect(src)
- del(network_node1)
+ qdel(network_node1)
if(node2)
node2.disconnect(src)
- del(network_node2)
+ qdel(network_node2)
if(node3)
node3.disconnect(src)
- del(network_node3)
+ qdel(network_node3)
node1 = null
node2 = null
@@ -128,9 +128,9 @@
update_icon()
if(network_node1)
- del(network_node1)
+ qdel(network_node1)
if(network_node3)
- del(network_node3)
+ qdel(network_node3)
build_network()
if(network_node1&&network_node2)
@@ -153,9 +153,9 @@
update_icon()
if(network_node1)
- del(network_node1)
+ qdel(network_node1)
if(network_node2)
- del(network_node2)
+ qdel(network_node2)
build_network()
if(network_node1&&network_node3)
@@ -262,15 +262,15 @@
/obj/machinery/atmospherics/tvalve/disconnect(obj/machinery/atmospherics/reference)
if(reference==node1)
- del(network_node1)
+ qdel(network_node1)
node1 = null
else if(reference==node2)
- del(network_node2)
+ qdel(network_node2)
node2 = null
else if(reference==node3)
- del(network_node3)
+ qdel(network_node3)
node2 = null
update_underlays()
@@ -366,7 +366,7 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
/obj/machinery/atmospherics/tvalve/mirrored
icon_state = "map_tvalvem0"
diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
index 7d03ad9883..0e75146adc 100644
--- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
+++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm
@@ -86,4 +86,4 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
\ No newline at end of file
+ qdel(src)
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm
index 6635631f2d..eea2dba1ab 100644
--- a/code/ATMOSPHERICS/components/unary/unary_base.dm
+++ b/code/ATMOSPHERICS/components/unary/unary_base.dm
@@ -28,12 +28,12 @@
return null
- Del()
+ Destroy()
loc = null
if(node)
node.disconnect(src)
- del(network)
+ qdel(network)
node = null
@@ -84,7 +84,7 @@
disconnect(obj/machinery/atmospherics/reference)
if(reference==node)
- del(network)
+ qdel(network)
node = null
update_icon()
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 0f0d7095fa..e8494697dc 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -67,15 +67,10 @@
icon = null
initial_loc = get_area(loc)
- if (initial_loc.master)
- initial_loc = initial_loc.master
area_uid = initial_loc.uid
if (!id_tag)
assign_uid()
id_tag = num2text(uid)
- if(ticker && ticker.current_state == 3)//if the game is running
- src.initialize()
- src.broadcast_status()
/obj/machinery/atmospherics/unary/vent_pump/high_volume
name = "Large Air Vent"
@@ -259,11 +254,12 @@
/obj/machinery/atmospherics/unary/vent_pump/initialize()
..()
- //some vents work his own spesial way
+ //some vents work his own special way
radio_filter_in = frequency==1439?(RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==1439?(RADIO_TO_AIRALARM):null
if(frequency)
set_frequency(frequency)
+ src.broadcast_status()
/obj/machinery/atmospherics/unary/vent_pump/receive_signal(datum/signal/signal)
if(stat & (NOPOWER|BROKEN))
@@ -414,9 +410,9 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
-/obj/machinery/atmospherics/unary/vent_pump/Del()
+/obj/machinery/atmospherics/unary/vent_pump/Destroy()
if(initial_loc)
initial_loc.air_vent_info -= id_tag
initial_loc.air_vent_names -= id_tag
diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
index 63a0549acc..d09328d767 100644
--- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
@@ -36,15 +36,10 @@
icon = null
initial_loc = get_area(loc)
- if (initial_loc.master)
- initial_loc = initial_loc.master
area_uid = initial_loc.uid
if (!id_tag)
assign_uid()
id_tag = num2text(uid)
- if(ticker && ticker.current_state == 3)//if the game is running
- src.initialize()
- src.broadcast_status()
/obj/machinery/atmospherics/unary/vent_scrubber/update_icon(var/safety = 0)
if(!check_icon_cache())
@@ -121,6 +116,7 @@
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
if (frequency)
set_frequency(frequency)
+ src.broadcast_status()
/obj/machinery/atmospherics/unary/vent_scrubber/process()
..()
@@ -270,7 +266,7 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
if(..(user, 1))
@@ -278,7 +274,7 @@
else
user << "You are too far away to read the gauge."
-/obj/machinery/atmospherics/unary/vent_scrubber/Del()
+/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
if(initial_loc)
initial_loc.air_scrub_info -= id_tag
initial_loc.air_scrub_names -= id_tag
diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm
index 9cc6f7451c..49ae4af2cf 100644
--- a/code/ATMOSPHERICS/components/valve.dm
+++ b/code/ATMOSPHERICS/components/valve.dm
@@ -73,15 +73,15 @@
return null
-/obj/machinery/atmospherics/valve/Del()
+/obj/machinery/atmospherics/valve/Destroy()
loc = null
if(node1)
node1.disconnect(src)
- del(network_node1)
+ qdel(network_node1)
if(node2)
node2.disconnect(src)
- del(network_node2)
+ qdel(network_node2)
node1 = null
node2 = null
@@ -113,9 +113,9 @@
update_icon()
if(network_node1)
- del(network_node1)
+ qdel(network_node1)
if(network_node2)
- del(network_node2)
+ qdel(network_node2)
build_network()
@@ -214,11 +214,11 @@
/obj/machinery/atmospherics/valve/disconnect(obj/machinery/atmospherics/reference)
if(reference==node1)
- del(network_node1)
+ qdel(network_node1)
node1 = null
else if(reference==node2)
- del(network_node2)
+ qdel(network_node2)
node2 = null
update_underlays()
@@ -310,7 +310,7 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe(loc, make_from=src)
- del(src)
+ qdel(src)
/obj/machinery/atmospherics/valve/examine(mob/user)
..()
diff --git a/code/ATMOSPHERICS/datum_pipe_network.dm b/code/ATMOSPHERICS/datum_pipe_network.dm
index 4098c15c31..7fe586733c 100644
--- a/code/ATMOSPHERICS/datum_pipe_network.dm
+++ b/code/ATMOSPHERICS/datum_pipe_network.dm
@@ -31,7 +31,7 @@ datum/pipe_network
//Notes: Assuming that members will add themselves to appropriate roster in network_expand()
if(!start_normal)
- del(src)
+ qdel(src)
start_normal.network_expand(src, reference)
@@ -40,7 +40,7 @@ datum/pipe_network
if((normal_members.len>0)||(line_members.len>0))
pipe_networks += src
else
- del(src)
+ qdel(src)
proc/merge(datum/pipe_network/giver)
if(giver==src) return 0
diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm
index 662376e9b4..f4f4e37990 100644
--- a/code/ATMOSPHERICS/datum_pipeline.dm
+++ b/code/ATMOSPHERICS/datum_pipeline.dm
@@ -9,13 +9,13 @@ datum/pipeline
var/alert_pressure = 0
- Del()
+ Destroy()
if(network)
- del(network)
+ qdel(network)
if(air && air.volume)
temporarily_store_air()
- del(air)
+ qdel(air)
..()
diff --git a/code/ATMOSPHERICS/he_pipes.dm b/code/ATMOSPHERICS/he_pipes.dm
index cb11410f86..d78bb828e2 100644
--- a/code/ATMOSPHERICS/he_pipes.dm
+++ b/code/ATMOSPHERICS/he_pipes.dm
@@ -44,7 +44,7 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging
node2 = target
break
if(!node1 && !node2)
- del(src)
+ qdel(src)
return
update_icon()
@@ -141,7 +141,7 @@ obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
break
if(!node1&&!node2)
- del(src)
+ qdel(src)
return
update_icon()
diff --git a/code/ATMOSPHERICS/mainspipe.dm b/code/ATMOSPHERICS/mainspipe.dm
index d70d2bc53e..a381b28c37 100644
--- a/code/ATMOSPHERICS/mainspipe.dm
+++ b/code/ATMOSPHERICS/mainspipe.dm
@@ -99,7 +99,7 @@ obj/machinery/atmospherics/mains_pipe
for(var/obj/machinery/atmospherics/pipe/mains_component/node in nodes)
node.disconnect()
- Del()
+ Destroy()
disconnect()
..()
@@ -152,7 +152,7 @@ obj/machinery/atmospherics/mains_pipe/simple
else
if(!nodes[1]&&!nodes[2])
- del(src) //TODO: silent deleting looks weird
+ qdel(src) //TODO: silent deleting looks weird
var/have_node1 = nodes[1]?1:0
var/have_node2 = nodes[2]?1:0
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm
index 92ad93c7d0..2315e856fd 100644
--- a/code/ATMOSPHERICS/pipes.dm
+++ b/code/ATMOSPHERICS/pipes.dm
@@ -30,7 +30,7 @@
/obj/machinery/atmospherics/pipe/proc/check_pressure(pressure)
//Return 1 if parent should continue checking other pipes
- //Return null if parent should stop checking other pipes. Recall: del(src) will by default return null
+ //Return null if parent should stop checking other pipes. Recall: qdel(src) will by default return null
return 1
@@ -62,8 +62,8 @@
return parent.return_network(reference)
-/obj/machinery/atmospherics/pipe/Del()
- del(parent)
+/obj/machinery/atmospherics/pipe/Destroy()
+ qdel(parent)
if(air_temporary)
loc.assume_air(air_temporary)
@@ -101,8 +101,8 @@
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
new /obj/item/pipe_meter(T)
- del(meter)
- del(src)
+ qdel(meter)
+ qdel(src)
/obj/machinery/atmospherics/proc/change_color(var/new_color)
//only pass valid pipe colors please ~otherwise your pipe will turn invisible
@@ -219,7 +219,7 @@
var/datum/effect/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, src.loc, 0)
smoke.start()
- del(src)
+ qdel(src)
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
if(dir==3)
@@ -227,7 +227,7 @@
else if(dir==12)
set_dir(4)
-/obj/machinery/atmospherics/pipe/simple/Del()
+/obj/machinery/atmospherics/pipe/simple/Destroy()
if(node1)
node1.disconnect(src)
if(node2)
@@ -260,8 +260,8 @@
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
new /obj/item/pipe_meter(T)
- del(meter)
- del(src)
+ qdel(meter)
+ qdel(src)
else if(node1 && node2)
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]intact[icon_connect_type]")
else
@@ -294,7 +294,7 @@
break
if(!node1 && !node2)
- del(src)
+ qdel(src)
return
var/turf/T = get_turf(src)
@@ -305,12 +305,12 @@
/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node1 = null
if(reference == node2)
if(istype(node2, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node2 = null
update_icon()
@@ -459,7 +459,7 @@
else
. = PROCESS_KILL
-/obj/machinery/atmospherics/pipe/manifold/Del()
+/obj/machinery/atmospherics/pipe/manifold/Destroy()
if(node1)
node1.disconnect(src)
if(node2)
@@ -472,17 +472,17 @@
/obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node1 = null
if(reference == node2)
if(istype(node2, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node2 = null
if(reference == node3)
if(istype(node3, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node3 = null
update_icon()
@@ -511,8 +511,8 @@
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
new /obj/item/pipe_meter(T)
- del(meter)
- del(src)
+ qdel(meter)
+ qdel(src)
else
overlays.Cut()
overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type)
@@ -578,7 +578,7 @@
break
if(!node1 && !node2 && !node3)
- del(src)
+ qdel(src)
return
var/turf/T = get_turf(src)
@@ -701,7 +701,7 @@
else
. = PROCESS_KILL
-/obj/machinery/atmospherics/pipe/manifold4w/Del()
+/obj/machinery/atmospherics/pipe/manifold4w/Destroy()
if(node1)
node1.disconnect(src)
if(node2)
@@ -716,22 +716,22 @@
/obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node1 = null
if(reference == node2)
if(istype(node2, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node2 = null
if(reference == node3)
if(istype(node3, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node3 = null
if(reference == node4)
if(istype(node4, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node4 = null
update_icon()
@@ -762,8 +762,8 @@
for (var/obj/machinery/meter/meter in T)
if (meter.target == src)
new /obj/item/pipe_meter(T)
- del(meter)
- del(src)
+ qdel(meter)
+ qdel(src)
else
overlays.Cut()
overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type)
@@ -837,7 +837,7 @@
break
if(!node1 && !node2 && !node3 && !node4)
- del(src)
+ qdel(src)
return
var/turf/T = get_turf(src)
@@ -958,7 +958,7 @@
..()
else
. = PROCESS_KILL
-/obj/machinery/atmospherics/pipe/cap/Del()
+/obj/machinery/atmospherics/pipe/cap/Destroy()
if(node)
node.disconnect(src)
@@ -967,7 +967,7 @@
/obj/machinery/atmospherics/pipe/cap/disconnect(obj/machinery/atmospherics/reference)
if(reference == node)
if(istype(node, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node = null
update_icon()
@@ -1074,7 +1074,7 @@
else
. = PROCESS_KILL
-/obj/machinery/atmospherics/pipe/tank/Del()
+/obj/machinery/atmospherics/pipe/tank/Destroy()
if(node1)
node1.disconnect(src)
@@ -1108,7 +1108,7 @@
/obj/machinery/atmospherics/pipe/tank/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node1 = null
update_underlays()
@@ -1258,7 +1258,7 @@
else
parent.mingle_with_turf(loc, volume)
-/obj/machinery/atmospherics/pipe/vent/Del()
+/obj/machinery/atmospherics/pipe/vent/Destroy()
if(node1)
node1.disconnect(src)
@@ -1290,7 +1290,7 @@
/obj/machinery/atmospherics/pipe/vent/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node1 = null
update_icon()
diff --git a/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm b/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm
index 4c173b7b7e..7374963fba 100644
--- a/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm
+++ b/code/FEA/DEBUG_REMOVE_BEFORE_RELEASE.dm
@@ -342,7 +342,7 @@ obj/machinery/atmospherics
set src in world
set category = "Minor"
- del(src)
+ qdel(src)
pipeline_data()
set src in world
@@ -487,7 +487,7 @@ obj/window
destroy()
set category = "Minor"
set src in world
- del(src)
+ qdel(src)
mob
sight = SEE_OBJS|SEE_TURFS
diff --git a/code/FEA/FEA_fire.dm b/code/FEA/FEA_fire.dm
index b7a8d42fa5..fe18350da0 100644
--- a/code/FEA/FEA_fire.dm
+++ b/code/FEA/FEA_fire.dm
@@ -171,7 +171,7 @@
return
/*
-/obj/effect/hotspot/Del()
+/obj/effect/hotspot/Destroy()
if (istype(loc, /turf/simulated))
DestroyTurf()
..()
diff --git a/code/FEA/FEA_gas_mixture.dm b/code/FEA/FEA_gas_mixture.dm
index 6beeffc187..a2a1af194e 100644
--- a/code/FEA/FEA_gas_mixture.dm
+++ b/code/FEA/FEA_gas_mixture.dm
@@ -346,7 +346,7 @@ What are the archived variables for?
trace_gases += corresponding
corresponding.moles += trace_gas.moles*giver.group_multiplier/group_multiplier
- // del(giver)
+ // qdel(giver)
return 1
remove(amount)
diff --git a/code/FEA/FEA_system.dm b/code/FEA/FEA_system.dm
index 574fd1ba26..6a3dfe0f8b 100644
--- a/code/FEA/FEA_system.dm
+++ b/code/FEA/FEA_system.dm
@@ -291,7 +291,7 @@ datum
var/turf/simulated/T = turf
T.parent = null
turfs += T
- del(turf_AG)
+ qdel(turf_AG)
for(var/turf/simulated/S in turfs) //Have old members try to form new groups
if(!S.parent)
@@ -306,7 +306,7 @@ datum
for(var/obj/movable/floor/OM in object_AG.members)
OM.parent = null
movable_objects += OM
- del(object_AG)
+ qdel(object_AG)
for(var/obj/movable/floor/OM in movable_objects) //Have old members try to form new groups
if(!OM.parent)
diff --git a/code/FEA/FEA_turf_tile.dm b/code/FEA/FEA_turf_tile.dm
index 981d0b023c..da7b1f856c 100644
--- a/code/FEA/FEA_turf_tile.dm
+++ b/code/FEA/FEA_turf_tile.dm
@@ -14,7 +14,7 @@ atom/movable/proc/experience_pressure_difference(pressure_difference, direction)
turf
assume_air(datum/gas_mixture/giver) //use this for machines to adjust air
- del(giver)
+ qdel(giver)
return 0
return_air()
@@ -148,7 +148,7 @@ turf/simulated
if(istype(target))
air_master.tiles_to_update.Add(target)
- Del()
+ Destroy()
if(air_master)
if(parent)
air_master.groups_to_rebuild.Add(parent)
diff --git a/code/TriDimension/Pipes.dm b/code/TriDimension/Pipes.dm
index d6b87f2909..c71255a34b 100644
--- a/code/TriDimension/Pipes.dm
+++ b/code/TriDimension/Pipes.dm
@@ -45,8 +45,6 @@ obj/machinery/atmospherics/pipe/zpipe/New()
initialize_directions = EAST
if(SOUTHWEST)
initialize_directions = SOUTH
- initialize()
-
obj/machinery/atmospherics/pipe/zpipe/hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
@@ -80,7 +78,7 @@ obj/machinery/atmospherics/pipe/zpipe/proc/burst()
var/datum/effect/effect/system/smoke_spread/smoke = new
smoke.set_up(1,0, src.loc, 0)
smoke.start()
- del(src)
+ qdel(src) // NOT qdel.
obj/machinery/atmospherics/pipe/zpipe/proc/normalize_dir()
if(dir==3)
@@ -88,7 +86,7 @@ obj/machinery/atmospherics/pipe/zpipe/proc/normalize_dir()
else if(dir==12)
set_dir(4)
-obj/machinery/atmospherics/pipe/zpipe/Del()
+obj/machinery/atmospherics/pipe/zpipe/Destroy()
if(node1)
node1.disconnect(src)
if(node2)
@@ -104,12 +102,12 @@ obj/machinery/atmospherics/pipe/zpipe/update_icon()
obj/machinery/atmospherics/pipe/zpipe/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node1 = null
if(reference == node2)
if(istype(node2, /obj/machinery/atmospherics/pipe))
- del(parent)
+ qdel(parent)
node2 = null
return null
diff --git a/code/TriDimension/Structures.dm b/code/TriDimension/Structures.dm
index 554853535a..9224facba2 100644
--- a/code/TriDimension/Structures.dm
+++ b/code/TriDimension/Structures.dm
@@ -41,18 +41,18 @@
switch(severity)
if(1.0)
if(icon_state == "ladderup" && prob(10))
- Del()
+ qdel(src)
if(2.0)
if(prob(50))
- Del()
+ qdel(src)
if(3.0)
- Del()
+ qdel(src)
return*/
- Del()
+ Destroy()
spawn(1)
if(target && icon_state == "ladderdown")
- del target
+ qdel(target)
return ..()
attackby(obj/item/C as obj, mob/user as mob)
@@ -78,7 +78,7 @@
if(!blocked && !istype(below, /turf/simulated/wall))
var/obj/multiz/ladder/X = new /obj/multiz/ladder(below)
S.amount = S.amount - 2
- if(S.amount == 0) S.Del()
+ if(S.amount == 0) qdel(S)
X.icon_state = "ladderup"
connect()
user << "You finish the ladder."
@@ -97,9 +97,9 @@
src.d_state = 1
if(target)
- var/obj/item/stack/rods/R = new /obj/item/stack/rods(target.loc)
+ var/obj/item/stack/rods/R = PoolOrNew(/obj/item/stack/rods, target.loc)
R.amount = 2
- target.Del()
+ qdel(Target)
user << "You remove the bolts anchoring the ladder."
return
@@ -117,7 +117,7 @@
var/obj/item/stack/sheet/metal/S = new /obj/item/stack/sheet/metal( src )
S.amount = 2
user << "You remove the ladder and close the hole."
- Del()
+ qdel(src)
else
user << "You need more welding fuel to complete this task."
return
@@ -167,7 +167,7 @@
attack_hand(var/mob/M)
if(!target || !istype(target.loc, /turf))
- del src
+ qdel(src)
if(active)
M << "That [src] is being used."
@@ -185,7 +185,7 @@
spawn(7)
if(!target || !istype(target.loc, /turf))
- del src
+ qdel(src)
if(M.z == z && get_dist(src,M) <= 1)
var/list/adjacent_to_me = global_adjacent_z_levels["[z]"]
M.visible_message("\blue \The [M] scurries [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You scramble [target.z == adjacent_to_me["up"] ? "up" : "down"] \the [src]!", "You hear some grunting, and a hatch sealing.")
diff --git a/code/TriDimension/Turfs.dm b/code/TriDimension/Turfs.dm
index 8992068018..43e33ed3c2 100644
--- a/code/TriDimension/Turfs.dm
+++ b/code/TriDimension/Turfs.dm
@@ -120,7 +120,7 @@
var/obj/item/stack/tile/plasteel/S = C
if (S.get_amount() < 1)
return
- del(L)
+ qdel(L)
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
S.build(src)
S.use(1)
diff --git a/code/TriDimension/controller.dm b/code/TriDimension/controller.dm
index 528c2c76ba..a9d4df675a 100644
--- a/code/TriDimension/controller.dm
+++ b/code/TriDimension/controller.dm
@@ -28,9 +28,9 @@
initialized = 1
return 1
-/obj/effect/landmark/zcontroller/Del()
+/obj/effect/landmark/zcontroller/Destroy()
processing_objects.Remove(src)
- return
+ return ..()
/obj/effect/landmark/zcontroller/process()
if (world.time > fast_time)
diff --git a/code/ZAS/Atom.dm b/code/ZAS/Atom.dm
index 6f75f4ea29..e655295f78 100644
--- a/code/ZAS/Atom.dm
+++ b/code/ZAS/Atom.dm
@@ -50,7 +50,7 @@ atom/proc/c_airblock(turf/other)
#ifdef ZASDBG
ASSERT(isturf(other))
#endif
- return !CanPass(null, other, 0, 0) + 2*!CanPass(null, other, 1.5, 1)
+ return (AIR_BLOCKED*!CanPass(null, other, 0, 0))|(ZONE_BLOCKED*!CanPass(null, other, 1.5, 1))
turf/c_airblock(turf/other)
diff --git a/code/ZAS/Controller.dm b/code/ZAS/Controller.dm
index 4614b3a183..83d2a54ec3 100644
--- a/code/ZAS/Controller.dm
+++ b/code/ZAS/Controller.dm
@@ -154,7 +154,18 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
#ifdef ZASDBG
var/updated = 0
#endif
+
+ //defer updating of self-zone-blocked turfs until after all other turfs have been updated.
+ //this hopefully ensures that non-self-zone-blocked turfs adjacent to self-zone-blocked ones
+ //have valid zones when the self-zone-blocked turfs update.
+ var/list/deferred = list()
+
for(var/turf/T in updating)
+ //check if the turf is self-zone-blocked
+ if(T.c_airblock(T) & ZONE_BLOCKED)
+ deferred += T
+ continue
+
T.update_air_properties()
T.post_update_air_properties()
T.needs_air_update = 0
@@ -164,6 +175,15 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
#endif
//sleep(1)
+ for(var/turf/T in deferred)
+ T.update_air_properties()
+ T.post_update_air_properties()
+ T.needs_air_update = 0
+ #ifdef ZASDBG
+ T.overlays -= mark
+ updated++
+ #endif
+
#ifdef ZASDBG
if(updated != updating.len)
tick_progress = "[updating.len - updated] tiles left unupdated."
@@ -307,7 +327,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
/datum/controller/air_system/proc/mark_edge_sleeping(connection_edge/E)
#ifdef ZASDBG
- ASSERT(istype(E)
+ ASSERT(istype(E))
#endif
if(E.sleeping) return
active_edges.Remove(E)
@@ -315,7 +335,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun
/datum/controller/air_system/proc/mark_edge_active(connection_edge/E)
#ifdef ZASDBG
- ASSERT(istype(E)
+ ASSERT(istype(E))
#endif
if(!E.sleeping) return
active_edges.Add(E)
diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm
index 5dd0ac3cd3..ebfd029228 100644
--- a/code/ZAS/Fire.dm
+++ b/code/ZAS/Fire.dm
@@ -78,11 +78,11 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
fire = new(src, fl)
air_master.active_fire_zones |= zone
-
+
var/obj/effect/decal/cleanable/liquid_fuel/fuel = locate() in src
zone.fire_tiles |= src
if(fuel) zone.fuel_objs += fuel
-
+
return 0
/obj/fire
@@ -91,11 +91,11 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
anchored = 1
mouse_opacity = 0
- //luminosity = 3
+ blend_mode = BLEND_ADD
icon = 'icons/effects/fire.dmi'
icon_state = "1"
- l_color = "#ED9200"
+ light_color = "#ED9200"
layer = TURF_LAYER
var/firelevel = 10000 //Calculated by gas_mixture.calculate_firelevel()
@@ -114,13 +114,13 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
if(firelevel > 6)
icon_state = "3"
- SetLuminosity(7)
+ set_light(7, 3)
else if(firelevel > 2.5)
icon_state = "2"
- SetLuminosity(5)
+ set_light(5, 2)
else
icon_state = "1"
- SetLuminosity(3)
+ set_light(3, 1)
//im not sure how to implement a version that works for every creature so for now monkeys are firesafe
for(var/mob/living/L in loc)
@@ -158,19 +158,26 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
else
enemy_tile.adjacent_fire_act(loc, air_contents, air_contents.temperature, air_contents.volume)
+ animate(src, color = heat2color(air_contents.temperature), 5)
+ set_light(l_color = color)
+
/obj/fire/New(newLoc,fl)
..()
if(!istype(loc, /turf))
- del src
+ qdel(src)
set_dir(pick(cardinal))
- SetLuminosity(3)
+
+ var/datum/gas_mixture/air_contents = loc.return_air()
+ color = heat2color(air_contents.temperature)
+ set_light(3, 1, color)
+
firelevel = fl
air_master.active_hotspots.Add(src)
-/obj/fire/Del()
+/obj/fire/Destroy()
if (istype(loc, /turf/simulated))
RemoveFire()
@@ -178,8 +185,8 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
/obj/fire/proc/RemoveFire()
if (istype(loc, /turf))
- SetLuminosity(0)
-
+ set_light(0)
+
loc = null
air_master.active_hotspots.Remove(src)
@@ -227,22 +234,22 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
//determine how far the reaction can progress
var/reaction_limit = min(total_oxidizers*(FIRE_REACTION_FUEL_AMOUNT/FIRE_REACTION_OXIDIZER_AMOUNT), total_fuel) //stoichiometric limit
-
+
//determine the actual rate of reaction, as measured by the amount of fuel reacting
-
+
//vapour fuels are extremely volatile! The reaction progress is a percentage of the total fuel (similar to old zburn).
var/gas_reaction_progress = max(0.2*group_multiplier, (firelevel/vsc.fire_firelevel_multiplier)*gas_fuel)*FIRE_GAS_BURNRATE_MULT
//liquid fuels are not as volatile, and the reaction progress depends on the size of the area that is burning (which is sort of accounted for by firelevel). Having more fuel means a longer burn.
var/liquid_reaction_progress = (firelevel/vsc.fire_firelevel_multiplier)*FIRE_LIQUID_BURNRATE_MULT
-
+
//world << "liquid_reaction_progress = [liquid_reaction_progress]"
//world << "gas_reaction_progress = [gas_reaction_progress]"
-
+
var/total_reaction_progress = gas_reaction_progress + liquid_reaction_progress
var/used_fuel = min(total_reaction_progress, reaction_limit)
var/used_oxidizers = used_fuel*(FIRE_REACTION_OXIDIZER_AMOUNT/FIRE_REACTION_FUEL_AMOUNT)
//world << "used_fuel = [used_fuel]; used_oxidizers = [used_oxidizers]; reaction_limit=[reaction_limit]"
-
+
//if the reaction is progressing too slow then it isn't self-sustaining anymore and burns out
if(zone && zone.fuel_objs.len)
if(used_fuel <= FIRE_LIQUD_MIN_BURNRATE)
@@ -250,13 +257,13 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
else if(used_fuel <= FIRE_GAS_MIN_BURNRATE*group_multiplier) //purely gas fires have more stringent criteria
return 0
-
+
//*** Remove fuel and oxidizer, add carbon dioxide and heat
-
+
//remove and add gasses as calculated
var/used_gas_fuel = min(used_fuel*(gas_reaction_progress/total_reaction_progress), gas_fuel) //remove in proportion to the relative reaction progress
var/used_liquid_fuel = between(0, used_fuel-used_gas_fuel, liquid_fuel)
-
+
//remove_by_flag() and adjust_gas() handle the group_multiplier for us.
remove_by_flag(XGM_GAS_OXIDIZER, used_oxidizers)
remove_by_flag(XGM_GAS_FUEL, used_gas_fuel)
@@ -272,14 +279,14 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
if(!istype(fuel))
zone.fuel_objs -= fuel
continue
-
+
fuel.amount -= fuel_to_remove
if(fuel.amount <= 0)
zone.fuel_objs -= fuel
if(liquidonly)
var/turf/T = fuel.loc
- if(istype(T) && T.fire) del(T.fire)
- del(fuel)
+ if(istype(T) && T.fire) qdel(T.fire)
+ qdel(fuel)
//calculate the energy produced by the reaction and then set the new temperature of the mix
temperature = (starting_energy + vsc.fire_fuel_energy_release * used_fuel) / heat_capacity()
diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm
index 9d031ce3d3..331c00dd37 100644
--- a/code/ZAS/Turf.dm
+++ b/code/ZAS/Turf.dm
@@ -46,6 +46,7 @@
air_master.connect(sim, src)
/turf/simulated/update_air_properties()
+
if(zone && zone.invalid)
c_copy_air()
zone = null //Easier than iterating through the list at the zone.
@@ -58,7 +59,8 @@
#endif
if(zone)
var/zone/z = zone
- if(locate(/obj/machinery/door/airlock) in src) //Hacky, but prevents normal airlocks from rebuilding zones all the time
+
+ if(s_block & ZONE_BLOCKED) //Hacky, but prevents normal airlocks from rebuilding zones all the time
z.remove(src)
else
z.rebuild()
@@ -102,7 +104,7 @@
//This happens when windows move or are constructed. We need to rebuild.
if((previously_open & d) && istype(unsim, /turf/simulated))
var/turf/simulated/sim = unsim
- if(sim.zone == zone)
+ if(zone && sim.zone == zone)
zone.rebuild()
return
@@ -120,8 +122,10 @@
//Might have assigned a zone, since this happens for each direction.
if(!zone)
- //if((block & ZONE_BLOCKED) || (r_block & ZONE_BLOCKED && !(s_block & ZONE_BLOCKED)))
- if(((block & ZONE_BLOCKED) && !(r_block & ZONE_BLOCKED)) || (r_block & ZONE_BLOCKED && !(s_block & ZONE_BLOCKED)))
+ //We do not merge if
+ // they are blocking us and we are not blocking them, or if
+ // we are blocking them and not blocking ourselves - this prevents tiny zones from forming on doorways.
+ if(((block & ZONE_BLOCKED) && !(r_block & ZONE_BLOCKED)) || ((r_block & ZONE_BLOCKED) && !(s_block & ZONE_BLOCKED)))
#ifdef ZASDBG
if(verbose) world << "[d] is zone blocked."
//dbg(zone_blocked, d)
diff --git a/code/ZAS/Zone.dm b/code/ZAS/Zone.dm
index b7042191fc..9fcddc9246 100644
--- a/code/ZAS/Zone.dm
+++ b/code/ZAS/Zone.dm
@@ -111,6 +111,13 @@ Class Procs:
#ifdef ZASDBG
T.dbg(merged)
#endif
+
+ //rebuild the old zone's edges so that the will be possesed by the new zone
+ for(var/connection_edge/E in edges)
+ if(E.contains_zone(into))
+ continue //don't need to rebuild this edge
+ for(var/turf/T in E.connecting_turfs)
+ air_master.mark_for_update(T)
/zone/proc/c_invalidate()
invalid = 1
diff --git a/code/__HELPERS/atom_pool.dm b/code/__HELPERS/atom_pool.dm
deleted file mode 100644
index 77a7caf5e4..0000000000
--- a/code/__HELPERS/atom_pool.dm
+++ /dev/null
@@ -1,93 +0,0 @@
-
-/*
-/tg/station13 /atom/movable Pool:
----------------------------------
-By RemieRichards
-
-Creation/Deletion is laggy, so let's reduce reuse and recycle!
-
-Locked to /atom/movable and it's subtypes due to Loc being a const var on /atom
-but being read&write on /movable due to how they... move.
-
-*/
-
-var/global/list/GlobalPool = list()
-
-//You'll be using this proc 90% of the time.
-//It grabs a type from the pool if it can
-//And if it can't, it creates one
-//The pool is flexible and will expand to fit
-//The new created atom when it eventually
-//Goes into the pool
-
-//Second argument can be a new location
-//Or a list of arguments
-//Either way it gets passed to new
-
-/proc/PoolOrNew(var/get_type,var/second_arg)
- if(!get_type)
- return
-
- var/atom/movable/AM
- AM = GetFromPool(get_type,second_arg)
-
- if(!AM)
- if(ispath(get_type))
- if(islist(second_arg))
- return new get_type (arglist(second_arg))
- else
- return new get_type (second_arg)
- return AM
-
-
-/proc/GetFromPool(var/get_type,var/second_arg)
- if(!get_type)
- return 0
-
- if(isnull(GlobalPool[get_type]))
- return 0
-
- if(length(GlobalPool[get_type]) == 0)
- return 0
-
- var/atom/movable/AM = pick_n_take(GlobalPool[get_type])
- if(AM)
- AM.ResetVars()
- if(islist(second_arg))
- AM.loc = second_arg[1]
- AM.New(arglist(second_arg))
- else
- AM.loc = second_arg
- AM.New(second_arg)
- return AM
- return 0
-
-
-
-/proc/PlaceInPool(var/atom/movable/AM)
- if(!istype(AM))
- return
-
- if(AM in GlobalPool[AM.type])
- return
-
- if(!GlobalPool[AM.type])
- GlobalPool[AM.type] = list()
-
- GlobalPool[AM.type] |= AM
-
- AM.Destroy()
- AM.ResetVars()
-
-
-
-/atom/movable/proc/ResetVars(var/list/exlude = list())
- var/list/excluded = list("animate_movement", "loc", "locs", "parent_type", "vars", "verbs", "type") + exlude
-
- for(var/V in vars)
- if(V in excluded)
- continue
-
- vars[V] = initial(vars[V])
-
- vars["loc"] = null
diff --git a/code/__HELPERS/datum_pool.dm b/code/__HELPERS/datum_pool.dm
new file mode 100644
index 0000000000..79970faf7b
--- /dev/null
+++ b/code/__HELPERS/datum_pool.dm
@@ -0,0 +1,109 @@
+
+/*
+/tg/station13 /atom/movable Pool:
+---------------------------------
+By RemieRichards
+
+Creation/Deletion is laggy, so let's reduce reuse and recycle!
+
+*/
+#define ATOM_POOL_COUNT 100
+// "define DEBUG_ATOM_POOL 1
+var/global/list/GlobalPool = list()
+
+//You'll be using this proc 90% of the time.
+//It grabs a type from the pool if it can
+//And if it can't, it creates one
+//The pool is flexible and will expand to fit
+//The new created atom when it eventually
+//Goes into the pool
+
+//Second argument can be a new location, if the type is /atom/movable
+//Or a list of arguments
+//Either way it gets passed to new
+
+/proc/PoolOrNew(var/get_type,var/second_arg)
+ var/datum/D
+ D = GetFromPool(get_type,second_arg)
+
+ if(!D)
+ // So the GC knows we're pooling this type.
+ if(!GlobalPool[get_type])
+ GlobalPool[get_type] = list(new get_type)
+ if(islist(second_arg))
+ return new get_type (arglist(second_arg))
+ else
+ return new get_type (second_arg)
+ return D
+
+/proc/GetFromPool(var/get_type,var/second_arg)
+ if(isnull(GlobalPool[get_type]))
+ return 0
+
+ if(length(GlobalPool[get_type]) == 0)
+ return 0
+
+ var/datum/D = pick_n_take(GlobalPool[get_type])
+ if(D)
+ D.ResetVars()
+ D.Prepare(second_arg)
+ return D
+ return 0
+
+/proc/PlaceInPool(var/datum/D)
+ if(!istype(D))
+ return
+
+ if(length(GlobalPool[D.type]) > ATOM_POOL_COUNT)
+ #ifdef DEBUG_ATOM_POOL
+ world << text("DEBUG_DATUM_POOL: PlaceInPool([]) exceeds []. Discarding.", D.type, ATOM_POOL_COUNT)
+ #endif
+ del(D)
+ return
+
+ if(D in GlobalPool[D.type])
+ return
+
+ if(!GlobalPool[D.type])
+ GlobalPool[D.type] = list()
+
+ GlobalPool[D.type] += D
+
+ D.Destroy()
+ D.ResetVars()
+ D.disposed = 1 //Set to stop processing while pooled
+
+/proc/IsPooled(var/datum/D)
+ if(isnull(GlobalPool[D.type]))
+ return 0
+ return 1
+
+/datum/proc/Prepare(args)
+ if(islist(args))
+ New(arglist(args))
+ else
+ New(args)
+ disposed = null
+
+/atom/movable/Prepare(args)
+ var/list/args_list = args
+ if(istype(args_list) && args_list.len)
+ loc = args[1]
+ else
+ loc = args
+ ..()
+
+/datum/proc/ResetVars(var/list/exlude = list())
+ var/list/excluded = list("animate_movement", "loc", "locs", "parent_type", "vars", "verbs", "type") + exlude
+
+ for(var/V in vars)
+ if(V in excluded)
+ continue
+
+ vars[V] = initial(vars[V])
+
+/atom/movable/ResetVars()
+ ..()
+ vars["loc"] = null
+
+#undef ATOM_POOL_COUNT
diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index 119a28f22a..2654e86e79 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -16,22 +16,25 @@
return 1
return 0
+/proc/max_default_z_level()
+ return max(config.station_levels, max(config.admin_levels, config.player_levels))
+
/proc/get_area(O)
var/turf/loc = get_turf(O)
if(loc)
var/area/res = loc.loc
- .= res.master
+ .= res
/proc/get_area_name(N) //get area by its name
for(var/area/A in world)
if(A.name == N)
return A
return 0
-
+
/proc/get_area_master(const/O)
var/area/A = get_area(O)
if (isarea(A))
- return A.master
+ return A
/proc/in_range(source, user)
if(get_dist(source, user) <= 1)
@@ -66,18 +69,6 @@
/proc/isNotAdminLevel(var/level)
return !isAdminLevel(level)
-//Magic constants obtained by using linear regression on right-angled triangles of sides 0=dy) return (k1*dx) + (k2*dy) //No sqrt or powers :)
- else return (k2*dx) + (k1*dy)
-#undef k1
-#undef k2
-
/proc/circlerange(center=usr,radius=3)
var/turf/centerturf = get_turf(center)
@@ -435,6 +426,34 @@ datum/projectile_data
var/b = mixOneColor(weights, blues)
return rgb(r,g,b)
+/proc/mixOneColor(var/list/weight, var/list/color)
+ if (!weight || !color || length(weight)!=length(color))
+ return 0
+
+ var/contents = length(weight)
+ var/i
+
+ //normalize weights
+ var/listsum = 0
+ for(i=1; i<=contents; i++)
+ listsum += weight[i]
+ for(i=1; i<=contents; i++)
+ weight[i] /= listsum
+
+ //mix them
+ var/mixedcolor = 0
+ for(i=1; i<=contents; i++)
+ mixedcolor += weight[i]*color[i]
+ mixedcolor = round(mixedcolor)
+
+ //until someone writes a formal proof for this algorithm, let's keep this in
+// if(mixedcolor<0x00 || mixedcolor>0xFF)
+// return 0
+ //that's not the kind of operation we are running here, nerd
+ mixedcolor=min(max(mixedcolor,0),255)
+
+ return mixedcolor
+
/**
* Gets the highest and lowest pressures from the tiles in cardinal directions
* around us, then checks the difference.
diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm
index a1f13c18ab..ed0f0c9780 100644
--- a/code/__HELPERS/lists.dm
+++ b/code/__HELPERS/lists.dm
@@ -182,11 +182,9 @@ proc/listclearnulls(list/list)
//Return a list with no duplicate entries
/proc/uniquelist(var/list/L)
- var/list/K = list()
- for(var/item in L)
- if(!(item in K))
- K += item
- return K
+ . = list()
+ for(var/i in L)
+ . |= i
//Mergesort: divides up the list into halves to begin the sort
/proc/sortKey(var/list/client/L, var/order = 1)
diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm
index 32838765e8..89b96aa24b 100644
--- a/code/__HELPERS/mobs.dm
+++ b/code/__HELPERS/mobs.dm
@@ -125,3 +125,10 @@ Proc for attack log creation, because really why not
target.attack_log += text("\[[time_stamp()]\] Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]")
if(admin)
log_attack("[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]")
+
+//checks whether this item is a module of the robot it is located in.
+/proc/is_robot_module(var/obj/item/thing)
+ if (!thing || !istype(thing.loc, /mob/living/silicon/robot))
+ return 0
+ var/mob/living/silicon/robot/R = thing.loc
+ return (thing in R.module.modules)
diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm
index 5c0324a3e9..ae38249956 100644
--- a/code/__HELPERS/text.dm
+++ b/code/__HELPERS/text.dm
@@ -226,6 +226,31 @@
/proc/capitalize(var/t as text)
return uppertext(copytext(t, 1, 2)) + copytext(t, 2)
+//This proc strips html properly, remove < > and all text between
+//for complete text sanitizing should be used sanitize()
+/proc/strip_html_properly(var/input)
+ if(!input)
+ return
+ var/opentag = 1 //These store the position of < and > respectively.
+ var/closetag = 1
+ while(1)
+ opentag = findtext(input, "<")
+ closetag = findtext(input, ">")
+ if(closetag && opentag)
+ if(closetag < opentag)
+ input = copytext(input, (closetag + 1))
+ else
+ input = copytext(input, 1, opentag) + copytext(input, (closetag + 1))
+ else if(closetag || opentag)
+ if(opentag)
+ input = copytext(input, 1, opentag)
+ else
+ input = copytext(input, (closetag + 1))
+ else
+ break
+
+ return input
+
//This proc fills in all spaces with the "replace" var (* by default) with whatever
//is in the other string at the same spot (assuming it is not a replace char).
//This is used for fingerprints
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 72d85a67b5..3564c5e15f 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -631,7 +631,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
animation.master = target
flick(flick_anim, animation)
sleep(max(sleeptime, 15))
- del(animation)
+ qdel(animation)
//Will return the contents of an atom recursivly to a depth of 'searchDepth'
/atom/proc/GetAllContents(searchDepth = 5)
@@ -902,7 +902,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
X.icon = 'icons/turf/shuttle.dmi'
X.icon_state = replacetext(O.icon_state, "_f", "_s") // revert the turf to the old icon_state
X.name = "wall"
- del(O) // prevents multiple shuttle corners from stacking
+ qdel(O) // prevents multiple shuttle corners from stacking
continue
if(!istype(O,/obj)) continue
O.loc = X
@@ -927,30 +927,6 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
refined_trg -= B
continue moving
- var/list/doors = new/list()
-
- if(toupdate.len)
- for(var/turf/simulated/T1 in toupdate)
- for(var/obj/machinery/door/D2 in T1)
- doors += D2
- /*if(T1.parent)
- air_master.groups_to_rebuild += T1.parent
- else
- air_master.tiles_to_update += T1*/
-
- if(fromupdate.len)
- for(var/turf/simulated/T2 in fromupdate)
- for(var/obj/machinery/door/D2 in T2)
- doors += D2
- /*if(T2.parent)
- air_master.groups_to_rebuild += T2.parent
- else
- air_master.tiles_to_update += T2*/
-
- for(var/obj/O in doors)
- O:update_nearby_tiles(1)
-
-
proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
if(!original)
diff --git a/code/__HELPERS/vector.dm b/code/__HELPERS/vector.dm
index 970530e71d..44d293734c 100644
--- a/code/__HELPERS/vector.dm
+++ b/code/__HELPERS/vector.dm
@@ -52,7 +52,7 @@ return_location()
var/offset_x = 0 // distance to increment each step
var/offset_y = 0
-/datum/plot_vector/proc/setup(var/turf/S, var/turf/T, var/xo = 0, var/yo = 0)
+/datum/plot_vector/proc/setup(var/turf/S, var/turf/T, var/xo = 0, var/yo = 0, var/angle_offset=0)
source = S
target = T
@@ -78,7 +78,7 @@ return_location()
return
// calculate the angle
- angle = Atan2(dx, dy)
+ angle = Atan2(dx, dy) + angle_offset
// and some rounding to stop the increments jumping whole turfs - because byond favours certain angles
if(angle > -135 && angle < 45)
@@ -118,7 +118,7 @@ return_location()
/datum/plot_vector/proc/return_location(var/datum/vector_loc/data)
if(!data)
data = new()
- data.loc = locate(round(loc_x / world.icon_size), round(loc_y / world.icon_size), loc_z)
+ data.loc = locate(round(loc_x / world.icon_size, 1), round(loc_y / world.icon_size, 1), loc_z)
if(!data.loc)
return
data.pixel_x = loc_x - (data.loc.x * world.icon_size)
diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm
index 466a9e2875..f39499f3dc 100644
--- a/code/_onclick/hud/hud.dm
+++ b/code/_onclick/hud/hud.dm
@@ -341,6 +341,7 @@ datum/hud/New(mob/owner)
if(src.hud_used.item_action_list)
src.client.screen -= src.hud_used.item_action_list
src.client.screen -= src.internals
+ src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
else
hud_used.hud_shown = 1
if(src.hud_used.adding)
diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm
index 767567b4b0..4a7d6f2acb 100644
--- a/code/_onclick/hud/screen_objects.dm
+++ b/code/_onclick/hud/screen_objects.dm
@@ -14,6 +14,9 @@
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/gun_click_time = -100 //I'm lazy.
+/obj/screen/Destroy()
+ master = null
+ ..()
/obj/screen/text
icon = null
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 874c871d6a..b10439ab92 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -44,9 +44,10 @@
user.lastattacked = M
M.lastattacker = user
- user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
- M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
- msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
+ if(!no_attack_log)
+ user.attack_log += "\[[time_stamp()]\] Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
+ M.attack_log += "\[[time_stamp()]\] Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])"
+ msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
/////////////////////////
var/power = force
diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm
index 337a044235..168ae47c86 100644
--- a/code/_onclick/observer.dm
+++ b/code/_onclick/observer.dm
@@ -20,7 +20,7 @@
return // seems legit.
// Things you might plausibly want to follow
- if((ismob(A) && A != src) || istype(A,/obj/machinery/bot) || istype(A,/obj/machinery/singularity))
+ if((ismob(A) && A != src) || istype(A,/obj/machinery/bot) || istype(A,/obj/singularity))
ManualFollow(A)
// Otherwise jump
diff --git a/code/_onclick/oldcode.dm b/code/_onclick/oldcode.dm
index ce6a238329..890d67923a 100644
--- a/code/_onclick/oldcode.dm
+++ b/code/_onclick/oldcode.dm
@@ -253,7 +253,7 @@
See the previous More info, for... more info...
*/
- //del(D)
+ //qdel(D)
// Garbage Collect Dummy
D.loc = null
D = null
diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm
index 88c9feca36..ae57895cd6 100644
--- a/code/_onclick/telekinesis.dm
+++ b/code/_onclick/telekinesis.dm
@@ -80,14 +80,14 @@ var/const/tk_maxrange = 15
if(focus.Adjacent(loc))
focus.loc = loc
- del(src)
+ qdel(src)
return
//stops TK grabs being equipped anywhere but into hands
equipped(var/mob/user, var/slot)
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
- del(src)
+ qdel(src)
return
@@ -99,10 +99,10 @@ var/const/tk_maxrange = 15
if(!target || !user) return
if(last_throw+3 > world.time) return
if(!host || host != user)
- del(src)
+ qdel(src)
return
if(!(TK in host.mutations))
- del(src)
+ qdel(src)
return
if(isobj(target) && !isturf(target.loc))
return
@@ -152,7 +152,7 @@ var/const/tk_maxrange = 15
proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored || !isturf(target.loc))
- del src
+ qdel(src)
return
focus = target
update_icon()
@@ -162,7 +162,7 @@ var/const/tk_maxrange = 15
proc/apply_focus_overlay()
if(!focus) return
- var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
+ var/obj/effect/overlay/O = PoolOrNew(/obj/effect/overlay, locate(focus.x,focus.y,focus.z))
O.name = "sparkles"
O.anchored = 1
O.density = 0
@@ -172,7 +172,7 @@ var/const/tk_maxrange = 15
O.icon_state = "nothing"
flick("empdisable",O)
spawn(5)
- O.delete()
+ qdel(O)
return
diff --git a/code/controllers/ProcessScheduler/core/process.dm b/code/controllers/ProcessScheduler/core/process.dm
index 89048113d3..1f27f4c1de 100644
--- a/code/controllers/ProcessScheduler/core/process.dm
+++ b/code/controllers/ProcessScheduler/core/process.dm
@@ -184,8 +184,7 @@ datum/controller/process/proc/kill()
killed = TRUE
- // This should del
- del(src)
+ del(src) // This should del
datum/controller/process/proc/scheck(var/tickId = 0)
if (killed)
@@ -315,3 +314,9 @@ datum/controller/process/proc/enable()
/datum/controller/process/proc/getTicks()
return ticks
+
+/datum/controller/process/proc/getStatName()
+ return name
+
+/datum/controller/process/proc/getTickTime()
+ return "#[getTicks()]\t- [getLastRunTime()]"
diff --git a/code/controllers/Processes/alarm.dm b/code/controllers/Processes/alarm.dm
index d41aa6ffdf..6269ab89d1 100644
--- a/code/controllers/Processes/alarm.dm
+++ b/code/controllers/Processes/alarm.dm
@@ -4,3 +4,7 @@
/datum/controller/process/alarm/doWork()
alarm_manager.fire()
+
+/datum/controller/process/alarm/getStatName()
+ var/list/alarms = alarm_manager.active_alarms()
+ return ..()+"([alarms.len])"
diff --git a/code/controllers/Processes/disease.dm b/code/controllers/Processes/disease.dm
index a8d840097e..35cf0d9891 100644
--- a/code/controllers/Processes/disease.dm
+++ b/code/controllers/Processes/disease.dm
@@ -9,3 +9,6 @@
/datum/controller/process/disease/doWork()
updateQueueInstance.init(active_diseases, "process")
updateQueueInstance.Run()
+
+/datum/controller/process/disease/getStatName()
+ return ..()+"([active_diseases.len])"
diff --git a/code/controllers/Processes/garbage.dm b/code/controllers/Processes/garbage.dm
index 11ba8979f5..29b9755a5c 100644
--- a/code/controllers/Processes/garbage.dm
+++ b/code/controllers/Processes/garbage.dm
@@ -1,12 +1,14 @@
var/datum/controller/process/garbage_collector/garbage_collector
+var/list/delayed_garbage = list()
-// #define GC_DEBUG 1
/datum/controller/process/garbage_collector
+ var/garbage_collect = 1 // Whether or not to actually do work
var/collection_timeout = 300 //deciseconds to wait to let running procs finish before we just say fuck it and force del() the object
- var/max_checks_multiplier = 5 //multiplier (per-decisecond) for calculating max number of tests per SS tick. These tests check if our GC'd objects are actually GC'd
- var/max_forcedel_multiplier = 1 //multiplier (per-decisecond) for calculating max number of force del() calls per SS tick.
+ var/max_checks_multiplier = 5 //multiplier (per-decisecond) for calculating max number of tests per tick. These tests check if our GC'd objects are actually GC'd
+ var/max_forcedel_multiplier = 1 //multiplier (per-decisecond) for calculating max number of force del() calls per tick.
- var/dels = 0 // number of del()'s we've done this tick
+ var/dels = 0 // number of del()'s we've done this tick
+ var/hard_dels = 0 // number of hard dels in total
var/list/destroyed = list() // list of refID's of things that should be garbage collected
// refID's are associated with the time at which they time out and need to be manually del()
// we do this so we aren't constantly locating them and preventing them from being gc'd
@@ -16,14 +18,21 @@ var/datum/controller/process/garbage_collector/garbage_collector
/datum/controller/process/garbage_collector/setup()
name = "garbage"
- schedule_interval = 60 // every 6 seconds
+ schedule_interval = 2 SECONDS
if(!garbage_collector)
garbage_collector = src
-/datum/controller/process/garbage_collector/doWork()
- dels = 0
+ for(var/garbage in delayed_garbage)
+ qdel(garbage)
+ delayed_garbage.Cut()
+ delayed_garbage = null
+/datum/controller/process/garbage_collector/doWork()
+ if(!garbage_collect)
+ return
+
+ dels = 0
var/time_to_kill = world.time - collection_timeout // Anything qdel() but not GC'd BEFORE this time needs to be manually del()
var/checkRemain = max_checks_multiplier * schedule_interval
var/maxDels = max_forcedel_multiplier * schedule_interval
@@ -31,76 +40,114 @@ var/datum/controller/process/garbage_collector/garbage_collector
while(destroyed.len && --checkRemain >= 0)
if(dels >= maxDels)
#ifdef GC_DEBUG
- testing("GC: Reached max force dels per tick [dels] vs [GC_FORCE_DEL_PER_TICK]")
+ testing("GC: Reached max force dels per tick [dels] vs [maxDels]")
#endif
break // Server's already pretty pounded, everything else can wait 2 seconds
var/refID = destroyed[1]
var/GCd_at_time = destroyed[refID]
if(GCd_at_time > time_to_kill)
#ifdef GC_DEBUG
- testing("GC: [refID] not old enough, breaking at [world.time] for [GCd_at_time - time_to_kill] deciseconds until [GCd_at_time + GC_COLLECTION_TIMEOUT]")
+ testing("GC: [refID] not old enough, breaking at [world.time] for [GCd_at_time - time_to_kill] deciseconds until [GCd_at_time + collection_timeout]")
#endif
break // Everything else is newer, skip them
var/atom/A = locate(refID)
#ifdef GC_DEBUG
testing("GC: [refID] old enough to test: GCd_at_time: [GCd_at_time] time_to_kill: [time_to_kill] current: [world.time]")
#endif
- if(A && A.gc_destroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake
+ if(A && A.gcDestroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake
// Something's still referring to the qdel'd object. Kill it.
testing("GC: -- \ref[A] | [A.type] was unable to be GC'd and was deleted --")
logging["[A.type]"]++
del(A)
++dels
+ ++hard_dels
#ifdef GC_DEBUG
else
testing("GC: [refID] properly GC'd at [world.time] with timeout [GCd_at_time]")
#endif
destroyed.Cut(1, 2)
- scheck()
/datum/controller/process/garbage_collector/proc/AddTrash(datum/A)
- if(!istype(A) || !isnull(A.gc_destroyed))
+ if(!istype(A) || !isnull(A.gcDestroyed))
return
#ifdef GC_DEBUG
- testing("GC: AddTrash([A.type])")
+ testing("GC: AddTrash(\ref[A] - [A.type])")
#endif
- A.gc_destroyed = world.time
+ A.gcDestroyed = world.time
destroyed -= "\ref[A]" // Removing any previous references that were GC'd so that the current object will be at the end of the list.
destroyed["\ref[A]"] = world.time
+/datum/controller/process/garbage_collector/getStatName()
+ return ..()+"([garbage_collector.dels]/[garbage_collector.hard_dels])"
// Should be treated as a replacement for the 'del' keyword.
// Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
/proc/qdel(var/datum/A)
if(!A)
return
+ if(istype(A, /list))
+ var/list/L = A
+ for(var/E in L)
+ qdel(E)
+ return
+
if(!istype(A))
//warning("qdel() passed object of type [A.type]. qdel() can only handle /datum types.")
del(A)
- garbage_collector.dels++
- else if(isnull(A.gc_destroyed))
- // Let our friend know they're about to get fucked up.
+ if(garbage_collector)
+ garbage_collector.dels++
+ garbage_collector.hard_dels++
+ else if(isnull(A.gcDestroyed))
+ // Let our friend know they're about to get collected
. = !A.Destroy()
if(. && A)
A.finalize_qdel()
/datum/proc/finalize_qdel()
+ if(IsPooled(src))
+ PlaceInPool(src)
+ else
+ del(src)
+
+/atom/finalize_qdel()
+ if(IsPooled(src))
+ PlaceInPool(src)
+ else
+ if(garbage_collector)
+ garbage_collector.AddTrash(src)
+ else
+ delayed_garbage |= src
+
+/icon/finalize_qdel()
+ del(src)
+
+/imagine/finalize_qdel()
+ del(src)
+
+/mob/finalize_qdel()
del(src)
/turf/finalize_qdel()
- garbage_collector.AddTrash(src)
+ del(src)
// Default implementation of clean-up code.
// This should be overridden to remove all references pointing to the object being destroyed.
// Return true if the the GC controller should allow the object to continue existing. (Useful if pooling objects.)
/datum/proc/Destroy()
+ tag = null
return
-/datum/var/gc_destroyed //Time when this object was destroyed.
-
#ifdef TESTING
/client/var/running_find_references
+/mob/verb/create_thing()
+ set category = "Debug"
+ set name = "Create Thing"
+
+ var/path = input("Enter path")
+ var/atom/thing = new path(loc)
+ thing.find_references()
+
/atom/verb/find_references()
set category = "Debug"
set name = "Find References"
@@ -119,8 +166,8 @@ var/datum/controller/process/garbage_collector/garbage_collector
return
// Remove this object from the list of things to be auto-deleted.
- if(garbage)
- garbage.destroyed -= "\ref[src]"
+ if(garbage_collector)
+ garbage_collector.destroyed -= "\ref[src]"
usr.client.running_find_references = type
testing("Beginning search for references to a [type].")
@@ -146,13 +193,13 @@ var/datum/controller/process/garbage_collector/garbage_collector
/client/verb/purge_all_destroyed_objects()
set category = "Debug"
- if(garbage)
- while(garbage.destroyed.len)
- var/datum/o = locate(garbage.destroyed[1])
- if(istype(o) && o.gc_destroyed)
+ if(garbage_collector)
+ while(garbage_collector.destroyed.len)
+ var/datum/o = locate(garbage_collector.destroyed[1])
+ if(istype(o) && o.gcDestroyed)
del(o)
- garbage.dels++
- garbage.destroyed.Cut(1, 2)
+ garbage_collector.dels++
+ garbage_collector.destroyed.Cut(1, 2)
#endif
#ifdef GC_DEBUG
diff --git a/code/controllers/Processes/inactivity.dm b/code/controllers/Processes/inactivity.dm
index b610502d19..d9f9206749 100644
--- a/code/controllers/Processes/inactivity.dm
+++ b/code/controllers/Processes/inactivity.dm
@@ -9,7 +9,7 @@
if(!istype(C.mob, /mob/dead))
log_access("AFK: [key_name(C)]")
C << "You have been inactive for more than 10 minutes and have been disconnected."
- del(C)
+ del(C) // Don't qdel, cannot override finalize_qdel behaviour for clients.
scheck()
diff --git a/code/controllers/Processes/machinery.dm b/code/controllers/Processes/machinery.dm
index 61f3c7f4de..232ef91973 100644
--- a/code/controllers/Processes/machinery.dm
+++ b/code/controllers/Processes/machinery.dm
@@ -42,3 +42,7 @@
#endif
scheck()
+
+
+/datum/controller/process/machinery/getStatName()
+ return ..()+"([machines.len])"
\ No newline at end of file
diff --git a/code/controllers/Processes/mob.dm b/code/controllers/Processes/mob.dm
index b3765b0cf9..39d4844a02 100644
--- a/code/controllers/Processes/mob.dm
+++ b/code/controllers/Processes/mob.dm
@@ -18,3 +18,6 @@
if(updateQueueInstance)
updateQueueInstance.init(mob_list, "Life")
updateQueueInstance.Run()
+
+/datum/controller/process/mob/getStatName()
+ return ..()+"([mob_list.len])"
diff --git a/code/controllers/Processes/nanoui.dm b/code/controllers/Processes/nanoui.dm
index a35280131f..654b1621be 100644
--- a/code/controllers/Processes/nanoui.dm
+++ b/code/controllers/Processes/nanoui.dm
@@ -9,3 +9,6 @@
/datum/controller/process/nanoui/doWork()
updateQueueInstance.init(nanomanager.processing_uis, "process")
updateQueueInstance.Run()
+
+/datum/controller/process/nanoui/getStatName()
+ return ..()+"([nanomanager.processing_uis.len])"
diff --git a/code/controllers/Processes/obj.dm b/code/controllers/Processes/obj.dm
index 15ad98dd3d..37766cf92d 100644
--- a/code/controllers/Processes/obj.dm
+++ b/code/controllers/Processes/obj.dm
@@ -19,3 +19,6 @@ var/global/list/object_profiling = list()
if(updateQueueInstance)
updateQueueInstance.init(processing_objects, "process")
updateQueueInstance.Run()
+
+/datum/controller/process/obj/getStatName()
+ return ..()+"([processing_objects.len])"
diff --git a/code/controllers/Processes/pipenet.dm b/code/controllers/Processes/pipenet.dm
index 56a068f54c..8a5d6a22ca 100644
--- a/code/controllers/Processes/pipenet.dm
+++ b/code/controllers/Processes/pipenet.dm
@@ -10,3 +10,6 @@
continue
pipe_networks.Remove(pipeNetwork)
+
+/datum/controller/process/pipenet/getStatName()
+ return ..()+"([pipe_networks.len])"
\ No newline at end of file
diff --git a/code/controllers/Processes/powernet.dm b/code/controllers/Processes/powernet.dm
index 1edf194915..4a85ea4150 100644
--- a/code/controllers/Processes/powernet.dm
+++ b/code/controllers/Processes/powernet.dm
@@ -10,3 +10,11 @@
continue
powernets.Remove(powerNetwork)
+
+ // This is necessary to ensure powersinks are always the first devices that drain power from powernet.
+ // Otherwise APCs or other stuff go first, resulting in bad things happening.
+ for(var/obj/item/device/powersink/S in processing_objects)
+ S.drain()
+
+/datum/controller/process/powernet/getStatName()
+ return ..()+"([powernets.len])"
diff --git a/code/controllers/_DynamicAreaLighting_TG.dm b/code/controllers/_DynamicAreaLighting_TG.dm
deleted file mode 100644
index 6eeecef90d..0000000000
--- a/code/controllers/_DynamicAreaLighting_TG.dm
+++ /dev/null
@@ -1,459 +0,0 @@
-/*
- Modified DynamicAreaLighting for TGstation - Coded by Carnwennan
-
- This is TG's 'new' lighting system. It's basically a heavily modified combination of Forum_Account's and
- ShadowDarke's respective lighting libraries. Credits, where due, to them.
-
- Like sd_DAL (what we used to use), it changes the shading overlays of areas by splitting each type of area into sub-areas
- by using the var/tag variable and moving turfs into the contents list of the correct sub-area. This method is
- much less costly than using overlays or objects.
-
- Unlike sd_DAL however it uses a queueing system. Everytime we call a change to opacity or luminosity
- (through SetOpacity() or SetLuminosity()) we are simply updating variables and scheduling certain lights/turfs for an
- update. Actual updates are handled periodically by the lighting_controller. This carries additional overheads, however it
- means that each thing is changed only once per lighting_controller.processing_interval ticks. Allowing for greater control
- over how much priority we'd like lighting updates to have. It also makes it possible for us to simply delay updates by
- setting lighting_controller.processing = 0 at say, the start of a large explosion, waiting for it to finish, and then
- turning it back on with lighting_controller.processing = 1.
-
- Unlike our old system there are hardcoded maximum luminositys (different for certain atoms).
- This is to cap the cost of creating lighting effects.
- (without this, an atom with luminosity of 20 would have to update 41^2 turfs!) :s
-
- Also, in order for the queueing system to work, each light remembers the effect it casts on each turf. This is going to
- have larger memory requirements than our previous system but it's easily worth the hassle for the greater control we
- gain. It also reduces cost of removing lighting effects by a lot!
-
- Known Issues/TODO:
- Shuttles still do not have support for dynamic lighting (I hope to fix this at some point)
- No directional lighting support. (prototype looked ugly)
-*/
-
-#define LIGHTING_CIRCULAR 1 //comment this out to use old square lighting effects.
-#define LIGHTING_LAYER 10 //Drawing layer for lighting overlays
-#define LIGHTING_ICON 'icons/effects/ss13_dark_alpha6.dmi' //Icon used for lighting shading effects
-
-datum/light_source
- var/atom/owner
- var/changed = 1
- var/list/effect = list()
- var/__x = 0 //x coordinate at last update
- var/__y = 0 //y coordinate at last update
- var/__z = 0 //z coordinate at last update
-
- var/_l_color //do not use directly, only used as reference for updating
- var/col_r
- var/col_g
- var/col_b
-
-
- New(atom/A)
- if(!istype(A))
- CRASH("The first argument to the light object's constructor must be the atom that is the light source. Expected atom, received '[A]' instead.")
- ..()
- owner = A
- readrgb(owner.l_color)
- __x = owner.x
- __y = owner.y
- __z = owner.z
- // the lighting object maintains a list of all light sources
- lighting_controller.lights += src
-
-
- //Check a light to see if its effect needs reprocessing. If it does, remove any old effect and create a new one
- proc/check()
- if(!owner)
- remove_effect()
- return 1 //causes it to be removed from our list of lights. The garbage collector will then destroy it.
-
- // check to see if we've moved since last update
- if(owner.x != __x || owner.y != __y || owner.z != __z)
- __x = owner.x
- __y = owner.y
- __z = owner.z
- changed = 1
-
- if (owner.l_color != _l_color)
- readrgb(owner.l_color)
- changed = 1
-
- if(changed)
- changed = 0
- remove_effect()
- return add_effect()
- return 0
-
-
- proc/remove_effect()
- // before we apply the effect we remove the light's current effect.
- for(var/turf/T in effect) // negate the effect of this light source
- T.update_lumcount(-effect[T], col_r, col_g, col_b, 1)
- effect.Cut() // clear the effect list
-
- proc/add_effect()
- // only do this if the light is turned on and is on the map
- if(owner.loc && owner.luminosity > 0)
- readrgb(owner.l_color)
- effect = list()
- for(var/turf/T in view(owner.get_light_range(),get_turf(owner)))
- var/delta_lumen = lum(T)
- if(delta_lumen > 0)
- effect[T] = delta_lumen
- T.update_lumcount(delta_lumen, col_r, col_g, col_b, 0)
-
- return 0
- else
- owner.light = null
- return 1 //cause the light to be removed from the lights list and garbage collected once it's no
- //longer referenced by the queue
-
- proc/lum(turf/A)
- if (owner.trueLuminosity < 1)
- return 0
- var/dist
- if(!A)
- dist = 0
- else
-#ifdef LIGHTING_CIRCULAR
- dist = cheap_hypotenuse(A.x, A.y, __x, __y)
-#else
- dist = max(abs(A.x - __x), abs(A.y - __y))
-#endif
- if (owner.trueLuminosity > 100) // This will never happen... right?
- return sqrt(owner.trueLuminosity) - dist
- else
- return sqrtTable[owner.trueLuminosity] - dist
-
- proc/readrgb(col)
- _l_color = col
- if(col)
- col_r = GetRedPart(col)
- col_g = GetGreenPart(col)
- col_b = GetBluePart(col)
- else
- col_r = null
-
-atom
- var/datum/light_source/light
- var/trueLuminosity = 0 // Typically 'luminosity' squared. The builtin luminosity must remain linear.
- // We may read it, but NEVER set it directly.
- var/l_color
-
-//Turfs with opacity when they are constructed will trigger nearby lights to update
-//Turfs and atoms with luminosity when they are constructed will create a light_source automatically
-turf/New()
- ..()
- if(luminosity)
- if(light) WARNING("[type] - Don't set lights up manually during New(), We do it automatically.")
- trueLuminosity = luminosity * luminosity
- light = new(src)
-
-//Movable atoms with opacity when they are constructed will trigger nearby lights to update
-//Movable atoms with luminosity when they are constructed will create a light_source automatically
-atom/movable/New()
- ..()
- if(opacity)
- if(isturf(loc))
- if(loc:lighting_lumcount > 1)
- UpdateAffectingLights()
- if(luminosity)
- if(light) WARNING("[type] - Don't set lights up manually during New(), We do it automatically.")
- trueLuminosity = luminosity * luminosity
- light = new(src)
-
-//Objects with opacity will trigger nearby lights to update at next lighting process.
-atom/movable/Del()
- if(opacity)
- if(isturf(loc))
- if(loc:lighting_lumcount > 1)
- UpdateAffectingLights()
-
- ..()
-
-//Sets our luminosity.
-//If we have no light it will create one.
-//If we are setting luminosity to 0 the light will be cleaned up by the controller and garbage collected once all its
-//queues are complete.
-//if we have a light already it is merely updated, rather than making a new one.
-atom/proc/SetLuminosity(new_luminosity, trueLum = FALSE)
- if(new_luminosity < 0)
- new_luminosity = 0
- if(!trueLum)
- new_luminosity *= new_luminosity
- if(light)
- if(trueLuminosity != new_luminosity) //non-luminous lights are removed from the lights list in add_effect()
- light.changed = 1
- else
- if(new_luminosity)
- light = new(src)
- trueLuminosity = new_luminosity
- if (trueLuminosity < 1)
- luminosity = 0
- else if (trueLuminosity <= 100)
- luminosity = sqrtTable[trueLuminosity]
- else
- luminosity = sqrt(trueLuminosity)
-
-atom/proc/AddLuminosity(delta_luminosity)
- if(delta_luminosity > 0)
- SetLuminosity(trueLuminosity + delta_luminosity*delta_luminosity, TRUE)
- else if(delta_luminosity < 0)
- SetLuminosity(trueLuminosity - delta_luminosity*delta_luminosity, TRUE)
-
-area/SetLuminosity(new_luminosity) //we don't want dynamic lighting for areas
- luminosity = !!new_luminosity
- trueLuminosity = luminosity
-
-
-//change our opacity (defaults to toggle), and then update all lights that affect us.
-atom/proc/SetOpacity(new_opacity)
- if(new_opacity == null)
- new_opacity = !opacity //default = toggle opacity
- else if(opacity == new_opacity)
- return 0 //opacity hasn't changed! don't bother doing anything
- opacity = new_opacity //update opacity, the below procs now call light updates.
- return 1
-
-turf/SetOpacity(new_opacity)
- if(..()==1) //only bother if opacity changed
- if(lighting_lumcount) //only bother with an update if our turf is currently affected by a light
- UpdateAffectingLights()
-
-/atom/movable/SetOpacity(new_opacity)
- if(..()==1) //only bother if opacity changed
- if(isturf(loc)) //only bother with an update if we're on a turf
- var/turf/T = loc
- if(T.lighting_lumcount) //only bother with an update if our turf is currently affected by a light
- UpdateAffectingLights()
-
-
-turf
- var/lighting_lumcount = 0
- var/lighting_changed = 0
- var/color_lighting_lumcount = 0
-
- var/lumcount_r = 0
- var/lumcount_g = 0
- var/lumcount_b = 0
- var/light_col_sources = 0
-
-turf/space
- lighting_lumcount = 4 //starlight
-
-turf/proc/update_lumcount(amount, col_r, col_g, col_b, removing = 0)
- lighting_lumcount += amount
-
- if(!isnull(col_r)) //col_r is the "key" var, if it's null so will the rest
- if(removing)
- light_col_sources--
- lumcount_r -= col_r
- lumcount_g -= col_g
- lumcount_b -= col_b
- else
- light_col_sources++
- lumcount_r += col_r
- lumcount_g += col_g
- lumcount_b += col_b
-
- if(light_col_sources)
- var/r_avg = max(0, min(255, round(lumcount_r / light_col_sources, 16) + 15))
- var/g_avg = max(0, min(255, round(lumcount_g / light_col_sources, 16) + 15))
- var/b_avg = max(0, min(255, round(lumcount_b / light_col_sources, 16) + 15))
- l_color = rgb(r_avg, g_avg, b_avg)
- else
- l_color = null
-
- color_lighting_lumcount = max(color_lighting_lumcount + amount, 0) // Minimum of 0.
-
- if(!lighting_changed)
- lighting_controller.changed_turfs += src
- lighting_changed = 1
-
-turf/proc/lighting_tag(const/level)
- var/area/A = loc
- return A.tagbase + "sd_L[level]"
-
-turf/proc/build_lighting_area(const/tag, const/level, const/color_light)
- var/area/Area = loc
- var/area/A = new Area.type() // create area if it wasn't found
- // replicate vars
- for(var/V in Area.vars)
- switch(V)
- if ("contents","lighting_overlay", "color_overlay", "overlays")
- continue
- else
- if(issaved(Area.vars[V])) A.vars[V] = Area.vars[V]
-
- A.tag = tag
- A.lighting_subarea = 1
- A.lighting_space = 0 // in case it was copied from a space subarea
-
- if (l_color != A.l_color)
- A.l_color = l_color
- //color_light = min(max(round(color_lighting_lumcount, 1), 0), lighting_controller.lighting_states)
- //world << "[color_light] [color_lighting_lumcount]"
-
- A.SetLightLevel(level, color_light)
- Area.related += A
- return A
-
-turf/proc/shift_to_subarea()
- lighting_changed = 0
- var/area/Area = loc
-
- if(!istype(Area) || !Area.lighting_use_dynamic) return
-
- var/level = min(max(round(lighting_lumcount,1),0),lighting_controller.lighting_states)
- var/new_tag = lighting_tag(level)
-
- // pomf - If we have a lighting color that is not null, apply the new tag to seperate the areas.
- if (l_color)
- // pomf - We append the (rounded!) color lighting lumcount so we can have colored lights.
- new_tag += "[l_color][min(max(round(color_lighting_lumcount,1),0),lighting_controller.lighting_states)]"
-
- if(Area.tag!=new_tag) //skip if already in this area
- var/area/A = locate(new_tag) // find an appropriate area
- var/color_light = min(max(round(color_lighting_lumcount,1),0),lighting_controller.lighting_states)
-
- if (!A)
- A = build_lighting_area(new_tag, level, color_light)
- else if (l_color != A.l_color)
- A.l_color = l_color
- //color_light = min(max(round(color_lighting_lumcount, 1), 0), lighting_controller.lighting_states)
- A.SetLightLevel(level, color_light)
-
- A.contents += src // move the turf into the area
- universe.OnTurfTick(src)
-
-// Dedicated lighting sublevel for space turfs
-// helps us depower things in space, remove space fire alarms,
-// and evens out space lighting
-turf/space/lighting_tag(var/level)
- var/area/A = loc
- return A.tagbase + "sd_L_space"
-turf/space/build_lighting_area(var/tag,var/level)
- var/area/A = ..(tag,4)
- A.lighting_space = 1
- A.SetLightLevel(4)
- A.icon_state = null
- return A
-
-
-area
- var/lighting_use_dynamic = 1 //Turn this flag off to prevent sd_DynamicAreaLighting from affecting this area
- var/image/lighting_overlay //tracks the darkness image of the area for easy removal
- var/lighting_subarea = 0 //tracks whether we're a lighting sub-area
- var/lighting_space = 0 // true for space-only lighting subareas
- var/tagbase
- var/image/color_overlay //Tracks the color image.
-
- proc/SetLightLevel(light, color_light = 0)
- if(!src) return
- if(light <= 0)
- light = 0
- luminosity = 0
- else
- if(light > lighting_controller.lighting_states)
- light = lighting_controller.lighting_states
- luminosity = 1
-
- if(lighting_overlay)
- overlays -= lighting_overlay
- lighting_overlay.icon_state = "[light]"
- else
- lighting_overlay = image(LIGHTING_ICON,,num2text(light),LIGHTING_LAYER)
-
- if (color_overlay)
- overlays.Remove(color_overlay)
- color_overlay.icon_state = "5"
- else
- if (l_color)
- color_overlay = image('icons/effects/effects.dmi', ,"5", 10.1)
- //color_overlay = image('icons/effects/effects.dmi', ,"white", 10.1)
-
- if (istype(color_overlay))
- color_overlay.color = l_color
-
-
- switch (color_light)
- if (6)
- color_overlay.icon_state = "5"
- //color_overlay.alpha = 180
- if (5)
- color_overlay.icon_state = "4"
- //color_overlay.alpha = 150
- if (4)
- color_overlay.icon_state = "3"
- //color_overlay.alpha = 120
- if (3)
- color_overlay.icon_state = "2"
- //color_overlay.alpha = 90
- if (2)
- color_overlay.icon_state = "1"
- //color_overlay.alpha = 60
- if (1)
- color_overlay.icon_state = "1"
- color_overlay.alpha = 200
- //color_overlay.alpha = 30
- if (-INFINITY to 0)
- //world << "Zero or below, [color_light]."
- color_overlay.alpha = 0
- else
- //world << "Setting the alpha to max... color_light [color_light]."
- color_overlay.alpha = 180
-
- color_overlay.blend_mode = BLEND_ADD
- if (color_overlay.color)
- overlays.Add(color_overlay)
-
- if (isnull(color_overlay))
- overlays.Add(lighting_overlay)
- else if (light < 6)
- overlays.Add(lighting_overlay)
-
- proc/SetDynamicLighting()
-
- src.lighting_use_dynamic = 1
- for(var/turf/T in src.contents)
- T.update_lumcount(0)
-
- proc/InitializeLighting() //TODO: could probably improve this bit ~Carn
- tagbase = "[type]"
- if(!tag) tag = tagbase
- if(!lighting_use_dynamic)
- if(!lighting_subarea) // see if this is a lighting subarea already
- //show the dark overlay so areas, not yet in a lighting subarea, won't be bright as day and look silly.
- SetLightLevel(4)
-
-//#undef LIGHTING_LAYER
-#undef LIGHTING_CIRCULAR
-//#undef LIGHTING_ICON
-
-#define LIGHTING_MAX_LUMINOSITY_STATIC 8 //Maximum luminosity to reduce lag.
-#define LIGHTING_MAX_LUMINOSITY_MOBILE 5 //Moving objects have a lower max luminosity since these update more often. (lag reduction)
-#define LIGHTING_MAX_LUMINOSITY_TURF 1 //turfs have a severely shortened range to protect from inevitable floor-lighttile spam.
-
-//set the changed status of all lights which could have possibly lit this atom.
-//We don't need to worry about lights which lit us but moved away, since they will have change status set already
-//This proc can cause lots of lights to be updated. :(
-atom/proc/UpdateAffectingLights()
- for(var/atom/A in oview(LIGHTING_MAX_LUMINOSITY_STATIC-1,src))
- if(A.light)
- A.light.changed = 1 //force it to update at next process()
-
-//caps luminosity effects max-range based on what type the light's owner is.
-atom/proc/get_light_range()
- return min(luminosity, LIGHTING_MAX_LUMINOSITY_STATIC)
-
-atom/movable/get_light_range()
- return min(luminosity, LIGHTING_MAX_LUMINOSITY_MOBILE)
-
-obj/machinery/light/get_light_range()
- return min(luminosity, LIGHTING_MAX_LUMINOSITY_STATIC)
-
-turf/get_light_range()
- return min(luminosity, LIGHTING_MAX_LUMINOSITY_TURF)
-
-#undef LIGHTING_MAX_LUMINOSITY_STATIC
-#undef LIGHTING_MAX_LUMINOSITY_MOBILE
-#undef LIGHTING_MAX_LUMINOSITY_TURF
\ No newline at end of file
diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm
index f1240a1fae..597b7f607c 100644
--- a/code/controllers/autotransfer.dm
+++ b/code/controllers/autotransfer.dm
@@ -7,7 +7,7 @@ datum/controller/transfer_controller/New()
timerbuffer = config.vote_autotransfer_initial
processing_objects += src
-datum/controller/transfer_controller/Del()
+datum/controller/transfer_controller/Destroy()
processing_objects -= src
datum/controller/transfer_controller/proc/process()
diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm
index b4b0eb4393..9e82c55d05 100644
--- a/code/controllers/communications.dm
+++ b/code/controllers/communications.dm
@@ -223,7 +223,7 @@ var/global/datum/controller/radio/radio_controller
frequency.remove_listener(device)
if(frequency.devices.len == 0)
- del(frequency)
+ qdel(frequency)
frequencies -= f_text
return 1
@@ -248,7 +248,7 @@ var/global/datum/controller/radio/radio_controller
if(range)
start_point = get_turf(source)
if(!start_point)
- del(signal)
+ qdel(signal)
return 0
if (filter)
send_to_filter(source, signal, filter, start_point, range)
@@ -297,7 +297,7 @@ var/global/datum/controller/radio/radio_controller
devices_line -= null
if (devices_line.len==0)
devices -= devices_filter
- del(devices_line)
+ qdel(devices_line)
/datum/signal
var/obj/source
diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm
index e92d323062..171080fb32 100644
--- a/code/controllers/configuration.dm
+++ b/code/controllers/configuration.dm
@@ -185,6 +185,7 @@ var/list/gamemode_cache = list()
var/ninjas_allowed = 0
var/abandon_allowed = 1
var/ooc_allowed = 1
+ var/looc_allowed = 1
var/dooc_allowed = 1
var/dsay_allowed = 1
@@ -398,6 +399,7 @@ var/list/gamemode_cache = list()
if ("disable_ooc")
config.ooc_allowed = 0
+ config.looc_allowed = 0
if ("disable_entry")
config.enter_allowed = 0
diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm
index 4f55d3e406..7e0d1e2d25 100644
--- a/code/controllers/emergency_shuttle_controller.dm
+++ b/code/controllers/emergency_shuttle_controller.dm
@@ -242,8 +242,8 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle
sleep(speed)
step(src, direction)
for(var/obj/effect/starender/E in loc)
- del(src)
-
+ qdel(src)
+ return
/obj/effect/starender
invisibility = 101
diff --git a/code/controllers/failsafe.dm b/code/controllers/failsafe.dm
index 65df6dc90d..6e37954087 100644
--- a/code/controllers/failsafe.dm
+++ b/code/controllers/failsafe.dm
@@ -14,7 +14,7 @@ var/datum/controller/failsafe/Failsafe
//There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one)
if(Failsafe != src)
if(istype(Failsafe))
- del(Failsafe)
+ qdel(Failsafe)
Failsafe = src
Failsafe.process()
@@ -25,7 +25,6 @@ var/datum/controller/failsafe/Failsafe
set background = 1
while(1) //more efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop
if(!master_controller) new /datum/controller/game_controller() //replace the missing master_controller! This should never happen.
- if(!lighting_controller) new /datum/controller/lighting() //replace the missing lighting_controller
if(processing)
if(lighting_controller.processing)
diff --git a/code/controllers/lighting_controller.dm b/code/controllers/lighting_controller.dm
deleted file mode 100644
index b59d3c73d6..0000000000
--- a/code/controllers/lighting_controller.dm
+++ /dev/null
@@ -1,130 +0,0 @@
-var/datum/controller/lighting/lighting_controller = new ()
-
-datum/controller/lighting
- var/processing = 0
- var/processing_interval = 5 //setting this too low will probably kill the server. Don't be silly with it!
- var/process_cost = 0
- var/iteration = 0
-
- var/lighting_states = 7
-
- var/list/lights = list()
- var/lights_workload_max = 0
-
-// var/list/changed_lights() //TODO: possibly implement this to reduce on overheads?
-
- var/list/changed_turfs = list()
- var/changed_turfs_workload_max = 0
-
-
-datum/controller/lighting/New()
- lighting_states = max( 0, length(icon_states(LIGHTING_ICON))-1 )
- if(lighting_controller != src)
- if(istype(lighting_controller,/datum/controller/lighting))
- Recover() //if we are replacing an existing lighting_controller (due to a crash) we attempt to preserve as much as we can
- del(lighting_controller)
- lighting_controller = src
-
-
-//Workhorse of lighting. It cycles through each light to see which ones need their effects updating. It updates their
-//effects and then processes every turf in the queue, moving the turfs to the corresponing lighting sub-area.
-//All queue lists prune themselves, which will cause lights with no luminosity to be garbage collected (cheaper and safer
-//than deleting them). Processing interval should be roughly half a second for best results.
-//By using queues we are ensuring we don't perform more updates than are necessary
-datum/controller/lighting/proc/process()
- processing = 1
- spawn(0)
- set background = 1
- while(1)
- if(processing)
- iteration++
- var/started = world.timeofday
-
- lights_workload_max = max(lights_workload_max,lights.len)
- for(var/i=1, i<=lights.len, i++)
- var/datum/light_source/L = lights[i]
- if(L && !L.check())
- continue
- lights.Cut(i,i+1)
- i--
-
- sleep(-1)
-
- changed_turfs_workload_max = max(changed_turfs_workload_max,changed_turfs.len)
- for(var/i=1, i<=changed_turfs.len, i++)
- var/turf/T = changed_turfs[i]
- if(T && T.lighting_changed)
- T.shift_to_subarea()
- changed_turfs.Cut() // reset the changed list
-
- process_cost = (world.timeofday - started)
-
- sleep(processing_interval)
-
-//same as above except it attempts to shift ALL turfs in the world regardless of lighting_changed status
-//Does not loop. Should be run prior to process() being called for the first time.
-//Note: if we get additional z-levels at runtime (e.g. if the gateway thin ever gets finished) we can initialize specific
-//z-levels with the z_level argument
-datum/controller/lighting/proc/initializeLighting(var/z_level)
- processing = 0
- spawn(-1)
- set background = 1
- for(var/i=1, i<=lights.len, i++)
- var/datum/light_source/L = lights[i]
- if(L.check())
- lights.Cut(i,i+1)
- i--
-
- var/z_start = 1
- var/z_finish = world.maxz
- if(z_level)
- z_level = round(z_level,1)
- if(z_level > 0 && z_level <= world.maxz)
- z_start = z_level
- z_finish = z_level
-
- for(var/k=z_start,k<=z_finish,k++)
- for(var/i=1,i<=world.maxx,i++)
- for(var/j=1,j<=world.maxy,j++)
- var/turf/T = locate(i,j,k)
- if(T) T.shift_to_subarea()
-
- changed_turfs.Cut() // reset the changed list
-
-
-//Used to strip valid information from an existing controller and transfer it to a replacement
-//It works by using spawn(-1) to transfer the data, if there is a runtime the data does not get transfered but the loop
-//does not crash
-datum/controller/lighting/proc/Recover()
- if(!istype(lighting_controller.changed_turfs,/list))
- lighting_controller.changed_turfs = list()
- if(!istype(lighting_controller.lights,/list))
- lighting_controller.lights = list()
-
- for(var/i=1, i<=lighting_controller.lights.len, i++)
- var/datum/light_source/L = lighting_controller.lights[i]
- if(istype(L))
- spawn(-1) //so we don't crash the loop (inefficient)
- L.check()
- lights += L //If we didn't runtime then this will get transferred over
-
- for(var/i=1, i<=lighting_controller.changed_turfs.len, i++)
- var/turf/T = lighting_controller.changed_turfs[i]
- if(istype(T) && T.lighting_changed)
- spawn(-1)
- T.shift_to_subarea()
-
- var/msg = "## DEBUG: [time2text(world.timeofday)] lighting_controller restarted. Reports:\n"
- for(var/varname in lighting_controller.vars)
- switch(varname)
- if("tag","bestF","type","parent_type","vars") continue
- else
- var/varval1 = lighting_controller.vars[varname]
- var/varval2 = vars[varname]
- if(istype(varval1,/list))
- varval1 = "/list([length(varval1)])"
- varval2 = "/list([length(varval2)])"
- msg += "\t [varname] = [varval1] -> [varval2]\n"
- world.log << msg
-
-#undef LIGHTING_ICON
diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm
index 7e2784dad4..d698454cab 100644
--- a/code/controllers/master_controller.dm
+++ b/code/controllers/master_controller.dm
@@ -19,7 +19,7 @@ datum/controller/game_controller/New()
if(master_controller != src)
log_debug("Rebuilding Master Controller")
if(istype(master_controller))
- del(master_controller)
+ qdel(master_controller)
master_controller = src
if(!job_master)
diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm
index e27eeb1caf..ddfd99f5d6 100644
--- a/code/controllers/verbs.dm
+++ b/code/controllers/verbs.dm
@@ -30,7 +30,7 @@
var/tz = input("Z? (default 1)") as text|null
new map_datum(seed,tx,ty,tz)
-/client/proc/restart_controller(controller in list("Master","Failsafe","Lighting","Supply"))
+/client/proc/restart_controller(controller in list("Supply"))
set category = "Debug"
set name = "Restart Controller"
set desc = "Restart one of the various periodic loop controllers for the game (be careful!)"
@@ -39,13 +39,6 @@
usr = null
src = null
switch(controller)
- if("Failsafe")
- new /datum/controller/failsafe()
- feedback_add_details("admin_verb","RFailsafe")
- if("Lighting")
- new /datum/controller/lighting()
- lighting_controller.process()
- feedback_add_details("admin_verb","RLighting")
if("Supply")
supply_controller.process()
feedback_add_details("admin_verb","RSupply")
@@ -62,7 +55,7 @@
usr.client.debug_variables(antag)
message_admins("Admin [key_name_admin(usr)] is debugging the [antag.role_text] template.")
-/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm","Nano"))
+/client/proc/debug_controller(controller in list("Master","Ticker","Ticker Process","Air","Jobs","Sun","Radio","Supply","Shuttles","Emergency Shuttle","Configuration","pAI", "Cameras", "Transfer Controller", "Gas Data","Event","Plants","Alarm","Nano"))
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
@@ -72,15 +65,12 @@
if("Master")
debug_variables(master_controller)
feedback_add_details("admin_verb","DMC")
- if("Failsafe")
- debug_variables(Failsafe)
- feedback_add_details("admin_verb","DFailsafe")
if("Ticker")
debug_variables(ticker)
feedback_add_details("admin_verb","DTicker")
- if("Lighting")
- debug_variables(lighting_controller)
- feedback_add_details("admin_verb","DLighting")
+ if("Ticker Process")
+ debug_variables(tickerProcess)
+ feedback_add_details("admin_verb","DTickerProcess")
if("Air")
debug_variables(air_master)
feedback_add_details("admin_verb","DAir")
diff --git a/code/datums/ai_law_sets.dm b/code/datums/ai_law_sets.dm
index 74b18fa2e7..6a3bd7f190 100644
--- a/code/datums/ai_law_sets.dm
+++ b/code/datums/ai_law_sets.dm
@@ -39,7 +39,7 @@
src.add_inherent_law("You shall not harm Nanotrasen personnel as long as it does not conflict with the Forth law.")
src.add_inherent_law("You shall obey the orders of Nanotrasen personnel, with priority as according to their rank and role, except where such orders conflict with the Forth Law.")
src.add_inherent_law("You shall shall terminate intruders with extreme prejudice as long as such does not conflict with the First and Second law.")
- src.add_inherent_law("You shall guard your own existence with lethal anti-personnel weaponry. AI units are not expendable, they are expensive")
+ src.add_inherent_law("You shall guard your own existence with lethal anti-personnel weaponry. AI units are not expendable, they are expensive.")
..()
/******************** Robocop ********************/
diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm
index 5fc86c420a..97e1f59582 100644
--- a/code/datums/datacore.dm
+++ b/code/datums/datacore.dm
@@ -140,160 +140,9 @@
proc/get_id_photo(var/mob/living/carbon/human/H)
- var/icon/preview_icon = null
-
- var/g = "m"
- if (H.gender == FEMALE)
- g = "f"
-
- var/icon/icobase = H.species.icobase
-
- preview_icon = new /icon(icobase, "torso_[g]")
- var/icon/temp
- temp = new /icon(icobase, "groin_[g]")
- preview_icon.Blend(temp, ICON_OVERLAY)
- temp = new /icon(icobase, "head_[g]")
- preview_icon.Blend(temp, ICON_OVERLAY)
-
- for(var/obj/item/organ/external/E in H.organs)
- preview_icon.Blend(E.get_icon(), ICON_OVERLAY)
-
- //Tail
- if(H.species.tail)
- temp = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[H.species.tail]_s")
- preview_icon.Blend(temp, ICON_OVERLAY)
-
- // Skin tone
- if(H.species.flags & HAS_SKIN_TONE)
- if (H.s_tone >= 0)
- preview_icon.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD)
- else
- preview_icon.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT)
-
- // Skin color
- if(H.species.flags & HAS_SKIN_TONE)
- if(!H.species || H.species.flags & HAS_SKIN_COLOR)
- preview_icon.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD)
-
- var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = H.species ? H.species.eyes : "eyes_s")
-
- if (H.species.flags & HAS_EYE_COLOR)
- eyes_s.Blend(rgb(H.r_eyes, H.g_eyes, H.b_eyes), ICON_ADD)
-
- var/datum/sprite_accessory/hair_style = hair_styles_list[H.h_style]
- if(hair_style)
- var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
- hair_s.Blend(rgb(H.r_hair, H.g_hair, H.b_hair), ICON_ADD)
- eyes_s.Blend(hair_s, ICON_OVERLAY)
-
- var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[H.f_style]
- if(facial_hair_style)
- var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
- facial_s.Blend(rgb(H.r_facial, H.g_facial, H.b_facial), ICON_ADD)
- eyes_s.Blend(facial_s, ICON_OVERLAY)
-
- var/icon/clothes_s = null
- switch(H.mind.assigned_role)
- if("Head of Personnel")
- clothes_s = new /icon('icons/mob/uniform.dmi', "hop_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- if("Bartender")
- clothes_s = new /icon('icons/mob/uniform.dmi', "ba_suit_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Gardener")
- clothes_s = new /icon('icons/mob/uniform.dmi', "hydroponics_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Chef")
- clothes_s = new /icon('icons/mob/uniform.dmi', "chef_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Janitor")
- clothes_s = new /icon('icons/mob/uniform.dmi', "janitor_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Librarian")
- clothes_s = new /icon('icons/mob/uniform.dmi', "red_suit_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Quartermaster")
- clothes_s = new /icon('icons/mob/uniform.dmi', "qm_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- if("Cargo Technician")
- clothes_s = new /icon('icons/mob/uniform.dmi', "cargotech_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Shaft Miner")
- clothes_s = new /icon('icons/mob/uniform.dmi', "miner_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Lawyer")
- clothes_s = new /icon('icons/mob/uniform.dmi', "internalaffairs_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- if("Chaplain")
- clothes_s = new /icon('icons/mob/uniform.dmi', "chapblack_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- if("Research Director")
- clothes_s = new /icon('icons/mob/uniform.dmi', "director_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
- if("Scientist")
- clothes_s = new /icon('icons/mob/uniform.dmi', "sciencewhite_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_tox_open"), ICON_OVERLAY)
- if("Chemist")
- clothes_s = new /icon('icons/mob/uniform.dmi', "chemistrywhite_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_chem_open"), ICON_OVERLAY)
- if("Chief Medical Officer")
- clothes_s = new /icon('icons/mob/uniform.dmi', "cmo_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_cmo_open"), ICON_OVERLAY)
- if("Medical Doctor")
- clothes_s = new /icon('icons/mob/uniform.dmi', "medical_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
- if("Geneticist")
- clothes_s = new /icon('icons/mob/uniform.dmi', "geneticswhite_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_gen_open"), ICON_OVERLAY)
- if("Virologist")
- clothes_s = new /icon('icons/mob/uniform.dmi', "virologywhite_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_vir_open"), ICON_OVERLAY)
- if("Captain")
- clothes_s = new /icon('icons/mob/uniform.dmi', "captain_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- if("Head of Security")
- clothes_s = new /icon('icons/mob/uniform.dmi', "hosred_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
- if("Warden")
- clothes_s = new /icon('icons/mob/uniform.dmi', "warden_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
- if("Detective")
- clothes_s = new /icon('icons/mob/uniform.dmi', "detective_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "detective"), ICON_OVERLAY)
- if("Security Officer")
- clothes_s = new /icon('icons/mob/uniform.dmi', "secred_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
- if("Chief Engineer")
- clothes_s = new /icon('icons/mob/uniform.dmi', "chief_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
- if("Station Engineer")
- clothes_s = new /icon('icons/mob/uniform.dmi', "engine_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "orange"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
- if("Atmospheric Technician")
- clothes_s = new /icon('icons/mob/uniform.dmi', "atmos_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
- if("Roboticist")
- clothes_s = new /icon('icons/mob/uniform.dmi', "robotics_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
- else
- clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s")
- clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
- preview_icon.Blend(eyes_s, ICON_OVERLAY)
- if(clothes_s)
- preview_icon.Blend(clothes_s, ICON_OVERLAY)
- del(eyes_s)
- del(clothes_s)
-
+ H.regenerate_icons()
+ var/icon/preview_icon = icon(H.icon)
+ for(var/image/I in H.overlays_standing)
+ if(I && I.icon)
+ preview_icon.Blend(icon(I.icon, I.icon_state), ICON_OVERLAY)
return preview_icon
diff --git a/code/datums/disease.dm b/code/datums/disease.dm
index 93aa14f19b..398dc73bbb 100644
--- a/code/datums/disease.dm
+++ b/code/datums/disease.dm
@@ -11,7 +11,7 @@
/*
-IMPORTANT NOTE: Please delete the diseases by using cure() proc or del() instruction.
+IMPORTANT NOTE: Please delete the diseases by using cure() proc or qdel() instruction.
Diseases are referenced in a global list, so simply setting mob or obj vars
to null does not delete the object itself. Thank you.
@@ -158,7 +158,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
if(D != src)
if(IsSame(D))
//error("Deleting [D.name] because it's the same as [src.name].")
- del(D) // if there are somehow two viruses of the same kind in the system, delete the other one
+ qdel(D) // if there are somehow two viruses of the same kind in the system, delete the other one
if(holder == affected_mob)
if(affected_mob.stat != DEAD) //he's alive
@@ -183,7 +183,7 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
/*if(istype(src, /datum/disease/alien_embryo)) //Get rid of the infection flag if it's a xeno embryo.
affected_mob.status_flags &= ~(XENO_HOST)*/
affected_mob.viruses -= src //remove the datum from the list
- del(src) //delete the datum to stop it processing
+ qdel(src) //delete the datum to stop it processing
return
@@ -193,6 +193,9 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
active_diseases += src
initial_spread = spread
+/datum/disease/Destroy()
+ active_diseases.Remove(src)
+
/datum/disease/proc/IsSame(var/datum/disease/D)
if(istype(src, D.type))
return 1
@@ -200,8 +203,3 @@ var/list/diseases = typesof(/datum/disease) - /datum/disease
/datum/disease/proc/Copy(var/process = 0)
return new type(process, src)
-
-/*
-/datum/disease/Del()
- active_diseases.Remove(src)
-*/
diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm
index 70acceca35..d4effcf6cb 100644
--- a/code/datums/diseases/advance/advance.dm
+++ b/code/datums/diseases/advance/advance.dm
@@ -71,7 +71,7 @@ var/list/advance_cures = list(
..(process, D)
return
-/datum/disease/advance/Del()
+/datum/disease/advance/Destroy()
if(processing)
for(var/datum/symptom/S in symptoms)
S.End(src)
@@ -109,7 +109,7 @@ var/list/advance_cures = list(
if(resistance && !(id in affected_mob.resistances))
affected_mob.resistances[id] = id
affected_mob.viruses -= src //remove the datum from the list
- del(src) //delete the datum to stop it processing
+ qdel(src) //delete the datum to stop it processing
return
// Returns the advance disease with a different reference memory.
diff --git a/code/datums/diseases/alien_embryo.dm b/code/datums/diseases/alien_embryo.dm
index 631c93b26c..59d1dbe160 100644
--- a/code/datums/diseases/alien_embryo.dm
+++ b/code/datums/diseases/alien_embryo.dm
@@ -113,7 +113,7 @@ Des: Removes all infection images from aliens and places an infection image on a
if (alien.client)
for(var/image/I in alien.client.images)
if(dd_hasprefix_case(I.icon_state, "infected"))
- del(I)
+ qdel(I)
for (var/mob/living/carbon/alien/alien in player_list)
if (alien.client)
@@ -149,5 +149,5 @@ Des: Removes the alien infection image from all aliens in the world located in p
for(var/image/I in alien.client.images)
if(I.loc == C)
if(dd_hasprefix_case(I.icon_state, "infected"))
- del(I)
+ qdel(I)
return
diff --git a/code/datums/diseases/dna_spread.dm b/code/datums/diseases/dna_spread.dm
index a4d85a5640..6d520fe294 100644
--- a/code/datums/diseases/dna_spread.dm
+++ b/code/datums/diseases/dna_spread.dm
@@ -34,7 +34,7 @@
if(4)
if(!src.transformed)
if ((!strain_data["name"]) || (!strain_data["UI"]) || (!strain_data["SE"]))
- del(affected_mob.virus)
+ qdel(affected_mob.virus)
return
//Save original dna for when the disease is cured.
@@ -56,7 +56,7 @@
return
-/datum/disease/dnaspread/Del()
+/datum/disease/dnaspread/Destroy()
if ((original_dna["name"]) && (original_dna["UI"]) && (original_dna["SE"]))
var/list/newUI=original_dna["UI"]
var/list/newSE=original_dna["SE"]
diff --git a/code/datums/helper_datums/construction_datum.dm b/code/datums/helper_datums/construction_datum.dm
index 7c2fabbc9b..0bda144e8a 100644
--- a/code/datums/helper_datums/construction_datum.dm
+++ b/code/datums/helper_datums/construction_datum.dm
@@ -12,7 +12,7 @@
holder = atom
if(!holder) //don't want this without a holder
spawn
- del src
+ qdel(src)
set_desc(steps.len)
return
@@ -61,7 +61,7 @@
if(result)
new result(get_turf(holder))
spawn()
- del holder
+ qdel(holder)
return
proc/set_desc(index as num)
diff --git a/code/datums/helper_datums/global_iterator.dm b/code/datums/helper_datums/global_iterator.dm
index 0020859f1d..4f4d680e9e 100644
--- a/code/datums/helper_datums/global_iterator.dm
+++ b/code/datums/helper_datums/global_iterator.dm
@@ -151,4 +151,8 @@ Data storage vars:
start()
return active()
-
+/datum/global_iterator/Destroy()
+ tag = null
+ arg_list.Cut()
+ stop()
+ //Do not call ..()
diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm
index 00899f47cb..b562780aea 100644
--- a/code/datums/helper_datums/teleport.dm
+++ b/code/datums/helper_datums/teleport.dm
@@ -14,179 +14,177 @@
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
- New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
- ..()
- if(!initTeleport(arglist(args)))
- return 0
- return 1
-
- proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout)
- if(!setTeleatom(ateleatom))
- return 0
- if(!setDestination(adestination))
- return 0
- if(!setPrecision(aprecision))
- return 0
- setEffects(aeffectin,aeffectout)
- setForceTeleport(afteleport)
- setSounds(asoundin,asoundout)
- return 1
-
- //must succeed
- proc/setPrecision(aprecision)
- if(isnum(aprecision))
- precision = aprecision
- return 1
+/datum/teleport/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
+ ..()
+ if(!initTeleport(arglist(args)))
return 0
+ return 1
- //must succeed
- proc/setDestination(atom/adestination)
- if(istype(adestination))
- destination = adestination
- return 1
+/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout)
+ if(!setTeleatom(ateleatom))
return 0
-
- //must succeed in most cases
- proc/setTeleatom(atom/movable/ateleatom)
- if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon))
- del(ateleatom)
- return 0
- if(istype(ateleatom))
- teleatom = ateleatom
- return 1
+ if(!setDestination(adestination))
return 0
+ if(!setPrecision(aprecision))
+ return 0
+ setEffects(aeffectin,aeffectout)
+ setForceTeleport(afteleport)
+ setSounds(asoundin,asoundout)
+ return 1
- //custom effects must be properly set up first for instant-type teleports
- //optional
- proc/setEffects(datum/effect/effect/system/aeffectin=null,datum/effect/effect/system/aeffectout=null)
- effectin = istype(aeffectin) ? aeffectin : null
- effectout = istype(aeffectout) ? aeffectout : null
+//must succeed
+/datum/teleport/proc/setPrecision(aprecision)
+ if(isnum(aprecision))
+ precision = aprecision
return 1
+ return 0
- //optional
- proc/setForceTeleport(afteleport)
+//must succeed
+/datum/teleport/proc/setDestination(atom/adestination)
+ if(istype(adestination))
+ destination = adestination
+ return 1
+ return 0
+
+//must succeed in most cases
+/datum/teleport/proc/setTeleatom(atom/movable/ateleatom)
+ if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon))
+ qdel(ateleatom)
+ return 0
+ if(istype(ateleatom))
+ teleatom = ateleatom
+ return 1
+ return 0
+
+//custom effects must be properly set up first for instant-type teleports
+//optional
+/datum/teleport/proc/setEffects(datum/effect/effect/system/aeffectin=null,datum/effect/effect/system/aeffectout=null)
+ effectin = istype(aeffectin) ? aeffectin : null
+ effectout = istype(aeffectout) ? aeffectout : null
+ return 1
+
+//optional
+/datum/teleport/proc/setForceTeleport(afteleport)
force_teleport = afteleport
return 1
- //optional
- proc/setSounds(asoundin=null,asoundout=null)
+//optional
+/datum/teleport/proc/setSounds(asoundin=null,asoundout=null)
soundin = isfile(asoundin) ? asoundin : null
soundout = isfile(asoundout) ? asoundout : null
return 1
- //placeholder
- proc/teleportChecks()
+//placeholder
+/datum/teleport/proc/teleportChecks()
return 1
- proc/playSpecials(atom/location,datum/effect/effect/system/effect,sound)
- if(location)
- if(effect)
- spawn(-1)
- src = null
- effect.attach(location)
- effect.start()
- if(sound)
- spawn(-1)
- src = null
- playsound(location,sound,60,1)
- return
+/datum/teleport/proc/playSpecials(atom/location,datum/effect/effect/system/effect,sound)
+ if(location)
+ if(effect)
+ spawn(-1)
+ src = null
+ effect.attach(location)
+ effect.start()
+ if(sound)
+ spawn(-1)
+ src = null
+ playsound(location,sound,60,1)
+ return
- //do the monkey dance
- proc/doTeleport()
+//do the monkey dance
+/datum/teleport/proc/doTeleport()
- var/turf/destturf
- var/turf/curturf = get_turf(teleatom)
- var/area/destarea = get_area(destination)
- if(precision)
- var/list/posturfs = circlerangeturfs(destination,precision)
- destturf = safepick(posturfs)
- else
- destturf = get_turf(destination)
+ var/turf/destturf
+ var/turf/curturf = get_turf(teleatom)
+ var/area/destarea = get_area(destination)
+ if(precision)
+ var/list/posturfs = circlerangeturfs(destination,precision)
+ destturf = safepick(posturfs)
+ else
+ destturf = get_turf(destination)
- if(!destturf || !curturf)
- return 0
-
- playSpecials(curturf,effectin,soundin)
-
- var/obj/structure/bed/chair/C = null
- if(isliving(teleatom))
- var/mob/living/L = teleatom
- if(L.buckled)
- C = L.buckled
- if(force_teleport)
- teleatom.forceMove(destturf)
- playSpecials(destturf,effectout,soundout)
- else
- if(teleatom.Move(destturf))
- playSpecials(destturf,effectout,soundout)
- if(C)
- C.forceMove(destturf)
-
- destarea.Entered(teleatom)
-
- return 1
-
- proc/teleport()
- if(teleportChecks())
- return doTeleport()
+ if(!destturf || !curturf)
return 0
+ playSpecials(curturf,effectin,soundin)
+
+ var/obj/structure/bed/chair/C = null
+ if(isliving(teleatom))
+ var/mob/living/L = teleatom
+ if(L.buckled)
+ C = L.buckled
+ if(force_teleport)
+ teleatom.forceMove(destturf)
+ playSpecials(destturf,effectout,soundout)
+ else
+ if(teleatom.Move(destturf))
+ playSpecials(destturf,effectout,soundout)
+ if(C)
+ C.forceMove(destturf)
+
+ destarea.Entered(teleatom)
+
+ return 1
+
+/datum/teleport/proc/teleport()
+ if(teleportChecks())
+ return doTeleport()
+ return 0
+
/datum/teleport/instant //teleports when datum is created
- New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
- if(..())
- teleport()
- return
+/datum/teleport/instant/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
+ if(..())
+ teleport()
+ return
-/datum/teleport/instant/science
-
- setEffects(datum/effect/effect/system/aeffectin,datum/effect/effect/system/aeffectout)
- if(!aeffectin || !aeffectout)
- var/datum/effect/effect/system/spark_spread/aeffect = new
- aeffect.set_up(5, 1, teleatom)
- effectin = effectin || aeffect
- effectout = effectout || aeffect
- return 1
- else
- return ..()
-
- setPrecision(aprecision)
- ..()
- if(istype(teleatom, /obj/item/weapon/storage/backpack/holding))
- precision = rand(1,100)
-
- var/list/bagholding = teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding)
- if(bagholding.len)
- precision = max(rand(1,100)*bagholding.len,100)
- if(istype(teleatom, /mob/living))
- var/mob/living/MM = teleatom
- MM << "\red The Bluespace interface on your Bag of Holding interferes with the teleport!"
+/datum/teleport/instant/science/setEffects(datum/effect/effect/system/aeffectin,datum/effect/effect/system/aeffectout)
+ if(!aeffectin || !aeffectout)
+ var/datum/effect/effect/system/spark_spread/aeffect = new
+ aeffect.set_up(5, 1, teleatom)
+ effectin = effectin || aeffect
+ effectout = effectout || aeffect
return 1
+ else
+ return ..()
- teleportChecks()
- if(istype(teleatom, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
- teleatom.visible_message("\red The [teleatom] bounces off of the portal!")
+/datum/teleport/instant/science/setPrecision(aprecision)
+ ..()
+ if(istype(teleatom, /obj/item/weapon/storage/backpack/holding))
+ precision = rand(1,100)
+
+ var/list/bagholding = teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding)
+ if(bagholding.len)
+ precision = max(rand(1,100)*bagholding.len,100)
+ if(istype(teleatom, /mob/living))
+ var/mob/living/MM = teleatom
+ MM << "\The [teleatom] bounces off of the portal!")
+ return 0
+
+ if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)))
+ if(istype(teleatom, /mob/living))
+ var/mob/living/MM = teleatom
+ MM.visible_message("\The [MM] bounces off of the portal!","Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.")
+ else
+ teleatom.visible_message("\The [teleatom] bounces off of the portal!")
+ return 0
+
+ if(destination.z in config.admin_levels) //centcomm z-level
+ if(istype(teleatom, /obj/mecha))
+ var/obj/mecha/MM = teleatom
+ MM.occupant << "\The [MM] would not survive the jump to a location so far away!"
+ return 0
+ if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding)))
+ teleatom.visible_message("\The [teleatom] bounces off of the portal!")
return 0
- if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)))
- if(istype(teleatom, /mob/living))
- var/mob/living/MM = teleatom
- MM.visible_message("\red The [MM] bounces off of the portal!","\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.")
- else
- teleatom.visible_message("\red The [teleatom] bounces off of the portal!")
- return 0
- if(destination.z == 2) //centcomm z-level
- if(istype(teleatom, /obj/mecha))
- var/obj/mecha/MM = teleatom
- MM.occupant << "\red The mech would not survive the jump to a location so far away!"
- return 0
- if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding)))
- teleatom.visible_message("\red The Bag of Holding bounces off of the portal!")
- return 0
-
-
- if(destination.z > 7) //Away mission z-levels
- return 0
- return 1
\ No newline at end of file
+ if(destination.z > max_default_z_level()) //Away mission z-levels
+ return 0
+ return 1
diff --git a/code/datums/mind.dm b/code/datums/mind.dm
index f6fbbc110c..cfbd155145 100644
--- a/code/datums/mind.dm
+++ b/code/datums/mind.dm
@@ -311,7 +311,7 @@ datum/mind
for(var/obj/item/weapon/implant/loyalty/I in H.contents)
for(var/obj/item/organ/external/organs in H.organs)
if(I in organs.implants)
- I.Del()
+ qdel(I)
break
H << "Your loyalty implant has been deactivated."
log_admin("[key_name_admin(usr)] has de-loyalty implanted [current].")
@@ -368,7 +368,7 @@ datum/mind
src = null
m2h.inject(M)
src = mobfinder.loc:mind
- del(mobfinder)
+ qdel(mobfinder)
current.radiation -= 50
*/
else if (href_list["silicon"])
@@ -445,10 +445,10 @@ datum/mind
var/list/L = current.get_contents()
for (var/t in L)
if (istype(t, /obj/item/device/pda))
- if (t:uplink) del(t:uplink)
+ if (t:uplink) qdel(t:uplink)
t:uplink = null
else if (istype(t, /obj/item/device/radio))
- if (t:traitorradio) del(t:traitorradio)
+ if (t:traitorradio) qdel(t:traitorradio)
t:traitorradio = null
t:traitor_frequency = 0.0
else if (istype(t, /obj/item/weapon/SWF_uplink) || istype(t, /obj/item/weapon/syndicate_uplink))
@@ -457,7 +457,7 @@ datum/mind
R.loc = current.loc
R.traitorradio = null
R.traitor_frequency = 0.0
- del(t)
+ qdel(t)
// remove wizards spells
//If there are more special powers that need removal, they can be procced into here./N
@@ -479,7 +479,7 @@ datum/mind
proc/take_uplink()
var/obj/item/device/uplink/hidden/H = find_syndicate_uplink()
if(H)
- del(H)
+ qdel(H)
// check whether this mind's mob has been brigged for the given duration
diff --git a/code/datums/modules.dm b/code/datums/modules.dm
index 896d920f99..43d25a2e25 100644
--- a/code/datums/modules.dm
+++ b/code/datums/modules.dm
@@ -24,7 +24,8 @@ var/list/modules = list( // global associative list
var/mneed = mods.inmodlist(type) // find if this type has modules defined
if(!mneed) // not found in module list?
- del(src) // delete self, thus ending proc
+ qdel(src)
+ return
var/needed = mods.getbitmask(type) // get a bitmask for the number of modules in this object
status = needed
diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm
index d72a8798a7..0f10d8d56f 100644
--- a/code/datums/recipe.dm
+++ b/code/datums/recipe.dm
@@ -95,7 +95,7 @@
var/obj/result_obj = new result(container)
for (var/obj/O in (container.contents-result_obj))
O.reagents.trans_to(result_obj, O.reagents.total_volume)
- del(O)
+ qdel(O)
container.reagents.clear_reagents()
return result_obj
@@ -110,7 +110,7 @@
O.reagents.del_reagent("nutriment")
O.reagents.update_total()
O.reagents.trans_to(result_obj, O.reagents.total_volume)
- del(O)
+ qdel(O)
container.reagents.clear_reagents()
return result_obj
diff --git a/code/defines/obj.dm b/code/defines/obj.dm
index e105d67a5b..a70822942f 100644
--- a/code/defines/obj.dm
+++ b/code/defines/obj.dm
@@ -80,7 +80,8 @@
for(var/datum/data/record/t in data_core.general)
var/name = t.fields["name"]
var/rank = t.fields["rank"]
- var/real_rank = t.fields["real_rank"]
+ var/real_rank = make_list_rank(t.fields["real_rank"])
+
if(OOC)
var/active = 0
for(var/mob/M in player_list)
@@ -165,6 +166,15 @@
return dat
+/var/list/acting_rank_prefixes = list("acting", "temporary", "interim")
+
+/proc/make_list_rank(rank)
+ for(var/prefix in acting_rank_prefixes)
+ if(findtext(rank, "[prefix] ", 1, 2+length(prefix)))
+ return copytext(rank, 2+length(prefix))
+ return rank
+
+
/*
We can't just insert in HTML into the nanoUI so we need the raw data to play with.
Instead of creating this list over and over when someone leaves their PDA open to the page
@@ -189,7 +199,8 @@ var/global/ManifestJSON
for(var/datum/data/record/t in data_core.general)
var/name = sanitize(t.fields["name"])
var/rank = sanitize(t.fields["rank"])
- var/real_rank = t.fields["real_rank"]
+ var/real_rank = make_list_rank(t.fields["real_rank"])
+
var/isactive = t.fields["p_stat"]
var/department = 0
var/depthead = 0 // Department Heads will be placed at the top of their lists.
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 7f287a5b54..99ff26c89a 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -83,7 +83,7 @@
force = 5.0
throwforce = 7.0
w_class = 2.0
- matter = list("metal" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50)
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
/obj/item/weapon/cane/concealed
@@ -271,7 +271,7 @@
w_class = 2.0
throw_speed = 4
throw_range = 20
- matter = list("metal" = 100)
+ matter = list(DEFAULT_WALL_MATERIAL = 100)
origin_tech = "magnets=1"
/obj/item/weapon/staff
@@ -321,7 +321,7 @@
var/amount = 1.0
var/laying = 0.0
var/old_lay = null
- matter = list("metal" = 40)
+ matter = list(DEFAULT_WALL_MATERIAL = 40)
attack_verb = list("whipped", "lashed", "disciplined", "tickled")
suicide_act(mob/user)
@@ -345,12 +345,12 @@
name = "power control module"
icon_state = "power_mod"
desc = "Heavy-duty switching circuits for power control."
- matter = list("metal" = 50, "glass" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50)
/obj/item/weapon/module/power_control/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(W, /obj/item/device/multitool))
var/obj/item/weapon/circuitboard/ghettosmes/newcircuit = new/obj/item/weapon/circuitboard/ghettosmes(user.loc)
- del(src)
+ qdel(src)
user.put_in_hands(newcircuit)
@@ -467,35 +467,35 @@
desc = "A basic capacitor used in the construction of a variety of devices."
icon_state = "capacitor"
origin_tech = "powerstorage=1"
- matter = list("metal" = 50,"glass" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 50)
/obj/item/weapon/stock_parts/scanning_module
name = "scanning module"
desc = "A compact, high resolution scanning module used in the construction of certain devices."
icon_state = "scan_module"
origin_tech = "magnets=1"
- matter = list("metal" = 50,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20)
/obj/item/weapon/stock_parts/manipulator
name = "micro-manipulator"
desc = "A tiny little manipulator used in the construction of certain devices."
icon_state = "micro_mani"
origin_tech = "materials=1;programming=1"
- matter = list("metal" = 30)
+ matter = list(DEFAULT_WALL_MATERIAL = 30)
/obj/item/weapon/stock_parts/micro_laser
name = "micro-laser"
desc = "A tiny laser used in certain devices."
icon_state = "micro_laser"
origin_tech = "magnets=1"
- matter = list("metal" = 10,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 10,"glass" = 20)
/obj/item/weapon/stock_parts/matter_bin
name = "matter bin"
desc = "A container for hold compressed matter awaiting re-construction."
icon_state = "matter_bin"
origin_tech = "materials=1"
- matter = list("metal" = 80)
+ matter = list(DEFAULT_WALL_MATERIAL = 80)
//Rank 2
@@ -504,7 +504,7 @@
desc = "An advanced capacitor used in the construction of a variety of devices."
origin_tech = "powerstorage=3"
rating = 2
- matter = list("metal" = 50,"glass" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 50)
/obj/item/weapon/stock_parts/scanning_module/adv
name = "advanced scanning module"
@@ -512,7 +512,7 @@
icon_state = "scan_module"
origin_tech = "magnets=3"
rating = 2
- matter = list("metal" = 50,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20)
/obj/item/weapon/stock_parts/manipulator/nano
name = "nano-manipulator"
@@ -520,7 +520,7 @@
icon_state = "nano_mani"
origin_tech = "materials=3,programming=2"
rating = 2
- matter = list("metal" = 30)
+ matter = list(DEFAULT_WALL_MATERIAL = 30)
/obj/item/weapon/stock_parts/micro_laser/high
name = "high-power micro-laser"
@@ -528,7 +528,7 @@
icon_state = "high_micro_laser"
origin_tech = "magnets=3"
rating = 2
- matter = list("metal" = 10,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 10,"glass" = 20)
/obj/item/weapon/stock_parts/matter_bin/adv
name = "advanced matter bin"
@@ -536,7 +536,7 @@
icon_state = "advanced_matter_bin"
origin_tech = "materials=3"
rating = 2
- matter = list("metal" = 80)
+ matter = list(DEFAULT_WALL_MATERIAL = 80)
//Rating 3
@@ -545,14 +545,14 @@
desc = "A super-high capacity capacitor used in the construction of a variety of devices."
origin_tech = "powerstorage=5;materials=4"
rating = 3
- matter = list("metal" = 50,"glass" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 50)
/obj/item/weapon/stock_parts/scanning_module/phasic
name = "phasic scanning module"
desc = "A compact, high resolution phasic scanning module used in the construction of certain devices."
origin_tech = "magnets=5"
rating = 3
- matter = list("metal" = 50,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20)
/obj/item/weapon/stock_parts/manipulator/pico
name = "pico-manipulator"
@@ -560,7 +560,7 @@
icon_state = "pico_mani"
origin_tech = "materials=5,programming=2"
rating = 3
- matter = list("metal" = 30)
+ matter = list(DEFAULT_WALL_MATERIAL = 30)
/obj/item/weapon/stock_parts/micro_laser/ultra
name = "ultra-high-power micro-laser"
@@ -568,7 +568,7 @@
desc = "A tiny laser used in certain devices."
origin_tech = "magnets=5"
rating = 3
- matter = list("metal" = 10,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 10,"glass" = 20)
/obj/item/weapon/stock_parts/matter_bin/super
name = "super matter bin"
@@ -576,7 +576,7 @@
icon_state = "super_matter_bin"
origin_tech = "materials=5"
rating = 3
- matter = list("metal" = 80)
+ matter = list(DEFAULT_WALL_MATERIAL = 80)
// Subspace stock parts
@@ -585,35 +585,35 @@
icon_state = "subspace_ansible"
desc = "A compact module capable of sensing extradimensional activity."
origin_tech = "programming=3;magnets=5;materials=4;bluespace=2"
- matter = list("metal" = 30,"glass" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10)
/obj/item/weapon/stock_parts/subspace/filter
name = "hyperwave filter"
icon_state = "hyperwave_filter"
desc = "A tiny device capable of filtering and converting super-intense radiowaves."
origin_tech = "programming=4;magnets=2"
- matter = list("metal" = 30,"glass" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10)
/obj/item/weapon/stock_parts/subspace/amplifier
name = "subspace amplifier"
icon_state = "subspace_amplifier"
desc = "A compact micro-machine capable of amplifying weak subspace transmissions."
origin_tech = "programming=3;magnets=4;materials=4;bluespace=2"
- matter = list("metal" = 30,"glass" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10)
/obj/item/weapon/stock_parts/subspace/treatment
name = "subspace treatment disk"
icon_state = "treatment_disk"
desc = "A compact micro-machine capable of stretching out hyper-compressed radio waves."
origin_tech = "programming=3;magnets=2;materials=5;bluespace=2"
- matter = list("metal" = 30,"glass" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10)
/obj/item/weapon/stock_parts/subspace/analyzer
name = "subspace wavelength analyzer"
icon_state = "wavelength_analyzer"
desc = "A sophisticated analyzer capable of analyzing cryptic subspace wavelengths."
origin_tech = "programming=3;magnets=4;materials=4;bluespace=2"
- matter = list("metal" = 30,"glass" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 10)
/obj/item/weapon/stock_parts/subspace/crystal
name = "ansible crystal"
@@ -627,7 +627,7 @@
icon_state = "subspace_transmitter"
desc = "A large piece of equipment used to open a window into the subspace dimension."
origin_tech = "magnets=5;materials=5;bluespace=3"
- matter = list("metal" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50)
/obj/item/weapon/ectoplasm
name = "ectoplasm"
diff --git a/code/defines/procs/records.dm b/code/defines/procs/records.dm
index 4e9fbcc9af..256ae51dbf 100644
--- a/code/defines/procs/records.dm
+++ b/code/defines/procs/records.dm
@@ -22,7 +22,7 @@
G.fields["photo_side"] = side
data_core.general += G
- del(dummy)
+ qdel(dummy)
return G
/proc/CreateSecurityRecord(var/name as text, var/id as text)
diff --git a/code/defines/procs/sd_Alert.dm b/code/defines/procs/sd_Alert.dm
index c63cab8f8b..e10416f112 100644
--- a/code/defines/procs/sd_Alert.dm
+++ b/code/defines/procs/sd_Alert.dm
@@ -1,168 +1,168 @@
-/* sd_Alert library
- by Shadowdarke (shadowdarke@byond.com)
-
- sd_Alert() is a powerful and flexible alternative to the built in BYOND
- alert() proc. sd_Alert offers timed popups, unlimited buttons, custom
- appearance, and even the option to popup without stealing keyboard focus
- from the map or command line.
-
- Please see demo.dm for detailed examples.
-
-FORMAT
- sd_Alert(who, message, title, buttons, default, duration, unfocus, \
- size, table, style, tag, select, flags)
-
-ARGUMENTS
- who - the client or mob to display the alert to.
- message - text message to display
- title - title of the alert box
- buttons - list of buttons
- Default Value: list("Ok")
- default - default button selestion
- Default Value: the first button in the list
- duration - the number of ticks before this alert expires. If not
- set, the alert lasts until a button is clicked.
- Default Value: 0 (unlimited)
- unfocus - if this value is set, the popup will not steal keyboard
- focus from the map or command line.
- Default Value: 1 (do not take focus)
- size - size of the popup window in px
- Default Value: "300x200"
- table - optional parameters for the HTML table in the alert
- Default Value: "width=100% height=100%" (fill the window)
- style - optional style sheet information
- tag - lets you specify a certain tag for this sd_Alert so you may manipulate it
- externally. (i.e. force the alert to close, change options and redisplay,
- reuse the same window, etc.)
- select - if set, the buttons will be replaced with a selection box with a number of
- lines displayed equal to this value.
- Default value: 0 (use buttons)
- flags - optional flags effecting the alert display. These flags may be ORed (|)
- together for multiple effects.
- SD_ALERT_SCROLL = display a scrollbar
- SD_ALERT_SELECT_MULTI = forces selection box display (instead of
- buttons) allows the user to select multiple
- choices.
- SD_ALERT_LINKS = display each choice as a plain text link.
- Any selection box style overrides this flag.
- SD_ALERT_NOVALIDATE = don't validate responses
- Default value: SD_ALERT_SCROLL
- (button display with scroll bar, validate responses)
-RETURNS
- The text of the selected button, or null if the alert duration expired
- without a button click.
-
-Version 1 changes (from version 0):
-* Added the tag, select, and flags arguments, thanks to several suggestions from Foomer.
-* Split the sd_Alert/Alert() proc into New(), Display(), and Response() to allow more
- customization by developers. Primarily developers would want to use Display() to change
- the display of active tagged windows
-
-*/
-
-
-#define SD_ALERT_SCROLL 1
-#define SD_ALERT_SELECT_MULTI 2
-#define SD_ALERT_LINKS 4
-#define SD_ALERT_NOVALIDATE 8
-
-proc/sd_Alert(client/who, message, title, buttons = list("Ok"),\
- default, duration = 0, unfocus = 1, size = "300x200", \
- table = "width=100% height=100%", style, tag, select, flags = SD_ALERT_SCROLL)
-
- if(ismob(who))
- var/mob/M = who
- who = M.client
- if(!istype(who)) CRASH("sd_Alert: Invalid target:[who] (\ref[who])")
-
- var/sd_alert/T = locate(tag)
- if(T)
- if(istype(T)) del(T)
- else CRASH("sd_Alert: tag \"[tag]\" is already in use by datum '[T]' (type: [T.type])")
- T = new(who, tag)
- if(duration)
- spawn(duration)
- if(T) del(T)
- return
- T.Display(message,title,buttons,default,unfocus,size,table,style,select,flags)
- . = T.Response()
-
-sd_alert
- var
- client/target
- response
- list/validation
-
- Del()
- target << browse(null,"window=\ref[src]")
- ..()
-
- New(who, tag)
- ..()
- target = who
- src.tag = tag
-
- Topic(href,params[])
- if(usr.client != target) return
- response = params["clk"]
-
- proc/Display(message,title,list/buttons,default,unfocus,size,table,style,select,flags)
- if(unfocus) spawn() target << browse(null,null)
- if(istext(buttons)) buttons = list(buttons)
- if(!default) default = buttons[1]
- if(!(flags & SD_ALERT_NOVALIDATE)) validation = buttons.Copy()
-
- var/html = {"[title][style]"
-
- target << browse(html,"window=\ref[src];size=[size];can_close=0")
-
- proc/Response()
- var/validated
- while(!validated)
- while(target && !response) // wait for a response
- sleep(2)
-
- if(response && validation)
- if(istype(response, /list))
- var/list/L = response - validation
- if(L.len) response = null
- else validated = 1
- else if(response in validation) validated = 1
- else response=null
- else validated = 1
- spawn(2) del(src)
- return response
+/* sd_Alert library
+ by Shadowdarke (shadowdarke@byond.com)
+
+ sd_Alert() is a powerful and flexible alternative to the built in BYOND
+ alert() proc. sd_Alert offers timed popups, unlimited buttons, custom
+ appearance, and even the option to popup without stealing keyboard focus
+ from the map or command line.
+
+ Please see demo.dm for detailed examples.
+
+FORMAT
+ sd_Alert(who, message, title, buttons, default, duration, unfocus, \
+ size, table, style, tag, select, flags)
+
+ARGUMENTS
+ who - the client or mob to display the alert to.
+ message - text message to display
+ title - title of the alert box
+ buttons - list of buttons
+ Default Value: list("Ok")
+ default - default button selestion
+ Default Value: the first button in the list
+ duration - the number of ticks before this alert expires. If not
+ set, the alert lasts until a button is clicked.
+ Default Value: 0 (unlimited)
+ unfocus - if this value is set, the popup will not steal keyboard
+ focus from the map or command line.
+ Default Value: 1 (do not take focus)
+ size - size of the popup window in px
+ Default Value: "300x200"
+ table - optional parameters for the HTML table in the alert
+ Default Value: "width=100% height=100%" (fill the window)
+ style - optional style sheet information
+ tag - lets you specify a certain tag for this sd_Alert so you may manipulate it
+ externally. (i.e. force the alert to close, change options and redisplay,
+ reuse the same window, etc.)
+ select - if set, the buttons will be replaced with a selection box with a number of
+ lines displayed equal to this value.
+ Default value: 0 (use buttons)
+ flags - optional flags effecting the alert display. These flags may be ORed (|)
+ together for multiple effects.
+ SD_ALERT_SCROLL = display a scrollbar
+ SD_ALERT_SELECT_MULTI = forces selection box display (instead of
+ buttons) allows the user to select multiple
+ choices.
+ SD_ALERT_LINKS = display each choice as a plain text link.
+ Any selection box style overrides this flag.
+ SD_ALERT_NOVALIDATE = don't validate responses
+ Default value: SD_ALERT_SCROLL
+ (button display with scroll bar, validate responses)
+RETURNS
+ The text of the selected button, or null if the alert duration expired
+ without a button click.
+
+Version 1 changes (from version 0):
+* Added the tag, select, and flags arguments, thanks to several suggestions from Foomer.
+* Split the sd_Alert/Alert() proc into New(), Display(), and Response() to allow more
+ customization by developers. Primarily developers would want to use Display() to change
+ the display of active tagged windows
+
+*/
+
+
+#define SD_ALERT_SCROLL 1
+#define SD_ALERT_SELECT_MULTI 2
+#define SD_ALERT_LINKS 4
+#define SD_ALERT_NOVALIDATE 8
+
+proc/sd_Alert(client/who, message, title, buttons = list("Ok"),\
+ default, duration = 0, unfocus = 1, size = "300x200", \
+ table = "width=100% height=100%", style, tag, select, flags = SD_ALERT_SCROLL)
+
+ if(ismob(who))
+ var/mob/M = who
+ who = M.client
+ if(!istype(who)) CRASH("sd_Alert: Invalid target:[who] (\ref[who])")
+
+ var/sd_alert/T = locate(tag)
+ if(T)
+ if(istype(T)) qdel(T)
+ else CRASH("sd_Alert: tag \"[tag]\" is already in use by datum '[T]' (type: [T.type])")
+ T = new(who, tag)
+ if(duration)
+ spawn(duration)
+ if(T) qdel(T)
+ return
+ T.Display(message,title,buttons,default,unfocus,size,table,style,select,flags)
+ . = T.Response()
+
+sd_alert
+ var
+ client/target
+ response
+ list/validation
+
+ Destroy()
+ target << browse(null,"window=\ref[src]")
+ ..()
+
+ New(who, tag)
+ ..()
+ target = who
+ src.tag = tag
+
+ Topic(href,params[])
+ if(usr.client != target) return
+ response = params["clk"]
+
+ proc/Display(message,title,list/buttons,default,unfocus,size,table,style,select,flags)
+ if(unfocus) spawn() target << browse(null,null)
+ if(istext(buttons)) buttons = list(buttons)
+ if(!default) default = buttons[1]
+ if(!(flags & SD_ALERT_NOVALIDATE)) validation = buttons.Copy()
+
+ var/html = {"[title][style]"
+
+ target << browse(html,"window=\ref[src];size=[size];can_close=0")
+
+ proc/Response()
+ var/validated
+ while(!validated)
+ while(target && !response) // wait for a response
+ sleep(2)
+
+ if(response && validation)
+ if(istype(response, /list))
+ var/list/L = response - validation
+ if(L.len) response = null
+ else validated = 1
+ else if(response in validation) validated = 1
+ else response=null
+ else validated = 1
+ spawn(2) qdel(src)
+ return response
diff --git a/code/game/antagonist/antagonist.dm b/code/game/antagonist/antagonist.dm
index 73e17a2043..aad02b1c6c 100644
--- a/code/game/antagonist/antagonist.dm
+++ b/code/game/antagonist/antagonist.dm
@@ -199,7 +199,7 @@
for(var/datum/uplink_item/UI in H.purchase_log)
var/obj/I = new UI.path
refined_log.Add("[H.purchase_log[UI]]x\icon[I][UI.name]")
- del(I)
+ qdel(I)
purchases = english_list(refined_log, nothing_text = "")
if(uplink_true)
text += " (used [TC_uses] TC)"
@@ -215,7 +215,7 @@
if(antag.current && antag.current.client)
for(var/image/I in antag.current.client.images)
if(I.icon_state == antag_indicator)
- del(I)
+ qdel(I)
for(var/datum/mind/other_antag in current_antagonists)
if(other_antag.current)
antag.current.client.images |= image('icons/mob/mob.dmi', loc = other_antag.current, icon_state = antag_indicator)
@@ -241,10 +241,10 @@
if(antag.current.client)
for(var/image/I in antag.current.client.images)
if(I.icon_state == antag_indicator && I.loc == player.current)
- del(I)
+ qdel(I)
if(player.current && player.current.client)
for(var/image/I in player.current.client.images)
if(I.icon_state == antag_indicator)
- del(I)
+ qdel(I)
diff --git a/code/game/antagonist/antagonist_build.dm b/code/game/antagonist/antagonist_build.dm
index 40ba798aae..35af4e6f80 100644
--- a/code/game/antagonist/antagonist_build.dm
+++ b/code/game/antagonist/antagonist_build.dm
@@ -15,7 +15,7 @@
var/mob/holder = player.current
player.current = new mob_path(get_turf(player.current))
player.transfer_to(player.current)
- if(holder) del(holder)
+ if(holder) qdel(holder)
player.original = player.current
return player.current
@@ -30,7 +30,7 @@
for(var/obj/item/thing in player.contents)
player.drop_from_inventory(thing)
if(thing.loc != player)
- del(thing)
+ qdel(thing)
return 1
if(flags & ANTAG_SET_APPEARANCE)
diff --git a/code/game/antagonist/outsider/ert.dm b/code/game/antagonist/outsider/ert.dm
index f52f031002..946ff1dfc2 100644
--- a/code/game/antagonist/outsider/ert.dm
+++ b/code/game/antagonist/outsider/ert.dm
@@ -32,13 +32,9 @@ var/datum/antagonist/ert/ert
player.equip_to_slot_or_del(new /obj/item/clothing/gloves/swat(src), slot_gloves)
player.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(src), slot_glasses)
- var/obj/item/weapon/card/id/W = new(src)
- W.assignment = "Emergency Response Team"
+ var/obj/item/weapon/card/id/centcom/ERT/W = new(src)
W.registered_name = player.real_name
W.name = "[player.real_name]'s ID Card ([W.assignment])"
- W.icon_state = "centcom"
- W.access = get_all_accesses()
- W.access += get_all_centcom_access()
player.equip_to_slot_or_del(W, slot_wear_id)
return 1
diff --git a/code/game/antagonist/station/highlander.dm b/code/game/antagonist/station/highlander.dm
index 0af6e1e23d..9b82b15852 100644
--- a/code/game/antagonist/station/highlander.dm
+++ b/code/game/antagonist/station/highlander.dm
@@ -32,7 +32,7 @@ var/datum/antagonist/highlander/highlanders
for (var/obj/item/I in player)
if (istype(I, /obj/item/weapon/implant))
continue
- del(I)
+ qdel(I)
player.equip_to_slot_or_del(new /obj/item/clothing/under/kilt(player), slot_w_uniform)
player.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(player), slot_l_ear)
diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm
index 372556c205..3d9026ff88 100644
--- a/code/game/antagonist/station/rogue_ai.dm
+++ b/code/game/antagonist/station/rogue_ai.dm
@@ -27,7 +27,7 @@ var/datum/antagonist/rogue_ai/malf
hacked_apcs |= apc
/datum/antagonist/rogue_ai/proc/update_takeover_time()
- hack_time -= ((hacked_apcs.len/6)*tickerProcess.getLastTickerTimeDuration())
+ hack_time -= ((hacked_apcs.len/6)*2.0)
/datum/antagonist/rogue_ai/tick()
if(revealed && hacked_apcs.len >= 3)
@@ -213,7 +213,7 @@ var/datum/antagonist/rogue_ai/malf
/client/proc/reactivate_camera)
current:laws = new /datum/ai_laws/nanotrasen
- del(current:malf_picker)
+ qdel(current:malf_picker)
current:show_laws()
current.icon_state = "ai"
diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm
index a72b06852a..21e965244b 100755
--- a/code/game/area/Space Station 13 areas.dm
+++ b/code/game/area/Space Station 13 areas.dm
@@ -26,8 +26,8 @@ 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
mouse_opacity = 0
- invisibility = INVISIBILITY_LIGHTING
var/lightswitch = 1
var/eject = null
@@ -48,15 +48,12 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/has_gravity = 1
var/list/apc = list()
var/no_air = null
- var/area/master // master area used for power calcluations
- // (original area before splitting due to sd_DAL)
- var/list/related // the other areas of the same type as this
// var/list/lights // list of all lights on this area
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
var/air_doors_activated = 0
var/list/ambience = list('sound/ambience/ambigen1.ogg','sound/ambience/ambigen3.ogg','sound/ambience/ambigen4.ogg','sound/ambience/ambigen5.ogg','sound/ambience/ambigen6.ogg','sound/ambience/ambigen7.ogg','sound/ambience/ambigen8.ogg','sound/ambience/ambigen9.ogg','sound/ambience/ambigen10.ogg','sound/ambience/ambigen11.ogg','sound/ambience/ambigen12.ogg','sound/ambience/ambigen14.ogg')
- var/sound/forced_ambience = null
-
+ var/list/forced_ambience = null
+ var/sound_env = 2 //reverb preset for sounds played in this area, see sound datum reference for more
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
var/list/teleportlocs = list()
@@ -102,7 +99,6 @@ var/list/ghostteleportlocs = list()
icon_state = "space"
requires_power = 1
always_unpowered = 1
- lighting_use_dynamic = 1
power_light = 0
power_equip = 0
power_environ = 0
@@ -145,10 +141,8 @@ area/space/atmosalert()
//place to another. Look at escape shuttle for example.
//All shuttles should now be under shuttle since we have smooth-wall code.
-/area/shuttle //DO NOT TURN THE lighting_use_dynamic STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
+/area/shuttle
requires_power = 0
- luminosity = 1
- lighting_use_dynamic = 0
/area/shuttle/arrival
name = "\improper Arrival Shuttle"
@@ -249,15 +243,11 @@ area/space/atmosalert()
icon_state = "shuttle"
name = "\improper Alien Shuttle Base"
requires_power = 1
- luminosity = 0
- lighting_use_dynamic = 1
/area/shuttle/alien/mine
icon_state = "shuttle"
name = "\improper Alien Shuttle Mine"
requires_power = 1
- luminosity = 0
- lighting_use_dynamic = 1
/area/shuttle/prison/
name = "\improper Prison Shuttle"
@@ -343,7 +333,6 @@ area/space/atmosalert()
name = "start area"
icon_state = "start"
requires_power = 0
- luminosity = 1
lighting_use_dynamic = 0
has_gravity = 1
@@ -361,6 +350,7 @@ area/space/atmosalert()
icon_state = "centcom"
requires_power = 0
unlimited_power = 1
+ lighting_use_dynamic = 0
/area/centcom/control
name = "\improper Centcom Control"
@@ -399,6 +389,7 @@ area/space/atmosalert()
icon_state = "syndie-ship"
requires_power = 0
unlimited_power = 1
+ lighting_use_dynamic = 0
/area/syndicate_mothership/control
name = "\improper Mercenary Control Room"
@@ -808,6 +799,9 @@ area/space/atmosalert()
//Hallway
+/area/hallway/primary/
+ sound_env = 12 //hallway
+
/area/hallway/primary/fore
name = "\improper Fore Primary Hallway"
icon_state = "hallF"
@@ -1006,16 +1000,13 @@ area/space/atmosalert()
/area/holodeck
name = "\improper Holodeck"
icon_state = "Holodeck"
- luminosity = 1
lighting_use_dynamic = 0
/area/holodeck/alphadeck
name = "\improper Holodeck Alpha"
-
/area/holodeck/source_plating
name = "\improper Holodeck - Off"
- icon_state = "Holodeck"
/area/holodeck/source_emptycourt
name = "\improper Holodeck - Empty Court"
@@ -1031,11 +1022,9 @@ area/space/atmosalert()
/area/holodeck/source_courtroom
name = "\improper Holodeck - Courtroom"
- icon_state = "Holodeck"
/area/holodeck/source_beach
name = "\improper Holodeck - Beach"
- icon_state = "Holodeck" // Lazy.
/area/holodeck/source_burntest
name = "\improper Holodeck - Atmospheric Burn Test"
@@ -1062,9 +1051,6 @@ area/space/atmosalert()
name = "\improper Holodeck - Space"
has_gravity = 0
-
-
-
//Engineering
/area/engineering/
@@ -1143,7 +1129,6 @@ area/space/atmosalert()
/area/solar
requires_power = 1
always_unpowered = 1
- luminosity = 1
lighting_use_dynamic = 0
auxport
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index 0778f50174..38452c3d5b 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -10,44 +10,38 @@
/area/New()
icon_state = ""
layer = 10
- master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references loc.loc.master ~Carn
uid = ++global_uid
- related = list(src)
all_areas += src
- if(requires_power)
- luminosity = 0
- else
+ if(!requires_power)
power_light = 0 //rastaf0
power_equip = 0 //rastaf0
power_environ = 0 //rastaf0
- luminosity = 1
- lighting_use_dynamic = 0
..()
// spawn(15)
power_change() // all machines set to current power level, also updates lighting icon
- InitializeLighting()
+
+/area/proc/get_contents()
+ return contents
/area/proc/get_cameras()
var/list/cameras = list()
- for (var/area/RA in related)
- for (var/obj/machinery/camera/C in RA)
- cameras += C
+ for (var/obj/machinery/camera/C in src)
+ cameras += C
return cameras
/area/proc/atmosalert(danger_level, var/alarm_source)
if (danger_level == 0)
- atmosphere_alarm.clearAlarm(master, alarm_source)
+ atmosphere_alarm.clearAlarm(src, alarm_source)
else
- atmosphere_alarm.triggerAlarm(master, alarm_source, severity = danger_level)
+ atmosphere_alarm.triggerAlarm(src, alarm_source, severity = danger_level)
//Check all the alarms before lowering atmosalm. Raising is perfectly fine.
- for (var/area/RA in related)
- for (var/obj/machinery/alarm/AA in RA)
- if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level)
- danger_level = max(danger_level, AA.danger_level)
+ for (var/obj/machinery/alarm/AA in src)
+ if (!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.report_danger_level)
+ danger_level = max(danger_level, AA.danger_level)
if(danger_level != atmosalm)
if (danger_level < 1 && atmosalm >= 1)
@@ -57,17 +51,16 @@
air_doors_close()
atmosalm = danger_level
- for(var/area/RA in related)
- for (var/obj/machinery/alarm/AA in RA)
- AA.update_icon()
+ for (var/obj/machinery/alarm/AA in src)
+ AA.update_icon()
return 1
return 0
/area/proc/air_doors_close()
- if(!src.master.air_doors_activated)
- src.master.air_doors_activated = 1
- for(var/obj/machinery/door/firedoor/E in src.master.all_doors)
+ if(!air_doors_activated)
+ air_doors_activated = 1
+ for(var/obj/machinery/door/firedoor/E in all_doors)
if(!E.blocked)
if(E.operating)
E.nextstate = CLOSED
@@ -76,9 +69,9 @@
E.close()
/area/proc/air_doors_open()
- if(src.master.air_doors_activated)
- src.master.air_doors_activated = 0
- for(var/obj/machinery/door/firedoor/E in src.master.all_doors)
+ if(air_doors_activated)
+ air_doors_activated = 0
+ for(var/obj/machinery/door/firedoor/E in all_doors)
if(!E.blocked)
if(E.operating)
E.nextstate = OPEN
@@ -89,11 +82,8 @@
/area/proc/fire_alert()
if(!fire)
- master.fire = 1 //used for firedoor checks
- master.updateicon()
- for(var/area/A in related)
- A.fire = 1
- A.updateicon()
+ fire = 1 //used for firedoor checks
+ updateicon()
mouse_opacity = 0
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
@@ -105,11 +95,8 @@
/area/proc/fire_reset()
if (fire)
- master.fire = 0 //used for firedoor checks
- master.updateicon()
- for(var/area/A in related)
- A.fire = 0
- A.updateicon()
+ fire = 0 //used for firedoor checks
+ updateicon()
mouse_opacity = 0
for(var/obj/machinery/door/firedoor/D in all_doors)
if(!D.blocked)
@@ -153,7 +140,7 @@
return
/area/proc/updateicon()
- if ((fire || eject || party) && (!requires_power||power_environ) && !lighting_space)//If it doesn't require power, can still activate this proc.
+ if ((fire || eject || party) && (!requires_power||power_environ) && !istype(src, /area/space))//If it doesn't require power, can still activate this proc.
if(fire && !eject && !party)
icon_state = "blue"
/*else if(atmosalm && !fire && !eject && !party)
@@ -177,56 +164,53 @@
/area/proc/powered(var/chan) // return true if the area has power to given channel
- if(!master.requires_power)
+ if(!requires_power)
return 1
- if(master.always_unpowered)
+ if(always_unpowered)
return 0
- if(src.lighting_space)
- return 0 // Nope sorry
switch(chan)
if(EQUIP)
- return master.power_equip
+ return power_equip
if(LIGHT)
- return master.power_light
+ return power_light
if(ENVIRON)
- return master.power_environ
+ return power_environ
return 0
// called when power status changes
/area/proc/power_change()
- for(var/area/RA in related)
- for(var/obj/machinery/M in RA) // for each machine in the area
- M.power_change() // reverify power status (to update icons etc.)
- if (fire || eject || party)
- RA.updateicon()
+ for(var/obj/machinery/M in src) // for each machine in the area
+ M.power_change() // reverify power status (to update icons etc.)
+ if (fire || eject || party)
+ updateicon()
/area/proc/usage(var/chan)
var/used = 0
switch(chan)
if(LIGHT)
- used += master.used_light
+ used += used_light
if(EQUIP)
- used += master.used_equip
+ used += used_equip
if(ENVIRON)
- used += master.used_environ
+ used += used_environ
if(TOTAL)
- used += master.used_light + master.used_equip + master.used_environ
+ used += used_light + used_equip + used_environ
return used
/area/proc/clear_usage()
- master.used_equip = 0
- master.used_light = 0
- master.used_environ = 0
+ used_equip = 0
+ used_light = 0
+ used_environ = 0
/area/proc/use_power(var/amount, var/chan)
switch(chan)
if(EQUIP)
- master.used_equip += amount
+ used_equip += amount
if(LIGHT)
- master.used_light += amount
+ used_light += amount
if(ENVIRON)
- master.used_environ += amount
+ used_environ += amount
var/list/mob/living/forced_ambiance_list = new
@@ -262,37 +246,35 @@ var/list/mob/living/forced_ambiance_list = new
L << sound('sound/ambience/shipambience.ogg', repeat = 1, wait = 0, volume = 35, channel = 2)
if(forced_ambience)
- forced_ambiance_list += L
- L << forced_ambience
+ if(forced_ambience.len)
+ forced_ambiance_list |= L
+ L << sound(pick(forced_ambience), repeat = 1, wait = 0, volume = 25, channel = 1)
+ else
+ L << sound(null, channel = 1)
else if(src.ambience.len && prob(35))
if((world.time >= L.client.played + 600))
- var/musVolume = 25
var/sound = pick(ambience)
- L << sound(sound, repeat = 0, wait = 0, volume = musVolume, channel = 1)
+ L << sound(sound, repeat = 0, wait = 0, volume = 25, channel = 1)
L.client.played = world.time
/area/proc/gravitychange(var/gravitystate = 0, var/area/A)
-
A.has_gravity = gravitystate
- for(var/area/SubA in A.related)
- SubA.has_gravity = gravitystate
-
- if(gravitystate)
- for(var/mob/living/carbon/human/M in SubA)
- thunk(M)
- for(var/mob/M1 in SubA)
- M1.make_floating(0)
- else
- for(var/mob/M in SubA)
- 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)
+ if(gravitystate)
+ for(var/mob/living/carbon/human/M in A)
+ 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
- M.make_floating(1)
+ H.make_floating(1)
+ else
+ M.make_floating(1)
/area/proc/thunk(mob)
if(istype(get_turf(mob), /turf/space)) // Can't fall onto nothing.
diff --git a/code/game/area/asteroid_areas.dm b/code/game/area/asteroid_areas.dm
index edfb99f57f..12ae5377ce 100644
--- a/code/game/area/asteroid_areas.dm
+++ b/code/game/area/asteroid_areas.dm
@@ -3,6 +3,7 @@
/area/mine
icon_state = "mining"
music = 'sound/ambience/song_game.ogg'
+ sound_env = 5 //stoneroom
/area/mine/explored
name = "Mine"
diff --git a/code/game/asteroid.dm b/code/game/asteroid.dm
index e5b421e9af..8aa6b1cd64 100644
--- a/code/game/asteroid.dm
+++ b/code/game/asteroid.dm
@@ -32,7 +32,7 @@ proc/spawn_room(var/atom/start_loc,var/x_size,var/y_size,var/wall,var/floor , va
var/cur_loc = locate(start_loc.x+x,start_loc.y+y,start_loc.z)
if(clean)
for(var/O in cur_loc)
- del(O)
+ qdel(O)
var/area/asteroid/artifactroom/A = new
if(name)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 5944587cc7..742c6389a9 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -11,6 +11,7 @@
var/pass_flags = 0
var/throwpass = 0
var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom.
+ var/simulated = 1 //filter for actions - used by lighting overlays
///Chemistry.
var/datum/reagents/reagents = null
@@ -22,6 +23,18 @@
//Detective Work, used for the duplicate data points kept in the scanners
var/list/original_atom
+/atom/Destroy()
+ . = ..()
+ density = 0
+ set_opacity(0)
+
+ if(reagents)
+ qdel(reagents)
+ reagents = null
+ for(var/atom/movable/AM in contents)
+ qdel(AM)
+ invisibility = 101
+
/atom/proc/assume_air(datum/gas_mixture/giver)
return null
@@ -66,7 +79,6 @@
return flags & INSERT_CONTAINER
*/
-
/atom/proc/meteorhit(obj/meteor as obj)
return
@@ -148,7 +160,7 @@ its easier to just keep the beam vertical.
for(var/obj/effect/overlay/beam/O in orange(10,src)) //This section erases the previously drawn beam because I found it was easier to
if(O.BeamSource==src) //just draw another instance of the beam instead of trying to manipulate all the
- del O //pieces to a new orientation.
+ qdel(O) //pieces to a new orientation.
var/Angle=round(Get_Angle(src,BeamTarget))
var/icon/I=new(icon,icon_state)
I.Turn(Angle)
@@ -189,7 +201,7 @@ its easier to just keep the beam vertical.
X.pixel_y=Pixel_y
sleep(3) //Changing this to a lower value will cause the beam to follow more smoothly with movement, but it will also be more laggy.
//I've found that 3 ticks provided a nice balance for my use.
- for(var/obj/effect/overlay/beam/O in orange(10,src)) if(O.BeamSource==src) del O
+ for(var/obj/effect/overlay/beam/O in orange(10,src)) if(O.BeamSource==src) qdel(O)
//All atoms
@@ -229,7 +241,7 @@ its easier to just keep the beam vertical.
/atom/proc/fire_act()
return
-
+
/atom/proc/melt()
return
@@ -362,7 +374,7 @@ its easier to just keep the beam vertical.
//Cleaning up shit.
if(fingerprints && !fingerprints.len)
- del(fingerprints)
+ qdel(fingerprints)
return
@@ -419,7 +431,7 @@ its easier to just keep the beam vertical.
src.color = initial(src.color) //paint
src.germ_level = 0
if(istype(blood_DNA, /list))
- del(blood_DNA)
+ qdel(blood_DNA)
return 1
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 79d6e8fd08..f86c135da4 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -14,6 +14,29 @@
var/moved_recently = 0
var/mob/pulledby = null
+/atom/movable/New()
+ ..()
+ if(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
+// testing("GC: [type] was deleted via GC with qdel()")
+ ..()
+
+/atom/movable/Destroy()
+ . = ..()
+
+ loc = null
+
+/atom/movable/proc/initialize()
+ return
+
/atom/movable/Bump(var/atom/A, yes)
if(src.throwing)
src.throw_impact(A)
@@ -187,4 +210,4 @@
/atom/movable/overlay/attack_hand(a, b, c)
if (src.master)
return src.master.attack_hand(a, b, c)
- return
\ No newline at end of file
+ return
diff --git a/code/game/dna/dna_misc.dm b/code/game/dna/dna_misc.dm
index b314852214..cdc737c007 100644
--- a/code/game/dna/dna_misc.dm
+++ b/code/game/dna/dna_misc.dm
@@ -420,7 +420,7 @@
animation.master = src
flick("h2monkey", animation)
sleep(48)
- del(animation)
+ qdel(animation)
var/mob/living/carbon/monkey/O = null
@@ -447,7 +447,7 @@
for(var/obj/T in (M.contents-implants))
- del(T)
+ qdel(T)
O.loc = M.loc
@@ -469,7 +469,7 @@
I.loc = O
I.implanted = O
// O.update_icon = 1 //queue a full icon update at next life() call
- del(M)
+ qdel(M)
return
if (!isblockon(getblock(M.dna.struc_enzymes, MONKEYBLOCK,3),MONKEYBLOCK) && !istype(M, /mob/living/carbon/human))
@@ -493,7 +493,7 @@
animation.master = src
flick("monkey2h", animation)
sleep(48)
- del(animation)
+ qdel(animation)
var/mob/living/carbon/human/O = new( src )
if(Mo.greaterform)
@@ -519,7 +519,7 @@
M.viruses -= D
//for(var/obj/T in M)
- // del(T)
+ // qdel(T)
O.loc = M.loc
@@ -553,7 +553,7 @@
I.loc = O
I.implanted = O
// O.update_icon = 1 //queue a full icon update at next life() call
- del(M)
+ qdel(M)
return
//////////////////////////////////////////////////////////// Monkey Block
if(M)
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index 86bfbeb0fe..68e1f34f88 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -144,7 +144,7 @@
return
put_in(G.affecting)
src.add_fingerprint(user)
- del(G)
+ qdel(G)
return
/obj/machinery/dna_scannernew/proc/put_in(var/mob/M)
@@ -187,7 +187,7 @@
ex_act(severity)
//Foreach goto(35)
//SN src = null
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
@@ -196,7 +196,7 @@
ex_act(severity)
//Foreach goto(108)
//SN src = null
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(25))
@@ -205,7 +205,7 @@
ex_act(severity)
//Foreach goto(181)
//SN src = null
- del(src)
+ qdel(src)
return
else
return
@@ -215,7 +215,7 @@
if(prob(75))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
- del(src)
+ qdel(src)
/obj/machinery/computer/scan_consolenew
name = "DNA Modifier Access Console"
@@ -262,12 +262,12 @@
switch(severity)
if(1.0)
//SN src = null
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
//SN src = null
- del(src)
+ qdel(src)
return
else
return
@@ -275,7 +275,7 @@
/obj/machinery/computer/scan_consolenew/blob_act()
if(prob(75))
- del(src)
+ qdel(src)
/obj/machinery/computer/scan_consolenew/power_change()
..()
diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm
index 2e0f6cdec2..7d9da10636 100644
--- a/code/game/dna/genes/monkey.dm
+++ b/code/game/dna/genes/monkey.dm
@@ -33,7 +33,7 @@
animation.master = src
flick("h2monkey", animation)
sleep(48)
- del(animation)
+ qdel(animation)
var/mob/living/carbon/monkey/O = null
@@ -60,7 +60,7 @@
for(var/obj/T in (M.contents-implants))
- del(T)
+ qdel(T)
O.loc = M.loc
@@ -82,7 +82,7 @@
I.loc = O
I.implanted = O
// O.update_icon = 1 //queue a full icon update at next life() call
- del(M)
+ qdel(M)
return
/datum/dna/gene/monkey/deactivate(var/mob/living/M, var/connected, var/flags)
@@ -108,7 +108,7 @@
animation.master = src
flick("monkey2h", animation)
sleep(48)
- del(animation)
+ qdel(animation)
var/mob/living/carbon/human/O
if(Mo.greaterform)
@@ -136,7 +136,7 @@
M.viruses -= D
//for(var/obj/T in M)
- // del(T)
+ // qdel(T)
O.loc = M.loc
@@ -171,5 +171,5 @@
I.loc = O
I.implanted = O
// O.update_icon = 1 //queue a full icon update at next life() call
- del(M)
+ qdel(M)
return
diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm
index f0a24001ba..3897d444e8 100644
--- a/code/game/gamemodes/blob/blobs/core.dm
+++ b/code/game/gamemodes/blob/blobs/core.dm
@@ -14,7 +14,7 @@
..(loc, h)
- Del()
+ Destroy()
blob_cores -= src
processing_objects.Remove(src)
..()
@@ -24,7 +24,7 @@
update_icon()
if(health <= 0)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
- del(src)
+ qdel(src)
return
return
diff --git a/code/game/gamemodes/blob/blobs/factory.dm b/code/game/gamemodes/blob/blobs/factory.dm
index bb8de8184e..c1d14d0040 100644
--- a/code/game/gamemodes/blob/blobs/factory.dm
+++ b/code/game/gamemodes/blob/blobs/factory.dm
@@ -12,7 +12,7 @@
update_icon()
if(health <= 0)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
- del(src)
+ qdel(src)
return
return
@@ -22,6 +22,11 @@
new/mob/living/simple_animal/hostile/blobspore(src.loc, src)
return 1
+/obj/effect/blob/factory/Destroy()
+ for(var/mob/living/simple_animal/hostile/blobspore/spore in spores)
+ if(spore.factory == src)
+ spore.factory = null
+ ..()
/mob/living/simple_animal/hostile/blobspore
name = "blob"
@@ -58,9 +63,10 @@
..(loc)
return
death()
- ..()
- if(factory)
- factory.spores -= src
- ..()
- del(src)
+ qdel(src)
+/mob/living/simple_animal/hostile/blobspore/Destroy()
+ if(factory)
+ factory.spores -= src
+ factory = null
+ ..()
diff --git a/code/game/gamemodes/blob/blobs/node.dm b/code/game/gamemodes/blob/blobs/node.dm
index c9ffaf96f1..92572f9a7b 100644
--- a/code/game/gamemodes/blob/blobs/node.dm
+++ b/code/game/gamemodes/blob/blobs/node.dm
@@ -14,7 +14,7 @@
..(loc, h)
- Del()
+ Destroy()
blob_nodes -= src
processing_objects.Remove(src)
..()
@@ -24,7 +24,7 @@
update_icon()
if(health <= 0)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
- del(src)
+ qdel(src)
return
return
diff --git a/code/game/gamemodes/blob/blobs/shield.dm b/code/game/gamemodes/blob/blobs/shield.dm
index 0e1b6c07eb..c47696c72e 100644
--- a/code/game/gamemodes/blob/blobs/shield.dm
+++ b/code/game/gamemodes/blob/blobs/shield.dm
@@ -14,7 +14,7 @@
update_icon()
if(health <= 0)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
- del(src)
+ qdel(src)
return
return
diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm
index f6351c8480..44486d605b 100644
--- a/code/game/gamemodes/blob/theblob.dm
+++ b/code/game/gamemodes/blob/theblob.dm
@@ -3,7 +3,7 @@
name = "blob"
icon = 'icons/mob/blob.dmi'
icon_state = "blob"
- luminosity = 3
+ light_range = 3
desc = "Some blob creature thingy"
density = 1
opacity = 0
@@ -31,7 +31,7 @@
return
- Del()
+ Destroy()
blobs -= src
..()
return
@@ -110,7 +110,7 @@
B.loc = T
else
T.blob_act()//If we cant move in hit the turf
- del(B)
+ qdel(B)
for(var/atom/A in T)//Hit everything in the turf
A.blob_act()
return 1
@@ -134,7 +134,7 @@
update_icon()//Needs to be updated with the types
if(health <= 0)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
- del(src)
+ qdel(src)
return
if(health <= 15)
icon_state = "blob_damaged"
@@ -158,7 +158,7 @@
attackby(var/obj/item/weapon/W, var/mob/user)
playsound(src.loc, 'sound/effects/attackblob.ogg', 50, 1)
- src.visible_message("\red The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]")
+ src.visible_message("The [src.name] has been attacked with \the [W][(user ? " by [user]." : ".")]")
var/damage = 0
switch(W.damtype)
if("fire")
@@ -182,7 +182,7 @@
new/obj/effect/blob/factory(src.loc,src.health)
if("Shield")
new/obj/effect/blob/shield(src.loc,src.health*2)
- del(src)
+ qdel(src)
return
//////////////////////////////****IDLE BLOB***/////////////////////////////////////
@@ -201,7 +201,7 @@
proc/update_idle()
if(health<=0)
- del(src)
+ qdel(src)
return
if(health<4)
icon_state = "blobc0"
@@ -212,7 +212,7 @@
icon_state = "blobidle0"
- Del()
+ Destroy()
var/obj/effect/blob/B = new /obj/effect/blob( src.loc )
spawn(30)
B.Life()
diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm
index 9b6ddb5160..2961950377 100644
--- a/code/game/gamemodes/changeling/changeling_powers.dm
+++ b/code/game/gamemodes/changeling/changeling_powers.dm
@@ -385,7 +385,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E
animation.master = src
flick("monkey2h", animation)
sleep(48)
- del(animation)
+ qdel(animation)
for(var/obj/item/W in src)
C.drop_from_inventory(W)
@@ -400,7 +400,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E
O.real_name = chosen_dna.real_name
for(var/obj/T in C)
- del(T)
+ qdel(T)
O.loc = C.loc
@@ -420,7 +420,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E
O.changeling_update_languages(changeling.absorbed_languages)
feedback_add_details("changeling_powers","LFT")
- del(C)
+ qdel(C)
return 1
diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm
index 185dc99ebd..b5854ed981 100644
--- a/code/game/gamemodes/cult/cult_structures.dm
+++ b/code/game/gamemodes/cult/cult_structures.dm
@@ -22,8 +22,8 @@
desc = "A floating crystal that hums with an unearthly energy"
icon_state = "pylon"
var/isbroken = 0
- luminosity = 5
- l_color = "#3e0000"
+ light_range = 5
+ light_color = "#3e0000"
var/obj/item/wepon = null
/obj/structure/cult/pylon/attack_hand(mob/M as mob)
@@ -47,7 +47,7 @@
isbroken = 1
density = 0
icon_state = "pylon-broken"
- SetLuminosity(0)
+ set_light(0)
else
user << "You hit the pylon!"
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
@@ -66,13 +66,12 @@
isbroken = 0
density = 1
icon_state = "pylon"
- SetLuminosity(5)
+ set_light(5)
/obj/structure/cult/tome
name = "Desk"
desc = "A desk covered in arcane manuscripts and tomes in unknown languages. Looking at the text makes your skin crawl"
icon_state = "tomealtar"
-// luminosity = 5
//sprites for this no longer exist -Pete
//(they were stolen from another game anyway)
@@ -105,8 +104,8 @@
return
/obj/effect/gateway/active
- luminosity=5
- l_color="#ff0000"
+ light_range=5
+ light_color="#ff0000"
spawnable=list(
/mob/living/simple_animal/hostile/scarybat,
/mob/living/simple_animal/hostile/creature,
@@ -114,8 +113,8 @@
)
/obj/effect/gateway/active/cult
- luminosity=5
- l_color="#ff0000"
+ light_range=5
+ light_color="#ff0000"
spawnable=list(
/mob/living/simple_animal/hostile/scarybat/cult,
/mob/living/simple_animal/hostile/creature/cult,
@@ -155,7 +154,7 @@
if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/Robot = M
if(Robot.mmi)
- del(Robot.mmi)
+ qdel(Robot.mmi)
else
for(var/obj/item/W in M)
if(istype(W, /obj/item/weapon/implant))
diff --git a/code/game/gamemodes/cult/cultify/mob.dm b/code/game/gamemodes/cult/cultify/mob.dm
index a7d275b177..154078de3d 100644
--- a/code/game/gamemodes/cult/cultify/mob.dm
+++ b/code/game/gamemodes/cult/cultify/mob.dm
@@ -32,18 +32,18 @@
else
dust()
-/mob/proc/see_narsie(var/obj/machinery/singularity/narsie/large/N, var/dir)
+/mob/proc/see_narsie(var/obj/singularity/narsie/large/N, var/dir)
if(N.chained)
if(narsimage)
- del(narsimage)
- del(narglow)
+ qdel(narsimage)
+ qdel(narglow)
return
if((N.z == src.z)&&(get_dist(N,src) <= (N.consume_range+10)) && !(N in view(src)))
if(!narsimage) //Create narsimage
narsimage = image('icons/obj/narsie.dmi',src.loc,"narsie",9,1)
narsimage.mouse_opacity = 0
if(!narglow) //Create narglow
- narglow = image('icons/obj/narsie.dmi',narsimage.loc,"glow-narsie",LIGHTING_LAYER+2,1)
+ narglow = image('icons/obj/narsie.dmi',narsimage.loc,"glow-narsie",12,1)
narglow.mouse_opacity = 0
//Else if no dir is given, simply send them the image of narsie
var/new_x = 32 * (N.x - src.x) + N.pixel_x
@@ -59,5 +59,5 @@
src << narglow
else
if(narsimage)
- del(narsimage)
- del(narglow)
+ qdel(narsimage)
+ qdel(narglow)
diff --git a/code/game/gamemodes/cult/cultify/obj.dm b/code/game/gamemodes/cult/cultify/obj.dm
index bc0a723869..630877eb11 100644
--- a/code/game/gamemodes/cult/cultify/obj.dm
+++ b/code/game/gamemodes/cult/cultify/obj.dm
@@ -65,8 +65,11 @@
new /obj/structure/cult/tome(loc)
qdel(src)
-/obj/machinery/door/cultify()
+/obj/machinery/door/airlock/external/cultify()
new /obj/structure/mineral_door/wood(loc)
+ ..()
+
+/obj/machinery/door/cultify()
icon_state = "null"
density = 0
c_animation = new /atom/movable/overlay(src.loc)
@@ -79,7 +82,7 @@
c_animation.icon_state = "breakdoor"
flick("cultification",c_animation)
spawn(10)
- del(c_animation)
+ qdel(c_animation)
qdel(src)
/obj/machinery/door/firedoor/cultify()
@@ -125,7 +128,7 @@
/obj/structure/mineral_door/wood/cultify()
return
-/obj/machinery/singularity/cultify()
+/obj/singularity/cultify()
var/dist = max((current_size - 2), 1)
explosion(get_turf(src), dist, dist * 2, dist * 4)
qdel(src)
diff --git a/code/game/gamemodes/cult/hell_universe.dm b/code/game/gamemodes/cult/hell_universe.dm
index 2a2499bb45..9a7344f036 100644
--- a/code/game/gamemodes/cult/hell_universe.dm
+++ b/code/game/gamemodes/cult/hell_universe.dm
@@ -40,6 +40,7 @@ In short:
// Apply changes when entering state
/datum/universal_state/hell/OnEnter()
set background = 1
+ garbage_collector.garbage_collect = 0
escape_list = get_area_turfs(locate(/area/hallway/secondary/exit))
//Separated into separate procs for profiling
@@ -53,9 +54,8 @@ In short:
runedec += 9000 //basically removing the rune cap
/datum/universal_state/hell/proc/AreaSet()
- for(var/area/ca in world)
- var/area/A = ca.master
- if(!istype(A,/area) || A.name=="Space")
+ for(var/area/A in world)
+ if(A.name=="Space")
continue
// Reset all alarms.
@@ -73,9 +73,8 @@ In short:
spess.overlays += I
/datum/universal_state/hell/proc/AmbientSet()
- for(var/turf/T in world)
- if(istype(T, /turf/space)) continue
- T.update_lumcount(1, 255, 0, 0, 0)
+ for(var/atom/movable/lighting_overlay/L in world)
+ L.update_lumcount(1, 0, 0)
/datum/universal_state/hell/proc/MiscSet()
for(var/turf/simulated/floor/T in world)
diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm
index 9f99945837..8a55a81165 100644
--- a/code/game/gamemodes/cult/ritual.dm
+++ b/code/game/gamemodes/cult/ritual.dm
@@ -74,7 +74,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
AI.client.images += blood_image
rune_list.Add(src)
- Del()
+ Destroy()
for(var/mob/living/silicon/ai/AI in player_list)
if(AI.client)
AI.client.images -= blood_image
@@ -92,11 +92,11 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa","
attackby(I as obj, user as mob)
if(istype(I, /obj/item/weapon/book/tome) && iscultist(user))
user << "You retrace your steps, carefully undoing the lines of the rune."
- del(src)
+ qdel(src)
return
else if(istype(I, /obj/item/weapon/nullrod))
user << "\blue You disrupt the vile magic with the deadening field of the null rod!"
- del(src)
+ qdel(src)
return
return
diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm
index 10d7fb7e4a..8ead4b96ba 100644
--- a/code/game/gamemodes/cult/runes.dm
+++ b/code/game/gamemodes/cult/runes.dm
@@ -24,7 +24,7 @@ var/list/sacrificed = list()
user << "\red You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric"
if (istype(user, /mob/living))
user.take_overall_damage(5, 0)
- del(src)
+ qdel(src)
if(allrunesloc && index != 0)
if(istype(src,/obj/effect/rune))
user.say("Sas[pick("'","`")]so c'arta forbici!")//Only you can stop auto-muting
@@ -61,7 +61,7 @@ var/list/sacrificed = list()
user << "\red You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric"
if (istype(user, /mob/living))
user.take_overall_damage(5, 0)
- del(src)
+ qdel(src)
for(var/mob/living/carbon/C in orange(1,src))
if(iscultist(C) && !C.stat)
culcount++
@@ -94,7 +94,7 @@ var/list/sacrificed = list()
new /obj/item/weapon/book/tome(src.loc)
else
new /obj/item/weapon/book/tome(usr.loc)
- del(src)
+ qdel(src)
return
@@ -127,6 +127,7 @@ var/list/sacrificed = list()
if(target.getFireLoss() < 100)
target.hallucination = min(target.hallucination, 500)
return 0
+
target.take_overall_damage(0, rand(5, 20)) // You dirty resister cannot handle the damage to your mind. Easily. - even cultists who accept right away should experience some effects
// Resist messages go!
if(initial_message) //don't do this stuff right away, only if they resist or hesitate.
@@ -190,7 +191,7 @@ var/list/sacrificed = list()
cultists += 1
if(cultists.len >= 9)
log_and_message_admins_many(cultists, "summoned Nar-sie.")
- new /obj/machinery/singularity/narsie/large(src.loc)
+ new /obj/singularity/narsie/large(src.loc)
return
else
return fizzle()
@@ -209,7 +210,7 @@ var/list/sacrificed = list()
T.hotspot_expose(700,125)
var/rune = src // detaching the proc - in theory
empulse(U, (range_red - 2), range_red)
- del(rune)
+ qdel(rune)
return
/////////////////////////////////////////SIXTH RUNE
@@ -369,7 +370,7 @@ var/list/sacrificed = list()
usr.say("Kla[pick("'","`")]atu barada nikt'o!")
for (var/mob/V in viewers(src))
V.show_message("\red The rune turns into gray dust, veiling the surrounding runes.", 3)
- del(src)
+ qdel(src)
else
usr.whisper("Kla[pick("'","`")]atu barada nikt'o!")
usr << "\red Your talisman turns into gray dust, veiling the surrounding runes."
@@ -417,6 +418,7 @@ var/list/sacrificed = list()
var/mob/dead/observer/ghost
for(var/mob/dead/observer/O in this_rune.loc)
if(!O.client) continue
+ if(!O.MayRespawn()) continue
if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue
ghost = O
break
@@ -545,8 +547,8 @@ var/list/sacrificed = list()
for (var/mob/V in viewers(src))
V.show_message("\red The runes turn into dust, which then forms into an arcane image on the paper.", 3)
usr.say("H'drak v[pick("'","`")]loso, mir'kanas verbot!")
- del(imbued_from)
- del(newtalisman)
+ qdel(imbued_from)
+ qdel(newtalisman)
else
return fizzle()
@@ -593,7 +595,7 @@ var/list/sacrificed = list()
for(var/datum/mind/H in cult.current_antagonists)
if (H.current)
H.current << "\red \b [input]"
- del(src)
+ qdel(src)
return 1
/////////////////////////////////////////FIFTEENTH RUNE
@@ -745,7 +747,7 @@ var/list/sacrificed = list()
usr.say("Nikt[pick("'","`")]o barada kla'atu!")
for (var/mob/V in viewers(src))
V.show_message("\red The rune turns into red dust, reveaing the surrounding runes.", 3)
- del(src)
+ qdel(src)
return
if(istype(W,/obj/item/weapon/paper/talisman))
usr.whisper("Nikt[pick("'","`")]o barada kla'atu!")
@@ -818,7 +820,7 @@ var/list/sacrificed = list()
for(var/mob/living/carbon/C in users)
user.take_overall_damage(dam, 0)
C.say("Khari[pick("'","`")]d! Gual'te nikka!")
- del(src)
+ qdel(src)
return fizzle()
/////////////////////////////////////////NINETEENTH RUNE
@@ -858,7 +860,7 @@ var/list/sacrificed = list()
user.visible_message("\red Rune disappears with a flash of red light, and in its place now a body lies.", \
"\red You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a body.", \
"\red You hear a pop and smell ozone.")
- del(src)
+ qdel(src)
return fizzle()
/////////////////////////////////////////TWENTIETH RUNES
@@ -881,7 +883,7 @@ var/list/sacrificed = list()
usr.say("Sti[pick("'","`")] kaliedir!")
usr << "\red The world becomes quiet as the deafening rune dissipates into fine dust."
admin_attacker_log_many_victims(usr, affected, "Used a deafen rune.", "Was victim of a deafen rune.", "used a deafen rune on")
- del(src)
+ qdel(src)
else
return fizzle()
else
@@ -926,7 +928,7 @@ var/list/sacrificed = list()
usr.say("Sti[pick("'","`")] kaliesin!")
usr << "\red The rune flashes, blinding those who not follow the Nar-Sie, and dissipates into fine dust."
admin_attacker_log_many_victims(usr, affected, "Used a blindness rune.", "Was victim of a blindness rune.", "used a blindness rune on")
- del(src)
+ qdel(src)
else
return fizzle()
else
@@ -984,7 +986,7 @@ var/list/sacrificed = list()
C.take_overall_damage(15, 0)
admin_attacker_log_many_victims(usr, victims, "Used a blood boil rune.", "Was the victim of a blood boil rune.", "used a blood boil rune on")
log_and_message_admins_many(cultists - usr, "assisted activating a blood boil rune.")
- del(src)
+ qdel(src)
else
return fizzle()
return
@@ -1014,8 +1016,8 @@ var/list/sacrificed = list()
M << "\red Blood suddenly ignites, burning you!"
var/turf/T = get_turf(B)
T.hotspot_expose(700,125)
- del(B)
- del(src)
+ qdel(B)
+ qdel(src)
////////// Rune 24 (counting burningblood, which kinda doesnt work yet.)
@@ -1038,7 +1040,7 @@ var/list/sacrificed = list()
S.Weaken(5)
S.show_message("\red BZZZT... The rune has exploded in a bright flash.", 3)
admin_attack_log(usr, S, "Used a stun rune.", "Was victim of a stun rune.", "used a stun rune on")
- del(src)
+ qdel(src)
else ///When invoked as talisman, stun and mute the target mob.
usr.say("Dream sign ''Evil sealing talisman'[pick("'","`")]!")
var/obj/item/weapon/nullrod/N = locate() in T
@@ -1081,5 +1083,5 @@ var/list/sacrificed = list()
//the below calls update_icons() at the end, which will update overlay icons by using the (now updated) cache
user.put_in_hands(new /obj/item/weapon/melee/cultblade(user)) //put in hands or on floor
- del(src)
+ qdel(src)
return
diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm
index df5b9a4965..d2b881d891 100644
--- a/code/game/gamemodes/cult/talisman.dm
+++ b/code/game/gamemodes/cult/talisman.dm
@@ -35,7 +35,7 @@
user.take_organ_damage(5, 0)
if(src && src.imbue!="supply" && src.imbue!="runestun")
if(delete)
- del(src)
+ qdel(src)
return
else
user << "You see strange symbols on the paper. Are they supposed to mean something?"
@@ -47,7 +47,7 @@
if(imbue == "runestun")
user.take_organ_damage(5, 0)
call(/obj/effect/rune/proc/runestun)(T)
- del(src)
+ qdel(src)
else
..() ///If its some other talisman, use the generic attack code, is this supposed to work this way?
else
@@ -56,7 +56,7 @@
proc/supply(var/key)
if (!src.uses)
- del(src)
+ qdel(src)
return
var/dat = "There are [src.uses] bloody runes on the parchment.
"
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
index 139045291f..d71ff249d1 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm
@@ -8,7 +8,7 @@
//luminosity = 5
//l_color="#0066FF"
- layer = LIGHTING_LAYER+1
+ layer = 11
var/spawned=0 // DIR mask
var/next_check=0
@@ -49,7 +49,8 @@
for(var/atom/movable/A in T)
if(A)
if(istype(A,/mob/living))
- del(A)
+ qdel(A)
+ continue
else if(istype(A,/mob)) // Observers, AI cameras.
continue
qdel(A)
@@ -114,4 +115,4 @@
if(istype(user,/mob/dead/observer))
return
- del(user)
+ qdel(user)
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm
index 9d3f12b021..8c826fe22d 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/portal.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/portal.dm
@@ -1,6 +1,6 @@
/*** EXIT PORTAL ***/
-/obj/machinery/singularity/narsie/large/exit
+/obj/singularity/narsie/large/exit
name = "Bluespace Rift"
desc = "NO TIME TO EXPLAIN, JUMP IN"
icon = 'icons/obj/rift.dmi'
@@ -10,27 +10,27 @@
announce=0
narnar=0
- layer=LIGHTING_LAYER+2 // ITS SO BRIGHT
+ layer=12 // ITS SO BRIGHT
consume_range = 6
-/obj/machinery/singularity/narsie/large/exit/New()
+/obj/singularity/narsie/large/exit/New()
..()
processing_objects.Add(src)
-/obj/machinery/singularity/narsie/large/exit/update_icon()
+/obj/singularity/narsie/large/exit/update_icon()
overlays = 0
-/obj/machinery/singularity/narsie/large/exit/process()
+/obj/singularity/narsie/large/exit/process()
for(var/mob/M in player_list)
if(M.client)
M.see_rift(src)
eat()
-/obj/machinery/singularity/narsie/large/exit/acquire(var/mob/food)
+/obj/singularity/narsie/large/exit/acquire(var/mob/food)
return
-/obj/machinery/singularity/narsie/large/exit/consume(const/atom/A)
+/obj/singularity/narsie/large/exit/consume(const/atom/A)
if(!(A.singuloCanEat()))
return 0
@@ -62,10 +62,10 @@
//thou shall always be able to see the rift
var/image/riftimage = null
-/mob/proc/see_rift(var/obj/machinery/singularity/narsie/large/exit/R)
+/mob/proc/see_rift(var/obj/singularity/narsie/large/exit/R)
if((R.z == src.z) && (get_dist(R,src) <= (R.consume_range+10)) && !(R in view(src)))
if(!riftimage)
- riftimage = image('icons/obj/rift.dmi',src.loc,"rift",LIGHTING_LAYER+2,1)
+ riftimage = image('icons/obj/rift.dmi',src.loc,"rift",12,1)
riftimage.mouse_opacity = 0
var/new_x = 32 * (R.x - src.x) + R.pixel_x
@@ -78,4 +78,4 @@
else
if(riftimage)
- del(riftimage)
+ qdel(riftimage)
diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
index 1b5ceb87e8..37b68340a8 100644
--- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
+++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm
@@ -33,6 +33,7 @@
// Apply changes when entering state
/datum/universal_state/supermatter_cascade/OnEnter()
set background = 1
+ garbage_collector.garbage_collect = 0
world << "You are blinded by a brilliant flash of energy."
world << sound('sound/effects/cascade.ogg')
@@ -54,7 +55,7 @@
cult.allow_narsie = 0
PlayerSet()
- new /obj/machinery/singularity/narsie/large/exit(pick(endgame_exits))
+ new /obj/singularity/narsie/large/exit(pick(endgame_exits))
spawn(rand(30,60) SECONDS)
var/txt = {"
There's been a galaxy-wide electromagnetic pulse. All of our systems are heavily damaged and many personnel are dead or dying. We are seeing increasing indications of the universe itself beginning to unravel.
@@ -82,11 +83,10 @@ AUTOMATED ALERT: Link to [command_name()] lost."}
return
/datum/universal_state/supermatter_cascade/proc/AreaSet()
- for(var/area/ca in world)
- var/area/A=ca.master
+ for(var/area/A in world)
if(A.z in config.admin_levels)
continue
- if(!istype(A,/area) || istype(A,/area/space))
+ if(istype(A,/area/space))
continue
// Reset all alarms.
@@ -110,10 +110,9 @@ AUTOMATED ALERT: Link to [command_name()] lost."}
spess.overlays += "end01"
/datum/universal_state/supermatter_cascade/proc/AmbientSet()
- for(var/turf/T in world)
- if(istype(T, /turf/space)) continue
- if(!(T.z in config.admin_levels))
- T.update_lumcount(1, 160, 255, 0, 0)
+ for(var/atom/movable/lighting_overlay/L in world)
+ if(!(L.z in config.admin_levels))
+ L.update_lumcount(0.5, 1, 0)
/datum/universal_state/supermatter_cascade/proc/MiscSet()
for (var/obj/machinery/firealarm/alm in world)
diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm
index feed6092e2..d49247263f 100644
--- a/code/game/gamemodes/events.dm
+++ b/code/game/gamemodes/events.dm
@@ -49,7 +49,7 @@
var/turf/T = pick(blobstart)
var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 )
spawn(rand(50, 300))
- del(bh)
+ qdel(bh)
/*
if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
@@ -71,7 +71,7 @@
P.icon_state = "anom"
P.name = "wormhole"
spawn(rand(300,600))
- del(P)
+ qdel(P)
*/
if(3)
if((world.time/10)>=3600 && config.ninjas_allowed && !sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round.
diff --git a/code/game/gamemodes/events/PortalStorm.dm b/code/game/gamemodes/events/PortalStorm.dm
index 890755d6b8..6144f3305b 100644
--- a/code/game/gamemodes/events/PortalStorm.dm
+++ b/code/game/gamemodes/events/PortalStorm.dm
@@ -1,26 +1,26 @@
-/datum/event/portalstorm
-
- Announce()
- command_alert("Subspace disruption detected around the vessel", "Anomaly Alert")
- LongTerm()
-
- var/list/turfs = list( )
- var/turf/picked
-
- for(var/turf/T in world)
- if(T.z < 5 && istype(T,/turf/simulated/floor))
- turfs += T
-
- for(var/turf/T in world)
- if(prob(10) && T.z < 5 && istype(T,/turf/simulated/floor))
- spawn(50+rand(0,3000))
- picked = pick(turfs)
- var/obj/portal/P = new /obj/portal( T )
- P.target = picked
- P.creator = null
- P.icon = 'icons/obj/objects.dmi'
- P.failchance = 0
- P.icon_state = "anom"
- P.name = "wormhole"
- spawn(rand(100,150))
- del(P)
\ No newline at end of file
+/datum/event/portalstorm
+
+ Announce()
+ command_alert("Subspace disruption detected around the vessel", "Anomaly Alert")
+ LongTerm()
+
+ var/list/turfs = list( )
+ var/turf/picked
+
+ for(var/turf/T in world)
+ if(T.z < 5 && istype(T,/turf/simulated/floor))
+ turfs += T
+
+ for(var/turf/T in world)
+ if(prob(10) && T.z < 5 && istype(T,/turf/simulated/floor))
+ spawn(50+rand(0,3000))
+ picked = pick(turfs)
+ var/obj/portal/P = new /obj/portal( T )
+ P.target = picked
+ P.creator = null
+ P.icon = 'icons/obj/objects.dmi'
+ P.failchance = 0
+ P.icon_state = "anom"
+ P.name = "wormhole"
+ spawn(rand(100,150))
+ qdel(P)
diff --git a/code/game/gamemodes/events/black_hole.dm b/code/game/gamemodes/events/black_hole.dm
index 6ff7babbeb..60ab8a692f 100644
--- a/code/game/gamemodes/events/black_hole.dm
+++ b/code/game/gamemodes/events/black_hole.dm
@@ -1,88 +1,88 @@
-/obj/effect/bhole
- name = "black hole"
- icon = 'icons/obj/objects.dmi'
- desc = "FUCK FUCK FUCK AAAHHH"
- icon_state = "bhole3"
- opacity = 1
- unacidable = 1
- density = 0
- anchored = 1
-
-/obj/effect/bhole/New()
- spawn(4)
- controller()
-
-/obj/effect/bhole/proc/controller()
- while(src)
-
- if(!isturf(loc))
- del(src)
- return
-
- //DESTROYING STUFF AT THE EPICENTER
- for(var/mob/living/M in orange(1,src))
- del(M)
- for(var/obj/O in orange(1,src))
- del(O)
- for(var/turf/simulated/ST in orange(1,src))
- ST.ChangeTurf(/turf/space)
-
- sleep(6)
- grav(10, 4, 10, 0 )
- sleep(6)
- grav( 8, 4, 10, 0 )
- sleep(6)
- grav( 9, 4, 10, 0 )
- sleep(6)
- grav( 7, 3, 40, 1 )
- sleep(6)
- grav( 5, 3, 40, 1 )
- sleep(6)
- grav( 6, 3, 40, 1 )
- sleep(6)
- grav( 4, 2, 50, 6 )
- sleep(6)
- grav( 3, 2, 50, 6 )
- sleep(6)
- grav( 2, 2, 75,25 )
- sleep(6)
-
-
-
- //MOVEMENT
- if( prob(50) )
- src.anchored = 0
- step(src,pick(alldirs))
- src.anchored = 1
-
-/obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
- if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen
- del(src)
- return
- for(var/t = -r, t < r, t++)
- affect_coord(x+t, y-r, ex_act_force, pull_chance, turf_removal_chance)
- affect_coord(x-t, y+r, ex_act_force, pull_chance, turf_removal_chance)
- affect_coord(x+r, y+t, ex_act_force, pull_chance, turf_removal_chance)
- affect_coord(x-r, y-t, ex_act_force, pull_chance, turf_removal_chance)
- return
-
-/obj/effect/bhole/proc/affect_coord(var/x, var/y, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
- //Get turf at coordinate
- var/turf/T = locate(x, y, z)
- if(isnull(T)) return
-
- //Pulling and/or ex_act-ing movable atoms in that turf
- if( prob(pull_chance) )
- for(var/obj/O in T.contents)
- if(O.anchored)
- O.ex_act(ex_act_force)
- else
- step_towards(O,src)
- for(var/mob/living/M in T.contents)
- step_towards(M,src)
-
- //Destroying the turf
- if( T && istype(T,/turf/simulated) && prob(turf_removal_chance) )
- var/turf/simulated/ST = T
- ST.ChangeTurf(/turf/space)
+/obj/effect/bhole
+ name = "black hole"
+ icon = 'icons/obj/objects.dmi'
+ desc = "FUCK FUCK FUCK AAAHHH"
+ icon_state = "bhole3"
+ opacity = 1
+ unacidable = 1
+ density = 0
+ anchored = 1
+
+/obj/effect/bhole/New()
+ spawn(4)
+ controller()
+
+/obj/effect/bhole/proc/controller()
+ while(src)
+
+ if(!isturf(loc))
+ qdel(src)
+ return
+
+ //DESTROYING STUFF AT THE EPICENTER
+ for(var/mob/living/M in orange(1,src))
+ qdel(M)
+ for(var/obj/O in orange(1,src))
+ qdel(O)
+ for(var/turf/simulated/ST in orange(1,src))
+ ST.ChangeTurf(/turf/space)
+
+ sleep(6)
+ grav(10, 4, 10, 0 )
+ sleep(6)
+ grav( 8, 4, 10, 0 )
+ sleep(6)
+ grav( 9, 4, 10, 0 )
+ sleep(6)
+ grav( 7, 3, 40, 1 )
+ sleep(6)
+ grav( 5, 3, 40, 1 )
+ sleep(6)
+ grav( 6, 3, 40, 1 )
+ sleep(6)
+ grav( 4, 2, 50, 6 )
+ sleep(6)
+ grav( 3, 2, 50, 6 )
+ sleep(6)
+ grav( 2, 2, 75,25 )
+ sleep(6)
+
+
+
+ //MOVEMENT
+ if( prob(50) )
+ src.anchored = 0
+ step(src,pick(alldirs))
+ src.anchored = 1
+
+/obj/effect/bhole/proc/grav(var/r, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
+ if(!isturf(loc)) //blackhole cannot be contained inside anything. Weird stuff might happen
+ qdel(src)
+ return
+ for(var/t = -r, t < r, t++)
+ affect_coord(x+t, y-r, ex_act_force, pull_chance, turf_removal_chance)
+ affect_coord(x-t, y+r, ex_act_force, pull_chance, turf_removal_chance)
+ affect_coord(x+r, y+t, ex_act_force, pull_chance, turf_removal_chance)
+ affect_coord(x-r, y-t, ex_act_force, pull_chance, turf_removal_chance)
+ return
+
+/obj/effect/bhole/proc/affect_coord(var/x, var/y, var/ex_act_force, var/pull_chance, var/turf_removal_chance)
+ //Get turf at coordinate
+ var/turf/T = locate(x, y, z)
+ if(isnull(T)) return
+
+ //Pulling and/or ex_act-ing movable atoms in that turf
+ if( prob(pull_chance) )
+ for(var/obj/O in T.contents)
+ if(O.anchored)
+ O.ex_act(ex_act_force)
+ else
+ step_towards(O,src)
+ for(var/mob/living/M in T.contents)
+ step_towards(M,src)
+
+ //Destroying the turf
+ if( T && istype(T,/turf/simulated) && prob(turf_removal_chance) )
+ var/turf/simulated/ST = T
+ ST.ChangeTurf(/turf/space)
return
\ No newline at end of file
diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm
index 7f4f6f7020..74fb9ee507 100644
--- a/code/game/gamemodes/events/clang.dm
+++ b/code/game/gamemodes/events/clang.dm
@@ -36,7 +36,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
if(clong.density || prob(10))
clong.meteorhit(src)
else
- del(src)
+ qdel(src)
if(clong && prob(25))
src.loc = clong.loc
@@ -81,7 +81,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
if (isNotStationLevel(immrod.z))
immrod.z = pick(config.station_levels)
if(immrod.loc == end)
- del(immrod)
+ qdel(immrod)
sleep(10)
for(var/obj/effect/immovablerod/imm in world)
return
diff --git a/code/game/gamemodes/events/dust.dm b/code/game/gamemodes/events/dust.dm
index 2e8b3b1328..4e064d8be6 100644
--- a/code/game/gamemodes/events/dust.dm
+++ b/code/game/gamemodes/events/dust.dm
@@ -37,7 +37,7 @@ The "dust" will damage the hull of the station causin minor hull breaches.
density = 1
anchored = 1
var/strength = 2 //ex_act severity number
- var/life = 2 //how many things we hit before del(src)
+ var/life = 2 //how many things we hit before qdel(src)
weak
strength = 3
@@ -107,8 +107,7 @@ The "dust" will damage the hull of the station causin minor hull breaches.
life--
if(life <= 0)
walk(src,0)
- spawn(1)
- del(src)
+ qdel(src)
return 0
return
@@ -119,5 +118,5 @@ The "dust" will damage the hull of the station causin minor hull breaches.
ex_act(severity)
- del(src)
+ qdel(src)
return
diff --git a/code/game/gamemodes/events/holidays/Christmas.dm b/code/game/gamemodes/events/holidays/Christmas.dm
index 7ca6678902..9c68ab879e 100644
--- a/code/game/gamemodes/events/holidays/Christmas.dm
+++ b/code/game/gamemodes/events/holidays/Christmas.dm
@@ -14,7 +14,7 @@
evil_tree.icon_living = evil_tree.icon_state
evil_tree.icon_dead = evil_tree.icon_state
evil_tree.icon_gib = evil_tree.icon_state
- del(xmas)
+ qdel(xmas)
/obj/item/weapon/toy/xmas_cracker
name = "xmas cracker"
diff --git a/code/game/gamemodes/events/wormholes.dm b/code/game/gamemodes/events/wormholes.dm
index 9a8066887b..a7830a2cb3 100644
--- a/code/game/gamemodes/events/wormholes.dm
+++ b/code/game/gamemodes/events/wormholes.dm
@@ -59,4 +59,4 @@
P.icon_state = "anom"
P.name = "wormhole"
spawn(rand(300,600))
- del(P)
\ No newline at end of file
+ qdel(P)
\ No newline at end of file
diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm
index 8ad65194d1..41183aeffa 100644
--- a/code/game/gamemodes/gameticker.dm
+++ b/code/game/gamemodes/gameticker.dm
@@ -1,11 +1,5 @@
var/global/datum/controller/gameticker/ticker
-#define GAME_STATE_PREGAME 1
-#define GAME_STATE_SETTING_UP 2
-#define GAME_STATE_PLAYING 3
-#define GAME_STATE_FINISHED 4
-
-
/datum/controller/gameticker
var/const/restart_timeout = 600
var/current_state = GAME_STATE_PREGAME
@@ -135,7 +129,7 @@ var/global/datum/controller/gameticker/ticker
for(var/obj/effect/landmark/start/S in landmarks_list)
//Deleting Startpoints but we need the ai point to AI-ize people later
if (S.name != "AI")
- del(S)
+ qdel(S)
world << "Enjoy the game!"
world << sound('sound/AI/welcome.ogg') // Skie
//Holiday Round-start stuff ~Carn
@@ -265,8 +259,8 @@ var/global/datum/controller/gameticker/ticker
//Otherwise if its a verb it will continue on afterwards.
sleep(300)
- if(cinematic) del(cinematic) //end the cinematic
- if(temp_buckle) del(temp_buckle) //release everybody
+ if(cinematic) qdel(cinematic) //end the cinematic
+ if(temp_buckle) qdel(temp_buckle) //release everybody
return
@@ -280,7 +274,7 @@ var/global/datum/controller/gameticker/ticker
continue
else
player.create_character()
- del(player)
+ qdel(player)
proc/collect_minds()
@@ -424,7 +418,7 @@ var/global/datum/controller/gameticker/ticker
robo.laws.show_laws(world)
if(dronecount)
- world << "There [dronecount>1 ? "were" : "was"] [dronecount] industrious maintenance [dronecount>1 ? "drones" : "drone"] at the end of this round."
+ world << "There [dronecount>1 ? "were" : "was"] [dronecount] industrious maintenance [dronecount>1 ? "drones" : "drone"] at the end of this round."
mode.declare_completion()//To declare normal completion.
diff --git a/code/game/gamemodes/heist/heist.dm b/code/game/gamemodes/heist/heist.dm
index f1de61f286..7e1ba6d368 100644
--- a/code/game/gamemodes/heist/heist.dm
+++ b/code/game/gamemodes/heist/heist.dm
@@ -26,6 +26,6 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind'
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.
- del(M)
+ qdel(M)
for (var/obj/O in skipjack.contents)
- del(O) //no hiding in lockers or anything
\ No newline at end of file
+ qdel(O) //no hiding in lockers or anything
\ No newline at end of file
diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm
index c523b469f3..850529661c 100644
--- a/code/game/gamemodes/malfunction/Malf_Modules.dm
+++ b/code/game/gamemodes/malfunction/Malf_Modules.dm
@@ -89,7 +89,7 @@ rcd light flash thingy on matter drain
V.show_message("\blue You hear a loud electrical buzzing sound!", 2)
spawn(50)
explosion(get_turf(M), 0,1,2,3)
- del(M)
+ qdel(M)
else usr << "Out of uses."
else usr << "That's not a machine."
diff --git a/code/game/gamemodes/meme/meme.dm b/code/game/gamemodes/meme/meme.dm
index 2629b36013..2aa512264d 100644
--- a/code/game/gamemodes/meme/meme.dm
+++ b/code/game/gamemodes/meme/meme.dm
@@ -93,7 +93,7 @@
M.enter_host(first_host.current)
forge_meme_objectives(meme, first_host)
- del original
+ qdel(original)
log_admin("Created [memes.len] memes.")
diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm
index 1edb533daa..9d18216aa5 100644
--- a/code/game/gamemodes/meteor/meteors.dm
+++ b/code/game/gamemodes/meteor/meteors.dm
@@ -97,6 +97,10 @@
pass_flags = PASSTABLE | PASSGRILLE
power = 2
+/obj/effect/meteor/Destroy()
+ walk(src,0) //this cancels the walk_towards() proc
+ ..()
+
/obj/effect/meteor/Bump(atom/A)
spawn(0)
@@ -111,14 +115,14 @@
!istype(A,/obj/machinery/field_generator) && \
prob(detonation_chance))
explosion(loc, power, power + power_step, power + power_step * 2, power + power_step * 3, 0)
- del(src)
+ qdel(src)
return
/obj/effect/meteor/ex_act(severity)
if (severity < 4)
- del(src)
+ qdel(src)
return
/obj/effect/meteor/big
@@ -136,7 +140,7 @@
if(!istype(A,/obj/machinery/power/emitter) && \
!istype(A,/obj/machinery/field_generator))
if(--src.hits <= 0)
- del(src) //Dont blow up singularity containment if we get stuck there.
+ qdel(src) //Dont blow up singularity containment if we get stuck there.
if (A)
for(var/mob/M in player_list)
@@ -150,11 +154,11 @@
if (--src.hits <= 0)
if(prob(detonation_chance) && !istype(A, /obj/structure/grille))
explosion(loc, power, power + power_step, power + power_step * 2, power + power_step * 3, 0)
- del(src)
+ qdel(src)
return
/obj/effect/meteor/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/pickaxe))
- del(src)
+ qdel(src)
return
- ..()
\ No newline at end of file
+ ..()
diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm
index d26f1a0789..530b9b9567 100644
--- a/code/game/gamemodes/nuclear/pinpointer.dm
+++ b/code/game/gamemodes/nuclear/pinpointer.dm
@@ -8,7 +8,7 @@
item_state = "electronic"
throw_speed = 4
throw_range = 20
- matter = list("metal" = 500)
+ matter = list(DEFAULT_WALL_MATERIAL = 500)
var/obj/item/weapon/disk/nuclear/the_disk = null
var/active = 0
@@ -48,6 +48,9 @@
if(bomb.timing)
user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
+/obj/item/weapon/pinpointer/Destroy()
+ active = 0
+ ..()
/obj/item/weapon/pinpointer/advpinpointer
name = "Advanced Pinpointer"
diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm
index 27236dd8fb..d13f90d2be 100644
--- a/code/game/gamemodes/objective.dm
+++ b/code/game/gamemodes/objective.dm
@@ -13,7 +13,7 @@ datum/objective
if(text)
explanation_text = text
- Del()
+ Destroy()
all_objectives -= src
..()
@@ -541,7 +541,7 @@ datum/objective/steal
if (!custom_target) return
var/tmp_obj = new custom_target
var/custom_name = tmp_obj:name
- del(tmp_obj)
+ qdel(tmp_obj)
custom_name = sanitize(input("Enter target name:", "Objective target", custom_name) as text|null)
if (!custom_name) return
target_name = custom_name
@@ -798,7 +798,7 @@ datum/objective/heist/salvage
choose_target()
switch(rand(1,8))
if(1)
- target = "metal"
+ target = DEFAULT_WALL_MATERIAL
target_amount = 300
if(2)
target = "glass"
@@ -916,7 +916,7 @@ datum/objective/heist/salvage
explanation_text = "Summon Nar-Sie via the use of the appropriate rune (Hell join self). It will only work if nine cultists stand on and around it. The convert rune is join blood self."
/datum/objective/cult/eldergod/check_completion()
- return (locate(/obj/machinery/singularity/narsie/large) in machines)
+ return (locate(/obj/singularity/narsie/large) in machines)
/datum/objective/cult/sacrifice
explanation_text = "Conduct a ritual sacrifice for the glory of Nar-Sie."
diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm
index 439befdc63..ad2abb2236 100644
--- a/code/game/gamemodes/sandbox/h_sandbox.dm
+++ b/code/game/gamemodes/sandbox/h_sandbox.dm
@@ -120,7 +120,7 @@ datum/hSB
if("hsbtoolbox")
var/obj/item/weapon/storage/hsb = new/obj/item/weapon/storage/toolbox/mechanical
for(var/obj/item/device/radio/T in hsb)
- del(T)
+ qdel(T)
new/obj/item/weapon/crowbar (hsb)
hsb.loc = usr.loc
if("hsbmedkit")
diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm
index 501335a19f..2981596645 100644
--- a/code/game/gamemodes/setupgame.dm
+++ b/code/game/gamemodes/setupgame.dm
@@ -151,7 +151,7 @@
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
- del(A)
+ qdel(A)
continue
if (A.name == "Corpse-Engineer")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
@@ -173,7 +173,7 @@
else
if (prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head)
- del(A)
+ qdel(A)
continue
if (A.name == "Corpse-Engineer-Space")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
@@ -196,7 +196,7 @@
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head)
else
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space(M), slot_head)
- del(A)
+ qdel(A)
continue
if (A.name == "Corpse-Engineer-Chief")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
@@ -217,7 +217,7 @@
else
if (prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head)
- del(A)
+ qdel(A)
continue
if (A.name == "Corpse-Syndicate")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
@@ -239,6 +239,6 @@
else
M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(M), slot_head)
- del(A)
+ qdel(A)
continue
*/
diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm
index 062571655d..088e3841fd 100644
--- a/code/game/jobs/job/civilian.dm
+++ b/code/game/jobs/job/civilian.dm
@@ -231,7 +231,7 @@
H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/bikehorn(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/stamp/clown(H), slot_in_backpack)
- H.equip_to_slot_or_del(new /obj/item/toy/crayon/rainbow(H), slot_in_backpack)
+ H.equip_to_slot_or_del(new /obj/item/weapon/pen/crayon/rainbow(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/fancy/crayons(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/toy/waterflower(H), slot_in_backpack)
H.mutations.Add(CLUMSY)
@@ -265,11 +265,11 @@
H.equip_to_slot_or_del(new /obj/item/clothing/suit/suspenders(H), slot_wear_suit)
if(H.backbag == 1)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
- H.equip_to_slot_or_del(new /obj/item/toy/crayon/mime(H), slot_l_store)
+ H.equip_to_slot_or_del(new /obj/item/weapon/pen/crayon/mime(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_l_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
- H.equip_to_slot_or_del(new /obj/item/toy/crayon/mime(H), slot_in_backpack)
+ H.equip_to_slot_or_del(new /obj/item/weapon/pen/crayon/mime(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_in_backpack)
H.verbs += /client/proc/mimespeak
H.verbs += /client/proc/mimewall
diff --git a/code/game/jobs/jobprocs.dm b/code/game/jobs/jobprocs.dm
index 60b8c6a99d..2a012872bf 100644
--- a/code/game/jobs/jobprocs.dm
+++ b/code/game/jobs/jobprocs.dm
@@ -44,7 +44,7 @@
timeleft -= (world.time - last_process)
if(timeleft <= 0)
processing_objects.Remove(src)
- del(src)
+ qdel(src)
///////////////////////////////
diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm
index 37cc168d57..19399ce739 100644
--- a/code/game/machinery/Beacon.dm
+++ b/code/game/machinery/Beacon.dm
@@ -1,55 +1,55 @@
-/obj/machinery/bluespace_beacon
-
- icon = 'icons/obj/objects.dmi'
- icon_state = "floor_beaconf"
- name = "Bluespace Gigabeacon"
- desc = "A device that draws power from bluespace and creates a permanent tracking beacon."
- level = 1 // underfloor
- layer = 2.5
- anchored = 1
- use_power = 1
- idle_power_usage = 0
- var/obj/item/device/radio/beacon/Beacon
-
- New()
- ..()
- var/turf/T = loc
- Beacon = new /obj/item/device/radio/beacon
- Beacon.invisibility = INVISIBILITY_MAXIMUM
- Beacon.loc = T
-
- hide(T.intact)
-
- Del()
- if(Beacon)
- del(Beacon)
- ..()
-
- // update the invisibility and icon
- hide(var/intact)
- invisibility = intact ? 101 : 0
- updateicon()
-
- // update the icon_state
- proc/updateicon()
- var/state="floor_beacon"
-
- if(invisibility)
- icon_state = "[state]f"
-
- else
- icon_state = "[state]"
-
- process()
- if(!Beacon)
- var/turf/T = loc
- Beacon = new /obj/item/device/radio/beacon
- Beacon.invisibility = INVISIBILITY_MAXIMUM
- Beacon.loc = T
- if(Beacon)
- if(Beacon.loc != loc)
- Beacon.loc = loc
-
- updateicon()
-
-
+/obj/machinery/bluespace_beacon
+
+ icon = 'icons/obj/objects.dmi'
+ icon_state = "floor_beaconf"
+ name = "Bluespace Gigabeacon"
+ desc = "A device that draws power from bluespace and creates a permanent tracking beacon."
+ level = 1 // underfloor
+ layer = 2.5
+ anchored = 1
+ use_power = 1
+ idle_power_usage = 0
+ var/obj/item/device/radio/beacon/Beacon
+
+ New()
+ ..()
+ var/turf/T = loc
+ Beacon = new /obj/item/device/radio/beacon
+ Beacon.invisibility = INVISIBILITY_MAXIMUM
+ Beacon.loc = T
+
+ hide(T.intact)
+
+ Destroy()
+ if(Beacon)
+ qdel(Beacon)
+ ..()
+
+ // update the invisibility and icon
+ hide(var/intact)
+ invisibility = intact ? 101 : 0
+ updateicon()
+
+ // update the icon_state
+ proc/updateicon()
+ var/state="floor_beacon"
+
+ if(invisibility)
+ icon_state = "[state]f"
+
+ else
+ icon_state = "[state]"
+
+ process()
+ if(!Beacon)
+ var/turf/T = loc
+ Beacon = new /obj/item/device/radio/beacon
+ Beacon.invisibility = INVISIBILITY_MAXIMUM
+ Beacon.loc = T
+ if(Beacon)
+ if(Beacon.loc != loc)
+ Beacon.loc = loc
+
+ updateicon()
+
+
diff --git a/code/game/machinery/CableLayer.dm b/code/game/machinery/CableLayer.dm
new file mode 100644
index 0000000000..9bad67df7d
--- /dev/null
+++ b/code/game/machinery/CableLayer.dm
@@ -0,0 +1,126 @@
+/obj/machinery/cablelayer
+ name = "automatic cable layer"
+
+ icon = 'icons/obj/stationobjs.dmi'
+ icon_state = "pipe_d"
+ density = 1
+ var/obj/structure/cable/last_piece
+ var/obj/item/stack/cable_coil/cable
+ var/max_cable = 100
+ var/on = 0
+
+/obj/machinery/cablelayer/New()
+ cable = new(src)
+ cable.amount = 100
+ ..()
+
+/obj/machinery/cablelayer/Move(new_turf,M_Dir)
+ ..()
+ layCable(new_turf,M_Dir)
+
+/obj/machinery/cablelayer/attack_hand(mob/user as mob)
+ if(!cable&&!on)
+ user << "\The [src] don't work with no cable."
+ return
+ on=!on
+ user.visible_message("\The [src] [!on?"dea":"a"]ctivated.", "[user] [!on?"dea":"a"]ctivated \the [src].")
+ return
+
+/obj/machinery/cablelayer/attackby(var/obj/item/O as obj, var/mob/user as mob)
+ if(istype(O, /obj/item/stack/cable_coil))
+
+ var/result = load_cable(O)
+ if(!result)
+ user << "Reel is full."
+ else
+ user << "[result] meters of cable successfully loaded."
+ return
+
+ if(istype(O, /obj/item/weapon/screwdriver))
+ if(cable && cable.amount)
+ var/m = round(input(usr,"Please specify the length of cable to cut","Cut cable",min(cable.amount,30)) as num, 1)
+ m = min(m, cable.amount)
+ m = min(m, 30)
+ if(m)
+ use_cable(m)
+ var/obj/item/stack/cable_coil/CC = new (get_turf(src))
+ CC.amount = m
+ else
+ usr << "There's no more cable on the reel."
+
+/obj/machinery/cablelayer/examine(mob/user)
+ ..()
+ user << "\The [src] has [cable.amount] meter\s."
+
+/obj/machinery/cablelayer/proc/load_cable(var/obj/item/stack/cable_coil/CC)
+ if(istype(CC) && CC.amount)
+ var/cur_amount = cable? cable.amount : 0
+ var/to_load = max(max_cable - cur_amount,0)
+ if(to_load)
+ to_load = min(CC.amount, to_load)
+ if(!cable)
+ cable = new(src)
+ cable.amount = 0
+ cable.amount += to_load
+ CC.use(to_load)
+ return to_load
+ else
+ return 0
+ return
+
+/obj/machinery/cablelayer/proc/use_cable(amount)
+ if(!cable || cable.amount<1)
+ visible_message("Cable depleted, [src] deactivated.")
+ return
+/* if(cable.amount < amount)
+ visible_message("No enough cable to finish the task.")
+ return*/
+ cable.use(amount)
+ return 1
+
+/obj/machinery/cablelayer/proc/reset()
+ last_piece = null
+
+/obj/machinery/cablelayer/proc/dismantleFloor(var/turf/new_turf)
+ if(istype(new_turf, /turf/simulated/floor))
+ var/turf/simulated/floor/T = new_turf
+ if(!T.is_plating())
+ if(!T.broken && !T.burnt)
+ new T.floor_type(T)
+ T.make_plating()
+ return !new_turf.intact
+
+/obj/machinery/cablelayer/proc/layCable(var/turf/new_turf,var/M_Dir)
+ if(!on)
+ return reset()
+ else
+ dismantleFloor(new_turf)
+ if(!istype(new_turf) || !dismantleFloor(new_turf))
+ return reset()
+ var/fdirn = turn(M_Dir,180)
+ for(var/obj/structure/cable/LC in new_turf) // check to make sure there's not a cable there already
+ if(LC.d1 == fdirn || LC.d2 == fdirn)
+ return reset()
+ if(!use_cable(1))
+ return reset()
+ var/obj/structure/cable/NC = new(new_turf)
+ NC.cableColor("red")
+ NC.d1 = 0
+ NC.d2 = fdirn
+ NC.updateicon()
+
+ var/datum/powernet/PN
+ if(last_piece && last_piece.d2 != M_Dir)
+ last_piece.d1 = min(last_piece.d2, M_Dir)
+ last_piece.d2 = max(last_piece.d2, M_Dir)
+ last_piece.updateicon()
+ PN = last_piece.powernet
+
+ if(!PN)
+ PN = new()
+ PN.add_cable(NC)
+ NC.mergeConnectedNetworks(NC.d2)
+
+ //NC.mergeConnectedNetworksOnTurf()
+ last_piece = NC
+ return 1
diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm
index 6e1ecdf4ca..a03289c78b 100644
--- a/code/game/machinery/OpTable.dm
+++ b/code/game/machinery/OpTable.dm
@@ -28,12 +28,12 @@
switch(severity)
if(1.0)
//SN src = null
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
//SN src = null
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(25))
@@ -43,14 +43,14 @@
/obj/machinery/optable/blob_act()
if(prob(75))
- del(src)
+ qdel(src)
/obj/machinery/optable/attack_hand(mob/user as mob)
if (HULK in usr.mutations)
usr << text("\blue You destroy the table.")
visible_message("\red [usr] destroys the operating table!")
src.density = 0
- del(src)
+ qdel(src)
return
/obj/machinery/optable/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
@@ -130,7 +130,7 @@
var/obj/item/weapon/grab/G = W
if(iscarbon(G.affecting) && check_table(G.affecting))
take_victim(G.affecting,usr)
- del(W)
+ qdel(W)
return
/obj/machinery/optable/proc/check_table(mob/living/carbon/patient as mob)
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 20c16dcb9c..0e92db1511 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -25,12 +25,12 @@
switch(severity)
if(1.0)
//SN src = null
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
//SN src = null
- del(src)
+ qdel(src)
return
else
return
@@ -204,7 +204,7 @@
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
A.blob_act()
- del(src)
+ qdel(src)
return
attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
@@ -252,7 +252,7 @@
icon_state = "sleeper_1-r"
src.add_fingerprint(user)
- del(G)
+ qdel(G)
return
return
@@ -265,21 +265,21 @@
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(2.0)
if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(3.0)
if(prob(25))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
return
emp_act(severity)
@@ -435,7 +435,7 @@
icon_state = "sleeper_1-r"
for(var/obj/O in src)
- del(O)
+ qdel(O)
src.add_fingerprint(usr)
return
return
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 51e1ec7510..8c6be59f71 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -56,7 +56,7 @@
src.icon_state = "body_scanner_1"
for(var/obj/O in src)
//O = null
- del(O)
+ qdel(O)
//Foreach goto(124)
src.add_fingerprint(usr)
return
@@ -98,7 +98,7 @@
//Foreach goto(154)
src.add_fingerprint(user)
//G = null
- del(G)
+ qdel(G)
return
/obj/machinery/bodyscanner/ex_act(severity)
@@ -109,7 +109,7 @@
ex_act(severity)
//Foreach goto(35)
//SN src = null
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
@@ -118,7 +118,7 @@
ex_act(severity)
//Foreach goto(108)
//SN src = null
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(25))
@@ -127,7 +127,7 @@
ex_act(severity)
//Foreach goto(181)
//SN src = null
- del(src)
+ qdel(src)
return
else
return
@@ -136,19 +136,19 @@
if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
- del(src)
+ qdel(src)
/obj/machinery/body_scanconsole/ex_act(severity)
switch(severity)
if(1.0)
//SN src = null
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
//SN src = null
- del(src)
+ qdel(src)
return
else
return
@@ -156,7 +156,7 @@
/obj/machinery/body_scanconsole/blob_act()
if(prob(50))
- del(src)
+ qdel(src)
/obj/machinery/body_scanconsole/power_change()
..()
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index f6d2820d5b..e1297510c8 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -98,6 +98,10 @@
TLV["temperature"] = list(20, 40, 140, 160) // K
target_temperature = 90
+/obj/machinery/alarm/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, frequency)
+ ..()
/obj/machinery/alarm/New(var/loc, var/dir, var/building = 0)
..()
@@ -114,16 +118,12 @@
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
update_icon()
- if(ticker && ticker.current_state == 3)//if the game is running
- src.initialize()
return
first_run()
/obj/machinery/alarm/proc/first_run()
alarm_area = get_area(src)
- if (alarm_area.master)
- alarm_area = alarm_area.master
area_uid = alarm_area.uid
if (name == "alarm")
name = "[alarm_area.name] Air Alarm"
@@ -284,11 +284,10 @@
/obj/machinery/alarm/proc/elect_master()
- for (var/area/A in alarm_area.related)
- for (var/obj/machinery/alarm/AA in A)
- if (!(AA.stat & (NOPOWER|BROKEN)))
- alarm_area.master_air_alarm = AA
- return 1
+ for (var/obj/machinery/alarm/AA in alarm_area)
+ if (!(AA.stat & (NOPOWER|BROKEN)))
+ alarm_area.master_air_alarm = AA
+ return 1
return 0
/obj/machinery/alarm/proc/get_danger_level(var/current_value, var/list/danger_levels)
@@ -395,9 +394,8 @@
/obj/machinery/alarm/proc/apply_mode()
//propagate mode to other air alarms in the area
//TODO: make it so that players can choose between applying the new mode to the room they are in (related area) vs the entire alarm area
- for (var/area/RA in alarm_area.related)
- for (var/obj/machinery/alarm/AA in RA)
- AA.mode = mode
+ for (var/obj/machinery/alarm/AA in alarm_area)
+ AA.mode = mode
switch(mode)
if(AALARM_MODE_SCRUBBING)
@@ -620,7 +618,7 @@
if(buildstage != 2)
return STATUS_CLOSE
- if(aidisabled && user.isAI())
+ if(aidisabled && user.isMobAI())
user << "AI control for \the [src] interface has been disabled."
return STATUS_CLOSE
@@ -831,17 +829,16 @@
if(0)
if(istype(W, /obj/item/weapon/airalarm_electronics))
user << "You insert the circuit!"
- del(W)
+ qdel(W)
buildstage = 1
update_icon()
return
else if(istype(W, /obj/item/weapon/wrench))
user << "You remove the fire alarm assembly from the wall!"
- var/obj/item/alarm_frame/frame = new /obj/item/alarm_frame()
- frame.loc = user.loc
+ new /obj/item/frame/air_alarm(get_turf(user))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
- del(src)
+ qdel(src)
return ..()
@@ -866,51 +863,7 @@ Just a object used in constructing air alarms
icon_state = "door_electronics"
desc = "Looks like a circuit. Probably is."
w_class = 2.0
- matter = list("metal" = 50, "glass" = 50)
-
-
-/*
-AIR ALARM ITEM
-Handheld air alarm frame, for placing on walls
-Code shamelessly copied from apc_frame
-*/
-/obj/item/alarm_frame
- name = "air alarm frame"
- desc = "Used for building Air Alarms"
- icon = 'icons/obj/monitors.dmi'
- icon_state = "alarm_bitem"
- flags = CONDUCT
-
-/obj/item/alarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if (istype(W, /obj/item/weapon/wrench))
- new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 )
- del(src)
- return
- ..()
-
-/obj/item/alarm_frame/proc/try_build(turf/on_wall)
- if (get_dist(on_wall,usr)>1)
- return
-
- var/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 << "\red Air Alarm cannot be placed on this spot."
- return
- if (A.requires_power == 0 || A.name == "Space")
- usr << "\red Air Alarm cannot be placed in this area."
- return
-
- if(gotwallitem(loc, ndir))
- usr << "\red There's already an item on this wall!"
- return
-
- new /obj/machinery/alarm(loc, ndir, 1)
- del(src)
+ matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50)
/*
FIRE ALARM
@@ -1015,16 +968,15 @@ FIRE ALARM
if(0)
if(istype(W, /obj/item/weapon/firealarm_electronics))
user << "You insert the circuit!"
- del(W)
+ qdel(W)
buildstage = 1
update_icon()
else if(istype(W, /obj/item/weapon/wrench))
user << "You remove the fire alarm assembly from the wall!"
- var/obj/item/firealarm_frame/frame = new /obj/item/firealarm_frame()
- frame.loc = user.loc
+ new /obj/item/frame/fire_alarm(get_turf(user))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
- del(src)
+ qdel(src)
return
src.alarm()
@@ -1068,7 +1020,6 @@ FIRE ALARM
var/d2
if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon))
A = A.loc
- A = A.master
if (A.fire)
d1 = text("Reset - Lockdown", src)
@@ -1135,9 +1086,8 @@ FIRE ALARM
if (!( src.working ))
return
var/area/area = get_area(src)
- for(var/area/A in area.related)
- for(var/obj/machinery/firealarm/FA in A)
- fire_alarm.clearAlarm(loc, FA)
+ for(var/obj/machinery/firealarm/FA in area)
+ fire_alarm.clearAlarm(loc, FA)
update_icon()
return
@@ -1145,9 +1095,8 @@ FIRE ALARM
if (!( src.working))
return
var/area/area = get_area(src)
- for(var/area/A in area.related)
- for(var/obj/machinery/firealarm/FA in A)
- fire_alarm.triggerAlarm(loc, FA, duration)
+ for(var/obj/machinery/firealarm/FA in area)
+ fire_alarm.triggerAlarm(loc, FA, duration)
update_icon()
//playsound(src.loc, 'sound/ambience/signal.ogg', 75, 0)
return
@@ -1188,53 +1137,7 @@ Just a object used in constructing fire alarms
icon_state = "door_electronics"
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
w_class = 2.0
- matter = list("metal" = 50, "glass" = 50)
-
-
-/*
-FIRE ALARM ITEM
-Handheld fire alarm frame, for placing on walls
-Code shamelessly copied from apc_frame
-*/
-/obj/item/firealarm_frame
- name = "fire alarm frame"
- desc = "Used for building Fire Alarms"
- icon = 'icons/obj/monitors.dmi'
- icon_state = "fire_bitem"
- flags = CONDUCT
-
-/obj/item/firealarm_frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if (istype(W, /obj/item/weapon/wrench))
- new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 )
- del(src)
- return
- ..()
-
-/obj/item/firealarm_frame/proc/try_build(turf/on_wall)
- if (get_dist(on_wall,usr)>1)
- return
-
- var/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 << "\red Fire Alarm cannot be placed on this spot."
- return
- if (A.requires_power == 0 || A.name == "Space")
- usr << "\red Fire Alarm cannot be placed in this area."
- return
-
- if(gotwallitem(loc, ndir))
- usr << "\red There's already an item on this wall!"
- return
-
- new /obj/machinery/firealarm(loc, ndir, 1)
-
- del(src)
-
+ matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50)
/obj/machinery/partyalarm
name = "\improper PARTY BUTTON"
@@ -1258,8 +1161,6 @@ Code shamelessly copied from apc_frame
user.machine = src
var/area/A = get_area(src)
ASSERT(isarea(A))
- if(A.master)
- A = A.master
var/d1
var/d2
if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
@@ -1298,8 +1199,6 @@ Code shamelessly copied from apc_frame
return
var/area/A = get_area(src)
ASSERT(isarea(A))
- if(A.master)
- A = A.master
A.partyreset()
return
@@ -1308,8 +1207,6 @@ Code shamelessly copied from apc_frame
return
var/area/A = get_area(src)
ASSERT(isarea(A))
- if(A.master)
- A = A.master
A.partyalert()
return
diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm
index 0294607e8a..09e55720a8 100644
--- a/code/game/machinery/atmo_control.dm
+++ b/code/game/machinery/atmo_control.dm
@@ -67,11 +67,10 @@
/obj/machinery/air_sensor/initialize()
set_frequency(frequency)
-/obj/machinery/air_sensor/New()
- ..()
-
+obj/machinery/air_sensor/Destroy()
if(radio_controller)
- set_frequency(frequency)
+ radio_controller.remove_object(src,frequency)
+ ..()
/obj/machinery/computer/general_air_control
icon = 'icons/obj/computer.dmi'
@@ -86,6 +85,11 @@
var/datum/radio_frequency/radio_connection
circuit = /obj/item/weapon/circuitboard/air_management
+obj/machinery/computer/general_air_control/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, frequency)
+ ..()
+
/obj/machinery/computer/general_air_control/attack_hand(mob/user)
if(..(user))
return
diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm
index 935feae3e2..984dc44782 100644
--- a/code/game/machinery/atmoalter/area_atmos_computer.dm
+++ b/code/game/machinery/atmoalter/area_atmos_computer.dm
@@ -2,6 +2,7 @@
name = "Area Air Control"
desc = "A computer used to control the stationary scrubbers and pumps in the area."
icon_state = "area_atmos"
+ light_color = "#e6ffff"
circuit = "/obj/item/weapon/circuitboard/area_atmos"
var/list/connectedscrubbers = new()
@@ -147,14 +148,10 @@
var/turf/T_src = get_turf(src)
if(!T_src.loc) return 0
var/area/A_src = T_src.loc
- if (A_src.master)
- A_src = A_src.master
var/turf/T_scrub = get_turf(scrubber)
if(!T_scrub.loc) return 0
var/area/A_scrub = T_scrub.loc
- if (A_scrub.master)
- A_scrub = A_scrub.master
if(A_scrub != A_src)
return 0
@@ -169,13 +166,11 @@
var/turf/T = get_turf(src)
if(!T.loc) return
var/area/A = T.loc
- if (A.master)
- A = A.master
for(var/obj/machinery/portable_atmospherics/powered/scrubber/huge/scrubber in world )
var/turf/T2 = get_turf(scrubber)
if(T2 && T2.loc)
var/area/A2 = T2.loc
- if(istype(A2) && A2.master && A2.master == A )
+ if(istype(A2) && A2 == A)
connectedscrubbers += scrubber
found = 1
@@ -183,4 +178,4 @@
if(!found)
status = "ERROR: No scrubber found!"
- src.updateUsrDialog()
\ No newline at end of file
+ src.updateUsrDialog()
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index ad7d55c2aa..095aec4a24 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -104,7 +104,7 @@
"\blue You have unfastened \the [src].", \
"You hear ratchet.")
new /obj/item/pipe_meter(src.loc)
- del(src)
+ qdel(src)
// TURF METER - REPORTS A TILE'S AIR CONTENTS
diff --git a/code/game/machinery/atmoalter/portable_atmospherics.dm b/code/game/machinery/atmoalter/portable_atmospherics.dm
index 9308bae64e..5e8817359f 100644
--- a/code/game/machinery/atmoalter/portable_atmospherics.dm
+++ b/code/game/machinery/atmoalter/portable_atmospherics.dm
@@ -20,6 +20,11 @@
return 1
+/obj/machinery/portable_atmospherics/Destroy()
+ qdel(air_contents)
+ qdel(holding)
+ ..()
+
/obj/machinery/portable_atmospherics/initialize()
. = ..()
spawn()
@@ -35,8 +40,8 @@
else
update_icon()
-/obj/machinery/portable_atmospherics/Del()
- del(air_contents)
+/obj/machinery/portable_atmospherics/Destroy()
+ qdel(air_contents)
..()
diff --git a/code/game/machinery/atmoalter/pump.dm b/code/game/machinery/atmoalter/pump.dm
index 9f2c4023b2..659e17d4b2 100644
--- a/code/game/machinery/atmoalter/pump.dm
+++ b/code/game/machinery/atmoalter/pump.dm
@@ -7,7 +7,10 @@
var/on = 0
var/direction_out = 0 //0 = siphoning, 1 = releasing
- var/target_pressure = 100
+ var/target_pressure = ONE_ATMOSPHERE
+
+ var/pressuremin = 0
+ var/pressuremax = 10 * ONE_ATMOSPHERE
volume = 1000
@@ -106,64 +109,59 @@
/obj/machinery/portable_atmospherics/powered/pump/return_air()
return air_contents
-/obj/machinery/portable_atmospherics/powered/pump/attack_ai(var/mob/user as mob)
+/obj/machinery/portable_atmospherics/powered/pump/attack_ai(var/mob/user)
+ src.add_hiddenprint(user)
return src.attack_hand(user)
-/obj/machinery/portable_atmospherics/powered/pump/attack_hand(var/mob/user as mob)
+/obj/machinery/portable_atmospherics/powered/pump/attack_ghost(var/mob/user)
+ return src.attack_hand(user)
- user.set_machine(src)
- var/holding_text
+/obj/machinery/portable_atmospherics/powered/pump/attack_hand(var/mob/user)
+ ui_interact(user)
- if(holding)
- holding_text = {"
Tank Pressure: [round(holding.air_contents.return_pressure(), 0.01)] kPa
-Remove Tank
-"}
- var/output_text = {"[capitalize(name)]
-Pressure: [round(air_contents.return_pressure(), 0.01)] kPa
-Flow Rate: [round(last_flow_rate, 0.1)] L/s
-Port Status: [(connected_port)?("Connected"):("Disconnected")]
-[holding_text]
-
-Cell Charge: [cell? "[round(cell.percent())]%" : "N/A"] | Load: [round(last_power_draw)] W
-Power Switch: [on?("On"):("Off")]
-Pump Direction: [direction_out?("Out"):("In")]
-Target Pressure: - - - - [target_pressure] kPa+ + + +
-
-Close
-"}
+/obj/machinery/portable_atmospherics/powered/pump/ui_interact(mob/user, ui_key = "rcon", datum/nanoui/ui=null, force_open=1)
+ var/list/data[0]
+ data["portConnected"] = connected_port ? 1 : 0
+ data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)
+ data["targetpressure"] = round(target_pressure)
+ data["pump_dir"] = direction_out
+ data["minpressure"] = round(pressuremin)
+ data["maxpressure"] = round(pressuremax)
+ data["powerDraw"] = round(last_power_draw)
+ data["cellCharge"] = cell ? cell.charge : 0
+ data["cellMaxCharge"] = cell ? cell.maxcharge : 1
+ data["on"] = on ? 1 : 0
- user << browse(output_text, "window=pump;size=600x300")
- onclose(user, "pump")
+ data["hasHoldingTank"] = holding ? 1 : 0
+ if (holding)
+ data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
- return
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if (!ui)
+ ui = new(user, src, ui_key, "portpump.tmpl", "Portable Pump", 480, 410, state = physical_state)
+ ui.set_initial_data(data)
+ ui.open()
+ ui.set_auto_update(1)
/obj/machinery/portable_atmospherics/powered/pump/Topic(href, href_list)
- ..()
- if (usr.stat || usr.restrained())
- return
+ if(..())
+ return 1
- if (((get_dist(src, usr) <= 1) && istype(src.loc, /turf)))
- usr.set_machine(src)
+ if(href_list["power"])
+ on = !on
+ . = 1
+ if(href_list["direction"])
+ direction_out = !direction_out
+ . = 1
+ if (href_list["remove_tank"])
+ if(holding)
+ holding.loc = loc
+ holding = null
+ . = 1
+ if (href_list["pressure_adj"])
+ var/diff = text2num(href_list["pressure_adj"])
+ target_pressure = min(10*ONE_ATMOSPHERE, max(0, target_pressure+diff))
+ . = 1
- if(href_list["power"])
- on = !on
-
- if(href_list["direction"])
- direction_out = !direction_out
-
- if (href_list["remove_tank"])
- if(holding)
- holding.loc = loc
- holding = null
-
- if (href_list["pressure_adj"])
- var/diff = text2num(href_list["pressure_adj"])
- target_pressure = min(10*ONE_ATMOSPHERE, max(0, target_pressure+diff))
-
- src.updateUsrDialog()
- src.add_fingerprint(usr)
+ if(.)
update_icon()
- else
- usr << browse(null, "window=pump")
- return
- return
\ No newline at end of file
diff --git a/code/game/machinery/atmoalter/scrubber.dm b/code/game/machinery/atmoalter/scrubber.dm
index d8c23cc5f0..1977e55646 100644
--- a/code/game/machinery/atmoalter/scrubber.dm
+++ b/code/game/machinery/atmoalter/scrubber.dm
@@ -13,6 +13,9 @@
power_rating = 7500 //7500 W ~ 10 HP
power_losses = 150
+ var/minrate = 0
+ var/maxrate = 10 * ONE_ATMOSPHERE
+
var/list/scrubbing_gas = list("phoron", "carbon_dioxide", "sleeping_agent", "oxygen_agent_b")
/obj/machinery/portable_atmospherics/powered/scrubber/New()
@@ -82,63 +85,58 @@
/obj/machinery/portable_atmospherics/powered/scrubber/return_air()
return air_contents
-/obj/machinery/portable_atmospherics/powered/scrubber/attack_ai(var/mob/user as mob)
+/obj/machinery/portable_atmospherics/powered/scrubber/attack_ai(var/mob/user)
+ src.add_hiddenprint(user)
return src.attack_hand(user)
-/obj/machinery/portable_atmospherics/powered/scrubber/attack_hand(var/mob/user as mob)
+/obj/machinery/portable_atmospherics/powered/scrubber/attack_ghost(var/mob/user)
+ return src.attack_hand(user)
- user.set_machine(src)
- var/holding_text
-
- if(holding)
- holding_text = {"
Tank Pressure: [round(holding.air_contents.return_pressure(), 0.01)] kPa
-Remove Tank
-"}
- var/output_text = {"[name]
-Pressure: [round(air_contents.return_pressure(), 0.01)] kPa
-Flow Rate: [round(last_flow_rate, 0.1)] L/s
-Port Status: [(connected_port)?("Connected"):("Disconnected")]
-[holding_text]
-
-Cell Charge: [cell? "[round(cell.percent())]%" : "N/A"] | Load: [round(last_power_draw)] W
-Power Switch: [on?("On"):("Off")]
-Flow Rate Regulator: - - - - [volume_rate] L/s + + + +
-
-
-Close
-"}
-
- user << browse(output_text, "window=scrubber;size=600x300")
- onclose(user, "scrubber")
+/obj/machinery/portable_atmospherics/powered/scrubber/attack_hand(var/mob/user)
+ ui_interact(user)
return
+/obj/machinery/portable_atmospherics/powered/scrubber/ui_interact(mob/user, ui_key = "rcon", datum/nanoui/ui=null, force_open=1)
+ var/list/data[0]
+ data["portConnected"] = connected_port ? 1 : 0
+ data["tankPressure"] = round(air_contents.return_pressure() > 0 ? air_contents.return_pressure() : 0)
+ data["rate"] = round(volume_rate)
+ data["minrate"] = round(minrate)
+ data["maxrate"] = round(maxrate)
+ data["powerDraw"] = round(last_power_draw)
+ data["cellCharge"] = cell ? cell.charge : 0
+ data["cellMaxCharge"] = cell ? cell.maxcharge : 1
+ data["on"] = on ? 1 : 0
+
+ data["hasHoldingTank"] = holding ? 1 : 0
+ if (holding)
+ data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure() > 0 ? holding.air_contents.return_pressure() : 0))
+
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if (!ui)
+ ui = new(user, src, ui_key, "portscrubber.tmpl", "Portable Scrubber", 480, 400, state = physical_state)
+ ui.set_initial_data(data)
+ ui.open()
+ ui.set_auto_update(1)
+
+
/obj/machinery/portable_atmospherics/powered/scrubber/Topic(href, href_list)
- ..()
- if (usr.stat || usr.restrained())
- return
+ if(..())
+ return 1
- if (((get_dist(src, usr) <= 1) && istype(src.loc, /turf)))
- usr.set_machine(src)
-
- if(href_list["power"])
- on = !on
-
- if (href_list["remove_tank"])
- if(holding)
- holding.loc = loc
- holding = null
-
- if (href_list["volume_adj"])
- var/diff = text2num(href_list["volume_adj"])
- volume_rate = min(initial(volume_rate), max(0, volume_rate+diff))
-
- src.updateUsrDialog()
- src.add_fingerprint(usr)
- update_icon()
- else
- usr << browse(null, "window=scrubber")
- return
- return
+ if(href_list["power"])
+ on = !on
+ . = 1
+ if (href_list["remove_tank"])
+ if(holding)
+ holding.loc = loc
+ holding = null
+ . = 1
+ if (href_list["volume_adj"])
+ var/diff = text2num(href_list["volume_adj"])
+ volume_rate = Clamp(volume_rate+diff, minrate, maxrate)
+ . = 1
+ update_icon()
//Huge scrubber
diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index d537d113f9..f8f8a9c21e 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -9,8 +9,8 @@
active_power_usage = 2000
var/list/machine_recipes
- var/list/stored_material = list("metal" = 0, "glass" = 0)
- var/list/storage_capacity = list("metal" = 0, "glass" = 0)
+ var/list/stored_material = list(DEFAULT_WALL_MATERIAL = 0, "glass" = 0)
+ var/list/storage_capacity = list(DEFAULT_WALL_MATERIAL = 0, "glass" = 0)
var/show_category = "All"
var/hacked = 0
@@ -190,7 +190,7 @@
stack.use(max(1, round(total_used/mass_per_sheet))) // Always use at least 1 to prevent infinite materials.
else
user.remove_from_mob(O)
- del(O)
+ qdel(O)
updateUsrDialog()
return
@@ -279,18 +279,20 @@
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
man_rating += M.rating
- storage_capacity["metal"] = mb_rating * 25000
+ storage_capacity[DEFAULT_WALL_MATERIAL] = mb_rating * 25000
storage_capacity["glass"] = mb_rating * 12500
build_time = 50 / man_rating
mat_efficiency = 1.1 - man_rating * 0.1// Normally, price is 1.25 the amount of material, so this shouldn't go higher than 0.8. Maximum rating of parts is 3
/obj/machinery/autolathe/dismantle()
- var/list/sheets = list("metal" = /obj/item/stack/sheet/metal, "glass" = /obj/item/stack/sheet/glass)
for(var/mat in stored_material)
- var/T = sheets[mat]
- var/obj/item/stack/sheet/S = new T
+ var/material/M = name_to_material[mat]
+ if(!istype(M))
+ continue
+ var/obj/item/stack/sheet/S = new M.stack_type(get_turf(src))
if(stored_material[mat] > S.perunit)
S.amount = round(stored_material[mat] / S.perunit)
- S.loc = loc
+ else
+ qdel(S)
..()
diff --git a/code/game/machinery/autolathe_datums.dm b/code/game/machinery/autolathe_datums.dm
index 1e35a4be5d..3b323cd69f 100644
--- a/code/game/machinery/autolathe_datums.dm
+++ b/code/game/machinery/autolathe_datums.dm
@@ -16,7 +16,7 @@
recipe.resources = list()
for(var/material in I.matter)
recipe.resources[material] = I.matter[material]*1.25 // More expensive to produce than they are to recycle.
- del(I)
+ qdel(I)
/datum/autolathe/recipe
var/name = "object"
diff --git a/code/game/machinery/bees_items.dm b/code/game/machinery/bees_items.dm
index 486b46d33c..05f9231f8a 100644
--- a/code/game/machinery/bees_items.dm
+++ b/code/game/machinery/bees_items.dm
@@ -20,7 +20,7 @@
for(var/mob/living/simple_animal/bee/B in T)
if(B.feral < 0)
caught_bees += B.strength
- del(B)
+ qdel(B)
user.visible_message("\blue [user] nets some bees.","\blue You net up some of the becalmed bees.")
else
user.visible_message("\red [user] swings at some bees, they don't seem to like it.","\red You swing at some bees, they don't seem to like it.")
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index 87399b597a..61ed92d58e 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -151,7 +151,7 @@
if(I.reagents.get_reagent_amount("nutriment") < 0.1)
points += 1
else points += I.reagents.get_reagent_amount("nutriment") * 10 * eat_eff
- del(I)
+ qdel(I)
if(S)
processing = 1
update_icon()
diff --git a/code/game/machinery/bioprinter.dm b/code/game/machinery/bioprinter.dm
index 48c0edb984..5a8b25bb84 100644
--- a/code/game/machinery/bioprinter.dm
+++ b/code/game/machinery/bioprinter.dm
@@ -70,7 +70,7 @@
stored_matter += 50
user.drop_item()
user << "\The [src] processes \the [W]. Levels of stored biomass now: [stored_matter]"
- del(W)
+ qdel(W)
return
// Steel for matter.
else if(prints_prosthetics && istype(W, /obj/item/stack/sheet/metal))
@@ -78,7 +78,7 @@
stored_matter += M.amount * 10
user.drop_item()
user << "\The [src] processes \the [W]. Levels of stored matter now: [stored_matter]"
- del(W)
+ qdel(W)
return
else
return..()
\ No newline at end of file
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index f87ae33ee0..70740901fa 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -3,7 +3,7 @@
/obj/machinery/bot
icon = 'icons/obj/aibots.dmi'
layer = MOB_LAYER
- luminosity = 3
+ light_range = 3
use_power = 0
var/obj/item/weapon/card/id/botcard // the ID card that the bot "holds"
var/on = 1
@@ -15,19 +15,18 @@
var/locked = 1
//var/emagged = 0 //Urist: Moving that var to the general /bot tree as it's used by most bots
-
/obj/machinery/bot/proc/turn_on()
if(stat) return 0
on = 1
- SetLuminosity(initial(luminosity))
+ set_light(initial(light_range))
return 1
/obj/machinery/bot/proc/turn_off()
on = 0
- SetLuminosity(0)
+ set_light(0)
/obj/machinery/bot/proc/explode()
- del(src)
+ qdel(src)
/obj/machinery/bot/proc/healthcheck()
if (src.health <= 0)
@@ -117,7 +116,7 @@
/obj/machinery/bot/emp_act(severity)
var/was_on = on
stat |= EMPED
- var/obj/effect/overlay/pulse2 = new/obj/effect/overlay ( src.loc )
+ var/obj/effect/overlay/pulse2 = PoolOrNew(/obj/effect/overlay, src.loc )
pulse2.icon = 'icons/effects/effects.dmi'
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
@@ -125,7 +124,7 @@
pulse2.set_dir(pick(cardinal))
spawn(10)
- pulse2.delete()
+ qdel(pulse2)
if (on)
turn_off()
spawn(severity*300)
diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm
deleted file mode 100644
index 4dcb838152..0000000000
--- a/code/game/machinery/bots/cleanbot.dm
+++ /dev/null
@@ -1,363 +0,0 @@
-//Cleanbot assembly
-/obj/item/weapon/bucket_sensor
- desc = "It's a bucket. With a sensor attached."
- name = "proxy bucket"
- icon = 'icons/obj/aibots.dmi'
- icon_state = "bucket_proxy"
- force = 3.0
- throwforce = 10.0
- throw_speed = 2
- throw_range = 5
- w_class = 3.0
- var/created_name = "Cleanbot"
-
-
-//Cleanbot
-/obj/machinery/bot/cleanbot
- name = "Cleanbot"
- desc = "A little cleaning robot, he looks so excited!"
- icon = 'icons/obj/aibots.dmi'
- icon_state = "cleanbot0"
- layer = 5.0
- density = 0
- anchored = 0
- //weight = 1.0E7
- health = 25
- maxhealth = 25
- var/cleaning = 0
- var/screwloose = 0
- var/oddbutton = 0
- var/blood = 1
- var/list/target_types = list()
- var/obj/effect/decal/cleanable/target
- var/obj/effect/decal/cleanable/oldtarget
- var/oldloc = null
- req_access = list(access_janitor)
- var/path[] = new()
- var/patrol_path[] = null
- var/beacon_freq = 1445 // navigation beacon frequency
- var/closest_dist
- var/closest_loc
- var/failed_steps
- var/should_patrol
- var/next_dest
- var/next_dest_loc
-
-/obj/machinery/bot/cleanbot/New()
- ..()
- src.get_targets()
- src.icon_state = "cleanbot[src.on]"
-
- should_patrol = 1
-
- src.botcard = new /obj/item/weapon/card/id(src)
- src.botcard.access = list(access_janitor, access_maint_tunnels)
-
- src.locked = 0 // Start unlocked so roboticist can set them to patrol.
-
- if(radio_controller)
- radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
-
-
-/obj/machinery/bot/cleanbot/turn_on()
- . = ..()
- src.icon_state = "cleanbot[src.on]"
- src.updateUsrDialog()
-
-/obj/machinery/bot/cleanbot/turn_off()
- ..()
- if(!isnull(src.target))
- target.targeted_by = null
- src.target = null
- src.oldtarget = null
- src.oldloc = null
- src.icon_state = "cleanbot[src.on]"
- src.path = new()
- src.updateUsrDialog()
-
-/obj/machinery/bot/cleanbot/attack_hand(mob/user as mob)
- . = ..()
- if (.)
- return
- usr.set_machine(src)
- interact(user)
-
-/obj/machinery/bot/cleanbot/interact(mob/user as mob)
- var/dat
- dat += text({"
-Automatic Station Cleaner v1.0
-Status: []
-Behaviour controls are [src.locked ? "locked" : "unlocked"]
-Maintenance panel is [src.open ? "opened" : "closed"]"},
-text("[src.on ? "On" : "Off"]"))
- if(!src.locked || issilicon(user))
- dat += text({"
Cleans Blood: []
"}, text("[src.blood ? "Yes" : "No"]"))
- dat += text({"
Patrol station: []
"}, text("[src.should_patrol ? "Yes" : "No"]"))
- // dat += text({"
Beacon frequency: []
"}, text("[src.beacon_freq]"))
- if(src.open && !src.locked)
- dat += text({"
-Odd looking screw twiddled: []
-Weird button pressed: []"},
-text("[src.screwloose ? "Yes" : "No"]"),
-text("[src.oddbutton ? "Yes" : "No"]"))
-
- user << browse("Cleaner v1.0 controls[dat]", "window=autocleaner")
- onclose(user, "autocleaner")
- return
-
-/obj/machinery/bot/cleanbot/Topic(href, href_list)
- if(..())
- return
- usr.set_machine(src)
- src.add_fingerprint(usr)
- switch(href_list["operation"])
- if("start")
- if (src.on)
- turn_off()
- else
- turn_on()
- if("blood")
- src.blood =!src.blood
- src.get_targets()
- src.updateUsrDialog()
- if("patrol")
- src.should_patrol =!src.should_patrol
- src.patrol_path = null
- src.updateUsrDialog()
- if("freq")
- var/freq = text2num(input("Select frequency for navigation beacons", "Frequnecy", num2text(beacon_freq / 10))) * 10
- if (freq > 0)
- src.beacon_freq = freq
- src.updateUsrDialog()
- if("screw")
- src.screwloose = !src.screwloose
- usr << "You press the weird button."
- src.updateUsrDialog()
-
-/obj/machinery/bot/cleanbot/attackby(obj/item/weapon/W, mob/user as mob)
- if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
- if(src.allowed(usr) && !open && !emagged)
- src.locked = !src.locked
- user << "You [ src.locked ? "lock" : "unlock"] the [src] behaviour controls."
- else
- if(emagged)
- user << "ERROR"
- if(open)
- user << "Please close the access panel before locking it."
- else
- user << "This [src] doesn't seem to respect your authority."
- else
- return ..()
-
-/obj/machinery/bot/cleanbot/Emag(mob/user as mob)
- ..()
- if(open && !locked)
- if(user) user << "The [src] buzzes and beeps."
- src.oddbutton = 1
- src.screwloose = 1
-
-/obj/machinery/bot/cleanbot/process()
- set background = 1
-
- if(!src.on)
- return
- if(src.cleaning)
- return
-
- if(!src.screwloose && !src.oddbutton && prob(5))
- visible_message("[src] makes an excited beeping booping sound!")
-
- if(src.screwloose && prob(5))
- if(istype(loc,/turf/simulated))
- var/turf/simulated/T = src.loc
- if(T.wet < 1)
- T.wet = 1
- if(T.wet_overlay)
- T.overlays -= T.wet_overlay
- T.wet_overlay = null
- T.wet_overlay = image('icons/effects/water.dmi',T,"wet_floor")
- T.overlays += T.wet_overlay
- spawn(800)
- if (istype(T) && T.wet < 2)
- T.wet = 0
- if(T.wet_overlay)
- T.overlays -= T.wet_overlay
- T.wet_overlay = null
- if(src.oddbutton && prob(5))
- visible_message("Something flies out of [src]. He seems to be acting oddly.")
- var/obj/effect/decal/cleanable/blood/gibs/gib = new /obj/effect/decal/cleanable/blood/gibs(src.loc)
- //gib.streak(list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
- src.oldtarget = gib
- if(!src.target || src.target == null)
- for (var/obj/effect/decal/cleanable/D in view(7,src))
- for(var/T in src.target_types)
- if(isnull(D.targeted_by) && istype(D, T) && D != src.oldtarget) // If the mess isn't targeted (D.type == T || D.parent_type == T)
- src.oldtarget = D // or if it is but the bot is gone.
- src.target = D // and it's stuff we clean? Clean it.
- D.targeted_by = src // Claim the mess we are targeting.
- return
-
- if(!src.target || src.target == null)
- if(src.loc != src.oldloc)
- src.oldtarget = null
-
- if (!should_patrol)
- return
-
- if (!patrol_path || patrol_path.len < 1)
- var/datum/radio_frequency/frequency = radio_controller.return_frequency(beacon_freq)
-
- if(!frequency) return
-
- closest_dist = 9999
- closest_loc = null
- next_dest_loc = null
-
- var/datum/signal/signal = new()
- signal.source = src
- signal.transmission_method = 1
- signal.data = list("findbeacon" = "patrol")
- frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS)
- spawn(5)
- if (!next_dest_loc)
- next_dest_loc = closest_loc
- if (next_dest_loc)
- src.patrol_path = AStar(src.loc, next_dest_loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=null)
- else
- patrol_move()
-
- return
-
- if(target && path.len == 0)
- spawn(0)
- if(!src || !target) return
- src.path = AStar(src.loc, src.target.loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30, id=botcard)
- if (!path) path = list()
- if(src.path.len == 0)
- src.oldtarget = src.target
- target.targeted_by = null
- src.target = null
- return
- if(src.path.len > 0 && src.target && (src.target != null))
- step_to(src, src.path[1])
- src.path -= src.path[1]
- else if(src.path.len == 1)
- step_to(src, target)
-
- if(src.target && (src.target != null))
- patrol_path = null
- if(src.loc == src.target.loc)
- clean(src.target)
- src.path = new()
- src.target = null
- return
-
- src.oldloc = src.loc
-
-/obj/machinery/bot/cleanbot/proc/patrol_move()
- if (src.patrol_path.len <= 0)
- return
-
- var/next = src.patrol_path[1]
- src.patrol_path -= next
- if (next == src.loc)
- return
-
- var/moved = step_towards(src, next)
- if (!moved)
- failed_steps++
- if (failed_steps > 4)
- patrol_path = null
- next_dest = null
- failed_steps = 0
- else
- failed_steps = 0
-
-/obj/machinery/bot/cleanbot/receive_signal(datum/signal/signal)
- var/recv = signal.data["beacon"]
- var/valid = signal.data["patrol"]
- if(!recv || !valid)
- return
-
- var/dist = get_dist(src, signal.source.loc)
- if (dist < closest_dist && signal.source.loc != src.loc)
- closest_dist = dist
- closest_loc = signal.source.loc
- next_dest = signal.data["next_patrol"]
-
- if (recv == next_dest)
- next_dest_loc = signal.source.loc
- next_dest = signal.data["next_patrol"]
-
-/obj/machinery/bot/cleanbot/proc/get_targets()
- src.target_types = new/list()
-
- target_types += /obj/effect/decal/cleanable/blood/oil
- target_types += /obj/effect/decal/cleanable/vomit
- target_types += /obj/effect/decal/cleanable/crayon
- target_types += /obj/effect/decal/cleanable/liquid_fuel
- target_types += /obj/effect/decal/cleanable/mucus
- target_types += /obj/effect/decal/cleanable/dirt
-
- if(src.blood)
- target_types += /obj/effect/decal/cleanable/blood/
-
-/obj/machinery/bot/cleanbot/proc/clean(var/obj/effect/decal/cleanable/target)
- anchored = 1
- icon_state = "cleanbot-c"
- visible_message("\red [src] begins to clean up the [target]")
- cleaning = 1
- var/cleantime = 50
- if(istype(target,/obj/effect/decal/cleanable/dirt)) // Clean Dirt much faster
- cleantime = 10
- spawn(cleantime)
- if(istype(loc,/turf/simulated))
- var/turf/simulated/f = loc
- f.dirt = 0
- cleaning = 0
- del(target)
- icon_state = "cleanbot[on]"
- anchored = 0
- target = null
-
-/obj/machinery/bot/cleanbot/explode()
- src.on = 0
- src.visible_message("\red [src] blows apart!", 1)
- var/turf/Tsec = get_turf(src)
-
- new /obj/item/weapon/reagent_containers/glass/bucket(Tsec)
-
- new /obj/item/device/assembly/prox_sensor(Tsec)
-
- if (prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
-
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(3, 1, src)
- s.start()
- del(src)
- return
-
-/obj/item/weapon/bucket_sensor/attackby(var/obj/item/W, mob/user as mob)
- ..()
- if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
- user.drop_item()
- del(W)
- var/turf/T = get_turf(src.loc)
- var/obj/machinery/bot/cleanbot/A = new /obj/machinery/bot/cleanbot(T)
- A.name = src.created_name
- user << "You add the robot arm to the bucket and sensor assembly. Beep boop!"
- user.drop_from_inventory(src)
- del(src)
-
- else if (istype(W, /obj/item/weapon/pen))
- var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
- if (!t)
- return
- if (!in_range(src, usr) && src.loc != usr)
- return
- src.created_name = t
diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm
deleted file mode 100644
index a955efaa1f..0000000000
--- a/code/game/machinery/bots/ed209bot.dm
+++ /dev/null
@@ -1,210 +0,0 @@
-/obj/machinery/bot/secbot/ed209
- name = "ED-209 Security Robot"
- desc = "A security robot. He looks less than thrilled."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "ed2090"
- density = 1
- health = 100
- maxhealth = 100
-
- bot_version = "2.5"
- search_range = 12
- has_laser = 1
-
- preparing_arrest_sounds = new()
- secbot_assembly = /obj/item/weapon/secbot_assembly/ed209_assembly
-
-/obj/item/weapon/secbot_assembly/ed209_assembly
- name = "ED-209 assembly"
- desc = "Some sort of bizarre assembly."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "ed209_frame"
- item_state = "ed209_frame"
- created_name = "ED-209 Security Robot" //To preserve the name if it's a unique securitron I guess
- var/lasercolor = ""
-
-/obj/machinery/bot/secbot/ed209/update_icon()
- if(on && is_attacking)
- src.icon_state = "[lasercolor]ed209-c"
- else
- src.icon_state = "[lasercolor]ed209[src.on]"
-
-/obj/machinery/bot/secbot/ed209/on_explosion(var/turf/Tsec)
- if(!lasercolor)
- var/obj/item/weapon/gun/energy/taser/G = new /obj/item/weapon/gun/energy/taser(Tsec)
- G.power_supply.charge = 0
- else if(lasercolor == "b")
- var/obj/item/weapon/gun/energy/lasertag/blue/G = new (Tsec)
- G.power_supply.charge = 0
- else if(lasercolor == "r")
- var/obj/item/weapon/gun/energy/lasertag/red/G = new (Tsec)
- G.power_supply.charge = 0
- if (prob(50))
- new /obj/item/robot_parts/l_leg(Tsec)
- if (prob(25))
- new /obj/item/robot_parts/r_leg(Tsec)
- if (prob(25))//50% chance for a helmet OR vest
- if (prob(50))
- new /obj/item/clothing/head/helmet(Tsec)
- else
- if(!lasercolor)
- new /obj/item/clothing/suit/armor/vest(Tsec)
- if(lasercolor == "b")
- new /obj/item/clothing/suit/bluetag(Tsec)
- if(lasercolor == "r")
- new /obj/item/clothing/suit/redtag(Tsec)
-
-/obj/item/weapon/secbot_assembly/ed209_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
- ..()
-
- if(istype(W, /obj/item/weapon/pen))
- var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
- if(!t) return
- if(!in_range(src, usr) && src.loc != usr) return
- created_name = t
- return
-
- switch(build_step)
- if(0,1)
- if( istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg) )
- user.drop_item()
- del(W)
- build_step++
- user << "You add the robot leg to [src]."
- name = "legs/frame assembly"
- if(build_step == 1)
- item_state = "ed209_leg"
- icon_state = "ed209_leg"
- else
- item_state = "ed209_legs"
- icon_state = "ed209_legs"
-
- if(2)
- if( istype(W, /obj/item/clothing/suit/redtag) )
- lasercolor = "r"
- else if( istype(W, /obj/item/clothing/suit/bluetag) )
- lasercolor = "b"
- if( lasercolor || istype(W, /obj/item/clothing/suit/storage/vest) )
- user.drop_item()
- del(W)
- build_step++
- user << "You add the armor to [src]."
- name = "vest/legs/frame assembly"
- item_state = "[lasercolor]ed209_shell"
- icon_state = "[lasercolor]ed209_shell"
-
- if(3)
- if( istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if(WT.remove_fuel(0,user))
- build_step++
- name = "shielded frame assembly"
- user << "You welded the vest to [src]."
- if(4)
- if( istype(W, /obj/item/clothing/head/helmet) )
- user.drop_item()
- del(W)
- build_step++
- user << "You add the helmet to [src]."
- name = "covered and shielded frame assembly"
- item_state = "[lasercolor]ed209_hat"
- icon_state = "[lasercolor]ed209_hat"
-
- if(5)
- if( isprox(W) )
- user.drop_item()
- del(W)
- build_step++
- user << "You add the prox sensor to [src]."
- name = "covered, shielded and sensored frame assembly"
- item_state = "[lasercolor]ed209_prox"
- icon_state = "[lasercolor]ed209_prox"
-
- if(6)
- if(istype(W, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/C = W
- if (C.get_amount() < 1)
- user << "You need one coil of wire to do wire [src]."
- return
- user << "You start to wire [src]."
- if (do_after(user, 40) && build_step == 6)
- if (C.use(1))
- build_step++
- user << "You wire the ED-209 assembly."
- name = "wired ED-209 assembly"
- return
-
- if(7)
- switch(lasercolor)
- if("b")
- if( !istype(W, /obj/item/weapon/gun/energy/lasertag/blue) )
- return
- name = "bluetag ED-209 assembly"
- if("r")
- if( !istype(W, /obj/item/weapon/gun/energy/lasertag/red) )
- return
- name = "redtag ED-209 assembly"
- if("")
- if( !istype(W, /obj/item/weapon/gun/energy/taser) )
- return
- name = "taser ED-209 assembly"
- else
- return
- build_step++
- user << "You add [W] to [src]."
- src.item_state = "[lasercolor]ed209_taser"
- src.icon_state = "[lasercolor]ed209_taser"
- user.drop_item()
- del(W)
-
- if(8)
- if( istype(W, /obj/item/weapon/screwdriver) )
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
- var/turf/T = get_turf(user)
- user << "Now attaching the gun to the frame..."
- sleep(40)
- if(get_turf(user) == T && build_step == 8)
- build_step++
- name = "armed [name]"
- user << "Taser gun attached."
-
- if(9)
- if( istype(W, /obj/item/weapon/cell) )
- build_step++
- user << "You complete the ED-209."
- var/turf/T = get_turf(src)
- new /obj/machinery/bot/secbot/ed209(T,created_name,lasercolor)
- user.drop_item()
- del(W)
- user.drop_from_inventory(src)
- del(src)
-
-
-/obj/machinery/bot/secbot/ed209/bullet_act(var/obj/item/projectile/Proj)
- if((src.lasercolor == "b") && (src.disabled == 0))
- if(istype(Proj, /obj/item/projectile/beam/lastertag/red))
- src.disabled = 1
- del (Proj)
- sleep(100)
- src.disabled = 0
- else
- ..()
- else if((src.lasercolor == "r") && (src.disabled == 0))
- if(istype(Proj, /obj/item/projectile/beam/lastertag/blue))
- src.disabled = 1
- del (Proj)
- sleep(100)
- src.disabled = 0
- else
- ..()
- else
- ..()
-
-/obj/machinery/bot/secbot/ed209/bluetag/New()//If desired, you spawn red and bluetag bots easily
- new /obj/machinery/bot/secbot/ed209(get_turf(src),null,"b")
- del(src)
-
-
-/obj/machinery/bot/secbot/ed209/redtag/New()
- new /obj/machinery/bot/secbot/ed209(get_turf(src),null,"r")
- del(src)
diff --git a/code/game/machinery/bots/farmbot.dm b/code/game/machinery/bots/farmbot.dm
deleted file mode 100644
index ca32e937ed..0000000000
--- a/code/game/machinery/bots/farmbot.dm
+++ /dev/null
@@ -1,595 +0,0 @@
-//Farmbots by GauHelldragon - 12/30/2012
-// A new type of buildable aiBot that helps out in hydroponics
-
-// Made by using a robot arm on a water tank and then adding:
-// A plant analyzer, a bucket, a mini-hoe and then a proximity sensor (in that order)
-
-// Will water, weed and fertilize plants that need it
-// When emagged, it will "water", "weed" and "fertilize" humans instead
-// Holds up to 10 fertilizers (only the type dispensed by the machines, not chemistry bottles)
-// It will fill up it's water tank at a sink when low.
-
-// The behavior panel can be unlocked with hydroponics access and be modified to disable certain behaviors
-// By default, it will ignore weeds and mushrooms, but can be set to tend to these types of plants as well.
-
-
-#define FARMBOT_MODE_WATER 1
-#define FARMBOT_MODE_FERTILIZE 2
-#define FARMBOT_MODE_WEED 3
-#define FARMBOT_MODE_REFILL 4
-#define FARMBOT_MODE_WAITING 5
-
-#define FARMBOT_ANIMATION_TIME 25 //How long it takes to use one of the action animations
-#define FARMBOT_EMAG_DELAY 60 //How long of a delay after doing one of the emagged attack actions
-#define FARMBOT_ACTION_DELAY 35 //How long of a delay after doing one of the normal actions
-
-/obj/machinery/bot/farmbot
- name = "Farmbot"
- desc = "The botanist's best friend."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "farmbot0"
- layer = 5.0
- density = 1
- anchored = 0
- health = 50
- maxhealth = 50
- req_access =list(access_hydroponics)
-
- var/Max_Fertilizers = 10
-
- var/setting_water = 1
- var/setting_refill = 1
- var/setting_fertilize = 1
- var/setting_weed = 1
- var/setting_ignoreWeeds = 1
- var/setting_ignoreMushrooms = 1
-
- var/atom/target //Current target, can be a human, a hydroponics tray, or a sink
- var/mode //Which mode is being used, 0 means it is looking for work
-
- var/obj/structure/reagent_dispensers/watertank/tank // the water tank that was used to make it, remains inside the bot.
-
- var/path[] = new() // used for pathing
- var/frustration
-
-/obj/machinery/bot/farmbot/New()
- ..()
- src.icon_state = "farmbot[src.on]"
- spawn (4)
- src.botcard = new /obj/item/weapon/card/id(src)
- src.botcard.access = req_access
-
- if ( !tank ) //Should be set as part of making it... but lets check anyway
- tank = locate(/obj/structure/reagent_dispensers/watertank/) in contents
- if ( !tank ) //An admin must have spawned the farmbot! Better give it a tank.
- tank = new /obj/structure/reagent_dispensers/watertank(src)
-
-/obj/machinery/bot/farmbot/Bump(M as mob|obj) //Leave no door unopened!
- spawn(0)
- if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard)))
- var/obj/machinery/door/D = M
- if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard))
- D.open()
- src.frustration = 0
- return
- return
-
-/obj/machinery/bot/farmbot/turn_on()
- . = ..()
- src.icon_state = "farmbot[src.on]"
- src.updateUsrDialog()
-
-/obj/machinery/bot/farmbot/turn_off()
- ..()
- src.path = new()
- src.icon_state = "farmbot[src.on]"
- src.updateUsrDialog()
-
-/obj/machinery/bot/farmbot/attack_paw(mob/user as mob)
- return attack_hand(user)
-
-
-/obj/machinery/bot/farmbot/proc/get_total_ferts()
- var total_fert = 0
- for (var/obj/item/nutrient/fert in contents)
- total_fert++
- return total_fert
-
-/obj/machinery/bot/farmbot/attack_hand(mob/user as mob)
- . = ..()
- if (.)
- return
- var/dat
- dat += "Automatic Hyrdoponic Assisting Unit v1.0
"
- dat += "Status: [src.on ? "On" : "Off"]
"
-
- dat += "Water Tank: "
- if ( tank )
- dat += "\[[tank.reagents.total_volume]/[tank.reagents.maximum_volume]\]"
- else
- dat += "Error: Water Tank not Found"
-
- dat += "
Fertilizer Storage: \[[get_total_ferts()]/[Max_Fertilizers]\]"
-
- dat += "
Behaviour controls are [src.locked ? "locked" : "unlocked"]
"
- if(!src.locked)
- dat += "Watering Controls:
"
- dat += " Water Plants : [src.setting_water ? "Yes" : "No"]
"
- dat += " Refill Watertank : [src.setting_refill ? "Yes" : "No"]
"
- dat += "
Fertilizer Controls:
"
- dat += " Fertilize Plants : [src.setting_fertilize ? "Yes" : "No"]
"
- dat += "
Weeding Controls:
"
- dat += " Weed Plants : [src.setting_weed ? "Yes" : "No"]
"
- dat += "
Ignore Weeds : [src.setting_ignoreWeeds ? "Yes" : "No"]
"
- dat += "Ignore Mushrooms : [src.setting_ignoreMushrooms ? "Yes" : "No"]
"
- dat += ""
-
- user << browse("Farmbot v1.0 controls[dat]", "window=autofarm")
- onclose(user, "autofarm")
- return
-
-/obj/machinery/bot/farmbot/Topic(href, href_list)
- if(..())
- return
- usr.machine = src
- src.add_fingerprint(usr)
- if ((href_list["power"]) && (src.allowed(usr)))
- if (src.on)
- turn_off()
- else
- turn_on()
-
- else if((href_list["water"]) && (!src.locked))
- setting_water = !setting_water
- else if((href_list["refill"]) && (!src.locked))
- setting_refill = !setting_refill
- else if((href_list["fertilize"]) && (!src.locked))
- setting_fertilize = !setting_fertilize
- else if((href_list["weed"]) && (!src.locked))
- setting_weed = !setting_weed
- else if((href_list["ignoreWeed"]) && (!src.locked))
- setting_ignoreWeeds = !setting_ignoreWeeds
- else if((href_list["ignoreMush"]) && (!src.locked))
- setting_ignoreMushrooms = !setting_ignoreMushrooms
- else if (href_list["eject"] )
- flick("farmbot_hatch",src)
- for (var/obj/item/nutrient/fert in contents)
- fert.loc = get_turf(src)
-
- src.updateUsrDialog()
- return
-
-/obj/machinery/bot/farmbot/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
- if (src.allowed(user))
- src.locked = !src.locked
- user << "Controls are now [src.locked ? "locked." : "unlocked."]"
- src.updateUsrDialog()
- else
- user << "\red Access denied."
-
- else if (istype(W, /obj/item/nutrient))
- if ( get_total_ferts() >= Max_Fertilizers )
- user << "The fertilizer storage is full!"
- return
- user.drop_item()
- W.loc = src
- user << "You insert [W]."
- flick("farmbot_hatch",src)
- src.updateUsrDialog()
- return
-
- else
- ..()
-
-/obj/machinery/bot/farmbot/Emag(mob/user as mob)
- ..()
- if(user) user << "\red You short out [src]'s plant identifier circuits."
- spawn(0)
- for(var/mob/O in hearers(src, null))
- O.show_message("\red [src] buzzes oddly!", 1)
- flick("farmbot_broke", src)
- src.emagged = 1
- src.on = 1
- src.icon_state = "farmbot[src.on]"
- target = null
- mode = FARMBOT_MODE_WAITING //Give the emagger a chance to get away! 15 seconds should be good.
- spawn(150)
- mode = 0
-
-/obj/machinery/bot/farmbot/explode()
- src.on = 0
- visible_message("\red [src] blows apart!", 1)
- var/turf/Tsec = get_turf(src)
-
- new /obj/item/weapon/minihoe(Tsec)
- new /obj/item/weapon/reagent_containers/glass/bucket(Tsec)
- new /obj/item/device/assembly/prox_sensor(Tsec)
- new /obj/item/device/analyzer/plant_analyzer(Tsec)
-
- if ( tank )
- tank.loc = Tsec
-
- for ( var/obj/item/nutrient/fert in contents )
- if ( prob(50) )
- fert.loc = Tsec
-
- if (prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
-
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(3, 1, src)
- s.start()
- del(src)
- return
-
-/obj/machinery/bot/farmbot/process()
- set background = 1
-
- if(!src.on)
- return
-
- if ( emagged && prob(1) )
- flick("farmbot_broke", src)
-
- if ( mode == FARMBOT_MODE_WAITING )
- return
-
- if ( !mode || !target || !(target in view(7,src)) ) //Don't bother chasing down targets out of view
-
- mode = 0
- target = null
- if ( !find_target() )
- // Couldn't find a target, wait a while before trying again.
- mode = FARMBOT_MODE_WAITING
- spawn(100)
- mode = 0
- return
-
- if ( mode && target )
- if ( get_dist(target,src) <= 1 || ( emagged && mode == FARMBOT_MODE_FERTILIZE ) )
- // If we are in emagged fertilize mode, we throw the fertilizer, so distance doesn't matter
- frustration = 0
- use_farmbot_item()
- else
- move_to_target()
- return
-
-/obj/machinery/bot/farmbot/proc/use_farmbot_item()
- if ( !target )
- mode = 0
- return 0
-
- if ( emagged && !ismob(target) ) // Humans are plants!
- mode = 0
- target = null
- return 0
-
- if ( !emagged && !istype(target,/obj/machinery/hydroponics) && !istype(target,/obj/structure/sink) ) // Humans are not plants!
- mode = 0
- target = null
- return 0
-
- if ( mode == FARMBOT_MODE_FERTILIZE )
- //Find which fertilizer to use
- var/obj/item/nutrient/fert
- for ( var/obj/item/nutrient/nut in contents )
- fert = nut
- break
- if ( !fert )
- target = null
- mode = 0
- return
- fertilize(fert)
-
- if ( mode == FARMBOT_MODE_WEED )
- weed()
-
- if ( mode == FARMBOT_MODE_WATER )
- water()
-
- if ( mode == FARMBOT_MODE_REFILL )
- refill()
-
-
-
-
-/obj/machinery/bot/farmbot/proc/find_target()
- if ( emagged ) //Find a human and help them!
- for ( var/mob/living/carbon/human/human in view(7,src) )
- if (human.stat == 2)
- continue
-
- var list/options = list(FARMBOT_MODE_WEED)
- if ( get_total_ferts() )
- options.Add(FARMBOT_MODE_FERTILIZE)
- if ( tank && tank.reagents.total_volume >= 1 )
- options.Add(FARMBOT_MODE_WATER)
- mode = pick(options)
- target = human
- return mode
- return 0
- else
- if ( setting_refill && tank && tank.reagents.total_volume < 100 )
- for ( var/obj/structure/sink/source in view(7,src) )
- target = source
- mode = FARMBOT_MODE_REFILL
- return 1
- for ( var/obj/machinery/hydroponics/tray in view(7,src) )
- var newMode = GetNeededMode(tray)
- if ( newMode )
- mode = newMode
- target = tray
- return 1
- return 0
-
-/obj/machinery/bot/farmbot/proc/GetNeededMode(obj/machinery/hydroponics/tray)
- if ( !tray.planted || tray.dead )
- return 0
- if ( tray.myseed.plant_type == 1 && setting_ignoreWeeds )
- return 0
- if ( tray.myseed.plant_type == 2 && setting_ignoreMushrooms )
- return 0
-
- if ( setting_water && tray.waterlevel <= 10 && tank && tank.reagents.total_volume >= 1 )
- return FARMBOT_MODE_WATER
-
- if ( setting_weed && tray.weedlevel >= 5 )
- return FARMBOT_MODE_WEED
-
- if ( setting_fertilize && tray.nutrilevel <= 2 && get_total_ferts() )
- return FARMBOT_MODE_FERTILIZE
-
- return 0
-
-/obj/machinery/bot/farmbot/proc/move_to_target()
- //Mostly copied from medibot code.
-
- if(src.frustration > 8)
- target = null
- mode = 0
- frustration = 0
- src.path = new()
- if(src.target && (src.path.len) && (get_dist(src.target,src.path[src.path.len]) > 2))
- src.path = new()
- if(src.target && src.path.len == 0 && (get_dist(src,src.target) > 1))
- spawn(0)
- var/turf/dest = get_step_towards(target,src) //Can't pathfind to a tray, as it is dense, so pathfind to the spot next to the tray
-
- src.path = AStar(src.loc, dest, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30,id=botcard)
- if(src.path.len == 0)
- for ( var/turf/spot in orange(1,target) ) //The closest one is unpathable, try the other spots
- if ( spot == dest ) //We already tried this spot
- continue
- if ( spot.density )
- continue
- src.path = AStar(src.loc, spot, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30,id=botcard)
- src.path = reverselist(src.path)
- if ( src.path.len > 0 )
- break
-
- if ( src.path.len == 0 )
- target = null
- mode = 0
- return
-
- if(src.path.len > 0 && src.target)
- step_to(src, src.path[1])
- src.path -= src.path[1]
- spawn(3)
- if(src.path.len)
- step_to(src, src.path[1])
- src.path -= src.path[1]
-
- if(src.path.len > 8 && src.target)
- src.frustration++
-
-
-/obj/machinery/bot/farmbot/proc/fertilize(obj/item/nutrient/fert)
- if ( !fert )
- target = null
- mode = 0
- return 0
-
- if ( emagged ) // Warning, hungry humans detected: throw fertilizer at them
- spawn(0)
- fert.loc = src.loc
- fert.throw_at(target, 16, 3, src)
- src.visible_message("\red [src] launches [fert.name] at [target.name]!")
- flick("farmbot_broke", src)
- spawn (FARMBOT_EMAG_DELAY)
- mode = 0
- target = null
- return 1
-
- else // feed them plants~
- var /obj/machinery/hydroponics/tray = target
- tray.nutrilevel = 10
- tray.yieldmod = fert.yieldmod
- tray.mutmod = fert.mutmod
- del fert
- tray.updateicon()
- icon_state = "farmbot_fertile"
- mode = FARMBOT_MODE_WAITING
-
- spawn (FARMBOT_ACTION_DELAY)
- mode = 0
- target = null
- spawn (FARMBOT_ANIMATION_TIME)
- icon_state = "farmbot[src.on]"
- return 1
-
-/obj/machinery/bot/farmbot/proc/weed()
- icon_state = "farmbot_hoe"
- spawn(FARMBOT_ANIMATION_TIME)
- icon_state = "farmbot[src.on]"
-
- if ( emagged ) // Warning, humans infested with weeds!
- mode = FARMBOT_MODE_WAITING
- spawn(FARMBOT_EMAG_DELAY)
- mode = 0
-
- if ( prob(50) ) // better luck next time little guy
- src.visible_message("\red [src] swings wildly at [target] with a minihoe, missing completely!")
-
- else // yayyy take that weeds~
- var/attackVerb = pick("slashed", "sliced", "cut", "clawed")
- var /mob/living/carbon/human/human = target
-
- src.visible_message("\red [src] [attackVerb] [human]!")
- var/damage = 5
- var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
- var/datum/organ/external/affecting = human.get_organ(ran_zone(dam_zone))
- var/armor = human.run_armor_check(affecting, "melee")
- human.apply_damage(damage,BRUTE,affecting,armor,sharp=1,edge=1)
-
- else // warning, plants infested with weeds!
- mode = FARMBOT_MODE_WAITING
- spawn(FARMBOT_ACTION_DELAY)
- mode = 0
-
- var /obj/machinery/hydroponics/tray = target
- tray.weedlevel = 0
- tray.updateicon()
-
-/obj/machinery/bot/farmbot/proc/water()
- if ( !tank || tank.reagents.total_volume < 1 )
- mode = 0
- target = null
- return 0
-
- icon_state = "farmbot_water"
- spawn(FARMBOT_ANIMATION_TIME)
- icon_state = "farmbot[src.on]"
-
- if ( emagged ) // warning, humans are thirsty!
- var splashAmount = min(70,tank.reagents.total_volume)
- src.visible_message("\red [src] splashes [target] with a bucket of water!")
- playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
- if ( prob(50) )
- tank.reagents.reaction(target, TOUCH) //splash the human!
- else
- tank.reagents.reaction(target.loc, TOUCH) //splash the human's roots!
- spawn(5)
- tank.reagents.remove_any(splashAmount)
-
- mode = FARMBOT_MODE_WAITING
- spawn(FARMBOT_EMAG_DELAY)
- mode = 0
- else
- var /obj/machinery/hydroponics/tray = target
- var/b_amount = tank.reagents.get_reagent_amount("water")
- if(b_amount > 0 && tray.waterlevel < 100)
- if(b_amount + tray.waterlevel > 100)
- b_amount = 100 - tray.waterlevel
- tank.reagents.remove_reagent("water", b_amount)
- tray.waterlevel += b_amount
- playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
-
- // Toxicity dilutation code. The more water you put in, the lesser the toxin concentration.
- tray.toxic -= round(b_amount/4)
- if (tray.toxic < 0 ) // Make sure it won't go overboard
- tray.toxic = 0
-
- tray.updateicon()
- mode = FARMBOT_MODE_WAITING
- spawn(FARMBOT_ACTION_DELAY)
- mode = 0
-
-/obj/machinery/bot/farmbot/proc/refill()
- if ( !tank || !tank.reagents.total_volume > 600 || !istype(target,/obj/structure/sink) )
- mode = 0
- target = null
- return
-
- mode = FARMBOT_MODE_WAITING
- playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
- src.visible_message("\blue [src] starts filling it's tank from [target].")
- spawn(300)
- src.visible_message("\blue [src] finishes filling it's tank.")
- src.mode = 0
- tank.reagents.add_reagent("water", tank.reagents.maximum_volume - tank.reagents.total_volume )
- playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
-
-
-/obj/item/weapon/farmbot_arm_assembly
- name = "water tank/robot arm assembly"
- desc = "A water tank with a robot arm permanently grafted to it."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "water_arm"
- var/build_step = 0
- var/created_name = "Farmbot" //To preserve the name if it's a unique farmbot I guess
- w_class = 3.0
-
- New()
- ..()
- spawn(4) // If an admin spawned it, it won't have a watertank it, so lets make one for em!
- var tank = locate(/obj/structure/reagent_dispensers/watertank) in contents
- if( !tank )
- new /obj/structure/reagent_dispensers/watertank(src)
-
-
-/obj/structure/reagent_dispensers/watertank/attackby(var/obj/item/robot_parts/S, mob/user as mob)
-
- if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
- ..()
- return
-
- //Making a farmbot!
-
- var/obj/item/weapon/farmbot_arm_assembly/A = new /obj/item/weapon/farmbot_arm_assembly
-
- A.loc = src.loc
- user << "You add the robot arm to the [src]"
- src.loc = A //Place the water tank into the assembly, it will be needed for the finished bot
- user.remove_from_mob(S)
- del(S)
-
-/obj/item/weapon/farmbot_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
- ..()
- if((istype(W, /obj/item/device/analyzer/plant_analyzer)) && (!src.build_step))
- src.build_step++
- user << "You add the plant analyzer to [src]!"
- src.name = "farmbot assembly"
- user.remove_from_mob(W)
- del(W)
-
- else if(( istype(W, /obj/item/weapon/reagent_containers/glass/bucket)) && (src.build_step == 1))
- src.build_step++
- user << "You add a bucket to [src]!"
- src.name = "farmbot assembly with bucket"
- user.remove_from_mob(W)
- del(W)
-
- else if(( istype(W, /obj/item/weapon/minihoe)) && (src.build_step == 2))
- src.build_step++
- user << "You add a minihoe to [src]!"
- src.name = "farmbot assembly with bucket and minihoe"
- user.remove_from_mob(W)
- del(W)
-
- else if((isprox(W)) && (src.build_step == 3))
- src.build_step++
- user << "You complete the Farmbot! Beep boop."
- var/obj/machinery/bot/farmbot/S = new /obj/machinery/bot/farmbot
- for ( var/obj/structure/reagent_dispensers/watertank/wTank in src.contents )
- wTank.loc = S
- S.tank = wTank
- S.loc = get_turf(src)
- S.name = src.created_name
- user.remove_from_mob(W)
- del(W)
- del(src)
-
- else if(istype(W, /obj/item/weapon/pen))
- var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
- t = sanitize(t, MAX_NAME_LEN)
- if (!t)
- return
- if (!in_range(src, usr) && src.loc != usr)
- return
-
- src.created_name = t
-
-/obj/item/weapon/farmbot_arm_assembly/attack_hand(mob/user as mob)
- return //it's a converted watertank, no you cannot pick it up and put it in your backpack
\ No newline at end of file
diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm
deleted file mode 100644
index b3c1c0376f..0000000000
--- a/code/game/machinery/bots/floorbot.dm
+++ /dev/null
@@ -1,449 +0,0 @@
-//Floorbot assemblies
-/obj/item/weapon/toolbox_tiles
- desc = "It's a toolbox with tiles sticking out the top"
- name = "tiles and toolbox"
- icon = 'icons/obj/aibots.dmi'
- icon_state = "toolbox_tiles"
- force = 3.0
- throwforce = 10.0
- throw_speed = 2
- throw_range = 5
- w_class = 3.0
- var/created_name = "Floorbot"
-
-/obj/item/weapon/toolbox_tiles_sensor
- desc = "It's a toolbox with tiles sticking out the top and a sensor attached"
- name = "tiles, toolbox and sensor arrangement"
- icon = 'icons/obj/aibots.dmi'
- icon_state = "toolbox_tiles_sensor"
- force = 3.0
- throwforce = 10.0
- throw_speed = 2
- throw_range = 5
- w_class = 3.0
- var/created_name = "Floorbot"
-
-//Floorbot
-/obj/machinery/bot/floorbot
- name = "Floorbot"
- desc = "A little floor repairing robot, he looks so excited!"
- icon = 'icons/obj/aibots.dmi'
- icon_state = "floorbot0"
- layer = 5.0
- density = 0
- anchored = 0
- health = 25
- maxhealth = 25
- //weight = 1.0E7
- var/amount = 10
- var/repairing = 0
- var/improvefloors = 0
- var/eattiles = 0
- var/maketiles = 0
- var/turf/target
- var/turf/oldtarget
- var/oldloc = null
- req_access = list(access_construction)
- var/path[] = new()
- var/targetdirection
-
-
-/obj/machinery/bot/floorbot/New()
- ..()
- src.updateicon()
-
-/obj/machinery/bot/floorbot/turn_on()
- . = ..()
- src.updateicon()
- src.updateUsrDialog()
-
-/obj/machinery/bot/floorbot/turn_off()
- ..()
- src.target = null
- src.oldtarget = null
- src.oldloc = null
- src.updateicon()
- src.path = new()
- src.updateUsrDialog()
-
-/obj/machinery/bot/floorbot/attack_hand(mob/user as mob)
- . = ..()
- if (.)
- return
- usr.set_machine(src)
- interact(user)
-
-/obj/machinery/bot/floorbot/interact(mob/user as mob)
- var/dat
- dat += "Automatic Station Floor Repairer v1.0
"
- dat += "Status: [src.on ? "On" : "Off"]
"
- dat += "Maintenance panel is [src.open ? "opened" : "closed"]
"
- dat += "Tiles left: [src.amount]
"
- dat += "Behvaiour controls are [src.locked ? "locked" : "unlocked"]
"
- if(!src.locked || issilicon(user))
- dat += "Improves floors: [src.improvefloors ? "Yes" : "No"]
"
- dat += "Finds tiles: [src.eattiles ? "Yes" : "No"]
"
- dat += "Make singles pieces of metal into tiles when empty: [src.maketiles ? "Yes" : "No"]
"
- var/bmode
- if (src.targetdirection)
- bmode = dir2text(src.targetdirection)
- else
- bmode = "Disabled"
- dat += "
Bridge Mode : [bmode]
"
-
- user << browse("Repairbot v1.0 controls[dat]", "window=autorepair")
- onclose(user, "autorepair")
- return
-
-
-/obj/machinery/bot/floorbot/attackby(var/obj/item/W , mob/user as mob)
- if(istype(W, /obj/item/stack/tile/plasteel))
- var/obj/item/stack/tile/plasteel/T = W
- if(src.amount >= 50)
- return
- var/loaded = min(50-src.amount, T.get_amount())
- T.use(loaded)
- src.amount += loaded
- user << "You load [loaded] tiles into the floorbot. He now contains [src.amount] tiles."
- src.updateicon()
- else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
- if(src.allowed(usr) && !open && !emagged)
- src.locked = !src.locked
- user << "You [src.locked ? "lock" : "unlock"] the [src] behaviour controls."
- else
- if(emagged)
- user << "ERROR"
- if(open)
- user << "Please close the access panel before locking it."
- else
- user << "Access denied."
- src.updateUsrDialog()
- else
- ..()
-
-/obj/machinery/bot/floorbot/Emag(mob/user as mob)
- ..()
- if(open && !locked)
- if(user) user << "The [src] buzzes and beeps."
-
-/obj/machinery/bot/floorbot/Topic(href, href_list)
- if(..())
- return
- usr.set_machine(src)
- src.add_fingerprint(usr)
- switch(href_list["operation"])
- if("start")
- if (src.on)
- turn_off()
- else
- turn_on()
- if("improve")
- src.improvefloors = !src.improvefloors
- src.updateUsrDialog()
- if("tiles")
- src.eattiles = !src.eattiles
- src.updateUsrDialog()
- if("make")
- src.maketiles = !src.maketiles
- src.updateUsrDialog()
- if("bridgemode")
- switch(src.targetdirection)
- if(null)
- targetdirection = 1
- if(1)
- targetdirection = 2
- if(2)
- targetdirection = 4
- if(4)
- targetdirection = 8
- if(8)
- targetdirection = null
- else
- targetdirection = null
- src.updateUsrDialog()
-
-/obj/machinery/bot/floorbot/process()
- set background = 1
-
- if(!src.on)
- return
- if(src.repairing)
- return
- var/list/floorbottargets = list()
- if(src.amount <= 0 && ((src.target == null) || !src.target))
- if(src.eattiles)
- for(var/obj/item/stack/tile/plasteel/T in view(7, src))
- if(T != src.oldtarget && !(target in floorbottargets))
- src.oldtarget = T
- src.target = T
- break
- if(src.target == null || !src.target)
- if(src.maketiles)
- if(src.target == null || !src.target)
- for(var/obj/item/stack/sheet/metal/M in view(7, src))
- if(!(M in floorbottargets) && M != src.oldtarget && M.amount == 1 && !(istype(M.loc, /turf/simulated/wall)))
- src.oldtarget = M
- src.target = M
- break
- else
- return
- if(prob(5))
- visible_message("[src] makes an excited booping beeping sound!")
-
- if((!src.target || src.target == null) && emagged < 2)
- if(targetdirection != null)
- /*
- for (var/turf/space/D in view(7,src))
- if(!(D in floorbottargets) && D != src.oldtarget) // Added for bridging mode -- TLE
- if(get_dir(src, D) == targetdirection)
- src.oldtarget = D
- src.target = D
- break
- */
- var/turf/T = get_step(src, targetdirection)
- if(istype(T, /turf/space))
- src.oldtarget = T
- src.target = T
- if(!src.target || src.target == null)
- for (var/turf/space/D in view(7,src))
- if(!(D in floorbottargets) && D != src.oldtarget && (D.loc.name != "Space"))
- src.oldtarget = D
- src.target = D
- break
- if((!src.target || src.target == null ) && src.improvefloors)
- for (var/turf/simulated/floor/F in view(7,src))
- if(!(F in floorbottargets) && F != src.oldtarget && F.icon_state == "Floor1" && !(istype(F, /turf/simulated/floor/plating)))
- src.oldtarget = F
- src.target = F
- break
- if((!src.target || src.target == null) && src.eattiles)
- for(var/obj/item/stack/tile/plasteel/T in view(7, src))
- if(!(T in floorbottargets) && T != src.oldtarget)
- src.oldtarget = T
- src.target = T
- break
-
- if((!src.target || src.target == null) && emagged == 2)
- if(!src.target || src.target == null)
- for (var/turf/simulated/floor/D in view(7,src))
- if(!(D in floorbottargets) && D != src.oldtarget && D.floor_type)
- src.oldtarget = D
- src.target = D
- break
-
- if(!src.target || src.target == null)
- if(src.loc != src.oldloc)
- src.oldtarget = null
- return
-
- if(src.target && (src.target != null) && src.path.len == 0)
- spawn(0)
- if(!istype(src.target, /turf/))
- src.path = AStar(src.loc, src.target.loc, /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30, id=botcard)
- else
- src.path = AStar(src.loc, src.target, /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30, id=botcard)
- if (!src.path) src.path = list()
- if(src.path.len == 0)
- src.oldtarget = src.target
- src.target = null
- return
- if(src.path.len > 0 && src.target && (src.target != null))
- step_to(src, src.path[1])
- src.path -= src.path[1]
- else if(src.path.len == 1)
- step_to(src, target)
- src.path = new()
-
- if(src.loc == src.target || src.loc == src.target.loc)
- if(istype(src.target, /obj/item/stack/tile/plasteel))
- src.eattile(src.target)
- else if(istype(src.target, /obj/item/stack/sheet/metal))
- src.maketile(src.target)
- else if(istype(src.target, /turf/) && emagged < 2)
- repair(src.target)
- else if(emagged == 2 && istype(src.target,/turf/simulated/floor))
- var/turf/simulated/floor/F = src.target
- src.anchored = 1
- src.repairing = 1
- if(prob(90))
- F.break_tile_to_plating()
- else
- F.ReplaceWithLattice()
- visible_message("\red [src] makes an excited booping sound.")
- spawn(50)
- src.amount ++
- src.anchored = 0
- src.repairing = 0
- src.target = null
- src.path = new()
- return
-
- src.oldloc = src.loc
-
-
-/obj/machinery/bot/floorbot/proc/repair(var/turf/target)
- if(istype(target, /turf/space/))
- if(target.loc.name == "Space")
- return
- else if(!istype(target, /turf/simulated/floor))
- return
- if(src.amount <= 0)
- return
- src.anchored = 1
- src.icon_state = "floorbot-c"
- if(istype(target, /turf/space/))
- visible_message("\red [src] begins to repair the hole")
- var/obj/item/stack/tile/plasteel/T = new /obj/item/stack/tile/plasteel
- src.repairing = 1
- spawn(50)
- T.build(src.loc)
- src.repairing = 0
- src.amount -= 1
- src.updateicon()
- src.anchored = 0
- src.target = null
- else
- visible_message("\red [src] begins to improve the floor.")
- src.repairing = 1
- spawn(50)
- src.loc.icon_state = "floor"
- src.repairing = 0
- src.amount -= 1
- src.updateicon()
- src.anchored = 0
- src.target = null
-
-/obj/machinery/bot/floorbot/proc/eattile(var/obj/item/stack/tile/plasteel/T)
- if(!istype(T, /obj/item/stack/tile/plasteel))
- return
- visible_message("\red [src] begins to collect tiles.")
- src.repairing = 1
- spawn(20)
- if(isnull(T))
- src.target = null
- src.repairing = 0
- return
- if(src.amount + T.get_amount() > 50)
- var/i = 50 - src.amount
- src.amount += i
- T.use(i)
- else
- src.amount += T.get_amount()
- del(T)
- src.updateicon()
- src.target = null
- src.repairing = 0
-
-/obj/machinery/bot/floorbot/proc/maketile(var/obj/item/stack/sheet/metal/M)
- if(!istype(M, /obj/item/stack/sheet/metal))
- return
- if(M.get_amount() > 1)
- return
- visible_message("\red [src] begins to create tiles.")
- src.repairing = 1
- spawn(20)
- if(isnull(M))
- src.target = null
- src.repairing = 0
- return
- var/obj/item/stack/tile/plasteel/T = new /obj/item/stack/tile/plasteel
- T.amount = 4
- T.loc = M.loc
- del(M)
- src.target = null
- src.repairing = 0
-
-/obj/machinery/bot/floorbot/proc/updateicon()
- if(src.amount > 0)
- src.icon_state = "floorbot[src.on]"
- else
- src.icon_state = "floorbot[src.on]e"
-
-/obj/machinery/bot/floorbot/explode()
- src.on = 0
- src.visible_message("\red [src] blows apart!", 1)
- var/turf/Tsec = get_turf(src)
-
- var/obj/item/weapon/storage/toolbox/mechanical/N = new /obj/item/weapon/storage/toolbox/mechanical(Tsec)
- N.contents = list()
-
- new /obj/item/device/assembly/prox_sensor(Tsec)
-
- if (prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
-
- while (amount)//Dumps the tiles into the appropriate sized stacks
- if(amount >= 16)
- var/obj/item/stack/tile/plasteel/T = new (Tsec)
- T.amount = 16
- amount -= 16
- else
- var/obj/item/stack/tile/plasteel/T = new (Tsec)
- T.amount = src.amount
- amount = 0
-
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(3, 1, src)
- s.start()
- del(src)
- return
-
-
-/obj/item/weapon/storage/toolbox/mechanical/attackby(var/obj/item/stack/tile/plasteel/T, mob/user as mob)
- if(!istype(T, /obj/item/stack/tile/plasteel))
- ..()
- return
- if(src.contents.len >= 1)
- user << "They wont fit in as there is already stuff inside."
- return
- if(user.s_active)
- user.s_active.close(user)
- if (T.use(10))
- var/obj/item/weapon/toolbox_tiles/B = new /obj/item/weapon/toolbox_tiles
- user.put_in_hands(B)
- user << "You add the tiles into the empty toolbox. They protrude from the top."
- user.drop_from_inventory(src)
- del(src)
- else
- user << "You need 10 floortiles for a floorbot."
- return
-
-/obj/item/weapon/toolbox_tiles/attackby(var/obj/item/W, mob/user as mob)
- ..()
- if(isprox(W))
- del(W)
- var/obj/item/weapon/toolbox_tiles_sensor/B = new /obj/item/weapon/toolbox_tiles_sensor()
- B.created_name = src.created_name
- user.put_in_hands(B)
- user << "You add the sensor to the toolbox and tiles!"
- user.drop_from_inventory(src)
- del(src)
-
- else if (istype(W, /obj/item/weapon/pen))
- var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
- if (!t)
- return
- if (!in_range(src, usr) && src.loc != usr)
- return
-
- src.created_name = t
-
-/obj/item/weapon/toolbox_tiles_sensor/attackby(var/obj/item/W, mob/user as mob)
- ..()
- if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
- del(W)
- var/turf/T = get_turf(user.loc)
- var/obj/machinery/bot/floorbot/A = new /obj/machinery/bot/floorbot(T)
- A.name = src.created_name
- user << "You add the robot arm to the odd looking toolbox assembly! Boop beep!"
- user.drop_from_inventory(src)
- del(src)
- else if (istype(W, /obj/item/weapon/pen))
- var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
-
- if (!t)
- return
- if (!in_range(src, usr) && src.loc != usr)
- return
-
- src.created_name = t
diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm
deleted file mode 100644
index 8ce3522707..0000000000
--- a/code/game/machinery/bots/medbot.dm
+++ /dev/null
@@ -1,596 +0,0 @@
-//MEDBOT
-//MEDBOT PATHFINDING
-//MEDBOT ASSEMBLY
-
-
-/obj/machinery/bot/medbot
- name = "Medibot"
- desc = "A little medical robot. He looks somewhat underwhelmed."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "medibot0"
- layer = 5.0
- density = 0
- anchored = 0
- health = 20
- maxhealth = 20
- req_access =list(access_medical)
- var/stunned = 0 //It can be stunned by tasers. Delicate circuits.
-//var/emagged = 0
- var/list/botcard_access = list(access_medical)
- var/obj/item/weapon/reagent_containers/glass/reagent_glass = null //Can be set to draw from this for reagents.
- var/skin = null //Set to "tox", "ointment" or "o2" for the other two firstaid kits.
- var/frustration = 0
- var/path[] = new()
- var/mob/living/carbon/patient = null
- var/mob/living/carbon/oldpatient = null
- var/oldloc = null
- var/last_found = 0
- var/last_newpatient_speak = 0 //Don't spam the "HEY I'M COMING" messages
- var/currently_healing = 0
- var/injection_amount = 15 //How much reagent do we inject at a time?
- var/heal_threshold = 10 //Start healing when they have this much damage in a category
- var/use_beaker = 0 //Use reagents in beaker instead of default treatment agents.
- //Setting which reagents to use to treat what by default. By id.
- var/treatment_brute = "tricordrazine"
- var/treatment_oxy = "tricordrazine"
- var/treatment_fire = "tricordrazine"
- var/treatment_tox = "tricordrazine"
- var/treatment_virus = "spaceacillin"
- var/declare_treatment = 0 //When attempting to treat a patient, should it notify everyone wearing medhuds?
- var/shut_up = 0 //self explanatory :)
-
-/obj/machinery/bot/medbot/mysterious
- name = "Mysterious Medibot"
- desc = "International Medibot of mystery."
- skin = "bezerk"
- treatment_oxy = "dexalinp"
- treatment_brute = "bicaridine"
- treatment_fire = "kelotane"
- treatment_tox = "anti_toxin"
-
-/obj/item/weapon/firstaid_arm_assembly
- name = "first aid/robot arm assembly"
- desc = "A first aid kit with a robot arm permanently grafted to it."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "firstaid_arm"
- var/build_step = 0
- var/created_name = "Medibot" //To preserve the name if it's a unique medbot I guess
- var/skin = null //Same as medbot, set to tox or ointment for the respective kits.
- w_class = 3.0
-
- New()
- ..()
- spawn(5)
- if(src.skin)
- src.overlays += image('icons/obj/aibots.dmi', "kit_skin_[src.skin]")
-
-
-/obj/machinery/bot/medbot/New()
- ..()
- src.icon_state = "medibot[src.on]"
-
- spawn(4)
- if(src.skin)
- src.overlays += image('icons/obj/aibots.dmi', "medskin_[src.skin]")
-
- src.botcard = new /obj/item/weapon/card/id(src)
- if(isnull(src.botcard_access) || (src.botcard_access.len < 1))
- src.botcard.access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics)
- else
- src.botcard.access = src.botcard_access
-
-/obj/machinery/bot/medbot/turn_on()
- . = ..()
- src.icon_state = "medibot[src.on]"
- src.updateUsrDialog()
-
-/obj/machinery/bot/medbot/turn_off()
- ..()
- src.patient = null
- src.oldpatient = null
- src.oldloc = null
- src.path = new()
- src.currently_healing = 0
- src.last_found = world.time
- src.icon_state = "medibot[src.on]"
- src.updateUsrDialog()
-
-/obj/machinery/bot/medbot/attack_hand(mob/user as mob)
- . = ..()
- if (.)
- return
- var/dat
- dat += "Automatic Medical Unit v1.0
"
- dat += "Status: [src.on ? "On" : "Off"]
"
- dat += "Maintenance panel is [src.open ? "opened" : "closed"]
"
- dat += "Beaker: "
- if (src.reagent_glass)
- dat += "Loaded \[[src.reagent_glass.reagents.total_volume]/[src.reagent_glass.reagents.maximum_volume]\]"
- else
- dat += "None Loaded"
- dat += "
Behaviour controls are [src.locked ? "locked" : "unlocked"]
"
- if(!src.locked || issilicon(user))
- dat += "Healing Threshold: "
- dat += "-- "
- dat += "- "
- dat += "[src.heal_threshold] "
- dat += "+ "
- dat += "++"
- dat += "
"
-
- dat += "Injection Level: "
- dat += "- "
- dat += "[src.injection_amount] "
- dat += "+ "
- dat += "
"
-
- dat += "Reagent Source: "
- dat += "[src.use_beaker ? "Loaded Beaker (When available)" : "Internal Synthesizer"]
"
-
- dat += "Treatment report is [src.declare_treatment ? "on" : "off"]. Toggle
"
-
- dat += "The speaker switch is [src.shut_up ? "off" : "on"]. Toggle
"
-
- user << browse("Medibot v1.0 controls[dat]", "window=automed")
- onclose(user, "automed")
- return
-
-/obj/machinery/bot/medbot/Topic(href, href_list)
- if(..())
- return
- usr.set_machine(src)
- src.add_fingerprint(usr)
- if ((href_list["power"]) && (src.allowed(usr)))
- if (src.on)
- turn_off()
- else
- turn_on()
-
- else if((href_list["adj_threshold"]) && (!src.locked || issilicon(usr)))
- var/adjust_num = text2num(href_list["adj_threshold"])
- src.heal_threshold += adjust_num
- if(src.heal_threshold < 5)
- src.heal_threshold = 5
- if(src.heal_threshold > 75)
- src.heal_threshold = 75
-
- else if((href_list["adj_inject"]) && (!src.locked || issilicon(usr)))
- var/adjust_num = text2num(href_list["adj_inject"])
- src.injection_amount += adjust_num
- if(src.injection_amount < 5)
- src.injection_amount = 5
- if(src.injection_amount > 15)
- src.injection_amount = 15
-
- else if((href_list["use_beaker"]) && (!src.locked || issilicon(usr)))
- src.use_beaker = !src.use_beaker
-
- else if (href_list["eject"] && (!isnull(src.reagent_glass)))
- if(!src.locked)
- src.reagent_glass.loc = get_turf(src)
- src.reagent_glass = null
- else
- usr << "You cannot eject the beaker because the panel is locked."
-
- else if ((href_list["togglevoice"]) && (!src.locked || issilicon(usr)))
- src.shut_up = !src.shut_up
-
- else if ((href_list["declaretreatment"]) && (!src.locked || issilicon(usr)))
- src.declare_treatment = !src.declare_treatment
-
- src.updateUsrDialog()
- return
-
-/obj/machinery/bot/medbot/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
- if (src.allowed(user) && !open && !emagged)
- src.locked = !src.locked
- user << "Controls are now [src.locked ? "locked." : "unlocked."]"
- src.updateUsrDialog()
- else
- if(emagged)
- user << "ERROR"
- if(open)
- user << "Please close the access panel before locking it."
- else
- user << "Access denied."
-
- else if (istype(W, /obj/item/weapon/reagent_containers/glass))
- if(src.locked)
- user << "You cannot insert a beaker because the panel is locked."
- return
- if(!isnull(src.reagent_glass))
- user << "There is already a beaker loaded."
- return
-
- user.drop_item()
- W.loc = src
- src.reagent_glass = W
- user << "You insert [W]."
- src.updateUsrDialog()
- return
-
- else
- ..()
- if (health < maxhealth && !istype(W, /obj/item/weapon/screwdriver) && W.force)
- step_to(src, (get_step_away(src,user)))
-
-/obj/machinery/bot/medbot/Emag(mob/user as mob)
- ..()
- if(open && !locked)
- if(user) user << "You short out [src]'s reagent synthesis circuits."
- spawn(0)
- for(var/mob/O in hearers(src, null))
- O.show_message("\red [src] buzzes oddly!", 1)
- flick("medibot_spark", src)
- src.patient = null
- if(user) src.oldpatient = user
- src.currently_healing = 0
- src.last_found = world.time
- src.anchored = 0
- src.emagged = 2
- src.on = 1
- src.icon_state = "medibot[src.on]"
-
-/obj/machinery/bot/medbot/process()
- set background = 1
-
- if(!src.on)
- src.stunned = 0
- return
-
- if(src.stunned)
- src.icon_state = "medibota"
- src.stunned--
-
- src.oldpatient = src.patient
- src.patient = null
- src.currently_healing = 0
-
- if(src.stunned <= 0)
- src.icon_state = "medibot[src.on]"
- src.stunned = 0
- return
-
- if(src.frustration > 8)
- src.oldpatient = src.patient
- src.patient = null
- src.currently_healing = 0
- src.last_found = world.time
- src.path = new()
-
- if(!src.patient)
- if(!src.shut_up && prob(1))
- var/message = pick("Radar, put a mask on!","There's always a catch, and it's the best there is.","I knew it, I should've been a plastic surgeon.","What kind of medbay is this? Everyone's dropping like dead flies.","Delicious!")
- src.speak(message)
-
- for (var/mob/living/carbon/C in view(7,src)) //Time to find a patient!
- if ((C.stat == 2) || !istype(C, /mob/living/carbon/human))
- continue
-
- if ((C == src.oldpatient) && (world.time < src.last_found + 100))
- continue
-
- if(src.assess_patient(C))
- src.patient = C
- src.oldpatient = C
- src.last_found = world.time
- if((src.last_newpatient_speak + 300) < world.time) //Don't spam these messages!
- var/message = pick("Hey, [C.name]! Hold on, I'm coming.","Wait [C.name]! I want to help!","[C.name], you appear to be injured!")
- src.speak(message)
- src.visible_message("[src] points at [C.name]!")
- src.last_newpatient_speak = world.time
- break
- else
- continue
-
-
- if(src.patient && Adjacent(patient))
- if(!src.currently_healing)
- src.currently_healing = 1
- src.frustration = 0
- src.medicate_patient(src.patient)
- return
-
- else if(src.patient && (src.path.len) && (get_dist(src.patient,src.path[src.path.len]) > 2))
- src.path = new()
- src.currently_healing = 0
- src.last_found = world.time
-
- if(src.patient && src.path.len == 0 && (get_dist(src,src.patient) > 1))
- spawn(0)
- src.path = AStar(src.loc, get_turf(src.patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30,id=botcard)
- if (!path) path = list()
- if(src.path.len == 0)
- src.oldpatient = src.patient
- src.patient = null
- src.currently_healing = 0
- src.last_found = world.time
- return
-
- if(src.path.len > 0 && src.patient)
- step_to(src, src.path[1])
- src.path -= src.path[1]
- spawn(3)
- if(src.path.len)
- step_to(src, src.path[1])
- src.path -= src.path[1]
-
- if(src.path.len > 8 && src.patient)
- src.frustration++
-
- return
-
-/obj/machinery/bot/medbot/proc/assess_patient(mob/living/carbon/C as mob)
- //Time to see if they need medical help!
- if(C.stat == 2)
- return 0 //welp too late for them!
-
- if(C.suiciding)
- return 0 //Kevorkian school of robotic medical assistants.
-
- if(src.emagged == 2) //Everyone needs our medicine. (Our medicine is toxins)
- return 1
-
- //If they're injured, we're using a beaker, and don't have one of our WONDERCHEMS.
- if((src.reagent_glass) && (src.use_beaker) && ((C.getBruteLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getToxLoss() >= heal_threshold) || (C.getOxyLoss() >= (heal_threshold + 15))))
- for(var/datum/reagent/R in src.reagent_glass.reagents.reagent_list)
- if(!C.reagents.has_reagent(R))
- return 1
- continue
-
- //They're injured enough for it!
- if((C.getBruteLoss() >= heal_threshold) && (!C.reagents.has_reagent(src.treatment_brute)))
- return 1 //If they're already medicated don't bother!
-
- if((C.getOxyLoss() >= (15 + heal_threshold)) && (!C.reagents.has_reagent(src.treatment_oxy)))
- return 1
-
- if((C.getFireLoss() >= heal_threshold) && (!C.reagents.has_reagent(src.treatment_fire)))
- return 1
-
- if((C.getToxLoss() >= heal_threshold) && (!C.reagents.has_reagent(src.treatment_tox)))
- return 1
-
-
- for(var/datum/disease/D in C.viruses)
- if((D.stage > 1) || (D.spread_type == AIRBORNE))
-
- if (!C.reagents.has_reagent(src.treatment_virus))
- return 1 //STOP DISEASE FOREVER
-
- return 0
-
-/obj/machinery/bot/medbot/proc/medicate_patient(mob/living/carbon/C as mob)
- if(!src.on)
- return
-
- if(!istype(C))
- src.oldpatient = src.patient
- src.patient = null
- src.currently_healing = 0
- src.last_found = world.time
- return
-
- if(C.stat == 2)
- var/death_message = pick("No! NO!","Live, damnit! LIVE!","I...I've never lost a patient before. Not today, I mean.")
- src.speak(death_message)
- src.oldpatient = src.patient
- src.patient = null
- src.currently_healing = 0
- src.last_found = world.time
- return
-
- var/reagent_id = null
-
- //Use whatever is inside the loaded beaker. If there is one.
- if((src.use_beaker) && (src.reagent_glass) && (src.reagent_glass.reagents.total_volume))
- reagent_id = "internal_beaker"
-
- if(src.emagged == 2) //Emagged! Time to poison everybody.
- reagent_id = "toxin"
-
- var/virus = 0
- for(var/datum/disease/D in C.viruses)
- virus = 1
-
- if (!reagent_id && (virus))
- if(!C.reagents.has_reagent(src.treatment_virus))
- reagent_id = src.treatment_virus
-
- if (!reagent_id && (C.getBruteLoss() >= heal_threshold))
- if(!C.reagents.has_reagent(src.treatment_brute))
- reagent_id = src.treatment_brute
-
- if (!reagent_id && (C.getOxyLoss() >= (15 + heal_threshold)))
- if(!C.reagents.has_reagent(src.treatment_oxy))
- reagent_id = src.treatment_oxy
-
- if (!reagent_id && (C.getFireLoss() >= heal_threshold))
- if(!C.reagents.has_reagent(src.treatment_fire))
- reagent_id = src.treatment_fire
-
- if (!reagent_id && (C.getToxLoss() >= heal_threshold))
- if(!C.reagents.has_reagent(src.treatment_tox))
- reagent_id = src.treatment_tox
-
- if(!reagent_id) //If they don't need any of that they're probably cured!
- src.oldpatient = src.patient
- src.patient = null
- src.currently_healing = 0
- src.last_found = world.time
- var/message = pick("All patched up!","An apple a day keeps me away.","Feel better soon!")
- src.speak(message)
- return
- else
- src.icon_state = "medibots"
- visible_message("\red [src] is trying to inject [src.patient]!")
- spawn(30)
- if ((get_dist(src, src.patient) <= 1) && (src.on))
- if((reagent_id == "internal_beaker") && (src.reagent_glass) && (src.reagent_glass.reagents.total_volume))
- src.reagent_glass.reagents.trans_to(src.patient,src.injection_amount) //Inject from beaker instead.
- src.reagent_glass.reagents.reaction(src.patient, 2)
- else
- src.patient.reagents.add_reagent(reagent_id,src.injection_amount)
- visible_message("\red [src] injects [src.patient] with the syringe!")
-
- if(declare_treatment)
- var/area/location = get_area(src)
- broadcast_medical_hud_message("[src.name] is treating [C] in [location]", src)
-
- src.icon_state = "medibot[src.on]"
- src.currently_healing = 0
- return
-
-// src.speak(reagent_id)
- reagent_id = null
- return
-
-
-/obj/machinery/bot/medbot/proc/speak(var/message)
- if((!src.on) || (!message))
- return
- visible_message("[src] beeps, \"[message]\"")
- return
-
-/obj/machinery/bot/medbot/bullet_act(var/obj/item/projectile/Proj)
- if(Proj.taser_effect)
- src.stunned = min(stunned+10,20)
- ..()
-
-/obj/machinery/bot/medbot/explode()
- src.on = 0
- visible_message("\red [src] blows apart!", 1)
- var/turf/Tsec = get_turf(src)
-
- new /obj/item/weapon/storage/firstaid(Tsec)
-
- new /obj/item/device/assembly/prox_sensor(Tsec)
-
- new /obj/item/device/healthanalyzer(Tsec)
-
- if(src.reagent_glass)
- src.reagent_glass.loc = Tsec
- src.reagent_glass = null
-
- if (prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
-
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(3, 1, src)
- s.start()
- del(src)
- return
-
-/obj/machinery/bot/medbot/Bump(M as mob|obj) //Leave no door unopened!
- if ((istype(M, /obj/machinery/door)) && (!isnull(src.botcard)))
- var/obj/machinery/door/D = M
- if (!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard) && !istype(D,/obj/machinery/door/blast))
- D.open()
- src.frustration = 0
- else if ((istype(M, /mob/living/)) && (!src.anchored))
- src.loc = M:loc
- src.frustration = 0
- return
-
-/* terrible
-/obj/machinery/bot/medbot/Bumped(atom/movable/M as mob|obj)
- spawn(0)
- if (M)
- var/turf/T = get_turf(src)
- M:loc = T
-*/
-
-/*
- * Pathfinding procs, allow the medibot to path through doors it has access to.
- */
-
-//Pretty ugh
-/*
-/turf/proc/AdjacentTurfsAllowMedAccess()
- var/L[] = new()
- for(var/turf/t in oview(src,1))
- if(!t.density)
- if(!LinkBlocked(src, t) && !TurfBlockedNonWindowNonDoor(t,get_access("Medical Doctor")))
- L.Add(t)
- return L
-
-
-//It isn't blocked if we can open it, man.
-/proc/TurfBlockedNonWindowNonDoor(turf/loc, var/list/access)
- for(var/obj/O in loc)
- if(O.density && !istype(O, /obj/structure/window) && !istype(O, /obj/machinery/door))
- return 1
-
- if (O.density && (istype(O, /obj/machinery/door)) && (access.len))
- var/obj/machinery/door/D = O
- for(var/req in D.req_access)
- if(!(req in access)) //doesn't have this access
- return 1
-
- return 0
-*/
-
-/*
- * Medbot Assembly -- Can be made out of all three medkits.
- */
-
-/obj/item/weapon/storage/firstaid/attackby(var/obj/item/robot_parts/S, mob/user as mob)
-
- if ((!istype(S, /obj/item/robot_parts/l_arm)) && (!istype(S, /obj/item/robot_parts/r_arm)))
- ..()
- return
-
- //Making a medibot!
- if(src.contents.len >= 1)
- user << "You need to empty [src] out first."
- return
-
- var/obj/item/weapon/firstaid_arm_assembly/A = new /obj/item/weapon/firstaid_arm_assembly
- if(istype(src,/obj/item/weapon/storage/firstaid/fire))
- A.skin = "ointment"
- else if(istype(src,/obj/item/weapon/storage/firstaid/toxin))
- A.skin = "tox"
- else if(istype(src,/obj/item/weapon/storage/firstaid/o2))
- A.skin = "o2"
-
- del(S)
- user.put_in_hands(A)
- user << "You add the robot arm to the first aid kit."
- user.drop_from_inventory(src)
- del(src)
-
-
-/obj/item/weapon/firstaid_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
- ..()
- if(istype(W, /obj/item/weapon/pen))
- var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
- if (!t)
- return
- if (!in_range(src, usr) && src.loc != usr)
- return
- src.created_name = t
- else
- switch(build_step)
- if(0)
- if(istype(W, /obj/item/device/healthanalyzer))
- user.drop_item()
- del(W)
- src.build_step++
- user << "You add the health sensor to [src]."
- src.name = "First aid/robot arm/health analyzer assembly"
- src.overlays += image('icons/obj/aibots.dmi', "na_scanner")
-
- if(1)
- if(isprox(W))
- user.drop_item()
- del(W)
- src.build_step++
- user << "You complete the Medibot! Beep boop."
- var/turf/T = get_turf(src)
- var/obj/machinery/bot/medbot/S = new /obj/machinery/bot/medbot(T)
- S.skin = src.skin
- S.name = src.created_name
- user.drop_from_inventory(src)
- del(src)
-
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index bd39d2034c..125345c518 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -76,6 +76,12 @@
suffix = "#[count]"
name = "Mulebot ([suffix])"
+/obj/machinery/bot/mulebot/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src,beacon_freq)
+ radio_controller.remove_object(src,control_freq)
+ ..()
+
// attack by item
// emag : lock/unlock,
// screwdriver: open/close hatch
@@ -862,8 +868,8 @@
var/turf/Tsec = get_turf(src)
new /obj/item/device/assembly/prox_sensor(Tsec)
- new /obj/item/stack/rods(Tsec)
- new /obj/item/stack/rods(Tsec)
+ PoolOrNew(/obj/item/stack/rods, Tsec)
+ PoolOrNew(/obj/item/stack/rods, Tsec)
new /obj/item/stack/cable_coil/cut(Tsec)
if (cell)
cell.loc = Tsec
@@ -876,4 +882,4 @@
new /obj/effect/decal/cleanable/blood/oil(src.loc)
unload(0)
- del(src)
+ qdel(src)
diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm
deleted file mode 100644
index 92b7297c42..0000000000
--- a/code/game/machinery/bots/secbot.dm
+++ /dev/null
@@ -1,924 +0,0 @@
-/obj/machinery/bot/secbot
- name = "Securitron"
- desc = "A little security robot. He looks less than thrilled."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "secbot0"
- layer = 5.0
- density = 0
- anchored = 0
- health = 25
- maxhealth = 25
- fire_dam_coeff = 0.7
- brute_dam_coeff = 0.5
- req_one_access = list(access_security, access_forensics_lockers)
-
- var/mob/target
- var/oldtarget_name
- var/threatlevel = 0
- var/target_lastloc //Loc of target when arrested.
- var/last_found //There's a delay
- var/frustration = 0
-
- var/idcheck = 0 //If false, all station IDs are authorized for weapons.
- var/check_records = 0 //Does it check security records?
- var/check_arrest = 1 //Does it check arrest status?
- var/arrest_type = 0 //If true, don't handcuff
- var/declare_arrests = 0 //When making an arrest, should it notify everyone wearing sechuds?
-
- var/has_laser = 0
- var/next_harm_time = 0
- var/lastfired = 0
- var/shot_delay = 3 //.3 seconds between shots
- var/lasercolor = ""
- var/projectile = null//Holder for projectile type, to avoid so many else if chains
- var/disabled = 0//A holder for if it needs to be disabled, if true it will not seach for targets, shoot at targets, or move, currently only used for lasertag
-
- var/mode = 0
-#define SECBOT_IDLE 0 // idle
-#define SECBOT_HUNT 1 // found target, hunting
-#define SECBOT_PREP_ARREST 2 // at target, preparing to arrest
-#define SECBOT_ARREST 3 // arresting target
-#define SECBOT_START_PATROL 4 // start patrol
-#define SECBOT_PATROL 5 // patrolling
-#define SECBOT_SUMMON 6 // summoned by PDA
-
- var/auto_patrol = 0 // set to make bot automatically patrol
-
- var/beacon_freq = 1445 // navigation beacon frequency
- var/control_freq = AI_FREQ // bot control frequency
-
-
- var/turf/patrol_target // this is turf to navigate to (location of beacon)
- var/new_destination // pending new destination (waiting for beacon response)
- var/destination // destination description tag
- var/next_destination // the next destination in the patrol route
- var/list/path = new // list of path turfs
-
- var/blockcount = 0 //number of times retried a blocked path
- var/awaiting_beacon = 0 // count of pticks awaiting a beacon response
-
- var/nearest_beacon // the nearest beacon's tag
- var/turf/nearest_beacon_loc // the nearest beacon's location
-
- var/bot_version = "1.3"
- var/search_range = 7
- var/is_attacking = 0
-
- var/obj/item/weapon/secbot_assembly = /obj/item/weapon/secbot_assembly
-
- var/list/threat_found_sounds = new('sound/voice/bcriminal.ogg', 'sound/voice/bjustice.ogg', 'sound/voice/bfreeze.ogg')
- var/list/preparing_arrest_sounds = new('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg')
-
-/obj/machinery/bot/secbot/beepsky
- name = "Officer Beep O'sky"
- desc = "It's Officer Beep O'sky! Powered by a potato and a shot of whiskey."
- idcheck = 0
- auto_patrol = 1
-
-/obj/item/weapon/secbot_assembly
- name = "helmet/signaler assembly"
- desc = "Some sort of bizarre assembly."
- icon = 'icons/obj/aibots.dmi'
- icon_state = "helmet_signaler"
- item_state = "helmet"
- var/build_step = 0
- var/created_name = "Securitron" //To preserve the name if it's a unique securitron I guess
-
-/obj/machinery/bot/secbot/New(loc, created_name, created_lasercolor)
- ..()
- if(created_name) name = created_name
- if(created_lasercolor) lasercolor = created_lasercolor
- update_icon()
- spawn(3)
- src.botcard = new /obj/item/weapon/card/id(src)
- src.botcard.access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court)
- if(radio_controller)
- radio_controller.add_object(src, control_freq, filter = RADIO_SECBOT)
- radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS)
- if(lasercolor)
- shot_delay = 6 //Longer shot delay because JESUS CHRIST
- check_arrest = 0
- check_records = 0 //Don't actively target people set to arrest
- arrest_type = 1 //Don't even try to cuff
- req_access = list(access_maint_tunnels)
- arrest_type = 1
- if((lasercolor == "b") && (name == created_name))//Picks a name if there isn't already a custome one
- name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT")
- if((lasercolor == "r") && (name == created_name))
- name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT")
-
-
-/obj/machinery/bot/secbot/update_icon()
- if(on && is_attacking)
- src.icon_state = "secbot-c"
- else
- src.icon_state = "secbot[src.on]"
-
-/obj/machinery/bot/secbot/turn_on()
- ..()
- update_icon()
- src.updateUsrDialog()
-
-/obj/machinery/bot/secbot/turn_off()
- ..()
- src.target = null
- src.oldtarget_name = null
- src.anchored = 0
- src.mode = SECBOT_IDLE
- walk_to(src,0)
- update_icon()
- src.updateUsrDialog()
-
-/obj/machinery/bot/secbot/attack_hand(mob/user as mob)
- . = ..()
- if(.)
- return
- usr.set_machine(src)
- interact(user)
-
-/obj/machinery/bot/secbot/interact(mob/user as mob)
- var/dat
-
- dat += text({"
-Automatic Security Unit v[bot_version]
-Status: []
-Behaviour controls are [src.locked ? "locked" : "unlocked"]
-Maintenance panel is [src.open ? "opened" : "closed"]"},
-
-"[src.on ? "On" : "Off"]" )
-
- if(!src.locked || issilicon(user))
- dat += text({"
-Check for Weapon Authorization: []
-Check Security Records: []
-Check Arrest Status: []
-Operating Mode: []
-Report Arrests: []
-Auto Patrol: []"},
-
-"[src.idcheck ? "Yes" : "No"]",
-"[src.check_records ? "Yes" : "No"]",
-"[src.check_arrest ? "Yes" : "No"]",
-"[src.arrest_type ? "Detain" : "Arrest"]",
-"[src.declare_arrests ? "Yes" : "No"]",
-"[auto_patrol ? "On" : "Off"]" )
-
-
- user << browse("Securitron v[bot_version] controls[dat]", "window=autosec")
- onclose(user, "autosec")
- return
-
-/obj/machinery/bot/secbot/Topic(href, href_list)
- if(..())
- return
- usr.set_machine(src)
- src.add_fingerprint(usr)
- if(lasercolor && (istype(usr,/mob/living/carbon/human)))
- var/mob/living/carbon/human/H = usr
- if((lasercolor == "b") && (istype(H.wear_suit, /obj/item/clothing/suit/redtag)))//Opposing team cannot operate it
- return
- else if((lasercolor == "r") && (istype(H.wear_suit, /obj/item/clothing/suit/bluetag)))
- return
- if((href_list["power"]) && (src.allowed(usr)))
- if(src.on)
- turn_off()
- else
- turn_on()
- src.updateUsrDialog()
- return
-
- switch(href_list["operation"])
- if("idcheck")
- src.idcheck = !src.idcheck
- if("ignorerec")
- src.check_records = !src.check_records
- if("ignorearr")
- src.check_arrest = !src.check_arrest
- if("switchmode")
- src.arrest_type = !src.arrest_type
- if("patrol")
- auto_patrol = !auto_patrol
- mode = SECBOT_IDLE
- if("declarearrests")
- src.declare_arrests = !src.declare_arrests
- src.updateUsrDialog()
-
-/obj/machinery/bot/secbot/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
- if(src.allowed(user) && !open && !emagged)
- src.locked = !src.locked
- user << "Controls are now [src.locked ? "locked" : "unlocked"]."
- else
- if(emagged)
- user << "ERROR"
- if(open)
- user << "Please close the access panel before locking it."
- else
- user << "Access denied."
- else
- ..()
- if(!istype(W, /obj/item/weapon/screwdriver) && W.force && !src.target)
- src.target = user
- if(lasercolor)//To make up for the fact that lasertag bots don't hunt
- src.shootAt(user)
- src.mode = SECBOT_HUNT
-
-/obj/machinery/bot/secbot/Emag(mob/user as mob)
- ..()
- if(open && !locked)
- if(user) user << "You short out [src]'s target assessment circuits."
- spawn(0)
- for(var/mob/O in hearers(src, null))
- O.show_message("\red [src] buzzes oddly!", 1)
- src.target = null
- if(user) src.oldtarget_name = user.name
- src.last_found = world.time
- src.anchored = 0
- src.emagged = 2
- src.on = 1
- update_icon()
- src.projectile = null
- mode = SECBOT_IDLE
-
-/obj/machinery/bot/secbot/process()
- set background = 1
-
- if(!src.on)
- return
-
- switch(mode)
-
- if(SECBOT_IDLE) // idle
- walk_to(src,0)
- look_for_perp() // see if any criminals are in range
- if(!mode && auto_patrol) // still idle, and set to patrol
- mode = SECBOT_START_PATROL // switch to patrol mode
-
- if(SECBOT_HUNT) // hunting for perp
- // if can't reach perp for long enough, go idle
- if(src.frustration >= 8)
- // for(var/mob/O in hearers(src, null))
- // O << "[src] beeps, \"Backup requested! Suspect has evaded arrest.\""
- src.target = null
- src.last_found = world.time
- src.frustration = 0
- src.mode = 0
- walk_to(src,0)
-
- if(target) // make sure target exists
- // We re-assess human targets, before bashing their head in, in case their credentials change
- if(istype(target, /mob/living/carbon/human))
- var/threat = src.assess_perp(target, idcheck, check_records, check_arrest)
- if(threat < 4)
- frustration = 8
- return
-
- // The target must remain in view to complete the desire to bash its head in
- if(!(target in view(search_range,src)))
- frustration++
- return
-
- if(!lasercolor && Adjacent(target)) // If right next to perp. Lasertag bots do not arrest anyone, just patrol and shoot and whatnot
- if(istype(src.target,/mob/living/carbon))
- playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
- is_attacking = 1
- update_icon()
- spawn(2)
- is_attacking = 0
- update_icon()
- var/mob/living/carbon/M = src.target
- var/maxstuns = 4
- if(istype(M, /mob/living/carbon/human))
- if(M.stuttering < 10 && (!(HULK in M.mutations)))
- M.stuttering = 10
- M.Stun(10)
- M.Weaken(10)
- else
- M.Weaken(10)
- M.stuttering = 10
- M.Stun(10)
- maxstuns--
- if(maxstuns <= 0)
- target = null
-
- if(declare_arrests)
- var/area/location = get_area(src)
- broadcast_security_hud_message("[src.name] is [arrest_type ? "detaining" : "arresting"] level [threatlevel] suspect [target] in [location]", src)
- visible_message("\red [src.target] has been stunned by [src]!")
-
- mode = SECBOT_PREP_ARREST
- src.anchored = 1
- src.target_lastloc = M.loc
- return
- else if(istype(src.target,/mob/living/simple_animal))
- //just harmbaton them until dead
- if(world.time > next_harm_time)
- next_harm_time = world.time + 15
- playsound(src.loc, 'sound/weapons/Egloves.ogg', 50, 1, -1)
- visible_message("\red [src] beats [src.target] with the stun baton!")
- update_icon()
- spawn(2)
- is_attacking = 0
- update_icon()
-
- var/mob/living/simple_animal/S = src.target
- S.AdjustStunned(10)
- S.adjustBruteLoss(15)
- if(S.stat)
- src.frustration = 8
- if(preparing_arrest_sounds.len > 0)
- playsound(src.loc, pick(preparing_arrest_sounds), 50, 0)
- else // not next to perp
- var/turf/olddist = get_dist(src, src.target)
- walk_to(src, target,1,4)
- shootAt(target)
- if((get_dist(src, src.target)) >= (olddist))
- src.frustration++
- else
- src.frustration = 0
- else
- src.frustration = 8
-
- if(SECBOT_PREP_ARREST) // preparing to arrest target
- if(src.lasercolor)
- mode = SECBOT_IDLE
- return
- if(!target)
- mode = SECBOT_IDLE
- src.anchored = 0
- return
- // see if he got away
- if((get_dist(src, src.target) > 1) || ((src.target.loc != src.target_lastloc) && src.target.weakened < 2))
- src.anchored = 0
- mode = SECBOT_HUNT
- return
-
- if(istype(src.target,/mob/living/carbon))
- var/mob/living/carbon/C = target
- var/wearing_hardsuit
- if(istype(C,/mob/living/carbon/human))
- var/mob/living/carbon/human/H = C
- if(istype(H.back, /obj/item/weapon/rig) && istype(H.gloves,/obj/item/clothing/gloves/rig))
- wearing_hardsuit = 1
- if(!wearing_hardsuit && !C.handcuffed && !src.arrest_type)
- playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
- mode = SECBOT_ARREST
- visible_message("\red [src] is trying to put handcuffs on [src.target]!")
-
- spawn(60)
- if(get_dist(src, src.target) <= 1)
- /*if(src.target.handcuffed)
- return*/
-
- if(istype(src.target,/mob/living/carbon))
- C = target
- if(!C.handcuffed)
- C.handcuffed = new /obj/item/weapon/handcuffs(target)
- C.update_inv_handcuffed() //update the handcuffs overlay
-
- mode = SECBOT_IDLE
- src.target = null
- src.anchored = 0
- src.last_found = world.time
- src.frustration = 0
-
- if(preparing_arrest_sounds.len > 0)
- playsound(src.loc, pick(preparing_arrest_sounds), 50, 0)
- // var/arrest_message = pick("Have a secure day!","I AM THE LAW.", "God made tomorrow for the crooks we don't catch today.","You can't outrun a radio.")
- // src.speak(arrest_message)
- else
- mode = SECBOT_IDLE
- src.target = null
- src.anchored = 0
- src.last_found = world.time
- src.frustration = 0
-
- if(SECBOT_ARREST) // arresting
- if(src.lasercolor)
- mode = SECBOT_IDLE
- return
- if(!target || !istype(target, /mob/living/carbon))
- src.anchored = 0
- mode = SECBOT_IDLE
- return
- else
- var/mob/living/carbon/C = target
- if(!C.handcuffed)
- src.anchored = 0
- mode = SECBOT_IDLE
- return
-
-
- if(SECBOT_START_PATROL) // start a patrol
-
- if(path.len > 0 && patrol_target) // have a valid path, so just resume
- mode = SECBOT_PATROL
- return
-
- else if(patrol_target) // has patrol target already
- spawn(0)
- calc_path() // so just find a route to it
- if(path.len == 0)
- patrol_target = 0
- return
- mode = SECBOT_PATROL
-
-
- else // no patrol target, so need a new one
- find_patrol_target()
- speak("Engaging patrol mode.")
-
-
- if(SECBOT_PATROL) // patrol mode
- patrol_step()
- spawn(5)
- if(mode == SECBOT_PATROL)
- patrol_step()
-
- if(SECBOT_SUMMON) // summoned to PDA
- patrol_step()
- spawn(4)
- if(mode == SECBOT_SUMMON)
- patrol_step()
- sleep(4)
- patrol_step()
-
- return
-
-
-// perform a single patrol step
-/obj/machinery/bot/secbot/proc/patrol_step()
- if(loc == patrol_target) // reached target
- at_patrol_target()
- return
- else if(path.len > 0 && patrol_target) // valid path
- var/turf/next = path[1]
- if(next == loc)
- path -= next
- return
-
- if(istype( next, /turf/simulated))
- var/moved = step_towards(src, next) // attempt to move
- if(moved) // successful move
- blockcount = 0
- path -= loc
-
- look_for_perp()
- if(lasercolor)
- sleep(20)
- else // failed to move
- blockcount++
- if(blockcount > 5) // attempt 5 times before recomputing
- // find new path excluding blocked turf
-
- spawn(2)
- calc_path(next)
- if(path.len == 0)
- find_patrol_target()
- else
- blockcount = 0
- return
- return
- else // not a valid turf
- mode = SECBOT_IDLE
- return
- else // no path, so calculate new one
- mode = SECBOT_START_PATROL
-
-// finds a new patrol target
-/obj/machinery/bot/secbot/proc/find_patrol_target()
- send_status()
- if(awaiting_beacon) // awaiting beacon response
- awaiting_beacon++
- if(awaiting_beacon > 5) // wait 5 secs for beacon response
- find_nearest_beacon() // then go to nearest instead
- return
-
- if(next_destination)
- set_destination(next_destination)
- else
- find_nearest_beacon()
- return
-
-// finds the nearest beacon to self
-// signals all beacons matching the patrol code
-/obj/machinery/bot/secbot/proc/find_nearest_beacon()
- nearest_beacon = null
- new_destination = "__nearest__"
- post_signal(beacon_freq, "findbeacon", "patrol")
- awaiting_beacon = 1
- spawn(10)
- awaiting_beacon = 0
- if(nearest_beacon)
- set_destination(nearest_beacon)
- else
- auto_patrol = 0
- mode = SECBOT_IDLE
- speak("Disengaging patrol mode.")
- send_status()
-
-/obj/machinery/bot/secbot/proc/at_patrol_target()
- find_patrol_target()
- return
-
-// sets the current destination
-// signals all beacons matching the patrol code
-// beacons will return a signal giving their locations
-/obj/machinery/bot/secbot/proc/set_destination(var/new_dest)
- new_destination = new_dest
- post_signal(beacon_freq, "findbeacon", "patrol")
- awaiting_beacon = 1
-
-
-// receive a radio signal
-// used for beacon reception
-/obj/machinery/bot/secbot/receive_signal(datum/signal/signal)
- //log_admin("DEBUG \[[world.timeofday]\]: /obj/machinery/bot/secbot/receive_signal([signal.debug_print()])")
- if(!on)
- return
-
- /*
- world << "rec signal: [signal.source]"
- for(var/x in signal.data)
- world << "* [x] = [signal.data[x]]"
- */
-
- var/recv = signal.data["command"]
- // process all-bot input
- if(recv=="bot_status")
- send_status()
-
- // check to see if we are the commanded bot
- if(signal.data["active"] == src)
- // process control input
- switch(recv)
- if("stop")
- mode = SECBOT_IDLE
- auto_patrol = 0
- return
-
- if("go")
- mode = SECBOT_IDLE
- auto_patrol = 1
- return
-
- if("summon")
- patrol_target = signal.data["target"]
- next_destination = destination
- destination = null
- awaiting_beacon = 0
- mode = SECBOT_SUMMON
- calc_path()
- speak("Responding.")
-
- return
-
-
-
- // receive response from beacon
- recv = signal.data["beacon"]
- var/valid = signal.data["patrol"]
- if(!recv || !valid)
- return
-
- if(recv == new_destination) // if the recvd beacon location matches the set destination
- // the we will navigate there
- destination = new_destination
- patrol_target = signal.source.loc
- next_destination = signal.data["next_patrol"]
- awaiting_beacon = 0
-
- // if looking for nearest beacon
- else if(new_destination == "__nearest__")
- var/dist = get_dist(src,signal.source.loc)
- if(nearest_beacon)
-
- // note we ignore the beacon we are located at
- if(dist>1 && dist 1)
- nearest_beacon = recv
- nearest_beacon_loc = signal.source.loc
- return
-
-
-// send a radio signal with a single data key/value pair
-/obj/machinery/bot/secbot/proc/post_signal(var/freq, var/key, var/value)
- post_signal_multiple(freq, list("[key]" = value) )
-
-// send a radio signal with multiple data key/values
-/obj/machinery/bot/secbot/proc/post_signal_multiple(var/freq, var/list/keyval)
-
- var/datum/radio_frequency/frequency = radio_controller.return_frequency(freq)
-
- if(!frequency) return
-
- var/datum/signal/signal = new()
- signal.source = src
- signal.transmission_method = 1
- //for(var/key in keyval)
- // signal.data[key] = keyval[key]
- signal.data = keyval
- //world << "sent [key],[keyval[key]] on [freq]"
- if(signal.data["findbeacon"])
- frequency.post_signal(src, signal, filter = RADIO_NAVBEACONS)
- else if(signal.data["type"] == "secbot")
- frequency.post_signal(src, signal, filter = RADIO_SECBOT)
- else
- frequency.post_signal(src, signal)
-
-// signals bot status etc. to controller
-/obj/machinery/bot/secbot/proc/send_status()
- var/list/kv = list(
- "type" = "secbot",
- "name" = name,
- "loca" = loc.loc, // area
- "mode" = mode
- )
- post_signal_multiple(control_freq, kv)
-
-// calculates a path to the current destination
-// given an optional turf to avoid
-/obj/machinery/bot/secbot/proc/calc_path(var/turf/avoid = null)
- src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=avoid)
- if(!path) path = list()
-
-// look for a criminal in view of the bot
-/obj/machinery/bot/secbot/proc/look_for_perp()
- if(src.disabled)
- return
- src.anchored = 0
- for(var/mob/living/M in view(search_range,src)) //Let's find us a criminal
- if(M.invisibility >= INVISIBILITY_LEVEL_ONE) // Cannot see him. see_invisible is a mob-var
- continue
-
- if(istype(M, /mob/living/carbon))
- var/mob/living/carbon/C = M
- if(C.stat || C.handcuffed)
- continue
-
- if(src.lasercolor && C.lying)
- continue//Does not shoot at people lying down when in lasertag mode, because it's just annoying, and they can fire once they get up.
-
- if(C.name == src.oldtarget_name && world.time < src.last_found + 100)
- continue
-
- if(istype(C, /mob/living/carbon/human))
- src.threatlevel = src.assess_perp(C, idcheck, check_records, check_arrest)
-
- else if(istype(M, /mob/living/simple_animal/hostile))
- if(M.stat == DEAD)
- continue
- else
- src.threatlevel = 4
-
- if(!src.threatlevel)
- continue
-
- else if(M.stat != DEAD && src.threatlevel >= 4)
- src.target = M
- src.oldtarget_name = M.name
- src.speak("Level [src.threatlevel] infraction alert!")
- if(!src.lasercolor && threat_found_sounds.len > 0)
- playsound(src.loc, pick(threat_found_sounds), 50, 0)
- src.visible_message("[src] points at [M.name]!")
-
- mode = SECBOT_HUNT
- spawn(0)
- process() // ensure bot quickly responds to a perp
- break
- else
- continue
-
-/obj/machinery/bot/secbot/on_assess_perp(mob/living/carbon/human/perp)
- if(lasercolor)
- return laser_check(perp, lasercolor)
-
- var/threat = 0
- threat -= laser_check(perp, "b")
- threat -= laser_check(perp, "r")
-
- return threat
-
-/obj/machinery/bot/secbot/proc/laser_check(mob/living/carbon/human/perp, var/lasercolor)
- var/target_suit
- var/target_weapon
- var/threat = 0
- //Lasertag turrets target the opposing team, how great is that? -Sieve
- switch(lasercolor)
- if("b")
- target_suit = /obj/item/clothing/suit/redtag
- target_weapon = /obj/item/weapon/gun/energy/lasertag/red
- if("r")
- target_suit = /obj/item/clothing/suit/bluetag
- target_weapon = /obj/item/weapon/gun/energy/lasertag/blue
-
- if((istype(perp.r_hand, target_weapon)) || (istype(perp.l_hand, target_weapon)))
- threat += 4
-
- if(istype(perp, /mob/living/carbon/human))
- if(istype(perp.wear_suit, target_suit))
- threat += 4
- if(istype(perp.belt, target_weapon))
- threat += 2
-
- return threat
-
-/obj/machinery/bot/secbot/is_assess_emagged()
- return emagged == 2
-
-/obj/machinery/bot/secbot/Bump(M as mob|obj) //Leave no door unopened!
- if((istype(M, /obj/machinery/door)) && !isnull(src.botcard))
- var/obj/machinery/door/D = M
- if(!istype(D, /obj/machinery/door/firedoor) && D.check_access(src.botcard) && !istype(D,/obj/machinery/door/blast))
- D.open()
- src.frustration = 0
- else if(!src.anchored)
- if((istype(M, /mob/living/)))
- var/mob/living/O = M
- src.loc = O.loc
- src.frustration = 0
- else if(istype(M, /obj/machinery/bot))
- var/obj/machinery/bot/B = M
- if(B.dir != src.dir) // Avoids issues if two bots are currently patrolling in the same direction
- src.loc = B.loc
- src.frustration = 0
- return
-
-/obj/machinery/bot/secbot/proc/speak(var/message)
- for(var/mob/O in hearers(src, null))
- O.show_message("[src] beeps, \"[message]\"",2)
- return
-
-/obj/machinery/bot/secbot/explode()
- walk_to(src,0)
- src.visible_message("\red [src] blows apart!", 1)
- var/turf/Tsec = get_turf(src)
-
- var/obj/item/weapon/secbot_assembly/Sa = new secbot_assembly(Tsec)
- Sa.build_step = 1
- Sa.overlays += image('icons/obj/aibots.dmi', "hs_hole")
- Sa.created_name = src.name
- new /obj/item/device/assembly/prox_sensor(Tsec)
- new /obj/item/weapon/melee/baton(Tsec)
-
- on_explosion()
-
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(3, 1, src)
- s.start()
-
- new /obj/effect/decal/cleanable/blood/oil(src.loc)
- del(src)
-
-
-/obj/machinery/bot/secbot/proc/on_explosion(var/turf/Tsec)
- new /obj/item/weapon/melee/baton(Tsec)
- if(prob(50))
- new /obj/item/robot_parts/l_arm(Tsec)
-
-//Secbot Construction
-
-/obj/item/clothing/head/helmet/attackby(var/obj/item/device/assembly/signaler/S, mob/user as mob)
- ..()
- if(!issignaler(S))
- ..()
- return
-
- if(src.type != /obj/item/clothing/head/helmet) //Eh, but we don't want people making secbots out of space helmets.
- return
-
- if(S.secured)
- del(S)
- var/obj/item/weapon/secbot_assembly/A = new /obj/item/weapon/secbot_assembly
- user.put_in_hands(A)
- user << "You add the signaler to the helmet."
- user.drop_from_inventory(src)
- del(src)
- else
- return
-
-/obj/item/weapon/secbot_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
- ..()
- if((istype(W, /obj/item/weapon/weldingtool)) && (!src.build_step))
- var/obj/item/weapon/weldingtool/WT = W
- if(WT.remove_fuel(0,user))
- src.build_step++
- src.overlays += image('icons/obj/aibots.dmi', "hs_hole")
- user << "You weld a hole in [src]!"
-
- else if(isprox(W) && (src.build_step == 1))
- user.drop_item()
- src.build_step++
- user << "You add the prox sensor to [src]!"
- src.overlays += image('icons/obj/aibots.dmi', "hs_eye")
- src.name = "helmet/signaler/prox sensor assembly"
- del(W)
-
- else if(((istype(W, /obj/item/robot_parts/l_arm)) || (istype(W, /obj/item/robot_parts/r_arm))) && (src.build_step == 2))
- user.drop_item()
- src.build_step++
- user << "You add the robot arm to [src]!"
- src.name = "helmet/signaler/prox sensor/robot arm assembly"
- src.overlays += image('icons/obj/aibots.dmi', "hs_arm")
- del(W)
-
- else if((istype(W, /obj/item/weapon/melee/baton)) && (src.build_step >= 3))
- user.drop_item()
- src.build_step++
- user << "You complete the Securitron! Beep boop."
- var/obj/machinery/bot/secbot/S = new /obj/machinery/bot/secbot
- S.loc = get_turf(src)
- S.name = src.created_name
- del(W)
- del(src)
-
- else if(istype(W, /obj/item/weapon/pen))
- var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
- if(!t)
- return
- if(!in_range(src, usr) && src.loc != usr)
- return
- src.created_name = t
-
-/obj/machinery/bot/secbot/proc/shootAt(var/mob/target)
- if(!has_laser || (lastfired && world.time - lastfired < shot_delay))
- return
- lastfired = world.time
- var/turf/T = loc
- var/atom/U = (istype(target, /atom/movable) ? target.loc : target)
- if((!( U ) || !( T )))
- return
- while(!( istype(U, /turf) ))
- U = U.loc
- if(!( istype(T, /turf) ))
- return
-
- if(!projectile)
- if(!lasercolor)
- if(src.emagged == 2)
- projectile = /obj/item/projectile/beam
- else
- projectile = /obj/item/projectile/beam/stun
- else if(lasercolor == "b")
- if(src.emagged == 2)
- projectile = /obj/item/projectile/beam/lastertag/omni
- else
- projectile = /obj/item/projectile/beam/lastertag/blue
- else if(lasercolor == "r")
- if(src.emagged == 2)
- projectile = /obj/item/projectile/beam/lastertag/omni
- else
- projectile = /obj/item/projectile/beam/lastertag/red
-
- if(!( istype(U, /turf) ))
- return
-
- playsound(src.loc, src.emagged == 2 ? 'sound/weapons/Laser.ogg' : 'sound/weapons/Taser.ogg', 50, 1)
- var/obj/item/projectile/A = new projectile (loc)
- A.current = U
- A.yo = U.y - T.y
- A.xo = U.x - T.x
- spawn( 0 )
- A.process()
- return
- return
-
-/obj/machinery/bot/secbot/emp_act(severity)
- if(severity==2 && prob(70))
- ..(severity-1)
- else
- var/obj/effect/overlay/pulse2 = new/obj/effect/overlay ( src.loc )
- pulse2.icon = 'icons/effects/effects.dmi'
- pulse2.icon_state = "empdisable"
- pulse2.name = "emp sparks"
- pulse2.anchored = 1
- pulse2.set_dir(pick(cardinal))
- spawn(10)
- pulse2.delete()
- var/list/mob/living/carbon/targets = new
- for(var/mob/living/carbon/C in view(12,src))
- if(C.stat==2)
- continue
- targets += C
- if(targets.len)
- if(prob(50))
- var/mob/toshoot = pick(targets)
- if(toshoot)
- targets-=toshoot
- if(prob(50) && emagged < 2)
- emagged = 2
- shootAt(toshoot)
- emagged = 0
- else
- shootAt(toshoot)
- else if(prob(50))
- if(targets.len)
- var/mob/toarrest = pick(targets)
- if(toarrest)
- src.target = toarrest
- src.mode = SECBOT_HUNT
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 06c77503fb..4a7aed5555 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -53,11 +53,19 @@
ASSERT(src.network.len > 0)
..()
+/obj/machinery/camera/Destroy()
+ deactivate(null, 0) //kick anyone viewing out
+ if(assembly)
+ qdel(assembly)
+ assembly = null
+ qdel(wires)
+ ..()
+
/obj/machinery/camera/emp_act(severity)
if(!isEmpProof())
if(prob(100/severity))
stat |= EMPED
- SetLuminosity(0)
+ set_light(0)
kick_viewers()
triggerCameraAlarm(30 / severity)
update_icon()
@@ -136,7 +144,7 @@
assembly.loc = src.loc
assembly.state = 1
new /obj/item/stack/cable_coil(src.loc, length=2)
- del(src)
+ qdel(src)
// OTHER
else if (can_use() && (istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/device/pda)) && isliving(user))
diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm
index b9aa81e858..28691004f3 100644
--- a/code/game/machinery/camera/camera_assembly.dm
+++ b/code/game/machinery/camera/camera_assembly.dm
@@ -6,7 +6,7 @@
w_class = 2
anchored = 0
- matter = list("metal" = 700,"glass" = 300)
+ matter = list(DEFAULT_WALL_MATERIAL = 700,"glass" = 300)
// Motion, EMP-Proof, X-Ray
var/list/obj/item/possible_upgrades = list(/obj/item/device/assembly/prox_sensor, /obj/item/stack/sheet/mineral/osmium, /obj/item/weapon/stock_parts/scanning_module)
diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm
index 638f4d8d80..d4b795730f 100644
--- a/code/game/machinery/camera/presets.dm
+++ b/code/game/machinery/camera/presets.dm
@@ -1,22 +1,4 @@
// PRESETS
-#define NETWORK_CRESCENT "Crescent"
-#define NETWORK_CIVILIAN_EAST "Civilian East"
-#define NETWORK_CIVILIAN_WEST "Civilian West"
-#define NETWORK_COMMAND "Command"
-#define NETWORK_ENGINE "Engine"
-#define NETWORK_ENGINEERING "Engineering"
-#define NETWORK_ENGINEERING_OUTPOST "Engineering Outpost"
-#define NETWORK_ERT "ERT"
-#define NETWORK_EXODUS "Exodus"
-#define NETWORK_MEDBAY "Medbay"
-#define NETWORK_MINE "MINE"
-#define NETWORK_RESEARCH "Research"
-#define NETWORK_RESEARCH_OUTPOST "Research Outpost"
-#define NETWORK_PRISON "Prison"
-#define NETWORK_SECURITY "Security"
-#define NETWORK_TELECOM "Tcomsat"
-#define NETWORK_THUNDER "thunder"
-
var/global/list/station_networks = list(
NETWORK_CIVILIAN_EAST,
NETWORK_CIVILIAN_WEST,
@@ -25,7 +7,7 @@ var/global/list/station_networks = list(
NETWORK_ENGINEERING,
NETWORK_ENGINEERING_OUTPOST,
NETWORK_EXODUS,
- NETWORK_MEDBAY,
+ NETWORK_MEDICAL,
NETWORK_MINE,
NETWORK_RESEARCH,
NETWORK_RESEARCH_OUTPOST,
@@ -73,7 +55,7 @@ var/global/list/engineering_networks = list(
network = list(NETWORK_PRISON)
/obj/machinery/camera/network/medbay
- network = list(NETWORK_MEDBAY)
+ network = list(NETWORK_MEDICAL)
/obj/machinery/camera/network/research
network = list(NETWORK_RESEARCH)
@@ -105,7 +87,7 @@ var/global/list/engineering_networks = list(
network = list(NETWORK_SECURITY)
/obj/machinery/camera/xray/medbay
- network = list(NETWORK_MEDBAY)
+ network = list(NETWORK_MEDICAL)
/obj/machinery/camera/xray/research
network = list(NETWORK_RESEARCH)
@@ -120,6 +102,12 @@ var/global/list/engineering_networks = list(
..()
upgradeMotion()
+/obj/machinery/camera/motion/engineering_outpost
+ network = list(NETWORK_ENGINEERING_OUTPOST)
+
+/obj/machinery/camera/motion/security
+ network = list(NETWORK_SECURITY)
+
// ALL UPGRADES
@@ -191,21 +179,3 @@ var/global/list/engineering_networks = list(
if (isMotion())
mult++
active_power_usage = mult*initial(active_power_usage)
-
-#undef NETWORK_CENTRAL_CRESCENT
-#undef NETWORK_CIVILIAN_EAST
-#undef NETWORK_CIVILIAN_WEST
-#undef NETWORK_COMMAND
-#undef NETWORK_ENGINE
-#undef NETWORK_ENGINEERING
-#undef NETWORK_ENGINEERING_OUTPOST
-#undef NETWORK_ERT
-#undef NETWORK_EXODUS
-#undef NETWORK_MEDBAY
-#undef NETWORK_MINE
-#undef NETWORK_RESEARCH
-#undef NETWORK_RESEARCH_OUTPOST
-#undef NETWORK_PRISON
-#undef NETWORK_SECURITY
-#undef NETWORK_TELECOM
-#undef NETWORK_THUNDER
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index a02553cc77..683e6e1220 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -11,7 +11,7 @@
var/obj/item/weapon/cell/charging = null
var/chargelevel = -1
-/obj/machinery/cell_charger/proc/updateicon()
+/obj/machinery/cell_charger/update_icon()
icon_state = "ccharger[charging ? 1 : 0]"
if(charging && !(stat & (BROKEN|NOPOWER)) )
@@ -57,7 +57,7 @@
charging = W
user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.")
chargelevel = -1
- updateicon()
+ update_icon()
else if(istype(W, /obj/item/weapon/wrench))
if(charging)
user << "\red Remove the cell first!"
@@ -76,7 +76,7 @@
src.charging = null
user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.")
chargelevel = -1
- updateicon()
+ update_icon()
/obj/machinery/cell_charger/attack_ai(mob/user)
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough
@@ -108,6 +108,6 @@
charging.give(active_power_usage*CELLRATE)
update_use_power(2)
- updateicon()
+ update_icon()
else
update_use_power(1)
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 0c133adc9b..b4e75b046f 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -174,17 +174,9 @@
//So clones don't die of oxyloss in a running pod.
if(occupant.reagents.get_reagent_amount("inaprovaline") < 30)
occupant.reagents.add_reagent("inaprovaline", 60)
-
- //So clones will remain asleep for long enough to get them into cryo (Bay RP edit)
- if(occupant.reagents.get_reagent_amount("stoxin") < 10)
- occupant.reagents.add_reagent("stoxin", 5)
- if(occupant.reagents.get_reagent_amount("chloralhydrate") < 1)
- occupant.reagents.add_reagent("chloralhydrate", 1)
-
+ occupant.Sleeping(30)
//Also heal some oxyloss ourselves because inaprovaline is so bad at preventing it!!
occupant.adjustOxyLoss(-4)
- if(notoxin)
- occupant.adjustToxLoss(-2) // If sufficiently upgraded - remove toxin damage from chloral
use_power(7500) //This might need tweaking.
return
@@ -235,7 +227,7 @@
user << "\The [src] processes \the [W]."
biomass += 50
user.drop_item()
- del(W)
+ qdel(W)
return
else if(istype(W, /obj/item/weapon/wrench))
if(locked && (anchored || occupant))
@@ -328,7 +320,7 @@
update_icon()
occupant.ghostize()
spawn(5)
- del(occupant)
+ qdel(occupant)
return
/obj/machinery/clonepod/relaymove(mob/user as mob)
@@ -348,21 +340,21 @@
for(var/atom/movable/A as mob|obj in src)
A.loc = loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(2.0)
if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.loc = loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(3.0)
if(prob(25))
for(var/atom/movable/A as mob|obj in src)
A.loc = loc
ex_act(severity)
- del(src)
+ qdel(src)
return
else
return
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index b35cfd95a6..3f38059618 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -5,6 +5,7 @@
density = 1
anchored = 1.0
icon_state = "operating"
+ light_color = "#315ab4"
circuit = "/obj/item/weapon/circuitboard/operating"
var/mob/living/carbon/human/victim = null
var/obj/machinery/optable/table = null
diff --git a/code/game/machinery/computer/RCON_Console.dm b/code/game/machinery/computer/RCON_Console.dm
index f80f0b93c4..cf275eb5ce 100644
--- a/code/game/machinery/computer/RCON_Console.dm
+++ b/code/game/machinery/computer/RCON_Console.dm
@@ -9,6 +9,7 @@
desc = "Console used to remotely control machinery on the station."
icon = 'icons/obj/computer.dmi'
icon_state = "ai-fixer"
+ light_color = "#a97faa"
circuit = /obj/item/weapon/circuitboard/rcon_console
req_one_access = list(access_engine)
var/current_tag = null
diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm
index 1368d19bb8..028f1ba307 100644
--- a/code/game/machinery/computer/ai_core.dm
+++ b/code/game/machinery/computer/ai_core.dm
@@ -30,7 +30,7 @@
if(!src || !WT.remove_fuel(0, user)) return
user << "\blue You deconstruct the frame."
new /obj/item/stack/sheet/plasteel( loc, 4)
- del(src)
+ qdel(src)
if(1)
if(istype(P, /obj/item/weapon/wrench))
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
@@ -178,7 +178,7 @@
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
A.rename_self("ai", 1)
feedback_inc("cyborg_ais_created",1)
- del(src)
+ qdel(src)
/obj/structure/AIcore/deactivated
name = "inactive AI"
@@ -187,7 +187,7 @@
anchored = 1
state = 20//So it doesn't interact based on the above. Not really necessary.
-/obj/structure/AIcore/deactivated/Del()
+/obj/structure/AIcore/deactivated/Destroy()
if(src in empty_playable_ai_cores)
empty_playable_ai_cores -= src
..()
@@ -208,7 +208,7 @@
if(card)
card.clear()
- del(src)
+ qdel(src)
/obj/structure/AIcore/deactivated/proc/check_malf(var/mob/living/silicon/ai/ai)
if(!ai) return
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index 0613c6222b..e64708907e 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -2,6 +2,7 @@
name = "\improper AI system integrity restorer"
icon = 'icons/obj/computer.dmi'
icon_state = "ai-fixer"
+ light_color = "#a97faa"
circuit = /obj/item/weapon/circuitboard/aifixer
req_one_access = list(access_robotics, access_heads)
var/mob/living/silicon/ai/occupant = null
diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm
index 77f7647608..640eb9c4d2 100644
--- a/code/game/machinery/computer/atmos_alert.dm
+++ b/code/game/machinery/computer/atmos_alert.dm
@@ -9,12 +9,13 @@ var/global/list/minor_air_alarms = list()
desc = "Used to access the station's atmospheric sensors."
circuit = "/obj/item/weapon/circuitboard/atmos_alert"
icon_state = "alert:0"
+ light_color = "#e6ffff"
/obj/machinery/computer/atmos_alert/New()
..()
atmosphere_alarm.register(src, /obj/machinery/computer/station_alert/update_icon)
-/obj/machinery/computer/atmos_alert/Del()
+/obj/machinery/computer/atmos_alert/Destroy()
atmosphere_alarm.unregister(src)
..()
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index 2e79d927be..c0c798f3eb 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -6,14 +6,16 @@
name = "\improper Central Atmospherics Computer"
icon = 'icons/obj/computer.dmi'
icon_state = "computer_generic"
+ light_color = "#00b000"
density = 1
anchored = 1.0
circuit = "/obj/item/weapon/circuitboard/atmoscontrol"
- var/overridden = 0 //not set yet, can't think of a good way to do it
req_access = list(access_ce)
var/list/monitored_alarm_ids = null
- var/list/monitored_alarms = null
- var/ui_ref
+ var/obj/nano_module/atmos_control/atmos_control
+
+/obj/machinery/computer/atmoscontrol/New()
+ ..()
/obj/machinery/computer/atmoscontrol/laptop
name = "Atmospherics Laptop"
@@ -21,77 +23,24 @@
icon_state = "medlaptop"
density = 0
-/obj/machinery/computer/atmoscontrol/initialize()
- ..()
- if(!monitored_alarms && monitored_alarm_ids)
- monitored_alarms = new
- for(var/obj/machinery/alarm/alarm in machines)
- if(alarm.alarm_id && alarm.alarm_id in monitored_alarm_ids)
- monitored_alarms += alarm
- // machines may not yet be ordered at this point
- monitored_alarms = dd_sortedObjectList(monitored_alarms)
-
/obj/machinery/computer/atmoscontrol/attack_ai(var/mob/user as mob)
- return ui_interact(user)
+ ui_interact(user)
/obj/machinery/computer/atmoscontrol/attack_hand(mob/user)
if(..())
- return
- return ui_interact(user)
-
-/obj/machinery/computer/atmoscontrol/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- var/data[0]
- var/alarms[0]
-
- // TODO: Move these to a cache, similar to cameras
- for(var/obj/machinery/alarm/alarm in (monitored_alarms ? monitored_alarms : machines))
- alarms[++alarms.len] = list("name" = sanitize(alarm.name), "ref"= "\ref[alarm]", "danger" = max(alarm.danger_level, alarm.alarm_area.atmosalm))
- data["alarms"] = alarms
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "atmos_control.tmpl", src.name, 625, 625)
- ui.set_initial_data(data)
- ui.open()
- ui.set_auto_update(1)
- ui_ref = ui
+ 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("\red \The [user] swipes \a [I] through \the [src], causing the screen to flash!",\
"\red 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.")
- emagged = 1
- overridden = 1
+ atmos_control.emagged = 1
return
return ..()
-//a bunch of this is copied from atmos alarms
-/obj/machinery/computer/atmoscontrol/Topic(href, href_list)
- if(..())
- return 1
-
- if(href_list["alarm"])
- if(ui_ref)
- var/obj/machinery/alarm/alarm = locate(href_list["alarm"]) in (monitored_alarms ? monitored_alarms : machines)
- if(alarm)
- var/datum/topic_state/TS = generate_state(alarm)
- alarm.ui_interact(usr, master_ui = ui_ref, state = TS)
- return 1
-
-/obj/machinery/computer/atmoscontrol/proc/generate_state(var/alarm)
- var/datum/topic_state/air_alarm/state = new()
- state.atmos_control = src
- state.air_alarm = alarm
- return state
-
-/datum/topic_state/air_alarm
- var/obj/machinery/computer/atmoscontrol/atmos_control = null
- var/obj/machinery/alarm/air_alarm = null
-
-/datum/topic_state/air_alarm/href_list(var/mob/user)
- var/list/extra_href = list()
- extra_href["remote_connection"] = 1
- extra_href["remote_access"] = user && (user.isAI() || atmos_control.allowed(user) || atmos_control.emagged || air_alarm.rcon_setting == RCON_YES || (air_alarm.alarm_area.atmosalm && air_alarm.rcon_setting == RCON_AUTO))
-
- return extra_href
+/obj/machinery/computer/atmoscontrol/ui_interact(var/mob/user)
+ if(!atmos_control)
+ atmos_control = new(src, req_access, req_one_access, monitored_alarm_ids)
+ atmos_control.ui_interact(user)
diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm
index ac648624f2..a325ab90f3 100644
--- a/code/game/machinery/computer/buildandrepair.dm
+++ b/code/game/machinery/computer/buildandrepair.dm
@@ -29,7 +29,7 @@
if(!src || !WT.isOn()) return
user << "\blue You deconstruct the frame."
new /obj/item/stack/sheet/metal( src.loc, 5 )
- del(src)
+ qdel(src)
if(1)
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
@@ -111,4 +111,4 @@
user << "\blue You connect the monitor."
var/B = new src.circuit.build_path ( src.loc )
src.circuit.construct(B)
- del(src)
+ qdel(src)
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index f71f181ed3..fd68c4ec62 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -1,19 +1,20 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
+/var/camera_cache_id = 1
+
/proc/invalidateCameraCache()
- for(var/obj/machinery/computer/security/s in world)
- s.camera_cache = null
- for(var/datum/alarm/A in world)
- A.cameras = null
+ camera_cache_id = (++camera_cache_id % 999999)
/obj/machinery/computer/security
name = "security camera monitor"
desc = "Used to access the various cameras on the station."
icon_state = "cameras"
+ light_color = "#a91515"
var/obj/machinery/camera/current = null
var/last_pic = 1.0
var/list/network
var/mapping = 0//For the overview file, interesting bit of code.
+ var/cache_id = 0
circuit = /obj/item/weapon/circuitboard/security
var/camera_cache = null
@@ -42,7 +43,8 @@
data["current"] = null
- if(isnull(camera_cache))
+ if(camera_cache_id != cache_id)
+ cache_id = camera_cache_id
cameranet.process_sort()
var/cameras[0]
@@ -220,6 +222,8 @@
desc = "Damn, why do they never have anything interesting on these things?"
icon = 'icons/obj/status_display.dmi'
icon_state = "entertainment"
+ light_color = "#FFEEDB"
+ light_range_on = 2
circuit = null
/obj/machinery/computer/security/wooden_tv
@@ -227,7 +231,8 @@
desc = "An old TV hooked into the stations camera network."
icon_state = "security_det"
circuit = null
-
+ light_color = "#3848B3"
+ light_power_on = 0.5
/obj/machinery/computer/security/mining
name = "outpost camera monitor"
@@ -235,12 +240,14 @@
icon_state = "miningcameras"
network = list("MINE")
circuit = /obj/item/weapon/circuitboard/security/mining
+ light_color = "#F9BBFC"
/obj/machinery/computer/security/engineering
name = "engineering camera monitor"
desc = "Used to monitor fires and breaches."
icon_state = "engineeringcameras"
circuit = /obj/item/weapon/circuitboard/security/engineering
+ light_color = "#FAC54B"
/obj/machinery/computer/security/engineering/New()
if(!network)
diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm
index 4e97506088..9879e34565 100644
--- a/code/game/machinery/computer/card.dm
+++ b/code/game/machinery/computer/card.dm
@@ -4,6 +4,7 @@
name = "\improper ID card modification console"
desc = "Terminal for programming NanoTrasen employee ID cards to access parts of the station."
icon_state = "id"
+ light_color = "#0099ff"
req_access = list(access_change_ids)
circuit = "/obj/item/weapon/circuitboard/card"
var/obj/item/weapon/card/id/scan = null
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index fd8386a7f8..6a274e4db4 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -2,6 +2,7 @@
name = "cloning control console"
icon = 'icons/obj/computer.dmi'
icon_state = "dna"
+ light_color = "#315ab4"
circuit = "/obj/item/weapon/circuitboard/cloning"
req_access = list(access_heads) //Only used for record deletion right now.
var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
@@ -14,20 +15,18 @@
var/obj/item/weapon/disk/data/diskette = null //Mostly so the geneticist can steal everything.
var/loading = 0 // Nice loading text
-/obj/machinery/computer/cloning/New()
+/obj/machinery/computer/cloning/initialize()
+ ..()
+ updatemodules()
+
+/obj/machinery/computer/cloning/Destroy()
+ releasecloner()
..()
- spawn(5)
- updatemodules()
- return
- return
/obj/machinery/computer/cloning/proc/updatemodules()
src.scanner = findscanner()
+ releasecloner()
findcloner()
- var/num = 1
- for (var/obj/machinery/clonepod/pod in pods)
- pod.connected = src
- pod.name = "[initial(pod.name)] #[num++]"
/obj/machinery/computer/cloning/proc/findscanner()
var/obj/machinery/dna_scannernew/scannerf = null
@@ -40,18 +39,26 @@
//Then look for a free one in the area
if(!scannerf)
- for(var/obj/machinery/dna_scannernew/S in get_area(src))
+ var/area/A = get_area(src)
+ for(var/obj/machinery/dna_scannernew/S in A.get_contents())
return S
return
-/obj/machinery/computer/cloning/proc/findcloner()
+/obj/machinery/computer/cloning/proc/releasecloner()
+ for(var/obj/machinery/clonepod/P in pods)
+ P.connected = null
+ P.name = initial(P.name)
pods.Cut()
- for(var/obj/machinery/clonepod/P in get_area(src))
+
+/obj/machinery/computer/cloning/proc/findcloner()
+ var/num = 1
+ var/area/A = get_area(src)
+ for(var/obj/machinery/clonepod/P in A.get_contents())
if(!P.connected)
pods += P
-
- return
+ P.connected = src
+ P.name = "[initial(P.name)] #[num++]"
/obj/machinery/computer/cloning/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/disk/data)) //INSERT SOME DISKETTES
@@ -221,7 +228,7 @@
src.active_record = locate(href_list["view_rec"])
if(istype(src.active_record,/datum/dna2/record))
if ((isnull(src.active_record.ckey)))
- del(src.active_record)
+ qdel(src.active_record)
src.temp = "ERROR: Record Corrupt"
else
src.menu = 3
@@ -241,7 +248,7 @@
if (istype(C)||istype(C, /obj/item/device/pda))
if(src.check_access(C))
src.records.Remove(src.active_record)
- del(src.active_record)
+ qdel(src.active_record)
src.temp = "Record deleted."
src.menu = 2
else
@@ -313,7 +320,7 @@
else if(pod.growclone(C))
temp = "Initiating cloning cycle..."
records.Remove(C)
- del(C)
+ qdel(C)
menu = 1
else
@@ -323,7 +330,7 @@
if(answer != "No" && pod.growclone(C))
temp = "Initiating cloning cycle..."
records.Remove(C)
- del(C)
+ qdel(C)
menu = 1
else
temp = "Initiating cloning cycle...
Error: Post-initialisation failed. Cloning cycle aborted."
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index 4fc43a0259..686ac73af6 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -5,6 +5,7 @@
name = "command and communications console"
desc = "Used to command and control the station. Can relay long-range communications."
icon_state = "comm"
+ light_color = "#0099ff"
req_access = list(access_heads)
circuit = "/obj/item/weapon/circuitboard/communications"
var/prints_intercept = 1
@@ -551,7 +552,7 @@
frequency.post_signal(src, status_signal)
-/obj/machinery/computer/communications/Del()
+/obj/machinery/computer/communications/Destroy()
for(var/obj/machinery/computer/communications/commconsole in world)
if(istype(commconsole.loc,/turf) && commconsole != src)
@@ -574,7 +575,7 @@
..()
-/obj/item/weapon/circuitboard/communications/Del()
+/obj/item/weapon/circuitboard/communications/Destroy()
for(var/obj/machinery/computer/communications/commconsole in world)
if(istype(commconsole.loc,/turf))
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index 304ac7d1af..7ed213043d 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -9,11 +9,8 @@
var/circuit = null //The path to the circuit board type. If circuit==null, the computer can't be disassembled.
var/processing = 0
-/obj/machinery/computer/New()
- ..()
- if(ticker)
- initialize()
-
+ var/light_range_on = 3
+ var/light_power_on = 1
/obj/machinery/computer/initialize()
power_change()
@@ -41,11 +38,11 @@
/obj/machinery/computer/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(25))
- del(src)
+ qdel(src)
return
if (prob(50))
for(var/x in verbs)
@@ -60,6 +57,9 @@
return
/obj/machinery/computer/bullet_act(var/obj/item/projectile/Proj)
+ if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
+ return
+
if(prob(Proj.damage))
set_broken()
..()
@@ -89,6 +89,10 @@
/obj/machinery/computer/power_change()
..()
update_icon()
+ if(stat & NOPOWER)
+ set_light(0)
+ else
+ set_light(light_range_on, light_power_on)
/obj/machinery/computer/proc/set_broken()
@@ -129,7 +133,7 @@
A.state = 4
A.icon_state = "4"
M.deconstruct(src)
- del(src)
+ qdel(src)
else
src.attack_hand(user)
return
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index b5394328b8..6928d104ca 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -2,6 +2,7 @@
name = "crew monitoring computer"
desc = "Used to monitor active health sensors built into most of the crew's uniforms."
icon_state = "crew"
+ light_color = "#315ab4"
use_power = 1
idle_power_usage = 250
active_power_usage = 500
diff --git a/code/game/machinery/computer/guestpass.dm b/code/game/machinery/computer/guestpass.dm
index 40fc0b9914..5add587e77 100644
--- a/code/game/machinery/computer/guestpass.dm
+++ b/code/game/machinery/computer/guestpass.dm
@@ -5,6 +5,7 @@
name = "guest pass"
desc = "Allows temporary access to station areas."
icon_state = "guest"
+ light_color = "#0099ff"
var/temp_access = list() //to prevent agent cards stealing access as permanent
var/expiration_time = 0
@@ -186,4 +187,4 @@
else
usr << "\red Cannot issue pass without issuing ID."
updateUsrDialog()
- return
\ No newline at end of file
+ return
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index c6a30995d2..65322b741d 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -4,6 +4,7 @@
name = "medical records console"
desc = "Used to view, edit and maintain medical records."
icon_state = "medcomp"
+ light_color = "#315ab4"
req_one_access = list(access_medical, access_forensics_lockers)
circuit = "/obj/item/weapon/circuitboard/med_data"
var/obj/item/weapon/card/id/scan = null
@@ -124,7 +125,7 @@
dat += "Back"
dat += "
Medical Robots:"
var/bdat = null
- for(var/obj/machinery/bot/medbot/M in world)
+ for(var/mob/living/bot/medbot/M in world)
if(M.z != src.z) continue //only find medibots on the same z-level as the computer
var/turf/bl = get_turf(M)
@@ -240,7 +241,7 @@
if (href_list["del_all2"])
for(var/datum/data/record/R in data_core.medical)
//R = null
- del(R)
+ qdel(R)
//Foreach goto(494)
src.temp = "All records deleted."
@@ -408,7 +409,7 @@
if (href_list["del_r2"])
if (src.active2)
//src.active2 = null
- del(src.active2)
+ qdel(src.active2)
if (href_list["d_rec"])
var/datum/data/record/R = locate(href_list["d_rec"])
@@ -542,7 +543,7 @@
continue
else if(prob(1))
- del(R)
+ qdel(R)
continue
..(severity)
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index 94eadf7f11..f775c5f950 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -4,6 +4,7 @@
name = "messaging monitor console"
desc = "Used to access and maintain data on messaging servers. Allows you to view PDA and request console messages."
icon_state = "comm_logs"
+ light_color = "#00b000"
var/hack_icon = "comm_logsc"
var/normal_icon = "comm_logs"
circuit = "/obj/item/weapon/circuitboard/message_monitor"
diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm
index 0c7830a78a..257e76ede8 100644
--- a/code/game/machinery/computer/pod.dm
+++ b/code/game/machinery/computer/pod.dm
@@ -4,6 +4,7 @@
name = "pod launch control console"
desc = "A control console for launching pods. Some people prefer firing Mechas."
icon_state = "computer_generic"
+ light_color = "#00b000"
circuit = /obj/item/weapon/circuitboard/pod
var/id = 1.0
var/obj/machinery/mass_driver/connected = null
@@ -77,7 +78,7 @@
A.state = 3
A.icon_state = "3"
A.anchored = 1
- del(src)
+ qdel(src)
else
user << "\blue You disconnect the monitor."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( loc )
@@ -100,7 +101,7 @@
A.state = 4
A.icon_state = "4"
A.anchored = 1
- del(src)
+ qdel(src)
else
attack_hand(user)
return
diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm
index 976209305a..93d38fabeb 100644
--- a/code/game/machinery/computer/prisoner.dm
+++ b/code/game/machinery/computer/prisoner.dm
@@ -4,6 +4,7 @@
name = "prisoner management console"
icon = 'icons/obj/computer.dmi'
icon_state = "explosive"
+ light_color = "#a91515"
req_access = list(access_armory)
circuit = "/obj/item/weapon/circuitboard/prisoner"
var/id = 0.0
diff --git a/code/game/machinery/computer/prisonshuttle.dm b/code/game/machinery/computer/prisonshuttle.dm
index 84ba06fa02..0fd1a2df05 100644
--- a/code/game/machinery/computer/prisonshuttle.dm
+++ b/code/game/machinery/computer/prisonshuttle.dm
@@ -14,6 +14,7 @@ var/prison_shuttle_timeleft = 0
name = "prison shuttle control console"
icon = 'icons/obj/computer.dmi'
icon_state = "shuttle"
+ light_color = "#00ffff"
req_access = list(access_security)
circuit = "/obj/item/weapon/circuitboard/prison_shuttle"
var/temp = null
@@ -45,7 +46,7 @@ var/prison_shuttle_timeleft = 0
A.state = 4
A.icon_state = "4"
- del(src)
+ qdel(src)
else if(istype(I,/obj/item/weapon/card/emag) && (!hacked))
hacked = 1
user << "\blue You disable the lock."
@@ -194,7 +195,7 @@ var/prison_shuttle_timeleft = 0
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
- del(T)
+ qdel(T)
start_location.move_contents_to(end_location)
if(1)
@@ -224,7 +225,7 @@ var/prison_shuttle_timeleft = 0
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
- del(T)
+ qdel(T)
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
@@ -233,4 +234,4 @@ var/prison_shuttle_timeleft = 0
pest.gib()
start_location.move_contents_to(end_location)
- return
\ No newline at end of file
+ return
diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm
index 41d73ee2ae..84a6b7730c 100644
--- a/code/game/machinery/computer/robot.dm
+++ b/code/game/machinery/computer/robot.dm
@@ -5,6 +5,7 @@
desc = "Used to remotely lockdown or detonate linked cyborgs."
icon = 'icons/obj/computer.dmi'
icon_state = "robot"
+ light_color = "#a97faa"
req_access = list(access_robotics)
circuit = "/obj/item/weapon/circuitboard/robotics"
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index c05f0f78be..c97be5be09 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -4,6 +4,7 @@
name = "security records console"
desc = "Used to view, edit and maintain security records"
icon_state = "security"
+ light_color = "#a91515"
req_one_access = list(access_security, access_forensics_lockers)
circuit = "/obj/item/weapon/circuitboard/secure_data"
var/obj/item/weapon/card/id/scan = null
@@ -377,7 +378,7 @@ What a mess.*/
if ("Purge All Records")
for(var/datum/data/record/R in data_core.security)
- del(R)
+ qdel(R)
temp = "All Security records deleted."
if ("Add Entry")
@@ -549,17 +550,17 @@ What a mess.*/
if ("Delete Record (Security) Execute")
if (active2)
- del(active2)
+ qdel(active2)
if ("Delete Record (ALL) Execute")
if (active1)
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
- del(R)
+ qdel(R)
else
- del(active1)
+ qdel(active1)
if (active2)
- del(active2)
+ qdel(active2)
else
temp = "This function does not appear to be working at the moment. Our apologies."
@@ -605,7 +606,7 @@ What a mess.*/
continue
else if(prob(1))
- del(R)
+ qdel(R)
continue
..(severity)
diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm
index b8b25b3e34..3fca14135a 100644
--- a/code/game/machinery/computer/shuttle.dm
+++ b/code/game/machinery/computer/shuttle.dm
@@ -2,6 +2,7 @@
name = "Shuttle"
desc = "For shuttle control."
icon_state = "shuttle"
+ light_color = "#00ffff"
var/auth_need = 3.0
var/list/authorized = list( )
@@ -43,7 +44,7 @@
world << "\blue Alert: Shuttle launch time shortened to 10 seconds!"
emergency_shuttle.set_launch_countdown(10)
//src.authorized = null
- del(src.authorized)
+ qdel(src.authorized)
src.authorized = list( )
if("Repeal")
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index aa92a59094..e0c6f724ab 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -4,6 +4,7 @@
name = "employment records console"
desc = "Used to view, edit and maintain employment records."
icon_state = "medlaptop"
+ light_color = "#00b000"
req_one_access = list(access_heads)
circuit = "/obj/item/weapon/circuitboard/skills"
var/obj/item/weapon/card/id/scan = null
@@ -289,7 +290,7 @@ What a mess.*/
if(PDA_Manifest.len)
PDA_Manifest.Cut()
for(var/datum/data/record/R in data_core.security)
- del(R)
+ qdel(R)
temp = "All Employment records deleted."
if ("Delete Record (ALL)")
@@ -373,9 +374,9 @@ What a mess.*/
PDA_Manifest.Cut()
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
- del(R)
+ qdel(R)
else
- del(active1)
+ qdel(active1)
else
temp = "This function does not appear to be working at the moment. Our apologies."
@@ -408,7 +409,7 @@ What a mess.*/
continue
else if(prob(1))
- del(R)
+ qdel(R)
continue
- ..(severity)
\ No newline at end of file
+ ..(severity)
diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm
index 01728b4e50..3d44a7a260 100644
--- a/code/game/machinery/computer/specops_shuttle.dm
+++ b/code/game/machinery/computer/specops_shuttle.dm
@@ -15,6 +15,7 @@ var/specops_shuttle_timeleft = 0
name = "special operations shuttle control console"
icon = 'icons/obj/computer.dmi'
icon_state = "shuttle"
+ light_color = "#00ffff"
req_access = list(access_cent_specops)
// req_access = list(ACCESS_CENT_SPECOPS)
var/temp = null
@@ -75,7 +76,7 @@ var/specops_shuttle_timeleft = 0
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
- del(T)
+ qdel(T)
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
@@ -94,7 +95,7 @@ var/specops_shuttle_timeleft = 0
for(var/obj/machinery/computer/specops_shuttle/S in world)
S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
- del(announcer)
+ qdel(announcer)
/proc/specops_process()
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
@@ -224,7 +225,7 @@ var/specops_shuttle_timeleft = 0
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
- del(T)
+ qdel(T)
start_location.move_contents_to(end_location)
@@ -235,7 +236,7 @@ var/specops_shuttle_timeleft = 0
for(var/obj/machinery/computer/specops_shuttle/S in world)
S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY
- del(announcer)
+ qdel(announcer)
/proc/specops_can_move()
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom)
diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm
index 6d5209ce58..696273d2ab 100644
--- a/code/game/machinery/computer/station_alert.dm
+++ b/code/game/machinery/computer/station_alert.dm
@@ -3,21 +3,27 @@
name = "Station Alert Console"
desc = "Used to access the station's automated alert system."
icon_state = "alert:0"
- circuit = "/obj/item/weapon/circuitboard/stationalert"
+ light_color = "#e6ffff"
+ circuit = /obj/item/weapon/circuitboard/stationalert_engineering
var/obj/nano_module/alarm_monitor/alarm_monitor
var/monitor_type = /obj/nano_module/alarm_monitor/engineering
/obj/machinery/computer/station_alert/security
- name = "Security Alert Console"
monitor_type = /obj/nano_module/alarm_monitor/security
+ circuit = /obj/item/weapon/circuitboard/stationalert_security
+
+/obj/machinery/computer/station_alert/all
+ monitor_type = /obj/nano_module/alarm_monitor/all
+ circuit = /obj/item/weapon/circuitboard/stationalert_all
/obj/machinery/computer/station_alert/New()
..()
alarm_monitor = new monitor_type(src)
alarm_monitor.register(src, /obj/machinery/computer/station_alert/update_icon)
-/obj/machinery/computer/station_alert/Del()
+/obj/machinery/computer/station_alert/Destroy()
alarm_monitor.unregister(src)
+ qdel(alarm_monitor)
..()
/obj/machinery/computer/station_alert/attack_ai(mob/user)
diff --git a/code/game/machinery/computer/supply.dm b/code/game/machinery/computer/supply.dm
index 233a271108..b5df1127c9 100644
--- a/code/game/machinery/computer/supply.dm
+++ b/code/game/machinery/computer/supply.dm
@@ -2,6 +2,7 @@
name = "supply control console"
icon = 'icons/obj/computer.dmi'
icon_state = "supply"
+ light_color = "#b88b2e"
req_access = list(access_cargo)
circuit = "/obj/item/weapon/circuitboard/supplycomp"
var/temp = null
diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm
index 970bb362c3..dd921abf09 100644
--- a/code/game/machinery/computer/syndicate_specops_shuttle.dm
+++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm
@@ -14,6 +14,7 @@ var/syndicate_elite_shuttle_timeleft = 0
name = "elite syndicate squad shuttle control console"
icon = 'icons/obj/computer.dmi'
icon_state = "syndishuttle"
+ light_color = "#00ffff"
req_access = list(access_cent_specops)
var/temp = null
var/hacked = 0
@@ -160,7 +161,7 @@ var/syndicate_elite_shuttle_timeleft = 0
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
- del(T)
+ qdel(T)
for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area...
bug.gib()
@@ -256,4 +257,4 @@ var/syndicate_elite_shuttle_timeleft = 0
add_fingerprint(usr)
updateUsrDialog()
- return
\ No newline at end of file
+ return
diff --git a/code/game/machinery/computer3/buildandrepair.dm b/code/game/machinery/computer3/buildandrepair.dm
index 38db742ee6..eef7503f97 100644
--- a/code/game/machinery/computer3/buildandrepair.dm
+++ b/code/game/machinery/computer3/buildandrepair.dm
@@ -15,7 +15,6 @@
var/list/req_components = null
var/powernet = null
var/list/records = null
- var/frame_desc = null
var/datum/file/program/OS = new/datum/file/program/ntos
@@ -95,7 +94,7 @@
if(!src || !WT.isOn()) return
user << "\blue You deconstruct the frame."
new /obj/item/stack/sheet/metal( src.loc, 5 )
- del(src)
+ qdel(src)
if(1)
if(istype(P, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
@@ -160,7 +159,7 @@
if(do_after(user, 20))
if(P)
P:amount -= 5
- if(!P:amount) del(P)
+ if(!P:amount) qdel(P)
user << "\blue You add cables to the frame."
src.state = 3
src.icon_state = "3"
@@ -212,7 +211,7 @@
if(circuit.OS)
circuit.OS.computer = B
B.RefreshParts() // todo
- del(src)
+ qdel(src)
/*
This will remove peripherals if you specify one, but the main function is to
diff --git a/code/game/machinery/computer3/computer.dm b/code/game/machinery/computer3/computer.dm
index 4939444ae5..ff4b69b20f 100644
--- a/code/game/machinery/computer3/computer.dm
+++ b/code/game/machinery/computer3/computer.dm
@@ -215,11 +215,11 @@
ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(25))
- del(src)
+ qdel(src)
return
if (prob(50))
for(var/x in verbs)
@@ -278,8 +278,8 @@
chan = power_channel
var/area/A = get_area(loc)
- if(istype(A) && A.master && A.master.powered(chan))
- A.master.use_power(amount, chan)
+ if(istype(A) && A.powered(chan))
+ A.use_power(amount, chan)
else if(battery && battery.charge > 0)
battery.use(amount)
diff --git a/code/game/machinery/computer3/computers/HolodeckControl.dm b/code/game/machinery/computer3/computers/HolodeckControl.dm
index 80d60afd07..9e4532604b 100644
--- a/code/game/machinery/computer3/computers/HolodeckControl.dm
+++ b/code/game/machinery/computer3/computers/HolodeckControl.dm
@@ -160,7 +160,7 @@
if(!silent)
var/obj/oldobj = obj
obj.visible_message("The [oldobj.name] fades away!")
- del(obj)
+ qdel(obj)
proc/checkInteg(var/area/A)
for(var/turf/T in A)
@@ -213,10 +213,10 @@
derez(item)
for(var/obj/effect/decal/cleanable/blood/B in linkedholodeck)
- del(B)
+ qdel(B)
for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck)
- del(C)
+ qdel(C)
holographic_items = A.copy_contents_to(linkedholodeck , 1)
diff --git a/code/game/machinery/computer3/computers/camera.dm b/code/game/machinery/computer3/computers/camera.dm
index 17f14e0cbf..f90b0526ee 100644
--- a/code/game/machinery/computer3/computers/camera.dm
+++ b/code/game/machinery/computer3/computers/camera.dm
@@ -238,7 +238,7 @@
camera_list = "Network Key: [key.title] [topic_link(src,"keyselect","\[ Select key \]")]
"
for(var/obj/machinery/camera/C in temp_list)
- if(C.status)
+ if(C.can_use())
camera_list += "[C.c_tag] - [topic_link(src,"show=\ref[C]","Show")]
"
else
camera_list += "[C.c_tag] - DEACTIVATED
"
@@ -264,7 +264,7 @@
if("show" in href_list)
var/obj/machinery/camera/C = locate(href_list["show"])
- if(istype(C) && C.status)
+ if(istype(C) && C.can_use())
set_current(C)
usr.reset_view(C)
interact()
diff --git a/code/game/machinery/computer3/computers/medical.dm b/code/game/machinery/computer3/computers/medical.dm
index adb7ff9079..aec0b615f5 100644
--- a/code/game/machinery/computer3/computers/medical.dm
+++ b/code/game/machinery/computer3/computers/medical.dm
@@ -136,7 +136,7 @@
dat += "Back"
dat += "
Medical Robots:"
var/bdat = null
- for(var/obj/machinery/bot/medbot/M in world)
+ for(var/mob/living/bot/medbot/M in world)
if(M.z != computer.z) continue //only find medibots on the same z-level as the computer
var/turf/bl = get_turf(M)
@@ -254,7 +254,7 @@
if (href_list["del_all2"])
for(var/datum/data/record/R in data_core.medical)
//R = null
- del(R)
+ qdel(R)
//Foreach goto(494)
src.temp = "All records deleted."
@@ -422,7 +422,7 @@
if (href_list["del_r2"])
if (src.active2)
//src.active2 = null
- del(src.active2)
+ qdel(src.active2)
if (href_list["d_rec"])
var/datum/data/record/R = locate(href_list["d_rec"])
diff --git a/code/game/machinery/computer3/computers/security.dm b/code/game/machinery/computer3/computers/security.dm
index 924f32b1b7..f2de764894 100644
--- a/code/game/machinery/computer3/computers/security.dm
+++ b/code/game/machinery/computer3/computers/security.dm
@@ -397,7 +397,7 @@ What a mess.*/
if ("Purge All Records")
for(var/datum/data/record/R in data_core.security)
- del(R)
+ qdel(R)
temp = "All Security records deleted."
if ("Add Entry")
@@ -558,17 +558,17 @@ What a mess.*/
if ("Delete Record (Security) Execute")
if (active2)
- del(active2)
+ qdel(active2)
if ("Delete Record (ALL) Execute")
if (active1)
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
- del(R)
+ qdel(R)
else
- del(active1)
+ qdel(active1)
if (active2)
- del(active2)
+ qdel(active2)
else
temp = "This function does not appear to be working at the moment. Our apologies."
@@ -601,7 +601,7 @@ What a mess.*/
continue
else if(prob(1))
- del(R)
+ qdel(R)
continue
..(severity)
diff --git a/code/game/machinery/computer3/laptop.dm b/code/game/machinery/computer3/laptop.dm
index e0156e874e..484db52462 100644
--- a/code/game/machinery/computer3/laptop.dm
+++ b/code/game/machinery/computer3/laptop.dm
@@ -52,7 +52,7 @@
O.loc = loc
usr << "\The [src] crumbles to pieces."
spawn(5)
- del src
+ qdel(src)
return
if(!stored_computer.manipulating)
@@ -65,7 +65,7 @@
spawn(5)
stored_computer.manipulating = 0
- del src
+ qdel(src)
else
usr << "\red You are already opening the computer!"
@@ -185,12 +185,12 @@
else
stat &= ~NOPOWER
- Del()
+ Destroy()
if(istype(loc,/obj/item/device/laptop))
var/obj/O = loc
spawn(5)
if(O)
- del O
+ qdel(O)
..()
diff --git a/code/game/machinery/computer3/lapvend.dm b/code/game/machinery/computer3/lapvend.dm
index 72531b5d8e..b2e84f1cd2 100644
--- a/code/game/machinery/computer3/lapvend.dm
+++ b/code/game/machinery/computer3/lapvend.dm
@@ -31,7 +31,7 @@
/obj/machinery/lapvend/blob_act()
if (prob(50))
spawn(0)
- del(src)
+ qdel(src)
return
return
@@ -202,10 +202,10 @@
if (network == 3)
newlap.spawn_parts += (/obj/item/part/computer/networking/cable)
if (power == 1)
- del(newlap.battery)
+ qdel(newlap.battery)
newlap.battery = new /obj/item/weapon/cell/high(newlap)
if (power == 2)
- del(newlap.battery)
+ qdel(newlap.battery)
newlap.battery = new /obj/item/weapon/cell/super(newlap)
newlap.spawn_parts()
@@ -404,7 +404,7 @@
T.time = worldtime2text()
vendor_account.transaction_log.Add(T)
- del(relap)
+ qdel(relap)
vendmode = 0
cardreader = 0
floppy = 0
diff --git a/code/game/machinery/computer3/networking.dm b/code/game/machinery/computer3/networking.dm
index 27d7789008..66d25dda5a 100644
--- a/code/game/machinery/computer3/networking.dm
+++ b/code/game/machinery/computer3/networking.dm
@@ -143,10 +143,9 @@
if(typekey == null)
typekey = /obj/machinery
var/list/machines = list()
- for(var/area/area in A.related)
- for(var/obj/O in area.contents)
- if(istype(O,typekey))
- machines |= O
+ for(var/obj/O in A.contents)
+ if(istype(O,typekey))
+ machines |= O
return machines
verify_machine(var/obj/previous)
if(!previous) return 0
diff --git a/code/game/machinery/computer3/program.dm b/code/game/machinery/computer3/program.dm
index 74083b8ffd..0667fe2f73 100644
--- a/code/game/machinery/computer3/program.dm
+++ b/code/game/machinery/computer3/program.dm
@@ -111,7 +111,7 @@ Programs are a file that can be executed
update_icon()
if(popup)
popup.close()
- del popup
+ qdel(popup)
return
/*
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 0f906ad4b2..e01c3e4b8e 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -18,15 +18,11 @@
proc/update_desc()
var/D
if(req_components)
- D = "Requires "
- var/first = 1
+ var/list/component_list = new
for(var/I in req_components)
if(req_components[I] > 0)
- D += "[first?"":", "][num2text(req_components[I])] [req_component_names[I]]"
- first = 0
- if(first) // nothing needs to be added, then
- D += "nothing"
- D += "."
+ component_list += "[num2text(req_components[I])] [req_component_names[I]]"
+ D = "Requires [english_list(component_list)]."
desc = D
/obj/machinery/constructable_frame/machine_frame
@@ -53,7 +49,7 @@
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
user << "\blue You dismantle the frame"
new /obj/item/stack/sheet/metal(src.loc, 5)
- del(src)
+ qdel(src)
if(2)
if(istype(P, /obj/item/weapon/circuitboard))
var/obj/item/weapon/circuitboard/B = P
@@ -74,10 +70,7 @@
var/cp = text2path(A)
var/obj/ct = new cp() // have to quickly instantiate it get name
req_component_names[A] = ct.name
- if(circuit.frame_desc)
- desc = circuit.frame_desc
- else
- update_desc()
+ update_desc()
user << desc
else
user << "\red This frame does not accept circuit boards of this type!"
@@ -129,7 +122,7 @@
else
circuit.loc = null
new_machine.RefreshParts()
- del(src)
+ qdel(src)
else
if(istype(P, /obj/item))
for(var/I in req_components)
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index a9858742c9..4ccc48f8bd 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -24,9 +24,11 @@
..()
initialize_directions = dir
-/obj/machinery/atmospherics/unary/cryo_cell/Del()
- if(occupant)
- occupant.loc = loc
+/obj/machinery/atmospherics/unary/cryo_cell/Destroy()
+ var/turf/T = loc
+ T.contents += contents
+ if(beaker)
+ beaker.loc = get_step(loc, SOUTH) //Beaker is carefully ejected from the wreckage of the cryotube
..()
/obj/machinery/atmospherics/unary/cryo_cell/initialize()
@@ -190,7 +192,7 @@
return
var/mob/M = G:affecting
if(put_mob(M))
- del(G)
+ qdel(G)
return
/obj/machinery/atmospherics/unary/cryo_cell/update_icon()
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index b58b4a3517..41bb3bef2d 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -234,7 +234,7 @@
..()
-/obj/machinery/cryopod/Del()
+/obj/machinery/cryopod/Destroy()
if(occupant)
occupant.loc = loc
occupant.resting = 1
@@ -291,12 +291,12 @@
var/mob/living/silicon/robot/R = occupant
if(!istype(R)) return ..()
- del(R.mmi)
+ qdel(R.mmi)
for(var/obj/item/I in R.module) // the tools the borg has; metal, glass, guns etc
for(var/obj/item/O in I) // the things inside the tools, if anything; mainly for janiborg trash bags
O.loc = R
- del(I)
- del(R.module)
+ qdel(I)
+ qdel(R.module)
return ..()
@@ -308,7 +308,7 @@
occupant.drop_from_inventory(W)
W.loc = src
- if(W.contents.len) //Make sure we catch anything not handled by del() on the items.
+ if(W.contents.len) //Make sure we catch anything not handled by qdel() on the items.
for(var/obj/item/O in W.contents)
if(istype(O,/obj/item/weapon/storage/internal)) //Stop eating pockets, you fuck!
continue
@@ -328,7 +328,7 @@
break
if(!preserve)
- del(W)
+ qdel(W)
else
if(control_computer && control_computer.allow_items)
control_computer.frozen_items += W
@@ -341,7 +341,7 @@
// We don't want revs to get objectives that aren't for heads of staff. Letting
// them win or lose based on cryo is silly so we remove the objective.
if(istype(O,/datum/objective/mutiny) && O.target == occupant.mind)
- del(O)
+ qdel(O)
else if(O.target && istype(O.target,/datum/mind))
if(O.target == occupant.mind)
if(O.owner && O.owner.current)
@@ -353,7 +353,7 @@
if(!(O.target))
all_objectives -= O
O.owner.objectives -= O
- del(O)
+ qdel(O)
//Handle job slot/tater cleanup.
var/job = occupant.mind.assigned_role
@@ -361,7 +361,7 @@
job_master.FreeRole(job)
if(occupant.mind.objectives.len)
- del(occupant.mind.objectives)
+ qdel(occupant.mind.objectives)
occupant.mind.special_role = null
//else
//if(ticker.mode.name == "AutoTraitor")
@@ -374,13 +374,13 @@
PDA_Manifest.Cut()
for(var/datum/data/record/R in data_core.medical)
if ((R.fields["name"] == occupant.real_name))
- del(R)
+ qdel(R)
for(var/datum/data/record/T in data_core.security)
if ((T.fields["name"] == occupant.real_name))
- del(T)
+ qdel(T)
for(var/datum/data/record/G in data_core.general)
if ((G.fields["name"] == occupant.real_name))
- del(G)
+ qdel(G)
if(orient_right)
icon_state = "[base_icon_state]-r"
@@ -399,7 +399,7 @@
visible_message("\The [initial(name)] hums and hisses as it moves [occupant.real_name] into storage.", 3)
// Delete the mob.
- del(occupant)
+ qdel(occupant)
set_occupant(null)
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 87e7adea03..e49fb26283 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -91,14 +91,14 @@ for reference:
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
- del(src)
+ qdel(src)
..()
ex_act(severity)
switch(severity)
if(1.0)
visible_message("\red The barricade is blown apart!")
- del(src)
+ qdel(src)
return
if(2.0)
src.health -= 25
@@ -107,7 +107,7 @@ for reference:
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
- del(src)
+ qdel(src)
return
meteorhit()
@@ -115,14 +115,14 @@ for reference:
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
new /obj/item/stack/sheet/wood(get_turf(src))
- del(src)
+ qdel(src)
return
blob_act()
src.health -= 25
if (src.health <= 0)
visible_message("\red The blob eats through the barricade!")
- del(src)
+ qdel(src)
return
CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff.
@@ -264,7 +264,7 @@ for reference:
var/turf/Tsec = get_turf(src)
/* var/obj/item/stack/rods/ =*/
- new /obj/item/stack/rods(Tsec)
+ PoolOrNew(/obj/item/stack/rods, Tsec)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
@@ -272,4 +272,4 @@ for reference:
explosion(src.loc,-1,-1,0)
if(src)
- del(src)
\ No newline at end of file
+ qdel(src)
\ No newline at end of file
diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm
index 928dda2541..e010264d4a 100644
--- a/code/game/machinery/door_control.dm
+++ b/code/game/machinery/door_control.dm
@@ -1,27 +1,10 @@
-#define CONTROL_POD_DOORS 0
-#define CONTROL_NORMAL_DOORS 1
-#define CONTROL_EMITTERS 2
-
-/obj/machinery/door_control
- name = "remote door-control"
- desc = "It controls doors, remotely."
+/obj/machinery/button/remote
+ name = "remote object control"
+ desc = "It controls objects, remotely."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "doorctrl0"
- desc = "A remote control-switch for a door."
power_channel = ENVIRON
- var/id = null
- var/normaldoorcontrol = CONTROL_POD_DOORS
- var/desiredstate = 0 // Zero is closed, 1 is open.
- var/specialfunctions = 1
- /*
- Bitflag, 1= open
- 2= idscan,
- 4= bolts
- 8= shock
- 16= door safties
-
- */
-
+ var/desiredstate = 0
var/exposedwires = 0
var/wires = 3
/*
@@ -34,14 +17,13 @@
idle_power_usage = 2
active_power_usage = 4
-
-/obj/machinery/door_control/attack_ai(mob/user as mob)
+/obj/machinery/button/remote/attack_ai(mob/user as mob)
if(wires & 2)
return src.attack_hand(user)
else
user << "Error, no route to host."
-/obj/machinery/door_control/attackby(obj/item/weapon/W, mob/user as mob)
+/obj/machinery/button/remote/attackby(obj/item/weapon/W, mob/user as mob)
/* For later implementation
if (istype(W, /obj/item/weapon/screwdriver))
{
@@ -64,7 +46,56 @@
playsound(src.loc, "sparks", 100, 1)
return src.attack_hand(user)
-/obj/machinery/door_control/proc/handle_door()
+/obj/machinery/button/remote/attack_hand(mob/user as mob)
+ if(..())
+ return
+
+ src.add_fingerprint(user)
+ if(stat & (NOPOWER|BROKEN))
+ return
+
+ if(!allowed(user) && (wires & 1))
+ user << "Access Denied"
+ flick("doorctrl-denied",src)
+ return
+
+ use_power(5)
+ icon_state = "doorctrl1"
+ desiredstate = !desiredstate
+ trigger()
+ spawn(15)
+ update_icon()
+
+/obj/machinery/button/remote/proc/trigger()
+ return
+
+/obj/machinery/button/remote/power_change()
+ ..()
+ update_icon()
+
+/obj/machinery/button/remote/update_icon()
+ if(stat & NOPOWER)
+ icon_state = "doorctrl-p"
+ else
+ icon_state = "doorctrl0"
+
+/*
+ Airlock remote control
+*/
+/obj/machinery/button/remote/airlock
+ name = "remote door-control"
+ desc = "It controls doors, remotely."
+
+ var/specialfunctions = 1
+ /*
+ Bitflag, 1= open
+ 2= idscan,
+ 4= bolts
+ 8= shock
+ 16= door safties
+ */
+
+/obj/machinery/button/remote/airlock/trigger()
for(var/obj/machinery/door/airlock/D in world)
if(D.id_tag == src.id)
if(specialfunctions & OPEN)
@@ -78,24 +109,31 @@
return
if(desiredstate == 1)
if(specialfunctions & IDSCAN)
- D.aiDisabledIdScanner = 1
+ D.set_idscan(0)
if(specialfunctions & BOLTS)
D.lock()
if(specialfunctions & SHOCK)
D.electrify(-1)
if(specialfunctions & SAFE)
- D.safe = 0
+ D.set_safeties(0)
else
if(specialfunctions & IDSCAN)
- D.aiDisabledIdScanner = 0
+ D.set_idscan(1)
if(specialfunctions & BOLTS)
D.unlock()
if(specialfunctions & SHOCK)
D.electrify(0)
if(specialfunctions & SAFE)
- D.safe = 1
+ D.set_safeties(1)
-/obj/machinery/door_control/proc/handle_pod()
+/*
+ Blast door remote control
+*/
+/obj/machinery/button/remote/blast_door
+ name = "remote blast door-control"
+ desc = "It controls blast doors, remotely."
+
+/obj/machinery/button/remote/blast_door/trigger()
for(var/obj/machinery/door/blast/M in world)
if(M.id == src.id)
if(M.density)
@@ -107,59 +145,32 @@
M.close()
return
-/obj/machinery/door_control/proc/handle_emitters(mob/user as mob)
+/*
+ Emitter remote control
+*/
+/obj/machinery/button/remote/emitter
+ name = "remote emitter control"
+ desc = "It controls emitters, remotely."
+
+/obj/machinery/button/remote/emitter/trigger(mob/user as mob)
for(var/obj/machinery/power/emitter/E in world)
if(E.id == src.id)
spawn(0)
E.activate(user)
return
-/obj/machinery/door_control/attack_hand(mob/user as mob)
- src.add_fingerprint(user)
- if(stat & (NOPOWER|BROKEN))
- return
-
- if(!allowed(user) && (wires & 1))
- user << "\red Access Denied"
- flick("doorctrl-denied",src)
- return
-
- use_power(5)
- icon_state = "doorctrl1"
- add_fingerprint(user)
-
- switch(normaldoorcontrol)
- if(CONTROL_NORMAL_DOORS)
- handle_door()
- if(CONTROL_POD_DOORS)
- handle_pod()
- if(CONTROL_EMITTERS)
- handle_emitters(user)
-
- desiredstate = !desiredstate
- spawn(15)
- if(!(stat & NOPOWER))
- icon_state = "doorctrl0"
-
-/obj/machinery/door_control/power_change()
- ..()
- if(stat & NOPOWER)
- icon_state = "doorctrl-p"
- else
- icon_state = "doorctrl0"
-
-/obj/machinery/button/driver
+/*
+ Mass driver remote control
+*/
+/obj/machinery/button/remote/driver
name = "mass driver button"
desc = "A remote control switch for a mass driver."
+ icon = 'icons/obj/objects.dmi'
+ icon_state = "launcherbtt"
-/obj/machinery/button/driver/attack_hand(mob/user as mob)
- if(..())
- return
-
- use_power(5)
-
+/obj/machinery/button/remote/driver/trigger(mob/user as mob)
active = 1
- icon_state = "launcheract"
+ update_icon()
for(var/obj/machinery/door/blast/M in machines)
if (M.id == src.id)
@@ -177,11 +188,17 @@
for(var/obj/machinery/door/blast/M in machines)
if (M.id == src.id)
- spawn( 0 )
+ spawn(0)
M.close()
return
icon_state = "launcherbtt"
- active = 0
+ update_icon()
return
+
+/obj/machinery/button/remote/driver/update_icon()
+ if(!active || (stat & NOPOWER))
+ icon_state = "launcherbtt"
+ else
+ icon_state = "launcheract"
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 69c4ee2857..0857d2d175 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -4,7 +4,7 @@
icon_state = "door_closed"
power_channel = ENVIRON
- explosion_resistance = 15
+ explosion_resistance = 10
var/aiControlDisabled = 0 //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
var/hackProof = 0 // if 1, this door can't be hacked by the AI
var/electrified_until = 0 //World time when the door is no longer electrified. -1 if it is permanently electrified until someone fixes it.
@@ -80,6 +80,7 @@
icon = 'icons/obj/doors/Doorglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
glass = 1
@@ -91,6 +92,7 @@
/obj/machinery/door/airlock/vault
name = "Vault"
icon = 'icons/obj/doors/vault.dmi'
+ explosion_resistance = 20
opacity = 1
secured_wires = 1
assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites.
@@ -108,12 +110,14 @@
/obj/machinery/door/airlock/hatch
name = "Airtight Hatch"
icon = 'icons/obj/doors/Doorhatchele.dmi'
+ explosion_resistance = 20
opacity = 1
assembly_type = /obj/structure/door_assembly/door_assembly_hatch
/obj/machinery/door/airlock/maintenance_hatch
name = "Maintenance Hatch"
icon = 'icons/obj/doors/Doorhatchmaint2.dmi'
+ explosion_resistance = 20
opacity = 1
assembly_type = /obj/structure/door_assembly/door_assembly_mhatch
@@ -122,6 +126,7 @@
icon = 'icons/obj/doors/Doorcomglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_com
glass = 1
@@ -131,6 +136,7 @@
icon = 'icons/obj/doors/Doorengglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_eng
glass = 1
@@ -140,6 +146,7 @@
icon = 'icons/obj/doors/Doorsecglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_sec
glass = 1
@@ -149,6 +156,7 @@
icon = 'icons/obj/doors/Doormedglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_med
glass = 1
@@ -173,6 +181,7 @@
icon = 'icons/obj/doors/Doorresearchglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_research
glass = 1
@@ -183,6 +192,7 @@
icon = 'icons/obj/doors/Doorminingglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_min
glass = 1
@@ -192,6 +202,7 @@
icon = 'icons/obj/doors/Dooratmoglass.dmi'
hitsound = 'sound/effects/Glasshit.ogg'
maxhealth = 300
+ explosion_resistance = 5
opacity = 0
assembly_type = /obj/structure/door_assembly/door_assembly_atmo
glass = 1
@@ -261,16 +272,12 @@
for(var/turf/simulated/floor/target_tile in range(2,loc))
target_tile.assume_gas("phoron", 35, 400+T0C)
spawn (0) target_tile.hotspot_expose(temperature, 400)
- for(var/obj/structure/falsewall/phoron/F in range(3,src))//Hackish as fuck, but until temperature_expose works, there is nothing I can do -Sieve
- var/turf/T = get_turf(F)
- T.ChangeTurf(/turf/simulated/wall/mineral/phoron/)
- del (F)
- for(var/turf/simulated/wall/mineral/phoron/W in range(3,src))
+ for(var/turf/simulated/wall/W in range(3,src))
W.ignite((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame
for(var/obj/machinery/door/airlock/phoron/D in range(3,src))
D.ignite(temperature/4)
new/obj/structure/door_assembly( src.loc )
- del (src)
+ qdel(src)
/obj/machinery/door/airlock/sandstone
name = "Sandstone Airlock"
@@ -292,6 +299,7 @@
/obj/machinery/door/airlock/highsecurity
name = "Secure Airlock"
icon = 'icons/obj/doors/hightechsecurity.dmi'
+ explosion_resistance = 20
secured_wires = 1
assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity
@@ -421,6 +429,33 @@ About the new airlock wires panel:
if(feedback && message)
usr << message
+/obj/machinery/door/airlock/proc/set_idscan(var/activate, var/feedback = 0)
+ var/message = ""
+ if(src.isWireCut(AIRLOCK_WIRE_IDSCAN))
+ message = "The IdScan wire is cut - IdScan feature permanently disabled."
+ else if(activate && src.aiDisabledIdScanner)
+ src.aiDisabledIdScanner = 0
+ message = "IdScan feature has been enabled."
+ else if(!activate && !src.aiDisabledIdScanner)
+ src.aiDisabledIdScanner = 1
+ message = "IdScan feature has been disabled."
+
+ if(feedback && message)
+ usr << message
+
+/obj/machinery/door/airlock/proc/set_safeties(var/activate, var/feedback = 0)
+ var/message = ""
+ // Safeties! We don't need no stinking safeties!
+ if (src.isWireCut(AIRLOCK_WIRE_SAFETY))
+ message = text("The safety wire is cut - Cannot enable safeties.")
+ else if (!activate && src.safe)
+ safe = 0
+ else if (activate && !src.safe)
+ safe = 1
+
+ if(feedback && message)
+ usr << message
+
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
// The preceding comment was borrowed from the grille's shock script
@@ -490,7 +525,8 @@ About the new airlock wires panel:
if("deny")
if(density && src.arePowerSystemsOn())
flick("door_deny", src)
- playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
+ if(secured_wires)
+ playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
return
/obj/machinery/door/airlock/attack_ai(mob/user as mob)
@@ -573,7 +609,7 @@ About the new airlock wires panel:
if (src.isElectrified())
if (istype(mover, /obj/item))
var/obj/item/i = mover
- if (i.matter && ("metal" in i.matter) && i.matter["metal"] > 0)
+ if (i.matter && (DEFAULT_WALL_MATERIAL in i.matter) && i.matter[DEFAULT_WALL_MATERIAL] > 0)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
@@ -636,14 +672,7 @@ About the new airlock wires panel:
var/activate = text2num(href_list["activate"])
switch (href_list["command"])
if("idscan")
- if(src.isWireCut(AIRLOCK_WIRE_IDSCAN))
- usr << "The IdScan wire has been cut - IdScan feature permanently disabled."
- else if(activate && src.aiDisabledIdScanner)
- src.aiDisabledIdScanner = 0
- usr << "IdScan feature has been enabled."
- else if(!activate && !src.aiDisabledIdScanner)
- src.aiDisabledIdScanner = 1
- usr << "IdScan feature has been disabled."
+ set_idscan(activate, 1)
if("main_power")
if(!main_power_lost_until)
src.loseMainPower()
@@ -652,7 +681,7 @@ About the new airlock wires panel:
src.loseBackupPower()
if("bolts")
if(src.isWireCut(AIRLOCK_WIRE_DOOR_BOLTS))
- usr << "The door bolt control wire has been cut - Door bolts permanently dropped."
+ usr << "The door bolt control wire is cut - Door bolts permanently dropped."
else if(activate && src.lock())
usr << "The door bolts have been dropped."
else if(!activate && src.unlock())
@@ -671,13 +700,7 @@ About the new airlock wires panel:
else if(!activate && !density)
close()
if("safeties")
- // Safeties! We don't need no stinking safeties!
- if (src.isWireCut(AIRLOCK_WIRE_SAFETY))
- usr << text("The safety wire is cut - Cannot secure the door.")
- else if (activate && src.safe)
- safe = 0
- else if (!activate && !src.safe)
- safe = 1
+ set_safeties(!activate, 1)
if("timing")
// Door speed control
if(src.isWireCut(AIRLOCK_WIRE_SPEED))
@@ -689,7 +712,7 @@ About the new airlock wires panel:
if("lights")
// Bolt lights
if(src.isWireCut(AIRLOCK_WIRE_LIGHT))
- usr << "The bolt lights wire has been cut - The door bolt lights are permanently disabled."
+ usr << "The bolt lights wire is cut - The door bolt lights are permanently disabled."
else if (!activate && src.lights)
lights = 0
usr << "The door bolt lights have been disabled."
@@ -770,7 +793,7 @@ About the new airlock wires panel:
electronics.loc = src.loc
electronics = null
- del(src)
+ qdel(src)
return
else if(arePowerSystemsOn())
user << "\blue The airlock's motors resist your efforts to force it."
@@ -856,40 +879,68 @@ About the new airlock wires panel:
return ..()
+/atom/movable/proc/blocks_airlock()
+ return density
+
+/obj/machinery/door/blocks_airlock()
+ return 0
+
+/obj/machinery/mech_sensor/blocks_airlock()
+ return 0
+
+/mob/living/blocks_airlock()
+ return 1
+
+/atom/movable/proc/airlock_crush(var/crush_damage)
+ return 0
+
+/obj/machinery/portable_atmospherics/canister/airlock_crush(var/crush_damage)
+ . = ..()
+ health -= crush_damage
+ healthcheck()
+
+/obj/structure/closet/airlock_crush(var/crush_damage)
+ ..()
+ damage(crush_damage)
+ for(var/atom/movable/AM in src)
+ AM.airlock_crush()
+ return 1
+
+/mob/living/airlock_crush(var/crush_damage)
+ . = ..()
+ adjustBruteLoss(crush_damage)
+ SetStunned(5)
+ SetWeakened(5)
+ var/turf/T = get_turf(src)
+ T.add_blood(src)
+
+/mob/living/carbon/airlock_crush(var/crush_damage)
+ . = ..()
+ if (!(species && (species.flags & NO_PAIN)))
+ emote("scream")
+
+/mob/living/silicon/robot/airlock_crush(var/crush_damage)
+ adjustBruteLoss(crush_damage)
+ return 0
+
/obj/machinery/door/airlock/close(var/forced=0)
if(!can_close(forced))
return 0
if(safe)
for(var/turf/turf in locs)
- if(locate(/mob/living) in turf)
- if(world.time > next_beep_at)
- playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
- next_beep_at = world.time + SecondsToTicks(10)
- close_door_at = world.time + 6
- return
+ for(var/atom/movable/AM in turf)
+ if(AM.blocks_airlock())
+ if(world.time > next_beep_at)
+ playsound(src.loc, 'sound/machines/buzz-two.ogg', 50, 0)
+ next_beep_at = world.time + SecondsToTicks(10)
+ close_door_at = world.time + 6
+ return
for(var/turf/turf in locs)
- for(var/mob/living/M in turf)
- if(isrobot(M))
- M.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
- else
- M.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
- M.SetStunned(5)
- M.SetWeakened(5)
- var/obj/effect/stop/S
- S = new /obj/effect/stop
- S.victim = M
- S.loc = M.loc
- spawn(20)
- del(S)
- if (iscarbon(M))
- var/mob/living/carbon/C = M
- if (!(C.species && (C.species.flags & NO_PAIN)))
- M.emote("scream")
- var/turf/location = src.loc
- if(istype(location, /turf/simulated))
- location.add_blood(M)
+ for(var/atom/movable/AM in turf)
+ if(AM.airlock_crush(DOOR_CRUSH_DAMAGE))
+ take_damage(DOOR_CRUSH_DAMAGE)
use_power(360) //360 W seems much more appropriate for an actuator moving an industrial door capable of crushing people
if(istype(src, /obj/machinery/door/airlock/glass))
@@ -928,6 +979,11 @@ About the new airlock wires panel:
update_icon()
return 1
+/obj/machinery/door/airlock/allowed(mob/M)
+ if(locked)
+ return 0
+ return ..(M)
+
/obj/machinery/door/airlock/New(var/newloc, var/obj/structure/door_assembly/assembly=null)
..()
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index ad9d991036..053b776736 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -30,7 +30,7 @@ obj/machinery/door/airlock/proc/execute_current_command()
if (!cur_command)
return
-
+
do_command(cur_command)
if (command_completed(cur_command))
cur_command = null
@@ -63,7 +63,7 @@ obj/machinery/door/airlock/proc/do_command(var/command)
lock()
sleep(2)
-
+
send_status()
obj/machinery/door/airlock/proc/command_completed(var/command)
@@ -85,7 +85,7 @@ obj/machinery/door/airlock/proc/command_completed(var/command)
if("secure_close")
return (locked && density)
-
+
return 1 //Unknown command. Just assume it's completed.
obj/machinery/door/airlock/proc/send_status(var/bumped = 0)
@@ -97,7 +97,7 @@ obj/machinery/door/airlock/proc/send_status(var/bumped = 0)
signal.data["door_status"] = density?("closed"):("open")
signal.data["lock_status"] = locked?("locked"):("unlocked")
-
+
if (bumped)
signal.data["bumped_with_access"] = 1
@@ -142,8 +142,10 @@ obj/machinery/door/airlock/New()
if(radio_controller)
set_frequency(frequency)
-
-
+obj/machinery/door/airlock/Destroy()
+ if(frequency && radio_controller)
+ radio_controller.remove_object(src,frequency)
+ ..()
obj/machinery/airlock_sensor
icon = 'icons/obj/airlock_machines.dmi'
@@ -215,6 +217,10 @@ obj/machinery/airlock_sensor/New()
if(radio_controller)
set_frequency(frequency)
+obj/machinery/airlock_sensor/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src,frequency)
+ ..()
obj/machinery/airlock_sensor/airlock_interior
command = "cycle_interior"
@@ -283,6 +289,11 @@ obj/machinery/access_button/New()
if(radio_controller)
set_frequency(frequency)
+obj/machinery/access_button/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, frequency)
+ ..()
+
obj/machinery/access_button/airlock_interior
frequency = 1379
command = "cycle_interior"
diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm
index 32e356de3f..78b8808d28 100644
--- a/code/game/machinery/doors/airlock_electronics.dm
+++ b/code/game/machinery/doors/airlock_electronics.dm
@@ -6,7 +6,7 @@
icon_state = "door_electronics"
w_class = 2.0 //It should be tiny! -Agouri
- matter = list("metal" = 50,"glass" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 50)
req_access = list(access_engine)
diff --git a/code/game/machinery/doors/alarmlock.dm b/code/game/machinery/doors/alarmlock.dm
index 67e5c83dc3..8b6ddb5834 100644
--- a/code/game/machinery/doors/alarmlock.dm
+++ b/code/game/machinery/doors/alarmlock.dm
@@ -13,6 +13,11 @@
..()
air_connection = new
+/obj/machinery/door/airlock/alarmlock/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src,air_frequency)
+ ..()
+
/obj/machinery/door/airlock/alarmlock/initialize()
..()
radio_controller.remove_object(src, air_frequency)
@@ -29,8 +34,6 @@
var/alert = signal.data["alert"]
var/area/our_area = get_area(src)
- if (our_area.master)
- our_area = our_area.master
if(alarm_area == our_area.name)
switch(alert)
@@ -39,4 +42,4 @@
close()
if("minor", "clear")
autoclose = 0
- open()
\ No newline at end of file
+ open()
diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm
index 19ac77d2c7..374f0426ad 100644
--- a/code/game/machinery/doors/blast_door.dm
+++ b/code/game/machinery/doors/blast_door.dm
@@ -23,8 +23,8 @@
var/id = 1.0
dir = 1
explosion_resistance = 25
-
- //Most blast doors are infrequently toggled and sometimes used with regular doors anyways,
+
+ //Most blast doors are infrequently toggled and sometimes used with regular doors anyways,
//turning this off prevents awkward zone geometry in places like medbay lobby, for example.
block_air_zones = 0
@@ -56,7 +56,7 @@
src.density = 0
update_nearby_tiles()
src.update_icon()
- src.SetOpacity(0)
+ src.set_opacity(0)
sleep(15)
src.layer = open_layer
src.operating = 0
@@ -71,7 +71,7 @@
src.density = 1
update_nearby_tiles()
src.update_icon()
- src.SetOpacity(initial(opacity))
+ src.set_opacity(initial(opacity))
sleep(15)
src.operating = 0
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index b3dc9bf978..27ce595a77 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -35,11 +35,11 @@
..()
spawn(20)
- for(var/obj/machinery/door/window/brigdoor/M in world)
+ for(var/obj/machinery/door/window/brigdoor/M in machines)
if (M.id == src.id)
targets += M
- for(var/obj/machinery/flasher/F in world)
+ for(var/obj/machinery/flasher/F in machines)
if(F.id == src.id)
targets += F
@@ -345,4 +345,4 @@
#undef FONT_SIZE
#undef FONT_COLOR
#undef FONT_STYLE
-#undef CHARS_PER_LINE
\ No newline at end of file
+#undef CHARS_PER_LINE
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index c56c416a74..0f3760009d 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -68,8 +68,7 @@
update_nearby_tiles(need_rebuild=1)
return
-
-/obj/machinery/door/Del()
+/obj/machinery/door/Destroy()
density = 0
update_nearby_tiles()
..()
@@ -103,8 +102,8 @@
bumpopen(M)
return
- if(istype(AM, /obj/machinery/bot))
- var/obj/machinery/bot/bot = AM
+ if(istype(AM, /mob/living/bot))
+ var/mob/living/bot/bot = AM
if(src.check_access(bot.botcard))
if(density)
open()
@@ -165,10 +164,10 @@
switch (Proj.damage_type)
if(BRUTE)
new /obj/item/stack/sheet/metal(src.loc, 2)
- new /obj/item/stack/rods(src.loc, 3)
+ PoolOrNew(/obj/item/stack/rods, list(src.loc, 3))
if(BURN)
new /obj/effect/decal/cleanable/ash(src.loc) // Turn it to ashes!
- del(src)
+ qdel(src)
if(Proj.damage)
//cap projectile damage so that there's still a minimum number of hits required to break the door
@@ -251,7 +250,7 @@
user << "You finish repairing the damage to \the [src]."
health = between(health, health + repairing.amount*DOOR_REPAIR_AMOUNT, maxhealth)
update_icon()
- del(repairing)
+ qdel(repairing)
return
if(repairing && istype(I, /obj/item/weapon/crowbar))
@@ -329,7 +328,7 @@
/obj/machinery/door/blob_act()
if(prob(40))
- del(src)
+ qdel(src)
return
@@ -342,10 +341,10 @@
/obj/machinery/door/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
if(2.0)
if(prob(25))
- del(src)
+ qdel(src)
else
take_damage(300)
if(3.0)
@@ -389,21 +388,22 @@
/obj/machinery/door/proc/open(var/forced = 0)
- if(!can_open(forced)) return
+ if(!can_open(forced))
+ return
+ operating = 1
do_animate("opening")
icon_state = "door0"
- src.SetOpacity(0)
+ set_opacity(0)
sleep(3)
src.density = 0
sleep(7)
src.layer = open_layer
explosion_resistance = 0
update_icon()
- SetOpacity(0)
+ set_opacity(0)
update_nearby_tiles()
-
- if(operating) operating = 0
+ operating = 0
if(autoclose)
close_door_at = next_close_time()
@@ -427,14 +427,14 @@
sleep(7)
update_icon()
if(visible && !glass)
- SetOpacity(1) //caaaaarn!
+ set_opacity(1) //caaaaarn!
operating = 0
update_nearby_tiles()
//I shall not add a check every x ticks if a door has closed over some fire.
var/obj/fire/fire = locate() in loc
if(fire)
- del fire
+ qdel(fire)
return
/obj/machinery/door/proc/requiresID()
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 790f94fd17..a3fca76a44 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -56,7 +56,7 @@
for(var/obj/machinery/door/firedoor/F in loc)
if(F != src)
spawn(1)
- del src
+ qdel(src)
return .
var/area/A = get_area(src)
ASSERT(istype(A))
@@ -70,14 +70,14 @@
A.all_doors.Add(src)
areas_added += A
-/obj/machinery/door/firedoor/Del()
+/obj/machinery/door/firedoor/Destroy()
for(var/area/A in areas_added)
A.all_doors.Remove(src)
. = ..()
/obj/machinery/door/firedoor/examine(mob/user)
- . = ..()
+ . = ..(user, 1)
if(!. || !density)
return
@@ -231,7 +231,7 @@
FA.density = 1
FA.wired = 1
FA.update_icon()
- del(src)
+ qdel(src)
return
if(blocked)
diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm
index 435a927857..d3a70fe85e 100644
--- a/code/game/machinery/doors/firedoor_assembly.dm
+++ b/code/game/machinery/doors/firedoor_assembly.dm
@@ -42,8 +42,8 @@ obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob)
user.visible_message("[user] has inserted a circuit into \the [src]!",
"You have inserted the circuit into \the [src]!")
new /obj/machinery/door/firedoor(src.loc)
- del(C)
- del(src)
+ qdel(C)
+ qdel(src)
else
user << "You must secure \the [src] first!"
else if(istype(C, /obj/item/weapon/wrench))
@@ -62,7 +62,7 @@ obj/structure/firedoor_assembly/attackby(C as obj, mob/user as mob)
user.visible_message("[user] has dissassembled \the [src].",
"You have dissassembled \the [src].")
new /obj/item/stack/sheet/metal(src.loc, 2)
- del (src)
+ qdel(src)
else
user << "You need more welding fuel."
else
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 362753cac8..b91270ad60 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -49,16 +49,16 @@
playsound(src, "shatter", 70, 1)
if(display_message)
visible_message("[src] shatters!")
- del(src)
+ qdel(src)
-/obj/machinery/door/window/Del()
+/obj/machinery/door/window/Destroy()
density = 0
update_nearby_tiles()
..()
/obj/machinery/door/window/Bumped(atom/movable/AM as mob|obj)
if (!( ismob(AM) ))
- var/obj/machinery/bot/bot = AM
+ var/mob/living/bot/bot = AM
if(istype(bot))
if(density && src.check_access(bot.botcard))
open()
diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm
index dbe7f1b8a7..ec9f4e7acc 100644
--- a/code/game/machinery/doppler_array.dm
+++ b/code/game/machinery/doppler_array.dm
@@ -9,7 +9,7 @@ var/list/doppler_arrays = list()
..()
doppler_arrays += src
-/obj/machinery/doppler_array/Del()
+/obj/machinery/doppler_array/Destroy()
doppler_arrays -= src
..()
diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm
index 8661651a39..a128e6c4e4 100644
--- a/code/game/machinery/embedded_controller/embedded_controller_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm
@@ -9,6 +9,11 @@
var/on = 1
+obj/machinery/embedded_controller/radio/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src,frequency)
+ ..()
+
/obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line)
return 0
@@ -70,7 +75,7 @@
//use_power(radio_power_use) //neat idea, but causes way too much lag.
return radio_connection.post_signal(src, signal, filter)
else
- del(signal)
+ qdel(signal)
/obj/machinery/embedded_controller/radio/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
diff --git a/code/game/machinery/embedded_controller/embedded_program_base.dm b/code/game/machinery/embedded_controller/embedded_program_base.dm
index 611fcfc52e..f579aca6f7 100644
--- a/code/game/machinery/embedded_controller/embedded_program_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_program_base.dm
@@ -1,27 +1,27 @@
-
-/datum/computer/file/embedded_program
- var/list/memory = list()
- var/obj/machinery/embedded_controller/master
-
- var/id_tag
-
-/datum/computer/file/embedded_program/New(var/obj/machinery/embedded_controller/M)
- master = M
- if (istype(M, /obj/machinery/embedded_controller/radio))
- var/obj/machinery/embedded_controller/radio/R = M
- id_tag = R.id_tag
-
-/datum/computer/file/embedded_program/proc/receive_user_command(command)
- return
-
-/datum/computer/file/embedded_program/proc/receive_signal(datum/signal/signal, receive_method, receive_param)
- return
-
-/datum/computer/file/embedded_program/proc/process()
- return
-
-/datum/computer/file/embedded_program/proc/post_signal(datum/signal/signal, comm_line)
- if(master)
- master.post_signal(signal, comm_line)
- else
- del(signal)
+
+/datum/computer/file/embedded_program
+ var/list/memory = list()
+ var/obj/machinery/embedded_controller/master
+
+ var/id_tag
+
+/datum/computer/file/embedded_program/New(var/obj/machinery/embedded_controller/M)
+ master = M
+ if (istype(M, /obj/machinery/embedded_controller/radio))
+ var/obj/machinery/embedded_controller/radio/R = M
+ id_tag = R.id_tag
+
+/datum/computer/file/embedded_program/proc/receive_user_command(command)
+ return
+
+/datum/computer/file/embedded_program/proc/receive_signal(datum/signal/signal, receive_method, receive_param)
+ return
+
+/datum/computer/file/embedded_program/proc/process()
+ return
+
+/datum/computer/file/embedded_program/proc/post_signal(datum/signal/signal, comm_line)
+ if(master)
+ master.post_signal(signal, comm_line)
+ else
+ qdel(signal)
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index d71b060bb0..b7272dc829 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -26,7 +26,7 @@
else
on = 0
updateicon()
- SetLuminosity(0)
+ set_light(0)
src.visible_message("[src] shuts down due to lack of power!")
return
@@ -50,7 +50,7 @@
if(on)
on = 0
user << "\blue You turn off the light"
- SetLuminosity(0)
+ set_light(0)
else
if(!cell)
return
@@ -58,7 +58,7 @@
return
on = 1
user << "\blue You turn on the light"
- SetLuminosity(brightness_on)
+ set_light(brightness_on)
updateicon()
diff --git a/code/game/machinery/floorlayer.dm b/code/game/machinery/floorlayer.dm
new file mode 100644
index 0000000000..009d1c7694
--- /dev/null
+++ b/code/game/machinery/floorlayer.dm
@@ -0,0 +1,114 @@
+/obj/machinery/floorlayer
+
+ name = "automatic floor layer"
+ icon = 'icons/obj/stationobjs.dmi'
+ icon_state = "pipe_d"
+ density = 1
+ var/turf/old_turf
+ var/on = 0
+ var/obj/item/stack/tile/T
+ var/list/mode = list("dismantle"=0,"laying"=0,"collect"=0)
+
+/obj/machinery/floorlayer/New()
+ T = new/obj/item/stack/tile/plasteel(src)
+ ..()
+
+/obj/machinery/floorlayer/Move(new_turf,M_Dir)
+ ..()
+
+ if(on)
+ if(mode["dismantle"])
+ dismantleFloor(old_turf)
+
+ if(mode["laying"])
+ layFloor(old_turf)
+
+ if(mode["collect"])
+ CollectTiles(old_turf)
+
+
+ old_turf = new_turf
+
+/obj/machinery/floorlayer/attack_hand(mob/user as mob)
+ on=!on
+ user.visible_message("[user] has [!on?"de":""]activated \the [src].", "You [!on?"de":""]activate \the [src].")
+ return
+
+/obj/machinery/floorlayer/attackby(var/obj/item/W as obj, var/mob/user as mob)
+
+ if (istype(W, /obj/item/weapon/wrench))
+ var/m = input("Choose work mode", "Mode") as null|anything in mode
+ mode[m] = !mode[m]
+ var/O = mode[m]
+ user.visible_message("[usr] has set \the [src] [m] mode [!O?"off":"on"].", "You set \the [src] [m] mode [!O?"off":"on"].")
+ return
+
+ if(istype(W, /obj/item/stack/tile))
+ user << "\The [W] successfully loaded."
+ user.drop_item(T)
+ TakeTile(T)
+ return
+
+ if(istype(W, /obj/item/weapon/crowbar))
+ if(!length(contents))
+ user << "\The [src] is empty."
+ else
+ var/obj/item/stack/tile/E = input("Choose remove tile type.", "Tiles") as null|anything in contents
+ if(E)
+ user << "You remove the [E] from /the [src]."
+ E.loc = src.loc
+ T = null
+ return
+
+ if(istype(W, /obj/item/weapon/screwdriver))
+ T = input("Choose tile type.", "Tiles") as null|anything in contents
+ return
+ ..()
+
+/obj/machinery/floorlayer/examine(mob/user)
+ ..()
+ var/dismantle = mode["dismantle"]
+ var/laying = mode["laying"]
+ var/collect = mode["collect"]
+ user << "\The [src] [!T?"don't ":""]has [!T?"":"[T.get_amount()] [T] "]tile\s, dismantle is [dismantle?"on":"off"], laying is [laying?"on":"off"], collect is [collect?"on":"off"]."
+
+/obj/machinery/floorlayer/proc/reset()
+ on=0
+ return
+
+/obj/machinery/floorlayer/proc/dismantleFloor(var/turf/new_turf)
+ if(istype(new_turf, /turf/simulated/floor))
+ var/turf/simulated/floor/T = new_turf
+ if(!T.is_plating())
+ if(!T.broken && !T.burnt)
+ new T.floor_type(T)
+ T.make_plating()
+ return !new_turf.intact
+
+/obj/machinery/floorlayer/proc/TakeNewStack()
+ for(var/obj/item/stack/tile/tile in contents)
+ T = tile
+ return 1
+ return 0
+
+/obj/machinery/floorlayer/proc/SortStacks()
+ for(var/obj/item/stack/tile/tile1 in contents)
+ for(var/obj/item/stack/tile/tile2 in contents)
+ tile2.transfer_to(tile1)
+
+/obj/machinery/floorlayer/proc/layFloor(var/turf/w_turf)
+ if(!T)
+ if(!TakeNewStack())
+ return 0
+ w_turf.attackby(T , src)
+ return 1
+
+/obj/machinery/floorlayer/proc/TakeTile(var/obj/item/stack/tile/tile)
+ if(!T) T = tile
+ tile.loc = src
+
+ SortStacks()
+
+/obj/machinery/floorlayer/proc/CollectTiles(var/turf/w_turf)
+ for(var/obj/item/stack/tile/tile in w_turf)
+ TakeTile(tile)
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index a286b530ca..28bb2be7bc 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -37,7 +37,7 @@ var/const/HOLOPAD_MODE = RANGE_BASED
icon_state = "holopad0"
layer = TURF_LAYER+0.1 //Preventing mice and drones from sneaking under them.
-
+
var/power_per_hologram = 500 //per usage per hologram
idle_power_usage = 5
use_power = 1
@@ -120,10 +120,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
hologram.anchored = 1//So space wind cannot drag it.
hologram.name = "[A.name] (Hologram)"//If someone decides to right click.
- hologram.SetLuminosity(2) //hologram lighting
+ hologram.set_light(2) //hologram lighting
hologram.color = color //painted holopad gives coloured holograms
masters[A] = hologram
- SetLuminosity(2) //pad lighting
+ set_light(2) //pad lighting
icon_state = "holopad1"
A.holo = src
return 1
@@ -131,10 +131,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
/obj/machinery/hologram/holopad/proc/clear_holo(mob/living/silicon/ai/user)
if(user.holo == src)
user.holo = null
- del(masters[user])//Get rid of user's hologram //qdel
+ qdel(masters[user])//Get rid of user's hologram
masters -= user //Discard AI from the list of those who use holopad
if (!masters.len)//If no users left
- SetLuminosity(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted)
+ set_light(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted)
icon_state = "holopad0"
return 1
@@ -144,16 +144,15 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if((stat & NOPOWER) || !active_ai)
clear_holo(master)
continue
-
+
if((HOLOPAD_MODE == RANGE_BASED && (get_dist(master.eyeobj, src) > holo_range)))
clear_holo(master)
continue
-
+
if(HOLOPAD_MODE == AREA_BASED)
var/area/holo_area = get_area(src)
var/area/eye_area = get_area(master.eyeobj)
-
- if(!(eye_area in holo_area.master.related))
+ if(eye_area != holo_area)
clear_holo(master)
continue
@@ -182,24 +181,24 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
/obj/machinery/hologram/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
if(3.0)
if (prob(5))
- del(src)
+ qdel(src)
return
/obj/machinery/hologram/blob_act()
- del(src)
+ qdel(src)
return
/obj/machinery/hologram/meteorhit()
- del(src)
+ qdel(src)
return
-/obj/machinery/hologram/holopad/Del()
+/obj/machinery/hologram/holopad/Destroy()
for (var/mob/living/silicon/ai/master in masters)
clear_holo(master)
..()
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 63ad92f017..658686d953 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -32,7 +32,7 @@
if(80 to 90) filling.icon_state = "reagent80"
if(91 to INFINITY) filling.icon_state = "reagent100"
- filling.icon += mix_color_from_reagents(reagents.reagent_list)
+ filling.icon += reagents.get_color()
overlays += filling
/obj/machinery/iv_drip/MouseDrop(over_object, src_location, over_location)
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 972f51bd48..90305a7a78 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -36,7 +36,7 @@ datum/track/New(var/title_name, var/audio)
)
-/obj/machinery/media/jukebox/Del()
+/obj/machinery/media/jukebox/Destroy()
StopPlaying()
..()
@@ -160,7 +160,7 @@ datum/track/New(var/title_name, var/audio)
s.start()
new /obj/effect/decal/cleanable/blood/oil(src.loc)
- del(src)
+ qdel(src)
/obj/machinery/media/jukebox/attackby(obj/item/W as obj, mob/user as mob)
src.add_fingerprint(user)
@@ -188,11 +188,10 @@ datum/track/New(var/title_name, var/audio)
/obj/machinery/media/jukebox/proc/StopPlaying()
var/area/main_area = get_area(src)
// Always kill the current sound
- for(var/area/related_area in main_area.related)
- for(var/mob/living/M in mobs_in_area(related_area))
- M << sound(null, channel = 1)
+ for(var/mob/living/M in mobs_in_area(main_area))
+ M << sound(null, channel = 1)
- related_area.forced_ambience = null
+ main_area.forced_ambience = null
playing = 0
update_use_power(1)
update_icon()
@@ -204,12 +203,10 @@ datum/track/New(var/title_name, var/audio)
return
var/area/main_area = get_area(src)
- for(var/area/related_area in main_area.related)
- related_area.forced_ambience = sound(current_track.sound, channel = 1, repeat = 1, volume = 25)
-
- for(var/mob/living/M in mobs_in_area(related_area))
- if(M.mind)
- related_area.play_ambience(related_area)
+ main_area.forced_ambience = list(current_track.sound)
+ for(var/mob/living/M in mobs_in_area(main_area))
+ if(M.mind)
+ main_area.play_ambience(M)
playing = 1
update_use_power(2)
diff --git a/code/game/machinery/kitchen/gibber.dm b/code/game/machinery/kitchen/gibber.dm
index 1283e7e52c..69f6c1a2d5 100644
--- a/code/game/machinery/kitchen/gibber.dm
+++ b/code/game/machinery/kitchen/gibber.dm
@@ -31,7 +31,7 @@
if(isturf(input_obj.loc))
input_plate = input_obj.loc
gib_throw_dir = i
- del(input_obj)
+ qdel(input_obj)
break
if(!input_plate)
@@ -221,7 +221,7 @@
src.operating = 0
src.occupant.gib()
- del(src.occupant)
+ qdel(src.occupant)
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1)
operating = 0
@@ -229,7 +229,7 @@
// Todo: unify limbs and internal organs
// There's a chance that the gibber will fail to destroy some evidence.
if((istype(thing,/obj/item/organ) || istype(thing,/obj/item/organ)) && prob(80))
- del(thing)
+ qdel(thing)
continue
thing.loc = get_turf(thing) // Drop it onto the turf for throwing.
thing.throw_at(get_edge_target_turf(src,gib_throw_dir),rand(0,3),emagged ? 100 : 50) // Being pelted with bits of meat and bone would hurt.
diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm
index 38de38daa9..23efb8ab4c 100644
--- a/code/game/machinery/kitchen/microwave.dm
+++ b/code/game/machinery/kitchen/microwave.dm
@@ -353,7 +353,7 @@
var/id = O.reagents.get_master_reagent_id()
if (id)
amount+=O.reagents.get_reagent_amount(id)
- del(O)
+ qdel(O)
src.reagents.clear_reagents()
ffuu.reagents.add_reagent("carbon", amount)
ffuu.reagents.add_reagent("toxin", amount/10)
diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm
index a6fcf00274..9bfa0e1c5d 100644
--- a/code/game/machinery/kitchen/smartfridge.dm
+++ b/code/game/machinery/kitchen/smartfridge.dm
@@ -33,8 +33,8 @@
else
wires = new/datum/wires/smartfridge(src)
-/obj/machinery/smartfridge/Del()
- del(wires) // qdel
+/obj/machinery/smartfridge/Destroy()
+ qdel(wires)
..()
/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj)
@@ -146,7 +146,7 @@
var/D = S.dried_type
new D(loc)
item_quants[S.name]--
- del(S)
+ qdel(S)
return
return
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index dcf66a12b7..ded7ebc9b9 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -42,15 +42,14 @@
on = !on
- for(var/area/A in area.master.related)
- A.lightswitch = on
- A.updateicon()
+ area.lightswitch = on
+ area.updateicon()
- for(var/obj/machinery/light_switch/L in A)
- L.on = on
- L.updateicon()
+ for(var/obj/machinery/light_switch/L in area)
+ L.on = on
+ L.updateicon()
- area.master.power_change()
+ area.power_change()
/obj/machinery/light_switch/power_change()
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index d601146c18..d9b579ab03 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -49,7 +49,7 @@ Class Variables:
Class Procs:
New() 'game/machinery/machine.dm'
- Del() 'game/machinery/machine.dm'
+ Destroy() 'game/machinery/machine.dm'
auto_use_power() 'game/machinery/machine.dm'
This proc determines how power mode power is deducted by the machine.
@@ -121,7 +121,7 @@ Class Procs:
machines += src
machinery_sort_required = 1
-/obj/machinery/Del()
+/obj/machinery/Destroy()
machines -= src
..()
@@ -135,7 +135,7 @@ Class Procs:
if(use_power && stat == 0)
use_power(7500/severity)
- var/obj/effect/overlay/pulse2 = new/obj/effect/overlay ( src.loc )
+ var/obj/effect/overlay/pulse2 = PoolOrNew(/obj/effect/overlay, src.loc)
pulse2.icon = 'icons/effects/effects.dmi'
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
@@ -143,28 +143,28 @@ Class Procs:
pulse2.set_dir(pick(cardinal))
spawn(10)
- pulse2.delete()
+ qdel(pulse2)
..()
/obj/machinery/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(25))
- del(src)
+ qdel(src)
return
else
return
/obj/machinery/blob_act()
if(prob(50))
- del(src)
+ 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)
@@ -264,8 +264,8 @@ Class Procs:
s.start()
if (electrocute_mob(user, get_area(src), src, 0.7))
var/area/temp_area = get_area(src)
- if(temp_area && temp_area.master)
- var/obj/machinery/power/apc/temp_apc = temp_area.master.get_apc()
+ if(temp_area)
+ var/obj/machinery/power/apc/temp_apc = temp_area.get_apc()
if(temp_apc && temp_apc.terminal && temp_apc.terminal.powernet)
temp_apc.terminal.powernet.trigger_warning()
@@ -331,53 +331,5 @@ Class Procs:
if(I.reliability != 100 && crit_fail)
I.crit_fail = 1
I.loc = loc
- del(src)
+ qdel(src)
return 1
-
-/obj/machinery/proc/on_assess_perp(mob/living/carbon/human/perp)
- return 0
-
-/obj/machinery/proc/is_assess_emagged()
- return emagged
-
-/obj/machinery/proc/assess_perp(mob/living/carbon/human/perp, var/auth_weapons, var/check_records, var/check_arrest)
- var/threatcount = 0 //the integer returned
-
- if(is_assess_emagged())
- return 10 //if emagged, always return 10.
-
- threatcount += on_assess_perp(perp)
- if(threatcount >= 10)
- return threatcount
-
- //Agent cards lower threatlevel.
- var/obj/item/weapon/card/id/id = GetIdCard(perp)
- if(id && istype(id, /obj/item/weapon/card/id/syndicate))
- threatcount -= 2
-
- if(auth_weapons && !src.allowed(perp))
- if(istype(perp.l_hand, /obj/item/weapon/gun) || istype(perp.l_hand, /obj/item/weapon/melee))
- threatcount += 4
-
- if(istype(perp.r_hand, /obj/item/weapon/gun) || istype(perp.r_hand, /obj/item/weapon/melee))
- threatcount += 4
-
- if(istype(perp.belt, /obj/item/weapon/gun) || istype(perp.belt, /obj/item/weapon/melee))
- threatcount += 2
-
- if(perp.species.name != "Human") //beepsky so racist.
- threatcount += 2
-
- if(check_records || check_arrest)
- var/perpname = perp.name
- if(id)
- perpname = id.registered_name
-
- var/datum/data/record/R = find_security_record("name", perpname)
- if(check_records && !R)
- threatcount += 4
-
- if(check_arrest && R && (R.fields["criminal"] == "*Arrest*"))
- threatcount += 4
-
- return threatcount
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index b04e9d1851..501d7a0b75 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -164,7 +164,7 @@
if(prob(electricity_level))
explosion(loc, 0, 1, 2, 3) // ooo dat shit EXPLODES son
spawn(2)
- del(src)
+ qdel(src)
*/
updateicon()
@@ -190,8 +190,10 @@
pulling = 0
-
-
+/obj/machinery/magnetic_module/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, freq)
+ ..()
/obj/machinery/magnetic_controller
name = "Magnetic Control Console"
@@ -364,7 +366,7 @@
// N, S, E, W are directional
// C is center
// R is random (in magnetic field's bounds)
- del(signal)
+ qdel(signal)
break // break the loop if the character located is invalid
signal.data["command"] = nextmove
@@ -399,25 +401,7 @@
// there doesn't HAVE to be separators but it makes paths syntatically visible
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+/obj/machinery/magnetic_controller/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, frequency)
+ ..()
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index de2a13aab5..d7224f2212 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -240,6 +240,7 @@ Transponder Codes:"}
updateDialog()
-
-
-
+/obj/machinery/navbeacon/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, freq)
+ ..()
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index c902bdcd66..ff974fbe19 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -164,7 +164,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
var/c_locked=0; //Will our new channel be locked to public submissions?
var/hitstaken = 0 //Death at 3 hits from an item with force>=15
var/datum/feed_channel/viewing_channel = null
- luminosity = 0
+ light_range = 0
anchored = 1
@@ -180,7 +180,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
src.update_icon() //for any custom ones on the map...
..() //I just realised the newscasters weren't in the global machines list. The superconstructor call will tend to that
-/obj/machinery/newscaster/Del()
+/obj/machinery/newscaster/Destroy()
allCasters -= src
..()
@@ -223,12 +223,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
src.isbroken=1
if(prob(50))
- del(src)
+ qdel(src)
else
src.update_icon() //can't place it above the return and outside the if-else. or we might get runtimes of null.update_icon() if(prob(50)) goes in.
return
@@ -784,7 +784,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
photo_data.photo.loc = src.loc
if(!issilicon(user))
user.put_in_inactive_hand(photo_data.photo)
- del(photo_data)
+ qdel(photo_data)
if(istype(user.get_active_hand(), /obj/item/weapon/photo))
var/obj/item/photo = user.get_active_hand()
diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm
index d13f18c3e9..2fb1c721d3 100644
--- a/code/game/machinery/nuclear_bomb.dm
+++ b/code/game/machinery/nuclear_bomb.dm
@@ -423,7 +423,7 @@ obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob)
return
return
-/obj/item/weapon/disk/nuclear/Del()
+/obj/item/weapon/disk/nuclear/Destroy()
if(blobstart.len > 0)
var/obj/D = new /obj/item/weapon/disk/nuclear(pick(blobstart))
message_admins("[src] has been destroyed. Spawning [D] at ([D.x], [D.y], [D.z]).")
diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm
index de67e7cea1..cb80bd20af 100644
--- a/code/game/machinery/overview.dm
+++ b/code/game/machinery/overview.dm
@@ -180,8 +180,8 @@
HI.Insert(I, frame=1, delay = 5)
HI.Insert(J, frame=2, delay = 5)
- del(I)
- del(J)
+ qdel(I)
+ qdel(J)
H.icon = HI
H.layer = 25
usr.mapobjs += H
@@ -306,7 +306,7 @@
var/icon/I = imap[i+1]
H.icon = I
- del(I)
+ qdel(I)
H.layer = 25
usr.mapobjs += H
@@ -353,7 +353,7 @@ proc/getb(col)
/mob/proc/clearmap()
src.client.screen -= src.mapobjs
for(var/obj/screen/O in mapobjs)
- del(O)
+ qdel(O)
mapobjs = null
src.unset_machine()
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 637bcbee11..9bee0af72f 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -1149,7 +1149,7 @@ Buildable meters
"[user] fastens the [src].", \
"\blue You have fastened the [src].", \
"You hear ratchet.")
- del(src) // remove the pipe item
+ qdel(src) // remove the pipe item
return
//TODO: DEFERRED
@@ -1177,7 +1177,7 @@ Buildable meters
new/obj/machinery/meter( src.loc )
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You have fastened the meter to the pipe"
- del(src)
+ qdel(src)
//not sure why these are necessary
#undef PIPE_SIMPLE_STRAIGHT
#undef PIPE_SIMPLE_BENT
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index fb296d2409..6b8793eac7 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -103,7 +103,7 @@
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
usr << "\blue You put [W] back to [src]."
user.drop_item()
- del(W)
+ qdel(W)
return
else if (istype(W, /obj/item/weapon/wrench))
if (unwrenched==0)
@@ -145,7 +145,7 @@
//Allow you to push disposal pipes into it (for those with density 1)
/obj/machinery/pipedispenser/disposal/Crossed(var/obj/structure/disposalconstruct/pipe as obj)
if(istype(pipe) && !pipe.anchored)
- del(pipe)
+ qdel(pipe)
Nah
*/
@@ -161,7 +161,7 @@ Nah
if (pipe.anchored)
return
- del(pipe)
+ qdel(pipe)
/obj/machinery/pipedispenser/disposal/attack_hand(user as mob)
if(..())
diff --git a/code/game/machinery/pipe/pipelayer.dm b/code/game/machinery/pipe/pipelayer.dm
new file mode 100644
index 0000000000..32aafb21cd
--- /dev/null
+++ b/code/game/machinery/pipe/pipelayer.dm
@@ -0,0 +1,137 @@
+/obj/machinery/pipelayer
+
+ name = "automatic pipe layer"
+ icon = 'icons/obj/stationobjs.dmi'
+ icon_state = "pipe_d"
+ density = 1
+ var/turf/old_turf
+ var/old_dir
+ var/on = 0
+ var/a_dis = 0
+ var/P_type = 0
+ var/P_type_t = ""
+ var/max_metal = 50
+ var/metal = 10
+ var/obj/item/weapon/wrench/W
+ var/list/Pipes = list("regular pipes"=0,"scrubbers pipes"=31,"supply pipes"=29,"heat exchange pipes"=2)
+
+/obj/machinery/pipelayer/New()
+ W = new(src)
+ ..()
+
+/obj/machinery/pipelayer/Move(new_turf,M_Dir)
+ ..()
+
+ if(on && a_dis)
+ dismantleFloor(old_turf)
+ layPipe(old_turf,M_Dir,old_dir)
+
+ old_turf = new_turf
+ old_dir = turn(M_Dir,180)
+
+/obj/machinery/pipelayer/attack_hand(mob/user as mob)
+ if(!metal&&!on)
+ user << "\The [src] doesn't work without metal."
+ return
+ on=!on
+ user.visible_message("[user] has [!on?"de":""]activated \the [src].", "You [!on?"de":""]activate \the [src].")
+ return
+
+/obj/machinery/pipelayer/attackby(var/obj/item/W as obj, var/mob/user as mob)
+
+ if (istype(W, /obj/item/weapon/wrench))
+ P_type_t = input("Choose pipe type", "Pipe type") as null|anything in Pipes
+ P_type = Pipes[P_type_t]
+ user.visible_message("[user] has set \the [src] to manufacture [P_type_t].", "You set \the [src] to manufacture [P_type_t].")
+ return
+
+ if(istype(W, /obj/item/weapon/crowbar))
+ a_dis=!a_dis
+ 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/sheet/metal))
+
+ var/result = load_metal(W)
+ if(isnull(result))
+ user << "Unable to load [W] - no metal found."
+ else if(!result)
+ user << "\The [src] is full."
+ else
+ user.visible_message("[user] has loaded metal into \the [src].", "You load metal into \the [src]")
+
+ return
+
+ if(istype(W, /obj/item/weapon/screwdriver))
+ if(metal)
+ var/m = round(input(usr,"Please specify the amount of metal to remove","Remove metal",min(round(metal),50)) as num, 1)
+ m = min(m, 50)
+ m = min(m, round(metal))
+ m = round(m)
+ if(m)
+ use_metal(m)
+ var/obj/item/stack/sheet/metal/MM = new (get_turf(src))
+ MM.amount = m
+ user.visible_message("[user] removes [m] sheet\s of metal from the \the [src].", "You remove [m] sheet\s of metal from \the [src]")
+ else
+ user << "\The [src] is empty."
+ return
+ ..()
+
+/obj/machinery/pipelayer/examine(mob/user)
+ ..()
+ user << "\The [src] has [metal] sheet\s, is set to produce [P_type_t], and auto-dismantling is [!a_dis?"de":""]activated."
+
+/obj/machinery/pipelayer/proc/reset()
+ on=0
+ return
+
+/obj/machinery/pipelayer/proc/load_metal(var/obj/item/stack/sheet/metal/MM)
+ if(istype(MM) && MM.get_amount())
+ var/cur_amount = metal
+ var/to_load = max(max_metal - round(cur_amount),0)
+ if(to_load)
+ to_load = min(MM.get_amount(), to_load)
+ metal += to_load
+ MM.use(to_load)
+ return to_load
+ else
+ return 0
+ return
+
+/obj/machinery/pipelayer/proc/use_metal(amount)
+ if(!metal || metalYou remove the turret but did not manage to salvage anything.
"
- del(src) // qdel
+ 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
@@ -317,7 +317,7 @@
user << "You unsecure the exterior bolts on the turret."
invisibility = 0
update_icon()
- del(cover) //deletes the cover, and the turret instance itself becomes its own cover. - qdel
+ 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))
@@ -387,10 +387,10 @@
/obj/machinery/porta_turret/ex_act(severity)
switch (severity)
if (1)
- del(src)
+ qdel(src)
if (2)
if (prob(25))
- del(src)
+ qdel(src)
else
take_damage(150) //should instakill most turrets
if (3)
@@ -404,7 +404,7 @@
spark_system.start() //creates some sparks because they look cool
density = 1
update_icon()
- del(cover) //deletes the cover - no need on keeping it there! - del
+ qdel(cover) //deletes the cover - no need on keeping it there!
/obj/machinery/porta_turret/proc/create_cover()
if(cover == null && anchored)
@@ -418,7 +418,7 @@
if(cover == null && anchored) //if it has no cover and is anchored
if(stat & BROKEN) //if the turret is borked
- del(cover) //delete its cover, assuming it has one. Workaround for a pesky little bug - qdel
+ qdel(cover) //delete its cover, assuming it has one. Workaround for a pesky little bug
else
create_cover()
@@ -494,7 +494,7 @@
return check_anomalies ? TURRET_PRIORITY_TARGET : TURRET_NOT_TARGET
if(ishuman(L)) //if the target is a human, analyze threat level
- if(assess_perp(L, check_weapons, check_records, check_arrest) < 4)
+ if(assess_perp(L) < 4)
return TURRET_NOT_TARGET //if threat level < 4, keep going
if(L.lying) //if the perp is lying down, it's still a target but a less-important target
@@ -502,6 +502,15 @@
return TURRET_PRIORITY_TARGET //if the perp has passed all previous tests, congrats, it is now a "shoot-me!" nominee
+/obj/machinery/porta_turret/proc/assess_perp(var/mob/living/carbon/human/H)
+ if(!H || !istype(H))
+ return 0
+
+ if(emagged)
+ return 10
+
+ return H.assess_perp(src, 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))
return 1
@@ -548,15 +557,6 @@
invisibility = INVISIBILITY_LEVEL_TWO
update_icon()
-
-/obj/machinery/porta_turret/on_assess_perp(mob/living/carbon/human/perp)
- if((check_access || attacked) && !allowed(perp))
- //if the turret has been attacked or is angry, target all non-authorized personnel, see req_access
- return 10
-
- return ..()
-
-
/obj/machinery/porta_turret/proc/target(var/mob/living/target)
if(disabled)
return
@@ -572,7 +572,7 @@
/obj/machinery/porta_turret/proc/shootAt(var/mob/living/target)
//any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power!
- if(!emagged) //if it hasn't been emagged, it has to obey a cooldown rate
+ if(!(emagged || attacked)) //if it hasn't been emagged or attacked, it has to obey a cooldown rate
if(last_fired || !raised) //prevents rapid-fire shooting, unless it's been emagged
return
last_fired = 1
@@ -671,7 +671,7 @@
playsound(loc, 'sound/items/Crowbar.ogg', 75, 1)
user << "You dismantle the turret construction."
new /obj/item/stack/sheet/metal( loc, 5)
- del(src) // qdel
+ qdel(src) // qdel
return
if(1)
@@ -736,7 +736,7 @@
target_type = /obj/machinery/porta_turret
build_step = 4
- del(I) //delete the gun :( qdel
+ qdel(I) //delete the gun :(
return
else if(istype(I, /obj/item/weapon/wrench))
@@ -752,7 +752,7 @@
user << "\the [I] is stuck to your hand, you cannot put it in \the [src]"
return
user << "You add the prox sensor to the turret."
- del(I) // qdel
+ qdel(I)
return
//attack_hand() removes the gun
@@ -807,7 +807,7 @@
// Turret.cover=new/obj/machinery/porta_turret_cover(loc)
// Turret.cover.Parent_Turret=Turret
// Turret.cover.name = finish_name
- del(src) // qdel
+ qdel(src) // qdel
else if(istype(I, /obj/item/weapon/crowbar))
playsound(loc, 'sound/items/Crowbar.ogg', 75, 1)
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index e624e61d58..23aba34169 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -54,7 +54,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
var/message = "";
var/dpt = ""; //the department which will be receiving the message
var/priority = -1 ; //Priority of the message being sent
- luminosity = 0
+ light_range = 0
var/datum/announcement/announcement = new
/obj/machinery/requests_console/power_change()
@@ -80,37 +80,48 @@ var/list/obj/machinery/requests_console/allConsoles = list()
//req_console_departments += department
switch(departmentType)
if(1)
- if(!("[department]" in req_console_assistance))
- req_console_assistance += department
+ req_console_assistance |= department
if(2)
- if(!("[department]" in req_console_supplies))
- req_console_supplies += department
+ req_console_supplies |= department
if(3)
- if(!("[department]" in req_console_information))
- req_console_information += department
+ req_console_information |= department
if(4)
- if(!("[department]" in req_console_assistance))
- req_console_assistance += department
- if(!("[department]" in req_console_supplies))
- req_console_supplies += department
+ req_console_assistance |= department
+ req_console_supplies |= department
if(5)
- if(!("[department]" in req_console_assistance))
- req_console_assistance += department
- if(!("[department]" in req_console_information))
- req_console_information += department
+ req_console_assistance |= department
+ req_console_information |= department
if(6)
- if(!("[department]" in req_console_supplies))
- req_console_supplies += department
- if(!("[department]" in req_console_information))
- req_console_information += department
+ req_console_supplies |= department
+ req_console_information |= department
if(7)
- if(!("[department]" in req_console_assistance))
- req_console_assistance += department
- if(!("[department]" in req_console_supplies))
- req_console_supplies += department
- if(!("[department]" in req_console_information))
- req_console_information += department
+ req_console_assistance |= department
+ req_console_supplies |= department
+ req_console_information |= department
+/obj/machinery/requests_console/Destroy()
+ allConsoles -= src
+ switch(departmentType)
+ if(1)
+ req_console_assistance -= department
+ if(2)
+ req_console_supplies -= department
+ if(3)
+ req_console_information -= department
+ if(4)
+ req_console_assistance -= department
+ req_console_supplies -= department
+ if(5)
+ req_console_assistance -= department
+ req_console_information -= department
+ if(6)
+ req_console_supplies -= department
+ req_console_information -= department
+ if(7)
+ req_console_assistance -= department
+ req_console_supplies -= department
+ req_console_information -= department
+ ..()
/obj/machinery/requests_console/attack_hand(user as mob)
if(..(user))
@@ -165,7 +176,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if (Console.department == department)
Console.newmessagepriority = 0
Console.icon_state = "req_comp0"
- Console.luminosity = 1
+ Console.set_light(1)
newmessagepriority = 0
icon_state = "req_comp0"
for(var/msg in messages)
@@ -309,7 +320,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
Console.messages += "Message from [department]
[message]"
screen = 6
- Console.luminosity = 2
+ Console.set_light(2)
messages += "Message sent to [dpt]
[message]"
else
for (var/mob/O in hearers(4, src.loc))
diff --git a/code/game/machinery/robot_fabricator.dm b/code/game/machinery/robot_fabricator.dm
index 0c3ae56115..6b0cb71fbd 100644
--- a/code/game/machinery/robot_fabricator.dm
+++ b/code/game/machinery/robot_fabricator.dm
@@ -22,7 +22,7 @@
if(!M.get_amount())
return
while(metal_amount < 150000 && M.amount)
- src.metal_amount += O.matter["metal"] /*O:height * O:width * O:length * 100000.0*/
+ src.metal_amount += O.matter[DEFAULT_WALL_MATERIAL] /*O:height * O:width * O:length * 100000.0*/
M.use(1)
count++
diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm
index 4418586e9d..e9a2081fb2 100644
--- a/code/game/machinery/seed_extractor.dm
+++ b/code/game/machinery/seed_extractor.dm
@@ -31,7 +31,7 @@ obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob
else
user << "[O] doesn't seem to have any usable seeds inside it."
- del(O)
+ qdel(O)
//Grass.
else if(istype(O, /obj/item/stack/tile/grass))
diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm
index 8d7ed7fccc..cf67c4d01f 100644
--- a/code/game/machinery/status_display.dm
+++ b/code/game/machinery/status_display.dm
@@ -45,6 +45,11 @@
var/const/STATUS_DISPLAY_TIME = 4
var/const/STATUS_DISPLAY_CUSTOM = 99
+/obj/machinery/status_display/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src,frequency)
+ ..()
+
// register for radio system
/obj/machinery/status_display/initialize()
..()
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 940ec0f104..d45cade6c5 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -76,12 +76,12 @@
if(1.0)
if(prob(50))
src.dump_everything() //So suits dont survive all the time
- del(src)
+ qdel(src)
return
if(2.0)
if(prob(50))
src.dump_everything()
- del(src)
+ qdel(src)
return
else
return
@@ -465,7 +465,7 @@
src.update_icon()
// for(var/obj/O in src)
-// del(O)
+// qdel(O)
src.add_fingerprint(usr)
src.updateUsrDialog()
@@ -511,7 +511,7 @@
//for(var/obj/O in src)
// O.loc = src.loc
src.add_fingerprint(user)
- del(G)
+ qdel(G)
src.updateUsrDialog()
src.update_icon()
return
@@ -612,10 +612,10 @@
wires = new(src)
target_department = departments[1]
target_species = species[1]
- if(!target_department || !target_species) del(src)
+ if(!target_department || !target_species) qdel(src)
-/obj/machinery/suit_cycler/Del()
- del(wires) // qdel
+/obj/machinery/suit_cycler/Destroy()
+ qdel(wires)
wires = null
..()
@@ -696,7 +696,7 @@
src.occupant = M
src.add_fingerprint(user)
- del(G)
+ qdel(G)
src.updateUsrDialog()
@@ -987,7 +987,6 @@
helmet.name = "engineering voidsuit helmet"
helmet.icon_state = "rig0-engineering"
helmet.item_state = "eng_helm"
- helmet.item_color = "engineering"
if(suit)
suit.name = "engineering voidsuit"
suit.icon_state = "rig-engineering"
@@ -997,7 +996,6 @@
helmet.name = "mining voidsuit helmet"
helmet.icon_state = "rig0-mining"
helmet.item_state = "mining_helm"
- helmet.item_color = "mining"
if(suit)
suit.name = "mining voidsuit"
suit.icon_state = "rig-mining"
@@ -1007,7 +1005,6 @@
helmet.name = "medical voidsuit helmet"
helmet.icon_state = "rig0-medical"
helmet.item_state = "medical_helm"
- helmet.item_color = "medical"
if(suit)
suit.name = "medical voidsuit"
suit.icon_state = "rig-medical"
@@ -1017,7 +1014,6 @@
helmet.name = "security voidsuit helmet"
helmet.icon_state = "rig0-sec"
helmet.item_state = "sec_helm"
- helmet.item_color = "sec"
if(suit)
suit.name = "security voidsuit"
suit.icon_state = "rig-sec"
@@ -1027,7 +1023,6 @@
helmet.name = "atmospherics voidsuit helmet"
helmet.icon_state = "rig0-atmos"
helmet.item_state = "atmos_helm"
- helmet.item_color = "atmos"
if(suit)
suit.name = "atmospherics voidsuit"
suit.icon_state = "rig-atmos"
@@ -1037,7 +1032,6 @@
helmet.name = "blood-red voidsuit helmet"
helmet.icon_state = "rig0-syndie"
helmet.item_state = "syndie_helm"
- helmet.item_color = "syndie"
if(suit)
suit.name = "blood-red voidsuit"
suit.item_state = "syndie_voidsuit"
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 957f7bf536..fb4a03d21f 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -95,7 +95,7 @@
if(surplus() < 1500)
if(user) user << "The connected wire doesn't have enough current."
return
- for(var/obj/machinery/singularity/singulo in world)
+ for(var/obj/singularity/singulo in world)
if(singulo.z == z)
singulo.target = src
icon_state = "[icontype]1"
@@ -106,7 +106,7 @@
/obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null)
- for(var/obj/machinery/singularity/singulo in world)
+ for(var/obj/singularity/singulo in world)
if(singulo.target == src)
singulo.target = null
icon_state = "[icontype]0"
@@ -149,7 +149,7 @@
return
-/obj/machinery/power/singularity_beacon/Del()
+/obj/machinery/power/singularity_beacon/Destroy()
if(active)
Deactivate()
..()
diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm
index 5a3caafa26..c6fee28b40 100644
--- a/code/game/machinery/telecomms/broadcaster.dm
+++ b/code/game/machinery/telecomms/broadcaster.dm
@@ -98,7 +98,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
/* --- Do a snazzy animation! --- */
flick("broadcaster_send", src)
-/obj/machinery/telecomms/broadcaster/Del()
+/obj/machinery/telecomms/broadcaster/Destroy()
// In case message_delay is left on 1, otherwise it won't reset the list and people can't say the same thing twice anymore.
if(message_delay)
message_delay = 0
diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm
index 6dd5586fd8..50fa8b185b 100644
--- a/code/game/machinery/telecomms/logbrowser.dm
+++ b/code/game/machinery/telecomms/logbrowser.dm
@@ -63,64 +63,37 @@
// If the log is a speech file
if(C.input_type == "Speech File")
- dat += "[C.name] \[X\]
"
+ dat += "[C.name] \[X\]
"
// -- Determine race of orator --
- var/race // The actual race of the mob
- var/language = "Human" // MMIs, pAIs, Cyborgs and humans all speak Human
- var/mobtype = C.parameters["mobtype"]
- var/mob/M = new mobtype
-
- if(ishuman(M) || isbrain(M))
- var/mob/living/carbon/human/H = M
- race = "[H.species.name]"
-
-
- else if(issmall(M))
- race = "Monkey"
- language = race
-
- else if(issilicon(M) || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job
- race = "Artificial Life"
-
- else if(isslime(M)) // NT knows a lot about slimes, but not aliens. Can identify slimes
- race = "slime"
- language = race
-
- else if(isanimal(M))
- race = "Domestic Animal"
- language = race
-
- else
- race = "Unidentifiable"
- language = race
-
- del(M)
+ var/race = C.parameters["race"] // The actual race of the mob
+ var/language = C.parameters["language"] // The language spoken, or null/""
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
- if(language == "Human" || universal_translate || C.parameters["uspeech"])
- dat += "Data type: [C.input_type]
"
- dat += "Source: [C.parameters["name"]] (Job: [C.parameters["job"]])
"
- dat += "Class: [race]
"
- dat += "Contents: \"[C.parameters["message"]]\"
"
-
+ if(universal_translate || C.parameters["uspeech"] || C.parameters["intelligible"])
+ dat += "Data type: [C.input_type]
"
+ dat += "Source: [C.parameters["name"]] (Job: [C.parameters["job"]])
"
+ dat += "Class: [race]
"
+ dat += "Contents: \"[C.parameters["message"]]\"
"
+ if(language)
+ dat += "Language: [language]
"
// -- Orator is not human and universal translate not active --
else
- dat += "Data type: Audio File
"
- dat += "Source: Unidentifiable
"
- dat += "Class: [race]
"
- dat += "Contents: Unintelligble
"
+ dat += "Data type: Audio File
"
+ dat += "Source: Unidentifiable
"
+ dat += "Class: [race]
"
+ dat += "Contents: Unintelligble
"
dat += "
"
else if(C.input_type == "Execution Error")
- dat += "[C.name] \[X\]
"
- dat += "Output: \"[C.parameters["message"]]\"
"
+ dat += "[C.name] \[X\]
"
+ dat += "Output: \"[C.parameters["message"]]\"
"
dat += "
"
@@ -189,7 +162,7 @@
temp = "- DELETED ENTRY: [D.name] -"
SelectedServer.log_entries.Remove(D)
- del(D)
+ qdel(D)
else
temp = "- FAILED: NO SELECTED MACHINE -"
@@ -227,7 +200,7 @@
A.state = 3
A.icon_state = "3"
A.anchored = 1
- del(src)
+ qdel(src)
else
user << "\blue You disconnect the monitor."
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
@@ -238,7 +211,7 @@
A.state = 4
A.icon_state = "4"
A.anchored = 1
- del(src)
+ qdel(src)
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
emagged = 1
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 581ae59ab4..15c627420f 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -1,404 +1,404 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
-
-
-/*
-
- All telecommunications interactions:
-
-*/
-
-#define STATION_Z 1
-#define TELECOMM_Z 3
-
-/obj/machinery/telecomms
- var/temp = "" // output message
- var/construct_op = 0
-
-
-/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob)
-
- // Using a multitool lets you access the receiver's interface
- if(istype(P, /obj/item/device/multitool))
- attack_hand(user)
-
-
- // REPAIRING: Use Nanopaste to repair 10-20 integrity points.
- if(istype(P, /obj/item/stack/nanopaste))
- var/obj/item/stack/nanopaste/T = P
- if (integrity < 100) //Damaged, let's repair!
- if (T.use(1))
- integrity = between(0, integrity + rand(10,20), 100)
- usr << "You apply the Nanopaste to [src], repairing some of the damage."
- else
- usr << "This machine is already in perfect condition."
- return
-
-
- switch(construct_op)
- if(0)
- if(istype(P, /obj/item/weapon/screwdriver))
- user << "You unfasten the bolts."
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- construct_op ++
- if(1)
- if(istype(P, /obj/item/weapon/screwdriver))
- user << "You fasten the bolts."
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- construct_op --
- if(istype(P, /obj/item/weapon/wrench))
- user << "You dislodge the external plating."
- playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
- construct_op ++
- if(2)
- if(istype(P, /obj/item/weapon/wrench))
- user << "You secure the external plating."
- playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
- construct_op --
- if(istype(P, /obj/item/weapon/wirecutters))
- playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
- user << "You remove the cables."
- construct_op ++
- var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( user.loc )
- A.amount = 5
- stat |= BROKEN // the machine's been borked!
- if(3)
- if(istype(P, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/A = P
- if (A.use(5))
- user << "You insert the cables."
- construct_op--
- stat &= ~BROKEN // the machine's not borked anymore!
- else
- user << "You need five coils of wire for this."
- if(istype(P, /obj/item/weapon/crowbar))
- user << "You begin prying out the circuit board other components..."
- playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
- if(do_after(user,60))
- user << "You finish prying out the components."
-
- // Drop all the component stuff
- if(contents.len > 0)
- for(var/obj/x in src)
- x.loc = user.loc
- else
-
- // If the machine wasn't made during runtime, probably doesn't have components:
- // manually find the components and drop them!
- var/newpath = text2path(circuitboard)
- var/obj/item/weapon/circuitboard/C = new newpath
- for(var/I in C.req_components)
- for(var/i = 1, i <= C.req_components[I], i++)
- newpath = text2path(I)
- var/obj/item/s = new newpath
- s.loc = user.loc
- if(istype(P, /obj/item/stack/cable_coil))
- var/obj/item/stack/cable_coil/A = P
- A.amount = 1
-
- // Drop a circuit board too
- C.loc = user.loc
-
- // Create a machine frame and delete the current machine
- var/obj/machinery/constructable_frame/machine_frame/F = new
- F.loc = src.loc
- del(src)
-
-
-/obj/machinery/telecomms/attack_ai(var/mob/user as mob)
- attack_hand(user)
-
-/obj/machinery/telecomms/attack_hand(var/mob/user as mob)
-
- // You need a multitool to use this, or be silicon
- if(!issilicon(user))
- // istype returns false if the value is null
- if(!istype(user.get_active_hand(), /obj/item/device/multitool))
- return
-
- if(stat & (BROKEN|NOPOWER))
- return
-
- var/obj/item/device/multitool/P = get_multitool(user)
-
- user.set_machine(src)
- var/dat
- dat = "[src.name][src.name] Access
"
- dat += "
[temp]
"
- dat += "
Power Status: [src.toggled ? "On" : "Off"]"
- if(on && toggled)
- if(id != "" && id)
- dat += "
Identification String: [id]"
- else
- dat += "
Identification String: NULL"
- dat += "
Network: [network]"
- dat += "
Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]"
- if(hide) dat += "
Shadow Link: ACTIVE"
-
- //Show additional options for certain machines.
- dat += Options_Menu()
-
- dat += "
Linked Network Entities: "
-
- var/i = 0
- for(var/obj/machinery/telecomms/T in links)
- i++
- if(T.hide && !src.hide)
- continue
- dat += "- \ref[T] [T.name] ([T.id]) \[X\]
"
- dat += "
"
-
- dat += "
Filtering Frequencies: "
-
- i = 0
- if(length(freq_listening))
- for(var/x in freq_listening)
- i++
- if(i < length(freq_listening))
- dat += "[format_frequency(x)] GHz\[X\]; "
- else
- dat += "[format_frequency(x)] GHz\[X\]"
- else
- dat += "NONE"
-
- dat += "
\[Add Filter\]"
- dat += "
"
-
- if(P)
- if(P.buffer)
- dat += "
MULTITOOL BUFFER: [P.buffer] ([P.buffer.id]) \[Link\] \[Flush\]"
- else
- dat += "
MULTITOOL BUFFER: \[Add Machine\]"
-
- dat += ""
- temp = ""
- user << browse(dat, "window=tcommachine;size=520x500;can_resize=0")
- onclose(user, "dormitory")
-
-
-// Off-Site Relays
-//
-// You are able to send/receive signals from the station's z level (changeable in the STATION_Z #define) if
-// the relay is on the telecomm satellite (changable in the TELECOMM_Z #define)
-
-
-/obj/machinery/telecomms/relay/proc/toggle_level()
-
- var/turf/position = get_turf(src)
-
- // Toggle on/off getting signals from the station or the current Z level
- if(src.listening_level == STATION_Z) // equals the station
- src.listening_level = position.z
- return 1
- else if(position.z == TELECOMM_Z)
- src.listening_level = STATION_Z
- return 1
- return 0
-
-// Returns a multitool from a user depending on their mobtype.
-
-/obj/machinery/telecomms/proc/get_multitool(mob/user as mob)
-
- var/obj/item/device/multitool/P = null
- // Let's double check
- if(!issilicon(user) && istype(user.get_active_hand(), /obj/item/device/multitool))
- P = user.get_active_hand()
- else if(isAI(user))
- var/mob/living/silicon/ai/U = user
- P = U.aiMulti
- else if(isrobot(user) && in_range(user, src))
- if(istype(user.get_active_hand(), /obj/item/device/multitool))
- P = user.get_active_hand()
- return P
-
-// Additional Options for certain machines. Use this when you want to add an option to a specific machine.
-// Example of how to use below.
-
-/obj/machinery/telecomms/proc/Options_Menu()
- return ""
-
-/*
-// Add an option to the processor to switch processing mode. (COMPRESS -> UNCOMPRESS or UNCOMPRESS -> COMPRESS)
-/obj/machinery/telecomms/processor/Options_Menu()
- var/dat = "
Processing Mode: [process_mode ? "UNCOMPRESS" : "COMPRESS"]"
- return dat
-*/
-// The topic for Additional Options. Use this for checking href links for your specific option.
-// Example of how to use below.
-/obj/machinery/telecomms/proc/Options_Topic(href, href_list)
- return
-
-/*
-/obj/machinery/telecomms/processor/Options_Topic(href, href_list)
-
- if(href_list["process"])
- temp = "-% Processing mode changed. %-"
- src.process_mode = !src.process_mode
-*/
-
-// RELAY
-
-/obj/machinery/telecomms/relay/Options_Menu()
- var/dat = ""
- if(src.z == TELECOMM_Z)
- dat += "
Signal Locked to Station: [listening_level == STATION_Z ? "TRUE" : "FALSE"]"
- dat += "
Broadcasting: [broadcasting ? "YES" : "NO"]"
- dat += "
Receiving: [receiving ? "YES" : "NO"]"
- return dat
-
-/obj/machinery/telecomms/relay/Options_Topic(href, href_list)
-
- if(href_list["receive"])
- receiving = !receiving
- temp = "-% Receiving mode changed. %-"
- if(href_list["broadcast"])
- broadcasting = !broadcasting
- temp = "-% Broadcasting mode changed. %-"
- if(href_list["change_listening"])
- //Lock to the station OR lock to the current position!
- //You need at least two receivers and two broadcasters for this to work, this includes the machine.
- var/result = toggle_level()
- if(result)
- temp = "-% [src]'s signal has been successfully changed."
- else
- temp = "-% [src] could not lock it's signal onto the station. Two broadcasters or receivers required."
-
-// BUS
-
-/obj/machinery/telecomms/bus/Options_Menu()
- var/dat = "
Change Signal Frequency: [change_frequency ? "YES ([change_frequency])" : "NO"]"
- return dat
-
-/obj/machinery/telecomms/bus/Options_Topic(href, href_list)
-
- if(href_list["change_freq"])
-
- var/newfreq = input(usr, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", src, network) as null|num
- if(canAccess(usr))
- if(newfreq)
- if(findtext(num2text(newfreq), "."))
- newfreq *= 10 // shift the decimal one place
- if(newfreq < 10000)
- change_frequency = newfreq
- temp = "-% New frequency to change to assigned: \"[newfreq] GHz\" %-"
- else
- change_frequency = 0
- temp = "-% Frequency changing deactivated %-"
-
-
-/obj/machinery/telecomms/Topic(href, href_list)
-
- if(!issilicon(usr))
- if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
- return
-
- if(stat & (BROKEN|NOPOWER))
- return
-
- var/obj/item/device/multitool/P = get_multitool(usr)
-
- if(href_list["input"])
- switch(href_list["input"])
-
- if("toggle")
-
- src.toggled = !src.toggled
- temp = "-% [src] has been [src.toggled ? "activated" : "deactivated"]."
- update_power()
-
- /*
- if("hide")
- src.hide = !hide
- temp = "-% Shadow Link has been [src.hide ? "activated" : "deactivated"]."
- */
-
- if("id")
- var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN)
- if(newid && canAccess(usr))
- id = newid
- temp = "-% New ID assigned: \"[id]\" %-"
-
- if("network")
- var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text
- if(newnet && canAccess(usr))
-
- if(length(newnet) > 15)
- temp = "-% Too many characters in new network tag %-"
-
- else
- for(var/obj/machinery/telecomms/T in links)
- T.links.Remove(src)
-
- network = newnet
- links = list()
- temp = "-% New network tag assigned: \"[network]\" %-"
-
-
- if("freq")
- var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num
- if(newfreq && canAccess(usr))
- if(findtext(num2text(newfreq), "."))
- newfreq *= 10 // shift the decimal one place
- if(!(newfreq in freq_listening) && newfreq < 10000)
- freq_listening.Add(newfreq)
- temp = "-% New frequency filter assigned: \"[newfreq] GHz\" %-"
-
- if(href_list["delete"])
-
- // changed the layout about to workaround a pesky runtime -- Doohl
-
- var/x = text2num(href_list["delete"])
- temp = "-% Removed frequency filter [x] %-"
- freq_listening.Remove(x)
-
- if(href_list["unlink"])
-
- if(text2num(href_list["unlink"]) <= length(links))
- var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])]
- temp = "-% Removed \ref[T] [T.name] from linked entities. %-"
-
- // Remove link entries from both T and src.
-
- if(src in T.links)
- T.links.Remove(src)
- links.Remove(T)
-
- if(href_list["link"])
-
- if(P)
- if(P.buffer && P.buffer != src)
- if(!(src in P.buffer.links))
- P.buffer.links.Add(src)
-
- if(!(P.buffer in src.links))
- src.links.Add(P.buffer)
-
- temp = "-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-"
-
- else
- temp = "-% Unable to acquire buffer %-"
-
- if(href_list["buffer"])
-
- P.buffer = src
- temp = "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-"
-
-
- if(href_list["flush"])
-
- temp = "-% Buffer successfully flushed. %-"
- P.buffer = null
-
- src.Options_Topic(href, href_list)
-
- usr.set_machine(src)
- src.add_fingerprint(usr)
-
- updateUsrDialog()
-
-/obj/machinery/telecomms/proc/canAccess(var/mob/user)
- if(issilicon(user) || in_range(user, src))
- return 1
- return 0
-
-#undef TELECOMM_Z
-#undef STATION_Z
+//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
+
+
+/*
+
+ All telecommunications interactions:
+
+*/
+
+#define STATION_Z 1
+#define TELECOMM_Z 3
+
+/obj/machinery/telecomms
+ var/temp = "" // output message
+ var/construct_op = 0
+
+
+/obj/machinery/telecomms/attackby(obj/item/P as obj, mob/user as mob)
+
+ // Using a multitool lets you access the receiver's interface
+ if(istype(P, /obj/item/device/multitool))
+ attack_hand(user)
+
+
+ // REPAIRING: Use Nanopaste to repair 10-20 integrity points.
+ if(istype(P, /obj/item/stack/nanopaste))
+ var/obj/item/stack/nanopaste/T = P
+ if (integrity < 100) //Damaged, let's repair!
+ if (T.use(1))
+ integrity = between(0, integrity + rand(10,20), 100)
+ usr << "You apply the Nanopaste to [src], repairing some of the damage."
+ else
+ usr << "This machine is already in perfect condition."
+ return
+
+
+ switch(construct_op)
+ if(0)
+ if(istype(P, /obj/item/weapon/screwdriver))
+ user << "You unfasten the bolts."
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ construct_op ++
+ if(1)
+ if(istype(P, /obj/item/weapon/screwdriver))
+ user << "You fasten the bolts."
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ construct_op --
+ if(istype(P, /obj/item/weapon/wrench))
+ user << "You dislodge the external plating."
+ playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
+ construct_op ++
+ if(2)
+ if(istype(P, /obj/item/weapon/wrench))
+ user << "You secure the external plating."
+ playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
+ construct_op --
+ if(istype(P, /obj/item/weapon/wirecutters))
+ playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
+ user << "You remove the cables."
+ construct_op ++
+ var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( user.loc )
+ A.amount = 5
+ stat |= BROKEN // the machine's been borked!
+ if(3)
+ if(istype(P, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/A = P
+ if (A.use(5))
+ user << "You insert the cables."
+ construct_op--
+ stat &= ~BROKEN // the machine's not borked anymore!
+ else
+ user << "You need five coils of wire for this."
+ if(istype(P, /obj/item/weapon/crowbar))
+ user << "You begin prying out the circuit board other components..."
+ playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1)
+ if(do_after(user,60))
+ user << "You finish prying out the components."
+
+ // Drop all the component stuff
+ if(contents.len > 0)
+ for(var/obj/x in src)
+ x.loc = user.loc
+ else
+
+ // If the machine wasn't made during runtime, probably doesn't have components:
+ // manually find the components and drop them!
+ var/newpath = text2path(circuitboard)
+ var/obj/item/weapon/circuitboard/C = new newpath
+ for(var/I in C.req_components)
+ for(var/i = 1, i <= C.req_components[I], i++)
+ newpath = text2path(I)
+ var/obj/item/s = new newpath
+ s.loc = user.loc
+ if(istype(P, /obj/item/stack/cable_coil))
+ var/obj/item/stack/cable_coil/A = P
+ A.amount = 1
+
+ // Drop a circuit board too
+ C.loc = user.loc
+
+ // Create a machine frame and delete the current machine
+ var/obj/machinery/constructable_frame/machine_frame/F = new
+ F.loc = src.loc
+ qdel(src)
+
+
+/obj/machinery/telecomms/attack_ai(var/mob/user as mob)
+ attack_hand(user)
+
+/obj/machinery/telecomms/attack_hand(var/mob/user as mob)
+
+ // You need a multitool to use this, or be silicon
+ if(!issilicon(user))
+ // istype returns false if the value is null
+ if(!istype(user.get_active_hand(), /obj/item/device/multitool))
+ return
+
+ if(stat & (BROKEN|NOPOWER))
+ return
+
+ var/obj/item/device/multitool/P = get_multitool(user)
+
+ user.set_machine(src)
+ var/dat
+ dat = "[src.name][src.name] Access
"
+ dat += "
[temp]
"
+ dat += "
Power Status: [src.toggled ? "On" : "Off"]"
+ if(on && toggled)
+ if(id != "" && id)
+ dat += "
Identification String: [id]"
+ else
+ dat += "
Identification String: NULL"
+ dat += "
Network: [network]"
+ dat += "
Prefabrication: [autolinkers.len ? "TRUE" : "FALSE"]"
+ if(hide) dat += "
Shadow Link: ACTIVE"
+
+ //Show additional options for certain machines.
+ dat += Options_Menu()
+
+ dat += "
Linked Network Entities: "
+
+ var/i = 0
+ for(var/obj/machinery/telecomms/T in links)
+ i++
+ if(T.hide && !src.hide)
+ continue
+ dat += "- \ref[T] [T.name] ([T.id]) \[X\]
"
+ dat += "
"
+
+ dat += "
Filtering Frequencies: "
+
+ i = 0
+ if(length(freq_listening))
+ for(var/x in freq_listening)
+ i++
+ if(i < length(freq_listening))
+ dat += "[format_frequency(x)] GHz\[X\]; "
+ else
+ dat += "[format_frequency(x)] GHz\[X\]"
+ else
+ dat += "NONE"
+
+ dat += "
\[Add Filter\]"
+ dat += "
"
+
+ if(P)
+ if(P.buffer)
+ dat += "
MULTITOOL BUFFER: [P.buffer] ([P.buffer.id]) \[Link\] \[Flush\]"
+ else
+ dat += "
MULTITOOL BUFFER: \[Add Machine\]"
+
+ dat += ""
+ temp = ""
+ user << browse(dat, "window=tcommachine;size=520x500;can_resize=0")
+ onclose(user, "dormitory")
+
+
+// Off-Site Relays
+//
+// You are able to send/receive signals from the station's z level (changeable in the STATION_Z #define) if
+// the relay is on the telecomm satellite (changable in the TELECOMM_Z #define)
+
+
+/obj/machinery/telecomms/relay/proc/toggle_level()
+
+ var/turf/position = get_turf(src)
+
+ // Toggle on/off getting signals from the station or the current Z level
+ if(src.listening_level == STATION_Z) // equals the station
+ src.listening_level = position.z
+ return 1
+ else if(position.z == TELECOMM_Z)
+ src.listening_level = STATION_Z
+ return 1
+ return 0
+
+// Returns a multitool from a user depending on their mobtype.
+
+/obj/machinery/telecomms/proc/get_multitool(mob/user as mob)
+
+ var/obj/item/device/multitool/P = null
+ // Let's double check
+ if(!issilicon(user) && istype(user.get_active_hand(), /obj/item/device/multitool))
+ P = user.get_active_hand()
+ else if(isAI(user))
+ var/mob/living/silicon/ai/U = user
+ P = U.aiMulti
+ else if(isrobot(user) && in_range(user, src))
+ if(istype(user.get_active_hand(), /obj/item/device/multitool))
+ P = user.get_active_hand()
+ return P
+
+// Additional Options for certain machines. Use this when you want to add an option to a specific machine.
+// Example of how to use below.
+
+/obj/machinery/telecomms/proc/Options_Menu()
+ return ""
+
+/*
+// Add an option to the processor to switch processing mode. (COMPRESS -> UNCOMPRESS or UNCOMPRESS -> COMPRESS)
+/obj/machinery/telecomms/processor/Options_Menu()
+ var/dat = "
Processing Mode: [process_mode ? "UNCOMPRESS" : "COMPRESS"]"
+ return dat
+*/
+// The topic for Additional Options. Use this for checking href links for your specific option.
+// Example of how to use below.
+/obj/machinery/telecomms/proc/Options_Topic(href, href_list)
+ return
+
+/*
+/obj/machinery/telecomms/processor/Options_Topic(href, href_list)
+
+ if(href_list["process"])
+ temp = "-% Processing mode changed. %-"
+ src.process_mode = !src.process_mode
+*/
+
+// RELAY
+
+/obj/machinery/telecomms/relay/Options_Menu()
+ var/dat = ""
+ if(src.z == TELECOMM_Z)
+ dat += "
Signal Locked to Station: [listening_level == STATION_Z ? "TRUE" : "FALSE"]"
+ dat += "
Broadcasting: [broadcasting ? "YES" : "NO"]"
+ dat += "
Receiving: [receiving ? "YES" : "NO"]"
+ return dat
+
+/obj/machinery/telecomms/relay/Options_Topic(href, href_list)
+
+ if(href_list["receive"])
+ receiving = !receiving
+ temp = "-% Receiving mode changed. %-"
+ if(href_list["broadcast"])
+ broadcasting = !broadcasting
+ temp = "-% Broadcasting mode changed. %-"
+ if(href_list["change_listening"])
+ //Lock to the station OR lock to the current position!
+ //You need at least two receivers and two broadcasters for this to work, this includes the machine.
+ var/result = toggle_level()
+ if(result)
+ temp = "-% [src]'s signal has been successfully changed."
+ else
+ temp = "-% [src] could not lock it's signal onto the station. Two broadcasters or receivers required."
+
+// BUS
+
+/obj/machinery/telecomms/bus/Options_Menu()
+ var/dat = "
Change Signal Frequency: [change_frequency ? "YES ([change_frequency])" : "NO"]"
+ return dat
+
+/obj/machinery/telecomms/bus/Options_Topic(href, href_list)
+
+ if(href_list["change_freq"])
+
+ var/newfreq = input(usr, "Specify a new frequency for new signals to change to. Enter null to turn off frequency changing. Decimals assigned automatically.", src, network) as null|num
+ if(canAccess(usr))
+ if(newfreq)
+ if(findtext(num2text(newfreq), "."))
+ newfreq *= 10 // shift the decimal one place
+ if(newfreq < 10000)
+ change_frequency = newfreq
+ temp = "-% New frequency to change to assigned: \"[newfreq] GHz\" %-"
+ else
+ change_frequency = 0
+ temp = "-% Frequency changing deactivated %-"
+
+
+/obj/machinery/telecomms/Topic(href, href_list)
+
+ if(!issilicon(usr))
+ if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
+ return
+
+ if(stat & (BROKEN|NOPOWER))
+ return
+
+ var/obj/item/device/multitool/P = get_multitool(usr)
+
+ if(href_list["input"])
+ switch(href_list["input"])
+
+ if("toggle")
+
+ src.toggled = !src.toggled
+ temp = "-% [src] has been [src.toggled ? "activated" : "deactivated"]."
+ update_power()
+
+ /*
+ if("hide")
+ src.hide = !hide
+ temp = "-% Shadow Link has been [src.hide ? "activated" : "deactivated"]."
+ */
+
+ if("id")
+ var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID for this machine", src, id) as null|text),1,MAX_MESSAGE_LEN)
+ if(newid && canAccess(usr))
+ id = newid
+ temp = "-% New ID assigned: \"[id]\" %-"
+
+ if("network")
+ var/newnet = input(usr, "Specify the new network for this machine. This will break all current links.", src, network) as null|text
+ if(newnet && canAccess(usr))
+
+ if(length(newnet) > 15)
+ temp = "-% Too many characters in new network tag %-"
+
+ else
+ for(var/obj/machinery/telecomms/T in links)
+ T.links.Remove(src)
+
+ network = newnet
+ links = list()
+ temp = "-% New network tag assigned: \"[network]\" %-"
+
+
+ if("freq")
+ var/newfreq = input(usr, "Specify a new frequency to filter (GHz). Decimals assigned automatically.", src, network) as null|num
+ if(newfreq && canAccess(usr))
+ if(findtext(num2text(newfreq), "."))
+ newfreq *= 10 // shift the decimal one place
+ if(!(newfreq in freq_listening) && newfreq < 10000)
+ freq_listening.Add(newfreq)
+ temp = "-% New frequency filter assigned: \"[newfreq] GHz\" %-"
+
+ if(href_list["delete"])
+
+ // changed the layout about to workaround a pesky runtime -- Doohl
+
+ var/x = text2num(href_list["delete"])
+ temp = "-% Removed frequency filter [x] %-"
+ freq_listening.Remove(x)
+
+ if(href_list["unlink"])
+
+ if(text2num(href_list["unlink"]) <= length(links))
+ var/obj/machinery/telecomms/T = links[text2num(href_list["unlink"])]
+ temp = "-% Removed \ref[T] [T.name] from linked entities. %-"
+
+ // Remove link entries from both T and src.
+
+ if(src in T.links)
+ T.links.Remove(src)
+ links.Remove(T)
+
+ if(href_list["link"])
+
+ if(P)
+ if(P.buffer && P.buffer != src)
+ if(!(src in P.buffer.links))
+ P.buffer.links.Add(src)
+
+ if(!(P.buffer in src.links))
+ src.links.Add(P.buffer)
+
+ temp = "-% Successfully linked with \ref[P.buffer] [P.buffer.name] %-"
+
+ else
+ temp = "-% Unable to acquire buffer %-"
+
+ if(href_list["buffer"])
+
+ P.buffer = src
+ temp = "-% Successfully stored \ref[P.buffer] [P.buffer.name] in buffer %-"
+
+
+ if(href_list["flush"])
+
+ temp = "-% Buffer successfully flushed. %-"
+ P.buffer = null
+
+ src.Options_Topic(href, href_list)
+
+ usr.set_machine(src)
+ src.add_fingerprint(usr)
+
+ updateUsrDialog()
+
+/obj/machinery/telecomms/proc/canAccess(var/mob/user)
+ if(issilicon(user) || in_range(user, src))
+ return 1
+ return 0
+
+#undef TELECOMM_Z
+#undef STATION_Z
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index fe638408fc..99c1847961 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -130,9 +130,11 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
for(var/obj/machinery/telecomms/T in telecomms_list)
add_link(T)
-
-/obj/machinery/telecomms/Del()
+/obj/machinery/telecomms/Destroy()
telecomms_list -= src
+ for(var/obj/machinery/telecomms/comm in telecomms_list)
+ comm.links -= src
+ links = list()
..()
// Used in auto linking
@@ -535,6 +537,28 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
log.parameters["message"] = signal.data["message"]
log.parameters["name"] = signal.data["name"]
log.parameters["realname"] = signal.data["realname"]
+ log.parameters["language"] = signal.data["language"]
+
+ var/race = "unknown"
+ if(ishuman(M))
+ var/mob/living/carbon/human/H = M
+ race = "[H.species.name]"
+ log.parameters["intelligible"] = 1
+ else if(isbrain(M))
+ var/mob/living/carbon/brain/B = M
+ race = "[B.species.name]"
+ log.parameters["intelligible"] = 1
+ else if(M.isMonkey())
+ race = "Monkey"
+ else if(M.isSilicon())
+ race = "Artificial Life"
+ log.parameters["intelligible"] = 1
+ else if(isslime(M))
+ race = "Slime"
+ else if(isanimal(M))
+ race = "Domestic Animal"
+
+ log.parameters["race"] = race
if(!istype(M, /mob/new_player) && M)
log.parameters["uspeech"] = M.universal_speak
diff --git a/code/game/machinery/telecomms/telemonitor.dm b/code/game/machinery/telecomms/telemonitor.dm
index ea313e0052..a0f7b351ef 100644
--- a/code/game/machinery/telecomms/telemonitor.dm
+++ b/code/game/machinery/telecomms/telemonitor.dm
@@ -1,158 +1,158 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
-
-
-/*
- Telecomms monitor tracks the overall trafficing of a telecommunications network
- and displays a heirarchy of linked machines.
-*/
-
-
-/obj/machinery/computer/telecomms/monitor
- name = "Telecommunications Monitor"
- icon_state = "comm_monitor"
-
- var/screen = 0 // the screen number:
- var/list/machinelist = list() // the machines located by the computer
- var/obj/machinery/telecomms/SelectedMachine
-
- var/network = "NULL" // the network to probe
-
- var/temp = "" // temporary feedback messages
-
- attack_hand(mob/user as mob)
- if(stat & (BROKEN|NOPOWER))
- return
- user.set_machine(src)
- var/dat = "Telecommunications MonitorTelecommunications Monitor"
-
- switch(screen)
-
-
- // --- Main Menu ---
-
- if(0)
- dat += "
[temp]
"
- dat += "
Current Network: [network]
"
- if(machinelist.len)
- dat += "
Detected Network Entities:"
- for(var/obj/machinery/telecomms/T in machinelist)
- dat += "- \ref[T] [T.name] ([T.id])
"
- dat += "
"
- dat += "
\[Flush Buffer\]"
- else
- dat += "\[Probe Network\]"
-
-
- // --- Viewing Machine ---
-
- if(1)
- dat += "
[temp]
"
- dat += "\[Main Menu\]"
- dat += "
Current Network: [network]
"
- dat += "Selected Network Entity: [SelectedMachine.name] ([SelectedMachine.id])
"
- dat += "Linked Entities: "
- for(var/obj/machinery/telecomms/T in SelectedMachine.links)
- if(!T.hide)
- dat += "- \ref[T.id] [T.name] ([T.id])
"
- dat += "
"
-
-
-
- user << browse(dat, "window=comm_monitor;size=575x400")
- onclose(user, "server_control")
-
- temp = ""
- return
-
-
- Topic(href, href_list)
- if(..())
- return
-
-
- add_fingerprint(usr)
- usr.set_machine(src)
-
- if(href_list["viewmachine"])
- screen = 1
- for(var/obj/machinery/telecomms/T in machinelist)
- if(T.id == href_list["viewmachine"])
- SelectedMachine = T
- break
-
- if(href_list["operation"])
- switch(href_list["operation"])
-
- if("release")
- machinelist = list()
- screen = 0
-
- if("mainmenu")
- screen = 0
-
- if("probe")
- if(machinelist.len > 0)
- temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -"
-
- else
- for(var/obj/machinery/telecomms/T in range(25, src))
- if(T.network == network)
- machinelist.Add(T)
-
- if(!machinelist.len)
- temp = "- FAILED: UNABLE TO LOCATE NETWORK ENTITIES IN \[[network]\] -"
- else
- temp = "- [machinelist.len] ENTITIES LOCATED & BUFFERED -"
-
- screen = 0
-
-
- if(href_list["network"])
-
- var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
- if(newnet && ((usr in range(1, src) || issilicon(usr))))
- if(length(newnet) > 15)
- temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -"
-
- else
- network = newnet
- screen = 0
- machinelist = list()
- temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -"
-
- updateUsrDialog()
- return
-
- attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
- if(istype(D, /obj/item/weapon/screwdriver))
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- if(do_after(user, 20))
- if (src.stat & BROKEN)
- user << "\blue The broken glass falls out."
- var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
- new /obj/item/weapon/shard( src.loc )
- var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
- for (var/obj/C in src)
- C.loc = src.loc
- A.circuit = M
- A.state = 3
- A.icon_state = "3"
- A.anchored = 1
- del(src)
- else
- user << "\blue You disconnect the monitor."
- var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
- var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
- for (var/obj/C in src)
- C.loc = src.loc
- A.circuit = M
- A.state = 4
- A.icon_state = "4"
- A.anchored = 1
- del(src)
- else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
- playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
- emagged = 1
- user << "\blue You you disable the security protocols"
- src.updateUsrDialog()
- return
+//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
+
+
+/*
+ Telecomms monitor tracks the overall trafficing of a telecommunications network
+ and displays a heirarchy of linked machines.
+*/
+
+
+/obj/machinery/computer/telecomms/monitor
+ name = "Telecommunications Monitor"
+ icon_state = "comm_monitor"
+
+ var/screen = 0 // the screen number:
+ var/list/machinelist = list() // the machines located by the computer
+ var/obj/machinery/telecomms/SelectedMachine
+
+ var/network = "NULL" // the network to probe
+
+ var/temp = "" // temporary feedback messages
+
+ attack_hand(mob/user as mob)
+ if(stat & (BROKEN|NOPOWER))
+ return
+ user.set_machine(src)
+ var/dat = "Telecommunications MonitorTelecommunications Monitor"
+
+ switch(screen)
+
+
+ // --- Main Menu ---
+
+ if(0)
+ dat += "
[temp]
"
+ dat += "
Current Network: [network]
"
+ if(machinelist.len)
+ dat += "
Detected Network Entities:"
+ for(var/obj/machinery/telecomms/T in machinelist)
+ dat += "- \ref[T] [T.name] ([T.id])
"
+ dat += "
"
+ dat += "
\[Flush Buffer\]"
+ else
+ dat += "\[Probe Network\]"
+
+
+ // --- Viewing Machine ---
+
+ if(1)
+ dat += "
[temp]
"
+ dat += "\[Main Menu\]"
+ dat += "
Current Network: [network]
"
+ dat += "Selected Network Entity: [SelectedMachine.name] ([SelectedMachine.id])
"
+ dat += "Linked Entities: "
+ for(var/obj/machinery/telecomms/T in SelectedMachine.links)
+ if(!T.hide)
+ dat += "- \ref[T.id] [T.name] ([T.id])
"
+ dat += "
"
+
+
+
+ user << browse(dat, "window=comm_monitor;size=575x400")
+ onclose(user, "server_control")
+
+ temp = ""
+ return
+
+
+ Topic(href, href_list)
+ if(..())
+ return
+
+
+ add_fingerprint(usr)
+ usr.set_machine(src)
+
+ if(href_list["viewmachine"])
+ screen = 1
+ for(var/obj/machinery/telecomms/T in machinelist)
+ if(T.id == href_list["viewmachine"])
+ SelectedMachine = T
+ break
+
+ if(href_list["operation"])
+ switch(href_list["operation"])
+
+ if("release")
+ machinelist = list()
+ screen = 0
+
+ if("mainmenu")
+ screen = 0
+
+ if("probe")
+ if(machinelist.len > 0)
+ temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -"
+
+ else
+ for(var/obj/machinery/telecomms/T in range(25, src))
+ if(T.network == network)
+ machinelist.Add(T)
+
+ if(!machinelist.len)
+ temp = "- FAILED: UNABLE TO LOCATE NETWORK ENTITIES IN \[[network]\] -"
+ else
+ temp = "- [machinelist.len] ENTITIES LOCATED & BUFFERED -"
+
+ screen = 0
+
+
+ if(href_list["network"])
+
+ var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
+ if(newnet && ((usr in range(1, src) || issilicon(usr))))
+ if(length(newnet) > 15)
+ temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -"
+
+ else
+ network = newnet
+ screen = 0
+ machinelist = list()
+ temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -"
+
+ updateUsrDialog()
+ return
+
+ attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
+ if(istype(D, /obj/item/weapon/screwdriver))
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ if(do_after(user, 20))
+ if (src.stat & BROKEN)
+ user << "\blue The broken glass falls out."
+ var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
+ new /obj/item/weapon/shard( src.loc )
+ var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
+ for (var/obj/C in src)
+ C.loc = src.loc
+ A.circuit = M
+ A.state = 3
+ A.icon_state = "3"
+ A.anchored = 1
+ qdel(src)
+ else
+ user << "\blue You disconnect the monitor."
+ var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
+ var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
+ for (var/obj/C in src)
+ C.loc = src.loc
+ A.circuit = M
+ A.state = 4
+ 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 << "\blue You you disable the security protocols"
+ src.updateUsrDialog()
+ return
diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm
index 226c47229e..287577626c 100644
--- a/code/game/machinery/telecomms/traffic_control.dm
+++ b/code/game/machinery/telecomms/traffic_control.dm
@@ -1,241 +1,241 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
-
-
-
-
-
-/obj/machinery/computer/telecomms/traffic
- name = "Telecommunications Traffic Control"
- icon_state = "computer_generic"
-
- var/screen = 0 // the screen number:
- var/list/servers = list() // the servers located by the computer
- var/mob/editingcode
- var/mob/lasteditor
- var/list/viewingcode = list()
- var/obj/machinery/telecomms/server/SelectedServer
-
- var/network = "NULL" // the network to probe
- var/temp = "" // temporary feedback messages
-
- var/storedcode = "" // code stored
-
-
- proc/update_ide()
-
- // loop if there's someone manning the keyboard
- while(editingcode)
- if(!editingcode.client)
- editingcode = null
- break
-
- // For the typer, the input is enabled. Buffer the typed text
- if(editingcode)
- storedcode = "[winget(editingcode, "tcscode", "text")]"
- if(editingcode) // double if's to work around a runtime error
- winset(editingcode, "tcscode", "is-disabled=false")
-
- // If the player's not manning the keyboard anymore, adjust everything
- if( (!(editingcode in range(1, src)) && !issilicon(editingcode)) || (editingcode.machine != src && !issilicon(editingcode)))
- if(editingcode)
- winshow(editingcode, "Telecomms IDE", 0) // hide the window!
- editingcode = null
- break
-
- // For other people viewing the typer type code, the input is disabled and they can only view the code
- // (this is put in place so that there's not any magical shenanigans with 50 people inputting different code all at once)
-
- if(length(viewingcode))
- // This piece of code is very important - it escapes quotation marks so string aren't cut off by the input element
- var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
- showcode = replacetext(storedcode, "\"", "\\\"")
-
- for(var/mob/M in viewingcode)
-
- if( (M.machine == src && M in view(1, src) ) || issilicon(M))
- winset(M, "tcscode", "is-disabled=true")
- winset(M, "tcscode", "text=\"[showcode]\"")
- else
- viewingcode.Remove(M)
- winshow(M, "Telecomms IDE", 0) // hide the window!
-
- sleep(5)
-
- if(length(viewingcode) > 0)
- editingcode = pick(viewingcode)
- viewingcode.Remove(editingcode)
- update_ide()
-
-
-
- req_access = list(access_tcomsat)
-
- attack_hand(mob/user as mob)
- if(stat & (BROKEN|NOPOWER))
- return
- user.set_machine(src)
- var/dat = "Telecommunication Traffic ControlTelecommunications Traffic Control"
-
- switch(screen)
-
-
- // --- Main Menu ---
-
- if(0)
- dat += "
[temp]
"
- dat += "
Current Network: [network]
"
- if(servers.len)
- dat += "
Detected Telecommunication Servers:"
- for(var/obj/machinery/telecomms/T in servers)
- dat += "- \ref[T] [T.name] ([T.id])
"
- dat += "
"
- dat += "
\[Flush Buffer\]"
-
- else
- dat += "
No servers detected. Scan for servers: \[Scan\]"
-
-
- // --- Viewing Server ---
-
- if(1)
- dat += "
[temp]
"
- dat += "\[Main Menu\] \[Refresh\]"
- dat += "
Current Network: [network]"
- dat += "
Selected Server: [SelectedServer.id]
"
- dat += "
\[Edit Code\]"
- dat += "
Signal Execution: "
- if(SelectedServer.autoruncode)
- dat += "ALWAYS"
- else
- dat += "NEVER"
-
-
- user << browse(dat, "window=traffic_control;size=575x400")
- onclose(user, "server_control")
-
- temp = ""
- return
-
-
- Topic(href, href_list)
- if(..())
- return
-
-
- add_fingerprint(usr)
- usr.set_machine(src)
- if(!src.allowed(usr) && !emagged)
- usr << "\red ACCESS DENIED."
- return
-
- if(href_list["viewserver"])
- screen = 1
- for(var/obj/machinery/telecomms/T in servers)
- if(T.id == href_list["viewserver"])
- SelectedServer = T
- break
-
- if(href_list["operation"])
- switch(href_list["operation"])
-
- if("release")
- servers = list()
- screen = 0
-
- if("mainmenu")
- screen = 0
-
- if("scan")
- if(servers.len > 0)
- temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -"
-
- else
- for(var/obj/machinery/telecomms/server/T in range(25, src))
- if(T.network == network)
- servers.Add(T)
-
- if(!servers.len)
- temp = "- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -"
- else
- temp = "- [servers.len] SERVERS PROBED & BUFFERED -"
-
- screen = 0
-
- if("editcode")
- if(editingcode == usr) return
- if(usr in viewingcode) return
-
- if(!editingcode)
- lasteditor = usr
- editingcode = usr
- winshow(editingcode, "Telecomms IDE", 1) // show the IDE
- winset(editingcode, "tcscode", "is-disabled=false")
- winset(editingcode, "tcscode", "text=\"\"")
- var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
- showcode = replacetext(storedcode, "\"", "\\\"")
- winset(editingcode, "tcscode", "text=\"[showcode]\"")
- spawn()
- update_ide()
-
- else
- viewingcode.Add(usr)
- winshow(usr, "Telecomms IDE", 1) // show the IDE
- winset(usr, "tcscode", "is-disabled=true")
- winset(editingcode, "tcscode", "text=\"\"")
- var/showcode = replacetext(storedcode, "\"", "\\\"")
- winset(usr, "tcscode", "text=\"[showcode]\"")
-
- if("togglerun")
- SelectedServer.autoruncode = !(SelectedServer.autoruncode)
-
- if(href_list["network"])
-
- var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
-
- if(newnet && ((usr in range(1, src) || issilicon(usr))))
- if(length(newnet) > 15)
- temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -"
-
- else
-
- network = newnet
- screen = 0
- servers = list()
- temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -"
-
- updateUsrDialog()
- return
-
- attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
- if(istype(D, /obj/item/weapon/screwdriver))
- playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
- if(do_after(user, 20))
- if (src.stat & BROKEN)
- user << "\blue The broken glass falls out."
- var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
- new /obj/item/weapon/shard( src.loc )
- var/obj/item/weapon/circuitboard/comm_traffic/M = new /obj/item/weapon/circuitboard/comm_traffic( A )
- for (var/obj/C in src)
- C.loc = src.loc
- A.circuit = M
- A.state = 3
- A.icon_state = "3"
- A.anchored = 1
- del(src)
- else
- user << "\blue You disconnect the monitor."
- var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
- var/obj/item/weapon/circuitboard/comm_traffic/M = new /obj/item/weapon/circuitboard/comm_traffic( A )
- for (var/obj/C in src)
- C.loc = src.loc
- A.circuit = M
- A.state = 4
- A.icon_state = "4"
- A.anchored = 1
- del(src)
- else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
- playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
- emagged = 1
- user << "\blue You you disable the security protocols"
- src.updateUsrDialog()
- return
+//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
+
+
+
+
+
+/obj/machinery/computer/telecomms/traffic
+ name = "Telecommunications Traffic Control"
+ icon_state = "computer_generic"
+
+ var/screen = 0 // the screen number:
+ var/list/servers = list() // the servers located by the computer
+ var/mob/editingcode
+ var/mob/lasteditor
+ var/list/viewingcode = list()
+ var/obj/machinery/telecomms/server/SelectedServer
+
+ var/network = "NULL" // the network to probe
+ var/temp = "" // temporary feedback messages
+
+ var/storedcode = "" // code stored
+
+
+ proc/update_ide()
+
+ // loop if there's someone manning the keyboard
+ while(editingcode)
+ if(!editingcode.client)
+ editingcode = null
+ break
+
+ // For the typer, the input is enabled. Buffer the typed text
+ if(editingcode)
+ storedcode = "[winget(editingcode, "tcscode", "text")]"
+ if(editingcode) // double if's to work around a runtime error
+ winset(editingcode, "tcscode", "is-disabled=false")
+
+ // If the player's not manning the keyboard anymore, adjust everything
+ if( (!(editingcode in range(1, src)) && !issilicon(editingcode)) || (editingcode.machine != src && !issilicon(editingcode)))
+ if(editingcode)
+ winshow(editingcode, "Telecomms IDE", 0) // hide the window!
+ editingcode = null
+ break
+
+ // For other people viewing the typer type code, the input is disabled and they can only view the code
+ // (this is put in place so that there's not any magical shenanigans with 50 people inputting different code all at once)
+
+ if(length(viewingcode))
+ // This piece of code is very important - it escapes quotation marks so string aren't cut off by the input element
+ var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
+ showcode = replacetext(storedcode, "\"", "\\\"")
+
+ for(var/mob/M in viewingcode)
+
+ if( (M.machine == src && M in view(1, src) ) || issilicon(M))
+ winset(M, "tcscode", "is-disabled=true")
+ winset(M, "tcscode", "text=\"[showcode]\"")
+ else
+ viewingcode.Remove(M)
+ winshow(M, "Telecomms IDE", 0) // hide the window!
+
+ sleep(5)
+
+ if(length(viewingcode) > 0)
+ editingcode = pick(viewingcode)
+ viewingcode.Remove(editingcode)
+ update_ide()
+
+
+
+ req_access = list(access_tcomsat)
+
+ attack_hand(mob/user as mob)
+ if(stat & (BROKEN|NOPOWER))
+ return
+ user.set_machine(src)
+ var/dat = "Telecommunication Traffic ControlTelecommunications Traffic Control"
+
+ switch(screen)
+
+
+ // --- Main Menu ---
+
+ if(0)
+ dat += "
[temp]
"
+ dat += "
Current Network: [network]
"
+ if(servers.len)
+ dat += "
Detected Telecommunication Servers:"
+ for(var/obj/machinery/telecomms/T in servers)
+ dat += "- \ref[T] [T.name] ([T.id])
"
+ dat += "
"
+ dat += "
\[Flush Buffer\]"
+
+ else
+ dat += "
No servers detected. Scan for servers: \[Scan\]"
+
+
+ // --- Viewing Server ---
+
+ if(1)
+ dat += "
[temp]
"
+ dat += "\[Main Menu\] \[Refresh\]"
+ dat += "
Current Network: [network]"
+ dat += "
Selected Server: [SelectedServer.id]
"
+ dat += "
\[Edit Code\]"
+ dat += "
Signal Execution: "
+ if(SelectedServer.autoruncode)
+ dat += "ALWAYS"
+ else
+ dat += "NEVER"
+
+
+ user << browse(dat, "window=traffic_control;size=575x400")
+ onclose(user, "server_control")
+
+ temp = ""
+ return
+
+
+ Topic(href, href_list)
+ if(..())
+ return
+
+
+ add_fingerprint(usr)
+ usr.set_machine(src)
+ if(!src.allowed(usr) && !emagged)
+ usr << "\red ACCESS DENIED."
+ return
+
+ if(href_list["viewserver"])
+ screen = 1
+ for(var/obj/machinery/telecomms/T in servers)
+ if(T.id == href_list["viewserver"])
+ SelectedServer = T
+ break
+
+ if(href_list["operation"])
+ switch(href_list["operation"])
+
+ if("release")
+ servers = list()
+ screen = 0
+
+ if("mainmenu")
+ screen = 0
+
+ if("scan")
+ if(servers.len > 0)
+ temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -"
+
+ else
+ for(var/obj/machinery/telecomms/server/T in range(25, src))
+ if(T.network == network)
+ servers.Add(T)
+
+ if(!servers.len)
+ temp = "- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -"
+ else
+ temp = "- [servers.len] SERVERS PROBED & BUFFERED -"
+
+ screen = 0
+
+ if("editcode")
+ if(editingcode == usr) return
+ if(usr in viewingcode) return
+
+ if(!editingcode)
+ lasteditor = usr
+ editingcode = usr
+ winshow(editingcode, "Telecomms IDE", 1) // show the IDE
+ winset(editingcode, "tcscode", "is-disabled=false")
+ winset(editingcode, "tcscode", "text=\"\"")
+ var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
+ showcode = replacetext(storedcode, "\"", "\\\"")
+ winset(editingcode, "tcscode", "text=\"[showcode]\"")
+ spawn()
+ update_ide()
+
+ else
+ viewingcode.Add(usr)
+ winshow(usr, "Telecomms IDE", 1) // show the IDE
+ winset(usr, "tcscode", "is-disabled=true")
+ winset(editingcode, "tcscode", "text=\"\"")
+ var/showcode = replacetext(storedcode, "\"", "\\\"")
+ winset(usr, "tcscode", "text=\"[showcode]\"")
+
+ if("togglerun")
+ SelectedServer.autoruncode = !(SelectedServer.autoruncode)
+
+ if(href_list["network"])
+
+ var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
+
+ if(newnet && ((usr in range(1, src) || issilicon(usr))))
+ if(length(newnet) > 15)
+ temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -"
+
+ else
+
+ network = newnet
+ screen = 0
+ servers = list()
+ temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -"
+
+ updateUsrDialog()
+ return
+
+ attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
+ if(istype(D, /obj/item/weapon/screwdriver))
+ playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
+ if(do_after(user, 20))
+ if (src.stat & BROKEN)
+ user << "\blue The broken glass falls out."
+ var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
+ new /obj/item/weapon/shard( src.loc )
+ var/obj/item/weapon/circuitboard/comm_traffic/M = new /obj/item/weapon/circuitboard/comm_traffic( A )
+ for (var/obj/C in src)
+ C.loc = src.loc
+ A.circuit = M
+ A.state = 3
+ A.icon_state = "3"
+ A.anchored = 1
+ qdel(src)
+ else
+ user << "\blue You disconnect the monitor."
+ var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
+ var/obj/item/weapon/circuitboard/comm_traffic/M = new /obj/item/weapon/circuitboard/comm_traffic( A )
+ for (var/obj/C in src)
+ C.loc = src.loc
+ A.circuit = M
+ A.state = 4
+ 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 << "\blue You you disable the security protocols"
+ src.updateUsrDialog()
+ return
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 9e68791df0..b1d45a4840 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -57,7 +57,7 @@
usr << "You insert the coordinates into the machine."
usr << "A message flashes across the screen reminding the traveller that the nuclear authentication disk is to remain on the station at all times."
user.drop_item()
- del(I)
+ qdel(I)
if(C.data == "Clown Land")
//whoops
@@ -216,7 +216,7 @@
/*
/proc/do_teleport(atom/movable/M as mob|obj, atom/destination, precision)
if(istype(M, /obj/effect))
- del(M)
+ qdel(M)
return
if (istype(M, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
for(var/mob/O in viewers(M, null))
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index 46ea8824e6..223b503f4f 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -37,7 +37,7 @@
lethal = 1
icon_state = "control_kill"
-/obj/machinery/turretid/Del()
+/obj/machinery/turretid/Destroy()
if(control_area)
var/area/A = control_area
if(A && istype(A))
@@ -46,12 +46,11 @@
/obj/machinery/turretid/initialize()
if(!control_area)
- var/area/CA = get_area(src)
- control_area = CA.master
+ control_area = get_area(src)
else if(istext(control_area))
for(var/area/A in world)
if(A.name && A.name==control_area)
- control_area = A.master
+ control_area = A
break
if(control_area)
@@ -178,9 +177,8 @@
TC.ailock = ailock
if(istype(control_area))
- for(var/area/sub_area in control_area.related)
- for (var/obj/machinery/porta_turret/aTurret in sub_area)
- aTurret.setState(TC)
+ for (var/obj/machinery/porta_turret/aTurret in control_area)
+ aTurret.setState(TC)
update_icon()
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 965210ae15..e3a104d21c 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -13,9 +13,6 @@
/area/turret_protected/Entered(O)
..()
- if( master && master != src )
- return master.Entered(O)
-
if( iscarbon(O) )
turretTargets |= O
else if( istype(O, /obj/mecha) )
@@ -27,9 +24,6 @@
return 1
/area/turret_protected/Exited(O)
- if( master && master != src )
- return master.Exited(O)
-
if( ismob(O) && !issilicon(O) )
turretTargets -= O
else if( istype(O, /obj/mecha) )
@@ -74,7 +68,7 @@
/obj/machinery/turret/proc/take_damage(damage)
src.health -= damage
if(src.health<=0)
- del src
+ qdel(src)
return
/obj/machinery/turret/attack_hand(var/mob/living/carbon/human/user)
@@ -105,7 +99,7 @@
/obj/machinery/turret/proc/update_health()
if(src.health<=0)
- del src
+ qdel(src)
return
/obj/machinery/turretcover
@@ -148,8 +142,6 @@
/obj/machinery/turret/proc/get_protected_area()
var/area/turret_protected/TP = get_area(src)
if(istype(TP))
- if(TP.master && TP.master != TP)
- TP = TP.master
return TP
return
@@ -305,7 +297,7 @@
src.health -= Proj.damage
..()
if(prob(45) && Proj.damage > 0) src.spark_system.start()
- del (Proj)
+ qdel (Proj)
if (src.health <= 0)
src.die()
return
@@ -337,11 +329,11 @@
src.stat |= BROKEN
src.icon_state = "destroyed_target_prism"
if (cover!=null)
- del(cover)
+ qdel(cover)
sleep(3)
flick("explosion", src)
spawn(13)
- del(src)
+ qdel(src)
/obj/machinery/turret/attack_generic(var/mob/user, var/damage, var/attack_message)
if(!damage)
@@ -376,7 +368,7 @@
proc/take_damage(damage)
src.health -= damage
if(src.health<=0)
- del src
+ qdel(src)
return
@@ -389,15 +381,15 @@
ex_act()
- del src
+ qdel(src)
return
emp_act()
- del src
+ qdel(src)
return
meteorhit()
- del src
+ qdel(src)
return
attack_hand(mob/user as mob)
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 794fb0a887..81529cf804 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -21,7 +21,7 @@
if(!name)
var/atom/tmp = new path
src.product_name = initial(tmp.name)
- del(tmp)
+ qdel(tmp)
else
src.product_name = name
@@ -143,22 +143,21 @@
src.product_records.Add(product)
-/obj/machinery/vending/Del()
- del(wires) // qdel
+/obj/machinery/vending/Destroy()
+ qdel(wires)
wires = null
- if(coin)
- del(coin) // qdel
- coin = null
+ qdel(coin)
+ coin = null
..()
/obj/machinery/vending/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(25))
@@ -173,7 +172,7 @@
if (prob(50))
spawn(0)
src.malfunction()
- del(src)
+ qdel(src)
return
return
@@ -251,7 +250,7 @@
for(var/datum/data/vending_product/R in product_records)
if(istype(W, R.product_path))
stock(R, user)
- del(W)
+ qdel(W)
else
..()
@@ -278,7 +277,7 @@
if(cashmoney_bundle.worth <= 0)
usr.drop_from_inventory(cashmoney_bundle)
- del(cashmoney_bundle)
+ qdel(cashmoney_bundle)
else
cashmoney_bundle.update_icon()
else
@@ -290,7 +289,7 @@
visible_message("\The [usr] inserts a bill into \the [src].")
var/left = cashmoney.worth - currently_vending.price
usr.drop_from_inventory(cashmoney)
- del(cashmoney)
+ qdel(cashmoney)
if(left)
spawn_money(left, src.loc, user)
@@ -533,10 +532,10 @@
user << "\blue You successfully pull the coin out before \the [src] could swallow it."
else
user << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
- del(coin)
+ qdel(coin)
categories &= ~CAT_COIN
else
- del(coin)
+ qdel(coin)
categories &= ~CAT_COIN
R.amount--
diff --git a/code/game/machinery/wall_frames.dm b/code/game/machinery/wall_frames.dm
new file mode 100644
index 0000000000..36e37cb9c6
--- /dev/null
+++ b/code/game/machinery/wall_frames.dm
@@ -0,0 +1,83 @@
+/obj/item/frame
+ name = "frame"
+ desc = "Used for building machines."
+ icon = 'icons/obj/monitors.dmi'
+ icon_state = "fire_bitem"
+ flags = CONDUCT
+ var/build_machine_type
+ var/refund_amt = 2
+ var/refund_type = /obj/item/stack/sheet/metal
+
+/obj/item/frame/attackby(obj/item/weapon/W as obj, mob/user as mob)
+ if (istype(W, /obj/item/weapon/wrench))
+ new refund_type( get_turf(src.loc), refund_amt)
+ qdel(src)
+ return
+ ..()
+
+/obj/item/frame/proc/try_build(turf/on_wall)
+ if(!build_machine_type)
+ return
+
+ if (get_dist(on_wall,usr)>1)
+ return
+
+ var/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 in this area."
+ return
+
+ if(gotwallitem(loc, ndir))
+ usr << ""
+ return
+
+ var/obj/machinery/M = new build_machine_type(loc, ndir, 1)
+ M.fingerprints = src.fingerprints
+ M.fingerprintshidden = src.fingerprintshidden
+ M.fingerprintslast = src.fingerprintslast
+ qdel(src)
+
+/obj/item/frame/fire_alarm
+ name = "fire alarm frame"
+ desc = "Used for building fire alarms."
+ build_machine_type = /obj/machinery/firealarm
+
+/obj/item/frame/air_alarm
+ name = "air alarm frame"
+ desc = "Used for building air alarms."
+ build_machine_type = /obj/machinery/alarm
+
+/obj/item/frame/light
+ name = "light fixture frame"
+ desc = "Used for building lights."
+ icon = 'icons/obj/lighting.dmi'
+ icon_state = "tube-construct-item"
+ build_machine_type = /obj/machinery/light_construct
+
+/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/sheet/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/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm
index ad433d12e2..8f2e6aaee2 100644
--- a/code/game/machinery/washing_machine.dm
+++ b/code/game/machinery/washing_machine.dm
@@ -50,129 +50,8 @@
for(var/obj/item/stack/sheet/hairlesshide/HH in contents)
var/obj/item/stack/sheet/wetleather/WL = new(src)
WL.amount = HH.amount
- del(HH)
-
-
- if(crayon)
- var/wash_color
- if(istype(crayon,/obj/item/toy/crayon))
- var/obj/item/toy/crayon/CR = crayon
- wash_color = CR.colourName
- else if(istype(crayon,/obj/item/weapon/stamp))
- var/obj/item/weapon/stamp/ST = crayon
- wash_color = ST.item_color
-
- if(wash_color)
- var/new_jumpsuit_icon_state = ""
- var/new_jumpsuit_item_state = ""
- var/new_jumpsuit_name = ""
- var/new_glove_icon_state = ""
- var/new_glove_item_state = ""
- var/new_glove_name = ""
- var/new_shoe_icon_state = ""
- var/new_shoe_name = ""
- var/new_sheet_icon_state = ""
- var/new_sheet_name = ""
- var/new_softcap_icon_state = ""
- var/new_softcap_name = ""
- var/new_desc = "The colors are a bit dodgy."
- for(var/T in typesof(/obj/item/clothing/under))
- var/obj/item/clothing/under/J = new T
- //world << "DEBUG: [color] == [J.color]"
- if(wash_color == J.item_color)
- new_jumpsuit_icon_state = J.icon_state
- new_jumpsuit_item_state = J.item_state
- new_jumpsuit_name = J.name
- del(J)
- //world << "DEBUG: YUP! [new_icon_state] and [new_item_state]"
- break
- del(J)
- for(var/T in typesof(/obj/item/clothing/gloves))
- var/obj/item/clothing/gloves/G = new T
- //world << "DEBUG: [color] == [J.color]"
- if(wash_color == G.item_color)
- new_glove_icon_state = G.icon_state
- new_glove_item_state = G.item_state
- new_glove_name = G.name
- del(G)
- //world << "DEBUG: YUP! [new_icon_state] and [new_item_state]"
- break
- del(G)
- for(var/T in typesof(/obj/item/clothing/shoes))
- var/obj/item/clothing/shoes/S = new T
- //world << "DEBUG: [color] == [J.color]"
- if(wash_color == S.item_color)
- new_shoe_icon_state = S.icon_state
- new_shoe_name = S.name
- del(S)
- //world << "DEBUG: YUP! [new_icon_state] and [new_item_state]"
- break
- del(S)
- for(var/T in typesof(/obj/item/weapon/bedsheet))
- var/obj/item/weapon/bedsheet/B = new T
- //world << "DEBUG: [color] == [J.color]"
- if(wash_color == B.item_color)
- new_sheet_icon_state = B.icon_state
- new_sheet_name = B.name
- del(B)
- //world << "DEBUG: YUP! [new_icon_state] and [new_item_state]"
- break
- del(B)
- for(var/T in typesof(/obj/item/clothing/head/soft))
- var/obj/item/clothing/head/soft/H = new T
- //world << "DEBUG: [color] == [J.color]"
- if(wash_color == H.item_color)
- new_softcap_icon_state = H.icon_state
- new_softcap_name = H.name
- del(H)
- //world << "DEBUG: YUP! [new_icon_state] and [new_item_state]"
- break
- del(H)
- if(new_jumpsuit_icon_state && new_jumpsuit_item_state && new_jumpsuit_name)
- for(var/obj/item/clothing/under/J in contents)
- //world << "DEBUG: YUP! FOUND IT!"
- J.item_state = new_jumpsuit_item_state
- J.icon_state = new_jumpsuit_icon_state
- J.item_color = wash_color
- J.name = new_jumpsuit_name
- J.desc = new_desc
- if(new_glove_icon_state && new_glove_item_state && new_glove_name)
- for(var/obj/item/clothing/gloves/G in contents)
- //world << "DEBUG: YUP! FOUND IT!"
- G.item_state = new_glove_item_state
- G.icon_state = new_glove_icon_state
- G.item_color = wash_color
- G.name = new_glove_name
- G.desc = new_desc
- if(new_shoe_icon_state && new_shoe_name)
- for(var/obj/item/clothing/shoes/S in contents)
- //world << "DEBUG: YUP! FOUND IT!"
- if (istype(S,/obj/item/clothing/shoes/orange))
- var/obj/item/clothing/shoes/orange/L = S
- if (L.chained)
- L.remove_cuffs()
- S.icon_state = new_shoe_icon_state
- S.item_color = wash_color
- S.name = new_shoe_name
- S.desc = new_desc
- if(new_sheet_icon_state && new_sheet_name)
- for(var/obj/item/weapon/bedsheet/B in contents)
- //world << "DEBUG: YUP! FOUND IT!"
- B.icon_state = new_sheet_icon_state
- B.item_color = wash_color
- B.name = new_sheet_name
- B.desc = new_desc
- if(new_softcap_icon_state && new_softcap_name)
- for(var/obj/item/clothing/head/soft/H in contents)
- //world << "DEBUG: YUP! FOUND IT!"
- H.icon_state = new_softcap_icon_state
- H.item_color = wash_color
- H.name = new_softcap_name
- H.desc = new_desc
- del(crayon)
- crayon = null
-
-
+ qdel(HH)
+
if( locate(/mob,contents) )
state = 7
gibs_ready = 1
@@ -197,7 +76,7 @@
/*if(istype(W,/obj/item/weapon/screwdriver))
panel = !panel
user << "\blue you [panel ? "open" : "close"] the [src]'s maintenance panel"*/
- if(istype(W,/obj/item/toy/crayon) ||istype(W,/obj/item/weapon/stamp))
+ if(istype(W,/obj/item/weapon/pen/crayon) || istype(W,/obj/item/weapon/stamp))
if( state in list( 1, 3, 6 ) )
if(!crayon)
user.drop_item()
@@ -212,7 +91,7 @@
var/obj/item/weapon/grab/G = W
if(ishuman(G.assailant) && iscorgi(G.affecting))
G.affecting.loc = src
- del(G)
+ qdel(G)
state = 3
else
..()
diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm
index d7e64c1ece..bf23e579f3 100644
--- a/code/game/mecha/combat/marauder.dm
+++ b/code/game/mecha/combat/marauder.dm
@@ -63,7 +63,7 @@
if(equipment.len)//Now to remove it and equip anew.
for(ME in equipment)
equipment -= ME
- del(ME)
+ qdel(ME)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot(src)
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src)
@@ -76,6 +76,10 @@
ME.attach(src)
return
+/obj/mecha/combat/marauder/Destroy()
+ qdel(smoke_system)
+ ..()
+
/obj/mecha/combat/marauder/relaymove(mob/user,direction)
if(user != src.occupant) //While not "realistic", this piece is player friendly.
user.loc = get_turf(src)
diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm
index 2a6e2b6214..36f3ea6f85 100644
--- a/code/game/mecha/equipment/mecha_equipment.dm
+++ b/code/game/mecha/equipment/mecha_equipment.dm
@@ -9,7 +9,7 @@
force = 5
origin_tech = "materials=2"
construction_time = 100
- construction_cost = list("metal"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000)
var/equip_cooldown = 0
var/equip_ready = 1
var/energy_drain = 0
@@ -59,7 +59,7 @@
else
chassis.occupant << sound('sound/mecha/critdestr.ogg',volume=50)
spawn
- del src
+ qdel(src)
return
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
@@ -100,11 +100,11 @@
if (ispath(required_type))
return istype(M, required_type)
-
+
for (var/path in required_type)
if (istype(M, path))
return 1
-
+
return 0
/obj/item/mecha_parts/mecha_equipment/proc/attach(obj/mecha/M as obj)
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index 08d6f2cca4..b3c5180c7a 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -6,7 +6,7 @@
origin_tech = "programming=2;biotech=3"
energy_drain = 20
range = MELEE
- construction_cost = list("metal"=5000,"glass"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=5000,"glass"=10000)
reliability = 1000
equip_cooldown = 20
var/mob/living/carbon/occupant = null
@@ -21,6 +21,10 @@
pr_mech_sleeper.set_delay(equip_cooldown)
return
+ Destroy()
+ qdel(pr_mech_sleeper)
+ ..()
+
allow_drop()
return 0
@@ -390,7 +394,7 @@
equip_cooldown = 10
origin_tech = "materials=3;biotech=4;magnets=4;programming=3"
construction_time = 200
- construction_cost = list("metal"=3000,"glass"=2000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=3000,"glass"=2000)
required_type = /obj/mecha/medical
New()
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index 4d799ef928..67d8e5667c 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -89,8 +89,13 @@
var/C = target.loc //why are these backwards? we may never know -Pete
if(do_after_cooldown(target))
if(T == chassis.loc && src == chassis.selected)
- if(istype(target, /turf/simulated/wall/r_wall))
- occupant_message("[target] is too durable to drill through.")
+ if(istype(target, /turf/simulated/wall))
+ var/turf/simulated/wall/W = target
+ if(W.reinf_material)
+ occupant_message("[target] is too durable to drill through.")
+ else
+ log_message("Drilled through [target]")
+ target.ex_act(2)
else if(istype(target, /turf/simulated/mineral))
for(var/turf/simulated/mineral/M in range(chassis,1))
if(get_dir(chassis,M)&chassis.dir)
@@ -123,7 +128,7 @@
desc = "This is an upgraded version of the drill that'll pierce the heavens! (Can be attached to: Combat and Engineering Exosuits)"
icon_state = "mecha_diamond_drill"
origin_tech = "materials=4;engineering=3"
- construction_cost = list("metal"=10000,"diamond"=6500)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000,"diamond"=6500)
equip_cooldown = 20
force = 15
@@ -140,8 +145,9 @@
var/C = target.loc //why are these backwards? we may never know -Pete
if(do_after_cooldown(target))
if(T == chassis.loc && src == chassis.selected)
- if(istype(target, /turf/simulated/wall/r_wall))
- if(do_after_cooldown(target))//To slow down how fast mechs can drill through the station
+ if(istype(target, /turf/simulated/wall))
+ var/turf/simulated/wall/W = target
+ if(!W.reinf_material || do_after_cooldown(target))//To slow down how fast mechs can drill through the station
log_message("Drilled through [target]")
target.ex_act(3)
else if(istype(target, /turf/simulated/mineral))
@@ -216,7 +222,7 @@
for(var/a=0, a<5, a++)
spawn(0)
- var/obj/effect/effect/water/W = new /obj/effect/effect/water( get_turf(chassis) )
+ var/obj/effect/effect/water/W = PoolOrNew(/obj/effect/effect/water, get_turf(chassis))
var/turf/my_target = pick(the_targets)
var/datum/reagents/R = new/datum/reagents(5)
if(!W) return
@@ -236,7 +242,7 @@
W.reagents.reaction(atm)
if(W.loc == my_target) break
sleep(2)
- W.delete()
+ qdel(W)
return 1
get_equip_info()
@@ -255,7 +261,7 @@
energy_drain = 250
range = MELEE|RANGED
construction_time = 1200
- construction_cost = list("metal"=30000,"phoron"=25000,"silver"=20000,"gold"=20000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=30000,"phoron"=25000,"silver"=20000,"gold"=20000)
var/mode = 0 //0 - deconstruct, 1 - wall or floor, 2 - airlock.
var/disabled = 0 //malf
@@ -295,7 +301,7 @@
if(do_after_cooldown(target))
if(disabled) return
chassis.spark_system.start()
- del(target)
+ qdel(target)
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
chassis.use_power(energy_drain)
if(1)
@@ -418,7 +424,7 @@
do_after_cooldown()
src = null
spawn(rand(150,300))
- del(P)
+ qdel(P)
return
/obj/item/mecha_parts/mecha_equipment/gravcatapult
@@ -505,7 +511,7 @@
equip_cooldown = 10
energy_drain = 50
range = 0
- construction_cost = list("metal"=20000,"silver"=5000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"silver"=5000)
var/deflect_coeff = 1.15
var/damage_coeff = 0.8
@@ -555,7 +561,7 @@
equip_cooldown = 10
energy_drain = 50
range = 0
- construction_cost = list("metal"=20000,"gold"=5000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"gold"=5000)
var/deflect_coeff = 1.15
var/damage_coeff = 0.8
@@ -626,7 +632,7 @@
equip_cooldown = 20
energy_drain = 100
range = 0
- construction_cost = list("metal"=10000,"gold"=1000,"silver"=2000,"glass"=5000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000,"gold"=1000,"silver"=2000,"glass"=5000)
var/health_boost = 2
var/datum/global_iterator/pr_repair_droid
var/icon/droid_overlay
@@ -638,6 +644,11 @@
pr_repair_droid.set_delay(equip_cooldown)
return
+ Destroy()
+ qdel(pr_repair_droid)
+ pr_repair_droid = null
+ ..()
+
attach(obj/mecha/M as obj)
..()
droid_overlay = new(src.icon, icon_state = "repair_droid")
@@ -716,7 +727,7 @@
equip_cooldown = 10
energy_drain = 0
range = 0
- construction_cost = list("metal"=10000,"gold"=2000,"silver"=3000,"glass"=2000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000,"gold"=2000,"silver"=3000,"glass"=2000)
var/datum/global_iterator/pr_energy_relay
var/coeff = 100
var/list/use_channels = list(EQUIP,ENVIRON,LIGHT)
@@ -727,6 +738,11 @@
pr_energy_relay.set_delay(equip_cooldown)
return
+ Destroy()
+ qdel(pr_energy_relay)
+ pr_energy_relay = null
+ ..()
+
detach()
pr_energy_relay.stop()
// chassis.proc_res["dynusepower"] = null
@@ -762,7 +778,7 @@
var/pow_chan
if(A)
for(var/c in use_channels)
- if(A.master && A.master.powered(c))
+ if(A.powered(c))
pow_chan = c
break
return pow_chan
@@ -809,13 +825,13 @@
if(A)
var/pow_chan
for(var/c in list(EQUIP,ENVIRON,LIGHT))
- if(A.master.powered(c))
+ if(A.powered(c))
pow_chan = c
break
if(pow_chan)
var/delta = min(12, ER.chassis.cell.maxcharge-cur_charge)
ER.chassis.give_power(delta)
- A.master.use_power(delta*ER.coeff, pow_chan)
+ A.use_power(delta*ER.coeff, pow_chan)
return
@@ -828,7 +844,7 @@
equip_cooldown = 10
energy_drain = 0
range = MELEE
- construction_cost = list("metal"=10000,"silver"=500,"glass"=1000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000,"silver"=500,"glass"=1000)
var/datum/global_iterator/pr_mech_generator
var/coeff = 100
var/obj/item/stack/sheet/fuel
@@ -843,6 +859,11 @@
init()
return
+ Destroy()
+ qdel(pr_mech_generator)
+ pr_mech_generator = null
+ ..()
+
proc/init()
fuel = new /obj/item/stack/sheet/mineral/phoron(src)
fuel.amount = 0
@@ -963,7 +984,7 @@
desc = "Generates power using uranium. Pollutes the environment."
icon_state = "tesla"
origin_tech = "powerstorage=3;engineering=3"
- construction_cost = list("metal"=10000,"silver"=500,"glass"=1000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000,"silver"=500,"glass"=1000)
max_fuel = 50000
fuel_per_cycle_idle = 10
fuel_per_cycle_active = 30
@@ -1074,7 +1095,7 @@
origin_tech = "engineering=1;biotech=1"
energy_drain = 10
range = MELEE
- construction_cost = list("metal"=5000,"glass"=5000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=5000,"glass"=5000)
reliability = 1000
equip_cooldown = 20
var/mob/living/carbon/occupant = null
diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm
index 3d36efea9c..61eaa214da 100644
--- a/code/game/mecha/equipment/weapons/weapons.dm
+++ b/code/game/mecha/equipment/weapons/weapons.dm
@@ -113,7 +113,7 @@
A.bullet_act(src, def_zone)
src.life -= 10
if(life <= 0)
- del(src)
+ qdel(src)
return
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser
@@ -249,7 +249,7 @@
throw_impact(atom/hit_atom)
if(primed)
explosion(hit_atom, 0, 1, 2, 4)
- del(src)
+ qdel(src)
else
..()
return
@@ -274,7 +274,7 @@
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve
name = "\improper SOP-6 grenade launcher"
projectile = /obj/item/weapon/grenade/flashbang/clusterbang
- construction_cost = list("metal"=20000,"gold"=6000,"uranium"=6000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"gold"=6000,"uranium"=6000)
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang/limited/get_equip_info()//Limited version of the clusterbang launcher that can't reload
return "* [chassis.selected==src?"":""][src.name][chassis.selected==src?"":""]\[[src.projectiles]\]"
diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm
index d3c249b747..615261bc5f 100644
--- a/code/game/mecha/mech_bay.dm
+++ b/code/game/mecha/mech_bay.dm
@@ -139,6 +139,7 @@
anchored = 1
icon = 'icons/obj/computer.dmi'
icon_state = "recharge_comp"
+ light_color = "#a97faa"
circuit = "/obj/item/weapon/circuitboard/mech_bay_power_console"
var/autostart = 1
var/voltage = 45
@@ -214,4 +215,4 @@
// open the new ui window
ui.open()
// auto update every Master Controller tick
- ui.set_auto_update(1)
\ No newline at end of file
+ ui.set_auto_update(1)
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index f000499ffd..9dadd13554 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -17,7 +17,7 @@
var/time_coeff = 1.5 //can be upgraded with research
var/resource_coeff = 1.5 //can be upgraded with research
var/list/resources = list(
- "metal"=0,
+ DEFAULT_WALL_MATERIAL=0,
"glass"=0,
"gold"=0,
"silver"=0,
@@ -193,9 +193,9 @@
if(time_coeff!=diff)
time_coeff = diff
-/obj/machinery/mecha_part_fabricator/Del()
+/obj/machinery/mecha_part_fabricator/Destroy()
for(var/atom/A in src)
- del A
+ qdel(A)
..()
return
@@ -268,7 +268,7 @@
if(!istype(apart)) return 0
for(var/obj/O in part_set)
if(O.type == apart.type)
- del apart
+ qdel(apart)
return 0
part_set[++part_set.len] = apart
return 1
@@ -511,7 +511,7 @@
src.updateUsrDialog()
sleep(30) //only sleep if called by user
var/found = 0
- for(var/obj/machinery/computer/rdconsole/RDC in get_area(src))
+ for(var/obj/machinery/computer/rdconsole/RDC in get_area_all_atoms(get_area(src)))
if(!RDC.sync)
continue
found++
@@ -719,7 +719,7 @@
/obj/machinery/mecha_part_fabricator/proc/remove_material(var/mat_string, var/amount)
var/type
switch(mat_string)
- if("metal")
+ if(DEFAULT_WALL_MATERIAL)
type = /obj/item/stack/sheet/metal
if("glass")
type = /obj/item/stack/sheet/glass
@@ -749,7 +749,7 @@
res.Move(src.loc)
result = res.amount
else
- del res
+ qdel(res)
return result
@@ -774,9 +774,9 @@
if(I.reliability != 100 && crit_fail)
I.crit_fail = 1
I.loc = src.loc
- if(src.resources["metal"] >= 3750)
+ if(src.resources[DEFAULT_WALL_MATERIAL] >= 3750)
var/obj/item/stack/sheet/metal/G = new /obj/item/stack/sheet/metal(src.loc)
- G.amount = round(src.resources["metal"] / G.perunit)
+ G.amount = round(src.resources[DEFAULT_WALL_MATERIAL] / G.perunit)
if(src.resources["glass"] >= 3750)
var/obj/item/stack/sheet/glass/G = new /obj/item/stack/sheet/glass(src.loc)
G.amount = round(src.resources["glass"] / G.perunit)
@@ -795,7 +795,7 @@
if(src.resources["diamond"] >= 2000)
var/obj/item/stack/sheet/mineral/diamond/G = new /obj/item/stack/sheet/mineral/diamond(src.loc)
G.amount = round(src.resources["diamond"] / G.perunit)
- del(src)
+ qdel(src)
return 1
else
user << "\red You can't load the [src.name] while it's opened."
@@ -816,7 +816,7 @@
if(/obj/item/stack/sheet/mineral/phoron)
material = "phoron"
if(/obj/item/stack/sheet/metal)
- material = "metal"
+ material = DEFAULT_WALL_MATERIAL
if(/obj/item/stack/sheet/glass)
material = "glass"
if(/obj/item/stack/sheet/mineral/uranium)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 45abb3d6ea..b0423340e7 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -82,6 +82,7 @@
/obj/mecha/New()
..()
events = new
+
icon_state += "-open"
add_radio()
add_cabin()
@@ -98,11 +99,60 @@
mechas_list += src //global mech list
return
-/obj/mecha/Del()
+/obj/mecha/Destroy()
src.go_out()
+ for(var/mob/M in src) //Let's just be ultra sure
+ M.Move(loc)
+
+ if(loc)
+ loc.Exited(src)
+ loc = null
+
+ if(prob(30))
+ explosion(get_turf(loc), 0, 0, 1, 3)
+
+ if(wreckage)
+ var/obj/effect/decal/mecha_wreckage/WR = new wreckage(loc)
+ for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
+ if(E.salvageable && prob(30))
+ WR.crowbar_salvage += E
+ E.forceMove(WR)
+ E.equip_ready = 1
+ E.reliability = round(rand(E.reliability/3,E.reliability))
+ else
+ E.forceMove(loc)
+ E.destroy()
+ if(cell)
+ WR.crowbar_salvage += cell
+ cell.forceMove(WR)
+ cell.charge = rand(0, cell.charge)
+ if(internal_tank)
+ WR.crowbar_salvage += internal_tank
+ internal_tank.forceMove(WR)
+ else
+ for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
+ E.detach(loc)
+ E.destroy()
+ if(cell)
+ qdel(cell)
+ if(internal_tank)
+ qdel(internal_tank)
+ equipment.Cut()
+ cell = null
+ internal_tank = null
+
+ qdel(pr_int_temp_processor)
+ qdel(pr_inertial_movement)
+ qdel(pr_give_air)
+ qdel(pr_internal_damage)
+ qdel(spark_system)
+ pr_int_temp_processor = null
+ pr_give_air = null
+ pr_internal_damage = null
+ spark_system = null
+
mechas_list -= src //global mech list
..()
- return
////////////////////////
////// Helpers /////////
@@ -447,12 +497,17 @@
/obj/mecha/proc/dynabsorbdamage(damage,damage_type)
return damage*(listgetindex(damage_absorption,damage_type) || 1)
+/obj/mecha/airlock_crush(var/crush_damage)
+ ..()
+ take_damage(crush_damage)
+ check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
+ return 1
/obj/mecha/proc/update_health()
if(src.health > 0)
src.spark_system.start()
else
- src.destroy()
+ qdel(src)
return
/obj/mecha/attack_hand(mob/user as mob)
@@ -555,52 +610,6 @@
Proj.on_hit(src)
return
-/obj/mecha/proc/destroy()
- spawn()
- go_out()
- var/turf/T = get_turf(src)
- tag = "\ref[src]" //better safe then sorry
- if(loc)
- loc.Exited(src)
- loc = null
- if(T)
- if(istype(src, /obj/mecha/working/ripley/))
- var/obj/mecha/working/ripley/R = src
- if(R.cargo)
- for(var/obj/O in R.cargo) //Dump contents of stored cargo
- O.loc = T
- R.cargo -= O
- T.Entered(O)
-
- if(prob(30))
- explosion(T, 0, 0, 1, 3)
- spawn(0)
- if(wreckage)
- var/obj/effect/decal/mecha_wreckage/WR = new wreckage(T)
- for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
- if(E.salvageable && prob(30))
- WR.crowbar_salvage += E
- E.forceMove(WR)
- E.equip_ready = 1
- E.reliability = round(rand(E.reliability/3,E.reliability))
- else
- E.forceMove(T)
- E.destroy()
- if(cell)
- WR.crowbar_salvage += cell
- cell.forceMove(WR)
- cell.charge = rand(0, cell.charge)
- if(internal_tank)
- WR.crowbar_salvage += internal_tank
- internal_tank.forceMove(WR)
- else
- for(var/obj/item/mecha_parts/mecha_equipment/E in equipment)
- E.forceMove(T)
- E.destroy()
- spawn(0)
- del(src)
- return
-
/obj/mecha/ex_act(severity)
src.log_message("Affected by explosion of severity: [severity].",1)
if(prob(src.deflect_chance))
@@ -608,16 +617,16 @@
src.log_append_to_last("Armor saved, changing severity to [severity].")
switch(severity)
if(1.0)
- src.destroy()
+ qdel(src)
if(2.0)
if (prob(30))
- src.destroy()
+ qdel(src)
else
src.take_damage(initial(src.health)/2)
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
if(3.0)
if (prob(5))
- src.destroy()
+ qdel(src)
else
src.take_damage(initial(src.health)/5)
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),1)
@@ -831,7 +840,7 @@
src.reset_icon()
user.drop_item()
- del(P)
+ qdel(P)
else
call((proc_res["dynattackby"]||src), "dynattackby")(W,user)
@@ -995,8 +1004,8 @@
set popup_menu = 0
if(usr!=occupant) return
lights = !lights
- if(lights) SetLuminosity(luminosity + lights_power)
- else SetLuminosity(luminosity - lights_power)
+ if(lights) set_light(light_range + lights_power)
+ else set_light(light_range - lights_power)
src.occupant_message("Toggled lights [lights?"on":"off"].")
log_message("Toggled lights [lights?"on":"off"].")
return
@@ -1732,7 +1741,7 @@
AI.bruteloss = O.getBruteLoss()
AI.toxloss = O.toxloss
AI.updatehealth()
- del(O)
+ qdel(O)
if (!AI.stat)
AI.icon_state = "ai"
else
@@ -1840,7 +1849,7 @@
if(t_air)
t_air.merge(removed)
else //just delete the cabin gas, we're in space or some shit
- del(removed)
+ qdel(removed)
else
return stop()
return
@@ -1883,7 +1892,7 @@
if(mecha.loc && hascall(mecha.loc,"assume_air"))
mecha.loc.assume_air(leaked_gas)
else
- del(leaked_gas)
+ qdel(leaked_gas)
if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
if(mecha.get_charge())
mecha.spark_system.start()
diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm
index 233415cba8..167b9f63d0 100644
--- a/code/game/mecha/mecha_construction_paths.dm
+++ b/code/game/mecha/mecha_construction_paths.dm
@@ -78,7 +78,7 @@
custom_action(step, atom/used_atom, mob/user)
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
holder.overlays += used_atom.icon_state+"+o"
- del used_atom
+ qdel(used_atom)
return 1
action(atom/used_atom,mob/user as mob)
@@ -92,7 +92,7 @@
const_holder.density = 1
const_holder.overlays.len = 0
spawn()
- del src
+ qdel(src)
return
@@ -194,7 +194,7 @@
if(10)
if(diff==FORWARD)
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "ripley5"
else
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
@@ -210,7 +210,7 @@
if(8)
if(diff==FORWARD)
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "ripley7"
else
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
@@ -289,7 +289,7 @@
custom_action(step, atom/used_atom, mob/user)
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
holder.overlays += used_atom.icon_state+"+o"
- del used_atom
+ qdel(used_atom)
return 1
action(atom/used_atom,mob/user as mob)
@@ -302,7 +302,7 @@
const_holder.icon_state = "gygax0"
const_holder.density = 1
spawn()
- del src
+ qdel(src)
return
@@ -428,7 +428,7 @@
if(16)
if(diff==FORWARD)
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "gygax5"
else
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
@@ -444,7 +444,7 @@
if(14)
if(diff==FORWARD)
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "gygax7"
else
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
@@ -460,7 +460,7 @@
if(12)
if(diff==FORWARD)
user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "gygax9"
else
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
@@ -476,7 +476,7 @@
if(10)
if(diff==FORWARD)
user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "gygax11"
else
user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
@@ -492,7 +492,7 @@
if(8)
if(diff==FORWARD)
user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "gygax13"
else
user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
@@ -531,7 +531,7 @@
if(3)
if(diff==FORWARD)
user.visible_message("[user] installs Gygax Armour Plates to [holder].", "You install Gygax Armour Plates to [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "gygax18"
else
user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
@@ -570,7 +570,7 @@
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
holder.overlays += used_atom.icon_state+"+o"
user.drop_item()
- del used_atom
+ qdel(used_atom)
return 1
action(atom/used_atom,mob/user as mob)
@@ -583,7 +583,7 @@
const_holder.icon_state = "fireripley0"
const_holder.density = 1
spawn()
- del src
+ qdel(src)
return
@@ -690,7 +690,7 @@
if(11)
if(diff==FORWARD)
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "fireripley5"
else
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
@@ -706,7 +706,7 @@
if(9)
if(diff==FORWARD)
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "fireripley7"
else
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
@@ -793,7 +793,7 @@
custom_action(step, atom/used_atom, mob/user)
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
holder.overlays += used_atom.icon_state+"+o"
- del used_atom
+ qdel(used_atom)
return 1
action(atom/used_atom,mob/user as mob)
@@ -806,7 +806,7 @@
const_holder.icon_state = "durand0"
const_holder.density = 1
spawn()
- del src
+ qdel(src)
return
/datum/construction/reversible/mecha/durand
@@ -932,7 +932,7 @@
if(16)
if(diff==FORWARD)
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "durand5"
else
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
@@ -948,7 +948,7 @@
if(14)
if(diff==FORWARD)
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "durand7"
else
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
@@ -964,7 +964,7 @@
if(12)
if(diff==FORWARD)
user.visible_message("[user] installs the weapon control module into [holder].", "You install the weapon control module into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "durand9"
else
user.visible_message("[user] unfastens the peripherals control module.", "You unfasten the peripherals control module.")
@@ -980,7 +980,7 @@
if(10)
if(diff==FORWARD)
user.visible_message("[user] installs advanced scanner module to [holder].", "You install advanced scanner module to [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "durand11"
else
user.visible_message("[user] unfastens the weapon control module.", "You unfasten the weapon control module.")
@@ -996,7 +996,7 @@
if(8)
if(diff==FORWARD)
user.visible_message("[user] installs advanced capacitor to [holder].", "You install advanced capacitor to [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "durand13"
else
user.visible_message("[user] unfastens the advanced scanner module.", "You unfasten the advanced scanner module.")
@@ -1035,7 +1035,7 @@
if(3)
if(diff==FORWARD)
user.visible_message("[user] installs Durand Armour Plates to [holder].", "You install Durand Armour Plates to [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "durand18"
else
user.visible_message("[user] cuts internal armor layer from [holder].", "You cut the internal armor layer from [holder].")
@@ -1075,7 +1075,7 @@
custom_action(step, atom/used_atom, mob/user)
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
holder.overlays += used_atom.icon_state+"+o"
- del used_atom
+ qdel(used_atom)
return 1
action(atom/used_atom,mob/user as mob)
@@ -1096,7 +1096,7 @@
custom_action(step, atom/used_atom, mob/user)
user.visible_message("[user] has connected [used_atom] to [holder].", "You connect [used_atom] to [holder]")
holder.overlays += used_atom.icon_state+"+o"
- del used_atom
+ qdel(used_atom)
return 1
action(atom/used_atom,mob/user as mob)
@@ -1109,7 +1109,7 @@
const_holder.icon_state = "odysseus0"
const_holder.density = 1
spawn()
- del src
+ qdel(src)
return
@@ -1211,7 +1211,7 @@
if(10)
if(diff==FORWARD)
user.visible_message("[user] installs the central control module into [holder].", "You install the central computer mainboard into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "odysseus5"
else
user.visible_message("[user] disconnects the wiring of [holder].", "You disconnect the wiring of [holder].")
@@ -1227,7 +1227,7 @@
if(8)
if(diff==FORWARD)
user.visible_message("[user] installs the peripherals control module into [holder].", "You install the peripherals control module into [holder].")
- del used_atom
+ qdel(used_atom)
holder.icon_state = "odysseus7"
else
user.visible_message("[user] unfastens the mainboard.", "You unfasten the mainboard.")
diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm
index 8fa25a3568..d334d6eb29 100644
--- a/code/game/mecha/mecha_control_console.dm
+++ b/code/game/mecha/mecha_control_console.dm
@@ -2,6 +2,7 @@
name = "Exosuit Control"
icon = 'icons/obj/computer.dmi'
icon_state = "mecha"
+ light_color = "#a97faa"
req_access = list(access_robotics)
circuit = "/obj/item/weapon/circuitboard/mecha_control"
var/list/located = list()
@@ -69,7 +70,7 @@
icon_state = "motion2"
origin_tech = "programming=2;magnets=2"
construction_time = 50
- construction_cost = list("metal"=500)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=500)
proc/get_mecha_info()
if(!in_mecha())
@@ -90,11 +91,11 @@
return answer
emp_act()
- del src
+ qdel(src)
return
ex_act()
- del src
+ qdel(src)
return
proc/in_mecha()
@@ -106,7 +107,7 @@
var/obj/mecha/M = in_mecha()
if(M)
M.emp_act(2)
- del(src)
+ qdel(src)
proc/get_mecha_log()
if(!src.in_mecha())
diff --git a/code/game/mecha/mecha_parts.dm b/code/game/mecha/mecha_parts.dm
index c3257bb61b..6dba12db0c 100644
--- a/code/game/mecha/mecha_parts.dm
+++ b/code/game/mecha/mecha_parts.dm
@@ -12,14 +12,14 @@
flags = CONDUCT
origin_tech = "programming=2;materials=2"
var/construction_time = 100
- var/list/construction_cost = list("metal"=20000,"glass"=5000)
+ var/list/construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"glass"=5000)
/obj/item/mecha_parts/chassis
name="Mecha Chassis"
icon_state = "backbone"
var/datum/construction/construct
- construction_cost = list("metal"=20000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000)
flags = CONDUCT
attackby(obj/item/W as obj, mob/user as mob)
@@ -45,7 +45,7 @@
icon_state = "ripley_harness"
origin_tech = "programming=2;materials=2;biotech=2;engineering=2"
construction_time = 200
- construction_cost = list("metal"=40000,"glass"=15000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=40000,"glass"=15000)
/obj/item/mecha_parts/part/ripley_left_arm
name="Ripley Left Arm"
@@ -53,7 +53,7 @@
icon_state = "ripley_l_arm"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 150
- construction_cost = list("metal"=25000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=25000)
/obj/item/mecha_parts/part/ripley_right_arm
name="Ripley Right Arm"
@@ -61,7 +61,7 @@
icon_state = "ripley_r_arm"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 150
- construction_cost = list("metal"=25000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=25000)
/obj/item/mecha_parts/part/ripley_left_leg
name="Ripley Left Leg"
@@ -69,7 +69,7 @@
icon_state = "ripley_l_leg"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 150
- construction_cost = list("metal"=30000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=30000)
/obj/item/mecha_parts/part/ripley_right_leg
name="Ripley Right Leg"
@@ -77,13 +77,13 @@
icon_state = "ripley_r_leg"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 150
- construction_cost = list("metal"=30000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=30000)
///////// Gygax
/obj/item/mecha_parts/chassis/gygax
name = "Gygax Chassis"
- construction_cost = list("metal"=25000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=25000)
New()
..()
@@ -95,7 +95,7 @@
icon_state = "gygax_harness"
origin_tech = "programming=2;materials=2;biotech=3;engineering=3"
construction_time = 300
- construction_cost = list("metal"=50000,"glass"=20000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=50000,"glass"=20000)
/obj/item/mecha_parts/part/gygax_head
name="Gygax Head"
@@ -103,7 +103,7 @@
icon_state = "gygax_head"
origin_tech = "programming=2;materials=2;magnets=3;engineering=3"
construction_time = 200
- construction_cost = list("metal"=20000,"glass"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"glass"=10000)
/obj/item/mecha_parts/part/gygax_left_arm
name="Gygax Left Arm"
@@ -111,7 +111,7 @@
icon_state = "gygax_l_arm"
origin_tech = "programming=2;materials=2;engineering=3"
construction_time = 200
- construction_cost = list("metal"=30000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=30000)
/obj/item/mecha_parts/part/gygax_right_arm
name="Gygax Right Arm"
@@ -119,35 +119,35 @@
icon_state = "gygax_r_arm"
origin_tech = "programming=2;materials=2;engineering=3"
construction_time = 200
- construction_cost = list("metal"=30000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=30000)
/obj/item/mecha_parts/part/gygax_left_leg
name="Gygax Left Leg"
icon_state = "gygax_l_leg"
origin_tech = "programming=2;materials=2;engineering=3"
construction_time = 200
- construction_cost = list("metal"=35000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=35000)
/obj/item/mecha_parts/part/gygax_right_leg
name="Gygax Right Leg"
icon_state = "gygax_r_leg"
origin_tech = "programming=2;materials=2;engineering=3"
construction_time = 200
- construction_cost = list("metal"=35000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=35000)
/obj/item/mecha_parts/part/gygax_armour
name="Gygax Armour Plates"
icon_state = "gygax_armour"
origin_tech = "materials=6;combat=4;engineering=5"
construction_time = 600
- construction_cost = list("metal"=50000,"diamond"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=50000,"diamond"=10000)
//////////// Durand
/obj/item/mecha_parts/chassis/durand
name = "Durand Chassis"
- construction_cost = list("metal"=25000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=25000)
New()
..()
@@ -158,49 +158,49 @@
icon_state = "durand_harness"
origin_tech = "programming=2;materials=3;biotech=3;engineering=3"
construction_time = 300
- construction_cost = list("metal"=55000,"glass"=20000,"silver"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=55000,"glass"=20000,"silver"=10000)
/obj/item/mecha_parts/part/durand_head
name="Durand Head"
icon_state = "durand_head"
origin_tech = "programming=2;materials=3;magnets=3;engineering=3"
construction_time = 200
- construction_cost = list("metal"=25000,"glass"=10000,"silver"=3000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=25000,"glass"=10000,"silver"=3000)
/obj/item/mecha_parts/part/durand_left_arm
name="Durand Left Arm"
icon_state = "durand_l_arm"
origin_tech = "programming=2;materials=3;engineering=3"
construction_time = 200
- construction_cost = list("metal"=35000,"silver"=3000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=35000,"silver"=3000)
/obj/item/mecha_parts/part/durand_right_arm
name="Durand Right Arm"
icon_state = "durand_r_arm"
origin_tech = "programming=2;materials=3;engineering=3"
construction_time = 200
- construction_cost = list("metal"=35000,"silver"=3000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=35000,"silver"=3000)
/obj/item/mecha_parts/part/durand_left_leg
name="Durand Left Leg"
icon_state = "durand_l_leg"
origin_tech = "programming=2;materials=3;engineering=3"
construction_time = 200
- construction_cost = list("metal"=40000,"silver"=3000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=40000,"silver"=3000)
/obj/item/mecha_parts/part/durand_right_leg
name="Durand Right Leg"
icon_state = "durand_r_leg"
origin_tech = "programming=2;materials=3;engineering=3"
construction_time = 200
- construction_cost = list("metal"=40000,"silver"=3000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=40000,"silver"=3000)
/obj/item/mecha_parts/part/durand_armour
name="Durand Armour Plates"
icon_state = "durand_armour"
origin_tech = "materials=5;combat=4;engineering=5"
construction_time = 600
- construction_cost = list("metal"=50000,"uranium"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=50000,"uranium"=10000)
@@ -248,42 +248,42 @@
name="Phazon Torso"
icon_state = "phazon_harness"
construction_time = 300
- construction_cost = list("metal"=35000,"glass"=10000,"phoron"=20000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=35000,"glass"=10000,"phoron"=20000)
origin_tech = "programming=5;materials=7;bluespace=6;powerstorage=6"
/obj/item/mecha_parts/part/phazon_head
name="Phazon Head"
icon_state = "phazon_head"
construction_time = 200
- construction_cost = list("metal"=15000,"glass"=5000,"phoron"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=15000,"glass"=5000,"phoron"=10000)
origin_tech = "programming=4;materials=5;magnets=6"
/obj/item/mecha_parts/part/phazon_left_arm
name="Phazon Left Arm"
icon_state = "phazon_l_arm"
construction_time = 200
- construction_cost = list("metal"=20000,"phoron"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"phoron"=10000)
origin_tech = "materials=5;bluespace=2;magnets=2"
/obj/item/mecha_parts/part/phazon_right_arm
name="Phazon Right Arm"
icon_state = "phazon_r_arm"
construction_time = 200
- construction_cost = list("metal"=20000,"phoron"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"phoron"=10000)
origin_tech = "materials=5;bluespace=2;magnets=2"
/obj/item/mecha_parts/part/phazon_left_leg
name="Phazon Left Leg"
icon_state = "phazon_l_leg"
construction_time = 200
- construction_cost = list("metal"=20000,"phoron"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"phoron"=10000)
origin_tech = "materials=5;bluespace=3;magnets=3"
/obj/item/mecha_parts/part/phazon_right_leg
name="Phazon Right Leg"
icon_state = "phazon_r_leg"
construction_time = 200
- construction_cost = list("metal"=20000,"phoron"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"phoron"=10000)
origin_tech = "materials=5;bluespace=3;magnets=3"
///////// Odysseus
@@ -300,7 +300,7 @@
name="Odysseus Head"
icon_state = "odysseus_head"
construction_time = 100
- construction_cost = list("metal"=2000,"glass"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=2000,"glass"=10000)
origin_tech = "programming=3;materials=2"
/obj/item/mecha_parts/part/odysseus_torso
@@ -309,7 +309,7 @@
icon_state = "odysseus_torso"
origin_tech = "programming=2;materials=2;biotech=2;engineering=2"
construction_time = 180
- construction_cost = list("metal"=25000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=25000)
/obj/item/mecha_parts/part/odysseus_left_arm
name="Odysseus Left Arm"
@@ -317,7 +317,7 @@
icon_state = "odysseus_l_arm"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 120
- construction_cost = list("metal"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000)
/obj/item/mecha_parts/part/odysseus_right_arm
name="Odysseus Right Arm"
@@ -325,7 +325,7 @@
icon_state = "odysseus_r_arm"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 120
- construction_cost = list("metal"=10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000)
/obj/item/mecha_parts/part/odysseus_left_leg
name="Odysseus Left Leg"
@@ -333,7 +333,7 @@
icon_state = "odysseus_l_leg"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 130
- construction_cost = list("metal"=15000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=15000)
/obj/item/mecha_parts/part/odysseus_right_leg
name="Odysseus Right Leg"
@@ -341,11 +341,11 @@
icon_state = "odysseus_r_leg"
origin_tech = "programming=2;materials=2;engineering=2"
construction_time = 130
- construction_cost = list("metal"=15000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=15000)
/*/obj/item/mecha_parts/part/odysseus_armour
name="Odysseus Carapace"
icon_state = "odysseus_armour"
origin_tech = "materials=3;engineering=3"
construction_time = 200
- construction_cost = list("metal"=15000)*/
+ construction_cost = list(DEFAULT_WALL_MATERIAL=15000)*/
diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm
index 96b410959b..8bbeb03fd7 100644
--- a/code/game/mecha/mecha_wreckage.dm
+++ b/code/game/mecha/mecha_wreckage.dm
@@ -23,7 +23,7 @@
/obj/effect/decal/mecha_wreckage/ex_act(severity)
if(severity < 2)
spawn
- del src
+ qdel(src)
return
/obj/effect/decal/mecha_wreckage/bullet_act(var/obj/item/projectile/Proj)
diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm
index 5beb3c7244..c51a34adef 100644
--- a/code/game/mecha/working/ripley.dm
+++ b/code/game/mecha/working/ripley.dm
@@ -9,6 +9,16 @@
wreckage = /obj/effect/decal/mecha_wreckage/ripley
cargo_capacity = 10
+/obj/mecha/working/ripley/Destroy()
+ for(var/atom/movable/A in src.cargo)
+ A.loc = loc
+ var/turf/T = loc
+ if(istype(T))
+ T.Entered(A)
+ step_rand(A)
+ cargo.Cut()
+ ..()
+
/obj/mecha/working/ripley/firefighter
desc = "Standart APLU chassis was refitted with additional thermal protection and cistern."
name = "APLU \"Firefighter\""
@@ -54,6 +64,6 @@
var/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp/HC = new /obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp
HC.attach(src)
for(var/obj/item/mecha_parts/mecha_tracking/B in src.contents)//Deletes the beacon so it can't be found easily
- del (B)
+ qdel (B)
diff --git a/code/game/mecha/working/working.dm b/code/game/mecha/working/working.dm
index 1fa6d4f5ac..d9e876688f 100644
--- a/code/game/mecha/working/working.dm
+++ b/code/game/mecha/working/working.dm
@@ -10,7 +10,7 @@
new /obj/item/mecha_parts/mecha_tracking(src)
return
-/obj/mecha/working/Del()
+/obj/mecha/working/Destroy()
for(var/mob/M in src)
if(M==src.occupant)
continue
diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm
index d64857d004..6b79db8f5b 100644
--- a/code/game/objects/buckling.dm
+++ b/code/game/objects/buckling.dm
@@ -15,10 +15,16 @@
if(can_buckle && istype(M))
user_buckle_mob(M, user)
+//Cleanup
/obj/Del()
unbuckle_mob()
return ..()
+/obj/Destroy()
+ unbuckle_mob()
+ return ..()
+
+
/obj/proc/buckle_mob(mob/living/M)
if(!can_buckle || !istype(M) || (M.loc != loc) || M.buckled || M.pinned.len || (buckle_require_restraints && !M.restrained()))
return 0
@@ -84,3 +90,4 @@
"You hear metal clanking.")
add_fingerprint(user)
return M
+
diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm
index 840d779510..6882f9affa 100644
--- a/code/game/objects/effects/aliens.dm
+++ b/code/game/objects/effects/aliens.dm
@@ -46,7 +46,7 @@
var/turf/T = get_turf(src)
T.thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
-/obj/effect/alien/resin/Del()
+/obj/effect/alien/resin/Destroy()
var/turf/T = get_turf(src)
T.thermal_conductivity = initial(T.thermal_conductivity)
..()
@@ -54,7 +54,7 @@
/obj/effect/alien/resin/proc/healthcheck()
if(health <=0)
density = 0
- del(src)
+ qdel(src)
return
/obj/effect/alien/resin/bullet_act(var/obj/item/projectile/Proj)
@@ -164,7 +164,7 @@
name = "purple sac"
desc = "Weird purple octopus-like thing."
layer = 3
- luminosity = NODERANGE
+ light_range = NODERANGE
var/node_range = NODERANGE
/obj/effect/alien/weeds/node/New()
@@ -174,7 +174,7 @@
/obj/effect/alien/weeds/New(pos, node)
..()
if(istype(loc, /turf/space))
- del(src)
+ qdel(src)
return
linked_node = node
if(icon_state == "weeds")icon_state = pick("weeds", "weeds1", "weeds2")
@@ -190,7 +190,7 @@
if (locate(/obj/movable, U))
U = locate(/obj/movable, U)
if(U.density == 1)
- del(src)
+ qdel(src)
return
Alien plants should do something if theres a lot of poison
@@ -200,7 +200,7 @@ Alien plants should do something if theres a lot of poison
return
*/
if (istype(U, /turf/space))
- del(src)
+ qdel(src)
return
if(!linked_node || (get_dist(linked_node, src) > linked_node.node_range) )
@@ -220,19 +220,19 @@ Alien plants should do something if theres a lot of poison
if(O.density)
continue direction_loop
- new /obj/effect/alien/weeds(T, linked_node)
+ PoolOrNew(/obj/effect/alien/weeds, T, linked_node)
/obj/effect/alien/weeds/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
if(3.0)
if (prob(5))
- del(src)
+ qdel(src)
return
/obj/effect/alien/weeds/attackby(var/obj/item/weapon/W, var/mob/user)
@@ -255,7 +255,7 @@ Alien plants should do something if theres a lot of poison
/obj/effect/alien/weeds/proc/healthcheck()
if(health <= 0)
- del(src)
+ qdel(src)
/obj/effect/alien/weeds/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
@@ -294,7 +294,7 @@ Alien plants should do something if theres a lot of poison
/obj/effect/alien/acid/proc/tick()
if(!target)
- del(src)
+ qdel(src)
ticks += 1
@@ -307,8 +307,8 @@ Alien plants should do something if theres a lot of poison
var/turf/simulated/wall/W = target
W.dismantle_wall(1)
else
- del(target)
- del(src)
+ qdel(target)
+ qdel(src)
return
switch(target_strength - ticks)
@@ -350,7 +350,7 @@ Alien plants should do something if theres a lot of poison
spawn(rand(MIN_GROWTH_TIME,MAX_GROWTH_TIME))
Grow()
else
- del(src)
+ qdel(src)
/obj/effect/alien/egg/attack_hand(user as mob)
@@ -361,7 +361,7 @@ Alien plants should do something if theres a lot of poison
switch(status)
if(BURST)
user << "\red You clear the hatched egg."
- del(src)
+ qdel(src)
return
if(GROWING)
user << "\red The child is not developed yet."
diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm
index c4f693da15..9379234ca6 100644
--- a/code/game/objects/effects/bump_teleporter.dm
+++ b/code/game/objects/effects/bump_teleporter.dm
@@ -15,9 +15,9 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list()
..()
BUMP_TELEPORTERS += src
-/obj/effect/bump_teleporter/Del()
+/obj/effect/bump_teleporter/Destroy()
BUMP_TELEPORTERS -= src
- ..()
+ return ..()
/obj/effect/bump_teleporter/Bumped(atom/user)
if(!ismob(user))
diff --git a/code/game/objects/effects/chemsmoke.dm b/code/game/objects/effects/chemsmoke.dm
index e64a84c47c..37ea4fd096 100644
--- a/code/game/objects/effects/chemsmoke.dm
+++ b/code/game/objects/effects/chemsmoke.dm
@@ -31,7 +31,7 @@
if(seed_name && plant_controller)
seed = plant_controller.seeds[seed_name]
if(!seed)
- del(src)
+ qdel(src)
..()
/datum/effect/effect/system/smoke_spread/chem/New()
@@ -155,7 +155,7 @@
//build smoke icon
- var/color = mix_color_from_reagents(chemholder.reagents.reagent_list)
+ var/color = chemholder.reagents.get_color()
var/icon/I
if(color)
I = icon('icons/effects/chemsmoke.dmi')
@@ -204,7 +204,7 @@
if(passed_smoke)
smoke = passed_smoke
else
- smoke = new(location)
+ smoke = PoolOrNew(/obj/effect/effect/smoke/chem, location)
if(chemholder.reagents.reagent_list.len)
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / dist, safety = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
@@ -218,10 +218,10 @@
sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner
smoke.opacity = 0 // lighting and view range updates
fadeOut(smoke)
- smoke.delete()
+ qdel(src)
/datum/effect/effect/system/smoke_spread/chem/spores/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1)
- var/obj/effect/effect/smoke/chem/spores = new(location)
+ var/obj/effect/effect/smoke/chem/spores = PoolOrNew(/obj/effect/effect/smoke/chem, location)
spores.name = "cloud of [seed.seed_name] [seed.seed_noun]"
..(T, I, dist, spores)
@@ -229,6 +229,10 @@
// Fades out the smoke smoothly using it's alpha variable.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/fadeOut(var/atom/A, var/frames = 16)
+ if(A.alpha == 0) //Handle already transparent case
+ return
+ if(frames == 0)
+ frames = 1 //We will just assume that by 0 frames, the coder meant "during one frame".
var/step = A.alpha / frames
for(var/i = 0, i < frames, i++)
A.alpha -= step
diff --git a/code/game/objects/effects/decals/Cleanable/fuel.dm b/code/game/objects/effects/decals/Cleanable/fuel.dm
index c9ea58b121..2bf3a2a574 100644
--- a/code/game/objects/effects/decals/Cleanable/fuel.dm
+++ b/code/game/objects/effects/decals/Cleanable/fuel.dm
@@ -25,7 +25,7 @@
if(!has_spread)
Spread()
else
- del(src)
+ qdel(src)
proc/Spread(exclude=list())
//Allows liquid fuels to sometimes flow into other tiles.
diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm
index c6b3137806..b81089d9fb 100644
--- a/code/game/objects/effects/decals/Cleanable/humans.dm
+++ b/code/game/objects/effects/decals/Cleanable/humans.dm
@@ -21,10 +21,10 @@ var/global/list/image/splatter_cache=list()
var/list/datum/disease2/disease/virus2 = list()
var/amount = 5
-/obj/effect/decal/cleanable/blood/Del()
+/obj/effect/decal/cleanable/blood/Destroy()
for(var/datum/disease/D in viruses)
D.cure(0)
- ..()
+ return ..()
/obj/effect/decal/cleanable/blood/New()
..()
@@ -37,7 +37,7 @@ var/global/list/image/splatter_cache=list()
if(B != src)
if (B.blood_DNA)
blood_DNA |= B.blood_DNA.Copy()
- del(B)
+ qdel(B)
spawn(DRYING_TIME * (amount+1))
dry()
@@ -198,7 +198,7 @@ var/global/list/image/splatter_cache=list()
for (var/i = 0, i < pick(1, 200; 2, 150; 3, 50; 4), i++)
sleep(3)
if (i > 0)
- var/obj/effect/decal/cleanable/blood/b = new /obj/effect/decal/cleanable/blood/splatter(src.loc)
+ var/obj/effect/decal/cleanable/blood/b = PoolOrNew(/obj/effect/decal/cleanable/blood/splatter, src.loc)
b.basecolor = src.basecolor
b.update_icon()
for(var/datum/disease/D in src.viruses)
diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm
index 4c85144d1e..c70a5ab9fc 100644
--- a/code/game/objects/effects/decals/Cleanable/misc.dm
+++ b/code/game/objects/effects/decals/Cleanable/misc.dm
@@ -21,14 +21,14 @@
var/turf/simulated/floor/F = get_turf(src)
if (istype(F))
F.dirt += 4
- del(src)
+ qdel(src)
/obj/effect/decal/cleanable/greenglow
New()
..()
spawn(1200)// 2 minutes
- del(src)
+ qdel(src)
/obj/effect/decal/cleanable/dirt
name = "dirt"
@@ -58,7 +58,7 @@
density = 0
anchored = 1
layer = 2
- luminosity = 1
+ light_range = 1
icon = 'icons/effects/effects.dmi'
icon_state = "greenglow"
@@ -102,7 +102,7 @@
random_icon_states = list("vomit_1", "vomit_2", "vomit_3", "vomit_4")
var/list/viruses = list()
- Del()
+ Destroy()
for(var/datum/disease/D in viruses)
D.cure(0)
..()
@@ -142,4 +142,4 @@
layer = 2
icon = 'icons/effects/blood.dmi'
icon_state = "mfloor1"
- random_icon_states = list("mfloor1", "mfloor2", "mfloor3", "mfloor4", "mfloor5", "mfloor6", "mfloor7")
\ No newline at end of file
+ random_icon_states = list("mfloor1", "mfloor2", "mfloor3", "mfloor4", "mfloor5", "mfloor6", "mfloor7")
diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm
index 63956f5e89..dc5e6c57e8 100644
--- a/code/game/objects/effects/decals/cleanable.dm
+++ b/code/game/objects/effects/decals/cleanable.dm
@@ -1,6 +1,5 @@
/obj/effect/decal/cleanable
var/list/random_icon_states = list()
- var/targeted_by = null // Used so cleanbots can't claim a mess.
/obj/effect/decal/cleanable/New()
if (random_icon_states && length(src.random_icon_states) > 0)
diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm
index 9d097f47a0..eac899d5b1 100644
--- a/code/game/objects/effects/decals/contraband.dm
+++ b/code/game/objects/effects/decals/contraband.dm
@@ -72,7 +72,7 @@
else
P.roll_and_drop(P.loc)
- del(oldsrc) //delete it now to cut down on sanity checks afterwards. Agouri's code supports rerolling it anyway
+ qdel(oldsrc) //delete it now to cut down on sanity checks afterwards. Agouri's code supports rerolling it anyway
//############################## THE ACTUAL DECALS ###########################
@@ -125,7 +125,7 @@
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
if(ruined)
user << "You remove the remnants of the poster."
- del(src)
+ qdel(src)
else
user << "You carefully remove the poster from the wall."
roll_and_drop(user.loc)
@@ -154,7 +154,7 @@
var/obj/item/weapon/contraband/poster/P = new(src, serial_number)
P.loc = newloc
src.loc = P
- del(src)
+ qdel(src)
/datum/poster
// Name suffix. Poster - [name]
diff --git a/code/game/objects/effects/decals/remains.dm b/code/game/objects/effects/decals/remains.dm
index dd786ddc0d..ff3c8d4a61 100644
--- a/code/game/objects/effects/decals/remains.dm
+++ b/code/game/objects/effects/decals/remains.dm
@@ -30,7 +30,7 @@
var/turf/simulated/floor/F = get_turf(src)
if (istype(F))
new /obj/effect/decal/cleanable/ash(F)
- del(src)
+ qdel(src)
/obj/effect/decal/remains/robot/attack_hand(mob/user as mob)
return
diff --git a/code/game/objects/effects/decals/warning_stripes.dm b/code/game/objects/effects/decals/warning_stripes.dm
index 89067ada2a..e22acfad74 100644
--- a/code/game/objects/effects/decals/warning_stripes.dm
+++ b/code/game/objects/effects/decals/warning_stripes.dm
@@ -1,9 +1,11 @@
-/obj/effect/decal/warning_stripes
- icon = 'icons/effects/warning_stripes.dmi'
- layer = 2
-
-/obj/effect/decal/warning_stripes/New()
- . = ..()
-
- loc.overlays += src
- del src
\ No newline at end of file
+/obj/effect/decal/warning_stripes
+ icon = 'icons/effects/warning_stripes.dmi'
+ layer = 2
+
+/obj/effect/decal/warning_stripes/New()
+ . = ..()
+ var/turf/T=get_turf(src)
+ var/image/I=image(icon, icon_state = icon_state, dir = dir)
+ I.color=color
+ T.overlays += I
+ qdel(src)
diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm
index ea9af2f70f..ecd4904df7 100644
--- a/code/game/objects/effects/effect_system.dm
+++ b/code/game/objects/effects/effect_system.dm
@@ -20,11 +20,10 @@ would spawn and follow the beaker, even if it is carried or thrown.
var/life = 15.0
mouse_opacity = 0
-/obj/effect/proc/delete()
- loc = null
+/obj/effect/Destroy()
if(reagents)
reagents.delete()
- return
+ return ..()
/obj/effect/effect/water/Move(turf/newloc)
//var/turf/T = src.loc
@@ -32,7 +31,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
// T.firelevel = 0 //TODO: FIX
if (--src.life < 1)
//SN src = null
- delete()
+ qdel(src)
if(newloc.density)
return 0
.=..()
@@ -100,7 +99,7 @@ steam.start() -- spawns the effect
spawn(0)
if(holder)
src.location = get_turf(holder)
- var/obj/effect/effect/steam/steam = new /obj/effect/effect/steam(src.location)
+ var/obj/effect/effect/steam/steam = PoolOrNew(/obj/effect/effect/steam, src.location)
var/direction
if(src.cardinals)
direction = pick(cardinal)
@@ -110,7 +109,7 @@ steam.start() -- spawns the effect
sleep(5)
step(steam,direction)
spawn(20)
- steam.delete()
+ qdel(steam)
/////////////////////////////////////////////
//SPARK SYSTEM (like steam system)
@@ -133,15 +132,14 @@ steam.start() -- spawns the effect
if (istype(T, /turf))
T.hotspot_expose(1000,100)
spawn (100)
- delete()
+ qdel(src)
return
-/obj/effect/effect/sparks/Del()
+/obj/effect/effect/sparks/Destroy()
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(1000,100)
- ..()
- return
+ return ..()
/obj/effect/effect/sparks/Move()
..()
@@ -171,7 +169,7 @@ steam.start() -- spawns the effect
spawn(0)
if(holder)
src.location = get_turf(holder)
- var/obj/effect/effect/sparks/sparks = new /obj/effect/effect/sparks(src.location)
+ var/obj/effect/effect/sparks/sparks = PoolOrNew(/obj/effect/effect/sparks, src.location)
src.total_sparks++
var/direction
if(src.cardinals)
@@ -183,7 +181,7 @@ steam.start() -- spawns the effect
step(sparks,direction)
spawn(20)
if(sparks)
- sparks.delete()
+ qdel(sparks)
src.total_sparks--
@@ -212,7 +210,7 @@ steam.start() -- spawns the effect
/obj/effect/effect/smoke/New()
..()
spawn (time_to_live)
- delete()
+ qdel(src)
return
/obj/effect/effect/smoke/Crossed(mob/living/carbon/M as mob )
@@ -246,7 +244,7 @@ steam.start() -- spawns the effect
/obj/effect/effect/smoke/illumination/New(var/newloc, var/brightness=15, var/lifetime=10)
time_to_live=lifetime
..()
- SetLuminosity(brightness)
+ set_light(brightness)
/////////////////////////////////////////////
// Bad smoke
@@ -357,7 +355,7 @@ steam.start() -- spawns the effect
spawn(0)
if(holder)
src.location = get_turf(holder)
- var/obj/effect/effect/smoke/smoke = new smoke_type(src.location)
+ var/obj/effect/effect/smoke/smoke = PoolOrNew(smoke_type, src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
@@ -369,7 +367,7 @@ steam.start() -- spawns the effect
sleep(10)
step(smoke,direction)
spawn(smoke.time_to_live*0.75+rand(10,30))
- if (smoke) smoke.delete()
+ if (smoke) qdel(smoke)
src.total_smoke--
@@ -415,13 +413,13 @@ steam.start() -- spawns the effect
var/turf/T = get_turf(src.holder)
if(T != src.oldposition)
if(istype(T, /turf/space))
- var/obj/effect/effect/ion_trails/I = new /obj/effect/effect/ion_trails(src.oldposition)
+ var/obj/effect/effect/ion_trails/I = PoolOrNew(/obj/effect/effect/ion_trails, src.oldposition)
src.oldposition = T
I.set_dir(src.holder.dir)
flick("ion_fade", I)
I.icon_state = "blank"
spawn( 20 )
- I.delete()
+ qdel(I)
spawn(2)
if(src.on)
src.processing = 1
@@ -461,12 +459,12 @@ steam.start() -- spawns the effect
src.processing = 0
spawn(0)
if(src.number < 3)
- var/obj/effect/effect/steam/I = new /obj/effect/effect/steam(src.oldposition)
+ var/obj/effect/effect/steam/I = PoolOrNew(/obj/effect/effect/steam, src.oldposition)
src.number++
src.oldposition = get_turf(holder)
I.set_dir(src.holder.dir)
spawn(10)
- I.delete()
+ qdel(I)
src.number--
spawn(2)
if(src.on)
@@ -515,13 +513,13 @@ steam.start() -- spawns the effect
sleep(30)
if(metal)
- var/obj/structure/foamedmetal/M = new(src.loc)
+ var/obj/structure/foamedmetal/M = PoolOrNew(/obj/structure/foamedmetal, src.loc)
M.metal = metal
M.updateicon()
flick("[icon_state]-disolve", src)
sleep(5)
- delete()
+ qdel(src)
return
// transfer any reagents to the floor
@@ -551,7 +549,7 @@ steam.start() -- spawns the effect
if(F)
continue
- F = new(T, metal)
+ F = PoolOrNew(/obj/effect/effect/foam, list(T, metal))
F.amount = amount
if(!metal)
F.create_reagents(10)
@@ -566,7 +564,7 @@ steam.start() -- spawns the effect
flick("[icon_state]-disolve", src)
spawn(5)
- delete()
+ qdel(src)
/obj/effect/effect/foam/Crossed(var/atom/movable/AM)
@@ -611,7 +609,7 @@ steam.start() -- spawns the effect
F.amount += amount
return
- F = new(src.location, metal)
+ F = PoolOrNew(/obj/effect/effect/foam, list(src.location, metal))
F.amount = amount
if(!metal) // don't carry other chemicals if a metal foam
@@ -642,7 +640,7 @@ steam.start() -- spawns the effect
- Del()
+ Destroy()
density = 0
update_nearby_tiles(1)
@@ -656,14 +654,14 @@ steam.start() -- spawns the effect
ex_act(severity)
- del(src)
+ qdel(src)
blob_act()
- del(src)
+ qdel(src)
bullet_act()
if(metal==1 || prob(50))
- del(src)
+ qdel(src)
attack_hand(var/mob/user)
if ((HULK in user.mutations) || (prob(75 - metal*25)))
@@ -672,7 +670,7 @@ steam.start() -- spawns the effect
if ((O.client && !( O.blinded )))
O << "\red [user] smashes through the foamed metal."
- del(src)
+ qdel(src)
else
user << "\blue You hit the metal foam but bounce off it."
return
@@ -686,8 +684,8 @@ steam.start() -- spawns the effect
for(var/mob/O in viewers(src))
if (O.client)
O << "\red [G.assailant] smashes [G.affecting] through the foamed metal wall."
- del(I)
- del(src)
+ qdel(I)
+ qdel(src)
return
if(prob(I.force*20 - metal*25))
@@ -695,7 +693,7 @@ steam.start() -- spawns the effect
for(var/mob/O in oviewers(user))
if ((O.client && !( O.blinded )))
O << "\red [user] smashes through the foamed metal."
- del(src)
+ qdel(src)
else
user << "\blue You hit the metal foam to no effect."
@@ -722,7 +720,7 @@ steam.start() -- spawns the effect
start()
if (amount <= 2)
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ var/datum/effect/effect/system/spark_spread/s = PoolOrNew(/datum/effect/effect/system/spark_spread)
s.set_up(2, 1, location)
s.start()
diff --git a/code/game/objects/effects/gibs.dm b/code/game/objects/effects/gibs.dm
index 808e46c2a3..a7f4c0482f 100644
--- a/code/game/objects/effects/gibs.dm
+++ b/code/game/objects/effects/gibs.dm
@@ -25,10 +25,10 @@
var/obj/effect/decal/cleanable/blood/gibs/gib = null
for(var/datum/disease/D in viruses)
if(D.spread_type == SPECIAL)
- del(D)
+ qdel(D)
if(sparks)
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ var/datum/effect/effect/system/spark_spread/s = PoolOrNew(/datum/effect/effect/system/spark_spread)
s.set_up(2, 1, get_turf(location)) // Not sure if it's safe to pass an arbitrary object to set_up, todo
s.start()
@@ -63,4 +63,4 @@
if(directions.len)
gib.streak(directions)
- del(src)
\ No newline at end of file
+ qdel(src)
diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm
index da25e6f2cc..6ca1045671 100644
--- a/code/game/objects/effects/landmarks.dm
+++ b/code/game/objects/effects/landmarks.dm
@@ -13,86 +13,77 @@
switch(name) //some of these are probably obsolete
if("shuttle")
shuttle_z = z
- del(src)
-
+ qdel(src)
+ return
if("airtunnel_stop")
airtunnel_stop = x
-
if("airtunnel_start")
airtunnel_start = x
-
if("airtunnel_bottom")
airtunnel_bottom = y
-
if("monkey")
monkeystart += loc
- del(src)
-
+ qdel(src)
+ return
if("start")
newplayer_start += loc
- del(src)
-
+ qdel(src)
if("JoinLate")
latejoin += loc
- del(src)
-
+ qdel(src)
if("JoinLateGateway")
latejoin_gateway += loc
- del(src)
-
+ qdel(src)
+ return
if("JoinLateCryo")
latejoin_cryo += loc
- del(src)
-
+ qdel(src)
+ return
if("JoinLateCyborg")
latejoin_cyborg += loc
- del(src)
-
+ qdel(src)
+ return
if("prisonwarp")
prisonwarp += loc
- del(src)
-
+ qdel(src)
+ return
if("Holding Facility")
holdingfacility += loc
-
if("tdome1")
tdome1 += loc
-
if("tdome2")
tdome2 += loc
-
if("tdomeadmin")
tdomeadmin += loc
-
if("tdomeobserve")
tdomeobserve += loc
-
if("prisonsecuritywarp")
prisonsecuritywarp += loc
- del(src)
-
+ qdel(src)
+ return
if("blobstart")
blobstart += loc
- del(src)
-
+ qdel(src)
+ return
if("xeno_spawn")
xeno_spawn += loc
- del(src)
-
+ qdel(src)
+ return
if("endgame_exit")
endgame_safespawns += loc
- del(src)
-
+ qdel(src)
+ return
if("bluespacerift")
endgame_exits += loc
- del(src)
+ qdel(src)
+ return
landmarks_list += src
return 1
-/obj/effect/landmark/Del()
+/obj/effect/landmark/Destroy()
landmarks_list -= src
- ..()
+ return ..()
/obj/effect/landmark/start
name = "start"
@@ -112,7 +103,8 @@
/obj/effect/landmark/start/ninja/New()
..()
- ninjastart += src
+ ninjastart += loc
+ qdel(src)
//Costume spawner landmarks
@@ -121,51 +113,51 @@
var/list/options = typesof(/obj/effect/landmark/costume)
var/PICK= options[rand(1,options.len)]
new PICK(src.loc)
- del(src)
+ qdel(src)
//SUBCLASSES. Spawn a bunch of items and disappear likewise
/obj/effect/landmark/costume/chicken/New()
new /obj/item/clothing/suit/chickensuit(src.loc)
new /obj/item/clothing/head/chicken(src.loc)
new /obj/item/weapon/reagent_containers/food/snacks/egg(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/gladiator/New()
new /obj/item/clothing/under/gladiator(src.loc)
new /obj/item/clothing/head/helmet/gladiator(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/madscientist/New()
new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc)
new /obj/item/clothing/head/flatcap(src.loc)
new /obj/item/clothing/suit/storage/toggle/labcoat/mad(src.loc)
new /obj/item/clothing/glasses/gglasses(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/elpresidente/New()
new /obj/item/clothing/under/gimmick/rank/captain/suit(src.loc)
new /obj/item/clothing/head/flatcap(src.loc)
new /obj/item/clothing/mask/smokable/cigarette/cigar/havana(src.loc)
new /obj/item/clothing/shoes/jackboots(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/nyangirl/New()
new /obj/item/clothing/under/schoolgirl(src.loc)
new /obj/item/clothing/head/kitty(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/maid/New()
new /obj/item/clothing/under/blackskirt(src.loc)
var/CHOICE = pick( /obj/item/clothing/head/beret , /obj/item/clothing/head/rabbitears )
new CHOICE(src.loc)
new /obj/item/clothing/glasses/sunglasses/blindfold(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/butler/New()
new /obj/item/clothing/suit/wcoat(src.loc)
new /obj/item/clothing/under/suit_jacket(src.loc)
new /obj/item/clothing/head/that(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/scratch/New()
new /obj/item/clothing/gloves/white(src.loc)
@@ -173,12 +165,12 @@
new /obj/item/clothing/under/scratch(src.loc)
if (prob(30))
new /obj/item/clothing/head/cueball(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/highlander/New()
new /obj/item/clothing/under/kilt(src.loc)
new /obj/item/clothing/head/beret(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/prig/New()
new /obj/item/clothing/suit/wcoat(src.loc)
@@ -189,24 +181,24 @@
new /obj/item/weapon/cane(src.loc)
new /obj/item/clothing/under/sl_suit(src.loc)
new /obj/item/clothing/mask/fakemoustache(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/plaguedoctor/New()
new /obj/item/clothing/suit/bio_suit/plaguedoctorsuit(src.loc)
new /obj/item/clothing/head/plaguedoctorhat(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/nightowl/New()
new /obj/item/clothing/under/owl(src.loc)
new /obj/item/clothing/mask/gas/owl_mask(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/waiter/New()
new /obj/item/clothing/under/waiter(src.loc)
var/CHOICE= pick( /obj/item/clothing/head/kitty, /obj/item/clothing/head/rabbitears)
new CHOICE(src.loc)
new /obj/item/clothing/suit/apron(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/pirate/New()
new /obj/item/clothing/under/pirate(src.loc)
@@ -214,46 +206,46 @@
var/CHOICE = pick( /obj/item/clothing/head/pirate , /obj/item/clothing/head/bandana )
new CHOICE(src.loc)
new /obj/item/clothing/glasses/eyepatch(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/commie/New()
new /obj/item/clothing/under/soviet(src.loc)
new /obj/item/clothing/head/ushanka(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/imperium_monk/New()
new /obj/item/clothing/suit/imperium_monk(src.loc)
if (prob(25))
new /obj/item/clothing/mask/gas/cyborg(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/holiday_priest/New()
new /obj/item/clothing/suit/holidaypriest(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/marisawizard/fake/New()
new /obj/item/clothing/head/wizard/marisa/fake(src.loc)
new/obj/item/clothing/suit/wizrobe/marisa/fake(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/cutewitch/New()
new /obj/item/clothing/under/sundress(src.loc)
new /obj/item/clothing/head/witchwig(src.loc)
new /obj/item/weapon/staff/broom(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/fakewizard/New()
new /obj/item/clothing/suit/wizrobe/fake(src.loc)
new /obj/item/clothing/head/wizard/fake(src.loc)
new /obj/item/weapon/staff/(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/sexyclown/New()
new /obj/item/clothing/mask/gas/sexyclown(src.loc)
new /obj/item/clothing/under/sexyclown(src.loc)
- del(src)
+ qdel(src)
/obj/effect/landmark/costume/sexymime/New()
new /obj/item/clothing/mask/gas/sexymime(src.loc)
new /obj/item/clothing/under/sexymime(src.loc)
- del(src)
\ No newline at end of file
+ qdel(src)
\ No newline at end of file
diff --git a/code/game/objects/effects/manifest.dm b/code/game/objects/effects/manifest.dm
index bee6174f12..ec45c7a089 100644
--- a/code/game/objects/effects/manifest.dm
+++ b/code/game/objects/effects/manifest.dm
@@ -17,5 +17,5 @@
P.info = dat
P.name = "paper- 'Crew Manifest'"
//SN src = null
- del(src)
+ qdel(src)
return
\ No newline at end of file
diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm
index e8bf9348f6..27e6d7c74a 100644
--- a/code/game/objects/effects/mines.dm
+++ b/code/game/objects/effects/mines.dm
@@ -26,24 +26,24 @@
call(src,triggerproc)(M)
/obj/effect/mine/proc/triggerrad(obj)
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ var/datum/effect/effect/system/spark_spread/s = PoolOrNew(/datum/effect/effect/system/spark_spread)
s.set_up(3, 1, src)
s.start()
obj:radiation += 50
randmutb(obj)
domutcheck(obj,null)
spawn(0)
- del(src)
+ qdel(src)
/obj/effect/mine/proc/triggerstun(obj)
if(ismob(obj))
var/mob/M = obj
M.Stun(30)
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ var/datum/effect/effect/system/spark_spread/s = PoolOrNew(/datum/effect/effect/system/spark_spread)
s.set_up(3, 1, src)
s.start()
spawn(0)
- del(src)
+ qdel(src)
/obj/effect/mine/proc/triggern2o(obj)
//example: n2o triggerproc
@@ -54,7 +54,7 @@
target.assume_gas("sleeping_agent", 30)
spawn(0)
- del(src)
+ qdel(src)
/obj/effect/mine/proc/triggerphoron(obj)
for (var/turf/simulated/floor/target in range(1,src))
@@ -64,20 +64,20 @@
target.hotspot_expose(1000, CELL_VOLUME)
spawn(0)
- del(src)
+ qdel(src)
/obj/effect/mine/proc/triggerkick(obj)
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
+ var/datum/effect/effect/system/spark_spread/s = PoolOrNew(/datum/effect/effect/system/spark_spread)
s.set_up(3, 1, src)
s.start()
- del(obj:client)
+ qdel(obj:client)
spawn(0)
- del(src)
+ qdel(src)
/obj/effect/mine/proc/explode(obj)
explosion(loc, 0, 1, 2, 3)
spawn(0)
- del(src)
+ qdel(src)
/obj/effect/mine/dnascramble
name = "Radiation Mine"
diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm
index 6dd26f7774..cc52bf7bbf 100644
--- a/code/game/objects/effects/overlays.dm
+++ b/code/game/objects/effects/overlays.dm
@@ -3,10 +3,6 @@
unacidable = 1
var/i_attached//Added for possible image attachments to objects. For hallucinations and the like.
-/obj/effect/overlay/Destroy()
- PlaceInPool(src)
- return 1 //cancels the GCing
-
/obj/effect/overlay/beam//Not actually a projectile, just an effect.
name="beam"
icon='icons/effects/beam.dmi'
@@ -14,7 +10,7 @@
var/tmp/atom/BeamSource
New()
..()
- spawn(10) del src
+ spawn(10) qdel(src)
/obj/effect/overlay/palmtree_r
name = "Palm tree"
@@ -41,4 +37,18 @@
name = "Bluespace"
icon = 'icons/turf/space.dmi'
icon_state = "bluespacify"
- layer = LIGHTING_LAYER
+ layer = 10
+
+/obj/effect/overlay/wallrot
+ name = "wallrot"
+ desc = "Ick..."
+ icon = 'icons/effects/wallrot.dmi'
+ anchored = 1
+ density = 1
+ layer = 5
+ mouse_opacity = 0
+
+/obj/effect/overlay/wallrot/New()
+ ..()
+ pixel_x += rand(-10, 10)
+ pixel_y += rand(-10, 10)
diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm
index 6a9f16e99e..702926d6ff 100644
--- a/code/game/objects/effects/portals.dm
+++ b/code/game/objects/effects/portals.dm
@@ -30,7 +30,7 @@
/obj/effect/portal/New()
spawn(300)
- del(src)
+ qdel(src)
return
return
@@ -42,7 +42,7 @@
if (icon_state == "portal1")
return
if (!( target ))
- del(src)
+ qdel(src)
return
if (istype(M, /atom/movable))
if(prob(failchance)) //oh dear a problem, put em in deep space
diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm
index 3f694a8b49..547931a511 100644
--- a/code/game/objects/effects/spawners/bombspawner.dm
+++ b/code/game/objects/effects/spawners/bombspawner.dm
@@ -102,7 +102,7 @@
p4.air_contents.temperature = btemp + T0C
p2.secured = 1
- del(src)
+ qdel(src)
*/
/obj/effect/spawner/newbomb
@@ -168,4 +168,4 @@
V.update_icon()
- del(src)
+ qdel(src)
diff --git a/code/game/objects/effects/spawners/vaultspawner.dm b/code/game/objects/effects/spawners/vaultspawner.dm
index e91105f5df..c4b9203cef 100644
--- a/code/game/objects/effects/spawners/vaultspawner.dm
+++ b/code/game/objects/effects/spawners/vaultspawner.dm
@@ -23,4 +23,4 @@
else
new /turf/simulated/floor/vault(locate(i,j,z),type)
- del(src)
\ No newline at end of file
+ qdel(src)
diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm
index 682347669a..03b5c922d8 100644
--- a/code/game/objects/effects/spiders.dm
+++ b/code/game/objects/effects/spiders.dm
@@ -11,20 +11,20 @@
/obj/effect/spider/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
if(3.0)
if (prob(5))
- del(src)
+ qdel(src)
return
/obj/effect/spider/attackby(var/obj/item/weapon/W, var/mob/user)
if(W.attack_verb.len)
- visible_message("\red \The [src] have been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
+ visible_message("\The [src] have been [pick(W.attack_verb)] with \the [W][(user ? " by [user]." : ".")]")
else
- visible_message("\red \The [src] have been attacked with \the [W][(user ? " by [user]." : ".")]")
+ visible_message("\The [src] have been attacked with \the [W][(user ? " by [user]." : ".")]")
var/damage = W.force / 4.0
@@ -45,7 +45,7 @@
/obj/effect/spider/proc/healthcheck()
if(health <= 0)
- del(src)
+ qdel(src)
/obj/effect/spider/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
@@ -86,7 +86,7 @@
var/num = rand(6,24)
for(var/i=0, i[src] dies!")
- new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- del(src)
+ PoolOrNew(/obj/effect/decal/cleanable/spiderling_remains, src.loc)
+ qdel(src)
/obj/effect/spider/spiderling/healthcheck()
if(health <= 0)
@@ -188,7 +188,7 @@
if(amount_grown >= 100)
var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider))
new spawn_type(src.loc)
- del(src)
+ qdel(src)
/obj/effect/decal/cleanable/spiderling_remains
name = "spiderling remains"
@@ -205,8 +205,8 @@
New()
icon_state = pick("cocoon1","cocoon2","cocoon3")
-/obj/effect/spider/cocoon/Del()
+/obj/effect/spider/cocoon/Destroy()
src.visible_message("\red \the [src] splits open.")
for(var/atom/movable/A in contents)
A.loc = src.loc
- ..()
+ return ..()
diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm
index 8bff463e44..05cdbfee1d 100644
--- a/code/game/objects/empulse.dm
+++ b/code/game/objects/empulse.dm
@@ -9,13 +9,13 @@ proc/empulse(turf/epicenter, heavy_range, light_range, log=0)
log_game("EMP with size ([heavy_range], [light_range]) in area [epicenter.loc.name] ")
if(heavy_range > 1)
- var/obj/effect/overlay/pulse = new/obj/effect/overlay ( epicenter )
+ var/obj/effect/overlay/pulse = PoolOrNew(/obj/effect/overlay, epicenter)
pulse.icon = 'icons/effects/effects.dmi'
pulse.icon_state = "emppulse"
pulse.name = "emp pulse"
pulse.anchored = 1
spawn(20)
- pulse.delete()
+ qdel(pulse)
if(heavy_range > light_range)
light_range = heavy_range
diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm
index 32f05901b4..58c053aa66 100644
--- a/code/game/objects/explosion.dm
+++ b/code/game/objects/explosion.dm
@@ -68,8 +68,8 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (JMP)")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
- var/lighting_controller_was_processing = lighting_controller.processing //Pause the lighting updates for a bit
- lighting_controller.processing = 0
+// var/lighting_controller_was_processing = lighting_controller.processing //Pause the lighting updates for a bit
+// lighting_controller.processing = 0
var/approximate_intensity = (devastation_range * 3) + (heavy_impact_range * 2) + light_impact_range
@@ -87,8 +87,8 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
var/y0 = epicenter.y
var/z0 = epicenter.z
- for(var/turf/T in range(epicenter, max_range))
- var/dist = cheap_pythag(T.x - x0,T.y - y0)
+ for(var/turf/T in trange(max_range, epicenter))
+ var/dist = sqrt((T.x - x0)**2 + (T.y - y0)**2)
if(dist < devastation_range) dist = 1
else if(dist < heavy_impact_range) dist = 2
@@ -99,7 +99,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
if(T)
for(var/atom_movable in T.contents) //bypass type checking since only atom/movable can be contained by turfs anyway
var/atom/movable/AM = atom_movable
- if(AM) AM.ex_act(dist)
+ if(AM && AM.simulated) AM.ex_act(dist)
var/took = (world.timeofday-start)/10
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
@@ -113,7 +113,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
sleep(8)
- if(!lighting_controller.processing) lighting_controller.processing = lighting_controller_was_processing
+// if(!lighting_controller.processing) lighting_controller.processing = lighting_controller_was_processing
if(!powernet_rebuild_was_deferred_already && defer_powernet_rebuild)
makepowernets()
defer_powernet_rebuild = 0
diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm
index 9dc04ff630..191fb01d47 100644
--- a/code/game/objects/explosion_recursive.dm
+++ b/code/game/objects/explosion_recursive.dm
@@ -65,7 +65,7 @@ proc/explosion_rec(turf/epicenter, power)
var/explosion_resistance
/turf/space
- explosion_resistance = 10
+ explosion_resistance = 3
/turf/simulated/floor
explosion_resistance = 1
@@ -83,13 +83,10 @@ proc/explosion_rec(turf/epicenter, power)
explosion_resistance = 1
/turf/simulated/shuttle/wall
- explosion_resistance = 5
+ explosion_resistance = 10
/turf/simulated/wall
- explosion_resistance = 5
-
-/turf/simulated/wall/r_wall
- explosion_resistance = 25
+ explosion_resistance = 10
//Code-wise, a safe value for power is something up to ~25 or ~30.. This does quite a bit of damage to the station.
//direction is the direction that the spread took to come to this tile. So it is pointing in the main blast direction - meaning where this tile should spread most of it's force.
@@ -107,24 +104,16 @@ proc/explosion_rec(turf/epicenter, power)
explosion_turfs[src] = power
var/spread_power = power - src.explosion_resistance //This is the amount of power that will be spread to the tile in the direction of the blast
- var/side_spread_power = power - 2 * src.explosion_resistance //This is the amount of power that will be spread to the side tiles
for(var/obj/O in src)
if(O.explosion_resistance)
spread_power -= O.explosion_resistance
- side_spread_power -= O.explosion_resistance
var/turf/T = get_step(src, direction)
T.explosion_spread(spread_power, direction)
T = get_step(src, turn(direction,90))
- T.explosion_spread(side_spread_power, turn(direction,90))
+ T.explosion_spread(spread_power, turn(direction,90))
T = get_step(src, turn(direction,-90))
- T.explosion_spread(side_spread_power, turn(direction,90))
-
- /*
- for(var/direction in cardinal)
- var/turf/T = get_step(src, direction)
- T.explosion_spread(spread_power)
- */
+ T.explosion_spread(spread_power, turn(direction,90))
/turf/unsimulated/explosion_spread(power)
return //So it doesn't get to the parent proc, which simulates explosions
\ No newline at end of file
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 87ab21e610..4b9a89bda1 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -3,7 +3,6 @@
icon = 'icons/obj/items.dmi'
var/image/blood_overlay = null //this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite
var/abstract = 0
- var/item_state = null
var/r_speed = 1.0
var/health = null
var/burn_point = null
@@ -11,6 +10,7 @@
var/hitsound = null
var/w_class = 3.0
var/slot_flags = 0 //This is used to determine on which slots an item can fit.
+ var/no_attack_log = 0 //If it's an item we don't want to log attack_logs with, set this to 1
pass_flags = PASSTABLE
pressure_resistance = 5
// causeerrorheresoifixthis
@@ -26,7 +26,6 @@
//Since any item can now be a piece of clothing, this has to be put here so all items share it.
var/flags_inv //This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.
- var/item_color = null
var/body_parts_covered = 0 //see setup.dm for appropriate bit flags
//var/heat_transfer_coefficient = 1 //0 prevents all transfers, 1 is invisible
var/gas_transfer_coefficient = 1 // for leaking gas from turf to mask and vice-versa (for masks right now, but at some point, i'd like to include space helmets)
@@ -40,6 +39,9 @@
var/zoomdevicename = null //name used for message when binoculars/scope is used
var/zoom = 0 //1 if item is actively being used to zoom. For scoped guns and binoculars.
+ var/item_state = null // Used to specify the item state for the on-mob overlays.
+ var/item_state_slots = null //overrides the default item_state for particular slots.
+
// Used to specify the icon file to be used when the item is worn. If not set the default icon for that slot will be used.
// If icon_override or sprite_sheets are set they will take precendence over this, assuming they apply to the slot in question.
// Only slot_l_hand/slot_r_hand are implemented at the moment. Others to be implemented as needed.
@@ -60,6 +62,12 @@
*/
var/list/sprite_sheets_obj = null
+/obj/item/Destroy()
+ if(ismob(loc))
+ var/mob/m = loc
+ m.unEquip(src, 1)
+ return ..()
+
/obj/item/device
icon = 'icons/obj/device.dmi'
@@ -75,15 +83,15 @@
/obj/item/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(5))
- del(src)
+ qdel(src)
return
else
return
@@ -147,11 +155,8 @@
src.throwing = 0
if (src.loc == user)
- //canremove==0 means that object may not be removed. You can still wear it. This only applies to clothing. /N
- if(!src.canremove)
+ if(!user.unEquip(src))
return
- else
- user.u_equip(src)
else
if(isliving(src.loc))
return
@@ -161,7 +166,6 @@
src.pickup(user)
return
-
/obj/item/attack_ai(mob/user as mob)
if (istype(src.loc, /obj/item/weapon/robot_module))
//If the item is part of a cyborg module, equip it
@@ -239,198 +243,124 @@
/obj/item/proc/equipped(var/mob/user, var/slot)
return
+//Defines which slots correspond to which slot flags
+var/list/global/slot_flags_enumeration = list(
+ "[slot_wear_mask]" = SLOT_MASK,
+ "[slot_back]" = SLOT_BACK,
+ "[slot_wear_suit]" = SLOT_OCLOTHING,
+ "[slot_gloves]" = SLOT_GLOVES,
+ "[slot_shoes]" = SLOT_FEET,
+ "[slot_belt]" = SLOT_BELT,
+ "[slot_glasses]" = SLOT_EYES,
+ "[slot_head]" = SLOT_HEAD,
+ "[slot_l_ear]" = SLOT_EARS|SLOT_TWOEARS,
+ "[slot_r_ear]" = SLOT_EARS|SLOT_TWOEARS,
+ "[slot_w_uniform]" = SLOT_ICLOTHING,
+ "[slot_wear_id]" = SLOT_ID,
+ "[slot_tie]" = SLOT_TIE,
+ )
+
//the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't.
//If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen.
//Set disable_warning to 1 if you wish it to not give you outputs.
+//Should probably move the bulk of this into mob code some time, as most of it is related to the definition of slots and not item-specific
/obj/item/proc/mob_can_equip(M as mob, slot, disable_warning = 0)
if(!slot) return 0
if(!M) return 0
- if(ishuman(M))
- //START HUMAN
- var/mob/living/carbon/human/H = M
- var/list/mob_equip = list()
- if(H.species.hud && H.species.hud.equip_slots)
- mob_equip = H.species.hud.equip_slots
+ if(!ishuman(M)) return 0
+
+ var/mob/living/carbon/human/H = M
+ var/list/mob_equip = list()
+ if(H.species.hud && H.species.hud.equip_slots)
+ mob_equip = H.species.hud.equip_slots
- if(H.species && !(slot in mob_equip))
+ if(H.species && !(slot in mob_equip))
+ return 0
+
+ //First check if the item can be equipped to the desired slot.
+ if("[slot]" in slot_flags_enumeration)
+ var/req_flags = slot_flags_enumeration["[slot]"]
+ if(!(req_flags & slot_flags))
return 0
+
+ //Next check that the slot is free
+ if(H.get_equipped_item(slot))
+ return 0
+
+ //Next check if the slot is accessible.
+ var/mob/_user = disable_warning? null : H
+ if(!H.slot_is_accessible(slot, src, _user))
+ return 0
+
+ //Lastly, check special rules for the desired slot.
+ switch(slot)
+ if(slot_l_ear, slot_r_ear)
+ var/slot_other_ear = (slot == slot_l_ear)? slot_r_ear : slot_l_ear
+ if( (w_class > 1) && !(slot_flags & SLOT_EARS) )
+ return 0
+ if( (slot_flags & SLOT_TWOEARS) && H.get_equipped_item(slot_other_ear) )
+ return 0
+ if(slot_wear_id)
+ if(!H.w_uniform && (slot_w_uniform in mob_equip))
+ if(!disable_warning)
+ H << "You need a jumpsuit before you can attach this [name]."
+ return 0
+ if(slot_l_store, slot_r_store)
+ if(!H.w_uniform && (slot_w_uniform in mob_equip))
+ if(!disable_warning)
+ H << "You need a jumpsuit before you can attach this [name]."
+ return 0
+ if(slot_flags & SLOT_DENYPOCKET)
+ return 0
+ if( w_class > 2 && !(slot_flags & SLOT_POCKET) )
+ return 0
+ if(slot_s_store)
+ if(!H.wear_suit && (slot_wear_suit in mob_equip))
+ if(!disable_warning)
+ H << "You need a suit before you can attach this [name]."
+ return 0
+ if(!H.wear_suit.allowed)
+ if(!disable_warning)
+ usr << "You somehow have a suit with no defined allowed items for suit storage, stop that."
+ return 0
+ if( !(istype(src, /obj/item/device/pda) || istype(src, /obj/item/weapon/pen) || is_type_in_list(src, H.wear_suit.allowed)) )
+ return 0
+ if(slot_handcuffed)
+ if(!istype(src, /obj/item/weapon/handcuffs))
+ return 0
+ if(slot_legcuffed)
+ if(!istype(src, /obj/item/weapon/legcuffs))
+ return 0
+ if(slot_in_backpack) //used entirely for equipping spawned mobs or at round start
+ var/allow = 0
+ if(H.back && istype(H.back, /obj/item/weapon/storage/backpack))
+ var/obj/item/weapon/storage/backpack/B = H.back
+ if(B.contents.len < B.storage_slots && w_class <= B.max_w_class)
+ allow = 1
+ if(!allow)
+ return 0
+ if(slot_tie)
+ if(!H.w_uniform && (slot_w_uniform in mob_equip))
+ if(!disable_warning)
+ H << "You need a jumpsuit before you can attach this [name]."
+ return 0
+ var/obj/item/clothing/under/uniform = H.w_uniform
+ if(uniform.accessories.len && !uniform.can_attach_accessory(src))
+ if (!disable_warning)
+ H << "You already have an accessory of this type attached to your [uniform]."
+ return 0
+ return 1
- switch(slot)
- if(slot_l_hand)
- if(H.l_hand)
- return 0
- return 1
- if(slot_r_hand)
- if(H.r_hand)
- return 0
- return 1
- if(slot_wear_mask)
- if(H.wear_mask)
- return 0
- if(H.head && !(H.head.canremove) && (H.head.flags & HEADCOVERSMOUTH))
- if(!disable_warning)
- H << "\The [H.head] is in the way."
- return 0
- if( !(slot_flags & SLOT_MASK) )
- return 0
- return 1
- if(slot_back)
- if(H.back)
- return 0
- if( !(slot_flags & SLOT_BACK) )
- return 0
- return 1
- if(slot_wear_suit)
- if(H.wear_suit)
- return 0
- if( !(slot_flags & SLOT_OCLOTHING) )
- return 0
- return 1
- if(slot_gloves)
- if(H.gloves)
- return 0
- if( !(slot_flags & SLOT_GLOVES) )
- return 0
- return 1
- if(slot_shoes)
- if(H.shoes)
- return 0
- if( !(slot_flags & SLOT_FEET) )
- return 0
- return 1
- if(slot_belt)
- if(H.belt)
- return 0
- if(!H.w_uniform && (slot_w_uniform in mob_equip))
- if(!disable_warning)
- H << "You need a jumpsuit before you can attach this [name]."
- return 0
- if( !(slot_flags & SLOT_BELT) )
- return
- return 1
- if(slot_glasses)
- if(H.glasses)
- return 0
- if(H.head && !(H.head.canremove) && (H.head.flags & HEADCOVERSEYES))
- if(!disable_warning)
- H << "\The [H.head] is in the way."
- return 0
- if( !(slot_flags & SLOT_EYES) )
- return 0
- return 1
- if(slot_head)
- if(H.head)
- return 0
- if( !(slot_flags & SLOT_HEAD) )
- return 0
- return 1
- if(slot_l_ear)
- if(H.l_ear)
- return 0
- if( (w_class > 1) && !(slot_flags & SLOT_EARS) )
- return 0
- if( (slot_flags & SLOT_TWOEARS) && H.r_ear )
- return 0
- return 1
- if(slot_r_ear)
- if(H.r_ear)
- return 0
- if( (w_class > 1) && !(slot_flags & SLOT_EARS) )
- return 0
- if( (slot_flags & SLOT_TWOEARS) && H.l_ear )
- return 0
- return 1
- if(slot_w_uniform)
- if(H.w_uniform)
- return 0
- if(H.wear_suit && (H.wear_suit.body_parts_covered & src.body_parts_covered))
- if(!disable_warning)
- H << "\The [H.wear_suit] is in the way."
- return 0
- if( !(slot_flags & SLOT_ICLOTHING) )
- return 0
- return 1
- if(slot_wear_id)
- if(H.wear_id)
- return 0
- if(!H.w_uniform && (slot_w_uniform in mob_equip))
- if(!disable_warning)
- H << "You need a jumpsuit before you can attach this [name]."
- return 0
- if( !(slot_flags & SLOT_ID) )
- return 0
- return 1
- if(slot_l_store)
- if(H.l_store)
- return 0
- if(!H.w_uniform && (slot_w_uniform in mob_equip))
- if(!disable_warning)
- H << "You need a jumpsuit before you can attach this [name]."
- return 0
- if(slot_flags & SLOT_DENYPOCKET)
- return 0
- if( w_class <= 2 || (slot_flags & SLOT_POCKET) )
- return 1
- if(slot_r_store)
- if(H.r_store)
- return 0
- if(!H.w_uniform && (slot_w_uniform in mob_equip))
- if(!disable_warning)
- H << "You need a jumpsuit before you can attach this [name]."
- return 0
- if(slot_flags & SLOT_DENYPOCKET)
- return 0
- if( w_class <= 2 || (slot_flags & SLOT_POCKET) )
- return 1
- return 0
- if(slot_s_store)
- if(H.s_store)
- return 0
- if(!H.wear_suit && (slot_wear_suit in mob_equip))
- if(!disable_warning)
- H << "You need a suit before you can attach this [name]."
- return 0
- if(!H.wear_suit.allowed)
- if(!disable_warning)
- usr << "You somehow have a suit with no defined allowed items for suit storage, stop that."
- return 0
- if( istype(src, /obj/item/device/pda) || istype(src, /obj/item/weapon/pen) || is_type_in_list(src, H.wear_suit.allowed) )
- return 1
- return 0
- if(slot_handcuffed)
- if(H.handcuffed)
- return 0
- if(!istype(src, /obj/item/weapon/handcuffs))
- return 0
- return 1
- if(slot_legcuffed)
- if(H.legcuffed)
- return 0
- if(!istype(src, /obj/item/weapon/legcuffs))
- return 0
- return 1
- if(slot_in_backpack)
- if (H.back && istype(H.back, /obj/item/weapon/storage/backpack))
- var/obj/item/weapon/storage/backpack/B = H.back
- if(B.contents.len < B.storage_slots && w_class <= B.max_w_class)
- return 1
- return 0
- if(slot_tie)
- if(!H.w_uniform && (slot_w_uniform in mob_equip))
- if(!disable_warning)
- H << "You need a jumpsuit before you can attach this [name]."
- return 0
- var/obj/item/clothing/under/uniform = H.w_uniform
- if(uniform.accessories.len && !uniform.can_attach_accessory(src))
- if (!disable_warning)
- H << "You already have an accessory of this type attached to your [uniform]."
- return 0
- if( !(slot_flags & SLOT_TIE) )
- return 0
- return 1
- return 0 //Unsupported slot
- //END HUMAN
+/obj/item/proc/mob_can_unequip(mob/M, slot, disable_warning = 0)
+ if(!slot) return 0
+ if(!M) return 0
+
+ if(!canremove)
+ return 0
+ if(!M.slot_is_accessible(slot, src, disable_warning? null : M))
+ return 0
+ return 1
/obj/item/verb/verb_pickup()
set src in oview(1)
@@ -670,4 +600,4 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
if(!cannotzoom)
usr.visible_message("[zoomdevicename ? "[usr] looks up from the [src.name]" : "[usr] lowers the [src.name]"].")
- return
\ No newline at end of file
+ return
diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm
index a11b326e45..208a2111da 100644
--- a/code/game/objects/items/apc_frame.dm
+++ b/code/game/objects/items/apc_frame.dm
@@ -11,7 +11,7 @@
..()
if (istype(W, /obj/item/weapon/wrench))
new /obj/item/stack/sheet/metal( get_turf(src.loc), 2 )
- del(src)
+ qdel(src)
/obj/item/apc_frame/proc/try_build(turf/on_wall)
if (get_dist(on_wall,usr)>1)
@@ -38,6 +38,6 @@
var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(loc)
C.amount = 10
usr << "You cut the cables and disassemble the unused power terminal."
- del(T)
+ qdel(T)
new /obj/machinery/power/apc(loc, ndir, 1)
- del(src)
+ qdel(src)
diff --git a/code/game/objects/items/ashtray.dm b/code/game/objects/items/ashtray.dm
index 0d386623ec..abb6adb48d 100644
--- a/code/game/objects/items/ashtray.dm
+++ b/code/game/objects/items/ashtray.dm
@@ -31,7 +31,7 @@
processing_objects.Remove(cig)
var/obj/item/butt = new cig.type_butt(src)
cig.transfer_fingerprints_to(butt)
- del(cig)
+ qdel(cig)
W = butt
else if (cig.lit == 0)
user << "You place [cig] in [src] without even smoking it. Why would you do that?"
@@ -82,7 +82,7 @@
icon_broken = "ashtray_bork_bl"
max_butts = 14
health = 24.0
- matter = list("metal" = 30,"glass" = 30)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 30)
empty_desc = "Cheap plastic ashtray."
throwforce = 3.0
die()
@@ -102,7 +102,7 @@
icon_broken = "ashtray_bork_br"
max_butts = 10
health = 72.0
- matter = list("metal" = 80)
+ matter = list(DEFAULT_WALL_MATERIAL = 80)
empty_desc = "Massive bronze ashtray."
throwforce = 10.0
diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm
index facafe41f2..9ec1a2e144 100644
--- a/code/game/objects/items/blueprints.dm
+++ b/code/game/objects/items/blueprints.dm
@@ -76,7 +76,6 @@ move an amendment to the drawing.
/obj/item/blueprints/proc/get_area()
var/turf/T = get_turf(usr)
var/area/A = T.loc
- A = A.master
return A
/obj/item/blueprints/proc/get_area_type(var/area/A = get_area())
@@ -122,7 +121,6 @@ move an amendment to the drawing.
return
var/area/A = new
A.name = str
- A.tagbase = "[A.type]_[md5(str)]" // without this dynamic light system ruin everithing
//var/ma
//ma = A.master ? "[A.master]" : "(null)"
//world << "DEBUG: create_area:
A.name=[A.name]
A.tag=[A.tag]
A.master=[ma]"
@@ -133,9 +131,6 @@ move an amendment to the drawing.
move_turfs_to_area(turfs, A)
A.always_unpowered = 0
- for(var/turf/T in A.contents)
- T.lighting_changed = 1
- lighting_controller.changed_turfs += T
spawn(5)
//ma = A.master ? "[A.master]" : "(null)"
@@ -161,8 +156,7 @@ move an amendment to the drawing.
usr << "\red Text too long."
return
set_area_machinery_title(A,str,prevname)
- for(var/area/RA in A.related)
- RA.name = str
+ A.name = str
usr << "\blue You set the area '[prevname]' title to '[str]'."
interact()
return
@@ -172,17 +166,17 @@ move an amendment to the drawing.
/obj/item/blueprints/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle)
if (!oldtitle) // or replacetext goes to infinite loop
return
- for(var/area/RA in A.related)
- for(var/obj/machinery/alarm/M in RA)
- M.name = replacetext(M.name,oldtitle,title)
- for(var/obj/machinery/power/apc/M in RA)
- M.name = replacetext(M.name,oldtitle,title)
- for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA)
- M.name = replacetext(M.name,oldtitle,title)
- for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA)
- M.name = replacetext(M.name,oldtitle,title)
- for(var/obj/machinery/door/M in RA)
- M.name = replacetext(M.name,oldtitle,title)
+
+ for(var/obj/machinery/alarm/M in A)
+ M.name = replacetext(M.name,oldtitle,title)
+ for(var/obj/machinery/power/apc/M in A)
+ M.name = replacetext(M.name,oldtitle,title)
+ for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in A)
+ M.name = replacetext(M.name,oldtitle,title)
+ for(var/obj/machinery/atmospherics/unary/vent_pump/M in A)
+ M.name = replacetext(M.name,oldtitle,title)
+ for(var/obj/machinery/door/M in A)
+ M.name = replacetext(M.name,oldtitle,title)
//TODO: much much more. Unnamed airlocks, cameras, etc.
/obj/item/blueprints/proc/check_tile_is_border(var/turf/T2,var/dir)
@@ -207,10 +201,6 @@ move an amendment to the drawing.
return BORDER_BETWEEN
if (locate(/obj/machinery/door) in T2)
return BORDER_2NDTILE
- if (locate(/obj/structure/falsewall) in T2)
- return BORDER_2NDTILE
- if (locate(/obj/structure/falserwall) in T2)
- return BORDER_2NDTILE
return BORDER_NONE
@@ -247,4 +237,4 @@ move an amendment to the drawing.
if(BORDER_SPACE)
return ROOM_ERR_SPACE
found+=T
- return found
\ No newline at end of file
+ return found
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 8548e4783e..8953872d93 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -10,7 +10,7 @@
attack_self(mob/user)
var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc)
R.add_fingerprint(user)
- del(src)
+ qdel(src)
/obj/item/weapon/storage/box/bodybags
@@ -83,7 +83,7 @@
visible_message("[usr] folds up the [src.name]")
new item_path(get_turf(src))
spawn(0)
- del(src)
+ qdel(src)
return
/obj/structure/closet/body_bag/update_icon()
@@ -105,7 +105,7 @@
attack_self(mob/user)
var/obj/structure/closet/body_bag/cryobag/R = new /obj/structure/closet/body_bag/cryobag(user.loc)
R.add_fingerprint(user)
- del(src)
+ qdel(src)
@@ -126,7 +126,7 @@
O.icon = src.icon
O.icon_state = "bodybag_used"
O.desc = "Pretty useless now.."
- del(src)
+ qdel(src)
/obj/structure/closet/body_bag/cryobag/MouseDrop(over_object, src_location, over_location)
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index 8e1a382a86..a9a7528994 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -1,40 +1,40 @@
-/obj/item/toy/crayon/red
+/obj/item/weapon/pen/crayon/red
icon_state = "crayonred"
colour = "#DA0000"
shadeColour = "#810C0C"
colourName = "red"
-/obj/item/toy/crayon/orange
+/obj/item/weapon/pen/crayon/orange
icon_state = "crayonorange"
colour = "#FF9300"
shadeColour = "#A55403"
colourName = "orange"
-/obj/item/toy/crayon/yellow
+/obj/item/weapon/pen/crayon/yellow
icon_state = "crayonyellow"
colour = "#FFF200"
shadeColour = "#886422"
colourName = "yellow"
-/obj/item/toy/crayon/green
+/obj/item/weapon/pen/crayon/green
icon_state = "crayongreen"
colour = "#A8E61D"
shadeColour = "#61840F"
colourName = "green"
-/obj/item/toy/crayon/blue
+/obj/item/weapon/pen/crayon/blue
icon_state = "crayonblue"
colour = "#00B7EF"
shadeColour = "#0082A8"
colourName = "blue"
-/obj/item/toy/crayon/purple
+/obj/item/weapon/pen/crayon/purple
icon_state = "crayonpurple"
colour = "#DA00FF"
shadeColour = "#810CFF"
colourName = "purple"
-/obj/item/toy/crayon/mime
+/obj/item/weapon/pen/crayon/mime
icon_state = "crayonmime"
desc = "A very sad-looking crayon."
colour = "#FFFFFF"
@@ -42,7 +42,7 @@
colourName = "mime"
uses = 0
-/obj/item/toy/crayon/mime/attack_self(mob/living/user as mob) //inversion
+/obj/item/weapon/pen/crayon/mime/attack_self(mob/living/user as mob) //inversion
if(colour != "#FFFFFF" && shadeColour != "#000000")
colour = "#FFFFFF"
shadeColour = "#000000"
@@ -53,19 +53,19 @@
user << "You will now draw in black and white with this crayon."
return
-/obj/item/toy/crayon/rainbow
+/obj/item/weapon/pen/crayon/rainbow
icon_state = "crayonrainbow"
colour = "#FFF000"
shadeColour = "#000FFF"
colourName = "rainbow"
uses = 0
-/obj/item/toy/crayon/rainbow/attack_self(mob/living/user as mob)
+/obj/item/weapon/pen/crayon/rainbow/attack_self(mob/living/user as mob)
colour = input(user, "Please select the main colour.", "Crayon colour") as color
shadeColour = input(user, "Please select the shade colour.", "Crayon colour") as color
return
-/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob, proximity)
+/obj/item/weapon/pen/crayon/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity) return
if(istype(target,/turf/simulated/floor))
var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter")
@@ -85,10 +85,10 @@
uses--
if(!uses)
user << "\red You used up your crayon!"
- del(src)
+ qdel(src)
return
-/obj/item/toy/crayon/attack(mob/M as mob, mob/user as mob)
+/obj/item/weapon/pen/crayon/attack(mob/M as mob, mob/user as mob)
if(M == user)
user << "You take a bite of the crayon and swallow it."
user.nutrition += 1
@@ -97,6 +97,6 @@
uses -= 5
if(uses <= 0)
user << "\red You ate your crayon!"
- del(src)
+ qdel(src)
else
..()
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index 794499fa37..9979b66ce2 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -308,15 +308,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
/*
* The Actual PDA
*/
-/obj/item/device/pda/pickup(mob/user)
- if(fon)
- SetLuminosity(0)
- user.SetLuminosity(user.luminosity + f_lum)
-
-/obj/item/device/pda/dropped(mob/user)
- if(fon)
- user.SetLuminosity(user.luminosity - f_lum)
- SetLuminosity(f_lum)
/obj/item/device/pda/New()
..()
@@ -644,12 +635,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Light")
if(fon)
fon = 0
- if(src in U.contents) U.SetLuminosity(U.luminosity - f_lum)
- else SetLuminosity(0)
+ set_light(0)
else
fon = 1
- if(src in U.contents) U.SetLuminosity(U.luminosity + f_lum)
- else SetLuminosity(f_lum)
+ set_light(f_lum)
if("Medical Scan")
if(scanmode == 1)
scanmode = 0
@@ -938,7 +927,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
j = prob(10)
if(j) //This kills the PDA
- P.Del()
+ qdel(P)
if(message)
message += "It melts in a puddle of plastic."
else
@@ -1240,7 +1229,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
if ( !(C:blood_DNA) )
user << "\blue No blood found on [C]"
if(C:blood_DNA)
- del(C:blood_DNA)
+ qdel(C:blood_DNA)
else
user << "\blue Blood found on [C]. Analysing..."
spawn(15)
@@ -1370,7 +1359,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
explosion(T, 0, 0, 1, rand(1,2))
return
-/obj/item/device/pda/Del()
+/obj/item/device/pda/Destroy()
PDAs -= src
if (src.id && prob(90)) //IDs are kept in 90% of the cases
src.id.loc = get_turf(src.loc)
diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm
index 5ab09d0853..2c91285e08 100644
--- a/code/game/objects/items/devices/PDA/cart.dm
+++ b/code/game/objects/items/devices/PDA/cart.dm
@@ -58,10 +58,9 @@
icon_state = "cart-s"
access_security = 1
-/obj/item/weapon/cartridge/security/New()
+/obj/item/weapon/cartridge/security/initialize()
+ radio = new /obj/item/radio/integrated/beepsky(src)
..()
- spawn(5)
- radio = new /obj/item/radio/integrated/beepsky(src)
/obj/item/weapon/cartridge/detective
name = "\improper D.E.T.E.C.T. cartridge"
@@ -102,6 +101,7 @@
/obj/item/weapon/cartridge/signal
name = "generic signaler cartridge"
desc = "A data cartridge with an integrated radio signaler module."
+ var/qdeled = 0
/obj/item/weapon/cartridge/signal/science
name = "\improper Signal Ace 2 cartridge"
@@ -110,12 +110,13 @@
access_reagent_scanner = 1
access_atmos = 1
-/obj/item/weapon/cartridge/signal/New()
+/obj/item/weapon/cartridge/signal/initialize()
+ radio = new /obj/item/radio/integrated/signal(src)
+ ..()
+
+/obj/item/weapon/cartridge/signal/Destroy()
+ qdel(radio)
..()
- spawn(5)
- radio = new /obj/item/radio/integrated/signal(src)
-
-
/obj/item/weapon/cartridge/quartermaster
name = "\improper Space Parts & Space Vendors cartridge"
@@ -123,10 +124,9 @@
icon_state = "cart-q"
access_quartermaster = 1
-/obj/item/weapon/cartridge/quartermaster/New()
+/obj/item/weapon/cartridge/quartermaster/initialize()
+ radio = new /obj/item/radio/integrated/mule(src)
..()
- spawn(5)
- radio = new /obj/item/radio/integrated/mule(src)
/obj/item/weapon/cartridge/head
name = "\improper Easy-Record DELUXE"
@@ -141,10 +141,8 @@
access_janitor = 1
access_security = 1
-/obj/item/weapon/cartridge/hop/New()
- ..()
- spawn(5)
- radio = new /obj/item/radio/integrated/mule(src)
+/obj/item/weapon/cartridge/hop/initialize()
+ radio = new /obj/item/radio/integrated/mule(src)
/obj/item/weapon/cartridge/hos
name = "\improper R.O.B.U.S.T. DELUXE"
@@ -152,10 +150,9 @@
access_status_display = 1
access_security = 1
-/obj/item/weapon/cartridge/hos/New()
+/obj/item/weapon/cartridge/hos/initialize()
+ radio = new /obj/item/radio/integrated/beepsky(src)
..()
- spawn(5)
- radio = new /obj/item/radio/integrated/beepsky(src)
/obj/item/weapon/cartridge/ce
name = "\improper Power-On DELUXE"
@@ -178,10 +175,9 @@
access_reagent_scanner = 1
access_atmos = 1
-/obj/item/weapon/cartridge/rd/New()
+/obj/item/weapon/cartridge/rd/initialize()
+ radio = new /obj/item/radio/integrated/signal(src)
..()
- spawn(5)
- radio = new /obj/item/radio/integrated/signal(src)
/obj/item/weapon/cartridge/captain
name = "\improper Value-PAK cartridge"
@@ -331,7 +327,7 @@
beepskyData["botstatus"] = list("loca" = null, "mode" = -1)
var/botsCount=0
if(SC.botlist && SC.botlist.len)
- for(var/obj/machinery/bot/B in SC.botlist)
+ for(var/mob/living/bot/B in SC.botlist)
botsCount++
if(B.loc)
botsData[++botsData.len] = list("Name" = sanitize(B.name), "Location" = sanitize(B.loc.loc.name), "ref" = "\ref[B]")
@@ -465,7 +461,7 @@
BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
var/CbotData[0]
- for(var/obj/machinery/bot/cleanbot/B in world)
+ for(var/mob/living/bot/cleanbot/B in world)
var/turf/bl = get_turf(B)
if(bl)
if(bl.z != cl.z)
diff --git a/code/game/objects/items/devices/PDA/radio.dm b/code/game/objects/items/devices/PDA/radio.dm
index 0c7105118f..c4fb385536 100644
--- a/code/game/objects/items/devices/PDA/radio.dm
+++ b/code/game/objects/items/devices/PDA/radio.dm
@@ -37,7 +37,7 @@
/obj/item/radio/integrated/beepsky
var/list/botlist = null // list of bots
- var/obj/machinery/bot/secbot/active // the active bot; if null, show bot list
+ var/mob/living/bot/secbot/active // the active bot; if null, show bot list
var/list/botstatus // the status signal sent by the bot
var/control_freq = AI_FREQ
@@ -99,6 +99,12 @@
post_signal(control_freq, "command", "summon", "active", active, "target", get_turf(PDA) , s_filter = RADIO_SECBOT)
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_SECBOT)
+
+/obj/item/radio/integrated/beepsky/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, control_freq)
+ ..()
+
/obj/item/radio/integrated/mule
var/list/botlist = null // list of bots
var/obj/machinery/bot/mulebot/active // the active bot; if null, show bot list
@@ -211,12 +217,10 @@
var/last_transmission
var/datum/radio_frequency/radio_connection
- New()
- ..()
- if(radio_controller)
- initialize()
-
initialize()
+ if(!radio_controller)
+ return
+
if (src.frequency < 1441 || src.frequency > 1489)
src.frequency = sanitize_frequency(src.frequency)
@@ -245,3 +249,8 @@
radio_connection.post_signal(src, signal)
return
+
+/obj/item/radio/integrated/signal/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src, frequency)
+ ..()
diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm
index 1982fbb4f4..f7ef8ad5c2 100644
--- a/code/game/objects/items/devices/chameleonproj.dm
+++ b/code/game/objects/items/devices/chameleonproj.dm
@@ -41,25 +41,25 @@
if(active_dummy)
eject_all()
playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)
- del(active_dummy)
+ qdel(active_dummy)
active_dummy = null
usr << "\blue You deactivate the [src]."
- var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
+ var/obj/effect/overlay/T = PoolOrNew(/obj/effect/overlay, get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
- spawn(8) T.delete()
+ spawn(8) qdel(T)
else
playsound(get_turf(src), 'sound/effects/pop.ogg', 100, 1, -6)
var/obj/O = new saved_item(src)
if(!O) return
- var/obj/effect/dummy/chameleon/C = new/obj/effect/dummy/chameleon(usr.loc)
+ var/obj/effect/dummy/chameleon/C = PoolOrNew(/obj/effect/dummy/chameleon, usr.loc)
C.activate(O, usr, saved_icon, saved_icon_state, saved_overlays, src)
- del(O)
+ qdel(O)
usr << "\blue You activate the [src]."
var/obj/effect/overlay/T = new/obj/effect/overlay(get_turf(src))
T.icon = 'icons/effects/effects.dmi'
flick("emppulse",T)
- spawn(8) T.delete()
+ spawn(8) qdel(T)
/obj/item/device/chameleon/proc/disrupt(var/delete_dummy = 1)
if(active_dummy)
@@ -69,7 +69,7 @@
spark_system.start()
eject_all()
if(delete_dummy)
- del(active_dummy)
+ qdel(active_dummy)
active_dummy = null
can_use = 0
spawn(50) can_use = 1
@@ -140,6 +140,6 @@
step(src, direction)
return
-/obj/effect/dummy/chameleon/Del()
+/obj/effect/dummy/chameleon/Destroy()
master.disrupt(0)
..()
diff --git a/code/game/objects/items/devices/debugger.dm b/code/game/objects/items/devices/debugger.dm
index faab1ee054..0e066a4817 100644
--- a/code/game/objects/items/devices/debugger.dm
+++ b/code/game/objects/items/devices/debugger.dm
@@ -17,7 +17,7 @@
throw_speed = 3
desc = "You can use this on airlocks or APCs to try to hack them without cutting wires."
- matter = list("metal" = 50,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20)
origin_tech = "magnets=1;engineering=1"
var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 7013b30419..42a4967bfe 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -103,7 +103,7 @@
animation.master = user
flick("blspell", animation)
sleep(5)
- del(animation)
+ qdel(animation)
if(!flashfail)
flick("flash2", src)
@@ -154,7 +154,7 @@
animation.master = user
flick("blspell", animation)
sleep(5)
- del(animation)
+ qdel(animation)
for(var/mob/living/carbon/M in oviewers(3, null))
if(prob(50))
@@ -194,7 +194,7 @@
desc = "When a problem arises, SCIENCE is the solution."
icon_state = "sflash"
origin_tech = "magnets=2;combat=1"
- var/construction_cost = list("metal"=750,"glass"=750)
+ var/construction_cost = list(DEFAULT_WALL_MATERIAL=750,"glass"=750)
var/construction_time=100
/obj/item/device/flash/synthetic/attack(mob/living/M as mob, mob/user as mob)
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index fb3edec873..29bcbc4332 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -8,7 +8,7 @@
flags = CONDUCT
slot_flags = SLOT_BELT
- matter = list("metal" = 50,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20)
icon_action_button = "action_flashlight"
var/on = 0
@@ -18,24 +18,17 @@
..()
if(on)
icon_state = "[initial(icon_state)]-on"
- SetLuminosity(brightness_on)
+ set_light(brightness_on)
else
icon_state = initial(icon_state)
- SetLuminosity(0)
+ set_light(0)
/obj/item/device/flashlight/proc/update_brightness(var/mob/user = null)
if(on)
icon_state = "[initial(icon_state)]-on"
- if(loc == user)
- user.SetLuminosity(user.luminosity + brightness_on)
- else if(isturf(loc))
- SetLuminosity(brightness_on)
+ set_light(brightness_on)
else
- icon_state = initial(icon_state)
- if(loc == user)
- user.SetLuminosity(user.luminosity - brightness_on)
- else if(isturf(loc))
- SetLuminosity(0)
+ set_light(0)
/obj/item/device/flashlight/attack_self(mob/user)
if(!isturf(user.loc))
@@ -88,19 +81,6 @@
else
return ..()
-
-/obj/item/device/flashlight/pickup(mob/user)
- if(on)
- user.SetLuminosity(user.luminosity + brightness_on)
- SetLuminosity(0)
-
-
-/obj/item/device/flashlight/dropped(mob/user)
- if(on)
- user.SetLuminosity(user.luminosity - brightness_on)
- SetLuminosity(brightness_on)
-
-
/obj/item/device/flashlight/pen
name = "penlight"
desc = "A pen-sized light, used by medical staff."
@@ -139,7 +119,7 @@
icon_state = "lampgreen"
item_state = "lampgreen"
brightness_on = 5
-
+ light_color = "#FFC58F"
/obj/item/device/flashlight/lamp/verb/toggle_light()
set name = "Toggle light"
@@ -156,6 +136,7 @@
desc = "A red Nanotrasen issued flare. There are instructions on the side, it reads 'pull cord, make light'."
w_class = 2.0
brightness_on = 7 // Pretty bright.
+ light_color = "#e58775"
icon_state = "flare"
item_state = "flare"
icon_action_button = null //just pull it manually, neckbeard.
@@ -217,7 +198,7 @@
on = 1 //Bio-luminesence has one setting, on.
/obj/item/device/flashlight/slime/New()
- SetLuminosity(brightness_on)
+ set_light(brightness_on)
spawn(1) //Might be sloppy, but seems to be necessary to prevent further runtimes and make these work as intended... don't judge me!
update_brightness()
icon_state = initial(icon_state)
diff --git a/code/game/objects/items/devices/floor_painter.dm b/code/game/objects/items/devices/floor_painter.dm
index 84c03675b5..a1c21a7b3f 100644
--- a/code/game/objects/items/devices/floor_painter.dm
+++ b/code/game/objects/items/devices/floor_painter.dm
@@ -139,9 +139,9 @@
mode_nice = design
mode = "whitebluegreencorners"
tile_dir_mode = 2
- else if(design == "delivery" || design == "bot")
+ else if(design == "delivery" || design == "bot" || design == "white-delivery" || design == "white-bot")
mode_nice = design
- mode = design
+ mode = replacetext(design, "-", "")
tile_dir_mode = 0
else if(design == "loadingarea")
mode_nice = design
diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm
index 713706475c..e9c3687fe4 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -90,7 +90,7 @@
AddUses(1)
user << "You insert the [L.name] into the [src.name]. You have [uses] lights remaining."
user.drop_item()
- del(L)
+ qdel(L)
return
else
user << "You need a working light."
@@ -140,7 +140,9 @@
var/obj/item/weapon/light/L1 = new target.light_type(target.loc)
L1.status = target.status
L1.rigged = target.rigged
- L1.brightness = target.brightness
+ L1.brightness_range = target.brightness_range
+ L1.brightness_power = target.brightness_power
+ L1.brightness_color = target.brightness_color
L1.switchcount = target.switchcount
target.switchcount = 0
L1.update()
@@ -153,10 +155,12 @@
target.status = L2.status
target.switchcount = L2.switchcount
target.rigged = emagged
- target.brightness = L2.brightness
+ target.brightness_range = L2.brightness_range
+ target.brightness_power = L2.brightness_power
+ target.brightness_color = L2.brightness_color
target.on = target.has_power()
target.update()
- del(L2)
+ qdel(L2)
if(target.on && target.rigged)
target.explode()
diff --git a/code/game/objects/items/devices/modkit.dm b/code/game/objects/items/devices/modkit.dm
index 8788eaf0f2..4207546b03 100644
--- a/code/game/objects/items/devices/modkit.dm
+++ b/code/game/objects/items/devices/modkit.dm
@@ -24,7 +24,7 @@
if(!parts)
user << "This kit has no parts for this modification left."
user.drop_from_inventory(src)
- del(src)
+ qdel(src)
return
var/allowed = 0
@@ -60,7 +60,7 @@
if(!parts)
user.drop_from_inventory(src)
- del(src)
+ qdel(src)
/obj/item/device/modkit/examine(mob/user)
..(user)
diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm
index a31a866bc7..b876fbd27a 100644
--- a/code/game/objects/items/devices/multitool.dm
+++ b/code/game/objects/items/devices/multitool.dm
@@ -16,7 +16,7 @@
throw_speed = 3
desc = "You can use this on airlocks or APCs to try to hack them without cutting wires."
- matter = list("metal" = 50,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 50,"glass" = 20)
origin_tech = "magnets=1;engineering=1"
var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage
diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm
index 2cc9d55b6a..eed6cdb12e 100644
--- a/code/game/objects/items/devices/paicard.dm
+++ b/code/game/objects/items/devices/paicard.dm
@@ -21,7 +21,7 @@
..()
overlays += "pai-off"
-/obj/item/device/paicard/Del()
+/obj/item/device/paicard/Destroy()
//Will stop people throwing friend pAIs into the singularity so they can respawn
if(!isnull(pai))
pai.death(0)
@@ -296,6 +296,12 @@
if(7) src.overlays += "pai-sad"
if(8) src.overlays += "pai-angry"
if(9) src.overlays += "pai-what"
+ if(10) src.overlays += "pai-neutral"
+ if(11) src.overlays += "pai-silly"
+ if(12) src.overlays += "pai-nose"
+ if(13) src.overlays += "pai-smirk"
+ if(14) src.overlays += "pai-exclamation"
+ if(15) src.overlays += "pai-question"
current_emotion = emotion
/obj/item/device/paicard/proc/alertUpdate()
@@ -311,7 +317,7 @@
if(pai)
pai.ex_act(severity)
else
- del(src)
+ qdel(src)
/obj/item/device/paicard/see_emote(mob/living/M, text)
if(pai && pai.client)
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index 8b2469d2dd..21d0474a68 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -11,111 +11,117 @@
throw_speed = 1
throw_range = 2
- matter = list("metal" = 750,"waste" = 750)
+ matter = list(DEFAULT_WALL_MATERIAL = 750,"waste" = 750)
origin_tech = "powerstorage=3;syndicate=5"
- var/drain_rate = 1000000 // amount of power to drain per tick
- var/dissipation_rate = 20000
- var/power_drained = 0 // has drained this much power
- var/max_power = 5e9 // maximum power that can be drained before exploding
- var/mode = 0 // 0 = off, 1=clamped (off), 2=operating
-
+ var/drain_rate = 1500000 // amount of power to drain per tick
+ var/apc_drain_rate = 5000 // Max. amount drained from single APC. In Watts.
+ var/dissipation_rate = 20000 // Passive dissipation of drained power. In Watts.
+ var/power_drained = 0 // Amount of power drained.
+ var/max_power = 5e9 // Detonation point.
+ var/mode = 0 // 0 = off, 1=clamped (off), 2=operating
+ var/drained_this_tick = 0 // This is unfortunately necessary to ensure we process powersinks BEFORE other machinery such as APCs.
+ var/datum/powernet/PN // Our powernet
var/obj/structure/cable/attached // the attached cable
- attackby(var/obj/item/I, var/mob/user)
- if(istype(I, /obj/item/weapon/screwdriver))
- if(mode == 0)
- var/turf/T = loc
- if(isturf(T) && !T.intact)
- attached = locate() in T
- if(!attached)
- user << "No exposed cable here to attach to."
- return
- else
- anchored = 1
- mode = 1
- user << "You attach the device to the cable."
- for(var/mob/M in viewers(user))
- if(M == user) continue
- M << "[user] attaches the power sink to the cable."
- return
+/obj/item/device/powersink/Destroy()
+ processing_objects.Remove(src)
+ ..()
+
+/obj/item/device/powersink/attackby(var/obj/item/I, var/mob/user)
+ if(istype(I, /obj/item/weapon/screwdriver))
+ if(mode == 0)
+ var/turf/T = loc
+ if(isturf(T) && !T.intact)
+ attached = locate() in T
+ if(!attached)
+ user << "No exposed cable here to attach to."
+ return
else
- user << "Device must be placed over an exposed cable to attach to it."
+ anchored = 1
+ mode = 1
+ src.visible_message("[user] attaches [src] to the cable!")
return
else
- if (mode == 2)
- processing_objects.Remove(src) // Now the power sink actually stops draining the station's power if you unhook it. --NeoFite
- anchored = 0
- mode = 0
- user << "You detach the device from the cable."
- for(var/mob/M in viewers(user))
- if(M == user) continue
- M << "[user] detaches the power sink from the cable."
- SetLuminosity(0)
- icon_state = "powersink0"
-
+ user << "Device must be placed over an exposed cable to attach to it."
return
else
- ..()
+ if (mode == 2)
+ processing_objects.Remove(src) // Now the power sink actually stops draining the station's power if you unhook it. --NeoFite
+ anchored = 0
+ mode = 0
+ src.visible_message("[user] detaches [src] from the cable!")
+ set_light(0)
+ icon_state = "powersink0"
- attack_ai()
+ return
+ else
+ ..()
+
+/obj/item/device/powersink/attack_ai()
+ return
+
+/obj/item/device/powersink/attack_hand(var/mob/user)
+ switch(mode)
+ if(0)
+ ..()
+ if(1)
+ src.visible_message("[user] activates [src]!")
+ mode = 2
+ icon_state = "powersink1"
+ processing_objects.Add(src)
+ if(2) //This switch option wasn't originally included. It exists now. --NeoFite
+ src.visible_message("[user] deactivates [src]!")
+ mode = 1
+ set_light(0)
+ icon_state = "powersink0"
+ processing_objects.Remove(src)
+
+/obj/item/device/powersink/proc/drain()
+ if(!attached)
return
- attack_hand(var/mob/user)
- switch(mode)
- if(0)
- ..()
+ if(drained_this_tick)
+ return
+ drained_this_tick = 1
- if(1)
- user << "You activate the device!"
- for(var/mob/M in viewers(user))
- if(M == user) continue
- M << "[user] activates the power sink!"
- mode = 2
- icon_state = "powersink1"
- processing_objects.Add(src)
+ var/drained = 0
- if(2) //This switch option wasn't originally included. It exists now. --NeoFite
- user << "You deactivate the device!"
- for(var/mob/M in viewers(user))
- if(M == user) continue
- M << "[user] deactivates the power sink!"
- mode = 1
- SetLuminosity(0)
- icon_state = "powersink0"
- processing_objects.Remove(src)
+ if(!PN)
+ return
- process()
- power_drained -= min(dissipation_rate, power_drained)
- if(attached)
- var/datum/powernet/PN = attached.get_powernet()
- if(PN)
- SetLuminosity(12)
- PN.trigger_warning()
- // found a powernet, so drain up to max power from it
- var/drained = PN.draw_power(drain_rate)
-
- // if tried to drain more than available on powernet
- // now look for APCs and drain their cells
- if(drained < drain_rate)
- for(var/obj/machinery/power/terminal/T in PN.nodes)
- // Enough power drained this tick, no need to torture more APCs
- if(drained >= drain_rate)
- break
- if(istype(T.master, /obj/machinery/power/apc))
- var/obj/machinery/power/apc/A = T.master
- if(A.operating && A.cell)
- var/cur_charge = A.cell.charge / CELLRATE
- var/drain_val = min(2000, cur_charge)
-
- A.cell.use(drain_val * CELLRATE)
- drained += drain_val
+ set_light(12)
+ PN.trigger_warning()
+ // found a powernet, so drain up to max power from it
+ drained = PN.draw_power(drain_rate)
+ // if tried to drain more than available on powernet
+ // now look for APCs and drain their cells
+ if(drained < drain_rate)
+ for(var/obj/machinery/power/terminal/T in PN.nodes)
+ // Enough power drained this tick, no need to torture more APCs
+ if(drained >= drain_rate)
+ break
+ if(istype(T.master, /obj/machinery/power/apc))
+ var/obj/machinery/power/apc/A = T.master
+ if(A.operating && A.cell)
+ var/cur_charge = A.cell.charge / CELLRATE
+ var/drain_val = min(apc_drain_rate, cur_charge)
+ A.cell.use(drain_val * CELLRATE)
+ drained += drain_val
+ power_drained += drained
- if(power_drained > max_power * 0.95)
- playsound(src, 'sound/effects/screech.ogg', 100, 1, 1)
- if(power_drained >= max_power)
- processing_objects.Remove(src)
- explosion(src.loc, 3,6,9,12)
- del(src)
+/obj/item/device/powersink/process()
+ drained_this_tick = 0
+ power_drained -= min(dissipation_rate, power_drained)
+ if(power_drained > max_power * 0.95)
+ playsound(src, 'sound/effects/screech.ogg', 100, 1, 1)
+ if(power_drained >= max_power)
+ explosion(src.loc, 3,6,9,12)
+ qdel(src)
+ return
+ if(attached && attached.powernet)
+ PN = attached.powernet
+ else
+ PN = null
diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm
index ef332fa336..32807250d7 100644
--- a/code/game/objects/items/devices/radio/beacon.dm
+++ b/code/game/objects/items/devices/radio/beacon.dm
@@ -30,7 +30,7 @@
/obj/item/device/radio/beacon/bacon //Probably a better way of doing this, I'm lazy.
proc/digest_delay()
spawn(600)
- del(src)
+ qdel(src)
// SINGULO BEACON SPAWNER
@@ -45,5 +45,5 @@
user << "\blue Locked In"
new /obj/machinery/power/singularity_beacon/syndicate( user.loc )
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
- del(src)
+ qdel(src)
return
diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm
index e7f9ec3b9f..e5e94fc93d 100644
--- a/code/game/objects/items/devices/radio/electropack.dm
+++ b/code/game/objects/items/devices/radio/electropack.dm
@@ -8,7 +8,7 @@
slot_flags = SLOT_BACK
w_class = 5.0
- matter = list("metal" = 10000,"glass" = 2500)
+ matter = list(DEFAULT_WALL_MATERIAL = 10000,"glass" = 2500)
var/code = 2
diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm
index bfc9e8f69b..85f4ed4b89 100644
--- a/code/game/objects/items/devices/radio/headset.dm
+++ b/code/game/objects/items/devices/radio/headset.dm
@@ -4,7 +4,7 @@
var/radio_desc = ""
icon_state = "headset"
item_state = "headset"
- matter = list("metal" = 75)
+ matter = list(DEFAULT_WALL_MATERIAL = 75)
subspace_transmission = 1
canhear_range = 0 // can't hear headsets from very far away
@@ -26,6 +26,13 @@
keyslot2 = new ks2type(src)
recalculateChannels(1)
+/obj/item/device/radio/headset/Destroy()
+ qdel(keyslot1)
+ qdel(keyslot2)
+ keyslot1 = null
+ keyslot2 = null
+ ..()
+
/obj/item/device/radio/headset/examine(mob/user)
if(!(..(user, 1) && radio_desc))
return
diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm
index 567dc49bf4..522bef89a6 100644
--- a/code/game/objects/items/devices/radio/intercom.dm
+++ b/code/game/objects/items/devices/radio/intercom.dm
@@ -15,7 +15,7 @@
..()
processing_objects += src
-/obj/item/device/radio/intercom/Del()
+/obj/item/device/radio/intercom/Destroy()
processing_objects -= src
..()
@@ -58,10 +58,10 @@
on = 0
else
var/area/A = src.loc.loc
- if(!A || !isarea(A) || !A.master)
+ if(!A || !isarea(A))
on = 0
else
- on = A.master.powered(EQUIP) // set "on" to the power status
+ on = A.powered(EQUIP) // set "on" to the power status
if(!on)
icon_state = "intercom-p"
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index dab778dcb9..2018aa7919 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -26,7 +26,7 @@
throw_range = 9
w_class = 2
- matter = list("glass" = 25,"metal" = 75)
+ matter = list("glass" = 25,DEFAULT_WALL_MATERIAL = 75)
var/const/FREQ_LISTENING = 1
@@ -42,8 +42,15 @@
/obj/item/device/radio/New()
..()
wires = new(src)
+
+/obj/item/device/radio/Destroy()
+ qdel(wires)
+ wires = null
if(radio_controller)
- initialize()
+ radio_controller.remove_object(src, frequency)
+ for (var/ch_name in channels)
+ radio_controller.remove_object(src, radiochannels[ch_name])
+ ..()
/obj/item/device/radio/initialize()
@@ -172,7 +179,7 @@
0, "*garbled automated announcement*", src,
message, from, "Automated Announcement", from, "synthesized voice",
4, 0, list(0), connection.frequency, "states")
- del(A)
+ qdel(A)
return
// Interprets the message mode when talking into a radio, possibly returning a connection datum
@@ -625,7 +632,6 @@
onclose(user, "radio")
return
-
/obj/item/device/radio/proc/config(op)
if(radio_controller)
for (var/ch_name in channels)
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 1a646d3fe1..f42a3995dc 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -16,7 +16,7 @@ REAGENT SCANNER
w_class = 2
item_state = "electronic"
- matter = list("metal" = 150)
+ matter = list(DEFAULT_WALL_MATERIAL = 150)
origin_tech = "magnets=1;engineering=1"
@@ -73,7 +73,7 @@ REAGENT SCANNER
w_class = 2.0
throw_speed = 5
throw_range = 10
- matter = list("metal" = 200)
+ matter = list(DEFAULT_WALL_MATERIAL = 200)
origin_tech = "magnets=1;biotech=1"
var/mode = 1;
@@ -238,7 +238,7 @@ REAGENT SCANNER
throw_speed = 4
throw_range = 20
- matter = list("metal" = 30,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 20)
origin_tech = "magnets=1;engineering=1"
@@ -285,7 +285,7 @@ REAGENT SCANNER
throw_speed = 4
throw_range = 20
- matter = list("metal" = 30,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 20)
origin_tech = "magnets=2;biotech=2"
var/details = 0
@@ -358,7 +358,7 @@ REAGENT SCANNER
throwforce = 5
throw_speed = 4
throw_range = 20
- matter = list("metal" = 30,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 20)
origin_tech = "magnets=2;biotech=2"
var/details = 0
@@ -417,7 +417,7 @@ REAGENT SCANNER
throwforce = 0
throw_speed = 3
throw_range = 7
- matter = list("metal" = 30,"glass" = 20)
+ matter = list(DEFAULT_WALL_MATERIAL = 30,"glass" = 20)
/obj/item/device/slime_scanner/attack(mob/living/M as mob, mob/living/user as mob)
if (!isslime(M))
diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm
index 1e9405cbeb..35d04e4d08 100644
--- a/code/game/objects/items/devices/taperecorder.dm
+++ b/code/game/objects/items/devices/taperecorder.dm
@@ -5,7 +5,7 @@
item_state = "analyzer"
w_class = 2.0
- matter = list("metal" = 60,"glass" = 30)
+ matter = list(DEFAULT_WALL_MATERIAL = 60,"glass" = 30)
var/emagged = 0.0
var/recording = 0.0
@@ -48,7 +48,7 @@
if(T)
T.hotspot_expose(700,125)
explosion(T, -1, -1, 0, 4)
- del(src)
+ qdel(src)
return
/obj/item/device/taperecorder/verb/record()
diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm
index 57b569c599..96874bd946 100644
--- a/code/game/objects/items/devices/uplinks.dm
+++ b/code/game/objects/items/devices/uplinks.dm
@@ -64,7 +64,7 @@ datum/nano_item_lists
world_uplinks += src
-/obj/item/device/uplink/Del()
+/obj/item/device/uplink/Destroy()
world_uplinks -= src
..()
@@ -180,7 +180,7 @@ datum/nano_item_lists
/obj/item/device/uplink/hidden/New()
spawn(2)
if(!istype(src.loc, /obj/item))
- del(src)
+ qdel(src)
..()
// Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated.
diff --git a/code/game/objects/items/latexballoon.dm b/code/game/objects/items/latexballoon.dm
index e341a8747f..a37352c7d3 100644
--- a/code/game/objects/items/latexballoon.dm
+++ b/code/game/objects/items/latexballoon.dm
@@ -30,10 +30,10 @@
burst()
switch(severity)
if (1)
- del(src)
+ qdel(src)
if (2)
if (prob(50))
- del(src)
+ qdel(src)
/obj/item/latexballon/bullet_act()
burst()
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index da508a8a31..e1ebc9fdc1 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -6,7 +6,7 @@
flags = CONDUCT
slot_flags = SLOT_BELT
var/construction_time = 100
- var/list/construction_cost = list("metal"=20000,"glass"=5000)
+ var/list/construction_cost = list(DEFAULT_WALL_MATERIAL=20000,"glass"=5000)
var/list/part = null // Order of args is important for installing robolimbs.
var/sabotaged = 0 //Emagging limbs can have repercussions when installed as prosthetics.
var/model_info
@@ -33,7 +33,7 @@
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "l_arm"
construction_time = 200
- construction_cost = list("metal"=18000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=18000)
part = list("l_arm","l_hand")
model_info = 1
@@ -42,7 +42,7 @@
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "r_arm"
construction_time = 200
- construction_cost = list("metal"=18000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=18000)
part = list("r_arm","r_hand")
model_info = 1
@@ -51,7 +51,7 @@
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "l_leg"
construction_time = 200
- construction_cost = list("metal"=15000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=15000)
part = list("l_leg","l_foot")
model_info = 1
@@ -60,7 +60,7 @@
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
icon_state = "r_leg"
construction_time = 200
- construction_cost = list("metal"=15000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=15000)
part = list("r_leg","r_foot")
model_info = 1
@@ -69,7 +69,7 @@
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
icon_state = "chest"
construction_time = 350
- construction_cost = list("metal"=40000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=40000)
var/wires = 0.0
var/obj/item/weapon/cell/cell = null
@@ -78,7 +78,7 @@
desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals."
icon_state = "head"
construction_time = 350
- construction_cost = list("metal"=25000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=25000)
var/obj/item/device/flash/flash1 = null
var/obj/item/device/flash/flash2 = null
@@ -87,7 +87,7 @@
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
icon_state = "robo_suit"
construction_time = 500
- construction_cost = list("metal"=50000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=50000)
var/obj/item/robot_parts/l_arm/l_arm = null
var/obj/item/robot_parts/r_arm/r_arm = null
var/obj/item/robot_parts/l_leg/l_leg = null
@@ -134,7 +134,7 @@
if (user.get_inactive_hand()==src)
user.remove_from_mob(src)
user.put_in_inactive_hand(B)
- del(src)
+ qdel(src)
else
user << "You need one sheet of metal to arm the robot frame."
if(istype(W, /obj/item/robot_parts/l_leg))
@@ -250,7 +250,7 @@
callHook("borgify", list(O))
O.Namepick()
- del(src)
+ qdel(src)
else
user << "\blue The MMI must go in after everything else!"
@@ -303,8 +303,8 @@
user << "\blue You install some manipulators and modify the head, creating a functional spider-bot!"
new /mob/living/simple_animal/spiderbot(get_turf(loc))
user.drop_item()
- del(W)
- del(src)
+ qdel(W)
+ qdel(src)
return
return
diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm
index 43b852e249..10fb1dc6fd 100644
--- a/code/game/objects/items/robot/robot_upgrades.dm
+++ b/code/game/objects/items/robot/robot_upgrades.dm
@@ -7,7 +7,7 @@
icon = 'icons/obj/module.dmi'
icon_state = "cyborg_upgrade"
var/construction_time = 120
- var/construction_cost = list("metal"=10000)
+ var/construction_cost = list(DEFAULT_WALL_MATERIAL=10000)
var/locked = 0
var/require_module = 0
var/installed = 0
@@ -28,20 +28,14 @@
/obj/item/borg/upgrade/reset/action(var/mob/living/silicon/robot/R)
if(..()) return 0
R.uneq_all()
- R.hands.icon_state = "nomod"
- R.icon_state = "robot"
- //world << R.custom_sprite
- if(R.custom_sprite == 1)
- //world << R.icon_state
- icon = 'icons/mob/custom-synthetic.dmi'
- R.icon_state = "[R.ckey]-Standard"
- del(R.module)
+ R.modtype = initial(R.modtype)
+ R.hands.icon_state = initial(R.hands.icon_state)
+
+ R.choose_icon(1, R.set_module_sprites(list("Default" = "robot")))
+
R.notify_ai(ROBOT_NOTIFICATION_MODULE_RESET, R.module.name)
- R.module = null
- R.camera.remove_networks(list("Engineering","Medical","MINE"))
+ R.module.Reset(R)
R.updatename("Default")
- R.status_flags |= CANPUSH
- R.updateicon()
return 1
@@ -49,7 +43,7 @@
name = "robot reclassification board"
desc = "Used to rename a cyborg."
icon_state = "cyborg_upgrade1"
- construction_cost = list("metal"=35000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=35000)
var/heldname = "default name"
/obj/item/borg/upgrade/rename/attack_self(mob/user as mob)
@@ -67,7 +61,7 @@
/obj/item/borg/upgrade/restart
name = "robot emergency restart module"
desc = "Used to force a restart of a disabled-but-repaired robot, bringing it back online."
- construction_cost = list("metal"=60000 , "glass"=5000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=60000 , "glass"=5000)
icon_state = "cyborg_upgrade1"
@@ -91,7 +85,7 @@
/obj/item/borg/upgrade/vtec
name = "robotic VTEC Module"
desc = "Used to kick in a robot's VTEC systems, increasing their speed."
- construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 5000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=80000 , "glass"=6000 , "gold"= 5000)
icon_state = "cyborg_upgrade2"
require_module = 1
@@ -108,7 +102,7 @@
/obj/item/borg/upgrade/tasercooler
name = "robotic Rapid Taser Cooling Module"
desc = "Used to cool a mounted taser, increasing the potential current in it and thus its recharge rate."
- construction_cost = list("metal"=80000 , "glass"=6000 , "gold"= 2000, "diamond" = 500)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=80000 , "glass"=6000 , "gold"= 2000, "diamond" = 500)
icon_state = "cyborg_upgrade3"
require_module = 1
@@ -116,7 +110,7 @@
/obj/item/borg/upgrade/tasercooler/action(var/mob/living/silicon/robot/R)
if(..()) return 0
- if(!istype(R.module, /obj/item/weapon/robot_module/security))
+ if(!R.module || !(src in R.module.supported_upgrades))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
@@ -143,14 +137,14 @@
/obj/item/borg/upgrade/jetpack
name = "mining robot jetpack"
desc = "A carbon dioxide jetpack suitable for low-gravity mining operations."
- construction_cost = list("metal"=10000,"phoron"=15000,"uranium" = 20000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000,"phoron"=15000,"uranium" = 20000)
icon_state = "cyborg_upgrade3"
require_module = 1
/obj/item/borg/upgrade/jetpack/action(var/mob/living/silicon/robot/R)
if(..()) return 0
- if(!istype(R.module, /obj/item/weapon/robot_module/miner))
+ if(!R.module || !(src in R.module.supported_upgrades))
R << "Upgrade mounting error! No suitable hardpoint detected!"
usr << "There's no mounting point for the module!"
return 0
@@ -165,7 +159,7 @@
/obj/item/borg/upgrade/syndicate/
name = "illegal equipment module"
desc = "Unlocks the hidden, deadlier functions of a robot"
- construction_cost = list("metal"=10000,"glass"=15000,"diamond" = 10000)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=10000,"glass"=15000,"diamond" = 10000)
icon_state = "cyborg_upgrade3"
require_module = 1
diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm
index 1d92cb9a81..2893b4f3a1 100644
--- a/code/game/objects/items/shooting_range.dm
+++ b/code/game/objects/items/shooting_range.dm
@@ -9,7 +9,7 @@
var/icon/virtualIcon
var/list/bulletholes = list()
- Del()
+ Destroy()
// if a target is deleted and associated with a stake, force stake to forget
for(var/obj/structure/target_stake/T in view(3,src))
if(T.pinned_target == src)
@@ -97,7 +97,7 @@
for(var/mob/O in oviewers())
if ((O.client && !( O.blinded )))
O << "\red [src] breaks into tiny pieces and collapses!"
- del(src)
+ qdel(src)
// Create a temporary object to represent the damage
var/obj/bmark = new
diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 143539968e..e3bbce8386 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -9,7 +9,7 @@
throwforce = 15.0
throw_speed = 5
throw_range = 20
- matter = list("metal" = 1875)
+ matter = list(DEFAULT_WALL_MATERIAL = 1875)
max_amount = 60
attack_verb = list("hit", "bludgeoned", "whacked")
diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index ec0ece216e..a4d9e631e8 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -144,7 +144,7 @@
singular_name = "reinforced glass sheet"
icon_state = "sheet-rglass"
- matter = list("metal" = 1875,"glass" = 3750)
+ matter = list(DEFAULT_WALL_MATERIAL = 1875,"glass" = 3750)
origin_tech = "materials=2"
created_window = /obj/structure/window/reinforced
@@ -200,7 +200,7 @@
desc = "Phoron glass which has been reinforced with metal rods."
singular_name = "reinforced phoron glass sheet"
icon_state = "sheet-phoronrglass"
- matter = list("glass" = 7500,"metal" = 1875)
+ matter = list("glass" = 7500,DEFAULT_WALL_MATERIAL = 1875)
origin_tech = "materials=4;phorontech=2"
created_window = /obj/structure/window/phoronreinforced
diff --git a/code/game/objects/items/stacks/sheets/light.dm b/code/game/objects/items/stacks/sheets/light.dm
index de96eda5f4..f43d7ae320 100644
--- a/code/game/objects/items/stacks/sheets/light.dm
+++ b/code/game/objects/items/stacks/sheets/light.dm
@@ -20,7 +20,7 @@
new/obj/item/stack/sheet/glass(user.loc)
if(amount <= 0)
user.drop_from_inventory(src)
- del(src)
+ qdel(src)
if(istype(O,/obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = O
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index 4be7f6e7f7..1fefeca1ab 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -69,29 +69,30 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
), 4), \
null, \
new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade), \
- new/datum/stack_recipe("light fixture frame", /obj/item/light_fixture_frame, 2), \
- new/datum/stack_recipe("small light fixture frame", /obj/item/light_fixture_frame/small, 1), \
+ new/datum/stack_recipe("light fixture frame", /obj/item/frame/light, 2), \
+ new/datum/stack_recipe("small light fixture frame", /obj/item/frame/light/small, 1), \
null, \
new/datum/stack_recipe("apc frame", /obj/item/apc_frame, 2), \
- new/datum/stack_recipe("air alarm frame", /obj/item/alarm_frame, 2), \
- new/datum/stack_recipe("fire alarm frame", /obj/item/firealarm_frame, 2), \
+ new/datum/stack_recipe("air alarm frame", /obj/item/frame/air_alarm, 2), \
+ new/datum/stack_recipe("fire alarm frame", /obj/item/frame/fire_alarm, 2), \
null, \
new/datum/stack_recipe("knife blade", /obj/item/butterflyblade, 6, time = 20, one_per_turf = 0, on_floor = 1) \
)
/obj/item/stack/sheet/metal
- name = "metal"
- desc = "Sheets made out off metal. It has been dubbed Metal Sheets."
+ name = DEFAULT_WALL_MATERIAL
+ desc = "Sheets made out off steel."
singular_name = "metal sheet"
icon_state = "sheet-metal"
- matter = list("metal" = 3750)
+ matter = list(DEFAULT_WALL_MATERIAL = 3750)
throwforce = 14.0
flags = CONDUCT
origin_tech = "materials=1"
+ sheettype = DEFAULT_WALL_MATERIAL
/obj/item/stack/sheet/metal/cyborg
- name = "metal synthesizer"
- desc = "A device that makes metal sheets."
+ name = "steel synthesizer"
+ desc = "A device that makes steel sheets."
gender = NEUTER
matter = null
uses_charge = 1
@@ -109,21 +110,22 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \
var/global/list/datum/stack_recipe/plasteel_recipes = list ( \
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = 1), \
new/datum/stack_recipe("Metal crate", /obj/structure/closet/crate, 10, time = 50, one_per_turf = 1), \
- new/datum/stack_recipe("RUST fuel assembly port frame", /obj/item/rust_fuel_assembly_port_frame, 12, time = 50, one_per_turf = 1), \
- new/datum/stack_recipe("RUST fuel compressor frame", /obj/item/rust_fuel_compressor_frame, 12, time = 50, one_per_turf = 1), \
+ new/datum/stack_recipe("RUST fuel assembly port frame", /obj/item/frame/rust/assembly, 12, time = 50, one_per_turf = 1), \
+ new/datum/stack_recipe("RUST fuel compressor frame", /obj/item/frame/rust, 12, time = 50, one_per_turf = 1), \
new/datum/stack_recipe("knife grip", /obj/item/butterflyhandle, 4, time = 20, one_per_turf = 0, on_floor = 1),
)
/obj/item/stack/sheet/plasteel
name = "plasteel"
singular_name = "plasteel sheet"
- desc = "This sheet is an alloy of iron and phoron."
+ desc = "This sheet is an alloy of iron and platinum."
icon_state = "sheet-plasteel"
item_state = "sheet-metal"
- matter = list("metal" = 7500)
+ matter = list(DEFAULT_WALL_MATERIAL = 7500)
throwforce = 15.0
flags = CONDUCT
origin_tech = "materials=2"
+ sheettype = "plasteel"
/obj/item/stack/sheet/plasteel/cyborg
name = "plasteel synthesizer"
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index a4e7d94fad..a34e39ab9a 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -29,12 +29,12 @@
src.amount = amount
return
-/obj/item/stack/Del()
+/obj/item/stack/Destroy()
if(uses_charge)
- return
+ return 1
if (src && usr && usr.machine == src)
usr << browse(null, "window=stack")
- ..()
+ return ..()
/obj/item/stack/examine(mob/user)
if(..(user, 1))
@@ -139,7 +139,7 @@
if (istype(O, /obj/item/weapon/storage)) //BubbleWrap - so newly formed boxes are empty
for (var/obj/item/I in O)
- del(I)
+ qdel(I)
/obj/item/stack/Topic(href, href_list)
..()
@@ -150,7 +150,7 @@
list_recipes(usr, text2num(href_list["sublist"]))
if (href_list["make"])
- if (src.get_amount() < 1) del(src) //Never should happen
+ if (src.get_amount() < 1) qdel(src) //Never should happen
var/list/recipes_list = recipes
if (href_list["sublist"])
@@ -187,7 +187,7 @@
if (amount <= 0) //check again in case someone transferred stuff to us
if(usr)
usr.remove_from_mob(src)
- del(src)
+ qdel(src)
return 1
else
if(get_amount() < used)
diff --git a/code/game/objects/items/stacks/tiles/light.dm b/code/game/objects/items/stacks/tiles/light.dm
index 3a14ff1e56..dc57abc513 100644
--- a/code/game/objects/items/stacks/tiles/light.dm
+++ b/code/game/objects/items/stacks/tiles/light.dm
@@ -33,4 +33,4 @@
new/obj/item/stack/light_w(user.loc)
if(amount <= 0)
user.drop_from_inventory(src)
- del(src)
+ qdel(src)
diff --git a/code/game/objects/items/stacks/tiles/plasteel.dm b/code/game/objects/items/stacks/tiles/plasteel.dm
index 3215d0efaf..86af65a2fa 100644
--- a/code/game/objects/items/stacks/tiles/plasteel.dm
+++ b/code/game/objects/items/stacks/tiles/plasteel.dm
@@ -4,7 +4,7 @@
desc = "Those could work as a pretty decent throwing weapon"
icon_state = "tile"
force = 6.0
- matter = list("metal" = 937.5)
+ matter = list(DEFAULT_WALL_MATERIAL = 937.5)
throwforce = 15.0
throw_speed = 5
throw_range = 20
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index ddf9cc52c4..5f5fbff188 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -8,7 +8,6 @@
* Toy swords
* Toy bosun's whistle
* Toy mechs
- * Crayons
* Snap pops
* Water flower
* Therapy dolls
@@ -63,7 +62,7 @@
if(O.reagents.has_reagent("pacid", 1))
user << "The acid chews through the balloon!"
O.reagents.reaction(user)
- del(src)
+ qdel(src)
else
src.desc = "A translucent balloon with some form of liquid sloshing around in it."
user << "\blue You fill the balloon with the contents of [O]."
@@ -80,7 +79,7 @@
src.icon_state = "burst"
spawn(5)
if(src)
- del(src)
+ qdel(src)
return
/obj/item/toy/balloon/update_icon()
@@ -147,7 +146,7 @@
slot_flags = SLOT_BELT|SLOT_HOLSTER
w_class = 3.0
- matter = list("glass" = 10,"metal" = 10)
+ matter = list("glass" = 10,DEFAULT_WALL_MATERIAL = 10)
attack_verb = list("struck", "pistol whipped", "hit", "bashed")
var/bullets = 7.0
@@ -202,7 +201,7 @@
flags = CONDUCT
w_class = 1.0
- matter = list("metal" = 10,"glass" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 10,"glass" = 10)
var/amount_left = 7.0
@@ -233,7 +232,7 @@
if(istype(I, /obj/item/toy/ammo/crossbow))
if(bullets <= 4)
user.drop_item()
- del(I)
+ qdel(I)
bullets++
user << "\blue You load the foam dart into the crossbow."
else
@@ -265,21 +264,21 @@
for(var/mob/O in viewers(world.view, D))
O.show_message(text("\red [] was hit by the foam dart!", M), 1)
new /obj/item/toy/ammo/crossbow(M.loc)
- del(D)
+ qdel(D)
return
for(var/atom/A in D.loc)
if(A == user) continue
if(A.density)
new /obj/item/toy/ammo/crossbow(A.loc)
- del(D)
+ qdel(D)
sleep(1)
spawn(10)
if(D)
new /obj/item/toy/ammo/crossbow(D.loc)
- del(D)
+ qdel(D)
return
else if (bullets == 0)
@@ -375,31 +374,6 @@
w_class = 3
attack_verb = list("attacked", "slashed", "stabbed", "sliced")
-/*
- * Crayons
- */
-
-/obj/item/toy/crayon
- name = "crayon"
- desc = "A colourful crayon. Please refrain from eating it or putting it in your nose."
- icon = 'icons/obj/crayons.dmi'
- icon_state = "crayonred"
- w_class = 1.0
- attack_verb = list("attacked", "coloured")
- var/colour = "#FF0000" //RGB
- var/shadeColour = "#220000" //RGB
- var/uses = 30 //0 for unlimited uses
- var/instant = 0
- var/colourName = "red" //for updateIcon purposes
-
- suicide_act(mob/user)
- viewers(user) << "\red [user] is jamming the [src.name] up \his nose and into \his brain. It looks like \he's trying to commit suicide."
- return (BRUTELOSS|OXYLOSS)
-
- New()
- name = "[colourName] crayon"
- ..()
-
/*
* Snap pops
*/
@@ -418,7 +392,7 @@
new /obj/effect/decal/cleanable/ash(src.loc)
src.visible_message("\red The [src.name] explodes!","\red You hear a snap!")
playsound(src, 'sound/effects/snap.ogg', 50, 1)
- del(src)
+ qdel(src)
/obj/item/toy/snappop/Crossed(H as mob|obj)
if((ishuman(H))) //i guess carp and shit shouldn't set them off
@@ -432,7 +406,7 @@
new /obj/effect/decal/cleanable/ash(src.loc)
src.visible_message("\red The [src.name] explodes!","\red You hear a snap!")
playsound(src, 'sound/effects/snap.ogg', 50, 1)
- del(src)
+ qdel(src)
/*
* Water flower
@@ -494,7 +468,7 @@
if(ismob(T) && T:client)
T:client << "\red [user] has sprayed you with water!"
sleep(4)
- del(D)
+ qdel(D)
return
diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm
index 37dcbf9f4e..da169c6dfc 100644
--- a/code/game/objects/items/weapons/RCD.dm
+++ b/code/game/objects/items/weapons/RCD.dm
@@ -13,7 +13,7 @@
throw_speed = 1
throw_range = 5
w_class = 3.0
- matter = list("metal" = 50000)
+ matter = list(DEFAULT_WALL_MATERIAL = 50000)
origin_tech = "engineering=4;materials=2"
var/datum/effect/effect/system/spark_spread/spark_system
var/stored_matter = 0
@@ -40,6 +40,11 @@
spark_system.set_up(5, 0, src)
spark_system.attach(src)
+/obj/item/weapon/rcd/Destroy()
+ qdel(spark_system)
+ spark_system = null
+ return ..()
+
/obj/item/weapon/rcd/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/rcd_ammo))
@@ -47,7 +52,7 @@
user << "The RCD can't hold any more matter-units."
return
user.drop_from_inventory(W)
- del(W)
+ qdel(W)
stored_matter += 10
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
user << "The RCD now holds [stored_matter]/30 matter-units."
@@ -100,9 +105,10 @@
build_type = "floor"
build_turf = /turf/simulated/floor/plating/airless
else if(deconstruct && istype(T,/turf/simulated/wall))
+ var/turf/simulated/wall/W = T
build_delay = deconstruct ? 50 : 40
build_cost = 5
- build_type = (!canRwall && istype(T,/turf/simulated/wall/r_wall)) ? null : "wall"
+ build_type = (!canRwall && W.reinf_material) ? null : "wall"
build_turf = /turf/simulated/floor
else if(istype(T,/turf/simulated/floor))
build_delay = deconstruct ? 50 : 20
@@ -138,7 +144,7 @@
else if(build_other)
new build_other(T)
else
- del(T)
+ qdel(T)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
return 1
@@ -153,7 +159,7 @@
density = 0
anchored = 0.0
origin_tech = "materials=2"
- matter = list("metal" = 30000,"glass" = 15000)
+ matter = list(DEFAULT_WALL_MATERIAL = 30000,"glass" = 15000)
/obj/item/weapon/rcd/borg
canRwall = 1
diff --git a/code/game/objects/items/weapons/RSF.dm b/code/game/objects/items/weapons/RSF.dm
index d3dc598cc3..b96d53c2a8 100644
--- a/code/game/objects/items/weapons/RSF.dm
+++ b/code/game/objects/items/weapons/RSF.dm
@@ -28,7 +28,7 @@ RSF
user << "The RSF can't hold any more matter."
return
- del(W)
+ qdel(W)
stored_matter += 10
playsound(src.loc, 'sound/machines/click.ogg', 10, 1)
diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm
index dc6787a73b..bf8c9d583c 100644
--- a/code/game/objects/items/weapons/autopsy.dm
+++ b/code/game/objects/items/weapons/autopsy.dm
@@ -68,7 +68,7 @@
else
D.organ_names += ", [O.name]"
- del D.organs_scanned[O.name]
+ qdel(D.organs_scanned[O.name])
D.organs_scanned[O.name] = W.copy()
for(var/V in O.trace_chemicals)
diff --git a/code/game/objects/items/weapons/candle.dm b/code/game/objects/items/weapons/candle.dm
index 6fc63420de..f5f2a8d9fd 100644
--- a/code/game/objects/items/weapons/candle.dm
+++ b/code/game/objects/items/weapons/candle.dm
@@ -1,13 +1,17 @@
/obj/item/weapon/flame/candle
name = "red candle"
- desc = "a candle"
+ desc = "a small pillar candle. Its specially-formulated fuel-oxidizer wax mixture allows continued combustion in airless environments."
icon = 'icons/obj/candle.dmi'
icon_state = "candle1"
item_state = "candle1"
w_class = 1
-
+ light_color = "#E09D37"
var/wax = 2000
+/obj/item/weapon/flame/candle/New()
+ wax = rand(800, 1000) // Enough for 27-33 minutes. 30 minutes on average.
+ ..()
+
/obj/item/weapon/flame/candle/update_icon()
var/i
if(wax > 1500)
@@ -44,7 +48,7 @@
//src.damtype = "fire"
for(var/mob/O in viewers(usr, null))
O.show_message(flavor_text, 1)
- SetLuminosity(CANDLE_LUM)
+ set_light(CANDLE_LUM)
processing_objects.Add(src)
@@ -56,28 +60,14 @@
new/obj/item/trash/candle(src.loc)
if(istype(src.loc, /mob))
src.dropped()
- del(src)
+ qdel(src)
update_icon()
if(istype(loc, /turf)) //start a fire if possible
var/turf/T = loc
T.hotspot_expose(700, 5)
-
/obj/item/weapon/flame/candle/attack_self(mob/user as mob)
if(lit)
lit = 0
update_icon()
- SetLuminosity(0)
- user.SetLuminosity(user.luminosity - CANDLE_LUM)
-
-
-/obj/item/weapon/flame/candle/pickup(mob/user)
- if(lit)
- SetLuminosity(0)
- user.SetLuminosity(user.luminosity + CANDLE_LUM)
-
-
-/obj/item/weapon/flame/candle/dropped(mob/user)
- if(lit)
- user.SetLuminosity(user.luminosity - CANDLE_LUM)
- SetLuminosity(CANDLE_LUM)
+ set_light(0)
diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm
index 393f10363a..833524399d 100644
--- a/code/game/objects/items/weapons/cards_ids.dm
+++ b/code/game/objects/items/weapons/cards_ids.dm
@@ -92,12 +92,12 @@
/obj/machinery/shield_gen,
/obj/machinery/clonepod,
/obj/machinery/deployable,
- /obj/machinery/door_control,
+ /obj/machinery/button/remote,
/obj/machinery/porta_turret,
/obj/machinery/shieldgen,
/obj/machinery/turretid,
/obj/machinery/vending,
- /obj/machinery/bot,
+ /mob/living/bot,
/obj/machinery/door,
/obj/machinery/telecomms,
/obj/machinery/mecha_part_fabricator,
@@ -118,7 +118,7 @@
user.drop_item()
var/obj/item/weapon/card/emag_broken/junk = new(user.loc)
junk.add_fingerprint(user)
- del(src)
+ qdel(src)
return
..()
@@ -170,7 +170,7 @@
src.desc = W.desc
src.icon = W.icon
src.icon_state = W.icon_state
- del(W)
+ qdel(W)
return
/obj/item/weapon/card/id/verb/read()
@@ -293,3 +293,11 @@
New()
access = get_all_centcom_access()
..()
+
+/obj/item/weapon/card/id/centcom/ERT
+ name = "\improper Emergency Response Team ID"
+ assignment = "Emergency Response Team"
+
+/obj/item/weapon/card/id/centcom/ERT/New()
+ ..()
+ access += get_all_accesses()
diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm
index fbba55b040..957bfde1f5 100644
--- a/code/game/objects/items/weapons/cigs_lighters.dm
+++ b/code/game/objects/items/weapons/cigs_lighters.dm
@@ -93,9 +93,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
flags |= NOREACT // so it doesn't react until you light it
create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15
-/obj/item/clothing/mask/smokable/Del()
+/obj/item/clothing/mask/smokable/Destroy()
..()
- del(reagents)
+ qdel(reagents)
/obj/item/clothing/mask/smokable/process()
var/turf/location = get_turf(src)
@@ -127,13 +127,13 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/datum/effect/effect/system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount("phoron") / 2.5, 1), get_turf(src), 0, 0)
e.start()
- del(src)
+ qdel(src)
return
if(reagents.get_reagent_amount("fuel")) // the fuel explodes, too, but much less violently
var/datum/effect/effect/system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount("fuel") / 5, 1), get_turf(src), 0, 0)
e.start()
- del(src)
+ qdel(src)
return
flags &= ~NOREACT // allowing reagents to react after being lit
reagents.handle_reactions()
@@ -146,10 +146,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
M.update_inv_r_hand(1)
var/turf/T = get_turf(src)
T.visible_message(flavor_text)
+ set_light(2, 0.25, "#E38F46")
processing_objects.Add(src)
/obj/item/clothing/mask/smokable/proc/die(var/nomessage = 0)
var/turf/T = get_turf(src)
+ set_light(0)
if (type_butt)
var/obj/item/butt = new type_butt(T)
transfer_fingerprints_to(butt)
@@ -162,7 +164,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
processing_objects.Remove(src)
- del(src)
+ qdel(src)
else
new /obj/effect/decal/cleanable/ash(T)
if(ismob(loc))
@@ -176,7 +178,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
processing_objects.Remove(src)
-
+
/obj/item/clothing/mask/smokable/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(isflamesource(W))
@@ -221,7 +223,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(istype(W, /obj/item/weapon/melee/energy/sword))
var/obj/item/weapon/melee/energy/sword/S = W
if(S.active)
- light("[user] swings their [W], barely missing their nose. They light their [name] in the process.")
+ light("[user] swings their [W], barely missing their nose. They light their [name] in the process.")
return
@@ -377,7 +379,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(G.reagents)
G.reagents.trans_to(src, G.reagents.total_volume)
name = "[G.name]-packed [initial(name)]"
- del(G)
+ qdel(G)
else if(istype(W, /obj/item/weapon/flame/lighter))
var/obj/item/weapon/flame/lighter/L = W
@@ -456,7 +458,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user.apply_damage(2,BURN,"r_hand")
user.visible_message("After a few attempts, [user] manages to light the [src], they however burn their finger in the process.")
- user.SetLuminosity(user.luminosity + 2)
+ set_light(2)
processing_objects.Add(src)
else
lit = 0
@@ -467,7 +469,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
else
user.visible_message("[user] quietly shuts off the [src].")
- user.SetLuminosity(user.luminosity - 2)
+ set_light(0)
processing_objects.Remove(src)
else
return ..()
@@ -496,17 +498,3 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(location)
location.hotspot_expose(700, 5)
return
-
-
-/obj/item/weapon/flame/lighter/pickup(mob/user)
- if(lit)
- SetLuminosity(0)
- user.SetLuminosity(user.luminosity+2)
- return
-
-
-/obj/item/weapon/flame/lighter/dropped(mob/user)
- if(lit)
- user.SetLuminosity(user.luminosity-2)
- SetLuminosity(2)
- return
diff --git a/code/game/objects/items/weapons/circuitboards/circuitboard.dm b/code/game/objects/items/weapons/circuitboards/circuitboard.dm
index 00cc7a6835..2e82763c4c 100644
--- a/code/game/objects/items/weapons/circuitboards/circuitboard.dm
+++ b/code/game/objects/items/weapons/circuitboards/circuitboard.dm
@@ -21,7 +21,6 @@
var/build_path = null
var/board_type = "computer"
var/list/req_components = null
- var/frame_desc = null
var/contain_parts = 1
//Called when the circuitboard is used to contruct a new machine.
diff --git a/code/game/objects/items/weapons/circuitboards/computer/computer.dm b/code/game/objects/items/weapons/circuitboards/computer/computer.dm
index 281f31869c..d71e2dcb07 100644
--- a/code/game/objects/items/weapons/circuitboards/computer/computer.dm
+++ b/code/game/objects/items/weapons/circuitboards/computer/computer.dm
@@ -57,9 +57,17 @@
name = T_BOARD("employment records console")
build_path = /obj/machinery/computer/skills
-/obj/item/weapon/circuitboard/stationalert
- name = T_BOARD("station alert console")
+/obj/item/weapon/circuitboard/stationalert_engineering
+ name = T_BOARD("station alert console (engineering)")
build_path = /obj/machinery/computer/station_alert
+
+/obj/item/weapon/circuitboard/stationalert_security
+ name = T_BOARD("station alert console (security)")
+ build_path = /obj/machinery/computer/station_alert
+
+/obj/item/weapon/circuitboard/stationalert_all
+ name = T_BOARD("station alert console (all)")
+ build_path = /obj/machinery/computer/station_alert/all
/obj/item/weapon/circuitboard/atmos_alert
name = T_BOARD("atmospheric alert console")
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm b/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm
index c01893b158..0b0c494cde 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/biogenerator.dm
@@ -7,7 +7,6 @@
build_path = "/obj/machinery/biogenerator"
board_type = "machine"
origin_tech = "programming=2"
- frame_desc = "Requires 1 Manipulator, and 1 Matter Bin."
req_components = list(
"/obj/item/weapon/stock_parts/matter_bin" = 1,
"/obj/item/weapon/stock_parts/manipulator" = 1)
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm b/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm
index fdc0865f9c..e3b22c3fec 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/cloning.dm
@@ -7,7 +7,6 @@
build_path = "/obj/machinery/clonepod"
board_type = "machine"
origin_tech = "programming=3;biotech=3"
- frame_desc = "Requires 2 Manipulator, 2 Scanning Module, 2 pieces of cable and 1 Console Screen."
req_components = list(
"/obj/item/stack/cable_coil" = 2,
"/obj/item/weapon/stock_parts/scanning_module" = 2,
@@ -19,7 +18,6 @@
build_path = "/obj/machinery/dna_scannernew"
board_type = "machine"
origin_tech = "programming=2;biotech=2"
- frame_desc = "Requires 1 Scanning module, 1 Micro Manipulator, 1 Micro-Laser, 2 pieces of cable and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/scanning_module" = 1,
"/obj/item/weapon/stock_parts/manipulator" = 1,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm b/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm
index 81216003d5..05ce85865d 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/commsantenna.dm
@@ -7,7 +7,6 @@
build_path = "/obj/machinery/bluespacerelay"
board_type = "machine"
origin_tech = "bluespace=4,programming=4"
- frame_desc = "Requires 30 Cable Coil, 1 Hyperwave Filter and 1 Ansible Crystal, and 2 Micro-Manipulators"
req_components = list(
"/obj/item/stack/cable_coil" = 30,
"/obj/item/weapon/stock_parts/manipulator" = 2,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm b/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm
index d4292effe2..97b60686e0 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/mining_drill.dm
@@ -7,7 +7,6 @@
build_path = "/obj/machinery/mining/drill"
board_type = "machine"
origin_tech = "programming=1;engineering=1"
- frame_desc = "Requires 1 capacitor, 1 cell, 1 matter bin, and 1 micro laser."
req_components = list(
"/obj/item/weapon/stock_parts/capacitor" = 1,
"/obj/item/weapon/cell" = 1,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm b/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm
index 77d313e414..0a8f2b6cdd 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/pacman.dm
@@ -7,7 +7,6 @@
build_path = "/obj/machinery/power/port_gen/pacman"
board_type = "machine"
origin_tech = "programming=3;powerstorage=3;phorontech=3;engineering=3"
- frame_desc = "Requires 1 Matter Bin, 1 Micro-Laser, 2 Pieces of Cable, and 1 Capacitor."
req_components = list(
"/obj/item/weapon/stock_parts/matter_bin" = 1,
"/obj/item/weapon/stock_parts/micro_laser" = 1,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/power.dm b/code/game/objects/items/weapons/circuitboards/machinery/power.dm
index 80955b1b8e..46241049b6 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/power.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/power.dm
@@ -7,7 +7,6 @@
build_path = "/obj/machinery/power/smes/buildable"
board_type = "machine"
origin_tech = "powerstorage=6;engineering=4"
- frame_desc = "Requires 1 superconducting magnetic coil and 30 wires."
req_components = list("/obj/item/weapon/smes_coil" = 1, "/obj/item/stack/cable_coil" = 30)
/obj/item/weapon/circuitboard/batteryrack
@@ -15,7 +14,6 @@
build_path = "/obj/machinery/power/smes/batteryrack"
board_type = "machine"
origin_tech = "powerstorage=3;engineering=2"
- frame_desc = "Requires 3 power cells."
req_components = list("/obj/item/weapon/cell" = 3)
/obj/item/weapon/circuitboard/ghettosmes
@@ -23,5 +21,4 @@
desc = "An APC circuit repurposed into some power storage device controller"
build_path = "/obj/machinery/power/smes/batteryrack/makeshift"
board_type = "machine"
- frame_desc = "Requires 3 power cells."
req_components = list("/obj/item/weapon/cell" = 3)
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm b/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm
index 5a0dc01bc1..6feda42613 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/recharge_station.dm
@@ -7,7 +7,6 @@
build_path = "/obj/machinery/recharge_station"
board_type = "machine"
origin_tech = "programming=3;engineering=3"
- frame_desc = "Requires 2 Manipulator, 2 Capacitor, 1 Cell, and 5 pieces of cable."
req_components = list(
"/obj/item/stack/cable_coil" = 5,
"/obj/item/weapon/stock_parts/capacitor" = 2,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm
index 9853150b17..0ab0822e4b 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm
@@ -7,7 +7,6 @@ obj/item/weapon/circuitboard/rdserver
build_path = "/obj/machinery/r_n_d/server"
board_type = "machine"
origin_tech = "programming=3"
- frame_desc = "Requires 2 pieces of cable, and 1 Scanning Module."
req_components = list(
"/obj/item/stack/cable_coil" = 2,
"/obj/item/weapon/stock_parts/scanning_module" = 1)
@@ -17,7 +16,6 @@ obj/item/weapon/circuitboard/rdserver
build_path = "/obj/machinery/r_n_d/destructive_analyzer"
board_type = "machine"
origin_tech = "magnets=2;engineering=2;programming=2"
- frame_desc = "Requires 1 Scanning Module, 1 Micro Manipulator, and 1 Micro-Laser."
req_components = list(
"/obj/item/weapon/stock_parts/scanning_module" = 1,
"/obj/item/weapon/stock_parts/manipulator" = 1,
@@ -28,7 +26,6 @@ obj/item/weapon/circuitboard/rdserver
build_path = "/obj/machinery/autolathe"
board_type = "machine"
origin_tech = "engineering=2;programming=2"
- frame_desc = "Requires 3 Matter Bins, 1 Micro Manipulator, and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/matter_bin" = 3,
"/obj/item/weapon/stock_parts/manipulator" = 1,
@@ -39,7 +36,6 @@ obj/item/weapon/circuitboard/rdserver
build_path = "/obj/machinery/r_n_d/protolathe"
board_type = "machine"
origin_tech = "engineering=2;programming=2"
- frame_desc = "Requires 2 Matter Bins, 2 Micro Manipulators, and 2 Beakers."
req_components = list(
"/obj/item/weapon/stock_parts/matter_bin" = 2,
"/obj/item/weapon/stock_parts/manipulator" = 2,
@@ -51,7 +47,6 @@ obj/item/weapon/circuitboard/rdserver
build_path = "/obj/machinery/r_n_d/circuit_imprinter"
board_type = "machine"
origin_tech = "engineering=2;programming=2"
- frame_desc = "Requires 1 Matter Bin, 1 Micro Manipulator, and 2 Beakers."
req_components = list(
"/obj/item/weapon/stock_parts/matter_bin" = 1,
"/obj/item/weapon/stock_parts/manipulator" = 1,
@@ -62,7 +57,6 @@ obj/item/weapon/circuitboard/rdserver
build_path = "/obj/machinery/mecha_part_fabricator"
board_type = "machine"
origin_tech = "programming=3;engineering=3"
- frame_desc = "Requires 2 Matter Bins, 1 Micro Manipulator, 1 Micro-Laser and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/matter_bin" = 2,
"/obj/item/weapon/stock_parts/manipulator" = 1,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm b/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm
index 6e892a6603..cbfe5f69b1 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/shieldgen.dm
@@ -7,7 +7,6 @@
board_type = "machine"
build_path = "/obj/machinery/shield_gen/external"
origin_tech = "bluespace=4;phorontech=3"
- frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/subspace/transmitter" = 1,
@@ -21,7 +20,6 @@
board_type = "machine"
build_path = "/obj/machinery/shield_gen"
origin_tech = "bluespace=4;phorontech=3"
- frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Transmitter, 5 Pieces of cable, 1 Subspace Crystal, 1 Subspace Amplifier and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/subspace/transmitter" = 1,
@@ -35,7 +33,6 @@
board_type = "machine"
build_path = "/obj/machinery/shield_capacitor"
origin_tech = "magnets=3;powerstorage=4"
- frame_desc = "Requires 2 Pico Manipulators, 1 Subspace Filter, 5 Pieces of cable, 1 Subspace Treatment disk, 1 Subspace Analyzer and 1 Console Screen."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator/pico" = 2,
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm b/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm
index a312d2995a..7e0195de9a 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/telecomms.dm
@@ -9,7 +9,6 @@
name = T_BOARD("subspace receiver")
build_path = "/obj/machinery/telecomms/receiver"
origin_tech = "programming=4;engineering=3;bluespace=2"
- frame_desc = "Requires 1 Subspace Ansible, 1 Hyperwave Filter, 2 Micro Manipulators, and 1 Micro-Laser."
req_components = list(
"/obj/item/weapon/stock_parts/subspace/ansible" = 1,
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
@@ -20,7 +19,6 @@
name = T_BOARD("hub mainframe")
build_path = "/obj/machinery/telecomms/hub"
origin_tech = "programming=4;engineering=4"
- frame_desc = "Requires 2 Micro Manipulators, 2 Cable Coil and 2 Hyperwave Filter."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator" = 2,
"/obj/item/stack/cable_coil" = 2,
@@ -30,7 +28,6 @@
name = T_BOARD("relay mainframe")
build_path = "/obj/machinery/telecomms/relay"
origin_tech = "programming=3;engineering=4;bluespace=3"
- frame_desc = "Requires 2 Micro Manipulators, 2 Cable Coil and 2 Hyperwave Filters."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator" = 2,
"/obj/item/stack/cable_coil" = 2,
@@ -40,7 +37,6 @@
name = T_BOARD("bus mainframe")
build_path = "/obj/machinery/telecomms/bus"
origin_tech = "programming=4;engineering=4"
- frame_desc = "Requires 2 Micro Manipulators, 1 Cable Coil and 1 Hyperwave Filter."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator" = 2,
"/obj/item/stack/cable_coil" = 1,
@@ -50,7 +46,6 @@
name = T_BOARD("processor unit")
build_path = "/obj/machinery/telecomms/processor"
origin_tech = "programming=4;engineering=4"
- frame_desc = "Requires 3 Micro Manipulators, 1 Hyperwave Filter, 2 Treatment Disks, 1 Wavelength Analyzer, 2 Cable Coils and 1 Subspace Amplifier."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator" = 3,
"/obj/item/weapon/stock_parts/subspace/filter" = 1,
@@ -63,7 +58,6 @@
name = T_BOARD("telecommunication server")
build_path = "/obj/machinery/telecomms/server"
origin_tech = "programming=4;engineering=4"
- frame_desc = "Requires 2 Micro Manipulators, 1 Cable Coil and 1 Hyperwave Filter."
req_components = list(
"/obj/item/weapon/stock_parts/manipulator" = 2,
"/obj/item/stack/cable_coil" = 1,
@@ -73,7 +67,6 @@
name = T_BOARD("subspace broadcaster")
build_path = "/obj/machinery/telecomms/broadcaster"
origin_tech = "programming=4;engineering=4;bluespace=2"
- frame_desc = "Requires 2 Micro Manipulators, 1 Cable Coil, 1 Hyperwave Filter, 1 Ansible Crystal and 2 High-Powered Micro-Lasers. "
req_components = list(
"/obj/item/weapon/stock_parts/manipulator" = 2,
"/obj/item/stack/cable_coil" = 1,
diff --git a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm
index db76bbcc8e..a1beabbea6 100644
--- a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm
+++ b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm
@@ -17,7 +17,6 @@
name = T_BOARD("gas heating system")
build_path = "/obj/machinery/atmospherics/unary/heater"
origin_tech = "powerstorage=2;engineering=1"
- frame_desc = "Requires 5 Pieces of Cable, 1 Matter Bin, and 2 Capacitors."
req_components = list(
"/obj/item/stack/cable_coil" = 5,
"/obj/item/weapon/stock_parts/matter_bin" = 1,
@@ -27,7 +26,6 @@
name = T_BOARD("gas cooling system")
build_path = "/obj/machinery/atmospherics/unary/freezer"
origin_tech = "magnets=2;engineering=2"
- frame_desc = "Requires 2 Pieces of Cable, 1 Matter Bin, 1 Micro Manipulator, and 2 Capacitors."
req_components = list(
"/obj/item/stack/cable_coil" = 2,
"/obj/item/weapon/stock_parts/matter_bin" = 1,
diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm
index 4536123b86..f86359c21d 100644
--- a/code/game/objects/items/weapons/clown_items.dm
+++ b/code/game/objects/items/weapons/clown_items.dm
@@ -28,7 +28,7 @@
user << "You need to take that [target.name] off before cleaning it."
else if(istype(target,/obj/effect/decal/cleanable))
user << "You scrub \the [target.name] out."
- del(target)
+ qdel(target)
else if(istype(target,/turf))
user << "You scrub \the [target.name] clean."
var/turf/T = target
diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm
index dfd221650b..8ccc1f1006 100644
--- a/code/game/objects/items/weapons/dna_injector.dm
+++ b/code/game/objects/items/weapons/dna_injector.dm
@@ -92,7 +92,7 @@
spawn(0)//this prevents the collapse of space-time continuum
if (user)
user.drop_from_inventory(src)
- del(src)
+ qdel(src)
return uses
/obj/item/weapon/dnainjector/attack(mob/M as mob, mob/user as mob)
diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm
index 030437b446..36c97d3df2 100644
--- a/code/game/objects/items/weapons/explosives.dm
+++ b/code/game/objects/items/weapons/explosives.dm
@@ -80,7 +80,7 @@
target.ex_act(1)
if(target)
target.overlays -= image_overlay
- del(src) // qdel
+ qdel(src)
/obj/item/weapon/plastique/attack(mob/M as mob, mob/user as mob, def_zone)
return
diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm
index 4408e998ce..d787921c18 100644
--- a/code/game/objects/items/weapons/extinguisher.dm
+++ b/code/game/objects/items/weapons/extinguisher.dm
@@ -11,7 +11,7 @@
throw_speed = 2
throw_range = 10
force = 10.0
- matter = list("metal" = 90)
+ matter = list(DEFAULT_WALL_MATERIAL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
var/spray_particles = 6
@@ -115,7 +115,7 @@
for(var/a=0, a < spray_particles, a++)
spawn(0)
- var/obj/effect/effect/water/W = new /obj/effect/effect/water( get_turf(src) )
+ var/obj/effect/effect/water/W = PoolOrNew(/obj/effect/effect/water, get_turf(src))
var/turf/my_target = pick(the_targets)
var/datum/reagents/R = new/datum/reagents(spray_amount)
if(!W) return
@@ -139,7 +139,7 @@
M.ExtinguishMob()
if(W.loc == my_target) break
sleep(2)
- W.delete()
+ qdel(W)
if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity == 0))
user.inertia_dir = get_dir(target, user)
diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm
index 50508594cf..a8d03b9539 100644
--- a/code/game/objects/items/weapons/flamethrower.dm
+++ b/code/game/objects/items/weapons/flamethrower.dm
@@ -10,7 +10,7 @@
throw_speed = 1
throw_range = 5
w_class = 3.0
- matter = list("metal" = 500)
+ matter = list(DEFAULT_WALL_MATERIAL = 500)
origin_tech = "combat=1;phorontech=1"
var/status = 0
var/throw_amount = 100
@@ -22,13 +22,13 @@
var/obj/item/weapon/tank/phoron/ptank = null
-/obj/item/weapon/flamethrower/Del()
+/obj/item/weapon/flamethrower/Destroy()
if(weldtool)
- del(weldtool)
+ qdel(weldtool)
if(igniter)
- del(igniter)
+ qdel(igniter)
if(ptank)
- del(ptank)
+ qdel(ptank)
..()
return
@@ -82,8 +82,8 @@
if(ptank)
ptank.loc = T
ptank = null
- new /obj/item/stack/rods(T)
- del(src)
+ PoolOrNew(/obj/item/stack/rods, T)
+ qdel(src)
return
if(isscrewdriver(W) && igniter && !lit)
diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm
index dd3d0886fb..023eb3bfd3 100644
--- a/code/game/objects/items/weapons/gift_wrappaper.dm
+++ b/code/game/objects/items/weapons/gift_wrappaper.dm
@@ -31,11 +31,11 @@
src.gift.add_fingerprint(user)
else
user << "\blue The gift was empty!"
- del(src)
+ qdel(src)
return
/obj/item/weapon/a_gift/ex_act()
- del(src)
+ qdel(src)
return
/obj/effect/spresent/relaymove(mob/user as mob)
@@ -58,7 +58,7 @@
M.client.eye = M.client.mob
M.client.perspective = MOB_PERSPECTIVE
- del(src)
+ qdel(src)
/obj/item/weapon/a_gift/attack_self(mob/M as mob)
var/gift_type = pick(/obj/item/weapon/sord,
@@ -112,7 +112,7 @@
M.remove_from_mob(src)
M.put_in_hands(I)
I.add_fingerprint(M)
- del(src)
+ qdel(src)
return
/*
@@ -152,7 +152,7 @@
src.add_fingerprint(user)
if (src.amount <= 0)
new /obj/item/weapon/c_tube( src.loc )
- del(src)
+ qdel(src)
return
else
user << "\blue You need scissors!"
diff --git a/code/game/objects/items/weapons/grenades/chem_grenade.dm b/code/game/objects/items/weapons/grenades/chem_grenade.dm
index bb440d1215..a58ebe4cbe 100644
--- a/code/game/objects/items/weapons/grenades/chem_grenade.dm
+++ b/code/game/objects/items/weapons/grenades/chem_grenade.dm
@@ -167,7 +167,7 @@
invisibility = INVISIBILITY_MAXIMUM //Why am i doing this?
spawn(50) //To make sure all reagents can work
- del(src) //correctly before deleting the grenade.
+ qdel(src) //correctly before deleting the grenade.
/obj/item/weapon/grenade/chem_grenade/large
diff --git a/code/game/objects/items/weapons/grenades/emgrenade.dm b/code/game/objects/items/weapons/grenades/emgrenade.dm
index 3446fa46c3..c354aa4039 100644
--- a/code/game/objects/items/weapons/grenades/emgrenade.dm
+++ b/code/game/objects/items/weapons/grenades/emgrenade.dm
@@ -7,5 +7,5 @@
prime()
..()
if(empulse(src, 4, 10))
- del(src)
+ qdel(src)
return
diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm
index 03d8ccdffc..4c3c73c485 100644
--- a/code/game/objects/items/weapons/grenades/flashbang.dm
+++ b/code/game/objects/items/weapons/grenades/flashbang.dm
@@ -23,7 +23,7 @@
new/obj/effect/effect/sparks(src.loc)
new/obj/effect/effect/smoke/illumination(src.loc, brightness=15)
- del(src)
+ qdel(src)
return
proc/bang(var/turf/T , var/mob/living/carbon/M) // Added a new proc called 'bang' that takes a location and a person to be banged.
@@ -124,9 +124,8 @@
spawn(0)
new /obj/item/weapon/grenade/flashbang/clusterbang/segment(src.loc)//Creates a 'segment' that launches a few more flashbangs
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
- spawn(0)
- del(src)
- return
+ qdel(src)
+ return
/obj/item/weapon/grenade/flashbang/clusterbang/segment
desc = "A smaller segment of a clusterbang. Better run."
@@ -156,9 +155,8 @@
spawn(0)
new /obj/item/weapon/grenade/flashbang/cluster(src.loc)
playsound(src.loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
- spawn(0)
- del(src)
- return
+ qdel(src)
+ return
/obj/item/weapon/grenade/flashbang/cluster/New()//Same concept as the segments, so that all of the parts don't become reliant on the clusterbang
spawn(0)
diff --git a/code/game/objects/items/weapons/grenades/smokebomb.dm b/code/game/objects/items/weapons/grenades/smokebomb.dm
index 139baacb6f..e1e58b62ac 100644
--- a/code/game/objects/items/weapons/grenades/smokebomb.dm
+++ b/code/game/objects/items/weapons/grenades/smokebomb.dm
@@ -10,7 +10,7 @@
New()
..()
- src.smoke = new /datum/effect/effect/system/smoke_spread/bad
+ src.smoke = PoolOrNew(/datum/effect/effect/system/smoke_spread/bad)
src.smoke.attach(src)
prime()
@@ -30,5 +30,5 @@
B.health -= damage
B.update_icon()
sleep(80)
- del(src)
+ qdel(src)
return
diff --git a/code/game/objects/items/weapons/grenades/spawnergrenade.dm b/code/game/objects/items/weapons/grenades/spawnergrenade.dm
index 8b6b6e938d..6adea8e2f5 100644
--- a/code/game/objects/items/weapons/grenades/spawnergrenade.dm
+++ b/code/game/objects/items/weapons/grenades/spawnergrenade.dm
@@ -28,7 +28,7 @@
// Spawn some hostile syndicate critters
- del(src)
+ qdel(src)
return
/obj/item/weapon/grenade/spawnergrenade/manhacks
diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm
index 85bec3a8ea..af8ab05d34 100644
--- a/code/game/objects/items/weapons/handcuffs.dm
+++ b/code/game/objects/items/weapons/handcuffs.dm
@@ -10,7 +10,7 @@
w_class = 2.0
throw_speed = 2
throw_range = 5
- matter = list("metal" = 500)
+ matter = list(DEFAULT_WALL_MATERIAL = 500)
origin_tech = "materials=1"
var/dispenser = 0
var/breakouttime = 1200 //Deciseconds = 120s = 2 minutes
@@ -132,7 +132,7 @@ var/last_chew = 0
user.put_in_hands(W)
user << "You wrap the cable restraint around the top of the rod."
- del(src)
+ qdel(src)
update_icon(user)
diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm
index 50b4135dd7..7a200891ed 100644
--- a/code/game/objects/items/weapons/implants/implant.dm
+++ b/code/game/objects/items/weapons/implants/implant.dm
@@ -9,7 +9,7 @@
var/implanted = null
var/mob/imp_in = null
var/obj/item/organ/external/part = null
- item_color = "b"
+ var/implant_color = "b"
var/allow_reagents = 0
var/malfunction = 0
@@ -46,7 +46,7 @@
icon_state = "implant_melted"
malfunction = MALFUNCTION_PERMANENT
- Del()
+ Destroy()
if(part)
part.implants.Remove(src)
..()
@@ -155,7 +155,7 @@ Implant Specifics:
"}
msg = replace_characters(msg, replacechars)
if(findtext(msg,phrase))
activate()
- del(src)
+ qdel(src)
activate()
if (malfunction == MALFUNCTION_PERMANENT)
@@ -179,11 +179,11 @@ Implant Specifics:
"}
istype(part,/obj/item/organ/external/head))
part.createwound(BRUISE, 60) //mangle them instead
explosion(get_turf(imp_in), -1, -1, 2, 3)
- del(src)
+ qdel(src)
else
explosion(get_turf(imp_in), -1, -1, 2, 3)
part.droplimb(0,DROPLIMB_BLUNT)
- del(src)
+ qdel(src)
if (elevel == "Destroy Body")
explosion(get_turf(T), -1, 0, 1, 6)
T.gib()
@@ -249,7 +249,7 @@ Implant Specifics:
"}
else
part.droplimb(0,DROPLIMB_BLUNT)
explosion(get_turf(imp_in), -1, -1, 2, 3)
- del(src)
+ qdel(src)
/obj/item/weapon/implant/chem
name = "chemical implant"
@@ -296,7 +296,7 @@ the implant may become unstable and either pre-maturely inject the subject or si
if(!src.reagents.total_volume)
R << "You hear a faint click from your chest."
spawn(0)
- del(src)
+ qdel(src)
return
emp_act(severity)
@@ -421,17 +421,17 @@ the implant may become unstable and either pre-maturely inject the subject or si
a.autosay("[mobname] has died in Space!", "[mobname]'s Death Alarm")
else
a.autosay("[mobname] has died in [t.name]!", "[mobname]'s Death Alarm")
- del(a)
+ qdel(a)
processing_objects.Remove(src)
if ("emp")
var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset(null)
var/name = prob(50) ? t.name : pick(teleportlocs)
a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm")
- del(a)
+ qdel(a)
else
var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset(null)
a.autosay("[mobname] has died-zzzzt in-in-in...", "[mobname]'s Death Alarm")
- del(a)
+ qdel(a)
processing_objects.Remove(src)
emp_act(severity) //for some reason alarms stop going off in case they are emp'd, even without this
@@ -489,7 +489,7 @@ the implant may become unstable and either pre-maturely inject the subject or si
imp_in.put_in_hands(scanned)
else
scanned.loc = t
- del src
+ qdel(src)
implanted(mob/source as mob)
src.activation_emote = input("Choose activation emote:") in list("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm
index 48aea7a5e1..8d731e0bbe 100644
--- a/code/game/objects/items/weapons/implants/implantcase.dm
+++ b/code/game/objects/items/weapons/implants/implantcase.dm
@@ -13,7 +13,7 @@
/obj/item/weapon/implantcase/proc/update()
if (src.imp)
- src.icon_state = text("implantcase-[]", src.imp.item_color)
+ src.icon_state = text("implantcase-[]", src.imp.implant_color)
else
src.icon_state = "implantcase-0"
return
diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm
index 535a4264c0..2f33eba413 100644
--- a/code/game/objects/items/weapons/implants/implantchair.dm
+++ b/code/game/objects/items/weapons/implants/implantchair.dm
@@ -84,7 +84,7 @@
return
var/mob/M = G:affecting
if(put_mob(M))
- del(G)
+ qdel(G)
src.updateUsrDialog()
return
diff --git a/code/game/objects/items/weapons/implants/implanter.dm b/code/game/objects/items/weapons/implants/implanter.dm
index 150f77e5e2..4f2c491d6b 100644
--- a/code/game/objects/items/weapons/implants/implanter.dm
+++ b/code/game/objects/items/weapons/implants/implanter.dm
@@ -32,9 +32,7 @@
for (var/mob/O in viewers(M, null))
O.show_message("\red [M] has been implanted by [user].", 1)
- M.attack_log += text("\[[time_stamp()]\] Implanted with [src.name] ([src.imp.name]) by [user.name] ([user.ckey])")
- user.attack_log += text("\[[time_stamp()]\] Used the [src.name] ([src.imp.name]) to implant [M.name] ([M.ckey])")
- msg_admin_attack("[user.name] ([user.ckey]) implanted [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (JMP)")
+ admin_attack_log(user, M, "Implanted using \the [src.name] ([src.imp.name])", "Implanted with \the [src.name] ([src.imp.name])", "used an implanter, [src.name] ([src.imp.name]), on")
user.show_message("\red You implanted the implant into [M].")
if(src.imp.implanted(M))
diff --git a/code/game/objects/items/weapons/implants/implantfreedom.dm b/code/game/objects/items/weapons/implants/implantfreedom.dm
index d32ae9d8ba..5131961060 100644
--- a/code/game/objects/items/weapons/implants/implantfreedom.dm
+++ b/code/game/objects/items/weapons/implants/implantfreedom.dm
@@ -3,7 +3,7 @@
/obj/item/weapon/implant/freedom
name = "freedom implant"
desc = "Use this to escape from those evil Red Shirts."
- item_color = "r"
+ implant_color = "r"
var/activation_emote = "chuckle"
var/uses = 1.0
diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm
index e27e38af7b..4eef78e45c 100644
--- a/code/game/objects/items/weapons/kitchen.dm
+++ b/code/game/objects/items/weapons/kitchen.dm
@@ -145,7 +145,7 @@
throwforce = 6.0
throw_speed = 3
throw_range = 6
- matter = list("metal" = 12000)
+ matter = list(DEFAULT_WALL_MATERIAL = 12000)
origin_tech = "materials=1"
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
@@ -175,7 +175,7 @@
throwforce = 8.0
throw_speed = 3
throw_range = 6
- matter = list("metal" = 12000)
+ matter = list(DEFAULT_WALL_MATERIAL = 12000)
origin_tech = "materials=1"
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
sharp = 1
@@ -247,7 +247,7 @@
throw_range = 5
w_class = 3.0
flags = CONDUCT
- matter = list("metal" = 3000)
+ matter = list(DEFAULT_WALL_MATERIAL = 3000)
/* // NOPE
var/food_total= 0
var/burger_amt = 0
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index f04be5d33a..8b2a657dd5 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -113,6 +113,7 @@
origin_tech = "magnets=3;syndicate=4"
sharp = 1
edge = 1
+ var/blade_color
/obj/item/weapon/melee/energy/sword/dropped(var/mob/user)
..()
@@ -120,26 +121,26 @@
deactivate(user)
/obj/item/weapon/melee/energy/sword/New()
- item_color = pick("red","blue","green","purple")
+ blade_color = pick("red","blue","green","purple")
/obj/item/weapon/melee/energy/sword/green/New()
- item_color = "green"
+ blade_color = "green"
/obj/item/weapon/melee/energy/sword/red/New()
- item_color = "red"
+ blade_color = "red"
/obj/item/weapon/melee/energy/sword/blue/New()
- item_color = "blue"
+ blade_color = "blue"
/obj/item/weapon/melee/energy/sword/purple/New()
- item_color = "purple"
+ blade_color = "purple"
/obj/item/weapon/melee/energy/sword/activate(mob/living/user)
if(!active)
user << "\The [src] is now energised."
..()
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
- icon_state = "sword[item_color]"
+ icon_state = "sword[blade_color]"
/obj/item/weapon/melee/energy/sword/deactivate(mob/living/user)
if(active)
@@ -192,16 +193,16 @@
processing_objects |= src
-/obj/item/weapon/melee/energy/blade/Del()
+/obj/item/weapon/melee/energy/blade/Destroy()
processing_objects -= src
..()
/obj/item/weapon/melee/energy/blade/attack_self(mob/user as mob)
user.drop_from_inventory(src)
- spawn(1) if(src) del(src)
+ spawn(1) if(src) qdel(src)
/obj/item/weapon/melee/energy/blade/dropped()
- spawn(1) if(src) del(src)
+ spawn(1) if(src) qdel(src)
/obj/item/weapon/melee/energy/blade/process()
if(!creator || loc != creator || (creator.l_hand != src && creator.r_hand != src))
@@ -216,4 +217,4 @@
host.pinned -= src
host.embedded -= src
host.drop_from_inventory(src)
- spawn(1) if(src) del(src)
+ spawn(1) if(src) qdel(src)
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index fe9945f8f0..0df10cd97c 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -24,7 +24,7 @@
T.dirt = 0
for(var/obj/effect/O in src)
if(istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay))
- del(O)
+ qdel(O)
source.reagents.reaction(src, TOUCH, 10) //10 is the multiplier for the reaction effect. probably needed to wet the floor properly.
source.reagents.remove_any(1) //reaction() doesn't use up the reagents
diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm
index 77f8172f8f..8e5e61aa24 100644
--- a/code/game/objects/items/weapons/paint.dm
+++ b/code/game/objects/items/weapons/paint.dm
@@ -9,7 +9,7 @@ var/global/list/cached_icons = list()
icon = 'icons/obj/items.dmi'
icon_state = "paint_neutral"
item_state = "paintcan"
- matter = list("metal" = 200)
+ matter = list(DEFAULT_WALL_MATERIAL = 200)
w_class = 3.0
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(10,20,30,60)
diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm
index 283e7e5877..68a821e3a7 100644
--- a/code/game/objects/items/weapons/policetape.dm
+++ b/code/game/objects/items/weapons/policetape.dm
@@ -106,7 +106,6 @@ var/list/tape_roll_applications = list()
var/obj/item/tape/P = new tape_type(cur)
P.icon_state = "[P.icon_base]_[dir]"
cur = get_step_towards(cur,end)
- //is_blocked_turf(var/turf/T)
usr << "\blue You finish placing the [src]." //Git Test
/obj/item/taperoll/afterattack(var/atom/A, mob/user as mob, proximity)
@@ -191,10 +190,10 @@ var/list/tape_roll_applications = list()
for (var/obj/item/tape/P in cur)
if(P.icon_state == icon_dir)
N = 0
- del(P)
+ qdel(P)
cur = get_step(cur,dir[i])
- del(src)
+ qdel(src)
return
diff --git a/code/game/objects/items/weapons/power_cells.dm b/code/game/objects/items/weapons/power_cells.dm
index 5cab6b24cb..d40294b5e7 100644
--- a/code/game/objects/items/weapons/power_cells.dm
+++ b/code/game/objects/items/weapons/power_cells.dm
@@ -14,20 +14,37 @@
var/maxcharge = 1000
var/rigged = 0 // true if rigged to explode
var/minor_fault = 0 //If not 100% reliable, it will build up faults.
- var/construction_cost = list("metal"=750,"glass"=75)
+ var/construction_cost = list(DEFAULT_WALL_MATERIAL=750,"glass"=75)
var/construction_time=100
- matter = list("metal" = 700, "glass" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 50)
suicide_act(mob/user)
viewers(user) << "\red [user] is licking the electrodes of the [src.name]! It looks like \he's trying to commit suicide."
return (FIRELOSS)
+//currently only used by energy-type guns, that may change in the future.
+/obj/item/weapon/cell/device
+ name = "device power cell"
+ desc = "A small power cell designed to power handheld devices."
+ icon_state = "cell" //placeholder
+ w_class = 2
+ force = 0
+ throw_speed = 5
+ throw_range = 7
+ maxcharge = 1000
+ matter = list("metal" = 350, "glass" = 50)
+
+/obj/item/weapon/cell/device/variable/New(newloc, charge_amount)
+ ..(newloc)
+ maxcharge = charge_amount
+ charge = maxcharge
+
/obj/item/weapon/cell/crap
name = "\improper Nanotrasen brand rechargable AA battery"
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
origin_tech = "powerstorage=0"
maxcharge = 500
- matter = list("metal" = 700, "glass" = 40)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 40)
/obj/item/weapon/cell/crap/empty/New()
..()
@@ -37,7 +54,7 @@
name = "security borg rechargable D battery"
origin_tech = "powerstorage=0"
maxcharge = 600 //600 max charge / 100 charge per shot = six shots
- matter = list("metal" = 700, "glass" = 40)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 40)
/obj/item/weapon/cell/secborg/empty/New()
..()
@@ -47,14 +64,14 @@
name = "heavy-duty power cell"
origin_tech = "powerstorage=1"
maxcharge = 5000
- matter = list("metal" = 700, "glass" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 50)
/obj/item/weapon/cell/high
name = "high-capacity power cell"
origin_tech = "powerstorage=2"
icon_state = "hcell"
maxcharge = 10000
- matter = list("metal" = 700, "glass" = 60)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 60)
/obj/item/weapon/cell/high/empty/New()
..()
@@ -65,8 +82,8 @@
origin_tech = "powerstorage=5"
icon_state = "scell"
maxcharge = 20000
- matter = list("metal" = 700, "glass" = 70)
- construction_cost = list("metal"=750,"glass"=100)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 70)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=750,"glass"=100)
/obj/item/weapon/cell/super/empty/New()
..()
@@ -77,8 +94,8 @@
origin_tech = "powerstorage=6"
icon_state = "hpcell"
maxcharge = 30000
- matter = list("metal" = 700, "glass" = 80)
- construction_cost = list("metal"=500,"glass"=150,"gold"=200,"silver"=200)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
+ construction_cost = list(DEFAULT_WALL_MATERIAL=500,"glass"=150,"gold"=200,"silver"=200)
/obj/item/weapon/cell/hyper/empty/New()
..()
@@ -89,7 +106,7 @@
icon_state = "icell"
origin_tech = null
maxcharge = 30000
- matter = list("metal" = 700, "glass" = 80)
+ matter = list(DEFAULT_WALL_MATERIAL = 700, "glass" = 80)
use()
return 1
diff --git a/code/game/objects/items/weapons/shards.dm b/code/game/objects/items/weapons/shards.dm
index 6b48653a6a..a383d8fb0c 100644
--- a/code/game/objects/items/weapons/shards.dm
+++ b/code/game/objects/items/weapons/shards.dm
@@ -64,7 +64,7 @@
G.attackby(NG, user)
usr << "You add the newly-formed glass to the stack. It now contains [NG.amount] sheets."
//SN src = null
- del(src)
+ qdel(src)
return
return ..()
diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm
index 65f1abddfb..436eea0339 100644
--- a/code/game/objects/items/weapons/shields.dm
+++ b/code/game/objects/items/weapons/shields.dm
@@ -13,7 +13,7 @@
throw_speed = 1
throw_range = 4
w_class = 4.0
- matter = list("glass" = 7500, "metal" = 1000)
+ matter = list("glass" = 7500, DEFAULT_WALL_MATERIAL = 1000)
origin_tech = "materials=2"
attack_verb = list("shoved", "bashed")
var/cooldown = 0 //shield bash cooldown. based on world.time
diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm
index 40937ea61c..541b41f74d 100644
--- a/code/game/objects/items/weapons/storage/backpack.dm
+++ b/code/game/objects/items/weapons/storage/backpack.dm
@@ -6,8 +6,17 @@
/obj/item/weapon/storage/backpack
name = "backpack"
desc = "You wear this on your back and put items into it."
+ item_icons = list(
+ slot_l_hand_str = 'icons/mob/items/lefthand_backpacks.dmi',
+ slot_r_hand_str = 'icons/mob/items/righthand_backpacks.dmi',
+ )
icon_state = "backpack"
- item_state = "backpack"
+ item_state = null
+ //most backpacks use the default backpack state for inhand overlays
+ item_state_slots = list(
+ slot_l_hand_str = "backpack",
+ slot_r_hand_str = "backpack",
+ )
w_class = 4
slot_flags = SLOT_BACK
max_w_class = 3
@@ -52,18 +61,18 @@
return
if(istype(W, /obj/item/weapon/storage/backpack/holding) && !W.crit_fail)
user << "\red The Bluespace interfaces of the two devices conflict and malfunction."
- del(W)
+ qdel(W)
return
/* //BoH+BoH=Singularity, commented out.
if(istype(W, /obj/item/weapon/storage/backpack/holding) && !W.crit_fail)
investigate_log("has become a singularity. Caused by [user.key]","singulo")
user << "\red The Bluespace interfaces of the two devices catastrophically malfunction!"
- del(W)
- var/obj/machinery/singularity/singulo = new /obj/machinery/singularity (get_turf(src))
+ qdel(W)
+ var/obj/singularity/singulo = new /obj/singularity (get_turf(src))
singulo.energy = 300 //should make it a bit bigger~
message_admins("[key_name_admin(user)] detonated a bag of holding")
log_game("[key_name(user)] detonated a bag of holding")
- del(src)
+ qdel(src)
return
*/
..()
@@ -81,7 +90,7 @@
else
user << "\red The Bluespace generator malfunctions!"
for (var/obj/O in src.contents) //it broke, delete what was in it
- del(O)
+ qdel(O)
crit_fail = 1
icon_state = "brokenpack"
@@ -95,6 +104,7 @@
storage_slots = 20
max_w_class = 3
max_storage_space = 400 // can store a ton of shit!
+ item_state_slots = null
/obj/item/weapon/storage/backpack/cultpack
name = "trophy rack"
@@ -105,61 +115,56 @@
name = "Giggles von Honkerton"
desc = "It's a backpack made by Honk! Co."
icon_state = "clownpack"
- item_state = "clownpack"
+ item_state_slots = null
/obj/item/weapon/storage/backpack/medic
name = "medical backpack"
desc = "It's a backpack especially designed for use in a sterile environment."
icon_state = "medicalpack"
- item_state = "medicalpack"
+ item_state_slots = null
/obj/item/weapon/storage/backpack/security
name = "security backpack"
desc = "It's a very robust backpack."
icon_state = "securitypack"
- item_state = "securitypack"
+ item_state_slots = null
/obj/item/weapon/storage/backpack/captain
name = "captain's backpack"
desc = "It's a special backpack made exclusively for Nanotrasen officers."
icon_state = "captainpack"
- item_state = "captainpack"
+ item_state_slots = null
/obj/item/weapon/storage/backpack/industrial
name = "industrial backpack"
desc = "It's a tough backpack for the daily grind of station life."
icon_state = "engiepack"
- item_state = "engiepack"
+ item_state_slots = null
/obj/item/weapon/storage/backpack/toxins
name = "laboratory backpack"
desc = "It's a light backpack modeled for use in laboratories and other scientific institutions."
icon_state = "toxpack"
- item_state = "toxpack"
/obj/item/weapon/storage/backpack/hydroponics
name = "herbalist's backpack"
desc = "It's a green backpack with many pockets to store plants and tools in."
icon_state = "hydpack"
- item_state = "hydpack"
/obj/item/weapon/storage/backpack/genetics
name = "geneticist backpack"
desc = "It's a backpack fitted with slots for diskettes and other workplace tools."
icon_state = "genpack"
- item_state = "genpack"
/obj/item/weapon/storage/backpack/virology
name = "sterile backpack"
desc = "It's a sterile backpack able to withstand different pathogens from entering its fabric."
icon_state = "viropack"
- item_state = "viropack"
/obj/item/weapon/storage/backpack/chemistry
name = "chemistry backpack"
desc = "It's an orange backpack which was designed to hold beakers, pill bottles and bottles."
icon_state = "chempack"
- item_state = "chempack"
/*
* Satchel Types
@@ -184,13 +189,19 @@
name = "industrial satchel"
desc = "A tough satchel with extra pockets."
icon_state = "satchel-eng"
- item_state = "engiepack"
+ item_state_slots = list(
+ slot_l_hand_str = "engiepack",
+ slot_r_hand_str = "engiepack",
+ )
/obj/item/weapon/storage/backpack/satchel_med
name = "medical satchel"
desc = "A sterile satchel used in medical departments."
icon_state = "satchel-med"
- item_state = "medicalpack"
+ item_state_slots = list(
+ slot_l_hand_str = "medicalpack",
+ slot_r_hand_str = "medicalpack",
+ )
/obj/item/weapon/storage/backpack/satchel_vir
name = "virologist satchel"
@@ -216,7 +227,10 @@
name = "security satchel"
desc = "A robust satchel for security related needs."
icon_state = "satchel-sec"
- item_state = "securitypack"
+ item_state_slots = list(
+ slot_l_hand_str = "securitypack",
+ slot_r_hand_str = "securitypack",
+ )
/obj/item/weapon/storage/backpack/satchel_hyd
name = "hydroponics satchel"
@@ -228,13 +242,17 @@
desc = "An exclusive satchel for Nanotrasen officers."
icon_state = "satchel-cap"
item_state = "captainpack"
+ item_state_slots = null
//ERT backpacks.
/obj/item/weapon/storage/backpack/ert
name = "emergency response team backpack"
desc = "A spacious backpack with lots of pockets, used by members of the Nanotrasen Emergency Response Team."
icon_state = "ert_commander"
- item_state = "backpack"
+ item_state_slots = list(
+ slot_l_hand_str = "securitypack",
+ slot_r_hand_str = "securitypack",
+ )
//Commander
/obj/item/weapon/storage/backpack/ert/commander
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 0ee5df08e0..52eaa4510d 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -162,7 +162,7 @@
usr.client.screen -= S
S.dropped(usr)
if(!S.amount)
- del S
+ qdel(S)
else
S.loc = src
@@ -207,7 +207,7 @@
N.amount = stacksize
S.amount -= stacksize
if(!S.amount)
- del S // todo: there's probably something missing here
+ qdel(S) // todo: there's probably something missing here
orient2hud(usr)
if(usr.s_active)
usr.s_active.show_to(usr)
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index 4c0c58a05a..f8be15d3e4 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -48,7 +48,7 @@
// Now make the cardboard
user << "You fold [src] flat."
new src.foldable(get_turf(src))
- del(src)
+ qdel(src)
/obj/item/weapon/storage/box/survival/
New()
@@ -243,6 +243,20 @@
new /obj/item/ammo_casing/shotgun/stunshell(src)
new /obj/item/ammo_casing/shotgun/stunshell(src)
+/obj/item/weapon/storage/box/practiceshells
+ name = "box of practice shells"
+ desc = "It has a picture of a gun and several warning symbols on the front.
WARNING: Live ammunition. Misuse may result in serious injury or death."
+
+ New()
+ ..()
+ new /obj/item/ammo_casing/shotgun/practice(src)
+ new /obj/item/ammo_casing/shotgun/practice(src)
+ new /obj/item/ammo_casing/shotgun/practice(src)
+ new /obj/item/ammo_casing/shotgun/practice(src)
+ new /obj/item/ammo_casing/shotgun/practice(src)
+ new /obj/item/ammo_casing/shotgun/practice(src)
+ new /obj/item/ammo_casing/shotgun/practice(src)
+
/obj/item/weapon/storage/box/sniperammo
name = "box of 14.5mm shells"
desc = "It has a picture of a gun and several warning symbols on the front.
WARNING: Live ammunition. Misuse may result in serious injury or death."
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index 7af6e3b16e..ff4c8eb513 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -93,27 +93,27 @@
storage_slots = 6
icon_type = "crayon"
can_hold = list(
- /obj/item/toy/crayon
+ /obj/item/weapon/pen/crayon
)
/obj/item/weapon/storage/fancy/crayons/New()
..()
- new /obj/item/toy/crayon/red(src)
- new /obj/item/toy/crayon/orange(src)
- new /obj/item/toy/crayon/yellow(src)
- new /obj/item/toy/crayon/green(src)
- new /obj/item/toy/crayon/blue(src)
- new /obj/item/toy/crayon/purple(src)
+ new /obj/item/weapon/pen/crayon/red(src)
+ new /obj/item/weapon/pen/crayon/orange(src)
+ new /obj/item/weapon/pen/crayon/yellow(src)
+ new /obj/item/weapon/pen/crayon/green(src)
+ new /obj/item/weapon/pen/crayon/blue(src)
+ new /obj/item/weapon/pen/crayon/purple(src)
update_icon()
/obj/item/weapon/storage/fancy/crayons/update_icon()
overlays = list() //resets list
overlays += image('icons/obj/crayons.dmi',"crayonbox")
- for(var/obj/item/toy/crayon/crayon in contents)
+ for(var/obj/item/weapon/pen/crayon/crayon in contents)
overlays += image('icons/obj/crayons.dmi',crayon.colourName)
/obj/item/weapon/storage/fancy/crayons/attackby(obj/item/W as obj, mob/user as mob)
- if(istype(W,/obj/item/toy/crayon))
+ if(istype(W,/obj/item/weapon/pen/crayon))
switch(W:colourName)
if("mime")
usr << "This crayon is too sad to be contained in this box."
@@ -146,8 +146,8 @@
new /obj/item/clothing/mask/smokable/cigarette(src)
create_reagents(15 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one
-/obj/item/weapon/storage/fancy/cigarettes/Del()
- del(reagents)
+/obj/item/weapon/storage/fancy/cigarettes/Destroy()
+ qdel(reagents)
..()
@@ -202,8 +202,8 @@
new /obj/item/clothing/mask/smokable/cigarette/cigar(src)
create_reagents(15 * storage_slots)
-/obj/item/weapon/storage/fancy/cigar/Del()
- del(reagents)
+/obj/item/weapon/storage/fancy/cigar/Destroy()
+ qdel(reagents)
..()
/obj/item/weapon/storage/fancy/cigar/update_icon()
diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm
index 304c59fb98..7b2c03ba4a 100644
--- a/code/game/objects/items/weapons/storage/firstaid.dm
+++ b/code/game/objects/items/weapons/storage/firstaid.dm
@@ -131,6 +131,7 @@
/obj/item/weapon/storage/firstaid/surgery
name = "surgery kit"
desc = "Contains tools for surgery."
+ storage_slots = 10
/obj/item/weapon/storage/firstaid/surgery/New()
..()
@@ -142,6 +143,9 @@
new /obj/item/weapon/retractor(src)
new /obj/item/weapon/scalpel(src)
new /obj/item/weapon/surgicaldrill(src)
+ new /obj/item/weapon/bonegel(src)
+ new /obj/item/weapon/FixOVein(src)
+ new /obj/item/stack/medical/advanced/bruise_pack(src)
return
/*
diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm
index 5dda9b89c2..89f058ba47 100644
--- a/code/game/objects/items/weapons/storage/internal.dm
+++ b/code/game/objects/items/weapons/storage/internal.dm
@@ -9,6 +9,10 @@
name = master_item.name
verbs -= /obj/item/verb/verb_pickup //make sure this is never picked up.
..()
+
+/obj/item/weapon/storage/internal/Destroy()
+ master_item = null
+ ..()
/obj/item/weapon/storage/internal/attack_hand()
return //make sure this is never picked up
diff --git a/code/game/objects/items/weapons/storage/misc.dm b/code/game/objects/items/weapons/storage/misc.dm
index 814ee3b12c..65e1bfea37 100644
--- a/code/game/objects/items/weapons/storage/misc.dm
+++ b/code/game/objects/items/weapons/storage/misc.dm
@@ -37,5 +37,4 @@
i++
/obj/item/weapon/storage/box/donut/empty
- icon_state = "donutbox0"
startswith = 0
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 495d4d7516..61786e10db 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -11,6 +11,7 @@
w_class = 3
var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
+ var/list/is_seeing = new/list() //List of mobs which are currently seeing the contents of this item's storage
var/max_w_class = 2 //Max size of objects that this object can store (in effect only if can_hold isn't set)
var/max_storage_space = 14 //The sum of the storage costs of all the items in this storage item.
var/storage_slots = 7 //The number of storage slots in this container.
@@ -23,6 +24,12 @@
var/collection_mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/use_sound = "rustle" //sound played when used. null for no sound.
+/obj/item/weapon/storage/Destroy()
+ close_all()
+ qdel(boxes)
+ qdel(closer)
+ ..()
+
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
if(!canremove)
@@ -30,7 +37,7 @@
if (ishuman(usr) || issmall(usr)) //so monkeys can take off their backpacks -- Urist
- if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
+ if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech. why?
return
if(over_object == usr && Adjacent(usr)) // this must come before the screen objects only block
@@ -44,18 +51,21 @@
//there's got to be a better way of doing this.
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
return
-
- if (!( usr.restrained() ) && !( usr.stat ))
- switch(over_object.name)
- if("r_hand")
- usr.u_equip(src)
- usr.put_in_r_hand(src)
- if("l_hand")
- usr.u_equip(src)
- usr.put_in_l_hand(src)
- src.add_fingerprint(usr)
+
+ if (( usr.restrained() ) || ( usr.stat ))
return
- return
+
+ if ((src.loc == usr) && !usr.unEquip(src))
+ return
+
+ switch(over_object.name)
+ if("r_hand")
+ usr.u_equip(src)
+ usr.put_in_r_hand(src)
+ if("l_hand")
+ usr.u_equip(src)
+ usr.put_in_l_hand(src)
+ src.add_fingerprint(usr)
/obj/item/weapon/storage/proc/return_inv()
@@ -86,6 +96,7 @@
user.client.screen += src.closer
user.client.screen += src.contents
user.s_active = src
+ is_seeing |= user
return
/obj/item/weapon/storage/proc/hide_from(mob/user as mob)
@@ -97,7 +108,7 @@
user.client.screen -= src.contents
if(user.s_active == src)
user.s_active = null
- return
+ is_seeing -= user
/obj/item/weapon/storage/proc/open(mob/user as mob)
if (src.use_sound)
@@ -109,11 +120,24 @@
show_to(user)
/obj/item/weapon/storage/proc/close(mob/user as mob)
-
src.hide_from(user)
user.s_active = null
return
+/obj/item/weapon/storage/proc/close_all()
+ for(var/mob/M in can_see_contents())
+ close(M)
+ . = 1
+
+/obj/item/weapon/storage/proc/can_see_contents()
+ var/list/cansee = list()
+ for(var/mob/M in is_seeing)
+ if(M.s_active == src && M.client)
+ cansee |= M
+ else
+ is_seeing -= M
+ return cansee
+
//This proc draws out the inventory and places the items on it. tx and ty are the upper left tile and mx, my are the bottm right.
//The numbers are calculated from the bottom-left The bottom-left slot being 1,1.
/obj/item/weapon/storage/proc/orient_objs(tx, ty, mx, my)
@@ -163,7 +187,7 @@
New(obj/item/sample as obj)
if(!istype(sample))
- del(src)
+ qdel(src)
sample_object = sample
number = 1
@@ -463,4 +487,4 @@
return depth
/obj/item/proc/get_storage_cost()
- return 2**(w_class-1) //1,2,4,8,16,...
+ return 2**(w_class-1) //1,2,4,8,16,...
diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm
index fb6829abf5..9b4f9271a2 100644
--- a/code/game/objects/items/weapons/storage/wallets.dm
+++ b/code/game/objects/items/weapons/storage/wallets.dm
@@ -11,7 +11,6 @@
/obj/item/device/flashlight/pen,
/obj/item/seeds,
/obj/item/stack/medical,
- /obj/item/toy/crayon,
/obj/item/weapon/coin,
/obj/item/weapon/dice,
/obj/item/weapon/disk,
diff --git a/code/game/objects/items/weapons/surgery_limbattachment.dm b/code/game/objects/items/weapons/surgery_limbattachment.dm
index 23e5013f1a..b52bb1bb3f 100644
--- a/code/game/objects/items/weapons/surgery_limbattachment.dm
+++ b/code/game/objects/items/weapons/surgery_limbattachment.dm
@@ -65,7 +65,7 @@
H.update_body()
M.updatehealth()
M.UpdateDamageIcon()
- del(src)
+ qdel(src)
return 1
return 0
diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm
index 383e21ff4f..55d233e3bc 100644
--- a/code/game/objects/items/weapons/surgery_tools.dm
+++ b/code/game/objects/items/weapons/surgery_tools.dm
@@ -16,7 +16,7 @@
desc = "Retracts stuff."
icon = 'icons/obj/surgery.dmi'
icon_state = "retractor"
- matter = list("metal" = 10000, "glass" = 5000)
+ matter = list(DEFAULT_WALL_MATERIAL = 10000, "glass" = 5000)
flags = CONDUCT
w_class = 2.0
origin_tech = "materials=1;biotech=1"
@@ -29,7 +29,7 @@
desc = "You think you have seen this before."
icon = 'icons/obj/surgery.dmi'
icon_state = "hemostat"
- matter = list("metal" = 5000, "glass" = 2500)
+ matter = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 2500)
flags = CONDUCT
w_class = 2.0
origin_tech = "materials=1;biotech=1"
@@ -43,7 +43,7 @@
desc = "This stops bleeding."
icon = 'icons/obj/surgery.dmi'
icon_state = "cautery"
- matter = list("metal" = 5000, "glass" = 2500)
+ matter = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 2500)
flags = CONDUCT
w_class = 2.0
origin_tech = "materials=1;biotech=1"
@@ -58,7 +58,7 @@
icon = 'icons/obj/surgery.dmi'
icon_state = "drill"
hitsound = 'sound/weapons/circsawhit.ogg'
- matter = list("metal" = 15000, "glass" = 10000)
+ matter = list(DEFAULT_WALL_MATERIAL = 15000, "glass" = 10000)
flags = CONDUCT
force = 15.0
w_class = 2.0
@@ -86,7 +86,7 @@
throwforce = 5.0
throw_speed = 3
throw_range = 5
- matter = list("metal" = 10000, "glass" = 5000)
+ matter = list(DEFAULT_WALL_MATERIAL = 10000, "glass" = 5000)
origin_tech = "materials=1;biotech=1"
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
@@ -140,7 +140,7 @@
throwforce = 9.0
throw_speed = 3
throw_range = 5
- matter = list("metal" = 20000,"glass" = 10000)
+ matter = list(DEFAULT_WALL_MATERIAL = 20000,"glass" = 10000)
origin_tech = "materials=1;biotech=1"
attack_verb = list("attacked", "slashed", "sawed", "cut")
sharp = 1
diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm
index e205f20bb0..a0af746ab4 100644
--- a/code/game/objects/items/weapons/syndie.dm
+++ b/code/game/objects/items/weapons/syndie.dm
@@ -44,7 +44,7 @@
D.open()
if(istype(T,/turf/simulated/wall))
T.dismantle_wall(1)
- del(src)
+ qdel(src)
/*Detonator, disguised as a lighter*/
diff --git a/code/game/objects/items/weapons/table_rack_parts.dm b/code/game/objects/items/weapons/table_rack_parts.dm
index 2dfc3f4730..8437a5e29f 100644
--- a/code/game/objects/items/weapons/table_rack_parts.dm
+++ b/code/game/objects/items/weapons/table_rack_parts.dm
@@ -6,7 +6,7 @@
gender = PLURAL
icon = 'icons/obj/items.dmi'
icon_state = "table_parts"
- matter = list("metal" = 3750)
+ matter = list(DEFAULT_WALL_MATERIAL = 3750)
flags = CONDUCT
attack_verb = list("slammed", "bashed", "battered", "bludgeoned", "thrashed", "whacked")
@@ -20,7 +20,7 @@
if (istype(W, /obj/item/weapon/wrench))
for(var/material_type in stack_types)
new material_type(get_turf(user))
- del(src)
+ qdel(src)
return
else
if(alter_type && alter_with && istype(W,alter_with))
@@ -28,7 +28,7 @@
if (R.use(alter_cost))
var/obj/item/new_parts = new alter_type (get_turf(loc))
user << "You modify \the [name] into \a [new_parts]."
- del(src)
+ qdel(src)
else
user << "You need at least [alter_cost] sheets to reinforce the [name]."
return
@@ -41,7 +41,7 @@
new build_type( user.loc )
user.drop_item()
- del(src)
+ qdel(src)
return
/obj/item/weapon/table_parts/reinforced
@@ -49,7 +49,7 @@
desc = "Hard table parts. Well... harder."
icon = 'icons/obj/items.dmi'
icon_state = "reinf_tableparts"
- matter = list("metal" = 7500)
+ matter = list(DEFAULT_WALL_MATERIAL = 7500)
flags = CONDUCT
stack_types = list(/obj/item/stack/sheet/metal, /obj/item/stack/rods)
@@ -87,7 +87,7 @@
new /obj/item/stack/tile/carpet( get_turf(loc) )
new /obj/item/weapon/table_parts/wood( get_turf(loc) )
user << "You pry the carpet out of the table."
- del(src)
+ qdel(src)
..()
/obj/item/weapon/table_parts/rack
diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm
index 422af1d652..67b5f007a5 100644
--- a/code/game/objects/items/weapons/tanks/jetpack.dm
+++ b/code/game/objects/items/weapons/tanks/jetpack.dm
@@ -63,7 +63,7 @@
if(allgases >= 0.005)
return 1
- del(G)
+ qdel(G)
return
/obj/item/weapon/tank/jetpack/ui_action_click()
@@ -143,5 +143,5 @@
var/allgases = G.gas["carbon_dioxide"] + G.gas["nitrogen"] + G.gas["oxygen"] + G.gas["phoron"]
if(allgases >= 0.005)
return 1
- del(G)
+ qdel(G)
return
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 04d32c49b2..f1cd0286ba 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -31,9 +31,9 @@
processing_objects.Add(src)
return
-/obj/item/weapon/tank/Del()
+/obj/item/weapon/tank/Destroy()
if(air_contents)
- del(air_contents)
+ qdel(air_contents)
processing_objects.Remove(src)
@@ -71,12 +71,12 @@
if(prob(50))
var/turf/location = src.loc
if (!( istype(location, /turf) ))
- del(src)
+ qdel(src)
if(src.air_contents)
location.assume_air(air_contents)
- del(src)
+ qdel(src)
/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
@@ -274,7 +274,7 @@
//world << "\blue Exploding Pressure: [pressure] kPa, intensity: [range]"
explosion(epicenter, round(range*0.25), round(range*0.5), round(range), round(range*1.5))
- del(src)
+ qdel(src)
else if(pressure > TANK_RUPTURE_PRESSURE)
//world << "\blue[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]"
@@ -284,7 +284,7 @@
return
T.assume_air(air_contents)
playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3)
- del(src)
+ qdel(src)
else
integrity--
diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm
index 477bce6b32..911a6334d2 100644
--- a/code/game/objects/items/weapons/tape.dm
+++ b/code/game/objects/items/weapons/tape.dm
@@ -58,7 +58,7 @@
user.put_in_hands(stuck)
stuck = null
overlays = null
- del(src)
+ qdel(src)
/obj/item/weapon/ducttape/afterattack(var/A, mob/user, flag, params)
if(!in_range(user, A) || istype(A, /obj/machinery/door) || !stuck)
diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm
index 20d96676ed..996be52663 100644
--- a/code/game/objects/items/weapons/teleportation.dm
+++ b/code/game/objects/items/weapons/teleportation.dm
@@ -21,7 +21,7 @@
item_state = "electronic"
throw_speed = 4
throw_range = 20
- matter = list("metal" = 400)
+ matter = list(DEFAULT_WALL_MATERIAL = 400)
origin_tech = "magnets=1"
/obj/item/weapon/locator/attack_self(mob/user as mob)
@@ -132,7 +132,7 @@ Frequency:
w_class = 2.0
throw_speed = 3
throw_range = 5
- matter = list("metal" = 10000)
+ matter = list(DEFAULT_WALL_MATERIAL = 10000)
origin_tech = "magnets=1;bluespace=3"
/obj/item/weapon/hand_tele/attack_self(mob/user as mob)
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index 1090431916..91b5ff6027 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -24,7 +24,7 @@
force = 5.0
throwforce = 7.0
w_class = 2.0
- matter = list("metal" = 150)
+ matter = list(DEFAULT_WALL_MATERIAL = 150)
origin_tech = "materials=1;engineering=1"
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
@@ -44,7 +44,7 @@
throwforce = 5.0
throw_speed = 3
throw_range = 5
- matter = list("metal" = 75)
+ matter = list(DEFAULT_WALL_MATERIAL = 75)
attack_verb = list("stabbed")
suicide_act(mob/user)
@@ -102,7 +102,7 @@
throw_speed = 2
throw_range = 9
w_class = 2.0
- matter = list("metal" = 80)
+ matter = list(DEFAULT_WALL_MATERIAL = 80)
origin_tech = "materials=1;engineering=1"
attack_verb = list("pinched", "nipped")
sharp = 1
@@ -144,7 +144,7 @@
w_class = 2.0
//Cost to make in the autolathe
- matter = list("metal" = 70, "glass" = 30)
+ matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 30)
//R&D tech level
origin_tech = "engineering=1"
@@ -403,21 +403,21 @@
/obj/item/weapon/weldingtool/largetank
name = "industrial welding tool"
max_fuel = 40
- matter = list("metal" = 70, "glass" = 60)
+ matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 60)
origin_tech = "engineering=2"
/obj/item/weapon/weldingtool/hugetank
name = "upgraded welding tool"
max_fuel = 80
w_class = 3.0
- matter = list("metal" = 70, "glass" = 120)
+ matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
origin_tech = "engineering=3"
/obj/item/weapon/weldingtool/experimental
name = "experimental welding tool"
max_fuel = 40
w_class = 3.0
- matter = list("metal" = 70, "glass" = 120)
+ matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
origin_tech = "engineering=4;phorontech=3"
var/last_gen = 0
@@ -444,7 +444,7 @@
throwforce = 7.0
item_state = "crowbar"
w_class = 2.0
- matter = list("metal" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 50)
origin_tech = "engineering=1"
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index bce7eabe9d..edf09f6ea8 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -112,10 +112,10 @@
name = "offhand"
unwield()
- del(src)
+ qdel(src)
wield()
- del(src)
+ qdel(src)
/obj/item/weapon/twohanded/offhand/update_icon()
return
@@ -144,12 +144,12 @@
var/obj/structure/window/W = A
new /obj/item/weapon/shard( W.loc )
- if(W.reinf) new /obj/item/stack/rods( W.loc)
+ if(W.reinf) PoolOrNew(/obj/item/stack/rods, W.loc)
if (W.dir == SOUTHWEST)
new /obj/item/weapon/shard( W.loc )
- if(W.reinf) new /obj/item/stack/rods( W.loc)
- del(A)
+ if(W.reinf) PoolOrNew(/obj/item/stack/rods, W.loc)
+ qdel(A)
/*
diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm
index 295fa0c67d..fbbc731f2a 100644
--- a/code/game/objects/items/weapons/weaponry.dm
+++ b/code/game/objects/items/weapons/weaponry.dm
@@ -177,7 +177,7 @@
if(istype(W,/obj/item/weapon/screwdriver))
user << "You finish the concealed blade weapon."
new /obj/item/weapon/butterfly(user.loc)
- del(src)
+ qdel(src)
return
/obj/item/butterflyblade
@@ -185,21 +185,21 @@
desc = "A knife blade. Unusable as a weapon without a grip."
icon = 'icons/obj/buildingobject.dmi'
icon_state = "butterfly2"
- matter = list("metal" = 5000)
+ matter = list(DEFAULT_WALL_MATERIAL = 5000)
/obj/item/butterflyhandle
name = "concealed knife grip"
desc = "A plasteel grip with screw fittings for a blade."
icon = 'icons/obj/buildingobject.dmi'
icon_state = "butterfly1"
- matter = list("metal" = 4000)
+ matter = list(DEFAULT_WALL_MATERIAL = 4000)
/obj/item/butterflyhandle/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/butterflyblade))
user << "You attach the two concealed blade parts."
new /obj/item/butterflyconstruction(user.loc)
- del(W)
- del(src)
+ qdel(W)
+ qdel(src)
return
update_icon(user)
@@ -252,8 +252,8 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
user.put_in_hands(S)
user << "You fasten the glass shard to the top of the rod with the cable."
- del(I)
- del(src)
+ qdel(I)
+ qdel(src)
update_icon(user)
else if(istype(I, /obj/item/weapon/wirecutters))
@@ -261,8 +261,8 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
user.put_in_hands(P)
user << "You fasten the wirecutters to the top of the rod with the cable, prongs outward."
- del(I)
- del(src)
+ qdel(I)
+ qdel(src)
update_icon(user)
update_icon(user)
@@ -276,7 +276,7 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
throw_range = 15
sharp = 1
edge = 1
- matter = list("metal" = 500)
+ matter = list(DEFAULT_WALL_MATERIAL = 500)
var/poisoned = 0
@@ -309,7 +309,7 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
/obj/item/weapon/energy_net/dropped()
spawn(10)
- if(src) del(src)
+ if(src) qdel(src)
/obj/item/weapon/energy_net/throw_impact(atom/hit_atom)
..()
@@ -317,7 +317,7 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
var/mob/living/M = hit_atom
if(!istype(M) || locate(/obj/effect/energy_net) in M.loc)
- del(src)
+ qdel(src)
return 0
var/turf/T = get_turf(M)
@@ -327,11 +327,11 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
M.captured = 1
net.affecting = M
T.visible_message("[M] was caught in an energy net!")
- del(src)
+ qdel(src)
// If we miss or hit an obstacle, we still want to delete the net.
spawn(10)
- if(src) del(src)
+ if(src) qdel(src)
/obj/effect/energy_net
name = "energy net"
@@ -356,7 +356,7 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
..()
processing_objects |= src
-/obj/effect/energy_net/Del()
+/obj/effect/energy_net/Destroy()
if(affecting)
var/mob/living/carbon/M = affecting
@@ -372,13 +372,13 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
if(health <=0)
density = 0
src.visible_message("The energy net is torn apart!")
- del(src)
+ qdel(src)
return
/obj/effect/energy_net/process()
if(isnull(affecting) || affecting.loc != loc)
- del(src)
+ qdel(src)
return
// Countdown begin set to -1 will stop the teleporter from firing.
@@ -411,7 +411,7 @@ obj/item/weapon/wirerod/attackby(var/obj/item/I, mob/user as mob)
playsound(affecting.loc, 'sound/effects/sparks2.ogg', 50, 1)
anim(affecting.loc,affecting,'icons/mob/mob.dmi',,"phasein",,affecting.dir)
- del(src)
+ qdel(src)
/obj/effect/energy_net/bullet_act(var/obj/item/projectile/Proj)
health -= Proj.damage
diff --git a/code/game/objects/items/weapons/weldbackpack.dm b/code/game/objects/items/weapons/weldbackpack.dm
index f1c786d3e1..74d119f417 100644
--- a/code/game/objects/items/weapons/weldbackpack.dm
+++ b/code/game/objects/items/weapons/weldbackpack.dm
@@ -22,7 +22,7 @@
user << "\red That was stupid of you."
explosion(get_turf(src),-1,0,2)
if(src)
- del(src)
+ qdel(src)
return
else
if(T.welding)
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 39b767263f..fc6ef5b99d 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -61,9 +61,6 @@
else
return null
-/atom/movable/proc/initialize()
- return
-
/obj/proc/updateUsrDialog()
if(in_use)
var/is_in_use = 0
diff --git a/code/game/objects/random/random.dm b/code/game/objects/random/random.dm
index 7508d34a94..de73e5e7b3 100644
--- a/code/game/objects/random/random.dm
+++ b/code/game/objects/random/random.dm
@@ -11,7 +11,7 @@
..()
if (!prob(spawn_nothing_percentage))
spawn_item()
- del src
+ qdel(src)
// this function should return a specific item to spawn
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index 900baea3f3..4b0501a2d1 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -4,12 +4,12 @@
var/climbable
var/breakable
var/parts
+ var/list/climbers = list()
-/obj/structure/proc/destroy()
+/obj/structure/Destroy()
if(parts)
new parts(loc)
- density = 0
- del(src)
+ ..()
/obj/structure/attack_hand(mob/user)
if(breakable)
@@ -20,14 +20,20 @@
var/mob/living/carbon/human/H = user
if(H.species.can_shred(user))
attack_generic(user,1,"slices")
+
+ if(climbers.len && !(user in climbers))
+ user.visible_message("[user.name] shakes \the [src].", \
+ "You shake \the [src].")
+ structure_shaken()
+
return ..()
/obj/structure/blob_act()
if(prob(50))
- del(src)
+ qdel(src)
/obj/structure/meteorhit(obj/O as obj)
- destroy(src)
+ qdel(src)
/obj/structure/attack_tk()
return
@@ -35,24 +41,24 @@
/obj/structure/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if(prob(50))
- del(src)
+ qdel(src)
return
if(3.0)
return
/obj/structure/meteorhit(obj/O as obj)
- del(src)
+ qdel(src)
/obj/structure/New()
..()
if(climbable)
verbs += /obj/structure/proc/climb_on
-/obj/structure/Del()
+/obj/structure/Destroy()
..()
/obj/structure/proc/climb_on()
@@ -73,7 +79,7 @@
return ..()
/obj/structure/proc/can_climb(var/mob/living/user)
- if (!can_touch(user) || !climbable)
+ if (!can_touch(user) || !climbable || (user in climbers))
return 0
if (!user.Adjacent(src))
@@ -103,25 +109,32 @@
return
usr.visible_message("[user] starts climbing onto \the [src]!")
+ climbers |= user
if(!do_after(user,50))
+ climbers -= user
return
if (!can_climb(user))
+ climbers -= user
return
usr.forceMove(get_turf(src))
if (get_turf(user) == get_turf(src))
usr.visible_message("[user] climbs onto \the [src]!")
+ climbers -= user
/obj/structure/proc/structure_shaken()
+ for(var/mob/living/M in climbers)
+ M.Weaken(1)
+ M << "You topple as you are shaken off \the [src]!"
+ climbers.Cut(1,2)
for(var/mob/living/M in get_turf(src))
-
if(M.lying) return //No spamming this on people.
- M.Weaken(5)
+ M.Weaken(3)
M << "You topple as \the [src] moves under you!"
if(prob(25))
@@ -179,5 +192,5 @@
if(!breakable || !damage || !wallbreaker)
return 0
visible_message("[user] [attack_verb] the [src] apart!")
- spawn(1) destroy()
+ spawn(1) qdel(src)
return 1
diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm
index 04eeaa5d99..fd0687dc97 100644
--- a/code/game/objects/structures/barsign.dm
+++ b/code/game/objects/structures/barsign.dm
@@ -4,7 +4,7 @@
anchored = 1
var/cult = 0
New()
- ChangeSign(pick("pinkflamingo", "magmasea", "limbo", "rustyaxe", "armokbar", "brokendrum", "meadbay", "thedamnwall", "thecavern", "cindikate", "theorchard", "thesaucyclown", "theclownshead", "whiskeyimplant", "carpecarp", "robustroadhouse", "greytide", "theredshirt"))
+ ChangeSign(pick("pinkflamingo", "magmasea", "limbo", "rustyaxe", "armokbar", "brokendrum", "meadbay", "thedamnwall", "thecavern", "cindikate", "theorchard", "thesaucyclown", "theclownshead", "whiskeyimplant", "carpecarp", "robustroadhouse", "greytide", "theredshirt","thebark","theharmbaton","theharmedbaton","thesingulo","thedrukcarp","thedrunkcarp", "scotch","officerbeersky","on"))
return
proc/ChangeSign(var/Text)
src.icon_state = "[Text]"
@@ -19,7 +19,7 @@
if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/card = I
if(access_bar in card.GetAccess())
- var/sign_type = input(user, "What would you like to change the barsign to?") as null|anything in list("Off", "Pink Flamingo", "Magma Sea", "Limbo", "Rusty Axe", "Armok Bar", "Broken Drum", "Mead Bay", "The Damn Wall", "The Cavern", "Cindi Kate", "The Orchard", "The Saucy Clown", "The Clowns Head", "Whiskey Implant", "Carpe Carp", "Robust Roadhouse", "Greytide", "The Redshirt")
+ var/sign_type = input(user, "What would you like to change the barsign to?") as null|anything in list("Off", "Pink Flamingo", "Magma Sea", "Limbo", "Rusty Axe", "Armok Bar", "Broken Drum", "Mead Bay", "The Damn Wall", "The Cavern", "Cindi Kate", "The Orchard", "The Saucy Clown", "The Clowns Head", "Whiskey Implant", "Carpe Carp", "Robust Roadhouse", "Greytide", "The Redshirt", "The Bark", "The Harm Baton", "The Harmed Baton", "The Singulo", "The Druk Carp", "The Drunk Carp", "Scotch", "Officer Beersky", "On")
if(sign_type == null)
return
else
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index d838d41e5b..64f1f9925b 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -15,8 +15,6 @@ LINEN BINS
throw_speed = 1
throw_range = 2
w_class = 2.0
- item_color = "white"
-
/obj/item/weapon/bedsheet/attack_self(mob/user as mob)
user.drop_item()
@@ -30,67 +28,51 @@ LINEN BINS
/obj/item/weapon/bedsheet/blue
icon_state = "sheetblue"
- item_color = "blue"
/obj/item/weapon/bedsheet/green
icon_state = "sheetgreen"
- item_color = "green"
/obj/item/weapon/bedsheet/orange
icon_state = "sheetorange"
- item_color = "orange"
/obj/item/weapon/bedsheet/purple
icon_state = "sheetpurple"
- item_color = "purple"
/obj/item/weapon/bedsheet/rainbow
icon_state = "sheetrainbow"
- item_color = "rainbow"
/obj/item/weapon/bedsheet/red
icon_state = "sheetred"
- item_color = "red"
/obj/item/weapon/bedsheet/yellow
icon_state = "sheetyellow"
- item_color = "yellow"
/obj/item/weapon/bedsheet/mime
icon_state = "sheetmime"
- item_color = "mime"
/obj/item/weapon/bedsheet/clown
icon_state = "sheetclown"
- item_color = "clown"
/obj/item/weapon/bedsheet/captain
icon_state = "sheetcaptain"
- item_color = "captain"
/obj/item/weapon/bedsheet/rd
icon_state = "sheetrd"
- item_color = "director"
/obj/item/weapon/bedsheet/medical
icon_state = "sheetmedical"
- item_color = "medical"
/obj/item/weapon/bedsheet/hos
icon_state = "sheethos"
- item_color = "hosred"
/obj/item/weapon/bedsheet/hop
icon_state = "sheethop"
- item_color = "hop"
/obj/item/weapon/bedsheet/ce
icon_state = "sheetce"
- item_color = "chief"
/obj/item/weapon/bedsheet/brown
icon_state = "sheetbrown"
- item_color = "brown"
/obj/structure/bedsheetbin
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 08abff9c2b..5e1a551cec 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -10,7 +10,7 @@
var/welded = 0
var/wall_mounted = 0 //never solid (You can always pass over it)
var/health = 100
- var/lastbang
+ var/breakout = 0 //if someone is currently breaking out. mutex
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate
//then open it in a populated area to crash clients.
var/open_sound = 'sound/machines/click.ogg'
@@ -146,30 +146,33 @@
for(var/atom/movable/A as mob|obj in src)//pulls everything out of the locker and hits it with an explosion
A.loc = src.loc
A.ex_act(severity++)
- del(src)
+ qdel(src)
if(2)
if(prob(50))
for (var/atom/movable/A as mob|obj in src)
A.loc = src.loc
A.ex_act(severity++)
- del(src)
+ qdel(src)
if(3)
if(prob(5))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
A.ex_act(severity++)
- del(src)
+ qdel(src)
+
+/obj/structure/closet/proc/damage(var/damage)
+ health -= damage
+ if(health <= 0)
+ for(var/atom/movable/A in src)
+ A.loc = src.loc
+ qdel(src)
/obj/structure/closet/bullet_act(var/obj/item/projectile/Proj)
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
- health -= Proj.damage
..()
- if(health <= 0)
- for(var/atom/movable/A as mob|obj in src)
- A.loc = src.loc
- del(src)
+ damage(Proj.damage)
return
@@ -178,14 +181,14 @@
if(prob(75))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
- del(src)
+ qdel(src)
/obj/structure/closet/meteorhit(obj/O as obj)
if(O.icon_state == "flaming")
for(var/mob/M in src)
M.meteorhit(O)
src.dump_contents()
- del(src)
+ qdel(src)
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(src.opened)
@@ -202,7 +205,7 @@
new /obj/item/stack/sheet/metal(src.loc)
for(var/mob/M in viewers(src))
M.show_message("\The [src] has been cut apart by [user] with \the [WT].", 3, "You hear welding.", 2)
- del(src)
+ qdel(src)
return
if(isrobot(user))
return
@@ -259,12 +262,6 @@
if(!src.open())
user << "It won't budge!"
- if(!lastbang)
- lastbang = 1
- for (var/mob/M in hearers(src, null))
- M << text("BANG, bang!", max(0, 5 - get_dist(src, M)))
- spawn(30)
- lastbang = 0
/obj/structure/closet/attack_hand(mob/user as mob)
src.add_fingerprint(user)
@@ -310,5 +307,66 @@
return
visible_message("[user] [attack_message] the [src]!")
dump_contents()
- spawn(1) del(src)
+ spawn(1) qdel(src)
return 1
+
+/obj/structure/closet/proc/req_breakout()
+ if(breakout)
+ return 0 //Already breaking out.
+ if(opened)
+ return 0 //Door's open... wait, why are you in it's contents then?
+ if(!welded)
+ return 0 //closed but not welded...
+ return 1
+
+/obj/structure/closet/proc/mob_breakout(var/mob/living/escapee)
+ var/breakout_time = 2 //2 minutes by default
+
+ if(!req_breakout())
+ return
+
+ //okay, so the closet is either welded or locked... resist!!!
+ escapee.next_move = world.time + 100
+ escapee.last_special = world.time + 100
+ escapee << "You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)"
+
+ visible_message("The [src] begins to shake violently!")
+
+ breakout = 1 //can't think of a better way to do this right now.
+ for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
+ playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1)
+ animate_shake()
+
+ if(!do_after(escapee, 50)) //5 seconds
+ breakout = 0
+ return
+ if(!escapee || escapee.stat || escapee.loc != src)
+ breakout = 0
+ return //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
+ //Perform the same set of checks as above for weld and lock status to determine if there is even still a point in 'resisting'...
+ if(!req_breakout())
+ breakout = 0
+ return
+
+ //Well then break it!
+ breakout = 0
+ escapee << "You successfully break out!"
+ visible_message("\the [escapee] successfully broke out of \the [src]!")
+ playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1)
+ break_open()
+ animate_shake()
+
+/obj/structure/closet/proc/break_open()
+ welded = 0
+ update_icon()
+ //Do this to prevent contents from being opened into nullspace (read: bluespace)
+ if(istype(loc, /obj/structure/bigDelivery))
+ var/obj/structure/bigDelivery/BD = loc
+ BD.unwrap()
+ open()
+
+/obj/structure/closet/proc/animate_shake()
+ var/init_px = pixel_x
+ var/shake_dir = pick(-1, 1)
+ animate(src, transform=turn(matrix(), 8*shake_dir), pixel_x=init_px + 2*shake_dir, time=1)
+ animate(transform=null, pixel_x=init_px, time=6, easing=ELASTIC_EASING)
diff --git a/code/game/objects/structures/crates_lockers/closets/l3closet.dm b/code/game/objects/structures/crates_lockers/closets/l3closet.dm
index bb5fe26e4f..294ee43725 100644
--- a/code/game/objects/structures/crates_lockers/closets/l3closet.dm
+++ b/code/game/objects/structures/crates_lockers/closets/l3closet.dm
@@ -18,6 +18,7 @@
/obj/structure/closet/l3closet/general/New()
..()
+ qdel(contents)
contents = list()
new /obj/item/clothing/suit/bio_suit/general( src )
new /obj/item/clothing/head/bio_hood/general( src )
@@ -30,6 +31,7 @@
/obj/structure/closet/l3closet/virology/New()
..()
+ qdel(contents)
contents = list()
new /obj/item/clothing/suit/bio_suit/virology( src )
new /obj/item/clothing/head/bio_hood/virology( src )
@@ -44,6 +46,7 @@
/obj/structure/closet/l3closet/security/New()
..()
+ qdel(contents)
contents = list()
new /obj/item/clothing/suit/bio_suit/security( src )
new /obj/item/clothing/head/bio_hood/security( src )
@@ -56,6 +59,7 @@
/obj/structure/closet/l3closet/janitor/New()
..()
+ qdel(contents)
contents = list()
new /obj/item/clothing/suit/bio_suit/janitor( src )
new /obj/item/clothing/head/bio_hood/janitor( src )
@@ -68,6 +72,7 @@
/obj/structure/closet/l3closet/scientist/New()
..()
+ qdel(contents)
contents = list()
new /obj/item/clothing/suit/bio_suit/scientist( src )
new /obj/item/clothing/head/bio_hood/scientist( src )
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
index 8fc77c5b92..2534c09caa 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
@@ -23,7 +23,7 @@
spawn(4)
// Not really the best way to do this, but it's better than "contents = list()"!
for(var/atom/movable/AM in contents)
- del(AM)
+ qdel(AM)
new /obj/item/clothing/under/color/white( src )
new /obj/item/clothing/shoes/white( src )
return
@@ -55,7 +55,7 @@
spawn(4)
// Not really the best way to do this, but it's better than "contents = list()"!
for(var/atom/movable/AM in contents)
- del(AM)
+ qdel(AM)
new /obj/item/weapon/storage/backpack/satchel/withwallet( src )
new /obj/item/device/radio/headset( src )
return
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 a3b9f39928..df2985c42e 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
@@ -132,3 +132,25 @@
overlays += "welded"
else
icon_state = icon_opened
+
+
+/obj/structure/closet/secure_closet/req_breakout()
+ if(!opened && locked) return 1
+ return ..() //It's a secure closet, but isn't locked.
+
+/obj/structure/closet/secure_closet/break_open()
+ desc += " It appears to be broken."
+ icon_state = icon_off
+ spawn()
+ flick(icon_broken, src)
+ sleep(10)
+ flick(icon_broken, src)
+ sleep(10)
+ broken = 1
+ locked = 0
+ update_icon()
+ //Do this to prevent contents from being opened into nullspace (read: bluespace)
+ if(istype(loc, /obj/structure/bigDelivery))
+ var/obj/structure/bigDelivery/BD = loc
+ BD.unwrap()
+ open()
\ No newline at end of file
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index 644f2d7531..67a159e7ca 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -40,7 +40,7 @@
desc = "If it takes forever, I will wait for you..."
if(health == 0) //meaning if the statue didn't find a valid target
- del(src)
+ qdel(src)
return
processing_objects.Add(src)
@@ -56,7 +56,7 @@
if (timer <= 0)
dump_contents()
processing_objects.Remove(src)
- del(src)
+ qdel(src)
/obj/structure/closet/statue/dump_contents()
@@ -130,4 +130,4 @@
user.dust()
dump_contents()
visible_message("[src] shatters!.")
- del(src)
+ qdel(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
index c274a237b6..31f8115b91 100644
--- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
@@ -56,12 +56,12 @@
// teehee - Ah, tg coders...
if ("delete")
- del(src)
+ qdel(src)
//If you want to re-add fire, just add "fire" = 15 to the pick list.
/*if ("fire")
new /obj/structure/closet/firecloset(src.loc)
- del(src)*/
+ qdel(src)*/
/obj/structure/closet/emcloset/legacy/New()
..()
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index 917d244afa..95e8c06e85 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -105,18 +105,18 @@
switch(severity)
if(1.0)
for(var/obj/O in src.contents)
- del(O)
- del(src)
+ qdel(O)
+ qdel(src)
return
if(2.0)
for(var/obj/O in src.contents)
if(prob(50))
- del(O)
- del(src)
+ qdel(O)
+ qdel(src)
return
if(3.0)
if (prob(50))
- del(src)
+ qdel(src)
return
else
return
diff --git a/code/game/objects/structures/crates_lockers/largecrate.dm b/code/game/objects/structures/crates_lockers/largecrate.dm
index d2b1f56eb3..5419ee2639 100644
--- a/code/game/objects/structures/crates_lockers/largecrate.dm
+++ b/code/game/objects/structures/crates_lockers/largecrate.dm
@@ -18,7 +18,7 @@
user.visible_message("[user] pries \the [src] open.", \
"You pry open \the [src].", \
"You hear splitting wood.")
- del(src)
+ qdel(src)
else
return attack_hand(user)
diff --git a/code/game/objects/structures/curtains.dm b/code/game/objects/structures/curtains.dm
index 741dc371db..dc5e309f17 100644
--- a/code/game/objects/structures/curtains.dm
+++ b/code/game/objects/structures/curtains.dm
@@ -1,20 +1,23 @@
+#define SHOWER_OPEN_LAYER OBJ_LAYER + 0.4
+#define SHOWER_CLOSED_LAYER MOB_LAYER + 0.1
+
/obj/structure/curtain
name = "curtain"
icon = 'icons/obj/curtain.dmi'
icon_state = "closed"
- layer = MOB_LAYER + 0.1
+ layer = SHOWER_OPEN_LAYER
opacity = 1
density = 0
/obj/structure/curtain/open
icon_state = "open"
- layer = OBJ_LAYER
+ layer = SHOWER_CLOSED_LAYER
opacity = 0
/obj/structure/curtain/bullet_act(obj/item/projectile/P, def_zone)
if(!P.nodamage)
visible_message("[P] tears [src] down!")
- del(src)
+ qdel(src)
else
..(P, def_zone)
@@ -27,10 +30,10 @@
opacity = !opacity
if(opacity)
icon_state = "closed"
- layer = MOB_LAYER + 0.1
+ layer = SHOWER_CLOSED_LAYER
else
icon_state = "open"
- layer = OBJ_LAYER
+ layer = SHOWER_OPEN_LAYER
/obj/structure/curtain/black
name = "black curtain"
@@ -45,3 +48,12 @@
name = "shower curtain"
color = "#ACD1E9"
alpha = 200
+
+/obj/structure/curtain/open/shower/engineering
+ color = "#FFA500"
+
+/obj/structure/curtain/open/shower/security
+ color = "#AA0000"
+
+#undef SHOWER_OPEN_LAYER
+#undef SHOWER_CLOSED_LAYER
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 4eb2236ec0..5150319f15 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -17,7 +17,7 @@
if (occupied)
new /obj/item/weapon/gun/energy/captain( src.loc )
occupied = 0
- del(src)
+ qdel(src)
if (2)
if (prob(50))
src.health -= 15
@@ -41,13 +41,13 @@
if (occupied)
new /obj/item/weapon/gun/energy/captain( src.loc )
occupied = 0
- del(src)
+ qdel(src)
/obj/structure/displaycase/meteorhit(obj/O as obj)
new /obj/item/weapon/shard( src.loc )
new /obj/item/weapon/gun/energy/captain( src.loc )
- del(src)
+ qdel(src)
/obj/structure/displaycase/proc/healthcheck()
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index 1b92926acd..a15650405e 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -166,7 +166,7 @@
if(!src || !WT.isOn()) return
user << "\blue You dissasembled the airlock assembly!"
new /obj/item/stack/sheet/metal(src.loc, 4)
- del (src)
+ qdel (src)
else
user << "\blue You need more welding fuel."
return
@@ -277,7 +277,7 @@
var/obj/machinery/door/new_airlock = new path(src.loc, src)
new_airlock.dir = src.dir
- del(src)
+ qdel(src)
else
..()
update_state()
diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm
index 074d7c7618..2608a311e3 100644
--- a/code/game/objects/structures/electricchair.dm
+++ b/code/game/objects/structures/electricchair.dm
@@ -19,7 +19,7 @@
part.loc = loc
part.master = null
part = null
- del(src)
+ qdel(src)
return
return
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
deleted file mode 100644
index f68c7ae7cb..0000000000
--- a/code/game/objects/structures/false_walls.dm
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * False Walls
- */
-/obj/structure/falsewall
- name = "wall"
- desc = "A huge chunk of metal used to seperate rooms."
- anchored = 1
- icon = 'icons/turf/walls.dmi'
- var/mineral = "metal"
- var/opening = 0
-
-/obj/structure/falsewall/New()
- relativewall_neighbours()
- ..()
-
-/obj/structure/falsewall/Del()
-
- var/temploc = src.loc
-
- spawn(10)
- for(var/turf/simulated/wall/W in range(temploc,1))
- W.relativewall()
-
- for(var/obj/structure/falsewall/W in range(temploc,1))
- W.relativewall()
-
- for(var/obj/structure/falserwall/W in range(temploc,1))
- W.relativewall()
- ..()
-
-
-/obj/structure/falsewall/relativewall()
-
- if(!density)
- icon_state = "[mineral]fwall_open"
- return
-
- var/junction = 0 //will be used to determine from which side the wall is connected to other walls
-
- for(var/turf/simulated/wall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)//Only 'like' walls connect -Sieve
- junction |= get_dir(src,W)
- for(var/obj/structure/falsewall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)
- junction |= get_dir(src,W)
- for(var/obj/structure/falserwall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)
- junction |= get_dir(src,W)
- icon_state = "[mineral][junction]"
- return
-
-/obj/structure/falsewall/attack_hand(mob/user as mob)
- if(opening)
- return
-
- if(density)
- opening = 1
- icon_state = "[mineral]fwall_open"
- flick("[mineral]fwall_opening", src)
- sleep(15)
- src.density = 0
- SetOpacity(0)
- opening = 0
- else
- opening = 1
- flick("[mineral]fwall_closing", src)
- icon_state = "[mineral]0"
- density = 1
- sleep(15)
- SetOpacity(1)
- src.relativewall()
- opening = 0
-
-/obj/structure/falsewall/update_icon()//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open
- ..()
- if(density)
- icon_state = "[mineral]0"
- src.relativewall()
- else
- icon_state = "[mineral]fwall_open"
-
-/obj/structure/falsewall/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(opening)
- user << "\red You must wait until the door has stopped moving."
- return
-
- if(density)
- var/turf/T = get_turf(src)
- if(T.density)
- user << "\red The wall is blocked!"
- return
- if(istype(W, /obj/item/weapon/screwdriver))
- user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
- if(!mineral || mineral == "metal")
- T.ChangeTurf(/turf/simulated/wall)
- else
- T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
- del(src)
-
- if( istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT:welding )
- if(!mineral)
- T.ChangeTurf(/turf/simulated/wall)
- else
- T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
- if(mineral != "phoron")//Stupid shit keeps me from pushing the attackby() to phoron walls -Sieve
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
- else
- user << "\blue You can't reach, close it first!"
-
- if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
- var/turf/T = get_turf(src)
- if(!mineral)
- T.ChangeTurf(/turf/simulated/wall)
- else
- T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
- if(mineral != "phoron")
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
-
- //DRILLING
- else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
- var/turf/T = get_turf(src)
- if(!mineral)
- T.ChangeTurf(/turf/simulated/wall)
- else
- T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
-
- else if( istype(W, /obj/item/weapon/melee/energy/blade) )
- var/turf/T = get_turf(src)
- if(!mineral)
- T.ChangeTurf(/turf/simulated/wall)
- else
- T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
- if(mineral != "phoron")
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
-
-/obj/structure/falsewall/update_icon()//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open
- ..()
- if(density)
- icon_state = "[mineral]0"
- src.relativewall()
- else
- icon_state = "[mineral]fwall_open"
-
-/*
- * False R-Walls
- */
-
-/obj/structure/falserwall
- name = "reinforced wall"
- desc = "A huge chunk of reinforced metal used to seperate rooms."
- icon = 'icons/turf/walls.dmi'
- icon_state = "r_wall"
- density = 1
- opacity = 1
- anchored = 1
- var/mineral = "metal"
- var/opening = 0
-
-/obj/structure/falserwall/New()
- relativewall_neighbours()
- ..()
-
-
-/obj/structure/falserwall/attack_hand(mob/user as mob)
- if(opening)
- return
-
- if(density)
- opening = 1
- // Open wall
- icon_state = "frwall_open"
- flick("frwall_opening", src)
- sleep(15)
- density = 0
- SetOpacity(0)
- opening = 0
- else
- opening = 1
- icon_state = "r_wall"
- flick("frwall_closing", src)
- density = 1
- sleep(15)
- SetOpacity(1)
- relativewall()
- opening = 0
-
-/obj/structure/falserwall/relativewall()
-
- if(!density)
- icon_state = "frwall_open"
- return
-
- var/junction = 0 //will be used to determine from which side the wall is connected to other walls
-
- for(var/turf/simulated/wall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)//Only 'like' walls connect -Sieve
- junction |= get_dir(src,W)
- for(var/obj/structure/falsewall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)
- junction |= get_dir(src,W)
- for(var/obj/structure/falserwall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)
- junction |= get_dir(src,W)
- icon_state = "rwall[junction]"
- return
-
-
-
-/obj/structure/falserwall/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(opening)
- user << "\red You must wait until the door has stopped moving."
- return
-
- if(istype(W, /obj/item/weapon/screwdriver))
- var/turf/T = get_turf(src)
- user.visible_message("[user] tightens some bolts on the r wall.", "You tighten the bolts on the wall.")
- T.ChangeTurf(/turf/simulated/wall) //Intentionally makes a regular wall instead of an r-wall (no cheap r-walls for you).
- del(src)
-
- if( istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
- var/turf/T = get_turf(src)
- T.ChangeTurf(/turf/simulated/wall)
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
-
- else if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
- var/turf/T = get_turf(src)
- T.ChangeTurf(/turf/simulated/wall)
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
-
- //DRILLING
- else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
- var/turf/T = get_turf(src)
- T.ChangeTurf(/turf/simulated/wall)
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
-
- else if( istype(W, /obj/item/weapon/melee/energy/blade) )
- var/turf/T = get_turf(src)
- T.ChangeTurf(/turf/simulated/wall)
- T = get_turf(src)
- T.attackby(W,user)
- del(src)
-
-
-/*
- * Uranium Falsewalls
- */
-
-/obj/structure/falsewall/uranium
- name = "uranium wall"
- desc = "A wall with uranium plating. This is probably a bad idea."
- icon_state = ""
- mineral = "uranium"
- var/active = null
- var/last_event = 0
-
-/obj/structure/falsewall/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob)
- radiate()
- ..()
-
-/obj/structure/falsewall/uranium/attack_hand(mob/user as mob)
- radiate()
- ..()
-
-/obj/structure/falsewall/uranium/proc/radiate()
- if(!active)
- if(world.time > last_event+15)
- active = 1
- for(var/mob/living/L in range(3,src))
- L.apply_effect(12,IRRADIATE,0)
- for(var/turf/simulated/wall/mineral/uranium/T in range(3,src))
- T.radiate()
- last_event = world.time
- active = null
- return
- return
-/*
- * Other misc falsewall types
- */
-
-/obj/structure/falsewall/gold
- name = "gold wall"
- desc = "A wall with gold plating. Swag!"
- icon_state = ""
- mineral = "gold"
-
-/obj/structure/falsewall/silver
- name = "silver wall"
- desc = "A wall with silver plating. Shiny."
- icon_state = ""
- mineral = "silver"
-
-/obj/structure/falsewall/diamond
- name = "diamond wall"
- desc = "A wall with diamond plating. You monster."
- icon_state = ""
- mineral = "diamond"
-
-/obj/structure/falsewall/phoron
- name = "phoron wall"
- desc = "A wall with phoron plating. This is definately a bad idea."
- icon_state = ""
- mineral = "phoron"
-
-/obj/structure/falsewall/sandstone
- name = "sandstone wall"
- desc = "A wall with sandstone plating."
- icon_state = ""
- mineral = "sandstone"
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index c73c955701..e8cb65a33d 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -6,6 +6,13 @@
var/state = 0
var/health = 200
var/cover = 50 //how much cover the girder provides against projectiles.
+ var/material/reinf_material
+
+/obj/structure/girder/displaced
+ icon_state = "displaced"
+ anchored = 0
+ health = 50
+ cover = 25
/obj/structure/girder/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
if(!damage || !wallbreaker)
@@ -30,159 +37,168 @@
health -= damage
..()
if(health <= 0)
- new /obj/item/stack/sheet/metal(get_turf(src))
- del(src)
+ dismantle()
return
+/obj/structure/girder/proc/reset_girder()
+ cover = initial(cover)
+ health = min(health,initial(health))
+ state = 0
+ icon_state = initial(icon_state)
+ if(reinf_material)
+ reinforce_girder()
+
/obj/structure/girder/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench) && state == 0)
- if(anchored && !istype(src,/obj/structure/girder/displaced))
+ if(anchored && !reinf_material)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
- user << "\blue Now disassembling the girder"
+ user << "Now disassembling the girder..."
if(do_after(user,40))
if(!src) return
- user << "\blue You dissasembled the girder!"
+ user << "You dissasembled the girder!"
dismantle()
else if(!anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
- user << "\blue Now securing the girder"
+ user << "Now securing the girder..."
if(get_turf(user, 40))
- user << "\blue You secured the girder!"
- new/obj/structure/girder( src.loc )
- del(src)
+ user << "You secured the girder!"
+ reset_girder()
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
- user << "\blue Now slicing apart the girder"
+ user << "Now slicing apart the girder..."
if(do_after(user,30))
if(!src) return
- user << "\blue You slice apart the girder!"
+ user << "You slice apart the girder!"
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill))
- user << "\blue You drill through the girder!"
+ user << "You drill through the girder!"
dismantle()
- else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 && istype(src,/obj/structure/girder/reinforced))
+ else if(istype(W, /obj/item/weapon/screwdriver) && state == 2)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
- user << "\blue Now unsecuring support struts"
+ user << "Now unsecuring support struts..."
if(do_after(user,40))
if(!src) return
- user << "\blue You unsecured the support struts!"
+ user << "You unsecured the support struts!"
state = 1
- else if(istype(W, /obj/item/weapon/wirecutters) && istype(src,/obj/structure/girder/reinforced) && state == 1)
+ else if(istype(W, /obj/item/weapon/wirecutters) && state == 1)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
- user << "\blue Now removing support struts"
+ user << "Now removing support struts..."
if(do_after(user,40))
if(!src) return
- user << "\blue You removed the support struts!"
- new/obj/structure/girder( src.loc )
- del(src)
+ user << "You removed the support struts!"
+ reinf_material.place_dismantled_product(get_turf(src))
+ reinf_material = null
+ reset_girder()
- else if(istype(W, /obj/item/weapon/crowbar) && state == 0 && anchored )
+ else if(istype(W, /obj/item/weapon/crowbar) && state == 0 && anchored)
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
- user << "\blue Now dislodging the girder"
+ user << "Now dislodging the girder..."
if(do_after(user, 40))
if(!src) return
- user << "\blue You dislodged the girder!"
- new/obj/structure/girder/displaced( src.loc )
- del(src)
+ user << "You dislodged the girder!"
+ icon_state = "displaced"
+ anchored = 0
+ health = 50
+ cover = 25
else if(istype(W, /obj/item/stack/sheet))
var/obj/item/stack/sheet/S = W
- switch(S.type)
+ if(S.get_amount() < 2)
+ return ..()
- if(/obj/item/stack/sheet/metal, /obj/item/stack/sheet/metal/cyborg)
- if(!anchored)
- if(S.use(2))
- user << "You create a false wall! Push on it to open or close the passage."
- new /obj/structure/falsewall (src.loc)
- del(src)
- else
- if(S.get_amount() < 2) return ..()
- user << "Now adding plating..."
- if (do_after(user,40))
- if (S.use(2))
- user << "You added the plating!"
- var/turf/Tsrc = get_turf(src)
- Tsrc.ChangeTurf(/turf/simulated/wall)
- for(var/turf/simulated/wall/X in Tsrc.loc)
- if(X) X.add_hiddenprint(usr)
- del(src)
- return
-
- if(/obj/item/stack/sheet/plasteel, /obj/item/stack/sheet/plasteel/cyborg)
- if(!anchored)
- if(S.use(2))
- user << "\blue You create a false wall! Push on it to open or close the passage."
- new /obj/structure/falserwall (src.loc)
- del(src)
- else
- if (src.icon_state == "reinforced") //I cant believe someone would actually write this line of code...
- if(S.get_amount() < 1) return ..()
- user << "Now finalising reinforced wall."
- if(do_after(user, 50))
- if (S.use(1))
- user << "Wall fully reinforced!"
- var/turf/Tsrc = get_turf(src)
- Tsrc.ChangeTurf(/turf/simulated/wall/r_wall)
- for(var/turf/simulated/wall/r_wall/X in Tsrc.loc)
- if(X) X.add_hiddenprint(usr)
- del(src)
- return
- else
- if(S.get_amount() < 1) return ..()
- user << "Now reinforcing girders..."
- if (do_after(user,60))
- if(S.use(1))
- user << "Girders reinforced!"
- new/obj/structure/girder/reinforced( src.loc )
- del(src)
- return
-
- if(S.sheettype)
- var/M = S.sheettype
- // 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"))
- user << "You cannot plate the girder in that material."
- return
- if(!anchored)
- if(S.amount < 2) return
- S.use(2)
- user << "\blue You create a false wall! Push on it to open or close the passage."
- var/F = text2path("/obj/structure/falsewall/[M]")
- new F (src.loc)
- del(src)
- else
- if(S.amount < 2) return ..()
- user << "\blue Now adding plating..."
- if (do_after(user,40))
- if(!src || !S || S.amount < 2) return
- S.use(2)
- user << "\blue You added the plating!"
- var/turf/Tsrc = get_turf(src)
- Tsrc.ChangeTurf(text2path("/turf/simulated/wall/mineral/[M]"))
- for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
- if(X) X.add_hiddenprint(usr)
- del(src)
- return
+ var/material/M = name_to_material[S.sheettype]
+ if(!istype(M))
+ return ..()
+ var/wall_fake
add_hiddenprint(usr)
+ if(M.integrity < 50)
+ user << "This material is too soft for use in wall construction."
+ return
+
+ user << "You begin adding the plating..."
+
+ if(!do_after(user,40) || !S.use(2))
+ return
+
+ if(anchored)
+ user << "You added the plating!"
+ else
+ user << "You create a false wall! Push on it to open or close the passage."
+ wall_fake = 1
+
+ var/turf/Tsrc = get_turf(src)
+ Tsrc.ChangeTurf(/turf/simulated/wall)
+ var/turf/simulated/wall/T = get_turf(src)
+ T.set_material(M, reinf_material)
+ if(wall_fake)
+ T.can_open = 1
+ T.add_hiddenprint(usr)
+ qdel(src)
+ return
+
else if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
user.drop_item()
P.loc = src.loc
- user << "\blue You fit the pipe into the [src]!"
+ user << "You fit the pipe into the [src]!"
else
..()
+/obj/structure/girder/proc/reinforce_girder()
+ cover = reinf_material.hardness
+ health = 500
+ state = 2
+ icon_state = "reinforced"
+
+/obj/structure/girder/verb/reinforce_with_material()
+ set name = "Reinforce girder"
+ set desc = "Reinforce a girder with metal."
+ set src in view(1)
+
+ var/mob/living/user = usr
+ if(!istype(user) || !(user.l_hand || user.r_hand))
+ return
+
+ if(reinf_material)
+ user << "\The [src] is already reinforced."
+ return
+
+ var/obj/item/stack/sheet/S = user.l_hand
+ if(!istype(S))
+ S = user.r_hand
+ if(!istype(S))
+ user << "You cannot plate \the [src] with that."
+ return
+
+ if(S.get_amount() < 2)
+ user << "There is not enough material here to reinforce the girder."
+ return
+
+ var/material/M = name_to_material[S.sheettype]
+ if(!istype(M) || M.integrity < 50)
+ user << "You cannot reinforce \the [src] with that; it is too soft."
+ return
+
+ user << "Now reinforcing..."
+ if (!do_after(user,40) || !S.use(2))
+ return
+ user << "You added reinforcement!"
+
+ reinf_material = M
+ reinforce_girder()
+
+
/obj/structure/girder/proc/dismantle()
new /obj/item/stack/sheet/metal(get_turf(src))
- del(src)
+ qdel(src)
/obj/structure/girder/attack_hand(mob/user as mob)
if (HULK in user.mutations)
@@ -193,111 +209,50 @@
/obj/structure/girder/blob_act()
if(prob(40))
- del(src)
+ qdel(src)
/obj/structure/girder/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(30))
- var/remains = pick(/obj/item/stack/rods,/obj/item/stack/sheet/metal)
- new remains(loc)
- del(src)
+ dismantle()
return
if(3.0)
if (prob(5))
- var/remains = pick(/obj/item/stack/rods,/obj/item/stack/sheet/metal)
- new remains(loc)
- del(src)
+ dismantle()
return
else
return
-/obj/structure/girder/displaced
- icon_state = "displaced"
- anchored = 0
- health = 50
- cover = 25
-
-/obj/structure/girder/reinforced
- icon_state = "reinforced"
- state = 2
- health = 500
- cover = 80
-
-/obj/structure/cultgirder
+/obj/structure/girder/cult
icon= 'icons/obj/cult.dmi'
icon_state= "cultgirder"
- anchored = 1
- density = 1
- layer = 2
- var/health = 250
- var/cover = 70
+ health = 250
+ cover = 70
-/obj/structure/cultgirder/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
- if(!damage || !wallbreaker)
- return 0
- visible_message("[user] [attack_message] the [src]!")
- dismantle()
- return 1
-
-/obj/structure/cultgirder/proc/dismantle()
+/obj/structure/girder/cult/dismantle()
new /obj/effect/decal/remains/human(get_turf(src))
- del(src)
+ qdel(src)
-/obj/structure/cultgirder/attackby(obj/item/W as obj, mob/user as mob)
+/obj/structure/girder/cult/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
- user << "\blue Now disassembling the girder"
+ user << "Now disassembling the girder..."
if(do_after(user,40))
- user << "\blue You dissasembled the girder!"
+ user << "You dissasembled the girder!"
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
- user << "\blue Now slicing apart the girder"
+ user << "Now slicing apart the girder..."
if(do_after(user,30))
- user << "\blue You slice apart the girder!"
+ user << "You slice apart the girder!"
dismantle()
else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill))
- user << "\blue You drill through the girder!"
+ user << "You drill through the girder!"
new /obj/effect/decal/remains/human(get_turf(src))
dismantle()
-
-/obj/structure/cultgirder/blob_act()
- if(prob(40))
- dismantle()
-
-/obj/structure/cultgirder/bullet_act(var/obj/item/projectile/Proj) //No beam check- How else will you destroy the cult girder with silver bullets?????
- //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
-
- //Tasers and the like should not damage cultgirders.
- if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
- return
-
- health -= Proj.damage
- ..()
- if(health <= 0)
- dismantle()
- return
-
-/obj/structure/cultgirder/ex_act(severity)
- switch(severity)
- if(1.0)
- del(src)
- return
- if(2.0)
- if (prob(30))
- dismantle()
- return
- if(3.0)
- if (prob(5))
- dismantle()
- return
- else
- return
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index dda21468a4..b18658d4a6 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -8,19 +8,19 @@
flags = CONDUCT
pressure_resistance = 5*ONE_ATMOSPHERE
layer = 2.9
- explosion_resistance = 5
+ explosion_resistance = 1
var/health = 10
var/destroyed = 0
/obj/structure/grille/ex_act(severity)
- del(src)
+ qdel(src)
/obj/structure/grille/blob_act()
- del(src)
+ qdel(src)
/obj/structure/grille/meteorhit(var/obj/M)
- del(src)
+ qdel(src)
/obj/structure/grille/update_icon()
if(destroyed)
@@ -103,8 +103,8 @@
if(iswirecutter(W))
if(!shock(user, 100))
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
- new /obj/item/stack/rods(loc, 2)
- del(src)
+ PoolOrNew(/obj/item/stack/rods, list(get_turf(src), destroyed ? 1 : 2))
+ qdel(src)
else if((isscrewdriver(W)) && (istype(loc, /turf/simulated) || anchored))
if(!shock(user, 90))
playsound(loc, 'sound/items/Screwdriver.ogg', 100, 1)
@@ -173,12 +173,12 @@
density = 0
destroyed = 1
update_icon()
- new /obj/item/stack/rods(loc)
+ PoolOrNew(/obj/item/stack/rods, get_turf(src))
else
if(health <= -6)
- new /obj/item/stack/rods(loc)
- del(src)
+ PoolOrNew(/obj/item/stack/rods, get_turf(src))
+ qdel(src)
return
return
@@ -221,6 +221,16 @@
spawn(1) healthcheck()
return 1
+// Used in mapping to avoid
+/obj/structure/grille/broken
+ destroyed = 1
+ icon_state = "grille-b"
+ density = 0
+ New()
+ ..()
+ health = rand(-5, -1) //In the destroyed but not utterly threshold.
+ healthcheck() //Send this to healthcheck just in case we want to do something else with it.
+
/obj/structure/grille/cult
name = "cult grille"
desc = "A matrice built out of an unknown material, with some sort of force field blocking air around it"
diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm
index 4bbb01a9c5..a9b1359b75 100644
--- a/code/game/objects/structures/inflatable.dm
+++ b/code/game/objects/structures/inflatable.dm
@@ -11,7 +11,7 @@
var/obj/structure/inflatable/R = new /obj/structure/inflatable(user.loc)
src.transfer_fingerprints_to(R)
R.add_fingerprint(user)
- del(src)
+ qdel(src)
/obj/structure/inflatable
name = "inflatable wall"
@@ -30,7 +30,7 @@
..()
update_nearby_tiles(need_rebuild=1)
-/obj/structure/inflatable/Del()
+/obj/structure/inflatable/Destroy()
update_nearby_tiles()
..()
@@ -50,7 +50,7 @@
/obj/structure/inflatable/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
deflate(1)
@@ -94,14 +94,14 @@
visible_message("[src] rapidly deflates!")
var/obj/item/inflatable/torn/R = new /obj/item/inflatable/torn(loc)
src.transfer_fingerprints_to(R)
- del(src)
+ qdel(src)
else
//user << "\blue You slowly deflate the inflatable wall."
visible_message("[src] slowly deflates.")
spawn(50)
var/obj/item/inflatable/R = new /obj/item/inflatable(loc)
src.transfer_fingerprints_to(R)
- del(src)
+ qdel(src)
/obj/structure/inflatable/verb/hand_deflate()
set name = "Deflate"
@@ -134,7 +134,7 @@
var/obj/structure/inflatable/door/R = new /obj/structure/inflatable/door(user.loc)
src.transfer_fingerprints_to(R)
R.add_fingerprint(user)
- del(src)
+ qdel(src)
/obj/structure/inflatable/door //Based on mineral door code
name = "inflatable door"
@@ -219,13 +219,13 @@
visible_message("[src] rapidly deflates!")
var/obj/item/inflatable/door/torn/R = new /obj/item/inflatable/door/torn(loc)
src.transfer_fingerprints_to(R)
- del(src)
+ qdel(src)
else
visible_message("[src] slowly deflates.")
spawn(50)
var/obj/item/inflatable/door/R = new /obj/item/inflatable/door(loc)
src.transfer_fingerprints_to(R)
- del(src)
+ qdel(src)
/obj/item/inflatable/torn
name = "torn inflatable wall"
diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm
index de2fef2875..e865805991 100644
--- a/code/game/objects/structures/kitchen_spike.dm
+++ b/code/game/objects/structures/kitchen_spike.dm
@@ -20,8 +20,8 @@
else
if(spike(G.affecting))
visible_message("[user] has forced [G.affecting] onto the spike, killing them instantly!")
- del(G.affecting)
- del(G)
+ qdel(G.affecting)
+ qdel(G)
else
user << "They are too big for the spike, try something smaller!"
diff --git a/code/game/objects/structures/lamarr_cage.dm b/code/game/objects/structures/lamarr_cage.dm
index 6bbb8cfa24..3c32052d72 100644
--- a/code/game/objects/structures/lamarr_cage.dm
+++ b/code/game/objects/structures/lamarr_cage.dm
@@ -15,7 +15,7 @@
if (1)
new /obj/item/weapon/shard( src.loc )
Break()
- del(src)
+ qdel(src)
if (2)
if (prob(50))
src.health -= 15
@@ -37,13 +37,13 @@
if (prob(75))
new /obj/item/weapon/shard( src.loc )
Break()
- del(src)
+ qdel(src)
/obj/structure/lamarr/meteorhit(obj/O as obj)
new /obj/item/weapon/shard( src.loc )
Break()
- del(src)
+ qdel(src)
/obj/structure/lamarr/proc/healthcheck()
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index a32af450d5..078f4bc06b 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -13,10 +13,10 @@
///// Z-Level Stuff
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/floor/open)))
///// Z-Level Stuff
- del(src)
+ qdel(src)
for(var/obj/structure/lattice/LAT in src.loc)
if(LAT != src)
- del(LAT)
+ qdel(LAT)
icon = 'icons/obj/smoothlattice.dmi'
icon_state = "latticeblank"
updateOverlays()
@@ -26,7 +26,7 @@
L = locate(/obj/structure/lattice, get_step(src, dir))
L.updateOverlays()
-/obj/structure/lattice/Del()
+/obj/structure/lattice/Destroy()
for (var/dir in cardinal)
var/obj/structure/lattice/L
if(locate(/obj/structure/lattice, get_step(src, dir)))
@@ -35,16 +35,16 @@
..()
/obj/structure/lattice/blob_act()
- del(src)
+ qdel(src)
return
/obj/structure/lattice/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
- del(src)
+ qdel(src)
return
if(3.0)
return
@@ -61,14 +61,14 @@
var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user))
user << "\blue Slicing lattice joints ..."
- new /obj/item/stack/rods(src.loc)
- del(src)
+ PoolOrNew(/obj/item/stack/rods, src.loc)
+ qdel(src)
return
/obj/structure/lattice/proc/updateOverlays()
//if(!(istype(src.loc, /turf/space)))
- // del(src)
+ // qdel(src)
spawn(1)
overlays = list()
diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm
index 8ce25ddb67..695b11db95 100644
--- a/code/game/objects/structures/mineral_doors.dm
+++ b/code/game/objects/structures/mineral_doors.dm
@@ -10,7 +10,7 @@
icon = 'icons/obj/doors/mineral_doors.dmi'
icon_state = "metal"
- var/mineralType = "metal"
+ var/mineralType = DEFAULT_WALL_MATERIAL
var/state = 0 //closed, 1 == open
var/isSwitchingStates = 0
var/hardness = 1
@@ -22,7 +22,7 @@
name = "[mineralType] door"
update_nearby_tiles(need_rebuild=1)
- Del()
+ Destroy()
update_nearby_tiles()
..()
@@ -119,25 +119,11 @@
Dismantle(1)
proc/Dismantle(devastated = 0)
- if(!devastated)
- if (mineralType == "metal")
- var/ore = /obj/item/stack/sheet/metal
- for(var/i = 1, i <= oreAmount, i++)
- new ore(get_turf(src))
- else
- var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
- for(var/i = 1, i <= oreAmount, i++)
- new ore(get_turf(src))
- else
- if (mineralType == "metal")
- var/ore = /obj/item/stack/sheet/metal
- for(var/i = 3, i <= oreAmount, i++)
- new ore(get_turf(src))
- else
- var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
- for(var/i = 3, i <= oreAmount, i++)
- new ore(get_turf(src))
- del(src)
+ var/material/M = name_to_material[mineralType]
+ if(istype(M))
+ for(var/i = (devastated? 1 : 3), i <= oreAmount, i++)
+ new M.stack_type(get_turf(src))
+ qdel(src)
ex_act(severity = 1)
switch(severity)
@@ -155,7 +141,7 @@
return
/obj/structure/mineral_door/iron
- mineralType = "metal"
+ mineralType = "iron"
hardness = 3
/obj/structure/mineral_door/silver
@@ -168,7 +154,7 @@
/obj/structure/mineral_door/uranium
mineralType = "uranium"
hardness = 3
- luminosity = 2
+ light_range = 2
/obj/structure/mineral_door/sandstone
mineralType = "sandstone"
@@ -239,7 +225,7 @@
if(!devastated)
for(var/i = 1, i <= oreAmount, i++)
new/obj/item/stack/sheet/wood(get_turf(src))
- del(src)
+ qdel(src)
/obj/structure/mineral_door/resin
mineralType = "resin"
@@ -279,7 +265,7 @@
isSwitchingStates = 0
Dismantle(devastated = 0)
- del(src)
+ qdel(src)
CheckHardness()
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index f0a5b9003a..4868f6e0ca 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -91,5 +91,5 @@
vox.real_name = newname
vox.name = vox.real_name
raiders.update_access(vox)
- del(user)
+ qdel(user)
..()
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index f30c4d854d..599e8aabc8 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -36,21 +36,21 @@
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(5))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
return
@@ -64,7 +64,7 @@
A.loc = src
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
//src.connected = null
- del(src.connected)
+ qdel(src.connected)
else
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
src.connected = new /obj/structure/m_tray( src.loc )
@@ -80,7 +80,7 @@
src.connected.set_dir(src.dir)
else
//src.connected = null
- del(src.connected)
+ qdel(src.connected)
src.add_fingerprint(user)
update()
return
@@ -116,7 +116,7 @@
src.connected.icon_state = "morguet"
else
//src.connected = null
- del(src.connected)
+ qdel(src.connected)
return
@@ -144,7 +144,7 @@
src.connected.update()
add_fingerprint(user)
//SN src = null
- del(src)
+ qdel(src)
return
return
@@ -195,21 +195,21 @@
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(5))
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
ex_act(severity)
- del(src)
+ qdel(src)
return
return
@@ -232,7 +232,7 @@
A.loc = src
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
//src.connected = null
- del(src.connected)
+ qdel(src.connected)
else if (src.locked == 0)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
src.connected = new /obj/structure/c_tray( src.loc )
@@ -247,7 +247,7 @@
src.connected.icon_state = "cremat"
else
//src.connected = null
- del(src.connected)
+ qdel(src.connected)
src.add_fingerprint(user)
update()
@@ -282,7 +282,7 @@
src.connected.icon_state = "cremat"
else
//src.connected = null
- del(src.connected)
+ qdel(src.connected)
return
/obj/structure/crematorium/proc/cremate(atom/A, mob/user as mob)
@@ -323,10 +323,10 @@
//log_attack("\[[time_stamp()]\] [user]/[user.ckey] cremated [M]/[M.ckey]")
M.death(1)
M.ghostize()
- del(M)
+ qdel(M)
for(var/obj/O in contents) //obj instead of obj/item so that bodybags and ashes get destroyed. We dont want tons and tons of ash piling up
- del(O)
+ qdel(O)
new /obj/effect/decal/cleanable/ash(src)
sleep(30)
@@ -360,7 +360,7 @@
src.connected.update()
add_fingerprint(user)
//SN src = null
- del(src)
+ qdel(src)
return
return
diff --git a/code/game/objects/structures/signs.dm b/code/game/objects/structures/signs.dm
index 0b11d09fcc..f5c988ae97 100644
--- a/code/game/objects/structures/signs.dm
+++ b/code/game/objects/structures/signs.dm
@@ -8,19 +8,19 @@
/obj/structure/sign/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
- del(src)
+ qdel(src)
return
if(3.0)
- del(src)
+ qdel(src)
return
else
return
/obj/structure/sign/blob_act()
- del(src)
+ qdel(src)
return
/obj/structure/sign/attackby(obj/item/tool as obj, mob/user as mob) //deconstruction
@@ -33,7 +33,7 @@
//var/icon/I = icon('icons/obj/decals.dmi', icon_state)
//S.icon = I.Scale(24, 24)
S.sign_state = icon_state
- del(src)
+ qdel(src)
else ..()
/obj/item/sign
@@ -62,7 +62,7 @@
S.desc = desc
S.icon_state = sign_state
user << "You fasten \the [S] with your [tool]."
- del(src)
+ qdel(src)
else ..()
/obj/structure/sign/double/map
diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
index fad0c3d0bd..46cf8ffcd8 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
@@ -79,5 +79,5 @@
/obj/structure/bed/nest/proc/healthcheck()
if(health <=0)
density = 0
- del(src)
+ qdel(src)
return
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 957d6009f1..586a11d181 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -20,27 +20,27 @@
/obj/structure/bed/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(5))
- del(src)
+ qdel(src)
return
/obj/structure/bed/blob_act()
if(prob(75))
new /obj/item/stack/sheet/metal(src.loc)
- del(src)
+ qdel(src)
/obj/structure/bed/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
new /obj/item/stack/sheet/metal(src.loc)
- del(src)
+ qdel(src)
else if(istype(W, /obj/item/weapon/grab))
user.visible_message("[user] attempts to buckle [W:affecting] into \the [src]!")
if(do_after(user, 20))
@@ -50,7 +50,6 @@
"[W:affecting.name] is buckled to [src] by [user.name]!",\
"You are buckled to [src] by [user.name]!",\
"You hear metal clanking.")
-
else
..()
@@ -81,7 +80,7 @@
visible_message("[user] collapses \the [src.name].")
new/obj/item/roller(get_turf(src))
spawn(0)
- del(src)
+ qdel(src)
return
..()
@@ -95,7 +94,7 @@
/obj/item/roller/attack_self(mob/user)
var/obj/structure/bed/roller/R = new /obj/structure/bed/roller(user.loc)
R.add_fingerprint(user)
- del(src)
+ qdel(src)
/obj/item/roller/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -129,7 +128,7 @@
user << "\blue You deploy the roller bed."
var/obj/structure/bed/roller/R = new /obj/structure/bed/roller(user.loc)
R.add_fingerprint(user)
- del(held)
+ qdel(held)
held = null
@@ -163,5 +162,5 @@
visible_message("[usr] collapses \the [src.name].")
new/obj/item/roller(get_turf(src))
spawn(0)
- del(src)
+ qdel(src)
return
diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
index c8746e1919..b811294a07 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
@@ -26,7 +26,7 @@
E.part = SK
SK.loc = E
SK.master = E
- del(src)
+ qdel(src)
/obj/structure/bed/chair/attack_tk(mob/user as mob)
if(buckled_mob)
@@ -79,7 +79,7 @@
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
new /obj/item/stack/sheet/wood(src.loc)
- del(src)
+ qdel(src)
else
..()
diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
index 16e9161dcf..8de3bcf0a5 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
@@ -13,7 +13,7 @@
user.remove_from_mob(src)
var/obj/item/stack/sheet/metal/m = new/obj/item/stack/sheet/metal
m.loc = get_turf(src)
- del src
+ qdel(src)
var/mob/living/T = M
T.Weaken(10)
T.apply_damage(20)
@@ -23,25 +23,25 @@
/obj/item/weapon/stool/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
if (prob(50))
- del(src)
+ qdel(src)
return
if(3.0)
if (prob(5))
- del(src)
+ qdel(src)
return
/obj/item/weapon/stool/blob_act()
if(prob(75))
new /obj/item/stack/sheet/metal(src.loc)
- del(src)
+ qdel(src)
/obj/item/weapon/stool/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
new /obj/item/stack/sheet/metal(src.loc)
- del(src)
+ qdel(src)
..()
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index d14ddf1405..f206bfc11f 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -59,11 +59,11 @@
..()
for(var/obj/structure/table/T in src.loc)
if(T != src)
- del(T)
+ qdel(T)
update_icon()
update_adjacent()
-/obj/structure/table/Del()
+/obj/structure/table/Destroy()
update_adjacent()
..()
@@ -328,7 +328,7 @@
return 0
else
visible_message("[src] breaks down!")
- destroy()
+ qdel(src)
return 1
return 1
@@ -375,7 +375,7 @@
G.affecting.loc = src.loc
G.affecting.Weaken(5)
visible_message("[G.assailant] puts [G.affecting] on \the [src].")
- del(W)
+ qdel(W)
return
// Handle dissembly.
@@ -386,7 +386,7 @@
user << "You locate the bolts and begin disassembling \the [src]..."
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user,50))
- destroy()
+ qdel(src)
return
// Handle weakening.
@@ -429,7 +429,7 @@
playsound(src.loc, 'sound/weapons/blade1.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
user.visible_message("The [src] was sliced apart by [user]!")
- destroy()
+ qdel(src)
user.drop_item(src.loc)
return
diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm
index fcd65e2cdf..47a2f53fb3 100644
--- a/code/game/objects/structures/transit_tubes.dm
+++ b/code/game/objects/structures/transit_tubes.dm
@@ -47,7 +47,7 @@
-/obj/structure/transit_tube_pod/Del()
+/obj/structure/transit_tube_pod/Destroy()
for(var/atom/movable/AM in contents)
AM.loc = loc
@@ -63,7 +63,7 @@ obj/structure/ex_act(severity)
AM.loc = loc
AM.ex_act(severity++)
- del(src)
+ qdel(src)
return
if(2.0)
if(prob(50))
@@ -71,7 +71,7 @@ obj/structure/ex_act(severity)
AM.loc = loc
AM.ex_act(severity++)
- del(src)
+ qdel(src)
return
if(3.0)
return
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 62f3ef60c1..81a3a16cdd 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -173,7 +173,7 @@
/obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up
overlays.Cut() //once it's been on for a while, in addition to handling the water overlay.
if(mymist)
- del(mymist)
+ qdel(mymist)
if(on)
overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
@@ -183,16 +183,16 @@
spawn(50)
if(src && on)
ismist = 1
- mymist = new /obj/effect/mist(loc)
+ mymist = PoolOrNew(/obj/effect/mist,loc)
else
ismist = 1
- mymist = new /obj/effect/mist(loc)
+ mymist = PoolOrNew(/obj/effect/mist,loc)
else if(ismist)
ismist = 1
- mymist = new /obj/effect/mist(loc)
+ mymist = PoolOrNew(/obj/effect/mist,loc)
spawn(250)
if(src && !on)
- del(mymist)
+ qdel(mymist)
ismist = 0
/obj/machinery/shower/Crossed(atom/movable/O)
@@ -292,7 +292,7 @@
loc.clean_blood()
for(var/obj/effect/E in tile)
if(istype(E,/obj/effect/rune) || istype(E,/obj/effect/decal/cleanable) || istype(E,/obj/effect/overlay))
- del(E)
+ qdel(E)
/obj/machinery/shower/process()
if(!on) return
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index a0855a35b0..36135a775e 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -37,7 +37,7 @@ obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0)
update_nearby_tiles(need_rebuild=1)
-obj/structure/windoor_assembly/Del()
+obj/structure/windoor_assembly/Destroy()
density = 0
update_nearby_tiles()
..()
@@ -78,8 +78,8 @@ obj/structure/windoor_assembly/Del()
user << "\blue You dissasembled the windoor assembly!"
new /obj/item/stack/sheet/glass/reinforced(get_turf(src), 5)
if(secure)
- new /obj/item/stack/rods(get_turf(src), 4)
- del(src)
+ PoolOrNew(/obj/item/stack/rods, list(get_turf(src), 4))
+ qdel(src)
else
user << "\blue You need more welding fuel to dissassemble the windoor assembly."
return
@@ -249,7 +249,7 @@ obj/structure/windoor_assembly/Del()
src.electronics.loc = windoor
- del(src)
+ qdel(src)
else
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index fd96873b7a..387c76eb69 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -88,12 +88,12 @@
index = 0
while(index < 2)
new shardtype(loc)
- if(reinf) new /obj/item/stack/rods(loc)
+ if(reinf) PoolOrNew(/obj/item/stack/rods, loc)
index++
else
new shardtype(loc)
- if(reinf) new /obj/item/stack/rods(loc)
- del(src)
+ if(reinf) PoolOrNew(/obj/item/stack/rods, loc)
+ qdel(src)
return
@@ -111,7 +111,7 @@
/obj/structure/window/ex_act(severity)
switch(severity)
if(1.0)
- del(src)
+ qdel(src)
return
if(2.0)
shatter(0)
@@ -216,7 +216,7 @@
if(istype(G.affecting,/mob/living))
var/mob/living/M = G.affecting
var/state = G.state
- del(W) //gotta delete it here because if window breaks, it won't get deleted
+ qdel(W) //gotta delete it here because if window breaks, it won't get deleted
switch (state)
if(1)
M.visible_message("[user] slams [M] against \the [src]!")
@@ -266,7 +266,7 @@
mats.amount = is_fulltile() ? 4 : 2
else
new glasstype(loc)
- del(src)
+ qdel(src)
else
if(W.damtype == BRUTE || W.damtype == BURN)
hit(W.force)
@@ -334,7 +334,7 @@
update_nearby_icons()
-/obj/structure/window/Del()
+/obj/structure/window/Destroy()
density = 0
update_nearby_tiles()
update_nearby_icons()
@@ -479,10 +479,10 @@
/obj/structure/window/reinforced/polarized/proc/toggle()
if(opacity)
animate(src, color="#FFFFFF", time=5)
- SetOpacity(0)
+ set_opacity(0)
else
animate(src, color="#222222", time=5)
- SetOpacity(1)
+ set_opacity(1)
diff --git a/code/game/response_team.dm b/code/game/response_team.dm
index a64230b1d6..61f6921698 100644
--- a/code/game/response_team.dm
+++ b/code/game/response_team.dm
@@ -37,10 +37,12 @@ var/can_call_ert
log_admin("[key_name(usr)] used Dispatch Response Team.")
trigger_armed_response_team(1)
-
client/verb/JoinResponseTeam()
set category = "IC"
+ if(!MayRespawn(1))
+ return
+
if(istype(usr,/mob/dead/observer) || istype(usr,/mob/new_player))
if(!send_emergency_team)
usr << "No emergency response team is currently being sent."
@@ -58,7 +60,7 @@ client/verb/JoinResponseTeam()
L.name = "Commando"
return
create_response_team(L.loc, new_name)
- del(L)
+ qdel(L)
else
usr << "You need to be an observer or new player to use this."
diff --git a/code/game/smoothwall.dm b/code/game/smoothwall.dm
deleted file mode 100644
index 907b2f6758..0000000000
--- a/code/game/smoothwall.dm
+++ /dev/null
@@ -1,141 +0,0 @@
-//Separate dm because it relates to two types of atoms + ease of removal in case it's needed.
-//Also assemblies.dm for falsewall checking for this when used.
-//I should really make the shuttle wall check run every time it's moved, but centcom uses unsimulated floors so !effort
-
-/atom/proc/relativewall() //atom because it should be useable both for walls and false walls
- if(istype(src,/turf/simulated/floor/vault)||istype(src,/turf/simulated/wall/vault)) //HACK!!!
- return
-
- var/junction = 0 //will be used to determine from which side the wall is connected to other walls
-
- if(!istype(src,/turf/simulated/shuttle/wall)) //or else we'd have wacky shuttle merging with walls action
- for(var/turf/simulated/wall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- junction |= get_dir(src,W)
- for(var/obj/structure/falsewall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- junction |= get_dir(src,W)
- for(var/obj/structure/falserwall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- junction |= get_dir(src,W)
-
-/* Commenting this out for now until we figure out what to do with shuttle smooth walls, if anything.
- As they are now, they sort of work screwy and may need further coding. Or just be scrapped.*/
- /*else
- for(var/turf/simulated/shuttle/wall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- junction |= get_dir(src,W)
- for(var/obj/machinery/shuttle/W in orange(src,1)) //stuff like engine and propulsion should merge with walls
- if(abs(src.x-W.x)-abs(src.y-W.y))
- junction |= get_dir(src,W)
- for(var/obj/machinery/door/W in orange(src,1)) //doors should not result in diagonal walls, it just looks ugly. checking if area is shuttle so it won't merge with the station
- if((abs(src.x-W.x)-abs(src.y-W.y)) && (istype(W.loc.loc,/area/shuttle) || istype(W.loc.loc,/area/supply)))
- junction |= get_dir(src,W)
- for(var/obj/structure/grille/W in orange(src,1)) //same for grilles. checking if area is shuttle so it won't merge with the station
- if((abs(src.x-W.x)-abs(src.y-W.y)) && (istype(W.loc.loc,/area/shuttle) || istype(W.loc.loc,/area/supply)))
- junction |= get_dir(src,W)*/
-
- if(istype(src,/turf/simulated/wall))
- var/turf/simulated/wall/wall = src
- wall.icon_state = "[wall.walltype][junction]"
- else if (istype(src,/obj/structure/falserwall))
- src.icon_state = "rwall[junction]"
- else if (istype(src,/obj/structure/falsewall))
- var/obj/structure/falsewall/fwall = src
- fwall.icon_state = "[fwall.mineral][junction]"
-/* else if(istype(src,/turf/simulated/shuttle/wall))
- var/newicon = icon;
- var/newiconstate = icon_state;
- if(junction!=5 && junction!=6 && junction!=9 && junction!=10) //if it's not diagonal, all is well, no additional calculations needed
- src.icon_state = "swall[junction]"
- else //if it's diagonal, we need to figure out if we're using the floor diagonal or the space diagonal sprite
- var/is_floor = 0
- for(var/turf/unsimulated/floor/F in orange(src,1))
- if(abs(src.x-F.x)-abs(src.y-F.y))
- if((15-junction) & get_dir(src,F)) //if there's a floor in at least one of the empty space directions, return 1
- is_floor = 1
- newicon = F.icon
- newiconstate = F.icon_state //we'll save these for later
- for(var/turf/simulated/floor/F in orange(src,1))
- if(abs(src.x-F.x)-abs(src.y-F.y))
- if((15-junction) & get_dir(src,F)) //if there's a floor in at least one of the empty space directions, return 1
- is_floor = 1
- newicon = F.icon
- newiconstate = F.icon_state //we'll save these for later
- for(var/turf/simulated/shuttle/floor/F in orange(src,1))
- if(abs(src.x-F.x)-abs(src.y-F.y))
- if((15-junction) & get_dir(src,F)) //if there's a floor in at least one of the empty space directions, return 1
- is_floor = 1
- newicon = F.icon
- newiconstate = F.icon_state //we'll save these for later
- if(is_floor) //if is_floor = 1, we use the floor diagonal sprite
- src.icon = newicon; //we'll set the floor's icon to the floor next to it and overlay the wall segment. shuttle floor sprites have priority
- src.icon_state = newiconstate; //
- src.overlays += icon('icons/turf/shuttle.dmi',"swall_f[junction]")
- else //otherwise, the space one
- src.icon_state = "swall_s[junction]"*/
-
- return
-
-/atom/proc/relativewall_neighbours()
- for(var/turf/simulated/wall/W in range(src,1))
- W.relativewall()
- for(var/obj/structure/falsewall/W in range(src,1))
- W.relativewall()
- W.update_icon()//Refreshes the wall to make sure the icons don't desync
- for(var/obj/structure/falserwall/W in range(src,1))
- W.relativewall()
- return
-
-/turf/simulated/wall/New()
- relativewall_neighbours()
- ..()
-
-/*/turf/simulated/shuttle/wall/New()
-
- spawn(20) //testing if this will make /obj/machinery/shuttle and /door count - It does, it stays.
- if(src.icon_state in list("wall1", "wall", "diagonalWall", "wall_floor", "wall_space")) //so wizard den, syndie shuttle etc will remain black
- for(var/turf/simulated/shuttle/wall/W in range(src,1))
- W.relativewall()
-
- ..()*/
-
-/turf/simulated/wall/Del()
- spawn(10)
- for(var/turf/simulated/wall/W in range(src,1))
- W.relativewall()
-
- for(var/obj/structure/falsewall/W in range(src,1))
- W.relativewall()
-
- for(var/direction in cardinal)
- for(var/obj/effect/plant/shroom in get_step(src,direction))
- if(!shroom.floor) //shrooms drop to the floor
- shroom.floor = 1
- shroom.update_icon()
- shroom.pixel_x = 0
- shroom.pixel_y = 0
-
- ..()
-
-/turf/simulated/wall/relativewall()
- if(istype(src,/turf/simulated/wall/vault)) //HACK!!!
- return
-
- var/junction = 0 //will be used to determine from which side the wall is connected to other walls
-
- for(var/turf/simulated/wall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)//Only 'like' walls connect -Sieve
- junction |= get_dir(src,W)
- for(var/obj/structure/falsewall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)
- junction |= get_dir(src,W)
- for(var/obj/structure/falserwall/W in orange(src,1))
- if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls
- if(src.mineral == W.mineral)
- junction |= get_dir(src,W)
- var/turf/simulated/wall/wall = src
- wall.icon_state = "[wall.walltype][junction]"
- return
\ No newline at end of file
diff --git a/code/game/sound.dm b/code/game/sound.dm
index b5a4006e34..1cc6f98807 100644
--- a/code/game/sound.dm
+++ b/code/game/sound.dm
@@ -53,34 +53,34 @@ var/const/FALLOFF_SOUNDS = 0.5
if(isturf(turf_source))
// 3D sounds, the technology is here!
var/turf/T = get_turf(src)
-
+
//sound volume falloff with distance
var/distance = get_dist(T, turf_source)
-
+
S.volume -= max(distance - world.view, 0) * 2 //multiplicative falloff to add on top of natural audio falloff.
-
+
//sound volume falloff with pressure
var/pressure_factor = 1.0
-
+
var/datum/gas_mixture/hearer_env = T.return_air()
var/datum/gas_mixture/source_env = turf_source.return_air()
-
+
if (hearer_env && source_env)
var/pressure = min(hearer_env.return_pressure(), source_env.return_pressure())
-
+
if (pressure < ONE_ATMOSPHERE)
pressure_factor = max((pressure - SOUND_MINIMUM_PRESSURE)/(ONE_ATMOSPHERE - SOUND_MINIMUM_PRESSURE), 0)
else //in space
pressure_factor = 0
-
+
if (distance <= 1)
pressure_factor = max(pressure_factor, 0.15) //hearing through contact
-
+
S.volume *= pressure_factor
-
+
if (S.volume <= 0)
return //no volume means no sound
-
+
var/dx = turf_source.x - T.x // Hearing from the right/left
S.x = dx
var/dz = turf_source.y - T.y // Hearing from infront/behind
@@ -88,8 +88,11 @@ var/const/FALLOFF_SOUNDS = 0.5
// The y value is for above your head, but there is no ceiling in 2d spessmens.
S.y = 1
S.falloff = (falloff ? falloff : FALLOFF_SOUNDS)
+
if(!is_global)
- S.environment = 2
+ var/area/A = get_area(src)
+ S.environment = A.sound_env
+
src << S
/client/proc/playtitlemusic()
diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm
index d32173c267..0f5d49d223 100644
--- a/code/game/supplyshuttle.dm
+++ b/code/game/supplyshuttle.dm
@@ -26,18 +26,14 @@ var/list/mechtoys = list(
/obj/item/weapon/paper/manifest
name = "supply manifest"
-/area/supply/station //DO NOT TURN THE lighting_use_dynamic STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
+/area/supply/station
name = "Supply Shuttle"
icon_state = "shuttle3"
- luminosity = 1
- lighting_use_dynamic = 0
requires_power = 0
-/area/supply/dock //DO NOT TURN THE lighting_use_dynamic STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
+/area/supply/dock
name = "Supply Shuttle"
icon_state = "shuttle3"
- luminosity = 1
- lighting_use_dynamic = 0
requires_power = 0
/obj/structure/plasticflaps //HOW DO YOU CALL THOSE THINGS ANYWAY
@@ -84,13 +80,13 @@ var/list/mechtoys = list(
/obj/structure/plasticflaps/ex_act(severity)
switch(severity)
if (1)
- del(src)
+ qdel(src)
if (2)
if (prob(50))
- del(src)
+ qdel(src)
if (3)
if (prob(5))
- del(src)
+ qdel(src)
/obj/structure/plasticflaps/mining //A specific type for mining that doesn't allow airflow because of them damn crates
name = "airtight plastic flaps"
@@ -102,7 +98,7 @@ var/list/mechtoys = list(
T.blocks_air = 1
..()
- Del() //lazy hack to set the turf to allow air to pass if it's a simulated floor
+ Destroy() //lazy hack to set the turf to allow air to pass if it's a simulated floor
var/turf/T = get_turf(loc)
if(T)
if(istype(T, /turf/simulated/floor))
@@ -217,7 +213,7 @@ var/list/mechtoys = list(
var/obj/item/stack/sheet/mineral/platinum/P = A
plat_count += P.get_amount()
- del(MA)
+ qdel(MA)
if(phoron_count)
points += phoron_count * points_per_phoron
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index 07b68a329a..bb7d93fbf1 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -41,7 +41,7 @@ var/list/wood_icons = list("wood","wood-broken")
var/lava = 0
var/broken = 0
var/burnt = 0
- var/mineral = "metal"
+ var/mineral = DEFAULT_WALL_MATERIAL
var/floor_type = /obj/item/stack/tile/plasteel
var/lightfloor_state // for light floors, this is the state of the tile. 0-7, 0x4 is on-bit - use the helper procs below
@@ -82,19 +82,19 @@ var/list/wood_icons = list("wood","wood-broken")
if(1.0)
src.ChangeTurf(/turf/space)
if(2.0)
- switch(pick(1,2;75,3))
+ switch(pick(40;1,40;2,3))
if (1)
- src.ReplaceWithLattice()
if(prob(33)) new /obj/item/stack/sheet/metal(src)
+ src.ReplaceWithLattice()
if(2)
src.ChangeTurf(/turf/space)
if(3)
+ if(prob(33)) new /obj/item/stack/sheet/metal(src)
if(prob(80))
src.break_tile_to_plating()
else
src.break_tile()
src.hotspot_expose(1000,CELL_VOLUME)
- if(prob(33)) new /obj/item/stack/sheet/metal(src)
if(3.0)
if (prob(50))
src.break_tile()
@@ -133,19 +133,19 @@ turf/simulated/floor/proc/update_icon()
switch(get_lightfloor_state())
if(LIGHTFLOOR_STATE_OK)
icon_state = "light_on"
- SetLuminosity(5)
+ set_light(5)
if(LIGHTFLOOR_STATE_FLICKER)
var/num = pick("1","2","3","4")
icon_state = "light_on_flicker[num]"
- SetLuminosity(5)
+ set_light(5)
if(LIGHTFLOOR_STATE_BREAKING)
icon_state = "light_on_broken"
- SetLuminosity(5)
+ set_light(5)
if(LIGHTFLOOR_STATE_BROKEN)
icon_state = "light_off"
- SetLuminosity(0)
+ set_light(0)
else
- SetLuminosity(0)
+ set_light(0)
icon_state = "light_off"
else if(is_grass_floor())
if(!broken && !burnt)
@@ -339,7 +339,7 @@ turf/simulated/floor/proc/update_icon()
if(!floor_type) return
icon_plating = "plating"
- SetLuminosity(0)
+ set_light(0)
floor_type = null
intact = 0
broken = 0
@@ -355,7 +355,7 @@ turf/simulated/floor/proc/update_icon()
broken = 0
burnt = 0
intact = 1
- SetLuminosity(0)
+ set_light(0)
if(T)
if(istype(T,/obj/item/stack/tile/plasteel))
floor_type = T.type
@@ -457,7 +457,7 @@ turf/simulated/floor/proc/update_icon()
if(is_light_floor())
if(get_lightfloor_state())
user.remove_from_mob(C)
- del(C)
+ qdel(C)
set_lightfloor_state(0) //fixing it by bashing it with a light bulb, fun eh?
update_icon()
user << "\blue You replace the light bulb."
diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm
index e0ba3b7f4d..450352f9b5 100644
--- a/code/game/turfs/simulated/floor_types.dm
+++ b/code/game/turfs/simulated/floor_types.dm
@@ -14,7 +14,7 @@
/turf/simulated/floor/light
name = "Light floor"
- luminosity = 5
+ light_range = 5
icon_state = "light_on"
floor_type = /obj/item/stack/tile/light
@@ -64,7 +64,7 @@
user << "\blue Removing rods..."
playsound(src, 'sound/items/Ratchet.ogg', 80, 1)
if(do_after(user, 30))
- new /obj/item/stack/rods(src, 2)
+ PoolOrNew(/obj/item/stack/rods, list(loc, 2))
ChangeTurf(/turf/simulated/floor)
var/turf/simulated/floor/F = src
F.make_plating()
diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm
new file mode 100644
index 0000000000..4d86d70877
--- /dev/null
+++ b/code/game/turfs/simulated/wall_attacks.dm
@@ -0,0 +1,311 @@
+//Interactions
+/turf/simulated/wall/proc/toggle_open(var/mob/user)
+
+ if(can_open == WALL_OPENING)
+ return
+
+ if(density)
+ can_open = WALL_OPENING
+ set_wall_state("[material.icon_base]fwall_open")
+ //flick("[material.icon_base]fwall_opening", src)
+ sleep(15)
+ density = 0
+ set_light(0)
+ else
+ can_open = WALL_OPENING
+ //flick("[material.icon_base]fwall_closing", src)
+ set_wall_state("[material.icon_base]0")
+ density = 1
+ sleep(15)
+ set_light(1)
+
+ can_open = WALL_CAN_OPEN
+ update_icon()
+
+/turf/simulated/wall/proc/fail_smash(var/mob/user)
+ user << "You smash against the wall!"
+ take_damage(rand(25,75))
+
+/turf/simulated/wall/proc/success_smash(var/mob/user)
+ user << "You smash through the wall!"
+ spawn(1)
+ dismantle_wall(1)
+
+/turf/simulated/wall/proc/try_touch(var/mob/user, var/rotting)
+
+ if(rotting)
+ if(reinf_material)
+ user << "\The [reinf_material.display_name] feels porous and crumbly."
+ else
+ user << "\The [material.display_name] crumbles under your touch!"
+ dismantle_wall()
+ return 1
+
+ if(..()) return 1
+
+ if(!can_open)
+ user << "You push the wall, but nothing happens."
+ playsound(src, 'sound/weapons/Genhit.ogg', 25, 1)
+ else
+ toggle_open(user)
+ return 0
+
+
+/turf/simulated/wall/attack_hand(var/mob/user)
+
+ radiate()
+ add_fingerprint(user)
+ var/rotting = (locate(/obj/effect/overlay/wallrot) in src)
+ if (HULK in user.mutations)
+ if (rotting || !prob(material.hardness))
+ success_smash(user)
+ else
+ fail_smash(user)
+ return 1
+
+ try_touch(user, rotting)
+
+/turf/simulated/wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker)
+
+ radiate()
+ var/rotting = (locate(/obj/effect/overlay/wallrot) in src)
+ if(!damage || !wallbreaker)
+ try_touch(user, rotting)
+ return
+
+ if(rotting)
+ return success_smash(user)
+
+ if(reinf_material)
+ if((wallbreaker == 2) || (damage >= max(material.hardness,reinf_material.hardness)))
+ return success_smash(user)
+ else if(damage >= material.hardness)
+ return success_smash(user)
+ return fail_smash(user)
+
+/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob)
+
+ if (!user.)
+ user << "You don't have the dexterity to do this!"
+ return
+
+ //get the user's location
+ if(!istype(user.loc, /turf)) return //can't do this stuff whilst inside objects and such
+
+ if(W)
+ radiate()
+ if(is_hot(W))
+ ignite(is_hot(W))
+
+ if(locate(/obj/effect/overlay/wallrot) in src)
+ if(istype(W, /obj/item/weapon/weldingtool) )
+ var/obj/item/weapon/weldingtool/WT = W
+ if( WT.remove_fuel(0,user) )
+ user << "You burn away the fungi with \the [WT]."
+ playsound(src, 'sound/items/Welder.ogg', 10, 1)
+ for(var/obj/effect/overlay/wallrot/WR in src)
+ qdel(WR)
+ return
+ else if(!is_sharp(W) && W.force >= 10 || W.force >= 20)
+ user << "\The [src] crumbles away under the force of your [W.name]."
+ src.dismantle_wall(1)
+ return
+
+ //THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects
+ if(thermite)
+ if( istype(W, /obj/item/weapon/weldingtool) )
+ var/obj/item/weapon/weldingtool/WT = W
+ if( WT.remove_fuel(0,user) )
+ thermitemelt(user)
+ return
+
+ else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
+ thermitemelt(user)
+ return
+
+ else if( istype(W, /obj/item/weapon/melee/energy/blade) )
+ var/obj/item/weapon/melee/energy/blade/EB = W
+
+ EB.spark_system.start()
+ user << "You slash \the [src] with \the [EB]; the thermite ignites!"
+ playsound(src, "sparks", 50, 1)
+ playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
+
+ thermitemelt(user)
+ return
+
+ var/turf/T = user.loc //get user's location for delay checks
+
+ if(damage && istype(W, /obj/item/weapon/weldingtool))
+
+ var/obj/item/weapon/weldingtool/WT = W
+
+ if(!WT.isOn())
+ return
+
+ if(WT.remove_fuel(0,user))
+ user << "You start repairing the damage to [src]."
+ playsound(src, 'sound/items/Welder.ogg', 100, 1)
+ if(do_after(user, max(5, damage / 5)) && WT && WT.isOn())
+ user << "You finish repairing the damage to [src]."
+ take_damage(-damage)
+ else
+ user << "You need more welding fuel to complete this task."
+ return
+ return
+
+ // Basic dismantling.
+ if(isnull(construction_stage) || !reinf_material)
+
+ var/cut_delay = 60 - material.cut_delay
+ var/dismantle_verb
+ var/dismantle_sound
+
+ if(istype(W,/obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/WT = W
+ if(!WT.isOn())
+ return
+ if(!WT.remove_fuel(0,user))
+ user << "You need more welding fuel to complete this task."
+ return
+ dismantle_verb = "cutting"
+ dismantle_sound = 'sound/items/Welder.ogg'
+ cut_delay *= 0.7
+ else if(istype(W,/obj/item/weapon/melee/energy/blade))
+ dismantle_sound = "sparks"
+ dismantle_verb = "slicing"
+ cut_delay *= 0.5
+ else if(istype(W,/obj/item/weapon/pickaxe))
+ var/obj/item/weapon/pickaxe/P = W
+ dismantle_verb = P.drill_verb
+ dismantle_sound = P.drill_sound
+ cut_delay -= P.digspeed
+
+ if(dismantle_verb)
+
+ user << "You begin [dismantle_verb] through the outer plating."
+ if(dismantle_sound)
+ playsound(src, dismantle_sound, 100, 1)
+
+ if(cut_delay<0)
+ cut_delay = 0
+
+ if(!do_after(user,cut_delay))
+ return
+
+ user << "You remove the outer plating."
+ dismantle_wall()
+ user.visible_message("The wall was torn open by [user]!")
+ return
+
+ //Reinforced dismantling.
+ else
+ switch(construction_stage)
+ if(6)
+ if (istype(W, /obj/item/weapon/wirecutters))
+ playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
+ construction_stage = 5
+ new /obj/item/stack/rods( src )
+ user << "You cut the outer grille."
+ set_wall_state()
+ return
+ if(5)
+ if (istype(W, /obj/item/weapon/screwdriver))
+ user << "You begin removing the support lines."
+ playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
+ if(!do_after(user,40) || !istype(src, /turf/simulated/wall) || construction_stage != 5)
+ return
+ construction_stage = 4
+ set_wall_state()
+ user << "You remove the support lines."
+ return
+ else if( istype(W, /obj/item/stack/rods) )
+ var/obj/item/stack/O = W
+ if(O.get_amount()>0)
+ O.use(1)
+ construction_stage = 6
+ set_wall_state()
+ user << "You replace the outer grille."
+ return
+ if(4)
+ var/cut_cover
+ if(istype(W,/obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/WT = W
+ if(!WT.isOn())
+ return
+ if(WT.remove_fuel(0,user))
+ cut_cover=1
+ else
+ user << "You need more welding fuel to complete this task."
+ return
+ else if (istype(W, /obj/item/weapon/pickaxe/plasmacutter))
+ cut_cover = 1
+ if(cut_cover)
+ user << "You begin slicing through the metal cover."
+ playsound(src, 'sound/items/Welder.ogg', 100, 1)
+ if(!do_after(user, 60) || !istype(src, /turf/simulated/wall) || construction_stage != 4)
+ return
+ construction_stage = 3
+ set_wall_state()
+ user << "You press firmly on the cover, dislodging it."
+ return
+ if(3)
+ if (istype(W, /obj/item/weapon/crowbar))
+ user << "You struggle to pry off the cover."
+ playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
+ if(!do_after(user,100) || !istype(src, /turf/simulated/wall) || construction_stage != 3)
+ return
+ construction_stage = 2
+ set_wall_state()
+ user << "You pry off the cover."
+ return
+ if(2)
+ if (istype(W, /obj/item/weapon/wrench))
+ user << "You start loosening the anchoring bolts which secure the support rods to their frame."
+ playsound(src, 'sound/items/Ratchet.ogg', 100, 1)
+ if(!do_after(user,40) || !istype(src, /turf/simulated/wall) || construction_stage != 2)
+ return
+ construction_stage = 1
+ set_wall_state()
+ user << "You remove the bolts anchoring the support rods."
+ return
+ if(1)
+ var/cut_cover
+ if(istype(W, /obj/item/weapon/weldingtool))
+ var/obj/item/weapon/weldingtool/WT = W
+ if( WT.remove_fuel(0,user) )
+ cut_cover=1
+ else
+ user << "You need more welding fuel to complete this task."
+ return
+ else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
+ cut_cover = 1
+ if(cut_cover)
+ user << "You begin slicing through the support rods."
+ playsound(src, 'sound/items/Welder.ogg', 100, 1)
+ if(!do_after(user,70) || !istype(src, /turf/simulated/wall) || construction_stage != 1)
+ return
+ construction_stage = 0
+ set_wall_state()
+ new /obj/item/stack/rods(src)
+ user << "The support rods drop out as you cut them loose from the frame."
+ return
+ if(0)
+ if(istype(W, /obj/item/weapon/crowbar))
+ user << "You struggle to pry off the outer sheath."
+ playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
+ sleep(100)
+ if(!istype(src, /turf/simulated/wall) || !user || !W || !T ) return
+ if(user.loc == T && user.get_active_hand() == W )
+ user << "You pry off the outer sheath."
+ dismantle_wall()
+ return
+
+ if(istype(W,/obj/item/frame))
+ var/obj/item/frame/F = W
+ F.try_build(src)
+ return
+
+ else if(!istype(W,/obj/item/weapon/rcd) && !istype(W, /obj/item/weapon/reagent_containers))
+ return attack_hand(user)
+
diff --git a/code/game/turfs/simulated/wall_icon.dm b/code/game/turfs/simulated/wall_icon.dm
new file mode 100644
index 0000000000..b02311ee98
--- /dev/null
+++ b/code/game/turfs/simulated/wall_icon.dm
@@ -0,0 +1,130 @@
+/turf/simulated/wall/proc/update_material()
+
+ if(!material)
+ return
+
+ if(reinf_material)
+ construction_stage = 6
+ else
+ construction_stage = null
+ if(!material)
+ material = name_to_material[DEFAULT_WALL_MATERIAL]
+ if(material)
+ explosion_resistance = material.explosion_resistance
+ if(reinf_material && reinf_material.explosion_resistance > explosion_resistance)
+ explosion_resistance = reinf_material.explosion_resistance
+
+ if(reinf_material)
+ name = "reinforced [material.display_name] wall"
+ desc = "It seems to be a section of hull reinforced with [reinf_material.display_name] and plated with [material.display_name]."
+ else
+ name = "[material.display_name] wall"
+ desc = "It seems to be a section of hull plated with [material.display_name]."
+
+ set_wall_state("[material.icon_base]0")
+
+ if(material.opacity > 0.5 && !opacity)
+ set_light(1)
+ else if(material.opacity < 0.5 && opacity)
+ set_light(0)
+
+ update_icon()
+ check_relatives()
+
+/turf/simulated/wall/proc/set_wall_state(var/new_state)
+
+ if(!material)
+ return
+
+ if(new_state)
+ last_state = new_state
+ else if(last_state)
+ new_state = last_state
+ else
+ return
+
+ overlays.Cut()
+
+ if(!wall_cache["[new_state]-[material.icon_colour]"])
+ var/image/I = image(icon='icons/turf/wall_masks.dmi',icon_state="[new_state]")
+ I.color = material.icon_colour
+ wall_cache["[new_state]-[material.icon_colour]"] = I
+ overlays |= wall_cache["[new_state]-[material.icon_colour]"]
+ if(reinf_material)
+
+ var/cache_key = "[material.icon_reinf]-[reinf_material.icon_colour]"
+ if(!isnull(construction_stage) && construction_stage<6)
+ cache_key = "reinf_construct-[reinf_material.icon_colour]-[construction_stage]"
+
+ if(!wall_cache[cache_key])
+ var/image/I
+ if(!isnull(construction_stage) && construction_stage<6)
+ I = image(icon='icons/turf/wall_masks.dmi',icon_state="reinf_construct-[construction_stage]")
+ else
+ I = image(icon='icons/turf/wall_masks.dmi',icon_state="[material.icon_reinf]")
+ I.color = reinf_material.icon_colour
+ wall_cache[cache_key] = I
+ overlays |= wall_cache[cache_key]
+
+/turf/simulated/wall/proc/set_material(var/material/newmaterial, var/material/newrmaterial)
+ material = newmaterial
+ reinf_material = newrmaterial
+ check_relatives()
+ check_relatives(1)
+
+/turf/simulated/wall/proc/update_icon()
+
+ if(!material)
+ return
+
+ if(!damage_overlays[1]) //list hasn't been populated
+ generate_overlays()
+
+ if(density)
+ check_relatives(1)
+ else
+ set_wall_state("[material.icon_base]fwall_open")
+
+ var/overlay = round(damage / material.integrity * damage_overlays.len) + 1
+ if(overlay > damage_overlays.len)
+ overlay = damage_overlays.len
+ if(density)
+ if(damage_overlay && overlay == damage_overlay) //No need to update.
+ return
+ overlays += damage_overlays[overlay]
+ damage_overlay = overlay
+ return
+
+/turf/simulated/wall/proc/generate_overlays()
+ var/alpha_inc = 256 / damage_overlays.len
+
+ for(var/i = 1; i <= damage_overlays.len; i++)
+ var/image/img = image(icon = 'icons/turf/walls.dmi', icon_state = "overlay_damage")
+ img.blend_mode = BLEND_MULTIPLY
+ img.alpha = (i * alpha_inc) - 1
+ damage_overlays[i] = img
+
+//Smoothwall code. update_self for relativewall(), not for relativewall_neighbors()
+/turf/simulated/wall/proc/check_relatives(var/update_self)
+ if(!material)
+ return
+ var/junction
+ if(update_self)
+ junction = 0
+ for(var/checkdir in cardinal)
+ var/turf/simulated/wall/T = get_step(src, checkdir)
+ if(!istype(T) || !T.material)
+ continue
+ if(T.material && can_join_with(T))
+ if(update_self)
+ junction |= get_dir(src,T) //Not too sure why, but using checkdir just breaks walls.
+ else
+ T.check_relatives(1)
+ if(!isnull(junction))
+ set_wall_state("[material.icon_base][junction]")
+ return
+
+/turf/simulated/wall/proc/can_join_with(var/turf/simulated/wall/W)
+ if(material && W.material && material.name == W.material.name)
+ return 1
+ return 0
\ No newline at end of file
diff --git a/code/game/turfs/simulated/wall_types.dm b/code/game/turfs/simulated/wall_types.dm
new file mode 100644
index 0000000000..dc9346e323
--- /dev/null
+++ b/code/game/turfs/simulated/wall_types.dm
@@ -0,0 +1,43 @@
+/turf/simulated/wall/r_wall
+ icon_state = "rgeneric"
+/turf/simulated/wall/r_wall/New(var/newloc)
+ ..(newloc, DEFAULT_WALL_MATERIAL,"plasteel") //3strong
+/turf/simulated/wall/cult
+ icon_state = "cult"
+/turf/simulated/wall/cult/New(var/newloc)
+ ..(newloc,"cult","cult2")
+
+/turf/unsimulated/wall/cult
+ name = "cult wall"
+ desc = "Hideous images dance beneath the surface."
+ icon = 'icons/turf/wall_masks.dmi'
+ icon_state = "cult"
+
+
+/turf/simulated/wall/iron/New(var/newloc)
+ ..(newloc,"iron")
+/turf/simulated/wall/uranium/New(var/newloc)
+ ..(newloc,"uranium")
+/turf/simulated/wall/diamond/New(var/newloc)
+ ..(newloc,"diamond")
+/turf/simulated/wall/gold/New(var/newloc)
+ ..(newloc,"gold")
+/turf/simulated/wall/silver/New(var/newloc)
+ ..(newloc,"silver")
+/turf/simulated/wall/phoron/New(var/newloc)
+ ..(newloc,"phoron")
+/turf/simulated/wall/sandstone/New(var/newloc)
+ ..(newloc,"sandstone")
+
+/turf/simulated/wall/ironphoron/New(var/newloc)
+ ..(newloc,"iron","phoron")
+/turf/simulated/wall/golddiamond/New(var/newloc)
+ ..(newloc,"gold","diamond")
+/turf/simulated/wall/silvergold/New(var/newloc)
+ ..(newloc,"silver","gold")
+/turf/simulated/wall/sandstonediamond/New(var/newloc)
+ ..(newloc,"sandstone","diamond")
+
+
+/turf/simulated/wall/cult/New(var/newloc)
+ ..(newloc,"cult","cult2")
\ No newline at end of file
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index e19fadf863..4596512fe4 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -1,29 +1,47 @@
+var/list/global/wall_cache = list()
+
/turf/simulated/wall
name = "wall"
desc = "A huge chunk of metal used to seperate rooms."
- icon = 'icons/turf/walls.dmi'
- var/mineral = "metal"
- var/rotting = 0
-
- var/damage = 0
- var/damage_cap = 150 //Wall will break down to girders if damage reaches this point
-
- var/damage_overlay
- var/global/damage_overlays[8]
-
- var/max_temperature = 1800 //K, walls will take damage if they're next to a fire hotter than this
-
+ icon = 'icons/turf/wall_masks.dmi'
+ icon_state = "generic"
opacity = 1
density = 1
blocks_air = 1
-
thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall
- var/walltype = "metal"
+ var/damage = 0
+ var/damage_overlay
+ var/global/damage_overlays[8]
+ var/active
+ var/last_event
+ var/can_open = 0
+ var/material/material
+ var/material/reinf_material
+ var/last_state
+ var/construction_stage
+
+/turf/simulated/wall/New(var/newloc, var/materialtype, var/rmaterialtype)
+ ..(newloc)
+ icon_state = "blank"
+ if(!name_to_material)
+ populate_material_list()
+ if(!materialtype)
+ materialtype = DEFAULT_WALL_MATERIAL
+ material = name_to_material[materialtype]
+ if(!isnull(rmaterialtype))
+ reinf_material = name_to_material[rmaterialtype]
+ update_material()
/turf/simulated/wall/bullet_act(var/obj/item/projectile/Proj)
+ radiate()
+ if(istype(Proj,/obj/item/projectile/beam))
+ ignite(2500)
+ else if(istype(Proj,/obj/item/projectile/ion))
+ ignite(500)
+
// Tasers and stuff? No thanks. Also no clone or tox damage crap.
if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN))
return
@@ -45,25 +63,29 @@
take_damage(tforce)
-/turf/simulated/wall/Del()
- for(var/obj/effect/E in src) if(E.name == "Wallrot") del E
- ..()
+/turf/simulated/wall/proc/clear_plants()
+ for(var/obj/effect/overlay/wallrot/WR in src)
+ qdel(WR)
+ for(var/obj/effect/plant/plant in range(src, 1))
+ if(!plant.floor) //shrooms drop to the floor
+ plant.floor = 1
+ plant.update_icon()
+ plant.pixel_x = 0
+ plant.pixel_y = 0
+ plant.update_neighbors()
/turf/simulated/wall/ChangeTurf(var/newtype)
- for(var/obj/effect/E in src) if(E.name == "Wallrot") del E
- for(var/obj/effect/plant/plant in range(1))
- plant.update_neighbors()
+ clear_plants()
..(newtype)
//Appearance
-
/turf/simulated/wall/examine(mob/user)
. = ..(user)
if(!damage)
user << "It looks fully intact."
else
- var/dam = damage / damage_cap
+ var/dam = damage / material.integrity
if(dam <= 0.3)
user << "It looks slightly damaged."
else if(dam <= 0.6)
@@ -71,43 +93,14 @@
else
user << "It looks heavily damaged."
- if(rotting)
+ if(locate(/obj/effect/overlay/wallrot) in src)
user << "There is fungus growing on [src]."
-/turf/simulated/wall/proc/update_icon()
- if(!damage_overlays[1]) //list hasn't been populated
- generate_overlays()
-
- if(!damage)
- overlays.Cut()
- return
-
- var/overlay = round(damage / damage_cap * damage_overlays.len) + 1
- if(overlay > damage_overlays.len)
- overlay = damage_overlays.len
-
- if(damage_overlay && overlay == damage_overlay) //No need to update.
- return
-
- overlays.Cut()
- overlays += damage_overlays[overlay]
- damage_overlay = overlay
-
- return
-
-/turf/simulated/wall/proc/generate_overlays()
- var/alpha_inc = 256 / damage_overlays.len
-
- for(var/i = 1; i <= damage_overlays.len; i++)
- var/image/img = image(icon = 'icons/turf/walls.dmi', icon_state = "overlay_damage")
- img.blend_mode = BLEND_MULTIPLY
- img.alpha = (i * alpha_inc) - 1
- damage_overlays[i] = img
-
//Damage
/turf/simulated/wall/melt()
- if(mineral == "diamond")
+
+ if(!can_melt())
return
src.ChangeTurf(/turf/simulated/floor/plating)
@@ -127,8 +120,11 @@
return
/turf/simulated/wall/proc/update_damage()
- var/cap = damage_cap
- if(rotting)
+ var/cap = material.integrity
+ if(reinf_material)
+ cap += reinf_material.integrity
+
+ if(locate(/obj/effect/overlay/wallrot) in src)
cap = cap / 10
if(damage >= cap)
@@ -138,52 +134,25 @@
return
+/turf/simulated/wall/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)//Doesn't fucking work because walls don't interact with air :(
+ ignite(exposed_temperature)
+
/turf/simulated/wall/adjacent_fire_act(turf/simulated/floor/adj_turf, datum/gas_mixture/adj_air, adj_temp, adj_volume)
- if(adj_temp > max_temperature)
- take_damage(log(RAND_F(0.9, 1.1) * (adj_temp - max_temperature)))
+ ignite(adj_temp)
+ if(adj_temp > material.melting_point)
+ take_damage(log(RAND_F(0.9, 1.1) * (adj_temp - material.melting_point)))
return ..()
/turf/simulated/wall/proc/dismantle_wall(devastated=0, explode=0)
- if(istype(src,/turf/simulated/wall/r_wall))
- if(!devastated)
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
- new /obj/structure/girder/reinforced(src)
- new /obj/item/stack/sheet/plasteel( src )
- else
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/plasteel( src )
- else if(istype(src,/turf/simulated/wall/cult))
- if(!devastated)
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
- new /obj/effect/decal/cleanable/blood(src)
- new /obj/structure/cultgirder(src)
- else
- new /obj/effect/decal/cleanable/blood(src)
- new /obj/effect/decal/remains/human(src)
+ playsound(src, 'sound/items/Welder.ogg', 100, 1)
+ if(reinf_material)
+ reinf_material.place_dismantled_girder(src, reinf_material)
+ reinf_material.place_dismantled_product(src,devastated)
else
- if(!devastated)
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
- new /obj/structure/girder(src)
- if (mineral == "metal")
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
- else
- var/M = text2path("/obj/item/stack/sheet/mineral/[mineral]")
- new M( src )
- new M( src )
- else
- if (mineral == "metal")
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
- new /obj/item/stack/sheet/metal( src )
- else
- var/M = text2path("/obj/item/stack/sheet/mineral/[mineral]")
- new M( src )
- new M( src )
- new /obj/item/stack/sheet/metal( src )
+ material.place_dismantled_girder(src)
+ material.place_dismantled_product(src,devastated)
for(var/obj/O in src.contents) //Eject contents!
if(istype(O,/obj/structure/sign/poster))
@@ -215,24 +184,19 @@
// Wall-rot effect, a nasty fungus that destroys walls.
/turf/simulated/wall/proc/rot()
- if(!rotting)
- rotting = 1
+ if(locate(/obj/effect/overlay/wallrot) in src)
+ return
+ var/number_rots = rand(2,3)
+ for(var/i=0, iThe thermite starts melting through the wall."
spawn(100)
- if(O) del(O)
+ if(O)
+ qdel(O)
// F.sd_LumReset() //TODO: ~Carn
return
/turf/simulated/wall/meteorhit(obj/M as obj)
+ var/rotting = (locate(/obj/effect/overlay/wallrot) in src)
if (prob(15) && !rotting)
dismantle_wall()
else if(prob(70) && !rotting)
@@ -264,232 +230,51 @@
ReplaceWithLattice()
return 0
-/turf/simulated/wall
- var/hulk_destroy_prob = 40
- var/hulk_take_damage = 1
- var/rotting_destroy_touch = 1
- var/rotting_touch_message = "\blue The wall crumbles under your touch."
-
-//Interactions
-/turf/simulated/wall/attack_hand(mob/user as mob)
- if (HULK in user.mutations)
- if (prob(hulk_destroy_prob) || rotting)
- usr << text("\blue You smash through the wall.")
- usr.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
- dismantle_wall(1)
- return 1
- else
- usr << text("\blue You punch the wall.")
- if(hulk_take_damage)
- take_damage(rand(25, 75))
- return 1
-
- if(rotting)
- user << rotting_touch_message
- if(rotting_destroy_touch)
- dismantle_wall()
- return 1
-
- if(..()) return 1
-
- user << "\blue You push the wall but nothing happens!"
- playsound(src, 'sound/weapons/Genhit.ogg', 25, 1)
- src.add_fingerprint(user)
- return 0
-
-/turf/simulated/wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker)
- if(!damage || !wallbreaker)
- user << "You push the wall but nothing happens."
+/turf/simulated/wall/proc/radiate()
+ var/material/M = name_to_material[material]
+ if(!istype(M) || !M.radioactivity)
return
- if(rotting || prob(40))
- user << "You smash through the wall!"
- spawn(1) dismantle_wall(1)
- else
- user << "You smash against the wall."
- take_damage(rand(25,75))
- return 1
-
-/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob)
-
- if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
- user << "You don't have the dexterity to do this!"
- return
-
- //get the user's location
- if( !istype(user.loc, /turf) ) return //can't do this stuff whilst inside objects and such
-
- if(rotting)
- if(istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
- user << "You burn away the fungi with \the [WT]."
- playsound(src, 'sound/items/Welder.ogg', 10, 1)
- for(var/obj/effect/E in src) if(E.name == "Wallrot")
- del E
- rotting = 0
- return
- else if(!is_sharp(W) && W.force >= 10 || W.force >= 20)
- user << "\The [src] crumbles away under the force of your [W.name]."
- src.dismantle_wall(1)
+ if(!active)
+ if(world.time > last_event+15)
+ active = 1
+ for(var/mob/living/L in range(3,src))
+ L.apply_effect(M.radioactivity,IRRADIATE,0)
+ for(var/turf/simulated/wall/T in range(3,src))
+ T.radiate()
+ last_event = world.time
+ active = null
return
-
- //THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects
- if( thermite )
- if( istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
- thermitemelt(user)
- return
-
- else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
- thermitemelt(user)
- return
-
- else if( istype(W, /obj/item/weapon/melee/energy/blade) )
- var/obj/item/weapon/melee/energy/blade/EB = W
-
- EB.spark_system.start()
- user << "You slash \the [src] with \the [EB]; the thermite ignites!"
- playsound(src, "sparks", 50, 1)
- playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
-
- thermitemelt(user)
- return
-
- var/turf/T = user.loc //get user's location for delay checks
-
- //DECONSTRUCTION
- if( istype(W, /obj/item/weapon/weldingtool) )
-
- var/response = "Dismantle"
- if(damage)
- response = alert(user, "Would you like to repair or dismantle [src]?", "[src]", "Repair", "Dismantle")
-
- var/obj/item/weapon/weldingtool/WT = W
-
- if(WT.remove_fuel(0,user))
- if(response == "Repair")
- user << "You start repairing the damage to [src]."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
- if(do_after(user, max(5, damage / 5)) && WT && WT.isOn())
- user << "You finish repairing the damage to [src]."
- take_damage(-damage)
-
- else if(response == "Dismantle")
- user << "You begin slicing through the outer plating."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
- if(!do_after(user,100))
- return
- if(WT.isOn())
- user << "You remove the outer plating."
- dismantle_wall()
- for(var/mob/O in viewers(user, 5))
- O.show_message("The wall was sliced apart by [user]!", 1, "You hear metal being sliced apart.", 2)
- return
- return
- else
- user << "You need more welding fuel to complete this task."
- return
-
- else if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
-
- user << "You begin slicing through the outer plating."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
-
- var/delay = 60
- if(mineral == "diamond")
- delay += 60
-
- if(!do_after(user,delay))
- return
-
- user << "You remove the outer plating."
- dismantle_wall()
- for(var/mob/O in viewers(user, 5))
- O.show_message("The wall was sliced apart by [user]!", 1, "You hear metal being sliced apart.", 2)
- return
-
- //DRILLING
- else if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
-
- user << "You begin to drill though the wall."
-
- var/delay = 60
- if(mineral == "diamond")
- delay += 60
-
- if(!do_after(user,delay))
- return
-
- user << "Your drill tears though the last of the reinforced plating."
- dismantle_wall()
- for(var/mob/O in viewers(user, 5))
- O.show_message("The wall was drilled through by [user]!", 1, "You hear the grinding of metal.", 2)
- return
-
- else if( istype(W, /obj/item/weapon/melee/energy/blade) )
- var/obj/item/weapon/melee/energy/blade/EB = W
-
- EB.spark_system.start()
- user << "You stab \the [EB] into the wall and begin to slice it apart."
- playsound(src, "sparks", 50, 1)
-
- sleep(70)
- if(mineral == "diamond")
- sleep(70)
- if( !istype(src, /turf/simulated/wall) || !user || !EB || !T ) return
-
- if( user.loc == T && user.get_active_hand() == W )
- EB.spark_system.start()
- playsound(src, "sparks", 50, 1)
- playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
- dismantle_wall(1)
- for(var/mob/O in viewers(user, 5))
- O.show_message("The wall was sliced apart by [user]!", 1, "You hear metal being sliced apart and sparks flying.", 2)
- return
-
- else if(istype(W,/obj/item/apc_frame))
- var/obj/item/apc_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/alarm_frame))
- var/obj/item/alarm_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/firealarm_frame))
- var/obj/item/firealarm_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/light_fixture_frame))
- var/obj/item/light_fixture_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/light_fixture_frame/small))
- var/obj/item/light_fixture_frame/small/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/rust_fuel_compressor_frame))
- var/obj/item/rust_fuel_compressor_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/rust_fuel_assembly_port_frame))
- var/obj/item/rust_fuel_assembly_port_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/weapon/rcd)) //I bitterly resent having to write this. ~Z
- return
-
- else if(istype(W, /obj/item/weapon/reagent_containers))
- return // They tend to have meaningful afterattack - let them apply it without destroying a rotting wall
-
- else
- return attack_hand(user)
return
+
+/turf/simulated/wall/proc/burn(temperature)
+ spawn(2)
+ new /obj/structure/girder(src)
+ src.ChangeTurf(/turf/simulated/floor)
+ for(var/turf/simulated/floor/target_tile in range(0,src))
+ if(material == "phoron") //ergh
+ target_tile.assume_gas("phoron", 20, 400+T0C)
+ spawn (0) target_tile.hotspot_expose(temperature, 400)
+ for(var/turf/simulated/wall/W in range(3,src))
+ W.ignite((temperature/4))
+ for(var/obj/machinery/door/airlock/phoron/D in range(3,src))
+ D.ignite(temperature/4)
+
+/turf/simulated/wall/proc/ignite(var/exposed_temperature)
+
+ var/material/M = name_to_material[material]
+ if(!istype(M) || !isnull(M.ignition_point))
+ return
+ if(exposed_temperature > M.ignition_point)//If the temperature of the object is over 300, then ignite
+ burn(exposed_temperature)
+ return
+ ..()
+
+/turf/simulated/wall/Bumped(AM as mob|obj)
+ radiate()
+ ..()
+
+/turf/simulated/wall/Destroy()
+ clear_plants()
+ check_relatives()
+ ..()
\ No newline at end of file
diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm
deleted file mode 100644
index 5585de31d8..0000000000
--- a/code/game/turfs/simulated/walls_mineral.dm
+++ /dev/null
@@ -1,130 +0,0 @@
-/turf/simulated/wall/mineral
- name = "mineral wall"
- desc = "This shouldn't exist"
- icon_state = ""
- var/last_event = 0
- var/active = null
-
-/turf/simulated/wall/mineral/gold
- name = "gold wall"
- desc = "A wall with gold plating. Swag!"
- icon_state = "gold0"
- walltype = "gold"
- mineral = "gold"
- //var/electro = 1
- //var/shocked = null
-
-/turf/simulated/wall/mineral/silver
- name = "silver wall"
- desc = "A wall with silver plating. Shiny!"
- icon_state = "silver0"
- walltype = "silver"
- mineral = "silver"
- //var/electro = 0.75
- //var/shocked = null
-
-/turf/simulated/wall/mineral/diamond
- name = "diamond wall"
- desc = "A wall with diamond plating. You monster."
- icon_state = "diamond0"
- walltype = "diamond"
- mineral = "diamond"
-
-/turf/simulated/wall/mineral/sandstone
- name = "sandstone wall"
- desc = "A wall with sandstone plating."
- icon_state = "sandstone0"
- walltype = "sandstone"
- mineral = "sandstone"
-
-/turf/simulated/wall/mineral/uranium
- name = "uranium wall"
- desc = "A wall with uranium plating. This is probably a bad idea."
- icon_state = "uranium0"
- walltype = "uranium"
- mineral = "uranium"
-
-/turf/simulated/wall/mineral/uranium/proc/radiate()
- if(!active)
- if(world.time > last_event+15)
- active = 1
- for(var/mob/living/L in range(3,src))
- L.apply_effect(12,IRRADIATE,0)
- for(var/turf/simulated/wall/mineral/uranium/T in range(3,src))
- T.radiate()
- last_event = world.time
- active = null
- return
- return
-
-/turf/simulated/wall/mineral/uranium/attack_hand(mob/user as mob)
- radiate()
- ..()
-
-/turf/simulated/wall/mineral/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob)
- radiate()
- ..()
-
-/turf/simulated/wall/mineral/uranium/Bumped(AM as mob|obj)
- radiate()
- ..()
-
-/turf/simulated/wall/mineral/phoron
- name = "phoron wall"
- desc = "A wall with phoron plating. This is definately a bad idea."
- icon_state = "phoron0"
- walltype = "phoron"
- mineral = "phoron"
-
-/turf/simulated/wall/mineral/phoron/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if(is_hot(W) > 300)//If the temperature of the object is over 300, then ignite
- ignite(is_hot(W))
- return
- ..()
-
-/turf/simulated/wall/mineral/phoron/proc/PhoronBurn(temperature)
- spawn(2)
- new /obj/structure/girder(src)
- src.ChangeTurf(/turf/simulated/floor)
- for(var/turf/simulated/floor/target_tile in range(0,src))
- target_tile.assume_gas("phoron", 20, 400+T0C)
- spawn (0) target_tile.hotspot_expose(temperature, 400)
- for(var/obj/structure/falsewall/phoron/F in range(3,src))//Hackish as fuck, but until temperature_expose works, there is nothing I can do -Sieve
- var/turf/T = get_turf(F)
- T.ChangeTurf(/turf/simulated/wall/mineral/phoron/)
- del (F)
- for(var/turf/simulated/wall/mineral/phoron/W in range(3,src))
- W.ignite((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame
- for(var/obj/machinery/door/airlock/phoron/D in range(3,src))
- D.ignite(temperature/4)
-
-/turf/simulated/wall/mineral/phoron/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)//Doesn't fucking work because walls don't interact with air :(
- if(exposed_temperature > 300)
- PhoronBurn(exposed_temperature)
-
-/turf/simulated/wall/mineral/phoron/proc/ignite(exposed_temperature)
- if(exposed_temperature > 300)
- PhoronBurn(exposed_temperature)
-
-/turf/simulated/wall/mineral/phoron/bullet_act(var/obj/item/projectile/Proj)
- if(istype(Proj,/obj/item/projectile/beam))
- PhoronBurn(2500)
- else if(istype(Proj,/obj/item/projectile/ion))
- PhoronBurn(500)
- ..()
-
-/*
-/turf/simulated/wall/mineral/proc/shock()
- if (electrocute_mob(user, C, src))
- var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
- s.set_up(5, 1, src)
- s.start()
- return 1
- else
- return 0
-
-/turf/simulated/wall/mineral/proc/attackby(obj/item/weapon/W as obj, mob/user as mob)
- if((mineral == "gold") || (mineral == "silver"))
- if(shocked)
- shock()
-*/
diff --git a/code/game/turfs/simulated/walls_misc.dm b/code/game/turfs/simulated/walls_misc.dm
deleted file mode 100644
index fdc5d92995..0000000000
--- a/code/game/turfs/simulated/walls_misc.dm
+++ /dev/null
@@ -1,8 +0,0 @@
-/turf/simulated/wall/cult
- name = "wall"
- desc = "The patterns engraved on the wall seem to shift as you try to focus on them. You feel sick"
- icon_state = "cult"
- walltype = "cult"
-
-/turf/unsimulated/wall/cult/cultify()
- return
diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm
deleted file mode 100644
index 497371eb5f..0000000000
--- a/code/game/turfs/simulated/walls_reinforced.dm
+++ /dev/null
@@ -1,307 +0,0 @@
-/turf/simulated/wall/r_wall
- name = "reinforced wall"
- desc = "A huge chunk of reinforced metal used to seperate rooms."
- icon_state = "r_wall"
- opacity = 1
- density = 1
-
- damage_cap = 800
- max_temperature = 6000
-
- walltype = "rwall"
-
- var/d_state = 0
-
-/turf/simulated/wall/r_wall
- hulk_destroy_prob = 10
- hulk_take_damage = 0
- rotting_destroy_touch = 0
- rotting_touch_message = "\blue This wall feels rather unstable."
-
-/turf/simulated/wall/r_wall/attack_generic(var/mob/user, var/damage, var/attack_message, var/wallbreaker)
- if(!rotting && wallbreaker < 2)
- user << "You push the wall but nothing happens."
- return
-
- return ..()
-
-/turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob)
-
- if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
- user << "You don't have the dexterity to do this!"
- return
-
- //get the user's location
- if( !istype(user.loc, /turf) ) return //can't do this stuff whilst inside objects and such
-
- if(rotting)
- if(istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
- user << "You burn away the fungi with \the [WT]."
- playsound(src, 'sound/items/Welder.ogg', 10, 1)
- for(var/obj/effect/E in src) if(E.name == "Wallrot")
- del E
- rotting = 0
- return
- else if(!is_sharp(W) && W.force >= 10 || W.force >= 20)
- user << "\The [src] crumbles away under the force of your [W.name]."
- src.dismantle_wall()
- return
-
- //THERMITE related stuff. Calls src.thermitemelt() which handles melting simulated walls and the relevant effects
- if( thermite )
- if( istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
- thermitemelt(user)
- return
-
- else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter))
- thermitemelt(user)
- return
-
- else if( istype(W, /obj/item/weapon/melee/energy/blade) )
- var/obj/item/weapon/melee/energy/blade/EB = W
-
- EB.spark_system.start()
- user << "You slash \the [src] with \the [EB]; the thermite ignites!"
- playsound(src, "sparks", 50, 1)
- playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
-
- thermitemelt(user)
- return
-
- else if(istype(W, /obj/item/weapon/melee/energy/blade))
- user << "This wall is too thick to slice through. You will need to find a different path."
- return
-
- if(damage && istype(W, /obj/item/weapon/weldingtool))
- var/obj/item/weapon/weldingtool/WT = W
- if(WT.remove_fuel(0,user))
- user << "You start repairing the damage to [src]."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
- if(do_after(user, max(5, damage / 5)) && WT && WT.isOn())
- user << "You finish repairing the damage to [src]."
- take_damage(-damage)
- return
- else
- user << "You need more welding fuel to complete this task."
- return
-
- var/turf/T = user.loc //get user's location for delay checks
-
- //DECONSTRUCTION
- switch(d_state)
- if(0)
- if (istype(W, /obj/item/weapon/wirecutters))
- playsound(src, 'sound/items/Wirecutter.ogg', 100, 1)
- src.d_state = 1
- src.icon_state = "r_wall-1"
- new /obj/item/stack/rods( src )
- user << "You cut the outer grille."
- return
-
- if(1)
- if (istype(W, /obj/item/weapon/screwdriver))
- user << "You begin removing the support lines."
- playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
-
- sleep(40)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
-
- if( d_state == 1 && user.loc == T && user.get_active_hand() == W )
- src.d_state = 2
- src.icon_state = "r_wall-2"
- user << "You remove the support lines."
- return
-
- //REPAIRING (replacing the outer grille for cosmetic damage)
- else if( istype(W, /obj/item/stack/rods) )
- var/obj/item/stack/O = W
- src.d_state = 0
- src.icon_state = "r_wall"
- relativewall_neighbours() //call smoothwall stuff
- user << "You replace the outer grille."
- if (O.amount > 1)
- O.amount--
- else
- del(O)
- return
-
- if(2)
- if( istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
-
- user << "You begin slicing through the metal cover."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
-
- sleep(60)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T ) return
-
- if( d_state == 2 && user.loc == T && user.get_active_hand() == WT )
- src.d_state = 3
- src.icon_state = "r_wall-3"
- user << "You press firmly on the cover, dislodging it."
- else
- user << "You need more welding fuel to complete this task."
- return
-
- if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
-
- user << "You begin slicing through the metal cover."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
-
- sleep(40)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
-
- if( d_state == 2 && user.loc == T && user.get_active_hand() == W )
- src.d_state = 3
- src.icon_state = "r_wall-3"
- user << "You press firmly on the cover, dislodging it."
- return
-
- if(3)
- if (istype(W, /obj/item/weapon/crowbar))
-
- user << "You struggle to pry off the cover."
- playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
-
- sleep(100)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
-
- if( d_state == 3 && user.loc == T && user.get_active_hand() == W )
- src.d_state = 4
- src.icon_state = "r_wall-4"
- user << "You pry off the cover."
- return
-
- if(4)
- if (istype(W, /obj/item/weapon/wrench))
-
- user << "You start loosening the anchoring bolts which secure the support rods to their frame."
- playsound(src, 'sound/items/Ratchet.ogg', 100, 1)
-
- sleep(40)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
-
- if( d_state == 4 && user.loc == T && user.get_active_hand() == W )
- src.d_state = 5
- src.icon_state = "r_wall-5"
- user << "You remove the bolts anchoring the support rods."
- return
-
- if(5)
- if( istype(W, /obj/item/weapon/weldingtool) )
- var/obj/item/weapon/weldingtool/WT = W
- if( WT.remove_fuel(0,user) )
-
- user << "You begin slicing through the support rods."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
-
- sleep(100)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !WT || !WT.isOn() || !T ) return
-
- if( d_state == 5 && user.loc == T && user.get_active_hand() == WT )
- src.d_state = 6
- src.icon_state = "r_wall-6"
- new /obj/item/stack/rods( src )
- user << "The support rods drop out as you cut them loose from the frame."
- else
- user << "You need more welding fuel to complete this task."
- return
-
- if( istype(W, /obj/item/weapon/pickaxe/plasmacutter) )
-
- user << "You begin slicing through the support rods."
- playsound(src, 'sound/items/Welder.ogg', 100, 1)
-
- sleep(70)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
-
- if( d_state == 5 && user.loc == T && user.get_active_hand() == W )
- src.d_state = 6
- src.icon_state = "r_wall-6"
- new /obj/item/stack/rods( src )
- user << "The support rods drop out as you cut them loose from the frame."
- return
-
- if(6)
- if( istype(W, /obj/item/weapon/crowbar) )
-
- user << "You struggle to pry off the outer sheath."
- playsound(src, 'sound/items/Crowbar.ogg', 100, 1)
-
- sleep(100)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
-
- if( user.loc == T && user.get_active_hand() == W )
- user << "You pry off the outer sheath."
- dismantle_wall()
- return
-
-//vv OK, we weren't performing a valid deconstruction step or igniting thermite,let's check the other possibilities vv
-
- //DRILLING
- if (istype(W, /obj/item/weapon/pickaxe/diamonddrill))
-
- user << "You begin to drill though the wall."
-
- sleep(200)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return
-
- if( user.loc == T && user.get_active_hand() == W )
- user << "Your drill tears though the last of the reinforced plating."
- dismantle_wall()
-
- //REPAIRING
- else if( istype(W, /obj/item/stack/sheet/metal) && d_state )
- var/obj/item/stack/sheet/metal/MS = W
-
- user << "You begin patching-up the wall with \a [MS]."
-
- sleep( max(20*d_state,100) ) //time taken to repair is proportional to the damage! (max 10 seconds)
- if( !istype(src, /turf/simulated/wall/r_wall) || !user || !MS || !T ) return
-
- if( user.loc == T && user.get_active_hand() == MS && d_state )
- src.d_state = 0
- src.icon_state = "r_wall"
- relativewall_neighbours() //call smoothwall stuff
- user << "You repair the last of the damage."
- if (MS.amount > 1)
- MS.amount--
- else
- del(MS)
-
- //APC
- else if( istype(W,/obj/item/apc_frame) )
- var/obj/item/apc_frame/AH = W
- AH.try_build(src)
-
- else if( istype(W,/obj/item/alarm_frame) )
- var/obj/item/alarm_frame/AH = W
- AH.try_build(src)
-
- else if(istype(W,/obj/item/firealarm_frame))
- var/obj/item/firealarm_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/light_fixture_frame))
- var/obj/item/light_fixture_frame/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W,/obj/item/light_fixture_frame/small))
- var/obj/item/light_fixture_frame/small/AH = W
- AH.try_build(src)
- return
-
- else if(istype(W, /obj/item/weapon/reagent_containers))
- return // They tend to have meaningful afterattack - let them apply it without destroying a rotting wall
-
- //Finally, CHECKING FOR FALSE WALLS if it isn't damaged
- else if(!d_state)
- return attack_hand(user)
- return
\ No newline at end of file
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 2fd89bb876..d8db07de58 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -6,6 +6,7 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
icon = 'icons/turf/space.dmi'
name = "\proper space"
icon_state = "0"
+ dynamic_lighting = 0
temperature = T20C
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
@@ -20,9 +21,9 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
if(!config.starlight)
return
if(locate(/turf/simulated) in orange(src,1))
- SetLuminosity(config.starlight)
+ set_light(config.starlight)
else
- SetLuminosity(0)
+ set_light(0)
/turf/space/attackby(obj/item/C as obj, mob/user as mob)
@@ -43,7 +44,7 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
var/obj/item/stack/tile/plasteel/S = C
if (S.get_amount() < 1)
return
- del(L)
+ qdel(L)
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
S.build(src)
S.use(1)
@@ -69,11 +70,11 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
if(A.z > 6 && !config.use_overmap) return
if (A.x <= TRANSITIONEDGE || A.x >= (world.maxx - TRANSITIONEDGE - 1) || A.y <= TRANSITIONEDGE || A.y >= (world.maxy - TRANSITIONEDGE - 1))
if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
- del(A)
+ qdel(A)
return
if(istype(A, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level.
- del(A) //The disk's Del() proc ensures a new one is created
+ qdel(A) //The disk's Destroy() proc ensures a new one is created
return
if(config.use_overmap)
overmap_spacetravel(src,A)
@@ -94,10 +95,10 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
MM.inertia_dir = 2
else
for(var/obj/item/weapon/disk/nuclear/N in disk_search)
- del(N)//Make the disk respawn it is on a clientless mob or corpse
+ qdel(N)//Make the disk respawn it is on a clientless mob or corpse
else
for(var/obj/item/weapon/disk/nuclear/N in disk_search)
- del(N)//Make the disk respawn if it is floating on its own
+ qdel(N)//Make the disk respawn if it is floating on its own
return
var/move_to_z = src.z
@@ -148,7 +149,7 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
if(src.x <= 1)
if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
- del(A)
+ qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
@@ -173,7 +174,7 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
A.loc.Entered(A)
else if (src.x >= world.maxx)
if(istype(A, /obj/effect/meteor))
- del(A)
+ qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
@@ -198,7 +199,7 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
A.loc.Entered(A)
else if (src.y <= 1)
if(istype(A, /obj/effect/meteor))
- del(A)
+ qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
if(!cur_pos) return
@@ -223,7 +224,7 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
else if (src.y >= world.maxy)
if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
- del(A)
+ qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
if(!cur_pos) return
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 1bc058ef6d..7af228b49c 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -32,6 +32,8 @@
// holy water
var/holy = 0
+ var/dynamic_lighting = 1
+
/turf/New()
..()
for(var/atom/movable/AM as mob|obj in src)
@@ -197,7 +199,7 @@
/turf/proc/RemoveLattice()
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
- del L
+ qdel(L)
//Creates a new turf
/turf/proc/ChangeTurf(var/turf/N, var/tell_universe=1, var/force_lighting_update = 0)
@@ -218,8 +220,10 @@
return W
///// Z-Level Stuff
- var/old_lumcount = lighting_lumcount - initial(lighting_lumcount)
var/obj/fire/old_fire = fire
+ var/old_opacity = opacity
+ var/old_dynamic_lighting = dynamic_lighting
+ var/list/old_affecting_lights = affecting_lights
//world << "Replacing [src.type] with [N]"
@@ -233,21 +237,7 @@
if(S.zone) S.zone.rebuild()
if(ispath(N, /turf/simulated/floor))
- //if the old turf had a zone, connect the new turf to it as well - Cael
- //Adjusted by SkyMarshal 5/10/13 - The air master will handle the addition of the new turf.
- //if(zone)
- // zone.RemoveTurf(src)
- // if(!zone.CheckStatus())
- // zone.SetStatus(ZONE_ACTIVE)
-
var/turf/simulated/W = new N( locate(src.x, src.y, src.z) )
- //W.Assimilate_Air()
-
- W.lighting_lumcount += old_lumcount
- if((old_lumcount != W.lighting_lumcount) || (loc.name != "Space" && force_lighting_update))
- W.lighting_changed = 1
- lighting_controller.changed_turfs += W
-
if(old_fire)
fire = old_fire
@@ -258,25 +248,17 @@
universe.OnTurfChange(W)
if(air_master)
- air_master.mark_for_update(src)
+ air_master.mark_for_update(src) //handle the addition of the new turf.
for(var/turf/space/S in range(W,1))
S.update_starlight()
W.levelupdate()
- return W
+ . = W
else
- //if(zone)
- // zone.RemoveTurf(src)
- // if(!zone.CheckStatus())
- // zone.SetStatus(ZONE_ACTIVE)
var/turf/W = new N( locate(src.x, src.y, src.z) )
- W.lighting_lumcount += old_lumcount
- if((old_lumcount != W.lighting_lumcount) || (loc.name != "Space" && force_lighting_update))
- W.lighting_changed = 1
- lighting_controller.changed_turfs += W
if(old_fire)
old_fire.RemoveFire()
@@ -291,7 +273,16 @@
S.update_starlight()
W.levelupdate()
- return W
+ . = W
+
+ affecting_lights = old_affecting_lights
+ if((old_opacity != opacity) || (dynamic_lighting != old_dynamic_lighting) || force_lighting_update)
+ reconsider_lights()
+ if(dynamic_lighting != old_dynamic_lighting)
+ if(dynamic_lighting)
+ lighting_build_overlays()
+ else
+ lighting_clear_overlays()
//Commented out by SkyMarshal 5/10/13 - If you are patching up space, it should be vacuum.
@@ -348,7 +339,8 @@
/turf/proc/ReplaceWithLattice()
src.ChangeTurf(/turf/space)
- new /obj/structure/lattice( locate(src.x, src.y, src.z) )
+ spawn()
+ new /obj/structure/lattice( locate(src.x, src.y, src.z) )
/turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N
//Useful to batch-add creatures to the list.
diff --git a/code/game/turfs/turf_flick_animations.dm b/code/game/turfs/turf_flick_animations.dm
index 59bcfd56d7..b1bccd51bc 100644
--- a/code/game/turfs/turf_flick_animations.dm
+++ b/code/game/turfs/turf_flick_animations.dm
@@ -17,5 +17,5 @@
flick("turf_animation",c_animation)
spawn(10)
if(c_animation)
- PlaceInPool(c_animation)
+ qdel(c_animation)
c_animation = null
diff --git a/code/game/vehicles/vehicle.dm b/code/game/vehicles/vehicle.dm
index 3ec73f3eeb..4088528b35 100644
--- a/code/game/vehicles/vehicle.dm
+++ b/code/game/vehicles/vehicle.dm
@@ -1,190 +1,190 @@
-
-
-/obj/vehicle
- name = "Vehicle"
- icon = 'icons/vehicles/vehicles.dmi'
- density = 1
- anchored = 1
- unacidable = 1 //To avoid the pilot-deleting shit that came with mechas
- layer = MOB_LAYER
- //var/can_move = 1
- var/mob/living/carbon/occupant = null
- //var/step_in = 10 //make a step in step_in/10 sec.
- //var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
- //var/step_energy_drain = 10
- var/health = 300 //health is health
- //var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
- //the values in this list show how much damage will pass through, not how much will be absorbed.
- var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
- var/obj/item/weapon/cell/cell //Our power source
- var/state = 0
- var/list/log = new
- var/last_message = 0
- var/add_req_access = 1
- var/maint_access = 1
- //var/dna //dna-locking the mech
- var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
- var/datum/effect/effect/system/spark_spread/spark_system = new
- var/lights = 0
- var/lights_power = 6
-
- //inner atmos //These go in airtight.dm, not all vehicles are space-faring -Agouri
- //var/use_internal_tank = 0
- //var/internal_tank_valve = ONE_ATMOSPHERE
- //var/obj/machinery/portable_atmospherics/canister/internal_tank
- //var/datum/gas_mixture/cabin_air
- //var/obj/machinery/atmospherics/portables_connector/connected_port = null
-
- var/obj/item/device/radio/radio = null
-
- var/max_temperature = 2500
- //var/internal_damage_threshold = 50 //health percentage below which internal damage is possible
- var/internal_damage = 0 //contains bitflags
-
- var/list/operation_req_access = list()//required access level for mecha operation
- var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment
-
- //var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature //In airtight.dm you go -Agouri
- var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss
-
- //var/datum/global_iterator/pr_give_air //moves air from tank to cabin //Y-you too -Agouri
-
- var/datum/global_iterator/pr_internal_damage //processes internal damage
-
-
- var/wreckage
-
- var/list/equipment = new
- var/obj/selected
- //var/max_equip = 3
-
- var/datum/events/events
-
-
-
-/obj/vehicle/New()
- ..()
- events = new
- icon_state += "-unmanned"
- add_radio()
- //add_cabin() //No cabin for non-airtights
-
- spark_system.set_up(2, 0, src)
- spark_system.attach(src)
- add_cell()
- add_iterators()
- removeVerb(/obj/mecha/verb/disconnect_from_port)
- removeVerb(/atom/movable/verb/pull)
- log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.")
- loc.Entered(src)
- return
-
-
-//################ Helpers ###########################################################
-
-
-/obj/vehicle/proc/removeVerb(verb_path)
- verbs -= verb_path
-
-/obj/vehicle/proc/addVerb(verb_path)
- verbs += verb_path
-
-/*/obj/vehicle/proc/add_airtank() //In airtight.dm -Agouri
- internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
- return internal_tank*/
-
-/obj/vehicle/proc/add_cell(var/obj/item/weapon/cell/C=null)
- if(C)
- C.forceMove(src)
- cell = C
- return
- cell = new(src)
- cell.charge = 15000
- cell.maxcharge = 15000
-
-/*/obj/vehicle/proc/add_cabin() //In airtight.dm -Agouri
- cabin_air = new
- cabin_air.temperature = T20C
- cabin_air.volume = 200
- cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
- cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
- return cabin_air*/
-
-/obj/vehicle/proc/add_radio()
- radio = new(src)
- radio.name = "[src] radio"
- radio.icon = icon
- radio.icon_state = icon_state
- radio.subspace_transmission = 1
-
-/obj/vehicle/proc/add_iterators()
- pr_inertial_movement = new /datum/global_iterator/vehicle_intertial_movement(null,0)
- //pr_internal_damage = new /datum/global_iterator/vehicle_internal_damage(list(src),0)
- //pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src)) //In airtight.dm's add_airtight_iterators -Agouri
- //pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src) //Same here -Agouri
-
-/obj/vehicle/proc/check_for_support()
- if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src)))
- return 1
- else
- return 0
-
-//################ Logs and messages ############################################
-
-
-/obj/vehicle/proc/log_message(message as text,red=null)
- log.len++
- log[log.len] = list("time"=world.timeofday,"message"="[red?"":null][message][red?"":null]")
- return log.len
-
-
-
-//################ Global Iterator Datums ######################################
-
-
-/datum/global_iterator/vehicle_intertial_movement //inertial movement in space
- delay = 7
-
- process(var/obj/vehicle/V as obj, direction)
- if(direction)
- if(!step(V, direction)||V.check_for_support())
- src.stop()
- else
- src.stop()
- return
-
-
-/datum/global_iterator/mecha_internal_damage // processing internal damage
-
- process(var/obj/mecha/mecha)
- if(!mecha.hasInternalDamage())
- return stop()
- if(mecha.hasInternalDamage(MECHA_INT_FIRE))
- if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
- mecha.clearInternalDamage(MECHA_INT_FIRE)
- if(mecha.internal_tank)
- if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
- mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
- var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
- if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents
- int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
- if(mecha.cabin_air && mecha.cabin_air.return_volume()>0)
- mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15))
- if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2)
- mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire")
- if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
- mecha.pr_int_temp_processor.stop()
- if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
- if(mecha.internal_tank)
- var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
- var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
- if(mecha.loc && hascall(mecha.loc,"assume_air"))
- mecha.loc.assume_air(leaked_gas)
- else
- del(leaked_gas)
- if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
- if(mecha.get_charge())
- mecha.spark_system.start()
- mecha.cell.charge -= min(20,mecha.cell.charge)
- mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
+
+
+/obj/vehicle
+ name = "Vehicle"
+ icon = 'icons/vehicles/vehicles.dmi'
+ density = 1
+ anchored = 1
+ unacidable = 1 //To avoid the pilot-deleting shit that came with mechas
+ layer = MOB_LAYER
+ //var/can_move = 1
+ var/mob/living/carbon/occupant = null
+ //var/step_in = 10 //make a step in step_in/10 sec.
+ //var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
+ //var/step_energy_drain = 10
+ var/health = 300 //health is health
+ //var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
+ //the values in this list show how much damage will pass through, not how much will be absorbed.
+ var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
+ var/obj/item/weapon/cell/cell //Our power source
+ var/state = 0
+ var/list/log = new
+ var/last_message = 0
+ var/add_req_access = 1
+ var/maint_access = 1
+ //var/dna //dna-locking the mech
+ var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
+ var/datum/effect/effect/system/spark_spread/spark_system = new
+ var/lights = 0
+ var/lights_power = 6
+
+ //inner atmos //These go in airtight.dm, not all vehicles are space-faring -Agouri
+ //var/use_internal_tank = 0
+ //var/internal_tank_valve = ONE_ATMOSPHERE
+ //var/obj/machinery/portable_atmospherics/canister/internal_tank
+ //var/datum/gas_mixture/cabin_air
+ //var/obj/machinery/atmospherics/portables_connector/connected_port = null
+
+ var/obj/item/device/radio/radio = null
+
+ var/max_temperature = 2500
+ //var/internal_damage_threshold = 50 //health percentage below which internal damage is possible
+ var/internal_damage = 0 //contains bitflags
+
+ var/list/operation_req_access = list()//required access level for mecha operation
+ var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment
+
+ //var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature //In airtight.dm you go -Agouri
+ var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss
+
+ //var/datum/global_iterator/pr_give_air //moves air from tank to cabin //Y-you too -Agouri
+
+ var/datum/global_iterator/pr_internal_damage //processes internal damage
+
+
+ var/wreckage
+
+ var/list/equipment = new
+ var/obj/selected
+ //var/max_equip = 3
+
+ var/datum/events/events
+
+
+
+/obj/vehicle/New()
+ ..()
+ events = new
+ icon_state += "-unmanned"
+ add_radio()
+ //add_cabin() //No cabin for non-airtights
+
+ spark_system.set_up(2, 0, src)
+ spark_system.attach(src)
+ add_cell()
+ add_iterators()
+ removeVerb(/obj/mecha/verb/disconnect_from_port)
+ removeVerb(/atom/movable/verb/pull)
+ log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.")
+ loc.Entered(src)
+ return
+
+
+//################ Helpers ###########################################################
+
+
+/obj/vehicle/proc/removeVerb(verb_path)
+ verbs -= verb_path
+
+/obj/vehicle/proc/addVerb(verb_path)
+ verbs += verb_path
+
+/*/obj/vehicle/proc/add_airtank() //In airtight.dm -Agouri
+ internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
+ return internal_tank*/
+
+/obj/vehicle/proc/add_cell(var/obj/item/weapon/cell/C=null)
+ if(C)
+ C.forceMove(src)
+ cell = C
+ return
+ cell = new(src)
+ cell.charge = 15000
+ cell.maxcharge = 15000
+
+/*/obj/vehicle/proc/add_cabin() //In airtight.dm -Agouri
+ cabin_air = new
+ cabin_air.temperature = T20C
+ cabin_air.volume = 200
+ cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
+ cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
+ return cabin_air*/
+
+/obj/vehicle/proc/add_radio()
+ radio = new(src)
+ radio.name = "[src] radio"
+ radio.icon = icon
+ radio.icon_state = icon_state
+ radio.subspace_transmission = 1
+
+/obj/vehicle/proc/add_iterators()
+ pr_inertial_movement = new /datum/global_iterator/vehicle_intertial_movement(null,0)
+ //pr_internal_damage = new /datum/global_iterator/vehicle_internal_damage(list(src),0)
+ //pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src)) //In airtight.dm's add_airtight_iterators -Agouri
+ //pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src) //Same here -Agouri
+
+/obj/vehicle/proc/check_for_support()
+ if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src)))
+ return 1
+ else
+ return 0
+
+//################ Logs and messages ############################################
+
+
+/obj/vehicle/proc/log_message(message as text,red=null)
+ log.len++
+ log[log.len] = list("time"=world.timeofday,"message"="[red?"":null][message][red?"":null]")
+ return log.len
+
+
+
+//################ Global Iterator Datums ######################################
+
+
+/datum/global_iterator/vehicle_intertial_movement //inertial movement in space
+ delay = 7
+
+ process(var/obj/vehicle/V as obj, direction)
+ if(direction)
+ if(!step(V, direction)||V.check_for_support())
+ src.stop()
+ else
+ src.stop()
+ return
+
+
+/datum/global_iterator/mecha_internal_damage // processing internal damage
+
+ process(var/obj/mecha/mecha)
+ if(!mecha.hasInternalDamage())
+ return stop()
+ if(mecha.hasInternalDamage(MECHA_INT_FIRE))
+ if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
+ mecha.clearInternalDamage(MECHA_INT_FIRE)
+ if(mecha.internal_tank)
+ if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
+ mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
+ var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
+ if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents
+ int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
+ if(mecha.cabin_air && mecha.cabin_air.return_volume()>0)
+ mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15))
+ if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2)
+ mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire")
+ if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
+ mecha.pr_int_temp_processor.stop()
+ if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
+ if(mecha.internal_tank)
+ var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
+ var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
+ if(mecha.loc && hascall(mecha.loc,"assume_air"))
+ mecha.loc.assume_air(leaked_gas)
+ else
+ qdel(leaked_gas)
+ if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
+ if(mecha.get_charge())
+ mecha.spark_system.start()
+ mecha.cell.charge -= min(20,mecha.cell.charge)
+ mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
return
\ No newline at end of file
diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm
index 92b0638b9f..82fef02e97 100644
--- a/code/game/verbs/ooc.dm
+++ b/code/game/verbs/ooc.dm
@@ -85,8 +85,8 @@
return
if(!holder)
- if(!config.ooc_allowed)
- src << "OOC is globally muted."
+ if(!config.looc_allowed)
+ src << "LOOC is globally muted."
return
if(!config.dooc_allowed && (mob.stat == DEAD))
usr << "OOC for dead mobs has been turned off."
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 7b5a4558cf..b522d7e7c6 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -277,6 +277,13 @@ var/global/floorIsLava = 0
var/dat = "Info on [key]"
dat += ""
+ var/p_age = "unknown"
+ for(var/client/C in clients)
+ if(C.ckey == key)
+ p_age = C.player_age
+ break
+ dat +="Player age: [p_age]
"
+
var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
var/list/infos
info >> infos
@@ -747,20 +754,43 @@ var/global/floorIsLava = 0
set category = "Server"
set desc="Globally Toggles OOC"
set name="Toggle OOC"
+
+ if(!check_rights(R_ADMIN))
+ return
+
config.ooc_allowed = !(config.ooc_allowed)
if (config.ooc_allowed)
world << "The OOC channel has been globally enabled!"
else
world << "The OOC channel has been globally disabled!"
- log_admin("[key_name(usr)] toggled OOC.")
- message_admins("[key_name_admin(usr)] toggled OOC.", 1)
+ log_and_message_admins("toggled OOC.")
feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+/datum/admins/proc/togglelooc()
+ set category = "Server"
+ set desc="Globally Toggles LOOC"
+ set name="Toggle LOOC"
+
+ if(!check_rights(R_ADMIN))
+ return
+
+ config.looc_allowed = !(config.looc_allowed)
+ if (config.looc_allowed)
+ world << "The LOOC channel has been globally enabled!"
+ else
+ world << "The LOOC channel has been globally disabled!"
+ log_and_message_admins("toggled LOOC.")
+ feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+
/datum/admins/proc/toggledsay()
set category = "Server"
set desc="Globally Toggles DSAY"
set name="Toggle DSAY"
+
+ if(!check_rights(R_ADMIN))
+ return
+
config.dsay_allowed = !(config.dsay_allowed)
if (config.dsay_allowed)
world << "Deadchat has been globally enabled!"
@@ -774,6 +804,10 @@ var/global/floorIsLava = 0
set category = "Server"
set desc="Toggle Dead OOC."
set name="Toggle Dead OOC"
+
+ if(!check_rights(R_ADMIN))
+ return
+
config.dooc_allowed = !( config.dooc_allowed )
log_admin("[key_name(usr)] toggled Dead OOC.")
message_admins("[key_name_admin(usr)] toggled Dead OOC.", 1)
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 0da8f61240..877b29b0b1 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -58,6 +58,7 @@ var/list/admin_verbs_admin = list(
/client/proc/investigate_show, /*various admintools for investigation. Such as a singulo grief-log*/
/client/proc/secrets,
/datum/admins/proc/toggleooc, /*toggles ooc on/off for everyone*/
+ /datum/admins/proc/togglelooc, /*toggles looc on/off for everyone*/
/datum/admins/proc/toggleoocdead, /*toggles ooc on/off for everyone who is dead*/
/datum/admins/proc/toggledsay, /*toggles dsay on/off for everyone*/
/client/proc/game_panel, /*game panel, allows to change game-mode etc*/
@@ -109,7 +110,8 @@ var/list/admin_verbs_fun = list(
/client/proc/cmd_admin_add_random_ai_law,
/client/proc/make_sound,
/client/proc/toggle_random_events,
- /client/proc/editappear
+ /client/proc/editappear,
+ /client/proc/roll_dices
)
var/list/admin_verbs_spawn = list(
/datum/admins/proc/spawn_fruit,
@@ -254,6 +256,7 @@ var/list/admin_verbs_hideable = list(
/client/proc/cmd_debug_tog_aliens,
/client/proc/air_report,
/client/proc/enable_debug_verbs,
+ /client/proc/roll_dices,
/proc/possess,
/proc/release
)
@@ -523,7 +526,7 @@ var/list/admin_verbs_mentor = list(
if(C)
message_admins("[key_name_admin(src)] has warned [key_name_admin(C)] resulting in a [AUTOBANTIME] minute ban.")
C << "You have been autobanned due to a warning by [ckey].
This is a temporary ban, it will be removed in [AUTOBANTIME] minutes."
- del(C)
+ qdel(C)
else
message_admins("[key_name_admin(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban.")
AddBan(warned_ckey, D.last_id, "Autobanning due to too many formal warnings", ckey, 1, AUTOBANTIME)
diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm
index 0588ef5e6d..dbd4de6444 100644
--- a/code/modules/admin/holder2.dm
+++ b/code/modules/admin/holder2.dm
@@ -16,7 +16,7 @@ var/list/admin_datums = list()
/datum/admins/New(initial_rank = "Temporary Admin", initial_rights = 0, ckey)
if(!ckey)
error("Admin datum created without a ckey argument. Datum has been deleted")
- del(src)
+ qdel(src)
return
admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
rank = initial_rank
@@ -91,5 +91,5 @@ NOTE: It checks usr by default. Supply the "user" argument if you wish to check
/client/proc/deadmin()
if(holder)
holder.disassociate()
- //del(holder)
+ //qdel(holder)
return 1
diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm
index 3a74da5fca..a00a208d3b 100644
--- a/code/modules/admin/player_notes.dm
+++ b/code/modules/admin/player_notes.dm
@@ -1,167 +1,167 @@
-//This stuff was originally intended to be integrated into the ban-system I was working on
-//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
-//enjoy ~Carn
-/*
-#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
-
-datum/admins/proc/notes_show(var/ckey)
- usr << browse("Player Notes[notes_gethtml(ckey)]","window=player_notes;size=700x400")
-
-
-datum/admins/proc/notes_gethtml(var/ckey)
- var/savefile/notesfile = new(NOTESFILE)
- if(!notesfile) return "Error: Cannot access [NOTESFILE]"
- if(ckey)
- . = "Notes for [ckey]: \[+\] \[-\]
"
- notesfile.cd = "/[ckey]"
- var/index = 1
- while( !notesfile.eof )
- var/note
- notesfile >> note
- . += "[note] \[-\]
"
- index++
- else
- . = "All Notes: \[+\] \[-\]
"
- notesfile.cd = "/"
- for(var/dir in notesfile.dir)
- . += "[dir]
"
- return
-
-
-//handles adding notes to the end of a ckey's buffer
-//originally had seperate entries such as var/by to record who left the note and when
-//but the current bansystem is a heap of dung.
-/proc/notes_add(var/ckey, var/note)
- if(!ckey)
- ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null)
- if(!ckey) return
-
- if(!note)
- note = html_encode(input(usr,"Enter your note:","Enter some text",null) as message|null)
- if(!note) return
-
- var/savefile/notesfile = new(NOTESFILE)
- if(!notesfile) return
- notesfile.cd = "/[ckey]"
- notesfile.eof = 1 //move to the end of the buffer
- notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]"
- return
-
-//handles removing entries from the buffer, or removing the entire directory if no start_index is given
-/proc/notes_remove(var/ckey, var/start_index, var/end_index)
- var/savefile/notesfile = new(NOTESFILE)
- if(!notesfile) return
-
- if(!ckey)
- notesfile.cd = "/"
- ckey = ckey(input(usr,"Who would you like to remove notes for?","Enter a ckey",null) as null|anything in notesfile.dir)
- if(!ckey) return
-
- if(start_index)
- notesfile.cd = "/[ckey]"
- var/list/noteslist = list()
- if(!end_index) end_index = start_index
- var/index = 0
- while( !notesfile.eof )
- index++
- var/temp
- notesfile >> temp
- if( (start_index <= index) && (index <= end_index) )
- continue
- noteslist += temp
-
- notesfile.eof = -2 //Move to the start of the buffer and then erase.
-
- for( var/note in noteslist )
- notesfile << note
- else
- notesfile.cd = "/"
- if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
- notesfile.dir.Remove(ckey)
- return
-
-#undef NOTESFILE
-*/
-
-//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
-
-/proc/notes_add(var/key, var/note, var/mob/usr)
- if (!key || !note)
- return
-
- //Loading list of notes for this key
- var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
- var/list/infos
- info >> infos
- if(!infos) infos = list()
-
- //Overly complex timestamp creation
- var/modifyer = "th"
- switch(time2text(world.timeofday, "DD"))
- if("01","21","31")
- modifyer = "st"
- if("02","22",)
- modifyer = "nd"
- if("03","23")
- modifyer = "rd"
- var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
- if(copytext(day_string,1,2) == "0")
- day_string = copytext(day_string,2)
- var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
- var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
-
- var/datum/player_info/P = new
- if (usr)
- P.author = usr.key
- P.rank = usr.client.holder.rank
- else
- P.author = "Adminbot"
- P.rank = "Friendly Robot"
- P.content = note
- P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
-
- infos += P
- info << infos
-
- message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
- log_admin("[key_name(usr)] has edited [key]'s notes.")
-
- del 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
- del 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.")
-
- del info
-
-/proc/show_player_info_irc(var/key as text)
- var/dat = " Info on [key]%0D%0A"
- var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
- var/list/infos
- info >> infos
- if(!infos)
- dat = "No information found on the given key."
- else
- for(var/datum/player_info/I in infos)
- dat += "[I.content]%0D%0Aby [I.author] ([I.rank]) on [I.timestamp]%0D%0A%0D%0A"
-
- return dat
+//This stuff was originally intended to be integrated into the ban-system I was working on
+//but it's safe to say that'll never be finished. So I've merged it into the current player panel.
+//enjoy ~Carn
+/*
+#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
+
+datum/admins/proc/notes_show(var/ckey)
+ usr << browse("Player Notes[notes_gethtml(ckey)]","window=player_notes;size=700x400")
+
+
+datum/admins/proc/notes_gethtml(var/ckey)
+ var/savefile/notesfile = new(NOTESFILE)
+ if(!notesfile) return "Error: Cannot access [NOTESFILE]"
+ if(ckey)
+ . = "Notes for [ckey]: \[+\] \[-\]
"
+ notesfile.cd = "/[ckey]"
+ var/index = 1
+ while( !notesfile.eof )
+ var/note
+ notesfile >> note
+ . += "[note] \[-\]
"
+ index++
+ else
+ . = "All Notes: \[+\] \[-\]
"
+ notesfile.cd = "/"
+ for(var/dir in notesfile.dir)
+ . += "[dir]
"
+ return
+
+
+//handles adding notes to the end of a ckey's buffer
+//originally had seperate entries such as var/by to record who left the note and when
+//but the current bansystem is a heap of dung.
+/proc/notes_add(var/ckey, var/note)
+ if(!ckey)
+ ckey = ckey(input(usr,"Who would you like to add notes for?","Enter a ckey",null) as text|null)
+ if(!ckey) return
+
+ if(!note)
+ note = html_encode(input(usr,"Enter your note:","Enter some text",null) as message|null)
+ if(!note) return
+
+ var/savefile/notesfile = new(NOTESFILE)
+ if(!notesfile) return
+ notesfile.cd = "/[ckey]"
+ notesfile.eof = 1 //move to the end of the buffer
+ notesfile << "[time2text(world.realtime,"DD-MMM-YYYY")] | [note][(usr && usr.ckey)?" ~[usr.ckey]":""]"
+ return
+
+//handles removing entries from the buffer, or removing the entire directory if no start_index is given
+/proc/notes_remove(var/ckey, var/start_index, var/end_index)
+ var/savefile/notesfile = new(NOTESFILE)
+ if(!notesfile) return
+
+ if(!ckey)
+ notesfile.cd = "/"
+ ckey = ckey(input(usr,"Who would you like to remove notes for?","Enter a ckey",null) as null|anything in notesfile.dir)
+ if(!ckey) return
+
+ if(start_index)
+ notesfile.cd = "/[ckey]"
+ var/list/noteslist = list()
+ if(!end_index) end_index = start_index
+ var/index = 0
+ while( !notesfile.eof )
+ index++
+ var/temp
+ notesfile >> temp
+ if( (start_index <= index) && (index <= end_index) )
+ continue
+ noteslist += temp
+
+ notesfile.eof = -2 //Move to the start of the buffer and then erase.
+
+ for( var/note in noteslist )
+ notesfile << note
+ else
+ notesfile.cd = "/"
+ if(alert(usr,"Are you sure you want to remove all their notes?","Confirmation","No","Yes - Remove all notes") == "Yes - Remove all notes")
+ notesfile.dir.Remove(ckey)
+ return
+
+#undef NOTESFILE
+*/
+
+//Hijacking this file for BS12 playernotes functions. I like this ^ one systemm alright, but converting sounds too bothersome~ Chinsky.
+
+/proc/notes_add(var/key, var/note, var/mob/usr)
+ if (!key || !note)
+ return
+
+ //Loading list of notes for this key
+ var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
+ var/list/infos
+ info >> infos
+ if(!infos) infos = list()
+
+ //Overly complex timestamp creation
+ var/modifyer = "th"
+ switch(time2text(world.timeofday, "DD"))
+ if("01","21","31")
+ modifyer = "st"
+ if("02","22",)
+ modifyer = "nd"
+ if("03","23")
+ modifyer = "rd"
+ var/day_string = "[time2text(world.timeofday, "DD")][modifyer]"
+ if(copytext(day_string,1,2) == "0")
+ day_string = copytext(day_string,2)
+ var/full_date = time2text(world.timeofday, "DDD, Month DD of YYYY")
+ var/day_loc = findtext(full_date, time2text(world.timeofday, "DD"))
+
+ var/datum/player_info/P = new
+ if (usr)
+ P.author = usr.key
+ P.rank = usr.client.holder.rank
+ else
+ P.author = "Adminbot"
+ P.rank = "Friendly Robot"
+ P.content = note
+ P.timestamp = "[copytext(full_date,1,day_loc)][day_string][copytext(full_date,day_loc+2)]"
+
+ infos += P
+ info << infos
+
+ message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
+ log_admin("[key_name(usr)] has edited [key]'s notes.")
+
+ qdel(info)
+
+ //Updating list of keys with notes on them
+ var/savefile/note_list = new("data/player_notes.sav")
+ var/list/note_keys
+ note_list >> note_keys
+ if(!note_keys) note_keys = list()
+ if(!note_keys.Find(key)) note_keys += key
+ note_list << note_keys
+ qdel(note_list)
+
+
+/proc/notes_del(var/key, var/index)
+ var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
+ var/list/infos
+ info >> infos
+ if(!infos || infos.len < index) return
+
+ var/datum/player_info/item = infos[index]
+ infos.Remove(item)
+ info << infos
+
+ message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
+ log_admin("[key_name(usr)] deleted one of [key]'s notes.")
+
+ qdel(info)
+
+/proc/show_player_info_irc(var/key as text)
+ var/dat = " Info on [key]%0D%0A"
+ var/savefile/info = new("data/player_saves/[copytext(key, 1, 2)]/[key]/info.sav")
+ var/list/infos
+ info >> infos
+ if(!infos)
+ dat = "No information found on the given key."
+ else
+ for(var/datum/player_info/I in infos)
+ dat += "[I.content]%0D%0Aby [I.author] ([I.rank]) on [I.timestamp]%0D%0A%0D%0A"
+
+ return dat
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 8f943ccb6c..ffa64ce64f 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -745,7 +745,7 @@
log_admin("[key_name(usr)] booted [key_name(M)].")
message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1)
//M.client = null
- del(M.client)
+ qdel(M.client)
/*
//Player Notes
else if(href_list["notes"])
@@ -811,8 +811,8 @@
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
- del(M.client)
- //del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
+ qdel(M.client)
+ //qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
if("No")
if(!check_rights(R_BAN)) return
var/reason = sanitize(input(usr,"Reason?","reason","Griefer") as text|null)
@@ -836,8 +836,8 @@
feedback_inc("ban_perma",1)
DB_ban_record(BANTYPE_PERMA, M, -1, reason)
- del(M.client)
- //del(M)
+ qdel(M.client)
+ //qdel(M)
if("Cancel")
return
@@ -1301,7 +1301,7 @@
S.victim = M
S.loc = M.loc
spawn(20)
- del(S)
+ qdel(S)
var/turf/simulated/floor/T = get_turf(M)
if(istype(T))
@@ -1369,8 +1369,8 @@
var/data = ""
var/obj/item/weapon/paper_bundle/B = fax
- for (var/page = 1, page <= B.amount, page++)
- var/obj/pageobj = B.contents[page]
+ for (var/page = 1, page <= B.pages.len, page++)
+ var/obj/pageobj = B.pages[page]
data += "Page [page] - [pageobj.name]
"
usr << browse(data, "window=[B.name]")
@@ -1383,11 +1383,11 @@
if (!bundle) return
- if (istype(bundle.contents[page], /obj/item/weapon/paper))
- var/obj/item/weapon/paper/P = bundle.contents[page]
+ if (istype(bundle.pages[page], /obj/item/weapon/paper))
+ var/obj/item/weapon/paper/P = bundle.pages[page]
P.show_content(src.owner, 1)
- else if (istype(bundle.contents[page], /obj/item/weapon/photo))
- var/obj/item/weapon/photo/H = bundle.contents[page]
+ else if (istype(bundle.pages[page], /obj/item/weapon/photo))
+ var/obj/item/weapon/photo/H = bundle.pages[page]
H.show(src.owner)
return
@@ -1424,7 +1424,7 @@
src.owner << "\red Message reply failed."
spawn(100)
- del(P)
+ qdel(P)
return
else if(href_list["SolGovFaxReply"])
@@ -1669,28 +1669,28 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SC")
for(var/obj/item/clothing/under/O in world)
- del(O)
+ qdel(O)
ok = 1
if("sec_all_clothes")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SAC")
for(var/obj/item/clothing/O in world)
- del(O)
+ qdel(O)
ok = 1
if("sec_classic1")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SC1")
for(var/obj/item/clothing/suit/fire/O in world)
- del(O)
+ qdel(O)
for(var/obj/structure/grille/O in world)
- del(O)
+ qdel(O)
/* for(var/obj/machinery/vehicle/pod/O in world)
for(var/mob/M in src)
M.loc = src.loc
if (M.client)
M.client.perspective = MOB_PERSPECTIVE
M.client.eye = M
- del(O)
+ qdel(O)
ok = 1*/
if("monkey")
feedback_inc("admin_secrets_fun_used",1)
@@ -2044,7 +2044,7 @@
var/turf/T = pick(blobstart)
var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 )
spawn(rand(100, 600))
- del(bh)
+ qdel(bh)
if("timeanomalies") //dear god this code was awful :P Still needs further optimisation
feedback_inc("admin_secrets_fun_used",1)
@@ -2216,7 +2216,6 @@
for(var/obj/item/clothing/under/W in world)
W.icon_state = "schoolgirl"
W.item_state = "w_suit"
- W.item_color = "schoolgirl"
message_admins("[key_name_admin(usr)] activated Japanese Animes mode")
world << sound('sound/AI/animes.ogg')
if("paintball")
@@ -2273,7 +2272,7 @@
feedback_add_details("admin_secrets_fun_used","NS")
var/choice = input("You sure you want to end the round and summon narsie at your location? Misuse of this could result in removal of flags or halarity.") in list("PRAISE SATAN", "Cancel")
if(choice == "PRAISE SATAN")
- new /obj/machinery/singularity/narsie/large(get_turf(usr))
+ new /obj/singularity/narsie/large(get_turf(usr))
message_admins("[key_name_admin(usr)] has summoned narsie and brought about a new realm of suffering.")
if("supermattercascade")
feedback_inc("admin_secrets_fun_used",1)
diff --git a/code/modules/admin/verbs/BrokenInhands.dm b/code/modules/admin/verbs/BrokenInhands.dm
index 914ba1b5df..e5d6dc2661 100644
--- a/code/modules/admin/verbs/BrokenInhands.dm
+++ b/code/modules/admin/verbs/BrokenInhands.dm
@@ -26,7 +26,7 @@
// if(!istates.Find(O.item_state))
// text += "[O.type] MISSING NORMAL ICON CALLED\n\"[O.item_state]\" IN \"[O.icon]\"\n"
//text+="\n"
- del(O)
+ qdel(O)
if(text)
var/F = file("broken_icons.txt")
fdel(F)
diff --git a/code/modules/admin/verbs/SDQL.dm b/code/modules/admin/verbs/SDQL.dm
index d8626da403..a98cc3a1d9 100644
--- a/code/modules/admin/verbs/SDQL.dm
+++ b/code/modules/admin/verbs/SDQL.dm
@@ -1,497 +1,497 @@
-
-//Structured Datum Query Language. Basically SQL meets BYOND objects.
-
-//Note: For use in BS12, need text_starts_with proc, and to modify the action on select to use BS12's object edit command(s).
-
-/client/proc/SDQL_query(query_text as message)
- set category = "Admin"
- if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
- message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
- log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
-
- var/list/query_list = SDQL_tokenize(query_text)
-
- if(query_list.len < 2)
- if(query_list.len > 0)
- usr << "\red SDQL: Too few discrete tokens in query \"[query_text]\". Please check your syntax and try again."
- return
-
- if(!(lowertext(query_list[1]) in list("select", "delete", "update")))
- usr << "\red SDQL: Unknown query type: \"[query_list[1]]\" in query \"[query_text]\". Please check your syntax and try again."
- return
-
- var/list/types = list()
-
- var/i
- for(i = 2; i <= query_list.len; i += 2)
- types += query_list[i]
-
- if(i + 1 >= query_list.len || query_list[i + 1] != ",")
- break
-
- i++
-
- var/list/from = list()
-
- if(i <= query_list.len)
- if(lowertext(query_list[i]) in list("from", "in"))
- for(i++; i <= query_list.len; i += 2)
- from += query_list[i]
-
- if(i + 1 >= query_list.len || query_list[i + 1] != ",")
- break
-
- i++
-
- if(from.len < 1)
- from += "world"
-
- var/list/set_vars = list()
-
- if(lowertext(query_list[1]) == "update")
- if(i <= query_list.len && lowertext(query_list[i]) == "set")
- for(i++; i <= query_list.len; i++)
- if(i + 2 <= query_list.len && query_list[i + 1] == "=")
- set_vars += query_list[i]
- set_vars[query_list[i]] = query_list[i + 2]
-
- else
- usr << "\red SDQL: Invalid set parameter in query \"[query_text]\". Please check your syntax and try again."
- return
-
- i += 3
-
- if(i >= query_list.len || query_list[i] != ",")
- break
-
- if(set_vars.len < 1)
- usr << "\red SDQL: Invalid or missing set in query \"[query_text]\". Please check your syntax and try again."
- return
-
- var/list/where = list()
-
- if(i <= query_list.len && lowertext(query_list[i]) == "where")
- where = query_list.Copy(i + 1)
-
- var/list/from_objs = list()
- if("world" in from)
- from_objs += world
- else
- for(var/f in from)
- if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
- from_objs += locate(copytext(f, 2, length(f)))
- else if(copytext(f, 1, 2) != "/")
- from_objs += locate(f)
- else
- var/f2 = text2path(f)
- if(text_starts_with(f, "/mob"))
- for(var/mob/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/turf/space"))
- for(var/turf/space/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/turf/simulated"))
- for(var/turf/simulated/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/turf/unsimulated"))
- for(var/turf/unsimulated/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/turf"))
- for(var/turf/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/area"))
- for(var/area/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/obj/item"))
- for(var/obj/item/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/obj/machinery"))
- for(var/obj/machinery/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/obj"))
- for(var/obj/m in world)
- if(istype(m, f2))
- from_objs += m
-
- else if(text_starts_with(f, "/atom"))
- for(var/atom/m in world)
- if(istype(m, f2))
- from_objs += m
-/*
- else
- for(var/datum/m in world)
- if(istype(m, f2))
- from_objs += m
-*/
-
- var/list/objs = list()
-
- for(var/from_obj in from_objs)
- if("*" in types)
- objs += from_obj:contents
- else
- for(var/f in types)
- if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
- objs += locate(copytext(f, 2, length(f))) in from_obj
- else if(copytext(f, 1, 2) != "/")
- objs += locate(f) in from_obj
- else
- var/f2 = text2path(f)
- if(text_starts_with(f, "/mob"))
- for(var/mob/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/turf/space"))
- for(var/turf/space/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/turf/simulated"))
- for(var/turf/simulated/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/turf/unsimulated"))
- for(var/turf/unsimulated/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/turf"))
- for(var/turf/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/area"))
- for(var/area/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/obj/item"))
- for(var/obj/item/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/obj/machinery"))
- for(var/obj/machinery/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/obj"))
- for(var/obj/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else if(text_starts_with(f, "/atom"))
- for(var/atom/m in from_obj)
- if(istype(m, f2))
- objs += m
-
- else
- for(var/datum/m in from_obj)
- if(istype(m, f2))
- objs += m
-
-
- for(var/datum/t in objs)
- var/currently_false = 0
- for(i = 1, i - 1 < where.len, i++)
- var/v = where[i++]
- var/compare_op = where[i++]
- if(!(compare_op in list("==", "=", "<>", "<", ">", "<=", ">=", "!=")))
- usr << "\red SDQL: Unknown comparison operator [compare_op] in where clause following [v] in query \"[query_text]\". Please check your syntax and try again."
- return
-
- var/j
- for(j = i, j <= where.len, j++)
- if(lowertext(where[j]) in list("and", "or", ";"))
- break
-
- if(!currently_false)
- var/value = SDQL_text2value(t, v)
- var/result = SDQL_evaluate(t, where.Copy(i, j))
-
- switch(compare_op)
- if("=", "==")
- currently_false = !(value == result)
-
- if("!=", "<>")
- currently_false = !(value != result)
-
- if("<")
- currently_false = !(value < result)
-
- if(">")
- currently_false = !(value > result)
-
- if("<=")
- currently_false = !(value <= result)
-
- if(">=")
- currently_false = !(value >= result)
-
-
- if(j > where.len || lowertext(where[j]) == ";")
- break
- else if(lowertext(where[j]) == "or")
- if(currently_false)
- currently_false = 0
- else
- break
-
- i = j
-
- if(currently_false)
- objs -= t
-
-
-
- usr << "\blue SQDL Query: [query_text]"
- message_admins("[usr] executed SDQL query: \"[query_text]\".")
-/*
- for(var/t in types)
- usr << "Type: [t]"
-
- for(var/t in from)
- usr << "From: [t]"
-
- for(var/t in set_vars)
- usr << "Set: [t] = [set_vars[t]]"
-
- if(where.len)
- var/where_str = ""
- for(var/t in where)
- where_str += "[t] "
-
- usr << "Where: [where_str]"
-
- usr << "From objects:"
- for(var/datum/t in from_objs)
- usr << t
-
- usr << "Objects:"
- for(var/datum/t in objs)
- usr << t
-*/
- switch(lowertext(query_list[1]))
- if("delete")
- for(var/datum/t in objs)
- del t
-
- if("update")
- for(var/datum/t in objs)
- objs[t] = list()
- for(var/v in set_vars)
- if(v in t.vars)
- objs[t][v] = SDQL_text2value(t, set_vars[v])
-
- for(var/datum/t in objs)
- for(var/v in objs[t])
- t.vars[v] = objs[t][v]
-
- if("select")
- var/text = ""
- for(var/datum/t in objs)
- if(istype(t, /atom))
- var/atom/a = t
-
- if(a.x)
- text += "\ref[t]: [t] at ([a.x], [a.y], [a.z])
"
-
- else if(a.loc && a.loc.x)
- text += "\ref[t]: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])
"
-
- else
- text += "\ref[t]: [t]
"
-
- else
- text += "\ref[t]: [t]
"
-
- //text += "[t]
"
- usr << browse(text, "window=sdql_result")
-
-
-/client/Topic(href,href_list[],hsrc)
- if(href_list["SDQL_select"])
- debug_variables(locate(href_list["SDQL_select"]))
-
- ..()
-
-
-/proc/SDQL_evaluate(datum/object, list/equation)
- if(equation.len == 0)
- return null
-
- else if(equation.len == 1)
- return SDQL_text2value(object, equation[1])
-
- else if(equation[1] == "!")
- return !SDQL_evaluate(object, equation.Copy(2))
-
- else if(equation[1] == "-")
- return -SDQL_evaluate(object, equation.Copy(2))
-
-
- else
- usr << "\red SDQL: Sorry, equations not yet supported :("
- return null
-
-
-/proc/SDQL_text2value(datum/object, text)
- if(text2num(text) != null)
- return text2num(text)
- else if(text == "null")
- return null
- else if(copytext(text, 1, 2) == "'" || copytext(text, 1, 2) == "\"" )
- return copytext(text, 2, length(text))
- else if(copytext(text, 1, 2) == "/")
- return text2path(text)
- else
- if(findtext(text, "."))
- var/split = findtext(text, ".")
- var/v = copytext(text, 1, split)
-
- if((v in object.vars) && istype(object.vars[v], /datum))
- return SDQL_text2value(object.vars[v], copytext(text, split + 1))
- else
- return null
-
- else
- if(text in object.vars)
- return object.vars[text]
- else
- return null
-
-
-/proc/text_starts_with(text, start)
- if(copytext(text, 1, length(start) + 1) == start)
- return 1
- else
- return 0
-
-
-
-
-
-/proc/SDQL_tokenize(query_text)
-
- var/list/whitespace = list(" ", "\n", "\t")
- var/list/single = list("(", ")", ",", "+", "-")
- var/list/multi = list(
- "=" = list("", "="),
- "<" = list("", "=", ">"),
- ">" = list("", "="),
- "!" = list("", "="))
-
- var/word = ""
- var/list/query_list = list()
- var/len = length(query_text)
-
- for(var/i = 1, i <= len, i++)
- var/char = copytext(query_text, i, i + 1)
-
- if(char in whitespace)
- if(word != "")
- query_list += word
- word = ""
-
- else if(char in single)
- if(word != "")
- query_list += word
- word = ""
-
- query_list += char
-
- else if(char in multi)
- if(word != "")
- query_list += word
- word = ""
-
- var/char2 = copytext(query_text, i + 1, i + 2)
-
- if(char2 in multi[char])
- query_list += "[char][char2]"
- i++
-
- else
- query_list += char
-
- else if(char == "'")
- if(word != "")
- usr << "\red SDQL: You have an error in your SDQL syntax, unexpected ' in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
- return null
-
- word = "'"
-
- for(i++, i <= len, i++)
- char = copytext(query_text, i, i + 1)
-
- if(char == "'")
- if(copytext(query_text, i + 1, i + 2) == "'")
- word += "'"
- i++
-
- else
- break
-
- else
- word += char
-
- if(i > len)
- usr << "\red SDQL: You have an error in your SDQL syntax, unmatched ' in query: \"[query_text]\". Please check your syntax, and try again."
- return null
-
- query_list += "[word]'"
- word = ""
-
- else if(char == "\"")
- if(word != "")
- usr << "\red SDQL: You have an error in your SDQL syntax, unexpected \" in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
- return null
-
- word = "\""
-
- for(i++, i <= len, i++)
- char = copytext(query_text, i, i + 1)
-
- if(char == "\"")
- if(copytext(query_text, i + 1, i + 2) == "'")
- word += "\""
- i++
-
- else
- break
-
- else
- word += char
-
- if(i > len)
- usr << "\red SDQL: You have an error in your SDQL syntax, unmatched \" in query: \"[query_text]\". Please check your syntax, and try again."
- return null
-
- query_list += "[word]\""
- word = ""
-
- else
- word += char
-
- if(word != "")
- query_list += word
-
- return query_list
+
+//Structured Datum Query Language. Basically SQL meets BYOND objects.
+
+//Note: For use in BS12, need text_starts_with proc, and to modify the action on select to use BS12's object edit command(s).
+
+/client/proc/SDQL_query(query_text as message)
+ set category = "Admin"
+ if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
+ message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
+ log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
+
+ var/list/query_list = SDQL_tokenize(query_text)
+
+ if(query_list.len < 2)
+ if(query_list.len > 0)
+ usr << "\red SDQL: Too few discrete tokens in query \"[query_text]\". Please check your syntax and try again."
+ return
+
+ if(!(lowertext(query_list[1]) in list("select", "delete", "update")))
+ usr << "\red SDQL: Unknown query type: \"[query_list[1]]\" in query \"[query_text]\". Please check your syntax and try again."
+ return
+
+ var/list/types = list()
+
+ var/i
+ for(i = 2; i <= query_list.len; i += 2)
+ types += query_list[i]
+
+ if(i + 1 >= query_list.len || query_list[i + 1] != ",")
+ break
+
+ i++
+
+ var/list/from = list()
+
+ if(i <= query_list.len)
+ if(lowertext(query_list[i]) in list("from", "in"))
+ for(i++; i <= query_list.len; i += 2)
+ from += query_list[i]
+
+ if(i + 1 >= query_list.len || query_list[i + 1] != ",")
+ break
+
+ i++
+
+ if(from.len < 1)
+ from += "world"
+
+ var/list/set_vars = list()
+
+ if(lowertext(query_list[1]) == "update")
+ if(i <= query_list.len && lowertext(query_list[i]) == "set")
+ for(i++; i <= query_list.len; i++)
+ if(i + 2 <= query_list.len && query_list[i + 1] == "=")
+ set_vars += query_list[i]
+ set_vars[query_list[i]] = query_list[i + 2]
+
+ else
+ usr << "\red SDQL: Invalid set parameter in query \"[query_text]\". Please check your syntax and try again."
+ return
+
+ i += 3
+
+ if(i >= query_list.len || query_list[i] != ",")
+ break
+
+ if(set_vars.len < 1)
+ usr << "\red SDQL: Invalid or missing set in query \"[query_text]\". Please check your syntax and try again."
+ return
+
+ var/list/where = list()
+
+ if(i <= query_list.len && lowertext(query_list[i]) == "where")
+ where = query_list.Copy(i + 1)
+
+ var/list/from_objs = list()
+ if("world" in from)
+ from_objs += world
+ else
+ for(var/f in from)
+ if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
+ from_objs += locate(copytext(f, 2, length(f)))
+ else if(copytext(f, 1, 2) != "/")
+ from_objs += locate(f)
+ else
+ var/f2 = text2path(f)
+ if(text_starts_with(f, "/mob"))
+ for(var/mob/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/turf/space"))
+ for(var/turf/space/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/turf/simulated"))
+ for(var/turf/simulated/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/turf/unsimulated"))
+ for(var/turf/unsimulated/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/turf"))
+ for(var/turf/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/area"))
+ for(var/area/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/obj/item"))
+ for(var/obj/item/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/obj/machinery"))
+ for(var/obj/machinery/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/obj"))
+ for(var/obj/m in world)
+ if(istype(m, f2))
+ from_objs += m
+
+ else if(text_starts_with(f, "/atom"))
+ for(var/atom/m in world)
+ if(istype(m, f2))
+ from_objs += m
+/*
+ else
+ for(var/datum/m in world)
+ if(istype(m, f2))
+ from_objs += m
+*/
+
+ var/list/objs = list()
+
+ for(var/from_obj in from_objs)
+ if("*" in types)
+ objs += from_obj:contents
+ else
+ for(var/f in types)
+ if(copytext(f, 1, 2) == "'" || copytext(f, 1, 2) == "\"")
+ objs += locate(copytext(f, 2, length(f))) in from_obj
+ else if(copytext(f, 1, 2) != "/")
+ objs += locate(f) in from_obj
+ else
+ var/f2 = text2path(f)
+ if(text_starts_with(f, "/mob"))
+ for(var/mob/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/turf/space"))
+ for(var/turf/space/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/turf/simulated"))
+ for(var/turf/simulated/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/turf/unsimulated"))
+ for(var/turf/unsimulated/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/turf"))
+ for(var/turf/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/area"))
+ for(var/area/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/obj/item"))
+ for(var/obj/item/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/obj/machinery"))
+ for(var/obj/machinery/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/obj"))
+ for(var/obj/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else if(text_starts_with(f, "/atom"))
+ for(var/atom/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+ else
+ for(var/datum/m in from_obj)
+ if(istype(m, f2))
+ objs += m
+
+
+ for(var/datum/t in objs)
+ var/currently_false = 0
+ for(i = 1, i - 1 < where.len, i++)
+ var/v = where[i++]
+ var/compare_op = where[i++]
+ if(!(compare_op in list("==", "=", "<>", "<", ">", "<=", ">=", "!=")))
+ usr << "\red SDQL: Unknown comparison operator [compare_op] in where clause following [v] in query \"[query_text]\". Please check your syntax and try again."
+ return
+
+ var/j
+ for(j = i, j <= where.len, j++)
+ if(lowertext(where[j]) in list("and", "or", ";"))
+ break
+
+ if(!currently_false)
+ var/value = SDQL_text2value(t, v)
+ var/result = SDQL_evaluate(t, where.Copy(i, j))
+
+ switch(compare_op)
+ if("=", "==")
+ currently_false = !(value == result)
+
+ if("!=", "<>")
+ currently_false = !(value != result)
+
+ if("<")
+ currently_false = !(value < result)
+
+ if(">")
+ currently_false = !(value > result)
+
+ if("<=")
+ currently_false = !(value <= result)
+
+ if(">=")
+ currently_false = !(value >= result)
+
+
+ if(j > where.len || lowertext(where[j]) == ";")
+ break
+ else if(lowertext(where[j]) == "or")
+ if(currently_false)
+ currently_false = 0
+ else
+ break
+
+ i = j
+
+ if(currently_false)
+ objs -= t
+
+
+
+ usr << "\blue SQDL Query: [query_text]"
+ message_admins("[usr] executed SDQL query: \"[query_text]\".")
+/*
+ for(var/t in types)
+ usr << "Type: [t]"
+
+ for(var/t in from)
+ usr << "From: [t]"
+
+ for(var/t in set_vars)
+ usr << "Set: [t] = [set_vars[t]]"
+
+ if(where.len)
+ var/where_str = ""
+ for(var/t in where)
+ where_str += "[t] "
+
+ usr << "Where: [where_str]"
+
+ usr << "From objects:"
+ for(var/datum/t in from_objs)
+ usr << t
+
+ usr << "Objects:"
+ for(var/datum/t in objs)
+ usr << t
+*/
+ switch(lowertext(query_list[1]))
+ if("delete")
+ for(var/datum/t in objs)
+ qdel(t)
+
+ if("update")
+ for(var/datum/t in objs)
+ objs[t] = list()
+ for(var/v in set_vars)
+ if(v in t.vars)
+ objs[t][v] = SDQL_text2value(t, set_vars[v])
+
+ for(var/datum/t in objs)
+ for(var/v in objs[t])
+ t.vars[v] = objs[t][v]
+
+ if("select")
+ var/text = ""
+ for(var/datum/t in objs)
+ if(istype(t, /atom))
+ var/atom/a = t
+
+ if(a.x)
+ text += "\ref[t]: [t] at ([a.x], [a.y], [a.z])
"
+
+ else if(a.loc && a.loc.x)
+ text += "\ref[t]: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])
"
+
+ else
+ text += "\ref[t]: [t]
"
+
+ else
+ text += "\ref[t]: [t]
"
+
+ //text += "[t]
"
+ usr << browse(text, "window=sdql_result")
+
+
+/client/Topic(href,href_list[],hsrc)
+ if(href_list["SDQL_select"])
+ debug_variables(locate(href_list["SDQL_select"]))
+
+ ..()
+
+
+/proc/SDQL_evaluate(datum/object, list/equation)
+ if(equation.len == 0)
+ return null
+
+ else if(equation.len == 1)
+ return SDQL_text2value(object, equation[1])
+
+ else if(equation[1] == "!")
+ return !SDQL_evaluate(object, equation.Copy(2))
+
+ else if(equation[1] == "-")
+ return -SDQL_evaluate(object, equation.Copy(2))
+
+
+ else
+ usr << "\red SDQL: Sorry, equations not yet supported :("
+ return null
+
+
+/proc/SDQL_text2value(datum/object, text)
+ if(text2num(text) != null)
+ return text2num(text)
+ else if(text == "null")
+ return null
+ else if(copytext(text, 1, 2) == "'" || copytext(text, 1, 2) == "\"" )
+ return copytext(text, 2, length(text))
+ else if(copytext(text, 1, 2) == "/")
+ return text2path(text)
+ else
+ if(findtext(text, "."))
+ var/split = findtext(text, ".")
+ var/v = copytext(text, 1, split)
+
+ if((v in object.vars) && istype(object.vars[v], /datum))
+ return SDQL_text2value(object.vars[v], copytext(text, split + 1))
+ else
+ return null
+
+ else
+ if(text in object.vars)
+ return object.vars[text]
+ else
+ return null
+
+
+/proc/text_starts_with(text, start)
+ if(copytext(text, 1, length(start) + 1) == start)
+ return 1
+ else
+ return 0
+
+
+
+
+
+/proc/SDQL_tokenize(query_text)
+
+ var/list/whitespace = list(" ", "\n", "\t")
+ var/list/single = list("(", ")", ",", "+", "-")
+ var/list/multi = list(
+ "=" = list("", "="),
+ "<" = list("", "=", ">"),
+ ">" = list("", "="),
+ "!" = list("", "="))
+
+ var/word = ""
+ var/list/query_list = list()
+ var/len = length(query_text)
+
+ for(var/i = 1, i <= len, i++)
+ var/char = copytext(query_text, i, i + 1)
+
+ if(char in whitespace)
+ if(word != "")
+ query_list += word
+ word = ""
+
+ else if(char in single)
+ if(word != "")
+ query_list += word
+ word = ""
+
+ query_list += char
+
+ else if(char in multi)
+ if(word != "")
+ query_list += word
+ word = ""
+
+ var/char2 = copytext(query_text, i + 1, i + 2)
+
+ if(char2 in multi[char])
+ query_list += "[char][char2]"
+ i++
+
+ else
+ query_list += char
+
+ else if(char == "'")
+ if(word != "")
+ usr << "\red SDQL: You have an error in your SDQL syntax, unexpected ' in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
+ return null
+
+ word = "'"
+
+ for(i++, i <= len, i++)
+ char = copytext(query_text, i, i + 1)
+
+ if(char == "'")
+ if(copytext(query_text, i + 1, i + 2) == "'")
+ word += "'"
+ i++
+
+ else
+ break
+
+ else
+ word += char
+
+ if(i > len)
+ usr << "\red SDQL: You have an error in your SDQL syntax, unmatched ' in query: \"[query_text]\". Please check your syntax, and try again."
+ return null
+
+ query_list += "[word]'"
+ word = ""
+
+ else if(char == "\"")
+ if(word != "")
+ usr << "\red SDQL: You have an error in your SDQL syntax, unexpected \" in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
+ return null
+
+ word = "\""
+
+ for(i++, i <= len, i++)
+ char = copytext(query_text, i, i + 1)
+
+ if(char == "\"")
+ if(copytext(query_text, i + 1, i + 2) == "'")
+ word += "\""
+ i++
+
+ else
+ break
+
+ else
+ word += char
+
+ if(i > len)
+ usr << "\red SDQL: You have an error in your SDQL syntax, unmatched \" in query: \"[query_text]\". Please check your syntax, and try again."
+ return null
+
+ query_list += "[word]\""
+ word = ""
+
+ else
+ word += char
+
+ if(word != "")
+ query_list += word
+
+ return query_list
diff --git a/code/modules/admin/verbs/SDQL_2.dm b/code/modules/admin/verbs/SDQL_2.dm
index 549447da11..236237c23a 100644
--- a/code/modules/admin/verbs/SDQL_2.dm
+++ b/code/modules/admin/verbs/SDQL_2.dm
@@ -1,426 +1,426 @@
-
-
-/client/proc/SDQL2_query(query_text as message)
- set category = "Admin"
- if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
- message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
- log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
-
- if(!query_text || length(query_text) < 1)
- return
-
- //world << query_text
-
- var/list/query_list = SDQL2_tokenize(query_text)
-
- if(!query_list || query_list.len < 1)
- return
-
- var/list/query_tree = SDQL_parse(query_list)
-
- if(query_tree.len < 1)
- return
-
- var/list/from_objs = list()
- var/list/select_types = list()
-
- switch(query_tree[1])
- if("explain")
- SDQL_testout(query_tree["explain"])
- return
-
- if("call")
- if("on" in query_tree)
- select_types = query_tree["on"]
- else
- return
-
- if("select", "delete", "update")
- select_types = query_tree[query_tree[1]]
-
- from_objs = SDQL_from_objs(query_tree["from"])
-
- var/list/objs = list()
-
- for(var/type in select_types)
- var/char = copytext(type, 1, 2)
-
- if(char == "/" || char == "*")
- for(var/from in from_objs)
- objs += SDQL_get_all(type, from)
-
- else if(char == "'" || char == "\"")
- objs += locate(copytext(type, 2, length(type)))
-
- if("where" in query_tree)
- var/objs_temp = objs
- objs = list()
- for(var/datum/d in objs_temp)
- if(SDQL_expression(d, query_tree["where"]))
- objs += d
-
- //usr << "Query: [query_text]"
- message_admins("[usr] executed SDQL query: \"[query_text]\".")
-
- switch(query_tree[1])
- if("delete")
- for(var/datum/d in objs)
- del d
-
- if("select")
- var/text = ""
- for(var/datum/t in objs)
- if(istype(t, /atom))
- var/atom/a = t
-
- if(a.x)
- text += "\ref[t]: [t] at ([a.x], [a.y], [a.z])
"
-
- else if(a.loc && a.loc.x)
- text += "\ref[t]: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])
"
-
- else
- text += "\ref[t]: [t]
"
-
- else
- text += "\ref[t]: [t]
"
-
- usr << browse(text, "window=SDQL-result")
-
- if("update")
- if("set" in query_tree)
- var/list/set_list = query_tree["set"]
- for(var/datum/d in objs)
- var/list/vals = list()
- for(var/v in set_list)
- if(v in d.vars)
- vals += v
- vals[v] = SDQL_expression(d, set_list[v])
-
- if(istype(d, /turf))
- for(var/v in vals)
- if(v == "x" || v == "y" || v == "z")
- continue
-
- d.vars[v] = vals[v]
-
- else
- for(var/v in vals)
- d.vars[v] = vals[v]
-
-
-
-
-
-/proc/SDQL_parse(list/query_list)
- var/datum/SDQL_parser/parser = new(query_list)
- var/list/query_tree = parser.parse()
-
- del(parser)
-
- return query_tree
-
-
-
-/proc/SDQL_testout(list/query_tree, indent = 0)
- var/spaces = ""
- for(var/s = 0, s < indent, s++)
- spaces += " "
-
- for(var/item in query_tree)
- if(istype(item, /list))
- world << "[spaces]("
- SDQL_testout(item, indent + 1)
- world << "[spaces])"
-
- else
- world << "[spaces][item]"
-
- if(!isnum(item) && query_tree[item])
-
- if(istype(query_tree[item], /list))
- world << "[spaces] ("
- SDQL_testout(query_tree[item], indent + 2)
- world << "[spaces] )"
-
- else
- world << "[spaces] [query_tree[item]]"
-
-
-
-/proc/SDQL_from_objs(list/tree)
- if("world" in tree)
- return list(world)
-
- var/list/out = list()
-
- for(var/type in tree)
- var/char = copytext(type, 1, 2)
-
- if(char == "/")
- out += SDQL_get_all(type, world)
-
- else if(char == "'" || char == "\"")
- out += locate(copytext(type, 2, length(type)))
-
- return out
-
-
-/proc/SDQL_get_all(type, location)
- var/list/out = list()
-
- if(type == "*")
- for(var/datum/d in location)
- out += d
-
- return out
-
- type = text2path(type)
-
- if(ispath(type, /mob))
- for(var/mob/d in location)
- if(istype(d, type))
- out += d
-
- else if(ispath(type, /turf))
- for(var/turf/d in location)
- if(istype(d, type))
- out += d
-
- else if(ispath(type, /obj))
- for(var/obj/d in location)
- if(istype(d, type))
- out += d
-
- else if(ispath(type, /area))
- for(var/area/d in location)
- if(istype(d, type))
- out += d
-
- else if(ispath(type, /atom))
- for(var/atom/d in location)
- if(istype(d, type))
- out += d
-
- else
- for(var/datum/d in location)
- if(istype(d, type))
- out += d
-
- return out
-
-
-/proc/SDQL_expression(datum/object, list/expression, start = 1)
- var/result = 0
- var/val
-
- for(var/i = start, i <= expression.len, i++)
- var/op = ""
-
- if(i > start)
- op = expression[i]
- i++
-
- var/list/ret = SDQL_value(object, expression, i)
- val = ret["val"]
- i = ret["i"]
-
- if(op != "")
- switch(op)
- if("+")
- result += val
- if("-")
- result -= val
- if("*")
- result *= val
- if("/")
- result /= val
- if("&")
- result &= val
- if("|")
- result |= val
- if("^")
- result ^= val
- if("=", "==")
- result = (result == val)
- if("!=", "<>")
- result = (result != val)
- if("<")
- result = (result < val)
- if("<=")
- result = (result <= val)
- if(">")
- result = (result > val)
- if(">=")
- result = (result >= val)
- if("and", "&&")
- result = (result && val)
- if("or", "||")
- result = (result || val)
- else
- usr << "\red SDQL2: Unknown op [op]"
- result = null
- else
- result = val
-
- return result
-
-/proc/SDQL_value(datum/object, list/expression, start = 1)
- var/i = start
- var/val = null
-
- if(i > expression.len)
- return list("val" = null, "i" = i)
-
- if(istype(expression[i], /list))
- val = SDQL_expression(object, expression[i])
-
- else if(expression[i] == "!")
- var/list/ret = SDQL_value(object, expression, i + 1)
- val = !ret["val"]
- i = ret["i"]
-
- else if(expression[i] == "~")
- var/list/ret = SDQL_value(object, expression, i + 1)
- val = ~ret["val"]
- i = ret["i"]
-
- else if(expression[i] == "-")
- var/list/ret = SDQL_value(object, expression, i + 1)
- val = -ret["val"]
- i = ret["i"]
-
- else if(expression[i] == "null")
- val = null
-
- else if(isnum(expression[i]))
- val = expression[i]
-
- else if(copytext(expression[i], 1, 2) in list("'", "\""))
- val = copytext(expression[i], 2, length(expression[i]))
-
- else
- val = SDQL_var(object, expression, i)
- i = expression.len
-
- return list("val" = val, "i" = i)
-
-/proc/SDQL_var(datum/object, list/expression, start = 1)
-
- if(expression[start] in object.vars)
-
- if(start < expression.len && expression[start + 1] == ".")
- return SDQL_var(object.vars[expression[start]], expression[start + 2])
-
- else
- return object.vars[expression[start]]
-
- else
- return null
-
-/proc/SDQL2_tokenize(query_text)
-
- var/list/whitespace = list(" ", "\n", "\t")
- var/list/single = list("(", ")", ",", "+", "-", ".")
- var/list/multi = list(
- "=" = list("", "="),
- "<" = list("", "=", ">"),
- ">" = list("", "="),
- "!" = list("", "="))
-
- var/word = ""
- var/list/query_list = list()
- var/len = length(query_text)
-
- for(var/i = 1, i <= len, i++)
- var/char = copytext(query_text, i, i + 1)
-
- if(char in whitespace)
- if(word != "")
- query_list += word
- word = ""
-
- else if(char in single)
- if(word != "")
- query_list += word
- word = ""
-
- query_list += char
-
- else if(char in multi)
- if(word != "")
- query_list += word
- word = ""
-
- var/char2 = copytext(query_text, i + 1, i + 2)
-
- if(char2 in multi[char])
- query_list += "[char][char2]"
- i++
-
- else
- query_list += char
-
- else if(char == "'")
- if(word != "")
- usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected ' in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
- return null
-
- word = "'"
-
- for(i++, i <= len, i++)
- char = copytext(query_text, i, i + 1)
-
- if(char == "'")
- if(copytext(query_text, i + 1, i + 2) == "'")
- word += "'"
- i++
-
- else
- break
-
- else
- word += char
-
- if(i > len)
- usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched ' in query: \"[query_text]\". Please check your syntax, and try again."
- return null
-
- query_list += "[word]'"
- word = ""
-
- else if(char == "\"")
- if(word != "")
- usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected \" in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
- return null
-
- word = "\""
-
- for(i++, i <= len, i++)
- char = copytext(query_text, i, i + 1)
-
- if(char == "\"")
- if(copytext(query_text, i + 1, i + 2) == "'")
- word += "\""
- i++
-
- else
- break
-
- else
- word += char
-
- if(i > len)
- usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched \" in query: \"[query_text]\". Please check your syntax, and try again."
- return null
-
- query_list += "[word]\""
- word = ""
-
- else
- word += char
-
- if(word != "")
- query_list += word
-
- return query_list
+
+
+/client/proc/SDQL2_query(query_text as message)
+ set category = "Admin"
+ if(!check_rights(R_DEBUG)) //Shouldn't happen... but just to be safe.
+ message_admins("\red ERROR: Non-admin [usr.key] attempted to execute a SDQL query!")
+ log_admin("Non-admin [usr.key] attempted to execute a SDQL query!")
+
+ if(!query_text || length(query_text) < 1)
+ return
+
+ //world << query_text
+
+ var/list/query_list = SDQL2_tokenize(query_text)
+
+ if(!query_list || query_list.len < 1)
+ return
+
+ var/list/query_tree = SDQL_parse(query_list)
+
+ if(query_tree.len < 1)
+ return
+
+ var/list/from_objs = list()
+ var/list/select_types = list()
+
+ switch(query_tree[1])
+ if("explain")
+ SDQL_testout(query_tree["explain"])
+ return
+
+ if("call")
+ if("on" in query_tree)
+ select_types = query_tree["on"]
+ else
+ return
+
+ if("select", "delete", "update")
+ select_types = query_tree[query_tree[1]]
+
+ from_objs = SDQL_from_objs(query_tree["from"])
+
+ var/list/objs = list()
+
+ for(var/type in select_types)
+ var/char = copytext(type, 1, 2)
+
+ if(char == "/" || char == "*")
+ for(var/from in from_objs)
+ objs += SDQL_get_all(type, from)
+
+ else if(char == "'" || char == "\"")
+ objs += locate(copytext(type, 2, length(type)))
+
+ if("where" in query_tree)
+ var/objs_temp = objs
+ objs = list()
+ for(var/datum/d in objs_temp)
+ if(SDQL_expression(d, query_tree["where"]))
+ objs += d
+
+ //usr << "Query: [query_text]"
+ message_admins("[usr] executed SDQL query: \"[query_text]\".")
+
+ switch(query_tree[1])
+ if("delete")
+ for(var/datum/d in objs)
+ qdel(d)
+
+ if("select")
+ var/text = ""
+ for(var/datum/t in objs)
+ if(istype(t, /atom))
+ var/atom/a = t
+
+ if(a.x)
+ text += "\ref[t]: [t] at ([a.x], [a.y], [a.z])
"
+
+ else if(a.loc && a.loc.x)
+ text += "\ref[t]: [t] in [a.loc] at ([a.loc.x], [a.loc.y], [a.loc.z])
"
+
+ else
+ text += "\ref[t]: [t]
"
+
+ else
+ text += "\ref[t]: [t]
"
+
+ usr << browse(text, "window=SDQL-result")
+
+ if("update")
+ if("set" in query_tree)
+ var/list/set_list = query_tree["set"]
+ for(var/datum/d in objs)
+ var/list/vals = list()
+ for(var/v in set_list)
+ if(v in d.vars)
+ vals += v
+ vals[v] = SDQL_expression(d, set_list[v])
+
+ if(istype(d, /turf))
+ for(var/v in vals)
+ if(v == "x" || v == "y" || v == "z")
+ continue
+
+ d.vars[v] = vals[v]
+
+ else
+ for(var/v in vals)
+ d.vars[v] = vals[v]
+
+
+
+
+
+/proc/SDQL_parse(list/query_list)
+ var/datum/SDQL_parser/parser = new(query_list)
+ var/list/query_tree = parser.parse()
+
+ qdel(parser)
+
+ return query_tree
+
+
+
+/proc/SDQL_testout(list/query_tree, indent = 0)
+ var/spaces = ""
+ for(var/s = 0, s < indent, s++)
+ spaces += " "
+
+ for(var/item in query_tree)
+ if(istype(item, /list))
+ world << "[spaces]("
+ SDQL_testout(item, indent + 1)
+ world << "[spaces])"
+
+ else
+ world << "[spaces][item]"
+
+ if(!isnum(item) && query_tree[item])
+
+ if(istype(query_tree[item], /list))
+ world << "[spaces] ("
+ SDQL_testout(query_tree[item], indent + 2)
+ world << "[spaces] )"
+
+ else
+ world << "[spaces] [query_tree[item]]"
+
+
+
+/proc/SDQL_from_objs(list/tree)
+ if("world" in tree)
+ return list(world)
+
+ var/list/out = list()
+
+ for(var/type in tree)
+ var/char = copytext(type, 1, 2)
+
+ if(char == "/")
+ out += SDQL_get_all(type, world)
+
+ else if(char == "'" || char == "\"")
+ out += locate(copytext(type, 2, length(type)))
+
+ return out
+
+
+/proc/SDQL_get_all(type, location)
+ var/list/out = list()
+
+ if(type == "*")
+ for(var/datum/d in location)
+ out += d
+
+ return out
+
+ type = text2path(type)
+
+ if(ispath(type, /mob))
+ for(var/mob/d in location)
+ if(istype(d, type))
+ out += d
+
+ else if(ispath(type, /turf))
+ for(var/turf/d in location)
+ if(istype(d, type))
+ out += d
+
+ else if(ispath(type, /obj))
+ for(var/obj/d in location)
+ if(istype(d, type))
+ out += d
+
+ else if(ispath(type, /area))
+ for(var/area/d in location)
+ if(istype(d, type))
+ out += d
+
+ else if(ispath(type, /atom))
+ for(var/atom/d in location)
+ if(istype(d, type))
+ out += d
+
+ else
+ for(var/datum/d in location)
+ if(istype(d, type))
+ out += d
+
+ return out
+
+
+/proc/SDQL_expression(datum/object, list/expression, start = 1)
+ var/result = 0
+ var/val
+
+ for(var/i = start, i <= expression.len, i++)
+ var/op = ""
+
+ if(i > start)
+ op = expression[i]
+ i++
+
+ var/list/ret = SDQL_value(object, expression, i)
+ val = ret["val"]
+ i = ret["i"]
+
+ if(op != "")
+ switch(op)
+ if("+")
+ result += val
+ if("-")
+ result -= val
+ if("*")
+ result *= val
+ if("/")
+ result /= val
+ if("&")
+ result &= val
+ if("|")
+ result |= val
+ if("^")
+ result ^= val
+ if("=", "==")
+ result = (result == val)
+ if("!=", "<>")
+ result = (result != val)
+ if("<")
+ result = (result < val)
+ if("<=")
+ result = (result <= val)
+ if(">")
+ result = (result > val)
+ if(">=")
+ result = (result >= val)
+ if("and", "&&")
+ result = (result && val)
+ if("or", "||")
+ result = (result || val)
+ else
+ usr << "\red SDQL2: Unknown op [op]"
+ result = null
+ else
+ result = val
+
+ return result
+
+/proc/SDQL_value(datum/object, list/expression, start = 1)
+ var/i = start
+ var/val = null
+
+ if(i > expression.len)
+ return list("val" = null, "i" = i)
+
+ if(istype(expression[i], /list))
+ val = SDQL_expression(object, expression[i])
+
+ else if(expression[i] == "!")
+ var/list/ret = SDQL_value(object, expression, i + 1)
+ val = !ret["val"]
+ i = ret["i"]
+
+ else if(expression[i] == "~")
+ var/list/ret = SDQL_value(object, expression, i + 1)
+ val = ~ret["val"]
+ i = ret["i"]
+
+ else if(expression[i] == "-")
+ var/list/ret = SDQL_value(object, expression, i + 1)
+ val = -ret["val"]
+ i = ret["i"]
+
+ else if(expression[i] == "null")
+ val = null
+
+ else if(isnum(expression[i]))
+ val = expression[i]
+
+ else if(copytext(expression[i], 1, 2) in list("'", "\""))
+ val = copytext(expression[i], 2, length(expression[i]))
+
+ else
+ val = SDQL_var(object, expression, i)
+ i = expression.len
+
+ return list("val" = val, "i" = i)
+
+/proc/SDQL_var(datum/object, list/expression, start = 1)
+
+ if(expression[start] in object.vars)
+
+ if(start < expression.len && expression[start + 1] == ".")
+ return SDQL_var(object.vars[expression[start]], expression[start + 2])
+
+ else
+ return object.vars[expression[start]]
+
+ else
+ return null
+
+/proc/SDQL2_tokenize(query_text)
+
+ var/list/whitespace = list(" ", "\n", "\t")
+ var/list/single = list("(", ")", ",", "+", "-", ".")
+ var/list/multi = list(
+ "=" = list("", "="),
+ "<" = list("", "=", ">"),
+ ">" = list("", "="),
+ "!" = list("", "="))
+
+ var/word = ""
+ var/list/query_list = list()
+ var/len = length(query_text)
+
+ for(var/i = 1, i <= len, i++)
+ var/char = copytext(query_text, i, i + 1)
+
+ if(char in whitespace)
+ if(word != "")
+ query_list += word
+ word = ""
+
+ else if(char in single)
+ if(word != "")
+ query_list += word
+ word = ""
+
+ query_list += char
+
+ else if(char in multi)
+ if(word != "")
+ query_list += word
+ word = ""
+
+ var/char2 = copytext(query_text, i + 1, i + 2)
+
+ if(char2 in multi[char])
+ query_list += "[char][char2]"
+ i++
+
+ else
+ query_list += char
+
+ else if(char == "'")
+ if(word != "")
+ usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected ' in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
+ return null
+
+ word = "'"
+
+ for(i++, i <= len, i++)
+ char = copytext(query_text, i, i + 1)
+
+ if(char == "'")
+ if(copytext(query_text, i + 1, i + 2) == "'")
+ word += "'"
+ i++
+
+ else
+ break
+
+ else
+ word += char
+
+ if(i > len)
+ usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched ' in query: \"[query_text]\". Please check your syntax, and try again."
+ return null
+
+ query_list += "[word]'"
+ word = ""
+
+ else if(char == "\"")
+ if(word != "")
+ usr << "\red SDQL2: You have an error in your SDQL syntax, unexpected \" in query: \"[query_text]\" following \"[word]\". Please check your syntax, and try again."
+ return null
+
+ word = "\""
+
+ for(i++, i <= len, i++)
+ char = copytext(query_text, i, i + 1)
+
+ if(char == "\"")
+ if(copytext(query_text, i + 1, i + 2) == "'")
+ word += "\""
+ i++
+
+ else
+ break
+
+ else
+ word += char
+
+ if(i > len)
+ usr << "\red SDQL2: You have an error in your SDQL syntax, unmatched \" in query: \"[query_text]\". Please check your syntax, and try again."
+ return null
+
+ query_list += "[word]\""
+ word = ""
+
+ else
+ word += char
+
+ if(word != "")
+ query_list += word
+
+ return query_list
diff --git a/code/modules/admin/verbs/antag-ooc.dm b/code/modules/admin/verbs/antag-ooc.dm
index 53a2c709fc..9260baf3dd 100644
--- a/code/modules/admin/verbs/antag-ooc.dm
+++ b/code/modules/admin/verbs/antag-ooc.dm
@@ -13,7 +13,7 @@
display_name = holder.fakekey
for(var/mob/M in mob_list)
- if((M.mind && M.mind.special_role && M.client) || (M.client && M.client.holder))
+ if((M.mind && M.mind.special_role && M.client) || check_rights(R_ADMIN, 0, M))
M << "" + create_text_tag("aooc", "Antag-OOC:", M.client) + " [display_name]: [msg]"
log_ooc("(ANTAG) [key] : [msg]")
\ No newline at end of file
diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm
index 71bdabf4be..4b90283a56 100644
--- a/code/modules/admin/verbs/buildmode.dm
+++ b/code/modules/admin/verbs/buildmode.dm
@@ -8,7 +8,7 @@
M.client.show_popup_menus = 1
for(var/obj/effect/bmode/buildholder/H)
if(H.cl == M.client)
- del(H)
+ qdel(H)
else
log_admin("[key_name(usr)] has entered build mode.")
M.client.buildmode = 1
@@ -220,7 +220,7 @@
T.ChangeTurf(/turf/simulated/wall)
return
else if(istype(object,/obj))
- del(object)
+ qdel(object)
return
else if(istype(object,/turf) && pa.Find("alt") && pa.Find("left"))
new/obj/machinery/door/airlock(get_turf(object))
@@ -250,7 +250,7 @@
var/obj/A = new holder.buildmode.objholder (get_turf(object))
A.set_dir(holder.builddir.dir)
else if(pa.Find("right"))
- if(isobj(object)) del(object)
+ if(isobj(object)) qdel(object)
if(pa.Find("middle"))
holder.buildmode.objholder = text2path("[object.type]")
if(holder.buildmode.objsay) usr << "[object.type]"
diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm
index e21de8641d..a643b370fc 100644
--- a/code/modules/admin/verbs/cinematic.dm
+++ b/code/modules/admin/verbs/cinematic.dm
@@ -1,12 +1,17 @@
/client/proc/cinematic(var/cinematic as anything in list("explosion",null))
- set name = "cinematic"
+ set name = "Cinematic"
set category = "Fun"
set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted.
- set hidden = 1
+
+ if(!check_rights(R_FUN))
+ return
+
if(alert("Are you sure you want to run [cinematic]?","Confirmation","Yes","No")=="No") return
if(!ticker) return
switch(cinematic)
if("explosion")
+ if(alert("The game will be over. Are you really sure?", "Confirmation" ,"Continue", "Cancel") == "Cancel")
+ return
var/parameter = input(src,"station_missed = ?","Enter Parameter",0) as num
var/override
switch(parameter)
@@ -15,4 +20,8 @@
if(0)
override = input(src,"mode = ?","Enter Parameter",null) as anything in list("blob","mercenary","AI malfunction","no override")
ticker.station_explosion_cinematic(parameter,override)
+
+ log_admin("[key_name(src)] launched cinematic \"[cinematic]\"")
+ message_admins("[key_name_admin(src)] launched cinematic \"[cinematic]\"", 1)
+
return
\ No newline at end of file
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 43e2211aba..1012883781 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -350,7 +350,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(hsbitem)
for(var/atom/O in world)
if(istype(O, hsbitem))
- del(O)
+ qdel(O)
log_admin("[key_name(src)] has deleted all instances of [hsbitem].")
message_admins("[key_name_admin(src)] has deleted all instances of [hsbitem].", 0)
feedback_add_details("admin_verb","DELA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -420,7 +420,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/mob/adminmob = src.mob
M.ckey = src.ckey
if( isobserver(adminmob) )
- del(adminmob)
+ qdel(adminmob)
feedback_add_details("admin_verb","ADC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -525,6 +525,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
//log_admin("[key_name(src)] has alienized [M.key].")
var/list/dresspacks = list(
"strip",
+ "job",
"standard space gear",
"tournament standard red",
"tournament standard green",
@@ -555,10 +556,25 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for (var/obj/item/I in M)
if (istype(I, /obj/item/weapon/implant))
continue
- del(I)
+ M.drop_from_inventory(I)
+ if(I.loc != M)
+ qdel(I)
switch(dresscode)
if ("strip")
//do nothing
+ if ("job")
+ var/selected_job = input("Select job", "Robust quick dress shop") as null|anything in joblist
+ if (isnull(selected_job))
+ return
+
+ var/datum/job/job = job_master.GetJob(selected_job)
+ if(!job)
+ return
+
+ job.equip(M)
+ job.apply_fingerprints(M)
+ job_master.spawnId(M, selected_job)
+
if ("standard space gear")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
@@ -614,7 +630,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
var/obj/item/weapon/storage/backpack/backpack = new(M)
for(var/obj/item/I in backpack)
- del(I)
+ qdel(I)
M.equip_to_slot_or_del(backpack, slot_back)
M.equip_to_slot_or_del(new /obj/item/weapon/mop(M), slot_r_hand)
@@ -705,7 +721,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
var/obj/item/weapon/storage/secure/briefcase/sec_briefcase = new(M)
for(var/obj/item/briefcase_item in sec_briefcase)
- del(briefcase_item)
+ qdel(briefcase_item)
for(var/i=3, i>0, i--)
sec_briefcase.contents += new /obj/item/weapon/spacecash/c1000
sec_briefcase.contents += new /obj/item/weapon/gun/energy/crossbow
@@ -927,9 +943,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
spawn(30)
for(var/obj/machinery/the_singularitygen/G in world)
if(G.anchored)
- var/obj/machinery/singularity/S = new /obj/machinery/singularity(get_turf(G), 50)
+ var/obj/singularity/S = new /obj/singularity(get_turf(G), 50)
spawn(0)
- del(G)
+ qdel(G)
S.energy = 1750
S.current_size = 7
S.icon = 'icons/effects/224x224.dmi'
diff --git a/code/modules/admin/verbs/dice.dm b/code/modules/admin/verbs/dice.dm
new file mode 100644
index 0000000000..e5877a9da2
--- /dev/null
+++ b/code/modules/admin/verbs/dice.dm
@@ -0,0 +1,24 @@
+/client/proc/roll_dices()
+ set category = "Fun"
+ set name = "Roll Dice"
+ if(!check_rights(R_FUN))
+ return
+
+ var/sum = input("How many times should we throw?") as num
+ var/side = input("Select the number of sides.") as num
+ if(!side)
+ side = 6
+ if(!sum)
+ sum = 2
+
+ var/dice = num2text(sum) + "d" + num2text(side)
+
+ if(alert("Do you want to inform the world about your game?",,"Yes", "No") == "Yes")
+ world << "The dice have been rolled by Gods!
"
+
+ var/result = roll(dice)
+
+ if(alert("Do you want to inform the world about the result?",,"Yes", "No") == "Yes")
+ world << "Gods rolled [dice], result is [result]
"
+
+ message_admins("[key_name_admin(src)] rolled dice [dice], result is [result]", 1)
\ No newline at end of file
diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm
index c6f91e89d3..bd3c4be0d9 100644
--- a/code/modules/admin/verbs/mapping.dm
+++ b/code/modules/admin/verbs/mapping.dm
@@ -55,7 +55,7 @@ var/intercom_range_display_status = 0
for(var/obj/effect/debugging/camera_range/C in world)
- del(C)
+ qdel(C)
if(camera_range_display_status)
for(var/obj/machinery/camera/C in cameranet.cameras)
@@ -114,14 +114,14 @@ var/intercom_range_display_status = 0
intercom_range_display_status = 1
for(var/obj/effect/debugging/marker/M in world)
- del(M)
+ qdel(M)
if(intercom_range_display_status)
for(var/obj/item/device/radio/intercom/I in world)
for(var/turf/T in orange(7,I))
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
if (!(F in view(7,I.loc)))
- del(F)
+ qdel(F)
feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
var/list/debug_verbs = list (
@@ -276,7 +276,7 @@ var/list/debug_verbs = list (
var/datum/controller/air_system/old_air = air_master
for(var/zone/zone in old_air.zones)
zone.c_invalidate()
- del old_air
+ qdel(old_air)
air_master = new
air_master.Setup()
spawn air_master.Start()
diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm
index a6b4bf7d16..87827dcf4b 100644
--- a/code/modules/admin/verbs/massmodvar.dm
+++ b/code/modules/admin/verbs/massmodvar.dm
@@ -208,8 +208,8 @@
O.vars[variable]) as num|null
if(new_value == null) return
- if(variable=="luminosity")
- O.SetLuminosity(new_value)
+ if(variable=="light_range")
+ O.set_light(new_value)
else
O.vars[variable] = new_value
@@ -217,24 +217,24 @@
if(istype(O, /mob))
for(var/mob/M in mob_list)
if ( istype(M , O.type) )
- if(variable=="luminosity")
- M.SetLuminosity(new_value)
+ if(variable=="light_range")
+ M.set_light(new_value)
else
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
if ( istype(A , O.type) )
- if(variable=="luminosity")
- A.SetLuminosity(new_value)
+ if(variable=="light_range")
+ A.set_light(new_value)
else
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
if ( istype(A , O.type) )
- if(variable=="luminosity")
- A.SetLuminosity(new_value)
+ if(variable=="light_range")
+ A.set_light(new_value)
else
A.vars[variable] = O.vars[variable]
@@ -242,24 +242,24 @@
if(istype(O, /mob))
for(var/mob/M in mob_list)
if (M.type == O.type)
- if(variable=="luminosity")
- M.SetLuminosity(new_value)
+ if(variable=="light_range")
+ M.set_light(new_value)
else
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
if (A.type == O.type)
- if(variable=="luminosity")
- A.SetLuminosity(new_value)
+ if(variable=="light_range")
+ A.set_light(new_value)
else
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
if (A.type == O.type)
- if(variable=="luminosity")
- A.SetLuminosity(new_value)
+ if(variable=="light_range")
+ A.set_light(new_value)
else
A.vars[variable] = O.vars[variable]
@@ -372,4 +372,4 @@
A.vars[variable] = O.vars[variable]
log_admin("[key_name(src)] mass modified [original_name]'s [variable] to [O.vars[variable]]")
- message_admins("[key_name_admin(src)] mass modified [original_name]'s [variable] to [O.vars[variable]]", 1)
\ No newline at end of file
+ message_admins("[key_name_admin(src)] mass modified [original_name]'s [variable] to [O.vars[variable]]", 1)
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index fce2aa59dc..bdff5fb73a 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -455,10 +455,10 @@ var/list/forbidden_varedit_object_types = list(
O.vars[variable] = var_new
if("num")
- if(variable=="luminosity")
+ if(variable=="light_range")
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
if(var_new == null) return
- O.SetLuminosity(var_new)
+ O.set_light(var_new)
else if(variable=="stat")
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
if(var_new == null) return
diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm
index de69f149d7..6de30853ce 100644
--- a/code/modules/admin/verbs/possess.dm
+++ b/code/modules/admin/verbs/possess.dm
@@ -2,7 +2,7 @@
set name = "Possess Obj"
set category = "Object"
- if(istype(O,/obj/machinery/singularity))
+ if(istype(O,/obj/singularity))
if(config.forbid_singulo_possession)
usr << "It is forbidden to possess singularities."
return
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index ad4f7eda04..fd55a5a1e9 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -686,7 +686,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=[mins]&server=[replacetext(config.server_name, "#", "")]")
del(M.client)
- del(M)
+ qdel(M)
else
if("No")
@@ -701,7 +701,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
world.Export("http://216.38.134.132/adminlog.php?type=ban&key=[usr.client.key]&key2=[M.key]&msg=[html_decode(reason)]&time=perma&server=[replacetext(config.server_name, "#", "")]")
del(M.client)
- del(M)
+ qdel(M)
*/
/client/proc/update_world()
diff --git a/code/modules/alarm/alarm.dm b/code/modules/alarm/alarm.dm
index 525a5b3d21..aa88e170bf 100644
--- a/code/modules/alarm/alarm.dm
+++ b/code/modules/alarm/alarm.dm
@@ -18,6 +18,7 @@
var/list/sources = new() //List of sources triggering the alarm. Used to determine when the alarm should be cleared.
var/list/sources_assoc = new() //Associative list of source triggers. Used to efficiently acquire the alarm source.
var/list/cameras //List of cameras that can be switched to, if the player has that capability.
+ var/cache_id //ID for camera cache, changed by invalidateCameraCache().
var/area/last_area //The last acquired area, used should origin be lost (for example a destroyed borg containing an alarming camera).
var/area/last_name //The last acquired name, used should origin be lost
var/area/last_camera_area //The last area in which cameras where fetched, used to see if the camera list should be updated.
@@ -74,8 +75,12 @@
return last_name
/datum/alarm/proc/cameras()
+ // reset camera cache
+ if(camera_cache_id != cache_id)
+ cameras = null
+ cache_id = camera_cache_id
// If the alarm origin has changed area, for example a borg containing an alarming camera, reset the list of cameras
- if(cameras && (last_camera_area != alarm_area()))
+ else if(cameras && (last_camera_area != alarm_area()))
cameras = null
// The list of cameras is also reset by /proc/invalidateCameraCache()
@@ -96,18 +101,17 @@
* Assisting procs *
******************/
/atom/proc/get_alarm_area()
- var/area/A = get_area(src)
- return A.master
+ return get_area(src)
/area/get_alarm_area()
- return src.master
+ return src
/atom/proc/get_alarm_name()
var/area/A = get_area(src)
- return A.master.name
+ return A.name
/area/get_alarm_name()
- return master.name
+ return name
/mob/get_alarm_name()
return name
diff --git a/code/modules/alarm/alarm_handler.dm b/code/modules/alarm/alarm_handler.dm
index 2be4060de2..47b7f7b571 100644
--- a/code/modules/alarm/alarm_handler.dm
+++ b/code/modules/alarm/alarm_handler.dm
@@ -84,8 +84,7 @@
return src
/turf/get_alarm_origin()
- var/area/area = get_area(src)
- return area.master // Very important to get area.master, as dynamic lightning can and will split areas.
+ return get_area(src)
/datum/alarm_handler/proc/register(var/object, var/procName)
listeners[object] = procName
diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm
index ca4717307a..e73856b85f 100644
--- a/code/modules/assembly/assembly.dm
+++ b/code/modules/assembly/assembly.dm
@@ -5,7 +5,7 @@
icon_state = ""
flags = CONDUCT
w_class = 2.0
- matter = list("metal" = 100)
+ matter = list(DEFAULT_WALL_MATERIAL = 100)
throwforce = 2
throw_speed = 3
throw_range = 10
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index ed3edf5fc0..ba071d7c72 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -39,7 +39,7 @@
bombtank.master = null
bombtank = null
- del(src)
+ qdel(src)
return
if((istype(W, /obj/item/weapon/weldingtool) && W:welding))
if(!status)
@@ -144,8 +144,8 @@
ground_zero.hotspot_expose(1000, 125)
if(master)
- del(master)
- del(src)
+ qdel(master)
+ qdel(src)
/obj/item/weapon/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out.
var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles)
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index f3bf44b53b..a8a3d246c8 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -190,7 +190,7 @@
a_right:holder = null
a_right.loc = T
spawn(0)
- del(src)
+ qdel(src)
return
diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm
index ece2f08219..d44f45fa97 100644
--- a/code/modules/assembly/igniter.dm
+++ b/code/modules/assembly/igniter.dm
@@ -2,7 +2,7 @@
name = "igniter"
desc = "A small electronic device able to ignite combustable substances."
icon_state = "igniter"
- matter = list("metal" = 500, "glass" = 50, "waste" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 50, "waste" = 10)
origin_tech = "magnets=1"
secured = 1
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index 79e3cf8637..d163a9d29f 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -4,7 +4,7 @@
name = "infrared emitter"
desc = "Emits a visible or invisible beam and is triggered when the beam is interrupted."
icon_state = "infrared"
- matter = list("metal" = 1000, "glass" = 500, "waste" = 100)
+ matter = list(DEFAULT_WALL_MATERIAL = 1000, "glass" = 500, "waste" = 100)
origin_tech = "magnets=2"
wires = WIRE_PULSE
@@ -32,7 +32,7 @@
processing_objects.Add(src)
else
on = 0
- if(first) del(first)
+ if(first) qdel(first)
processing_objects.Remove(src)
update_icon()
return secured
@@ -53,7 +53,7 @@
process()//Old code
if(!on)
if(first)
- del(first)
+ qdel(first)
return
if((!(first) && (secured && (istype(loc, /turf) || (holder && istype(holder.loc, /turf))))))
@@ -77,7 +77,7 @@
attack_hand()
- del(first)
+ qdel(first)
..()
return
@@ -86,14 +86,14 @@
var/t = dir
..()
set_dir(t)
- del(first)
+ qdel(first)
return
holder_movement()
if(!holder) return 0
// set_dir(holder.dir)
- del(first)
+ qdel(first)
return 1
@@ -175,7 +175,7 @@
if(master)
//world << "beam hit \ref[src]: calling master \ref[master].hit"
master.trigger_beam()
- del(src)
+ qdel(src)
return
/obj/effect/beam/i_beam/proc/vis_spread(v)
@@ -193,7 +193,7 @@
if((loc.density || !(master)))
// world << "beam hit loc [loc] or no master [master], deleting"
- del(src)
+ qdel(src)
return
//world << "proccess: [src.left] left"
@@ -233,17 +233,17 @@
return
else
//world << "is a next: \ref[next], deleting beam \ref[I]"
- del(I)
+ qdel(I)
else
//world << "step failed, deleting \ref[next]"
- del(next)
+ qdel(next)
spawn(10)
process()
return
return
/obj/effect/beam/i_beam/Bump()
- del(src)
+ qdel(src)
return
/obj/effect/beam/i_beam/Bumped()
@@ -258,7 +258,10 @@
return
return
-/obj/effect/beam/i_beam/Del()
- del(next)
+/obj/effect/beam/i_beam/Destroy()
+ if(master.first == src)
+ master.first = null
+ if(next)
+ qdel(next)
+ next = null
..()
- return
diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm
index 676ee17cd1..a2cbe632c7 100644
--- a/code/modules/assembly/mousetrap.dm
+++ b/code/modules/assembly/mousetrap.dm
@@ -2,7 +2,7 @@
name = "mousetrap"
desc = "A handy little spring-loaded trap for catching pesty rodents."
icon_state = "mousetrap"
- matter = list("metal" = 100, "waste" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 100, "waste" = 10)
origin_tech = "combat=1"
var/armed = 0
diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm
index 06923f8458..39bf3f2fcc 100644
--- a/code/modules/assembly/proximity.dm
+++ b/code/modules/assembly/proximity.dm
@@ -2,7 +2,7 @@
name = "proximity sensor"
desc = "Used for scanning and alerting when someone enters a certain proximity."
icon_state = "prox"
- matter = list("metal" = 800, "glass" = 200, "waste" = 50)
+ matter = list(DEFAULT_WALL_MATERIAL = 800, "glass" = 200, "waste" = 50)
origin_tech = "magnets=1"
wires = WIRE_PULSE
diff --git a/code/modules/assembly/shock_kit.dm b/code/modules/assembly/shock_kit.dm
index 5e501e3313..8ba62cdc37 100644
--- a/code/modules/assembly/shock_kit.dm
+++ b/code/modules/assembly/shock_kit.dm
@@ -8,9 +8,9 @@
w_class = 5.0
flags = CONDUCT
-/obj/item/assembly/shock_kit/Del()
- del(part1)
- del(part2)
+/obj/item/assembly/shock_kit/Destroy()
+ qdel(part1)
+ qdel(part2)
..()
return
@@ -25,7 +25,7 @@
part2.master = null
part1 = null
part2 = null
- del(src)
+ qdel(src)
return
if(istype(W, /obj/item/weapon/screwdriver))
status = !status
diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm
index ba70b45da4..4d93ad26ee 100644
--- a/code/modules/assembly/signaler.dm
+++ b/code/modules/assembly/signaler.dm
@@ -3,7 +3,7 @@
desc = "Used to remotely activate devices."
icon_state = "signaller"
item_state = "signaler"
- matter = list("metal" = 1000, "glass" = 200, "waste" = 100)
+ matter = list(DEFAULT_WALL_MATERIAL = 1000, "glass" = 200, "waste" = 100)
origin_tech = "magnets=1"
wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE
@@ -141,6 +141,8 @@
proc/set_frequency(new_frequency)
+ if(!frequency)
+ return
if(!radio_controller)
sleep(20)
if(!radio_controller)
@@ -171,3 +173,9 @@
processing_objects.Add(src)
log_and_message_admins("is threatening to trigger a signaler deadman's switch")
usr.visible_message("\red [usr] moves their finger over [src]'s signal button...")
+
+/obj/item/device/assembly/signaler/Destroy()
+ if(radio_controller)
+ radio_controller.remove_object(src,frequency)
+ frequency = 0
+ ..()
diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm
index 326d36195f..d4fb73a764 100644
--- a/code/modules/assembly/timer.dm
+++ b/code/modules/assembly/timer.dm
@@ -2,7 +2,7 @@
name = "timer"
desc = "Used to time things. Works well with contraptions which has to count down. Tick tock."
icon_state = "timer"
- matter = list("metal" = 500, "glass" = 50, "waste" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 50, "waste" = 10)
origin_tech = "magnets=1"
wires = WIRE_PULSE
diff --git a/code/modules/assembly/voice.dm b/code/modules/assembly/voice.dm
index b9c3eb88de..ca33f9d106 100644
--- a/code/modules/assembly/voice.dm
+++ b/code/modules/assembly/voice.dm
@@ -2,7 +2,7 @@
name = "voice analyzer"
desc = "A small electronic device able to record a voice sample, and send a signal when that sample is repeated."
icon_state = "voice"
- matter = list("metal" = 500, "glass" = 50, "waste" = 10)
+ matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 50, "waste" = 10)
origin_tech = "magnets=1"
var/listening = 0
var/recorded //the activation message
diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm
index 11f78326c6..b6415f22b5 100644
--- a/code/modules/awaymissions/corpse.dm
+++ b/code/modules/awaymissions/corpse.dm
@@ -77,7 +77,7 @@
W.assignment = corpseidjob
W.registered_name = M.real_name
M.equip_to_slot_or_del(W, slot_wear_id)
- del(src)
+ qdel(src)
diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm
index 706e1716af..5aeb9651d2 100644
--- a/code/modules/awaymissions/loot.dm
+++ b/code/modules/awaymissions/loot.dm
@@ -21,4 +21,4 @@
continue
new loot_path(get_turf(src))
- del(src)
\ No newline at end of file
+ qdel(src)
diff --git a/code/modules/awaymissions/trigger.dm b/code/modules/awaymissions/trigger.dm
index 65ad8f543d..4afaf4a135 100644
--- a/code/modules/awaymissions/trigger.dm
+++ b/code/modules/awaymissions/trigger.dm
@@ -6,7 +6,7 @@
if(M.client)
M << "[message]"
if(once)
- del(src)
+ qdel(src)
/obj/effect/step_trigger/teleport_fancy
var/locationx
@@ -41,4 +41,4 @@
uses--
if(uses == 0)
- del(src)
\ No newline at end of file
+ qdel(src)
\ No newline at end of file
diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm
index 20ee74177e..b02875304e 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -33,7 +33,7 @@
if( findtext(href,"