diff --git a/.travis.yml b/.travis.yml index 5895a706b17..4171bbe84ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,5 +17,5 @@ install: - cd .. script: - - (! grep -q 'step_[xy]' maps/tgstation2.dmm) + - $(for i in 1 2 3 4 5 6; do (grep -q 'step_[xy]' maps/exodus-$i.dmm; if [ $? -eq 1 ]; then exit 0; else exit 1; fi) done) - DreamMaker baystation12.dme diff --git a/baystation12.dme b/baystation12.dme index 3bdc98ee842..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" @@ -997,6 +998,7 @@ #include "code\modules\mob\living\carbon\brain\login.dm" #include "code\modules\mob\living\carbon\brain\MMI.dm" #include "code\modules\mob\living\carbon\brain\posibrain.dm" +#include "code\modules\mob\living\carbon\brain\robot.dm" #include "code\modules\mob\living\carbon\brain\say.dm" #include "code\modules\mob\living\carbon\human\death.dm" #include "code\modules\mob\living\carbon\human\emote.dm" @@ -1015,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/WorkInProgress/computer3/computers/medical.dm b/code/WorkInProgress/computer3/computers/medical.dm index 5cb984ee362..f7e6167e1df 100644 --- a/code/WorkInProgress/computer3/computers/medical.dm +++ b/code/WorkInProgress/computer3/computers/medical.dm @@ -377,6 +377,8 @@ src.active1.fields["p_stat"] = "Physically Unfit" if("disabled") src.active1.fields["p_stat"] = "Disabled" + if(PDA_Manifest.len) + PDA_Manifest.Cut() if (href_list["m_stat"]) if (src.active1) @@ -525,4 +527,4 @@ src.printing = null interact() - return + return \ No newline at end of file diff --git a/code/WorkInProgress/computer3/computers/security.dm b/code/WorkInProgress/computer3/computers/security.dm index f3a3d3ae2bb..1c409da853e 100644 --- a/code/WorkInProgress/computer3/computers/security.dm +++ b/code/WorkInProgress/computer3/computers/security.dm @@ -594,6 +594,8 @@ What a mess.*/ R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Released") if(5) R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit") + if(PDA_Manifest.len) + PDA_Manifest.Cut() if(6) R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") continue @@ -606,4 +608,4 @@ What a mess.*/ /obj/machinery/computer3/secure_data/detective_computer icon = 'icons/obj/computer.dmi' - icon_state = "messyfiles" + icon_state = "messyfiles" \ No newline at end of file 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/type2type.dm b/code/__HELPERS/type2type.dm index 1612f1ce7bf..cfac858e252 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -50,8 +50,10 @@ placeholder = 2 if (!( isnum(num) )) return - if (!( num )) - return "0" + if (num == 0) + var/final = "" + for(var/i=1 to placeholder) final = "[final]0" + return final var/hex = "" var/i = 0 while(16 ** i < num) 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/ai.dm b/code/_onclick/ai.dm index 020efa396f2..0a8ea086a17 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -124,7 +124,7 @@ Topic(src, list("src"= "\ref[src]", "breaker"="1"), 1) // 1 meaning no window (consistency!) /obj/machinery/turretid/AICtrlClick() //turns off/on Turrets - Topic(src, list("src"= "\ref[src]", "toggleOn"="1", 1)) // 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "operation"="toggleon"), 1) // 1 meaning no window (consistency!) /atom/proc/AIAltClick(var/atom/A) AltClick(A) @@ -139,7 +139,7 @@ return /obj/machinery/turretid/AIAltClick() //toggles lethal on turrets - Topic(src, list("src"= "\ref[src]", "toggleLethal"="1", 1)) // 1 meaning no window (consistency!) + Topic(src, list("src"= "\ref[src]", "operation"="togglelethal"), 1) // 1 meaning no window (consistency!) /atom/proc/AIMiddleClick() return 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/controllers/shuttle_controller.dm b/code/controllers/shuttle_controller.dm index 81403ec3b81..5fb5f0c8bdb 100644 --- a/code/controllers/shuttle_controller.dm +++ b/code/controllers/shuttle_controller.dm @@ -223,7 +223,8 @@ var/global/datum/shuttle_controller/shuttle_controller "South of the station" = locate(/area/syndicate_station/south), "Southeast of the station" = locate(/area/syndicate_station/southeast), "Telecomms Satellite" = locate(/area/syndicate_station/commssat), - "Mining Asteroid" = locate(/area/syndicate_station/mining) + "Mining Asteroid" = locate(/area/syndicate_station/mining), + "Arrivals dock" = locate(/area/syndicate_station/arrivals_dock), ) MS.announcer = "NSV Icarus" 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..271db65fa93 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" @@ -1180,6 +1190,7 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee /obj/item/weapon/folder/red, /obj/item/weapon/folder/yellow, /obj/item/weapon/hand_labeler, + /obj/item/weapon/tape_roll, /obj/structure/filingcabinet/chestdrawer{anchored = 0}, /obj/item/weapon/paper_bin) name = "Office supplies" diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm index 13e53164320..f65ee6be508 100644 --- a/code/datums/wires/robot.dm +++ b/code/datums/wires/robot.dm @@ -40,7 +40,7 @@ var/const/BORG_WIRE_CAMERA = 16 if (BORG_WIRE_CAMERA) if(!isnull(R.camera) && !R.scrambledcodes) R.camera.status = mended - R.camera.deactivate(usr, 0) // Will kick anyone who is watching the Cyborg's camera. + R.camera.kick_viewers() // Will kick anyone who is watching the Cyborg's camera. if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh if (R.lawupdate) @@ -83,7 +83,7 @@ var/const/BORG_WIRE_CAMERA = 16 if (BORG_WIRE_CAMERA) if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes) - R.camera.deactivate(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera. + R.camera.kick_viewers() // Kick anyone watching the Cyborg's camera R.visible_message("[R]'s camera lense focuses loudly.") R << "Your camera lense focuses loudly." diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 26feaefe47a..5121b39dbe4 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -97,6 +97,9 @@ var/list/wireColours = list("red", "blue", "green", "white", "orange", "brown", html += " [IsAttached(colour) ? "Detach" : "Attach"] Signaller" html += "" html += "" + + if (random) + html += "\The [holder] appears to have tamper-resistant electronics installed.

" //maybe this could be more generic? return html diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 99ac499dc95..7f115404b3d 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -495,6 +495,14 @@ var/list/ghostteleportlocs = list() name = "\improper north east of the mining asteroid" icon_state = "north" +/area/syndicate_station/arrivals_dock + name = "\improper docked with station" + icon_state = "shuttle" + +/area/syndicate_station/maint_dock + name = "\improper docked with station" + icon_state = "shuttle" + /area/syndicate_station/transit name = "\improper hyperspace" icon_state = "shuttle" @@ -904,18 +912,10 @@ var/list/ghostteleportlocs = list() name = "\improper Engineering Washroom" icon_state = "toilet" -/area/crew_quarters/sleep/bedrooms/one +/area/crew_quarters/sleep/bedrooms name = "\improper Dormitory Bedroom One" icon_state = "Sleep" -/area/crew_quarters/sleep/bedrooms/two - name = "\improper Dormitory Bedroom Two" - icon_state = "Sleep" - -/area/crew_quarters/sleep/bedrooms/three - name = "\improper Dormitory Bedroom Three" - icon_state = "Sleep" - /area/crew_quarters/sleep/cryo name = "\improper Cryogenic Storage" icon_state = "Sleep" 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/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index 961f38fc0d9..52f1ff6286e 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -2,6 +2,7 @@ icon_state = "paper_talisman" var/imbue = null var/uses = 0 + info = "

