diff --git a/baystation12.dme b/baystation12.dme index 2deef09a8bb..a7176e3b98a 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -577,6 +577,7 @@ #include "code\game\objects\items\weapons\surgery_tools.dm" #include "code\game\objects\items\weapons\swords_axes_etc.dm" #include "code\game\objects\items\weapons\table_rack_parts.dm" +#include "code\game\objects\items\weapons\tape.dm" #include "code\game\objects\items\weapons\teleportation.dm" #include "code\game\objects\items\weapons\tools.dm" #include "code\game\objects\items\weapons\twohanded.dm" @@ -1016,6 +1017,7 @@ #include "code\modules\mob\living\carbon\human\logout.dm" #include "code\modules\mob\living\carbon\human\say.dm" #include "code\modules\mob\living\carbon\human\species.dm" +#include "code\modules\mob\living\carbon\human\unarmed_attack.dm" #include "code\modules\mob\living\carbon\human\update_icons.dm" #include "code\modules\mob\living\carbon\human\whisper.dm" #include "code\modules\mob\living\carbon\human\alien\alien.dm" diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index 649972297a3..aed8b2dc07e 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -1,5 +1,5 @@ obj/machinery/atmospherics/binary - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|NORTH use_power = 1 diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index 0ac8ab62997..cb9ecfbdc58 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -111,7 +111,7 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." @@ -123,5 +123,5 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, -90) + src.set_dir(turn(src.dir, -90)) desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]." \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm index 7f0984efd7e..6923b6d31eb 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm @@ -129,7 +129,7 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, -90) + src.set_dir(turn(src.dir, -90)) verb/rotate_anticlockwise() @@ -140,7 +140,7 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) //Goddamn copypaste from binary base class because atmospherics machinery API is not damn flexible network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) @@ -276,7 +276,7 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, -90) + src.set_dir(turn(src.dir, -90)) verb/rotate_anticlock() set category = "Object" @@ -286,4 +286,4 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, 90) \ No newline at end of file + src.set_dir(turn(src.dir, 90)) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index 4bfd61a0a2a..488c1eeb915 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -5,7 +5,7 @@ name = "Connector Port" desc = "For connecting portables devices related to atmospherics control." - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH var/obj/machinery/portable_atmospherics/connected_device diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 5649b25e012..4f5205687ed 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -248,7 +248,7 @@ /obj/machinery/atmospherics/trinary/filter/m_filter icon_state = "mmap" - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|NORTH|EAST obj/machinery/atmospherics/trinary/filter/m_filter/New() diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 051a2ced27f..9432518b539 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -181,7 +181,7 @@ obj/machinery/atmospherics/trinary/mixer/t_mixer icon_state = "tmap" - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|EAST|WEST //node 3 is the outlet, nodes 1 & 2 are intakes @@ -227,7 +227,7 @@ obj/machinery/atmospherics/trinary/mixer/t_mixer/initialize() obj/machinery/atmospherics/trinary/mixer/m_mixer icon_state = "mmap" - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|NORTH|EAST //node 3 is the outlet, nodes 1 & 2 are intakes diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 822c9a4d6dc..ce3aafc9536 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -1,5 +1,5 @@ obj/machinery/atmospherics/trinary - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|NORTH|WEST use_power = 1 diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index 39ca1e25fd8..4d931bd3249 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -6,7 +6,7 @@ desc = "A pipe valve" level = 1 - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|NORTH|WEST var/state = 0 // 0 = go straight, 1 = go to side diff --git a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm index 14bbb46bbaa..c3ccdbc574b 100644 --- a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm +++ b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm @@ -6,7 +6,7 @@ obj/machinery/atmospherics/unary/oxygen_generator name = "Oxygen Generator" desc = "" - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH var/on = 0 diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index 8af26e51eb3..8d850cc74fa 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -1,5 +1,5 @@ /obj/machinery/atmospherics/unary - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH //layer = TURF_LAYER+0.1 diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index bce38d06545..4633c06511f 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -6,7 +6,7 @@ desc = "A pipe valve" level = 1 - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|NORTH var/open = 0 @@ -123,9 +123,9 @@ /obj/machinery/atmospherics/valve/proc/normalize_dir() if(dir==3) - dir = 1 + set_dir(1) else if(dir==12) - dir = 4 + set_dir(4) /obj/machinery/atmospherics/valve/attack_ai(mob/user as mob) return diff --git a/code/ATMOSPHERICS/mainspipe.dm b/code/ATMOSPHERICS/mainspipe.dm index 631f3530a24..ce23f7bfba3 100644 --- a/code/ATMOSPHERICS/mainspipe.dm +++ b/code/ATMOSPHERICS/mainspipe.dm @@ -115,7 +115,7 @@ obj/machinery/atmospherics/mains_pipe/simple name = "mains pipe" desc = "A one meter section of 3-line mains pipe" - dir = SOUTH + set_dir(SOUTH) initialize_mains_directions = SOUTH|NORTH New() @@ -137,9 +137,9 @@ obj/machinery/atmospherics/mains_pipe/simple proc/normalize_dir() if(dir==3) - dir = 1 + set_dir(1) else if(dir==12) - dir = 4 + set_dir(4) update_icon() if(nodes[1] && nodes[2]) @@ -148,7 +148,7 @@ obj/machinery/atmospherics/mains_pipe/simple //var/node1_direction = get_dir(src, node1) //var/node2_direction = get_dir(src, node2) - //dir = node1_direction|node2_direction + //set_dir(node1_direction|node2_direction) else if(!nodes[1]&&!nodes[2]) @@ -196,7 +196,7 @@ obj/machinery/atmospherics/mains_pipe/manifold name = "manifold pipe" desc = "A manifold composed of mains pipes" - dir = SOUTH + set_dir(SOUTH) initialize_mains_directions = EAST|NORTH|WEST volume = 105 @@ -261,7 +261,7 @@ obj/machinery/atmospherics/mains_pipe/manifold4w name = "manifold pipe" desc = "A manifold composed of mains pipes" - dir = SOUTH + set_dir(SOUTH) initialize_mains_directions = EAST|NORTH|WEST|SOUTH volume = 105 @@ -504,7 +504,7 @@ obj/machinery/atmospherics/mains_pipe/cap name = "pipe cap" desc = "A cap for the end of a mains pipe" - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH volume = 35 @@ -546,7 +546,7 @@ obj/machinery/atmospherics/mains_pipe/valve var/open = 1 - dir = SOUTH + set_dir(SOUTH) initialize_mains_directions = SOUTH|NORTH New() @@ -597,9 +597,9 @@ obj/machinery/atmospherics/mains_pipe/valve proc/normalize_dir() if(dir==3) - dir = 1 + set_dir(1) else if(dir==12) - dir = 4 + set_dir(4) proc/open() if(open) return 0 diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index 53910f2fe3d..037d39218ae 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -143,7 +143,7 @@ volume = ATMOS_DEFAULT_VOLUME_PIPE - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH|NORTH var/obj/machinery/atmospherics/node1 @@ -216,9 +216,9 @@ /obj/machinery/atmospherics/pipe/simple/proc/normalize_dir() if(dir==3) - dir = 1 + set_dir(1) else if(dir==12) - dir = 4 + set_dir(4) /obj/machinery/atmospherics/pipe/simple/Del() if(node1) @@ -406,7 +406,7 @@ volume = ATMOS_DEFAULT_VOLUME_PIPE * 1.5 - dir = SOUTH + set_dir(SOUTH) initialize_directions = EAST|NORTH|WEST var/obj/machinery/atmospherics/node1 @@ -658,7 +658,7 @@ volume = ATMOS_DEFAULT_VOLUME_PIPE * 2 - dir = SOUTH + set_dir(SOUTH) initialize_directions = NORTH|SOUTH|EAST|WEST var/obj/machinery/atmospherics/node1 @@ -918,7 +918,7 @@ volume = 35 - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH var/obj/machinery/atmospherics/node @@ -1042,7 +1042,7 @@ var/start_pressure = 25*ONE_ATMOSPHERE level = 1 - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH density = 1 @@ -1220,7 +1220,7 @@ volume = 250 - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH var/build_killswitch = 1 @@ -1259,7 +1259,7 @@ if(node1) icon_state = "intact" - dir = get_dir(src, node1) + set_dir(get_dir(src, node1)) else icon_state = "exposed" @@ -1291,7 +1291,7 @@ /obj/machinery/atmospherics/pipe/vent/hide(var/i) //to make the little pipe section invisible, the icon changes. if(node1) icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact" - dir = get_dir(src, node1) + set_dir(get_dir(src, node1)) else icon_state = "exposed" diff --git a/code/FEA/FEA_fire.dm b/code/FEA/FEA_fire.dm index bb71f31d47f..b7a8d42fa5e 100644 --- a/code/FEA/FEA_fire.dm +++ b/code/FEA/FEA_fire.dm @@ -167,7 +167,7 @@ /obj/effect/hotspot/New() ..() - dir = pick(cardinal) + set_dir(pick(cardinal)) return /* diff --git a/code/TriDimension/Pipes.dm b/code/TriDimension/Pipes.dm index 4132ddfe947..4f38444e988 100644 --- a/code/TriDimension/Pipes.dm +++ b/code/TriDimension/Pipes.dm @@ -10,7 +10,7 @@ obj/machinery/atmospherics/pipe/zpipe volume = 70 - dir = SOUTH + set_dir(SOUTH) initialize_directions = SOUTH var/obj/machinery/atmospherics/node1 //connection on the same Z @@ -84,9 +84,9 @@ obj/machinery/atmospherics/pipe/zpipe/proc/burst() obj/machinery/atmospherics/pipe/zpipe/proc/normalize_dir() if(dir==3) - dir = 1 + set_dir(1) else if(dir==12) - dir = 4 + set_dir(4) obj/machinery/atmospherics/pipe/zpipe/Del() if(node1) diff --git a/code/TriDimension/Structures.dm b/code/TriDimension/Structures.dm index fa91ccd5bb6..554853535a7 100644 --- a/code/TriDimension/Structures.dm +++ b/code/TriDimension/Structures.dm @@ -256,8 +256,8 @@ initialise_stair_connection(S, src, inv_dir) proc/initialise_stair_connection(var/obj/multiz/stairs/top, var/obj/multiz/stairs/bottom, var/dir) - top.dir = dir - bottom.dir = dir + top.set_dir(dir) + bottom.set_dir(dir) top.connected = bottom bottom.connected = top top.icon_state = "ramptop" diff --git a/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm b/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm index 95f7c265565..7e350dc3a06 100644 --- a/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm +++ b/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm @@ -368,7 +368,7 @@ var/predir = M.dir step(M, throw_dir) - M.dir = predir + M.set_dir(predir) //gives turf a different description, to try and trick players /obj/effect/step_trigger/trap/fake diff --git a/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm b/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm index ffc1265b7dd..7ae07059f7d 100644 --- a/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm +++ b/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm @@ -62,7 +62,7 @@ continue moving var/turf/X = new T.type(B) - X.dir = old_dir1 + X.set_dir(old_dir1) X.icon_state = old_icon_state1 X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm index b012d1c360e..0c12ed23a01 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm @@ -39,7 +39,7 @@ // offset 24 pixels in direction of dir // this allows the APC to be embedded in a wall, yet still inside an area if (building) - dir = ndir + set_dir(ndir) else has_electronics = 3 opened = 0 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm index fab9eb87d5c..3d2e32f971e 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm @@ -39,7 +39,7 @@ // offset 24 pixels in direction of dir // this allows the APC to be embedded in a wall, yet still inside an area if (building) - dir = ndir + set_dir(ndir) else has_electronics = 3 opened = 0 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm index e3441dafd86..ad7ea622e25 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm @@ -294,7 +294,7 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) /obj/machinery/power/rust_fuel_injector/verb/rotate_anticlock() set category = "Object" @@ -304,4 +304,4 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, -90) \ No newline at end of file + src.set_dir(turn(src.dir, -90)) \ No newline at end of file diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm index f375716b21e..0fff75bb508 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm @@ -95,7 +95,7 @@ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() - A.dir = src.dir + A.set_dir(src.dir) if(src.dir == 1)//Up A.yo = 20 A.xo = 0 @@ -125,7 +125,7 @@ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start()*/ - A.dir = src.dir + A.set_dir(src.dir) if(src.dir == 1)//Up A.yo = 20 A.xo = 0 diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm b/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm index 155ef23c5c6..b94127ffa2b 100644 --- a/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm +++ b/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm @@ -26,7 +26,7 @@ if(!dir) RadiateParticleRand(energy, ionizing) var/obj/effect/accelerated_particle/particle = new - particle.dir = dir + particle.set_dir(dir) particle.ionizing = ionizing if(energy) particle.energy = energy diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm index 38032c459ca..3782e76209c 100644 --- a/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm +++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm @@ -22,7 +22,7 @@ if(!first) src.first = new /obj/beam/e_beam(src.loc) src.first.master = src - src.first.dir = src.dir + src.first.set_dir(src.dir) src.first.power = src.power src.first.freq = src.freq src.first.phase = src.phase @@ -61,7 +61,7 @@ if(!next) if(get_step(src.loc,src.dir)) var/obj/beam/e_beam/e = new /obj/beam/e_beam(src.loc) - e.dir = src.dir + e.set_dir(src.dir) src.next = e e.master = src.master e.power = src.power diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm index 04c07733df2..66ccf181bd8 100644 --- a/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm +++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm @@ -34,7 +34,7 @@ if (src.anchored || usr:stat) usr << "It is fastened to the floor!" return 0 - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) return 1 /obj/machinery/zero_point_emitter/New() @@ -98,7 +98,7 @@ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() - A.dir = src.dir + A.set_dir(src.dir) switch(dir) if(NORTH) A.yo = 20 diff --git a/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm b/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm index 85bcc084b7a..9ebc5fa5dec 100644 --- a/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm +++ b/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm @@ -13,7 +13,7 @@ /obj/item/projectile/missile/process(var/turf/newtarget) target = newtarget - dir = get_dir(src.loc, target) + set_dir(get_dir(src.loc, target)) walk_towards(src, target, MISSILE_SPEED) /obj/item/projectile/missile/Bump(atom/A) @@ -164,7 +164,7 @@ /obj/machinery/meteor_battery/proc/target() while(src && enabled && !stat) - src.dir = get_dir(src, cur_target) + src.set_dir(get_dir(src, cur_target)) shootAt(cur_target) sleep(shot_delay) return diff --git a/code/WorkInProgress/Cael_Aislinn/sculpture.dm b/code/WorkInProgress/Cael_Aislinn/sculpture.dm index 639c2c84877..808e968f55e 100644 --- a/code/WorkInProgress/Cael_Aislinn/sculpture.dm +++ b/code/WorkInProgress/Cael_Aislinn/sculpture.dm @@ -56,7 +56,7 @@ continue turfs += thisturf var/turf/target_turf = pick(turfs) - src.dir = get_dir(src, target_turf) + src.set_dir(get_dir(src, target_turf)) src.loc = target_turf hibernate = 1 @@ -193,7 +193,7 @@ if(!next_turf.CanPass(src, next_turf)) break src.loc = next_turf - src.dir = get_dir(src, target_mob) + src.set_dir(get_dir(src, target_mob)) next_turf = get_step(src, get_dir(next_turf,target_mob)) num_turfs-- @@ -233,7 +233,7 @@ if(!next_turf.CanPass(src, next_turf)) break src.loc = next_turf - src.dir = get_dir(src, target_mob) + src.set_dir(get_dir(src, target_mob)) next_turf = get_step(src, get_dir(next_turf,target_turf)) num_turfs-- else if(G) diff --git a/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm b/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm index b26e7216389..44a7dcb84f9 100644 --- a/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm +++ b/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm @@ -89,7 +89,7 @@ anchored = 1 New(var/turf/nloc, var/ndir, var/temp) - dir = ndir + set_dir(ndir) ..(nloc) if(nloc) diff --git a/code/WorkInProgress/Cib/amorph/amorph_hud.dm b/code/WorkInProgress/Cib/amorph/amorph_hud.dm index c9a4ef0cc9c..41a3adc9f58 100644 --- a/code/WorkInProgress/Cib/amorph/amorph_hud.dm +++ b/code/WorkInProgress/Cib/amorph/amorph_hud.dm @@ -46,7 +46,7 @@ using = new /obj/screen( src ) using.name = "act_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = ui_style using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent) using.screen_loc = ui_acti @@ -105,7 +105,7 @@ using = new /obj/screen( src ) using.name = "mov_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi @@ -123,7 +123,7 @@ using = new /obj/screen( src ) using.name = "r_hand" - using.dir = WEST + using.set_dir(WEST) using.icon = ui_style using.icon_state = "hand_inactive" if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use @@ -135,7 +135,7 @@ using = new /obj/screen( src ) using.name = "l_hand" - using.dir = EAST + using.set_dir(EAST) using.icon = ui_style using.icon_state = "hand_inactive" if(mymob && mymob.hand) //This being 1 means the left hand is in use @@ -147,7 +147,7 @@ using = new /obj/screen( src ) using.name = "hand" - using.dir = SOUTH + using.set_dir(SOUTH) using.icon = ui_style using.icon_state = "hand1" using.screen_loc = ui_swaphand1 @@ -156,7 +156,7 @@ using = new /obj/screen( src ) using.name = "hand" - using.dir = SOUTH + using.set_dir(SOUTH) using.icon = ui_style using.icon_state = "hand2" using.screen_loc = ui_swaphand2 @@ -165,7 +165,7 @@ using = new /obj/screen( src ) using.name = "mask" - using.dir = NORTH + using.set_dir(NORTH) using.icon = ui_style using.icon_state = "equip" using.screen_loc = ui_monkey_mask @@ -174,7 +174,7 @@ using = new /obj/screen( src ) using.name = "back" - using.dir = NORTHEAST + using.set_dir(NORTHEAST) using.icon = ui_style using.icon_state = "equip" using.screen_loc = ui_back @@ -291,19 +291,19 @@ mymob.gun_setting_icon = new /obj/screen/gun/mode(null) if (mymob.client) if (mymob.client.gun_mode) // If in aim mode, correct the sprite - mymob.gun_setting_icon.dir = 2 + mymob.gun_setting_icon.set_dir(2) for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons if (G.target) mymob.item_use_icon = new /obj/screen/gun/item(null) if (mymob.client.target_can_click) - mymob.item_use_icon.dir = 1 + mymob.item_use_icon.set_dir(1) src.adding += mymob.item_use_icon mymob.gun_move_icon = new /obj/screen/gun/move(null) if (mymob.client.target_can_move) - mymob.gun_move_icon.dir = 1 + mymob.gun_move_icon.set_dir(1) mymob.gun_run_icon = new /obj/screen/gun/run(null) if (mymob.client.target_can_run) - mymob.gun_run_icon.dir = 1 + mymob.gun_run_icon.set_dir(1) src.adding += mymob.gun_run_icon src.adding += mymob.gun_move_icon diff --git a/code/WorkInProgress/Tastyfish/livestock.dm b/code/WorkInProgress/Tastyfish/livestock.dm index f17265ba046..0befcb4c61b 100644 --- a/code/WorkInProgress/Tastyfish/livestock.dm +++ b/code/WorkInProgress/Tastyfish/livestock.dm @@ -63,15 +63,15 @@ if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds if (movement_target.loc.x < src.x) - dir = WEST + set_dir(WEST) else if (movement_target.loc.x > src.x) - dir = EAST + set_dir(EAST) else if (movement_target.loc.y < src.y) - dir = SOUTH + set_dir(SOUTH) else if (movement_target.loc.y > src.y) - dir = NORTH + set_dir(NORTH) else - dir = SOUTH + set_dir(SOUTH) if(isturf(movement_target.loc)) movement_target.attack_animal(src) diff --git a/code/WorkInProgress/Tastyfish/wallmount_frame.dm b/code/WorkInProgress/Tastyfish/wallmount_frame.dm index 16bdb12d6c6..28b6101a751 100644 --- a/code/WorkInProgress/Tastyfish/wallmount_frame.dm +++ b/code/WorkInProgress/Tastyfish/wallmount_frame.dm @@ -25,7 +25,7 @@ del(src) return - dir = get_dir(T, loc) + set_dir(get_dir(T, loc)) /obj/machinery/constructable_frame/wallmount_frame/attackby(obj/item/P as obj, mob/user as mob) if(P.crit_fail) @@ -109,7 +109,7 @@ if(component_check) playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) var/obj/machinery/new_machine = new src.circuit.build_path(src.loc) - new_machine.dir = dir + new_machine.set_dir(dir) if(istype(circuit, /obj/item/weapon/circuitboard/status_display)) new_machine.pixel_x = pixel_x * 1.33 new_machine.pixel_y = pixel_y * 1.33 diff --git a/code/WorkInProgress/buildmode.dm b/code/WorkInProgress/buildmode.dm index d93d45fec5c..acd442355a0 100644 --- a/code/WorkInProgress/buildmode.dm +++ b/code/WorkInProgress/buildmode.dm @@ -48,15 +48,15 @@ Click() switch(dir) if(NORTH) - dir = EAST + set_dir(EAST) if(EAST) - dir = SOUTH + set_dir(SOUTH) if(SOUTH) - dir = WEST + set_dir(WEST) if(WEST) - dir = NORTHWEST + set_dir(NORTHWEST) if(NORTHWEST) - dir = NORTH + set_dir(NORTH) return 1 /obj/effect/bmode/buildhelp @@ -219,19 +219,19 @@ switch(holder.builddir.dir) if(NORTH) var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object)) - WIN.dir = NORTH + WIN.set_dir(NORTH) if(SOUTH) var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object)) - WIN.dir = SOUTH + WIN.set_dir(SOUTH) if(EAST) var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object)) - WIN.dir = EAST + WIN.set_dir(EAST) if(WEST) var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object)) - WIN.dir = WEST + WIN.set_dir(WEST) if(NORTHWEST) var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object)) - WIN.dir = NORTHWEST + WIN.set_dir(NORTHWEST) if(2) if(pa.Find("left")) if(ispath(holder.buildmode.objholder,/turf)) @@ -239,7 +239,7 @@ T.ChangeTurf(holder.buildmode.objholder) else var/obj/A = new holder.buildmode.objholder (get_turf(object)) - A.dir = holder.builddir.dir + A.set_dir(holder.builddir.dir) else if(pa.Find("right")) if(isobj(object)) del(object) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 24aa1d2a514..babce841261 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -161,7 +161,7 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh) if(!istype(loc, /turf)) del src - dir = pick(cardinal) + set_dir(pick(cardinal)) SetLuminosity(3) firelevel = fl air_master.active_hotspots.Add(src) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 4a213027771..d78f3e7a9d0 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -623,7 +623,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl //The variables should be apparent enough. var/atom/movable/overlay/animation = new(location) if(direction) - animation.dir = direction + animation.set_dir(direction) animation.icon = a_icon animation.layer = target:layer+1 if(a_icon_state) @@ -854,7 +854,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl var/old_icon1 = T.icon var/turf/X = B.ChangeTurf(T.type) - X.dir = old_dir1 + X.set_dir(old_dir1) X.icon_state = old_icon_state1 X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi @@ -1027,7 +1027,7 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) continue moving var/turf/X = new T.type(B) - X.dir = old_dir1 + X.set_dir(old_dir1) X.icon_state = old_icon_state1 X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index eadc657a9ce..5ab826fa867 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -350,7 +350,5 @@ else if(dx > 0) direction = EAST else direction = WEST - dir = direction - if(buckled && buckled.movable) - buckled.dir = direction - buckled.handle_rotation() \ No newline at end of file + if(direction != dir) + facedir(direction) diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 5037353ff1a..6c5da7817ad 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -7,7 +7,7 @@ using = new /obj/screen() using.name = "mov_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = 'icons/mob/screen1_alien.dmi' using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_acti diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 8b3fe141340..33a14d2e4d2 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -34,7 +34,7 @@ inv_box.icon_state = slot_data["state"] if(slot_data["dir"]) - inv_box.dir = slot_data["dir"] + inv_box.set_dir(slot_data["dir"]) if(slot_data["toggle"]) src.other += inv_box @@ -58,7 +58,7 @@ using = new /obj/screen() using.name = "act_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = ui_style using.icon_state = "intent_"+mymob.a_intent using.screen_loc = ui_acti @@ -125,7 +125,7 @@ if(hud_data.has_m_intent) using = new /obj/screen() using.name = "mov_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi @@ -160,7 +160,7 @@ inv_box = new /obj/screen/inventory() inv_box.name = "r_hand" - inv_box.dir = WEST + inv_box.set_dir(WEST) inv_box.icon = ui_style inv_box.icon_state = "hand_inactive" if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use @@ -176,7 +176,7 @@ inv_box = new /obj/screen/inventory() inv_box.name = "l_hand" - inv_box.dir = EAST + inv_box.set_dir(EAST) inv_box.icon = ui_style inv_box.icon_state = "hand_inactive" if(mymob && mymob.hand) //This being 1 means the left hand is in use @@ -191,7 +191,7 @@ using = new /obj/screen/inventory() using.name = "hand" - using.dir = SOUTH + using.set_dir(SOUTH) using.icon = ui_style using.icon_state = "hand1" using.screen_loc = ui_swaphand1 @@ -202,7 +202,7 @@ using = new /obj/screen/inventory() using.name = "hand" - using.dir = SOUTH + using.set_dir(SOUTH) using.icon = ui_style using.icon_state = "hand2" using.screen_loc = ui_swaphand2 @@ -358,7 +358,7 @@ if (mymob.client) if (mymob.client.gun_mode) // If in aim mode, correct the sprite - mymob.gun_setting_icon.dir = 2 + mymob.gun_setting_icon.set_dir(2) mymob.client.screen = null diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 7ca8216bf21..65924284b51 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -8,7 +8,7 @@ using = new /obj/screen() using.name = "act_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = ui_style using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent) using.screen_loc = ui_acti @@ -67,7 +67,7 @@ using = new /obj/screen() using.name = "mov_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi @@ -85,7 +85,7 @@ inv_box = new /obj/screen/inventory() inv_box.name = "r_hand" - inv_box.dir = WEST + inv_box.set_dir(WEST) inv_box.icon = ui_style inv_box.icon_state = "hand_inactive" if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use @@ -98,7 +98,7 @@ inv_box = new /obj/screen/inventory() inv_box.name = "l_hand" - inv_box.dir = EAST + inv_box.set_dir(EAST) inv_box.icon = ui_style inv_box.icon_state = "hand_inactive" if(mymob && mymob.hand) //This being 1 means the left hand is in use @@ -111,7 +111,7 @@ using = new /obj/screen/inventory() using.name = "hand" - using.dir = SOUTH + using.set_dir(SOUTH) using.icon = ui_style using.icon_state = "hand1" using.screen_loc = ui_swaphand1 @@ -120,7 +120,7 @@ using = new /obj/screen/inventory() using.name = "hand" - using.dir = SOUTH + using.set_dir(SOUTH) using.icon = ui_style using.icon_state = "hand2" using.screen_loc = ui_swaphand2 @@ -129,7 +129,7 @@ inv_box = new /obj/screen/inventory() inv_box.name = "mask" - inv_box.dir = NORTH + inv_box.set_dir(NORTH) inv_box.icon = ui_style inv_box.icon_state = "equip" inv_box.screen_loc = ui_monkey_mask @@ -139,7 +139,7 @@ inv_box = new /obj/screen/inventory() inv_box.name = "back" - inv_box.dir = NORTHEAST + inv_box.set_dir(NORTHEAST) inv_box.icon = ui_style inv_box.icon_state = "equip" inv_box.screen_loc = ui_back @@ -224,19 +224,19 @@ mymob.gun_setting_icon = new /obj/screen/gun/mode(null) if (mymob.client) if (mymob.client.gun_mode) // If in aim mode, correct the sprite - mymob.gun_setting_icon.dir = 2 + mymob.gun_setting_icon.set_dir(2) for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons if (G.target) mymob.item_use_icon = new /obj/screen/gun/item(null) if (mymob.client.target_can_click) - mymob.item_use_icon.dir = 1 + mymob.item_use_icon.set_dir(1) src.adding += mymob.item_use_icon mymob.gun_move_icon = new /obj/screen/gun/move(null) if (mymob.client.target_can_move) - mymob.gun_move_icon.dir = 1 + mymob.gun_move_icon.set_dir(1) mymob.gun_run_icon = new /obj/screen/gun/run(null) if (mymob.client.target_can_run) - mymob.gun_run_icon.dir = 1 + mymob.gun_run_icon.set_dir(1) src.adding += mymob.gun_run_icon src.adding += mymob.gun_move_icon diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index c696308d2d9..644b8113765 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -11,7 +11,7 @@ var/obj/screen/robot_inventory //Radio using = new /obj/screen() using.name = "radio" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = 'icons/mob/screen1_robot.dmi' using.icon_state = "radio" using.screen_loc = ui_movi @@ -22,7 +22,7 @@ var/obj/screen/robot_inventory using = new /obj/screen() using.name = "module1" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = 'icons/mob/screen1_robot.dmi' using.icon_state = "inv1" using.screen_loc = ui_inv1 @@ -32,7 +32,7 @@ var/obj/screen/robot_inventory using = new /obj/screen() using.name = "module2" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = 'icons/mob/screen1_robot.dmi' using.icon_state = "inv2" using.screen_loc = ui_inv2 @@ -42,7 +42,7 @@ var/obj/screen/robot_inventory using = new /obj/screen() using.name = "module3" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = 'icons/mob/screen1_robot.dmi' using.icon_state = "inv3" using.screen_loc = ui_inv3 @@ -55,7 +55,7 @@ var/obj/screen/robot_inventory //Intent using = new /obj/screen() using.name = "act_intent" - using.dir = SOUTHWEST + using.set_dir(SOUTHWEST) using.icon = 'icons/mob/screen1_robot.dmi' using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent) using.screen_loc = ui_acti @@ -155,19 +155,19 @@ var/obj/screen/robot_inventory mymob.gun_setting_icon = new /obj/screen/gun/mode(null) if (mymob.client) if (mymob.client.gun_mode) // If in aim mode, correct the sprite - mymob.gun_setting_icon.dir = 2 + mymob.gun_setting_icon.set_dir(2) for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons if (G.target) mymob.item_use_icon = new /obj/screen/gun/item(null) if (mymob.client.target_can_click) - mymob.item_use_icon.dir = 1 + mymob.item_use_icon.set_dir(1) src.adding += mymob.item_use_icon mymob.gun_move_icon = new /obj/screen/gun/move(null) if (mymob.client.target_can_move) - mymob.gun_move_icon.dir = 1 + mymob.gun_move_icon.set_dir(1) mymob.gun_run_icon = new /obj/screen/gun/run(null) if (mymob.client.target_can_run) - mymob.gun_run_icon.dir = 1 + mymob.gun_run_icon.set_dir(1) src.adding += mymob.gun_run_icon src.adding += mymob.gun_move_icon diff --git a/code/_onclick/oldcode.dm b/code/_onclick/oldcode.dm index 2d52a26390a..8585eb8e5fc 100644 --- a/code/_onclick/oldcode.dm +++ b/code/_onclick/oldcode.dm @@ -23,16 +23,16 @@ if(dy || dx) if(abs(dx) < abs(dy)) - if(dy > 0) usr.dir = NORTH - else usr.dir = SOUTH + if(dy > 0) usr.set_dir(NORTH) + else usr.set_dir(SOUTH) else - if(dx > 0) usr.dir = EAST - else usr.dir = WEST + if(dx > 0) usr.set_dir(EAST) + else usr.set_dir(WEST) else - if(pixel_y > 16) usr.dir = NORTH - else if(pixel_y < -16) usr.dir = SOUTH - else if(pixel_x > 16) usr.dir = EAST - else if(pixel_x < -16) usr.dir = WEST + if(pixel_y > 16) usr.set_dir(NORTH) + else if(pixel_y < -16) usr.set_dir(SOUTH) + else if(pixel_x > 16) usr.set_dir(EAST) + else if(pixel_x < -16) usr.set_dir(WEST) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 3f74cbd0eae..88c9feca369 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -167,7 +167,7 @@ var/const/tk_maxrange = 15 O.anchored = 1 O.density = 0 O.layer = FLY_LAYER - O.dir = pick(cardinal) + O.set_dir(pick(cardinal)) O.icon = 'icons/effects/effects.dmi' O.icon_state = "nothing" flick("empdisable",O) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index a51ac42ee25..e69ed4b5ddd 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -670,8 +670,8 @@ client return switch(href_list["rotatedir"]) - if("right") A.dir = turn(A.dir, -45) - if("left") A.dir = turn(A.dir, 45) + if("right") A.set_dir(turn(A.dir, -45)) + if("left") A.set_dir(turn(A.dir, 45)) href_list["datumrefresh"] = href_list["rotatedatum"] else if(href_list["makemonkey"]) diff --git a/code/datums/spells/dumbfire.dm b/code/datums/spells/dumbfire.dm index 4a466d1663a..53df7d1f92d 100644 --- a/code/datums/spells/dumbfire.dm +++ b/code/datums/spells/dumbfire.dm @@ -43,7 +43,7 @@ projectile:linked_spells += proj_type projectile.icon = proj_icon projectile.icon_state = proj_icon_state - projectile.dir = get_dir(projectile, target) + projectile.set_dir(get_dir(projectile, target)) projectile.name = proj_name var/current_loc = usr.loc diff --git a/code/datums/spells/projectile.dm b/code/datums/spells/projectile.dm index 5d5ba5e1f8e..9bd1a34f18d 100644 --- a/code/datums/spells/projectile.dm +++ b/code/datums/spells/projectile.dm @@ -34,7 +34,7 @@ projectile:linked_spells += proj_type projectile.icon = proj_icon projectile.icon_state = proj_icon_state - projectile.dir = get_dir(target,projectile) + projectile.set_dir(get_dir(target,projectile)) projectile.name = proj_name var/current_loc = usr.loc @@ -47,7 +47,7 @@ if(proj_homing) if(proj_insubstantial) - projectile.dir = get_dir(projectile,target) + projectile.set_dir(get_dir(projectile,target)) projectile.loc = get_step_to(projectile,target) else step_to(projectile,target) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index c11ca32bca7..ef9f6e3b1c6 100755 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -380,6 +380,16 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee containername = "Medical crate" group = "Medical" +/datum/supply_packs/medical + name = "BloodPack crate" + contains = list(/obj/item/weapon/storage/box/bloodpacks, + /obj/item/weapon/storage/box/bloodpacks, + /obj/item/weapon/storage/box/bloodpacks) + cost = 10 + containertype = /obj/structure/closet/crate/medical + containername = "BloodPack crate" + group = "Medical" + /datum/supply_packs/bodybag name = "Body bag crate" contains = list(/obj/item/weapon/storage/box/bodybags, @@ -463,7 +473,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/smescoil name = "Superconducting Magnetic Coil" contains = list(/obj/item/weapon/smes_coil) - cost = 150 + cost = 75 containertype = /obj/structure/closet/crate containername = "Superconducting Magnetic Coil crate" group = "Engineering" @@ -1087,7 +1097,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /datum/supply_packs/smbig name = "Supermatter Core" contains = list(/obj/machinery/power/supermatter) - cost = 50 + cost = 150 containertype = /obj/structure/closet/crate/secure/phoron containername = "Supermatter crate (CAUTION)" group = "Engineering" diff --git a/code/game/atoms.dm b/code/game/atoms.dm index adaaa5b9633..93cb08b5a09 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -138,7 +138,7 @@ its easier to just keep the beam vertical. //of range or to another z-level, then the beam will stop. Otherwise it will //continue to draw. - dir=get_dir(src,BeamTarget) //Causes the source of the beam to rotate to continuosly face the BeamTarget. + set_dir(get_dir(src,BeamTarget)) //Causes the source of the beam to rotate to continuosly face the BeamTarget. 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 @@ -209,6 +209,11 @@ its easier to just keep the beam vertical. /atom/proc/relaymove() return +//called to set the atom's dir and used to add behaviour to dir-changes +/atom/proc/set_dir(new_dir) + . = new_dir != dir + dir = new_dir + /atom/proc/ex_act() return diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 82c7eb3016e..21e8b5d9a9f 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -14,16 +14,6 @@ var/moved_recently = 0 var/mob/pulledby = null -/atom/movable/Move() - var/atom/A = src.loc - . = ..() - src.move_speed = world.time - src.l_move_time - src.l_move_time = world.time - src.m_flag = 1 - if ((A != src.loc && A && A.z == src.z)) - src.last_move = get_dir(A, src.loc) - return - /atom/movable/Bump(var/atom/A as mob|obj|turf|area, yes) if(src.throwing) src.throw_impact(A) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 01ef334ce7d..322e65202f9 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -46,6 +46,7 @@ use_power = 1 idle_power_usage = 50 active_power_usage = 300 + interact_offline = 1 var/locked = 0 var/mob/living/carbon/occupant = null var/obj/item/weapon/reagent_containers/glass/beaker = null diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 51b321528ee..f6351c84809 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -25,7 +25,7 @@ New(loc, var/h = 30) blobs += src src.health = h - src.dir = pick(1,2,4,8) + src.set_dir(pick(1,2,4,8)) src.update_icon() ..(loc) return @@ -195,7 +195,7 @@ New(loc, var/h = 10) src.health = h - src.dir = pick(1,2,4,8) + src.set_dir(pick(1,2,4,8)) src.update_idle() diff --git a/code/game/gamemodes/events/space_ninja.dm b/code/game/gamemodes/events/space_ninja.dm index 97bb3e2404a..1bf2406db5b 100644 --- a/code/game/gamemodes/events/space_ninja.dm +++ b/code/game/gamemodes/events/space_ninja.dm @@ -531,7 +531,19 @@ As such, it's hard-coded for now. No reason for it not to be, really. else equip_to_slot_or_del(new /obj/item/clothing/under/color/black(src), slot_w_uniform) - equip_to_slot_or_del(new /obj/item/weapon/rig/light/ninja(src), slot_back) + var/obj/item/weapon/rig/light/ninja/ninjasuit = new(src) + + // Make sure the ninja can actually equip the suit. + if(src.dna && src.dna.unique_enzymes) + src << "Suit hardware locked to your DNA hash." + ninjasuit.locked_dna = src.dna.unique_enzymes + else + ninjasuit.req_access = list() + + equip_to_slot_or_del(ninjasuit,slot_back) + spawn(10) + ninjasuit.toggle_seals(src,1) + equip_to_slot_or_del(new /obj/item/clothing/mask/gas/voice/space_ninja(src), slot_wear_mask) equip_to_slot_or_del(new /obj/item/device/flashlight(src), slot_belt) equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(src), slot_s_store) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 36137a74a93..50ae7b9fc13 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -30,7 +30,7 @@ if(!the_disk) icon_state = "pinonnull" return - dir = get_dir(src,the_disk) + set_dir(get_dir(src,the_disk)) switch(get_dist(src,the_disk)) if(0) icon_state = "pinondirect" @@ -79,7 +79,7 @@ if(!location) icon_state = "pinonnull" return - dir = get_dir(src,location) + set_dir(get_dir(src,location)) switch(get_dist(src,location)) if(0) icon_state = "pinondirect" @@ -98,7 +98,7 @@ if(!target) icon_state = "pinonnull" return - dir = get_dir(src,target) + set_dir(get_dir(src,target)) switch(get_dist(src,target)) if(0) icon_state = "pinondirect" @@ -215,7 +215,7 @@ // if(loc.z != the_disk.z) //If you are on a different z-level from the disk // icon_state = "pinonnull" // else - dir = get_dir(src, the_disk) + set_dir(get_dir(src, the_disk)) switch(get_dist(src, the_disk)) if(0) icon_state = "pinondirect" @@ -248,7 +248,7 @@ if(loc.z != home.z) //If you are on a different z-level from the shuttle icon_state = "pinonnull" else - dir = get_dir(src, home) + set_dir(get_dir(src, home)) switch(get_dist(src, home)) if(0) icon_state = "pinondirect" diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm index d7b4b1f96ca..34fe340a126 100644 --- a/code/game/jobs/job/civilian_chaplain.dm +++ b/code/game/jobs/job/civilian_chaplain.dm @@ -84,7 +84,7 @@ for(var/area/chapel/main/A in world) for(var/turf/T in A.contents) if(T.icon_state == "carpetsymbol") - T.dir = 4 + T.set_dir(4) if("Scrapbook") B.icon_state = "scrapbook" B.item_state = "scrapbook" @@ -103,7 +103,7 @@ for(var/area/chapel/main/A in world) for(var/turf/T in A.contents) if(T.icon_state == "carpetsymbol") - T.dir = 10 + T.set_dir(10) if("Tome") B.icon_state = "tome" B.item_state = "syringe_kit" @@ -119,7 +119,7 @@ for(var/area/chapel/main/A in world) for(var/turf/T in A.contents) if(T.icon_state == "carpetsymbol") - T.dir = 8 + T.set_dir(8) if("the bible melts") B.icon_state = "melted" B.item_state = "melted" @@ -133,7 +133,7 @@ for(var/area/chapel/main/A in world) for(var/turf/T in A.contents) if(T.icon_state == "carpetsymbol") - T.dir = 2 + T.set_dir(2) H.update_inv_l_hand() // so that it updates the bible's item_state in his hand diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index e87b3c36ec6..326f705a5da 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -422,7 +422,7 @@ var/global/datum/controller/occupations/job_master // Moving wheelchair if they have one if(H.buckled && istype(H.buckled, /obj/structure/stool/bed/chair/wheelchair)) H.buckled.loc = H.loc - H.buckled.dir = H.dir + H.buckled.set_dir(H.dir) //give them an account in the station database var/datum/money_account/M = create_account(H.real_name, rand(50,500)*10, null) @@ -516,7 +516,7 @@ var/global/datum/controller/occupations/job_master var/obj/structure/stool/bed/chair/wheelchair/W = new /obj/structure/stool/bed/chair/wheelchair(H.loc) H.buckled = W H.update_canmove() - W.dir = H.dir + W.set_dir(H.dir) W.buckled_mob = H W.add_fingerprint(H) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index f5474c927d0..9e52c28133a 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -13,7 +13,7 @@ use_power = 1 idle_power_usage = 40 - + interact_offline = 1 /obj/machinery/sleep_console/process() if(stat & (NOPOWER|BROKEN)) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index f8074755a8b..0c7e738cff9 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -104,7 +104,7 @@ src.loc = loc if(dir) - src.dir = dir + src.set_dir(dir) buildstage = 0 wiresexposed = 1 @@ -1274,7 +1274,7 @@ FIRE ALARM src.loc = loc if(dir) - src.dir = dir + src.set_dir(dir) if(building) buildstage = 0 diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm index 9f98f89deef..c4007c69944 100644 --- a/code/game/machinery/bots/bots.dm +++ b/code/game/machinery/bots/bots.dm @@ -120,7 +120,7 @@ pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.dir = pick(cardinal) + pulse2.set_dir(pick(cardinal)) spawn(10) pulse2.delete() diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index a2436f9de41..e7f766a5b40 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -526,14 +526,14 @@ var/obj/effect/decal/cleanable/blood/tracks/B = new(loc) var/newdir = get_dir(next, loc) if(newdir == dir) - B.dir = newdir + B.set_dir(newdir) else newdir = newdir | dir if(newdir == 3) newdir = 1 else if(newdir == 12) newdir = 4 - B.dir = newdir + B.set_dir(newdir) bloodiness-- diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 9e80d176c58..4dd60649253 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -884,7 +884,7 @@ Auto Patrol: []"}, pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.dir = pick(cardinal) + pulse2.set_dir(pick(cardinal)) spawn(10) pulse2.delete() var/list/mob/living/carbon/targets = new diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 140659a0e51..4b60d58a3fe 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -234,13 +234,13 @@ //If someone knows a better way to do this, let me know. -Giacom switch(i) if(NORTH) - src.dir = SOUTH + src.set_dir(SOUTH) if(SOUTH) - src.dir = NORTH + src.set_dir(NORTH) if(WEST) - src.dir = EAST + src.set_dir(EAST) if(EAST) - src.dir = WEST + src.set_dir(WEST) break //Return a working camera that can see a given mob diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 171646c4b15..a02553cc77e 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -79,7 +79,16 @@ updateicon() /obj/machinery/cell_charger/attack_ai(mob/user) - return + if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough + if(!src.charging) + return + + charging.loc = src.loc + charging.updateicon() + charging = null + update_icon() + user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.") + /obj/machinery/cell_charger/emp_act(severity) if(stat & (BROKEN|NOPOWER)) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 4e5b64c631b..03fa91212fc 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -294,7 +294,7 @@ obj/item/weapon/circuitboard/rdserver /obj/item/weapon/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/unary/U) //TODO: Move this stuff into the relevant constructor when pipe/construction.dm is cleaned up. - U.dir = src.machine_dir + U.set_dir(src.machine_dir) U.initialize_directions = src.init_dirs U.initialize() U.build_network() diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 3974ebdd503..32543822b99 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -7,6 +7,7 @@ density = 1 anchored = 1.0 layer = 2.8 + interact_offline = 1 var/on = 0 use_power = 1 diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index d9c40ce64e6..c2a6d996a1e 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -15,6 +15,7 @@ icon = 'icons/obj/Cryogenic2.dmi' icon_state = "cellconsole" circuit = "/obj/item/weapon/circuitboard/cryopodcontrol" + interact_offline = 1 var/mode = null //Used for logging people entering cryosleep and important items they are carrying. diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index bb23176478c..7328c7b8f3d 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -899,7 +899,7 @@ About the new airlock wires panel: var/obj/structure/door_assembly/da = new assembly_type(src.loc) if (istype(da, /obj/structure/door_assembly/multi_tile)) - da.dir = src.dir + da.set_dir(src.dir) da.anchored = 1 if(mineral) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 37966deea69..720fbdc8227 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -29,7 +29,7 @@ var/hitsound = 'sound/weapons/smash.ogg' //sound door makes when hit with a weapon //Multi-tile doors - dir = EAST + set_dir(EAST) var/width = 1 /obj/machinery/door/New() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index f2e81684855..209b993788a 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -194,7 +194,7 @@ wa.name = "Wired Windoor Assembly" if (src.base_state == "right" || src.base_state == "rightsecure") wa.facing = "r" - wa.dir = src.dir + wa.set_dir(src.dir) wa.state = "02" wa.update_icon() diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 845cd277160..519219e96e9 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -109,6 +109,7 @@ Class Procs: var/list/component_parts = list() //list of all the parts used to build it, if made from certain kinds of frames. var/uid var/manual = 0 + var/interact_offline = 0 // Can the machine be interacted with while de-powered. var/global/gl_uid = 1 /obj/machinery/drain_power(var/drain_check) @@ -152,7 +153,7 @@ Class Procs: pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.dir = pick(cardinal) + pulse2.set_dir(pick(cardinal)) spawn(10) pulse2.delete() @@ -197,35 +198,66 @@ Class Procs: /obj/machinery/proc/inoperable(var/additional_flags = 0) return (stat & (NOPOWER|BROKEN|additional_flags)) + /obj/machinery/Topic(href, href_list, var/nowindow = 0, var/checkrange = 1) if(..()) return 1 - if(inoperable()) + if(!can_be_used_by(usr, be_close = checkrange)) return 1 - if(usr.restrained() || usr.lying || usr.stat) - return 1 - if ( ! (istype(usr, /mob/living/carbon/human) || \ - istype(usr, /mob/living/silicon) || \ - istype(usr, /mob/living/carbon/monkey)) ) - usr << "\red You don't have the dexterity to do this!" - return 1 - - var/norange = 0 - if(istype(usr, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = usr - if(istype(H.l_hand, /obj/item/tk_grab)) - norange = 1 - else if(istype(H.r_hand, /obj/item/tk_grab)) - norange = 1 - - if(checkrange && !norange) - if ((!in_range(src, usr) || !istype(src.loc, /turf)) && !istype(usr, /mob/living/silicon)) - return 1 - - src.add_fingerprint(usr) - + add_fingerprint(usr) return 0 +/obj/machinery/proc/can_be_used_by(mob/user, be_close = 1) + if(!interact_offline && stat & (NOPOWER|BROKEN)) + return 0 + if(!user.canUseTopic(src, be_close)) + return 0 + return 1 + +//////////////////////////////////////////////////////////////////////////////////////////// + +/mob/proc/canUseTopic(atom/movable/M, be_close = 1) + return + +/mob/dead/observer/canUseTopic(atom/movable/M, be_close = 1) + if(check_rights(R_ADMIN, 0)) + return + +/mob/living/canUseTopic(atom/movable/M, be_close = 1, no_dextery = 0) + if(no_dextery) + src << "You don't have the dexterity to do this!" + return 0 + return be_close && !in_range(M, src) + +/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close = 1) + if(restrained() || lying || stat || stunned || weakened) + return + if(be_close && !in_range(M, src)) + if(TK in mutations) + var/mob/living/carbon/human/H = M + if(istype(H.l_hand, /obj/item/tk_grab) || istype(H.r_hand, /obj/item/tk_grab)) + return 1 + return + if(!isturf(M.loc) && M.loc != src) + return + return 1 + +/mob/living/silicon/ai/canUseTopic(atom/movable/M) + if(stat) + return + //stop AIs from leaving windows open and using then after they lose vision + //apc_override is needed here because AIs use their own APC when powerless + if(cameranet && !cameranet.checkTurfVis(get_turf(M)) && !apc_override) + return + return 1 + +/mob/living/silicon/robot/canUseTopic(atom/movable/M) + if(stat || lockcharge || stunned || weakened) + return + return 1 + +//////////////////////////////////////////////////////////////////////////////////////////// + /obj/machinery/attack_ai(mob/user as mob) if(isrobot(user)) // For some reason attack_robot doesn't work diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 205cc1cedef..210948bbd3e 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -67,7 +67,7 @@ Buildable meters /obj/item/pipe/New(var/loc, var/pipe_type as num, var/dir as num, var/obj/machinery/atmospherics/make_from = null) ..() if (make_from) - src.dir = make_from.dir + src.set_dir(make_from.dir) src.pipename = make_from.name color = make_from.pipe_color var/is_bent @@ -180,7 +180,7 @@ Buildable meters ///// Z-Level stuff else src.pipe_type = pipe_type - src.dir = dir + src.set_dir(dir) if (pipe_type == 29 || pipe_type == 30 || pipe_type == 33 || pipe_type == 35 || pipe_type == 37 || pipe_type == 39 || pipe_type == 41) connect_types = list(2) src.color = PIPE_COLOR_BLUE @@ -314,28 +314,28 @@ Buildable meters if ( usr.stat || usr.restrained() ) return - src.dir = turn(src.dir, -90) + src.set_dir(turn(src.dir, -90)) if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE)) if(dir==2) - dir = 1 + set_dir(1) else if(dir==8) - dir = 4 + set_dir(4) else if (pipe_type in list (PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W)) - dir = 2 - //src.pipe_dir = get_pipe_dir() + set_dir(2) + //src.pipe_set_dir(get_pipe_dir()) return /obj/item/pipe/Move() ..() if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \ && (src.dir in cardinal)) - src.dir = src.dir|turn(src.dir, 90) + src.set_dir(src.dir|turn(src.dir, 90)) else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE)) if(dir==2) - dir = 1 + set_dir(1) else if(dir==8) - dir = 4 + set_dir(4) return // returns all pipe's endpoints @@ -427,11 +427,11 @@ Buildable meters return 1 if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE)) if(dir==2) - dir = 1 + set_dir(1) else if(dir==8) - dir = 4 + set_dir(4) else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER)) - dir = 2 + set_dir(2) var/pipe_dir = get_pipe_dir() for(var/obj/machinery/atmospherics/M in src.loc) @@ -447,7 +447,7 @@ Buildable meters if(PIPE_SIMPLE_STRAIGHT, PIPE_SIMPLE_BENT) var/obj/machinery/atmospherics/pipe/simple/P = new( src.loc ) P.pipe_color = color - P.dir = src.dir + P.set_dir(src.dir) P.initialize_directions = pipe_dir var/turf/T = P.loc P.level = T.intact ? 2 : 1 @@ -466,7 +466,7 @@ Buildable meters if(PIPE_SUPPLY_STRAIGHT, PIPE_SUPPLY_BENT) var/obj/machinery/atmospherics/pipe/simple/hidden/supply/P = new( src.loc ) P.color = color - P.dir = src.dir + P.set_dir(src.dir) P.initialize_directions = pipe_dir var/turf/T = P.loc P.level = T.intact ? 2 : 1 @@ -485,7 +485,7 @@ Buildable meters if(PIPE_SCRUBBERS_STRAIGHT, PIPE_SCRUBBERS_BENT) var/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers/P = new( src.loc ) P.color = color - P.dir = src.dir + P.set_dir(src.dir) P.initialize_directions = pipe_dir var/turf/T = P.loc P.level = T.intact ? 2 : 1 @@ -504,7 +504,7 @@ Buildable meters if(PIPE_UNIVERSAL) var/obj/machinery/atmospherics/pipe/simple/hidden/universal/P = new( src.loc ) P.color = color - P.dir = src.dir + P.set_dir(src.dir) P.initialize_directions = pipe_dir var/turf/T = P.loc P.level = T.intact ? 2 : 1 @@ -522,7 +522,7 @@ Buildable meters if(PIPE_HE_STRAIGHT, PIPE_HE_BENT) var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new ( src.loc ) - P.dir = src.dir + P.set_dir(src.dir) P.initialize_directions = pipe_dir //this var it's used to know if the pipe is bent or not P.initialize_directions_he = pipe_dir //var/turf/T = P.loc @@ -541,7 +541,7 @@ Buildable meters if(PIPE_CONNECTOR) // connector var/obj/machinery/atmospherics/portables_connector/C = new( src.loc ) - C.dir = dir + C.set_dir(dir) C.initialize_directions = pipe_dir if (pipename) C.name = pipename @@ -557,7 +557,7 @@ Buildable meters if(PIPE_MANIFOLD) //manifold var/obj/machinery/atmospherics/pipe/manifold/M = new( src.loc ) M.pipe_color = color - M.dir = dir + M.set_dir(dir) M.initialize_directions = pipe_dir //M.New() var/turf/T = M.loc @@ -580,7 +580,7 @@ Buildable meters if(PIPE_SUPPLY_MANIFOLD) //manifold var/obj/machinery/atmospherics/pipe/manifold/hidden/supply/M = new( src.loc ) M.color = color - M.dir = dir + M.set_dir(dir) M.initialize_directions = pipe_dir //M.New() var/turf/T = M.loc @@ -603,7 +603,7 @@ Buildable meters if(PIPE_SCRUBBERS_MANIFOLD) //manifold var/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers/M = new( src.loc ) M.color = color - M.dir = dir + M.set_dir(dir) M.initialize_directions = pipe_dir //M.New() var/turf/T = M.loc @@ -626,7 +626,7 @@ Buildable meters if(PIPE_MANIFOLD4W) //4-way manifold var/obj/machinery/atmospherics/pipe/manifold4w/M = new( src.loc ) M.pipe_color = color - M.dir = dir + M.set_dir(dir) M.initialize_directions = pipe_dir //M.New() var/turf/T = M.loc @@ -652,7 +652,7 @@ Buildable meters if(PIPE_SUPPLY_MANIFOLD4W) //4-way manifold var/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply/M = new( src.loc ) M.color = color - M.dir = dir + M.set_dir(dir) M.initialize_directions = pipe_dir M.connect_types = src.connect_types //M.New() @@ -679,7 +679,7 @@ Buildable meters if(PIPE_SCRUBBERS_MANIFOLD4W) //4-way manifold var/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers/M = new( src.loc ) M.color = color - M.dir = dir + M.set_dir(dir) M.initialize_directions = pipe_dir M.connect_types = src.connect_types //M.New() @@ -705,7 +705,7 @@ Buildable meters if(PIPE_JUNCTION) var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/P = new ( src.loc ) - P.dir = src.dir + P.set_dir(src.dir) P.initialize_directions = src.get_pdir() P.initialize_directions_he = src.get_hdir() //var/turf/T = P.loc @@ -724,7 +724,7 @@ Buildable meters if(PIPE_UVENT) //unary vent var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc ) - V.dir = dir + V.set_dir(dir) V.initialize_directions = pipe_dir if (pipename) V.name = pipename @@ -739,7 +739,7 @@ Buildable meters if(PIPE_MVALVE) //manual valve var/obj/machinery/atmospherics/valve/V = new( src.loc) - V.dir = dir + V.set_dir(dir) V.initialize_directions = pipe_dir if (pipename) V.name = pipename @@ -758,7 +758,7 @@ Buildable meters if(PIPE_PUMP) //gas pump var/obj/machinery/atmospherics/binary/pump/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -775,7 +775,7 @@ Buildable meters if(PIPE_GAS_FILTER) //gas filter var/obj/machinery/atmospherics/trinary/filter/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -795,7 +795,7 @@ Buildable meters if(PIPE_GAS_MIXER) //gas mixer var/obj/machinery/atmospherics/trinary/mixer/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -815,7 +815,7 @@ Buildable meters if(PIPE_GAS_FILTER_M) //gas filter mirrored var/obj/machinery/atmospherics/trinary/filter/m_filter/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -835,7 +835,7 @@ Buildable meters if(PIPE_GAS_MIXER_T) //gas mixer-t var/obj/machinery/atmospherics/trinary/mixer/t_mixer/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -855,7 +855,7 @@ Buildable meters if(PIPE_GAS_MIXER_M) //gas mixer mirrored var/obj/machinery/atmospherics/trinary/mixer/m_mixer/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -875,7 +875,7 @@ Buildable meters if(PIPE_SCRUBBER) //scrubber var/obj/machinery/atmospherics/unary/vent_scrubber/S = new(src.loc) - S.dir = dir + S.set_dir(dir) S.initialize_directions = pipe_dir if (pipename) S.name = pipename @@ -889,7 +889,7 @@ Buildable meters if(PIPE_INSULATED_STRAIGHT, PIPE_INSULATED_BENT) var/obj/machinery/atmospherics/pipe/simple/insulated/P = new( src.loc ) - P.dir = src.dir + P.set_dir(src.dir) P.initialize_directions = pipe_dir var/turf/T = P.loc P.level = T.intact ? 2 : 1 @@ -907,7 +907,7 @@ Buildable meters if(PIPE_MTVALVE) //manual t-valve var/obj/machinery/atmospherics/tvalve/V = new(src.loc) - V.dir = dir + V.set_dir(dir) V.initialize_directions = pipe_dir if (pipename) V.name = pipename @@ -927,7 +927,7 @@ Buildable meters if(PIPE_CAP) var/obj/machinery/atmospherics/pipe/cap/C = new(src.loc) - C.dir = dir + C.set_dir(dir) C.initialize_directions = pipe_dir C.initialize() C.build_network() @@ -937,7 +937,7 @@ Buildable meters if(PIPE_SUPPLY_CAP) var/obj/machinery/atmospherics/pipe/cap/hidden/supply/C = new(src.loc) - C.dir = dir + C.set_dir(dir) C.initialize_directions = pipe_dir C.initialize() C.build_network() @@ -947,7 +947,7 @@ Buildable meters if(PIPE_SCRUBBERS_CAP) var/obj/machinery/atmospherics/pipe/cap/hidden/scrubbers/C = new(src.loc) - C.dir = dir + C.set_dir(dir) C.initialize_directions = pipe_dir C.initialize() C.build_network() @@ -957,7 +957,7 @@ Buildable meters if(PIPE_PASSIVE_GATE) //passive gate var/obj/machinery/atmospherics/binary/passive_gate/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -974,7 +974,7 @@ Buildable meters if(PIPE_VOLUME_PUMP) //volume pump var/obj/machinery/atmospherics/binary/pump/high_power/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -991,7 +991,7 @@ Buildable meters if(PIPE_HEAT_EXCHANGE) // heat exchanger var/obj/machinery/atmospherics/unary/heat_exchanger/C = new( src.loc ) - C.dir = dir + C.set_dir(dir) C.initialize_directions = pipe_dir if (pipename) C.name = pipename @@ -1005,7 +1005,7 @@ Buildable meters ///// Z-Level stuff if(PIPE_UP) var/obj/machinery/atmospherics/pipe/zpipe/up/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -1021,7 +1021,7 @@ Buildable meters P.node2.build_network() if(PIPE_DOWN) var/obj/machinery/atmospherics/pipe/zpipe/down/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -1037,7 +1037,7 @@ Buildable meters P.node2.build_network() if(PIPE_SUPPLY_UP) var/obj/machinery/atmospherics/pipe/zpipe/up/supply/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -1053,7 +1053,7 @@ Buildable meters P.node2.build_network() if(PIPE_SUPPLY_DOWN) var/obj/machinery/atmospherics/pipe/zpipe/down/supply/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -1069,7 +1069,7 @@ Buildable meters P.node2.build_network() if(PIPE_SCRUBBERS_UP) var/obj/machinery/atmospherics/pipe/zpipe/up/scrubbers/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename @@ -1085,7 +1085,7 @@ Buildable meters P.node2.build_network() if(PIPE_SCRUBBERS_DOWN) var/obj/machinery/atmospherics/pipe/zpipe/down/scrubbers/P = new(src.loc) - P.dir = dir + P.set_dir(dir) P.initialize_directions = pipe_dir if (pipename) P.name = pipename diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index b8e3bfd0713..5bc3eef7af4 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -456,9 +456,7 @@ if(check_synth) //If it's set to attack all non-silicons, target them! if(L.lying) - if(lethal) - return TURRET_SECONDARY_TARGET - return TURRET_NOT_TARGET + return TURRET_SECONDARY_TARGET return TURRET_PRIORITY_TARGET if(iscuffed(L)) // If the target is handcuffed, leave it alone @@ -470,7 +468,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) < 4) + if(assess_perp(L, check_weapons, check_records, check_arrest) < 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 @@ -535,7 +533,7 @@ if(target && (target.stat != DEAD) && (!(target.lying) || emagged)) spawn() popUp() //pop the turret up if it's not already up. - dir = get_dir(src, target) //even if you can't shoot, follow the target + set_dir(get_dir(src, target)) //even if you can't shoot, follow the target spawn() shootAt(target) return 1 diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index acd89ee17cd..b014ece92a6 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -25,11 +25,11 @@ if(istype(station)) station.com = hub - station.dir = dir + station.set_dir(dir) if(istype(hub)) hub.com = src - hub.dir = dir + hub.set_dir(dir) /obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob) if(istype(I, /obj/item/weapon/card/data/)) diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm index 567afc0d6d6..29811e1a18d 100644 --- a/code/game/machinery/turrets.dm +++ b/code/game/machinery/turrets.dm @@ -232,7 +232,7 @@ /obj/machinery/turret/proc/target() while(src && enabled && !stat && check_target(cur_target)) - src.dir = get_dir(src, cur_target) + src.set_dir(get_dir(src, cur_target)) shootAt(cur_target) sleep(shot_delay) return @@ -487,7 +487,7 @@ if(!target) cur_target = null return - src.dir = get_dir(src,target) + src.set_dir(get_dir(src,target)) var/turf/targloc = get_turf(target) var/target_x = targloc.x var/target_y = targloc.y diff --git a/code/game/mecha/equipment/tools/unused_tools.dm b/code/game/mecha/equipment/tools/unused_tools.dm index 68578913813..470159e06fb 100644 --- a/code/game/mecha/equipment/tools/unused_tools.dm +++ b/code/game/mecha/equipment/tools/unused_tools.dm @@ -61,7 +61,7 @@ if(chassis.hasInternalDamage(MECHA_INT_CONTROL_LOST)) move_result = step_rand(chassis) else if(chassis.dir!=direction) - chassis.dir = direction + chassis.set_dir(direction) move_result = 1 else move_result = step(chassis,direction) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index c8f8f261a24..031077d2eab 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -316,7 +316,7 @@ return 0 /obj/mecha/proc/mechturn(direction) - dir = direction + set_dir(direction) playsound(src,'sound/mecha/mechturn.ogg',40,1) return 1 @@ -1014,7 +1014,7 @@ src.forceMove(src.loc) src.log_append_to_last("[H] moved in as pilot.") src.icon_state = src.reset_icon() - dir = dir_in + set_dir(dir_in) playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) if(!hasInternalDamage()) src.occupant << sound('sound/mecha/nominal.ogg',volume=50) @@ -1073,7 +1073,7 @@ src.Entered(mmi_as_oc) src.Move(src.loc) src.icon_state = src.reset_icon() - dir = dir_in + set_dir(dir_in) src.log_message("[mmi_as_oc] moved in as pilot.") if(!hasInternalDamage()) src.occupant << sound('sound/mecha/nominal.ogg',volume=50) @@ -1162,7 +1162,7 @@ src.verbs += /obj/mecha/verb/eject src.occupant = null src.icon_state = src.reset_icon()+"-open" - src.dir = dir_in + src.set_dir(dir_in) return ///////////////////////// diff --git a/code/game/mecha/medical/medical.dm b/code/game/mecha/medical/medical.dm index 7fe4c456950..027c9f84afc 100644 --- a/code/game/mecha/medical/medical.dm +++ b/code/game/mecha/medical/medical.dm @@ -7,7 +7,7 @@ /obj/mecha/medical/mechturn(direction) - dir = direction + set_dir(direction) playsound(src,'sound/mecha/mechmove01.ogg',40,1) return 1 diff --git a/code/game/mecha/working/hoverpod.dm b/code/game/mecha/working/hoverpod.dm index 5f775d619b5..5736e00b4fb 100644 --- a/code/game/mecha/working/hoverpod.dm +++ b/code/game/mecha/working/hoverpod.dm @@ -56,7 +56,7 @@ //these three procs overriden to play different sounds /obj/mecha/working/hoverpod/mechturn(direction) - dir = direction + set_dir(direction) //playsound(src,'sound/machines/hiss.ogg',40,1) return 1 diff --git a/code/game/objects/effects/biomass_rift.dm b/code/game/objects/effects/biomass_rift.dm index 247f485b570..c619ccb1e7a 100644 --- a/code/game/objects/effects/biomass_rift.dm +++ b/code/game/objects/effects/biomass_rift.dm @@ -30,7 +30,7 @@ if(!IsValidBiomassLoc(T)) continue var/obj/effect/biomass/starting = new /obj/effect/biomass(T) - starting.dir = get_dir(src,starting) + starting.set_dir(get_dir(src,starting)) starting.originalRift = src linkedBiomass += starting spawn(1) //DEBUG @@ -53,13 +53,13 @@ return switch(dir) if(NORTHWEST) - dir = NORTH + set_dir(NORTH) if(NORTHEAST) - dir = EAST + set_dir(EAST) if(SOUTHWEST) - dir = WEST + set_dir(WEST) if(SOUTHEAST) - dir = SOUTH + set_dir(SOUTH) sleep(spreadDelay) Spread() @@ -93,7 +93,7 @@ var/obj/effect/biomass/newBiomass = new /obj/effect/biomass(get_step(src,direction)) newBiomass.curDistance = curDistance + 1 newBiomass.maxDistance = maxDistance - newBiomass.dir = direction + newBiomass.set_dir(direction) newBiomass.originalRift = originalRift newBiomass.icon_state = "[originalRift.newicon]" //DEBUG originalRift.linkedBiomass += newBiomass @@ -110,7 +110,7 @@ if(!IsValidBiomassLoc(T,src)) continue var/obj/effect/biomass/starting = new /obj/effect/biomass(T) - starting.dir = get_dir(src,starting) + starting.set_dir(get_dir(src,starting)) starting.maxDistance = maxDistance /proc/IsValidBiomassLoc(turf/location,obj/effect/biomass/source = null) diff --git a/code/game/objects/effects/chemsmoke.dm b/code/game/objects/effects/chemsmoke.dm index fb9b049a3e0..e62623e2ec0 100644 --- a/code/game/objects/effects/chemsmoke.dm +++ b/code/game/objects/effects/chemsmoke.dm @@ -192,7 +192,7 @@ 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 smoke.icon = I smoke.layer = 6 - smoke.dir = pick(cardinal) + smoke.set_dir(pick(cardinal)) smoke.pixel_x = -32 + rand(-8,8) smoke.pixel_y = -32 + rand(-8,8) walk_to(smoke, T) diff --git a/code/game/objects/effects/decals/Cleanable/fuel.dm b/code/game/objects/effects/decals/Cleanable/fuel.dm index 6b7ef0242e7..5162d0f6dff 100644 --- a/code/game/objects/effects/decals/Cleanable/fuel.dm +++ b/code/game/objects/effects/decals/Cleanable/fuel.dm @@ -40,7 +40,7 @@ obj/effect/decal/cleanable/liquid_fuel icon_state = "mustard" anchored = 0 New(newLoc, amt = 1, d = 0) - dir = d //Setting this direction means you won't get torched by your own flamethrower. + set_dir(d) //Setting this direction means you won't get torched by your own flamethrower. . = ..() Spread() diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 5b209e0423d..db7abda850a 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -402,7 +402,7 @@ steam.start() -- spawns the effect if(istype(T, /turf/space)) var/obj/effect/effect/ion_trails/I = new /obj/effect/effect/ion_trails(src.oldposition) src.oldposition = T - I.dir = src.holder.dir + I.set_dir(src.holder.dir) flick("ion_fade", I) I.icon_state = "blank" spawn( 20 ) @@ -449,7 +449,7 @@ steam.start() -- spawns the effect var/obj/effect/effect/steam/I = new /obj/effect/effect/steam(src.oldposition) src.number++ src.oldposition = get_turf(holder) - I.dir = src.holder.dir + I.set_dir(src.holder.dir) spawn(10) I.delete() src.number-- diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 68285d4f986..f7a6795e84c 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -28,7 +28,7 @@ ..() - dir = CalcDir() + set_dir(CalcDir()) if(!floor) switch(dir) //offset to make it be on the wall rather than on the floor diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index cd9142bdc0b..59a71ddaa82 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -71,7 +71,7 @@ var/predir = AM.dir step(AM, direction) if(!facedir) - AM.dir = predir + AM.set_dir(predir) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 30cc42e6cf3..40a38621bef 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -262,7 +262,8 @@ if(H.wear_mask) return 0 if(H.head && !(H.head.canremove) && (H.head.flags & HEADCOVERSMOUTH)) - H << "\red \The [H.head] is in the way." + if(!disable_warning) + H << "\The [H.head] is in the way." return 0 if( !(slot_flags & SLOT_MASK) ) return 0 @@ -296,7 +297,7 @@ return 0 if(!H.w_uniform && (slot_w_uniform in mob_equip)) if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." + H << "You need a jumpsuit before you can attach this [name]." return 0 if( !(slot_flags & SLOT_BELT) ) return @@ -305,7 +306,8 @@ if(H.glasses) return 0 if(H.head && !(H.head.canremove) && (H.head.flags & HEADCOVERSEYES)) - H << "\red \The [H.head] is in the way." + if(!disable_warning) + H << "\The [H.head] is in the way." return 0 if( !(slot_flags & SLOT_EYES) ) return 0 @@ -339,6 +341,10 @@ if(slot_w_uniform) if(H.w_uniform) return 0 + if(H.wear_suit) + if(!disable_warning) + H << "\The [H.wear_suit] is in the way." + return 0 if( !(slot_flags & SLOT_ICLOTHING) ) return 0 return 1 @@ -347,7 +353,7 @@ return 0 if(!H.w_uniform && (slot_w_uniform in mob_equip)) if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." + H << "You need a jumpsuit before you can attach this [name]." return 0 if( !(slot_flags & SLOT_ID) ) return 0 @@ -357,7 +363,7 @@ return 0 if(!H.w_uniform && (slot_w_uniform in mob_equip)) if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." + H << "You need a jumpsuit before you can attach this [name]." return 0 if(slot_flags & SLOT_DENYPOCKET) return 0 @@ -368,7 +374,7 @@ return 0 if(!H.w_uniform && (slot_w_uniform in mob_equip)) if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." + H << "You need a jumpsuit before you can attach this [name]." return 0 if(slot_flags & SLOT_DENYPOCKET) return 0 @@ -380,11 +386,11 @@ return 0 if(!H.wear_suit && (slot_wear_suit in mob_equip)) if(!disable_warning) - H << "\red You need a suit before you can attach this [name]." + 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." + 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 @@ -410,12 +416,12 @@ if(slot_tie) if(!H.w_uniform && (slot_w_uniform in mob_equip)) if(!disable_warning) - H << "\red You need a jumpsuit before you can attach this [name]." + H << "You need a jumpsuit before you can attach this [name]." return 0 var/obj/item/clothing/under/uniform = H.w_uniform if(uniform.hastie) if (!disable_warning) - H << "\red You already have [uniform.hastie] attached to your [uniform]." + H << "You already have [uniform.hastie] attached to your [uniform]." return 0 if( !(slot_flags & SLOT_TIE) ) return 0 @@ -655,7 +661,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. usr << "You are unable to focus through the [devicename]" cannotzoom = 1 else if(!zoom && global_hud.darkMask[1] in usr.client.screen) - usr << "Your welding equipment gets in the way of you looking through the [devicename]" + usr << "Your visor gets in the way of looking through the [devicename]" cannotzoom = 1 else if(!zoom && usr.get_active_hand() != src) usr << "You are too distracted to look through the [devicename], perhaps if it was in your active hand this might work better" diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index b97ef5746c1..af350bd56bc 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -95,7 +95,7 @@ icon = new_icon icon_state = new_iconstate overlays = new_overlays - dir = O.dir + set_dir(O.dir) M.loc = src master = C master.active_dummy = src diff --git a/code/game/objects/items/devices/floor_painter.dm b/code/game/objects/items/devices/floor_painter.dm index d0bb6b93c05..27b4054fa5e 100644 --- a/code/game/objects/items/devices/floor_painter.dm +++ b/code/game/objects/items/devices/floor_painter.dm @@ -29,7 +29,7 @@ switch(tile_dir_mode) if(1) // All directions accepted - F.dir = D + F.set_dir(D) F.icon_state = mode if(2) // Corner mode - diagonal directions converted CW around. switch(D) @@ -41,7 +41,7 @@ D = WEST if(NORTHWEST) D = NORTH - F.dir = D + F.set_dir(D) F.icon_state = mode if(3) // cardinal directions only. I've adjusted diagonals the same way the facing code does. switch(D) @@ -53,7 +53,7 @@ D = WEST if(NORTHWEST) D = WEST - F.dir = D + F.set_dir(D) F.icon_state = mode if(4) // floors.dmi icon_states "warningcorner" and "warnwhitecorner" are incorrect, this fixes it var/D2 @@ -66,16 +66,16 @@ D2 = NORTH if(NORTHWEST) D2 = EAST - F.dir = D2 + F.set_dir(D2) F.icon_state = mode if(5) - F.dir = 0 + F.set_dir(0) if(D == NORTH || D == SOUTH || D == NORTHEAST || D == SOUTHWEST) F.icon_state = mode else F.icon_state = "[mode]_inv" else - F.dir = 0 + F.set_dir(0) F.icon_state = mode else usr << "You can't paint that!" diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index 54c159d8db7..2f0b67d31d8 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -116,7 +116,7 @@ if(Proj.damage >= 20 || istype(Proj, /obj/item/projectile/beam/practice)) bmark.icon_state = "scorch" - bmark.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design + bmark.set_dir(pick(NORTH,SOUTH,EAST,WEST)) // random scorch design else diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index e6e3cff050a..530c9b5b88e 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -46,6 +46,7 @@ var/global/list/datum/stack_recipe/plastic_recipes = list ( \ new/datum/stack_recipe("plastic spoon", /obj/item/weapon/kitchen/utensil/pspoon, 1, on_floor = 1), \ new/datum/stack_recipe("plastic knife", /obj/item/weapon/kitchen/utensil/pknife, 1, on_floor = 1), \ new/datum/stack_recipe("plastic bag", /obj/item/weapon/storage/bag/plasticbag, 3, on_floor = 1), \ + new/datum/stack_recipe("blood pack", /obj/item/weapon/reagent_containers/blood/empty, 4, on_floor = 0), \ ) var/global/list/datum/stack_recipe/iron_recipes = list ( \ diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index aa93aec8ba6..c3fa049b17e 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -131,7 +131,7 @@ if (src.amount < R.req_amount*multiplier) return var/atom/O = new R.result_type( usr.loc ) - O.dir = usr.dir + O.set_dir(usr.dir) if (R.max_res_amount>1) var/obj/item/stack/new_item = O new_item.amount = R.res_amount*multiplier diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 2ff3114423d..46854c6a2a8 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -35,7 +35,7 @@ spawn(det_time) prime() return - user.dir = get_dir(user, target) + user.set_dir(get_dir(user, target)) user.drop_item() var/t = (isturf(target) ? target : target.loc) walk_towards(src, t, 3) diff --git a/code/game/objects/items/weapons/tape.dm b/code/game/objects/items/weapons/tape.dm new file mode 100644 index 00000000000..8177c746d70 --- /dev/null +++ b/code/game/objects/items/weapons/tape.dm @@ -0,0 +1,88 @@ +/obj/item/weapon/tape_roll + name = "tape roll" + desc = "A roll of sticky tape. Possibly for taping ducks... or was that ducts?" + icon = 'icons/obj/bureaucracy.dmi' + icon_state = "taperoll" + w_class = 1 + +/* -- Disabled for now until it has a use -- +/obj/item/weapon/tape_roll/attack_self(mob/user as mob) + user << "You remove a length of tape from [src]." + + var/obj/item/weapon/ducttape/tape = new() + user.put_in_hands(tape) +*/ + +/obj/item/weapon/tape_roll/proc/stick(var/obj/item/weapon/W, mob/user as mob) + if(!istype(W, /obj/item/weapon/paper)) + return + + user.drop_from_inventory(W) + var/obj/item/weapon/ducttape/tape = new(get_turf(src)) + tape.attach(W) + user.put_in_hands(tape) + +/obj/item/weapon/ducttape + name = "tape" + desc = "A piece of sticky tape." + icon = 'icons/obj/bureaucracy.dmi' + icon_state = "tape" + w_class = 1 + layer = 4 + anchored = 1 //it's sticky, no you cant move it + + var/obj/item/weapon/stuck = null + +/obj/item/weapon/ducttape/New() + ..() + flags |= NOBLUDGEON + +/obj/item/weapon/ducttape/examine(mob/user as mob) + return stuck.examine(user) + +/obj/item/weapon/ducttape/proc/attach(var/obj/item/weapon/W) + stuck = W + W.forceMove(src) + icon_state = W.icon_state + "_taped" + name = W.name + " (taped)" + +/obj/item/weapon/ducttape/attack_self(mob/user as mob) + if(!stuck) + return + + user << "You remove \the [initial(name)] from [stuck]." + + user.drop_from_inventory(src) + stuck.forceMove(get_turf(src)) + user.put_in_hands(stuck) + stuck = null + del(src) + +/obj/item/weapon/ducttape/afterattack(var/A, mob/user as mob, flag, params) + if(!in_range(user, A) || istype(A, /obj/machinery/door) || !stuck) + return + + var/turf/target_turf = get_turf(A) + var/turf/source_turf = get_turf(user) + + var/dir_offset = 0 + if(target_turf != source_turf) + dir_offset = get_dir(source_turf, target_turf) + + user.drop_from_inventory(src) + forceMove(source_turf) + + if(params) + var/list/mouse_control = params2list(params) + if(mouse_control["icon-x"]) + pixel_x = text2num(mouse_control["icon-x"]) - 16 + if(dir_offset & EAST) + pixel_x += 32 + else if(dir_offset & WEST) + pixel_x -= 32 + if(mouse_control["icon-y"]) + pixel_y = text2num(mouse_control["icon-y"]) - 16 + if(dir_offset & NORTH) + pixel_y += 32 + else if(dir_offset & SOUTH) + pixel_y -= 32 \ No newline at end of file diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 6bb08bb451f..70485e67a2a 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -169,7 +169,7 @@ if((wielded) && prob(50)) spawn(0) for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2)) - user.dir = i + user.set_dir(i) sleep(1) /obj/item/weapon/twohanded/dualsaber/IsShield() diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm index 2330e63ecc3..28d9ebc6232 100644 --- a/code/game/objects/structures/electricchair.dm +++ b/code/game/objects/structures/electricchair.dm @@ -15,7 +15,7 @@ if(istype(W, /obj/item/weapon/wrench)) var/obj/structure/stool/bed/chair/C = new /obj/structure/stool/bed/chair(loc) playsound(loc, 'sound/items/Ratchet.ogg', 50, 1) - C.dir = dir + C.set_dir(dir) part.loc = loc part.master = null part = null diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index b12a1a74d05..535b73d3b56 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -170,14 +170,14 @@ /obj/structure/stool/bed/chair/janicart/New() - handle_rotation() create_reagents(100) + update_layer() /obj/structure/stool/bed/chair/janicart/examine(mob/user) if(!..(user, 1)) return - + user << "\icon[src] This [callme] contains [reagents.total_volume] unit\s of water!" if(mybag) user << "\A [mybag] is hanging on the [callme]." @@ -215,7 +215,6 @@ if(istype(user.l_hand, /obj/item/key) || istype(user.r_hand, /obj/item/key)) step(src, direction) update_mob() - handle_rotation() else user << "You'll need the keys in one of your hands to drive this [callme]." @@ -238,13 +237,20 @@ "You climb onto the [callme]!") M.buckled = src M.loc = loc - M.dir = dir + M.set_dir(dir) M.update_canmove() buckled_mob = M update_mob() add_fingerprint(user) +/obj/structure/stool/bed/chair/janicart/update_layer() + if(dir == SOUTH) + layer = FLY_LAYER + else + layer = OBJ_LAYER + + /obj/structure/stool/bed/chair/janicart/unbuckle() if(buckled_mob) buckled_mob.pixel_x = 0 @@ -252,12 +258,9 @@ ..() -/obj/structure/stool/bed/chair/janicart/handle_rotation() - if(dir == SOUTH) - layer = FLY_LAYER - else - layer = OBJ_LAYER - +/obj/structure/stool/bed/chair/janicart/set_dir() + ..() + update_layer() if(buckled_mob) if(buckled_mob.loc != loc) buckled_mob.buckled = null //Temporary, so Move() succeeds. @@ -268,7 +271,7 @@ /obj/structure/stool/bed/chair/janicart/proc/update_mob() if(buckled_mob) - buckled_mob.dir = dir + buckled_mob.set_dir(dir) switch(dir) if(SOUTH) buckled_mob.pixel_x = 0 diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 3db68575c98..e1c8427ecf6 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -77,7 +77,7 @@ for(var/atom/movable/A as mob|obj in src) A.loc = src.connected.loc src.connected.icon_state = "morguet" - src.connected.dir = src.dir + src.connected.set_dir(src.dir) else //src.connected = null del(src.connected) 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 3c5bbfc1ca2..3d21575c749 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 @@ -56,7 +56,7 @@ "You hear squelching...") M.buckled = src M.loc = src.loc - M.dir = src.dir + M.set_dir(src.dir) M.update_canmove() M.pixel_y = 6 M.old_y = 6 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 a3f99324b74..8902dbc8ecf 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -33,9 +33,6 @@ manual_unbuckle(user) return -/obj/structure/stool/bed/proc/handle_rotation() - return - /obj/structure/stool/bed/MouseDrop(atom/over_object) return @@ -104,7 +101,7 @@ "You hear metal clanking") M.buckled = src M.loc = src.loc - M.dir = src.dir + M.set_dir(src.dir) M.update_canmove() src.buckled_mob = M src.add_fingerprint(user) 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 5db6d2f2068..0e8e7d5850a 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -11,7 +11,7 @@ /obj/structure/stool/bed/chair/New() ..() spawn(3) //sorry. i don't think there's a better way to do this. - handle_rotation() + update_layer() return /obj/structure/stool/bed/chair/attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -24,7 +24,7 @@ user.drop_item() var/obj/structure/stool/bed/chair/e_chair/E = new /obj/structure/stool/bed/chair/e_chair(src.loc) playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - E.dir = dir + E.set_dir(dir) E.part = SK SK.loc = E SK.master = E @@ -37,13 +37,17 @@ rotate() return -/obj/structure/stool/bed/chair/handle_rotation() //making this into a seperate proc so office chairs can call it on Move() +/obj/structure/stool/bed/chair/proc/update_layer() if(src.dir == NORTH) src.layer = FLY_LAYER else src.layer = OBJ_LAYER + +/obj/structure/stool/bed/chair/set_dir() + ..() + update_layer() if(buckled_mob) - buckled_mob.dir = dir + buckled_mob.set_dir(dir) /obj/structure/stool/bed/chair/verb/rotate() set name = "Rotate Chair" @@ -51,8 +55,7 @@ set src in oview(1) if(config.ghost_interaction) - src.dir = turn(src.dir, 90) - handle_rotation() + src.set_dir(turn(src.dir, 90)) return else if(istype(usr,/mob/living/simple_animal/mouse)) @@ -62,8 +65,7 @@ if(usr.stat || usr.restrained()) return - src.dir = turn(src.dir, 90) - handle_rotation() + src.set_dir(turn(src.dir, 90)) return /obj/structure/stool/bed/chair/MouseDrop_T(mob/M as mob, mob/user as mob) @@ -142,7 +144,6 @@ Bump(O) else unbuckle() - handle_rotation() /obj/structure/stool/bed/chair/office/Bump(atom/A) ..() diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 8e801de6e2d..0ed780ebddf 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -10,12 +10,13 @@ var/bloodiness -/obj/structure/stool/bed/chair/wheelchair/handle_rotation() +/obj/structure/stool/bed/chair/wheelchair/set_dir() + ..() overlays = null var/image/O = image(icon = 'icons/obj/objects.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir) overlays += O if(buckled_mob) - buckled_mob.dir = dir + buckled_mob.set_dir(dir) /obj/structure/stool/bed/chair/wheelchair/relaymove(mob/user, direction) // Redundant check? @@ -64,8 +65,7 @@ step(src, direction) if(buckled_mob) // Make sure it stays beneath the occupant Move(buckled_mob.loc) - dir = direction - handle_rotation() + set_dir(direction) if(pulling) // Driver if(pulling.loc == src.loc) // We moved onto the wheelchair? Revert! pulling.loc = T @@ -74,7 +74,7 @@ if(get_dist(src, pulling) > 1) // We are too far away? Losing control. pulling = null user.pulledby = null - pulling.dir = get_dir(pulling, src) // When everything is right, face the wheelchair + pulling.set_dir(get_dir(pulling, src)) // When everything is right, face the wheelchair if(bloodiness) create_track() driving = 0 @@ -101,7 +101,6 @@ else if (occupant && (src.loc != occupant.loc)) src.loc = occupant.loc // Failsafe to make sure the wheelchair stays beneath the occupant after driving - handle_rotation() /obj/structure/stool/bed/chair/wheelchair/attack_hand(mob/user as mob) if (pulling) @@ -122,7 +121,7 @@ usr.pulledby = src if(usr.pulling) usr.stop_pulling() - usr.dir = get_dir(usr, src) + usr.set_dir(get_dir(usr, src)) usr << "You grip \the [name]'s handles." else if(usr != pulling) @@ -176,14 +175,14 @@ var/obj/effect/decal/cleanable/blood/tracks/B = new(loc) var/newdir = get_dir(get_step(loc, dir), loc) if(newdir == dir) - B.dir = newdir + B.set_dir(newdir) else newdir = newdir | dir if(newdir == 3) newdir = 1 else if(newdir == 12) newdir = 4 - B.dir = newdir + B.set_dir(newdir) bloodiness-- /obj/structure/stool/bed/chair/wheelchair/buckle_mob(mob/M as mob, mob/user as mob) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index bcd09a51cd4..2dc9ae80572 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -250,9 +250,9 @@ if(6) icon_state = "tabledir3" if (dir_sum in list(1,2,4,8,5,6,9,10)) - dir = dir_sum + set_dir(dir_sum) else - dir = 2 + set_dir(2) /obj/structure/table/attack_tk() // no telehulk sorry return @@ -445,7 +445,7 @@ spawn(0) A.throw_at(pick(targets),1,1) - dir = direction + set_dir(direction) if(dir != NORTH) layer = 5 climbable = 0 //flipping tables allows them to be used as makeshift barriers diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index aed971b20d1..2c8c534dd47 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -170,7 +170,7 @@ obj/structure/ex_act(severity) nexttube = tube break if(!nexttube) - pod.dir = turn(pod.dir, 180) + pod.set_dir(turn(pod.dir, 180)) if(icon_state == "closed" && pod) pod.follow_tube() @@ -320,13 +320,13 @@ obj/structure/ex_act(severity) break if(current_tube == null) - dir = next_dir + set_dir(next_dir) Move(get_step(loc, dir)) // Allow collisions when leaving the tubes. break last_delay = current_tube.enter_delay(src, next_dir) sleep(last_delay) - dir = next_dir + set_dir(next_dir) loc = next_loc // When moving from one tube to another, skip collision and such. density = current_tube.density @@ -429,14 +429,14 @@ obj/structure/ex_act(severity) station.open_animation() else if(direction in station.directions()) - dir = direction + set_dir(direction) station.launch_pod() return for(var/obj/structure/transit_tube/tube in loc) if(dir in tube.directions()) if(tube.has_exit(direction)) - dir = direction + set_dir(direction) return diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 9e1b47a0b17..c115f230e2b 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -32,9 +32,9 @@ obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) anchored = 0 switch(start_dir) if(NORTH, SOUTH, EAST, WEST) - dir = start_dir + set_dir(start_dir) else //If the user is facing northeast. northwest, southeast, southwest or north, default to north - dir = NORTH + set_dir(NORTH) update_nearby_tiles(need_rebuild=1) @@ -220,7 +220,7 @@ obj/structure/windoor_assembly/Del() else windoor.icon_state = "rightsecureopen" windoor.base_state = "rightsecure" - windoor.dir = src.dir + windoor.set_dir(src.dir) windoor.density = 0 if(src.electronics.one_access) @@ -238,7 +238,7 @@ obj/structure/windoor_assembly/Del() else windoor.icon_state = "rightopen" windoor.base_state = "right" - windoor.dir = src.dir + windoor.set_dir(src.dir) windoor.density = 0 if(src.electronics.one_access) @@ -272,7 +272,7 @@ obj/structure/windoor_assembly/Del() if(src.state != "01") update_nearby_tiles(need_rebuild=1) //Compel updates before - src.dir = turn(src.dir, 270) + src.set_dir(turn(src.dir, 270)) if(src.state != "01") update_nearby_tiles(need_rebuild=1) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index a8492748a3c..73ec443e0a6 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -246,7 +246,7 @@ return 0 update_nearby_tiles(need_rebuild=1) //Compel updates before - dir = turn(dir, 90) + set_dir(turn(dir, 90)) // updateSilicate() update_nearby_tiles(need_rebuild=1) return @@ -262,7 +262,7 @@ return 0 update_nearby_tiles(need_rebuild=1) //Compel updates before - dir = turn(dir, 270) + set_dir(turn(dir, 270)) // updateSilicate() update_nearby_tiles(need_rebuild=1) return @@ -292,7 +292,7 @@ anchored = 0 if (start_dir) - dir = start_dir + set_dir(start_dir) health = maxhealth @@ -313,7 +313,7 @@ var/ini_dir = dir update_nearby_tiles(need_rebuild=1) ..() - dir = ini_dir + set_dir(ini_dir) update_nearby_tiles(need_rebuild=1) //checks if this window is full-tile one diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index db622996da2..6c417a35e12 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1769,7 +1769,7 @@ else var/atom/O = new path(target) if(O) - O.dir = obj_dir + O.set_dir(obj_dir) if(obj_name) O.name = obj_name if(istype(O,/mob)) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 50b2c862058..3a70e853996 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -60,7 +60,7 @@ var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam((holder ? holder.loc : loc) ) I.master = src I.density = 1 - I.dir = dir + I.set_dir(dir) step(I, I.dir) if(I) I.density = 0 @@ -85,14 +85,14 @@ Move() var/t = dir ..() - dir = t + set_dir(t) del(first) return holder_movement() if(!holder) return 0 -// dir = holder.dir +// set_dir(holder.dir) del(first) return 1 @@ -151,7 +151,7 @@ set category = "Object" set src in usr - dir = turn(dir, 90) + set_dir(turn(dir, 90)) return @@ -213,7 +213,7 @@ var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam(loc) I.master = master I.density = 1 - I.dir = dir + I.set_dir(dir) //world << "created new beam \ref[I] at [I.x] [I.y] [I.z]" step(I, I.dir) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index 20864c641ee..04c255b94eb 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -120,13 +120,13 @@ obj/machinery/gateway/centerstation/process() if(!awaygate) return if(awaygate.calibrated) M.loc = get_step(awaygate.loc, SOUTH) - M.dir = SOUTH + M.set_dir(SOUTH) return else var/obj/effect/landmark/dest = pick(awaydestinations) if(dest) M.loc = dest.loc - M.dir = SOUTH + M.set_dir(SOUTH) use_power(5000) return @@ -222,7 +222,7 @@ obj/machinery/gateway/centerstation/process() M << "\black The station gate has detected your exile implant and is blocking your entry." return M.loc = get_step(stationgate.loc, SOUTH) - M.dir = SOUTH + M.set_dir(SOUTH) /obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob) diff --git a/code/modules/client/preferences_gear.dm b/code/modules/client/preferences_gear.dm index 72d30a72011..3f9eb7b3613 100644 --- a/code/modules/client/preferences_gear.dm +++ b/code/modules/client/preferences_gear.dm @@ -747,6 +747,12 @@ var/global/list/gear_datums = list() sort_category = "utility" cost = 1 +/datum/gear/paicard + display_name = "personal AI device" + path = /obj/item/device/paicard + sort_category = "utility" + cost = 2 + // The rest of the trash. /datum/gear/ashtray @@ -837,4 +843,4 @@ var/global/list/gear_datums = list() path = /obj/item/clothing/ears/skrell/cloth_female cost = 2 sort_category = "ears" - whitelisted = "Skrell" \ No newline at end of file + whitelisted = "Skrell" diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index dc242cd23fe..ee06abd127b 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -144,7 +144,7 @@ desc = O.desc icon = O.icon icon_state = O.icon_state - dir = O.dir + set_dir(O.dir) /obj/item/clothing/ears/earmuffs name = "earmuffs" @@ -244,6 +244,7 @@ BLIND // can't see anything w_class = 2.0 var/light_overlay = "helmet_light" + var/light_applied var/brightness_on var/on = 0 @@ -254,40 +255,54 @@ BLIND // can't see anything /obj/item/clothing/head/attack_self(mob/user) if(brightness_on) - if(!isturf(user.loc)) - user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. + user << "You cannot turn the light on while in this [user.loc]" return - on = !on - - overlays.Cut() - if(on) - if(!light_overlay_cache["[light_overlay]_icon"]) - light_overlay_cache["[light_overlay]_icon"] = image("icon" = 'icons/obj/light_overlays.dmi', "icon_state" = "[light_overlay]") - if(!light_overlay_cache["[light_overlay]"]) - light_overlay_cache["[light_overlay]"] = image("icon" = 'icons/mob/light_overlays.dmi', "icon_state" = "[light_overlay]") - overlays |= light_overlay_cache["[light_overlay]_icon"] - user.SetLuminosity(user.luminosity + brightness_on) - else - user.SetLuminosity(user.luminosity - brightness_on) - - if(istype(user,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = user - H.update_inv_head() - + user << "You [on ? "enable" : "disable"] the helmet light." + update_light(user) else return ..(user) -/obj/item/clothing/head/proc/update_light(mob/user) - - if(!brightness_on) - return - - if(on) - if(light_overlay) overlays |= light_overlay - user.SetLuminosity(user.luminosity - brightness_on) +/obj/item/clothing/head/proc/update_light(var/mob/user = null) + if(on && !light_applied) + if(loc == user) + user.SetLuminosity(user.luminosity + brightness_on) SetLuminosity(brightness_on) + light_applied = 1 + else if(!on && light_applied) + if(loc == user) + user.SetLuminosity(user.luminosity - brightness_on) + SetLuminosity(0) + light_applied = 0 + update_icon(user) + +/obj/item/clothing/head/equipped(mob/user) + ..() + spawn(1) + if(on && loc == user && !light_applied) + user.SetLuminosity(user.luminosity + brightness_on) + light_applied = 1 + +/obj/item/clothing/head/dropped(mob/user) + ..() + spawn(1) + if(on && loc != user && light_applied) + user.SetLuminosity(user.luminosity - brightness_on) + light_applied = 0 + +/obj/item/clothing/head/update_icon(var/mob/user) + + overlays.Cut() + if(on) + if(!light_overlay_cache["[light_overlay]_icon"]) + light_overlay_cache["[light_overlay]_icon"] = image("icon" = 'icons/obj/light_overlays.dmi', "icon_state" = "[light_overlay]") + if(!light_overlay_cache["[light_overlay]"]) + light_overlay_cache["[light_overlay]"] = image("icon" = 'icons/mob/light_overlays.dmi', "icon_state" = "[light_overlay]") + overlays |= light_overlay_cache["[light_overlay]_icon"] + if(istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + H.update_inv_head() /obj/item/clothing/head/equipped(mob/user) ..() @@ -545,5 +560,4 @@ BLIND // can't see anything /obj/item/clothing/under/emp_act(severity) if (hastie) hastie.emp_act(severity) - ..() - + ..() \ No newline at end of file diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 7a1016efa98..287d3ed7487 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -4,28 +4,28 @@ icon_state = "magboots0" species_restricted = null var/magpulse = 0 + var/icon_base = "magboots" icon_action_button = "action_blank" action_button_name = "Toggle the magboots" -// flags = NOSLIP //disabled by default - attack_self(mob/user) - if(magpulse) - flags &= ~NOSLIP - slowdown = SHOES_SLOWDOWN - magpulse = 0 - icon_state = "magboots0" - user << "You disable the mag-pulse traction system." - else - flags |= NOSLIP - slowdown = 2 - magpulse = 1 - icon_state = "magboots1" - user << "You enable the mag-pulse traction system." - user.update_inv_shoes() //so our mob-overlays update - - examine(mob/user) - ..(user) - var/state = "disabled" - if(src.flags&NOSLIP) - state = "enabled" - user << "Its mag-pulse traction system appears to be [state]." \ No newline at end of file +/obj/item/clothing/shoes/magboots/attack_self(mob/user) + if(magpulse) + flags &= ~NOSLIP + slowdown = SHOES_SLOWDOWN + magpulse = 0 + if(icon_base) icon_state = "[icon_base]0" + user << "You disable the mag-pulse traction system." + else + flags |= NOSLIP + slowdown = 2 + magpulse = 1 + if(icon_base) icon_state = "[icon_base]1" + user << "You enable the mag-pulse traction system." + user.update_inv_shoes() //so our mob-overlays update + +/obj/item/clothing/shoes/magboots/examine(mob/user) + ..(user) + var/state = "disabled" + if(src.flags&NOSLIP) + state = "enabled" + user << "Its mag-pulse traction system appears to be [state]." \ No newline at end of file diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index 457ad2ecd7e..7b7e2374d4c 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -291,7 +291,7 @@ toggleable = 1 usable = 0 - engage_string = "Enable Countermeasures" + activate_string = "Enable Countermeasures" deactivate_string = "Disable Countermeasures" interface_name = "electrowarfare system" @@ -322,7 +322,7 @@ activates_on_touch = 1 disruptive = 0 - engage_string = "Enable Power Sink" + activate_string = "Enable Power Sink" deactivate_string = "Disable Power Sink" interface_name = "niling d-sink" diff --git a/code/modules/clothing/spacesuits/rig/modules/ninja.dm b/code/modules/clothing/spacesuits/rig/modules/ninja.dm index 50865ca8dfe..63231dcd958 100644 --- a/code/modules/clothing/spacesuits/rig/modules/ninja.dm +++ b/code/modules/clothing/spacesuits/rig/modules/ninja.dm @@ -173,6 +173,14 @@ /obj/item/rig_module/self_destruct/engage() explosion(get_turf(src), 0, 0, 3, 4) + if(holder && holder.wearer) + holder.wearer.drop_from_inventory(src) + del(holder) + del(src) /obj/item/rig_module/self_destruct/small/engage() - explosion(get_turf(src), 0, 0, 1, 2) \ No newline at end of file + explosion(get_turf(src), 0, 0, 1, 2) + if(holder && holder.wearer) + holder.wearer.drop_from_inventory(src) + del(holder) + del(src) \ No newline at end of file diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm index 620ea228938..06a72bc3525 100644 --- a/code/modules/clothing/spacesuits/rig/modules/utility.dm +++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm @@ -279,7 +279,7 @@ disruptive = 0 suit_overlay_active = "maneuvering_active" - suit_overlay_inactive = "maneuvering_inactive" + suit_overlay_inactive = null //"maneuvering_inactive" engage_string = "Toggle Stabilizers" activate_string = "Activate Thrusters" diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index fa730c7cb4e..41c02cba100 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -32,14 +32,14 @@ var/list/initial_modules var/chest_type = /obj/item/clothing/suit/space/rig var/helm_type = /obj/item/clothing/head/helmet/space/rig - var/boot_type = /obj/item/clothing/shoes/rig + var/boot_type = /obj/item/clothing/shoes/magboots/rig var/glove_type = /obj/item/clothing/gloves/rig var/cell_type = /obj/item/weapon/cell/high var/air_type = /obj/item/weapon/tank/oxygen //Component/device holders. var/obj/item/weapon/tank/air_supply // Air tank, if any. - var/obj/item/clothing/shoes/rig/boots = null // Deployable boots, if any. + var/obj/item/clothing/shoes/boots = null // Deployable boots, if any. var/obj/item/clothing/suit/space/rig/chest // Deployable chestpiece, if any. var/obj/item/clothing/head/helmet/space/rig/helmet = null // Deployable helmet, if any. var/obj/item/clothing/gloves/rig/gloves = null // Deployable gauntlets, if any. @@ -63,6 +63,7 @@ var/malfunction_delay = 0 var/electrified = 0 var/locked_down = 0 + var/locked_dna = null var/sealing // Keeps track of seal status independantly of canremove. var/offline = 1 // Should we be applying suit maluses? @@ -122,6 +123,8 @@ verbs |= /obj/item/weapon/rig/proc/toggle_boots if(chest_type) chest = new chest_type(src) + if(allowed) + chest.allowed = allowed verbs |= /obj/item/weapon/rig/proc/toggle_chest for(var/obj/item/piece in list(gloves,helmet,boots,chest)) @@ -137,12 +140,6 @@ piece.siemens_coefficient = siemens_coefficient piece.permeability_coefficient = permeability_coefficient - spawn(1) - var/mob/M = loc - if(istype(M)) - toggle_seals(M,1) - update_icon() - /obj/item/weapon/rig/Del() for(var/obj/item/piece in list(gloves,boots,helmet,chest)) var/mob/living/M = piece.loc @@ -155,13 +152,13 @@ /obj/item/weapon/rig/proc/suit_is_deployed() if(!istype(wearer) || src.loc != wearer || wearer.back != src) return 0 - if(helm_type && (!helmet || wearer.head != helmet)) + if(helm_type && !(helmet && wearer.head == helmet)) return 0 - if(glove_type && (!gloves || wearer.gloves != gloves)) + if(glove_type && !(gloves && wearer.gloves == gloves)) return 0 - if(boot_type && (!boots || wearer.shoes != boots)) + if(boot_type && !(boots && wearer.shoes == boots)) return 0 - if(chest_type && (!chest || wearer.wear_suit != chest)) + if(chest_type && !(chest && wearer.wear_suit == chest)) return 0 return 1 @@ -169,9 +166,6 @@ if(sealing) return - if(M && !(istype(M) && M.back == src ) && !istype(M,/mob/living/silicon) ) - return 0 - if(!check_power_cost(M)) return 0 @@ -187,30 +181,25 @@ M << "The suit flashes an error light. It can't function properly without being fully deployed." failed_to_seal = 1 - if(!failed_to_seal && instant) - for(var/obj/item/piece in list(helmet,boots,gloves,chest)) - if(!piece) continue - piece.icon_state = "[initial(icon_state)]_sealed" - update_icon() + if(!failed_to_seal) - else if(!failed_to_seal) - - M << "With a quiet hum, the suit begins running checks and adjusting components." - - if(!do_after(M,SEAL_DELAY)) - if(M) M << "You must remain still while the suit is adjusting the components." - failed_to_seal = 1 + if(!instant) + M << "With a quiet hum, the suit begins running checks and adjusting components." + if(!do_after(M,SEAL_DELAY)) + if(M) M << "You must remain still while the suit is adjusting the components." + failed_to_seal = 1 if(!M) failed_to_seal = 1 else - for(var/list/piece_data in list(list(M.shoes,boots,"boots"),list(M.gloves,gloves,"gloves"),list(M.head,helmet,"helmet"),list(M.wear_suit,chest,"chest"))) + for(var/list/piece_data in list(list(M.shoes,boots,"boots",boot_type),list(M.gloves,gloves,"gloves",glove_type),list(M.head,helmet,"helmet",helm_type),list(M.wear_suit,chest,"chest",chest_type))) var/obj/item/piece = piece_data[1] var/obj/item/compare_piece = piece_data[2] var/msg_type = piece_data[3] + var/piece_type = piece_data[4] - if(!piece) + if(!piece || !piece_type) continue if(!istype(M) || !istype(piece) || !istype(compare_piece) || !msg_type) @@ -219,7 +208,12 @@ failed_to_seal = 1 break - if(M.back == src && piece == compare_piece && do_after(M,SEAL_DELAY)) + if(M.back == src && piece == compare_piece) + + if(!instant) + if(!do_after(M,SEAL_DELAY)) + failed_to_seal = 1 + piece.icon_state = "[initial(icon_state)][!seal_target ? "_sealed" : ""]" switch(msg_type) if("boots") @@ -234,15 +228,17 @@ if("helmet") M << "\The [piece] hisses [!seal_target ? "closed" : "open"]." M.update_inv_head() - if(!seal_target) - if(flags & AIRTIGHT) - helmet.flags |= AIRTIGHT - helmet.flags_inv |= (HIDEEYES|HIDEFACE) - helmet.body_parts_covered |= (FACE|EYES) - else - helmet.flags &= ~AIRTIGHT - helmet.flags_inv &= ~(HIDEEYES|HIDEFACE) - helmet.body_parts_covered &= ~(FACE|EYES) + if(helmet) + if(!seal_target) + if(flags & AIRTIGHT) + helmet.flags |= AIRTIGHT + helmet.flags_inv |= (HIDEEYES|HIDEFACE) + helmet.body_parts_covered |= (FACE|EYES) + else + helmet.flags &= ~AIRTIGHT + helmet.flags_inv &= ~(HIDEEYES|HIDEFACE) + helmet.body_parts_covered &= ~(FACE|EYES) + helmet.update_light(wearer) else failed_to_seal = 1 @@ -287,6 +283,10 @@ piece.flags |= AIRTIGHT update_icon(1) + if(instant && air_supply) + wearer.internals = air_supply + wearer.internals.icon_state = "internal1" + /obj/item/weapon/rig/process() if(!istype(wearer) || loc != wearer || wearer.back != src || canremove || !cell || cell.charge <= 0) @@ -437,7 +437,7 @@ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) - ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 800, 600) + ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 480, 550) ui.set_initial_data(data) ui.open() ui.set_auto_update(1) @@ -472,45 +472,59 @@ wearer.update_inv_back() return +/obj/item/weapon/rig/proc/check_suit_access(var/mob/living/carbon/human/user) + + if(!security_check_enabled) + return 1 + + if(istype(user)) + if(user.back != src) + return 0 + if(locked_dna) + if(!user.dna || user.dna.unique_enzymes != locked_dna) + user << "DNA scan mismatch. Access denied." + return 0 + else if(!src.allowed(user)) + user << "Unauthorized user. Access denied." + return 0 + + else if(user.loc && user.loc.loc && istype(user.loc.loc,/obj/item/rig_module/ai_container)) + if(!ai_override_enabled) + user << "Synthetic access disabled. Please consult hardware provider." + return 0 + + return 1 + /obj/item/weapon/rig/Topic(href,href_list) - var/mob/living/carbon/human/H = usr + if(!check_suit_access(usr)) + return - if((istype(H) && H.back == src) || (istype(H,/mob/living/silicon))) + if(href_list["toggle_piece"]) + toggle_piece(href_list["toggle_piece"], usr) + else if(href_list["toggle_seals"]) + toggle_seals(usr) + else if(href_list["interact_module"]) - if(istype(H,/mob/living/silicon)) - if(!control_overridden) - usr << "Synthetic access disabled. Please consult hardware provider." - return - else if(security_check_enabled && !src.allowed(usr)) - usr << "Access denied." - return + var/module_index = text2num(href_list["interact_module"]) - if(href_list["toggle_piece"]) - toggle_piece(href_list["toggle_piece"], H) - else if(href_list["toggle_seals"]) - toggle_seals(H) - else if(href_list["interact_module"]) - - var/module_index = text2num(href_list["interact_module"]) - - if(module_index > 0 && module_index <= installed_modules.len) - var/obj/item/rig_module/module = installed_modules[module_index] - switch(href_list["module_mode"]) - if("activate") - module.activate() - if("deactivate") - module.deactivate() - if("engage") - module.engage() - if("select") - selected_module = module - if("select_charge_type") - module.charge_selected = href_list["charge_type"] - else if(href_list["toggle_ai_control"]) - ai_override_enabled = !ai_override_enabled - else if(href_list["toggle_suit_lock"]) - security_check_enabled = !security_check_enabled + if(module_index > 0 && module_index <= installed_modules.len) + var/obj/item/rig_module/module = installed_modules[module_index] + switch(href_list["module_mode"]) + if("activate") + module.activate() + if("deactivate") + module.deactivate() + if("engage") + module.engage() + if("select") + selected_module = module + if("select_charge_type") + module.charge_selected = href_list["charge_type"] + else if(href_list["toggle_ai_control"]) + ai_override_enabled = !ai_override_enabled + else if(href_list["toggle_suit_lock"]) + locked = !locked usr.set_machine(src) src.add_fingerprint(usr) diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm index 26a2621e2cd..1b54b8f1eee 100644 --- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm +++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm @@ -20,6 +20,7 @@ user << "It looks like the locking system has been shorted out." return else if(istype(W, /obj/item/weapon/card/emag)) + locked_dna = null req_access = null req_one_access = null locked = 0 diff --git a/code/modules/clothing/spacesuits/rig/rig_pieces.dm b/code/modules/clothing/spacesuits/rig/rig_pieces.dm index 0251a625eb8..5d8c8532ce0 100644 --- a/code/modules/clothing/spacesuits/rig/rig_pieces.dm +++ b/code/modules/clothing/spacesuits/rig/rig_pieces.dm @@ -21,12 +21,13 @@ species_restricted = null gender = PLURAL -/obj/item/clothing/shoes/rig +/obj/item/clothing/shoes/magboots/rig name = "boots" cold_protection = FEET heat_protection = FEET species_restricted = null gender = PLURAL + icon_base = null /obj/item/clothing/suit/space/rig name = "chestpiece" diff --git a/code/modules/clothing/spacesuits/rig/rig_verbs.dm b/code/modules/clothing/spacesuits/rig/rig_verbs.dm index 5347bbc5b94..9ec6f03df7b 100644 --- a/code/modules/clothing/spacesuits/rig/rig_verbs.dm +++ b/code/modules/clothing/spacesuits/rig/rig_verbs.dm @@ -27,8 +27,7 @@ usr << "The suit is not active." return - if((security_check_enabled && !src.allowed(wearer)) || control_overridden) - wearer << "Access denied." + if(!check_suit_access(usr)) return if(!visor) @@ -51,8 +50,7 @@ usr << "The hardsuit is not being worn." return - if((security_check_enabled && !src.allowed(wearer)) || control_overridden) - wearer << "Access denied." + if(!check_suit_access(usr)) return toggle_piece("helmet",wearer) @@ -64,8 +62,7 @@ set category = "Hardsuit" set src = usr.contents - if((security_check_enabled && !src.allowed(wearer)) || control_overridden) - wearer << "Access denied." + if(!check_suit_access(usr)) return toggle_piece("chest",wearer) @@ -81,8 +78,7 @@ usr << "The hardsuit is not being worn." return - if((security_check_enabled && !src.allowed(wearer)) || control_overridden) - wearer << "Access denied." + if(!check_suit_access(usr)) return toggle_piece("gauntlets",wearer) @@ -98,8 +94,7 @@ usr << "The hardsuit is not being worn." return - if((security_check_enabled && !src.allowed(wearer)) || control_overridden) - wearer << "Access denied." + if(!check_suit_access(usr)) return toggle_piece("boots",wearer) @@ -115,8 +110,7 @@ usr << "The hardsuit is not being worn." return - if((security_check_enabled && !src.allowed(wearer)) || control_overridden) - wearer << "Access denied." + if(!check_suit_access(usr)) return if(!check_power_cost(usr)) @@ -135,8 +129,7 @@ usr << "The hardsuit is not being worn." return - if((security_check_enabled && !src.allowed(wearer)) || control_overridden) - wearer << "Access denied." + if(!check_suit_access(usr)) return toggle_seals(wearer) diff --git a/code/modules/clothing/spacesuits/rig/suits/alien.dm b/code/modules/clothing/spacesuits/rig/suits/alien.dm index dc449f68fb5..5b35d6a139f 100644 --- a/code/modules/clothing/spacesuits/rig/suits/alien.dm +++ b/code/modules/clothing/spacesuits/rig/suits/alien.dm @@ -16,4 +16,4 @@ icon_state = "breacher_rig" armor = list(melee = 90, bullet = 90, laser = 90, energy = 90, bomb = 90, bio = 100, rad = 80) vision_restriction = 0 - offline_vision_restriction = 2 \ No newline at end of file + slowdown = 4 \ No newline at end of file diff --git a/code/modules/clothing/spacesuits/rig/suits/combat.dm b/code/modules/clothing/spacesuits/rig/suits/combat.dm index 0ed811e4b46..8774a0310e7 100644 --- a/code/modules/clothing/spacesuits/rig/suits/combat.dm +++ b/code/modules/clothing/spacesuits/rig/suits/combat.dm @@ -12,6 +12,7 @@ offline_vision_restriction = 1 helm_type = /obj/item/clothing/head/helmet/space/rig/combat + allowed = list(/obj/item/weapon/gun,/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/melee/baton) initial_modules = list( /obj/item/rig_module/mounted, @@ -28,6 +29,7 @@ desc = "A blood-red hardsuit featuring some fairly illegal technology." icon_state = "merc_rig" suit_type = "crimson hardsuit" + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword,/obj/item/weapon/handcuffs) initial_modules = list( /obj/item/rig_module/mounted, diff --git a/code/modules/clothing/spacesuits/rig/suits/ert.dm b/code/modules/clothing/spacesuits/rig/suits/ert.dm index 02e59490d62..499547918f6 100644 --- a/code/modules/clothing/spacesuits/rig/suits/ert.dm +++ b/code/modules/clothing/spacesuits/rig/suits/ert.dm @@ -36,8 +36,7 @@ /obj/item/rig_module/ai_container, /obj/item/rig_module/maneuvering_jets, /obj/item/rig_module/device/plasmacutter, - /obj/item/rig_module/device/rcd, - /obj/item/rig_module/foam_sprayer + /obj/item/rig_module/device/rcd ) /obj/item/weapon/rig/ert/medical diff --git a/code/modules/clothing/spacesuits/rig/suits/light.dm b/code/modules/clothing/spacesuits/rig/suits/light.dm index b94d1701e17..3568a4b64d9 100644 --- a/code/modules/clothing/spacesuits/rig/suits/light.dm +++ b/code/modules/clothing/spacesuits/rig/suits/light.dm @@ -13,7 +13,7 @@ chest_type = /obj/item/clothing/suit/space/rig/light helm_type = /obj/item/clothing/head/helmet/space/rig/light - boot_type = /obj/item/clothing/shoes/rig/light + boot_type = /obj/item/clothing/shoes/magboots/rig/light glove_type = /obj/item/clothing/gloves/rig/light /obj/item/clothing/suit/space/rig/light @@ -22,7 +22,7 @@ /obj/item/clothing/gloves/rig/light name = "gloves" -/obj/item/clothing/shoes/rig/light +/obj/item/clothing/shoes/magboots/rig/light name = "shoes" /obj/item/clothing/head/helmet/space/rig/light @@ -53,7 +53,6 @@ suit_type = "ominous" desc = "A unique, vaccum-proof suit of nano-enhanced armor designed specifically for Spider Clan assassins." icon_state = "ninja_rig" - allowed = list(/obj/item/weapon/gun,/obj/item/ammo_magazine,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/cell) armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30) slowdown = 0 diff --git a/code/modules/clothing/spacesuits/rig/suits/station.dm b/code/modules/clothing/spacesuits/rig/suits/station.dm index e524afbddf0..4a34ebd3092 100644 --- a/code/modules/clothing/spacesuits/rig/suits/station.dm +++ b/code/modules/clothing/spacesuits/rig/suits/station.dm @@ -8,6 +8,8 @@ offline_slowdown = 10 offline_vision_restriction = 2 + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/bag/ore,/obj/item/device/t_scanner,/obj/item/weapon/pickaxe, /obj/item/weapon/rcd) + req_access = null req_one_access = null @@ -31,6 +33,8 @@ offline_slowdown = 0 offline_vision_restriction = 0 + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/bag/ore,/obj/item/device/t_scanner,/obj/item/weapon/pickaxe, /obj/item/weapon/rcd) + req_access = list(access_ce) initial_modules = list( @@ -49,12 +53,15 @@ name = "AMI control module" suit_type = "hazmat" desc = "An Anomalous Material Interaction hardsuit that protects against the strangest energies the universe can throw at it." - icon_state = "science_rig" + icon_state = "medical_rig" //placeholder armor = list(melee = 15, bullet = 15, laser = 80, energy = 80, bomb = 60, bio = 100, rad = 100) slowdown = 1 offline_slowdown = 3 offline_vision_restriction = 1 + //Todo: add xenoarch gear. + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank,/obj/item/device/suit_cooling_unit,/obj/item/weapon/storage/firstaid,/obj/item/device/healthanalyzer,/obj/item/stack/medical) + req_access = list(access_rd) initial_modules = list( diff --git a/code/modules/clothing/spacesuits/void/void.dm b/code/modules/clothing/spacesuits/void/void.dm index 558b719bea6..5d0247283ea 100644 --- a/code/modules/clothing/spacesuits/void/void.dm +++ b/code/modules/clothing/spacesuits/void/void.dm @@ -49,4 +49,134 @@ //Breach thresholds, should ideally be inherited by most (if not all) voidsuits. breach_threshold = 18 - can_breach = 1 \ No newline at end of file + can_breach = 1 + + //Inbuilt devices. + var/obj/item/clothing/shoes/magboots/boots = null // Deployable boots, if any. + var/obj/item/clothing/head/helmet/helmet = null // Deployable helmet, if any. + +/obj/item/clothing/suit/space/void/equipped(mob/M) + ..() + + var/mob/living/carbon/human/H = M + + if(!istype(H)) return + + if(H.wear_suit != src) + return + + if(helmet) + if(H.head) + M << "You are unable to deploy your suit's helmet as \the [H.head] is in the way." + else + M << "Your suit's helmet deploys with a hiss." + //TODO: Species check, skull damage for forcing an unfitting helmet on? + helmet.loc = H + H.equip_to_slot(helmet, slot_head) + helmet.canremove = 0 + + if(boots) + if(H.shoes) + M << "You are unable to deploy your suit's magboots as \the [H.shoes] are in the way." + else + M << "Your suit's boots deploy with a hiss." + boots.loc = H + H.equip_to_slot(boots, slot_shoes) + boots.canremove = 0 + +/obj/item/clothing/suit/space/void/dropped() + ..() + + var/mob/living/carbon/human/H + + if(helmet) + H = helmet.loc + if(istype(H)) + if(helmet && H.head == helmet) + helmet.canremove = 1 + H.drop_from_inventory(helmet) + helmet.loc = src + + if(boots) + H = boots.loc + if(istype(H)) + if(boots && H.shoes == boots) + boots.canremove = 1 + H.drop_from_inventory(boots) + boots.loc = src + +/obj/item/clothing/suit/space/void/verb/toggle_helmet() + + set name = "Toggle Helmet" + set category = "Object" + set src in usr + + if(!istype(src.loc,/mob/living)) return + + if(!helmet) + usr << "There is no helmet installed." + return + + var/mob/living/carbon/human/H = usr + + if(!istype(H)) return + if(H.stat) return + if(H.wear_suit != src) return + + if(H.head == helmet) + H << "\blue You retract your suit helmet." + helmet.canremove = 1 + H.drop_from_inventory(helmet) + helmet.loc = src + else + if(H.head) + H << "You cannot deploy your helmet while wearing another helmet." + return + //TODO: Species check, skull damage for forcing an unfitting helmet on? + helmet.loc = H + helmet.pickup(H) + H.equip_to_slot(helmet, slot_head) + helmet.canremove = 0 + H << "You deploy your suit helmet, sealing you off from the world." + helmet.update_light(H) + +/obj/item/clothing/suit/space/void/attackby(obj/item/W as obj, mob/user as mob) + + if(!istype(user,/mob/living)) return + + if(istype(src.loc,/mob/living)) + user << "How do you propose to modify a hardsuit while it is being worn?" + return + + if(istype(W,/obj/item/weapon/screwdriver)) + if(helmet) + user << "You detatch \the [helmet] from \the [src]'s helmet mount." + helmet.loc = get_turf(src) + src.helmet = null + else if (boots) + user << "You detatch \the [helmet] from \the [src]'s helmet mount." + helmet.loc = get_turf(src) + src.helmet = null + else + user << "\The [src] does not have anything installed." + return + else if(istype(W,/obj/item/clothing/head/helmet/space)) + if(helmet) + user << "\The [src] already has a helmet installed." + else + user << "You attach \the [W] to \the [src]'s helmet mount." + user.drop_item() + W.loc = src + src.helmet = W + return + else if(istype(W,/obj/item/clothing/shoes/magboots)) + if(boots) + user << "\The [src] already has magboots installed." + else + user << "You attach \the [W] to \the [src]'s boot mounts." + user.drop_item() + W.loc = src + boots = W + return + + ..() \ No newline at end of file diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index bd3d93ae72f..fe6c3ea0315 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -295,7 +295,7 @@ proc/check_panel(mob/M) collapse() continue if(get_dist(src,my_target) > 1) - src.dir = get_dir(src,my_target) + src.set_dir(get_dir(src,my_target)) step_towards(src,my_target) updateimage() else diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm index 4ed2cd08673..7f9d331aace 100644 --- a/code/modules/mining/drilling/drill.dm +++ b/code/modules/mining/drilling/drill.dm @@ -388,5 +388,5 @@ usr << "It is anchored in place!" return 0 - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) return 1 \ No newline at end of file diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm index 2ef5725d707..eb596309156 100644 --- a/code/modules/mining/satchel_ore_boxdm.dm +++ b/code/modules/mining/satchel_ore_boxdm.dm @@ -40,7 +40,8 @@ user << "That's an [src]." user << desc - if(!istype(user, /mob/living/carbon/human)) //Only living, intelligent creatures with hands can check the contents of ore boxes. + // Borgs can now check contents too. + if((!istype(user, /mob/living/carbon/human)) && (!istype(user, /mob/living/silicon/robot))) return if(!Adjacent(user)) //Can only check the contents of ore boxes if you can physically reach them. diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 0f3c764878b..c5e1afbc4cb 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -182,7 +182,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/Move(NewLoc, direct) following = null - dir = direct + set_dir(direct) if(NewLoc) loc = NewLoc for(var/obj/effect/step_trigger/S in NewLoc) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index eb96d51512d..67197567440 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -130,9 +130,9 @@ hud_used.l_hand_hud_object.icon_state = "hand_inactive" hud_used.r_hand_hud_object.icon_state = "hand_active" /*if (!( src.hand )) - src.hands.dir = NORTH + src.hands.set_dir(NORTH) else - src.hands.dir = SOUTH*/ + src.hands.set_dir(SOUTH)*/ return /mob/living/carbon/proc/activate_hand(var/selhand) //0 or "r" or "right" for right hand; 1 or "l" or "left" for left hand. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index eca9bec9ce5..a3143e6b88f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -708,29 +708,6 @@ number += 2 return number -/mob/living/carbon/human/proc/magboot_stomp(mob/living/carbon/human/H as mob, datum/organ/external/affecting) - visible_message("\red [src] raises one of \his magboots over [H]'s [affecting.display_name]...") - attack_move = 1 - if(do_after(usr, 20)) - if(src.canmove && !src.lying && src.Adjacent(H) && H.lying) - visible_message("\red [src] stomps \his magboot down on [H]'s [affecting.display_name] with full force!") - apply_damage(rand(20,30), BRUTE, affecting, run_armor_check(affecting, "melee")) - playsound(loc, 'sound/weapons/genhit3.ogg', 25, 1, -1) - attack_move = 0 - - src.attack_log += text("\[[time_stamp()]\] Magboot-stomped [H.name] ([H.ckey])") - H.attack_log += text("\[[time_stamp()]\] Has been magboot-stomped by [src.name] ([src.ckey])") - msg_admin_attack("[key_name(src)] magboot-stomped [key_name(H)]") - return 1 - return 0 - -/mob/living/carbon/human/get_combat_buff(var/damage) - if(check_special_role("Ninja") || check_special_role("Changeling")) - damage += 3 // We assume Ninjas and Changelings are slightly better in combat than the usual human - if(HULK in mutations) - damage *= 2 // Hulks do twice the damage - return damage * damage_multiplier - /mob/living/carbon/human/IsAdvancedToolUser(var/silent) if(species.has_fine_manipulation) return 1 diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 1679430589a..90efe34a47d 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -100,115 +100,66 @@ attack = H.species.secondary_unarmed if(!attack.is_usable(H)) return 0 - if(attack_move) return 0 - var/damage = rand(1, 5) + var/damage = rand(1, attack.damage) var/block = 0 var/accurate = 0 - var/target_zone = check_zone(H.zone_sel.selecting) // The zone that was targeted - var/hit_zone = target_zone // The zone that is actually hit + var/hit_zone = H.zone_sel.selecting var/datum/organ/external/affecting = get_organ(hit_zone) - // Check for magboot attack - if(src.lying && H.canmove && !H.lying && H.shoes && istype(H.shoes, /obj/item/clothing/shoes/magboots)) - var/obj/item/clothing/shoes/magboots/mboots = H.shoes - if(mboots.magpulse) - return H.magboot_stomp(src, affecting) - switch(src.a_intent) if("help") // We didn't see this coming, so we get the full blow - damage = 5 + damage = attack.damage accurate = 1 if("hurt", "grab") // We're in a fighting stance, there's a chance we block - if(prob(20) && src.canmove && !(src==H)) + if(src.canmove && src!=H && prob(20)) block = 1 if (M.grabbed_by.len) // Someone got a good grip on them, they won't be able to do much damage - damage = max(0, damage - 2) + damage = max(1, damage - 2) if(src.grabbed_by.len || src.buckled || !src.canmove || src==H) accurate = 1 // certain circumstances make it impossible for us to evade punches // Process evasion and blocking + var/miss_type = 0 + var/attack_message if(!accurate) if(prob(80)) - hit_zone = ran_zone(target_zone) + hit_zone = ran_zone(hit_zone) if(prob(15) && hit_zone != "chest") // Missed! - playsound(loc, attack.miss_sound, 25, 1, -1) - var/atk_verb = pick(attack.attack_verb) - visible_message("\red [H] attempted to [atk_verb] [src]!") - visible_message("\red [pick("The [pick(attack.attack_noun)] barely missed their [affecting.display_name]!", "[src] managed to dodge the [pick(attack.attack_noun)] narrowly!")]") + attack_message = "[H] attempted to [pick(attack.attack_verb)] [src], but the [attack.attack_noun] missed!" + miss_type = 1 - H.attack_log += text("\[[time_stamp()]\] attempted to [atk_verb] [src.name] ([src.ckey]) (dodged)") - src.attack_log += text("\[[time_stamp()]\] Dodged attack by [H.name] ([H.ckey])") - msg_admin_attack("[key_name(H)] attempted to [pick(attack.attack_verb)] [key_name(src)] (dodged)") - return 0 - if(block) - playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - visible_message("\red [H] went for [src]'s [affecting.display_name] but was blocked!") + if(!miss_type && block) + attack_message = "[H] went for [src]'s [affecting.display_name] but was blocked!" + miss_type = 2 - H.attack_log += text("\[[time_stamp()]\] attempted to [pick(attack.attack_verb)] [src.name] ([src.ckey]) (blocked)") - src.attack_log += text("\[[time_stamp()]\] Blocked attack by [H.name] ([H.ckey])") - msg_admin_attack("[key_name(H)] attempted to [pick(attack.attack_verb)] [key_name(src)] (blocked)") + if(!attack_message) + attack.show_attack(H, src, hit_zone, damage) + else + H.visible_message("[attack_message]") + + playsound(loc, ((miss_type) ? (miss_type == 1 ? attack.miss_sound : 'sound/weapons/thudswoosh.ogg') : attack.attack_sound), 25, 1, -1) + H.attack_log += text("\[[time_stamp()]\] [miss_type ? (miss_type == 1 ? "Missed" : "Blocked") : "[pick(attack.attack_verb)]ed"] [src.name] ([src.ckey])") + src.attack_log += text("\[[time_stamp()]\] [miss_type ? (miss_type == 1 ? "Was missed by" : "Has blocked") : "Has Been [pick(attack.attack_verb)]ed"] by [H.name] ([H.ckey])") + msg_admin_attack("[key_name(H)] [miss_type ? (miss_type == 1 ? "has missed" : "was blocked by") : "has [pick(attack.attack_verb)]ed"] [key_name(src)]") + + if(miss_type) return 0 - // Handle the attack logs - attack.combat_log(H, src, hit_zone, damage) + if(HULK in H.mutations) + damage *= 2 // Hulks do twice the damage) - H.attack_log += text("\[[time_stamp()]\] [pick(attack.attack_verb)]ed [src.name] ([src.ckey])") - src.attack_log += text("\[[time_stamp()]\] Has been [pick(attack.attack_verb)]ed by [H.name] ([H.ckey])") - msg_admin_attack("[key_name(H)] [pick(attack.attack_verb)]ed [key_name(src)]") - - // Apply possible buffs - damage = H.get_combat_buff(damage) - - var/armor_block = run_armor_check(affecting, "melee") // IMPORTANT: To run armor check after attack log as it produces a log itself - var/numb = rand(0, 100) - if(damage >= 5 && armor_block < 2 && !(src == H) && numb <= damage*5) // 25% standard chance - switch(hit_zone) // strong punches can have effects depending on where they hit - if("head") - // Induce blurriness - visible_message("\red [src] stares blankly for a few moments.", "\red You see stars.") - apply_effect(damage*2, EYE_BLUR, armor_block) - if("l_arm", "l_hand") - if (l_hand) - // Disarm left hand - visible_message("\red [src] [pick("dropped", "let go off")] \the [l_hand][pick("", " with a scream")]!") - drop_l_hand() - if("r_arm", "r_hand") - if (r_hand) - // Disarm right hand - visible_message("\red [src] [pick("dropped", "let go off")] \the [r_hand][pick("", " with a scream")]!") - drop_r_hand() - if("chest") - if(!src.lying) - visible_message("\red [pick("[src] was sent flying backward a few metres!", "[src] staggers back from the impact!")]") - step(src, get_dir(get_turf(M), get_turf(src))) - apply_effect(0.4*damage, WEAKEN, armor_block) - if("groin") - visible_message("\red [src] looks like \he is in pain!", (gender=="female")?"\red Oh god that hurt!":"\red Oh no, not your[pick("testicles", "crown jewels", "clockweights", "family jewels", "marbles", "bean bags", "teabags", "sweetmeats", "goolies")]!") - apply_effects(stutter=damage*2, agony=damage*3, blocked=armor_block) - if("l_leg", "l_foot", "r_leg", "r_foot") - if(!src.lying) - visible_message("\red [src] gives way slightly.") - apply_effect(damage*3, AGONY, armor_block) - else if(damage >= 5 && !(src == H) && numb+damage*5 >= 100 && armor_block < 2) // Chance to get the usual throwdown as well (25% standard chance) - if(!src.lying) - visible_message("\red [src] [pick("slumps", "falls", "drops")] down to the ground!") - else - visible_message("\red [src] has been weakened!") - apply_effect(3, WEAKEN, armor_block) - - // Sum up species damage bonus at the very end so xenos don't get buffed stun chances - damage += attack.damage // 3 for human/skrell, 5 for tajaran/unathi - - playsound(H.loc, attack.attack_sound, 25, 1, -1) + var/armour = run_armor_check(affecting, "melee") + // Apply additional unarmed effects. + attack.apply_effects(H,src,armour,damage,hit_zone) // Finally, apply damage to target - apply_damage(damage, BRUTE, affecting, armor_block, sharp=attack.sharp, edge=attack.edge) + apply_damage(damage, BRUTE, affecting, armour, sharp=attack.sharp, edge=attack.edge) if("disarm") M.attack_log += text("\[[time_stamp()]\] Disarmed [src.name] ([src.ckey])") diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 72b7d1f1db7..b9cde0c192b 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -82,5 +82,3 @@ var/hand_blood_color var/list/flavor_texts = list() - - var/attack_move = 0 //Used in combat to check if user is performing an attack over several ticks \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 943cd6472da..058619cbc7e 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1245,7 +1245,7 @@ if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe client.images.Remove(hud) - client.screen.Remove(global_huds) + client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask, global_hud.nvg, global_hud.thermal, global_hud.meson) update_action_buttons() @@ -1484,20 +1484,23 @@ if(eye_blurry) client.screen += global_hud.blurry if(druggy) client.screen += global_hud.druggy - var/masked = 0 - - if(!masked && istype(glasses, /obj/item/clothing/glasses/welding)) - var/obj/item/clothing/glasses/welding/O = glasses - if(!O.up && tinted_weldhelh) + if(tinted_weldhelh) + var/found_welder + if(istype(glasses, /obj/item/clothing/glasses/welding)) + var/obj/item/clothing/glasses/welding/O = glasses + if(!O.up) + found_welder = 1 + else if(istype(head, /obj/item/clothing/head/welding)) + var/obj/item/clothing/head/welding/O = head + if(!O.up) + found_welder = 1 + else if(istype(back, /obj/item/weapon/rig)) + var/obj/item/weapon/rig/O = back + if(O.helmet && O.helmet == head && (O.helmet.body_parts_covered & EYES)) + if((O.offline && O.offline_vision_restriction == 1) || (!O.offline && O.vision_restriction == 1)) + found_welder = 1 + if(found_welder) client.screen |= global_hud.darkMask - masked = 1 - - if(!masked && istype(back, /obj/item/weapon/rig)) - var/obj/item/weapon/rig/O = back - // Ugh, why is this done on a case by case basis? Why is there no flag for causing weldervision? - if(O.helmet && O.helmet == head && (O.helmet.body_parts_covered & EYES)) - if((O.offline && O.offline_vision_restriction == 1) || (!O.offline && O.vision_restriction == 1)) - client.screen |= global_hud.darkMask if(machine) if(!machine.check_eye(src)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 50ae104da5f..c15ef31be70 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -493,154 +493,6 @@ return 0 -//Species unarmed attacks -/datum/unarmed_attack - var/attack_verb = list("attack") // Empty hand hurt intent verb. - var/attack_noun = list("fist") - var/damage = 0 // Extra empty hand attack damage. - var/attack_sound = "punch" - var/miss_sound = 'sound/weapons/punchmiss.ogg' - var/shredding = 0 // Calls the old attack_alien() behavior on objects/mobs when on harm intent. - var/sharp = 0 - var/edge = 0 - -/datum/unarmed_attack/proc/is_usable(var/mob/living/carbon/human/user) - if(user.restrained()) - return 0 - - // Check if they have a functioning hand. - var/datum/organ/external/E = user.organs_by_name["l_hand"] - if(E && !(E.status & ORGAN_DESTROYED)) - return 1 - - E = user.organs_by_name["r_hand"] - if(E && !(E.status & ORGAN_DESTROYED)) - return 1 - - return 0 - -/datum/unarmed_attack/proc/combat_log(mob/living/carbon/human/M as mob, mob/living/carbon/human/T as mob, zone, damage) - var/datum/organ/external/affecting = T.get_organ(zone) - M.visible_message("[M] [pick(attack_verb)] [T] in the [affecting.display_name]!") - playsound(M.loc, attack_sound, 25, 1, -1) - -/datum/unarmed_attack/bite - attack_verb = list("bite") // 'x has biteed y', needs work. - attack_sound = 'sound/weapons/bite.ogg' - shredding = 0 - damage = 3 - sharp = 0 - edge = 0 - -/datum/unarmed_attack/bite/eye_tooth - attack_verb = list("bite") // 'x has biteed y', needs work. - attack_sound = 'sound/weapons/bite.ogg' - shredding = 0 - damage = 5 - sharp = 1 - edge = 1 - -/datum/unarmed_attack/bite/is_usable(var/mob/living/carbon/human/user) - if (user.wear_mask && istype(user.wear_mask, /obj/item/clothing/mask/muzzle)) - return 0 - return 1 - -/datum/unarmed_attack/punch - attack_verb = list("punch") - attack_noun = list("fist") - damage = 3 - -/datum/unarmed_attack/punch/combat_log(mob/living/carbon/human/M as mob, mob/living/carbon/human/T as mob, zone, damage) - var/skill = M.skills["combat"] - var/datum/organ/external/affecting = T.get_organ(zone) - var/organ = affecting.display_name - - if(!skill) skill = 1 - damage = Clamp(damage, 1, 5) - - if(T == M) - M.visible_message("\red [M] [pick(attack_verb)]ed \himself in the [organ]!") - return 0 - if(!T.lying) - switch(zone) - if("head") - // ----- HEAD ----- // - switch(damage) - if(1 to 2) M.visible_message("\red [M] slapped [T] across \his cheek!") - if(3 to 4) M.visible_message("\red [M] struck [T] in the head[pick("", " with a closed fist")]!") - if(5) M.visible_message("\red [M] gave [T] a resounding slap to the face!") - if("chest", "l_arm", "r_arm", "l_hand", "r_hand") - // -- UPPER BODY -- // - switch(damage) - if(1 to 2) M.visible_message("\red [M] slapped [T]'s [organ]!") - if(3 to 4) M.visible_message("\red [M] [findtext(zone, "hand")?"[pick(attack_verb)]ed":pick("[pick(attack_verb)]ed", "shoulders")] [T] in \his [organ]!") - if(5) M.visible_message("\red [M] rammed \his [pick(attack_noun)] into [T]'s [organ]!") - if("groin", "l_leg", "r_leg") - // -- LOWER BODY -- // - switch(damage) - if(1 to 2) M.visible_message("\red [M] gave [T] a light kick to the [organ]!") - if(3 to 4) M.visible_message("\red [M] [pick("kicked", "kneed")] [T] in \his [organ]!") - if(5) M.visible_message("\red [M] landed a strong kick against [T]'s [organ]!") - if("l_foot", "r_foot") - // ----- FEET ----- // - switch(damage) - if(1 to 4) M.visible_message("\red [M] kicked [T] in \his [organ]!") - if(5) M.visible_message("\red [M] stomped down hard on [T]'s [organ]!") - else if (M.loc != T.loc) - M.visible_message("\red [M] [pick("stomped down hard on", "kicked against", "gave a strong kick against", "rams their foot into")] [T]'s [organ]!") - else - M.visible_message("\red [M] [pick("punches", "throws a punch", "strikes", "slaps", "rams their [pick(attack_noun)] into")] [T]'s [organ]!") - - -/datum/unarmed_attack/diona - attack_verb = list("lash", "bludgeon") - attack_noun = list("tendril") - damage = 5 - -/datum/unarmed_attack/claws - attack_verb = list("scratch", "claw", "goug") - attack_noun = list("claws") - attack_sound = 'sound/weapons/slice.ogg' - miss_sound = 'sound/weapons/slashmiss.ogg' - damage = 5 - sharp = 1 - edge = 1 - -/datum/unarmed_attack/claws/combat_log(mob/living/carbon/human/M as mob, mob/living/carbon/human/T as mob, zone, damage) - var/skill = M.skills["combat"] - var/datum/organ/external/affecting = T.get_organ(zone) - var/organ = affecting.display_name - - if(!skill) skill = 1 - damage = Clamp(damage, 1, 5) - - if(T == M) - M.visible_message("\red [M] [pick(attack_verb)]ed \himself in the [organ]!") - return 0 - - switch(zone) - if("head") - // ----- HEAD ----- // - switch(damage) - if(1 to 2) M.visible_message("\red [M] scratched [T] across \his cheek!") - if(3 to 4) M.visible_message("\red [M] [pick(attack_verb)]ed [pick("", "the side of")][T] [pick("head", "neck")][pick("", " with spread [pick(attack_noun)]")]!") - if(5) M.visible_message("\red [M] [pick(attack_verb)]ed [T] across \his face!") - if("chest", "l_arm", "r_arm", "l_hand", "r_hand", "groin", "l_leg", "r_leg", "l_foot", "r_foot") - // ----- BODY ----- // - switch(damage) - if(1 to 2) M.visible_message("\red [M] scratched [T]'s [organ]!") - if(3 to 4) M.visible_message("\red [M] [pick(attack_verb)]ed [pick("", "the side of")][T]'s [organ]!") - if(5) M.visible_message("\red [M] digs \his [pick(attack_noun)] deep into [T]'s [organ]!") - -/datum/unarmed_attack/claws/strong - attack_verb = list("slash") - damage = 10 - shredding = 1 - -/datum/unarmed_attack/bite/strong - attack_verb = list("maul") - damage = 15 - shredding = 1 /datum/hud_data var/icon // If set, overrides ui_style. diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm new file mode 100644 index 00000000000..7e17ea5ed75 --- /dev/null +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -0,0 +1,193 @@ +//Species unarmed attacks +/datum/unarmed_attack + var/attack_verb = list("attack") // Empty hand hurt intent verb. + var/attack_noun = list("fist") + var/damage = 0 // Extra empty hand attack damage. + var/attack_sound = "punch" + var/miss_sound = 'sound/weapons/punchmiss.ogg' + var/shredding = 0 // Calls the old attack_alien() behavior on objects/mobs when on harm intent. + var/sharp = 0 + var/edge = 0 + +/datum/unarmed_attack/proc/is_usable(var/mob/living/carbon/human/user) + if(user.restrained()) + return 0 + + // Check if they have a functioning hand. + var/datum/organ/external/E = user.organs_by_name["l_hand"] + if(E && !(E.status & ORGAN_DESTROYED)) + return 1 + + E = user.organs_by_name["r_hand"] + if(E && !(E.status & ORGAN_DESTROYED)) + return 1 + + return 0 + +/datum/unarmed_attack/proc/apply_effects(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/armour,var/attack_damage,var/zone) + + var/stun_chance = rand(0, 100) + + // Reduce effective damage to normalize stun chance across species. + attack_damage = min(1,attack_damage - damage) + + if(attack_damage >= 5 && armour < 2 && !(target == user) && stun_chance <= attack_damage * 5) // 25% standard chance + switch(zone) // strong punches can have effects depending on where they hit + if("head", "mouth", "eyes") + // Induce blurriness + target.visible_message("[target] stares blankly for a few moments.", "You see stars.") + target.apply_effect(attack_damage*2, EYE_BLUR, armour) + if("l_arm", "l_hand") + if (target.l_hand) + // Disarm left hand + target.visible_message("[src] [pick("dropped", "let go off")] \the [target.l_hand][pick("", " with a scream")]!") + target.drop_l_hand() + if("r_arm", "r_hand") + if (target.r_hand) + // Disarm right hand + target.visible_message("[src] [pick("dropped", "let go off")] \the [target.r_hand][pick("", " with a scream")]!") + target.drop_r_hand() + if("chest") + if(!target.lying) + target.visible_message("[pick("[target] was sent flying backward a few metres!", "[target] staggers back from the impact!")]") + var/turf/T = step(src, get_dir(get_turf(user), get_turf(target))) + if(T.density) // This will need to be expanded to check for structures etc. + target.visible_message("[target] slams into [T]!") + else + target.loc = T + target.apply_effect(attack_damage * 0.4, WEAKEN, armour) + if("groin") + target.visible_message("[target] looks like \he is in pain!", "[(target.gender=="female") ? "Oh god that hurt!" : "Oh no, not your[pick("testicles", "crown jewels", "clockweights", "family jewels", "marbles", "bean bags", "teabags", "sweetmeats", "goolies")]!"]") + target.apply_effects(stutter = attack_damage * 2, agony = attack_damage* 3, blocked = armour) + if("l_leg", "l_foot", "r_leg", "r_foot") + if(!target.lying) + target.visible_message("[src] gives way slightly.") + target.apply_effect(attack_damage*3, AGONY, armour) + else if(attack_damage >= 5 && !(target == user) && (stun_chance + attack_damage) * 5 >= 100 && armour < 2) // Chance to get the usual throwdown as well (25% standard chance) + if(!target.lying) + target.visible_message("[pick("slumps", "falls", "drops")] down to the ground!") + else + target.visible_message("[target] has been weakened!") + target.apply_effect(3, WEAKEN, armour) + +/datum/unarmed_attack/proc/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) + var/datum/organ/external/affecting = target.get_organ(zone) + user.visible_message("[user] [pick(attack_verb)] [target] in the [affecting.display_name]!") + playsound(user.loc, attack_sound, 25, 1, -1) + +/datum/unarmed_attack/bite + attack_verb = list("bite") // 'x has biteed y', needs work. + attack_sound = 'sound/weapons/bite.ogg' + shredding = 0 + damage = 3 + sharp = 0 + edge = 0 + +/datum/unarmed_attack/bite/eye_tooth + attack_verb = list("bite") // 'x has biteed y', needs work. + attack_sound = 'sound/weapons/bite.ogg' + shredding = 0 + damage = 5 + sharp = 1 + edge = 1 + +/datum/unarmed_attack/bite/is_usable(var/mob/living/carbon/human/user) + if (user.wear_mask && istype(user.wear_mask, /obj/item/clothing/mask/muzzle)) + return 0 + return 1 + +/datum/unarmed_attack/punch + attack_verb = list("punch") + attack_noun = list("fist") + damage = 3 + +/datum/unarmed_attack/punch/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) + var/skill = user.skills["combat"] + var/datum/organ/external/affecting = target.get_organ(zone) + var/organ = affecting.display_name + + if(!skill) skill = 1 + + if(target == user) + user.visible_message("[user] [pick(attack_verb)]ed \himself in the [organ]!") + return 0 + + if(!target.lying) + switch(zone) + if("head", "mouth", "eyes") + // ----- HEAD ----- // + switch(attack_damage) + if(1 to 2) user.visible_message("[user] slapped [target] across \his cheek!") + if(3 to 4) user.visible_message("[user] struck [target] in the head[pick("", " with a closed fist")]!") + if(5) user.visible_message("[user] gave [target] a resounding slap to the face!") + if("chest", "l_arm", "r_arm", "l_hand", "r_hand") + // -- UPPER BODY -- // + switch(attack_damage) + if(1 to 2) user.visible_message("[user] slapped [target]'s [organ]!") + if(3 to 4) user.visible_message("[user] [findtext(zone, "hand")?"[pick(attack_verb)]ed":pick("[pick(attack_verb)]ed", "shoulders")] [target] in \his [organ]!") + if(5) user.visible_message("[user] rammed \his [pick(attack_noun)] into [target]'s [organ]!") + if("groin", "l_leg", "r_leg") + // -- LOWER BODY -- // + switch(attack_damage) + if(1 to 2) user.visible_message("[user] gave [target] a light kick to the [organ]!") + if(3 to 4) user.visible_message("[user] [pick("kicked", "kneed")] [target] in \his [organ]!") + if(5) user.visible_message("[user] landed a strong kick against [target]'s [organ]!") + if("l_foot", "r_foot") + // ----- FEET ----- // + switch(attack_damage) + if(1 to 4) user.visible_message("[user] kicked [target] in \his [organ]!") + if(5) user.visible_message("[user] stomped down hard on [target]'s [organ]!") + else if (user.loc != target.loc) + user.visible_message("[user] [pick("stomped down hard on", "kicked against", "gave a strong kick against", "rams their foot into")] [target]'s [organ]!") + else + user.visible_message("[user] [pick("punched", "threw a punch", "struck", "slapped", "rammed their [pick(attack_noun)] into")] [target]'s [organ]!") + + +/datum/unarmed_attack/diona + attack_verb = list("lash", "bludgeon") + attack_noun = list("tendril") + damage = 5 + +/datum/unarmed_attack/claws + attack_verb = list("scratch", "claw", "goug") + attack_noun = list("claws") + attack_sound = 'sound/weapons/slice.ogg' + miss_sound = 'sound/weapons/slashmiss.ogg' + damage = 5 + sharp = 1 + edge = 1 + +/datum/unarmed_attack/claws/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) + var/skill = user.skills["combat"] + var/datum/organ/external/affecting = target.get_organ(zone) + + if(!skill) skill = 1 + attack_damage = Clamp(attack_damage, 1, 5) + + if(target == user) + user.visible_message("[user] [pick(attack_verb)]ed \himself in the [affecting.display_name]!") + return 0 + + switch(zone) + if("head", "mouth", "eyes") + // ----- HEAD ----- // + switch(damage) + if(1 to 2) user.visible_message("[user] scratched [target] across \his cheek!") + if(3 to 4) user.visible_message("[user] [pick(attack_verb)]ed [pick("", "the side of")][target] [pick("head", "neck")][pick("", " with spread [pick(attack_noun)]")]!") + if(5) user.visible_message("[user] [pick(attack_verb)]ed [target] across \his face!") + if("chest", "l_arm", "r_arm", "l_hand", "r_hand", "groin", "l_leg", "r_leg", "l_foot", "r_foot") + // ----- BODY ----- // + switch(damage) + if(1 to 2) user.visible_message("[user] scratched [target]'s [affecting.display_name]!") + if(3 to 4) user.visible_message("[user] [pick(attack_verb)]ed [pick("", "the side of")][target]'s [affecting.display_name]!") + if(5) user.visible_message("[user] digs \his [pick(attack_noun)] deep into [target]'s [affecting.display_name]!") + +/datum/unarmed_attack/claws/strong + attack_verb = list("slash") + damage = 10 + shredding = 1 + +/datum/unarmed_attack/bite/strong + attack_verb = list("maul") + damage = 15 + shredding = 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/monkey/npc.dm b/code/modules/mob/living/carbon/monkey/npc.dm index f863558605a..a7d4bfc7aef 100644 --- a/code/modules/mob/living/carbon/monkey/npc.dm +++ b/code/modules/mob/living/carbon/monkey/npc.dm @@ -53,7 +53,7 @@ mob/living/carbon/monkey/proc/npc_act() hiding_behind = null hid_behind = 0 - if(loc == prevloc) dir = get_dir(src, npc_fleeing) + if(loc == prevloc) set_dir(get_dir(src, npc_fleeing)) else if(prob(33) && canmove && isturf(loc)) step(src, pick(cardinal)) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 16d42b07dec..e6738936c9c 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -72,6 +72,7 @@ var/list/ai_verbs_default = list( var/mob/living/silicon/ai/parent = null + var/apc_override = 0 //hack for letting the AI use its APC even when visionless var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through. var/datum/trackable/track = null var/last_announcement = "" @@ -229,7 +230,7 @@ var/list/ai_verbs_default = list( */ /obj/machinery/ai_powersupply name="Power Supply" - active_power_usage=1000 + active_power_usage=50000 // Station AIs use significant amounts of power. This, when combined with charged SMES should mean AI lasts for 1hr without external power. use_power = 2 power_channel = EQUIP var/mob/living/silicon/ai/powered_ai = null diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 5047f87d0d3..cf11f2d2118 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -166,7 +166,9 @@ src << "Receiving control information from APC." sleep(2) //bring up APC dialog + apc_override = 1 theAPC.attack_ai(src) + apc_override = 0 src:aiRestorePowerRoutine = 3 src << "Here are your current laws:" src.show_laws() diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index aa033cde55a..0a382de88dc 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -26,8 +26,14 @@ /obj/item/weapon/smes_coil ) - //Item currently being held. - var/obj/item/wrapped = null + var/obj/item/wrapped = null // Item currently being held. + +// VEEEEERY limited version for mining borgs. Basically only for swapping cells and upgrading the drills. +/obj/item/weapon/gripper/miner + can_hold = list( + /obj/item/weapon/cell, + /obj/item/weapon/stock_parts + ) /obj/item/weapon/gripper/paperwork name = "paperwork gripper" @@ -44,7 +50,8 @@ /obj/item/weapon/gripper/attack_self(mob/user as mob) if(wrapped) - wrapped.attack_self(user) + return wrapped.attack_self(user) + return ..() /obj/item/weapon/gripper/verb/drop_item() @@ -68,12 +75,9 @@ //update_icon() /obj/item/weapon/gripper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) - return + return (wrapped ? wrapped.attack(M,user) : 0) -/obj/item/weapon/gripper/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity, params) - - if(!target || !proximity) //Target is invalid or we are not adjacent. - return +/obj/item/weapon/gripper/afterattack(var/atom/target, var/mob/living/user, proximity, params) //There's some weirdness with items being lost inside the arm. Trying to fix all cases. ~Z if(!wrapped) @@ -82,13 +86,10 @@ break if(wrapped) //Already have an item. - //Temporary put wrapped into user so target's attackby() checks pass. wrapped.loc = user - //Pass the attack on to the target. This might delete/relocate wrapped. - target.attackby(wrapped,user) - + wrapped.afterattack(target,user) //If wrapped was neither deleted nor put into target, put it back into the gripper. if(wrapped && user && (wrapped.loc == user)) wrapped.loc = src @@ -255,6 +256,8 @@ stored_comms["wood"]++ stored_comms["wood"]++ stored_comms["wood"]++ + else if(istype(W,/obj/item/pipe)) + // This allows drones and engiborgs to clear pipe assemblies from floors. else continue diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index f5ce4f21496..ad06e19ec1c 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -249,7 +249,7 @@ var/list/robot_verbs_default = list( module_sprites["Basic"] = "Miner_old" module_sprites["Advanced Droid"] = "droid-miner" module_sprites["Treadhead"] = "Miner" - module_sprites["Drone"] = "drone-medical" + module_sprites["Drone"] = "drone-miner" if("Crisis") module = new /obj/item/weapon/robot_module/crisis(src) @@ -260,6 +260,7 @@ var/list/robot_verbs_default = list( module_sprites["Standard"] = "surgeon" module_sprites["Advanced Droid"] = "droid-medical" module_sprites["Needles"] = "medicalrobot" + module_sprites["Drone" ] = "drone-medical" if("Surgeon") module = new /obj/item/weapon/robot_module/surgeon(src) @@ -271,7 +272,7 @@ var/list/robot_verbs_default = list( module_sprites["Standard"] = "surgeon" module_sprites["Advanced Droid"] = "droid-medical" module_sprites["Needles"] = "medicalrobot" - module_sprites["Drone"] = "drone-medical" + module_sprites["Drone"] = "drone-surgery" if("Security") module = new /obj/item/weapon/robot_module/security(src) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 57cf8b1c620..9dddac9cca8 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -181,6 +181,7 @@ src.modules += new /obj/item/weapon/wrench(src) src.modules += new /obj/item/weapon/crowbar(src) src.modules += new /obj/item/weapon/pickaxe/plasmacutter(src) + src.modules += new /obj/item/device/pipe_painter(src) /obj/item/weapon/robot_module/engineering name = "engineering robot module" @@ -189,7 +190,7 @@ /obj/item/stack/sheet/metal = 50, /obj/item/stack/sheet/glass = 50, /obj/item/stack/sheet/glass/reinforced = 50, - /obj/item/stack/cable_coil = 50, + /obj/item/stack/cable_coil/robot = 50, /obj/item/stack/rods = 15, /obj/item/stack/tile/plasteel = 15 ) @@ -210,6 +211,7 @@ src.modules += new /obj/item/taperoll/engineering(src) src.modules += new /obj/item/weapon/gripper(src) src.modules += new /obj/item/weapon/matter_decompiler(src) + src.modules += new /obj/item/device/pipe_painter(src) src.emag = new /obj/item/borg/stun(src) @@ -225,7 +227,7 @@ G.amount = 50 src.modules += G - var/obj/item/stack/cable_coil/W = new /obj/item/stack/cable_coil(src) + var/obj/item/stack/cable_coil/robot/W = new /obj/item/stack/cable_coil/robot(src) W.amount = 50 src.modules += W @@ -365,6 +367,9 @@ src.modules += new /obj/item/weapon/storage/bag/ore(src) src.modules += new /obj/item/weapon/pickaxe/borgdrill(src) src.modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src) + src.modules += new /obj/item/weapon/gripper/miner(src) + src.modules += new /obj/item/weapon/mining_scanner(src) + src.modules += new /obj/item/weapon/crowbar(src) src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src) return @@ -406,7 +411,7 @@ /obj/item/stack/tile/plasteel = 15, /obj/item/stack/sheet/metal = 20, /obj/item/stack/sheet/glass = 20, - /obj/item/stack/cable_coil = 30 + /obj/item/stack/cable_coil/robot = 30 ) New() diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index 2b632c70f57..162038dd070 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -297,15 +297,15 @@ if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds if (movement_target.loc.x < src.x) - dir = WEST + set_dir(WEST) else if (movement_target.loc.x > src.x) - dir = EAST + set_dir(EAST) else if (movement_target.loc.y < src.y) - dir = SOUTH + set_dir(SOUTH) else if (movement_target.loc.y > src.y) - dir = NORTH + set_dir(NORTH) else - dir = SOUTH + set_dir(SOUTH) if(isturf(movement_target.loc) ) UnarmedAttack(movement_target) @@ -316,7 +316,7 @@ visible_emote(pick("dances around","chases their tail")) spawn(0) for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2,1,2,4,8,4,2)) - dir = i + set_dir(i) sleep(1) /obj/item/weapon/reagent_containers/food/snacks/meat/corgi @@ -369,7 +369,7 @@ M.show_message("\blue [user] baps [name] on the nose with the rolled up [O]") spawn(0) for(var/i in list(1,2,4,8,4,2,1,2)) - dir = i + set_dir(i) sleep(1) else ..() @@ -471,5 +471,5 @@ visible_emote(pick("dances around","chases her tail")) spawn(0) for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2,1,2,4,8,4,2)) - dir = i + set_dir(i) sleep(1) diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm index fa3e8c23853..5bc3d41afc6 100644 --- a/code/modules/mob/living/simple_animal/hostile/bear.dm +++ b/code/modules/mob/living/simple_animal/hostile/bear.dm @@ -74,7 +74,7 @@ stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again. stance_step++ found_mob = 1 - src.dir = get_dir(src,target_mob) //Keep staring at the mob + src.set_dir(get_dir(src,target_mob)) //Keep staring at the mob if(stance_step in list(1,4,7)) //every 3 ticks var/action = pick( list( "growls at [target_mob]", "stares angrily at [target_mob]", "prepares to attack [target_mob]", "closely watches [target_mob]" ) ) diff --git a/code/modules/mob/living/simple_animal/worm.dm b/code/modules/mob/living/simple_animal/worm.dm index 6dad3655e31..0df4f5c7c42 100644 --- a/code/modules/mob/living/simple_animal/worm.dm +++ b/code/modules/mob/living/simple_animal/worm.dm @@ -75,7 +75,7 @@ if(stat == CONSCIOUS || stat == UNCONSCIOUS) icon_state = "spacewormhead[previous?1:0]" if(previous) - dir = get_dir(previous,src) + set_dir(get_dir(previous,src)) else icon_state = "spacewormheaddead" @@ -129,7 +129,7 @@ icon_state = "spaceworm[get_dir(src,previous) | get_dir(src,next)]" //see 3 lines below else //tail icon_state = "spacewormtail" - dir = get_dir(src,next) //next will always be present since it's not a head and if it's dead, it goes in the other if branch + set_dir(get_dir(src,next)) //next will always be present since it's not a head and if it's dead, it goes in the other if branch else icon_state = "spacewormdead" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 7e0c47fe4a7..6bf10756d0f 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -652,9 +652,6 @@ var/list/slot_equipment_priority = list( \ var/mob/pulled = AM pulled.inertia_dir = 0 -/mob/proc/get_combat_buff(var/damage) - return damage - /mob/proc/can_use_hands() return @@ -908,10 +905,9 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/facedir(var/ndir) if(!canface()) return 0 - dir = ndir + set_dir(ndir) if(buckled && buckled.movable) - buckled.dir = ndir - buckled.handle_rotation() + buckled.set_dir(ndir) client.move_delay += movement_delay() return 1 diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index f999b26ec02..da6d01de79b 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -110,8 +110,8 @@ */ return - -/atom/movable/Move(NewLoc, direct) +//This proc should never be overridden elsewhere at /atom/movable to keep directions sane. +/atom/movable/Move(newloc, direct) if (direct & (direct - 1)) if (direct & 1) if (direct & 4) @@ -143,9 +143,20 @@ if (step(src, WEST)) step(src, SOUTH) else - . = ..() - return + var/atom/A = src.loc + var/olddir = dir //we can't override this without sacrificing the rest of movable/New() + . = ..() + if(direct != olddir) + dir = olddir + set_dir(direct) + + src.move_speed = world.time - src.l_move_time + src.l_move_time = world.time + src.m_flag = 1 + if ((A != src.loc && A && A.z == src.z)) + src.last_move = get_dir(A, src.loc) + return /client/proc/Move_object(direct) if(mob && mob.control_object) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 48d0140d906..00c6f9d05ee 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -334,7 +334,7 @@ // Moving wheelchair if they have one if(character.buckled && istype(character.buckled, /obj/structure/stool/bed/chair/wheelchair)) character.buckled.loc = character.loc - character.buckled.dir = character.dir + character.buckled.set_dir(character.dir) ticker.mode.latespawn(character) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 6d830d1559f..7816b914cfa 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -1037,7 +1037,7 @@ obj/item/weapon/organ/New(loc, mob/living/carbon/human/H) base.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD) icon = base - dir = SOUTH + set_dir(SOUTH) src.transform = turn(src.transform, rand(70,130)) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 8a79226dab9..72f827f7edd 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -365,6 +365,11 @@ if(user.mind && (user.mind.assigned_role == "Clown")) clown = 1 + if(istype(P, /obj/item/weapon/tape_roll)) + var/obj/item/weapon/tape_roll/tape = P + tape.stick(src, user) + return + if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/photo)) if (istype(P, /obj/item/weapon/paper/carbon)) var/obj/item/weapon/paper/carbon/C = P diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 510602122f3..63e8636f59d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -143,9 +143,9 @@ // offset 24 pixels in direction of dir // this allows the APC to be embedded in a wall, yet still inside an area if (building) - dir = ndir + set_dir(ndir) src.tdir = dir // to fix Vars bug - dir = SOUTH + set_dir(SOUTH) pixel_x = (src.tdir & 3)? 0 : (src.tdir == 4 ? 24 : -24) pixel_y = (src.tdir & 3)? (src.tdir ==1 ? 24 : -24) : 0 @@ -184,7 +184,7 @@ // create a terminal object at the same position as original turf loc // wires will attach to this terminal = new/obj/machinery/power/terminal(src.loc) - terminal.dir = tdir + terminal.set_dir(tdir) terminal.master = src /obj/machinery/power/apc/proc/init() @@ -1139,7 +1139,7 @@ else if(longtermpower > -10) longtermpower -= 2 - if(cell.charge >= 1250 || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101 + if((cell.percent() > 30) || longtermpower > 0) // Put most likely at the top so we don't check it last, effeciency 101 if(autoflag != 3) equipment = autoset(equipment, 1) lighting = autoset(lighting, 1) @@ -1148,21 +1148,21 @@ area.poweralert(1, src) if(cell.charge >= 4000) area.poweralert(1, src) - else if(cell.charge < 1250 && cell.charge > 750 && longtermpower < 0) // <30%, turn off equipment + else if((cell.percent() <= 30) && (cell.percent() > 15) && longtermpower < 0) // <30%, turn off equipment if(autoflag != 2) equipment = autoset(equipment, 2) lighting = autoset(lighting, 1) environ = autoset(environ, 1) area.poweralert(0, src) autoflag = 2 - else if(cell.charge < 750 && cell.charge > 10) // <15%, turn off lighting & equipment + else if(cell.percent() <= 15) // <15%, turn off lighting & equipment if((autoflag > 1 && longtermpower < 0) || (autoflag > 1 && longtermpower >= 0)) equipment = autoset(equipment, 2) lighting = autoset(lighting, 2) environ = autoset(environ, 1) area.poweralert(0, src) autoflag = 1 - else if(cell.charge <= 0) // zero charge, turn all off + else // zero charge, turn all off if(autoflag != 0) equipment = autoset(equipment, 0) lighting = autoset(lighting, 0) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 0e0f7c6e1f4..dd04e38321f 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -590,6 +590,31 @@ obj/structure/cable/proc/cableColor(var/colorC) usr << "\blue You cannot do that." ..() +/obj/item/stack/cable_coil/robot/verb/set_colour() + set name = "Change Colour" + set category = "Object" + + var/list/possible_colours = list ("Yellow", "Green", "Pink", "Blue", "Orange", "Cyan", "Red") + var/selected_type = input("Pick new colour.", "Cable Colour", null, null) as null|anything in possible_colours + + if(selected_type) + switch(selected_type) + if("Yellow") + color = COLOR_YELLOW + if("Green") + color = COLOR_GREEN + if("Pink") + color = COLOR_PINK + if("Blue") + color = COLOR_BLUE + if("Orange") + color = COLOR_ORANGE + if("Cyan") + color = COLOR_CYAN + else + color = COLOR_RED + usr << "You change your cable coil's colour to [selected_type]" + // Items usable on a cable coil : // - Wirecutters : cut them duh ! // - Cable coil : merge cables diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index e6bd2151c8b..c574c37ef83 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -191,7 +191,7 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) /obj/machinery/power/generator/verb/rotate_anticlock() set category = "Object" @@ -201,4 +201,4 @@ if (usr.stat || usr.restrained() || anchored) return - src.dir = turn(src.dir, -90) \ No newline at end of file + src.set_dir(turn(src.dir, -90)) \ No newline at end of file diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 4ae6e0b2543..59e93c23b64 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -33,7 +33,7 @@ if (src.anchored || usr:stat) usr << "It is fastened to the floor!" return 0 - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) return 1 /obj/machinery/power/emitter/initialize() @@ -137,7 +137,7 @@ var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(5, 1, src) s.start() - A.dir = src.dir + A.set_dir(src.dir) switch(dir) if(NORTH) A.yo = 20 diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index cf339eff301..501ccd989aa 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -299,7 +299,7 @@ field_generator power level display fields += CF G.fields += CF CF.loc = T - CF.dir = field_dir + CF.set_dir(field_dir) var/listcheck = 0 for(var/obj/machinery/field_generator/FG in connected_gens) if (isnull(FG)) diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm index 0fc32904ab9..cbec31306be 100644 --- a/code/modules/power/singularity/particle_accelerator/particle.dm +++ b/code/modules/power/singularity/particle_accelerator/particle.dm @@ -29,7 +29,7 @@ /obj/effect/accelerated_particle/New(loc, dir = 2) src.loc = loc - src.dir = dir + src.set_dir(dir) if(movement_range > 20) movement_range = 20 spawn(0) diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index a122fd12f38..6739bd165e4 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -91,7 +91,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin if (src.anchored || usr:stat) usr << "It is fastened to the floor!" return 0 - src.dir = turn(src.dir, 270) + src.set_dir(turn(src.dir, 270)) return 1 /obj/structure/particle_accelerator/verb/rotateccw() @@ -102,7 +102,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin if (src.anchored || usr:stat) usr << "It is fastened to the floor!" return 0 - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) return 1 /obj/structure/particle_accelerator/examine(mob/user) @@ -282,7 +282,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin if (src.anchored || usr:stat) usr << "It is fastened to the floor!" return 0 - src.dir = turn(src.dir, 270) + src.set_dir(turn(src.dir, 270)) return 1 /obj/machinery/particle_accelerator/verb/rotateccw() @@ -293,7 +293,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin if (src.anchored || usr:stat) usr << "It is fastened to the floor!" return 0 - src.dir = turn(src.dir, 90) + src.set_dir(turn(src.dir, 90)) return 1 /obj/machinery/particle_accelerator/update_icon() diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm index 5b30c000c70..26239ff5678 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_control.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm @@ -157,7 +157,7 @@ /obj/machinery/particle_accelerator/control_box/proc/part_scan() for(var/obj/structure/particle_accelerator/fuel_chamber/F in orange(1,src)) - src.dir = F.dir + src.set_dir(F.dir) connected_parts = list() var/tally = 0 var/ldir = turn(dir,-90) diff --git a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm index 01666774a96..ff6a444a538 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm @@ -44,6 +44,6 @@ if(2) A = new/obj/effect/accelerated_particle/strong(T, dir) if(A) - A.dir = src.dir + A.set_dir(src.dir) return 1 return 0 diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index f18aa2eb2aa..611c8546f30 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -207,7 +207,7 @@ user << "You start adding cable to the [src]." if(do_after(user, 50)) terminal = new /obj/machinery/power/terminal(tempLoc) - terminal.dir = tempDir + terminal.set_dir(tempDir) terminal.master = src return 0 return 1 diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index a3cf39280d9..861665b462c 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -102,7 +102,7 @@ var/list/solars_list = list() overlays += image('icons/obj/power.dmi', icon_state = "solar_panel-b", layer = FLY_LAYER) else overlays += image('icons/obj/power.dmi', icon_state = "solar_panel", layer = FLY_LAYER) - src.dir = angle2dir(adir) + src.set_dir(angle2dir(adir)) return //calculates the fraction of the sunlight that the panel recieves diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm index 92b6d2924c2..38824dec5d9 100644 --- a/code/modules/power/tracker.dm +++ b/code/modules/power/tracker.dm @@ -52,7 +52,7 @@ sun_angle = angle //set icon dir to show sun illumination - dir = turn(NORTH, -angle - 22.5) // 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST + set_dir(turn(NORTH, -angle - 22.5)) // 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST if(powernet && (powernet == control.powernet)) //update if we're still in the same powernet control.cdir = angle diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 972f6206ae1..610c0f28a3b 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -18,7 +18,7 @@ BB = new projectile_type(src) pixel_x = rand(-10.0, 10) pixel_y = rand(-10.0, 10) - dir = pick(cardinal) + set_dir(pick(cardinal)) /obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index 9ddfa5c9ff0..9493dc0e148 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -80,13 +80,17 @@ obj/item/weapon/gun/energy/laser/retro /obj/item/weapon/gun/energy/lasercannon/mounted/load_into_chamber() if(in_chamber) return 1 - var/mob/living/carbon/human/H = loc - if(istype(H) && H.back) - var/obj/item/weapon/rig/suit = H.back - if(istype(suit) && suit.cell && suit.cell.charge >= 250) - suit.cell.use(250) - in_chamber = new /obj/item/projectile/beam/heavylaser(src) - return 1 + var/obj/item/rig_module/module = loc + if(!istype(module)) + return 0 + if(module.holder && module.holder.wearer) + var/mob/living/carbon/human/H = module.holder.wearer + if(istype(H) && H.back) + var/obj/item/weapon/rig/suit = H.back + if(istype(suit) && suit.cell && suit.cell.charge >= 250) + suit.cell.use(250) + in_chamber = new /obj/item/projectile/beam/heavylaser(src) + return 1 return 0 /obj/item/weapon/gun/energy/lasercannon/cyborg/load_into_chamber() diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm index 9b1203c6494..61c65165abf 100644 --- a/code/modules/projectiles/guns/energy/nuclear.dm +++ b/code/modules/projectiles/guns/energy/nuclear.dm @@ -38,14 +38,18 @@ /obj/item/weapon/gun/energy/gun/mounted/load_into_chamber() if(in_chamber) return 1 - var/mob/living/carbon/human/H = loc - if(istype(H) && H.back) - var/obj/item/weapon/rig/suit = H.back - if(istype(suit) && suit.cell && suit.cell.charge >= 250) - suit.cell.use(250) - var/prog_path = text2path(projectile_type) - in_chamber = new prog_path(src) - return 1 + var/obj/item/rig_module/module = loc + if(!istype(module)) + return 0 + if(module.holder && module.holder.wearer) + var/mob/living/carbon/human/H = module.holder.wearer + if(istype(H) && H.back) + var/obj/item/weapon/rig/suit = H.back + if(istype(suit) && suit.cell && suit.cell.charge >= 250) + suit.cell.use(250) + var/prog_path = text2path(projectile_type) + in_chamber = new prog_path(src) + return 1 return 0 /obj/item/weapon/gun/energy/gun/nuclear diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index ddacdbead5c..496455f24e4 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -48,7 +48,7 @@ //Lets not spam it. if(lock_time > world.time - 2) return - user.dir = get_cardinal_dir(src, A) + user.set_dir(get_cardinal_dir(src, A)) if(isliving(A) && !(A in target)) Aim(A) //Clicked a mob, aim at them return 1 @@ -103,7 +103,7 @@ else click_empty(M) - usr.dir = get_cardinal_dir(src, T) + usr.set_dir(get_cardinal_dir(src, T)) if (!firerate) // If firerate is set to lower aim after one shot, untarget the target T.NotTargeted(src) diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index 445fa864638..4f4981b4d8a 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -1,3 +1,17 @@ +/obj/item/weapon/storage/box/bloodpacks + name = "blood packs bags" + desc = "This box contains blood packs." + icon_state = "sterile" + New() + ..() + new /obj/item/weapon/reagent_containers/blood/empty(src) + new /obj/item/weapon/reagent_containers/blood/empty(src) + new /obj/item/weapon/reagent_containers/blood/empty(src) + new /obj/item/weapon/reagent_containers/blood/empty(src) + new /obj/item/weapon/reagent_containers/blood/empty(src) + new /obj/item/weapon/reagent_containers/blood/empty(src) + new /obj/item/weapon/reagent_containers/blood/empty(src) + /obj/item/weapon/reagent_containers/blood name = "BloodPack" desc = "Contains blood used for transfusion." diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 314e6dbccfd..2244e98bf10 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -24,7 +24,7 @@ /obj/machinery/conveyor/New(loc, newdir, on = 0) ..(loc) if(newdir) - dir = newdir + set_dir(newdir) switch(dir) if(NORTH) forwards = NORTH diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm index b4c8cfc2f52..8b26dd31333 100644 --- a/code/modules/recycling/disposal-construction.dm +++ b/code/modules/recycling/disposal-construction.dm @@ -111,7 +111,7 @@ usr << "You must unfasten the pipe before rotating it." return - dir = turn(dir, -90) + set_dir(turn(dir, -90)) update() verb/flip() @@ -125,7 +125,7 @@ usr << "You must unfasten the pipe before flipping it." return - dir = turn(dir, 180) + set_dir(turn(dir, 180)) switch(ptype) if(2) ptype = 3 @@ -260,7 +260,7 @@ var/obj/structure/disposalpipe/P = new pipetype(src.loc) src.transfer_fingerprints_to(P) P.base_icon_state = base_state - P.dir = dir + P.set_dir(dir) P.dpdir = dpdir P.updateicon() @@ -278,7 +278,7 @@ var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc) src.transfer_fingerprints_to(P) - P.dir = dir + P.set_dir(dir) var/obj/structure/disposalpipe/trunk/Trunk = CP Trunk.linked = P @@ -286,7 +286,7 @@ var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc) src.transfer_fingerprints_to(P) - P.dir = dir + P.set_dir(dir) del(src) return diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 3b5d5a197a2..2bfac53547a 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -543,7 +543,7 @@ loc = D.trunk active = 1 - dir = DOWN + set_dir(DOWN) spawn(1) move() // spawn off the movement process @@ -702,7 +702,7 @@ // proc/transfer(var/obj/structure/disposalholder/H) var/nextdir = nextdir(H.dir) - H.dir = nextdir + H.set_dir(nextdir) var/turf/T = H.nextloc() var/obj/structure/disposalpipe/P = H.findpipe(T) @@ -808,7 +808,7 @@ for(var/D in cardinal) if(D & dpdir) var/obj/structure/disposalpipe/broken/P = new(src.loc) - P.dir = D + P.set_dir(D) src.invisibility = 101 // make invisible (since we won't delete the pipe immediately) var/obj/structure/disposalholder/H = locate() in src @@ -919,7 +919,7 @@ if("pipe-tagger-partial") C.ptype = 14 src.transfer_fingerprints_to(C) - C.dir = dir + C.set_dir(dir) C.density = 0 C.anchored = 1 C.update() @@ -965,7 +965,7 @@ transfer(var/obj/structure/disposalholder/H) var/nextdir = nextdir(H.dir) - H.dir = nextdir + H.set_dir(nextdir) var/turf/T var/obj/structure/disposalpipe/P @@ -1229,7 +1229,7 @@ transfer(var/obj/structure/disposalholder/H) var/nextdir = nextdir(H.dir, H.destinationTag) - H.dir = nextdir + H.set_dir(nextdir) var/turf/T = H.nextloc() var/obj/structure/disposalpipe/P = H.findpipe(T) diff --git a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm index 9b461b5d198..9f498d3faab 100644 --- a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm +++ b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm @@ -322,7 +322,7 @@ if(anchored) usr << "\red You cannot rotate [src], it has been firmly fixed to the floor." else - dir = turn(dir, 90) + set_dir(turn(dir, 90)) /obj/machinery/suspension_gen/verb/rotate_cw() set src in view(1) @@ -332,7 +332,7 @@ if(anchored) usr << "\red You cannot rotate [src], it has been firmly fixed to the floor." else - dir = turn(dir, -90) + set_dir(turn(dir, -90)) /obj/effect/suspension_field name = "energy field" diff --git a/code/modules/research/xenoarchaeology/tools/tools_locater.dm b/code/modules/research/xenoarchaeology/tools/tools_locater.dm index dfecd5979ba..ad84f0e0100 100644 --- a/code/modules/research/xenoarchaeology/tools/tools_locater.dm +++ b/code/modules/research/xenoarchaeology/tools/tools_locater.dm @@ -22,7 +22,7 @@ /obj/item/device/beacon_locator/process() if(target_radio) - dir = get_dir(src,target_radio) + set_dir(get_dir(src,target_radio)) switch(get_dist(src,target_radio)) if(0 to 3) icon_state = "pinondirect" diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm index 8ecb5fb3b18..a3616319604 100644 --- a/code/modules/shieldgen/emergency_shield.dm +++ b/code/modules/shieldgen/emergency_shield.dm @@ -13,7 +13,7 @@ var/shield_idle_power = 1500 //how much power we use when just being sustained. /obj/machinery/shield/New() - src.dir = pick(1,2,3,4) + src.set_dir(pick(1,2,3,4)) ..() update_nearby_tiles(need_rebuild=1) diff --git a/code/modules/shieldgen/sheldwallgen.dm b/code/modules/shieldgen/sheldwallgen.dm index 9bce6c3597a..d2d8148c133 100644 --- a/code/modules/shieldgen/sheldwallgen.dm +++ b/code/modules/shieldgen/sheldwallgen.dm @@ -154,7 +154,7 @@ T2 = T var/obj/machinery/shieldwall/CF = new/obj/machinery/shieldwall/(src, G) //(ref to this gen, ref to connected gen) CF.loc = T - CF.dir = field_dir + CF.set_dir(field_dir) /obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user) diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm index 2893f11b89f..0c26178314e 100644 --- a/code/modules/shieldgen/shield_capacitor.dm +++ b/code/modules/shieldgen/shield_capacitor.dm @@ -149,5 +149,5 @@ if (src.anchored) usr << "It is fastened to the floor!" return - src.dir = turn(src.dir, 270) + src.set_dir(turn(src.dir, 270)) return diff --git a/code/modules/supermatter/supermatter.dm b/code/modules/supermatter/supermatter.dm index 8e74323d6e7..de8f5233e6f 100644 --- a/code/modules/supermatter/supermatter.dm +++ b/code/modules/supermatter/supermatter.dm @@ -1,9 +1,9 @@ -#define NITROGEN_RETARDATION_FACTOR 0.15 //Higher == N2 slows reaction more -#define THERMAL_RELEASE_MODIFIER 750 //Higher == more heat released during reaction -#define PHORON_RELEASE_MODIFIER 1500 //Higher == less phoron released by reaction -#define OXYGEN_RELEASE_MODIFIER 1500 //Higher == less oxygen released at high temperature/power -#define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power +#define NITROGEN_RETARDATION_FACTOR 0.15 //Higher == N2 slows reaction more +#define THERMAL_RELEASE_MODIFIER 750 //Higher == more heat released during reaction +#define PHORON_RELEASE_MODIFIER 1500 //Higher == less phoron released by reaction +#define OXYGEN_RELEASE_MODIFIER 1500 //Higher == less oxygen released at high temperature/power +#define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power /* How to tweak the SM @@ -17,10 +17,10 @@ //Controls how much power is produced by each collector in range - this is the main parameter for tweaking SM balance, as it basically controls how the power variable relates to the rest of the game. #define POWER_FACTOR 1.0 -#define DECAY_FACTOR 700 //Affects how fast the supermatter power decays -#define CRITICAL_TEMPERATURE 800 //K +#define DECAY_FACTOR 700 //Affects how fast the supermatter power decays +#define CRITICAL_TEMPERATURE 800 //K #define CHARGING_FACTOR 0.05 -#define DAMAGE_RATE_LIMIT 3 //damage rate cap at power = 300, scales linearly with power +#define DAMAGE_RATE_LIMIT 3 //damage rate cap at power = 300, scales linearly with power //These would be what you would get at point blank, decreases with distance @@ -28,7 +28,7 @@ #define DETONATION_HALLUCINATION 600 -#define WARNING_DELAY 30 //seconds between warnings. +#define WARNING_DELAY 20 //seconds between warnings. /obj/machinery/power/supermatter name = "Supermatter" @@ -46,6 +46,7 @@ var/damage = 0 var/damage_archived = 0 var/safe_alert = "Crystaline hyperstructure returning to safe operating levels." + var/safe_warned = 0 var/warning_point = 100 var/warning_alert = "Danger! Crystal hyperstructure instability!" var/emergency_point = 700 @@ -58,15 +59,20 @@ var/grav_pulling = 0 var/pull_radius = 14 + // Time in ticks between delamination ('exploding') and exploding (as in the actual boom) + var/pull_time = 100 + var/explosion_power = 8 var/emergency_issued = 0 - var/explosion_power = 8 + // Time in 1/10th of seconds since the last sent warning + var/lastwarning = 0 + + // This stops spawning redundand explosions. Also incidentally makes supermatter unexplodable if set to 1. + var/exploded = 0 - var/lastwarning = 0 // Time in 1/10th of seconds since the last sent warning var/power = 0 - - var/oxygen = 0 // Moving this up here for easier debugging. + var/oxygen = 0 //Temporary values so that we can optimize this //How much the bullets damage should be multiplied by when it is added to the internal variables @@ -80,22 +86,6 @@ var/debug = 0 - shard //Small subtype, less efficient and more sensitive, but less boom. - name = "Supermatter Shard" - desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure. \red You get headaches just from looking at it." - icon_state = "darkmatter_shard" - base_icon_state = "darkmatter_shard" - - warning_point = 50 - emergency_point = 500 - explosion_point = 900 - - gasefficency = 0.125 - - pull_radius = 5 - explosion_power = 3 //3,6,9,12? Or is that too small? - - /obj/machinery/power/supermatter/New() . = ..() radio = new (src) @@ -106,9 +96,20 @@ . = ..() /obj/machinery/power/supermatter/proc/explode() + message_admins("Supermatter exploded at ([x],[y],[z] - JMP)",0,1) + log_game("Supermatter exploded at ([x],[y],[z])") anchored = 1 grav_pulling = 1 - spawn(100) + exploded = 1 + for(var/mob/living/mob in living_mob_list) + if(loc.z == mob.loc.z) + if(istype(mob, /mob/living/carbon/human)) + //Hilariously enough, running into a closet should make you get hit the hardest. + var/mob/living/carbon/human/H = mob + H.hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) ) + var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(mob, src) + 1) ) + mob.apply_effect(rads, IRRADIATE) + spawn(pull_time) explosion(get_turf(src), explosion_power, explosion_power * 2, explosion_power * 3, explosion_power * 4, 1) del src return @@ -120,6 +121,28 @@ if(luminosity != lum) SetLuminosity(lum) +/obj/machinery/power/supermatter/proc/announce_warning() + var/integrity = damage / explosion_point + integrity = round(100 - integrity * 100) + integrity = integrity < 0 ? 0 : integrity + var/alert_msg = " Integrity at [integrity]%" + + if(damage > emergency_point) + alert_msg = emergency_alert + alert_msg + lastwarning = world.timeofday - WARNING_DELAY * 4 + else if(damage >= damage_archived) // The damage is still going up + safe_warned = 0 + alert_msg = warning_alert + alert_msg + lastwarning = world.timeofday + else if(!safe_warned) + safe_warned = 1 // We are safe, warn only once + alert_msg = safe_alert + lastwarning = world.timeofday + else + alert_msg = null + if(alert_msg) + radio.autosay(alert_msg, "Supermatter Monitor") + /obj/machinery/power/supermatter/process() var/turf/L = loc @@ -130,39 +153,17 @@ if(!istype(L)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now. return //Yeah just stop. - - if(damage > warning_point) // while the core is still damaged and it's still worth noting its status - - shift_light(5, warning_color) - if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY) - var/stability = num2text(round((damage / explosion_point) * 100)) - var/alert_msg - - if(damage > emergency_point) - shift_light(7, emergency_color) - alert_msg = addtext(emergency_alert, " Instability: ",stability,"%") - lastwarning = world.timeofday - else if(damage >= damage_archived) // The damage is still going up - alert_msg = addtext(warning_alert," Instability: ",stability,"%") - lastwarning = world.timeofday - 150 - else // Phew, we're safe - alert_msg = safe_alert - lastwarning = world.timeofday - - if(!istype(L, /turf/space) && alert_msg) - radio.autosay(alert_msg, "Supermatter Monitor") - - if(damage > explosion_point) - for(var/mob/living/mob in living_mob_list) - if(loc.z == mob.loc.z) - if(istype(mob, /mob/living/carbon/human)) - //Hilariously enough, running into a closet should make you get hit the hardest. - var/mob/living/carbon/human/H = mob - H.hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) ) - var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(mob, src) + 1) ) - mob.apply_effect(rads, IRRADIATE) - + if(damage > explosion_point) + if(!exploded) + if(!istype(L, /turf/space)) + announce_warning() explode() + else if(damage > warning_point) // while the core is still damaged and it's still worth noting its status + shift_light(5, warning_color) + if(damage > emergency_point) + shift_light(7, emergency_color) + if(!istype(L, /turf/space) && (world.timeofday - lastwarning) >= WARNING_DELAY * 10) + announce_warning() else shift_light(4,initial(l_color)) if(grav_pulling) @@ -324,7 +325,6 @@ /obj/machinery/power/supermatter/proc/supermatter_pull() - //following is adapted from singulo code if(defer_powernet_rebuild != 2) defer_powernet_rebuild = 1 @@ -363,4 +363,23 @@ return /obj/machinery/power/supermatter/RepelAirflowDest(n) - return \ No newline at end of file + return + +/obj/machinery/power/supermatter/shard //Small subtype, less efficient and more sensitive, but less boom. + name = "Supermatter Shard" + desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure. \red You get headaches just from looking at it." + icon_state = "darkmatter_shard" + base_icon_state = "darkmatter_shard" + + warning_point = 50 + emergency_point = 400 + explosion_point = 600 + + gasefficency = 0.125 + + pull_radius = 5 + pull_time = 45 + explosion_power = 3 + +/obj/machinery/power/supermatter/shard/announce_warning() //Shards don't get announcements + return diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index d8e372d8189..c323eed8091 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -155,7 +155,7 @@ //latch with src as the follower lead = T T.tow = src - dir = lead.dir + set_dir(lead.dir) if(user) user << "\blue You hitch [src] to [T]." diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm index 5b40c9e5fc2..b6746552045 100644 --- a/code/modules/vehicles/vehicle.dm +++ b/code/modules/vehicles/vehicle.dm @@ -55,7 +55,7 @@ if(load) load.forceMove(loc)// = loc - load.dir = dir + load.set_dir(dir) return 1 else @@ -140,7 +140,7 @@ pulse2.icon_state = "empdisable" pulse2.name = "emp sparks" pulse2.anchored = 1 - pulse2.dir = pick(cardinal) + pulse2.set_dir(pick(cardinal)) spawn(10) pulse2.delete() @@ -154,9 +154,6 @@ /obj/vehicle/attack_ai(mob/user as mob) return -/obj/vehicle/proc/handle_rotation() - return - //------------------------------------------- // Vehicle procs //------------------------------------------- @@ -273,7 +270,7 @@ crate.close() C.forceMove(loc) - C.dir = dir + C.set_dir(dir) C.anchored = 1 load = C @@ -325,7 +322,7 @@ return 0 load.forceMove(dest) - load.dir = get_dir(loc, dest) + load.set_dir(get_dir(loc, dest)) load.anchored = initial(load.anchored) load.pixel_x = initial(load.pixel_x) load.pixel_y = initial(load.pixel_y) diff --git a/code/unused/Agouri_stuff.dm b/code/unused/Agouri_stuff.dm index bb5e7d3b35f..e204fbd7d39 100644 --- a/code/unused/Agouri_stuff.dm +++ b/code/unused/Agouri_stuff.dm @@ -539,7 +539,7 @@ var/turf/simulated/floor/W = new /turf/simulated/floor( locate(src.x, src.y, src.z) ) W.RemoveLattice() - W.dir = old_dir + W.set_dir(old_dir) if(prior_icon) W.icon_state = prior_icon else W.icon_state = "floor" @@ -557,7 +557,7 @@ var/turf/simulated/floor/plating/W = new /turf/simulated/floor/plating( locate(src.x, src.y, src.z) ) W.RemoveLattice() - W.dir = old_dir + W.set_dir(old_dir) if(prior_icon) W.icon_state = prior_icon else W.icon_state = "plating" W.opacity = 1 @@ -570,7 +570,7 @@ var/turf/simulated/floor/engine/E = new /turf/simulated/floor/engine( locate(src.x, src.y, src.z) ) - E.dir = old_dir + E.set_dir(old_dir) E.icon_state = "engine" /turf/simulated/Entered(atom/A, atom/OL) @@ -633,13 +633,13 @@ /turf/proc/ReplaceWithSpace() var/old_dir = dir var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) ) - S.dir = old_dir + S.set_dir(old_dir) return S /turf/proc/ReplaceWithLattice() var/old_dir = dir var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) ) - S.dir = old_dir + S.set_dir(old_dir) new /obj/structure/lattice( locate(src.x, src.y, src.z) ) return S diff --git a/code/unused/_debug.dm b/code/unused/_debug.dm index 6b8bb9c3e36..fb4a994f28a 100644 --- a/code/unused/_debug.dm +++ b/code/unused/_debug.dm @@ -502,7 +502,7 @@ Doing this because FindTurfs() isn't even used set category = "Debug" if(Debug) var/obj/effect/smoke/O = new /obj/effect/smoke( src.loc ) - O.dir = pick(NORTH, SOUTH, EAST, WEST) + O.set_dir(pick(NORTH, SOUTH, EAST, WEST)) spawn( 0 ) O.Life() else diff --git a/code/unused/assemblies.dm b/code/unused/assemblies.dm index 8f7d0f71e1c..2c6909287a9 100644 --- a/code/unused/assemblies.dm +++ b/code/unused/assemblies.dm @@ -480,8 +480,8 @@ set category = "Object" set src in usr - src.dir = turn(src.dir, 90) - src.part2.dir = src.dir + src.set_dir(turn(src.dir, 90)) + src.part2.set_dir(src.dir) src.add_fingerprint(usr) return @@ -489,7 +489,7 @@ var/t = src.dir ..() - src.dir = t + src.set_dir(t) //src.part2.first = null del(src.part2.first) return diff --git a/code/unused/asteroiddevice.dm b/code/unused/asteroiddevice.dm index f9c6aa9185e..57a5747cfec 100644 --- a/code/unused/asteroiddevice.dm +++ b/code/unused/asteroiddevice.dm @@ -47,7 +47,7 @@ var/atom/cur_loc = src.loc if(cur_loc.z == beacon.z) - src.dir = get_dir(cur_loc,beacon) + src.set_dir(get_dir(cur_loc,beacon)) else var/list/beacon_global_loc = beacon.get_global_map_pos() var/list/src_global_loc = cur_loc.get_global_map_pos() @@ -64,7 +64,7 @@ else if(beacon_global_loc["y"]