" attack_self(mob/living/user as mob) if(iscultist(user)) 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/adv_med.dm b/code/game/machinery/adv_med.dm index 97e61e5707b..98ebc5a6265 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -330,9 +330,9 @@ dat += text("Inaprovaline: [] units
", occ["inaprovaline_amount"]) dat += text("Soporific: [] units
", occ["stoxin_amount"]) - dat += text("[]\tDermaline: [] units
", (occ["dermaline"] < 30 ? "" : ""), occ["dermaline"]) - dat += text("[]\tBicaridine: [] units
", (occ["bicaridine"] < 30 ? "" : ""), occ["bicaridine"]) - dat += text("[]\tDexalin: [] units
", (occ["dexalin"] < 30 ? "" : ""), occ["dexalin"]) + dat += text("[]\tDermaline: [] units
", (occ["dermaline_amount"] < 30 ? "" : ""), occ["dermaline_amount"]) + dat += text("[]\tBicaridine: [] units
", (occ["bicaridine_amount"] < 30 ? "" : ""), occ["bicaridine_amount"]) + dat += text("[]\tDexalin: [] units
", (occ["dexalin_amount"] < 30 ? "" : ""), occ["dexalin_amount"]) for(var/datum/disease/D in occ["tg_diseases_list"]) if(!D.hidden[SCANNER]) 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 84f3efb167f..4dd60649253 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -20,7 +20,8 @@ var/frustration = 0 var/idcheck = 0 //If false, all station IDs are authorized for weapons. - var/check_records = 1 //Does it check security records? + var/check_records = 0 //Does it check security records? + var/check_arrest = 1 //Does it check arrest status? var/arrest_type = 0 //If true, don't handcuff var/declare_arrests = 0 //When making an arrest, should it notify everyone wearing sechuds? @@ -97,6 +98,7 @@ radio_controller.add_object(src, beacon_freq, filter = RADIO_NAVBEACONS) if(lasercolor) shot_delay = 6 //Longer shot delay because JESUS CHRIST + check_arrest = 0 check_records = 0 //Don't actively target people set to arrest arrest_type = 1 //Don't even try to cuff req_access = list(access_maint_tunnels) @@ -150,12 +152,14 @@ Maintenance panel is [src.open ? "opened" : "closed"]"}, dat += text({"
Check for Weapon Authorization: []
Check Security Records: []
+Check Arrest Status: []
Operating Mode: []
Report Arrests: []
Auto Patrol: []"}, "[src.idcheck ? "Yes" : "No"]", "[src.check_records ? "Yes" : "No"]", +"[src.check_arrest ? "Yes" : "No"]", "[src.arrest_type ? "Detain" : "Arrest"]", "[src.declare_arrests ? "Yes" : "No"]", "[auto_patrol ? "On" : "Off"]" ) @@ -189,6 +193,8 @@ Auto Patrol: []"}, src.idcheck = !src.idcheck if("ignorerec") src.check_records = !src.check_records + if("ignorearr") + src.check_arrest = !src.check_arrest if("switchmode") src.arrest_type = !src.arrest_type if("patrol") @@ -262,7 +268,7 @@ Auto Patrol: []"}, // We re-assess human targets, before bashing their head in, in case their credentials change if(target && istype(target, /mob/living/carbon/human)) - var/threat = src.assess_perp(target, idcheck, check_records) + var/threat = src.assess_perp(target, idcheck, check_records, check_arrest) if(threat < 4) target = null @@ -649,7 +655,7 @@ Auto Patrol: []"}, continue if(istype(C, /mob/living/carbon/human)) - src.threatlevel = src.assess_perp(C, idcheck, check_records) + src.threatlevel = src.assess_perp(C, idcheck, check_records, check_arrest) else if(istype(M, /mob/living/simple_animal/hostile)) if(M.stat == DEAD) @@ -878,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..4e064e347ee 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -11,13 +11,15 @@ var/list/network = list("SS13") var/c_tag = null var/c_tag_order = 999 - var/status = 1.0 + var/status = 1 anchored = 1.0 var/panel_open = 0 // 0 = Closed / 1 = Open var/invuln = null var/bugged = 0 var/obj/item/weapon/camera_assembly/assembly = null + var/toughness = 5 //sorta fragile + // WIRES var/datum/wires/camera/wires = null // Wires datum @@ -49,37 +51,57 @@ ASSERT(src.network.len > 0) ..() +/obj/machinery/camera/Del() + if(!alarm_on) + triggerCameraAlarm() + + spawn(50) + src = null + cancelCameraAlarm() //so camera alarms don't just go on forever + ..() + /obj/machinery/camera/emp_act(severity) if(!isEmpProof()) if(prob(100/severity)) - icon_state = "[initial(icon_state)]emp" - var/list/previous_network = network - network = list() - cameranet.removeCamera(src) stat |= EMPED SetLuminosity(0) + kick_viewers() triggerCameraAlarm() + update_icon() + spawn(900) - network = previous_network - icon_state = initial(icon_state) stat &= ~EMPED cancelCameraAlarm() - if(can_use()) - cameranet.addCamera(src) - kick_viewers() + update_icon() + ..() +/obj/machinery/camera/bullet_act(var/obj/item/projectile/P) + if(P.damage_type == BRUTE || P.damage_type == BURN) + take_damage(P.damage) /obj/machinery/camera/ex_act(severity) if(src.invuln) return - else - ..(severity) - return + + //camera dies if an explosion touches it! + if(severity <= 2 || prob(50)) + destroy() + + ..() //and give it the regular chance of being deleted outright + /obj/machinery/camera/blob_act() return +/obj/machinery/camera/hitby(AM as mob|obj) + ..() + if (istype(AM, /obj)) + var/obj/O = AM + if (O.throwforce >= src.toughness) + visible_message("[src] was hit by [O].") + take_damage(O.throwforce) + /obj/machinery/camera/proc/setViewRange(var/num = 7) src.view_range = num cameranet.updateVisibility(src, 0) @@ -90,14 +112,14 @@ return if(user.species.can_shred(user)) - status = 0 + set_status(0) visible_message("\The [user] slashes at [src]!") playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) icon_state = "[initial(icon_state)]1" add_hiddenprint(user) - deactivate(user,0) + destroy() -/obj/machinery/camera/attackby(W as obj, mob/living/user as mob) +/obj/machinery/camera/attackby(obj/W as obj, mob/living/user as mob) // DECONSTRUCTION if(isscrewdriver(W)) @@ -111,16 +133,19 @@ else if((iswirecutter(W) || ismultitool(W)) && panel_open) interact(user) - else if(iswelder(W) && wires.CanDeconstruct()) + else if(iswelder(W) && (wires.CanDeconstruct() || (stat & BROKEN))) if(weld(W, user)) - if(assembly) + if (stat & BROKEN) + new /obj/item/weapon/circuitboard/broken(src.loc) + new /obj/item/stack/cable_coil(src.loc, length=2) + else if(assembly) assembly.loc = src.loc assembly.state = 1 + new /obj/item/stack/cable_coil(src.loc, length=2) del(src) - // OTHER - else if ((istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/device/pda)) && isliving(user)) + else if (can_use() && (istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/device/pda)) && isliving(user)) var/mob/living/U = user var/obj/item/weapon/paper/X = null var/obj/item/device/pda/P = null @@ -147,6 +172,7 @@ if (S.current == src) O << "[U] holds \a [itemname] up to one of the cameras ..." O << browse(text("[][]", itemname, info), text("window=[]", itemname)) + else if (istype(W, /obj/item/weapon/camera_bug)) if (!src.can_use()) user << "\blue Camera non-functional" @@ -157,22 +183,25 @@ else user << "\blue Camera bugged." src.bugged = 1 - else if(istype(W, /obj/item/weapon/melee/energy/blade))//Putting it here last since it's a special case. I wonder if there is a better way to do these than type casting. - deactivate(user,2)//Here so that you can disconnect anyone viewing the camera, regardless if it's on or off. - var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() - spark_system.set_up(5, 0, loc) - spark_system.start() - playsound(loc, 'sound/weapons/blade1.ogg', 50, 1) - playsound(loc, "sparks", 50, 1) - visible_message("\blue The camera has been sliced apart by [] with an energy blade!") - del(src) + + else if(W.damtype == BRUTE || W.damtype == BURN) //bashing cameras + if (W.force >= src.toughness) + visible_message("[src] has been [pick(W.attack_verb)] with [W] by [user]!") + if (istype(W, /obj/item)) //is it even possible to get into attackby() with non-items? + var/obj/item/I = W + if (I.hitsound) + playsound(loc, I.hitsound, 50, 1, -1) + take_damage(W.force) + else ..() - return /obj/machinery/camera/proc/deactivate(user as mob, var/choice = 1) - if(choice==1) - status = !( src.status ) + if(choice != 1) + //legacy support, if choice is != 1 then just kick viewers without changing status + kick_viewers() + else + set_status( !src.status ) if (!(src.status)) visible_message("\red [user] has deactivated [src]!") playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) @@ -183,10 +212,32 @@ playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1) icon_state = initial(icon_state) add_hiddenprint(user) - // now disconnect anyone using the camera - //Apparently, this will disconnect anyone even if the camera was re-activated. - //I guess that doesn't matter since they can't use it anyway? + +/obj/machinery/camera/proc/take_damage(var/force, var/message) + //prob(25) gives an average of 3-4 hits + if (force >= toughness && (force > toughness*4 || prob(25))) + destroy() + +//Used when someone breaks a camera +/obj/machinery/camera/proc/destroy() + stat |= BROKEN kick_viewers() + triggerCameraAlarm() + update_icon() + + //sparks + var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() + spark_system.set_up(5, 0, loc) + spark_system.start() + playsound(loc, "sparks", 50, 1) + +/obj/machinery/camera/proc/set_status(var/newstatus) + if (status != newstatus) + status = newstatus + // now disconnect anyone using the camera + //Apparently, this will disconnect anyone even if the camera was re-activated. + //I guess that doesn't matter since they couldn't use it anyway? + kick_viewers() //This might be redundant, because of check_eye() /obj/machinery/camera/proc/kick_viewers() @@ -198,6 +249,14 @@ O.reset_view(null) O << "The screen bursts into static." +/obj/machinery/camera/update_icon() + if (!status || (stat & BROKEN)) + icon_state = "[initial(icon_state)]1" + else if (stat & EMPED) + icon_state = "[initial(icon_state)]emp" + else + icon_state = initial(icon_state) + /obj/machinery/camera/proc/triggerCameraAlarm() alarm_on = 1 for(var/mob/living/silicon/S in mob_list) @@ -209,10 +268,11 @@ for(var/mob/living/silicon/S in mob_list) S.cancelAlarm("Camera", get_area(src), src) +//if false, then the camera is listed as DEACTIVATED and cannot be used /obj/machinery/camera/proc/can_use() if(!status) return 0 - if(stat & EMPED) + if(stat & (EMPED|BROKEN)) return 0 return 1 @@ -234,13 +294,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 @@ -284,6 +344,10 @@ /obj/machinery/camera/interact(mob/living/user as mob) if(!panel_open || istype(user, /mob/living/silicon/ai)) return + + if(stat & BROKEN) + user << "\The [src] is broken." + return user.set_machine(src) wires.Interact(user) diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 0017b260c29..48f0a94faf2 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -1,6 +1,6 @@ /obj/item/weapon/camera_assembly name = "camera assembly" - desc = "The basic construction for Nanotrasen-Always-Watching-You cameras." + desc = "A pre-fabricated security camera kit, ready to be assembled and mounted to a surface." icon = 'icons/obj/monitors.dmi' icon_state = "cameracase" w_class = 2 @@ -171,4 +171,4 @@ return 0 return 1 busy = 0 - return 0 \ No newline at end of file + return 0 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/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 7c1e9d721f2..2dbfcd96207 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -123,21 +123,22 @@ laws.add_inherent_law(M.newFreeFormLaw) usr << "Added a freeform law." - if(istype(P, /obj/item/device/mmi) || istype(P, /obj/item/device/mmi/posibrain)) - if(!P:brainmob) + if(istype(P, /obj/item/device/mmi)) + var/obj/item/device/mmi/M = P + if(!M.brainmob) user << "\red Sticking an empty [P] into the frame would sort of defeat the purpose." return - if(P:brainmob.stat == 2) + if(M.brainmob.stat == 2) user << "\red Sticking a dead [P] into the frame would sort of defeat the purpose." return - if(jobban_isbanned(P:brainmob, "AI")) + if(jobban_isbanned(M.brainmob, "AI")) user << "\red This [P] does not seem to fit." return - if(P:brainmob.mind) - ticker.mode.remove_cultist(P:brainmob.mind, 1) - ticker.mode.remove_revolutionary(P:brainmob.mind, 1) + if(M.brainmob.mind) + ticker.mode.remove_cultist(M.brainmob.mind, 1) + ticker.mode.remove_revolutionary(M.brainmob.mind, 1) user.drop_item() P.loc = src diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index 7c907c4605c..3c30ffa198e 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -25,6 +25,14 @@ var/frame_desc = null var/contain_parts = 1 +//Not sure where else to put this +/obj/item/weapon/circuitboard/broken + name = "broken electronics" + icon = 'icons/obj/doors/door_assembly.dmi' + icon_state = "door_electronics_smoked" + origin_tech = null + board_type = "other" + //Called when the circuitboard is used to contruct a new machine. /obj/item/weapon/circuitboard/proc/construct(var/obj/machinery/M) if (istype(M, build_path)) @@ -453,4 +461,4 @@ user << "\blue You connect the monitor." var/B = new src.circuit.build_path ( src.loc ) src.circuit.construct(B) - del(src) \ No newline at end of file + del(src) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index f21322a3e20..a03edba52ad 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -364,6 +364,8 @@ src.active1.fields["p_stat"] = "Physically Unfit" if("disabled") src.active1.fields["p_stat"] = "Disabled" + if(PDA_Manifest.len) + PDA_Manifest.Cut() if (href_list["m_stat"]) if (src.active1) @@ -533,6 +535,8 @@ R.fields["b_type"] = pick("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+") if(5) R.fields["p_stat"] = pick("*SSD*", "Active", "Physically Unfit", "Disabled") + if(PDA_Manifest.len) + PDA_Manifest.Cut() if(6) R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") continue @@ -547,4 +551,4 @@ /obj/machinery/computer/med_data/laptop name = "Medical Laptop" desc = "Cheap Nanotrasen Laptop." - icon_state = "medlaptop" + icon_state = "medlaptop" \ No newline at end of file diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index f1f866864a7..e97d9f6865d 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -598,6 +598,8 @@ What a mess.*/ R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Released") if(5) R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit") + if(PDA_Manifest.len) + PDA_Manifest.Cut() if(6) R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") continue @@ -610,4 +612,4 @@ What a mess.*/ /obj/machinery/computer/secure_data/detective_computer icon = 'icons/obj/computer.dmi' - icon_state = "messyfiles" + icon_state = "messyfiles" \ No newline at end of file diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index 21d584fe8bc..98c75daf570 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -401,6 +401,8 @@ What a mess.*/ R.fields["criminal"] = pick("None", "*Arrest*", "Incarcerated", "Parolled", "Released") if(5) R.fields["p_stat"] = pick("*Unconcious*", "Active", "Physically Unfit") + if(PDA_Manifest.len) + PDA_Manifest.Cut() if(6) R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") continue @@ -409,4 +411,4 @@ What a mess.*/ del(R) continue - ..(severity) + ..(severity) \ No newline at end of file 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 9ba81bb79c0..d0634f81cc0 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -27,8 +27,7 @@ normalspeed = 1 var/obj/item/weapon/airlock_electronics/electronics = null var/hasShocked = 0 //Prevents multiple shocks from happening - var/secured_wires = 0 //for mapping use - var/security_bolts = 0 //if 1, door bolts when broken + var/secured_wires = 0 var/datum/wires/airlock/wires = null /obj/machinery/door/airlock/command @@ -78,7 +77,7 @@ name = "Vault" icon = 'icons/obj/doors/vault.dmi' opacity = 1 - security_bolts = 1 + secured_wires = 1 assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites. /obj/machinery/door/airlock/freezer @@ -259,9 +258,9 @@ glass = 1 /obj/machinery/door/airlock/highsecurity - name = "High Tech Security Airlock" + name = "Secure Airlock" icon = 'icons/obj/doors/hightechsecurity.dmi' - security_bolts = 1 + secured_wires = 1 assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity /* @@ -899,7 +898,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) @@ -911,23 +910,14 @@ About the new airlock wires panel: da.created_name = src.name da.update_state() - var/obj/item/weapon/airlock_electronics/ae - if(!electronics) - ae = new/obj/item/weapon/airlock_electronics( src.loc ) - if(!src.req_access) - src.check_access() - if(src.req_access.len) - ae.conf_access = src.req_access - else if (src.req_one_access.len) - ae.conf_access = src.req_one_access - ae.one_access = 1 - else - ae = electronics - electronics = null - ae.loc = src.loc if(operating == -1) - ae.icon_state = "door_electronics_smoked" + new /obj/item/weapon/circuitboard/broken(src.loc) operating = 0 + else + if (!electronics) create_electronics() + + electronics.loc = src.loc + electronics = null del(src) return @@ -970,7 +960,7 @@ About the new airlock wires panel: /obj/machinery/door/airlock/set_broken() src.p_open = 1 stat |= BROKEN - if (src.security_bolts) + if (secured_wires) lock() for (var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) @@ -1066,12 +1056,35 @@ About the new airlock wires panel: return 1 return 0 -/obj/machinery/door/airlock/New() +/obj/machinery/door/airlock/New(var/newloc, var/obj/structure/door_assembly/assembly=null) ..() +<<<<<<< HEAD //High-sec airlocks are much harder to completely break by emitters. if(security_bolts) emitter_resistance *= 3 +======= + //if assembly is given, create the new door from the assembly + if (assembly) + assembly_type = assembly.type + + electronics = assembly.electronics + electronics.loc = src + + //update the door's access to match the electronics' + secured_wires = electronics.secure + if(electronics.one_access) + req_access = null + req_one_access = src.electronics.conf_access + else + req_access = src.electronics.conf_access + + //get the name from the assembly + if(assembly.created_name) + name = assembly.created_name + else + name = "[istext(assembly.glass) ? "[assembly.glass] airlock" : assembly.base_name]" +>>>>>>> 2d7ea3028f36259d189674c209b727029da4ecc6 //wires if (secured_wires) @@ -1086,6 +1099,25 @@ About the new airlock wires panel: src.closeOther = A break +// Most doors will never be deconstructed over the course of a round, +// so as an optimization defer the creation of electronics until +// the airlock is deconstructed +/obj/machinery/door/airlock/proc/create_electronics() + //create new electronics + if (secured_wires) + src.electronics = new/obj/item/weapon/airlock_electronics/secure( src.loc ) + else + src.electronics = new/obj/item/weapon/airlock_electronics( src.loc ) + + //update the electronics to match the door's access + if(!src.req_access) + src.check_access() + if(src.req_access.len) + electronics.conf_access = src.req_access + else if (src.req_one_access.len) + electronics.conf_access = src.req_one_access + electronics.one_access = 1 + /obj/machinery/door/airlock/power_change() //putting this is obj/machinery/door itself makes non-airlock doors turn invisible for some reason ..() update_icon() @@ -1097,4 +1129,4 @@ About the new airlock wires panel: src.unlock() src.open() src.lock() - return \ No newline at end of file + return diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 0a22aa0dd94..32e356de3fe 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -10,6 +10,7 @@ req_access = list(access_engine) + var/secure = 0 //if set, then wires will be randomized and bolts will drop if the door is broken var/list/conf_access = null var/one_access = 0 //if set to 1, door would receive req_one_access instead of req_access var/last_configurator = null @@ -113,4 +114,5 @@ /obj/item/weapon/airlock_electronics/secure name = "secure airlock electronics" desc = "designed to be somewhat more resistant to hacking than standard electronics." - origin_tech = "programming=3" + origin_tech = "programming=2" + secure = 1 diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 02d48f4c036..de38264cd3d 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -31,7 +31,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() @@ -131,8 +131,8 @@ /obj/machinery/door/bullet_act(var/obj/item/projectile/Proj) ..() - //Tasers and the like should not damage doors. - if(Proj.damage_type == HALLOSS) + //Tasers and the like should not damage doors. Nor should TOX, OXY, CLONE, etc damage types + if(!(Proj.damage_type == BRUTE || Proj.damage_type == BURN)) return // Emitter Blasts - these will eventually completely destroy the door, given enough time. @@ -154,7 +154,7 @@ /obj/machinery/door/hitby(AM as mob|obj) ..() - visible_message("\red [src.name] was hit by [AM].", 1) + visible_message("\red [src.name] was hit by [AM].") var/tforce = 0 if(ismob(AM)) tforce = 15 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 fab5bbea6e0..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 @@ -318,7 +350,7 @@ Class Procs: /obj/machinery/proc/is_assess_emagged() return emagged -/obj/machinery/proc/assess_perp(mob/living/carbon/human/perp, var/auth_weapons, var/check_records) +/obj/machinery/proc/assess_perp(mob/living/carbon/human/perp, var/auth_weapons, var/check_records, var/check_arrest) var/threatcount = 0 //the integer returned if(is_assess_emagged()) @@ -345,13 +377,17 @@ Class Procs: if(perp.dna && perp.dna.mutantrace && perp.dna.mutantrace != "none") threatcount += 2 - if(check_records) + + if(check_records || check_arrest) var/perpname = perp.name if(id) perpname = id.registered_name var/datum/data/record/R = find_security_record("name", perpname) - if(R && (R.fields["criminal"] == "*Arrest*")) + if(check_records && !R) + threatcount += 4 + + if(check_arrest && R && (R.fields["criminal"] == "*Arrest*")) threatcount += 4 return threatcount 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_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm index fa4e75bfc5a..13f7032aa3a 100644 --- a/code/game/machinery/portable_tag_turret.dm +++ b/code/game/machinery/portable_tag_turret.dm @@ -23,9 +23,10 @@ eprojectile = /obj/item/weapon/gun/energy/laser/bluetag lasercolor = "b" req_access = list(access_maint_tunnels, access_theatre) + check_arrest = 0 check_records = 0 - auth_weapons = 1 - stun_all = 0 + check_weapons = 1 + check_access = 0 check_anomalies = 0 shot_delay = 30 @@ -33,9 +34,10 @@ eprojectile = /obj/item/weapon/gun/energy/laser/redtag lasercolor = "r" req_access = list(access_maint_tunnels, access_theatre) + check_arrest = 0 check_records = 0 - auth_weapons = 1 - stun_all = 0 + check_weapons = 1 + check_access = 0 check_anomalies = 0 shot_delay = 30 iconholder = 1 diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index b0b8df60c8e..33334ffe04d 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -36,11 +36,12 @@ var/last_fired = 0 //1: if the turret is cooling down from a shot, 0: turret is ready to fire var/shot_delay = 15 //1.5 seconds between each shot - var/check_records = 1 //checks if it can use the security records - var/auth_weapons = 0 //checks if it can shoot people that have a weapon they aren't authorized to have - var/stun_all = 1 //if this is active, the turret shoots everything that does not meet the access requirements + var/check_arrest = 1 //checks if the perp is set to arrest + var/check_records = 1 //checks if a security record exists at all + var/check_weapons = 0 //checks if it can shoot people that have a weapon they aren't authorized to have + var/check_access = 1 //if this is active, the turret shoots everything that does not meet the access requirements var/check_anomalies = 1 //checks if it can shoot at unidentified lifeforms (ie xenos) - var/ai = 0 //if active, will shoot at anything not an AI or cyborg + var/check_synth = 0 //if active, will shoot at anything not an AI or cyborg var/ailock = 0 // AI cannot use this var/attacked = 0 //if set to 1, the turret gets pissed off and shoots at people nearby (unless they have sec access!) @@ -181,17 +182,21 @@ Neutralize All Non-Synthetics: []
"}, "[lethal ? "Enabled" : "Disabled"]", - "[ai ? "Yes" : "No"]") - if(!ai) + "[check_synth ? "Yes" : "No"]") + if(!check_synth) dat += text({"Check for Weapon Authorization: []
Check Security Records: []
+ Check Arrest Status: []
Neutralize All Non-Authorized Personnel: []
Neutralize All Unidentified Life Signs: []
"}, - "[auth_weapons ? "Yes" : "No"]", + "[check_weapons ? "Yes" : "No"]", "[check_records ? "Yes" : "No"]", - "[stun_all ? "Yes" : "No"]", + "[check_arrest ? "Yes" : "No"]", + "[check_access ? "Yes" : "No"]", "[check_anomalies ? "Yes" : "No"]" ) + else + dat += "
Swipe ID card to unlock interface
" user << browse("Automatic Portable Turret Installation[dat]", "window=autosec") onclose(user, "autosec") @@ -207,13 +212,14 @@ if(!can_use(usr)) return 1 + if(HasController()) + usr << "Turrets can only be controlled using the assigned turret controller." + return + usr.set_machine(src) if(href_list["power"]) if(anchored) //you can't turn a turret on/off if it's not anchored/secured - if(HasController()) - usr << "Turrets can only be [on ? "disabled" : "enabled"] using the assigned turret controller." - else - on = !on //toggle on/off + on = !on //toggle on/off else usr << "It has to be secured first!" @@ -223,18 +229,17 @@ switch(href_list["operation"]) //toggles customizable behavioural protocols if("togglelethal") if(!controllock) - if(HasController()) - usr << "Weapon mode can only be altered using the assigned turret controller." - else - lethal = !lethal + lethal = !lethal if("toggleai") - ai = !ai + check_synth = !check_synth if("authweapon") - auth_weapons = !auth_weapons + check_weapons = !check_weapons if("checkrecords") check_records = !check_records - if("shootall") - stun_all = !stun_all + if("checkarrests") + check_arrest = !check_arrest + if("checkaccess") + check_access = !check_access if("checkxenos") check_anomalies = !check_anomalies updateUsrDialog() @@ -316,9 +321,7 @@ else //if the turret was attacked with the intention of harming it: user.changeNext_move(CLICK_CD_MELEE) - health -= I.force * 0.5 - if(health <= 0) - die() + take_damage(I.force * 0.5) if(I.force * 0.5 > 1) //if the force of impact dealt at least 1 damage, the turret gets pissed off if(!attacked && !emagged) attacked = 1 @@ -327,6 +330,12 @@ attacked = 0 ..() +/obj/machinery/porta_turret/proc/take_damage(var/force) + health -= force + if (force > 5 && prob(45)) + spark_system.start() + if(health <= 0) + die() //the death process :( /obj/machinery/porta_turret/bullet_act(obj/item/projectile/Proj) if(on) @@ -335,24 +344,21 @@ spawn() sleep(60) attacked = 0 - - if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) - health -= Proj.damage - + ..() - if(prob(45) && Proj.damage > 0) - spark_system.start() - if(health <= 0) - die() //the death process :( + if((Proj.damage_type == BRUTE || Proj.damage_type == BURN)) + take_damage(Proj.damage) /obj/machinery/porta_turret/emp_act(severity) if(on) //if the turret is on, the EMP no matter how severe disables the turret for a while //and scrambles its settings, with a slight chance of having an emag effect - check_records = pick(0, 1) - auth_weapons = pick(0, 1) - stun_all = pick(0, 0, 0, 0, 1) //stun_all is a pretty big deal, so it's least likely to get turned on + check_arrest = prob(50) + check_records = prob(50) + check_weapons = prob(50) + check_access = prob(20) // check_access is a pretty big deal, so it's least likely to get turned on + check_anomalies = prob(50) if(prob(5)) emagged = 1 @@ -364,10 +370,16 @@ ..() /obj/machinery/porta_turret/ex_act(severity) - if(severity >= 3) //turret dies if an explosion touches it! - del(src) // qdel - else - die() + switch (severity) + if (1) + del(src) + if (2) + if (prob(25)) + del(src) + else + take_damage(150) //should instakill most turrets + if (3) + take_damage(50) /obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0 health = 0 @@ -446,7 +458,7 @@ if(dst > 7) return 0 - if(ai) //If it's set to attack all non-silicons, target them! + if(check_synth) //If it's set to attack all non-silicons, target them! if(L.lying) return TURRET_SECONDARY_TARGET return TURRET_PRIORITY_TARGET @@ -460,7 +472,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, auth_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 @@ -512,7 +524,7 @@ /obj/machinery/porta_turret/on_assess_perp(mob/living/carbon/human/perp) - if((stun_all || attacked) && !allowed(perp)) + if((check_access || attacked) && !allowed(perp)) //if the turret has been attacked or is angry, target all non-authorized personnel, see req_access return 10 @@ -525,7 +537,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 @@ -570,12 +582,32 @@ spawn(1) A.process() -/obj/machinery/porta_turret/proc/setState(var/on, var/lethal) +/datum/turret_checks + var/on + var/lethal + var/check_synth + var/check_access + var/check_records + var/check_arrest + var/check_weapons + var/check_anomalies + var/ailock + +/obj/machinery/porta_turret/proc/setState(var/datum/turret_checks/TC) if(controllock) return - src.on = on - src.lethal = lethal - src.iconholder = lethal + src.on = TC.on + src.lethal = TC.lethal + src.iconholder = TC.lethal + + check_synth = TC.check_synth + check_access = TC.check_access + check_records = TC.check_records + check_arrest = TC.check_arrest + check_weapons = TC.check_weapons + check_anomalies = TC.check_anomalies + ailock = TC.ailock + src.power_change() /* diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm index e850058df90..9c5dfab8e4f 100644 --- a/code/game/machinery/seed_extractor.dm +++ b/code/game/machinery/seed_extractor.dm @@ -37,7 +37,7 @@ obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob else if(istype(O, /obj/item/stack/tile/grass)) var/obj/item/stack/tile/grass/S = O if (S.use(1)) - user << "You extract some seeds from the [S.name]." + user << "You extract some seeds from the grass tile." new /obj/item/seeds/grassseed(loc) return \ No newline at end of file diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index d625d6f27af..722c96d5839 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -46,7 +46,7 @@ src.updateUsrDialog() return var/mob/M = locate(href_list["traitormob"]) - if(M.mind.special_role) + if(M.mind.special_role || jobban_isbanned(M, "Syndicate")) temptext = "We have no need for you at this time. Have a pleasant day.
" src.updateUsrDialog() return 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/turret_control.dm b/code/game/machinery/turret_control.dm index b28d0a6e7f5..ce2a3b73ad3 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -17,7 +17,15 @@ var/lethal = 0 var/locked = 1 var/control_area //can be area name, path or nothing. - var/ailock = 0 // AI cannot use this + + var/check_arrest = 1 //checks if the perp is set to arrest + var/check_records = 1 //checks if a security record exists at all + var/check_weapons = 0 //checks if it can shoot people that have a weapon they aren't authorized to have + var/check_access = 1 //if this is active, the turret shoots everything that does not meet the access requirements + var/check_anomalies = 1 //checks if it can shoot at unidentified lifeforms (ie xenos) + var/check_synth = 0 //if active, will shoot at anything not an AI or cyborg + var/ailock = 0 // AI cannot use this + req_access = list(access_ai_upload) /obj/machinery/turretid/stun @@ -116,20 +124,34 @@ if (!istype(loc, /area)) return var/area/area = loc - var/t = "" + var/dat = "" - if(src.locked && (!istype(user, /mob/living/silicon))) - t += "
Swipe ID card to unlock interface
" + if(!locked || issilicon(user)) + dat += text({"

+ Lethal Mode: []
+ Neutralize All Non-Synthetics: []
"}, + + "[lethal ? "Enabled" : "Disabled"]", + "[check_synth ? "Yes" : "No"]") + if(!check_synth) + dat += text({"Check for Weapon Authorization: []
+ Check Security Records: []
+ Check Arrest Status: []
+ Neutralize All Non-Authorized Personnel: []
+ Neutralize All Unidentified Life Signs: []
"}, + + "[check_weapons ? "Yes" : "No"]", + "[check_records ? "Yes" : "No"]", + "[check_arrest ? "Yes" : "No"]", + "[check_access ? "Yes" : "No"]", + "[check_anomalies ? "Yes" : "No"]" ) else - if (!istype(user, /mob/living/silicon)) - t += "
Swipe ID card to lock interface
" - t += text("Turrets [] - []?
\n", src.enabled?"activated":"deactivated", src, src.enabled?"Disable":"Enable") - t += text("Currently set for [] - Change to []?
\n", src.lethal?"lethal":"stun repeatedly", src, src.lethal?"Stun repeatedly":"Lethal") + dat += "
Swipe ID card to unlock interface
" //user << browse(t, "window=turretid") //onclose(user, "turretid") - var/datum/browser/popup = new(user, "turretid", "Turret Control Panel ([area.name])", 500, 200) - popup.set_content(t) + var/datum/browser/popup = new(user, "turretid", "Turret Control Panel ([area.name])", 500, 500) + popup.set_content(dat) popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) popup.open() @@ -140,12 +162,25 @@ if(!can_use(usr)) return 1 - if (href_list["toggleOn"]) - src.enabled = !src.enabled - src.updateTurrets() - else if (href_list["toggleLethal"]) - src.lethal = !src.lethal - src.updateTurrets() + switch(href_list["operation"]) //toggles customizable behavioural protocols + if("toggleon") + enabled = !enabled + if("togglelethal") + lethal = !lethal + if("toggleai") + check_synth = !check_synth + if("authweapon") + check_weapons = !check_weapons + if("checkrecords") + check_records = !check_records + if("checkarrest") + check_arrest = !check_arrest + if("checkaccess") + check_access = !check_access + if("checkxenos") + check_anomalies = !check_anomalies + + src.updateTurrets() if(!nowindow) attack_hand(usr) @@ -156,9 +191,20 @@ ..() /obj/machinery/turretid/proc/updateTurrets() + var/datum/turret_checks/TC = new + TC.on = enabled + TC.lethal = lethal + TC.check_synth = check_synth + TC.check_access = check_access + TC.check_records = check_records + TC.check_arrest = check_arrest + TC.check_weapons = check_weapons + TC.check_anomalies = check_anomalies + TC.ailock = ailock + if(control_area) for (var/obj/machinery/porta_turret/aTurret in get_area_all_atoms(control_area)) - aTurret.setState(enabled, lethal) + aTurret.setState(TC) src.update_icon() /obj/machinery/turretid/power_change() @@ -177,3 +223,24 @@ icon_state = "control_stun" else icon_state = "control_standby" + +/obj/machinery/turretid/emp_act(severity) + if(enabled) + //if the turret is on, the EMP no matter how severe disables the turret for a while + //and scrambles its settings, with a slight chance of having an emag effect + + check_arrest = pick(0, 1) + check_records = pick(0, 1) + check_weapons = pick(0, 1) + check_access = pick(0, 0, 0, 0, 1) // check_access is a pretty big deal, so it's least likely to get turned on + check_anomalies = pick(0, 1) + + enabled=0 + updateTurrets() + + sleep(rand(60,600)) + if(!enabled) + enabled=1 + updateTurrets() + + ..() 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 1006a5f9409..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 @@ -636,7 +636,7 @@ /obj/mecha/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/device/mmi) || istype(W, /obj/item/device/mmi/posibrain)) + if(istype(W, /obj/item/device/mmi)) if(mmi_move_inside(W,user)) user << "[src]-MMI interface initialized successfuly" else @@ -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) @@ -1153,7 +1153,7 @@ src.occupant.client.perspective = MOB_PERSPECTIVE */ src.occupant << browse(null, "window=exosuit") - if(istype(mob_container, /obj/item/device/mmi) || istype(mob_container, /obj/item/device/mmi/posibrain)) + if(istype(mob_container, /obj/item/device/mmi)) var/obj/item/device/mmi/mmi = mob_container if(mmi.brainmob) occupant.loc = mmi @@ -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/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm index 5a575f5e151..68f60816fa7 100644 --- a/code/game/objects/effects/decals/contraband.dm +++ b/code/game/objects/effects/decals/contraband.dm @@ -31,18 +31,19 @@ obj/structure/sign/poster icon = 'icons/obj/contraband.dmi' anchored = 1 var/serial_number //Will hold the value of src.loc if nobody initialises it + var/poster_type //So mappers can specify a desired poster var/ruined = 0 - obj/structure/sign/poster/New(var/serial) - - serial_number = serial - - if(serial_number == loc) - serial_number = rand(1, poster_designs.len) //This is for the mappers that want individual posters without having to use rolled posters. - - var/designtype = poster_designs[serial_number] - var/datum/poster/design=new designtype + var/designtype + if (poster_type) + designtype = text2path(poster_type) + else + if(serial_number == loc) + serial_number = rand(1, poster_designs.len) //This is for the mappers that want individual posters without having to use rolled posters. + designtype = poster_designs[serial_number] + + var/datum/poster/design=new designtype() name += " - [design.name]" desc += " [design.desc]" icon_state = design.icon_state // poster[serial_number] diff --git a/code/game/objects/effects/decals/posters/bs12.dm b/code/game/objects/effects/decals/posters/bs12.dm index b21fcc3ee3b..73700472334 100644 --- a/code/game/objects/effects/decals/posters/bs12.dm +++ b/code/game/objects/effects/decals/posters/bs12.dm @@ -244,3 +244,7 @@ name = "Engineering recruitment" desc = "This is a poster showing an engineer relaxing by a computer, the text states \"Living the life! Join Engineering today!\"" +/datum/poster/bay_50 + icon_state="bsposter50" + name = "Pinup Girl Cindy Kate" + desc = "This particular one is of Cindy Kate, a seductive performer well known among less savoury circles." //idk \ No newline at end of file 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/devices/radio/encryptionkey.dm b/code/game/objects/items/devices/radio/encryptionkey.dm index e3e4408a47e..8067fd33293 100644 --- a/code/game/objects/items/devices/radio/encryptionkey.dm +++ b/code/game/objects/items/devices/radio/encryptionkey.dm @@ -1,7 +1,7 @@ /obj/item/device/encryptionkey/ name = "Standard Encrpytion Key" - desc = "An encyption key for a radio headset. Contains cypherkeys." + desc = "An encryption key for a radio headset. Contains cypherkeys." icon = 'icons/obj/radio.dmi' icon_state = "cypherkey" item_state = "" diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 22976e9cb53..b28fe2cac17 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -32,8 +32,6 @@ /obj/item/device/radio/intercom/receive_range(freq, level) if (!on) return -1 - if (!(src.wires & WIRE_RECEIVE)) - return -1 if(!(0 in level)) var/turf/position = get_turf(src) if(isnull(position) || !(position.z in level)) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index f818f59ddc6..dad292fd472 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -135,11 +135,11 @@ return else if (href_list["talk"]) - broadcasting = text2num(href_list["talk"]) + broadcasting = !(wires.IsIndexCut(WIRE_TRANSMIT) || wires.IsIndexCut(WIRE_SIGNAL)) && text2num(href_list["talk"]) else if (href_list["listen"]) var/chan_name = href_list["ch_name"] if (!chan_name) - listening = text2num(href_list["listen"]) + listening = !(wires.IsIndexCut(WIRE_RECEIVE) || wires.IsIndexCut(WIRE_SIGNAL)) && text2num(href_list["listen"]) else if (channels[chan_name] & FREQ_LISTENING) channels[chan_name] &= ~FREQ_LISTENING 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/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm index 776062c1b94..d28586b0a21 100644 --- a/code/game/objects/items/weapons/storage/uplink_kits.dm +++ b/code/game/objects/items/weapons/storage/uplink_kits.dm @@ -9,7 +9,6 @@ new /obj/item/clothing/shoes/syndigaloshes(src) return - if ("stealth") if("stealth") new /obj/item/weapon/gun/energy/crossbow(src) new /obj/item/weapon/pen/paralysis(src) @@ -22,6 +21,8 @@ new /obj/item/device/powersink(src) new /obj/item/clothing/suit/space/syndicate(src) new /obj/item/clothing/head/helmet/space/syndicate(src) + new /obj/item/clothing/mask/gas/syndicate(src) + new /obj/item/weapon/tank/emergency_oxygen/double(src) return if("guns") @@ -55,6 +56,8 @@ new /obj/item/device/radio/beacon/syndicate(src) new /obj/item/clothing/suit/space/syndicate(src) new /obj/item/clothing/head/helmet/space/syndicate(src) + new /obj/item/clothing/mask/gas/syndicate(src) + new /obj/item/weapon/tank/emergency_oxygen/double(src) new /obj/item/weapon/card/emag(src) return @@ -116,7 +119,10 @@ ..() new /obj/item/clothing/suit/space/syndicate(src) new /obj/item/clothing/head/helmet/space/syndicate(src) + new /obj/item/clothing/mask/gas/syndicate(src) + new /obj/item/weapon/tank/emergency_oxygen/double(src) return + /obj/item/weapon/storage/box/syndie_kit/chameleon name = "Chameleon Kit" desc = "Comes with all the clothes you need to impersonate most people. Acting lessons sold seperately." 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/door_assembly.dm b/code/game/objects/structures/door_assembly.dm index 17e34e4efd2..9fbf63ba182 100644 --- a/code/game/objects/structures/door_assembly.dm +++ b/code/game/objects/structures/door_assembly.dm @@ -205,7 +205,7 @@ obj/structure/door_assembly new/obj/item/stack/cable_coil(src.loc, 1) src.state = 0 - else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1 && W:icon_state != "door_electronics_smoked") + else if(istype(W, /obj/item/weapon/airlock_electronics) && state == 1) playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1) user.visible_message("[user] installs the electronics into the airlock assembly.", "You start to install electronics into the airlock assembly.") @@ -219,6 +219,12 @@ obj/structure/door_assembly src.electronics = W else if(istype(W, /obj/item/weapon/crowbar) && state == 2 ) + //This should never happen, but just in case I guess + if (!electronics) + user << "There was nothing to remove." + src.state = 1 + return + playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1) user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove the electronics from the airlock assembly.") @@ -227,13 +233,8 @@ obj/structure/door_assembly user << "\blue You removed the airlock electronics!" src.state = 1 src.name = "Wired Airlock Assembly" - var/obj/item/weapon/airlock_electronics/ae - if (!electronics) - ae = new/obj/item/weapon/airlock_electronics( src.loc ) - else - ae = electronics - electronics = null - ae.loc = src.loc + electronics.loc = src.loc + electronics = null else if(istype(W, /obj/item/stack/sheet) && !glass) var/obj/item/stack/sheet/S = W @@ -271,22 +272,7 @@ obj/structure/door_assembly else path = text2path("/obj/machinery/door/airlock[airlock_type]") - var/obj/machinery/door/airlock/door = new path(src.loc) - - door.assembly_type = type - door.electronics = src.electronics - if (istype(electronics, /obj/item/weapon/airlock_electronics/secure)) - door.wires = new/datum/wires/airlock/secure(src) - if(src.electronics.one_access) - door.req_access = null - door.req_one_access = src.electronics.conf_access - else - door.req_access = src.electronics.conf_access - if(created_name) - door.name = created_name - else - door.name = "[istext(glass) ? "[glass] airlock" : base_name]" - src.electronics.loc = door + new path(src.loc, src) del(src) else ..() 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..4ac8aa6c465 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -214,7 +214,7 @@ visible_message("[user] dismantles \the [src].") if(dir == SOUTHWEST) var/obj/item/stack/sheet/mats = new glasstype(loc) - mats.amount = 2 + mats.amount = is_fulltile() ? 4 : 2 else new glasstype(loc) del(src) @@ -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/client procs.dm b/code/modules/client/client procs.dm index eae64acc1ef..4fa4db8b188 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -299,5 +299,6 @@ 'icons/spideros_icons/sos_12.png', 'icons/spideros_icons/sos_13.png', 'icons/spideros_icons/sos_14.png', - 'html/images/ntlogo.png' + 'html/images/ntlogo.png', + 'html/images/talisman.png' ) 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 b3f954703c0..7b7e2374d4c 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -103,7 +103,7 @@ return 1 // Okay, it wasn't a terminal being touched, check for all the simple insertions. - if(input_device.type in list(/obj/item/device/paicard, /obj/item/device/mmi, /obj/item/device/mmi/posibrain)) + if(input_device.type in list(/obj/item/device/paicard, /obj/item/device/mmi, /obj/item/device/mmi/digital/posibrain)) integrate_ai(input_device,user) return 1 @@ -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/maps/reader.dm b/code/modules/maps/reader.dm index d67b156863c..66ebb13c725 100644 --- a/code/modules/maps/reader.dm +++ b/code/modules/maps/reader.dm @@ -156,24 +156,41 @@ //The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile - //first instance the /area and remove it from the members list - var/length = members.len - var/atom/instance - var/dmm_suite/preloader/_preloader = new(members_attributes[length])//preloader for assigning set variables on atom creation + //in case of multiples turfs on one tile, + //will contains the images of all underlying turfs, to simulate the DMM multiple tiles piling + var/list/turfs_underlays = list() - instance = locate(members[length]) + //first instance the /area and remove it from the members list + index = members.len + var/atom/instance + var/dmm_suite/preloader/_preloader = new(members_attributes[index])//preloader for assigning set variables on atom creation + + instance = locate(members[index]) instance.contents.Add(locate(xcrd,ycrd,zcrd)) if(_preloader && instance) _preloader.load(instance) - members.Remove(members[length]) + members.Remove(members[index]) - //then instance the /turf and remove it from the members list - length = members.len + //then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect + + var/first_turf_index = 1 + while(!ispath(members[first_turf_index],/turf)) //find first /turf object in members + first_turf_index++ + + //instanciate the first /turf + var/turf/T = instance_atom(members[first_turf_index],members_attributes[first_turf_index],xcrd,ycrd,zcrd) + + //if others /turf are presents, simulates the underlays piling effect + index = first_turf_index + 1 + while(index <= members.len) + turfs_underlays.Insert(1,image(T.icon,null,T.icon_state,T.layer,T.dir))//add the current turf image to the underlays list + var/turf/UT = instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd)//instance new turf + add_underlying_turf(UT,T,turfs_underlays)//simulates the DMM piling effect + T = UT + index++ - instance_atom(members[length],members_attributes[length],xcrd,ycrd,zcrd) - members.Remove(members[length]) //Replace the previous part of the code with this if it's unsafe to assume tiles have ALWAYS an /area AND a /turf /*while(members.len > 0) @@ -203,8 +220,8 @@ */ //finally instance all remainings objects/mobs - for(var/k=1,k<=members.len,k++) - instance_atom(members[k],members_attributes[k],xcrd,ycrd,zcrd) + for(index=1,index < first_turf_index,index++) + instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd) //////////////// //Helpers procs @@ -220,6 +237,8 @@ if(_preloader && instance)//second preloader pass, as some variables may have been reset/changed by New() _preloader.load(instance) + return instance + //text trimming (both directions) helper proc //optionally removes quotes before and after the text (for variable name) /dmm_suite/proc/trim_text(var/what as text,var/trim_quotes=0) @@ -296,8 +315,16 @@ return to_return +//simulates the DM multiple turfs on one tile underlaying +/dmm_suite/proc/add_underlying_turf(var/turf/placed,var/turf/underturf, var/list/turfs_underlays) + if(underturf.density) + placed.density = 1 + if(underturf.opacity) + placed.opacity = 1 + placed.underlays += turfs_underlays + //atom creation method that preloads variables before creation -atom/New(atom/loc, dmm_suite/preloader/_dmm_preloader) +/atom/New(atom/loc, dmm_suite/preloader/_dmm_preloader) if(istype(_dmm_preloader, /dmm_suite/preloader)) _dmm_preloader.load(src) . = ..() @@ -319,4 +346,4 @@ atom/New(atom/loc, dmm_suite/preloader/_dmm_preloader) /dmm_suite/preloader/proc/load(atom/what) for(var/attribute in attributes) what.vars[attribute] = attributes[attribute] - Del() \ No newline at end of file + Del() 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..f94fceffcf1 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -22,6 +22,7 @@ universal_speak = 1 var/atom/movable/following = null var/admin_ghosted = 0 + var/anonsay = 0 /mob/dead/observer/New(mob/body) sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF @@ -168,7 +169,15 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(stat == DEAD) announce_ghost_joinleave(ghostize(1)) else - var/response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost, you won't be able to play this round for another 30 minutes! You can't change your mind so choose wisely!)","Are you sure you want to ghost?","Ghost","Stay in body") + var/response + if(src.client && src.client.holder) + response = alert(src, "You have the ability to Admin-Ghost. The regular Ghost verb will announce your presence to dead chat. Both variants will allow you to return to your body using 'aghost'.\n\nWhat do you wish to do?", "Are you sure you want to ghost?", "Ghost", "Admin Ghost", "Stay in body") + if(response == "Admin Ghost") + if(!src.client) + return + src.client.admin_ghost() + else + response = alert(src, "Are you -sure- you want to ghost?\n(You are alive. If you ghost, you won't be able to play this round for another 30 minutes! You can't change your mind so choose wisely!)", "Are you sure you want to ghost?", "Ghost", "Stay in body") if(response != "Ghost") return resting = 1 @@ -182,7 +191,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) @@ -580,8 +589,19 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp toggled_invisible = world.time visible_message("It fades from sight...", "You are now invisible") else - src << "You are now visible" invisibility = invisibility == INVISIBILITY_OBSERVER ? 0 : INVISIBILITY_OBSERVER // Give the ghost a cult icon which should be visible only to itself toggle_icon("cult") + +/mob/dead/observer/verb/toggle_anonsay() + set category = "Ghost" + set name = "Toggle Anonymous Chat" + set desc = "Toggles showing your key in dead chat." + + src.anonsay = !src.anonsay + if(anonsay) + src << "Your key won't be shown when you speak in dead chat." + else + src << "Your key will be publicly visible again." diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index f7c85f0b710..546e0ec81a4 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -1,5 +1,22 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 +/obj/item/device/mmi/digital/New() + src.brainmob = new(src) + src.brainmob.add_language("Binary") + src.brainmob.loc = src + src.brainmob.container = src + src.brainmob.stat = 0 + src.brainmob.silent = 0 + dead_mob_list -= src.brainmob + +/obj/item/device/mmi/digital/transfer_identity(var/mob/living/carbon/H) + brainmob.dna = H.dna + brainmob.timeofhostdeath = H.timeofdeath + brainmob.stat = 0 + if(H.mind) + H.mind.transfer_to(brainmob) + return + /obj/item/device/mmi name = "Man-Machine Interface" desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity." diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index 0917381c4df..08f2e34243b 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -1,4 +1,4 @@ -/obj/item/device/mmi/posibrain +/obj/item/device/mmi/digital/posibrain name = "positronic brain" desc = "A cube of shining metal, four inches to a side and covered in shallow grooves." icon = 'icons/obj/assemblies.dmi' @@ -15,7 +15,7 @@ mecha = null//This does not appear to be used outside of reference in mecha.dm. -/obj/item/device/mmi/posibrain/attack_self(mob/user as mob) +/obj/item/device/mmi/digital/posibrain/attack_self(mob/user as mob) if(brainmob && !brainmob.key && searching == 0) //Start the process of searching for a new user. user << "\blue You carefully locate the manual activation switch and start the positronic brain's boot process." @@ -24,7 +24,7 @@ src.request_player() spawn(600) reset_search() -/obj/item/device/mmi/posibrain/proc/request_player() +/obj/item/device/mmi/digital/posibrain/proc/request_player() for(var/mob/dead/observer/O in player_list) if(O.has_enabled_antagHUD == 1 && config.antag_hud_restricted) continue @@ -34,7 +34,7 @@ if(O.client.prefs.be_special & BE_AI) question(O.client) -/obj/item/device/mmi/posibrain/proc/question(var/client/C) +/obj/item/device/mmi/digital/posibrain/proc/question(var/client/C) spawn(0) if(!C) return var/response = alert(C, "Someone is requesting a personality for a positronic brain. Would you like to play as one?", "Positronic brain request", "Yes", "No", "Never for this round") @@ -47,26 +47,15 @@ C.prefs.be_special ^= BE_AI -/obj/item/device/mmi/posibrain/transfer_identity(var/mob/living/carbon/H) - /* - Positronic brains should have posibrain-like name, instead of human-MMIlike names. -- ATL - - name = "positronic brain ([H])" - brainmob.name = H.real_name - brainmob.real_name = H.real_name - */ - brainmob.dna = H.dna - brainmob.timeofhostdeath = H.timeofdeath - brainmob.stat = 0 +/obj/item/device/mmi/digital/posibrain/transfer_identity(var/mob/living/carbon/H) + ..() if(brainmob.mind) brainmob.mind.assigned_role = "Positronic Brain" - if(H.mind) - H.mind.transfer_to(brainmob) - brainmob << "\blue You feel slightly disoriented. That's normal when you're just a metal cube." + brainmob << "You feel slightly disoriented. That's normal when you're just a metal cube." icon_state = "posibrain-occupied" return -/obj/item/device/mmi/posibrain/proc/transfer_personality(var/mob/candidate) +/obj/item/device/mmi/digital/posibrain/proc/transfer_personality(var/mob/candidate) announce_ghost_joinleave(candidate, 0, "They are occupying a positronic brain now.") src.searching = 0 src.brainmob.mind = candidate.mind @@ -83,7 +72,7 @@ M.show_message("\blue The positronic brain chimes quietly.") icon_state = "posibrain-occupied" -/obj/item/device/mmi/posibrain/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer. +/obj/item/device/mmi/digital/posibrain/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer. if(src.brainmob && src.brainmob.key) return @@ -94,10 +83,10 @@ for (var/mob/M in viewers(T)) M.show_message("\blue The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?") -/obj/item/device/mmi/posibrain/examine(mob/user) +/obj/item/device/mmi/digital/posibrain/examine(mob/user) if(!..(user)) return - + var/msg = "*---------*\nThis is \icon[src] \a [src]!\n[desc]\n" msg += "" @@ -113,7 +102,7 @@ user << msg return -/obj/item/device/mmi/posibrain/emp_act(severity) +/obj/item/device/mmi/digital/posibrain/emp_act(severity) if(!src.brainmob) return else @@ -126,16 +115,7 @@ src.brainmob.emp_damage += rand(0,10) ..() -/obj/item/device/mmi/posibrain/New() - - src.brainmob = new(src) - src.brainmob.add_language("Binary") +/obj/item/device/mmi/digital/posibrain/New() + ..() src.brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]" src.brainmob.real_name = src.brainmob.name - src.brainmob.loc = src - src.brainmob.container = src - src.brainmob.stat = 0 - src.brainmob.silent = 0 - dead_mob_list -= src.brainmob - - ..() diff --git a/code/modules/mob/living/carbon/brain/robot.dm b/code/modules/mob/living/carbon/brain/robot.dm new file mode 100644 index 00000000000..bc7a13c2c2a --- /dev/null +++ b/code/modules/mob/living/carbon/brain/robot.dm @@ -0,0 +1,19 @@ +/obj/item/device/mmi/digital/robot + name = "robotic intelligence circuit" + desc = "The pinnacle of artifical intelligence which can be achieved using classical computer science." + icon = 'icons/obj/module.dmi' + icon_state = "mainboard" + w_class = 3 + origin_tech = "engineering=4;materials=3;programming=4" + +/obj/item/device/mmi/digital/robot/New() + ..() + src.brainmob.name = "[pick(list("ADA","DOS","GNU","MAC","WIN"))]-[rand(1000, 9999)]" + src.brainmob.real_name = src.brainmob.name + +/obj/item/device/mmi/digital/robot/transfer_identity(var/mob/living/carbon/H) + ..() + if(brainmob.mind) + brainmob.mind.assigned_role = "Robotic Intelligence" + brainmob << "You feel slightly disoriented. That's normal when you're little more than a complex circuit." + return diff --git a/code/modules/mob/living/carbon/brain/say.dm b/code/modules/mob/living/carbon/brain/say.dm index 4756cc88ad4..6c2394eb614 100644 --- a/code/modules/mob/living/carbon/brain/say.dm +++ b/code/modules/mob/living/carbon/brain/say.dm @@ -3,7 +3,7 @@ if (silent) return - if(!(container && (istype(container, /obj/item/device/mmi) || istype(container, /obj/item/device/mmi/posibrain)))) + if(!(container && istype(container, /obj/item/device/mmi))) return //No MMI, can't speak, bucko./N else if(prob(emp_damage*4)) 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..086a1ef0aa4 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -100,115 +100,82 @@ 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, 5) + 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) + /* + This is kind of convoluted, but it seems to break down like this: + (note that the chance to miss is exaggerated here since ran_zone() might roll "chest" + + If aiming for chest: + 80% chance you hit your target + 17% chance you hit a random zone + 3% chance you miss + + If aiming for something else: + 68% chance you hit your target + 17% chance you hit a random zone + 15% chance you miss + + Why don't we just use get_zone_with_miss_chance() ??? + */ 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..064819b2cd8 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -59,7 +59,7 @@ var/used_skillpoints = 0 var/skill_specialization = null - var/list/skills = null + var/list/skills = list() var/icon/stand_icon = null var/icon/lying_icon = null @@ -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..67eb8f86e09 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -222,7 +222,7 @@ language = "Sinta'unathi" tail = "sogtail" unarmed_type = /datum/unarmed_attack/claws - secondary_unarmed_type = /datum/unarmed_attack/bite/strong + secondary_unarmed_type = /datum/unarmed_attack/bite/sharp primitive = /mob/living/carbon/monkey/unathi darksight = 3 gluttonous = 1 @@ -250,7 +250,7 @@ language = "Siik'tajr" tail = "tajtail" unarmed_type = /datum/unarmed_attack/claws - secondary_unarmed_type = /datum/unarmed_attack/bite/eye_tooth + secondary_unarmed_type = /datum/unarmed_attack/bite/sharp darksight = 8 cold_level_1 = 200 //Default 260 @@ -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. @@ -694,4 +546,4 @@ if(slot_w_uniform in equip_slots) equip_slots |= slot_tie - equip_slots |= slot_legcuffed \ No newline at end of file + equip_slots |= slot_legcuffed 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..b96d9b6fdb5 --- /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] looks dazed.", "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!", "[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("bit") + attack_sound = 'sound/weapons/bite.ogg' + shredding = 0 + damage = 0 + sharp = 0 + edge = 0 + +/datum/unarmed_attack/bite/sharp //eye teeth + attack_verb = list("bit", "chomped on") + 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("punched") + attack_noun = list("fist") + damage = 0 + +/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)] \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] [pick(attack_verb)] [target] in \his [organ]!") + if(5) user.visible_message("[user] slams \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", "slams 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("lashed", "bludgeoned") + attack_noun = list("tendril") + damage = 5 + +/datum/unarmed_attack/claws + attack_verb = list("scratched", "clawed", "slashed") + 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)] \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)] [target]'s [pick("head", "neck")] [pick("", "", "", "with spread [pick(attack_noun)]")]!") + if(5) user.visible_message("[pick("[user] [pick(attack_verb)] [target] across \his face!", "[user] rakes \his [pick(attack_noun)] across [target]'s 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)] [pick("", "", "the side of")] [target]'s [affecting.display_name]!") + if(5) user.visible_message("[user] tears \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 diff --git a/code/modules/mob/living/carbon/metroid/subtypes.dm b/code/modules/mob/living/carbon/metroid/subtypes.dm index 3b7e0107abb..9db9e7b02f9 100644 --- a/code/modules/mob/living/carbon/metroid/subtypes.dm +++ b/code/modules/mob/living/carbon/metroid/subtypes.dm @@ -31,24 +31,24 @@ proc/mutation_table(var/colour) //Tier 3 if("dark blue") slime_mutation[1] = "purple" - slime_mutation[2] = "blue" - slime_mutation[3] = "cerulean" - slime_mutation[4] = "cerulean" + slime_mutation[2] = "purple" + slime_mutation[3] = "blue" + slime_mutation[4] = "blue" if("dark purple") slime_mutation[1] = "purple" - slime_mutation[2] = "orange" - slime_mutation[3] = "sepia" - slime_mutation[4] = "sepia" + slime_mutation[2] = "purple" + slime_mutation[3] = "orange" + slime_mutation[4] = "orange" if("yellow") slime_mutation[1] = "metal" - slime_mutation[2] = "orange" - slime_mutation[3] = "bluespace" - slime_mutation[4] = "bluespace" + slime_mutation[2] = "metal" + slime_mutation[3] = "orange" + slime_mutation[4] = "orange" if("silver") slime_mutation[1] = "metal" - slime_mutation[2] = "blue" - slime_mutation[3] = "pyrite" - slime_mutation[4] = "pyrite" + slime_mutation[2] = "metal" + slime_mutation[3] = "blue" + slime_mutation[4] = "blue" //Tier 4 if("pink") slime_mutation[1] = "pink" 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 4a70e8e6510..77aa73cb72b 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -45,6 +45,7 @@ var/list/ai_verbs_default = list( anchored = 1 // -- TLE density = 1 status_flags = CANSTUN|CANPARALYSE + shouldnt_see = list(/obj/effect/rune) var/list/network = list("SS13") var/obj/machinery/camera/camera = null var/list/connected_robots = list() @@ -71,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 = "" @@ -129,7 +131,7 @@ var/list/ai_verbs_default = list( //Languages add_language("Robot Talk", 1) - add_language("Galactic Common", 0) + add_language("Galactic Common", 1) add_language("Sol Common", 0) add_language("Sinta'unathi", 0) add_language("Siik'tajr", 0) @@ -228,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/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 68310e4d14f..d8bf9706fd8 100755 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -339,6 +339,7 @@ chassis = possible_chassis[choice] verbs -= /mob/living/silicon/pai/proc/choose_chassis + verbs += /mob/living/proc/hide /mob/living/silicon/pai/proc/choose_verbs() set category = "pAI Commands" 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 3db1a97d7e8..f2aa919eb00 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -78,25 +78,22 @@ var/list/robot_verbs_default = list( var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them. var/braintype = "Cyborg" -/mob/living/silicon/robot/drain_power(var/drain_check) +/mob/living/silicon/robot/syndicate + lawupdate = 0 + scrambledcodes = 1 + icon_state = "securityrobot" + modtype = "Security" + lawchannel = "State" - if(drain_check) - return 1 +/mob/living/silicon/robot/syndicate/New() + if(!cell) + cell = new /obj/item/weapon/cell(src) + cell.maxcharge = 25000 + cell.charge = 25000 - if(!cell || !cell.charge) - return 0 + ..() - if(cell.charge) - src << "Warning: Unauthorized access through power channel 12 detected." - var/drained_power = rand(200,400) - if(cell.charge < drained_power) - drained_power = cell.charge - cell.use(drained_power) - return drained_power - - return 0 - -/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0) +/mob/living/silicon/robot/New(loc,var/unfinished = 0) spark_system = new /datum/effect/effect/system/spark_spread() spark_system.set_up(5, 0, src) spark_system.attach(src) @@ -112,23 +109,11 @@ var/list/robot_verbs_default = list( updatename("Default") updateicon() - if(syndie) - if(!cell) - cell = new /obj/item/weapon/cell(src) - - laws = new /datum/ai_laws/antimov() - lawupdate = 0 - scrambledcodes = 1 - cell.maxcharge = 25000 - cell.charge = 25000 - module = new /obj/item/weapon/robot_module/syndicate(src) - hands.icon_state = "standard" - icon_state = "secborg" - modtype = "Security" - init() - radio = new /obj/item/device/radio/borg(src) common_radio = radio + + init() + if(!scrambledcodes && !camera) camera = new /obj/machinery/camera(src) camera.c_tag = real_name @@ -182,6 +167,36 @@ var/list/robot_verbs_default = list( playsound(loc, 'sound/voice/liveagain.ogg', 75, 1) +/mob/living/silicon/robot/syndicate/init() + aiCamera = new/obj/item/device/camera/siliconcam/robot_camera(src) + + laws = new /datum/ai_laws/syndicate_override + module = new /obj/item/weapon/robot_module/syndicate(src) + + radio.keyslot = new /obj/item/device/encryptionkey/syndicate(radio) + radio.recalculateChannels() + + playsound(loc, 'sound/mecha/nominalsyndi.ogg', 75, 0) + + +/mob/living/silicon/robot/drain_power(var/drain_check) + + if(drain_check) + return 1 + + if(!cell || !cell.charge) + return 0 + + if(cell.charge) + src << "Warning: Unauthorized access through power channel 12 detected." + var/drained_power = rand(200,400) + if(cell.charge < drained_power) + drained_power = cell.charge + cell.use(drained_power) + return drained_power + + return 0 + // setup the PDA and its name /mob/living/silicon/robot/proc/setup_PDA() if (!rbPDA) @@ -249,7 +264,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 +275,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 +287,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) @@ -339,13 +355,14 @@ var/list/robot_verbs_default = list( /mob/living/silicon/robot/proc/updatename(var/prefix as text) if(prefix) modtype = prefix - if(mmi) - if(istype(mmi, /obj/item/device/mmi/posibrain)) - braintype = "Android" - else - braintype = "Cyborg" - else + + if(istype(mmi, /obj/item/device/mmi/digital/posibrain)) + braintype = "Android" + else if(istype(mmi, /obj/item/device/mmi/digital/robot)) braintype = "Robot" + else + braintype = "Cyborg" + var/changed_name = "" if(custom_name) @@ -1291,6 +1308,16 @@ var/list/robot_verbs_default = list( return 1 return 0 +/mob/living/silicon/robot/syndicate/canUseTopic(atom/movable/M) + if(stat || lockcharge || stunned || weakened) + return + if(z in config.admin_levels) + return 1 + if(istype(M, /obj/machinery)) + var/obj/machinery/Machine = M + return Machine.emagged + return 1 + /mob/living/silicon/robot/proc/notify_ai(var/notifytype, var/oldname, var/newname) if(!connected_ai) return @@ -1300,4 +1327,4 @@ var/list/robot_verbs_default = list( if(2) //New Module connected_ai << "

NOTICE - Cyborg module change detected: [name] has loaded the [module.name] module.
" if(3) //New Name - connected_ai << "

NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].
" \ No newline at end of file + connected_ai << "

NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].
" diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 57cf8b1c620..2fd766d65a6 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,20 +367,39 @@ 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 /obj/item/weapon/robot_module/syndicate name = "illegal robot module" - New() + New(var/mob/living/silicon/robot/R) + loc = R + src.modules += new /obj/item/device/flashlight(src) src.modules += new /obj/item/device/flash(src) src.modules += new /obj/item/weapon/melee/energy/sword(src) src.modules += new /obj/item/weapon/gun/energy/pulse_rifle/destroyer(src) src.modules += new /obj/item/weapon/card/emag(src) + + var/jetpack = new/obj/item/weapon/tank/jetpack/carbondioxide(src) + src.modules += jetpack + R.internals = jetpack + return +/obj/item/weapon/robot_module/syndicate/add_languages(var/mob/living/silicon/robot/R) + //full set of languages + R.add_language("Sol Common", 1) + R.add_language("Tradeband", 1) + R.add_language("Sinta'unathi", 0) + R.add_language("Siik'tajr", 0) + R.add_language("Skrellian", 0) + R.add_language("Gutter", 1) + /obj/item/weapon/robot_module/combat name = "combat robot module" @@ -406,7 +427,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/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index bf64e9265b6..4122e3a2101 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -43,7 +43,7 @@ /mob/living/simple_animal/spiderbot/attackby(var/obj/item/O as obj, var/mob/user as mob) - if(istype(O, /obj/item/device/mmi) || istype(O, /obj/item/device/mmi/posibrain)) + if(istype(O, /obj/item/device/mmi)) var/obj/item/device/mmi/B = O if(src.mmi) //There's already a brain in it. user << "\red There's already a brain in [src]!" @@ -164,14 +164,12 @@ death() /mob/living/simple_animal/spiderbot/proc/update_icon() - if(mmi) - if(istype(mmi,/obj/item/device/mmi)) - icon_state = "spiderbot-chassis-mmi" - icon_living = "spiderbot-chassis-mmi" - if(istype(mmi, /obj/item/device/mmi/posibrain)) - icon_state = "spiderbot-chassis-posi" - icon_living = "spiderbot-chassis-posi" - + if(istype(mmi, /obj/item/device/mmi/digital/posibrain)) + icon_state = "spiderbot-chassis-posi" + icon_living = "spiderbot-chassis-posi" + else if(istype(mmi,/obj/item/device/mmi)) + icon_state = "spiderbot-chassis-mmi" + icon_living = "spiderbot-chassis-mmi" else icon_state = "spiderbot-chassis" icon_living = "spiderbot-chassis" 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 01ec915f70d..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 @@ -823,6 +820,8 @@ note dizziness decrements automatically in the mob's Life() proc. for(var/atom/A in listed_turf) if(A.invisibility > see_invisible) continue + if(is_type_in_list(A, shouldnt_see)) + continue statpanel(listed_turf.name, null, A) if(spell_list && spell_list.len) @@ -906,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_defines.dm b/code/modules/mob/mob_defines.dm index d1edb9cdcfa..15e0db47fc8 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -217,6 +217,7 @@ var/immune_to_ssd = 0 - var/turf/listed_turf = null //the current turf being examined in the stat panel + var/turf/listed_turf = null //the current turf being examined in the stat panel + var/list/shouldnt_see = list() //list of objects that this mob shouldn't see in the stat panel. this silliness is needed because of AI alt+click and cult blood runes var/list/active_genes=list() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index daddf617f70..177651f7dff 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -471,9 +471,10 @@ proc/is_blind(A) //I know you can't see the change, but I rewrote the name code. It is significantly less messy now /proc/say_dead_direct(var/message, var/mob/subject = null) var/name + var/keyname if(subject && subject.client) var/client/C = subject.client - var/keyname = (C.holder && C.holder.fakekey) ? C.holder.fakekey : C.key + keyname = (C.holder && C.holder.fakekey) ? C.holder.fakekey : C.key if(C.mob) //Most of the time this is the dead/observer mob; we can totally use him if there is no better name var/mindname var/realname = C.mob.real_name @@ -485,17 +486,30 @@ proc/is_blind(A) name = "[realname] died as [mindname]" else name = realname - name = "[keyname] ([name]) " for(var/mob/M in player_list) if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && !is_mentor(M.client))) && (M.client.prefs.toggles & CHAT_DEAD)) - var/follow = "" + var/follow + var/lname if(subject) if(subject != M) follow = "(follow) " if(M.stat != DEAD && M.client.holder) follow = "(JMP) " - M << "" + create_text_tag("dead", "DEAD:", M.client) + " [name][follow][message]" + var/mob/dead/observer/DM + if(istype(subject, /mob/dead/observer)) + DM = subject + if(M.client.holder) // What admins see + lname = "[keyname][(DM && DM.anonsay) ? "*" : (DM ? "" : "^")] ([name])" + else + if(DM && DM.anonsay) // If the person is actually observer they have the option to be anonymous + lname = "Ghost of [name]" + else if(DM) // Non-anons + lname = "[keyname] ([name])" + else // Everyone else (dead people who didn't ghost yet, etc.) + lname = name + lname = "[lname] " + M << "" + create_text_tag("dead", "DEAD:", M.client) + " [lname][follow][message]" //Announces that a ghost has joined/left, mainly for use with wizards /proc/announce_ghost_joinleave(O, var/joined_ghosts = 1, var/message = "") 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 363b1b9c41d..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) @@ -375,7 +375,10 @@ var/mins = (mills % 36000) / 600 var/hours = mills / 36000 + var/name = client.prefs.be_random_name ? "friend" : client.prefs.real_name + var/dat = "
" + dat += "Welcome, [name].
" dat += "Round Duration: [round(hours)]h [round(mins)]m
" if(emergency_shuttle) //In case Nanotrasen decides reposess CentComm's shuttles. diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index d5d7a0791f1..b4530b07674 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -158,14 +158,13 @@ O.job = "Cyborg" if(O.mind.assigned_role == "Cyborg") if(O.mind.role_alt_title == "Android") - O.mmi = new /obj/item/device/mmi/posibrain(O) + O.mmi = new /obj/item/device/mmi/digital/posibrain(O) else if(O.mind.role_alt_title == "Robot") - O.mmi = null //Robots do not have removable brains. + O.mmi = new /obj/item/device/mmi/digital/robot(O) else O.mmi = new /obj/item/device/mmi(O) - if(O.mmi) - O.mmi.transfer_identity(src) + O.mmi.transfer_identity(src) callHook("borgify", list(O)) O.notify_ai(1) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index c0c23975188..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)) @@ -1168,7 +1168,7 @@ obj/item/weapon/organ/head/attackby(obj/item/weapon/W as obj, mob/user as mob) //TODO: ORGAN REMOVAL UPDATE. if(istype(src,/obj/item/weapon/organ/head/posi)) - var/obj/item/device/mmi/posibrain/B = new(loc) + var/obj/item/device/mmi/digital/posibrain/B = new(loc) B.transfer_identity(brainmob) else var/obj/item/organ/brain/B = new(loc) 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/fractal_reactor.dm b/code/modules/power/fractal_reactor.dm index 51b39bec77f..54b46bb92ff 100644 --- a/code/modules/power/fractal_reactor.dm +++ b/code/modules/power/fractal_reactor.dm @@ -5,18 +5,20 @@ /obj/machinery/power/fractal_reactor name = "Fractal Energy Reactor" - desc = "This thing drains power from fractal-subspace. (DEBUG ITEM: INFINITE POWERSOURCE FOR MAP TESTING. CONTACT DEVELOPERS IF FOUND.)" + desc = "This thing drains power from fractal-subspace." // (DEBUG ITEM: INFINITE POWERSOURCE FOR MAP TESTING. CONTACT DEVELOPERS IF FOUND.)" icon = 'icons/obj/power.dmi' icon_state = "tracker" //ICON stolen from solar tracker. There is no need to make new texture for debug item anchored = 1 density = 1 - var/power_generation_rate = 2000000 //Defaults to 2MW of power. Should be enough to run SMES charging on full 2 times. + var/power_generation_rate = 1000000 //Defaults to 1MW of power. var/powernet_connection_failed = 0 + var/mapped_in = 0 //Do not announce creation when it's mapped in. // This should be only used on Dev for testing purposes. /obj/machinery/power/fractal_reactor/New() ..() - world << "\red WARNING: \black Map testing power source activated at: X:[src.loc.x] Y:[src.loc.y] Z:[src.loc.z]" + if(!mapped_in) + world << "\red WARNING: \black Map testing power source activated at: X:[src.loc.x] Y:[src.loc.y] Z:[src.loc.z]" /obj/machinery/power/fractal_reactor/process() if(!powernet && !powernet_connection_failed) 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 ef224e7c1c8..611c8546f30 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -36,6 +36,7 @@ var/name_tag = null var/building_terminal = 0 //Suggestions about how to avoid clickspam building several terminals accepted! var/obj/machinery/power/terminal/terminal = null + var/should_be_mapped = 0 // If this is set to 0 it will send out warning on New() /obj/machinery/power/smes/drain_power(var/drain_check) @@ -74,6 +75,13 @@ if(!terminal.powernet) terminal.connect_to_network() update_icon() + + + + + if(!should_be_mapped) + warning("Non-buildable or Non-magical SMES at [src.x]X [src.y]Y [src.z]Z") + return /obj/machinery/power/smes/update_icon() @@ -199,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 @@ -413,6 +421,7 @@ desc = "A high-capacity superconducting magnetic energy storage (SMES) unit. Magically produces power." capacity = 9000000 output_level = 250000 + should_be_mapped = 1 /obj/machinery/power/smes/magical/process() charge = 5000000 diff --git a/code/modules/power/smes_construction.dm b/code/modules/power/smes_construction.dm index 47fdefc9f93..676b84e50e5 100644 --- a/code/modules/power/smes_construction.dm +++ b/code/modules/power/smes_construction.dm @@ -31,6 +31,8 @@ var/cur_coils = 1 // Current amount of installed coils var/safeties_enabled = 1 // If 0 modifications can be done without discharging the SMES, at risk of critical failure. var/failing = 0 // If 1 critical failure has occured and SMES explosion is imminent. + charge = 0 + should_be_mapped = 1 /obj/machinery/power/smes/buildable/New() component_parts = list() @@ -86,6 +88,8 @@ var/obj/item/clothing/gloves/G = h_user.gloves if(G.siemens_coefficient == 0) user_protected = 1 + log_game("SMES FAILURE: [src.x]X [src.y]Y [src.z]Z User: [usr.ckey], Intensity: [intensity]/100") + message_admins("SMES FAILURE: [src.x]X [src.y]Y [src.z]Z User: [usr.ckey], Intensity: [intensity]/100 - JMP") switch (intensity) @@ -134,7 +138,7 @@ empulse(src.loc, 8, 16) charge = 0 apcs_overload(1, 10) - src.visible_message("\icon[src] [src] beeps: \"Caution. Output regulators malfunction. Uncontrolled discharge detected.\"") + src.ping("Caution. Output regulators malfunction. Uncontrolled discharge detected.") if (61 to INFINITY) // Massive overcharge @@ -149,14 +153,21 @@ empulse(src.loc, 32, 64) charge = 0 apcs_overload(5, 25) - src.visible_message("\icon[src] [src] beeps: \"Caution. Output regulators malfunction. Significant uncontrolled discharge detected.\"") + src.ping("Caution. Output regulators malfunction. Significant uncontrolled discharge detected.") if (prob(50)) - src.visible_message("\icon[src] [src] beeps: \"DANGER! Magnetic containment field unstable! Containment field failure imminent!\"") + // Added admin-notifications so they can stop it when griffed. + log_game("SMES explosion imminent.") + message_admins("SMES explosion imminent.") + src.ping("DANGER! Magnetic containment field unstable! Containment field failure imminent!") failing = 1 // 30 - 60 seconds and then BAM! spawn(rand(300,600)) - src.visible_message("\icon[src] [src] beeps: \"DANGER! Magnetic containment field failure in 3 ... 2 ... 1 ...\"") + if(!failing) // Admin can manually set this var back to 0 to stop overload, for use when griffed. + update_icon() + src.ping("Magnetic containment stabilised.") + return + src.ping("DANGER! Magnetic containment field failure in 3 ... 2 ... 1 ...") explosion(src.loc,1,2,4,8) // Not sure if this is necessary, but just in case the SMES *somehow* survived.. del(src) @@ -173,7 +184,7 @@ var/obj/machinery/power/apc/A = T.master if (prob(overload_chance)) A.overload_lighting() - else if (prob(failure_chance)) + if (prob(failure_chance)) A.set_broken() // Failing SMES has special icon overlay. 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/designs.dm b/code/modules/research/designs.dm index 801088bb718..5e5fd8148d4 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -604,7 +604,7 @@ datum/design/posibrain build_type = PROTOLATHE materials = list("$metal" = 2000, "$glass" = 1000, "$silver" = 1000, "$gold" = 500, "$phoron" = 500, "$diamond" = 100) - build_path = /obj/item/device/mmi/posibrain + build_path = /obj/item/device/mmi/digital/posibrain /////////////////////////////////// //////////Mecha Module Disks/////// @@ -1273,6 +1273,15 @@ datum/design/gas_cooler materials = list("$glass" = 2000, "sacid" = 20) build_path = /obj/item/weapon/circuitboard/unary_atmos/cooler +datum/design/secure_airlock + name = "Secure Airlock Electronics" + desc = "Tamper-resistant airlock electronics" + id = "securedoor" + req_tech = list("programming" = 3) + build_type = IMPRINTER + materials = list("$glass" = 2000, "sacid" = 20) + build_path = /obj/item/weapon/airlock_electronics/secure + ///////////////////////////////////////// ////////////Power Stuff////////////////// ///////////////////////////////////////// @@ -1812,7 +1821,7 @@ datum/design/borg_syndicate_module /////////////PDA and Radio stuff///////// ///////////////////////////////////////// datum/design/binaryencrypt - name = "Binary Encrpytion Key" + name = "binary encryption key" desc = "An encyption key for a radio headset. Contains cypherkeys." id = "binaryencrypt" req_tech = list("syndicate" = 2) 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/shuttles/antagonist.dm b/code/modules/shuttles/antagonist.dm index c49c099026c..43836267890 100644 --- a/code/modules/shuttles/antagonist.dm +++ b/code/modules/shuttles/antagonist.dm @@ -6,4 +6,4 @@ /obj/machinery/computer/shuttle_control/multi/syndicate name = "Syndicate control console" req_access = list(access_syndicate) - shuttle_tag = "Syndicate" \ No newline at end of file + shuttle_tag = "Mercenary" \ No newline at end of file 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"]