diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd0323d8bf..1312e71180 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,34 @@ jobs: tools/ci/validate_files.sh tools/ci/build_tgui.sh + dreamchecker: + name: DreamChecker + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: Cache SpacemanDMM + uses: actions/cache@v2 + with: + path: ~/SpacemanDMM + key: ${{ runner.os }}-dreamchecker-${{ hashFiles('dependencies.sh')}} + restore-keys: ${{ runner.os }}-dreamchecker + + - name: Install Dependencies + run: | + tools/ci/install_spaceman_dmm.sh dreamchecker + + - name: Run Linter + id: linter + run: | + ~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1 + + - name: Annotate Linter + uses: yogstation13/DreamAnnotate@v1 + if: always() + with: + outputFile: output-annotations.txt + unit_tests: name: Integration Tests runs-on: ubuntu-18.04 diff --git a/SpacemanDMM.toml b/SpacemanDMM.toml index 771e48d2ef..ebc374f630 100644 --- a/SpacemanDMM.toml +++ b/SpacemanDMM.toml @@ -1,8 +1,6 @@ -[diagnostics] -macro_redefined = "off" -macro_undefined_no_definition = "off" -as_local_var = "off" -tmp_no_effect = "off" - [langserver] dreamchecker = true + +[code_standards] +disallow_relative_type_definitions = true +disallow_relative_proc_definitions = true \ No newline at end of file diff --git a/_build_dependencies.sh b/_build_dependencies.sh index b89a8a2dd6..70ca4690c0 100644 --- a/_build_dependencies.sh +++ b/_build_dependencies.sh @@ -1,6 +1,6 @@ # This file has all the information on what versions of libraries are thrown into the code # For dreamchecker -export SPACEMANDMM_TAG=suite-1.4 +export SPACEMAN_DMM_VERSION=suite-1.7 # For NanoUI + TGUI export NODE_VERSION=12 # Byond Major diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index 72e623351a..c09c482cc1 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -1,8 +1,5 @@ //node1, air1, network1 correspond to input //node2, air2, network2 correspond to output - -#define ADIABATIC_EXPONENT 0.667 //Actually adiabatic exponent - 1. - /obj/machinery/atmospherics/binary/circulator name = "circulator" desc = "A gas circulator turbine and heat exchanger." diff --git a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm deleted file mode 100644 index 7ef1858b2f..0000000000 --- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm +++ /dev/null @@ -1,288 +0,0 @@ -#define ADIABATIC_EXPONENT 0.667 //Actually adiabatic exponent - 1. - -/obj/machinery/atmospherics/pipeturbine - name = "turbine" - desc = "A gas turbine. Converting pressure into energy since 1884." - icon = 'icons/obj/pipeturbine.dmi' - icon_state = "turbine" - anchored = 0 - density = 1 - - var/efficiency = 0.4 - var/kin_energy = 0 - var/datum/gas_mixture/air_in = new - var/datum/gas_mixture/air_out = new - var/volume_ratio = 0.2 - var/kin_loss = 0.001 - - var/dP = 0 - - var/datum/pipe_network/network1 - var/datum/pipe_network/network2 - -/obj/machinery/atmospherics/pipeturbine/New() - ..() - air_in.volume = 200 - air_out.volume = 800 - volume_ratio = air_in.volume / (air_in.volume + air_out.volume) - switch(dir) - if(NORTH) - initialize_directions = EAST|WEST - if(SOUTH) - initialize_directions = EAST|WEST - if(EAST) - initialize_directions = NORTH|SOUTH - if(WEST) - initialize_directions = NORTH|SOUTH - -/obj/machinery/atmospherics/pipeturbine/Destroy() - . = ..() - - if(node1) - node1.disconnect(src) - qdel(network1) - if(node2) - node2.disconnect(src) - qdel(network2) - - node1 = null - node2 = null - -/obj/machinery/atmospherics/pipeturbine/process() - ..() - if(anchored && !(stat&BROKEN)) - kin_energy *= 1 - kin_loss - dP = max(air_in.return_pressure() - air_out.return_pressure(), 0) - if(dP > 10) - kin_energy += 1/ADIABATIC_EXPONENT * dP * air_in.volume * (1 - volume_ratio**ADIABATIC_EXPONENT) * efficiency - air_in.temperature *= volume_ratio**ADIABATIC_EXPONENT - - var/datum/gas_mixture/air_all = new - air_all.volume = air_in.volume + air_out.volume - air_all.merge(air_in.remove_ratio(1)) - air_all.merge(air_out.remove_ratio(1)) - - air_in.merge(air_all.remove(volume_ratio)) - air_out.merge(air_all) - - update_icon() - - if (network1) - network1.update = 1 - if (network2) - network2.update = 1 - -/obj/machinery/atmospherics/pipeturbine/update_icon() - overlays.Cut() - if (dP > 10) - overlays += image('icons/obj/pipeturbine.dmi', "moto-turb") - if (kin_energy > 100000) - overlays += image('icons/obj/pipeturbine.dmi', "low-turb") - if (kin_energy > 500000) - overlays += image('icons/obj/pipeturbine.dmi', "med-turb") - if (kin_energy > 1000000) - overlays += image('icons/obj/pipeturbine.dmi', "hi-turb") - -/obj/machinery/atmospherics/pipeturbine/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) - anchored = !anchored - playsound(src, W.usesound, 50, 1) - to_chat(user, "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.") - - if(anchored) - if(dir & (NORTH|SOUTH)) - initialize_directions = EAST|WEST - else if(dir & (EAST|WEST)) - initialize_directions = NORTH|SOUTH - - atmos_init() - build_network() - if (node1) - node1.atmos_init() - node1.build_network() - if (node2) - node2.atmos_init() - node2.build_network() - else - if(node1) - node1.disconnect(src) - qdel(network1) - if(node2) - node2.disconnect(src) - qdel(network2) - - node1 = null - node2 = null - - return - ..() - -/obj/machinery/atmospherics/pipeturbine/verb/rotate_clockwise() - set name = "Rotate Turbine Clockwise" - set category = "Object" - set src in view(1) - - if (usr.stat || usr.restrained() || anchored) - return - - src.set_dir(turn(src.dir, 270)) - - -/obj/machinery/atmospherics/pipeturbine/verb/rotate_counterclockwise() - set name = "Rotate Turbine Counterclockwise" - set category = "Object" - set src in view(1) - - if (usr.stat || usr.restrained() || anchored) - return - - src.set_dir(turn(src.dir, 90)) - -//Goddamn copypaste from binary base class because atmospherics machinery API is not damn flexible -/obj/machinery/atmospherics/pipeturbine/get_neighbor_nodes_for_init() - return list(node1, node2) - -/obj/machinery/atmospherics/pipeturbine/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) - if(reference == node1) - network1 = new_network - - else if(reference == node2) - network2 = new_network - - if(new_network.normal_members.Find(src)) - return 0 - - new_network.normal_members += src - - return null - -/obj/machinery/atmospherics/pipeturbine/atmos_init() - if(node1 && node2) - return - - var/node2_connect = turn(dir, -90) - var/node1_connect = turn(dir, 90) - - for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect)) - if(target.initialize_directions & get_dir(target,src)) - node1 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect)) - if(target.initialize_directions & get_dir(target,src)) - node2 = target - break - -/obj/machinery/atmospherics/pipeturbine/build_network() - if(!network1 && node1) - network1 = new /datum/pipe_network() - network1.normal_members += src - network1.build_network(node1, src) - - if(!network2 && node2) - network2 = new /datum/pipe_network() - network2.normal_members += src - network2.build_network(node2, src) - - -/obj/machinery/atmospherics/pipeturbine/return_network(obj/machinery/atmospherics/reference) - build_network() - - if(reference==node1) - return network1 - - if(reference==node2) - return network2 - - return null - -/obj/machinery/atmospherics/pipeturbine/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) - if(network1 == old_network) - network1 = new_network - if(network2 == old_network) - network2 = new_network - - return 1 - -/obj/machinery/atmospherics/pipeturbine/return_network_air(datum/pipe_network/reference) - var/list/results = list() - - if(network1 == reference) - results += air_in - if(network2 == reference) - results += air_out - - return results - -/obj/machinery/atmospherics/pipeturbine/disconnect(obj/machinery/atmospherics/reference) - if(reference==node1) - qdel(network1) - node1 = null - - else if(reference==node2) - qdel(network2) - node2 = null - - return null - - -/obj/machinery/power/turbinemotor - name = "motor" - desc = "Electrogenerator. Converts rotation into power." - icon = 'icons/obj/pipeturbine.dmi' - icon_state = "motor" - anchored = 0 - density = 1 - - var/kin_to_el_ratio = 0.1 //How much kinetic energy will be taken from turbine and converted into electricity - var/obj/machinery/atmospherics/pipeturbine/turbine - -/obj/machinery/power/turbinemotor/Initialize() - . = ..() - updateConnection() - -/obj/machinery/power/turbinemotor/proc/updateConnection() - turbine = null - if(src.loc && anchored) - turbine = locate(/obj/machinery/atmospherics/pipeturbine) in get_step(src,dir) - if (turbine.stat & (BROKEN) || !turbine.anchored || turn(turbine.dir,180) != dir) - turbine = null - -/obj/machinery/power/turbinemotor/process() - updateConnection() - if(!turbine || !anchored || stat & (BROKEN)) - return - - var/power_generated = kin_to_el_ratio * turbine.kin_energy - turbine.kin_energy -= power_generated - add_avail(power_generated) - -/obj/machinery/power/turbinemotor/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wrench()) - anchored = !anchored - playsound(src, W.usesound, 50, 1) - turbine = null - to_chat(user, "You [anchored ? "secure" : "unsecure"] the bolts holding \the [src] to the floor.") - updateConnection() - else - ..() - -/obj/machinery/power/turbinemotor/verb/rotate_clockwise() - set name = "Rotate Motor Clockwise" - set category = "Object" - set src in view(1) - - if (usr.stat || usr.restrained() || anchored) - return - - src.set_dir(turn(src.dir, 270)) - -/obj/machinery/power/turbinemotor/verb/rotate_counterclockwise() - set name = "Rotate Motor Counterclockwise" - set category = "Object" - set src in view(1) - - if (usr.stat || usr.restrained() || anchored) - return - - src.set_dir(turn(src.dir, 90)) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index ef2a4c1a8a..7344a3e732 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -163,7 +163,7 @@ // // "T" Orientation - Inputs are on oposite sides instead of adjacent // -obj/machinery/atmospherics/trinary/mixer/t_mixer +/obj/machinery/atmospherics/trinary/mixer/t_mixer icon_state = "tmap" construction_type = /obj/item/pipe/trinary // Can't flip a "T", its symmetrical pipe_state = "t_mixer" diff --git a/code/ATMOSPHERICS/components/unary/generator_input.dm b/code/ATMOSPHERICS/components/unary/generator_input.dm deleted file mode 100644 index 2b31097dc4..0000000000 --- a/code/ATMOSPHERICS/components/unary/generator_input.dm +++ /dev/null @@ -1,21 +0,0 @@ -/obj/machinery/atmospherics/unary/generator_input - icon = 'icons/obj/atmospherics/heat_exchanger.dmi' - icon_state = "intact" - density = 1 - - name = "Generator Input" - desc = "Placeholder" - - var/update_cycle - - update_icon() - if(node) - icon_state = "intact" - else - icon_state = "exposed" - - return - - proc - return_exchange_air() - return air_contents \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index 2295f70378..bba26185e7 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -11,77 +11,77 @@ var/obj/machinery/atmospherics/unary/heat_exchanger/partner = null var/update_cycle - update_icon() - if(node) - icon_state = "intact" - else - icon_state = "exposed" +/obj/machinery/atmospherics/unary/heat_exchanger/update_icon() + if(node) + icon_state = "intact" + else + icon_state = "exposed" - return + return - atmos_init() - if(!partner) - var/partner_connect = turn(dir,180) +/obj/machinery/atmospherics/unary/heat_exchanger/atmos_init() + if(!partner) + var/partner_connect = turn(dir,180) - for(var/obj/machinery/atmospherics/unary/heat_exchanger/target in get_step(src,partner_connect)) - if(target.dir & get_dir(src,target)) - partner = target - partner.partner = src - break + for(var/obj/machinery/atmospherics/unary/heat_exchanger/target in get_step(src,partner_connect)) + if(target.dir & get_dir(src,target)) + partner = target + partner.partner = src + break - ..() + ..() - process() - ..() - if(!partner) - return 0 +/obj/machinery/atmospherics/unary/heat_exchanger/process() + ..() + if(!partner) + return 0 - if(!air_master || air_master.current_cycle <= update_cycle) - return 0 + if(!air_master || air_master.current_cycle <= update_cycle) + return 0 - update_cycle = air_master.current_cycle - partner.update_cycle = air_master.current_cycle + update_cycle = air_master.current_cycle + partner.update_cycle = air_master.current_cycle - var/air_heat_capacity = air_contents.heat_capacity() - var/other_air_heat_capacity = partner.air_contents.heat_capacity() - var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity + var/air_heat_capacity = air_contents.heat_capacity() + var/other_air_heat_capacity = partner.air_contents.heat_capacity() + var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity - var/old_temperature = air_contents.temperature - var/other_old_temperature = partner.air_contents.temperature + var/old_temperature = air_contents.temperature + var/other_old_temperature = partner.air_contents.temperature - if(combined_heat_capacity > 0) - var/combined_energy = partner.air_contents.temperature*other_air_heat_capacity + air_heat_capacity*air_contents.temperature + if(combined_heat_capacity > 0) + var/combined_energy = partner.air_contents.temperature*other_air_heat_capacity + air_heat_capacity*air_contents.temperature - var/new_temperature = combined_energy/combined_heat_capacity - air_contents.temperature = new_temperature - partner.air_contents.temperature = new_temperature + var/new_temperature = combined_energy/combined_heat_capacity + air_contents.temperature = new_temperature + partner.air_contents.temperature = new_temperature - if(network) - if(abs(old_temperature-air_contents.temperature) > 1) - network.update = 1 + if(network) + if(abs(old_temperature-air_contents.temperature) > 1) + network.update = 1 - if(partner.network) - if(abs(other_old_temperature-partner.air_contents.temperature) > 1) - partner.network.update = 1 + if(partner.network) + if(abs(other_old_temperature-partner.air_contents.temperature) > 1) + partner.network.update = 1 + return 1 + +/obj/machinery/atmospherics/unary/heat_exchanger/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) + if (!W.is_wrench()) + return ..() + var/turf/T = src.loc + if (level==1 && isturf(T) && !T.is_plating()) + to_chat(user, "You must remove the plating first.") return 1 - - attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) - if (!W.is_wrench()) - return ..() - var/turf/T = src.loc - if (level==1 && isturf(T) && !T.is_plating()) - to_chat(user, "You must remove the plating first.") - return 1 - if (!can_unwrench()) - to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.") - add_fingerprint(user) - return 1 - playsound(src, W.usesound, 50, 1) - to_chat(user, "You begin to unfasten \the [src]...") - if (do_after(user, 40 * W.toolspeed)) - user.visible_message( \ - "\The [user] unfastens \the [src].", \ - "You have unfastened \the [src].", \ - "You hear a ratchet.") - deconstruct() + if (!can_unwrench()) + to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.") + add_fingerprint(user) + return 1 + playsound(src, W.usesound, 50, 1) + to_chat(user, "You begin to unfasten \the [src]...") + if (do_after(user, 40 * W.toolspeed)) + user.visible_message( \ + "\The [user] unfastens \the [src].", \ + "You have unfastened \the [src].", \ + "You hear a ratchet.") + deconstruct() diff --git a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm deleted file mode 100644 index 14bbb46bba..0000000000 --- a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm +++ /dev/null @@ -1,49 +0,0 @@ -obj/machinery/atmospherics/unary/oxygen_generator - icon = 'icons/obj/atmospherics/oxygen_generator.dmi' - icon_state = "intact_off" - density = 1 - - name = "Oxygen Generator" - desc = "" - - dir = SOUTH - initialize_directions = SOUTH - - var/on = 0 - - var/oxygen_content = 10 - - update_icon() - if(node) - icon_state = "intact_[on?("on"):("off")]" - else - icon_state = "exposed_off" - - on = 0 - - return - - New() - ..() - - air_contents.volume = 50 - - process() - ..() - if(!on) - return 0 - - var/total_moles = air_contents.total_moles - - if(total_moles < oxygen_content) - var/current_heat_capacity = air_contents.heat_capacity() - - var/added_oxygen = oxygen_content - total_moles - - air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen) - air_contents.adjust_gas("oxygen", added_oxygen) - - if(network) - network.update = 1 - - return 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/mainspipe.dm b/code/ATMOSPHERICS/mainspipe.dm deleted file mode 100644 index 797d801a4e..0000000000 --- a/code/ATMOSPHERICS/mainspipe.dm +++ /dev/null @@ -1,708 +0,0 @@ -// internal pipe, don't actually place or use these -obj/machinery/atmospherics/pipe/mains_component - var/obj/machinery/atmospherics/mains_pipe/parent_pipe - var/list/obj/machinery/atmospherics/pipe/mains_component/nodes = new() - - New(loc) - ..(loc) - parent_pipe = loc - - check_pressure(pressure) - var/datum/gas_mixture/environment = loc.loc.return_air() - - var/pressure_difference = pressure - environment.return_pressure() - - if(pressure_difference > parent_pipe.maximum_pressure) - mains_burst() - - else if(pressure_difference > parent_pipe.fatigue_pressure) - //TODO: leak to turf, doing pfshhhhh - if(prob(5)) - mains_burst() - - else return 1 - - pipeline_expansion() - return nodes - - disconnect(obj/machinery/atmospherics/reference) - if(nodes.Find(reference)) - nodes.Remove(reference) - - proc/mains_burst() - parent_pipe.burst() - -obj/machinery/atmospherics/mains_pipe - icon = 'icons/obj/atmospherics/mainspipe.dmi' - layer = PIPES_LAYER - plane = PLATING_PLANE - - var/volume = 0 - - var/alert_pressure = 80*ONE_ATMOSPHERE - - var/initialize_mains_directions = 0 - - var/list/obj/machinery/atmospherics/mains_pipe/nodes = new() - var/obj/machinery/atmospherics/pipe/mains_component/supply - var/obj/machinery/atmospherics/pipe/mains_component/scrubbers - var/obj/machinery/atmospherics/pipe/mains_component/aux - - var/minimum_temperature_difference = 300 - var/thermal_conductivity = 0 //WALL_HEAT_TRANSFER_COEFFICIENT No - - var/maximum_pressure = 70*ONE_ATMOSPHERE - var/fatigue_pressure = 55*ONE_ATMOSPHERE - alert_pressure = 55*ONE_ATMOSPHERE - - New() - ..() - - supply = new(src) - supply.volume = volume - supply.nodes.len = nodes.len - scrubbers = new(src) - scrubbers.volume = volume - scrubbers.nodes.len = nodes.len - aux = new(src) - aux.volume = volume - aux.nodes.len = nodes.len - - hide(var/i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - - proc/burst() - for(var/obj/machinery/atmospherics/pipe/mains_component/pipe in contents) - burst() - - proc/check_pressure(pressure) - var/datum/gas_mixture/environment = loc.return_air() - - var/pressure_difference = pressure - environment.return_pressure() - - if(pressure_difference > maximum_pressure) - burst() - - else if(pressure_difference > fatigue_pressure) - //TODO: leak to turf, doing pfshhhhh - if(prob(5)) - burst() - - else return 1 - - get_neighbor_nodes_for_init() - return nodes - - disconnect() - ..() - for(var/obj/machinery/atmospherics/pipe/mains_component/node in nodes) - node.disconnect() - - Destroy() - disconnect() - ..() - - atmos_init() - for(var/i = 1 to nodes.len) - var/obj/machinery/atmospherics/mains_pipe/node = nodes[i] - if(node) - supply.nodes[i] = node.supply - scrubbers.nodes[i] = node.scrubbers - aux.nodes[i] = node.aux - -obj/machinery/atmospherics/mains_pipe/simple - name = "mains pipe" - desc = "A one meter section of 3-line mains pipe" - - dir = SOUTH - initialize_mains_directions = SOUTH|NORTH - - New() - nodes.len = 2 - ..() - switch(dir) - if(SOUTH || NORTH) - initialize_mains_directions = SOUTH|NORTH - if(EAST || WEST) - initialize_mains_directions = EAST|WEST - if(NORTHEAST) - initialize_mains_directions = NORTH|EAST - if(NORTHWEST) - initialize_mains_directions = NORTH|WEST - if(SOUTHEAST) - initialize_mains_directions = SOUTH|EAST - if(SOUTHWEST) - initialize_mains_directions = SOUTH|WEST - - proc/normalize_dir() - if(dir==3) - set_dir(1) - else if(dir==12) - set_dir(4) - - update_icon() - if(nodes[1] && nodes[2]) - icon_state = "intact[invisibility ? "-f" : "" ]" - - //var/node1_direction = get_dir(src, node1) - //var/node2_direction = get_dir(src, node2) - - //set_dir(node1_direction|node2_direction) - - else - if(!nodes[1]&&!nodes[2]) - qdel(src) //TODO: silent deleting looks weird - var/have_node1 = nodes[1]?1:0 - var/have_node2 = nodes[2]?1:0 - icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]" - - atmos_init() - normalize_dir() - var/node1_dir - var/node2_dir - - for(var/direction in cardinal) - if(direction&initialize_mains_directions) - if (!node1_dir) - node1_dir = direction - else if (!node2_dir) - node2_dir = direction - - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[1] = target - break - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[2] = target - break - - ..() // initialize internal pipes - - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) - update_icon() - - hidden - level = 1 - icon_state = "intact-f" - - visible - level = 2 - icon_state = "intact" - -obj/machinery/atmospherics/mains_pipe/manifold - name = "manifold pipe" - desc = "A manifold composed of mains pipes" - - dir = SOUTH - initialize_mains_directions = EAST|NORTH|WEST - volume = 105 - - New() - nodes.len = 3 - ..() - initialize_mains_directions = (NORTH|SOUTH|EAST|WEST) & ~dir - - atmos_init() - var/connect_directions = initialize_mains_directions - - for(var/direction in cardinal) - if(direction&connect_directions) - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[1] = target - connect_directions &= ~direction - break - if (nodes[1]) - break - - - for(var/direction in cardinal) - if(direction&connect_directions) - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[2] = target - connect_directions &= ~direction - break - if (nodes[2]) - break - - - for(var/direction in cardinal) - if(direction&connect_directions) - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[3] = target - connect_directions &= ~direction - break - if (nodes[3]) - break - - ..() // initialize internal pipes - - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) - update_icon() - - update_icon() - icon_state = "manifold[invisibility ? "-f" : "" ]" - - hidden - level = 1 - icon_state = "manifold-f" - - visible - level = 2 - icon_state = "manifold" - -obj/machinery/atmospherics/mains_pipe/manifold4w - name = "manifold pipe" - desc = "A manifold composed of mains pipes" - - dir = SOUTH - initialize_mains_directions = EAST|NORTH|WEST|SOUTH - volume = 105 - - New() - nodes.len = 4 - ..() - - atmos_init() - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,NORTH)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[1] = target - break - - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,SOUTH)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[2] = target - break - - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,EAST)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[3] = target - break - - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,WEST)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[3] = target - break - - ..() // initialize internal pipes - - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) - update_icon() - - update_icon() - icon_state = "manifold4w[invisibility ? "-f" : "" ]" - - hidden - level = 1 - icon_state = "manifold4w-f" - - visible - level = 2 - icon_state = "manifold4w" - -obj/machinery/atmospherics/mains_pipe/split - name = "mains splitter" - desc = "A splitter for connecting to a single pipe off a mains." - - var/obj/machinery/atmospherics/pipe/mains_component/split_node - var/obj/machinery/atmospherics/node3 - var/icon_type - - New() - nodes.len = 2 - ..() - initialize_mains_directions = turn(dir, 90) | turn(dir, -90) - initialize_directions = dir // actually have a normal connection too - - atmos_init() - var/node1_dir - var/node2_dir - var/node3_dir - - node1_dir = turn(dir, 90) - node2_dir = turn(dir, -90) - node3_dir = dir - - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[1] = target - break - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[2] = target - break - for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir)) - if(target.initialize_directions & get_dir(target,src)) - node3 = target - break - - ..() // initialize internal pipes - - // bind them - spawn(5) - if(node3 && split_node) - var/datum/pipe_network/N1 = node3.return_network(src) - var/datum/pipe_network/N2 = split_node.return_network(split_node) - if(N1 && N2) - N1.merge(N2) - - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) - update_icon() - - update_icon() - icon_state = "split-[icon_type][invisibility ? "-f" : "" ]" - - return_network(A) - return split_node.return_network(A) - - supply - icon_type = "supply" - - New() - ..() - split_node = supply - - hidden - level = 1 - icon_state = "split-supply-f" - - visible - level = 2 - icon_state = "split-supply" - - scrubbers - icon_type = "scrubbers" - - New() - ..() - split_node = scrubbers - - hidden - level = 1 - icon_state = "split-scrubbers-f" - - visible - level = 2 - icon_state = "split-scrubbers" - - aux - icon_type = "aux" - - New() - ..() - split_node = aux - - hidden - level = 1 - icon_state = "split-aux-f" - - visible - level = 2 - icon_state = "split-aux" - -obj/machinery/atmospherics/mains_pipe/split3 - name = "triple mains splitter" - desc = "A splitter for connecting to the 3 pipes on a mainline." - - var/obj/machinery/atmospherics/supply_node - var/obj/machinery/atmospherics/scrubbers_node - var/obj/machinery/atmospherics/aux_node - - New() - nodes.len = 1 - ..() - initialize_mains_directions = dir - initialize_directions = cardinal & ~dir // actually have a normal connection too - - atmos_init() - var/node1_dir - var/supply_node_dir - var/scrubbers_node_dir - var/aux_node_dir - - node1_dir = dir - aux_node_dir = turn(dir, 180) - if(dir & (NORTH|SOUTH)) - supply_node_dir = EAST - scrubbers_node_dir = WEST - else - supply_node_dir = SOUTH - scrubbers_node_dir = NORTH - - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src, node1_dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[1] = target - break - for(var/obj/machinery/atmospherics/target in get_step(src,supply_node_dir)) - if(target.initialize_directions & get_dir(target,src)) - supply_node = target - break - for(var/obj/machinery/atmospherics/target in get_step(src,scrubbers_node_dir)) - if(target.initialize_directions & get_dir(target,src)) - scrubbers_node = target - break - for(var/obj/machinery/atmospherics/target in get_step(src,aux_node_dir)) - if(target.initialize_directions & get_dir(target,src)) - aux_node = target - break - - ..() // initialize internal pipes - - // bind them - spawn(5) - if(supply_node) - var/datum/pipe_network/N1 = supply_node.return_network(src) - var/datum/pipe_network/N2 = supply.return_network(supply) - if(N1 && N2) - N1.merge(N2) - if(scrubbers_node) - var/datum/pipe_network/N1 = scrubbers_node.return_network(src) - var/datum/pipe_network/N2 = scrubbers.return_network(scrubbers) - if(N1 && N2) - N1.merge(N2) - if(aux_node) - var/datum/pipe_network/N1 = aux_node.return_network(src) - var/datum/pipe_network/N2 = aux.return_network(aux) - if(N1 && N2) - N1.merge(N2) - - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) - update_icon() - - update_icon() - icon_state = "split-t[invisibility ? "-f" : "" ]" - - return_network(obj/machinery/atmospherics/reference) - var/obj/machinery/atmospherics/A - - A = supply_node.return_network(reference) - if(!A) - A = scrubbers_node.return_network(reference) - if(!A) - A = aux_node.return_network(reference) - - return A - - hidden - level = 1 - icon_state = "split-t-f" - - visible - level = 2 - icon_state = "split-t" - -obj/machinery/atmospherics/mains_pipe/cap - name = "pipe cap" - desc = "A cap for the end of a mains pipe" - - dir = SOUTH - initialize_directions = SOUTH - volume = 35 - - New() - nodes.len = 1 - ..() - initialize_mains_directions = dir - - update_icon() - icon_state = "cap[invisibility ? "-f" : ""]" - - atmos_init() - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[1] = target - break - - ..() - - var/turf/T = src.loc // hide if turf is not intact - if(level == 1 && !T.is_plating()) hide(1) - update_icon() - - hidden - level = 1 - icon_state = "cap-f" - - visible - level = 2 - icon_state = "cap" - -//TODO: Get Mains valves working! -/* -obj/machinery/atmospherics/mains_pipe/valve - icon_state = "mvalve0" - - name = "mains shutoff valve" - desc = "A mains pipe valve" - - var/open = 1 - - dir = SOUTH - initialize_mains_directions = SOUTH|NORTH - - New() - nodes.len = 2 - ..() - initialize_mains_directions = dir | turn(dir, 180) - - update_icon(animation) - var/turf/simulated/floor = loc - var/hide = istype(floor) ? floor.intact : 0 - level = 1 - for(var/obj/machinery/atmospherics/mains_pipe/node in nodes) - if(node.level == 2) - hide = 0 - level = 2 - break - - if(animation) - flick("[hide?"h":""]mvalve[src.open][!src.open]",src) - else - icon_state = "[hide?"h":""]mvalve[open]" - - initialize() - normalize_dir() - var/node1_dir - var/node2_dir - - for(var/direction in cardinal) - if(direction&initialize_mains_directions) - if (!node1_dir) - node1_dir = direction - else if (!node2_dir) - node2_dir = direction - - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[1] = target - break - for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir)) - if(target.initialize_mains_directions & get_dir(target,src)) - nodes[2] = target - break - - if(open) - ..() // initialize internal pipes - - update_icon() - - proc/normalize_dir() - if(dir==3) - set_dir(1) - else if(dir==12) - set_dir(4) - - proc/open() - if(open) return 0 - - open = 1 - update_icon() - - initialize() - - return 1 - - proc/close() - if(!open) return 0 - - open = 0 - update_icon() - - for(var/obj/machinery/atmospherics/pipe/mains_component/node in src) - for(var/obj/machinery/atmospherics/pipe/mains_component/o in node.nodes) - o.disconnect(node) - o.build_network() - - return 1 - - attack_ai(mob/user as mob) - return - - attack_paw(mob/user as mob) - return attack_hand(user) - - attack_hand(mob/user as mob) - src.add_fingerprint(usr) - update_icon(1) - sleep(10) - if (open) - close() - else - open() - - digital // can be controlled by AI - name = "digital mains valve" - desc = "A digitally controlled valve." - icon_state = "dvalve0" - - attack_ai(mob/user as mob) - return src.attack_hand(user) - - attack_hand(mob/user as mob) - if(!src.allowed(user)) - to_chat(user, "Access denied.") - return - ..() - - //Radio remote control - - proc - set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - if(frequency) - radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA) - - var/frequency = 0 - var/id = null - var/datum/radio_frequency/radio_connection - - initialize() - ..() - if(frequency) - set_frequency(frequency) - - update_icon(animation) - var/turf/simulated/floor = loc - var/hide = istype(floor) ? floor.intact : 0 - level = 1 - for(var/obj/machinery/atmospherics/mains_pipe/node in nodes) - if(node.level == 2) - hide = 0 - level = 2 - break - - if(animation) - flick("[hide?"h":""]dvalve[src.open][!src.open]",src) - else - icon_state = "[hide?"h":""]dvalve[open]" - - receive_signal(datum/signal/signal) - if(!signal.data["tag"] || (signal.data["tag"] != id)) - return 0 - - switch(signal.data["command"]) - if("valve_open") - if(!open) - open() - - if("valve_close") - if(open) - close() - - if("valve_toggle") - if(open) - close() - else - open() -*/ diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index 4d92a42c35..fcc81509c8 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -2,8 +2,8 @@ Contains helper procs for airflow, handled in /connection_group. */ -mob/var/tmp/last_airflow_stun = 0 -mob/proc/airflow_stun() +/mob/var/tmp/last_airflow_stun = 0 +/mob/proc/airflow_stun() if(stat == 2) return 0 if(last_airflow_stun > world.time - vsc.airflow_stun_cooldown) return 0 @@ -19,16 +19,16 @@ mob/proc/airflow_stun() Weaken(5) last_airflow_stun = world.time -mob/living/silicon/airflow_stun() +/mob/living/silicon/airflow_stun() return -mob/living/carbon/human/airflow_stun() +/mob/living/carbon/human/airflow_stun() if(shoes && (shoes.item_flags & NOSLIP)) to_chat(src, "Air suddenly rushes past you!") return 0 ..() -atom/movable/proc/check_airflow_movable(n) +/atom/movable/proc/check_airflow_movable(n) if(!simulated) return 0 if(anchored && !ismob(src)) return 0 @@ -37,19 +37,19 @@ atom/movable/proc/check_airflow_movable(n) return 1 -mob/check_airflow_movable(n) +/mob/check_airflow_movable(n) if(n < vsc.airflow_heavy_pressure) return 0 return 1 -mob/observer/check_airflow_movable() +/mob/observer/check_airflow_movable() return 0 -mob/living/silicon/check_airflow_movable() +/mob/living/silicon/check_airflow_movable() return 0 -obj/check_airflow_movable(n) +/obj/check_airflow_movable(n) if (!(. = ..())) return 0 if(isnull(w_class)) @@ -90,11 +90,11 @@ obj/check_airflow_movable(n) airflow_time = 0 . = ..() -atom/movable/proc/airflow_hit(atom/A) +/atom/movable/proc/airflow_hit(atom/A) airflow_speed = 0 airflow_dest = null -mob/airflow_hit(atom/A) +/mob/airflow_hit(atom/A) for(var/mob/M in hearers(src)) M.show_message("\The [src] slams into \a [A]!",1,"You hear a loud slam!",2) playsound(src, "smash.ogg", 25, 1, -1) @@ -102,17 +102,17 @@ mob/airflow_hit(atom/A) Weaken(weak_amt) . = ..() -obj/airflow_hit(atom/A) +/obj/airflow_hit(atom/A) for(var/mob/M in hearers(src)) M.show_message("\The [src] slams into \a [A]!",1,"You hear a loud slam!",2) playsound(src, "smash.ogg", 25, 1, -1) . = ..() -obj/item/airflow_hit(atom/A) +/obj/item/airflow_hit(atom/A) airflow_speed = 0 airflow_dest = null -mob/living/carbon/human/airflow_hit(atom/A) +/mob/living/carbon/human/airflow_hit(atom/A) // for(var/mob/M in hearers(src)) // M.show_message("[src] slams into [A]!",1,"You hear a loud slam!",2) playsound(src, "punch", 25, 1, -1) @@ -140,7 +140,7 @@ mob/living/carbon/human/airflow_hit(atom/A) Stun(round(airflow_speed * vsc.airflow_stun/2)) . = ..() -zone/proc/movables() +/zone/proc/movables() . = list() for(var/turf/T in contents) for(var/atom/movable/A in T) diff --git a/code/ZAS/Atom.dm b/code/ZAS/Atom.dm index b395c4551e..1953c58e9f 100644 --- a/code/ZAS/Atom.dm +++ b/code/ZAS/Atom.dm @@ -64,13 +64,13 @@ // AIR_BLOCKED - Blocked // ZONE_BLOCKED - Not blocked, but zone boundaries will not cross. // BLOCKED - Blocked, zone boundaries will not cross even if opened. -atom/proc/c_airblock(turf/other) +/atom/proc/c_airblock(turf/other) #ifdef ZASDBG ASSERT(isturf(other)) #endif return (AIR_BLOCKED*!CanZASPass(other, FALSE))|(ZONE_BLOCKED*!CanZASPass(other, TRUE)) -turf/c_airblock(turf/other) +/turf/c_airblock(turf/other) #ifdef ZASDBG ASSERT(isturf(other)) #endif diff --git a/code/ZAS/ConnectionGroup.dm b/code/ZAS/ConnectionGroup.dm index 11b1e22a0b..c048cf614a 100644 --- a/code/ZAS/ConnectionGroup.dm +++ b/code/ZAS/ConnectionGroup.dm @@ -242,7 +242,7 @@ Class Procs: if(!A.air.compare(air, vacuum_exception = 1)) air_master.mark_edge_active(src) -proc/ShareHeat(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles) +/proc/ShareHeat(datum/gas_mixture/A, datum/gas_mixture/B, connecting_tiles) //This implements a simplistic version of the Stefan-Boltzmann law. var/energy_delta = ((A.temperature - B.temperature) ** 4) * STEFAN_BOLTZMANN_CONSTANT * connecting_tiles * 2.5 var/maximum_energy_delta = max(0, min(A.temperature * A.heat_capacity() * A.group_multiplier, B.temperature * B.heat_capacity() * B.group_multiplier)) diff --git a/code/ZAS/Debug.dm b/code/ZAS/Debug.dm index 6f0a67fd3e..d16cf167db 100644 --- a/code/ZAS/Debug.dm +++ b/code/ZAS/Debug.dm @@ -16,5 +16,5 @@ var/image/mark = image('icons/Testing/Zone.dmi', icon_state = "mark") overlays += img dbg_img = img -proc/soft_assert(thing,fail) +/proc/soft_assert(thing,fail) if(!thing) message_admins(fail) \ No newline at end of file diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index 83537b8575..7166b42dc6 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -1,4 +1,4 @@ -client/proc/ZoneTick() +/client/proc/ZoneTick() set category = "Debug" set name = "Process Atmos" set desc = "Manually run a single tick of the air subsystem" @@ -16,7 +16,7 @@ client/proc/ZoneTick() to_chat(src, "Failed to process! ([air_master.tick_progress])") */ -client/proc/Zone_Info(turf/T as null|turf) +/client/proc/Zone_Info(turf/T as null|turf) set category = "Debug" if(T) if(istype(T,/turf/simulated) && T:zone) @@ -33,9 +33,9 @@ client/proc/Zone_Info(turf/T as null|turf) images -= zone_debug_images[zone] zone_debug_images = null -client/var/list/zone_debug_images +/client/var/list/zone_debug_images -client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf) +/client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf) set category = "Debug" if(!istype(T)) return @@ -94,7 +94,7 @@ client/proc/Test_ZAS_Connection(var/turf/simulated/T as turf) else to_chat(mob, "both turfs can merge.") -client/proc/ZASSettings() +/client/proc/ZASSettings() set category = "Debug" vsc.SetDefault(mob) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index bb4ec95a84..9c8ec74d4d 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -11,11 +11,11 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin /turf/var/obj/fire/fire = null //Some legacy definitions so fires can be started. -atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) +/atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) return null -turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) +/turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) /turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh) @@ -320,7 +320,7 @@ turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) return firelevel -datum/gas_mixture/proc/check_recombustability(list/fuel_objs) +/datum/gas_mixture/proc/check_recombustability(list/fuel_objs) . = 0 for(var/g in gas) if(gas_data.flags[g] & XGM_GAS_OXIDIZER && gas[g] >= 0.1) diff --git a/code/ZAS/Phoron.dm b/code/ZAS/Phoron.dm index 00467faad1..3fc8b8db0d 100644 --- a/code/ZAS/Phoron.dm +++ b/code/ZAS/Phoron.dm @@ -38,7 +38,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') var/N2O_HALLUCINATION_DESC = "Does being in sleeping gas cause you to hallucinate?" -obj/var/contaminated = 0 +/obj/var/contaminated = 0 /obj/item/proc/can_contaminate() @@ -173,7 +173,7 @@ obj/var/contaminated = 0 gloves.contaminate() -turf/Entered(obj/item/I) +/turf/Entered(obj/item/I) . = ..() //Items that are in phoron, but not on a mob, can still be contaminated. if(istype(I) && vsc.plc.CLOTH_CONTAMINATION && I.can_contaminate()) diff --git a/code/__defines/_lists.dm b/code/__defines/_lists.dm index 247e9dfeb0..582c026f3c 100644 --- a/code/__defines/_lists.dm +++ b/code/__defines/_lists.dm @@ -39,7 +39,7 @@ #define LAZYACCESSASSOC(L, I, K) L ? L[I] ? L[I][K] ? L[I][K] : null : null : null // Null-safe L.Cut() -#define LAZYCLEARLIST(L) if(L) L.Cut() +#define LAZYCLEARLIST(L) if(L) { L.Cut(); L = null; } // Reads L or an empty list if L is not a list. Note: Does NOT assign, L may be an expression. #define SANITIZE_LIST(L) ( islist(L) ? L : list() ) diff --git a/code/__defines/_planes+layers.dm b/code/__defines/_planes+layers.dm index b0dd0fbe7c..56c8997c4c 100644 --- a/code/__defines/_planes+layers.dm +++ b/code/__defines/_planes+layers.dm @@ -94,6 +94,8 @@ What is the naming convention for planes or layers? #define BELOW_MOB_LAYER 3.9 // Should be converted to plane swaps #define ABOVE_MOB_LAYER 4.1 // Should be converted to plane swaps +#define ABOVE_MOB_PLANE -24 + // Invisible things plane #define CLOAKED_PLANE -15 @@ -123,6 +125,7 @@ What is the naming convention for planes or layers? #define PLANE_PLANETLIGHTING 4 //Lighting on planets #define PLANE_LIGHTING 5 //Where the lighting (and darkness) lives #define PLANE_LIGHTING_ABOVE 6 //For glowy eyes etc. that shouldn't be affected by darkness +#define PLANE_RUNECHAT 7 #define PLANE_GHOSTS 10 //Spooooooooky ghooooooosts #define PLANE_AI_EYE 11 //The AI eye lives here @@ -154,6 +157,9 @@ What is the naming convention for planes or layers? #define CRIT_LAYER 18.3 //Client UI HUD stuff +#define PLANE_HOLOMAP_FRAME 92 +#define PLANE_HOLOMAP 93 // Holomap rendered here +#define PLANE_HOLOMAP_ICONS 94 // Holomap markers and bobbins #define PLANE_PLAYER_HUD 95 //The character's UI is on this plane #define LAYER_HUD_UNDER 1 //Under the HUD items #define LAYER_HUD_BASE 2 //The HUD items themselves diff --git a/code/__defines/atmos.dm b/code/__defines/atmos.dm index 424f2a2639..04905878a0 100644 --- a/code/__defines/atmos.dm +++ b/code/__defines/atmos.dm @@ -94,3 +94,7 @@ #define ATMOSTANK_CO2 25000 // CO2 and PH are not critically important for station, only for toxins and alternative coolants, no need to store a lot of those. #define ATMOSTANK_PHORON 25000 #define ATMOSTANK_NITROUSOXIDE 10000 // N2O doesn't have a real useful use, i guess it's on station just to allow refilling of sec's riot control canisters? + +// Used in various things like tanks and oxygen pumps. +#define TANK_MAX_RELEASE_PRESSURE (3*ONE_ATMOSPHERE) +#define TANK_DEFAULT_RELEASE_PRESSURE ONE_ATMOSPHERE \ No newline at end of file diff --git a/code/__defines/color.dm b/code/__defines/color.dm index 3cb9715586..0cf687df09 100644 --- a/code/__defines/color.dm +++ b/code/__defines/color.dm @@ -163,9 +163,6 @@ #define COLOR_ASSEMBLY_PURPLE "#6F6192" #define COLOR_ASSEMBLY_HOT_PINK "#FF69B4" -#define COLOR_ASTEROID_ROCK "#735555" -#define COLOR_GOLD "#ffcc33" - // Discord requires colors to be in decimal instead of hexadecimal. #define COLOR_WEBHOOK_DEFAULT 0x8bbbd5 // "#8bbbd5" #define COLOR_WEBHOOK_GOOD 0x2ECC71 // "#2ECC71" diff --git a/code/__defines/construction.dm b/code/__defines/construction.dm index 0ab4103e4d..c6d29a77ef 100644 --- a/code/__defines/construction.dm +++ b/code/__defines/construction.dm @@ -50,7 +50,6 @@ #define PIPING_LAYER_DEFAULT PIPING_LAYER_REGULAR // We offset the layer values of the different pipe types to ensure they look nice -#define PIPES_SCRUBBER_LAYER (PIPES_LAYER - 0.05) #define PIPES_AUX_LAYER (PIPES_LAYER - 0.04) #define PIPES_FUEL_LAYER (PIPES_LAYER - 0.03) #define PIPES_SCRUBBER_LAYER (PIPES_LAYER - 0.02) diff --git a/code/__defines/gamemode.dm b/code/__defines/gamemode.dm index dd49d06445..5c4020cca9 100644 --- a/code/__defines/gamemode.dm +++ b/code/__defines/gamemode.dm @@ -91,7 +91,6 @@ var/list/be_special_flags = list( #define MODE_MONKEY "monkey" #define MODE_RENEGADE "renegade" #define MODE_REVOLUTIONARY "revolutionary" -#define MODE_LOYALIST "loyalist" #define MODE_MALFUNCTION "malf" #define MODE_TRAITOR "traitor" #define MODE_AUTOTRAITOR "autotraitor" @@ -139,4 +138,28 @@ var/list/be_special_flags = list( #define Sp_CHARGES "charges" #define Sp_HOLDVAR "holdervar" -#define CHANGELING_STASIS_COST 20 \ No newline at end of file +#define CHANGELING_STASIS_COST 20 + +//Spell stuff, for Technomancer and Cult. +//cast_method flags +#define CAST_USE 1 // Clicking the spell in your hand. +#define CAST_MELEE 2 // Clicking an atom in melee range. +#define CAST_RANGED 4 // Clicking an atom beyond melee range. +#define CAST_THROW 8 // Throwing the spell and hitting an atom. +#define CAST_COMBINE 16 // Clicking another spell with this spell. +#define CAST_INNATE 32 // Activates upon verb usage, used for mobs without hands. + +//Aspects +#define ASPECT_FIRE "fire" //Damage over time and raising body-temp. Firesuits protect from this. +#define ASPECT_FROST "frost" //Slows down the affected, also involves imbedding with icicles. Winter coats protect from this. +#define ASPECT_SHOCK "shock" //Energy-expensive, usually stuns. Insulated armor protects from this. +#define ASPECT_AIR "air" //Mostly involves manipulation of atmos, useless in a vacuum. Magboots protect from this. +#define ASPECT_FORCE "force" //Manipulates gravity to push things away or towards a location. +#define ASPECT_TELE "tele" //Teleportation of self, other objects, or other people. +#define ASPECT_DARK "dark" //Makes all those photons vanish using magic-- WITH SCIENCE. Used for sneaky stuff. +#define ASPECT_LIGHT "light" //The opposite of dark, usually blinds, makes holo-illusions, or makes laser lightshows. +#define ASPECT_BIOMED "biomed" //Mainly concerned with healing and restoration. +#define ASPECT_EMP "emp" //Unused now. +#define ASPECT_UNSTABLE "unstable" //Heavily RNG-based, causes instability to the victim. +#define ASPECT_CHROMATIC "chromatic" //Used to combine with other spells. +#define ASPECT_UNHOLY "unholy" //Involves the dead, blood, and most things against divine beings. \ No newline at end of file diff --git a/code/__defines/holomap.dm b/code/__defines/holomap.dm index 0b93e03ae0..53584a5648 100644 --- a/code/__defines/holomap.dm +++ b/code/__defines/holomap.dm @@ -2,12 +2,50 @@ // Constants and standard colors for the holomap // -#define WORLD_ICON_SIZE 32 // Size of a standard tile in pixels (world.icon_size) -#define PIXEL_MULTIPLIER WORLD_ICON_SIZE/32 // Convert from normal icon size of 32 to whatever insane thing this server is using. #define HOLOMAP_ICON 'icons/480x480.dmi' // Icon file to start with when drawing holomaps (to get a 480x480 canvas). #define HOLOMAP_ICON_SIZE 480 // Pixel width & height of the holomap icon. Used for auto-centering etc. #define ui_holomap "CENTER-7, CENTER-7" // Screen location of the holomap "hud" +//Holomap filters +#define HOLOMAP_FILTER_DEATHSQUAD 1 +#define HOLOMAP_FILTER_ERT 2 +#define HOLOMAP_FILTER_NUKEOPS 4 +#define HOLOMAP_FILTER_ELITESYNDICATE 8 +#define HOLOMAP_FILTER_VOX 16 +#define HOLOMAP_FILTER_STATIONMAP 32 +#define HOLOMAP_FILTER_STATIONMAP_STRATEGIC 64//features markers over the captain's office, the armory, the SMES +#define HOLOMAP_FILTER_CULT 128//bloodstone locators + +#define HOLOMAP_EXTRA_STATIONMAP "stationmapformatted" +#define HOLOMAP_EXTRA_STATIONMAP_STRATEGIC "stationmapstrategic" +#define HOLOMAP_EXTRA_STATIONMAPAREAS "stationareas" +#define HOLOMAP_EXTRA_STATIONMAPSMALL "stationmapsmall" +#define HOLOMAP_EXTRA_STATIONMAPSMALL_NORTH "stationmapsmallnorth" +#define HOLOMAP_EXTRA_STATIONMAPSMALL_SOUTH "stationmapsmallsouth" +#define HOLOMAP_EXTRA_STATIONMAPSMALL_EAST "stationmapsmalleast" +#define HOLOMAP_EXTRA_STATIONMAPSMALL_WEST "stationmapsmallwest" +#define HOLOMAP_EXTRA_CULTMAP "cultmap" + +#define HOLOMAP_MARKER_SMES "smes" +#define HOLOMAP_MARKER_DISK "diskspawn" +#define HOLOMAP_MARKER_SKIPJACK "skipjack" +#define HOLOMAP_MARKER_SYNDISHUTTLE "syndishuttle" +#define HOLOMAP_MARKER_BLOODSTONE "bloodstone" +#define HOLOMAP_MARKER_BLOODSTONE_BROKEN "bloodstone-broken" +#define HOLOMAP_MARKER_BLOODSTONE_ANCHOR "bloodstone-narsie" +#define HOLOMAP_MARKER_CULT_ALTAR "altar" +#define HOLOMAP_MARKER_CULT_FORGE "forge" +#define HOLOMAP_MARKER_CULT_SPIRE "spire" +#define HOLOMAP_MARKER_CULT_ENTRANCE "path_entrance" +#define HOLOMAP_MARKER_CULT_EXIT "path_exit" +#define HOLOMAP_MARKER_CULT_RUNE "rune" + +#define HOLOMAP_DRAW_NORMAL 0 +#define HOLOMAP_DRAW_FULL 1 +#define HOLOMAP_DRAW_EMPTY 2 +#define HOLOMAP_DRAW_PATH 3 +#define HOLOMAP_DRAW_HALLWAY 4 + // Holomap colors #define HOLOMAP_OBSTACLE "#FFFFFFDD" // Color of walls and barriers #define HOLOMAP_PATH "#66666699" // Color of floors @@ -46,7 +84,3 @@ // #define HOLOMAP_MARKER_DISK "diskspawn" // #define HOLOMAP_MARKER_SKIPJACK "skipjack" // #define HOLOMAP_MARKER_SYNDISHUTTLE "syndishuttle" - -#define HOLOMAP_EXTRA_STATIONMAP "stationmapformatted" -#define HOLOMAP_EXTRA_STATIONMAPAREAS "stationareas" -#define HOLOMAP_EXTRA_STATIONMAPSMALL "stationmapsmall" \ No newline at end of file diff --git a/code/__defines/is_helpers.dm b/code/__defines/is_helpers.dm index d7aaed2ce8..c1405b370b 100644 --- a/code/__defines/is_helpers.dm +++ b/code/__defines/is_helpers.dm @@ -57,3 +57,5 @@ //#define isturf(D) istype(D, /turf) //Built in #define isopenspace(A) istype(A, /turf/simulated/open) #define isspace(A) istype(A, /turf/space) + +#define istaurtail(A) istype(A, /datum/sprite_accessory/tail/taur) diff --git a/code/__defines/items_clothing.dm b/code/__defines/items_clothing.dm index 27250bc9a2..a7dba8be88 100644 --- a/code/__defines/items_clothing.dm +++ b/code/__defines/items_clothing.dm @@ -101,11 +101,9 @@ #define slot_r_ear_str "slot_r_ear" #define slot_belt_str "slot_belt" #define slot_shoes_str "slot_shoes" -#define slot_head_str "slot_head" #define slot_wear_mask_str "slot_wear_mask" #define slot_handcuffed_str "slot_handcuffed" #define slot_legcuffed_str "slot_legcuffed" -#define slot_wear_mask_str "slot_wear_mask" #define slot_wear_id_str "slot_wear_id" #define slot_gloves_str "slot_gloves" #define slot_glasses_str "slot_glasses" diff --git a/code/__defines/map.dm b/code/__defines/map.dm index 0638ee77ef..a3a27dab9e 100644 --- a/code/__defines/map.dm +++ b/code/__defines/map.dm @@ -8,6 +8,7 @@ #define MAP_LEVEL_CONSOLES 0x040 // Z-levels available to various consoles, such as the crew monitor (when that gets coded in). Defaults to station_levels if unset. #define MAP_LEVEL_XENOARCH_EXEMPT 0x080 // Z-levels exempt from xenoarch digsite generation. #define MAP_LEVEL_PERSIST 0x100 // Z-levels where SSpersistence should persist between rounds +#define MAP_LEVEL_MAPPABLE 0x200 // Z-levels where mapping units will work fully // Misc map defines. #define SUBMAP_MAP_EDGE_PAD 15 // Automatically created submaps are forbidden from being this close to the main map's edge. \ No newline at end of file diff --git a/code/__defines/materials.dm b/code/__defines/materials.dm index 499c974b47..f62d800516 100644 --- a/code/__defines/materials.dm +++ b/code/__defines/materials.dm @@ -57,7 +57,4 @@ #define MATERIAL_BRITTLE 0x2 #define MATERIAL_PADDING 0x4 -#define DEFAULT_TABLE_MATERIAL "plastic" -#define DEFAULT_WALL_MATERIAL "steel" - #define TABLE_BRITTLE_MATERIAL_MULTIPLIER 4 // Amount table damage is multiplied by if it is made of a brittle material (e.g. glass) diff --git a/code/__defines/math_physics.dm b/code/__defines/math_physics.dm index 90950d0ca0..b00aef11ba 100644 --- a/code/__defines/math_physics.dm +++ b/code/__defines/math_physics.dm @@ -2,6 +2,7 @@ #define R_IDEAL_GAS_EQUATION 8.31 // kPa*L/(K*mol). #define ONE_ATMOSPHERE 101.325 // kPa. #define IDEAL_GAS_ENTROPY_CONSTANT 1164 // (mol^3 * s^3) / (kg^3 * L). +#define ADIABATIC_EXPONENT 0.667 //Actually adiabatic exponent - 1. #define T0C 273.15 // 0.0 degrees celcius #define T20C 293.15 // 20.0 degrees celcius diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 237413d180..0b955b6cfc 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -196,8 +196,6 @@ #define MIDNIGHT_ROLLOVER 864000 //number of deciseconds in a day -#define WORLD_ICON_SIZE 32 //Needed for the R-UST port -#define PIXEL_MULTIPLIER WORLD_ICON_SIZE/32 //Needed for the R-UST port #define MAX_CLIENT_VIEW 34 // Maximum effective value of client.view (According to DM references) // Maploader bounds indices @@ -452,4 +450,6 @@ GLOBAL_LIST_INIT(all_volume_channels, list( #ifndef HTTP_POST_DLL_LOCATION #define HTTP_POST_DLL_LOCATION (world.system_type == MS_WINDOWS ? WINDOWS_HTTP_POST_DLL_LOCATION : UNIX_HTTP_POST_DLL_LOCATION) -#endif \ No newline at end of file +#endif + +#define DOCK_ATTEMPT_TIMEOUT 200 //how long in ticks we wait before assuming the docking controller is broken or blown up. \ No newline at end of file diff --git a/code/__defines/species_languages.dm b/code/__defines/species_languages.dm index dd3d08f633..57cdc5b147 100644 --- a/code/__defines/species_languages.dm +++ b/code/__defines/species_languages.dm @@ -25,19 +25,18 @@ #define EMP_OXY_DMG 0x100 // EMPs inflict oxy damage // Species allergens -#define MEAT 0x1 // Skrell won't like this. -#define FISH 0x2 // Seperate for completion's sake. Still bad for skrell. -#define FRUIT 0x4 // An apple a day only keeps the doctor away if they're allergic. -#define VEGETABLE 0x8 // Taters 'n' carrots. Potato allergy is a thing, apparently. -#define GRAINS 0x10 // Wheat, oats, etc. -#define BEANS 0x20 // The musical fruit! Includes soy. -#define SEEDS 0x40 // Hope you don't have a nut allergy. -#define DAIRY 0x80 // Lactose intolerance, ho! Also bad for skrell. -#define FUNGI 0x100 // Delicious shrooms. -#define COFFEE 0x200 // Mostly here for tajara. -#define GENERIC 0x400 // Catchall for stuff that doesn't fall into the groups above. You shouldn't be allergic to this type, ever. -#define SUGARS 0x800 // For unathi-like reactions -#define EGGS 0x1000 // For Skrell eggs allergy +#define ALLERGEN_MEAT 0x1 // Skrell won't like this. +#define ALLERGEN_FISH 0x2 // Seperate for completion's sake. Still bad for skrell. +#define ALLERGEN_FRUIT 0x4 // An apple a day only keeps the doctor away if they're allergic. +#define ALLERGEN_VEGETABLE 0x8 // Taters 'n' carrots. Potato allergy is a thing, apparently. +#define ALLERGEN_GRAINS 0x10 // Wheat, oats, etc. +#define ALLERGEN_BEANS 0x20 // The musical fruit! Includes soy. +#define ALLERGEN_SEEDS 0x40 // Hope you don't have a nut allergy. +#define ALLERGEN_DAIRY 0x80 // Lactose intolerance, ho! Also bad for skrell. +#define ALLERGEN_FUNGI 0x100 // Delicious shrooms. +#define ALLERGEN_COFFEE 0x200 // Mostly here for tajara. +#define ALLERGEN_SUGARS 0x400 // For unathi-like reactions +#define ALLERGEN_EGGS 0x800 // For Skrell eggs allergy // Allergen reactions #define AG_TOX_DMG 0x1 // the classic diff --git a/code/__defines/turfs.dm b/code/__defines/turfs.dm index 2d49014114..9c5138f92e 100644 --- a/code/__defines/turfs.dm +++ b/code/__defines/turfs.dm @@ -19,7 +19,9 @@ #define isCardinal(x) (x == NORTH || x == SOUTH || x == EAST || x == WEST) #define isDiagonal(x) (x == NORTHEAST || x == SOUTHEAST || x == NORTHWEST || x == SOUTHWEST) +#define FOOTSTEP_SPRITE_AMT 2 + // Used to designate if a turf (or its area) should initialize as outdoors or not. #define OUTDOORS_YES 1 // This needs to be 1 for backwards compatibility. #define OUTDOORS_NO 0 // Ditto. -#define OUTDOORS_INHERIT -1 // If a turf has this, it will defer to the area's settings. \ No newline at end of file +#define OUTDOORS_INHERIT -1 // If a turf has this, it will defer to the area's settings. diff --git a/code/_global_vars/bitfields.dm b/code/_global_vars/bitfields.dm index 891c50ce88..be3de4adeb 100644 --- a/code/_global_vars/bitfields.dm +++ b/code/_global_vars/bitfields.dm @@ -2,6 +2,38 @@ GLOBAL_LIST_INIT(bitfields, list( "datum_flags" = list( "DF_VAR_EDITED" = DF_VAR_EDITED, "DF_ISPROCESSING" = DF_ISPROCESSING - ) - + ), + "appearance_flags" = list( + "KEEP_APART" = KEEP_APART, + "KEEP_TOGETHER" = KEEP_TOGETHER, + "LONG_GLIDE" = LONG_GLIDE, + "NO_CLIENT_COLOR" = NO_CLIENT_COLOR, + "PIXEL_SCALE" = PIXEL_SCALE, + "PLANE_MASTER" = PLANE_MASTER, + "RESET_ALPHA" = RESET_ALPHA, + "RESET_COLOR" = RESET_COLOR, + "RESET_TRANSFORM" = RESET_TRANSFORM, + "TILE_BOUND" = TILE_BOUND, + ), + "vis_flags" = list( + "VIS_HIDE" = VIS_HIDE, + "VIS_INHERIT_DIR" = VIS_INHERIT_DIR, + "VIS_INHERIT_ICON" = VIS_INHERIT_ICON, + "VIS_INHERIT_ICON_STATE" = VIS_INHERIT_ICON_STATE, + "VIS_INHERIT_ID" = VIS_INHERIT_ID, + "VIS_INHERIT_LAYER" = VIS_INHERIT_LAYER, + "VIS_INHERIT_PLANE" = VIS_INHERIT_PLANE, + "VIS_UNDERLAY" = VIS_UNDERLAY, + ), + "sight" = list( + "BLIND" = BLIND, + "SEE_BLACKNESS" = SEE_BLACKNESS, + "SEE_INFRA" = SEE_INFRA, + "SEE_MOBS" = SEE_MOBS, + "SEE_OBJS" = SEE_OBJS, + "SEE_PIXELS" = SEE_PIXELS, + "SEE_SELF" = SEE_SELF, + "SEE_THRU" = SEE_THRU, + "SEE_TURFS" = SEE_TURFS, + ), )) diff --git a/code/_helpers/_lists.dm b/code/_helpers/_lists.dm index a87307ac80..0d1a46b2ea 100644 --- a/code/_helpers/_lists.dm +++ b/code/_helpers/_lists.dm @@ -79,7 +79,7 @@ return counting_english_list(input, output_icons, determiners, nothing_text, and_text, comma_text, final_comma_text) //Returns list element or null. Should prevent "index out of bounds" error. -proc/listgetindex(var/list/list,index) +/proc/listgetindex(var/list/list,index) if(istype(list) && list.len) if(isnum(index)) if(InRange(index,1,list.len)) @@ -89,13 +89,13 @@ proc/listgetindex(var/list/list,index) return //Return either pick(list) or null if list is not of type /list or is empty -proc/safepick(list/list) +/proc/safepick(list/list) if(!islist(list) || !list.len) return return pick(list) //Checks if the list is empty -proc/isemptylist(list/list) +/proc/isemptylist(list/list) if(!list.len) return 1 return 0 @@ -177,13 +177,13 @@ proc/isemptylist(list/list) ////////////////////////////////////////////////////// //Empties the list by setting the length to 0. Hopefully the elements get garbage collected -proc/clearlist(list/list) +/proc/clearlist(list/list) if(istype(list)) list.len = 0 return //Removes any null entries from the list -proc/listclearnulls(list/list) +/proc/listclearnulls(list/list) if(istype(list)) while(null in list) list -= null @@ -611,7 +611,7 @@ This actually tests if they have the same entries and values. min = mid+1 /* -proc/dd_sortedObjectList(list/incoming) +/proc/dd_sortedObjectList(list/incoming) /* Use binary search to order by dd_SortValue(). This works by going to the half-point of the list, seeing if the node in @@ -669,7 +669,7 @@ proc/dd_sortedObjectList(list/incoming) return sorted_list */ -proc/dd_sortedtextlist(list/incoming, case_sensitive = 0) +/proc/dd_sortedtextlist(list/incoming, case_sensitive = 0) // Returns a new list with the text values sorted. // Use binary search to order by sortValue. // This works by going to the half-point of the list, seeing if the node in question is higher or lower cost, @@ -728,7 +728,7 @@ proc/dd_sortedtextlist(list/incoming, case_sensitive = 0) return sorted_text -proc/dd_sortedTextList(list/incoming) +/proc/dd_sortedTextList(list/incoming) var/case_sensitive = 1 return dd_sortedtextlist(incoming, case_sensitive) diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index 1af2e01bb9..6bfac66783 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -314,39 +314,35 @@ return list("mobs" = mobs, "objs" = objs) -#define SIGN(X) ((X<0)?-1:1) - -proc - inLineOfSight(X1,Y1,X2,Y2,Z=1,PX1=16.5,PY1=16.5,PX2=16.5,PY2=16.5) - var/turf/T - if(X1==X2) - if(Y1==Y2) - return 1 //Light cannot be blocked on same tile - else - var/s = SIGN(Y2-Y1) - Y1+=s - while(Y1!=Y2) - T=locate(X1,Y1,Z) - if(T.opacity) - return 0 - Y1+=s +/proc/inLineOfSight(X1,Y1,X2,Y2,Z=1,PX1=16.5,PY1=16.5,PX2=16.5,PY2=16.5) + var/turf/T + if(X1==X2) + if(Y1==Y2) + return 1 //Light cannot be blocked on same tile else - var/m=(32*(Y2-Y1)+(PY2-PY1))/(32*(X2-X1)+(PX2-PX1)) - var/b=(Y1+PY1/32-0.015625)-m*(X1+PX1/32-0.015625) //In tiles - var/signX = SIGN(X2-X1) - var/signY = SIGN(Y2-Y1) - if(X1 transparent, gray -> translucent white, white -> solid white - proc/BecomeAlphaMask() - SwapColor(null, "#000000ff") // don't let transparent become gray - MapColors(0,0,0,0.3, 0,0,0,0.59, 0,0,0,0.11, 0,0,0,0, 1,1,1,0) +// Change a grayscale icon into a white icon where the original color becomes the alpha +// I.e., black -> transparent, gray -> translucent white, white -> solid white +/icon/proc/BecomeAlphaMask() + SwapColor(null, "#000000ff") // don't let transparent become gray + MapColors(0,0,0,0.3, 0,0,0,0.59, 0,0,0,0.11, 0,0,0,0, 1,1,1,0) - proc/UseAlphaMask(mask) - Opaque() - AddAlphaMask(mask) +/icon/proc/UseAlphaMask(mask) + Opaque() + AddAlphaMask(mask) - proc/AddAlphaMask(mask) - var/icon/M = new(mask) - M.Blend("#ffffff", ICON_SUBTRACT) - // apply mask - Blend(M, ICON_ADD) +/icon/proc/AddAlphaMask(mask) + var/icon/M = new(mask) + M.Blend("#ffffff", ICON_SUBTRACT) + // apply mask + Blend(M, ICON_ADD) /* HSV format is represented as "#hhhssvv" or "#hhhssvvaa" @@ -317,7 +316,7 @@ icon Higher value means brighter color */ -proc/ReadRGB(rgb) +/proc/ReadRGB(rgb) if(!rgb) return // interpret the HSV or HSVA value @@ -367,7 +366,7 @@ proc/ReadRGB(rgb) . = list(r, g, b) if(usealpha) . += alpha -proc/ReadHSV(hsv) +/proc/ReadHSV(hsv) if(!hsv) return // interpret the HSV or HSVA value @@ -406,7 +405,7 @@ proc/ReadHSV(hsv) . = list(hue, sat, val) if(usealpha) . += alpha -proc/HSVtoRGB(hsv) +/proc/HSVtoRGB(hsv) if(!hsv) return "#000000" var/list/HSV = ReadHSV(hsv) if(!HSV) return "#000000" @@ -434,7 +433,7 @@ proc/HSVtoRGB(hsv) return (HSV.len > 3) ? rgb(r,g,b,HSV[4]) : rgb(r,g,b) -proc/RGBtoHSV(rgb) +/proc/RGBtoHSV(rgb) if(!rgb) return "#0000000" var/list/RGB = ReadRGB(rgb) if(!RGB) return "#0000000" @@ -465,7 +464,7 @@ proc/RGBtoHSV(rgb) return hsv(hue, sat, val, (RGB.len>3 ? RGB[4] : null)) -proc/hsv(hue, sat, val, alpha) +/proc/hsv(hue, sat, val, alpha) if(hue < 0 || hue >= 1536) hue %= 1536 if(hue < 0) hue += 1536 if((hue & 0xFF) == 0xFF) @@ -498,7 +497,7 @@ proc/hsv(hue, sat, val, alpha) amount<0 or amount>1 are allowed */ -proc/BlendHSV(hsv1, hsv2, amount) +/proc/BlendHSV(hsv1, hsv2, amount) var/list/HSV1 = ReadHSV(hsv1) var/list/HSV2 = ReadHSV(hsv2) @@ -552,7 +551,7 @@ proc/BlendHSV(hsv1, hsv2, amount) amount<0 or amount>1 are allowed */ -proc/BlendRGB(rgb1, rgb2, amount) +/proc/BlendRGB(rgb1, rgb2, amount) var/list/RGB1 = ReadRGB(rgb1) var/list/RGB2 = ReadRGB(rgb2) @@ -568,10 +567,10 @@ proc/BlendRGB(rgb1, rgb2, amount) return isnull(alpha) ? rgb(r, g, b) : rgb(r, g, b, alpha) -proc/BlendRGBasHSV(rgb1, rgb2, amount) +/proc/BlendRGBasHSV(rgb1, rgb2, amount) return HSVtoRGB(RGBtoHSV(rgb1), RGBtoHSV(rgb2), amount) -proc/HueToAngle(hue) +/proc/HueToAngle(hue) // normalize hsv in case anything is screwy if(hue < 0 || hue >= 1536) hue %= 1536 if(hue < 0) hue += 1536 @@ -579,7 +578,7 @@ proc/HueToAngle(hue) hue -= hue >> 8 return hue / (1530/360) -proc/AngleToHue(angle) +/proc/AngleToHue(angle) // normalize hsv in case anything is screwy if(angle < 0 || angle >= 360) angle -= 360 * round(angle / 360) var/hue = angle * (1530/360) @@ -589,7 +588,7 @@ proc/AngleToHue(angle) // positive angle rotates forward through red->green->blue -proc/RotateHue(hsv, angle) +/proc/RotateHue(hsv, angle) var/list/HSV = ReadHSV(hsv) // normalize hsv in case anything is screwy @@ -611,13 +610,13 @@ proc/RotateHue(hsv, angle) return hsv(HSV[1], HSV[2], HSV[3], (HSV.len > 3 ? HSV[4] : null)) // Convert an rgb color to grayscale -proc/GrayScale(rgb) +/proc/GrayScale(rgb) var/list/RGB = ReadRGB(rgb) var/gray = RGB[1]*0.3 + RGB[2]*0.59 + RGB[3]*0.11 return (RGB.len > 3) ? rgb(gray, gray, gray, RGB[4]) : rgb(gray, gray, gray) // Change grayscale color to black->tone->white range -proc/ColorTone(rgb, tone) +/proc/ColorTone(rgb, tone) var/list/RGB = ReadRGB(rgb) var/list/TONE = ReadRGB(tone) @@ -925,7 +924,7 @@ GLOBAL_LIST_EMPTY(cached_examine_icons) /proc/uncache_examine_icon(var/weakref/WR) GLOB.cached_examine_icons -= WR -proc/adjust_brightness(var/color, var/value) +/proc/adjust_brightness(var/color, var/value) if (!color) return "#FFFFFF" if (!value) return color @@ -935,7 +934,7 @@ proc/adjust_brightness(var/color, var/value) RGB[3] = CLAMP(RGB[3]+value,0,255) return rgb(RGB[1],RGB[2],RGB[3]) -proc/sort_atoms_by_layer(var/list/atoms) +/proc/sort_atoms_by_layer(var/list/atoms) // Comb sort icons based on levels var/list/result = atoms.Copy() var/gap = result.len diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index dc3d9f179c..7860e93b00 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -1,4 +1,4 @@ -proc/random_hair_style(gender, species = SPECIES_HUMAN) +/proc/random_hair_style(gender, species = SPECIES_HUMAN) var/h_style = "Bald" var/list/valid_hairstyles = list() @@ -17,7 +17,7 @@ proc/random_hair_style(gender, species = SPECIES_HUMAN) return h_style -proc/random_facial_hair_style(gender, species = SPECIES_HUMAN) +/proc/random_facial_hair_style(gender, species = SPECIES_HUMAN) var/f_style = "Shaved" var/list/valid_facialhairstyles = list() @@ -37,14 +37,14 @@ proc/random_facial_hair_style(gender, species = SPECIES_HUMAN) return f_style -proc/sanitize_name(name, species = SPECIES_HUMAN, robot = 0) +/proc/sanitize_name(name, species = SPECIES_HUMAN, robot = 0) var/datum/species/current_species if(species) current_species = GLOB.all_species[species] return current_species ? current_species.sanitize_name(name, robot) : sanitizeName(name, MAX_NAME_LEN, robot) -proc/random_name(gender, species = SPECIES_HUMAN) +/proc/random_name(gender, species = SPECIES_HUMAN) var/datum/species/current_species if(species) @@ -58,7 +58,7 @@ proc/random_name(gender, species = SPECIES_HUMAN) else return current_species.get_random_name(gender) -proc/random_skin_tone() +/proc/random_skin_tone() switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino")) if("caucasian") . = -10 if("afroamerican") . = -115 @@ -68,7 +68,7 @@ proc/random_skin_tone() else . = rand(-185,34) return min(max( .+rand(-25, 25), -185),34) -proc/skintone2racedescription(tone) +/proc/skintone2racedescription(tone) switch (tone) if(30 to INFINITY) return "albino" if(20 to 30) return "pale" @@ -80,7 +80,7 @@ proc/skintone2racedescription(tone) if(-INFINITY to -65) return "black" else return "unknown" -proc/age2agedescription(age) +/proc/age2agedescription(age) switch(age) if(0 to 1) return "infant" if(1 to 3) return "toddler" diff --git a/code/_helpers/sorts/comparators.dm b/code/_helpers/sorts/comparators.dm index c192d19008..6e59f479c5 100644 --- a/code/_helpers/sorts/comparators.dm +++ b/code/_helpers/sorts/comparators.dm @@ -57,12 +57,6 @@ if (!.) . = B[STAT_ENTRY_COUNT] - A[STAT_ENTRY_COUNT] -// Compares complexity of recipes for use in cooking, etc. This is for telling which recipe to make, not for showing things to the player. -/proc/cmp_recipe_complexity_dsc(datum/recipe/A, datum/recipe/B) - var/a_score = LAZYLEN(A.items) + LAZYLEN(A.reagents) + LAZYLEN(A.fruit) - var/b_score = LAZYLEN(B.items) + LAZYLEN(B.reagents) + LAZYLEN(B.fruit) - return b_score - a_score - /proc/cmp_typepaths_asc(A, B) return sorttext("[B]","[A]") diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index 5daa3c7530..770881e49a 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -319,7 +319,7 @@ //Used in preferences' SetFlavorText and human's set_flavor verb //Previews a string of len or less length -proc/TextPreview(var/string,var/len=40) +/proc/TextPreview(var/string,var/len=40) if(length(string) <= len) if(!length(string)) return "\[...\]" diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm index 0b014a4844..a52b458f92 100644 --- a/code/_helpers/time.dm +++ b/code/_helpers/time.dm @@ -20,6 +20,8 @@ #define TICKS2DS(T) ((T) TICKS) // Convert ticks to deciseconds #define DS2NEARESTTICK(DS) TICKS2DS(-round(-(DS2TICKS(DS)))) +var/world_startup_time + /proc/get_game_time() var/global/time_offset = 0 var/global/last_time = 0 @@ -78,7 +80,7 @@ var/next_station_date_change = 1 DAY return time2text(wtime - GLOB.timezoneOffset, format) /* Returns 1 if it is the selected month and day */ -proc/isDay(var/month, var/day) +/proc/isDay(var/month, var/day) if(isnum(month) && isnum(day)) var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 1d5d770f71..0541b7bed7 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -595,7 +595,7 @@ Turf and target are seperate in case you want to teleport some distance from a t return max(min(middle, high), low) //returns random gauss number -proc/GaussRand(var/sigma) +/proc/GaussRand(var/sigma) var/x,y,rsq do x=2*rand()-1 @@ -605,7 +605,7 @@ proc/GaussRand(var/sigma) return sigma*y*sqrt(-2*log(rsq)/rsq) //returns random gauss number, rounded to 'roundto' -proc/GaussRandRound(var/sigma,var/roundto) +/proc/GaussRandRound(var/sigma,var/roundto) return round(GaussRand(sigma),roundto) //Will return the contents of an atom recursivly to a depth of 'searchDepth' @@ -866,7 +866,7 @@ proc/GaussRandRound(var/sigma,var/roundto) refined_trg -= B continue moving -proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) +/proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) if(!original) return null @@ -1014,16 +1014,16 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) -proc/get_cardinal_dir(atom/A, atom/B) +/proc/get_cardinal_dir(atom/A, atom/B) var/dx = abs(B.x - A.x) var/dy = abs(B.y - A.y) return get_dir(A, B) & (rand() * (dx+dy) < dy ? 3 : 12) //chances are 1:value. anyprob(1) will always return true -proc/anyprob(value) +/proc/anyprob(value) return (rand(1,value)==value) -proc/view_or_range(distance = world.view , center = usr , type) +/proc/view_or_range(distance = world.view , center = usr , type) switch(type) if("view") . = view(distance,center) @@ -1031,7 +1031,7 @@ proc/view_or_range(distance = world.view , center = usr , type) . = range(distance,center) return -proc/oview_or_orange(distance = world.view , center = usr , type) +/proc/oview_or_orange(distance = world.view , center = usr , type) switch(type) if("view") . = oview(distance,center) @@ -1039,7 +1039,7 @@ proc/oview_or_orange(distance = world.view , center = usr , type) . = orange(distance,center) return -proc/get_mob_with_client_list() +/proc/get_mob_with_client_list() var/list/mobs = list() for(var/mob/M in mob_list) if (M.client) @@ -1096,7 +1096,7 @@ var/global/list/common_tools = list( return TRUE return -proc/is_hot(obj/item/W as obj) +/proc/is_hot(obj/item/W as obj) switch(W.type) if(/obj/item/weapon/weldingtool) var/obj/item/weapon/weldingtool/WT = W @@ -1478,8 +1478,6 @@ var/mob/dview/dview_mob = new /proc/pass() return -#define NAMEOF(datum, X) (#X || ##datum.##X) - /proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) if (value == FALSE) //nothing should be calling us with a number, so this is safe value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text diff --git a/code/_macros.dm b/code/_macros.dm index 18a8ddf825..d122d9045f 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -40,5 +40,6 @@ #define ARGS_DEBUG log_debug("[__FILE__] - [__LINE__]") ; for(var/arg in args) { log_debug("\t[log_info_line(arg)]") } -#define isitem(A) istype(A, /obj/item) -#define isTaurTail(A) istype(A, /datum/sprite_accessory/tail/taur) +#define WORLD_ICON_SIZE 32 //Needed for the R-UST port + +#define PIXEL_MULTIPLIER WORLD_ICON_SIZE/32 //Needed for the R-UST port \ No newline at end of file diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 4bd324d7cf..71e32197ff 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -87,12 +87,6 @@ var/list/global_huds = list( science = setup_overlay("science_hud") material = setup_overlay("material_hud") - // The holomap screen object is actually totally invisible. - // Station maps work by setting it as an images location before sending to client, not - // actually changing the icon or icon state of the screen object itself! - // Why do they work this way? I don't know really, that is how /vg designed them, but since they DO - // work this way, we can take advantage of their immutability by making them part of - // the global_hud (something we have and /vg doesn't) instead of an instance per mob. holomap = new /obj/screen() holomap.name = "holomap" holomap.icon = null @@ -188,16 +182,17 @@ var/list/global_huds = list( var/icon/ui_style var/ui_color var/ui_alpha - + var/list/minihuds = list() -datum/hud/New(mob/owner) +/datum/hud/New(mob/owner) mymob = owner instantiate() ..() /datum/hud/Destroy() . = ..() + qdel_null(minihuds) grab_intent = null hurt_intent = null disarm_intent = null @@ -216,7 +211,6 @@ datum/hud/New(mob/owner) hotkeybuttons = null // item_action_list = null // ? mymob = null - qdel_null(minihuds) /datum/hud/proc/hidden_inventory_update() if(!mymob) return @@ -307,7 +301,7 @@ datum/hud/New(mob/owner) /datum/hud/proc/instantiate() if(!ismob(mymob)) return 0 - + mymob.create_mob_hud(src) persistant_inventory_update() diff --git a/code/_onclick/hud/minihud.dm b/code/_onclick/hud/minihud.dm new file mode 100644 index 0000000000..1b8cd69caf --- /dev/null +++ b/code/_onclick/hud/minihud.dm @@ -0,0 +1,36 @@ +/datum/mini_hud + var/datum/hud/main_hud + var/list/screenobjs + var/needs_processing = FALSE + +/datum/mini_hud/New(var/datum/hud/other) + apply_to_hud(other) + if(needs_processing) + START_PROCESSING(SSprocessing, src) + +/datum/mini_hud/Destroy() + unapply_to_hud() + if(needs_processing) + STOP_PROCESSING(SSprocessing, src) + QDEL_LIST_NULL(screenobjs) + return ..() + +// Apply to a real /datum/hud +/datum/mini_hud/proc/apply_to_hud(var/datum/hud/other) + if(main_hud) + unapply_to_hud(main_hud) + main_hud = other + main_hud.apply_minihud(src) + +// Remove from a real /datum/hud +/datum/mini_hud/proc/unapply_to_hud() + main_hud?.remove_minihud(src) + main_hud = null + +// Update the hud +/datum/mini_hud/process() + return PROCESS_KILL // You shouldn't be here! + +// Return a list of screen objects we use +/datum/mini_hud/proc/get_screen_objs(var/mob/M) + return screenobjs.Copy() diff --git a/code/_onclick/hud/minihud_mapper.dm b/code/_onclick/hud/minihud_mapper.dm new file mode 100644 index 0000000000..1b9246d729 --- /dev/null +++ b/code/_onclick/hud/minihud_mapper.dm @@ -0,0 +1,13 @@ +// Specific types +/datum/mini_hud/mapper + var/obj/item/device/mapping_unit/owner + +/datum/mini_hud/mapper/New(var/datum/hud/other, owner) + src.owner = owner + screenobjs = list(new /obj/screen/movable/mapper_holder(null, owner)) + ..() + +/datum/mini_hud/mapper/Destroy() + owner?.hud_item = null + owner?.hud_datum = null + return ..() \ No newline at end of file diff --git a/code/_onclick/hud/rigmech.dm b/code/_onclick/hud/minihud_rigmech.dm similarity index 86% rename from code/_onclick/hud/rigmech.dm rename to code/_onclick/hud/minihud_rigmech.dm index 91632e1604..e54a733f80 100644 --- a/code/_onclick/hud/rigmech.dm +++ b/code/_onclick/hud/minihud_rigmech.dm @@ -1,40 +1,3 @@ -/datum/mini_hud - var/datum/hud/main_hud - var/list/screenobjs = list() - var/list/types_to_instantiate - var/needs_processing = FALSE - -/datum/mini_hud/New(var/datum/hud/other) - apply_to_hud(other) - if(needs_processing) - START_PROCESSING(SSprocessing, src) - -/datum/mini_hud/Destroy() - main_hud?.remove_minihud(src) - main_hud = null - if(needs_processing) - STOP_PROCESSING(SSprocessing, src) - return ..() - -// Apply to a real /datum/hud -/datum/mini_hud/proc/apply_to_hud(var/datum/hud/other) - if(main_hud) - unapply_to_hud(main_hud) - main_hud = other - main_hud.apply_minihud(src) - -// Remove from a real /datum/hud -/datum/mini_hud/proc/unapply_to_hud(var/datum/hud/other) - main_hud.remove_minihud(src) - -// Update the hud -/datum/mini_hud/process() - return PROCESS_KILL // You shouldn't be here! - -// Return a list of screen objects we use -/datum/mini_hud/proc/get_screen_objs(var/mob/M) - return screenobjs - // Specific types /datum/mini_hud/rig var/obj/item/weapon/rig/owner_rig diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 6a42572c2f..9d6da07f0b 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -655,3 +655,218 @@ holder.screen -= src holder = null return ..() + + +/** + * This object holds all the on-screen elements of the mapping unit. + * It has a decorative frame and onscreen buttons. The map itself is drawn + * using a white mask and multiplying the mask against it to crop it to the + * size of the screen. This is not ideal, as filter() is faster, and has + * alpha masks, but the alpha masks it has can't be animated, so the 'ping' + * mode of this device isn't possible using that technique. + * + * The markers use that technique, though, so at least there's that. + */ +/obj/screen/movable/mapper_holder + name = "gps unit" + icon = null + icon_state = "" + screen_loc = "CENTER,CENTER" + alpha = 255 + appearance_flags = KEEP_TOGETHER + mouse_opacity = 1 + plane = PLANE_HOLOMAP + + var/running = FALSE + + var/obj/screen/mapper/mask_full/mask_full + var/obj/screen/mapper/mask_ping/mask_ping + var/obj/screen/mapper/bg/bg + + var/obj/screen/mapper/frame/frame + var/obj/screen/mapper/powbutton/powbutton + var/obj/screen/mapper/mapbutton/mapbutton + + var/obj/item/device/mapping_unit/owner + var/obj/screen/mapper/extras_holder/extras_holder + +/obj/screen/movable/mapper_holder/Initialize(mapload, newowner) + owner = newowner + + mask_full = new(src) // Full white square mask + mask_ping = new(src) // Animated 'pinging' mask + bg = new(src) // Background color, holds map in vis_contents, uses mult against masks + + frame = new(src) // Decorative frame + powbutton = new(src) // Clickable button + mapbutton = new(src) // Clickable button + + frame.icon_state = initial(frame.icon_state)+owner.hud_frame_hint + + /** + * The vis_contents layout is: this(frame,extras_holder,mask(bg(map))) + * bg is set to BLEND_MULTIPLY against the mask to crop it. + */ + + mask_full.vis_contents.Add(bg) + mask_ping.vis_contents.Add(bg) + frame.vis_contents.Add(powbutton,mapbutton) + vis_contents.Add(frame) + + +/obj/screen/movable/mapper_holder/Destroy() + qdel_null(mask_full) + qdel_null(mask_ping) + qdel_null(bg) + + qdel_null(frame) + qdel_null(powbutton) + qdel_null(mapbutton) + + extras_holder = null + owner = null + return ..() + +/obj/screen/movable/mapper_holder/proc/update(var/obj/screen/mapper/map, var/obj/screen/mapper/extras_holder/extras, ping = FALSE) + if(!running) + running = TRUE + if(ping) + vis_contents.Add(mask_ping) + else + vis_contents.Add(mask_full) + + bg.vis_contents.Cut() + bg.vis_contents.Add(map) + + if(extras && !extras_holder) + extras_holder = extras + vis_contents += extras_holder + if(!extras && extras_holder) + vis_contents -= extras_holder + extras_holder = null + +/obj/screen/movable/mapper_holder/proc/powerClick() + if(running) + off() + else + on() + +/obj/screen/movable/mapper_holder/proc/mapClick() + if(owner) + if(running) + off() + owner.pinging = !owner.pinging + on() + +/obj/screen/movable/mapper_holder/proc/off(var/inform = TRUE) + frame.cut_overlay("powlight") + bg.vis_contents.Cut() + vis_contents.Remove(mask_ping, mask_full, extras_holder) + extras_holder = null + running = FALSE + if(inform) + owner.stop_updates() + +/obj/screen/movable/mapper_holder/proc/on(var/inform = TRUE) + frame.add_overlay("powlight") + if(inform) + owner.start_updates() + +// Prototype +/obj/screen/mapper + plane = PLANE_HOLOMAP + mouse_opacity = 0 + var/obj/screen/movable/mapper_holder/parent + +/obj/screen/mapper/New() + ..() + parent = loc + +/obj/screen/mapper/Destroy() + parent = null + return ..() + +// Holds the actual map image +/obj/screen/mapper/map + var/offset_x = 32 + var/offset_y = 32 + +// I really wish I could use filters for this instead of this multiplication-masking technique +// but alpha filters can't be animated, which means I can't use them for the 'sonar ping' mode. +// If filters start supporting animated icons in the future (for the alpha mask filter), +// you should definitely replace these with that technique instead. +/obj/screen/mapper/mask_full + icon = 'icons/effects/64x64.dmi' + icon_state = "mapper_mask" + +/obj/screen/mapper/mask_ping + icon = 'icons/effects/64x64.dmi' + icon_state = "mapper_ping" + +/obj/screen/mapper/bg + icon = 'icons/effects/64x64.dmi' + icon_state = "mapper_bg" + + blend_mode = BLEND_MULTIPLY + appearance_flags = KEEP_TOGETHER + +// Frame/deco components +/obj/screen/mapper/frame + icon = 'icons/effects/gpshud.dmi' + icon_state = "frame" + plane = PLANE_HOLOMAP_FRAME + pixel_x = -18 + pixel_y = -29 + mouse_opacity = 1 + vis_flags = VIS_INHERIT_ID + +/obj/screen/mapper/powbutton + icon = 'icons/effects/gpshud.dmi' + icon_state = "powbutton" + plane = PLANE_HOLOMAP_FRAME + mouse_opacity = 1 + +/obj/screen/mapper/powbutton/Click() + if(!usr.checkClickCooldown()) + return TRUE + if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) + return TRUE + if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech + return TRUE + parent.powerClick() + flick("powClick",src) + usr << get_sfx("button") + return TRUE + +/obj/screen/mapper/mapbutton + icon = 'icons/effects/gpshud.dmi' + icon_state = "mapbutton" + plane = PLANE_HOLOMAP_FRAME + mouse_opacity = 1 + +/obj/screen/mapper/mapbutton/Click() + if(!usr.checkClickCooldown()) + return TRUE + if(usr.stat || usr.paralysis || usr.stunned || usr.weakened) + return TRUE + if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech + return TRUE + parent.mapClick() + flick("mapClick",src) + usr << get_sfx("button") + return TRUE + +// Markers are 16x16, people have apparently settled on centering them on the 8,8 pixel +/obj/screen/mapper/marker + icon = 'icons/holomap_markers.dmi' + plane = PLANE_HOLOMAP_ICONS + + var/offset_x = -8 + var/offset_y = -8 + +// Holds markers in its vis_contents. It uses an alpha filter to crop them to the HUD screen size +/obj/screen/mapper/extras_holder + icon = null + icon_state = null + plane = PLANE_HOLOMAP_ICONS + appearance_flags = KEEP_TOGETHER diff --git a/code/_onclick/hud/skybox.dm b/code/_onclick/hud/skybox.dm index 16742c7d70..8a75808baf 100644 --- a/code/_onclick/hud/skybox.dm +++ b/code/_onclick/hud/skybox.dm @@ -62,6 +62,5 @@ client.update_skybox() client.skybox?.scale_to_view(client.view) -#undef SKYBOX_BORDER #undef SKYBOX_PIXELS #undef SKYBOX_TURFS diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index dcf4f8957e..8aca3bd1a4 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -4,14 +4,14 @@ These are the default click code call sequences used when clicking on stuff with Atoms: -mob/ClickOn() calls the item's resolve_attackby() proc. +/mob/ClickOn() calls the item's resolve_attackby() proc. item/resolve_attackby() calls the target atom's attackby() proc. Mobs: -mob/living/attackby() after checking for surgery, calls the item's attack() proc. +/mob/living/attackby() after checking for surgery, calls the item's attack() proc. item/attack() generates attack logs, sets click cooldown and calls the mob's attacked_with_item() proc. If you override this, consider whether you need to set a click cooldown, play attack animations, and generate logs yourself. -mob/attacked_with_item() should then do mob-type specific stuff (like determining hit/miss, handling shields, etc) and then possibly call the item's apply_hit_effect() proc to actually apply the effects of being hit. +/mob/attacked_with_item() should then do mob-type specific stuff (like determining hit/miss, handling shields, etc) and then possibly call the item's apply_hit_effect() proc to actually apply the effects of being hit. Item Hit Effects: @@ -41,11 +41,6 @@ avoid code duplication. This includes items that may sometimes act as a standard return TRUE return FALSE -/atom/movable/attackby(obj/item/W, mob/user, var/attack_modifier, var/click_parameters) - . = ..() - if(!. && !(W.flags & NOBLUDGEON)) - visible_message("[src] has been hit by [user] with [W].") - /mob/living/attackby(obj/item/I, mob/user, var/attack_modifier, var/click_parameters) if(!ismob(user)) return 0 diff --git a/code/controllers/autotransfer.dm b/code/controllers/autotransfer.dm index 776e2698ba..2ea9e10b59 100644 --- a/code/controllers/autotransfer.dm +++ b/code/controllers/autotransfer.dm @@ -1,16 +1,16 @@ var/datum/controller/transfer_controller/transfer_controller -datum/controller/transfer_controller +/datum/controller/transfer_controller var/timerbuffer = 0 //buffer for time check var/currenttick = 0 -datum/controller/transfer_controller/New() +/datum/controller/transfer_controller/New() timerbuffer = config.vote_autotransfer_initial START_PROCESSING(SSprocessing, src) -datum/controller/transfer_controller/Destroy() +/datum/controller/transfer_controller/Destroy() STOP_PROCESSING(SSprocessing, src) -datum/controller/transfer_controller/process() +/datum/controller/transfer_controller/process() currenttick = currenttick + 1 if (round_duration_in_ds >= timerbuffer - 1 MINUTE) SSvote.autotransfer() diff --git a/code/controllers/communications.dm b/code/controllers/communications.dm index 0b53ed169d..05f524e4a0 100644 --- a/code/controllers/communications.dm +++ b/code/controllers/communications.dm @@ -154,9 +154,6 @@ var/list/ANTAG_FREQS = list(SYND_FREQ, RAID_FREQ) //Department channels, arranged lexically var/list/DEPT_FREQS = list(AI_FREQ, COMM_FREQ, ENG_FREQ, ENT_FREQ, MED_FREQ, SEC_FREQ, SCI_FREQ, SRV_FREQ, SUP_FREQ) -#define TRANSMISSION_WIRE 0 -#define TRANSMISSION_RADIO 1 - /proc/frequency_span_class(var/frequency) // Antags! if (frequency in ANTAG_FREQS) diff --git a/code/controllers/failsafe.dm b/code/controllers/failsafe.dm index 0589d5fa7f..99f2683a68 100644 --- a/code/controllers/failsafe.dm +++ b/code/controllers/failsafe.dm @@ -56,23 +56,23 @@ var/datum/controller/failsafe/Failsafe if(4,5) --defcon if(3) - to_chat(admins, "Notice: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks.") + log_and_message_admins("SSfailsafe Notice: DEFCON [defcon_pretty()]. The Master Controller (\ref[Master]) has not fired in the last [(5-defcon) * processing_interval] ticks.") --defcon if(2) - to_chat(admins, "Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.") + log_and_message_admins("SSfailsafe Warning: DEFCON [defcon_pretty()]. The Master Controller (\ref[Master]) has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.") --defcon if(1) - to_chat(admins, "Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting...") + log_and_message_admins("SSfailsafe Warning: DEFCON [defcon_pretty()]. The Master Controller (\ref[Master]) has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting...") --defcon var/rtn = Recreate_MC() if(rtn > 0) defcon = 4 master_iteration = 0 - to_chat(admins, "MC restarted successfully") + log_and_message_admins("SSfailsafe Notice: MC (New:\ref[Master]) restarted successfully") else if(rtn < 0) - log_game("FailSafe: Could not restart MC, runtime encountered. Entering defcon 0") - to_chat(admins, "ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying.") + log_game("SSfailsafe Notice: Could not restart MC (\ref[Master]), runtime encountered. Entering defcon 0") + log_and_message_admins("SSFAILSAFE ERROR: DEFCON [defcon_pretty()]. Could not restart MC (\ref[Master]), runtime encountered. I will silently keep retrying.") //if the return number was 0, it just means the mc was restarted too recently, and it just needs some time before we try again //no need to handle that specially when defcon 0 can handle it if(0) //DEFCON 0! (mc failed to restart) @@ -80,7 +80,7 @@ var/datum/controller/failsafe/Failsafe if(rtn > 0) defcon = 4 master_iteration = 0 - to_chat(admins, "MC restarted successfully") + log_and_message_admins("SSfailsafe Notice: MC (New:\ref[Master]) restarted successfully") else defcon = min(defcon + 1,5) master_iteration = Master.iteration diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 644ab8d2f0..bfdfe412cf 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -132,10 +132,10 @@ GLOBAL_REAL(Master, /datum/controller/master) = new LAZYINITLIST(BadBoy.failure_strikes) switch(++BadBoy.failure_strikes[BadBoy.type]) if(2) - msg = "The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again." + msg = "MC Notice: The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again." FireHim = TRUE if(3) - msg = "The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined." + msg = "MC Notice: The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined." BadBoy.flags |= SS_NO_FIRE if(msg) log_game(msg) @@ -150,7 +150,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new current_runlevel = Master.current_runlevel StartProcessing(10) else - to_chat(world, "The Master Controller is having some issues, we will need to re-initialize EVERYTHING") + to_world("The Master Controller is having some issues, we will need to re-initialize EVERYTHING") Initialize(20, TRUE) @@ -165,7 +165,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new if(init_sss) init_subtypes(/datum/controller/subsystem, subsystems) - to_chat(world, "Initializing subsystems...") + to_chat(world, "MC: Initializing subsystems...") // Sort subsystems by init_order, so they initialize in the correct order. sortTim(subsystems, /proc/cmp_subsystem_init) @@ -181,7 +181,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new current_ticklimit = TICK_LIMIT_RUNNING var/time = (REALTIMEOFDAY - start_timeofday) / 10 - var/msg = "Initializations complete within [time] second[time == 1 ? "" : "s"]!" + var/msg = "MC: Initializations complete within [time] second[time == 1 ? "" : "s"]!" to_chat(world, "[msg]") log_world(msg) @@ -219,13 +219,17 @@ GLOBAL_REAL(Master, /datum/controller/master) = new if (rtn > 0 || processing < 0) return //this was suppose to happen. //loop ended, restart the mc - log_game("MC crashed or runtimed, restarting") - message_admins("MC crashed or runtimed, restarting") + log_and_message_admins("MC Notice: MC crashed or runtimed, self-restarting (\ref[src])") var/rtn2 = Recreate_MC() - if (rtn2 <= 0) - log_game("Failed to recreate MC (Error code: [rtn2]), it's up to the failsafe now") - message_admins("Failed to recreate MC (Error code: [rtn2]), it's up to the failsafe now") - Failsafe.defcon = 2 + switch(rtn2) + if(-1) + log_and_message_admins("MC Warning: Failed to self-recreate MC (Return code: [rtn2]), it's up to the failsafe now (\ref[src])") + Failsafe.defcon = 2 + if(0) + log_and_message_admins("MC Warning: Too soon for MC self-restart (Return code: [rtn2]), going to let failsafe handle it (\ref[src])") + Failsafe.defcon = 2 + if(1) + log_and_message_admins("MC Notice: MC self-recreated, old MC departing (Return code: [rtn2]) (\ref[src])") // Main loop. /datum/controller/master/proc/Loop() diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 2695a39373..bcea4490de 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -13,10 +13,10 @@ var/global/last_tick_duration = 0 var/global/pipe_processing_killed = 0 -datum/controller/game_controller +/datum/controller/game_controller var/list/shuttle_list // For debugging and VV -datum/controller/game_controller/New() +/datum/controller/game_controller/New() //There can be only one master_controller. Out with the old and in with the new. if(master_controller != src) log_debug("Rebuilding Master Controller") @@ -33,7 +33,7 @@ datum/controller/game_controller/New() if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase() if(!syndicate_code_response) syndicate_code_response = generate_code_phrase() -datum/controller/game_controller/proc/setup() +/datum/controller/game_controller/proc/setup() setup_objects() // setupgenetics() Moved to SSatoms @@ -48,7 +48,7 @@ datum/controller/game_controller/proc/setup() // #define CHECK_SLEEP_MASTER if(++initialized_objects > 500) { initialized_objects=0;sleep(world.tick_lag); } // #endif -datum/controller/game_controller/proc/setup_objects() +/datum/controller/game_controller/proc/setup_objects() // Set up antagonists. populate_antag_type_list() diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index ffb3db6caa..e73911b5a1 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -68,10 +68,14 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun /datum/controller/subsystem/air/fire(resumed = 0) var/timer if(!resumed) - ASSERT(LAZYLEN(currentrun) == 0) // Santity checks to make sure we don't somehow have items left over from last cycle - ASSERT(current_step == null) // Or somehow didn't finish all the steps from last cycle - current_cycle++ // Begin a new air_master cycle! - current_step = SSAIR_TURFS // Start with Step 1 of course + // Santity checks to make sure we don't somehow have items left over from last cycle + // Or somehow didn't finish all the steps from last cycle + if(LAZYLEN(currentrun) || current_step) + log_and_message_admins("SSair: Was told to start a new run, but the previous run wasn't finished! currentrun.len=[currentrun.len], current_step=[current_step]") + resumed = TRUE + else + current_cycle++ // Begin a new air_master cycle! + current_step = SSAIR_TURFS // Start with Step 1 of course INTERNAL_PROCESS_STEP(SSAIR_TURFS, TRUE, process_tiles_to_update, cost_turfs, SSAIR_EDGES) INTERNAL_PROCESS_STEP(SSAIR_EDGES, FALSE, process_active_edges, cost_edges, SSAIR_FIREZONES) @@ -80,10 +84,11 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun INTERNAL_PROCESS_STEP(SSAIR_ZONES, FALSE, process_zones_to_update, cost_zones, SSAIR_DONE) // Okay, we're done! Woo! Got thru a whole air_master cycle! - ASSERT(LAZYLEN(currentrun) == 0) // Sanity checks to make sure there are really none left - ASSERT(current_step == SSAIR_DONE) // And that we didn't somehow skip past the last step - currentrun = null - current_step = null + if(LAZYLEN(currentrun) || current_step != SSAIR_DONE) + log_and_message_admins("SSair: Was not able to complete a full air cycle despite reaching the end of fire(). This shouldn't happen.") + else + currentrun = null + current_step = null /datum/controller/subsystem/air/proc/process_tiles_to_update(resumed = 0) if (!resumed) diff --git a/code/controllers/subsystems/lighting.dm b/code/controllers/subsystems/lighting.dm index 8817d83ad5..36d95cfa34 100644 --- a/code/controllers/subsystems/lighting.dm +++ b/code/controllers/subsystems/lighting.dm @@ -45,9 +45,13 @@ SUBSYSTEM_DEF(lighting) /datum/controller/subsystem/lighting/fire(resumed = FALSE) var/timer if(!resumed) - ASSERT(LAZYLEN(currentrun) == 0) // Santity checks to make sure we don't somehow have items left over from last cycle - ASSERT(stage == null) // Or somehow didn't finish all the steps from last cycle - stage = SSLIGHTING_STAGE_LIGHTS // Start with Step 1 of course + // Santity checks to make sure we don't somehow have items left over from last cycle + // Or somehow didn't finish all the steps from last cycle + if(LAZYLEN(currentrun) || stage) + log_and_message_admins("SSlighting: Was told to start a new run, but the previous run wasn't finished! currentrun.len=[currentrun.len], stage=[stage]") + resumed = TRUE + else + stage = SSLIGHTING_STAGE_LIGHTS // Start with Step 1 of course if(stage == SSLIGHTING_STAGE_LIGHTS) timer = TICK_USAGE @@ -77,10 +81,11 @@ SUBSYSTEM_DEF(lighting) stage = SSLIGHTING_STAGE_DONE // Okay, we're done! Woo! Got thru a whole air_master cycle! - ASSERT(LAZYLEN(currentrun) == 0) // Sanity checks to make sure there are really none left - ASSERT(stage == SSLIGHTING_STAGE_DONE) // And that we didn't somehow skip past the last step - currentrun = null - stage = null + if(LAZYLEN(currentrun) || stage != SSLIGHTING_STAGE_DONE) + log_and_message_admins("SSlighting: Was not able to complete a full lighting cycle despite reaching the end of fire(). This shouldn't happen.") + else + currentrun = null + stage = null /datum/controller/subsystem/lighting/proc/internal_process_lights(resumed = FALSE, init_tick_checks = FALSE) if (!resumed) @@ -162,5 +167,4 @@ SUBSYSTEM_DEF(lighting) #undef DUAL_TICK_CHECK #undef SSLIGHTING_STAGE_LIGHTS #undef SSLIGHTING_STAGE_CORNERS -#undef SSLIGHTING_STAGE_OVERLAYS -#undef SSLIGHTING_STAGE_STATS \ No newline at end of file +#undef SSLIGHTING_STAGE_OVERLAYS \ No newline at end of file diff --git a/code/controllers/subsystems/machines.dm b/code/controllers/subsystems/machines.dm index 29d6ecce56..68f0ebfff7 100644 --- a/code/controllers/subsystems/machines.dm +++ b/code/controllers/subsystems/machines.dm @@ -175,5 +175,4 @@ SUBSYSTEM_DEF(machines) #undef SSMACHINES_PIPENETS #undef SSMACHINES_MACHINERY -#undef SSMACHINES_POWER #undef SSMACHINES_POWER_OBJECTS diff --git a/code/controllers/subsystems/supply.dm b/code/controllers/subsystems/supply.dm index f35ecee703..fc1d3dc6ef 100644 --- a/code/controllers/subsystems/supply.dm +++ b/code/controllers/subsystems/supply.dm @@ -200,10 +200,11 @@ SUBSYSTEM_DEF(supply) else if(islist(SP.access) && SP.one_access) var/list/L = SP.access // access var is a plain var, we need a list A.req_one_access = L.Copy() - A.req_access.Cut() + LAZYCLEARLIST(A.req_access) else if(islist(SP.access) && !SP.one_access) var/list/L = SP.access A.req_access = L.Copy() + LAZYCLEARLIST(A.req_one_access) else log_debug("Supply pack with invalid access restriction [SP.access] encountered!") diff --git a/code/datums/browser.dm b/code/datums/browser.dm index d0fedd1316..9cf2d0f486 100644 --- a/code/datums/browser.dm +++ b/code/datums/browser.dm @@ -305,8 +305,7 @@ div_slider = "locked" output += {"
  • "} diff --git a/code/datums/category.dm b/code/datums/category.dm index 45b2df5996..624183fe98 100644 --- a/code/datums/category.dm +++ b/code/datums/category.dm @@ -58,7 +58,7 @@ collection = null return ..() -datum/category_group/dd_SortValue() +/datum/category_group/dd_SortValue() return name @@ -77,5 +77,5 @@ datum/category_group/dd_SortValue() category = null return ..() -datum/category_item/dd_SortValue() +/datum/category_item/dd_SortValue() return name diff --git a/code/datums/chat_message.dm b/code/datums/chat_message.dm new file mode 100644 index 0000000000..b7582e6fe1 --- /dev/null +++ b/code/datums/chat_message.dm @@ -0,0 +1,336 @@ +#define CHAT_MESSAGE_SPAWN_TIME 0.2 SECONDS +#define CHAT_MESSAGE_LIFESPAN 5 SECONDS +#define CHAT_MESSAGE_EOL_FADE 0.7 SECONDS +#define CHAT_MESSAGE_EXP_DECAY 0.8 // Messages decay at pow(factor, idx in stack) +#define CHAT_MESSAGE_HEIGHT_DECAY 0.7 // Increase message decay based on the height of the message +#define CHAT_MESSAGE_APPROX_LHEIGHT 11 // Approximate height in pixels of an 'average' line, used for height decay + +#define CHAT_MESSAGE_WIDTH 96 // pixels +#define CHAT_MESSAGE_EXT_WIDTH 128 +#define CHAT_MESSAGE_LENGTH 68 // characters +#define CHAT_MESSAGE_EXT_LENGTH 150 + +#define CHAT_MESSAGE_MOB 1 +#define CHAT_MESSAGE_OBJ 2 +#define WXH_TO_HEIGHT(x) text2num(copytext((x), findtextEx((x), "x") + 1)) // thanks lummox + +#define CHAT_RUNE_EMOTE 0x1 +#define CHAT_RUNE_RADIO 0x2 + +/** + * # Chat Message Overlay + * + * Datum for generating a message overlay on the map + * Ported from TGStation; https://github.com/tgstation/tgstation/pull/50608/, author: bobbahbrown + */ + +// Cached runechat icon +var/list/runechat_image_cache = list() + + +/hook/startup/proc/runechat_images() + var/image/radio_image = image('icons/UI_Icons/chat/chat_icons.dmi', icon_state = "radio") + runechat_image_cache["radio"] = radio_image + + var/image/emote_image = image('icons/UI_Icons/chat/chat_icons.dmi', icon_state = "emote") + runechat_image_cache["emote"] = emote_image + + return TRUE + +/datum/chatmessage + /// The visual element of the chat messsage + var/image/message + /// The location in which the message is appearing + var/atom/message_loc + /// The client who heard this message + var/client/owned_by + /// Contains the scheduled destruction time + var/scheduled_destruction + /// Contains the approximate amount of lines for height decay + var/approx_lines + /// If we are currently processing animation and cleanup at EOL + var/ending_life + +/** + * Constructs a chat message overlay + * + * Arguments: + * * text - The text content of the overlay + * * target - The target atom to display the overlay at + * * owner - The mob that owns this overlay, only this mob will be able to view it + * * extra_classes - Extra classes to apply to the span that holds the text + * * lifespan - The lifespan of the message in deciseconds + */ +/datum/chatmessage/New(text, atom/target, mob/owner, list/extra_classes = null, lifespan = CHAT_MESSAGE_LIFESPAN) + . = ..() + if(!istype(target)) + CRASH("Invalid target given for chatmessage") + if(!istype(owner) || QDELETED(owner) || !owner.client) + stack_trace("/datum/chatmessage created with [isnull(owner) ? "null" : "invalid"] mob owner") + qdel(src) + return + generate_image(text, target, owner, extra_classes, lifespan) + +/datum/chatmessage/Destroy() + if(owned_by) + UnregisterSignal(owned_by, COMSIG_PARENT_QDELETING) + LAZYREMOVEASSOC(owned_by.seen_messages, message_loc, src) + owned_by.images.Remove(message) + if(message_loc) + UnregisterSignal(message_loc, COMSIG_PARENT_QDELETING) + owned_by = null + message_loc = null + message = null + return ..() + +/** + * Generates a chat message image representation + * + * Arguments: + * * text - The text content of the overlay + * * target - The target atom to display the overlay at + * * owner - The mob that owns this overlay, only this mob will be able to view it + * * extra_classes - Extra classes to apply to the span that holds the text + * * lifespan - The lifespan of the message in deciseconds + */ +/datum/chatmessage/proc/generate_image(text, atom/target, mob/owner, list/extra_classes, lifespan) + set waitfor = FALSE + + if(!target || !owner) + qdel(src) + return + + // Register client who owns this message + owned_by = owner.client + RegisterSignal(owned_by, COMSIG_PARENT_QDELETING, .proc/qdel_self) + + var/extra_length = owned_by.is_preference_enabled(/datum/client_preference/runechat_long_messages) + var/maxlen = extra_length ? CHAT_MESSAGE_EXT_LENGTH : CHAT_MESSAGE_LENGTH + var/msgwidth = extra_length ? CHAT_MESSAGE_EXT_WIDTH : CHAT_MESSAGE_WIDTH + + // Clip message + if(length_char(text) > maxlen) + text = copytext_char(text, 1, maxlen + 1) + "..." // BYOND index moment + + // Calculate target color if not already present + if(!target.chat_color || target.chat_color_name != target.name) + target.chat_color = colorize_string(target.name) + target.chat_color_darkened = colorize_string(target.name, 0.85, 0.85) + target.chat_color_name = target.name + + // Get rid of any URL schemes that might cause BYOND to automatically wrap something in an anchor tag + var/static/regex/url_scheme = new(@"[A-Za-z][A-Za-z0-9+-\.]*:\/\/", "g") + text = replacetext(text, url_scheme, "") + + // Reject whitespace + var/static/regex/whitespace = new(@"^\s*$") + if(whitespace.Find(text)) + qdel(src) + return + + // Non mobs speakers can be small + if(!ismob(target)) + extra_classes |= "small" + + // If we heard our name, it's important + // Differnt from our own system of name emphasis, maybe unify + var/list/names = splittext(owner.name, " ") + for (var/word in names) + text = replacetext(text, word, "[word]") + + var/list/prefixes + + // Append prefixes + if(extra_classes.Find("virtual-speaker")) + LAZYADD(prefixes, "\icon[runechat_image_cache["radio"]]") + if(extra_classes.Find("emote")) + // Icon on both ends? + //var/image/I = runechat_image_cache["emote"] + //text = "\icon[I][text]\icon[I]" + + // Icon on one end? + //LAZYADD(prefixes, "\icon[runechat_image_cache["emote"]]") + + // Asterisks instead? + text = "* [text] *" + + text = "[prefixes?.Join(" ")][text]" + + text = encode_html_emphasis(text) + + // We dim italicized text to make it more distinguishable from regular text + var/tgt_color = extra_classes.Find("italics") ? target.chat_color_darkened : target.chat_color + + // Approximate text height + var/complete_text = "[text]" + var/mheight = WXH_TO_HEIGHT(owned_by.MeasureText(complete_text, null, msgwidth)) + approx_lines = max(1, mheight / CHAT_MESSAGE_APPROX_LHEIGHT) + + // Translate any existing messages upwards, apply exponential decay factors to timers + message_loc = target + RegisterSignal(message_loc, COMSIG_PARENT_QDELETING, .proc/qdel_self) + if(owned_by.seen_messages) + var/idx = 1 + var/combined_height = approx_lines + for(var/msg in owned_by.seen_messages[message_loc]) + var/datum/chatmessage/m = msg + animate(m.message, pixel_y = m.message.pixel_y + mheight, time = CHAT_MESSAGE_SPAWN_TIME) + combined_height += m.approx_lines + + if(!m.ending_life) // Don't bother! + var/sched_remaining = m.scheduled_destruction - world.time + if(sched_remaining > CHAT_MESSAGE_SPAWN_TIME) + var/remaining_time = (sched_remaining) * (CHAT_MESSAGE_EXP_DECAY ** idx++) * (CHAT_MESSAGE_HEIGHT_DECAY ** combined_height) + m.scheduled_destruction = world.time + remaining_time + spawn(remaining_time) + m.end_of_life() + + // Build message image + message = image(loc = message_loc, layer = ABOVE_MOB_LAYER) + message.plane = PLANE_RUNECHAT + message.appearance_flags = APPEARANCE_UI_IGNORE_ALPHA | KEEP_APART + message.alpha = 0 + message.pixel_y = owner.bound_height * 0.95 + message.maptext_width = msgwidth + message.maptext_height = mheight + message.maptext_x = (CHAT_MESSAGE_WIDTH - owner.bound_width) * -0.5 + message.maptext = complete_text + + if(owner.contains(target)) // Special case, holding an atom speaking (pAI, recorder...) + message.plane = PLANE_PLAYER_HUD_ABOVE + + // View the message + LAZYADDASSOCLIST(owned_by.seen_messages, message_loc, src) + owned_by.images += message + animate(message, alpha = 255, time = CHAT_MESSAGE_SPAWN_TIME) + + // Prepare for destruction + scheduled_destruction = world.time + (lifespan - CHAT_MESSAGE_EOL_FADE) + spawn(lifespan - CHAT_MESSAGE_EOL_FADE) + end_of_life() + +/** + * Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion + */ +/datum/chatmessage/proc/end_of_life(fadetime = CHAT_MESSAGE_EOL_FADE) + if(gc_destroyed || ending_life) + return + ending_life = TRUE + animate(message, alpha = 0, time = fadetime, flags = ANIMATION_PARALLEL) + spawn(fadetime) + qdel(src) + +/** + * Creates a message overlay at a defined location for a given speaker + * + * Arguments: + * * speaker - The atom who is saying this message + * * message - The text content of the message + * * italics - Decides if this should be small or not, as generally italics text are for whisper/radio overhear + * * existing_extra_classes - Additional classes to add to the message + */ +/mob/proc/create_chat_message(atom/movable/speaker, message, italics, list/existing_extra_classes, audible = TRUE) + if(!client) + return + + // Doesn't want to hear + if(ismob(speaker) && !client.is_preference_enabled(/datum/client_preference/runechat_mob)) + return + else if(isobj(speaker) && !client.is_preference_enabled(/datum/client_preference/runechat_obj)) + return + + // Incapable of receiving + if((audible && is_deaf()) || (!audible && is_blind())) + return + + // Check for virtual speakers (aka hearing a message through a radio) + if(existing_extra_classes.Find("radio")) + return + + /* Not currently necessary + message = strip_html_properly(message) + if(!message) + return + */ + + var/list/extra_classes = list() + extra_classes += existing_extra_classes + + if(italics) + extra_classes |= "italics" + + if(client.is_preference_enabled(/datum/client_preference/runechat_border)) + extra_classes |= "black_outline" + + var/dist = get_dist(src, speaker) + switch (dist) + if(4 to 5) + extra_classes |= "small" + if(5 to 16) + extra_classes |= "very_small" + + // Display visual above source + new /datum/chatmessage(message, speaker, src, extra_classes) + +// Tweak these defines to change the available color ranges +#define CM_COLOR_SAT_MIN 0.6 +#define CM_COLOR_SAT_MAX 0.95 +#define CM_COLOR_LUM_MIN 0.70 +#define CM_COLOR_LUM_MAX 0.90 + +/** + * Gets a color for a name, will return the same color for a given string consistently within a round.atom + * + * Note that this proc aims to produce pastel-ish colors using the HSL colorspace. These seem to be favorable for displaying on the map. + * + * Arguments: + * * name - The name to generate a color for + * * sat_shift - A value between 0 and 1 that will be multiplied against the saturation + * * lum_shift - A value between 0 and 1 that will be multiplied against the luminescence + */ +/datum/chatmessage/proc/colorize_string(name, sat_shift = 1, lum_shift = 1) + // seed to help randomness + var/static/rseed = rand(1,26) + + // get hsl using the selected 6 characters of the md5 hash + var/hash = copytext(md5(name + "[world_startup_time]"), rseed, rseed + 6) + var/h = hex2num(copytext(hash, 1, 3)) * (360 / 255) + var/s = (hex2num(copytext(hash, 3, 5)) >> 2) * ((CM_COLOR_SAT_MAX - CM_COLOR_SAT_MIN) / 63) + CM_COLOR_SAT_MIN + var/l = (hex2num(copytext(hash, 5, 7)) >> 2) * ((CM_COLOR_LUM_MAX - CM_COLOR_LUM_MIN) / 63) + CM_COLOR_LUM_MIN + + // adjust for shifts + s *= clamp(sat_shift, 0, 1) + l *= clamp(lum_shift, 0, 1) + + // convert to rgba + var/h_int = round(h/60) // mapping each section of H to 60 degree sections + var/c = (1 - abs(2 * l - 1)) * s + var/x = c * (1 - abs((h / 60) % 2 - 1)) + var/m = l - c * 0.5 + x = (x + m) * 255 + c = (c + m) * 255 + m *= 255 + switch(h_int) + if(0) + return rgb(c,x,m) + if(1) + return rgb(x,c,m) + if(2) + return rgb(m,c,x) + if(3) + return rgb(m,x,c) + if(4) + return rgb(x,m,c) + if(5) + return rgb(c,m,x) + +/atom/proc/runechat_message(message, range = world.view, italics, list/classes = list(), audible = TRUE) + var/list/hear = get_mobs_and_objs_in_view_fast(get_turf(src), range, remote_ghosts = FALSE) + + var/list/hearing_mobs = hear["mobs"] + + for(var/mob in hearing_mobs) + var/mob/M = mob + if(!M.client) + continue + M.create_chat_message(src, message, italics, classes, audible) diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm index 1cb9e0b1c4..c4ee090ce8 100644 --- a/code/datums/components/_component.dm +++ b/code/datums/components/_component.dm @@ -213,10 +213,10 @@ * * Arguments: * * datum/target Datum to stop listening to signals from - * * sig_typeor_types Signal string key or list of signal keys to stop listening to specifically + * * sig_type_or_types Signal string key or list of signal keys to stop listening to specifically */ /datum/proc/UnregisterSignal(datum/target, sig_type_or_types) - var/list/lookup = target.comp_lookup + var/list/lookup = target?.comp_lookup if(!signal_procs || !signal_procs[target] || !lookup) return if(!islist(sig_type_or_types)) diff --git a/code/datums/computerfiles.dm b/code/datums/computerfiles.dm deleted file mode 100644 index 14cd7e3861..0000000000 --- a/code/datums/computerfiles.dm +++ /dev/null @@ -1,7 +0,0 @@ -datum - computer - var/name - folder - var/list/datum/computer/contents = list() - - file \ No newline at end of file diff --git a/code/datums/helper_datums/events.dm b/code/datums/helper_datums/events.dm index 424f113a9c..bc3661470e 100644 --- a/code/datums/helper_datums/events.dm +++ b/code/datums/helper_datums/events.dm @@ -6,62 +6,62 @@ /datum/events var/list/events - New() - ..() - events = new +/datum/events/New() + ..() + events = new - proc/addEventType(event_type as text) - if(!(event_type in events) || !islist(events[event_type])) - events[event_type] = list() - return 1 - return - - - // Arguments: event_type as text, proc_holder as datum, proc_name as text - // Returns: New event, null on error. - proc/addEvent(event_type as text, proc_holder, proc_name as text) - if(!event_type || !proc_holder || !proc_name) - return - addEventType(event_type) - var/list/event = events[event_type] - var/datum/event/E = new /datum/event(proc_holder,proc_name) - event += E - return E - - // Arguments: event_type as text, any number of additional arguments to pass to event handler - // Returns: null - proc/fireEvent() - //to_world("Events in [args[1]] called") - var/list/event = listgetindex(events,args[1]) - if(istype(event)) - spawn(-1) - for(var/datum/event/E in event) - if(!E.Fire(arglist(args.Copy(2)))) - clearEvent(args[1],E) - return - - // Arguments: event_type as text, E as /datum/event - // Returns: 1 if event cleared, null on error - proc/clearEvent(event_type as text, datum/event/E) - if(!event_type || !E) - return - var/list/event = listgetindex(events,event_type) - event -= E +/datum/events/proc/addEventType(event_type as text) + if(!(event_type in events) || !islist(events[event_type])) + events[event_type] = list() return 1 + return + + +// Arguments: event_type as text, proc_holder as datum, proc_name as text +// Returns: New event, null on error. +/datum/events/proc/addEvent(event_type as text, proc_holder, proc_name as text) + if(!event_type || !proc_holder || !proc_name) + return + addEventType(event_type) + var/list/event = events[event_type] + var/datum/event/E = new /datum/event(proc_holder,proc_name) + event += E + return E + +// Arguments: event_type as text, any number of additional arguments to pass to event handler +// Returns: null +/datum/events/proc/fireEvent() + //to_world("Events in [args[1]] called") + var/list/event = listgetindex(events,args[1]) + if(istype(event)) + spawn(-1) + for(var/datum/event/E in event) + if(!E.Fire(arglist(args.Copy(2)))) + clearEvent(args[1],E) + return + +// Arguments: event_type as text, E as /datum/event +// Returns: 1 if event cleared, null on error +/datum/events/proc/clearEvent(event_type as text, datum/event/E) + if(!event_type || !E) + return + var/list/event = listgetindex(events,event_type) + event -= E + return 1 /datum/event var/listener var/proc_name - New(tlistener,tprocname) - listener = tlistener - proc_name = tprocname - return ..() +/datum/event/New(tlistener,tprocname) + listener = tlistener + proc_name = tprocname + return ..() - proc/Fire() - //to_world("Event fired") - if(listener) - call(listener,proc_name)(arglist(args)) - return 1 - return \ No newline at end of file +/datum/event/proc/Fire() + //to_world("Event fired") + if(listener) + call(listener,proc_name)(arglist(args)) + return 1 + return \ No newline at end of file diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 8b194a139c..23a099cbb7 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -29,7 +29,7 @@ var/global/datum/getrev/revdata = new() to_world_log(date) to_world_log(revision) -client/verb/showrevinfo() +/client/verb/showrevinfo() set category = "OOC" set name = "Show Server Revision" set desc = "Check the current server code revision" diff --git a/code/datums/helper_datums/global_iterator.dm b/code/datums/helper_datums/global_iterator.dm deleted file mode 100644 index a4cbc07de2..0000000000 --- a/code/datums/helper_datums/global_iterator.dm +++ /dev/null @@ -1,160 +0,0 @@ -/* - DO NOT USE THIS. THIS IS BEING DEPRECATED BY PROCESSING SUBSYSTEMS (controllers/subsystems/processing) AND TIMERS. -*/ - -/* -README: - -The global_iterator datum is supposed to provide a simple and robust way to -create some constantly "looping" processes with ability to stop and restart them at will. -Generally, the only thing you want to play with (meaning, redefine) is the process() proc. -It must contain all the things you want done. - -Control functions: - new - used to create datum. First argument (optional) - var list(to use in process() proc) as list, - second (optional) - autostart control. - If autostart == TRUE, the loop will be started immediately after datum creation. - - start(list/arguments) - starts the loop. Takes arguments(optional) as a list, which is then used - by process() proc. Returns null if datum already active, 1 if loop started succesfully and 0 if there's - an error in supplied arguments (not list or empty list). - - stop() - stops the loop. Returns null if datum is already inactive and 1 on success. - - set_delay(new_delay) - sets the delay between iterations. Pretty selfexplanatory. - Returns 0 on error(new_delay is not numerical), 1 otherwise. - - set_process_args(list/arguments) - passes the supplied arguments to the process() proc. - - active() - Returns 1 if datum is active, 0 otherwise. - - toggle() - toggles datum state. Returns new datum state (see active()). - -Misc functions: - - get_last_exec_time() - Returns the time of last iteration. - - get_last_exec_time_as_text() - Returns the time of last iteration as text - - -Control vars: - - delay - delay between iterations - - check_for_null - if equals TRUE, on each iteration the supplied arguments will be checked for nulls. - If some varible equals null (and null only), the loop is stopped. - Usefull, if some var unexpectedly becomes null - due to object deletion, for example. - Of course, you can also check the variables inside process() proc to prevent runtime errors. - -Data storage vars: - - result - stores the value returned by process() proc -*/ - -/datum/global_iterator - var/control_switch = 0 - var/delay = 10 - var/list/arg_list = new - var/last_exec = null - var/check_for_null = 1 - var/forbid_garbage = 0 - var/result - var/state = 0 - - New(list/arguments=null,autostart=1) - delay = delay>0?(delay):1 - if(forbid_garbage) //prevents garbage collection with tag != null - tag = "\ref[src]" - set_process_args(arguments) - if(autostart) - start() - return - - proc/main() - state = 1 - while(src && control_switch) - last_exec = world.timeofday - if(check_for_null && has_null_args()) - stop() - return 0 - result = process(arglist(arg_list)) - for(var/sleep_time=delay;sleep_time>0;sleep_time--) //uhh, this is ugly. But I see no other way to terminate sleeping proc. Such disgrace. - if(!control_switch) - return 0 - sleep(1) - return 0 - - proc/start(list/arguments=null) - if(active()) - return - if(arguments) - if(!set_process_args(arguments)) - return 0 - if(!state_check()) //the main loop is sleeping, wait for it to terminate. - return - control_switch = 1 - spawn() - state = main() - return 1 - - proc/stop() - if(!active()) - return - control_switch = 0 - spawn(-1) //report termination error but don't wait for state_check(). - state_check() - return 1 - - proc/state_check() - var/lag = 0 - while(state) - sleep(1) - if(++lag>10) - CRASH("The global_iterator loop \ref[src] failed to terminate in designated timeframe. This may be caused by server lagging.") - return 1 - - proc/active() - return control_switch - - proc/has_null_args() - if(null in arg_list) - return 1 - return 0 - - - proc/set_delay(new_delay) - if(isnum(new_delay)) - delay = max(1, round(new_delay)) - return 1 - else - return 0 - - proc/get_last_exec_time() - return (last_exec||0) - - proc/get_last_exec_time_as_text() - return (time2text(last_exec)||"Wasn't executed yet") - - proc/set_process_args(list/arguments) - if(arguments && istype(arguments, /list) && arguments.len) - arg_list = arguments - return 1 - else -// to_world("Invalid arguments supplied for [src.type], ref = \ref[src]") - return 0 - - proc/toggle_null_checks() - check_for_null = !check_for_null - return check_for_null - - proc/toggle() - if(!stop()) - start() - return active() - -/datum/global_iterator/Destroy() - tag = null - arg_list.Cut() - stop() - return QDEL_HINT_LETMELIVE - //Do not call ..() diff --git a/code/datums/helper_datums/topic_input.dm b/code/datums/helper_datums/topic_input.dm index 17dd3f1266..809a6c4bc5 100644 --- a/code/datums/helper_datums/topic_input.dm +++ b/code/datums/helper_datums/topic_input.dm @@ -2,59 +2,59 @@ var/href var/list/href_list - New(thref,list/thref_list) - href = thref - href_list = thref_list.Copy() - return +/datum/topic_input/New(thref,list/thref_list) + href = thref + href_list = thref_list.Copy() + return - proc/get(i) - return listgetindex(href_list,i) +/datum/topic_input/proc/get(i) + return listgetindex(href_list,i) - proc/getAndLocate(i) - var/t = get(i) - if(t) - t = locate(t) - return t || null +/datum/topic_input/proc/getAndLocate(i) + var/t = get(i) + if(t) + t = locate(t) + return t || null - proc/getNum(i) - var/t = get(i) - if(t) - t = text2num(t) - return isnum(t) ? t : null +/datum/topic_input/proc/getNum(i) + var/t = get(i) + if(t) + t = text2num(t) + return isnum(t) ? t : null - proc/getObj(i) - var/t = getAndLocate(i) - return isobj(t) ? t : null +/datum/topic_input/proc/getObj(i) + var/t = getAndLocate(i) + return isobj(t) ? t : null - proc/getMob(i) - var/t = getAndLocate(i) - return ismob(t) ? t : null +/datum/topic_input/proc/getMob(i) + var/t = getAndLocate(i) + return ismob(t) ? t : null - proc/getTurf(i) - var/t = getAndLocate(i) - return isturf(t) ? t : null +/datum/topic_input/proc/getTurf(i) + var/t = getAndLocate(i) + return isturf(t) ? t : null - proc/getAtom(i) - return getType(i,/atom) +/datum/topic_input/proc/getAtom(i) + return getType(i,/atom) - proc/getArea(i) - var/t = getAndLocate(i) - return isarea(t) ? t : null +/datum/topic_input/proc/getArea(i) + var/t = getAndLocate(i) + return isarea(t) ? t : null - proc/getStr(i)//params should always be text, but... - var/t = get(i) - return istext(t) ? t : null +/datum/topic_input/proc/getStr(i)//params should always be text, but... + var/t = get(i) + return istext(t) ? t : null - proc/getType(i,type) - var/t = getAndLocate(i) - return istype(t,type) ? t : null +/datum/topic_input/proc/getType(i,type) + var/t = getAndLocate(i) + return istype(t,type) ? t : null - proc/getPath(i) - var/t = get(i) - if(t) - t = text2path(t) - return ispath(t) ? t : null +/datum/topic_input/proc/getPath(i) + var/t = get(i) + if(t) + t = text2path(t) + return ispath(t) ? t : null - proc/getList(i) - var/t = getAndLocate(i) - return islist(t) ? t : null \ No newline at end of file +/datum/topic_input/proc/getList(i) + var/t = getAndLocate(i) + return islist(t) ? t : null \ No newline at end of file diff --git a/code/datums/managed_browsers/feedback_form.dm b/code/datums/managed_browsers/feedback_form.dm index bc5c456aec..00755c7624 100644 --- a/code/datums/managed_browsers/feedback_form.dm +++ b/code/datums/managed_browsers/feedback_form.dm @@ -4,7 +4,7 @@ /client/can_vv_get(var_name) return var_name != NAMEOF(src, feedback_form) // No snooping. -GENERAL_PROTECT_DATUM(datum/managed_browser/feedback_form) +GENERAL_PROTECT_DATUM(/datum/managed_browser/feedback_form) // A fairly simple object to hold information about a player's feedback as it's being written. // Having this be it's own object instead of being baked into /mob/new_player allows for it to be used diff --git a/code/datums/repositories/decls.dm b/code/datums/repositories/decls.dm index c46c8b41bf..e6040a90dd 100644 --- a/code/datums/repositories/decls.dm +++ b/code/datums/repositories/decls.dm @@ -14,7 +14,7 @@ // III. Thou shalt not write a decl that relies on arguments supplied to New(). // IV. Thou shalt not call Initialize() on a /decl. -var/repository/decls/decls_repository = new() +var/repository/decls/decls_repository // Initialiozed in /datum/global_init/New() /repository/decls var/list/fetched_decls diff --git a/code/datums/supplypacks/costumes.dm b/code/datums/supplypacks/costumes.dm index 9afd0fd60f..4af40491d3 100644 --- a/code/datums/supplypacks/costumes.dm +++ b/code/datums/supplypacks/costumes.dm @@ -109,7 +109,7 @@ containertype = /obj/structure/closet/crate/gilthari containername = "Formal suit crate" -datum/supply_pack/costumes/witch +/datum/supply_pack/costumes/witch name = "Witch costume" containername = "Witch costume" containertype = /obj/structure/closet/crate/nanothreads diff --git a/code/datums/supplypacks/recreation.dm b/code/datums/supplypacks/recreation.dm index eae37c5869..a3b6ad30d5 100644 --- a/code/datums/supplypacks/recreation.dm +++ b/code/datums/supplypacks/recreation.dm @@ -51,7 +51,7 @@ /obj/item/weapon/reagent_containers/glass/paint/purple, /obj/item/weapon/reagent_containers/glass/paint/black, /obj/item/weapon/reagent_containers/glass/paint/white, - /obj/item/weapon/contraband/poster/custom, + /obj/item/poster/custom, /obj/item/weapon/wrapping_paper = 3 ) cost = 10 diff --git a/code/datums/supplypacks/security.dm b/code/datums/supplypacks/security.dm index 18d3f66028..746256c3b8 100644 --- a/code/datums/supplypacks/security.dm +++ b/code/datums/supplypacks/security.dm @@ -419,7 +419,8 @@ /obj/item/clothing/accessory/holster, /obj/item/clothing/accessory/holster/armpit, /obj/item/clothing/accessory/holster/waist, - /obj/item/clothing/accessory/holster/hip + /obj/item/clothing/accessory/holster/hip, + /obj/item/clothing/accessory/holster/leg ) cost = 15 containertype = /obj/structure/closet/crate/hedberg @@ -663,9 +664,9 @@ /datum/supply_pack/security/posters name = "Gear - Morale Posters" contains = list( - /obj/item/weapon/contraband/poster/nanotrasen = 6 + /obj/item/poster/nanotrasen = 6 ) - cost = 20 + cost = 10 containertype = /obj/structure/closet/crate/secure/nanotrasen containername = "Morale Posters" access = access_maint_tunnels diff --git a/code/datums/underwear/underwear.dm b/code/datums/underwear/underwear.dm index f418f3e8d1..e3bf9d37ea 100644 --- a/code/datums/underwear/underwear.dm +++ b/code/datums/underwear/underwear.dm @@ -12,7 +12,7 @@ var/display_name // For displaying in text var/gender = NEUTER -datum/category_group/underwear/dd_SortValue() +/datum/category_group/underwear/dd_SortValue() return sort_order /datum/category_group/underwear/top diff --git a/code/datums/uplink/uplink_categories.dm b/code/datums/uplink/uplink_categories.dm index f7236ddbb0..e075021c52 100644 --- a/code/datums/uplink/uplink_categories.dm +++ b/code/datums/uplink/uplink_categories.dm @@ -6,7 +6,7 @@ ..() items = list() -datum/uplink_category/ammunition +/datum/uplink_category/ammunition name = "Ammunition" /datum/uplink_category/services diff --git a/code/datums/uplink/uplink_items.dm b/code/datums/uplink/uplink_items.dm index e02e604984..7156f807bd 100644 --- a/code/datums/uplink/uplink_items.dm +++ b/code/datums/uplink/uplink_items.dm @@ -95,7 +95,7 @@ var/datum/uplink/uplink = new() log_and_message_admins("\the [M] bought \a [src] through the uplink") M.mind.purchase_log[src] += 1 -datum/uplink_item/dd_SortValue() +/datum/uplink_item/dd_SortValue() return item_cost /******************************** diff --git a/code/defines/obj.dm b/code/defines/obj.dm index 18f889ffae..72b808165a 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -4,16 +4,16 @@ anchored = 1 density = 1 - attackby(obj/item/weapon/W as obj, mob/user as mob) - return attack_hand(user) +/obj/structure/signpost/attackby(obj/item/weapon/W as obj, mob/user as mob) + return attack_hand(user) - attack_hand(mob/user as mob) - switch(alert("Travel back to ss13?",,"Yes","No")) - if("Yes") - if(user.z != src.z) return - user.forceMove(pick(latejoin)) - if("No") - return +/obj/structure/signpost/attack_hand(mob/user as mob) + switch(alert("Travel back to ss13?",,"Yes","No")) + if("Yes") + if(user.z != src.z) return + user.forceMove(pick(latejoin)) + if("No") + return /obj/effect/mark var/mark = "" @@ -99,9 +99,9 @@ drop_sound = 'sound/items/drop/rubber.ogg' pickup_sound = 'sound/items/pickup/rubber.ogg' - afterattack(atom/target as mob|obj|turf|area, mob/user as mob) - user.drop_item() - src.throw_at(target, throw_range, throw_speed, user) +/obj/item/weapon/beach_ball/afterattack(atom/target as mob|obj|turf|area, mob/user as mob) + user.drop_item() + src.throw_at(target, throw_range, throw_speed, user) /obj/effect/spawner name = "object spawner" diff --git a/code/defines/procs/AStar.dm b/code/defines/procs/AStar.dm index 3ce268d375..c29ffef73f 100644 --- a/code/defines/procs/AStar.dm +++ b/code/defines/procs/AStar.dm @@ -37,69 +37,69 @@ length to avoid portals or something i guess?? Not that they're counted right no // Also added 'exclude' turf to avoid travelling over; defaults to null -PriorityQueue +/PriorityQueue var/list/queue var/comparison_function - New(compare) - queue = list() - comparison_function = compare +/PriorityQueue/New(compare) + queue = list() + comparison_function = compare - proc/IsEmpty() - return !queue.len +/PriorityQueue/proc/IsEmpty() + return !queue.len - proc/Enqueue(var/data) - queue.Add(data) - var/index = queue.len +/PriorityQueue/proc/Enqueue(var/data) + queue.Add(data) + var/index = queue.len - //From what I can tell, this automagically sorts the added data into the correct location. - while(index > 2 && call(comparison_function)(queue[index / 2], queue[index]) > 0) - queue.Swap(index, index / 2) - index /= 2 + //From what I can tell, this automagically sorts the added data into the correct location. + while(index > 2 && call(comparison_function)(queue[index / 2], queue[index]) > 0) + queue.Swap(index, index / 2) + index /= 2 - proc/Dequeue() - if(!queue.len) - return 0 - return Remove(1) +/PriorityQueue/proc/Dequeue() + if(!queue.len) + return 0 + return Remove(1) - proc/Remove(var/index) - if(index > queue.len) - return 0 +/PriorityQueue/proc/Remove(var/index) + if(index > queue.len) + return 0 - var/thing = queue[index] - queue.Swap(index, queue.len) - queue.Cut(queue.len) - if(index < queue.len) - FixQueue(index) - return thing + var/thing = queue[index] + queue.Swap(index, queue.len) + queue.Cut(queue.len) + if(index < queue.len) + FixQueue(index) + return thing - proc/FixQueue(var/index) - var/child = 2 * index - var/item = queue[index] +/PriorityQueue/proc/FixQueue(var/index) + var/child = 2 * index + var/item = queue[index] - while(child <= queue.len) - if(child < queue.len && call(comparison_function)(queue[child], queue[child + 1]) > 0) - child++ - if(call(comparison_function)(item, queue[child]) > 0) - queue[index] = queue[child] - index = child - else - break - child = 2 * index - queue[index] = item + while(child <= queue.len) + if(child < queue.len && call(comparison_function)(queue[child], queue[child + 1]) > 0) + child++ + if(call(comparison_function)(item, queue[child]) > 0) + queue[index] = queue[child] + index = child + else + break + child = 2 * index + queue[index] = item - proc/List() - return queue.Copy() +/PriorityQueue/proc/List() + return queue.Copy() - proc/Length() - return queue.len +/PriorityQueue/proc/Length() + return queue.len - proc/RemoveItem(data) - var/index = queue.Find(data) - if(index) - return Remove(index) +/PriorityQueue/proc/RemoveItem(data) + var/index = queue.Find(data) + if(index) + return Remove(index) -PathNode +/PathNode var/datum/position var/PathNode/previous_node @@ -109,21 +109,21 @@ PathNode var/cost var/nodes_traversed - New(_position, _previous_node, _known_cost, _cost, _nodes_traversed) - position = _position - previous_node = _previous_node +/PathNode/New(_position, _previous_node, _known_cost, _cost, _nodes_traversed) + position = _position + previous_node = _previous_node - known_cost = _known_cost - cost = _cost - estimated_cost = cost + known_cost + known_cost = _known_cost + cost = _cost + estimated_cost = cost + known_cost - best_estimated_cost = estimated_cost - nodes_traversed = _nodes_traversed + best_estimated_cost = estimated_cost + nodes_traversed = _nodes_traversed -proc/PathWeightCompare(PathNode/a, PathNode/b) +/proc/PathWeightCompare(PathNode/a, PathNode/b) return a.estimated_cost - b.estimated_cost -proc/AStar(var/start, var/end, var/adjacent, var/dist, var/max_nodes, var/max_node_depth = 30, var/min_target_dist = 0, var/min_node_dist, var/id, var/datum/exclude) +/proc/AStar(var/start, var/end, var/adjacent, var/dist, var/max_nodes, var/max_node_depth = 30, var/min_target_dist = 0, var/min_node_dist, var/id, var/datum/exclude) var/PriorityQueue/open = new /PriorityQueue(/proc/PathWeightCompare) var/list/closed = list() var/list/path diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm index 8133e01388..5ba5f7ac85 100644 --- a/code/defines/procs/announce.dm +++ b/code/defines/procs/announce.dm @@ -50,7 +50,7 @@ Sound(message_sound, zlevels) Log(message, message_title) -datum/announcement/proc/Message(message as text, message_title as text, var/list/zlevels) +/datum/announcement/proc/Message(message as text, message_title as text, var/list/zlevels) for(var/mob/M in player_list) if(!istype(M,/mob/new_player) && !isdeaf(M)) to_chat(M, "

    [title]

    ") @@ -59,17 +59,17 @@ datum/announcement/proc/Message(message as text, message_title as text, var/list to_chat(M, " -[html_encode(announcer)]") // You'll need to update these to_world usages if you want to make these z-level specific ~Aro -datum/announcement/minor/Message(message as text, message_title as text) +/datum/announcement/minor/Message(message as text, message_title as text) to_world("[message]") -datum/announcement/priority/Message(message as text, message_title as text) +/datum/announcement/priority/Message(message as text, message_title as text) to_world("

    [message_title]

    ") to_world("[message]") if(announcer) to_world(" -[html_encode(announcer)]") to_world("
    ") -datum/announcement/priority/command/Message(message as text, message_title as text, var/list/zlevels) +/datum/announcement/priority/command/Message(message as text, message_title as text, var/list/zlevels) var/command command += "

    [command_name()] Update

    " if (message_title) @@ -83,11 +83,11 @@ datum/announcement/priority/command/Message(message as text, message_title as te if(!istype(M,/mob/new_player) && !isdeaf(M)) to_chat(M, command) -datum/announcement/priority/security/Message(message as text, message_title as text) +/datum/announcement/priority/security/Message(message as text, message_title as text) to_world("[message_title]") to_world("[message]") -datum/announcement/proc/NewsCast(message as text, message_title as text) +/datum/announcement/proc/NewsCast(message as text, message_title as text) if(!newscast) return @@ -99,7 +99,7 @@ datum/announcement/proc/NewsCast(message as text, message_title as text) news.can_be_redacted = 0 announce_newscaster_news(news) -datum/announcement/proc/PlaySound(var/message_sound, var/list/zlevels) +/datum/announcement/proc/PlaySound(var/message_sound, var/list/zlevels) if(!message_sound) return @@ -109,17 +109,17 @@ datum/announcement/proc/PlaySound(var/message_sound, var/list/zlevels) if(!istype(M,/mob/new_player) && !isdeaf(M)) M << message_sound -datum/announcement/proc/Sound(var/message_sound, var/list/zlevels) +/datum/announcement/proc/Sound(var/message_sound, var/list/zlevels) PlaySound(message_sound, zlevels) -datum/announcement/priority/Sound(var/message_sound) +/datum/announcement/priority/Sound(var/message_sound) if(message_sound) world << message_sound -datum/announcement/priority/command/Sound(var/message_sound) +/datum/announcement/priority/command/Sound(var/message_sound) PlaySound(message_sound) -datum/announcement/proc/Log(message as text, message_title as text) +/datum/announcement/proc/Log(message as text, message_title as text) if(log) log_game("[key_name(usr)] has made \a [announcement_type]: [message_title] - [message] - [announcer]") message_admins("[key_name_admin(usr)] has made \a [announcement_type].", 1) diff --git a/code/defines/procs/dbcore.dm b/code/defines/procs/dbcore.dm index 35470e8c59..e0f8ab94af 100644 --- a/code/defines/procs/dbcore.dm +++ b/code/defines/procs/dbcore.dm @@ -38,7 +38,7 @@ var/DB_SERVER = "" // This is the location of your MySQL server (localhost is US var/DB_PORT = 3306 // This is the port your MySQL server is running on (3306 is the default) */ -DBConnection +/DBConnection var/_db_con // This variable contains a reference to the actual database connection. var/dbi // This variable is a string containing the DBI MySQL requires. var/user // This variable contains the username data. @@ -48,14 +48,14 @@ DBConnection var/server = "" var/port = 3306 -DBConnection/New(dbi_handler,username,password_handler,cursor_handler) +/DBConnection/New(dbi_handler,username,password_handler,cursor_handler) src.dbi = dbi_handler src.user = username src.password = password_handler src.default_cursor = cursor_handler _db_con = _dm_db_new_con() -DBConnection/proc/Connect(dbi_handler=src.dbi,user_handler=src.user,password_handler=src.password,cursor_handler) +/DBConnection/proc/Connect(dbi_handler=src.dbi,user_handler=src.user,password_handler=src.password,cursor_handler) if(!config.sql_enabled) return 0 if(!src) return 0 @@ -63,24 +63,24 @@ DBConnection/proc/Connect(dbi_handler=src.dbi,user_handler=src.user,password_han if(!cursor_handler) cursor_handler = Default_Cursor return _dm_db_connect(_db_con,dbi_handler,user_handler,password_handler,cursor_handler,null) -DBConnection/proc/Disconnect() return _dm_db_close(_db_con) +/DBConnection/proc/Disconnect() return _dm_db_close(_db_con) -DBConnection/proc/IsConnected() +/DBConnection/proc/IsConnected() if(!config.sql_enabled) return 0 var/success = _dm_db_is_connected(_db_con) return success -DBConnection/proc/Quote(str) return _dm_db_quote(_db_con,str) +/DBConnection/proc/Quote(str) return _dm_db_quote(_db_con,str) -DBConnection/proc/ErrorMsg() return _dm_db_error_msg(_db_con) -DBConnection/proc/SelectDB(database_name,dbi) +/DBConnection/proc/ErrorMsg() return _dm_db_error_msg(_db_con) +/DBConnection/proc/SelectDB(database_name,dbi) if(IsConnected()) Disconnect() //return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[DB_SERVER]:[DB_PORT]"]",user,password) return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[sqladdress]:[sqlport]"]",user,password) -DBConnection/proc/NewQuery(sql_query,cursor_handler=src.default_cursor) return new/DBQuery(sql_query,src,cursor_handler) +/DBConnection/proc/NewQuery(sql_query,cursor_handler=src.default_cursor) return new/DBQuery(sql_query,src,cursor_handler) -DBQuery/New(sql_query,DBConnection/connection_handler,cursor_handler) +/DBQuery/New(sql_query,DBConnection/connection_handler,cursor_handler) if(sql_query) src.sql = sql_query if(connection_handler) src.db_connection = connection_handler if(cursor_handler) src.default_cursor = cursor_handler @@ -88,7 +88,7 @@ DBQuery/New(sql_query,DBConnection/connection_handler,cursor_handler) return ..() -DBQuery +/DBQuery var/sql // The sql query being executed. var/default_cursor var/list/columns //list of DB Columns populated by Columns() @@ -98,26 +98,26 @@ DBQuery var/DBConnection/db_connection var/_db_query -DBQuery/proc/Connect(DBConnection/connection_handler) src.db_connection = connection_handler +/DBQuery/proc/Connect(DBConnection/connection_handler) src.db_connection = connection_handler -DBQuery/proc/Execute(sql_query=src.sql,cursor_handler=default_cursor) +/DBQuery/proc/Execute(sql_query=src.sql,cursor_handler=default_cursor) Close() return _dm_db_execute(_db_query,sql_query,db_connection._db_con,cursor_handler,null) -DBQuery/proc/NextRow() return _dm_db_next_row(_db_query,item,conversions) +/DBQuery/proc/NextRow() return _dm_db_next_row(_db_query,item,conversions) -DBQuery/proc/RowsAffected() return _dm_db_rows_affected(_db_query) +/DBQuery/proc/RowsAffected() return _dm_db_rows_affected(_db_query) -DBQuery/proc/RowCount() return _dm_db_row_count(_db_query) +/DBQuery/proc/RowCount() return _dm_db_row_count(_db_query) -DBQuery/proc/ErrorMsg() return _dm_db_error_msg(_db_query) +/DBQuery/proc/ErrorMsg() return _dm_db_error_msg(_db_query) -DBQuery/proc/Columns() +/DBQuery/proc/Columns() if(!columns) columns = _dm_db_columns(_db_query,/DBColumn) return columns -DBQuery/proc/GetRowData() +/DBQuery/proc/GetRowData() var/list/columns = Columns() var/list/results if(columns.len) @@ -128,23 +128,23 @@ DBQuery/proc/GetRowData() results[C] = src.item[(cur_col.position+1)] return results -DBQuery/proc/Close() +/DBQuery/proc/Close() item.len = 0 columns = null conversions = null return _dm_db_close(_db_query) -DBQuery/proc/Quote(str) +/DBQuery/proc/Quote(str) return db_connection.Quote(str) -DBQuery/proc/SetConversion(column,conversion) +/DBQuery/proc/SetConversion(column,conversion) if(istext(column)) column = columns.Find(column) if(!conversions) conversions = new/list(column) else if(conversions.len < column) conversions.len = column conversions[column] = conversion -DBColumn +/DBColumn var/name var/table var/position //1-based index into item data @@ -153,7 +153,7 @@ DBColumn var/length var/max_length -DBColumn/New(name_handler,table_handler,position_handler,type_handler,flag_handler,length_handler,max_length_handler) +/DBColumn/New(name_handler,table_handler,position_handler,type_handler,flag_handler,length_handler,max_length_handler) src.name = name_handler src.table = table_handler src.position = position_handler @@ -164,7 +164,7 @@ DBColumn/New(name_handler,table_handler,position_handler,type_handler,flag_handl return ..() -DBColumn/proc/SqlTypeName(type_handler=src.sql_type) +/DBColumn/proc/SqlTypeName(type_handler=src.sql_type) switch(type_handler) if(TINYINT) return "TINYINT" if(SMALLINT) return "SMALLINT" diff --git a/code/defines/procs/sd_Alert.dm b/code/defines/procs/sd_Alert.dm deleted file mode 100644 index e10416f112..0000000000 --- a/code/defines/procs/sd_Alert.dm +++ /dev/null @@ -1,168 +0,0 @@ -/* sd_Alert library - by Shadowdarke (shadowdarke@byond.com) - - sd_Alert() is a powerful and flexible alternative to the built in BYOND - alert() proc. sd_Alert offers timed popups, unlimited buttons, custom - appearance, and even the option to popup without stealing keyboard focus - from the map or command line. - - Please see demo.dm for detailed examples. - -FORMAT - sd_Alert(who, message, title, buttons, default, duration, unfocus, \ - size, table, style, tag, select, flags) - -ARGUMENTS - who - the client or mob to display the alert to. - message - text message to display - title - title of the alert box - buttons - list of buttons - Default Value: list("Ok") - default - default button selestion - Default Value: the first button in the list - duration - the number of ticks before this alert expires. If not - set, the alert lasts until a button is clicked. - Default Value: 0 (unlimited) - unfocus - if this value is set, the popup will not steal keyboard - focus from the map or command line. - Default Value: 1 (do not take focus) - size - size of the popup window in px - Default Value: "300x200" - table - optional parameters for the HTML table in the alert - Default Value: "width=100% height=100%" (fill the window) - style - optional style sheet information - tag - lets you specify a certain tag for this sd_Alert so you may manipulate it - externally. (i.e. force the alert to close, change options and redisplay, - reuse the same window, etc.) - select - if set, the buttons will be replaced with a selection box with a number of - lines displayed equal to this value. - Default value: 0 (use buttons) - flags - optional flags effecting the alert display. These flags may be ORed (|) - together for multiple effects. - SD_ALERT_SCROLL = display a scrollbar - SD_ALERT_SELECT_MULTI = forces selection box display (instead of - buttons) allows the user to select multiple - choices. - SD_ALERT_LINKS = display each choice as a plain text link. - Any selection box style overrides this flag. - SD_ALERT_NOVALIDATE = don't validate responses - Default value: SD_ALERT_SCROLL - (button display with scroll bar, validate responses) -RETURNS - The text of the selected button, or null if the alert duration expired - without a button click. - -Version 1 changes (from version 0): -* Added the tag, select, and flags arguments, thanks to several suggestions from Foomer. -* Split the sd_Alert/Alert() proc into New(), Display(), and Response() to allow more - customization by developers. Primarily developers would want to use Display() to change - the display of active tagged windows - -*/ - - -#define SD_ALERT_SCROLL 1 -#define SD_ALERT_SELECT_MULTI 2 -#define SD_ALERT_LINKS 4 -#define SD_ALERT_NOVALIDATE 8 - -proc/sd_Alert(client/who, message, title, buttons = list("Ok"),\ - default, duration = 0, unfocus = 1, size = "300x200", \ - table = "width=100% height=100%", style, tag, select, flags = SD_ALERT_SCROLL) - - if(ismob(who)) - var/mob/M = who - who = M.client - if(!istype(who)) CRASH("sd_Alert: Invalid target:[who] (\ref[who])") - - var/sd_alert/T = locate(tag) - if(T) - if(istype(T)) qdel(T) - else CRASH("sd_Alert: tag \"[tag]\" is already in use by datum '[T]' (type: [T.type])") - T = new(who, tag) - if(duration) - spawn(duration) - if(T) qdel(T) - return - T.Display(message,title,buttons,default,unfocus,size,table,style,select,flags) - . = T.Response() - -sd_alert - var - client/target - response - list/validation - - Destroy() - target << browse(null,"window=\ref[src]") - ..() - - New(who, tag) - ..() - target = who - src.tag = tag - - Topic(href,params[]) - if(usr.client != target) return - response = params["clk"] - - proc/Display(message,title,list/buttons,default,unfocus,size,table,style,select,flags) - if(unfocus) spawn() target << browse(null,null) - if(istext(buttons)) buttons = list(buttons) - if(!default) default = buttons[1] - if(!(flags & SD_ALERT_NOVALIDATE)) validation = buttons.Copy() - - var/html = {"[title][style]\ -
    [message]
    "} - - if(select || (flags & SD_ALERT_SELECT_MULTI)) // select style choices - html += {"
    \ - -
    " - else if(flags & SD_ALERT_LINKS) // text link style - for(var/b in buttons) - var/list/L = list() - L["clk"] = b - var/html_string=list2params(L) - var/focus - if(b == default) focus = " ID=fcs" - html += "[html_encode(b)]\ -
    " - else // button style choices - for(var/b in buttons) - var/list/L = list() - L["clk"] = b - var/html_string=list2params(L) - var/focus - if(b == default) focus = " ID=fcs" - html += " " - - html += "
    " - - target << browse(html,"window=\ref[src];size=[size];can_close=0") - - proc/Response() - var/validated - while(!validated) - while(target && !response) // wait for a response - sleep(2) - - if(response && validation) - if(istype(response, /list)) - var/list/L = response - validation - if(L.len) response = null - else validated = 1 - else if(response in validation) validated = 1 - else response=null - else validated = 1 - spawn(2) qdel(src) - return response diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index 3d05d5ba9e..bf1007e6cf 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -1,4 +1,4 @@ -proc/sql_poll_population() +/proc/sql_poll_population() if(!sqllogging) return var/admincount = admins.len @@ -16,16 +16,16 @@ proc/sql_poll_population() var/err = query.ErrorMsg() log_game("SQL ERROR during population polling. Error : \[[err]\]\n") -proc/sql_report_round_start() +/proc/sql_report_round_start() // TODO if(!sqllogging) return -proc/sql_report_round_end() +/proc/sql_report_round_end() // TODO if(!sqllogging) return -proc/sql_report_death(var/mob/living/carbon/human/H) +/proc/sql_report_death(var/mob/living/carbon/human/H) if(!sqllogging) return if(!H) @@ -59,7 +59,7 @@ proc/sql_report_death(var/mob/living/carbon/human/H) log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") -proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) +/proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) if(!sqllogging) return if(!H) @@ -93,7 +93,7 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) log_game("SQL ERROR during death reporting. Error : \[[err]\]\n") -proc/statistic_cycle() +/proc/statistic_cycle() set waitfor = 0 if(!sqllogging) return @@ -102,7 +102,7 @@ proc/statistic_cycle() sleep(6000) //This proc is used for feedback. It is executed at round end. -proc/sql_commit_feedback() +/proc/sql_commit_feedback() if(!blackbox) log_game("Round ended without a blackbox recorder. No feedback was sent to the database.") return diff --git a/code/game/antagonist/_antagonist_setup.dm b/code/game/antagonist/_antagonist_setup.dm index fa99f001f3..6f514b9413 100644 --- a/code/game/antagonist/_antagonist_setup.dm +++ b/code/game/antagonist/_antagonist_setup.dm @@ -14,19 +14,6 @@ - To skip equipping with appropriate gear, supply a positive third argument. */ -// Antagonist datum flags. -#define ANTAG_OVERRIDE_JOB 1 // Assigned job is set to MODE when spawning. -#define ANTAG_OVERRIDE_MOB 2 // Mob is recreated from datum mob_type var when spawning. -#define ANTAG_CLEAR_EQUIPMENT 4 // All preexisting equipment is purged. -#define ANTAG_CHOOSE_NAME 8 // Antagonists are prompted to enter a name. -#define ANTAG_IMPLANT_IMMUNE 16 // Cannot be loyalty implanted. -#define ANTAG_SUSPICIOUS 32 // Shows up on roundstart report. -#define ANTAG_HAS_LEADER 64 // Generates a leader antagonist. -#define ANTAG_HAS_NUKE 128 // Will spawn a nuke at supplied location. -#define ANTAG_RANDSPAWN 256 // Potentially randomly spawns due to events. -#define ANTAG_VOTABLE 512 // Can be voted as an additional antagonist before roundstart. -#define ANTAG_SET_APPEARANCE 1024 // Causes antagonists to use an appearance modifier on spawn. - // Globals. var/global/list/all_antag_types = list() var/global/list/all_antag_spawnpoints = list() diff --git a/code/game/antagonist/outsider/wizard.dm b/code/game/antagonist/outsider/wizard.dm index ac8efd6582..f362f6b3a8 100644 --- a/code/game/antagonist/outsider/wizard.dm +++ b/code/game/antagonist/outsider/wizard.dm @@ -105,7 +105,7 @@ var/datum/antagonist/wizard/wizards for(var/spell/spell_to_remove in src.spell_list) remove_spell(spell_to_remove) -obj/item/clothing +/obj/item/clothing var/wizard_garb = 0 // Does this clothing slot count as wizard garb? (Combines a few checks) diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 89a101e1b3..154f496be1 100644 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -1473,29 +1473,29 @@ NOTE: there are two lists of areas in the end of this file: centcom and station dynamic_lighting = 0 ambience = AMBIENCE_SPACE - auxport - name = "\improper Fore Port Solar Array" - icon_state = "panelsA" +/area/solar/auxport + name = "\improper Fore Port Solar Array" + icon_state = "panelsA" - auxstarboard - name = "\improper Fore Starboard Solar Array" - icon_state = "panelsA" +/area/solar/auxstarboard + name = "\improper Fore Starboard Solar Array" + icon_state = "panelsA" - fore - name = "\improper Fore Solar Array" - icon_state = "yellow" +/area/solar/fore + name = "\improper Fore Solar Array" + icon_state = "yellow" - aft - name = "\improper Aft Solar Array" - icon_state = "aft" +/area/solar/aft + name = "\improper Aft Solar Array" + icon_state = "aft" - starboard - name = "\improper Aft Starboard Solar Array" - icon_state = "panelsS" +/area/solar/starboard + name = "\improper Aft Starboard Solar Array" + icon_state = "panelsS" - port - name = "\improper Aft Port Solar Array" - icon_state = "panelsP" +/area/solar/port + name = "\improper Aft Port Solar Array" + icon_state = "panelsP" /area/maintenance/auxsolarport name = "Solar Maintenance - Fore Port" diff --git a/code/game/area/asteroid_areas.dm b/code/game/area/asteroid_areas.dm index 85f3bffd2f..2beaa88613 100644 --- a/code/game/area/asteroid_areas.dm +++ b/code/game/area/asteroid_areas.dm @@ -129,9 +129,9 @@ always_unpowered = 1 dynamic_lighting = 0 - aft - name = "\improper Engineering Outpost Solar Array" - icon_state = "yellow" +/area/outpost/engineering/solarsoutside/aft + name = "\improper Engineering Outpost Solar Array" + icon_state = "yellow" // Engineering Mining Outpost /area/outpost/engineering/mining diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 37e2d5c578..de6600b194 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -34,6 +34,15 @@ // Track if we are already had initialize() called to prevent double-initialization. var/initialized = FALSE + /// Last name used to calculate a color for the chatmessage overlays + var/chat_color_name + /// Last color calculated for the the chatmessage overlays + var/chat_color + /// A luminescence-shifted value of the last color calculated for chatmessage overlays + var/chat_color_darkened + /// The chat color var, without alpha. + var/chat_color_hover + /atom/New(loc, ...) // Don't call ..() unless /datum/New() ever exists @@ -476,7 +485,7 @@ // Use for objects performing visible actions // message is output to anyone who can see, e.g. "The [src] does something!" // blind_message (optional) is what blind people will hear e.g. "You hear something!" -/atom/proc/visible_message(var/message, var/blind_message, var/list/exclude_mobs, var/range = world.view) +/atom/proc/visible_message(var/message, var/blind_message, var/list/exclude_mobs, var/range = world.view, var/runemessage = "👁") var/list/see = get_mobs_and_objs_in_view_fast(get_turf(src), range, remote_ghosts = FALSE) @@ -492,6 +501,8 @@ var/mob/M = mob if(M.see_invisible >= invisibility && MOB_CAN_SEE_PLANE(M, plane)) M.show_message(message, VISIBLE_MESSAGE, blind_message, AUDIBLE_MESSAGE) + if(runemessage != -1) + M.create_chat_message(src, "[runemessage]", FALSE, list("emote"), audible = FALSE) else if(blind_message) M.show_message(blind_message, AUDIBLE_MESSAGE) @@ -500,7 +511,7 @@ // message is the message output to anyone who can hear. // deaf_message (optional) is what deaf people will see. // hearing_distance (optional) is the range, how many tiles away the message can be heard. -/atom/proc/audible_message(var/message, var/deaf_message, var/hearing_distance, var/radio_message) +/atom/proc/audible_message(var/message, var/deaf_message, var/hearing_distance, var/radio_message, var/runemessage) var/range = hearing_distance || world.view var/list/hear = get_mobs_and_objs_in_view_fast(get_turf(src),range,remote_ghosts = FALSE) @@ -521,6 +532,8 @@ var/mob/M = mob var/msg = message M.show_message(msg, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE) + if(runemessage != -1) + M.create_chat_message(src, "[runemessage || message]", FALSE, list("emote")) /atom/movable/proc/dropInto(var/atom/destination) while(istype(destination)) diff --git a/code/game/base_turf.dm b/code/game/base_turf.dm index b1944cba4a..92bf5c9f8d 100644 --- a/code/game/base_turf.dm +++ b/code/game/base_turf.dm @@ -1,12 +1,12 @@ // Returns the lowest turf available on a given Z-level, defaults to asteroid for Polaris. -proc/get_base_turf(var/z) +/proc/get_base_turf(var/z) if(!using_map.base_turf_by_z["[z]"]) using_map.base_turf_by_z["[z]"] = /turf/space return using_map.base_turf_by_z["[z]"] //An area can override the z-level base turf, so our solar array areas etc. can be space-based. -proc/get_base_turf_by_area(var/turf/T) +/proc/get_base_turf_by_area(var/turf/T) var/area/A = T.loc if(A.base_turf) return A.base_turf diff --git a/code/game/dna/dna2.dm b/code/game/dna/dna2.dm index 115a42d46b..d96df97bcd 100644 --- a/code/game/dna/dna2.dm +++ b/code/game/dna/dna2.dm @@ -58,10 +58,6 @@ var/global/list/datum/dna/gene/dna_genes[0] // Used for genes that check for value rather than a binary on/off. #define GENE_ALWAYS_ACTIVATE 1 -// Skip checking if it's already active. -// Used for genes that check for value rather than a binary on/off. -#define GENE_ALWAYS_ACTIVATE 1 - /datum/dna // READ-ONLY, GETS OVERWRITTEN // DO NOT FUCK WITH THESE OR BYOND WILL EAT YOUR FACE diff --git a/code/game/dna/genes/disabilities.dm b/code/game/dna/genes/disabilities.dm index f3506cba7f..2d3c1a3ac5 100644 --- a/code/game/dna/genes/disabilities.dm +++ b/code/game/dna/genes/disabilities.dm @@ -57,73 +57,73 @@ activation_message="Your mind says 'Hello'." mutation=mHallucination - New() - block=HALLUCINATIONBLOCK +/datum/dna/gene/disability/hallucinate/New() + block=HALLUCINATIONBLOCK /datum/dna/gene/disability/epilepsy name="Epilepsy" activation_message="You get a headache." disability=EPILEPSY - New() - block=HEADACHEBLOCK +/datum/dna/gene/disability/epilepsy/New() + block=HEADACHEBLOCK /datum/dna/gene/disability/cough name="Coughing" activation_message="You start coughing." disability=COUGHING - New() - block=COUGHBLOCK +/datum/dna/gene/disability/cough/New() + block=COUGHBLOCK /datum/dna/gene/disability/clumsy name="Clumsiness" activation_message="You feel lightheaded." mutation=CLUMSY - New() - block=CLUMSYBLOCK +/datum/dna/gene/disability/clumsy/New() + block=CLUMSYBLOCK /datum/dna/gene/disability/tourettes name="Tourettes" activation_message="You twitch." disability=TOURETTES - New() - block=TWITCHBLOCK +/datum/dna/gene/disability/tourettes/New() + block=TWITCHBLOCK /datum/dna/gene/disability/nervousness name="Nervousness" activation_message="You feel nervous." disability=NERVOUS - New() - block=NERVOUSBLOCK +/datum/dna/gene/disability/nervousness/New() + block=NERVOUSBLOCK /datum/dna/gene/disability/blindness name="Blindness" activation_message="You can't seem to see anything." sdisability=BLIND - New() - block=BLINDBLOCK +/datum/dna/gene/disability/blindness/New() + block=BLINDBLOCK /datum/dna/gene/disability/deaf name="Deafness" activation_message="It's kinda quiet." sdisability=DEAF - New() - block=DEAFBLOCK +/datum/dna/gene/disability/deaf/New() + block=DEAFBLOCK - activate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) - M.ear_deaf = 1 +/datum/dna/gene/disability/deaf/activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.ear_deaf = 1 /datum/dna/gene/disability/nearsighted name="Nearsightedness" activation_message="Your eyes feel weird..." disability=NEARSIGHTED - New() - block=GLASSESBLOCK +/datum/dna/gene/disability/nearsighted/New() + block=GLASSESBLOCK diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index efb934e504..6f91a5d0c8 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -7,180 +7,153 @@ activation_messages=list("You feel no need to breathe.") mutation=mNobreath - New() - block=NOBREATHBLOCK +/datum/dna/gene/basic/nobreath/New() + block=NOBREATHBLOCK /datum/dna/gene/basic/remoteview name="Remote Viewing" activation_messages=list("Your mind expands.") mutation=mRemote - New() - block=REMOTEVIEWBLOCK +/datum/dna/gene/basic/remoteview/New() + block=REMOTEVIEWBLOCK - activate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) - M.verbs += /mob/living/carbon/human/proc/remoteobserve +/datum/dna/gene/basic/remoteview/activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.verbs += /mob/living/carbon/human/proc/remoteobserve /datum/dna/gene/basic/regenerate name="Regenerate" activation_messages=list("You feel better.") mutation=mRegen - New() - block=REGENERATEBLOCK +/datum/dna/gene/basic/regenerate/New() + block=REGENERATEBLOCK /datum/dna/gene/basic/increaserun name="Super Speed" activation_messages=list("Your leg muscles pulsate.") mutation=mRun - New() - block=INCREASERUNBLOCK +/datum/dna/gene/basic/increaserun/New() + block=INCREASERUNBLOCK /datum/dna/gene/basic/remotetalk name="Telepathy" activation_messages=list("You expand your mind outwards.") mutation=mRemotetalk - New() - block=REMOTETALKBLOCK +/datum/dna/gene/basic/remotetalk/New() + block=REMOTETALKBLOCK - activate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) - M.verbs += /mob/living/carbon/human/proc/remotesay +/datum/dna/gene/basic/remotetalk/activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.verbs += /mob/living/carbon/human/proc/remotesay /datum/dna/gene/basic/morph name="Morph" activation_messages=list("Your skin feels strange.") mutation=mMorph - New() - block=MORPHBLOCK +/datum/dna/gene/basic/morph/New() + block=MORPHBLOCK - activate(var/mob/M) - ..(M) - M.verbs += /mob/living/carbon/human/proc/morph - -/* Not used on bay -/datum/dna/gene/basic/heat_resist - name="Heat Resistance" - activation_messages=list("Your skin is icy to the touch.") - mutation=mHeatres - - New() - block=COLDBLOCK - - can_activate(var/mob/M,var/flags) - if(flags & MUTCHK_FORCED) - return !(/datum/dna/gene/basic/cold_resist in M.active_genes) - // Probability check - var/_prob = 15 - if(COLD_RESISTANCE in M.mutations) - _prob=5 - if(probinj(_prob,(flags&MUTCHK_FORCED))) - return 1 - - OnDrawUnderlays(var/mob/M,var/g,var/fat) - return "cold[fat]_s" -*/ +/datum/dna/gene/basic/morph/activate(var/mob/M) + ..(M) + M.verbs += /mob/living/carbon/human/proc/morph /datum/dna/gene/basic/cold_resist name="Cold Resistance" activation_messages=list("Your body is filled with warmth.") mutation=COLD_RESISTANCE - New() - block=FIREBLOCK +/datum/dna/gene/basic/cold_resist/New() + block=FIREBLOCK - can_activate(var/mob/M,var/flags) - if(flags & MUTCHK_FORCED) - return 1 - // return !(/datum/dna/gene/basic/heat_resist in M.active_genes) - // Probability check - var/_prob=30 - //if(mHeatres in M.mutations) - // _prob=5 - if(probinj(_prob,(flags&MUTCHK_FORCED))) - return 1 +/datum/dna/gene/basic/cold_resist/can_activate(var/mob/M,var/flags) + if(flags & MUTCHK_FORCED) + return 1 + var/_prob=30 + if(probinj(_prob,(flags&MUTCHK_FORCED))) + return 1 - OnDrawUnderlays(var/mob/M,var/g,var/fat) - return "fire[fat]_s" +/datum/dna/gene/basic/cold_resist/OnDrawUnderlays(var/mob/M,var/g,var/fat) + return "fire[fat]_s" /datum/dna/gene/basic/noprints name="No Prints" activation_messages=list("Your fingers feel numb.") mutation=mFingerprints - New() - block=NOPRINTSBLOCK +/datum/dna/gene/basic/noprints/New() + block=NOPRINTSBLOCK /datum/dna/gene/basic/noshock name="Shock Immunity" activation_messages=list("Your skin feels strange.") mutation=mShock - New() - block=SHOCKIMMUNITYBLOCK +/datum/dna/gene/basic/noshock/New() + block=SHOCKIMMUNITYBLOCK /datum/dna/gene/basic/midget name="Midget" activation_messages=list("Your skin feels rubbery.") mutation=mSmallsize - New() - block=SMALLSIZEBLOCK +/datum/dna/gene/basic/midget/New() + block=SMALLSIZEBLOCK - can_activate(var/mob/M,var/flags) - // Can't be big and small. - if(HULK in M.mutations) - return 0 - return ..(M,flags) +/datum/dna/gene/basic/midget/can_activate(var/mob/M,var/flags) + // Can't be big and small. + if(HULK in M.mutations) + return 0 + return ..(M,flags) - activate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) - M.pass_flags |= 1 +/datum/dna/gene/basic/midget/activate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.pass_flags |= 1 - deactivate(var/mob/M, var/connected, var/flags) - ..(M,connected,flags) - M.pass_flags &= ~1 //This may cause issues down the track, but offhand I can't think of any other way for humans to get passtable short of varediting so it should be fine. ~Z +/datum/dna/gene/basic/midget/deactivate(var/mob/M, var/connected, var/flags) + ..(M,connected,flags) + M.pass_flags &= ~1 //This may cause issues down the track, but offhand I can't think of any other way for humans to get passtable short of varediting so it should be fine. ~Z /datum/dna/gene/basic/hulk name="Hulk" activation_messages=list("Your muscles hurt.") mutation=HULK - New() - block=HULKBLOCK +/datum/dna/gene/basic/hulk/New() + block=HULKBLOCK - can_activate(var/mob/M,var/flags) - // Can't be big and small. - if(mSmallsize in M.mutations) - return 0 - return ..(M,flags) +/datum/dna/gene/basic/hulk/can_activate(var/mob/M,var/flags) + // Can't be big and small. + if(mSmallsize in M.mutations) + return 0 + return ..(M,flags) - OnDrawUnderlays(var/mob/M,var/g,var/fat) - if(fat) - return "hulk_[fat]_s" - else - return "hulk_[g]_s" +/datum/dna/gene/basic/hulk/OnDrawUnderlays(var/mob/M,var/g,var/fat) + if(fat) + return "hulk_[fat]_s" + else + return "hulk_[g]_s" - OnMobLife(var/mob/living/carbon/human/M) - if(!istype(M)) return - if(M.health <= 25) - M.mutations.Remove(HULK) - M.update_mutations() //update our mutation overlays - to_chat(M, "You suddenly feel very weak.") - M.Weaken(3) - M.emote("collapse") +/datum/dna/gene/basic/hulk/OnMobLife(var/mob/living/carbon/human/M) + if(!istype(M)) return + if(M.health <= 25) + M.mutations.Remove(HULK) + M.update_mutations() //update our mutation overlays + to_chat(M, "You suddenly feel very weak.") + M.Weaken(3) + M.emote("collapse") /datum/dna/gene/basic/xray name="X-Ray Vision" activation_messages=list("The walls suddenly disappear.") mutation=XRAY - New() - block=XRAYBLOCK +/datum/dna/gene/basic/xray/New() + block=XRAYBLOCK /datum/dna/gene/basic/tk name="Telekenesis" @@ -188,7 +161,7 @@ mutation=TK activation_prob=15 - New() - block=TELEBLOCK - OnDrawUnderlays(var/mob/M,var/g,var/fat) - return "telekinesishead[fat]_s" +/datum/dna/gene/basic/tk/New() + block=TELEBLOCK +/datum/dna/gene/basic/tk/OnDrawUnderlays(var/mob/M,var/g,var/fat) + return "telekinesishead[fat]_s" diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index b03b986bca..f6d6695b19 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -160,7 +160,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E //STINGS// //They get a pretty header because there's just so fucking many of them ;_; ////////// -turf/proc/AdjacentTurfsRangedSting() +/turf/proc/AdjacentTurfsRangedSting() //Yes this is snowflakey, but I couldn't get it to work any other way.. -Luke var/list/allowed = list( /obj/structure/table, diff --git a/code/game/gamemodes/cult/construct_spells.dm b/code/game/gamemodes/cult/construct_spells.dm index 954361fb9f..29361f9741 100644 --- a/code/game/gamemodes/cult/construct_spells.dm +++ b/code/game/gamemodes/cult/construct_spells.dm @@ -1,29 +1,6 @@ -//cast_method flags, needs to be up to date with Technomancer's. They were, for some reason, not working outside it. -#define CAST_USE 1 // Clicking the spell in your hand. -#define CAST_MELEE 2 // Clicking an atom in melee range. -#define CAST_RANGED 4 // Clicking an atom beyond melee range. -#define CAST_THROW 8 // Throwing the spell and hitting an atom. -#define CAST_COMBINE 16 // Clicking another spell with this spell. -#define CAST_INNATE 32 // Activates upon verb usage, used for mobs without hands. - -//Aspects -#define ASPECT_FIRE "fire" //Damage over time and raising body-temp. Firesuits protect from this. -#define ASPECT_FROST "frost" //Slows down the affected, also involves imbedding with icicles. Winter coats protect from this. -#define ASPECT_SHOCK "shock" //Energy-expensive, usually stuns. Insulated armor protects from this. -#define ASPECT_AIR "air" //Mostly involves manipulation of atmos, useless in a vacuum. Magboots protect from this. -#define ASPECT_FORCE "force" //Manipulates gravity to push things away or towards a location. -#define ASPECT_TELE "tele" //Teleportation of self, other objects, or other people. -#define ASPECT_DARK "dark" //Makes all those photons vanish using magic-- WITH SCIENCE. Used for sneaky stuff. -#define ASPECT_LIGHT "light" //The opposite of dark, usually blinds, makes holo-illusions, or makes laser lightshows. -#define ASPECT_BIOMED "biomed" //Mainly concerned with healing and restoration. -#define ASPECT_EMP "emp" //Unused now. -#define ASPECT_UNSTABLE "unstable" //Heavily RNG-based, causes instability to the victim. -#define ASPECT_CHROMATIC "chromatic" //Used to combine with other spells. -#define ASPECT_UNHOLY "unholy" //Involves the dead, blood, and most things against divine beings. - //////////////////////////////Construct Spells///////////////////////// -proc/findNullRod(var/atom/target) +/proc/findNullRod(var/atom/target) if(istype(target,/obj/item/weapon/nullrod)) return 1 else if(target.contents) diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 07440ae5f5..4b095d2cd1 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -65,117 +65,116 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," // self other technology - Communication rune //was other hear blood // join hide technology - stun rune. Rune color: bright pink. - New() - ..() - blood_image = image(loc = src) - blood_image.override = 1 - for(var/mob/living/silicon/ai/AI in player_list) - if(AI.client) - AI.client.images += blood_image - rune_list.Add(src) +/obj/effect/rune/Initialize() + . = ..() + blood_image = image(loc = src) + blood_image.override = 1 + for(var/mob/living/silicon/ai/AI in player_list) + if(AI.client) + AI.client.images += blood_image + rune_list.Add(src) - Destroy() - for(var/mob/living/silicon/ai/AI in player_list) - if(AI.client) - AI.client.images -= blood_image - qdel(blood_image) - blood_image = null - rune_list.Remove(src) - ..() +/obj/effect/rune/Destroy() + for(var/mob/living/silicon/ai/AI in player_list) + if(AI.client) + AI.client.images -= blood_image + qdel(blood_image) + blood_image = null + rune_list.Remove(src) + ..() - examine(mob/user) - . = ..() - if(iscultist(user)) - . += "This spell circle reads: [word1] [word2] [word3]." +/obj/effect/rune/examine(mob/user) + . = ..() + if(iscultist(user)) + . += "This spell circle reads: [word1] [word2] [word3]." - attackby(I as obj, user as mob) - if(istype(I, /obj/item/weapon/book/tome) && iscultist(user)) - to_chat(user, "You retrace your steps, carefully undoing the lines of the rune.") - qdel(src) - return - else if(istype(I, /obj/item/weapon/nullrod)) - to_chat(user, "You disrupt the vile magic with the deadening field of the null rod!") - qdel(src) - return +/obj/effect/rune/attackby(I as obj, user as mob) + if(istype(I, /obj/item/weapon/book/tome) && iscultist(user)) + to_chat(user, "You retrace your steps, carefully undoing the lines of the rune.") + qdel(src) return + else if(istype(I, /obj/item/weapon/nullrod)) + to_chat(user, "You disrupt the vile magic with the deadening field of the null rod!") + qdel(src) + return + return - attack_hand(mob/living/user as mob) - if(!iscultist(user)) - to_chat(user, "You can't mouth the arcane scratchings without fumbling over them.") - return - if(user.is_muzzled()) - to_chat(user, "You are unable to speak the words of the rune.") - return - if(!word1 || !word2 || !word3 || prob(user.getBrainLoss())) - return fizzle() +/obj/effect/rune/attack_hand(mob/living/user as mob) + if(!iscultist(user)) + to_chat(user, "You can't mouth the arcane scratchings without fumbling over them.") + return + if(user.is_muzzled()) + to_chat(user, "You are unable to speak the words of the rune.") + return + if(!word1 || !word2 || !word3 || prob(user.getBrainLoss())) + return fizzle() // if(!src.visibility) // src.visibility=1 - if(word1 == cultwords["travel"] && word2 == cultwords["self"]) - return teleport(src.word3) - if(word1 == cultwords["see"] && word2 == cultwords["blood"] && word3 == cultwords["hell"]) - return tomesummon() - if(word1 == cultwords["hell"] && word2 == cultwords["destroy"] && word3 == cultwords["other"]) - return armor() - if(word1 == cultwords["join"] && word2 == cultwords["blood"] && word3 == cultwords["self"]) - return convert() - if(word1 == cultwords["hell"] && word2 == cultwords["join"] && word3 == cultwords["self"]) - return tearreality() - if(word1 == cultwords["destroy"] && word2 == cultwords["see"] && word3 == cultwords["technology"]) - return emp(src.loc,5) - if(word1 == cultwords["travel"] && word2 == cultwords["blood"] && word3 == cultwords["self"]) - return drain() - if(word1 == cultwords["see"] && word2 == cultwords["hell"] && word3 == cultwords["join"]) - return seer() - if(word1 == cultwords["blood"] && word2 == cultwords["join"] && word3 == cultwords["hell"]) - return raise() - if(word1 == cultwords["hide"] && word2 == cultwords["see"] && word3 == cultwords["blood"]) - return obscure(4) - if(word1 == cultwords["hell"] && word2 == cultwords["travel"] && word3 == cultwords["self"]) - return ajourney() - if(word1 == cultwords["blood"] && word2 == cultwords["see"] && word3 == cultwords["travel"]) - return manifest() - if(word1 == cultwords["hell"] && word2 == cultwords["technology"] && word3 == cultwords["join"]) - return talisman() - if(word1 == cultwords["hell"] && word2 == cultwords["blood"] && word3 == cultwords["join"]) - return sacrifice() - if(word1 == cultwords["blood"] && word2 == cultwords["see"] && word3 == cultwords["hide"]) - return revealrunes(src) - if(word1 == cultwords["destroy"] && word2 == cultwords["travel"] && word3 == cultwords["self"]) - return wall() - if(word1 == cultwords["travel"] && word2 == cultwords["technology"] && word3 == cultwords["other"]) - return freedom() - if(word1 == cultwords["join"] && word2 == cultwords["other"] && word3 == cultwords["self"]) - return cultsummon() - if(word1 == cultwords["hide"] && word2 == cultwords["other"] && word3 == cultwords["see"]) - return deafen() - if(word1 == cultwords["destroy"] && word2 == cultwords["see"] && word3 == cultwords["other"]) - return blind() - if(word1 == cultwords["destroy"] && word2 == cultwords["see"] && word3 == cultwords["blood"]) - return bloodboil() - if(word1 == cultwords["self"] && word2 == cultwords["other"] && word3 == cultwords["technology"]) - return communicate() - if(word1 == cultwords["travel"] && word2 == cultwords["other"]) - return itemport(src.word3) - if(word1 == cultwords["join"] && word2 == cultwords["hide"] && word3 == cultwords["technology"]) - return runestun() - else - return fizzle() + if(word1 == cultwords["travel"] && word2 == cultwords["self"]) + return teleport(src.word3) + if(word1 == cultwords["see"] && word2 == cultwords["blood"] && word3 == cultwords["hell"]) + return tomesummon() + if(word1 == cultwords["hell"] && word2 == cultwords["destroy"] && word3 == cultwords["other"]) + return armor() + if(word1 == cultwords["join"] && word2 == cultwords["blood"] && word3 == cultwords["self"]) + return convert() + if(word1 == cultwords["hell"] && word2 == cultwords["join"] && word3 == cultwords["self"]) + return tearreality() + if(word1 == cultwords["destroy"] && word2 == cultwords["see"] && word3 == cultwords["technology"]) + return emp(src.loc,5) + if(word1 == cultwords["travel"] && word2 == cultwords["blood"] && word3 == cultwords["self"]) + return drain() + if(word1 == cultwords["see"] && word2 == cultwords["hell"] && word3 == cultwords["join"]) + return seer() + if(word1 == cultwords["blood"] && word2 == cultwords["join"] && word3 == cultwords["hell"]) + return raise() + if(word1 == cultwords["hide"] && word2 == cultwords["see"] && word3 == cultwords["blood"]) + return obscure(4) + if(word1 == cultwords["hell"] && word2 == cultwords["travel"] && word3 == cultwords["self"]) + return ajourney() + if(word1 == cultwords["blood"] && word2 == cultwords["see"] && word3 == cultwords["travel"]) + return manifest() + if(word1 == cultwords["hell"] && word2 == cultwords["technology"] && word3 == cultwords["join"]) + return talisman() + if(word1 == cultwords["hell"] && word2 == cultwords["blood"] && word3 == cultwords["join"]) + return sacrifice() + if(word1 == cultwords["blood"] && word2 == cultwords["see"] && word3 == cultwords["hide"]) + return revealrunes(src) + if(word1 == cultwords["destroy"] && word2 == cultwords["travel"] && word3 == cultwords["self"]) + return wall() + if(word1 == cultwords["travel"] && word2 == cultwords["technology"] && word3 == cultwords["other"]) + return freedom() + if(word1 == cultwords["join"] && word2 == cultwords["other"] && word3 == cultwords["self"]) + return cultsummon() + if(word1 == cultwords["hide"] && word2 == cultwords["other"] && word3 == cultwords["see"]) + return deafen() + if(word1 == cultwords["destroy"] && word2 == cultwords["see"] && word3 == cultwords["other"]) + return blind() + if(word1 == cultwords["destroy"] && word2 == cultwords["see"] && word3 == cultwords["blood"]) + return bloodboil() + if(word1 == cultwords["self"] && word2 == cultwords["other"] && word3 == cultwords["technology"]) + return communicate() + if(word1 == cultwords["travel"] && word2 == cultwords["other"]) + return itemport(src.word3) + if(word1 == cultwords["join"] && word2 == cultwords["hide"] && word3 == cultwords["technology"]) + return runestun() + else + return fizzle() - proc - fizzle() - if(istype(src,/obj/effect/rune)) - usr.say(pick("Hakkrutju gopoenjim.", "Nherasai pivroiashan.", "Firjji prhiv mazenhor.", "Tanah eh wakantahe.", "Obliyae na oraie.", "Miyf hon vnor'c.", "Wakabai hij fen juswix.")) - else - usr.whisper(pick("Hakkrutju gopoenjim.", "Nherasai pivroiashan.", "Firjji prhiv mazenhor.", "Tanah eh wakantahe.", "Obliyae na oraie.", "Miyf hon vnor'c.", "Wakabai hij fen juswix.")) - for (var/mob/V in viewers(src)) - V.show_message("The markings pulse with a small burst of light, then fall dark.", 3, "You hear a faint fizzle.", 2) - return +/obj/effect/rune/proc/fizzle() + if(istype(src,/obj/effect/rune)) + usr.say(pick("Hakkrutju gopoenjim.", "Nherasai pivroiashan.", "Firjji prhiv mazenhor.", "Tanah eh wakantahe.", "Obliyae na oraie.", "Miyf hon vnor'c.", "Wakabai hij fen juswix.")) + else + usr.whisper(pick("Hakkrutju gopoenjim.", "Nherasai pivroiashan.", "Firjji prhiv mazenhor.", "Tanah eh wakantahe.", "Obliyae na oraie.", "Miyf hon vnor'c.", "Wakabai hij fen juswix.")) + for (var/mob/V in viewers(src)) + V.show_message("The markings pulse with a small burst of light, then fall dark.", 3, "You hear a faint fizzle.", 2) + return - check_icon() - icon = get_uristrune_cult(word1, word2, word3) +/obj/effect/rune/proc/check_icon() + icon = get_uristrune_cult(word1, word2, word3) /obj/item/weapon/book/tome name = "arcane tome" @@ -289,149 +288,149 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," "} - New() - ..() - if(!cultwords["travel"]) - runerandom() - for(var/V in cultwords) - words[cultwords[V]] = V +/obj/item/weapon/book/tome/Initialize() + . = ..() + if(!cultwords["travel"]) + runerandom() + for(var/V in cultwords) + words[cultwords[V]] = V - attack(mob/living/M as mob, mob/living/user as mob) - add_attack_logs(user,M,"Hit with [name]") +/obj/item/weapon/book/tome/attack(mob/living/M as mob, mob/living/user as mob) + add_attack_logs(user,M,"Hit with [name]") - if(istype(M,/mob/observer/dead)) - var/mob/observer/dead/D = M - D.manifest(user) - return - if(!istype(M)) - return - if(!iscultist(user)) - return ..() - if(iscultist(M)) - return - M.take_organ_damage(0,rand(5,20)) //really lucky - 5 hits for a crit - for(var/mob/O in viewers(M, null)) - O.show_message("\The [user] beats \the [M] with \the [src]!", 1) - to_chat(M, "You feel searing heat inside!") + if(istype(M,/mob/observer/dead)) + var/mob/observer/dead/D = M + D.manifest(user) + return + if(!istype(M)) + return + if(!iscultist(user)) + return ..() + if(iscultist(M)) + return + M.take_organ_damage(0,rand(5,20)) //really lucky - 5 hits for a crit + for(var/mob/O in viewers(M, null)) + O.show_message("\The [user] beats \the [M] with \the [src]!", 1) + to_chat(M, "You feel searing heat inside!") - attack_self(mob/living/user as mob) - usr = user - if(!usr.canmove || usr.stat || usr.restrained()) +/obj/item/weapon/book/tome/attack_self(mob/living/user as mob) + usr = user + if(!usr.canmove || usr.stat || usr.restrained()) + return + + if(!cultwords["travel"]) + runerandom() + if(iscultist(user)) + var/C = 0 + for(var/obj/effect/rune/N in rune_list) + C++ + if (!istype(user.loc,/turf)) + to_chat(user, "You do not have enough space to write a proper rune.") return - if(!cultwords["travel"]) - runerandom() - if(iscultist(user)) - var/C = 0 - for(var/obj/effect/rune/N in rune_list) - C++ - if (!istype(user.loc,/turf)) - to_chat(user, "You do not have enough space to write a proper rune.") - return - - if (C>=26 + runedec + cult.current_antagonists.len) //including the useless rune at the secret room, shouldn't count against the limit of 25 runes - Urist - alert("The cloth of reality can't take that much of a strain. Remove some runes first!") - return - else - switch(alert("You open the tome",,"Read it","Scribe a rune", "Cancel")) - if("Cancel") - return - if("Read it") - if(usr.get_active_hand() != src) - return - user << browse("[tomedat]", "window=Arcane Tome") - return - if(usr.get_active_hand() != src) - return - - var/list/dictionary = list ( - "convert" = list("join","blood","self"), - "wall" = list("destroy","travel","self"), - "blood boil" = list("destroy","see","blood"), - "blood drain" = list("travel","blood","self"), - "raise dead" = list("blood","join","hell"), - "summon narsie" = list("hell","join","self"), - "communicate" = list("self","other","technology"), - "emp" = list("destroy","see","technology"), - "manifest" = list("blood","see","travel"), - "summon tome" = list("see","blood","hell"), - "see invisible" = list("see","hell","join"), - "hide" = list("hide","see","blood"), - "reveal" = list("blood","see","hide"), - "astral journey" = list("hell","travel","self"), - "imbue" = list("hell","technology","join"), - "sacrifice" = list("hell","blood","join"), - "summon cultist" = list("join","other","self"), - "free cultist" = list("travel","technology","other"), - "deafen" = list("hide","other","see"), - "blind" = list("destroy","see","other"), - "stun" = list("join","hide","technology"), - "armor" = list("hell","destroy","other"), - "teleport" = list("travel","self"), - "teleport other" = list("travel","other") - ) - - var/list/english = list() - - var/list/scribewords = list("none") - - for (var/entry in words) - if (words[entry] != entry) - english += list(words[entry] = entry) - - for (var/entry in dictionary) - var/list/required = dictionary[entry] - if (length(english&required) == required.len) - scribewords += entry - - var/chosen_rune = null - - if(usr) - chosen_rune = input ("Choose a rune to scribe.") in scribewords - if (!chosen_rune) - return - if (chosen_rune == "none") - to_chat(user, "You decide against scribing a rune, perhaps you should take this time to study your notes.") - return - if (chosen_rune == "teleport") - dictionary[chosen_rune] += input ("Choose a destination word") in english - if (chosen_rune == "teleport other") - dictionary[chosen_rune] += input ("Choose a destination word") in english - - if(usr.get_active_hand() != src) - return - - for (var/mob/V in viewers(src)) - V.show_message("\The [user] slices open a finger and begins to chant and paint symbols on the floor.", 3, "You hear chanting.", 2) - to_chat(user, "You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world.") - user.take_overall_damage((rand(9)+1)/10) // 0.1 to 1.0 damage - if(do_after(user, 50)) - var/area/A = get_area(user) - log_and_message_admins("created \an [chosen_rune] rune at \the [A.name] - [user.loc.x]-[user.loc.y]-[user.loc.z].") - if(usr.get_active_hand() != src) - return - var/mob/living/carbon/human/H = user - var/obj/effect/rune/R = new /obj/effect/rune(user.loc) - to_chat(user, "You finish drawing the arcane markings of the Geometer.") - var/list/required = dictionary[chosen_rune] - R.word1 = english[required[1]] - R.word2 = english[required[2]] - R.word3 = english[required[3]] - R.check_icon() - R.blood_DNA = list() - R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type + if (C>=26 + runedec + cult.current_antagonists.len) //including the useless rune at the secret room, shouldn't count against the limit of 25 runes - Urist + alert("The cloth of reality can't take that much of a strain. Remove some runes first!") return else - to_chat(user, "The book seems full of illegible scribbles. Is this a joke?") + switch(alert("You open the tome",,"Read it","Scribe a rune", "Cancel")) + if("Cancel") + return + if("Read it") + if(usr.get_active_hand() != src) + return + user << browse("[tomedat]", "window=Arcane Tome") + return + if(usr.get_active_hand() != src) return - examine(mob/user) - . = ..() - if(!iscultist(user)) - . += "An old, dusty tome with frayed edges and a sinister looking cover." - else - . += "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though." + var/list/dictionary = list ( + "convert" = list("join","blood","self"), + "wall" = list("destroy","travel","self"), + "blood boil" = list("destroy","see","blood"), + "blood drain" = list("travel","blood","self"), + "raise dead" = list("blood","join","hell"), + "summon narsie" = list("hell","join","self"), + "communicate" = list("self","other","technology"), + "emp" = list("destroy","see","technology"), + "manifest" = list("blood","see","travel"), + "summon tome" = list("see","blood","hell"), + "see invisible" = list("see","hell","join"), + "hide" = list("hide","see","blood"), + "reveal" = list("blood","see","hide"), + "astral journey" = list("hell","travel","self"), + "imbue" = list("hell","technology","join"), + "sacrifice" = list("hell","blood","join"), + "summon cultist" = list("join","other","self"), + "free cultist" = list("travel","technology","other"), + "deafen" = list("hide","other","see"), + "blind" = list("destroy","see","other"), + "stun" = list("join","hide","technology"), + "armor" = list("hell","destroy","other"), + "teleport" = list("travel","self"), + "teleport other" = list("travel","other") + ) + + var/list/english = list() + + var/list/scribewords = list("none") + + for (var/entry in words) + if (words[entry] != entry) + english += list(words[entry] = entry) + + for (var/entry in dictionary) + var/list/required = dictionary[entry] + if (length(english&required) == required.len) + scribewords += entry + + var/chosen_rune = null + + if(usr) + chosen_rune = input ("Choose a rune to scribe.") in scribewords + if (!chosen_rune) + return + if (chosen_rune == "none") + to_chat(user, "You decide against scribing a rune, perhaps you should take this time to study your notes.") + return + if (chosen_rune == "teleport") + dictionary[chosen_rune] += input ("Choose a destination word") in english + if (chosen_rune == "teleport other") + dictionary[chosen_rune] += input ("Choose a destination word") in english + + if(usr.get_active_hand() != src) + return + + for (var/mob/V in viewers(src)) + V.show_message("\The [user] slices open a finger and begins to chant and paint symbols on the floor.", 3, "You hear chanting.", 2) + to_chat(user, "You slice open one of your fingers and begin drawing a rune on the floor whilst chanting the ritual that binds your life essence with the dark arcane energies flowing through the surrounding world.") + user.take_overall_damage((rand(9)+1)/10) // 0.1 to 1.0 damage + if(do_after(user, 50)) + var/area/A = get_area(user) + log_and_message_admins("created \an [chosen_rune] rune at \the [A.name] - [user.loc.x]-[user.loc.y]-[user.loc.z].") + if(usr.get_active_hand() != src) + return + var/mob/living/carbon/human/H = user + var/obj/effect/rune/R = new /obj/effect/rune(user.loc) + to_chat(user, "You finish drawing the arcane markings of the Geometer.") + var/list/required = dictionary[chosen_rune] + R.word1 = english[required[1]] + R.word2 = english[required[2]] + R.word3 = english[required[3]] + R.check_icon() + R.blood_DNA = list() + R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type + return + else + to_chat(user, "The book seems full of illegible scribbles. Is this a joke?") + return + +/obj/item/weapon/book/tome/examine(mob/user) + . = ..() + if(!iscultist(user)) + . += "An old, dusty tome with frayed edges and a sinister looking cover." + else + . += "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though." /obj/item/weapon/book/tome/cultify() return @@ -439,174 +438,174 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," /obj/item/weapon/book/tome/imbued //admin tome, spawns working runes without waiting w_class = ITEMSIZE_SMALL var/cultistsonly = 1 - attack_self(mob/user as mob) - if(src.cultistsonly && !iscultist(usr)) - return - if(!cultwords["travel"]) - runerandom() - if(user) - var/r - if (!istype(user.loc,/turf)) - to_chat(user, "You do not have enough space to write a proper rune.") - var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") - r = input("Choose a rune to scribe", "Rune Scribing") in runes //not cancellable. - var/obj/effect/rune/R = new /obj/effect/rune - if(istype(user, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = user - R.blood_DNA = list() - R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type - var/area/A = get_area(user) - log_and_message_admins("created \an [r] rune at \the [A.name] - [user.loc.x]-[user.loc.y]-[user.loc.z].") - switch(r) - if("teleport") - var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") - var/beacon - if(usr) - beacon = input("Select the last rune", "Rune Scribing") in words - R.word1=cultwords["travel"] - R.word2=cultwords["self"] - R.word3=beacon - R.loc = user.loc - R.check_icon() - if("itemport") - var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") - var/beacon - if(usr) - beacon = input("Select the last rune", "Rune Scribing") in words - R.word1=cultwords["travel"] - R.word2=cultwords["other"] - R.word3=beacon - R.loc = user.loc - R.check_icon() - if("tome") - R.word1=cultwords["see"] - R.word2=cultwords["blood"] - R.word3=cultwords["hell"] - R.loc = user.loc - R.check_icon() - if("armor") - R.word1=cultwords["hell"] - R.word2=cultwords["destroy"] - R.word3=cultwords["other"] - R.loc = user.loc - R.check_icon() - if("convert") - R.word1=cultwords["join"] - R.word2=cultwords["blood"] - R.word3=cultwords["self"] - R.loc = user.loc - R.check_icon() - if("tear in reality") - R.word1=cultwords["hell"] - R.word2=cultwords["join"] - R.word3=cultwords["self"] - R.loc = user.loc - R.check_icon() - if("emp") - R.word1=cultwords["destroy"] - R.word2=cultwords["see"] - R.word3=cultwords["technology"] - R.loc = user.loc - R.check_icon() - if("drain") - R.word1=cultwords["travel"] - R.word2=cultwords["blood"] - R.word3=cultwords["self"] - R.loc = user.loc - R.check_icon() - if("seer") - R.word1=cultwords["see"] - R.word2=cultwords["hell"] - R.word3=cultwords["join"] - R.loc = user.loc - R.check_icon() - if("raise") - R.word1=cultwords["blood"] - R.word2=cultwords["join"] - R.word3=cultwords["hell"] - R.loc = user.loc - R.check_icon() - if("obscure") - R.word1=cultwords["hide"] - R.word2=cultwords["see"] - R.word3=cultwords["blood"] - R.loc = user.loc - R.check_icon() - if("astral journey") - R.word1=cultwords["hell"] - R.word2=cultwords["travel"] - R.word3=cultwords["self"] - R.loc = user.loc - R.check_icon() - if("manifest") - R.word1=cultwords["blood"] - R.word2=cultwords["see"] - R.word3=cultwords["travel"] - R.loc = user.loc - R.check_icon() - if("imbue talisman") - R.word1=cultwords["hell"] - R.word2=cultwords["technology"] - R.word3=cultwords["join"] - R.loc = user.loc - R.check_icon() - if("sacrifice") - R.word1=cultwords["hell"] - R.word2=cultwords["blood"] - R.word3=cultwords["join"] - R.loc = user.loc - R.check_icon() - if("reveal") - R.word1=cultwords["blood"] - R.word2=cultwords["see"] - R.word3=cultwords["hide"] - R.loc = user.loc - R.check_icon() - if("wall") - R.word1=cultwords["destroy"] - R.word2=cultwords["travel"] - R.word3=cultwords["self"] - R.loc = user.loc - R.check_icon() - if("freedom") - R.word1=cultwords["travel"] - R.word2=cultwords["technology"] - R.word3=cultwords["other"] - R.loc = user.loc - R.check_icon() - if("cultsummon") - R.word1=cultwords["join"] - R.word2=cultwords["other"] - R.word3=cultwords["self"] - R.loc = user.loc - R.check_icon() - if("deafen") - R.word1=cultwords["hide"] - R.word2=cultwords["other"] - R.word3=cultwords["see"] - R.loc = user.loc - R.check_icon() - if("blind") - R.word1=cultwords["destroy"] - R.word2=cultwords["see"] - R.word3=cultwords["other"] - R.loc = user.loc - R.check_icon() - if("bloodboil") - R.word1=cultwords["destroy"] - R.word2=cultwords["see"] - R.word3=cultwords["blood"] - R.loc = user.loc - R.check_icon() - if("communicate") - R.word1=cultwords["self"] - R.word2=cultwords["other"] - R.word3=cultwords["technology"] - R.loc = user.loc - R.check_icon() - if("stun") - R.word1=cultwords["join"] - R.word2=cultwords["hide"] - R.word3=cultwords["technology"] - R.loc = user.loc - R.check_icon() +/obj/item/weapon/book/tome/imbued/attack_self(mob/user as mob) + if(src.cultistsonly && !iscultist(usr)) + return + if(!cultwords["travel"]) + runerandom() + if(user) + var/r + if (!istype(user.loc,/turf)) + to_chat(user, "You do not have enough space to write a proper rune.") + var/list/runes = list("teleport", "itemport", "tome", "armor", "convert", "tear in reality", "emp", "drain", "seer", "raise", "obscure", "reveal", "astral journey", "manifest", "imbue talisman", "sacrifice", "wall", "freedom", "cultsummon", "deafen", "blind", "bloodboil", "communicate", "stun") + r = input("Choose a rune to scribe", "Rune Scribing") in runes //not cancellable. + var/obj/effect/rune/R = new /obj/effect/rune + if(istype(user, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + R.blood_DNA = list() + R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type + var/area/A = get_area(user) + log_and_message_admins("created \an [r] rune at \the [A.name] - [user.loc.x]-[user.loc.y]-[user.loc.z].") + switch(r) + if("teleport") + var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") + var/beacon + if(usr) + beacon = input("Select the last rune", "Rune Scribing") in words + R.word1=cultwords["travel"] + R.word2=cultwords["self"] + R.word3=beacon + R.loc = user.loc + R.check_icon() + if("itemport") + var/list/words = list("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") + var/beacon + if(usr) + beacon = input("Select the last rune", "Rune Scribing") in words + R.word1=cultwords["travel"] + R.word2=cultwords["other"] + R.word3=beacon + R.loc = user.loc + R.check_icon() + if("tome") + R.word1=cultwords["see"] + R.word2=cultwords["blood"] + R.word3=cultwords["hell"] + R.loc = user.loc + R.check_icon() + if("armor") + R.word1=cultwords["hell"] + R.word2=cultwords["destroy"] + R.word3=cultwords["other"] + R.loc = user.loc + R.check_icon() + if("convert") + R.word1=cultwords["join"] + R.word2=cultwords["blood"] + R.word3=cultwords["self"] + R.loc = user.loc + R.check_icon() + if("tear in reality") + R.word1=cultwords["hell"] + R.word2=cultwords["join"] + R.word3=cultwords["self"] + R.loc = user.loc + R.check_icon() + if("emp") + R.word1=cultwords["destroy"] + R.word2=cultwords["see"] + R.word3=cultwords["technology"] + R.loc = user.loc + R.check_icon() + if("drain") + R.word1=cultwords["travel"] + R.word2=cultwords["blood"] + R.word3=cultwords["self"] + R.loc = user.loc + R.check_icon() + if("seer") + R.word1=cultwords["see"] + R.word2=cultwords["hell"] + R.word3=cultwords["join"] + R.loc = user.loc + R.check_icon() + if("raise") + R.word1=cultwords["blood"] + R.word2=cultwords["join"] + R.word3=cultwords["hell"] + R.loc = user.loc + R.check_icon() + if("obscure") + R.word1=cultwords["hide"] + R.word2=cultwords["see"] + R.word3=cultwords["blood"] + R.loc = user.loc + R.check_icon() + if("astral journey") + R.word1=cultwords["hell"] + R.word2=cultwords["travel"] + R.word3=cultwords["self"] + R.loc = user.loc + R.check_icon() + if("manifest") + R.word1=cultwords["blood"] + R.word2=cultwords["see"] + R.word3=cultwords["travel"] + R.loc = user.loc + R.check_icon() + if("imbue talisman") + R.word1=cultwords["hell"] + R.word2=cultwords["technology"] + R.word3=cultwords["join"] + R.loc = user.loc + R.check_icon() + if("sacrifice") + R.word1=cultwords["hell"] + R.word2=cultwords["blood"] + R.word3=cultwords["join"] + R.loc = user.loc + R.check_icon() + if("reveal") + R.word1=cultwords["blood"] + R.word2=cultwords["see"] + R.word3=cultwords["hide"] + R.loc = user.loc + R.check_icon() + if("wall") + R.word1=cultwords["destroy"] + R.word2=cultwords["travel"] + R.word3=cultwords["self"] + R.loc = user.loc + R.check_icon() + if("freedom") + R.word1=cultwords["travel"] + R.word2=cultwords["technology"] + R.word3=cultwords["other"] + R.loc = user.loc + R.check_icon() + if("cultsummon") + R.word1=cultwords["join"] + R.word2=cultwords["other"] + R.word3=cultwords["self"] + R.loc = user.loc + R.check_icon() + if("deafen") + R.word1=cultwords["hide"] + R.word2=cultwords["other"] + R.word3=cultwords["see"] + R.loc = user.loc + R.check_icon() + if("blind") + R.word1=cultwords["destroy"] + R.word2=cultwords["see"] + R.word3=cultwords["other"] + R.loc = user.loc + R.check_icon() + if("bloodboil") + R.word1=cultwords["destroy"] + R.word2=cultwords["see"] + R.word3=cultwords["blood"] + R.loc = user.loc + R.check_icon() + if("communicate") + R.word1=cultwords["self"] + R.word2=cultwords["other"] + R.word3=cultwords["technology"] + R.loc = user.loc + R.check_icon() + if("stun") + R.word1=cultwords["join"] + R.word2=cultwords["hide"] + R.word3=cultwords["technology"] + R.loc = user.loc + R.check_icon() diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 44f743f122..7526cecad5 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -3,8 +3,6 @@ var/list/sacrificed = list() /obj/effect/rune/cultify() return -/obj/effect/rune - /* * Use as a general guideline for this and related files: * * ... - when something non-trivial or an error happens, so something similar to "Sparks come out of the machine!" @@ -14,285 +12,278 @@ var/list/sacrificed = list() /////////////////////////////////////////FIRST RUNE - proc - teleport(var/key) - var/mob/living/user = usr - var/allrunesloc[] - allrunesloc = new/list() - var/index = 0 - // var/tempnum = 0 - for(var/obj/effect/rune/R in rune_list) - if(R == src) - continue - if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z)) - index++ - allrunesloc.len = index - allrunesloc[index] = R.loc - if(index >= 5) - to_chat(user, "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric.") - if (istype(user, /mob/living)) - user.take_overall_damage(5, 0) - qdel(src) - if(allrunesloc && index != 0) - if(istype(src,/obj/effect/rune)) - user.say("Sas[pick("'","`")]so c'arta forbici!")//Only you can stop auto-muting - else - user.whisper("Sas[pick("'","`")]so c'arta forbici!") - user.visible_message("[user] disappears in a flash of red light!", \ - "You feel as your body gets dragged through the dimension of Nar-Sie!", \ - "You hear a sickening crunch and sloshing of viscera.") - user.loc = allrunesloc[rand(1,index)] - return - if(istype(src,/obj/effect/rune)) - return fizzle() //Use friggin manuals, Dorf, your list was of zero length. - else - call(/obj/effect/rune/proc/fizzle)() - return +/obj/effect/rune/proc/teleport(var/key) + var/mob/living/user = usr + var/allrunesloc[] + allrunesloc = new/list() + var/index = 0 + for(var/obj/effect/rune/R in rune_list) + if(R == src) + continue + if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z)) + index++ + allrunesloc.len = index + allrunesloc[index] = R.loc + if(index >= 5) + to_chat(user, "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric.") + if (istype(user, /mob/living)) + user.take_overall_damage(5, 0) + qdel(src) + if(allrunesloc && index != 0) + if(istype(src,/obj/effect/rune)) + user.say("Sas[pick("'","`")]so c'arta forbici!")//Only you can stop auto-muting + else + user.whisper("Sas[pick("'","`")]so c'arta forbici!") + user.visible_message("[user] disappears in a flash of red light!", \ + "You feel as your body gets dragged through the dimension of Nar-Sie!", \ + "You hear a sickening crunch and sloshing of viscera.") + user.loc = allrunesloc[rand(1,index)] + return + if(istype(src,/obj/effect/rune)) + return fizzle() //Use friggin manuals, Dorf, your list was of zero length. + else + call(/obj/effect/rune/proc/fizzle)() + return - itemport(var/key) -// var/allrunesloc[] -// allrunesloc = new/list() -// var/index = 0 - // var/tempnum = 0 - var/culcount = 0 - var/runecount = 0 - var/obj/effect/rune/IP = null - var/mob/living/user = usr - for(var/obj/effect/rune/R in rune_list) - if(R == src) - continue - if(R.word1 == cultwords["travel"] && R.word2 == cultwords["other"] && R.word3 == key) - IP = R - runecount++ - if(runecount >= 2) - to_chat(user, "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric.") - if (istype(user, /mob/living)) - user.take_overall_damage(5, 0) - qdel(src) - for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C) && !C.stat) - culcount++ - if(culcount>=3) - user.say("Sas[pick("'","`")]so c'arta forbici tarem!") - user.visible_message("You feel air moving from the rune - like as it was swapped with somewhere else.", \ - "You feel air moving from the rune - like as it was swapped with somewhere else.", \ - "You smell ozone.") - for(var/obj/O in src.loc) - if(!O.anchored) - O.loc = IP.loc - for(var/mob/M in src.loc) - M.loc = IP.loc - return +/obj/effect/rune/proc/itemport(var/key) + var/culcount = 0 + var/runecount = 0 + var/obj/effect/rune/IP = null + var/mob/living/user = usr + for(var/obj/effect/rune/R in rune_list) + if(R == src) + continue + if(R.word1 == cultwords["travel"] && R.word2 == cultwords["other"] && R.word3 == key) + IP = R + runecount++ + if(runecount >= 2) + to_chat(user, "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric.") + if (istype(user, /mob/living)) + user.take_overall_damage(5, 0) + qdel(src) + for(var/mob/living/carbon/C in orange(1,src)) + if(iscultist(C) && !C.stat) + culcount++ + if(culcount>=3) + user.say("Sas[pick("'","`")]so c'arta forbici tarem!") + user.visible_message("You feel air moving from the rune - like as it was swapped with somewhere else.", \ + "You feel air moving from the rune - like as it was swapped with somewhere else.", \ + "You smell ozone.") + for(var/obj/O in src.loc) + if(!O.anchored) + O.loc = IP.loc + for(var/mob/M in src.loc) + M.loc = IP.loc + return - return fizzle() + return fizzle() /////////////////////////////////////////SECOND RUNE - tomesummon() - if(istype(src,/obj/effect/rune)) - usr.say("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") - else - usr.whisper("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") - usr.visible_message("Rune disappears with a flash of red light, and in its place now a book lies.", \ - "You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a book.", \ - "You hear a pop and smell ozone.") - if(istype(src,/obj/effect/rune)) - new /obj/item/weapon/book/tome(src.loc) - else - new /obj/item/weapon/book/tome(usr.loc) - qdel(src) - return +/obj/effect/rune/proc/tomesummon() + if(istype(src,/obj/effect/rune)) + usr.say("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") + else + usr.whisper("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") + usr.visible_message("Rune disappears with a flash of red light, and in its place now a book lies.", \ + "You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a book.", \ + "You hear a pop and smell ozone.") + if(istype(src,/obj/effect/rune)) + new /obj/item/weapon/book/tome(src.loc) + else + new /obj/item/weapon/book/tome(usr.loc) + qdel(src) + return /////////////////////////////////////////THIRD RUNE - convert() - var/mob/attacker = usr - var/mob/living/carbon/target = null - for(var/mob/living/carbon/M in src.loc) - if(!iscultist(M) && M.stat < DEAD && !(M in converting)) - target = M - break +/obj/effect/rune/proc/convert() + var/mob/attacker = usr + var/mob/living/carbon/target = null + for(var/mob/living/carbon/M in src.loc) + if(!iscultist(M) && M.stat < DEAD && !(M in converting)) + target = M + break - if(!target) //didn't find any new targets - if(!converting.len) - fizzle() - else - to_chat(usr, "You sense that the power of the dark one is already working away at them.") - return + if(!target) //didn't find any new targets + if(!converting.len) + fizzle() + else + to_chat(usr, "You sense that the power of the dark one is already working away at them.") + return - usr.say("Mah[pick("'","`")]weyh pleggh at e'ntrath!") + usr.say("Mah[pick("'","`")]weyh pleggh at e'ntrath!") - converting |= target - var/list/waiting_for_input = list(target = 0) //need to box this up in order to be able to reset it again from inside spawn, apparently - var/initial_message = 0 - while(target in converting) - if(target.loc != src.loc || target.stat == DEAD) + converting |= target + var/list/waiting_for_input = list(target = 0) //need to box this up in order to be able to reset it again from inside spawn, apparently + var/initial_message = 0 + while(target in converting) + if(target.loc != src.loc || target.stat == DEAD) + converting -= target + if(target.getFireLoss() < 100) + target.hallucination = min(target.hallucination, 500) + return 0 + + target.take_overall_damage(0, rand(5, 20)) // You dirty resister cannot handle the damage to your mind. Easily. - even cultists who accept right away should experience some effects + // Resist messages go! + if(initial_message) //don't do this stuff right away, only if they resist or hesitate. + add_attack_logs(attacker,target,"Convert rune") + switch(target.getFireLoss()) + if(0 to 25) + to_chat(target, "Your blood boils as you force yourself to resist the corruption invading every corner of your mind.") + if(25 to 45) + to_chat(target, "Your blood boils and your body burns as the corruption further forces itself into your body and mind.") + if(45 to 75) + to_chat(target, "You begin to hallucinate images of a dark and incomprehensible being and your entire body feels like its engulfed in flame as your mental defenses crumble.") + target.apply_effect(rand(1,10), STUTTER) + if(75 to 100) + to_chat(target, "Your mind turns to ash as the burning flames engulf your very soul and images of an unspeakable horror begin to bombard the last remnants of mental resistance.") + //broken mind - 5000 may seem like a lot I wanted the effect to really stand out for maxiumum losing-your-mind-spooky + //hallucination is reduced when the step off as well, provided they haven't hit the last stage... + + //5000 is waaaay too much, in practice. + target.hallucination = min(target.hallucination + 100, 500) + target.apply_effect(10, STUTTER) + target.adjustBrainLoss(1) + if(100 to INFINITY) + to_chat(target, "Your entire broken soul and being is engulfed in corruption and flames as your mind shatters away into nothing.") + //5000 is waaaay too much, in practice. + target.hallucination = min(target.hallucination + 100, 500) + target.apply_effect(15, STUTTER) + target.adjustBrainLoss(1) + + initial_message = 1 + if (!target.can_feel_pain()) + target.visible_message("The markings below \the [target] glow a bloody red.") + else + var/datum/gender/TT = gender_datums[target.get_visible_gender()] + target.visible_message("[target] writhes in pain as the markings below [TT.him] glow a bloody red.", "AAAAAAHHHH!", "You hear an anguished scream.") + + if(!waiting_for_input[target]) //so we don't spam them with dialogs if they hesitate + waiting_for_input[target] = 1 + + if(!cult.can_become_antag(target.mind) || jobban_isbanned(target, "cultist"))//putting jobban check here because is_convertable uses mind as argument + //waiting_for_input ensures this is only shown once, so they basically auto-resist from here on out. They still need to find a way to get off the freaking rune if they don't want to burn to death, though. + to_chat(target, "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.") + to_chat(target, "And you were able to force it out of your mind. You now know the truth, there's something horrible out there, stop it and its minions at all costs.") + + else spawn() + var/choice = alert(target,"Do you want to join the cult?","Submit to Nar'Sie","Resist","Submit") + waiting_for_input[target] = 0 + if(choice == "Submit") //choosing 'Resist' does nothing of course. + cult.add_antagonist(target.mind) converting -= target - if(target.getFireLoss() < 100) - target.hallucination = min(target.hallucination, 500) - return 0 + target.hallucination = 0 //sudden clarity - target.take_overall_damage(0, rand(5, 20)) // You dirty resister cannot handle the damage to your mind. Easily. - even cultists who accept right away should experience some effects - // Resist messages go! - if(initial_message) //don't do this stuff right away, only if they resist or hesitate. - add_attack_logs(attacker,target,"Convert rune") - switch(target.getFireLoss()) - if(0 to 25) - to_chat(target, "Your blood boils as you force yourself to resist the corruption invading every corner of your mind.") - if(25 to 45) - to_chat(target, "Your blood boils and your body burns as the corruption further forces itself into your body and mind.") - if(45 to 75) - to_chat(target, "You begin to hallucinate images of a dark and incomprehensible being and your entire body feels like its engulfed in flame as your mental defenses crumble.") - target.apply_effect(rand(1,10), STUTTER) - if(75 to 100) - to_chat(target, "Your mind turns to ash as the burning flames engulf your very soul and images of an unspeakable horror begin to bombard the last remnants of mental resistance.") - //broken mind - 5000 may seem like a lot I wanted the effect to really stand out for maxiumum losing-your-mind-spooky - //hallucination is reduced when the step off as well, provided they haven't hit the last stage... - - //5000 is waaaay too much, in practice. - target.hallucination = min(target.hallucination + 100, 500) - target.apply_effect(10, STUTTER) - target.adjustBrainLoss(1) - if(100 to INFINITY) - to_chat(target, "Your entire broken soul and being is engulfed in corruption and flames as your mind shatters away into nothing.") - //5000 is waaaay too much, in practice. - target.hallucination = min(target.hallucination + 100, 500) - target.apply_effect(15, STUTTER) - target.adjustBrainLoss(1) - - initial_message = 1 - if (!target.can_feel_pain()) - target.visible_message("The markings below \the [target] glow a bloody red.") - else - var/datum/gender/TT = gender_datums[target.get_visible_gender()] - target.visible_message("[target] writhes in pain as the markings below [TT.him] glow a bloody red.", "AAAAAAHHHH!", "You hear an anguished scream.") - - if(!waiting_for_input[target]) //so we don't spam them with dialogs if they hesitate - waiting_for_input[target] = 1 - - if(!cult.can_become_antag(target.mind) || jobban_isbanned(target, "cultist"))//putting jobban check here because is_convertable uses mind as argument - //waiting_for_input ensures this is only shown once, so they basically auto-resist from here on out. They still need to find a way to get off the freaking rune if they don't want to burn to death, though. - to_chat(target, "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.") - to_chat(target, "And you were able to force it out of your mind. You now know the truth, there's something horrible out there, stop it and its minions at all costs.") - - else spawn() - var/choice = alert(target,"Do you want to join the cult?","Submit to Nar'Sie","Resist","Submit") - waiting_for_input[target] = 0 - if(choice == "Submit") //choosing 'Resist' does nothing of course. - cult.add_antagonist(target.mind) - converting -= target - target.hallucination = 0 //sudden clarity - - sleep(100) //proc once every 10 seconds - return 1 + sleep(100) //proc once every 10 seconds + return 1 /////////////////////////////////////////FOURTH RUNE - tearreality() - if(!cult.allow_narsie) - return fizzle() +/obj/effect/rune/proc/tearreality() + if(!cult.allow_narsie) + return fizzle() - var/list/cultists = new() - for(var/mob/M in range(1,src)) - if(iscultist(M) && !M.stat) - M.say("Tok-lyr rqa'nap g[pick("'","`")]lt-ulotf!") - if(istype(M, /mob/living/carbon/human/dummy)) //No manifest cheese. - continue - cultists.Add(M) - if(cultists.len >= 9) - if(!narsie_cometh)//so we don't initiate Hell more than one time. - to_world("THE VEIL HAS BEEN SHATTERED!") - world << sound('sound/effects/weather/wind/wind_5_1.ogg') + var/list/cultists = new() + for(var/mob/M in range(1,src)) + if(iscultist(M) && !M.stat) + M.say("Tok-lyr rqa'nap g[pick("'","`")]lt-ulotf!") + if(istype(M, /mob/living/carbon/human/dummy)) //No manifest cheese. + continue + cultists.Add(M) + if(cultists.len >= 9) + if(!narsie_cometh)//so we don't initiate Hell more than one time. + to_world("THE VEIL HAS BEEN SHATTERED!") + world << sound('sound/effects/weather/wind/wind_5_1.ogg') - SetUniversalState(/datum/universal_state/hell) - narsie_cometh = 1 + SetUniversalState(/datum/universal_state/hell) + narsie_cometh = 1 - spawn(10 SECONDS) - if(emergency_shuttle) - emergency_shuttle.call_evac() - emergency_shuttle.launch_time = 0 // Cannot recall + spawn(10 SECONDS) + if(emergency_shuttle) + emergency_shuttle.call_evac() + emergency_shuttle.launch_time = 0 // Cannot recall - log_and_message_admins_many(cultists, "summoned the end of days.") -// new /obj/singularity/narsie/large(src.loc) - return - else - return fizzle() + log_and_message_admins_many(cultists, "summoned the end of days.") + return + else + return fizzle() /////////////////////////////////////////FIFTH RUNE - emp(var/U,var/range_red) //range_red - var which determines by which number to reduce the default emp range, U is the source loc, needed because of talisman emps which are held in hand at the moment of using and that apparently messes things up -- Urist - log_and_message_admins("activated an EMP rune.") - if(istype(src,/obj/effect/rune)) - usr.say("Ta'gh fara[pick("'","`")]qha fel d'amar det!") - else - usr.whisper("Ta'gh fara[pick("'","`")]qha fel d'amar det!") - playsound(U, 'sound/items/Welder2.ogg', 25, 1) - var/turf/T = get_turf(U) - if(T) - T.hotspot_expose(700,125) - var/rune = src // detaching the proc - in theory - empulse(U, (range_red - 3), (range_red - 2), (range_red - 1), range_red) - qdel(rune) - return +/obj/effect/rune/proc/emp(var/U,var/range_red) //range_red - var which determines by which number to reduce the default emp range, U is the source loc, needed because of talisman emps which are held in hand at the moment of using and that apparently messes things up -- Urist + log_and_message_admins("activated an EMP rune.") + if(istype(src,/obj/effect/rune)) + usr.say("Ta'gh fara[pick("'","`")]qha fel d'amar det!") + else + usr.whisper("Ta'gh fara[pick("'","`")]qha fel d'amar det!") + playsound(U, 'sound/items/Welder2.ogg', 25, 1) + var/turf/T = get_turf(U) + if(T) + T.hotspot_expose(700,125) + var/rune = src // detaching the proc - in theory + empulse(U, (range_red - 3), (range_red - 2), (range_red - 1), range_red) + qdel(rune) + return /////////////////////////////////////////SIXTH RUNE - drain() - var/drain = 0 - for(var/obj/effect/rune/R in rune_list) - if(R.word1==cultwords["travel"] && R.word2==cultwords["blood"] && R.word3==cultwords["self"]) - for(var/mob/living/carbon/D in R.loc) - if(D.stat!=2) - add_attack_logs(usr,D,"Blood drain rune") - var/bdrain = rand(1,25) - to_chat(D, "You feel weakened.") - D.take_overall_damage(bdrain, 0) - drain += bdrain - if(!drain) - return fizzle() - usr.say ("Yu[pick("'","`")]gular faras desdae. Havas mithum javara. Umathar uf'kal thenar!") - usr.visible_message("Blood flows from the rune into [usr]!", \ - "The blood starts flowing from the rune and into your frail mortal body. You feel... empowered.", \ - "You hear a liquid flowing.") - var/mob/living/user = usr - if(user.bhunger) - user.bhunger = max(user.bhunger-2*drain,0) - if(drain>=50) - user.visible_message("[user]'s eyes give off eerie red glow!", \ - "...but it wasn't nearly enough. You crave, crave for more. The hunger consumes you from within.", \ - "You hear a heartbeat.") - user.bhunger += drain - src = user - spawn() - for (,user.bhunger>0,user.bhunger--) - sleep(50) - user.take_overall_damage(3, 0) - return - user.heal_organ_damage(drain%5, 0) - drain-=drain%5 - for (,drain>0,drain-=5) - sleep(2) - user.heal_organ_damage(5, 0) - if(ishuman(user)) - var/mob/living/carbon/human/H = user - for(var/obj/item/organ/I in H.internal_organs) - if(I.damage > 0) - I.damage = max(I.damage - 5, 0) //Heals 5 damage per organ per use - if(I.damage <= 5 && I.organ_tag == O_EYES) - H.sdisabilities &= ~BLIND - for(var/obj/item/organ/E in H.bad_external_organs) - var/obj/item/organ/external/affected = E - if((affected.damage < affected.min_broken_damage * config.organ_health_multiplier) && (affected.status & ORGAN_BROKEN)) - affected.status &= ~ORGAN_BROKEN - for(var/datum/wound/W in affected.wounds) - if(istype(W, /datum/wound/internal_bleeding)) - affected.wounds -= W - affected.update_damages() - return +/obj/effect/rune/proc/drain() + var/drain = 0 + for(var/obj/effect/rune/R in rune_list) + if(R.word1==cultwords["travel"] && R.word2==cultwords["blood"] && R.word3==cultwords["self"]) + for(var/mob/living/carbon/D in R.loc) + if(D.stat!=2) + add_attack_logs(usr,D,"Blood drain rune") + var/bdrain = rand(1,25) + to_chat(D, "You feel weakened.") + D.take_overall_damage(bdrain, 0) + drain += bdrain + if(!drain) + return fizzle() + usr.say ("Yu[pick("'","`")]gular faras desdae. Havas mithum javara. Umathar uf'kal thenar!") + usr.visible_message("Blood flows from the rune into [usr]!", \ + "The blood starts flowing from the rune and into your frail mortal body. You feel... empowered.", \ + "You hear a liquid flowing.") + var/mob/living/user = usr + if(user.bhunger) + user.bhunger = max(user.bhunger-2*drain,0) + if(drain>=50) + user.visible_message("[user]'s eyes give off eerie red glow!", \ + "...but it wasn't nearly enough. You crave, crave for more. The hunger consumes you from within.", \ + "You hear a heartbeat.") + user.bhunger += drain + src = user + spawn() + for (,user.bhunger>0,user.bhunger--) + sleep(50) + user.take_overall_damage(3, 0) + return + user.heal_organ_damage(drain%5, 0) + drain-=drain%5 + for (,drain>0,drain-=5) + sleep(2) + user.heal_organ_damage(5, 0) + if(ishuman(user)) + var/mob/living/carbon/human/H = user + for(var/obj/item/organ/I in H.internal_organs) + if(I.damage > 0) + I.damage = max(I.damage - 5, 0) //Heals 5 damage per organ per use + if(I.damage <= 5 && I.organ_tag == O_EYES) + H.sdisabilities &= ~BLIND + for(var/obj/item/organ/E in H.bad_external_organs) + var/obj/item/organ/external/affected = E + if((affected.damage < affected.min_broken_damage * config.organ_health_multiplier) && (affected.status & ORGAN_BROKEN)) + affected.status &= ~ORGAN_BROKEN + for(var/datum/wound/W in affected.wounds) + if(istype(W, /datum/wound/internal_bleeding)) + affected.wounds -= W + affected.update_damages() + return @@ -301,104 +292,99 @@ var/list/sacrificed = list() /////////////////////////////////////////SEVENTH RUNE - seer() - if(usr.loc==src.loc) - if(usr.seer==1) - usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium viortia.") - to_chat(usr, "The world beyond fades from your vision.") - usr.see_invisible = SEE_INVISIBLE_LIVING - usr.seer = 0 - else if(usr.see_invisible!=SEE_INVISIBLE_LIVING) - to_chat(usr, "The world beyond flashes your eyes but disappears quickly, as if something is disrupting your vision.") - usr.see_invisible = SEE_INVISIBLE_CULT - usr.seer = 0 - else - usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium vivira. Itonis al'ra matum!") - to_chat(usr, "The world beyond opens to your eyes.") - usr.see_invisible = SEE_INVISIBLE_CULT - usr.seer = 1 - return - return fizzle() +/obj/effect/rune/proc/seer() + if(usr.loc==src.loc) + if(usr.seer==1) + usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium viortia.") + to_chat(usr, "The world beyond fades from your vision.") + usr.see_invisible = SEE_INVISIBLE_LIVING + usr.seer = 0 + else if(usr.see_invisible!=SEE_INVISIBLE_LIVING) + to_chat(usr, "The world beyond flashes your eyes but disappears quickly, as if something is disrupting your vision.") + usr.see_invisible = SEE_INVISIBLE_CULT + usr.seer = 0 + else + usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium vivira. Itonis al'ra matum!") + to_chat(usr, "The world beyond opens to your eyes.") + usr.see_invisible = SEE_INVISIBLE_CULT + usr.seer = 1 + return + return fizzle() /////////////////////////////////////////EIGHTH RUNE - raise() - var/mob/living/carbon/human/corpse_to_raise - var/mob/living/carbon/human/body_to_sacrifice +/obj/effect/rune/proc/raise() + var/mob/living/carbon/human/corpse_to_raise + var/mob/living/carbon/human/body_to_sacrifice - var/is_sacrifice_target = 0 - for(var/mob/living/carbon/human/M in src.loc) - if(M.stat == DEAD) - if(cult && M.mind == cult.sacrifice_target) + var/is_sacrifice_target = 0 + for(var/mob/living/carbon/human/M in src.loc) + if(M.stat == DEAD) + if(cult && M.mind == cult.sacrifice_target) + is_sacrifice_target = 1 + else + corpse_to_raise = M + break + + if(!corpse_to_raise) + if(is_sacrifice_target) + to_chat(usr, "The Geometer of blood wants this mortal for himself.") + return fizzle() + + + is_sacrifice_target = 0 + find_sacrifice: + for(var/obj/effect/rune/R in rune_list) + if(R.word1==cultwords["blood"] && R.word2==cultwords["join"] && R.word3==cultwords["hell"]) + for(var/mob/living/carbon/human/N in R.loc) + if(cult && N.mind && N.mind == cult.sacrifice_target) is_sacrifice_target = 1 else - corpse_to_raise = M - break + if(N.stat!= DEAD) + body_to_sacrifice = N + break find_sacrifice - if(!corpse_to_raise) - if(is_sacrifice_target) - to_chat(usr, "The Geometer of blood wants this mortal for himself.") - return fizzle() + if(!body_to_sacrifice) + if (is_sacrifice_target) + to_chat(usr, "The Geometer of Blood wants that corpse for himself.") + else + to_chat(usr, "The sacrifical corpse is not dead. You must free it from this world of illusions before it may be used.") + return fizzle() + if(!cult.can_become_antag(corpse_to_raise.mind) || jobban_isbanned(corpse_to_raise, "cultist")) + to_chat(usr, "The Geometer of Blood refuses to touch this one.") + return fizzle() + else if(!corpse_to_raise.client && corpse_to_raise.mind) //Don't force the dead person to come back if they don't want to. + for(var/mob/observer/dead/ghost in player_list) + if(ghost.mind == corpse_to_raise.mind) + to_chat(ghost, "The cultist [usr.real_name] is trying to \ + revive you. Return to your body if you want to be resurrected into the service of Nar'Sie! \ + (Verbs -> Ghost -> Re-enter corpse)") + break - is_sacrifice_target = 0 - find_sacrifice: - for(var/obj/effect/rune/R in rune_list) - if(R.word1==cultwords["blood"] && R.word2==cultwords["join"] && R.word3==cultwords["hell"]) - for(var/mob/living/carbon/human/N in R.loc) - if(cult && N.mind && N.mind == cult.sacrifice_target) - is_sacrifice_target = 1 - else - if(N.stat!= DEAD) - body_to_sacrifice = N - break find_sacrifice + sleep(10 SECONDS) - if(!body_to_sacrifice) - if (is_sacrifice_target) - to_chat(usr, "The Geometer of Blood wants that corpse for himself.") - else - to_chat(usr, "The sacrifical corpse is not dead. You must free it from this world of illusions before it may be used.") - return fizzle() + if(corpse_to_raise.client) - if(!cult.can_become_antag(corpse_to_raise.mind) || jobban_isbanned(corpse_to_raise, "cultist")) - to_chat(usr, "The Geometer of Blood refuses to touch this one.") - return fizzle() - else if(!corpse_to_raise.client && corpse_to_raise.mind) //Don't force the dead person to come back if they don't want to. - for(var/mob/observer/dead/ghost in player_list) - if(ghost.mind == corpse_to_raise.mind) - to_chat(ghost, "The cultist [usr.real_name] is trying to \ - revive you. Return to your body if you want to be resurrected into the service of Nar'Sie! \ - (Verbs -> Ghost -> Re-enter corpse)") - break + var/datum/gender/TU = gender_datums[corpse_to_raise.get_visible_gender()] + var/datum/gender/TT = gender_datums[body_to_sacrifice.get_visible_gender()] - sleep(10 SECONDS) + cult.add_antagonist(corpse_to_raise.mind) + corpse_to_raise.revive() - if(corpse_to_raise.client) + usr.say("Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!") + corpse_to_raise.visible_message("[corpse_to_raise]'s eyes glow with a faint red as [TU.he] stand[TU.s] up, slowly starting to breathe again.", \ + "Life... I'm alive again...", \ + "You hear a faint, slightly familiar whisper.") + body_to_sacrifice.visible_message("[body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from [TT.his] remains!", \ + "You feel as your blood boils, tearing you apart.", \ + "You hear a thousand voices, all crying in pain.") + body_to_sacrifice.gib() - var/datum/gender/TU = gender_datums[corpse_to_raise.get_visible_gender()] - var/datum/gender/TT = gender_datums[body_to_sacrifice.get_visible_gender()] + to_chat(corpse_to_raise, "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.") + to_chat(corpse_to_raise, "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.") - cult.add_antagonist(corpse_to_raise.mind) - corpse_to_raise.revive() - - usr.say("Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!") - corpse_to_raise.visible_message("[corpse_to_raise]'s eyes glow with a faint red as [TU.he] stand[TU.s] up, slowly starting to breathe again.", \ - "Life... I'm alive again...", \ - "You hear a faint, slightly familiar whisper.") - body_to_sacrifice.visible_message("[body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from [TT.his] remains!", \ - "You feel as your blood boils, tearing you apart.", \ - "You hear a thousand voices, all crying in pain.") - body_to_sacrifice.gib() - -// if(ticker.mode.name == "cult") -// ticker.mode:add_cultist(corpse_to_raise.mind) -// else -// ticker.mode.cult |= corpse_to_raise.mind - - to_chat(corpse_to_raise, "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.") - to_chat(corpse_to_raise, "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.") - - return + return @@ -406,114 +392,114 @@ var/list/sacrificed = list() /////////////////////////////////////////NINETH RUNE - obscure(var/rad) - var/S=0 - for(var/obj/effect/rune/R in orange(rad,src)) - if(R!=src) - R.invisibility=INVISIBILITY_OBSERVER - S=1 - if(S) - if(istype(src,/obj/effect/rune)) - usr.say("Kla[pick("'","`")]atu barada nikt'o!") - for (var/mob/V in viewers(src)) - V.show_message("The rune turns into gray dust, veiling the surrounding runes.", 3) - qdel(src) - else - usr.whisper("Kla[pick("'","`")]atu barada nikt'o!") - to_chat(usr, "Your talisman turns into gray dust, veiling the surrounding runes.") - for (var/mob/V in orange(1,src)) - if(V!=usr) - V.show_message("Dust emanates from [usr]'s hands for a moment.", 3) +/obj/effect/rune/proc/obscure(var/rad) + var/S=0 + for(var/obj/effect/rune/R in orange(rad,src)) + if(R!=src) + R.invisibility=INVISIBILITY_OBSERVER + S=1 + if(S) + if(istype(src,/obj/effect/rune)) + usr.say("Kla[pick("'","`")]atu barada nikt'o!") + for (var/mob/V in viewers(src)) + V.show_message("The rune turns into gray dust, veiling the surrounding runes.", 3) + qdel(src) + else + usr.whisper("Kla[pick("'","`")]atu barada nikt'o!") + to_chat(usr, "Your talisman turns into gray dust, veiling the surrounding runes.") + for (var/mob/V in orange(1,src)) + if(V!=usr) + V.show_message("Dust emanates from [usr]'s hands for a moment.", 3) - return - if(istype(src,/obj/effect/rune)) - return fizzle() - else - call(/obj/effect/rune/proc/fizzle)() - return + return + if(istype(src,/obj/effect/rune)) + return fizzle() + else + call(/obj/effect/rune/proc/fizzle)() + return /////////////////////////////////////////TENTH RUNE - ajourney() //some bits copypastaed from admin tools - Urist - if(usr.loc==src.loc) - var/mob/living/carbon/human/L = usr - var/datum/gender/TU = gender_datums[L.get_visible_gender()] - usr.say("Fwe[pick("'","`")]sh mah erl nyag r'ya!") - usr.visible_message("[usr]'s eyes glow blue as [TU.he] freeze[TU.s] in place, absolutely motionless.", \ - "The shadow that is your spirit separates itself from your body. You are now in the realm beyond. While this is a great sight, being here strains your mind and body. Hurry...", \ - "You hear only complete silence for a moment.") - announce_ghost_joinleave(usr.ghostize(1), 1, "You feel that they had to use some [pick("dark", "black", "blood", "forgotten", "forbidden")] magic to [pick("invade","disturb","disrupt","infest","taint","spoil","blight")] this place!") - L.ajourn = 1 - while(L) - if(L.key) - L.ajourn=0 - return - else - L.take_organ_damage(3, 0) - sleep(100) - return fizzle() +/obj/effect/rune/proc/ajourney() //some bits copypastaed from admin tools - Urist + if(usr.loc==src.loc) + var/mob/living/carbon/human/L = usr + var/datum/gender/TU = gender_datums[L.get_visible_gender()] + usr.say("Fwe[pick("'","`")]sh mah erl nyag r'ya!") + usr.visible_message("[usr]'s eyes glow blue as [TU.he] freeze[TU.s] in place, absolutely motionless.", \ + "The shadow that is your spirit separates itself from your body. You are now in the realm beyond. While this is a great sight, being here strains your mind and body. Hurry...", \ + "You hear only complete silence for a moment.") + announce_ghost_joinleave(usr.ghostize(1), 1, "You feel that they had to use some [pick("dark", "black", "blood", "forgotten", "forbidden")] magic to [pick("invade","disturb","disrupt","infest","taint","spoil","blight")] this place!") + L.ajourn = 1 + while(L) + if(L.key) + L.ajourn=0 + return + else + L.take_organ_damage(3, 0) + sleep(100) + return fizzle() /////////////////////////////////////////ELEVENTH RUNE - manifest() - var/obj/effect/rune/this_rune = src - src = null - if(usr.loc!=this_rune.loc) - return this_rune.fizzle() - var/mob/observer/dead/ghost - for(var/mob/observer/dead/O in this_rune.loc) - if(!O.client) continue - if(!O.MayRespawn()) continue - if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue - if(!(O.client.prefs.be_special & BE_CULTIST)) continue - ghost = O - break - if(!ghost) - return this_rune.fizzle() - if(jobban_isbanned(ghost, "cultist")) - return this_rune.fizzle() +/obj/effect/rune/proc/manifest() + var/obj/effect/rune/this_rune = src + src = null + if(usr.loc!=this_rune.loc) + return this_rune.fizzle() + var/mob/observer/dead/ghost + for(var/mob/observer/dead/O in this_rune.loc) + if(!O.client) continue + if(!O.MayRespawn()) continue + if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue + if(!(O.client.prefs.be_special & BE_CULTIST)) continue + ghost = O + break + if(!ghost) + return this_rune.fizzle() + if(jobban_isbanned(ghost, "cultist")) + return this_rune.fizzle() - usr.say("Gal'h'rfikk harfrandid mud[pick("'","`")]gib!") - var/mob/living/carbon/human/dummy/D = new(this_rune.loc) - usr.visible_message("A shape forms in the center of the rune. A shape of... a man.", \ - "A shape forms in the center of the rune. A shape of... a man.", \ - "You hear liquid flowing.") - D.real_name = "Unknown" - var/chose_name = 0 - for(var/obj/item/weapon/paper/P in this_rune.loc) - if(P.info) - D.real_name = copytext(P.info, findtext(P.info,">")+1, findtext(P.info,"<",2) ) - chose_name = 1 - break - D.universal_speak = 1 - D.status_flags &= ~GODMODE - D.b_eyes = 200 - D.r_eyes = 200 - D.g_eyes = 200 - D.update_eyes() - D.all_underwear.Cut() - D.key = ghost.key - cult.add_antagonist(D.mind) + usr.say("Gal'h'rfikk harfrandid mud[pick("'","`")]gib!") + var/mob/living/carbon/human/dummy/D = new(this_rune.loc) + usr.visible_message("A shape forms in the center of the rune. A shape of... a man.", \ + "A shape forms in the center of the rune. A shape of... a man.", \ + "You hear liquid flowing.") + D.real_name = "Unknown" + var/chose_name = 0 + for(var/obj/item/weapon/paper/P in this_rune.loc) + if(P.info) + D.real_name = copytext(P.info, findtext(P.info,">")+1, findtext(P.info,"<",2) ) + chose_name = 1 + break + D.universal_speak = 1 + D.status_flags &= ~GODMODE + D.b_eyes = 200 + D.r_eyes = 200 + D.g_eyes = 200 + D.update_eyes() + D.all_underwear.Cut() + D.key = ghost.key + cult.add_antagonist(D.mind) - if(!chose_name) - D.real_name = pick("Anguished", "Blasphemous", "Corrupt", "Cruel", "Depraved", "Despicable", "Disturbed", "Exacerbated", "Foul", "Hateful", "Inexorable", "Implacable", "Impure", "Malevolent", "Malignant", "Malicious", "Pained", "Profane", "Profligate", "Relentless", "Resentful", "Restless", "Spiteful", "Tormented", "Unclean", "Unforgiving", "Vengeful", "Vindictive", "Wicked", "Wronged") - D.real_name += " " - D.real_name += pick("Apparition", "Aptrgangr", "Dis", "Draugr", "Dybbuk", "Eidolon", "Fetch", "Fylgja", "Ghast", "Ghost", "Gjenganger", "Haint", "Phantom", "Phantasm", "Poltergeist", "Revenant", "Shade", "Shadow", "Soul", "Spectre", "Spirit", "Spook", "Visitant", "Wraith") + if(!chose_name) + D.real_name = pick("Anguished", "Blasphemous", "Corrupt", "Cruel", "Depraved", "Despicable", "Disturbed", "Exacerbated", "Foul", "Hateful", "Inexorable", "Implacable", "Impure", "Malevolent", "Malignant", "Malicious", "Pained", "Profane", "Profligate", "Relentless", "Resentful", "Restless", "Spiteful", "Tormented", "Unclean", "Unforgiving", "Vengeful", "Vindictive", "Wicked", "Wronged") + D.real_name += " " + D.real_name += pick("Apparition", "Aptrgangr", "Dis", "Draugr", "Dybbuk", "Eidolon", "Fetch", "Fylgja", "Ghast", "Ghost", "Gjenganger", "Haint", "Phantom", "Phantasm", "Poltergeist", "Revenant", "Shade", "Shadow", "Soul", "Spectre", "Spirit", "Spook", "Visitant", "Wraith") - log_and_message_admins("used a manifest rune.") - var/mob/living/user = usr - while(this_rune && user && user.stat==CONSCIOUS && user.client && user.loc==this_rune.loc) - user.take_organ_damage(1, 0) - sleep(30) - if(D) - D.visible_message("[D] slowly dissipates into dust and bones.", \ - "You feel pain, as bonds formed between your soul and this homunculus break.", \ - "You hear faint rustle.") - D.dust() - return + log_and_message_admins("used a manifest rune.") + var/mob/living/user = usr + while(this_rune && user && user.stat==CONSCIOUS && user.client && user.loc==this_rune.loc) + user.take_organ_damage(1, 0) + sleep(30) + if(D) + D.visible_message("[D] slowly dissipates into dust and bones.", \ + "You feel pain, as bonds formed between your soul and this homunculus break.", \ + "You hear faint rustle.") + D.dust() + return @@ -521,617 +507,617 @@ var/list/sacrificed = list() /////////////////////////////////////////TWELFTH RUNE - talisman()//only hide, emp, teleport, deafen, blind and tome runes can be imbued atm - var/obj/item/weapon/paper/newtalisman - var/unsuitable_newtalisman = 0 - for(var/obj/item/weapon/paper/P in src.loc) - if(!P.info) - newtalisman = P - break - else - unsuitable_newtalisman = 1 - if (!newtalisman) - if (unsuitable_newtalisman) - to_chat(usr, "The blank is tainted. It is unsuitable.") - return fizzle() +/obj/effect/rune/proc/talisman()//only hide, emp, teleport, deafen, blind and tome runes can be imbued atm + var/obj/item/weapon/paper/newtalisman + var/unsuitable_newtalisman = 0 + for(var/obj/item/weapon/paper/P in src.loc) + if(!P.info) + newtalisman = P + break + else + unsuitable_newtalisman = 1 + if (!newtalisman) + if (unsuitable_newtalisman) + to_chat(usr, "The blank is tainted. It is unsuitable.") + return fizzle() - var/obj/effect/rune/imbued_from - var/obj/item/weapon/paper/talisman/T - for(var/obj/effect/rune/R in orange(1,src)) - if(R==src) - continue - if(R.word1==cultwords["travel"] && R.word2==cultwords["self"]) //teleport - T = new(src.loc) - T.imbue = "[R.word3]" - T.info = "[R.word3]" - imbued_from = R - break - if(R.word1==cultwords["see"] && R.word2==cultwords["blood"] && R.word3==cultwords["hell"]) //tome - T = new(src.loc) - T.imbue = "newtome" - imbued_from = R - break - if(R.word1==cultwords["destroy"] && R.word2==cultwords["see"] && R.word3==cultwords["technology"]) //emp - T = new(src.loc) - T.imbue = "emp" - imbued_from = R - break - if(R.word1==cultwords["blood"] && R.word2==cultwords["see"] && R.word3==cultwords["destroy"]) //conceal - T = new(src.loc) - T.imbue = "conceal" - imbued_from = R - break - if(R.word1==cultwords["hell"] && R.word2==cultwords["destroy"] && R.word3==cultwords["other"]) //armor - T = new(src.loc) - T.imbue = "armor" - imbued_from = R - break - if(R.word1==cultwords["blood"] && R.word2==cultwords["see"] && R.word3==cultwords["hide"]) //reveal - T = new(src.loc) - T.imbue = "revealrunes" - imbued_from = R - break - if(R.word1==cultwords["hide"] && R.word2==cultwords["other"] && R.word3==cultwords["see"]) //deafen - T = new(src.loc) - T.imbue = "deafen" - imbued_from = R - break - if(R.word1==cultwords["destroy"] && R.word2==cultwords["see"] && R.word3==cultwords["other"]) //blind - T = new(src.loc) - T.imbue = "blind" - imbued_from = R - break - if(R.word1==cultwords["self"] && R.word2==cultwords["other"] && R.word3==cultwords["technology"]) //communicat - T = new(src.loc) - T.imbue = "communicate" - imbued_from = R - break - if(R.word1==cultwords["join"] && R.word2==cultwords["hide"] && R.word3==cultwords["technology"]) //communicat - T = new(src.loc) - T.imbue = "runestun" - imbued_from = R - break - if (imbued_from) - for (var/mob/V in viewers(src)) - V.show_message("The runes turn into dust, which then forms into an arcane image on the paper.", 3) - usr.say("H'drak v[pick("'","`")]loso, mir'kanas verbot!") - qdel(imbued_from) - qdel(newtalisman) - else - return fizzle() + var/obj/effect/rune/imbued_from + var/obj/item/weapon/paper/talisman/T + for(var/obj/effect/rune/R in orange(1,src)) + if(R==src) + continue + if(R.word1==cultwords["travel"] && R.word2==cultwords["self"]) //teleport + T = new(src.loc) + T.imbue = "[R.word3]" + T.info = "[R.word3]" + imbued_from = R + break + if(R.word1==cultwords["see"] && R.word2==cultwords["blood"] && R.word3==cultwords["hell"]) //tome + T = new(src.loc) + T.imbue = "newtome" + imbued_from = R + break + if(R.word1==cultwords["destroy"] && R.word2==cultwords["see"] && R.word3==cultwords["technology"]) //emp + T = new(src.loc) + T.imbue = "emp" + imbued_from = R + break + if(R.word1==cultwords["blood"] && R.word2==cultwords["see"] && R.word3==cultwords["destroy"]) //conceal + T = new(src.loc) + T.imbue = "conceal" + imbued_from = R + break + if(R.word1==cultwords["hell"] && R.word2==cultwords["destroy"] && R.word3==cultwords["other"]) //armor + T = new(src.loc) + T.imbue = "armor" + imbued_from = R + break + if(R.word1==cultwords["blood"] && R.word2==cultwords["see"] && R.word3==cultwords["hide"]) //reveal + T = new(src.loc) + T.imbue = "revealrunes" + imbued_from = R + break + if(R.word1==cultwords["hide"] && R.word2==cultwords["other"] && R.word3==cultwords["see"]) //deafen + T = new(src.loc) + T.imbue = "deafen" + imbued_from = R + break + if(R.word1==cultwords["destroy"] && R.word2==cultwords["see"] && R.word3==cultwords["other"]) //blind + T = new(src.loc) + T.imbue = "blind" + imbued_from = R + break + if(R.word1==cultwords["self"] && R.word2==cultwords["other"] && R.word3==cultwords["technology"]) //communicat + T = new(src.loc) + T.imbue = "communicate" + imbued_from = R + break + if(R.word1==cultwords["join"] && R.word2==cultwords["hide"] && R.word3==cultwords["technology"]) //communicat + T = new(src.loc) + T.imbue = "runestun" + imbued_from = R + break + if (imbued_from) + for (var/mob/V in viewers(src)) + V.show_message("The runes turn into dust, which then forms into an arcane image on the paper.", 3) + usr.say("H'drak v[pick("'","`")]loso, mir'kanas verbot!") + qdel(imbued_from) + qdel(newtalisman) + else + return fizzle() /////////////////////////////////////////THIRTEENTH RUNE - mend() - var/mob/living/user = usr - var/datum/gender/TU = gender_datums[usr.get_visible_gender()] - src = null - user.say("Uhrast ka'hfa heldsagen ver[pick("'","`")]lot!") - user.take_overall_damage(200, 0) - runedec+=10 - user.visible_message("\The [user] keels over dead, [TU.his] blood glowing blue as it escapes [TU.his] body and dissipates into thin air.", \ - "In the last moment of your humble life, you feel an immense pain as fabric of reality mends... with your blood.", \ - "You hear faint rustle.") - for(,user.stat==2) - sleep(600) - if (!user) - return - runedec-=10 +/obj/effect/rune/proc/mend() + var/mob/living/user = usr + var/datum/gender/TU = gender_datums[usr.get_visible_gender()] + src = null + user.say("Uhrast ka'hfa heldsagen ver[pick("'","`")]lot!") + user.take_overall_damage(200, 0) + runedec+=10 + user.visible_message("\The [user] keels over dead, [TU.his] blood glowing blue as it escapes [TU.his] body and dissipates into thin air.", \ + "In the last moment of your humble life, you feel an immense pain as fabric of reality mends... with your blood.", \ + "You hear faint rustle.") + for(,user.stat==2) + sleep(600) + if (!user) return + runedec-=10 + return /////////////////////////////////////////FOURTEETH RUNE - // returns 0 if the rune is not used. returns 1 if the rune is used. - communicate() - . = 1 // Default output is 1. If the rune is deleted it will return 1 - var/input = input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")//sanitize() below, say() and whisper() have their own - if(!input) - if (istype(src)) - fizzle() - return 0 - else - return 0 +// returns 0 if the rune is not used. returns 1 if the rune is used. +/obj/effect/rune/proc/communicate() + . = 1 // Default output is 1. If the rune is deleted it will return 1 + var/input = input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")//sanitize() below, say() and whisper() have their own + if(!input) + if (istype(src)) + fizzle() + return 0 + else + return 0 - if(istype(src,/obj/effect/rune)) - usr.say("O bidai nabora se[pick("'","`")]sma!") - else - usr.whisper("O bidai nabora se[pick("'","`")]sma!") + if(istype(src,/obj/effect/rune)) + usr.say("O bidai nabora se[pick("'","`")]sma!") + else + usr.whisper("O bidai nabora se[pick("'","`")]sma!") - input = sanitize(input) - log_and_message_admins("used a communicate rune to say '[input]'") - for(var/datum/mind/H in cult.current_antagonists) - if (H.current) - to_chat(H.current, "[input]") - for(var/mob/observer/dead/O in player_list) - to_chat(O, "[input]") - qdel(src) - return 1 + input = sanitize(input) + log_and_message_admins("used a communicate rune to say '[input]'") + for(var/datum/mind/H in cult.current_antagonists) + if (H.current) + to_chat(H.current, "[input]") + for(var/mob/observer/dead/O in player_list) + to_chat(O, "[input]") + qdel(src) + return 1 /////////////////////////////////////////FIFTEENTH RUNE - sacrifice() - var/list/mob/living/carbon/human/cultsinrange = list() - var/list/mob/living/carbon/human/victims = list() - for(var/mob/living/carbon/human/V in src.loc)//Checks for non-cultist humans to sacrifice - if(ishuman(V)) - if(!(iscultist(V))) - victims += V//Checks for cult status and mob type - for(var/obj/item/I in src.loc)//Checks for MMIs/brains/Intellicards - if(istype(I,/obj/item/organ/internal/brain)) - var/obj/item/organ/internal/brain/B = I - victims += B.brainmob - else if(istype(I,/obj/item/device/mmi)) - var/obj/item/device/mmi/B = I - victims += B.brainmob - else if(istype(I,/obj/item/device/aicard)) - for(var/mob/living/silicon/ai/A in I) - victims += A - for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C) && !C.stat) - cultsinrange += C - C.say("Barhah hra zar[pick("'","`")]garis!") +/obj/effect/rune/proc/sacrifice() + var/list/mob/living/carbon/human/cultsinrange = list() + var/list/mob/living/carbon/human/victims = list() + for(var/mob/living/carbon/human/V in src.loc)//Checks for non-cultist humans to sacrifice + if(ishuman(V)) + if(!(iscultist(V))) + victims += V//Checks for cult status and mob type + for(var/obj/item/I in src.loc)//Checks for MMIs/brains/Intellicards + if(istype(I,/obj/item/organ/internal/brain)) + var/obj/item/organ/internal/brain/B = I + victims += B.brainmob + else if(istype(I,/obj/item/device/mmi)) + var/obj/item/device/mmi/B = I + victims += B.brainmob + else if(istype(I,/obj/item/device/aicard)) + for(var/mob/living/silicon/ai/A in I) + victims += A + for(var/mob/living/carbon/C in orange(1,src)) + if(iscultist(C) && !C.stat) + cultsinrange += C + C.say("Barhah hra zar[pick("'","`")]garis!") - for(var/mob/H in victims) + for(var/mob/H in victims) - var/worth = 0 - if(istype(H,/mob/living/carbon/human)) - var/mob/living/carbon/human/lamb = H - if(lamb.species.rarity_value > 3) - worth = 1 + var/worth = 0 + if(istype(H,/mob/living/carbon/human)) + var/mob/living/carbon/human/lamb = H + if(lamb.species.rarity_value > 3) + worth = 1 - if (ticker.mode.name == "cult") - if(H.mind == cult.sacrifice_target) - if(cultsinrange.len >= 3) - sacrificed += H.mind - if(isrobot(H)) - H.dust()//To prevent the MMI from remaining - else - H.gib() - to_chat(usr, "The Geometer of Blood accepts this sacrifice, your objective is now complete.") - else - to_chat(usr, "Your target's earthly bonds are too strong. You need more cultists to succeed in this ritual.") + if (ticker.mode.name == "cult") + if(H.mind == cult.sacrifice_target) + if(cultsinrange.len >= 3) + sacrificed += H.mind + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining else - if(cultsinrange.len >= 3) - if(H.stat !=2) - if(prob(80) || worth) - to_chat(usr, "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice.") - cult.grant_runeword(usr) - else - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - to_chat(usr, "However, this soul was not enough to gain His favor.") - if(isrobot(H)) - H.dust()//To prevent the MMI from remaining - else - H.gib() - else - if(prob(40) || worth) - to_chat(usr, "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice.") - cult.grant_runeword(usr) - else - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") - if(isrobot(H)) - H.dust()//To prevent the MMI from remaining - else - H.gib() - else - if(H.stat !=2) - to_chat(usr, "The victim is still alive, you will need more cultists chanting for the sacrifice to succeed.") - else - if(prob(40)) - - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - cult.grant_runeword(usr) - else - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") - if(isrobot(H)) - H.dust()//To prevent the MMI from remaining - else - H.gib() + H.gib() + to_chat(usr, "The Geometer of Blood accepts this sacrifice, your objective is now complete.") else - if(cultsinrange.len >= 3) - if(H.stat !=2) - if(prob(80)) - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - cult.grant_runeword(usr) - else - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - to_chat(usr, "However, this soul was not enough to gain His favor.") - if(isrobot(H)) - H.dust()//To prevent the MMI from remaining - else - H.gib() + to_chat(usr, "Your target's earthly bonds are too strong. You need more cultists to succeed in this ritual.") + else + if(cultsinrange.len >= 3) + if(H.stat !=2) + if(prob(80) || worth) + to_chat(usr, "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice.") + cult.grant_runeword(usr) else - if(prob(40)) - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - cult.grant_runeword(usr) - else - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") - if(isrobot(H)) - H.dust()//To prevent the MMI from remaining - else - H.gib() + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + to_chat(usr, "However, this soul was not enough to gain His favor.") + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() else - if(H.stat !=2) - to_chat(usr, "The victim is still alive, you will need more cultists chanting for the sacrifice to succeed.") + if(prob(40) || worth) + to_chat(usr, "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice.") + cult.grant_runeword(usr) else - if(prob(40)) - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - cult.grant_runeword(usr) - else - to_chat(usr, "The Geometer of Blood accepts this sacrifice.") - to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") - if(isrobot(H)) - H.dust()//To prevent the MMI from remaining - else - H.gib() + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() + else + if(H.stat !=2) + to_chat(usr, "The victim is still alive, you will need more cultists chanting for the sacrifice to succeed.") + else + if(prob(40)) + + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + cult.grant_runeword(usr) + else + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() + else + if(cultsinrange.len >= 3) + if(H.stat !=2) + if(prob(80)) + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + cult.grant_runeword(usr) + else + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + to_chat(usr, "However, this soul was not enough to gain His favor.") + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() + else + if(prob(40)) + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + cult.grant_runeword(usr) + else + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() + else + if(H.stat !=2) + to_chat(usr, "The victim is still alive, you will need more cultists chanting for the sacrifice to succeed.") + else + if(prob(40)) + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + cult.grant_runeword(usr) + else + to_chat(usr, "The Geometer of Blood accepts this sacrifice.") + to_chat(usr, "However, a mere dead body is not enough to satisfy Him.") + if(isrobot(H)) + H.dust()//To prevent the MMI from remaining + else + H.gib() /////////////////////////////////////////SIXTEENTH RUNE - revealrunes(var/obj/W as obj) - var/go=0 - var/rad - var/S=0 - if(istype(W,/obj/effect/rune)) - rad = 6 - go = 1 - if (istype(W,/obj/item/weapon/paper/talisman)) - rad = 4 - go = 1 - if (istype(W,/obj/item/weapon/nullrod)) - rad = 1 - go = 1 - if(go) - for(var/obj/effect/rune/R in orange(rad,src)) - if(R!=src) - R:visibility=15 - S=1 - if(S) - if(istype(W,/obj/item/weapon/nullrod)) - to_chat(usr, "Arcane markings suddenly glow from underneath a thin layer of dust!") - return - if(istype(W,/obj/effect/rune)) - usr.say("Nikt[pick("'","`")]o barada kla'atu!") - for (var/mob/V in viewers(src)) - V.show_message("The rune turns into red dust, reveaing the surrounding runes.", 3) - qdel(src) - return - if(istype(W,/obj/item/weapon/paper/talisman)) - usr.whisper("Nikt[pick("'","`")]o barada kla'atu!") - to_chat(usr, "Your talisman turns into red dust, revealing the surrounding runes.") - for (var/mob/V in orange(1,usr.loc)) - if(V!=usr) - V.show_message("Red dust emanates from [usr]'s hands for a moment.", 3) - return - return - if(istype(W,/obj/effect/rune)) - return fizzle() - if(istype(W,/obj/item/weapon/paper/talisman)) - call(/obj/effect/rune/proc/fizzle)() - return +/obj/effect/rune/proc/revealrunes(var/obj/W as obj) + var/go=0 + var/rad + var/S=0 + if(istype(W,/obj/effect/rune)) + rad = 6 + go = 1 + if (istype(W,/obj/item/weapon/paper/talisman)) + rad = 4 + go = 1 + if (istype(W,/obj/item/weapon/nullrod)) + rad = 1 + go = 1 + if(go) + for(var/obj/effect/rune/R in orange(rad,src)) + if(R!=src) + R:visibility=15 + S=1 + if(S) + if(istype(W,/obj/item/weapon/nullrod)) + to_chat(usr, "Arcane markings suddenly glow from underneath a thin layer of dust!") + return + if(istype(W,/obj/effect/rune)) + usr.say("Nikt[pick("'","`")]o barada kla'atu!") + for (var/mob/V in viewers(src)) + V.show_message("The rune turns into red dust, reveaing the surrounding runes.", 3) + qdel(src) + return + if(istype(W,/obj/item/weapon/paper/talisman)) + usr.whisper("Nikt[pick("'","`")]o barada kla'atu!") + to_chat(usr, "Your talisman turns into red dust, revealing the surrounding runes.") + for (var/mob/V in orange(1,usr.loc)) + if(V!=usr) + V.show_message("Red dust emanates from [usr]'s hands for a moment.", 3) + return + return + if(istype(W,/obj/effect/rune)) + return fizzle() + if(istype(W,/obj/item/weapon/paper/talisman)) + call(/obj/effect/rune/proc/fizzle)() + return /////////////////////////////////////////SEVENTEENTH RUNE - wall() - usr.say("Khari[pick("'","`")]d! Eske'te tannin!") - src.density = !src.density - var/mob/living/user = usr - user.take_organ_damage(2, 0) - if(src.density) - to_chat(usr, "Your blood flows into the rune, and you feel that the very space over the rune thickens.") - else - to_chat(usr, "Your blood flows into the rune, and you feel as the rune releases its grasp on space.") - return +/obj/effect/rune/proc/wall() + usr.say("Khari[pick("'","`")]d! Eske'te tannin!") + src.density = !src.density + var/mob/living/user = usr + user.take_organ_damage(2, 0) + if(src.density) + to_chat(usr, "Your blood flows into the rune, and you feel that the very space over the rune thickens.") + else + to_chat(usr, "Your blood flows into the rune, and you feel as the rune releases its grasp on space.") + return /////////////////////////////////////////EIGHTTEENTH RUNE - freedom() - var/mob/living/user = usr - var/list/mob/living/carbon/cultists = new - for(var/datum/mind/H in cult.current_antagonists) - if (istype(H.current,/mob/living/carbon)) - cultists+=H.current - var/list/mob/living/carbon/users = new - for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C) && !C.stat) - users+=C - var/dam = round(15 / users.len) - if(users.len>=3) - var/mob/living/carbon/cultist = input("Choose the one who you want to free", "Followers of Geometer") as null|anything in (cultists - users) - if(!cultist) - return fizzle() - if (cultist == user) //just to be sure. - return - if(!(cultist.buckled || \ - cultist.handcuffed || \ - istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle) || \ - (istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded) || \ - (istype(cultist.loc, /obj/structure/closet/secure_closet)&&cultist.loc:locked) || \ - (istype(cultist.loc, /obj/machinery/dna_scannernew)&&cultist.loc:locked) \ - )) - to_chat(user, "The [cultist] is already free.") - return - cultist.buckled = null - if (cultist.handcuffed) - cultist.drop_from_inventory(cultist.handcuffed) - if (cultist.legcuffed) - cultist.drop_from_inventory(cultist.legcuffed) - if (istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle)) - cultist.drop_from_inventory(cultist.wear_mask) - if(istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded) - cultist.loc:welded = 0 - if(istype(cultist.loc, /obj/structure/closet/secure_closet)&&cultist.loc:locked) - cultist.loc:locked = 0 - if(istype(cultist.loc, /obj/machinery/dna_scannernew)&&cultist.loc:locked) - cultist.loc:locked = 0 - for(var/mob/living/carbon/C in users) - user.take_overall_damage(dam, 0) - C.say("Khari[pick("'","`")]d! Gual'te nikka!") - qdel(src) +/obj/effect/rune/proc/freedom() + var/mob/living/user = usr + var/list/mob/living/carbon/cultists = new + for(var/datum/mind/H in cult.current_antagonists) + if (istype(H.current,/mob/living/carbon)) + cultists+=H.current + var/list/mob/living/carbon/users = new + for(var/mob/living/carbon/C in orange(1,src)) + if(iscultist(C) && !C.stat) + users+=C + var/dam = round(15 / users.len) + if(users.len>=3) + var/mob/living/carbon/cultist = input("Choose the one who you want to free", "Followers of Geometer") as null|anything in (cultists - users) + if(!cultist) return fizzle() + if (cultist == user) //just to be sure. + return + if(!(cultist.buckled || \ + cultist.handcuffed || \ + istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle) || \ + (istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded) || \ + (istype(cultist.loc, /obj/structure/closet/secure_closet)&&cultist.loc:locked) || \ + (istype(cultist.loc, /obj/machinery/dna_scannernew)&&cultist.loc:locked) \ + )) + to_chat(user, "The [cultist] is already free.") + return + cultist.buckled = null + if (cultist.handcuffed) + cultist.drop_from_inventory(cultist.handcuffed) + if (cultist.legcuffed) + cultist.drop_from_inventory(cultist.legcuffed) + if (istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle)) + cultist.drop_from_inventory(cultist.wear_mask) + if(istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded) + cultist.loc:welded = 0 + if(istype(cultist.loc, /obj/structure/closet/secure_closet)&&cultist.loc:locked) + cultist.loc:locked = 0 + if(istype(cultist.loc, /obj/machinery/dna_scannernew)&&cultist.loc:locked) + cultist.loc:locked = 0 + for(var/mob/living/carbon/C in users) + user.take_overall_damage(dam, 0) + C.say("Khari[pick("'","`")]d! Gual'te nikka!") + qdel(src) + return fizzle() /////////////////////////////////////////NINETEENTH RUNE - cultsummon() - var/mob/living/user = usr - var/list/mob/living/carbon/cultists = new - for(var/datum/mind/H in cult.current_antagonists) - if (istype(H.current,/mob/living/carbon)) - cultists+=H.current - var/list/mob/living/carbon/users = new - for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C) && !C.stat) - users += C - if(users.len>=3) - var/mob/living/carbon/cultist = input("Choose the one who you want to summon", "Followers of Geometer") as null|anything in (cultists - user) - if(!cultist) - return fizzle() - if (cultist == user) //just to be sure. - return - if(cultist.buckled || cultist.handcuffed || (!isturf(cultist.loc) && !istype(cultist.loc, /obj/structure/closet))) - var/datum/gender/TU = gender_datums[cultist.get_visible_gender()] - to_chat(user, "You cannot summon \the [cultist], for [TU.his] shackles of blood are strong.") - return fizzle() - cultist.loc = src.loc - cultist.lying = 1 - cultist.regenerate_icons() - - var/dam = round(25 / (users.len/2)) //More people around the rune less damage everyone takes. Minimum is 3 cultists - - for(var/mob/living/carbon/human/C in users) - if(iscultist(C) && !C.stat) - C.say("N'ath reth sh'yro eth d[pick("'","`")]rekkathnor!") - C.take_overall_damage(dam, 0) - if(users.len <= 4) // You did the minimum, this is going to hurt more and we're going to stun you. - C.apply_effect(rand(3,6), STUN) - C.apply_effect(1, WEAKEN) - user.visible_message("Rune disappears with a flash of red light, and in its place now a body lies.", \ - "You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a body.", \ - "You hear a pop and smell ozone.") - qdel(src) +/obj/effect/rune/proc/cultsummon() + var/mob/living/user = usr + var/list/mob/living/carbon/cultists = new + for(var/datum/mind/H in cult.current_antagonists) + if (istype(H.current,/mob/living/carbon)) + cultists+=H.current + var/list/mob/living/carbon/users = new + for(var/mob/living/carbon/C in orange(1,src)) + if(iscultist(C) && !C.stat) + users += C + if(users.len>=3) + var/mob/living/carbon/cultist = input("Choose the one who you want to summon", "Followers of Geometer") as null|anything in (cultists - user) + if(!cultist) return fizzle() + if (cultist == user) //just to be sure. + return + if(cultist.buckled || cultist.handcuffed || (!isturf(cultist.loc) && !istype(cultist.loc, /obj/structure/closet))) + var/datum/gender/TU = gender_datums[cultist.get_visible_gender()] + to_chat(user, "You cannot summon \the [cultist], for [TU.his] shackles of blood are strong.") + return fizzle() + cultist.loc = src.loc + cultist.lying = 1 + cultist.regenerate_icons() + + var/dam = round(25 / (users.len/2)) //More people around the rune less damage everyone takes. Minimum is 3 cultists + + for(var/mob/living/carbon/human/C in users) + if(iscultist(C) && !C.stat) + C.say("N'ath reth sh'yro eth d[pick("'","`")]rekkathnor!") + C.take_overall_damage(dam, 0) + if(users.len <= 4) // You did the minimum, this is going to hurt more and we're going to stun you. + C.apply_effect(rand(3,6), STUN) + C.apply_effect(1, WEAKEN) + user.visible_message("Rune disappears with a flash of red light, and in its place now a body lies.", \ + "You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a body.", \ + "You hear a pop and smell ozone.") + qdel(src) + return fizzle() /////////////////////////////////////////TWENTIETH RUNES - deafen() - if(istype(src,/obj/effect/rune)) - var/list/affected = new() - for(var/mob/living/carbon/C in range(7,src)) - if (iscultist(C)) - continue - var/obj/item/weapon/nullrod/N = locate() in C - if(N) - continue - C.ear_deaf += 50 - C.show_message("The world around you suddenly becomes quiet.", 3) - affected += C - if(prob(1)) - C.sdisabilities |= DEAF - if(affected.len) - usr.say("Sti[pick("'","`")] kaliedir!") - to_chat(usr, "The world becomes quiet as the deafening rune dissipates into fine dust.") - add_attack_logs(usr,affected,"Deafen rune") - qdel(src) - else - return fizzle() - else - var/list/affected = new() - for(var/mob/living/carbon/C in range(7,usr)) - if (iscultist(C)) - continue - var/obj/item/weapon/nullrod/N = locate() in C - if(N) - continue - C.ear_deaf += 30 - //talismans is weaker. - C.show_message("The world around you suddenly becomes quiet.", 3) - affected += C - if(affected.len) - usr.whisper("Sti[pick("'","`")] kaliedir!") - to_chat(usr, "Your talisman turns into gray dust, deafening everyone around.") - add_attack_logs(usr, affected, "Deafen rune") - for (var/mob/V in orange(1,src)) - if(!(iscultist(V))) - V.show_message("Dust flows from [usr]'s hands for a moment, and the world suddenly becomes quiet..", 3) - return +/obj/effect/rune/proc/deafen() + if(istype(src,/obj/effect/rune)) + var/list/affected = new() + for(var/mob/living/carbon/C in range(7,src)) + if (iscultist(C)) + continue + var/obj/item/weapon/nullrod/N = locate() in C + if(N) + continue + C.ear_deaf += 50 + C.show_message("The world around you suddenly becomes quiet.", 3) + affected += C + if(prob(1)) + C.sdisabilities |= DEAF + if(affected.len) + usr.say("Sti[pick("'","`")] kaliedir!") + to_chat(usr, "The world becomes quiet as the deafening rune dissipates into fine dust.") + add_attack_logs(usr,affected,"Deafen rune") + qdel(src) + else + return fizzle() + else + var/list/affected = new() + for(var/mob/living/carbon/C in range(7,usr)) + if (iscultist(C)) + continue + var/obj/item/weapon/nullrod/N = locate() in C + if(N) + continue + C.ear_deaf += 30 + //talismans is weaker. + C.show_message("The world around you suddenly becomes quiet.", 3) + affected += C + if(affected.len) + usr.whisper("Sti[pick("'","`")] kaliedir!") + to_chat(usr, "Your talisman turns into gray dust, deafening everyone around.") + add_attack_logs(usr, affected, "Deafen rune") + for (var/mob/V in orange(1,src)) + if(!(iscultist(V))) + V.show_message("Dust flows from [usr]'s hands for a moment, and the world suddenly becomes quiet..", 3) + return - blind() - if(istype(src,/obj/effect/rune)) - var/list/affected = new() - for(var/mob/living/carbon/C in viewers(src)) - if (iscultist(C)) - continue - var/obj/item/weapon/nullrod/N = locate() in C - if(N) - continue - C.eye_blurry += 50 - C.Blind(20) - if(prob(5)) - C.disabilities |= NEARSIGHTED - if(prob(10)) - C.sdisabilities |= BLIND - C.show_message("Suddenly you see a red flash that blinds you.", 3) - affected += C - if(affected.len) - usr.say("Sti[pick("'","`")] kaliesin!") - to_chat(usr, "The rune flashes, blinding those who not follow the Nar-Sie, and dissipates into fine dust.") - add_attack_logs(usr, affected, "Blindness rune") - qdel(src) - else - return fizzle() - else - var/list/affected = new() - for(var/mob/living/carbon/C in view(2,usr)) - if (iscultist(C)) - continue - var/obj/item/weapon/nullrod/N = locate() in C - if(N) - continue - C.eye_blurry += 30 - C.Blind(10) - //talismans is weaker. - affected += C - C.show_message("You feel a sharp pain in your eyes, and the world disappears into darkness..", 3) - if(affected.len) - usr.whisper("Sti[pick("'","`")] kaliesin!") - to_chat(usr, "Your talisman turns into gray dust, blinding those who not follow the Nar-Sie.") - add_attack_logs(usr, affected, "Blindness rune") - return +/obj/effect/rune/proc/blind() + if(istype(src,/obj/effect/rune)) + var/list/affected = new() + for(var/mob/living/carbon/C in viewers(src)) + if (iscultist(C)) + continue + var/obj/item/weapon/nullrod/N = locate() in C + if(N) + continue + C.eye_blurry += 50 + C.Blind(20) + if(prob(5)) + C.disabilities |= NEARSIGHTED + if(prob(10)) + C.sdisabilities |= BLIND + C.show_message("Suddenly you see a red flash that blinds you.", 3) + affected += C + if(affected.len) + usr.say("Sti[pick("'","`")] kaliesin!") + to_chat(usr, "The rune flashes, blinding those who not follow the Nar-Sie, and dissipates into fine dust.") + add_attack_logs(usr, affected, "Blindness rune") + qdel(src) + else + return fizzle() + else + var/list/affected = new() + for(var/mob/living/carbon/C in view(2,usr)) + if (iscultist(C)) + continue + var/obj/item/weapon/nullrod/N = locate() in C + if(N) + continue + C.eye_blurry += 30 + C.Blind(10) + //talismans is weaker. + affected += C + C.show_message("You feel a sharp pain in your eyes, and the world disappears into darkness..", 3) + if(affected.len) + usr.whisper("Sti[pick("'","`")] kaliesin!") + to_chat(usr, "Your talisman turns into gray dust, blinding those who not follow the Nar-Sie.") + add_attack_logs(usr, affected, "Blindness rune") + return - bloodboil() //cultists need at least one DANGEROUS rune. Even if they're all stealthy. +/obj/effect/rune/proc/bloodboil() //cultists need at least one DANGEROUS rune. Even if they're all stealthy. /* - var/list/mob/living/carbon/cultists = new - for(var/datum/mind/H in ticker.mode.cult) - if (istype(H.current,/mob/living/carbon)) - cultists+=H.current + var/list/mob/living/carbon/cultists = new + for(var/datum/mind/H in ticker.mode.cult) + if (istype(H.current,/mob/living/carbon)) + cultists+=H.current */ - var/list/cultists = new //also, wording for it is old wording for obscure rune, which is now hide-see-blood. - var/list/victims = new + var/list/cultists = new //also, wording for it is old wording for obscure rune, which is now hide-see-blood. + var/list/victims = new // var/list/cultboil = list(cultists-usr) //and for this words are destroy-see-blood. - for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C) && !C.stat) - cultists+=C - if(cultists.len>=3) - for(var/mob/living/carbon/M in viewers(usr)) - if(iscultist(M)) - continue - var/obj/item/weapon/nullrod/N = locate() in M - if(N) - continue - M.take_overall_damage(51,51) - to_chat(M, "Your blood boils!") - victims += M - if(prob(5)) - spawn(5) - M.gib() - for(var/obj/effect/rune/R in view(src)) - if(prob(10)) - explosion(R.loc, -1, 0, 1, 5) - for(var/mob/living/carbon/human/C in orange(1,src)) - if(iscultist(C) && !C.stat) - C.say("Dedo ol[pick("'","`")]btoh!") - C.take_overall_damage(15, 0) - add_attack_logs(usr, victims, "Blood boil rune") - qdel(src) - else - return fizzle() - return + for(var/mob/living/carbon/C in orange(1,src)) + if(iscultist(C) && !C.stat) + cultists+=C + if(cultists.len>=3) + for(var/mob/living/carbon/M in viewers(usr)) + if(iscultist(M)) + continue + var/obj/item/weapon/nullrod/N = locate() in M + if(N) + continue + M.take_overall_damage(51,51) + to_chat(M, "Your blood boils!") + victims += M + if(prob(5)) + spawn(5) + M.gib() + for(var/obj/effect/rune/R in view(src)) + if(prob(10)) + explosion(R.loc, -1, 0, 1, 5) + for(var/mob/living/carbon/human/C in orange(1,src)) + if(iscultist(C) && !C.stat) + C.say("Dedo ol[pick("'","`")]btoh!") + C.take_overall_damage(15, 0) + add_attack_logs(usr, victims, "Blood boil rune") + qdel(src) + else + return fizzle() + return // WIP rune, I'll wait for Rastaf0 to add limited blood. - burningblood() - var/culcount = 0 - for(var/mob/living/carbon/C in orange(1,src)) - if(iscultist(C) && !C.stat) - culcount++ - if(culcount >= 5) - for(var/obj/effect/rune/R in rune_list) - if(R.blood_DNA == src.blood_DNA) - for(var/mob/living/M in orange(2,R)) - M.take_overall_damage(0,15) - if (R.invisibility>M.see_invisible) - to_chat(M, "Aargh it burns!") - else - to_chat(M, "Rune suddenly ignites, burning you!") - var/turf/T = get_turf(R) - T.hotspot_expose(700,125) - for(var/obj/effect/decal/cleanable/blood/B in world) - if(B.blood_DNA == src.blood_DNA) - for(var/mob/living/M in orange(1,B)) - M.take_overall_damage(0,5) - to_chat(M, "Blood suddenly ignites, burning you!") - var/turf/T = get_turf(B) - T.hotspot_expose(700,125) - qdel(B) - qdel(src) +/obj/effect/rune/proc/burningblood() + var/culcount = 0 + for(var/mob/living/carbon/C in orange(1,src)) + if(iscultist(C) && !C.stat) + culcount++ + if(culcount >= 5) + for(var/obj/effect/rune/R in rune_list) + if(R.blood_DNA == src.blood_DNA) + for(var/mob/living/M in orange(2,R)) + M.take_overall_damage(0,15) + if (R.invisibility>M.see_invisible) + to_chat(M, "Aargh it burns!") + else + to_chat(M, "Rune suddenly ignites, burning you!") + var/turf/T = get_turf(R) + T.hotspot_expose(700,125) + for(var/obj/effect/decal/cleanable/blood/B in world) + if(B.blood_DNA == src.blood_DNA) + for(var/mob/living/M in orange(1,B)) + M.take_overall_damage(0,5) + to_chat(M, "Blood suddenly ignites, burning you!") + var/turf/T = get_turf(B) + T.hotspot_expose(700,125) + qdel(B) + qdel(src) ////////// Rune 24 (counting burningblood, which kinda doesnt work yet.) - runestun(var/mob/living/T as mob) - if(istype(src,/obj/effect/rune)) ///When invoked as rune, flash and stun everyone around. - usr.say("Fuu ma[pick("'","`")]jin!") - for(var/mob/living/L in viewers(src)) - if(iscarbon(L)) - var/mob/living/carbon/C = L - C.flash_eyes() - if(C.stuttering < 1 && (!(HULK in C.mutations))) - C.stuttering = 1 - C.Weaken(1) - C.Stun(1) - C.show_message("The rune explodes in a bright flash.", 3) - add_attack_logs(usr,C,"Stun rune") +/obj/effect/rune/proc/runestun(var/mob/living/T as mob) + if(istype(src,/obj/effect/rune)) ///When invoked as rune, flash and stun everyone around. + usr.say("Fuu ma[pick("'","`")]jin!") + for(var/mob/living/L in viewers(src)) + if(iscarbon(L)) + var/mob/living/carbon/C = L + C.flash_eyes() + if(C.stuttering < 1 && (!(HULK in C.mutations))) + C.stuttering = 1 + C.Weaken(1) + C.Stun(1) + C.show_message("The rune explodes in a bright flash.", 3) + add_attack_logs(usr,C,"Stun rune") - else if(issilicon(L)) - var/mob/living/silicon/S = L - S.Weaken(5) - S.show_message("BZZZT... The rune has exploded in a bright flash.", 3) - add_attack_logs(usr,S,"Stun rune") - qdel(src) - else ///When invoked as talisman, stun and mute the target mob. - usr.say("Dream sign ''Evil sealing talisman'[pick("'","`")]!") - var/obj/item/weapon/nullrod/N = locate() in T - if(N) - for(var/mob/O in viewers(T, null)) - O.show_message(text("[] invokes a talisman at [], but they are unaffected!", usr, T), 1) - else - for(var/mob/O in viewers(T, null)) - O.show_message(text("[] invokes a talisman at []", usr, T), 1) + else if(issilicon(L)) + var/mob/living/silicon/S = L + S.Weaken(5) + S.show_message("BZZZT... The rune has exploded in a bright flash.", 3) + add_attack_logs(usr,S,"Stun rune") + qdel(src) + else ///When invoked as talisman, stun and mute the target mob. + usr.say("Dream sign ''Evil sealing talisman'[pick("'","`")]!") + var/obj/item/weapon/nullrod/N = locate() in T + if(N) + for(var/mob/O in viewers(T, null)) + O.show_message(text("[] invokes a talisman at [], but they are unaffected!", usr, T), 1) + else + for(var/mob/O in viewers(T, null)) + O.show_message(text("[] invokes a talisman at []", usr, T), 1) - if(issilicon(T)) - T.Weaken(15) - add_attack_logs(usr,T,"Stun rune") - else if(iscarbon(T)) - var/mob/living/carbon/C = T - C.flash_eyes() - if (!(HULK in C.mutations)) - C.silent += 15 - C.Weaken(25) - C.Stun(25) - add_attack_logs(usr,C,"Stun rune") - return + if(issilicon(T)) + T.Weaken(15) + add_attack_logs(usr,T,"Stun rune") + else if(iscarbon(T)) + var/mob/living/carbon/C = T + C.flash_eyes() + if (!(HULK in C.mutations)) + C.silent += 15 + C.Weaken(25) + C.Stun(25) + add_attack_logs(usr,C,"Stun rune") + return /////////////////////////////////////////TWENTY-FIFTH RUNE - armor() - var/mob/living/carbon/human/user = usr - if(istype(src,/obj/effect/rune)) - usr.say("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") - else - usr.whisper("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") - usr.visible_message("The rune disappears with a flash of red light, and a set of armor appears on [usr]...", \ - "You are blinded by the flash of red light! After you're able to see again, you see that you are now wearing a set of armor.") +/obj/effect/rune/proc/armor() + var/mob/living/carbon/human/user = usr + if(istype(src,/obj/effect/rune)) + usr.say("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") + else + usr.whisper("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") + usr.visible_message("The rune disappears with a flash of red light, and a set of armor appears on [usr]...", \ + "You are blinded by the flash of red light! After you're able to see again, you see that you are now wearing a set of armor.") - user.equip_to_slot_or_del(new /obj/item/clothing/head/culthood/alt(user), slot_head) - user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit) - user.equip_to_slot_or_del(new /obj/item/clothing/shoes/cult(user), slot_shoes) - user.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/cultpack(user), slot_back) - //the above update their overlay icons cache but do not call update_icons() - //the below calls update_icons() at the end, which will update overlay icons by using the (now updated) cache - user.put_in_hands(new /obj/item/weapon/melee/cultblade(user)) //put in hands or on floor + user.equip_to_slot_or_del(new /obj/item/clothing/head/culthood/alt(user), slot_head) + user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit) + user.equip_to_slot_or_del(new /obj/item/clothing/shoes/cult(user), slot_shoes) + user.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/cultpack(user), slot_back) + //the above update their overlay icons cache but do not call update_icons() + //the below calls update_icons() at the end, which will update overlay icons by using the (now updated) cache + user.put_in_hands(new /obj/item/weapon/melee/cultblade(user)) //put in hands or on floor - qdel(src) - return + qdel(src) + return diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index 304bb2b2a6..02923522dc 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -4,113 +4,113 @@ var/uses = 0 info = "


    " - attack_self(mob/living/user as mob) - if(iscultist(user)) - var/delete = 1 - // who the hell thought this was a good idea :( - switch(imbue) - if("newtome") - call(/obj/effect/rune/proc/tomesummon)() - if("armor") - call(/obj/effect/rune/proc/armor)() - if("emp") - call(/obj/effect/rune/proc/emp)(usr.loc,3) - if("conceal") - call(/obj/effect/rune/proc/obscure)(2) - if("revealrunes") - call(/obj/effect/rune/proc/revealrunes)(src) - if("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") - call(/obj/effect/rune/proc/teleport)(imbue) - if("communicate") - //If the user cancels the talisman this var will be set to 0 - delete = call(/obj/effect/rune/proc/communicate)() - if("deafen") - call(/obj/effect/rune/proc/deafen)() - if("blind") - call(/obj/effect/rune/proc/blind)() - if("runestun") - to_chat(user, "To use this talisman, attack your target directly.") - return - if("supply") - supply() - user.take_organ_damage(5, 0) - if(src && src.imbue!="supply" && src.imbue!="runestun") - if(delete) - qdel(src) - return - else - to_chat(user, "You see strange symbols on the paper. Are they supposed to mean something?") - return - - - attack(mob/living/carbon/T as mob, mob/living/user as mob) - if(iscultist(user)) - if(imbue == "runestun") - user.take_organ_damage(5, 0) - call(/obj/effect/rune/proc/runestun)(T) +/obj/item/weapon/paper/talisman/attack_self(mob/living/user as mob) + if(iscultist(user)) + var/delete = 1 + // who the hell thought this was a good idea :( + switch(imbue) + if("newtome") + call(/obj/effect/rune/proc/tomesummon)() + if("armor") + call(/obj/effect/rune/proc/armor)() + if("emp") + call(/obj/effect/rune/proc/emp)(usr.loc,3) + if("conceal") + call(/obj/effect/rune/proc/obscure)(2) + if("revealrunes") + call(/obj/effect/rune/proc/revealrunes)(src) + if("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri") + call(/obj/effect/rune/proc/teleport)(imbue) + if("communicate") + //If the user cancels the talisman this var will be set to 0 + delete = call(/obj/effect/rune/proc/communicate)() + if("deafen") + call(/obj/effect/rune/proc/deafen)() + if("blind") + call(/obj/effect/rune/proc/blind)() + if("runestun") + to_chat(user, "To use this talisman, attack your target directly.") + return + if("supply") + supply() + user.take_organ_damage(5, 0) + if(src && src.imbue!="supply" && src.imbue!="runestun") + if(delete) qdel(src) - else - ..() ///If its some other talisman, use the generic attack code, is this supposed to work this way? - else - ..() + return + else + to_chat(user, "You see strange symbols on the paper. Are they supposed to mean something?") + return - proc/supply(var/key) - if (!src.uses) +/obj/item/weapon/paper/talisman/attack(mob/living/carbon/T as mob, mob/living/user as mob) + if(iscultist(user)) + if(imbue == "runestun") + user.take_organ_damage(5, 0) + call(/obj/effect/rune/proc/runestun)(T) qdel(src) - return + else + ..() ///If its some other talisman, use the generic attack code, is this supposed to work this way? + else + ..() - var/dat = "There are [src.uses] bloody runes on the parchment.
    " - dat += "Please choose the chant to be imbued into the fabric of reality.
    " - dat += "
    " - dat += "N'ath reth sh'yro eth d'raggathnor! - Allows you to summon a new arcane tome.
    " - dat += "Sas'so c'arta forbici! - Allows you to move to a rune with the same last word.
    " - dat += "Ta'gh fara'qha fel d'amar det! - Allows you to destroy technology in a short range.
    " - dat += "Kla'atu barada nikt'o! - Allows you to conceal the runes you placed on the floor.
    " - dat += "O bidai nabora se'sma! - Allows you to coordinate with others of your cult.
    " - dat += "Fuu ma'jin - Allows you to stun a person by attacking them with the talisman.
    " - dat += "Sa tatha najin - Allows you to summon armoured robes and an unholy blade
    " - dat += "Kal om neth - Summons a soul stone
    " - dat += "Da A'ig Osk - Summons a construct shell for use with captured souls. It is too large to carry on your person.
    " - usr << browse(dat, "window=id_com;size=350x200") + +/obj/item/weapon/paper/talisman/proc/supply(var/key) + if (!src.uses) + qdel(src) return + var/dat = "There are [src.uses] bloody runes on the parchment.
    " + dat += "Please choose the chant to be imbued into the fabric of reality.
    " + dat += "
    " + dat += "N'ath reth sh'yro eth d'raggathnor! - Allows you to summon a new arcane tome.
    " + dat += "Sas'so c'arta forbici! - Allows you to move to a rune with the same last word.
    " + dat += "Ta'gh fara'qha fel d'amar det! - Allows you to destroy technology in a short range.
    " + dat += "Kla'atu barada nikt'o! - Allows you to conceal the runes you placed on the floor.
    " + dat += "O bidai nabora se'sma! - Allows you to coordinate with others of your cult.
    " + dat += "Fuu ma'jin - Allows you to stun a person by attacking them with the talisman.
    " + dat += "Sa tatha najin - Allows you to summon armoured robes and an unholy blade
    " + dat += "Kal om neth - Summons a soul stone
    " + dat += "Da A'ig Osk - Summons a construct shell for use with captured souls. It is too large to carry on your person.
    " + usr << browse(dat, "window=id_com;size=350x200") + return - Topic(href, href_list) - if(!src) return - if (usr.stat || usr.restrained() || !in_range(src, usr)) return - if (href_list["rune"]) - switch(href_list["rune"]) - if("newtome") - var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) - T.imbue = "newtome" - if("teleport") - var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) - T.imbue = "[pick("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri", "orkan", "allaq")]" - T.info = "[T.imbue]" - if("emp") - var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) - T.imbue = "emp" - if("conceal") - var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) - T.imbue = "conceal" - if("communicate") - var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) - T.imbue = "communicate" - if("runestun") - var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) - T.imbue = "runestun" - if("armor") - var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) - T.imbue = "armor" - if("soulstone") - new /obj/item/device/soulstone(get_turf(usr)) - if("construct") - new /obj/structure/constructshell/cult(get_turf(usr)) - src.uses-- - supply() - return +/obj/item/weapon/paper/talisman/Topic(href, href_list) + if(!src) return + if (usr.stat || usr.restrained() || !in_range(src, usr)) return + + if (href_list["rune"]) + switch(href_list["rune"]) + if("newtome") + var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) + T.imbue = "newtome" + if("teleport") + var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) + T.imbue = "[pick("ire", "ego", "nahlizet", "certum", "veri", "jatkaa", "balaq", "mgar", "karazet", "geeri", "orkan", "allaq")]" + T.info = "[T.imbue]" + if("emp") + var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) + T.imbue = "emp" + if("conceal") + var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) + T.imbue = "conceal" + if("communicate") + var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) + T.imbue = "communicate" + if("runestun") + var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) + T.imbue = "runestun" + if("armor") + var/obj/item/weapon/paper/talisman/T = new /obj/item/weapon/paper/talisman(get_turf(usr)) + T.imbue = "armor" + if("soulstone") + new /obj/item/device/soulstone(get_turf(usr)) + if("construct") + new /obj/structure/constructshell/cult(get_turf(usr)) + src.uses-- + supply() + return /obj/item/weapon/paper/talisman/supply diff --git a/code/game/gamemodes/events/clang.dm b/code/game/gamemodes/events/clang.dm index ea40622695..fd6a36e3d4 100644 --- a/code/game/gamemodes/events/clang.dm +++ b/code/game/gamemodes/events/clang.dm @@ -16,34 +16,34 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 density = 1 anchored = 1 - Bump(atom/clong) - if(istype(clong, /turf/simulated/shuttle)) //Skip shuttles without actually deleting the rod - return +/obj/effect/immovablerod/Bump(atom/clong) + if(istype(clong, /turf/simulated/shuttle)) //Skip shuttles without actually deleting the rod + return - else if (istype(clong, /turf) && !istype(clong, /turf/unsimulated)) - if(clong.density) - clong.ex_act(2) - for (var/mob/O in hearers(src, null)) - O.show_message("CLANG", 2) + else if (istype(clong, /turf) && !istype(clong, /turf/unsimulated)) + if(clong.density) + clong.ex_act(2) + for (var/mob/O in hearers(src, null)) + O.show_message("CLANG", 2) - else if (istype(clong, /obj)) - if(clong.density) - clong.ex_act(2) - for (var/mob/O in hearers(src, null)) - O.show_message("CLANG", 2) + else if (istype(clong, /obj)) + if(clong.density) + clong.ex_act(2) + for (var/mob/O in hearers(src, null)) + O.show_message("CLANG", 2) - else if (istype(clong, /mob)) - if(clong.density || prob(10)) - clong.ex_act(2) - else - qdel(src) + else if (istype(clong, /mob)) + if(clong.density || prob(10)) + clong.ex_act(2) + else + qdel(src) - if(clong && prob(25)) - src.loc = clong.loc + if(clong && prob(25)) + src.loc = clong.loc - Destroy() - walk(src, 0) // Because we might have called walk_towards, we must stop the walk loop or BYOND keeps an internal reference to us forever. - return ..() +/obj/effect/immovablerod/Destroy() + walk(src, 0) // Because we might have called walk_towards, we must stop the walk loop or BYOND keeps an internal reference to us forever. + return ..() /proc/immovablerod() var/startx = 0 diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 4208ac6240..ef94946ed7 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -469,7 +469,7 @@ var/global/list/additional_antag_types = list() ////////////////////////// //Reports player logouts// ////////////////////////// -proc/display_roundstart_logout_report() +/proc/display_roundstart_logout_report() var/msg = "Roundstart logout report\n\n" for(var/mob/living/L in mob_list) @@ -521,7 +521,7 @@ proc/display_roundstart_logout_report() if(M.client && M.client.holder) to_chat(M,msg) -proc/get_nt_opposed() +/proc/get_nt_opposed() var/list/dudes = list() for(var/mob/living/carbon/human/man in player_list) if(man.client) diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index b185208fbd..4639f57138 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -1453,7 +1453,7 @@ datum return 0 return 1 -datum/objective/silence +/datum/objective/silence explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left." check_completion() diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 8bb79c5eb0..6b6b1b8a3d 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -1,428 +1,425 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 var/global/list/all_objectives = list() -datum/objective +/datum/objective var/datum/mind/owner = null //Who owns the objective. var/explanation_text = "Nothing" //What that person is supposed to do. var/datum/mind/target = null //If they are focused on a particular person. var/target_amount = 0 //If they are focused on a particular number. Steal objectives have their own counter. var/completed = 0 //currently only used for custom objectives. - New(var/text) - all_objectives |= src - if(text) - explanation_text = text - ..() +/datum/objective/New(var/text) + all_objectives |= src + if(text) + explanation_text = text + ..() - Destroy() - all_objectives -= src - ..() +/datum/objective/Destroy() + all_objectives -= src + ..() - proc/check_completion() - return completed +/datum/objective/proc/check_completion() + return completed - proc/find_target() - var/list/possible_targets = list() - for(var/datum/mind/possible_target in ticker.minds) - if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2)) - possible_targets += possible_target - if(possible_targets.len > 0) - target = pick(possible_targets) +/datum/objective/proc/find_target() + var/list/possible_targets = list() + for(var/datum/mind/possible_target in ticker.minds) + if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2)) + possible_targets += possible_target + if(possible_targets.len > 0) + target = pick(possible_targets) - proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned. - for(var/datum/mind/possible_target in ticker.minds) - if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) ) - target = possible_target - break +/datum/objective/proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned. + for(var/datum/mind/possible_target in ticker.minds) + if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) ) + target = possible_target + break -datum/objective/assassinate - find_target() - ..() - if(target && target.current) - explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]." - else - explanation_text = "Free Objective" - return target +/datum/objective/assassinate/find_target() + ..() + if(target && target.current) + explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]." + else + explanation_text = "Free Objective" + return target - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - explanation_text = "Assassinate [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]." - else - explanation_text = "Free Objective" - return target +/datum/objective/assassinate/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "Assassinate [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]." + else + explanation_text = "Free Objective" + return target - check_completion() - if(target && target.current) - if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite - return 1 - return 0 - return 1 +/datum/objective/assassinate/check_completion() + if(target && target.current) + if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite + return 1 + return 0 + return 1 -datum/objective/anti_revolution/execute - find_target() - ..() - if(target && target.current) - var/datum/gender/T = gender_datums[target.current.get_visible_gender()] - explanation_text = "[target.current.real_name], the [target.assigned_role] has extracted confidential information above their clearance. Execute [T.him]." - else - explanation_text = "Free Objective" - return target +/datum/objective/anti_revolution/execute/find_target() + ..() + if(target && target.current) + var/datum/gender/T = gender_datums[target.current.get_visible_gender()] + explanation_text = "[target.current.real_name], the [target.assigned_role] has extracted confidential information above their clearance. Execute [T.him]." + else + explanation_text = "Free Objective" + return target - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - var/datum/gender/T = gender_datums[target.current.get_visible_gender()] - explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has extracted confidential information above their clearance. Execute [T.him]." - else - explanation_text = "Free Objective" - return target +/datum/objective/anti_revolution/execute/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + var/datum/gender/T = gender_datums[target.current.get_visible_gender()] + explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has extracted confidential information above their clearance. Execute [T.him]." + else + explanation_text = "Free Objective" + return target - check_completion() - if(target && target.current) - if(target.current.stat == DEAD || !ishuman(target.current)) - return 1 - return 0 - return 1 +/datum/objective/anti_revolution/execute/check_completion() + if(target && target.current) + if(target.current.stat == DEAD || !ishuman(target.current)) + return 1 + return 0 + return 1 -datum/objective/anti_revolution/brig +/datum/objective/anti_revolution/brig var/already_completed = 0 - find_target() - ..() - if(target && target.current) - explanation_text = "Brig [target.current.real_name], the [target.assigned_role] for 20 minutes to set an example." - else - explanation_text = "Free Objective" - return target +/datum/objective/anti_revolution/brig/find_target() + ..() + if(target && target.current) + explanation_text = "Brig [target.current.real_name], the [target.assigned_role] for 20 minutes to set an example." + else + explanation_text = "Free Objective" + return target - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - explanation_text = "Brig [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] for 20 minutes to set an example." - else - explanation_text = "Free Objective" - return target +/datum/objective/anti_revolution/brig/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "Brig [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] for 20 minutes to set an example." + else + explanation_text = "Free Objective" + return target - check_completion() - if(already_completed) - return 1 - - if(target && target.current) - if(target.current.stat == DEAD) - return 0 - if(target.is_brigged(10 * 60 * 10)) - already_completed = 1 - return 1 - return 0 - return 0 - -datum/objective/anti_revolution/demote - find_target() - ..() - if(target && target.current) - var/datum/gender/T = gender_datums[target.current.get_visible_gender()] - explanation_text = "[target.current.real_name], the [target.assigned_role] has been classified as harmful to [using_map.company_name]'s goals. Demote [T.him] to assistant." - else - explanation_text = "Free Objective" - return target - - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - var/datum/gender/T = gender_datums[target.current.get_visible_gender()] - explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has been classified as harmful to [using_map.company_name]'s goals. Demote [T.him] to assistant." - else - explanation_text = "Free Objective" - return target - - check_completion() - if(target && target.current && istype(target,/mob/living/carbon/human)) - var/obj/item/weapon/card/id/I = target.current:wear_id - if(istype(I, /obj/item/device/pda)) - var/obj/item/device/pda/P = I - I = P.id - - if(!istype(I)) return 1 - - if(I.assignment == "Assistant") - return 1 - else - return 0 +/datum/objective/anti_revolution/brig/check_completion() + if(already_completed) return 1 -datum/objective/debrain//I want braaaainssss - find_target() - ..() - if(target && target.current) - explanation_text = "Steal the brain of [target.current.real_name]." - else - explanation_text = "Free Objective" - return target - - - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - explanation_text = "Steal the brain of [target.current.real_name] the [!role_type ? target.assigned_role : target.special_role]." - else - explanation_text = "Free Objective" - return target - - check_completion() - if(!target)//If it's a free objective. - return 1 - if( !owner.current || owner.current.stat==DEAD )//If you're otherwise dead. + if(target && target.current) + if(target.current.stat == DEAD) return 0 - if( !target.current || !isbrain(target.current) ) - return 0 - var/atom/A = target.current - while(A.loc) //check to see if the brainmob is on our person - A = A.loc - if(A == owner.current) - return 1 - return 0 - - -datum/objective/protect//The opposite of killing a dude. - find_target() - ..() - if(target && target.current) - explanation_text = "Protect [target.current.real_name], the [target.assigned_role]." - else - explanation_text = "Free Objective" - return target - - - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - explanation_text = "Protect [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]." - else - explanation_text = "Free Objective" - return target - - check_completion() - if(!target) //If it's a free objective. - return 1 - if(target.current) - if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current)) - return 0 + if(target.is_brigged(10 * 60 * 10)) + already_completed = 1 return 1 return 0 + return 0 + +/datum/objective/anti_revolution/demote/find_target() + ..() + if(target && target.current) + var/datum/gender/T = gender_datums[target.current.get_visible_gender()] + explanation_text = "[target.current.real_name], the [target.assigned_role] has been classified as harmful to [using_map.company_name]'s goals. Demote [T.him] to assistant." + else + explanation_text = "Free Objective" + return target + +/datum/objective/anti_revolution/demote/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + var/datum/gender/T = gender_datums[target.current.get_visible_gender()] + explanation_text = "[target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] has been classified as harmful to [using_map.company_name]'s goals. Demote [T.him] to assistant." + else + explanation_text = "Free Objective" + return target + +/datum/objective/anti_revolution/demote/check_completion() + if(target && target.current && istype(target,/mob/living/carbon/human)) + var/obj/item/weapon/card/id/I = target.current:wear_id + if(istype(I, /obj/item/device/pda)) + var/obj/item/device/pda/P = I + I = P.id + + if(!istype(I)) return 1 + + if(I.assignment == "Assistant") + return 1 + else + return 0 + return 1 + +//I want braaaainssss +/datum/objective/debrain/find_target() + ..() + if(target && target.current) + explanation_text = "Steal the brain of [target.current.real_name]." + else + explanation_text = "Free Objective" + return target -datum/objective/hijack +/datum/objective/debrain/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "Steal the brain of [target.current.real_name] the [!role_type ? target.assigned_role : target.special_role]." + else + explanation_text = "Free Objective" + return target + +/datum/objective/debrain/check_completion() + if(!target)//If it's a free objective. + return 1 + if( !owner.current || owner.current.stat==DEAD )//If you're otherwise dead. + return 0 + if( !target.current || !isbrain(target.current) ) + return 0 + var/atom/A = target.current + while(A.loc) //check to see if the brainmob is on our person + A = A.loc + if(A == owner.current) + return 1 + return 0 + + +//The opposite of killing a dude. +/datum/objective/protect/find_target() + ..() + if(target && target.current) + explanation_text = "Protect [target.current.real_name], the [target.assigned_role]." + else + explanation_text = "Free Objective" + return target + + +/datum/objective/protect/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "Protect [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]." + else + explanation_text = "Free Objective" + return target + +/datum/objective/protect/check_completion() + if(!target) //If it's a free objective. + return 1 + if(target.current) + if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current)) + return 0 + return 1 + return 0 + + +/datum/objective/hijack explanation_text = "Hijack the emergency shuttle by escaping alone." - check_completion() - if(!owner.current || owner.current.stat) - return 0 - if(!emergency_shuttle.returned()) - return 0 - if(issilicon(owner.current)) - return 0 - var/area/shuttle = locate(/area/shuttle/escape/centcom) - var/list/protected_mobs = list(/mob/living/silicon/ai, /mob/living/silicon/pai) - for(var/mob/living/player in player_list) - if(player.type in protected_mobs) continue - if (player.mind && (player.mind != owner)) - if(player.stat != DEAD) //they're not dead! - if(get_turf(player) in shuttle) - return 0 - return 1 +/datum/objective/hijack/check_completion() + if(!owner.current || owner.current.stat) + return 0 + if(!emergency_shuttle.returned()) + return 0 + if(issilicon(owner.current)) + return 0 + var/area/shuttle = locate(/area/shuttle/escape/centcom) + var/list/protected_mobs = list(/mob/living/silicon/ai, /mob/living/silicon/pai) + for(var/mob/living/player in player_list) + if(player.type in protected_mobs) continue + if (player.mind && (player.mind != owner)) + if(player.stat != DEAD) //they're not dead! + if(get_turf(player) in shuttle) + return 0 + return 1 -datum/objective/block +/datum/objective/block explanation_text = "Do not allow any organic lifeforms to escape on the shuttle alive." - check_completion() - if(!istype(owner.current, /mob/living/silicon)) - return 0 - if(!emergency_shuttle.returned()) - return 0 - if(!owner.current) - return 0 - var/area/shuttle = locate(/area/shuttle/escape/centcom) - var/protected_mobs[] = list(/mob/living/silicon/ai, /mob/living/silicon/pai, /mob/living/silicon/robot) - for(var/mob/living/player in player_list) - if(player.type in protected_mobs) continue - if (player.mind) - if (player.stat != 2) - if (get_turf(player) in shuttle) - return 0 - return 1 +/datum/objective/block/check_completion() + if(!istype(owner.current, /mob/living/silicon)) + return 0 + if(!emergency_shuttle.returned()) + return 0 + if(!owner.current) + return 0 + var/area/shuttle = locate(/area/shuttle/escape/centcom) + var/protected_mobs[] = list(/mob/living/silicon/ai, /mob/living/silicon/pai, /mob/living/silicon/robot) + for(var/mob/living/player in player_list) + if(player.type in protected_mobs) continue + if (player.mind) + if (player.stat != 2) + if (get_turf(player) in shuttle) + return 0 + return 1 -datum/objective/silence +/datum/objective/silence explanation_text = "Do not allow anyone to escape the station. Only allow the shuttle to be called when everyone is dead and your story is the only one left." - check_completion() - if(!emergency_shuttle.returned()) - return 0 +/datum/objective/silence/check_completion() + if(!emergency_shuttle.returned()) + return 0 - for(var/mob/living/player in player_list) - if(player == owner.current) - continue - if(player.mind) - if(player.stat != DEAD) - var/turf/T = get_turf(player) - if(!T) continue - switch(T.loc.type) - if(/area/shuttle/escape/centcom, /area/shuttle/escape_pod1/centcom, /area/shuttle/escape_pod2/centcom, /area/shuttle/escape_pod3/centcom, /area/shuttle/escape_pod5/centcom) - return 0 - return 1 + for(var/mob/living/player in player_list) + if(player == owner.current) + continue + if(player.mind) + if(player.stat != DEAD) + var/turf/T = get_turf(player) + if(!T) continue + switch(T.loc.type) + if(/area/shuttle/escape/centcom, /area/shuttle/escape_pod1/centcom, /area/shuttle/escape_pod2/centcom, /area/shuttle/escape_pod3/centcom, /area/shuttle/escape_pod5/centcom) + return 0 + return 1 -datum/objective/escape +/datum/objective/escape explanation_text = "Escape on the shuttle or an escape pod alive and free." - check_completion() - if(issilicon(owner.current)) - return 0 - if(isbrain(owner.current)) - return 0 - if(!emergency_shuttle.returned()) - return 0 - if(!owner.current || owner.current.stat ==2) - return 0 - var/turf/location = get_turf(owner.current.loc) - if(!location) - return 0 +/datum/objective/escape/check_completion() + if(issilicon(owner.current)) + return 0 + if(isbrain(owner.current)) + return 0 + if(!emergency_shuttle.returned()) + return 0 + if(!owner.current || owner.current.stat ==2) + return 0 + var/turf/location = get_turf(owner.current.loc) + if(!location) + return 0 - if(istype(location, /turf/simulated/shuttle/floor4)) // Fails traitors if they are in the shuttle brig -- Polymorph - if(istype(owner.current, /mob/living/carbon)) - var/mob/living/carbon/C = owner.current - if (!C.handcuffed) - return 1 - return 0 + if(istype(location, /turf/simulated/shuttle/floor4)) // Fails traitors if they are in the shuttle brig -- Polymorph + if(istype(owner.current, /mob/living/carbon)) + var/mob/living/carbon/C = owner.current + if (!C.handcuffed) + return 1 + return 0 - var/area/check_area = location.loc - if(istype(check_area, /area/shuttle/escape/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod1/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod2/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod3/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod5/centcom)) - return 1 - else - return 0 + var/area/check_area = location.loc + if(istype(check_area, /area/shuttle/escape/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod1/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod2/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod3/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod5/centcom)) + return 1 + else + return 0 -datum/objective/survive +/datum/objective/survive explanation_text = "Stay alive until the end." - check_completion() - if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current)) - return 0 //Brains no longer win survive objectives. --NEO - if(issilicon(owner.current) && owner.current != owner.original) - return 0 - return 1 +/datum/objective/survive/check_completion() + if(!owner.current || owner.current.stat == DEAD || isbrain(owner.current)) + return 0 //Brains no longer win survive objectives. --NEO + if(issilicon(owner.current) && owner.current != owner.original) + return 0 + return 1 // Similar to the anti-rev objective, but for traitors -datum/objective/brig +/datum/objective/brig var/already_completed = 0 - find_target() - ..() - if(target && target.current) - explanation_text = "Have [target.current.real_name], the [target.assigned_role] brigged for 10 minutes." - else - explanation_text = "Free Objective" - return target +/datum/objective/brig/find_target() + ..() + if(target && target.current) + explanation_text = "Have [target.current.real_name], the [target.assigned_role] brigged for 10 minutes." + else + explanation_text = "Free Objective" + return target - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - explanation_text = "Have [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] brigged for 10 minutes." - else - explanation_text = "Free Objective" - return target +/datum/objective/brig/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "Have [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role] brigged for 10 minutes." + else + explanation_text = "Free Objective" + return target - check_completion() - if(already_completed) - return 1 +/datum/objective/brig/check_completion() + if(already_completed) + return 1 - if(target && target.current) - if(target.current.stat == DEAD) - return 0 - // Make the actual required time a bit shorter than the official time - if(target.is_brigged(10 * 60 * 5)) - already_completed = 1 - return 1 + if(target && target.current) + if(target.current.stat == DEAD) return 0 + // Make the actual required time a bit shorter than the official time + if(target.is_brigged(10 * 60 * 5)) + already_completed = 1 + return 1 return 0 + return 0 // Harm a crew member, making an example of them -datum/objective/harm +/datum/objective/harm var/already_completed = 0 - find_target() - ..() - if(target && target.current) - explanation_text = "Make an example of [target.current.real_name], the [target.assigned_role]. Break one of their bones, detach one of their limbs or disfigure their face. Make sure they're alive when you do it." - else - explanation_text = "Free Objective" - return target +/datum/objective/harm/find_target() + ..() + if(target && target.current) + explanation_text = "Make an example of [target.current.real_name], the [target.assigned_role]. Break one of their bones, detach one of their limbs or disfigure their face. Make sure they're alive when you do it." + else + explanation_text = "Free Objective" + return target - find_target_by_role(role, role_type=0) - ..(role, role_type) - if(target && target.current) - explanation_text = "Make an example of [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]. Break one of their bones, detach one of their limbs or disfigure their face. Make sure they're alive when you do it." - else - explanation_text = "Free Objective" - return target +/datum/objective/harm/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "Make an example of [target.current.real_name], the [!role_type ? target.assigned_role : target.special_role]. Break one of their bones, detach one of their limbs or disfigure their face. Make sure they're alive when you do it." + else + explanation_text = "Free Objective" + return target - check_completion() - if(already_completed) - return 1 +/datum/objective/harm/check_completion() + if(already_completed) + return 1 - if(target && target.current && istype(target.current, /mob/living/carbon/human)) - if(target.current.stat == DEAD) - return 0 + if(target && target.current && istype(target.current, /mob/living/carbon/human)) + if(target.current.stat == DEAD) + return 0 - var/mob/living/carbon/human/H = target.current - for(var/obj/item/organ/external/E in H.organs) - if(E.status & ORGAN_BROKEN) - return 1 - for(var/limb_tag in H.species.has_limbs) //todo check prefs for robotic limbs and amputations. - var/list/organ_data = H.species.has_limbs[limb_tag] - var/limb_type = organ_data["path"] - var/found - for(var/obj/item/organ/external/E in H.organs) - if(limb_type == E.type) - found = 1 - break - if(!found) - return 1 - - var/obj/item/organ/external/head/head = H.get_organ(BP_HEAD) - if(head.disfigured) + var/mob/living/carbon/human/H = target.current + for(var/obj/item/organ/external/E in H.organs) + if(E.status & ORGAN_BROKEN) return 1 - return 0 + for(var/limb_tag in H.species.has_limbs) //todo check prefs for robotic limbs and amputations. + var/list/organ_data = H.species.has_limbs[limb_tag] + var/limb_type = organ_data["path"] + var/found + for(var/obj/item/organ/external/E in H.organs) + if(limb_type == E.type) + found = 1 + break + if(!found) + return 1 + + var/obj/item/organ/external/head/head = H.get_organ(BP_HEAD) + if(head.disfigured) + return 1 + return 0 -datum/objective/nuclear +/datum/objective/nuclear explanation_text = "Destroy the station with a nuclear device." -datum/objective/steal +/datum/objective/steal var/obj/item/steal_target var/target_name @@ -461,346 +458,337 @@ datum/objective/steal ) - proc/set_target(item_name) - target_name = item_name - steal_target = possible_items[target_name] - if (!steal_target ) - steal_target = possible_items_special[target_name] +/datum/objective/steal/proc/set_target(item_name) + target_name = item_name + steal_target = possible_items[target_name] + if (!steal_target ) + steal_target = possible_items_special[target_name] + explanation_text = "Steal [target_name]." + return steal_target + + +/datum/objective/steal/find_target() + return set_target(pick(possible_items)) + + +/datum/objective/steal/proc/select_target() + var/list/possible_items_all = possible_items+possible_items_special+"custom" + var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all + if (!new_target) return + if (new_target == "custom") + var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item) + if (!custom_target) return + var/tmp_obj = new custom_target + var/custom_name = tmp_obj:name + qdel(tmp_obj) + custom_name = sanitize(input("Enter target name:", "Objective target", custom_name) as text|null) + if (!custom_name) return + target_name = custom_name + steal_target = custom_target explanation_text = "Steal [target_name]." - return steal_target + else + set_target(new_target) + return steal_target +/datum/objective/steal/check_completion() + if(!steal_target || !owner.current) return 0 + if(!isliving(owner.current)) return 0 + var/list/all_items = owner.current.get_contents() + switch (target_name) + if("28 moles of phoron (full tank)","10 diamonds","50 gold bars","25 refined uranium bars") + var/target_amount = text2num(target_name)//Non-numbers are ignored. + var/found_amount = 0.0//Always starts as zero. - find_target() - return set_target(pick(possible_items)) + for(var/obj/item/I in all_items) //Check for phoron tanks + if(istype(I, steal_target)) + found_amount += (target_name=="28 moles of phoron (full tank)" ? (I:air_contents:gas["phoron"]) : (I:amount)) + return found_amount>=target_amount + if("50 coins (in bag)") + var/obj/item/weapon/moneybag/B = locate() in all_items - proc/select_target() - var/list/possible_items_all = possible_items+possible_items_special+"custom" - var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all - if (!new_target) return - if (new_target == "custom") - var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item) - if (!custom_target) return - var/tmp_obj = new custom_target - var/custom_name = tmp_obj:name - qdel(tmp_obj) - custom_name = sanitize(input("Enter target name:", "Objective target", custom_name) as text|null) - if (!custom_name) return - target_name = custom_name - steal_target = custom_target - explanation_text = "Steal [target_name]." - else - set_target(new_target) - return steal_target + if(B) + var/target = text2num(target_name) + var/found_amount = 0.0 + for(var/obj/item/weapon/coin/C in B) + found_amount++ + return found_amount>=target - check_completion() - if(!steal_target || !owner.current) return 0 - if(!isliving(owner.current)) return 0 - var/list/all_items = owner.current.get_contents() - switch (target_name) - if("28 moles of phoron (full tank)","10 diamonds","50 gold bars","25 refined uranium bars") - var/target_amount = text2num(target_name)//Non-numbers are ignored. - var/found_amount = 0.0//Always starts as zero. + if("a functional AI") - for(var/obj/item/I in all_items) //Check for phoron tanks - if(istype(I, steal_target)) - found_amount += (target_name=="28 moles of phoron (full tank)" ? (I:air_contents:gas["phoron"]) : (I:amount)) - return found_amount>=target_amount - - if("50 coins (in bag)") - var/obj/item/weapon/moneybag/B = locate() in all_items - - if(B) - var/target = text2num(target_name) - var/found_amount = 0.0 - for(var/obj/item/weapon/coin/C in B) - found_amount++ - return found_amount>=target - - if("a functional AI") - - for(var/obj/item/device/aicard/C in all_items) //Check for ai card - for(var/mob/living/silicon/ai/M in C) - if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card. - return 1 - - for(var/mob/living/silicon/ai/ai in mob_list) - var/turf/T = get_turf(ai) - if(istype(T)) - var/area/check_area = get_area(ai) - if(istype(check_area, /area/shuttle/escape/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod1/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod2/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod3/centcom)) - return 1 - if(istype(check_area, /area/shuttle/escape_pod5/centcom)) - return 1 - else - - for(var/obj/I in all_items) //Check for items - if(istype(I, steal_target)) + for(var/obj/item/device/aicard/C in all_items) //Check for ai card + for(var/mob/living/silicon/ai/M in C) + if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card. return 1 + + for(var/mob/living/silicon/ai/ai in mob_list) + var/turf/T = get_turf(ai) + if(istype(T)) + var/area/check_area = get_area(ai) + if(istype(check_area, /area/shuttle/escape/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod1/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod2/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod3/centcom)) + return 1 + if(istype(check_area, /area/shuttle/escape_pod5/centcom)) + return 1 + else + + for(var/obj/I in all_items) //Check for items + if(istype(I, steal_target)) + return 1 + return 0 + + + +/datum/objective/download/proc/gen_amount_goal() + target_amount = rand(10,20) + explanation_text = "Download [target_amount] research levels." + return target_amount + + +/datum/objective/download/check_completion() + if(!ishuman(owner.current)) + return 0 + if(!owner.current || owner.current.stat == 2) return 0 + var/current_amount + var/obj/item/weapon/rig/S + if(istype(owner.current,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = owner.current + S = H.back + + if(!istype(S) || !S.installed_modules || !S.installed_modules.len) + return 0 + + var/obj/item/rig_module/datajack/stolen_data = locate() in S.installed_modules + if(!istype(stolen_data)) + return 0 + + for(var/datum/tech/current_data in stolen_data.stored_research) + if(current_data.level > 1) + current_amount += (current_data.level-1) + + return (current_amount 1) - current_amount += (current_data.level-1) - - return (current_amount= target_amount)) return 1 - - -/datum/objective/absorb - proc/gen_amount_goal(var/lowbound = 4, var/highbound = 6) - target_amount = rand (lowbound,highbound) - if (ticker) - var/n_p = 1 //autowin - if (ticker.current_state == GAME_STATE_SETTING_UP) - for(var/mob/new_player/P in player_list) - if(P.client && P.ready && P.mind!=owner) - n_p ++ - else if (ticker.current_state == GAME_STATE_PLAYING) - for(var/mob/living/carbon/human/P in player_list) - if(P.client && !(P.mind.changeling) && P.mind!=owner) - n_p ++ - target_amount = min(target_amount, n_p) - - explanation_text = "Absorb [target_amount] compatible genomes." - return target_amount - - check_completion() - if(owner && owner.changeling && owner.changeling.absorbed_dna && (owner.changeling.absorbedcount >= target_amount)) - return 1 - else - return 0 + else + return 0 // Heist objectives. -datum/objective/heist - proc/choose_target() - return +/datum/objective/heist/proc/choose_target() + return -datum/objective/heist/kidnap - choose_target() - var/list/roles = list("Chief Engineer","Research Director","Roboticist","Chemist","Station Engineer") - var/list/possible_targets = list() - var/list/priority_targets = list() +/datum/objective/heist/kidnap/choose_target() + var/list/roles = list("Chief Engineer","Research Director","Roboticist","Chemist","Station Engineer") + var/list/possible_targets = list() + var/list/priority_targets = list() - for(var/datum/mind/possible_target in ticker.minds) - if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2) && (!possible_target.special_role)) - possible_targets += possible_target - for(var/role in roles) - if(possible_target.assigned_role == role) - priority_targets += possible_target - continue + for(var/datum/mind/possible_target in ticker.minds) + if(possible_target != owner && ishuman(possible_target.current) && (possible_target.current.stat != 2) && (!possible_target.special_role)) + possible_targets += possible_target + for(var/role in roles) + if(possible_target.assigned_role == role) + priority_targets += possible_target + continue - if(priority_targets.len > 0) - target = pick(priority_targets) - else if(possible_targets.len > 0) - target = pick(possible_targets) + if(priority_targets.len > 0) + target = pick(priority_targets) + else if(possible_targets.len > 0) + target = pick(possible_targets) - if(target && target.current) - explanation_text = "We can get a good price for [target.current.real_name], the [target.assigned_role]. Take them alive." - else - explanation_text = "Free Objective" - return target + if(target && target.current) + explanation_text = "We can get a good price for [target.current.real_name], the [target.assigned_role]. Take them alive." + else + explanation_text = "Free Objective" + return target - check_completion() - if(target && target.current) - if (target.current.stat == 2) - return 0 // They're dead. Fail. - //if (!target.current.restrained()) - // return 0 // They're loose. Close but no cigar. - - var/area/skipjack_station/start/A = locate() - for(var/mob/living/carbon/human/M in A) - if(target.current == M) - return 1 //They're restrained on the shuttle. Success. - else - return 0 - -datum/objective/heist/loot - - choose_target() - var/loot = "an object" - switch(rand(1,8)) - if(1) - target = /obj/structure/particle_accelerator - target_amount = 6 - loot = "a complete particle accelerator" - if(2) - target = /obj/machinery/the_singularitygen - target_amount = 1 - loot = "a gravitational generator" - if(3) - target = /obj/machinery/power/emitter - target_amount = 4 - loot = "four emitters" - if(4) - target = /obj/machinery/nuclearbomb - target_amount = 1 - loot = "a nuclear bomb" - if(5) - target = /obj/item/weapon/gun - target_amount = 6 - loot = "six guns" - if(6) - target = /obj/item/weapon/gun/energy - target_amount = 4 - loot = "four energy guns" - if(7) - target = /obj/item/weapon/gun/energy/laser - target_amount = 2 - loot = "two laser guns" - if(8) - target = /obj/item/weapon/gun/energy/ionrifle - target_amount = 1 - loot = "an ion gun" - - explanation_text = "It's a buyer's market out here. Steal [loot] for resale." - - check_completion() - - var/total_amount = 0 - - for(var/obj/O in locate(/area/skipjack_station/start)) - if(istype(O,target)) total_amount++ - for(var/obj/I in O.contents) - if(istype(I,target)) total_amount++ - if(total_amount >= target_amount) return 1 - - for(var/datum/mind/raider in raiders.current_antagonists) - if(raider.current) - for(var/obj/O in raider.current.get_contents()) - if(istype(O,target)) total_amount++ - if(total_amount >= target_amount) return 1 +/datum/objective/heist/kidnap/check_completion() + if(target && target.current) + if (target.current.stat == 2) + return 0 // They're dead. Fail. + //if (!target.current.restrained()) + // return 0 // They're loose. Close but no cigar. + var/area/skipjack_station/start/A = locate() + for(var/mob/living/carbon/human/M in A) + if(target.current == M) + return 1 //They're restrained on the shuttle. Success. + else return 0 -datum/objective/heist/salvage +/datum/objective/heist/loot/choose_target() + var/loot = "an object" + switch(rand(1,8)) + if(1) + target = /obj/structure/particle_accelerator + target_amount = 6 + loot = "a complete particle accelerator" + if(2) + target = /obj/machinery/the_singularitygen + target_amount = 1 + loot = "a gravitational generator" + if(3) + target = /obj/machinery/power/emitter + target_amount = 4 + loot = "four emitters" + if(4) + target = /obj/machinery/nuclearbomb + target_amount = 1 + loot = "a nuclear bomb" + if(5) + target = /obj/item/weapon/gun + target_amount = 6 + loot = "six guns" + if(6) + target = /obj/item/weapon/gun/energy + target_amount = 4 + loot = "four energy guns" + if(7) + target = /obj/item/weapon/gun/energy/laser + target_amount = 2 + loot = "two laser guns" + if(8) + target = /obj/item/weapon/gun/energy/ionrifle + target_amount = 1 + loot = "an ion gun" - choose_target() - switch(rand(1,8)) - if(1) - target = DEFAULT_WALL_MATERIAL - target_amount = 300 - if(2) - target = "glass" - target_amount = 200 - if(3) - target = "plasteel" - target_amount = 100 - if(4) - target = "phoron" - target_amount = 100 - if(5) - target = "silver" - target_amount = 50 - if(6) - target = "gold" - target_amount = 20 - if(7) - target = "uranium" - target_amount = 20 - if(8) - target = "diamond" - target_amount = 20 + explanation_text = "It's a buyer's market out here. Steal [loot] for resale." - explanation_text = "Ransack the station and escape with [target_amount] [target]." - check_completion() +/datum/objective/heist/loot/check_completion() + var/total_amount = 0 - var/total_amount = 0 + for(var/obj/O in locate(/area/skipjack_station/start)) + if(istype(O,target)) total_amount++ + for(var/obj/I in O.contents) + if(istype(I,target)) total_amount++ + if(total_amount >= target_amount) return 1 - for(var/obj/item/O in locate(/area/skipjack_station/start)) + for(var/datum/mind/raider in raiders.current_antagonists) + if(raider.current) + for(var/obj/O in raider.current.get_contents()) + if(istype(O,target)) total_amount++ + if(total_amount >= target_amount) return 1 - var/obj/item/stack/material/S - if(istype(O,/obj/item/stack/material)) - if(O.name == target) - S = O + return 0 + +/datum/objective/heist/salvage/choose_target() + switch(rand(1,8)) + if(1) + target = DEFAULT_WALL_MATERIAL + target_amount = 300 + if(2) + target = "glass" + target_amount = 200 + if(3) + target = "plasteel" + target_amount = 100 + if(4) + target = "phoron" + target_amount = 100 + if(5) + target = "silver" + target_amount = 50 + if(6) + target = "gold" + target_amount = 20 + if(7) + target = "uranium" + target_amount = 20 + if(8) + target = "diamond" + target_amount = 20 + + explanation_text = "Ransack the station and escape with [target_amount] [target]." + +/datum/objective/heist/salvage/check_completion() + + var/total_amount = 0 + + for(var/obj/item/O in locate(/area/skipjack_station/start)) + + var/obj/item/stack/material/S + if(istype(O,/obj/item/stack/material)) + if(O.name == target) + S = O + total_amount += S.get_amount() + for(var/obj/I in O.contents) + if(istype(I,/obj/item/stack/material)) + if(I.name == target) + S = I total_amount += S.get_amount() - for(var/obj/I in O.contents) - if(istype(I,/obj/item/stack/material)) - if(I.name == target) - S = I + + for(var/datum/mind/raider in raiders.current_antagonists) + if(raider.current) + for(var/obj/item/O in raider.current.get_contents()) + if(istype(O,/obj/item/stack/material)) + if(O.name == target) + var/obj/item/stack/material/S = O total_amount += S.get_amount() - for(var/datum/mind/raider in raiders.current_antagonists) - if(raider.current) - for(var/obj/item/O in raider.current.get_contents()) - if(istype(O,/obj/item/stack/material)) - if(O.name == target) - var/obj/item/stack/material/S = O - total_amount += S.get_amount() - - if(total_amount >= target_amount) return 1 - return 0 + if(total_amount >= target_amount) return 1 + return 0 /datum/objective/heist/preserve_crew explanation_text = "Do not leave anyone behind, alive or dead." - check_completion() - if(raiders && raiders.is_raider_crew_safe()) return 1 - return 0 +/datum/objective/heist/preserve_crew/check_completion() + if(raiders && raiders.is_raider_crew_safe()) return 1 + return 0 //Borer objective(s). /datum/objective/borer_survive diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 11f070f2f5..cde2f9a2a2 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -29,7 +29,7 @@ mob if(sandbox) sandbox.update() -datum/hSB +/datum/hSB var/owner = null var/admin = 0 proc @@ -102,7 +102,7 @@ datum/hSB var/accesses = get_all_accesses() for(var/A in accesses) if(alert(usr, "Will this airlock require [get_access_desc(A)] access?", "Sandbox:", "Yes", "No") == "Yes") - hsb.req_access += A + LAZYADD(hsb.req_access, A) hsb.loc = usr.loc to_chat(usr, "Sandbox: Created an airlock.") diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm index 6d55f80cb4..1c2ed98e36 100644 --- a/code/game/gamemodes/technomancer/spell_objs.dm +++ b/code/game/gamemodes/technomancer/spell_objs.dm @@ -1,26 +1,3 @@ -//cast_method flags -#define CAST_USE 1 // Clicking the spell in your hand. -#define CAST_MELEE 2 // Clicking an atom in melee range. -#define CAST_RANGED 4 // Clicking an atom beyond melee range. -#define CAST_THROW 8 // Throwing the spell and hitting an atom. -#define CAST_COMBINE 16 // Clicking another spell with this spell. -#define CAST_INNATE 32 // Activates upon verb usage, used for mobs without hands. - -//Aspects -#define ASPECT_FIRE "fire" //Damage over time and raising body-temp. Firesuits protect from this. -#define ASPECT_FROST "frost" //Slows down the affected, also involves imbedding with icicles. Winter coats protect from this. -#define ASPECT_SHOCK "shock" //Energy-expensive, usually stuns. Insulated armor protects from this. -#define ASPECT_AIR "air" //Mostly involves manipulation of atmos, useless in a vacuum. Magboots protect from this. -#define ASPECT_FORCE "force" //Manipulates gravity to push things away or towards a location. -#define ASPECT_TELE "tele" //Teleportation of self, other objects, or other people. -#define ASPECT_DARK "dark" //Makes all those photons vanish using magic-- WITH SCIENCE. Used for sneaky stuff. -#define ASPECT_LIGHT "light" //The opposite of dark, usually blinds, makes holo-illusions, or makes laser lightshows. -#define ASPECT_BIOMED "biomed" //Mainly concerned with healing and restoration. -#define ASPECT_EMP "emp" //Unused now. -#define ASPECT_UNSTABLE "unstable" //Heavily RNG-based, causes instability to the victim. -#define ASPECT_CHROMATIC "chromatic" //Used to combine with other spells. -#define ASPECT_UNHOLY "unholy" //Involves the dead, blood, and most things against divine beings. - /obj/item/weapon/spell name = "glowing particles" desc = "Your hands appear to be glowing brightly." diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 71809a2b72..4861e73ca0 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -1,21 +1,9 @@ -//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 - -/obj/var/list/req_access = list() -/obj/var/list/req_one_access = list() +/obj/var/list/req_access +/obj/var/list/req_one_access //returns 1 if this mob has sufficient access to use this object /obj/proc/allowed(mob/M) - //check if it doesn't require any access at all - if(src.check_access(null)) - return 1 - - var/id = M.GetIdCard() - if(id) - return check_access(id) - return 0 - -///obj/item/proc/GetAccess() -// return list() + return check_access(M?.GetIdCard()) /atom/movable/proc/GetAccess() var/obj/item/weapon/card/id/id = GetIdCard() @@ -25,25 +13,36 @@ return null /obj/proc/check_access(obj/item/I) - return check_access_list(I ? I.GetAccess() : list()) + return check_access_list(I ? I.GetAccess() : null) /obj/proc/check_access_list(var/list/L) - if(!req_access) req_access = list() - if(!req_one_access) req_one_access = list() - if(!L) return 0 - if(!istype(L, /list)) return 0 + // We don't require access + if(!LAZYLEN(req_access) && !LAZYLEN(req_one_access)) + return TRUE + + // They passed nothing, but we are something that requires access + if(!LAZYLEN(L)) + return FALSE + + // Run list comparisons return has_access(req_access, req_one_access, L) /proc/has_access(var/list/req_access, var/list/req_one_access, var/list/accesses) + // req_access list has priority if set + // Requires at least every access in list for(var/req in req_access) - if(!(req in accesses)) //doesn't have this access - return 0 - if(req_one_access.len) + if(!(req in accesses)) + return FALSE + + // req_one_access is secondary if set + // Requires at least one access in list + if(LAZYLEN(req_one_access)) for(var/req in req_one_access) - if(req in accesses) //has an access from the single access list - return 1 - return 0 - return 1 + if(req in accesses) + return TRUE + return FALSE + + return TRUE /proc/get_centcom_access(job) switch(job) @@ -230,13 +229,13 @@ /mob/living/silicon/GetIdCard() return idcard -proc/FindNameFromID(var/mob/living/carbon/human/H) +/proc/FindNameFromID(var/mob/living/carbon/human/H) ASSERT(istype(H)) var/obj/item/weapon/card/id/C = H.GetIdCard() if(C) return C.registered_name -proc/get_all_job_icons() //For all existing HUD icons +/proc/get_all_job_icons() //For all existing HUD icons return joblist + list("Prisoner") /obj/proc/GetJobName() //Used in secHUD icon generation diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 4cbdae35f6..5eaede945a 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -14,602 +14,602 @@ var/global/datum/controller/occupations/job_master //Cache of icons for job info window var/list/job_icons = list() - proc/SetupOccupations(var/faction = "Station") - occupations = list() - //var/list/all_jobs = typesof(/datum/job) - var/list/all_jobs = list(/datum/job/assistant) | using_map.allowed_jobs - if(!all_jobs.len) - to_world("Error setting up jobs, no job datums found!") - return 0 - for(var/J in all_jobs) - var/datum/job/job = new J() - if(!job) continue - if(job.faction != faction) continue - occupations += job - sortTim(occupations, /proc/cmp_job_datums) - - - return 1 - - - proc/Debug(var/text) - if(!Debug2) return 0 - job_debug.Add(text) - return 1 - - - proc/GetJob(var/rank) - if(!rank) return null - for(var/datum/job/J in occupations) - if(!J) continue - if(J.title == rank) return J - return null - - proc/GetPlayerAltTitle(mob/new_player/player, rank) - return player.client.prefs.GetPlayerAltTitle(GetJob(rank)) - - proc/AssignRole(var/mob/new_player/player, var/rank, var/latejoin = 0) - Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]") - if(player && player.mind && rank) - var/datum/job/job = GetJob(rank) - if(!job) - return 0 - if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) - return 0 - if(jobban_isbanned(player, rank)) - return 0 - if(!job.player_old_enough(player.client)) - return 0 - - var/position_limit = job.total_positions - if(!latejoin) - position_limit = job.spawn_positions - if((job.current_positions < position_limit) || position_limit == -1) - Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]") - player.mind.assigned_role = rank - player.mind.role_alt_title = GetPlayerAltTitle(player, rank) - unassigned -= player - job.current_positions++ - return 1 - Debug("AR has failed, Player: [player], Rank: [rank]") +/datum/controller/occupations/proc/SetupOccupations(var/faction = "Station") + occupations = list() + //var/list/all_jobs = typesof(/datum/job) + var/list/all_jobs = list(/datum/job/assistant) | using_map.allowed_jobs + if(!all_jobs.len) + to_world("Error setting up jobs, no job datums found!") return 0 + for(var/J in all_jobs) + var/datum/job/job = new J() + if(!job) continue + if(job.faction != faction) continue + occupations += job + sortTim(occupations, /proc/cmp_job_datums) - proc/FreeRole(var/rank) //making additional slot on the fly + + return 1 + + +/datum/controller/occupations/proc/Debug(var/text) + if(!Debug2) return 0 + job_debug.Add(text) + return 1 + + +/datum/controller/occupations/proc/GetJob(var/rank) + if(!rank) return null + for(var/datum/job/J in occupations) + if(!J) continue + if(J.title == rank) return J + return null + +/datum/controller/occupations/proc/GetPlayerAltTitle(mob/new_player/player, rank) + return player.client.prefs.GetPlayerAltTitle(GetJob(rank)) + +/datum/controller/occupations/proc/AssignRole(var/mob/new_player/player, var/rank, var/latejoin = 0) + Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]") + if(player && player.mind && rank) var/datum/job/job = GetJob(rank) - if(job && job.total_positions != -1) - job.total_positions++ + if(!job) + return 0 + if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + return 0 + if(jobban_isbanned(player, rank)) + return 0 + if(!job.player_old_enough(player.client)) + return 0 + + var/position_limit = job.total_positions + if(!latejoin) + position_limit = job.spawn_positions + if((job.current_positions < position_limit) || position_limit == -1) + Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]") + player.mind.assigned_role = rank + player.mind.role_alt_title = GetPlayerAltTitle(player, rank) + unassigned -= player + job.current_positions++ return 1 - return 0 + Debug("AR has failed, Player: [player], Rank: [rank]") + return 0 - proc/FindOccupationCandidates(datum/job/job, level, flag) - Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]") - var/list/candidates = list() - for(var/mob/new_player/player in unassigned) - if(jobban_isbanned(player, job.title)) - Debug("FOC isbanned failed, Player: [player]") - continue - if(!job.player_old_enough(player.client)) - Debug("FOC player not old enough, Player: [player]") - continue - if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) - Debug("FOC character not old enough, Player: [player]") - continue - if(flag && (!player.client.prefs.be_special & flag)) - Debug("FOC flag failed, Player: [player], Flag: [flag], ") - continue - if(player.client.prefs.GetJobDepartment(job, level) & job.flag) - Debug("FOC pass, Player: [player], Level:[level]") - candidates += player - return candidates +/datum/controller/occupations/proc/FreeRole(var/rank) //making additional slot on the fly + var/datum/job/job = GetJob(rank) + if(job && job.total_positions != -1) + job.total_positions++ + return 1 + return 0 - proc/GiveRandomJob(var/mob/new_player/player) - Debug("GRJ Giving random job, Player: [player]") - for(var/datum/job/job in shuffle(occupations)) - if(!job) - continue +/datum/controller/occupations/proc/FindOccupationCandidates(datum/job/job, level, flag) + Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]") + var/list/candidates = list() + for(var/mob/new_player/player in unassigned) + if(jobban_isbanned(player, job.title)) + Debug("FOC isbanned failed, Player: [player]") + continue + if(!job.player_old_enough(player.client)) + Debug("FOC player not old enough, Player: [player]") + continue + if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + Debug("FOC character not old enough, Player: [player]") + continue + if(flag && !(player.client.prefs.be_special & flag)) + Debug("FOC flag failed, Player: [player], Flag: [flag], ") + continue + if(player.client.prefs.GetJobDepartment(job, level) & job.flag) + Debug("FOC pass, Player: [player], Level:[level]") + candidates += player + return candidates - if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) - continue +/datum/controller/occupations/proc/GiveRandomJob(var/mob/new_player/player) + Debug("GRJ Giving random job, Player: [player]") + for(var/datum/job/job in shuffle(occupations)) + if(!job) + continue - if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring! - continue + if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + continue - if(SSjob.is_job_in_department(job.title, DEPARTMENT_COMMAND)) //If you want a command position, select it! - continue + if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring! + continue - if(jobban_isbanned(player, job.title)) - Debug("GRJ isbanned failed, Player: [player], Job: [job.title]") - continue + if(SSjob.is_job_in_department(job.title, DEPARTMENT_COMMAND)) //If you want a command position, select it! + continue - if(!job.player_old_enough(player.client)) - Debug("GRJ player not old enough, Player: [player]") - continue + if(jobban_isbanned(player, job.title)) + Debug("GRJ isbanned failed, Player: [player], Job: [job.title]") + continue - if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) - Debug("GRJ Random job given, Player: [player], Job: [job]") - AssignRole(player, job.title) - unassigned -= player - break + if(!job.player_old_enough(player.client)) + Debug("GRJ player not old enough, Player: [player]") + continue - proc/ResetOccupations() - for(var/mob/new_player/player in player_list) - if((player) && (player.mind)) - player.mind.assigned_role = null - player.mind.special_role = null - SetupOccupations() - unassigned = list() - return + if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) + Debug("GRJ Random job given, Player: [player], Job: [job]") + AssignRole(player, job.title) + unassigned -= player + break + +/datum/controller/occupations/proc/ResetOccupations() + for(var/mob/new_player/player in player_list) + if((player) && (player.mind)) + player.mind.assigned_role = null + player.mind.special_role = null + SetupOccupations() + unassigned = list() + return - ///This proc is called before the level loop of DivideOccupations() and will try to select a head, ignoring ALL non-head preferences for every level until it locates a head or runs out of levels to check - proc/FillHeadPosition() - for(var/level = 1 to 3) - for(var/command_position in SSjob.get_job_titles_in_department(DEPARTMENT_COMMAND)) - var/datum/job/job = GetJob(command_position) - if(!job) continue - var/list/candidates = FindOccupationCandidates(job, level) - if(!candidates.len) continue - - // Build a weighted list, weight by age. - var/list/weightedCandidates = list() - for(var/mob/V in candidates) - // Log-out during round-start? What a bad boy, no head position for you! - if(!V.client) continue - var/age = V.client.prefs.age - - if(age < job.minimum_character_age) // Nope. - continue - - switch(age) - if(job.minimum_character_age to (job.minimum_character_age+10)) - weightedCandidates[V] = 3 // Still a bit young. - if((job.minimum_character_age+10) to (job.ideal_character_age-10)) - weightedCandidates[V] = 6 // Better. - if((job.ideal_character_age-10) to (job.ideal_character_age+10)) - weightedCandidates[V] = 10 // Great. - if((job.ideal_character_age+10) to (job.ideal_character_age+20)) - weightedCandidates[V] = 6 // Still good. - if((job.ideal_character_age+20) to INFINITY) - weightedCandidates[V] = 3 // Geezer. - else - // If there's ABSOLUTELY NOBODY ELSE - if(candidates.len == 1) weightedCandidates[V] = 1 - - - var/mob/new_player/candidate = pickweight(weightedCandidates) - if(AssignRole(candidate, command_position)) - return 1 - return 0 - - - ///This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level - proc/CheckHeadPositions(var/level) +///This proc is called before the level loop of DivideOccupations() and will try to select a head, ignoring ALL non-head preferences for every level until it locates a head or runs out of levels to check +/datum/controller/occupations/proc/FillHeadPosition() + for(var/level = 1 to 3) for(var/command_position in SSjob.get_job_titles_in_department(DEPARTMENT_COMMAND)) var/datum/job/job = GetJob(command_position) if(!job) continue var/list/candidates = FindOccupationCandidates(job, level) if(!candidates.len) continue - var/mob/new_player/candidate = pick(candidates) - AssignRole(candidate, command_position) - return + + // Build a weighted list, weight by age. + var/list/weightedCandidates = list() + for(var/mob/V in candidates) + // Log-out during round-start? What a bad boy, no head position for you! + if(!V.client) continue + var/age = V.client.prefs.age + + if(age < job.minimum_character_age) // Nope. + continue + + switch(age) + if(job.minimum_character_age to (job.minimum_character_age+10)) + weightedCandidates[V] = 3 // Still a bit young. + if((job.minimum_character_age+10) to (job.ideal_character_age-10)) + weightedCandidates[V] = 6 // Better. + if((job.ideal_character_age-10) to (job.ideal_character_age+10)) + weightedCandidates[V] = 10 // Great. + if((job.ideal_character_age+10) to (job.ideal_character_age+20)) + weightedCandidates[V] = 6 // Still good. + if((job.ideal_character_age+20) to INFINITY) + weightedCandidates[V] = 3 // Geezer. + else + // If there's ABSOLUTELY NOBODY ELSE + if(candidates.len == 1) weightedCandidates[V] = 1 + + + var/mob/new_player/candidate = pickweight(weightedCandidates) + if(AssignRole(candidate, command_position)) + return 1 + return 0 + + +///This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level +/datum/controller/occupations/proc/CheckHeadPositions(var/level) + for(var/command_position in SSjob.get_job_titles_in_department(DEPARTMENT_COMMAND)) + var/datum/job/job = GetJob(command_position) + if(!job) continue + var/list/candidates = FindOccupationCandidates(job, level) + if(!candidates.len) continue + var/mob/new_player/candidate = pick(candidates) + AssignRole(candidate, command_position) + return /** Proc DivideOccupations * fills var "assigned_role" for all ready players. * This proc must not have any side effect besides of modifying "assigned_role". **/ - proc/DivideOccupations() - //Setup new player list and get the jobs list - Debug("Running DO") - SetupOccupations() +/datum/controller/occupations/proc/DivideOccupations() + //Setup new player list and get the jobs list + Debug("Running DO") + SetupOccupations() - //Holder for Triumvirate is stored in the ticker, this just processes it - if(ticker && ticker.triai) - for(var/datum/job/A in occupations) - if(A.title == "AI") - A.spawn_positions = 3 - break + //Holder for Triumvirate is stored in the ticker, this just processes it + if(ticker && ticker.triai) + for(var/datum/job/A in occupations) + if(A.title == "AI") + A.spawn_positions = 3 + break - //Get the players who are ready - for(var/mob/new_player/player in player_list) - if(player.ready && player.mind && !player.mind.assigned_role) - unassigned += player + //Get the players who are ready + for(var/mob/new_player/player in player_list) + if(player.ready && player.mind && !player.mind.assigned_role) + unassigned += player - Debug("DO, Len: [unassigned.len]") - if(unassigned.len == 0) return 0 + Debug("DO, Len: [unassigned.len]") + if(unassigned.len == 0) return 0 - //Shuffle players and jobs - unassigned = shuffle(unassigned) + //Shuffle players and jobs + unassigned = shuffle(unassigned) - HandleFeedbackGathering() + HandleFeedbackGathering() - //People who wants to be assistants, sure, go on. - Debug("DO, Running Assistant Check 1") - var/datum/job/assist = new DEFAULT_JOB_TYPE () - var/list/assistant_candidates = FindOccupationCandidates(assist, 3) - Debug("AC1, Candidates: [assistant_candidates.len]") - for(var/mob/new_player/player in assistant_candidates) - Debug("AC1 pass, Player: [player]") - AssignRole(player, "Assistant") - assistant_candidates -= player - Debug("DO, AC1 end") + //People who wants to be assistants, sure, go on. + Debug("DO, Running Assistant Check 1") + var/datum/job/assist = new DEFAULT_JOB_TYPE () + var/list/assistant_candidates = FindOccupationCandidates(assist, 3) + Debug("AC1, Candidates: [assistant_candidates.len]") + for(var/mob/new_player/player in assistant_candidates) + Debug("AC1 pass, Player: [player]") + AssignRole(player, "Assistant") + assistant_candidates -= player + Debug("DO, AC1 end") - //Select one head - Debug("DO, Running Head Check") - FillHeadPosition() - Debug("DO, Head Check end") + //Select one head + Debug("DO, Running Head Check") + FillHeadPosition() + Debug("DO, Head Check end") - //Other jobs are now checked - Debug("DO, Running Standard Check") + //Other jobs are now checked + Debug("DO, Running Standard Check") - // New job giving system by Donkie - // This will cause lots of more loops, but since it's only done once it shouldn't really matter much at all. - // Hopefully this will add more randomness and fairness to job giving. + // New job giving system by Donkie + // This will cause lots of more loops, but since it's only done once it shouldn't really matter much at all. + // Hopefully this will add more randomness and fairness to job giving. - // Loop through all levels from high to low - var/list/shuffledoccupations = shuffle(occupations) - // var/list/disabled_jobs = ticker.mode.disabled_jobs // So we can use .Find down below without a colon. - for(var/level = 1 to 3) - //Check the head jobs first each level - CheckHeadPositions(level) + // Loop through all levels from high to low + var/list/shuffledoccupations = shuffle(occupations) + // var/list/disabled_jobs = ticker.mode.disabled_jobs // So we can use .Find down below without a colon. + for(var/level = 1 to 3) + //Check the head jobs first each level + CheckHeadPositions(level) - // Loop through all unassigned players - for(var/mob/new_player/player in unassigned) - - // Loop through all jobs - for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY - if(!job || ticker.mode.disabled_jobs.Find(job.title) ) - continue - - if(jobban_isbanned(player, job.title)) - Debug("DO isbanned failed, Player: [player], Job:[job.title]") - continue - - if(!job.player_old_enough(player.client)) - Debug("DO player not old enough, Player: [player], Job:[job.title]") - continue - - // If the player wants that job on this level, then try give it to him. - if(player.client.prefs.GetJobDepartment(job, level) & job.flag) - - // If the job isn't filled - if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) - Debug("DO pass, Player: [player], Level:[level], Job:[job.title]") - AssignRole(player, job.title) - unassigned -= player - break - - // Hand out random jobs to the people who didn't get any in the last check - // Also makes sure that they got their preference correct + // Loop through all unassigned players for(var/mob/new_player/player in unassigned) - if(player.client.prefs.alternate_option == GET_RANDOM_JOB) - GiveRandomJob(player) - /* - Old job system - for(var/level = 1 to 3) - for(var/datum/job/job in occupations) - Debug("Checking job: [job]") - if(!job) + + // Loop through all jobs + for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY + if(!job || ticker.mode.disabled_jobs.Find(job.title) ) continue - if(!unassigned.len) - break - if((job.current_positions >= job.spawn_positions) && job.spawn_positions != -1) + + if(jobban_isbanned(player, job.title)) + Debug("DO isbanned failed, Player: [player], Job:[job.title]") continue - var/list/candidates = FindOccupationCandidates(job, level) - while(candidates.len && ((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)) - var/mob/new_player/candidate = pick(candidates) - Debug("Selcted: [candidate], for: [job.title]") - AssignRole(candidate, job.title) - candidates -= candidate*/ - Debug("DO, Standard Check end") + if(!job.player_old_enough(player.client)) + Debug("DO player not old enough, Player: [player], Job:[job.title]") + continue - Debug("DO, Running AC2") + // If the player wants that job on this level, then try give it to him. + if(player.client.prefs.GetJobDepartment(job, level) & job.flag) - // For those who wanted to be assistant if their preferences were filled, here you go. - for(var/mob/new_player/player in unassigned) - if(player.client.prefs.alternate_option == BE_ASSISTANT) - Debug("AC2 Assistant located, Player: [player]") - AssignRole(player, "Assistant") + // If the job isn't filled + if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) + Debug("DO pass, Player: [player], Level:[level], Job:[job.title]") + AssignRole(player, job.title) + unassigned -= player + break - //For ones returning to lobby - for(var/mob/new_player/player in unassigned) - if(player.client.prefs.alternate_option == RETURN_TO_LOBBY) - player.ready = 0 - player.new_player_panel_proc() - unassigned -= player - return 1 - - - proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0) - if(!H) return null - - var/datum/job/job = GetJob(rank) - var/list/spawn_in_storage = list() - - if(!joined_late) - var/obj/S = null - var/list/possible_spawns = list() - for(var/obj/effect/landmark/start/sloc in landmarks_list) - if(sloc.name != rank) continue - if(locate(/mob/living) in sloc.loc) continue - possible_spawns.Add(sloc) - if(possible_spawns.len) - S = pick(possible_spawns) - if(!S) - S = locate("start*[rank]") // use old stype - if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf)) - H.forceMove(S.loc) - else - var/list/spawn_props = LateSpawn(H.client, rank) - var/turf/T = spawn_props["turf"] - if(!T) - to_chat(H, "You were unable to be spawned at your chosen late-join spawnpoint. Please verify your job/spawn point combination makes sense, and try another one.") - return - else - H.forceMove(T) - - // Moving wheelchair if they have one - if(H.buckled && istype(H.buckled, /obj/structure/bed/chair/wheelchair)) - H.buckled.forceMove(H.loc) - H.buckled.set_dir(H.dir) - - if(job) - - //Equip custom gear loadout. - var/list/custom_equip_slots = list() //If more than one item takes the same slot, all after the first one spawn in storage. - var/list/custom_equip_leftovers = list() - if(H.client.prefs.gear && H.client.prefs.gear.len && !(job.mob_type & JOB_SILICON)) - for(var/thing in H.client.prefs.gear) - var/datum/gear/G = gear_datums[thing] - if(!G) //Not a real gear datum (maybe removed, as this is loaded from their savefile) - continue - - var/permitted - // Check if it is restricted to certain roles - if(G.allowed_roles) - for(var/job_name in G.allowed_roles) - if(job.title == job_name) - permitted = 1 - else - permitted = 1 - - // Check if they're whitelisted for this gear (in alien whitelist? seriously?) - if(G.whitelisted && !is_alien_whitelisted(H, GLOB.all_species[G.whitelisted])) - permitted = 0 - - // If they aren't, tell them - if(!permitted) - to_chat(H, "Your current species, job or whitelist status does not permit you to spawn with [thing]!") - continue - - // Implants get special treatment - if(G.slot == "implant") - var/obj/item/weapon/implant/I = G.spawn_item(H, H.client.prefs.gear[G.display_name]) - I.invisibility = 100 - I.implant_loadout(H) - continue - - // Try desperately (and sorta poorly) to equip the item. Now with increased desperation! - if(G.slot && !(G.slot in custom_equip_slots)) - var/metadata = H.client.prefs.gear[G.display_name] - if(G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head) - custom_equip_leftovers += thing - else if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot)) - to_chat(H, "Equipping you with \the [thing]!") - if(G.slot != slot_tie) - custom_equip_slots.Add(G.slot) - else - custom_equip_leftovers.Add(thing) - else - spawn_in_storage += thing - - // Set up their account - job.setup_account(H) - - // Equip job items. - job.equip(H, H.mind ? H.mind.role_alt_title : "") - - // Stick their fingerprints on literally everything - job.apply_fingerprints(H) - - // Only non-silicons get post-job-equip equipment - if(!(job.mob_type & JOB_SILICON)) - H.equip_post_job() - - // If some custom items could not be equipped before, try again now. - for(var/thing in custom_equip_leftovers) - var/datum/gear/G = gear_datums[thing] - if(G.slot in custom_equip_slots) - spawn_in_storage += thing - else - var/metadata = H.client.prefs.gear[G.display_name] - if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot)) - to_chat(H, "Equipping you with \the [thing]!") - custom_equip_slots.Add(G.slot) - else - spawn_in_storage += thing - else - to_chat(H, "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator.") - - H.job = rank - log_game("JOINED [key_name(H)] as \"[rank]\"") - - // If they're head, give them the account info for their department - if(H.mind && job.department_accounts) - var/remembered_info = "" - for(var/D in job.department_accounts) - var/datum/money_account/department_account = department_accounts[D] - if(department_account) - remembered_info += "Department account number ([D]): #[department_account.account_number]
    " - remembered_info += "Department account pin ([D]): [department_account.remote_access_pin]
    " - remembered_info += "Department account funds ([D]): $[department_account.money]
    " - - H.mind.store_memory(remembered_info) - - var/alt_title = null - if(H.mind) - H.mind.assigned_role = rank - alt_title = H.mind.role_alt_title - - // If we're a silicon, we may be done at this point - if(job.mob_type & JOB_SILICON_ROBOT) - return H.Robotize() - if(job.mob_type & JOB_SILICON_AI) - return H - - // TWEET PEEP - if(rank == "Site Manager") - var/sound/announce_sound = (ticker.current_state <= GAME_STATE_SETTING_UP) ? null : sound('sound/misc/boatswain.ogg', volume=20) - captain_announcement.Announce("All hands, [alt_title ? alt_title : "Site Manager"] [H.real_name] on deck!", new_sound = announce_sound, zlevel = H.z) - - //Deferred item spawning. - if(spawn_in_storage && spawn_in_storage.len) - var/obj/item/weapon/storage/B - for(var/obj/item/weapon/storage/S in H.contents) - B = S - break - - if(!isnull(B)) - for(var/thing in spawn_in_storage) - to_chat(H, "Placing \the [thing] in your [B.name]!") - var/datum/gear/G = gear_datums[thing] - var/metadata = H.client.prefs.gear[G.display_name] - G.spawn_item(B, metadata) - else - to_chat(H, "Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.") - - if(istype(H)) //give humans wheelchairs, if they need them. - var/obj/item/organ/external/l_foot = H.get_organ("l_foot") - var/obj/item/organ/external/r_foot = H.get_organ("r_foot") - var/obj/item/weapon/storage/S = locate() in H.contents - var/obj/item/wheelchair/R - if(S) - R = locate() in S.contents - if(!l_foot || !r_foot || R) - var/wheelchair_type = R?.unfolded_type || /obj/structure/bed/chair/wheelchair - var/obj/structure/bed/chair/wheelchair/W = new wheelchair_type(H.loc) - W.buckle_mob(H) - H.update_canmove() - W.set_dir(H.dir) - W.add_fingerprint(H) - if(R) - W.color = R.color - qdel(R) - - to_chat(H, "You are [job.total_positions == 1 ? "the" : "a"] [alt_title ? alt_title : rank].") - - if(job.supervisors) - to_chat(H, "As the [alt_title ? alt_title : rank] you answer directly to [job.supervisors]. Special circumstances may change this.") - if(job.has_headset) - H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_l_ear) - to_chat(H, "To speak on your department's radio channel use :h. For the use of other channels, examine your headset.") - - if(job.req_admin_notify) - to_chat(H, "You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.") - - // EMAIL GENERATION - // Email addresses will be created under this domain name. Mostly for the looks. - var/domain = "freemail.nt" - if(using_map && LAZYLEN(using_map.usable_email_tlds)) - domain = using_map.usable_email_tlds[1] - var/sanitized_name = sanitize(replacetext(replacetext(lowertext(H.real_name), " ", "."), "'", "")) - var/complete_login = "[sanitized_name]@[domain]" - - // It is VERY unlikely that we'll have two players, in the same round, with the same name and branch, but still, this is here. - // If such conflict is encountered, a random number will be appended to the email address. If this fails too, no email account will be created. - if(ntnet_global.does_email_exist(complete_login)) - complete_login = "[sanitized_name][random_id(/datum/computer_file/data/email_account/, 100, 999)]@[domain]" - - // If even fallback login generation failed, just don't give them an email. The chance of this happening is astronomically low. - if(ntnet_global.does_email_exist(complete_login)) - to_chat(H, "You were not assigned an email address.") - H.mind.store_memory("You were not assigned an email address.") - else - var/datum/computer_file/data/email_account/EA = new/datum/computer_file/data/email_account() - EA.password = GenerateKey() - EA.login = complete_login - to_chat(H, "Your email account address is [EA.login] and the password is [EA.password]. This information has also been placed into your notes.") - H.mind.store_memory("Your email account address is [EA.login] and the password is [EA.password].") - // END EMAIL GENERATION - - //Gives glasses to the vision impaired - if(H.disabilities & NEARSIGHTED) - var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses) - if(equipped != 1) - var/obj/item/clothing/glasses/G = H.glasses - G.prescription = 1 - - BITSET(H.hud_updateflag, ID_HUD) - BITSET(H.hud_updateflag, IMPLOYAL_HUD) - BITSET(H.hud_updateflag, SPECIALROLE_HUD) - return H - - proc/LoadJobs(jobsfile) //ran during round setup, reads info from jobs.txt -- Urist - if(!config.load_jobs_from_txt) - return 0 - - var/list/jobEntries = file2list(jobsfile) - - for(var/job in jobEntries) + // Hand out random jobs to the people who didn't get any in the last check + // Also makes sure that they got their preference correct + for(var/mob/new_player/player in unassigned) + if(player.client.prefs.alternate_option == GET_RANDOM_JOB) + GiveRandomJob(player) + /* + Old job system + for(var/level = 1 to 3) + for(var/datum/job/job in occupations) + Debug("Checking job: [job]") if(!job) continue - - job = trim(job) - if (!length(job)) + if(!unassigned.len) + break + if((job.current_positions >= job.spawn_positions) && job.spawn_positions != -1) continue + var/list/candidates = FindOccupationCandidates(job, level) + while(candidates.len && ((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)) + var/mob/new_player/candidate = pick(candidates) + Debug("Selcted: [candidate], for: [job.title]") + AssignRole(candidate, job.title) + candidates -= candidate*/ - var/pos = findtext(job, "=") - var/name = null - var/value = null + Debug("DO, Standard Check end") - if(pos) - name = copytext(job, 1, pos) - value = copytext(job, pos + 1) + Debug("DO, Running AC2") + + // For those who wanted to be assistant if their preferences were filled, here you go. + for(var/mob/new_player/player in unassigned) + if(player.client.prefs.alternate_option == BE_ASSISTANT) + Debug("AC2 Assistant located, Player: [player]") + AssignRole(player, "Assistant") + + //For ones returning to lobby + for(var/mob/new_player/player in unassigned) + if(player.client.prefs.alternate_option == RETURN_TO_LOBBY) + player.ready = 0 + player.new_player_panel_proc() + unassigned -= player + return 1 + + +/datum/controller/occupations/proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0) + if(!H) return null + + var/datum/job/job = GetJob(rank) + var/list/spawn_in_storage = list() + + if(!joined_late) + var/obj/S = null + var/list/possible_spawns = list() + for(var/obj/effect/landmark/start/sloc in landmarks_list) + if(sloc.name != rank) continue + if(locate(/mob/living) in sloc.loc) continue + possible_spawns.Add(sloc) + if(possible_spawns.len) + S = pick(possible_spawns) + if(!S) + S = locate("start*[rank]") // use old stype + if(istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf)) + H.forceMove(S.loc) + else + var/list/spawn_props = LateSpawn(H.client, rank) + var/turf/T = spawn_props["turf"] + if(!T) + to_chat(H, "You were unable to be spawned at your chosen late-join spawnpoint. Please verify your job/spawn point combination makes sense, and try another one.") + return else + H.forceMove(T) + + // Moving wheelchair if they have one + if(H.buckled && istype(H.buckled, /obj/structure/bed/chair/wheelchair)) + H.buckled.forceMove(H.loc) + H.buckled.set_dir(H.dir) + + if(job) + + //Equip custom gear loadout. + var/list/custom_equip_slots = list() //If more than one item takes the same slot, all after the first one spawn in storage. + var/list/custom_equip_leftovers = list() + if(H.client.prefs.gear && H.client.prefs.gear.len && !(job.mob_type & JOB_SILICON)) + for(var/thing in H.client.prefs.gear) + var/datum/gear/G = gear_datums[thing] + if(!G) //Not a real gear datum (maybe removed, as this is loaded from their savefile) + continue + + var/permitted + // Check if it is restricted to certain roles + if(G.allowed_roles) + for(var/job_name in G.allowed_roles) + if(job.title == job_name) + permitted = 1 + else + permitted = 1 + + // Check if they're whitelisted for this gear (in alien whitelist? seriously?) + if(G.whitelisted && !is_alien_whitelisted(H, GLOB.all_species[G.whitelisted])) + permitted = 0 + + // If they aren't, tell them + if(!permitted) + to_chat(H, "Your current species, job or whitelist status does not permit you to spawn with [thing]!") + continue + + // Implants get special treatment + if(G.slot == "implant") + var/obj/item/weapon/implant/I = G.spawn_item(H, H.client.prefs.gear[G.display_name]) + I.invisibility = 100 + I.implant_loadout(H) + continue + + // Try desperately (and sorta poorly) to equip the item. Now with increased desperation! + if(G.slot && !(G.slot in custom_equip_slots)) + var/metadata = H.client.prefs.gear[G.display_name] + if(G.slot == slot_wear_mask || G.slot == slot_wear_suit || G.slot == slot_head) + custom_equip_leftovers += thing + else if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot)) + to_chat(H, "Equipping you with \the [thing]!") + if(G.slot != slot_tie) + custom_equip_slots.Add(G.slot) + else + custom_equip_leftovers.Add(thing) + else + spawn_in_storage += thing + + // Set up their account + job.setup_account(H) + + // Equip job items. + job.equip(H, H.mind ? H.mind.role_alt_title : "") + + // Stick their fingerprints on literally everything + job.apply_fingerprints(H) + + // Only non-silicons get post-job-equip equipment + if(!(job.mob_type & JOB_SILICON)) + H.equip_post_job() + + // If some custom items could not be equipped before, try again now. + for(var/thing in custom_equip_leftovers) + var/datum/gear/G = gear_datums[thing] + if(G.slot in custom_equip_slots) + spawn_in_storage += thing + else + var/metadata = H.client.prefs.gear[G.display_name] + if(H.equip_to_slot_or_del(G.spawn_item(H, metadata), G.slot)) + to_chat(H, "Equipping you with \the [thing]!") + custom_equip_slots.Add(G.slot) + else + spawn_in_storage += thing + else + to_chat(H, "Your job is [rank] and the game just can't handle it! Please report this bug to an administrator.") + + H.job = rank + log_game("JOINED [key_name(H)] as \"[rank]\"") + + // If they're head, give them the account info for their department + if(H.mind && job.department_accounts) + var/remembered_info = "" + for(var/D in job.department_accounts) + var/datum/money_account/department_account = department_accounts[D] + if(department_account) + remembered_info += "Department account number ([D]): #[department_account.account_number]
    " + remembered_info += "Department account pin ([D]): [department_account.remote_access_pin]
    " + remembered_info += "Department account funds ([D]): $[department_account.money]
    " + + H.mind.store_memory(remembered_info) + + var/alt_title = null + if(H.mind) + H.mind.assigned_role = rank + alt_title = H.mind.role_alt_title + + // If we're a silicon, we may be done at this point + if(job.mob_type & JOB_SILICON_ROBOT) + return H.Robotize() + if(job.mob_type & JOB_SILICON_AI) + return H + + // TWEET PEEP + if(rank == "Site Manager") + var/sound/announce_sound = (ticker.current_state <= GAME_STATE_SETTING_UP) ? null : sound('sound/misc/boatswain.ogg', volume=20) + captain_announcement.Announce("All hands, [alt_title ? alt_title : "Site Manager"] [H.real_name] on deck!", new_sound = announce_sound, zlevel = H.z) + + //Deferred item spawning. + if(spawn_in_storage && spawn_in_storage.len) + var/obj/item/weapon/storage/B + for(var/obj/item/weapon/storage/S in H.contents) + B = S + break + + if(!isnull(B)) + for(var/thing in spawn_in_storage) + to_chat(H, "Placing \the [thing] in your [B.name]!") + var/datum/gear/G = gear_datums[thing] + var/metadata = H.client.prefs.gear[G.display_name] + G.spawn_item(B, metadata) + else + to_chat(H, "Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.") + + if(istype(H)) //give humans wheelchairs, if they need them. + var/obj/item/organ/external/l_foot = H.get_organ("l_foot") + var/obj/item/organ/external/r_foot = H.get_organ("r_foot") + var/obj/item/weapon/storage/S = locate() in H.contents + var/obj/item/wheelchair/R + if(S) + R = locate() in S.contents + if(!l_foot || !r_foot || R) + var/wheelchair_type = R?.unfolded_type || /obj/structure/bed/chair/wheelchair + var/obj/structure/bed/chair/wheelchair/W = new wheelchair_type(H.loc) + W.buckle_mob(H) + H.update_canmove() + W.set_dir(H.dir) + W.add_fingerprint(H) + if(R) + W.color = R.color + qdel(R) + + to_chat(H, "You are [job.total_positions == 1 ? "the" : "a"] [alt_title ? alt_title : rank].") + + if(job.supervisors) + to_chat(H, "As the [alt_title ? alt_title : rank] you answer directly to [job.supervisors]. Special circumstances may change this.") + if(job.has_headset) + H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_l_ear) + to_chat(H, "To speak on your department's radio channel use :h. For the use of other channels, examine your headset.") + + if(job.req_admin_notify) + to_chat(H, "You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp.") + + // EMAIL GENERATION + // Email addresses will be created under this domain name. Mostly for the looks. + var/domain = "freemail.nt" + if(using_map && LAZYLEN(using_map.usable_email_tlds)) + domain = using_map.usable_email_tlds[1] + var/sanitized_name = sanitize(replacetext(replacetext(lowertext(H.real_name), " ", "."), "'", "")) + var/complete_login = "[sanitized_name]@[domain]" + + // It is VERY unlikely that we'll have two players, in the same round, with the same name and branch, but still, this is here. + // If such conflict is encountered, a random number will be appended to the email address. If this fails too, no email account will be created. + if(ntnet_global.does_email_exist(complete_login)) + complete_login = "[sanitized_name][random_id(/datum/computer_file/data/email_account/, 100, 999)]@[domain]" + + // If even fallback login generation failed, just don't give them an email. The chance of this happening is astronomically low. + if(ntnet_global.does_email_exist(complete_login)) + to_chat(H, "You were not assigned an email address.") + H.mind.store_memory("You were not assigned an email address.") + else + var/datum/computer_file/data/email_account/EA = new/datum/computer_file/data/email_account() + EA.password = GenerateKey() + EA.login = complete_login + to_chat(H, "Your email account address is [EA.login] and the password is [EA.password]. This information has also been placed into your notes.") + H.mind.store_memory("Your email account address is [EA.login] and the password is [EA.password].") + // END EMAIL GENERATION + + //Gives glasses to the vision impaired + if(H.disabilities & NEARSIGHTED) + var/equipped = H.equip_to_slot_or_del(new /obj/item/clothing/glasses/regular(H), slot_glasses) + if(equipped != 1) + var/obj/item/clothing/glasses/G = H.glasses + G.prescription = 1 + + BITSET(H.hud_updateflag, ID_HUD) + BITSET(H.hud_updateflag, IMPLOYAL_HUD) + BITSET(H.hud_updateflag, SPECIALROLE_HUD) + return H + +/datum/controller/occupations/proc/LoadJobs(jobsfile) //ran during round setup, reads info from jobs.txt -- Urist + if(!config.load_jobs_from_txt) + return 0 + + var/list/jobEntries = file2list(jobsfile) + + for(var/job in jobEntries) + if(!job) + continue + + job = trim(job) + if (!length(job)) + continue + + var/pos = findtext(job, "=") + var/name = null + var/value = null + + if(pos) + name = copytext(job, 1, pos) + value = copytext(job, pos + 1) + else + continue + + if(name && value) + var/datum/job/J = GetJob(name) + if(!J) continue + J.total_positions = text2num(value) + J.spawn_positions = text2num(value) + if(J.mob_type & JOB_SILICON) + J.total_positions = 0 + + return 1 + + +/datum/controller/occupations/proc/HandleFeedbackGathering() + for(var/datum/job/job in occupations) + var/tmp_str = "|[job.title]|" + + var/level1 = 0 //high + var/level2 = 0 //medium + var/level3 = 0 //low + var/level4 = 0 //never + var/level5 = 0 //banned + var/level6 = 0 //account too young + for(var/mob/new_player/player in player_list) + if(!(player.ready && player.mind && !player.mind.assigned_role)) + continue //This player is not ready + if(jobban_isbanned(player, job.title)) + level5++ continue + if(!job.player_old_enough(player.client)) + level6++ + continue + if(player.client.prefs.GetJobDepartment(job, 1) & job.flag) + level1++ + else if(player.client.prefs.GetJobDepartment(job, 2) & job.flag) + level2++ + else if(player.client.prefs.GetJobDepartment(job, 3) & job.flag) + level3++ + else level4++ //not selected - if(name && value) - var/datum/job/J = GetJob(name) - if(!J) continue - J.total_positions = text2num(value) - J.spawn_positions = text2num(value) - if(J.mob_type & JOB_SILICON) - J.total_positions = 0 - - return 1 - - - proc/HandleFeedbackGathering() - for(var/datum/job/job in occupations) - var/tmp_str = "|[job.title]|" - - var/level1 = 0 //high - var/level2 = 0 //medium - var/level3 = 0 //low - var/level4 = 0 //never - var/level5 = 0 //banned - var/level6 = 0 //account too young - for(var/mob/new_player/player in player_list) - if(!(player.ready && player.mind && !player.mind.assigned_role)) - continue //This player is not ready - if(jobban_isbanned(player, job.title)) - level5++ - continue - if(!job.player_old_enough(player.client)) - level6++ - continue - if(player.client.prefs.GetJobDepartment(job, 1) & job.flag) - level1++ - else if(player.client.prefs.GetJobDepartment(job, 2) & job.flag) - level2++ - else if(player.client.prefs.GetJobDepartment(job, 3) & job.flag) - level3++ - else level4++ //not selected - - tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|YOUNG=[level6]|-" - feedback_add_details("job_preferences",tmp_str) + tmp_str += "HIGH=[level1]|MEDIUM=[level2]|LOW=[level3]|NEVER=[level4]|BANNED=[level5]|YOUNG=[level6]|-" + feedback_add_details("job_preferences",tmp_str) /datum/controller/occupations/proc/LateSpawn(var/client/C, var/rank) diff --git a/code/game/json.dm b/code/game/json.dm index 2fd5282795..2a2bd78933 100644 --- a/code/game/json.dm +++ b/code/game/json.dm @@ -2,7 +2,7 @@ var/jsonpath = "/home/bay12/public_html" var/dmepath = "/home/bay12/git/baystation12.dme" var/makejson = 1 //temp -proc/makejson() +/proc/makejson() if(!makejson) return @@ -82,19 +82,19 @@ proc/makejson() message_admins("Done") world.Reboot("Switching to [newmap]") -obj/mapinfo +/obj/mapinfo invisibility = 101 var/mapname = "thismap" var/decks = 4 -proc/GetMapInfo() +/proc/GetMapInfo() // var/obj/mapinfo/M = locate() // Just removing these to try and fix the occasional JSON -> WORLD issue. // to_world(M.name) // to_world(M.mapname) -client/proc/ChangeMap(var/X as text) +/client/proc/ChangeMap(var/X as text) set name = "Change Map" set category = "Admin" switchmap(X,X) -proc/send2adminirc(channel,msg) +/proc/send2adminirc(channel,msg) world << channel << " "<< msg shell("python nudge.py '[channel]' [msg]") \ No newline at end of file diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index e6aae5a915..519257a254 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -474,7 +474,7 @@ if(unknown_body) imp += "Unknown body present:" - if(!AN && !open && !infected & !imp) + if(!AN && !open && !infected && !imp) AN = "None:" if(!(e.status & ORGAN_DESTROYED)) dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured][o_dead]" diff --git a/code/game/machinery/air_alarm.dm b/code/game/machinery/air_alarm.dm index b372a21c33..5e831188d1 100644 --- a/code/game/machinery/air_alarm.dm +++ b/code/game/machinery/air_alarm.dm @@ -186,7 +186,7 @@ update_use_power(USE_POWER_ACTIVE) regulating_temperature = 1 audible_message("\The [src] clicks as it starts [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\ - "You hear a click and a faint electronic hum.") + "You hear a click and a faint electronic hum.", runemessage = "* click *") playsound(src, 'sound/machines/click.ogg', 50, 1) else //check for when we should stop adjusting temperature @@ -194,7 +194,7 @@ update_use_power(USE_POWER_IDLE) regulating_temperature = 0 audible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\ - "You hear a click as a faint electronic humming stops.") + "You hear a click as a faint electronic humming stops.", runemessage = "* click *") playsound(src, 'sound/machines/click.ogg', 50, 1) if(regulating_temperature) @@ -557,20 +557,21 @@ var/list/info = alarm_area.air_scrub_info[id_tag] if(!info) continue - data["scrubbers"] += list(list( + scrubbers += list(list( "id_tag" = id_tag, "long_name" = sanitize(long_name), "power" = info["power"], "scrubbing" = info["scrubbing"], "panic" = info["panic"], - "filters" = list() + "filters" = list( + list("name" = "Oxygen", "command" = "o2_scrub", "val" = info["filter_o2"]), + list("name" = "Nitrogen", "command" = "n2_scrub", "val" = info["filter_n2"]), + list("name" = "Carbon Dioxide", "command" = "co2_scrub","val" = info["filter_co2"]), + list("name" = "Toxin" , "command" = "tox_scrub","val" = info["filter_phoron"]), + list("name" = "Nitrous Oxide", "command" = "n2o_scrub","val" = info["filter_n2o"]), + list("name" = "Fuel", "command" = "fuel_scrub","val" = info["filter_fuel"]) + ) )) - scrubbers[scrubbers.len]["filters"] += list(list("name" = "Oxygen", "command" = "o2_scrub", "val" = info["filter_o2"])) - scrubbers[scrubbers.len]["filters"] += list(list("name" = "Nitrogen", "command" = "n2_scrub", "val" = info["filter_n2"])) - scrubbers[scrubbers.len]["filters"] += list(list("name" = "Carbon Dioxide", "command" = "co2_scrub","val" = info["filter_co2"])) - scrubbers[scrubbers.len]["filters"] += list(list("name" = "Toxin" , "command" = "tox_scrub","val" = info["filter_phoron"])) - scrubbers[scrubbers.len]["filters"] += list(list("name" = "Nitrous Oxide", "command" = "n2o_scrub","val" = info["filter_n2o"])) - scrubbers[scrubbers.len]["filters"] += list(list("name" = "Fuel", "command" = "fuel_scrub","val" = info["filter_fuel"])) data["scrubbers"] = scrubbers var/list/modes = list() diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm index 2d87fcd45a..29d9ed5562 100644 --- a/code/game/machinery/atmo_control.dm +++ b/code/game/machinery/atmo_control.dm @@ -69,7 +69,7 @@ if(frequency) set_frequency(frequency) -obj/machinery/air_sensor/Destroy() +/obj/machinery/air_sensor/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) . = ..() @@ -85,7 +85,7 @@ obj/machinery/air_sensor/Destroy() var/datum/radio_frequency/radio_connection circuit = /obj/item/weapon/circuitboard/air_management -obj/machinery/computer/general_air_control/Destroy() +/obj/machinery/computer/general_air_control/Destroy() if(radio_controller) radio_controller.remove_object(src, frequency) ..() diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 44f50a4644..d30ec8a07e 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -215,7 +215,7 @@ return L -mob/living/proc/near_camera() +/mob/living/proc/near_camera() if (!isturf(loc)) return 0 else if(!cameranet.checkVis(src)) @@ -263,16 +263,16 @@ mob/living/proc/near_camera() if(T && (T.z in using_map.station_levels) && hassensorlevel(src, SUIT_SENSOR_TRACKING)) return TRACKING_POSSIBLE -mob/living/proc/tracking_initiated() +/mob/living/proc/tracking_initiated() -mob/living/silicon/robot/tracking_initiated() +/mob/living/silicon/robot/tracking_initiated() tracking_entities++ if(tracking_entities == 1 && has_zeroth_law()) to_chat(src, "Internal camera is currently being accessed.") -mob/living/proc/tracking_cancelled() +/mob/living/proc/tracking_cancelled() -mob/living/silicon/robot/tracking_initiated() +/mob/living/silicon/robot/tracking_initiated() tracking_entities-- if(!tracking_entities && has_zeroth_law()) to_chat(src, "Internal camera is no longer being accessed.") diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 0370990ae6..d06a0080b0 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -206,7 +206,7 @@ else if((occupant.health >= heal_level || occupant.health == occupant.getMaxHealth()) && (!eject_wait)) playsound(src, 'sound/machines/medbayscanner1.ogg', 50, 1) - audible_message("\The [src] signals that the cloning process is complete.") + audible_message("\The [src] signals that the cloning process is complete.", runemessage = "ding") connected_message("Cloning Process Complete.") locked = 0 go_out() @@ -499,30 +499,30 @@ name = "data disk - 'God Emperor of Mankind'" read_only = 1 - New() - initializeDisk() - buf.types=DNA2_BUF_UE|DNA2_BUF_UI - //data = "066000033000000000AF00330660FF4DB002690" - //data = "0C80C80C80C80C80C8000000000000161FBDDEF" - Farmer Jeff - buf.dna.real_name="God Emperor of Mankind" - buf.dna.unique_enzymes = md5(buf.dna.real_name) - buf.dna.UI=list(0x066,0x000,0x033,0x000,0x000,0x000,0xAF0,0x033,0x066,0x0FF,0x4DB,0x002,0x690) - //buf.dna.UI=list(0x0C8,0x0C8,0x0C8,0x0C8,0x0C8,0x0C8,0x000,0x000,0x000,0x000,0x161,0xFBD,0xDEF) // Farmer Jeff - buf.dna.UpdateUI() +/obj/item/weapon/disk/data/demo/New() + initializeDisk() + buf.types=DNA2_BUF_UE|DNA2_BUF_UI + //data = "066000033000000000AF00330660FF4DB002690" + //data = "0C80C80C80C80C80C8000000000000161FBDDEF" - Farmer Jeff + buf.dna.real_name="God Emperor of Mankind" + buf.dna.unique_enzymes = md5(buf.dna.real_name) + buf.dna.UI=list(0x066,0x000,0x033,0x000,0x000,0x000,0xAF0,0x033,0x066,0x0FF,0x4DB,0x002,0x690) + //buf.dna.UI=list(0x0C8,0x0C8,0x0C8,0x0C8,0x0C8,0x0C8,0x000,0x000,0x000,0x000,0x161,0xFBD,0xDEF) // Farmer Jeff + buf.dna.UpdateUI() /obj/item/weapon/disk/data/monkey name = "data disk - 'Mr. Muggles'" read_only = 1 - New() - ..() - initializeDisk() - buf.types=DNA2_BUF_SE - var/list/new_SE=list(0x098,0x3E8,0x403,0x44C,0x39F,0x4B0,0x59D,0x514,0x5FC,0x578,0x5DC,0x640,0x6A4) - for(var/i=new_SE.len;i<=DNA_SE_LENGTH;i++) - new_SE += rand(1,1024) - buf.dna.SE=new_SE - buf.dna.SetSEValueRange(MONKEYBLOCK,0xDAC, 0xFFF) +/obj/item/weapon/disk/data/monkey/New() + ..() + initializeDisk() + buf.types=DNA2_BUF_SE + var/list/new_SE=list(0x098,0x3E8,0x403,0x44C,0x39F,0x4B0,0x59D,0x514,0x5FC,0x578,0x5DC,0x640,0x6A4) + for(var/i=new_SE.len;i<=DNA_SE_LENGTH;i++) + new_SE += rand(1,1024) + buf.dna.SE=new_SE + buf.dna.SetSEValueRange(MONKEYBLOCK,0xDAC, 0xFFF) /obj/item/weapon/disk/data/New() ..() diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index 3f5cac7ca8..a6b2c5d8bc 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -522,9 +522,9 @@ if(electronics) sleep(10) if(oldfuel > fuel && oldfood > food) - src.audible_message("\The [src] lets out a somehow reassuring chime.") + src.audible_message("\The [src] lets out a somehow reassuring chime.", runemessage = "reassuring chime") else if(oldfuel < fuel || oldfood < food) - src.audible_message("\The [src] lets out a somehow ominous chime.") + src.audible_message("\The [src] lets out a somehow ominous chime.", runemessage = "ominous chime") food = oldfood fuel = oldfuel diff --git a/code/game/machinery/computer/prisonshuttle.dm b/code/game/machinery/computer/prisonshuttle.dm index 1d58a61df1..1a81f9db91 100644 --- a/code/game/machinery/computer/prisonshuttle.dm +++ b/code/game/machinery/computer/prisonshuttle.dm @@ -23,190 +23,190 @@ var/prison_shuttle_timeleft = 0 var/allowedtocall = 0 var/prison_break = 0 - attack_ai(var/mob/user as mob) - return src.attack_hand(user) +/obj/machinery/computer/prison_shuttle/attack_ai(var/mob/user as mob) + return src.attack_hand(user) - attack_hand(var/mob/user as mob) - if(!src.allowed(user) && (!hacked)) - to_chat(user, "Access Denied.") +/obj/machinery/computer/prison_shuttle/attack_hand(var/mob/user as mob) + if(!src.allowed(user) && (!hacked)) + to_chat(user, "Access Denied.") + return + if(prison_break) + to_chat(user, "Unable to locate shuttle.") + return + if(..()) + return + user.set_machine(src) + post_signal("prison") + var/dat + if (src.temp) + dat = src.temp + else + dat += {"
    Prison Shuttle
    + \nLocation: [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "Moving to station ([prison_shuttle_timeleft] Secs.)":prison_shuttle_at_station ? "Station":"Dock"]
    + [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "\n*Shuttle already called*
    \n
    ":prison_shuttle_at_station ? "\nSend to Dock
    \n
    ":"\nSend to station
    \n
    "] + \nClose"} + + user << browse(dat, "window=computer;size=575x450") + onclose(user, "computer") + return + + +/obj/machinery/computer/prison_shuttle/Topic(href, href_list) + if(..()) + return + + if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) + usr.set_machine(src) + + if (href_list["sendtodock"]) + if (!prison_can_move()) + to_chat(usr, "The prison shuttle is unable to leave.") return - if(prison_break) - to_chat(user, "Unable to locate shuttle.") - return - if(..()) - return - user.set_machine(src) + if(!prison_shuttle_at_station|| prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return post_signal("prison") - var/dat - if (src.temp) - dat = src.temp - else - dat += {"
    Prison Shuttle
    - \nLocation: [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "Moving to station ([prison_shuttle_timeleft] Secs.)":prison_shuttle_at_station ? "Station":"Dock"]
    - [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "\n*Shuttle already called*
    \n
    ":prison_shuttle_at_station ? "\nSend to Dock
    \n
    ":"\nSend to station
    \n
    "] - \nClose"} - - user << browse(dat, "window=computer;size=575x450") - onclose(user, "computer") - return - - - Topic(href, href_list) - if(..()) - return - - if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon))) - usr.set_machine(src) - - if (href_list["sendtodock"]) - if (!prison_can_move()) - to_chat(usr, "The prison shuttle is unable to leave.") - return - if(!prison_shuttle_at_station|| prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return - post_signal("prison") - to_chat(usr, "The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.") - src.temp += "Shuttle sent.

    OK" - src.updateUsrDialog() - prison_shuttle_moving_to_prison = 1 - prison_shuttle_time = world.timeofday + PRISON_MOVETIME - spawn(0) - prison_process() - - else if (href_list["sendtostation"]) - if (!prison_can_move()) - to_chat(usr, "The prison shuttle is unable to leave.") - return - if(prison_shuttle_at_station || prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return - post_signal("prison") - to_chat(usr, "The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.") - src.temp += "Shuttle sent.

    OK" - src.updateUsrDialog() - prison_shuttle_moving_to_station = 1 - prison_shuttle_time = world.timeofday + PRISON_MOVETIME - spawn(0) - prison_process() - - else if (href_list["mainmenu"]) - src.temp = null - - src.add_fingerprint(usr) + to_chat(usr, "The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.") + src.temp += "Shuttle sent.

    OK" src.updateUsrDialog() - return + prison_shuttle_moving_to_prison = 1 + prison_shuttle_time = world.timeofday + PRISON_MOVETIME + spawn(0) + prison_process() + + else if (href_list["sendtostation"]) + if (!prison_can_move()) + to_chat(usr, "The prison shuttle is unable to leave.") + return + if(prison_shuttle_at_station || prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return + post_signal("prison") + to_chat(usr, "The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.") + src.temp += "Shuttle sent.

    OK" + src.updateUsrDialog() + prison_shuttle_moving_to_station = 1 + prison_shuttle_time = world.timeofday + PRISON_MOVETIME + spawn(0) + prison_process() + + else if (href_list["mainmenu"]) + src.temp = null + + src.add_fingerprint(usr) + src.updateUsrDialog() + return - proc/prison_can_move() - if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return 0 - else return 1 +/obj/machinery/computer/prison_shuttle/proc/prison_can_move() + if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return 0 + else return 1 - proc/prison_break() - switch(prison_break) - if (0) - if(!prison_shuttle_at_station || prison_shuttle_moving_to_prison) return +/obj/machinery/computer/prison_shuttle/proc/prison_break() + switch(prison_break) + if (0) + if(!prison_shuttle_at_station || prison_shuttle_moving_to_prison) return - prison_shuttle_moving_to_prison = 1 - prison_shuttle_at_station = prison_shuttle_at_station + prison_shuttle_moving_to_prison = 1 + prison_shuttle_at_station = prison_shuttle_at_station - if (!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station) - prison_shuttle_time = world.timeofday + PRISON_MOVETIME - spawn(0) - prison_process() - prison_break = 1 - if(1) - prison_break = 0 + if (!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station) + prison_shuttle_time = world.timeofday + PRISON_MOVETIME + spawn(0) + prison_process() + prison_break = 1 + if(1) + prison_break = 0 - proc/post_signal(var/command) - var/datum/radio_frequency/frequency = radio_controller.return_frequency(1311) - if(!frequency) return - var/datum/signal/status_signal = new - status_signal.source = src - status_signal.transmission_method = TRANSMISSION_RADIO - status_signal.data["command"] = command - frequency.post_signal(src, status_signal) - return +/obj/machinery/computer/prison_shuttle/proc/post_signal(var/command) + var/datum/radio_frequency/frequency = radio_controller.return_frequency(1311) + if(!frequency) return + var/datum/signal/status_signal = new + status_signal.source = src + status_signal.transmission_method = TRANSMISSION_RADIO + status_signal.data["command"] = command + frequency.post_signal(src, status_signal) + return - proc/prison_process() - while(prison_shuttle_time - world.timeofday > 0) - var/ticksleft = prison_shuttle_time - world.timeofday +/obj/machinery/computer/prison_shuttle/proc/prison_process() + while(prison_shuttle_time - world.timeofday > 0) + var/ticksleft = prison_shuttle_time - world.timeofday - if(ticksleft > 1e5) - prison_shuttle_time = world.timeofday + 10 // midnight rollover + if(ticksleft > 1e5) + prison_shuttle_time = world.timeofday + 10 // midnight rollover - prison_shuttle_timeleft = (ticksleft / 10) - sleep(5) - prison_shuttle_moving_to_station = 0 - prison_shuttle_moving_to_prison = 0 + prison_shuttle_timeleft = (ticksleft / 10) + sleep(5) + prison_shuttle_moving_to_station = 0 + prison_shuttle_moving_to_prison = 0 - switch(prison_shuttle_at_station) + switch(prison_shuttle_at_station) - if(0) - prison_shuttle_at_station = 1 - if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return + if(0) + prison_shuttle_at_station = 1 + if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return - if (!prison_can_move()) - to_chat(usr, "The prison shuttle is unable to leave.") - return + if (!prison_can_move()) + to_chat(usr, "The prison shuttle is unable to leave.") + return - var/area/start_location = locate(/area/shuttle/prison/prison) - var/area/end_location = locate(/area/shuttle/prison/station) + var/area/start_location = locate(/area/shuttle/prison/prison) + var/area/end_location = locate(/area/shuttle/prison/station) - var/list/dstturfs = list() - var/throwy = world.maxy + var/list/dstturfs = list() + var/throwy = world.maxy - for(var/turf/T in end_location) - dstturfs += T - if(T.y < throwy) - throwy = T.y - // hey you, get out of the way! - for(var/turf/T in dstturfs) - // find the turf to move things to - var/turf/D = locate(T.x, throwy - 1, 1) - //var/turf/E = get_step(D, SOUTH) - for(var/atom/movable/AM as mob|obj in T) - AM.Move(D) - if(istype(T, /turf/simulated)) - qdel(T) - start_location.move_contents_to(end_location) + for(var/turf/T in end_location) + dstturfs += T + if(T.y < throwy) + throwy = T.y + // hey you, get out of the way! + for(var/turf/T in dstturfs) + // find the turf to move things to + var/turf/D = locate(T.x, throwy - 1, 1) + //var/turf/E = get_step(D, SOUTH) + for(var/atom/movable/AM as mob|obj in T) + AM.Move(D) + if(istype(T, /turf/simulated)) + qdel(T) + start_location.move_contents_to(end_location) - if(1) - prison_shuttle_at_station = 0 - if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return + if(1) + prison_shuttle_at_station = 0 + if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return - if (!prison_can_move()) - to_chat(usr, "The prison shuttle is unable to leave.") - return + if (!prison_can_move()) + to_chat(usr, "The prison shuttle is unable to leave.") + return - var/area/start_location = locate(/area/shuttle/prison/station) - var/area/end_location = locate(/area/shuttle/prison/prison) + var/area/start_location = locate(/area/shuttle/prison/station) + var/area/end_location = locate(/area/shuttle/prison/prison) - var/list/dstturfs = list() - var/throwy = world.maxy + var/list/dstturfs = list() + var/throwy = world.maxy - for(var/turf/T in end_location) - dstturfs += T - if(T.y < throwy) - throwy = T.y + for(var/turf/T in end_location) + dstturfs += T + if(T.y < throwy) + throwy = T.y - // hey you, get out of the way! - for(var/turf/T in dstturfs) - // find the turf to move things to - var/turf/D = locate(T.x, throwy - 1, 1) - //var/turf/E = get_step(D, SOUTH) - for(var/atom/movable/AM as mob|obj in T) - AM.Move(D) - if(istype(T, /turf/simulated)) - qdel(T) + // hey you, get out of the way! + for(var/turf/T in dstturfs) + // find the turf to move things to + var/turf/D = locate(T.x, throwy - 1, 1) + //var/turf/E = get_step(D, SOUTH) + for(var/atom/movable/AM as mob|obj in T) + AM.Move(D) + if(istype(T, /turf/simulated)) + qdel(T) - for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area... - bug.gib() + for(var/mob/living/carbon/bug in end_location) // If someone somehow is still in the shuttle's docking area... + bug.gib() - for(var/mob/living/simple_mob/pest in end_location) // And for the other kind of bug... - pest.gib() + for(var/mob/living/simple_mob/pest in end_location) // And for the other kind of bug... + pest.gib() - start_location.move_contents_to(end_location) - return + start_location.move_contents_to(end_location) + return /obj/machinery/computer/prison_shuttle/emag_act(var/charges, var/mob/user) if(!hacked) diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index 1ffe2d6570..d3de10cba1 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -8,64 +8,64 @@ var/list/authorized = list( ) - attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob) - if(stat & (BROKEN|NOPOWER)) return - if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location() || !( user ))) return - if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) - if (istype(W, /obj/item/device/pda)) - var/obj/item/device/pda/pda = W - W = pda.id - if (!W:access) //no access - to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") - return +/obj/machinery/computer/shuttle/attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob) + if(stat & (BROKEN|NOPOWER)) return + if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location() || !( user ))) return + if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) + if (istype(W, /obj/item/device/pda)) + var/obj/item/device/pda/pda = W + W = pda.id + if (!W:access) //no access + to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") + return - var/list/cardaccess = W:access - if(!istype(cardaccess, /list) || !cardaccess.len) //no access - to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") - return + var/list/cardaccess = W:access + if(!istype(cardaccess, /list) || !cardaccess.len) //no access + to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") + return - if(!(access_heads in W:access)) //doesn't have this access - to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") - return 0 + if(!(access_heads in W:access)) //doesn't have this access + to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ") + return 0 - var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort") - if(emergency_shuttle.location() && user.get_active_hand() != W) - return 0 - switch(choice) - if("Authorize") - src.authorized -= W:registered_name - src.authorized += W:registered_name - if (src.auth_need - src.authorized.len > 0) - message_admins("[key_name_admin(user)] has authorized early shuttle launch") - log_game("[user.ckey] has authorized early shuttle launch") - to_world("Alert: [src.auth_need - src.authorized.len] authorizations needed until shuttle is launched early") - else - message_admins("[key_name_admin(user)] has launched the shuttle") - log_game("[user.ckey] has launched the shuttle early") - to_world("Alert: Shuttle launch time shortened to 10 seconds!") - emergency_shuttle.set_launch_countdown(10) - //src.authorized = null - qdel(src.authorized) - src.authorized = list( ) - - if("Repeal") - src.authorized -= W:registered_name + var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort") + if(emergency_shuttle.location() && user.get_active_hand() != W) + return 0 + switch(choice) + if("Authorize") + src.authorized -= W:registered_name + src.authorized += W:registered_name + if (src.auth_need - src.authorized.len > 0) + message_admins("[key_name_admin(user)] has authorized early shuttle launch") + log_game("[user.ckey] has authorized early shuttle launch") to_world("Alert: [src.auth_need - src.authorized.len] authorizations needed until shuttle is launched early") - - if("Abort") - to_world("All authorizations to shortening time for shuttle launch have been revoked!") - src.authorized.len = 0 + else + message_admins("[key_name_admin(user)] has launched the shuttle") + log_game("[user.ckey] has launched the shuttle early") + to_world("Alert: Shuttle launch time shortened to 10 seconds!") + emergency_shuttle.set_launch_countdown(10) + //src.authorized = null + qdel(src.authorized) src.authorized = list( ) - else if (istype(W, /obj/item/weapon/card/emag) && !emagged) - var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel") + if("Repeal") + src.authorized -= W:registered_name + to_world("Alert: [src.auth_need - src.authorized.len] authorizations needed until shuttle is launched early") - if(!emagged && !emergency_shuttle.location() && user.get_active_hand() == W) - switch(choice) - if("Launch") - to_world("Alert: Shuttle launch time shortened to 10 seconds!") - emergency_shuttle.set_launch_countdown(10) - emagged = 1 - if("Cancel") - return - return + if("Abort") + to_world("All authorizations to shortening time for shuttle launch have been revoked!") + src.authorized.len = 0 + src.authorized = list( ) + + else if (istype(W, /obj/item/weapon/card/emag) && !emagged) + var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel") + + if(!emagged && !emergency_shuttle.location() && user.get_active_hand() == W) + switch(choice) + if("Launch") + to_world("Alert: Shuttle launch time shortened to 10 seconds!") + emergency_shuttle.set_launch_countdown(10) + emagged = 1 + if("Cancel") + return + return diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 64a3cc1fc7..9b14dc68bb 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -130,8 +130,8 @@ Deployable items /obj/machinery/deployable/barrier/emag_act(var/remaining_charges, var/mob/user) if(emagged == 0) emagged = 1 - req_access.Cut() - req_one_access.Cut() + LAZYCLEARLIST(req_access) + LAZYCLEARLIST(req_one_access) to_chat(user, "You break the ID authentication lock on \the [src].") var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread s.set_up(2, 1, src) diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index b8f7acd5bf..c74b4fa9a0 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -28,9 +28,9 @@ return attack_hand(user) /obj/machinery/button/remote/emag_act(var/remaining_charges, var/mob/user) - if(req_access.len || req_one_access.len) - req_access = list() - req_one_access = list() + if(LAZYLEN(req_access) || LAZYLEN(req_one_access)) + LAZYCLEARLIST(req_access) + LAZYCLEARLIST(req_one_access) playsound(src, "sparks", 100, 1) return 1 diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index c3b1ba1d95..01ece0eaa9 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1388,10 +1388,10 @@ About the new airlock wires panel: //update the door's access to match the electronics' secured_wires = electronics.secure if(electronics.one_access) - req_access.Cut() + LAZYCLEARLIST(req_access) req_one_access = src.electronics.conf_access else - req_one_access.Cut() + LAZYCLEARLIST(req_one_access) req_access = src.electronics.conf_access //get the name from the assembly @@ -1437,12 +1437,10 @@ About the new airlock wires panel: 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 + if(LAZYLEN(req_access)) + electronics.conf_access = req_access + else if (LAZYLEN(req_one_access)) + electronics.conf_access = req_one_access electronics.one_access = 1 /obj/machinery/door/airlock/emp_act(var/severity) diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index ddbc8ed9cf..36c054ec24 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -1,19 +1,19 @@ #define AIRLOCK_CONTROL_RANGE 22 // This code allows for airlocks to be controlled externally by setting an id_tag and comm frequency (disables ID access) -obj/machinery/door/airlock +/obj/machinery/door/airlock var/id_tag var/frequency var/shockedby = list() var/datum/radio_frequency/radio_connection var/cur_command = null //the command the door is currently attempting to complete -obj/machinery/door/airlock/process() +/obj/machinery/door/airlock/process() ..() if (arePowerSystemsOn()) execute_current_command() -obj/machinery/door/airlock/receive_signal(datum/signal/signal) +/obj/machinery/door/airlock/receive_signal(datum/signal/signal) if (!arePowerSystemsOn()) return //no power if(!signal || signal.encryption) return @@ -23,7 +23,7 @@ obj/machinery/door/airlock/receive_signal(datum/signal/signal) cur_command = signal.data["command"] execute_current_command() -obj/machinery/door/airlock/proc/execute_current_command() +/obj/machinery/door/airlock/proc/execute_current_command() if(operating) return //emagged or busy doing something else @@ -35,7 +35,7 @@ obj/machinery/door/airlock/proc/execute_current_command() if (command_completed(cur_command)) cur_command = null -obj/machinery/door/airlock/proc/do_command(var/command) +/obj/machinery/door/airlock/proc/do_command(var/command) switch(command) if("open") open() @@ -66,7 +66,7 @@ obj/machinery/door/airlock/proc/do_command(var/command) send_status() -obj/machinery/door/airlock/proc/command_completed(var/command) +/obj/machinery/door/airlock/proc/command_completed(var/command) switch(command) if("open") return (!density) @@ -88,7 +88,7 @@ obj/machinery/door/airlock/proc/command_completed(var/command) return 1 //Unknown command. Just assume it's completed. -obj/machinery/door/airlock/proc/send_status(var/bumped = 0) +/obj/machinery/door/airlock/proc/send_status(var/bumped = 0) if(radio_connection) var/datum/signal/signal = new signal.transmission_method = TRANSMISSION_RADIO //radio signal @@ -104,17 +104,17 @@ obj/machinery/door/airlock/proc/send_status(var/bumped = 0) radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, radio_filter = RADIO_AIRLOCK) -obj/machinery/door/airlock/open(surpress_send) +/obj/machinery/door/airlock/open(surpress_send) . = ..() if(!surpress_send) send_status() -obj/machinery/door/airlock/close(surpress_send) +/obj/machinery/door/airlock/close(surpress_send) . = ..() if(!surpress_send) send_status() -obj/machinery/door/airlock/Bumped(atom/AM) +/obj/machinery/door/airlock/Bumped(atom/AM) ..(AM) if(istype(AM, /obj/mecha)) var/obj/mecha/mecha = AM @@ -122,26 +122,26 @@ obj/machinery/door/airlock/Bumped(atom/AM) send_status(1) return -obj/machinery/door/airlock/proc/set_frequency(new_frequency) +/obj/machinery/door/airlock/proc/set_frequency(new_frequency) radio_controller.remove_object(src, frequency) if(new_frequency) frequency = new_frequency radio_connection = radio_controller.add_object(src, frequency, RADIO_AIRLOCK) -obj/machinery/door/airlock/Initialize() +/obj/machinery/door/airlock/Initialize() . = ..() if(frequency) set_frequency(frequency) update_icon() -obj/machinery/door/airlock/Destroy() +/obj/machinery/door/airlock/Destroy() if(frequency && radio_controller) radio_controller.remove_object(src,frequency) return ..() -obj/machinery/airlock_sensor +/obj/machinery/airlock_sensor icon = 'icons/obj/airlock_machines.dmi' icon_state = "airlock_sensor_off" layer = ABOVE_WINDOW_LAYER @@ -162,7 +162,7 @@ obj/machinery/airlock_sensor var/alert = 0 var/previousPressure -obj/machinery/airlock_sensor/update_icon() +/obj/machinery/airlock_sensor/update_icon() if(on) if(alert) icon_state = "airlock_sensor_alert" @@ -171,7 +171,7 @@ obj/machinery/airlock_sensor/update_icon() else icon_state = "airlock_sensor_off" -obj/machinery/airlock_sensor/attack_hand(mob/user) +/obj/machinery/airlock_sensor/attack_hand(mob/user) var/datum/signal/signal = new signal.transmission_method = TRANSMISSION_RADIO //radio signal signal.data["tag"] = master_tag @@ -180,7 +180,7 @@ obj/machinery/airlock_sensor/attack_hand(mob/user) radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, radio_filter = RADIO_AIRLOCK) flick("airlock_sensor_cycle", src) -obj/machinery/airlock_sensor/process() +/obj/machinery/airlock_sensor/process() if(on) var/datum/gas_mixture/air_sample = return_air() var/pressure = round(air_sample.return_pressure(),0.1) @@ -200,34 +200,34 @@ obj/machinery/airlock_sensor/process() update_icon() -obj/machinery/airlock_sensor/proc/set_frequency(new_frequency) +/obj/machinery/airlock_sensor/proc/set_frequency(new_frequency) radio_controller.remove_object(src, frequency) frequency = new_frequency radio_connection = radio_controller.add_object(src, frequency, RADIO_AIRLOCK) -obj/machinery/airlock_sensor/Initialize() +/obj/machinery/airlock_sensor/Initialize() . = ..() set_frequency(frequency) -obj/machinery/airlock_sensor/Destroy() +/obj/machinery/airlock_sensor/Destroy() if(radio_controller) radio_controller.remove_object(src,frequency) return ..() -obj/machinery/airlock_sensor/airlock_interior +/obj/machinery/airlock_sensor/airlock_interior command = "cycle_interior" -obj/machinery/airlock_sensor/airlock_exterior +/obj/machinery/airlock_sensor/airlock_exterior command = "cycle_exterior" // Return the air from the turf in "front" of us (Used in shuttles, so it can be in the shuttle area but sense outside it) -obj/machinery/airlock_sensor/airlock_exterior/shuttle/return_air() +/obj/machinery/airlock_sensor/airlock_exterior/shuttle/return_air() var/turf/T = get_step(src, dir) if(isnull(T)) return ..() return T.return_air() -obj/machinery/access_button +/obj/machinery/access_button icon = 'icons/obj/airlock_machines.dmi' icon_state = "access_button_standby" layer = ABOVE_WINDOW_LAYER @@ -245,20 +245,20 @@ obj/machinery/access_button var/on = 1 -obj/machinery/access_button/update_icon() +/obj/machinery/access_button/update_icon() if(on) icon_state = "access_button_standby" else icon_state = "access_button_off" -obj/machinery/access_button/attackby(obj/item/I as obj, mob/user as mob) +/obj/machinery/access_button/attackby(obj/item/I as obj, mob/user as mob) //Swiping ID on the access button if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda)) attack_hand(user) return ..() -obj/machinery/access_button/attack_hand(mob/user) +/obj/machinery/access_button/attack_hand(mob/user) add_fingerprint(usr) if(!allowed(user)) to_chat(user, "Access Denied") @@ -273,25 +273,25 @@ obj/machinery/access_button/attack_hand(mob/user) flick("access_button_cycle", src) -obj/machinery/access_button/proc/set_frequency(new_frequency) +/obj/machinery/access_button/proc/set_frequency(new_frequency) radio_controller.remove_object(src, frequency) frequency = new_frequency radio_connection = radio_controller.add_object(src, frequency, RADIO_AIRLOCK) -obj/machinery/access_button/Initialize() +/obj/machinery/access_button/Initialize() . = ..() set_frequency(frequency) -obj/machinery/access_button/Destroy() +/obj/machinery/access_button/Destroy() if(radio_controller) radio_controller.remove_object(src, frequency) return ..() -obj/machinery/access_button/airlock_interior +/obj/machinery/access_button/airlock_interior frequency = 1379 command = "cycle_interior" -obj/machinery/access_button/airlock_exterior +/obj/machinery/access_button/airlock_exterior frequency = 1379 command = "cycle_exterior" diff --git a/code/game/machinery/doors/blast_door.dm b/code/game/machinery/doors/blast_door.dm index fee4973703..6bd7a82291 100644 --- a/code/game/machinery/doors/blast_door.dm +++ b/code/game/machinery/doors/blast_door.dm @@ -285,6 +285,7 @@ return force_close() + return 1 // Proc: repair() // Parameters: None @@ -305,7 +306,7 @@ // SUBTYPE: Regular // Your classical blast door, found almost everywhere. -obj/machinery/door/blast/regular +/obj/machinery/door/blast/regular icon_state_open = "pdoor0" icon_state_opening = "pdoorc0" icon_state_closed = "pdoor1" @@ -313,7 +314,7 @@ obj/machinery/door/blast/regular icon_state = "pdoor1" maxhealth = 600 -obj/machinery/door/blast/regular/open +/obj/machinery/door/blast/regular/open icon_state = "pdoor0" density = 0 opacity = 0 @@ -330,7 +331,7 @@ obj/machinery/door/blast/regular/open // SUBTYPE: Transparent // Not technically a blast door but operates like one. Allows air and light. -obj/machinery/door/blast/gate +/obj/machinery/door/blast/gate name = "thick gate" icon_state_open = "tshutter0" icon_state_opening = "tshutterc0" @@ -343,7 +344,7 @@ obj/machinery/door/blast/gate opacity = 0 istransparent = 1 -obj/machinery/door/blast/gate/open +/obj/machinery/door/blast/gate/open icon_state = "tshutter0" density = 0 @@ -375,5 +376,81 @@ obj/machinery/door/blast/gate/open icon_state = "bars_1" density = 0 +// SUBTYPE: Multi-tile +// Pod doors ported from Paradise + + // Whoever wrote the old code for multi-tile spesspod doors needs to burn in hell. - Unknown + // Wise words. - Bxil +/obj/machinery/door/blast/multi_tile + name = "large blast door" + +/obj/machinery/door/blast/multi_tile/Initialize(mapload) + . = ..() + apply_opacity_to_my_turfs(opacity) + +/obj/machinery/door/blast/multi_tile/open() + if((. = ..())) + apply_opacity_to_my_turfs(opacity) + +/obj/machinery/door/blast/multi_tile/close() + if((. = ..())) + apply_opacity_to_my_turfs(opacity) + +/obj/machinery/door/blast/multi_tile/Destroy() + apply_opacity_to_my_turfs(0) + return ..() + +//Multi-tile poddoors don't turn invisible automatically, so we change the opacity of the turfs below instead one by one. +/obj/machinery/door/blast/multi_tile/proc/apply_opacity_to_my_turfs(new_opacity) + for(var/turf/T in locs) + T.opacity = new_opacity + T.has_opaque_atom = new_opacity + T.reconsider_lights() + update_nearby_tiles() + +/obj/machinery/door/blast/multi_tile + icon_state_open = "open" + icon_state_opening = "opening" + icon_state_closed = "closed" + icon_state_closing = "closing" + icon_state = "closed" + +/obj/machinery/door/blast/multi_tile/four_tile_ver + icon = 'icons/obj/doors/1x4blast_vert.dmi' + bound_height = 128 + width = 4 + dir = NORTH + +/obj/machinery/door/blast/multi_tile/three_tile_ver + icon = 'icons/obj/doors/1x3blast_vert.dmi' + bound_height = 96 + width = 3 + dir = NORTH + +/obj/machinery/door/blast/multi_tile/two_tile_ver + icon = 'icons/obj/doors/1x2blast_vert.dmi' + bound_height = 64 + width = 2 + dir = NORTH + +/obj/machinery/door/blast/multi_tile/four_tile_hor + icon = 'icons/obj/doors/1x4blast_hor.dmi' + bound_width = 128 + width = 4 + dir = EAST + +/obj/machinery/door/blast/multi_tile/three_tile_hor + icon = 'icons/obj/doors/1x3blast_hor.dmi' + bound_width = 96 + width = 3 + dir = EAST + +/obj/machinery/door/blast/multi_tile/two_tile_hor + icon = 'icons/obj/doors/1x2blast_hor.dmi' + bound_width = 64 + width = 2 + dir = EAST + + #undef BLAST_DOOR_CRUSH_DAMAGE #undef SHUTTER_CRUSH_DAMAGE \ No newline at end of file diff --git a/code/game/machinery/doors/firedoor_assembly.dm b/code/game/machinery/doors/firedoor_assembly.dm index aa857d5065..ab1de73c60 100644 --- a/code/game/machinery/doors/firedoor_assembly.dm +++ b/code/game/machinery/doors/firedoor_assembly.dm @@ -1,4 +1,4 @@ -obj/structure/firedoor_assembly +/obj/structure/firedoor_assembly name = "\improper emergency shutter assembly" desc = "It can save lives." icon = 'icons/obj/doors/DoorHazard.dmi' @@ -9,7 +9,7 @@ obj/structure/firedoor_assembly var/wired = 0 var/glass = FALSE -obj/structure/firedoor_assembly/update_icon() +/obj/structure/firedoor_assembly/update_icon() if(glass) icon = 'icons/obj/doors/DoorHazardGlass.dmi' else @@ -19,7 +19,7 @@ obj/structure/firedoor_assembly/update_icon() else icon_state = "door_construction" -obj/structure/firedoor_assembly/attackby(obj/item/C, mob/user as mob) +/obj/structure/firedoor_assembly/attackby(obj/item/C, mob/user as mob) if(istype(C, /obj/item/stack/cable_coil) && !wired && anchored) var/obj/item/stack/cable_coil/cable = C if (cable.get_amount() < 1) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index cfd0b3706c..a50e54ba75 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -20,7 +20,7 @@ /obj/machinery/door/window/New() ..() update_nearby_tiles() - if (src.req_access && src.req_access.len) + if(LAZYLEN(req_access)) src.icon_state = "[src.icon_state]" src.base_state = src.icon_state return @@ -38,12 +38,10 @@ 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 + if(LAZYLEN(req_access)) + ae.conf_access = req_access + else if (LAZYLEN(req_one_access)) + ae.conf_access = req_one_access ae.one_access = 1 else ae = electronics @@ -241,12 +239,10 @@ else if(!electronics) wa.electronics = new/obj/item/weapon/airlock_electronics() - if(!src.req_access) - src.check_access() - if(src.req_access.len) - wa.electronics.conf_access = src.req_access - else if (src.req_one_access.len) - wa.electronics.conf_access = src.req_one_access + if(LAZYLEN(req_access)) + wa.electronics.conf_access = req_access + else if (LAZYLEN(req_one_access)) + wa.electronics.conf_access = req_one_access wa.electronics.one_access = 1 else wa.electronics = electronics diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm index bbe003243a..0e2b7d5dc7 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers.dm @@ -2,7 +2,7 @@ /obj/machinery/embedded_controller/radio/airlock // Setup parameters only radio_filter = RADIO_AIRLOCK - program = /datum/computer/file/embedded_program/airlock + program = /datum/embedded_program/airlock var/tag_exterior_door var/tag_interior_door var/tag_airpump diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller.dm b/code/game/machinery/embedded_controller/airlock_docking_controller.dm index 080fa7d357..ce7219e57f 100644 --- a/code/game/machinery/embedded_controller/airlock_docking_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_docking_controller.dm @@ -1,31 +1,31 @@ /* * NOTE - This file defines both these datums: Yes, you read that right. Its confusing. Lets try and break it down. - * /datum/computer/file/embedded_program/docking/airlock + * /datum/embedded_program/docking/airlock * - A docking controller for an airlock based docking port - * /datum/computer/file/embedded_program/airlock/docking + * /datum/embedded_program/airlock/docking * - An extension to the normal airlock program allows disabling of the regular airlock functions when docking */ //a docking port based on an airlock /obj/machinery/embedded_controller/radio/airlock/docking_port name = "docking port controller" - var/datum/computer/file/embedded_program/airlock/docking/airlock_program - var/datum/computer/file/embedded_program/docking/airlock/docking_program + var/datum/embedded_program/airlock/docking/airlock_program + var/datum/embedded_program/docking/airlock/docking_program var/display_name // For mappers to override docking_program.display_name (how would it show up on docking monitoring program) tag_secure = 1 valid_actions = list("cycle_ext", "cycle_int", "force_ext", "force_int", "abort", "toggle_override") /obj/machinery/embedded_controller/radio/airlock/docking_port/Initialize() . = ..() - airlock_program = new/datum/computer/file/embedded_program/airlock/docking(src) - docking_program = new/datum/computer/file/embedded_program/docking/airlock(src, airlock_program) + airlock_program = new/datum/embedded_program/airlock/docking(src) + docking_program = new/datum/embedded_program/docking/airlock(src, airlock_program) program = docking_program if(display_name) docking_program.display_name = display_name /obj/machinery/embedded_controller/radio/airlock/docking_port/attackby(obj/item/W, mob/user) if(istype(W,/obj/item/device/multitool)) //give them part of code, would take few tries to get full - var/datum/computer/file/embedded_program/docking/airlock/docking_program = program + var/datum/embedded_program/docking/airlock/docking_program = program var/code = docking_program.docking_codes if(!code) code = "N/A" @@ -36,8 +36,8 @@ ..() /obj/machinery/embedded_controller/radio/airlock/docking_port/tgui_data(mob/user) - var/datum/computer/file/embedded_program/docking/airlock/docking_program = program - var/datum/computer/file/embedded_program/airlock/docking/airlock_program = docking_program.airlock_program + var/datum/embedded_program/docking/airlock/docking_program = program + var/datum/embedded_program/airlock/docking/airlock_program = docking_program.airlock_program . = list( "chamber_pressure" = round(airlock_program.memory["chamber_sensor_pressure"]), @@ -55,15 +55,15 @@ /////////////////////////////////////////////////////////////////////////////// //A docking controller for an airlock based docking port // -/datum/computer/file/embedded_program/docking/airlock - var/datum/computer/file/embedded_program/airlock/docking/airlock_program +/datum/embedded_program/docking/airlock + var/datum/embedded_program/airlock/docking/airlock_program -/datum/computer/file/embedded_program/docking/airlock/New(var/obj/machinery/embedded_controller/M, var/datum/computer/file/embedded_program/airlock/docking/A) +/datum/embedded_program/docking/airlock/New(var/obj/machinery/embedded_controller/M, var/datum/embedded_program/airlock/docking/A) ..(M) airlock_program = A airlock_program.master_prog = src -/datum/computer/file/embedded_program/docking/airlock/receive_user_command(command) +/datum/embedded_program/docking/airlock/receive_user_command(command) if (command == "toggle_override") if (override_enabled) disable_override() @@ -74,35 +74,35 @@ . = ..(command) . = airlock_program.receive_user_command(command) || . //pass along to subprograms; bypass shortcircuit -/datum/computer/file/embedded_program/docking/airlock/process() +/datum/embedded_program/docking/airlock/process() airlock_program.process() ..() -/datum/computer/file/embedded_program/docking/airlock/receive_signal(datum/signal/signal, receive_method, receive_param) +/datum/embedded_program/docking/airlock/receive_signal(datum/signal/signal, receive_method, receive_param) airlock_program.receive_signal(signal, receive_method, receive_param) //pass along to subprograms ..(signal, receive_method, receive_param) //tell the docking port to start getting ready for docking - e.g. pressurize -/datum/computer/file/embedded_program/docking/airlock/prepare_for_docking() +/datum/embedded_program/docking/airlock/prepare_for_docking() airlock_program.begin_dock_cycle() //are we ready for docking? -/datum/computer/file/embedded_program/docking/airlock/ready_for_docking() +/datum/embedded_program/docking/airlock/ready_for_docking() return airlock_program.done_cycling() //we are docked, open the doors or whatever. -/datum/computer/file/embedded_program/docking/airlock/finish_docking() +/datum/embedded_program/docking/airlock/finish_docking() airlock_program.enable_mech_regulation() airlock_program.open_doors() //tell the docking port to start getting ready for undocking - e.g. close those doors. -/datum/computer/file/embedded_program/docking/airlock/prepare_for_undocking() +/datum/embedded_program/docking/airlock/prepare_for_undocking() airlock_program.stop_cycling() airlock_program.close_doors() airlock_program.disable_mech_regulation() //are we ready for undocking? -/datum/computer/file/embedded_program/docking/airlock/ready_for_undocking() +/datum/embedded_program/docking/airlock/ready_for_undocking() var/ext_closed = airlock_program.check_exterior_door_secured() var/int_closed = airlock_program.check_interior_door_secured() return (ext_closed || int_closed) @@ -111,37 +111,37 @@ //An airlock controller to be used by the airlock-based docking port controller. //Same as a regular airlock controller but allows disabling of the regular airlock functions when docking // -/datum/computer/file/embedded_program/airlock/docking - var/datum/computer/file/embedded_program/docking/airlock/master_prog +/datum/embedded_program/airlock/docking + var/datum/embedded_program/docking/airlock/master_prog -/datum/computer/file/embedded_program/airlock/docking/Destroy() +/datum/embedded_program/airlock/docking/Destroy() if(master_prog) master_prog.airlock_program = null master_prog = null return ..() -/datum/computer/file/embedded_program/airlock/docking/receive_user_command(command) +/datum/embedded_program/airlock/docking/receive_user_command(command) if (master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled return ..(command) -/datum/computer/file/embedded_program/airlock/docking/proc/open_doors() +/datum/embedded_program/airlock/docking/proc/open_doors() toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "open") toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "open") -/datum/computer/file/embedded_program/airlock/docking/cycleDoors(var/target) +/datum/embedded_program/airlock/docking/cycleDoors(var/target) if (master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled ..(target) /*** DEBUG VERBS *** -/datum/computer/file/embedded_program/docking/proc/print_state() +/datum/embedded_program/docking/proc/print_state() to_world("id_tag: [id_tag]") to_world("dock_state: [dock_state]") to_world("control_mode: [control_mode]") to_world("tag_target: [tag_target]") to_world("response_sent: [response_sent]") -/datum/computer/file/embedded_program/docking/post_signal(datum/signal/signal, comm_line) +/datum/embedded_program/docking/post_signal(datum/signal/signal, comm_line) to_world("Program [id_tag] sent a message!") print_state() to_world("[id_tag] sent command \"[signal.data["command"]]\" to \"[signal.data["recipient"]]\"") diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm index b153437ca6..3a10c45fad 100644 --- a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm +++ b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm @@ -2,7 +2,7 @@ //this is the master controller, that things will try to dock with. /obj/machinery/embedded_controller/radio/docking_port_multi name = "docking port controller" - program = /datum/computer/file/embedded_program/docking/multi + program = /datum/embedded_program/docking/multi var/child_tags_txt var/child_names_txt var/list/child_names = list() @@ -16,7 +16,7 @@ child_names[tags[i]] = names[i] /obj/machinery/embedded_controller/radio/docking_port_multi/tgui_data(mob/user) - var/datum/computer/file/embedded_program/docking/multi/docking_program = program // Cast to proper type + var/datum/embedded_program/docking/multi/docking_program = program // Cast to proper type var/list/airlocks[child_names.len] var/i = 1 @@ -36,14 +36,14 @@ // This is the actual controller that will be commanded by the master defined above /obj/machinery/embedded_controller/radio/airlock/docking_port_multi name = "docking port controller" - program = /datum/computer/file/embedded_program/airlock/multi_docking + program = /datum/embedded_program/airlock/multi_docking var/master_tag //for mapping tag_secure = 1 valid_actions = list("cycle_ext", "cycle_int", "force_ext", "force_int", "abort", "toggle_override") /obj/machinery/embedded_controller/radio/airlock/docking_port_multi/tgui_data(mob/user) - var/datum/computer/file/embedded_program/airlock/multi_docking/airlock_program = program // Cast to proper type + var/datum/embedded_program/airlock/multi_docking/airlock_program = program // Cast to proper type . = list( "chamber_pressure" = round(airlock_program.memory["chamber_sensor_pressure"]), @@ -58,14 +58,14 @@ /*** DEBUG VERBS *** -/datum/computer/file/embedded_program/docking/multi/proc/print_state() +/datum/embedded_program/docking/multi/proc/print_state() to_world("id_tag: [id_tag]") to_world("dock_state: [dock_state]") to_world("control_mode: [control_mode]") to_world("tag_target: [tag_target]") to_world("response_sent: [response_sent]") -/datum/computer/file/embedded_program/docking/multi/post_signal(datum/signal/signal, comm_line) +/datum/embedded_program/docking/multi/post_signal(datum/signal/signal, comm_line) to_world("Program [id_tag] sent a message!") print_state() to_world("[id_tag] sent command \"[signal.data["command"]]\" to \"[signal.data["recipient"]]\"") diff --git a/code/game/machinery/embedded_controller/airlock_program.dm b/code/game/machinery/embedded_controller/airlock_program.dm index dc02084f98..786e9a1b74 100644 --- a/code/game/machinery/embedded_controller/airlock_program.dm +++ b/code/game/machinery/embedded_controller/airlock_program.dm @@ -12,7 +12,7 @@ #define MIN_TARGET_PRESSURE (ONE_ATMOSPHERE * 0.05) // Never try to pump to pure vacuum, its not happening. #define SKIPCYCLE_MARGIN 1 // Skip cycling airlock (just open the doors) if pressures are within this range. -/datum/computer/file/embedded_program/airlock +/datum/embedded_program/airlock var/tag_exterior_door var/tag_interior_door var/tag_airpump @@ -29,7 +29,7 @@ var/tag_pump_out_external var/tag_pump_out_internal -/datum/computer/file/embedded_program/airlock/New(var/obj/machinery/embedded_controller/M) +/datum/embedded_program/airlock/New(var/obj/machinery/embedded_controller/M) ..(M) memory["chamber_sensor_pressure"] = ONE_ATMOSPHERE @@ -62,7 +62,7 @@ signalDoor(tag_exterior_door, "update") //signals connected doors to update their status signalDoor(tag_interior_door, "update") -/datum/computer/file/embedded_program/airlock/receive_signal(datum/signal/signal, receive_method, receive_param) +/datum/embedded_program/airlock/receive_signal(datum/signal/signal, receive_method, receive_param) var/receive_tag = signal.data["tag"] if(!receive_tag) return @@ -115,7 +115,7 @@ receive_user_command("cycle_int") -/datum/computer/file/embedded_program/airlock/receive_user_command(command) +/datum/embedded_program/airlock/receive_user_command(command) var/shutdown_pump = 0 . = TRUE switch(command) @@ -175,7 +175,7 @@ -/datum/computer/file/embedded_program/airlock/process() +/datum/embedded_program/airlock/process() if(!state) //Idle if(target_state) switch(target_state) @@ -271,49 +271,49 @@ //these are here so that other types don't have to make so many assuptions about our implementation -/datum/computer/file/embedded_program/airlock/proc/begin_cycle_in() +/datum/embedded_program/airlock/proc/begin_cycle_in() state = STATE_IDLE target_state = TARGET_INOPEN memory["purge"] = cycle_to_external_air -/datum/computer/file/embedded_program/airlock/proc/begin_dock_cycle() +/datum/embedded_program/airlock/proc/begin_dock_cycle() state = STATE_IDLE target_state = TARGET_INOPEN -/datum/computer/file/embedded_program/airlock/proc/begin_cycle_out() +/datum/embedded_program/airlock/proc/begin_cycle_out() state = STATE_IDLE target_state = TARGET_OUTOPEN memory["purge"] = cycle_to_external_air -/datum/computer/file/embedded_program/airlock/proc/close_doors() +/datum/embedded_program/airlock/proc/close_doors() toggleDoor(memory["interior_status"], tag_interior_door, 1, "close") toggleDoor(memory["exterior_status"], tag_exterior_door, 1, "close") -/datum/computer/file/embedded_program/airlock/proc/stop_cycling() +/datum/embedded_program/airlock/proc/stop_cycling() state = STATE_IDLE target_state = TARGET_NONE -/datum/computer/file/embedded_program/airlock/proc/done_cycling() +/datum/embedded_program/airlock/proc/done_cycling() return (state == STATE_IDLE && target_state == TARGET_NONE) //are the doors closed and locked? -/datum/computer/file/embedded_program/airlock/proc/check_exterior_door_secured() +/datum/embedded_program/airlock/proc/check_exterior_door_secured() return (memory["exterior_status"]["state"] == "closed" && memory["exterior_status"]["lock"] == "locked") -/datum/computer/file/embedded_program/airlock/proc/check_interior_door_secured() +/datum/embedded_program/airlock/proc/check_interior_door_secured() return (memory["interior_status"]["state"] == "closed" && memory["interior_status"]["lock"] == "locked") -/datum/computer/file/embedded_program/airlock/proc/check_doors_secured() +/datum/embedded_program/airlock/proc/check_doors_secured() var/ext_closed = check_exterior_door_secured() var/int_closed = check_interior_door_secured() return (ext_closed && int_closed) -/datum/computer/file/embedded_program/airlock/proc/signalDoor(var/tag, var/command) +/datum/embedded_program/airlock/proc/signalDoor(var/tag, var/command) var/datum/signal/signal = new signal.data["tag"] = tag signal.data["command"] = command post_signal(signal, RADIO_AIRLOCK) -/datum/computer/file/embedded_program/airlock/proc/signalPump(var/tag, var/power, var/direction, var/pressure) +/datum/embedded_program/airlock/proc/signalPump(var/tag, var/power, var/direction, var/pressure) var/datum/signal/signal = new signal.data = list( "tag" = tag, @@ -325,7 +325,7 @@ post_signal(signal) //this is called to set the appropriate door state at the end of a cycling process, or for the exterior buttons -/datum/computer/file/embedded_program/airlock/proc/cycleDoors(var/target) +/datum/embedded_program/airlock/proc/cycleDoors(var/target) switch(target) if(TARGET_OUTOPEN) toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "close") @@ -341,17 +341,17 @@ signalDoor(tag_exterior_door, command) signalDoor(tag_interior_door, command) -datum/computer/file/embedded_program/airlock/proc/signal_mech_sensor(var/command, var/sensor) +/datum/embedded_program/airlock/proc/signal_mech_sensor(var/command, var/sensor) var/datum/signal/signal = new signal.data["tag"] = sensor signal.data["command"] = command post_signal(signal) -/datum/computer/file/embedded_program/airlock/proc/enable_mech_regulation() +/datum/embedded_program/airlock/proc/enable_mech_regulation() signal_mech_sensor("enable", tag_shuttle_mech_sensor) signal_mech_sensor("enable", tag_airlock_mech_sensor) -/datum/computer/file/embedded_program/airlock/proc/disable_mech_regulation() +/datum/embedded_program/airlock/proc/disable_mech_regulation() signal_mech_sensor("disable", tag_shuttle_mech_sensor) signal_mech_sensor("disable", tag_airlock_mech_sensor) @@ -367,7 +367,7 @@ Only sends a command if it is needed, i.e. if the door is already open, passing an open command to this proc will not send an additional command to open the door again. ----------------------------------------------------------*/ -/datum/computer/file/embedded_program/airlock/proc/toggleDoor(var/list/doorStatus, var/doorTag, var/secure, var/command) +/datum/embedded_program/airlock/proc/toggleDoor(var/list/doorStatus, var/doorTag, var/secure, var/command) var/doorCommand = null if(command == "toggle") diff --git a/code/game/machinery/embedded_controller/docking_program.dm b/code/game/machinery/embedded_controller/docking_program.dm index 86876abe28..7adc3ba9d3 100644 --- a/code/game/machinery/embedded_controller/docking_program.dm +++ b/code/game/machinery/embedded_controller/docking_program.dm @@ -61,7 +61,7 @@ */ -/datum/computer/file/embedded_program/docking +/datum/embedded_program/docking var/tag_target //the tag of the docking controller that we are trying to dock with var/dock_state = STATE_UNDOCKED var/control_mode = MODE_NONE @@ -73,18 +73,18 @@ var/docking_codes //would only allow docking when receiving signal with these, if set var/display_name //Override the name shown on docking monitoring program; defaults to area name + coordinates if unset -/datum/computer/file/embedded_program/docking/New() +/datum/embedded_program/docking/New() ..() if(id_tag) if(SSshuttles.docking_registry[id_tag]) crash_with("Docking controller tag [id_tag] had multiple associated programs.") SSshuttles.docking_registry[id_tag] = src -/datum/computer/file/embedded_program/docking/Destroy() +/datum/embedded_program/docking/Destroy() SSshuttles.docking_registry -= id_tag return ..() -/datum/computer/file/embedded_program/docking/receive_signal(datum/signal/signal, receive_method, receive_param) +/datum/embedded_program/docking/receive_signal(datum/signal/signal, receive_method, receive_param) var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id var/command = signal.data["command"] var/recipient = signal.data["recipient"] //the intended recipient of the docking signal @@ -149,7 +149,7 @@ if (receive_tag == tag_target) reset() -/datum/computer/file/embedded_program/docking/process() +/datum/embedded_program/docking/process() switch(dock_state) if (STATE_DOCKING) //waiting for our docking port to be ready for docking if (ready_for_docking()) @@ -198,7 +198,7 @@ control_mode = MODE_NONE -/datum/computer/file/embedded_program/docking/proc/initiate_docking(var/target) +/datum/embedded_program/docking/proc/initiate_docking(var/target) if (dock_state != STATE_UNDOCKED || control_mode == MODE_SERVER) //must be undocked and not serving another request to begin a new docking handshake return @@ -207,7 +207,7 @@ send_docking_command(tag_target, "request_dock") -/datum/computer/file/embedded_program/docking/proc/initiate_undocking() +/datum/embedded_program/docking/proc/initiate_undocking() if (dock_state != STATE_DOCKED || control_mode != MODE_CLIENT) //must be docked and must be client to start undocking return @@ -220,36 +220,36 @@ send_docking_command(tag_target, "request_undock") //tell the docking port to start getting ready for docking - e.g. pressurize -/datum/computer/file/embedded_program/docking/proc/prepare_for_docking() +/datum/embedded_program/docking/proc/prepare_for_docking() return //are we ready for docking? -/datum/computer/file/embedded_program/docking/proc/ready_for_docking() +/datum/embedded_program/docking/proc/ready_for_docking() return 1 //we are docked, open the doors or whatever. -/datum/computer/file/embedded_program/docking/proc/finish_docking() +/datum/embedded_program/docking/proc/finish_docking() return //tell the docking port to start getting ready for undocking - e.g. close those doors. -/datum/computer/file/embedded_program/docking/proc/prepare_for_undocking() +/datum/embedded_program/docking/proc/prepare_for_undocking() return //we are docked, open the doors or whatever. -/datum/computer/file/embedded_program/docking/proc/finish_undocking() +/datum/embedded_program/docking/proc/finish_undocking() return //are we ready for undocking? -/datum/computer/file/embedded_program/docking/proc/ready_for_undocking() +/datum/embedded_program/docking/proc/ready_for_undocking() return 1 -/datum/computer/file/embedded_program/docking/proc/enable_override() +/datum/embedded_program/docking/proc/enable_override() override_enabled = 1 -/datum/computer/file/embedded_program/docking/proc/disable_override() +/datum/embedded_program/docking/proc/disable_override() override_enabled = 0 -/datum/computer/file/embedded_program/docking/proc/reset() +/datum/embedded_program/docking/proc/reset() dock_state = STATE_UNDOCKED broadcast_docking_status() @@ -258,23 +258,23 @@ response_sent = 0 received_confirm = 0 -/datum/computer/file/embedded_program/docking/proc/force_undock() +/datum/embedded_program/docking/proc/force_undock() //to_world("[id_tag]: forcing undock") if (tag_target) send_docking_command(tag_target, "dock_error") reset() -/datum/computer/file/embedded_program/docking/proc/docked() +/datum/embedded_program/docking/proc/docked() return (dock_state == STATE_DOCKED) -/datum/computer/file/embedded_program/docking/proc/undocked() +/datum/embedded_program/docking/proc/undocked() return (dock_state == STATE_UNDOCKED) //returns 1 if we are saftely undocked (and the shuttle can leave) -/datum/computer/file/embedded_program/docking/proc/can_launch() +/datum/embedded_program/docking/proc/can_launch() return undocked() -/datum/computer/file/embedded_program/docking/proc/send_docking_command(var/recipient, var/command) +/datum/embedded_program/docking/proc/send_docking_command(var/recipient, var/command) var/datum/signal/signal = new signal.data["tag"] = id_tag signal.data["command"] = command @@ -282,21 +282,21 @@ signal.data["code"] = docking_codes post_signal(signal) -/datum/computer/file/embedded_program/docking/proc/broadcast_docking_status() +/datum/embedded_program/docking/proc/broadcast_docking_status() var/datum/signal/signal = new signal.data["tag"] = id_tag signal.data["dock_status"] = get_docking_status() post_signal(signal) //this is mostly for NanoUI -/datum/computer/file/embedded_program/docking/proc/get_docking_status() +/datum/embedded_program/docking/proc/get_docking_status() switch (dock_state) if (STATE_UNDOCKED) return "undocked" if (STATE_DOCKING) return "docking" if (STATE_UNDOCKING) return "undocking" if (STATE_DOCKED) return "docked" -/datum/computer/file/embedded_program/docking/proc/get_name() +/datum/embedded_program/docking/proc/get_name() return display_name ? display_name : "[get_area(master)] ([master.x], [master.y])" #undef STATE_UNDOCKED diff --git a/code/game/machinery/embedded_controller/docking_program_multi.dm b/code/game/machinery/embedded_controller/docking_program_multi.dm index a4ad7d2985..b4f22bc244 100644 --- a/code/game/machinery/embedded_controller/docking_program_multi.dm +++ b/code/game/machinery/embedded_controller/docking_program_multi.dm @@ -6,12 +6,12 @@ /* the master program */ -/datum/computer/file/embedded_program/docking/multi +/datum/embedded_program/docking/multi var/list/children_tags var/list/children_ready var/list/children_override -/datum/computer/file/embedded_program/docking/multi/New(var/obj/machinery/embedded_controller/M) +/datum/embedded_program/docking/multi/New(var/obj/machinery/embedded_controller/M) ..(M) if (istype(M,/obj/machinery/embedded_controller/radio/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction @@ -25,11 +25,11 @@ children_ready[child_tag] = 0 children_override[child_tag] = "disabled" -/datum/computer/file/embedded_program/docking/multi/proc/clear_children_ready_status() +/datum/embedded_program/docking/multi/proc/clear_children_ready_status() for (var/child_tag in children_tags) children_ready[child_tag] = 0 -/datum/computer/file/embedded_program/docking/multi/receive_signal(datum/signal/signal, receive_method, receive_param) +/datum/embedded_program/docking/multi/receive_signal(datum/signal/signal, receive_method, receive_param) var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id var/command = signal.data["command"] var/recipient = signal.data["recipient"] //the intended recipient of the docking signal @@ -53,7 +53,7 @@ ..(signal, receive_method, receive_param) -/datum/computer/file/embedded_program/docking/multi/prepare_for_docking() +/datum/embedded_program/docking/multi/prepare_for_docking() //clear children ready status clear_children_ready_status() @@ -61,14 +61,14 @@ for (var/child_tag in children_tags) send_docking_command(child_tag, "prepare_for_docking") -/datum/computer/file/embedded_program/docking/multi/ready_for_docking() +/datum/embedded_program/docking/multi/ready_for_docking() //check children ready status for (var/child_tag in children_tags) if (!children_ready[child_tag]) return 0 return 1 -/datum/computer/file/embedded_program/docking/multi/finish_docking() +/datum/embedded_program/docking/multi/finish_docking() //tell children to finish docking for (var/child_tag in children_tags) send_docking_command(child_tag, "finish_docking") @@ -76,7 +76,7 @@ //clear ready flags clear_children_ready_status() -/datum/computer/file/embedded_program/docking/multi/prepare_for_undocking() +/datum/embedded_program/docking/multi/prepare_for_undocking() //clear children ready status clear_children_ready_status() @@ -84,14 +84,14 @@ for (var/child_tag in children_tags) send_docking_command(child_tag, "prepare_for_undocking") -/datum/computer/file/embedded_program/docking/multi/ready_for_undocking() +/datum/embedded_program/docking/multi/ready_for_undocking() //check children ready status for (var/child_tag in children_tags) if (!children_ready[child_tag]) return 0 return 1 -/datum/computer/file/embedded_program/docking/multi/finish_undocking() +/datum/embedded_program/docking/multi/finish_undocking() //tell children to finish undocking for (var/child_tag in children_tags) send_docking_command(child_tag, "finish_undocking") @@ -106,7 +106,7 @@ the child program technically should be "slave" but eh... I'm too politically correct. */ -/datum/computer/file/embedded_program/airlock/multi_docking +/datum/embedded_program/airlock/multi_docking var/master_tag var/master_status = "undocked" @@ -115,14 +115,14 @@ var/docking_mode = 0 //0 = docking, 1 = undocking var/response_sent = 0 -/datum/computer/file/embedded_program/airlock/multi_docking/New(var/obj/machinery/embedded_controller/M) +/datum/embedded_program/airlock/multi_docking/New(var/obj/machinery/embedded_controller/M) ..(M) if (istype(M, /obj/machinery/embedded_controller/radio/airlock/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction var/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/controller = M src.master_tag = controller.master_tag -/datum/computer/file/embedded_program/airlock/multi_docking/receive_user_command(command) +/datum/embedded_program/airlock/multi_docking/receive_user_command(command) if (command == "toggle_override") if (override_enabled) override_enabled = 0 @@ -135,7 +135,7 @@ if (!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled ..(command) -/datum/computer/file/embedded_program/airlock/multi_docking/receive_signal(datum/signal/signal, receive_method, receive_param) +/datum/embedded_program/airlock/multi_docking/receive_signal(datum/signal/signal, receive_method, receive_param) ..() var/receive_tag = signal.data["tag"] //for docking signals, this is the sender id @@ -178,7 +178,7 @@ if ("finish_undocking") docking_enabled = 0 -/datum/computer/file/embedded_program/airlock/multi_docking/process() +/datum/embedded_program/airlock/multi_docking/process() ..() if (docking_enabled && !response_sent) @@ -194,31 +194,31 @@ response_sent = 1 //checks if we are ready for docking -/datum/computer/file/embedded_program/airlock/multi_docking/proc/ready_for_docking() +/datum/embedded_program/airlock/multi_docking/proc/ready_for_docking() return done_cycling() //checks if we are ready for undocking -/datum/computer/file/embedded_program/airlock/multi_docking/proc/ready_for_undocking() +/datum/embedded_program/airlock/multi_docking/proc/ready_for_undocking() var/ext_closed = check_exterior_door_secured() var/int_closed = check_interior_door_secured() return (ext_closed || int_closed) -/datum/computer/file/embedded_program/airlock/multi_docking/proc/open_doors() +/datum/embedded_program/airlock/multi_docking/proc/open_doors() toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "open") toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "open") -/datum/computer/file/embedded_program/airlock/multi_docking/cycleDoors(var/target) +/datum/embedded_program/airlock/multi_docking/cycleDoors(var/target) if (!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled ..(target) -/datum/computer/file/embedded_program/airlock/multi_docking/proc/send_signal_to_master(var/command) +/datum/embedded_program/airlock/multi_docking/proc/send_signal_to_master(var/command) var/datum/signal/signal = new signal.data["tag"] = id_tag signal.data["command"] = command signal.data["recipient"] = master_tag post_signal(signal) -/datum/computer/file/embedded_program/airlock/multi_docking/proc/broadcast_override_status() +/datum/embedded_program/airlock/multi_docking/proc/broadcast_override_status() var/datum/signal/signal = new signal.data["tag"] = id_tag signal.data["override_status"] = override_enabled? "enabled" : "disabled" diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index 58db9782da..196edfd224 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -3,7 +3,7 @@ anchored = 1 use_power = USE_POWER_IDLE idle_power_usage = 10 - var/datum/computer/file/embedded_program/program //the currently executing program + var/datum/embedded_program/program //the currently executing program var/list/valid_actions = list() var/on = 1 diff --git a/code/game/machinery/embedded_controller/embedded_program_base.dm b/code/game/machinery/embedded_controller/embedded_program_base.dm index 48340b0c8b..664d60de81 100644 --- a/code/game/machinery/embedded_controller/embedded_program_base.dm +++ b/code/game/machinery/embedded_controller/embedded_program_base.dm @@ -1,30 +1,30 @@ - -/datum/computer/file/embedded_program +/datum/embedded_program + var/name var/list/memory = list() var/obj/machinery/embedded_controller/master var/id_tag -/datum/computer/file/embedded_program/New(var/obj/machinery/embedded_controller/M) +/datum/embedded_program/New(var/obj/machinery/embedded_controller/M) master = M if (istype(M, /obj/machinery/embedded_controller/radio)) var/obj/machinery/embedded_controller/radio/R = M id_tag = R.id_tag -/datum/computer/file/embedded_program/Destroy() +/datum/embedded_program/Destroy() if(master) master.program = null master = null return ..() // Return TRUE if was a command for us, otherwise return FALSE (so controllers with multiple programs can try each in turn until one accepts) -/datum/computer/file/embedded_program/proc/receive_user_command(command) +/datum/embedded_program/proc/receive_user_command(command) return FALSE -/datum/computer/file/embedded_program/proc/receive_signal(datum/signal/signal, receive_method, receive_param) +/datum/embedded_program/proc/receive_signal(datum/signal/signal, receive_method, receive_param) return -/datum/computer/file/embedded_program/proc/post_signal(datum/signal/signal, comm_line) +/datum/embedded_program/proc/post_signal(datum/signal/signal, comm_line) if(master) master.post_signal(signal, comm_line) else diff --git a/code/game/machinery/embedded_controller/simple_docking_controller.dm b/code/game/machinery/embedded_controller/simple_docking_controller.dm index df94c21d5c..741a5f4374 100644 --- a/code/game/machinery/embedded_controller/simple_docking_controller.dm +++ b/code/game/machinery/embedded_controller/simple_docking_controller.dm @@ -1,12 +1,12 @@ //a docking port that uses a single door /obj/machinery/embedded_controller/radio/simple_docking_controller name = "docking hatch controller" - program = /datum/computer/file/embedded_program/docking/simple + program = /datum/embedded_program/docking/simple var/tag_door valid_actions = list("force_door", "toggle_override") /obj/machinery/embedded_controller/radio/simple_docking_controller/tgui_data(mob/user) - var/datum/computer/file/embedded_program/docking/simple/docking_program = program // Cast to proper type + var/datum/embedded_program/docking/simple/docking_program = program // Cast to proper type . = list( "docking_status" = docking_program.get_docking_status(), @@ -16,10 +16,10 @@ ) //A docking controller program for a simple door based docking port -/datum/computer/file/embedded_program/docking/simple +/datum/embedded_program/docking/simple var/tag_door -/datum/computer/file/embedded_program/docking/simple/New(var/obj/machinery/embedded_controller/M) +/datum/embedded_program/docking/simple/New(var/obj/machinery/embedded_controller/M) ..(M) memory["door_status"] = list(state = "closed", lock = "locked") //assume closed and locked in case the doors dont report in @@ -32,7 +32,7 @@ signal_door("update") //signals connected doors to update their status -/datum/computer/file/embedded_program/docking/simple/receive_signal(datum/signal/signal, receive_method, receive_param) +/datum/embedded_program/docking/simple/receive_signal(datum/signal/signal, receive_method, receive_param) var/receive_tag = signal.data["tag"] if(!receive_tag) return @@ -43,7 +43,7 @@ ..(signal, receive_method, receive_param) -/datum/computer/file/embedded_program/docking/simple/receive_user_command(command) +/datum/embedded_program/docking/simple/receive_user_command(command) . = TRUE switch(command) if("force_door") @@ -60,24 +60,24 @@ else . = FALSE -/datum/computer/file/embedded_program/docking/simple/proc/signal_door(var/command) +/datum/embedded_program/docking/simple/proc/signal_door(var/command) var/datum/signal/signal = new signal.data["tag"] = tag_door signal.data["command"] = command post_signal(signal) -///datum/computer/file/embedded_program/docking/simple/proc/signal_mech_sensor(var/command) +///datum/embedded_program/docking/simple/proc/signal_mech_sensor(var/command) // signal_door(command) // return -/datum/computer/file/embedded_program/docking/simple/proc/open_door() +/datum/embedded_program/docking/simple/proc/open_door() if(memory["door_status"]["state"] == "closed") //signal_mech_sensor("enable") signal_door("secure_open") else if(memory["door_status"]["lock"] == "unlocked") signal_door("lock") -/datum/computer/file/embedded_program/docking/simple/proc/close_door() +/datum/embedded_program/docking/simple/proc/close_door() if(memory["door_status"]["state"] == "open") signal_door("secure_close") //signal_mech_sensor("disable") @@ -85,23 +85,23 @@ signal_door("lock") //tell the docking port to start getting ready for docking - e.g. pressurize -/datum/computer/file/embedded_program/docking/simple/prepare_for_docking() +/datum/embedded_program/docking/simple/prepare_for_docking() return //don't need to do anything //are we ready for docking? -/datum/computer/file/embedded_program/docking/simple/ready_for_docking() +/datum/embedded_program/docking/simple/ready_for_docking() return 1 //don't need to do anything //we are docked, open the doors or whatever. -/datum/computer/file/embedded_program/docking/simple/finish_docking() +/datum/embedded_program/docking/simple/finish_docking() open_door() //tell the docking port to start getting ready for undocking - e.g. close those doors. -/datum/computer/file/embedded_program/docking/simple/prepare_for_undocking() +/datum/embedded_program/docking/simple/prepare_for_undocking() close_door() //are we ready for undocking? -/datum/computer/file/embedded_program/docking/simple/ready_for_undocking() +/datum/embedded_program/docking/simple/ready_for_undocking() return (memory["door_status"]["state"] == "closed" && memory["door_status"]["lock"] == "locked") /*** DEBUG VERBS *** diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm index a3cf6c262c..c963449a59 100644 --- a/code/game/machinery/jukebox.dm +++ b/code/game/machinery/jukebox.dm @@ -1,8 +1,8 @@ -datum/track +/datum/track var/title var/sound -datum/track/New(var/title_name, var/audio) +/datum/track/New(var/title_name, var/audio) title = title_name sound = audio diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 8d6a55b3fd..7c25333600 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -200,9 +200,8 @@ var/bomb_set extended = 1 return -obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) - var/dat as text - dat += "Nuclear Fission Explosive
    \nNuclear Device Wires:
    " +/obj/machinery/nuclearbomb/proc/nukehack_win(mob/user as mob) + var/dat = "Nuclear Fission Explosive
    \nNuclear Device Wires:
    " for(var/wire in wires) dat += text("[wire] Wire: [wires[wire] ? "Mend" : "Cut"] Pulse
    ") dat += text("
    The device is [timing ? "shaking!" : "still"]
    ") diff --git a/code/game/machinery/overview.dm b/code/game/machinery/overview.dm index 557f9169dd..705914f794 100644 --- a/code/game/machinery/overview.dm +++ b/code/game/machinery/overview.dm @@ -317,13 +317,13 @@ return -proc/getr(col) +/proc/getr(col) return hex2num(copytext(col, 2,4)) -proc/getg(col) +/proc/getg(col) return hex2num(copytext(col, 4,6)) -proc/getb(col) +/proc/getb(col) return hex2num(copytext(col, 6)) /mob/proc/clearmap() diff --git a/code/game/machinery/oxygen_pump.dm b/code/game/machinery/oxygen_pump.dm index 37c75957be..32a76c3fb8 100644 --- a/code/game/machinery/oxygen_pump.dm +++ b/code/game/machinery/oxygen_pump.dm @@ -1,6 +1,3 @@ -#define TANK_MAX_RELEASE_PRESSURE (3*ONE_ATMOSPHERE) -#define TANK_DEFAULT_RELEASE_PRESSURE ONE_ATMOSPHERE - /obj/machinery/oxygen_pump name = "emergency oxygen pump" icon = 'icons/obj/walllocker.dmi' diff --git a/code/game/machinery/records_scanner.dm b/code/game/machinery/records_scanner.dm index e8fdc17f0e..c4e3ead84b 100644 --- a/code/game/machinery/records_scanner.dm +++ b/code/game/machinery/records_scanner.dm @@ -1,5 +1,5 @@ //not a computer -obj/machinery/scanner +/obj/machinery/scanner name = "identity analyzer" var/outputdir = 0 icon = 'icons/obj/stationobjs.dmi' @@ -8,7 +8,7 @@ obj/machinery/scanner anchored = 1 var/lastuser = null -obj/machinery/scanner/New() +/obj/machinery/scanner/New() if(!outputdir) switch(dir) if(1) @@ -35,7 +35,7 @@ obj/machinery/scanner/New() else icon_state = "scanner_idle" -obj/machinery/scanner/attack_hand(mob/living/carbon/human/user) +/obj/machinery/scanner/attack_hand(mob/living/carbon/human/user) if(stat & NOPOWER) return if(!ishuman(user) || lastuser == user.real_name) diff --git a/code/game/machinery/seed_extractor.dm b/code/game/machinery/seed_extractor.dm index 1b9d89dc00..cb1f0c9ab4 100644 --- a/code/game/machinery/seed_extractor.dm +++ b/code/game/machinery/seed_extractor.dm @@ -6,7 +6,7 @@ density = 1 anchored = 1 -obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob) +/obj/machinery/seed_extractor/attackby(var/obj/item/O as obj, var/mob/user as mob) // Fruits and vegetables. if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown) || istype(O, /obj/item/weapon/grown)) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 1786365ef8..c7cb351e70 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -262,8 +262,7 @@ set_light(0) update() -#undef CHARS_PER_LINE -#undef FOND_SIZE +#undef FONT_SIZE #undef FONT_COLOR #undef FONT_STYLE #undef SCROLL_SPEED \ No newline at end of file diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index d2ccad5d00..6beaa0d309 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -59,10 +59,10 @@ freq_listening = list(AI_FREQ, SCI_FREQ, MED_FREQ, SUP_FREQ, SRV_FREQ, COMM_FREQ, ENG_FREQ, SEC_FREQ, ENT_FREQ) //Common and other radio frequencies for people to freely use - New() - for(var/i = PUBLIC_LOW_FREQ, i < PUBLIC_HIGH_FREQ, i += 2) - freq_listening |= i - ..() +/obj/machinery/telecomms/receiver/preset_right/New() + for(var/i = PUBLIC_LOW_FREQ, i < PUBLIC_HIGH_FREQ, i += 2) + freq_listening |= i + ..() /obj/machinery/telecomms/receiver/preset_cent id = "CentCom Receiver" diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm index 7bd16315e4..4565ab1668 100644 --- a/code/game/machinery/telecomms/traffic_control.dm +++ b/code/game/machinery/telecomms/traffic_control.dm @@ -16,6 +16,7 @@ var/list/viewingcode = list() var/obj/machinery/telecomms/server/SelectedServer circuit = /obj/item/weapon/circuitboard/comm_traffic + req_access = list(access_tcomsat) var/network = "NULL" // the network to probe var/temp = "" // temporary feedback messages @@ -23,190 +24,189 @@ var/storedcode = "" // code stored - proc/update_ide() +/obj/machinery/computer/telecomms/traffic/proc/update_ide() - // loop if there's someone manning the keyboard - while(editingcode) - if(!editingcode.client) - editingcode = null - break + // loop if there's someone manning the keyboard + while(editingcode) + if(!editingcode.client) + editingcode = null + break - // For the typer, the input is enabled. Buffer the typed text + // For the typer, the input is enabled. Buffer the typed text + if(editingcode) + storedcode = "[winget(editingcode, "tcscode", "text")]" + if(editingcode) // double if's to work around a runtime error + winset(editingcode, "tcscode", "is-disabled=false") + + // If the player's not manning the keyboard anymore, adjust everything + if( (!(editingcode in range(1, src)) && !issilicon(editingcode)) || (editingcode.machine != src && !issilicon(editingcode))) if(editingcode) - storedcode = "[winget(editingcode, "tcscode", "text")]" - if(editingcode) // double if's to work around a runtime error - winset(editingcode, "tcscode", "is-disabled=false") + winshow(editingcode, "Telecomms IDE", 0) // hide the window! + editingcode = null + break - // If the player's not manning the keyboard anymore, adjust everything - if( (!(editingcode in range(1, src)) && !issilicon(editingcode)) || (editingcode.machine != src && !issilicon(editingcode))) - if(editingcode) - winshow(editingcode, "Telecomms IDE", 0) // hide the window! - editingcode = null + // For other people viewing the typer type code, the input is disabled and they can only view the code + // (this is put in place so that there's not any magical shenanigans with 50 people inputting different code all at once) + + if(length(viewingcode)) + // This piece of code is very important - it escapes quotation marks so string aren't cut off by the input element + var/showcode = replacetext(storedcode, "\\\"", "\\\\\"") + showcode = replacetext(storedcode, "\"", "\\\"") + + for(var/mob/M in viewingcode) + + if( (M.machine == src && (M in view(1, src)) ) || issilicon(M)) + winset(M, "tcscode", "is-disabled=true") + winset(M, "tcscode", "text=\"[showcode]\"") + else + viewingcode.Remove(M) + winshow(M, "Telecomms IDE", 0) // hide the window! + + sleep(5) + + if(length(viewingcode) > 0) + editingcode = pick(viewingcode) + viewingcode.Remove(editingcode) + update_ide() + + + + +/obj/machinery/computer/telecomms/traffic/attack_hand(mob/user as mob) + if(stat & (BROKEN|NOPOWER)) + return + user.set_machine(src) + var/dat = "Telecommunication Traffic Control
    Telecommunications Traffic Control
    " + + switch(screen) + + + // --- Main Menu --- + + if(0) + dat += "
    [temp]
    " + dat += "
    Current Network: [network]
    " + if(servers.len) + dat += "
    Detected Telecommunication Servers:
      " + for(var/obj/machinery/telecomms/T in servers) + dat += "
    • \ref[T] [T.name] ([T.id])
    • " + dat += "
    " + dat += "
    \[Flush Buffer\]" + + else + dat += "
    No servers detected. Scan for servers: \[Scan\]" + + + // --- Viewing Server --- + + if(1) + dat += "
    [temp]
    " + dat += "
    \[Main Menu\] \[Refresh\]
    " + dat += "
    Current Network: [network]" + dat += "
    Selected Server: [SelectedServer.id]

    " + dat += "
    \[Edit Code\]" + dat += "
    Signal Execution: " + if(SelectedServer.autoruncode) + dat += "ALWAYS" + else + dat += "NEVER" + + + user << browse(dat, "window=traffic_control;size=575x400") + onclose(user, "server_control") + + temp = "" + return + + +/obj/machinery/computer/telecomms/traffic/Topic(href, href_list) + if(..()) + return + + + add_fingerprint(usr) + usr.set_machine(src) + if(!src.allowed(usr) && !emagged) + to_chat(usr, "ACCESS DENIED.") + return + + if(href_list["viewserver"]) + screen = 1 + for(var/obj/machinery/telecomms/T in servers) + if(T.id == href_list["viewserver"]) + SelectedServer = T break - // For other people viewing the typer type code, the input is disabled and they can only view the code - // (this is put in place so that there's not any magical shenanigans with 50 people inputting different code all at once) + if(href_list["operation"]) + switch(href_list["operation"]) - if(length(viewingcode)) - // This piece of code is very important - it escapes quotation marks so string aren't cut off by the input element - var/showcode = replacetext(storedcode, "\\\"", "\\\\\"") - showcode = replacetext(storedcode, "\"", "\\\"") + if("release") + servers = list() + screen = 0 - for(var/mob/M in viewingcode) + if("mainmenu") + screen = 0 - if( (M.machine == src && (M in view(1, src)) ) || issilicon(M)) - winset(M, "tcscode", "is-disabled=true") - winset(M, "tcscode", "text=\"[showcode]\"") - else - viewingcode.Remove(M) - winshow(M, "Telecomms IDE", 0) // hide the window! - - sleep(5) - - if(length(viewingcode) > 0) - editingcode = pick(viewingcode) - viewingcode.Remove(editingcode) - update_ide() - - - - req_access = list(access_tcomsat) - - attack_hand(mob/user as mob) - if(stat & (BROKEN|NOPOWER)) - return - user.set_machine(src) - var/dat = "Telecommunication Traffic Control
    Telecommunications Traffic Control
    " - - switch(screen) - - - // --- Main Menu --- - - if(0) - dat += "
    [temp]
    " - dat += "
    Current Network: [network]
    " - if(servers.len) - dat += "
    Detected Telecommunication Servers:
      " - for(var/obj/machinery/telecomms/T in servers) - dat += "
    • \ref[T] [T.name] ([T.id])
    • " - dat += "
    " - dat += "
    \[Flush Buffer\]" + if("scan") + if(servers.len > 0) + temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -" else - dat += "
    No servers detected. Scan for servers: \[Scan\]" + for(var/obj/machinery/telecomms/server/T in range(25, src)) + if(T.network == network) + servers.Add(T) + if(!servers.len) + temp = "- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -" + else + temp = "- [servers.len] SERVERS PROBED & BUFFERED -" - // --- Viewing Server --- - - if(1) - dat += "
    [temp]
    " - dat += "
    \[Main Menu\] \[Refresh\]
    " - dat += "
    Current Network: [network]" - dat += "
    Selected Server: [SelectedServer.id]

    " - dat += "
    \[Edit Code\]" - dat += "
    Signal Execution: " - if(SelectedServer.autoruncode) - dat += "ALWAYS" - else - dat += "NEVER" - - - user << browse(dat, "window=traffic_control;size=575x400") - onclose(user, "server_control") - - temp = "" - return - - - Topic(href, href_list) - if(..()) - return - - - add_fingerprint(usr) - usr.set_machine(src) - if(!src.allowed(usr) && !emagged) - to_chat(usr, "ACCESS DENIED.") - return - - if(href_list["viewserver"]) - screen = 1 - for(var/obj/machinery/telecomms/T in servers) - if(T.id == href_list["viewserver"]) - SelectedServer = T - break - - if(href_list["operation"]) - switch(href_list["operation"]) - - if("release") - servers = list() screen = 0 - if("mainmenu") - screen = 0 + if("editcode") + if(editingcode == usr) return + if(usr in viewingcode) return - if("scan") - if(servers.len > 0) - temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -" - - else - for(var/obj/machinery/telecomms/server/T in range(25, src)) - if(T.network == network) - servers.Add(T) - - if(!servers.len) - temp = "- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -" - else - temp = "- [servers.len] SERVERS PROBED & BUFFERED -" - - screen = 0 - - if("editcode") - if(editingcode == usr) return - if(usr in viewingcode) return - - if(!editingcode) - lasteditor = usr - editingcode = usr - winshow(editingcode, "Telecomms IDE", 1) // show the IDE - winset(editingcode, "tcscode", "is-disabled=false") - winset(editingcode, "tcscode", "text=\"\"") - var/showcode = replacetext(storedcode, "\\\"", "\\\\\"") - showcode = replacetext(storedcode, "\"", "\\\"") - winset(editingcode, "tcscode", "text=\"[showcode]\"") - spawn() - update_ide() - - else - viewingcode.Add(usr) - winshow(usr, "Telecomms IDE", 1) // show the IDE - winset(usr, "tcscode", "is-disabled=true") - winset(editingcode, "tcscode", "text=\"\"") - var/showcode = replacetext(storedcode, "\"", "\\\"") - winset(usr, "tcscode", "text=\"[showcode]\"") - - if("togglerun") - SelectedServer.autoruncode = !(SelectedServer.autoruncode) - - if(href_list["network"]) - - var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text - - if(newnet && ((usr in range(1, src) || issilicon(usr)))) - if(length(newnet) > 15) - temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -" + if(!editingcode) + lasteditor = usr + editingcode = usr + winshow(editingcode, "Telecomms IDE", 1) // show the IDE + winset(editingcode, "tcscode", "is-disabled=false") + winset(editingcode, "tcscode", "text=\"\"") + var/showcode = replacetext(storedcode, "\\\"", "\\\\\"") + showcode = replacetext(storedcode, "\"", "\\\"") + winset(editingcode, "tcscode", "text=\"[showcode]\"") + spawn() + update_ide() else + viewingcode.Add(usr) + winshow(usr, "Telecomms IDE", 1) // show the IDE + winset(usr, "tcscode", "is-disabled=true") + winset(editingcode, "tcscode", "text=\"\"") + var/showcode = replacetext(storedcode, "\"", "\\\"") + winset(usr, "tcscode", "text=\"[showcode]\"") - network = newnet - screen = 0 - servers = list() - temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -" + if("togglerun") + SelectedServer.autoruncode = !(SelectedServer.autoruncode) - updateUsrDialog() - return + if(href_list["network"]) + + var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text + + if(newnet && ((usr in range(1, src) || issilicon(usr)))) + if(length(newnet) > 15) + temp = "- FAILED: NETWORK TAG STRING TOO LENGHTLY -" + + else + + network = newnet + screen = 0 + servers = list() + temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -" + + updateUsrDialog() + return /obj/machinery/computer/telecomms/traffic/emag_act(var/remaining_charges, var/mob/user) if(!emagged) diff --git a/code/game/magic/archived_book.dm b/code/game/magic/archived_book.dm index a283247996..cc29ed2a8b 100644 --- a/code/game/magic/archived_book.dm +++ b/code/game/magic/archived_book.dm @@ -7,11 +7,11 @@ var/global/datum/book_manager/book_mgr = new() -datum/book_manager/proc/path(id) +/datum/book_manager/proc/path(id) if(isnum(id)) // kill any path exploits return "[BOOK_PATH][id].sav" -datum/book_manager/proc/getall() +/datum/book_manager/proc/getall() var/list/paths = flist(BOOK_PATH) var/list/books = new() @@ -21,7 +21,7 @@ datum/book_manager/proc/getall() return books -datum/book_manager/proc/freeid() +/datum/book_manager/proc/freeid() var/list/paths = flist(BOOK_PATH) var/id = paths.len + 101 @@ -59,10 +59,10 @@ datum/book_manager/proc/freeid() log_admin("[usr.key] has deleted the book [isbn]") // delete a book -datum/book_manager/proc/remove(var/id) +/datum/book_manager/proc/remove(var/id) fdel(path(id)) -datum/archived_book +/datum/archived_book var/author // Who wrote the thing, can be changed by pen or PC. It is not automatically assigned var/title // The real name of the book. var/category // The category/genre of the book @@ -74,7 +74,7 @@ datum/archived_book var/list/icon/photos // in-game photos used // loads the book corresponding by the specified id -datum/archived_book/New(var/path) +/datum/archived_book/New(var/path) if(isnull(path)) return @@ -107,7 +107,7 @@ datum/archived_book/New(var/path) return -datum/archived_book/proc/save() +/datum/archived_book/proc/save() var/savefile/F = new(book_mgr.path(id)) F["version"] << BOOK_VERSION_MAX diff --git a/code/game/mecha/combat/gorilla.dm b/code/game/mecha/combat/gorilla.dm index fecb361f1a..fd62870d55 100644 --- a/code/game/mecha/combat/gorilla.dm +++ b/code/game/mecha/combat/gorilla.dm @@ -85,7 +85,8 @@ if(move_result) if(istype(src.loc, /turf/space)) if(!src.check_for_support()) - src.pr_inertial_movement.start(list(src,direction)) + float_direction = direction + start_process(MECHA_PROC_MOVEMENT) can_move = 0 spawn(tmp_step_in) can_move = 1 use_power(tmp_step_energy_drain) diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index 1f9d4a0b6e..b2b5fe613f 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -81,9 +81,7 @@ C.forceMove(src) cell = C return - cell = new(src) - cell.charge = 30000 - cell.maxcharge = 30000 + cell = new /obj/item/weapon/cell/hyper(src) /obj/mecha/combat/gygax/serenity desc = "A lightweight exosuit made from a modified Gygax chassis combined with proprietary VeyMed medical tech. It's faster and sturdier than most medical mechs, but much of the armor plating has been stripped out, leaving it more vulnerable than a regular Gygax." diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index fd0442a294..c218493847 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -97,7 +97,7 @@ src.occupant_message("Unable to move while connected to the air system port") last_message = world.time return 0 - if(!thrusters && src.pr_inertial_movement.active()) + if(!thrusters && (current_processes & MECHA_PROC_MOVEMENT)) return 0 if(state || !has_charge(step_energy_drain)) return 0 @@ -113,9 +113,9 @@ if(move_result) if(istype(src.loc, /turf/space)) if(!src.check_for_support()) - src.pr_inertial_movement.start(list(src,direction)) + float_direction = direction + start_process(MECHA_PROC_MOVEMENT) if(thrusters) - src.pr_inertial_movement.set_process_args(list(src,direction)) tmp_step_energy_drain = step_energy_drain*2 can_move = 0 diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 18a04783de..477ad1b12e 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -13,11 +13,11 @@ origin_tech = list(TECH_MATERIAL = 2) description_info = "Some equipment may gain new abilities or advantages if equipped to certain types of Exosuits." var/equip_cooldown = 0 - var/equip_ready = 1 + var/equip_ready = TRUE var/energy_drain = 0 var/obj/mecha/chassis = null var/range = MELEE //bitflags - var/salvageable = 1 + var/salvageable = TRUE var/required_type = /obj/mecha //may be either a type or a list of allowed types var/equip_type = null //mechaequip2 var/allow_duplicate = FALSE @@ -28,7 +28,7 @@ /obj/item/mecha_parts/mecha_equipment/proc/do_after_cooldown(target=1) sleep(equip_cooldown) - set_ready_state(1) + set_ready_state(TRUE) if(ready_sound) //Kind of like the kinetic accelerator. playsound(src, ready_sound, 50, 1, -1) if(target && chassis) @@ -39,10 +39,6 @@ . = ..() . += "[src] will fill [equip_type?"a [equip_type]":"any"] slot." -/obj/item/mecha_parts/mecha_equipment/New() - ..() - return - /obj/item/mecha_parts/mecha_equipment/proc/add_equip_overlay(obj/mecha/M as obj) return @@ -199,27 +195,31 @@ src.update_chassis_page() return +/obj/item/mecha_parts/mecha_equipment/Destroy() + detach() + return ..() + /obj/item/mecha_parts/mecha_equipment/proc/detach(atom/moveto=null) moveto = moveto || get_turf(chassis) - if(src.Move(moveto)) - chassis.equipment -= src - chassis.universal_equipment -= src - if(equip_type) - switch(equip_type) - if(EQUIP_HULL) - chassis.hull_equipment -= src - if(EQUIP_WEAPON) - chassis.weapon_equipment -= src - if(EQUIP_UTILITY) - chassis.utility_equipment -= src - if(EQUIP_SPECIAL) - chassis.special_equipment -= src - if(chassis.selected == src) - chassis.selected = null - update_chassis_page() - chassis.log_message("[src] removed from equipment.") - chassis = null - set_ready_state(1) + forceMove(moveto) + chassis.equipment -= src + chassis.universal_equipment -= src + if(equip_type) + switch(equip_type) + if(EQUIP_HULL) + chassis.hull_equipment -= src + if(EQUIP_WEAPON) + chassis.weapon_equipment -= src + if(EQUIP_UTILITY) + chassis.utility_equipment -= src + if(EQUIP_SPECIAL) + chassis.special_equipment -= src + if(chassis.selected == src) + chassis.selected = null + update_chassis_page() + chassis.log_message("[src] removed from equipment.") + chassis = null + set_ready_state(TRUE) enable_special = FALSE return diff --git a/code/game/mecha/equipment/tools/armor_melee.dm b/code/game/mecha/equipment/tools/armor_melee.dm index ed5724ce64..7618d5093d 100644 --- a/code/game/mecha/equipment/tools/armor_melee.dm +++ b/code/game/mecha/equipment/tools/armor_melee.dm @@ -29,7 +29,7 @@ chassis.occupant_message("\The [user] hits [chassis] with [W].") user.visible_message("\The [user] hits [chassis] with [W].", "You hit [src] with [W].") inc_damage *= damage_coeff - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) spawn() do_after_cooldown() @@ -65,7 +65,7 @@ user.visible_message("\The [user] hits [chassis] with [W].", "You hit [src] with [W].") chassis.take_damage(round(W.force*damage_coeff),W.damtype) chassis.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_after_cooldown() return diff --git a/code/game/mecha/equipment/tools/armor_ranged.dm b/code/game/mecha/equipment/tools/armor_ranged.dm index e1a06bef2d..4cc6287019 100644 --- a/code/game/mecha/equipment/tools/armor_ranged.dm +++ b/code/game/mecha/equipment/tools/armor_ranged.dm @@ -25,7 +25,7 @@ inc_damage = 0 else inc_damage *= src.damage_coeff - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) spawn() do_after_cooldown() @@ -41,7 +41,7 @@ inc_damage = 0 else if(istype(A, /obj)) inc_damage *= damage_coeff - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) spawn() do_after_cooldown() @@ -83,7 +83,7 @@ chassis.take_damage(round(Proj.damage*src.damage_coeff),Proj.check_armour) chassis.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) Proj.on_hit(chassis) - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_after_cooldown() return @@ -103,7 +103,7 @@ if(O.throwforce) chassis.take_damage(round(O.throwforce*damage_coeff)) chassis.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST)) - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_after_cooldown() return diff --git a/code/game/mecha/equipment/tools/cable_layer.dm b/code/game/mecha/equipment/tools/cable_layer.dm index 5fbb7b70db..a431ecdcbf 100644 --- a/code/game/mecha/equipment/tools/cable_layer.dm +++ b/code/game/mecha/equipment/tools/cable_layer.dm @@ -73,7 +73,7 @@ /obj/item/mecha_parts/mecha_equipment/tool/cable_layer/proc/use_cable(amount) if(!cable || cable.amount<1) - set_ready_state(1) + set_ready_state(TRUE) occupant_message("Cable depleted, [src] deactivated.") log_message("Cable depleted, [src] deactivated.") return diff --git a/code/game/mecha/equipment/tools/catapult.dm b/code/game/mecha/equipment/tools/catapult.dm index 7d9162823d..f734a52c79 100644 --- a/code/game/mecha/equipment/tools/catapult.dm +++ b/code/game/mecha/equipment/tools/catapult.dm @@ -39,7 +39,7 @@ locked.throw_at(target, 14, 1.5, chassis) locked = null send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info()) - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_after_cooldown() else @@ -60,7 +60,7 @@ for(var/i=0 to iter) step_away(A,target) sleep(2) - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_after_cooldown() return diff --git a/code/game/mecha/equipment/tools/clamp.dm b/code/game/mecha/equipment/tools/clamp.dm index 0580134f33..70f46ee35f 100644 --- a/code/game/mecha/equipment/tools/clamp.dm +++ b/code/game/mecha/equipment/tools/clamp.dm @@ -76,7 +76,7 @@ occupant_message("You lift [target] and start to load it into cargo compartment.") chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.") - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) O.anchored = 1 var/T = chassis.loc @@ -115,7 +115,7 @@ step_away(M,chassis) occupant_message("You push [target] out of the way.") chassis.visible_message("[chassis] pushes [target] out of the way.") - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_after_cooldown() return 1 @@ -137,7 +137,7 @@ if(cargo_holder.cargo.len < cargo_holder.cargo_capacity) chassis.occupant_message("You lift [target] and start to load it into cargo compartment.") chassis.visible_message("[chassis] lifts [target] and starts to load it into cargo compartment.") - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) O.anchored = 1 var/T = chassis.loc @@ -169,7 +169,7 @@ step_away(M,chassis) chassis.occupant_message("You smash into [target], sending them flying.") chassis.visible_message("[chassis] tosses [target] like a piece of paper.") - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_after_cooldown() return 1 \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/cloak.dm b/code/game/mecha/equipment/tools/cloak.dm index e78a4f7395..3bcb6bf62d 100644 --- a/code/game/mecha/equipment/tools/cloak.dm +++ b/code/game/mecha/equipment/tools/cloak.dm @@ -3,25 +3,18 @@ desc = "Integrated cloaking system. High power usage, but does render you invisible to the naked eye. Doesn't prevent noise, however." icon_state = "tesla" origin_tech = list(TECH_MAGNET = 5, TECH_DATA = 5) - equip_cooldown = 2 SECONDS energy_drain = 300 range = 0 - equip_type = EQUIP_SPECIAL - var/datum/global_iterator/mecha_cloak/cloak_iterator - -/obj/item/mecha_parts/mecha_equipment/cloak/Initialize() - . = ..() - cloak_iterator = new /datum/global_iterator/mecha_cloak(list(src),0) - cloak_iterator.set_delay(equip_cooldown) - -/obj/item/mecha_parts/mecha_equipment/cloak/Destroy() - qdel_null(cloak_iterator) - return ..() +/obj/item/mecha_parts/mecha_equipment/cloak/process() + ..() + //Removed from chassis or ran out of power + if(!chassis || !chassis.use_power(energy_drain)) + stop_cloak() + return /obj/item/mecha_parts/mecha_equipment/cloak/detach() - qdel_null(cloak_iterator) if(!equip_ready) //We were running stop_cloak() return ..() @@ -44,27 +37,14 @@ if(chassis) chassis.cloak() log_message("Activated.") - cloak_iterator.start() - set_ready_state(0) + START_PROCESSING(SSobj, src) + set_ready_state(FALSE) playsound(src, 'sound/effects/EMPulse.ogg', 100, 1) /obj/item/mecha_parts/mecha_equipment/cloak/proc/stop_cloak() if(chassis) chassis.uncloak() log_message("Deactivated.") - cloak_iterator.stop() - set_ready_state(1) + STOP_PROCESSING(SSobj, src) + set_ready_state(TRUE) playsound(src, 'sound/effects/EMPulse.ogg', 100, 1) - -// These things are so silly -/datum/global_iterator/mecha_cloak/process(var/obj/item/mecha_parts/mecha_equipment/cloak/cloak) - //Removed from chassis - if(!cloak.chassis) - stop() - cloak.stop_cloak() - return - //Ran out of power - if(!cloak.chassis.use_power(cloak.energy_drain)) - stop() - cloak.stop_cloak() - return diff --git a/code/game/mecha/equipment/tools/drill.dm b/code/game/mecha/equipment/tools/drill.dm index 7a3587e454..2b64f93616 100644 --- a/code/game/mecha/equipment/tools/drill.dm +++ b/code/game/mecha/equipment/tools/drill.dm @@ -13,7 +13,7 @@ if(isobj(target)) var/obj/target_obj = target if(!target_obj.vars.Find("unacidable") || target_obj.unacidable) return - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) chassis.visible_message("[chassis] starts to drill [target]", "You hear the drill.") occupant_message("You start to drill [target]") @@ -100,7 +100,7 @@ if(isobj(target)) var/obj/target_obj = target if(target_obj.unacidable) return - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) chassis.visible_message("[chassis] starts to bore into \the [target]", "You hear the bore.") occupant_message("You start to bore into \the [target]") diff --git a/code/game/mecha/equipment/tools/energy_relay.dm b/code/game/mecha/equipment/tools/energy_relay.dm index 0e02f927e4..32943104f0 100644 --- a/code/game/mecha/equipment/tools/energy_relay.dm +++ b/code/game/mecha/equipment/tools/energy_relay.dm @@ -6,25 +6,39 @@ equip_cooldown = 10 energy_drain = 0 range = 0 - var/datum/global_iterator/pr_energy_relay var/coeff = 100 var/list/use_channels = list(EQUIP,ENVIRON,LIGHT) - equip_type = EQUIP_UTILITY -/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/New() +/obj/item/mecha_parts/mecha_equipment/repair_droid/Destroy() + STOP_PROCESSING(SSfastprocess, src) ..() - pr_energy_relay = new /datum/global_iterator/mecha_energy_relay(list(src),0) - pr_energy_relay.set_delay(equip_cooldown) + +/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/process() + if(!chassis || chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) + set_ready_state(TRUE) + return PROCESS_KILL + var/cur_charge = chassis.get_charge() + if(isnull(cur_charge) || !chassis.cell) + set_ready_state(TRUE) + occupant_message("No powercell detected.") + return PROCESS_KILL + if(cur_charge*
     [src.name] - [pr_energy_relay.active()?"Dea":"A"]ctivate" - -/* proc/dynusepower(amount) - if(!equip_ready) //enabled - var/area/A = get_area(chassis) - var/pow_chan = get_power_channel(A) - if(pow_chan) - A.master.use_power(amount*coeff, pow_chan) - return 1 - return chassis.dynusepower(amount)*/ - -/datum/global_iterator/mecha_energy_relay - -/datum/global_iterator/mecha_energy_relay/process(var/obj/item/mecha_parts/mecha_equipment/tesla_energy_relay/ER) - if(!ER.chassis || ER.chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) - stop() - ER.set_ready_state(1) - return - var/cur_charge = ER.chassis.get_charge() - if(isnull(cur_charge) || !ER.chassis.cell) - stop() - ER.set_ready_state(1) - ER.occupant_message("No powercell detected.") - return - if(cur_charge* [src.name] - [(datum_flags & DF_ISPROCESSING)?"Dea":"A"]ctivate" \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/extinguisher.dm b/code/game/mecha/equipment/tools/extinguisher.dm index 5bb6cd147c..5b83b20344 100644 --- a/code/game/mecha/equipment/tools/extinguisher.dm +++ b/code/game/mecha/equipment/tools/extinguisher.dm @@ -19,7 +19,7 @@ /obj/item/mecha_parts/mecha_equipment/tool/extinguisher/action(atom/target) //copypasted from extinguisher. TODO: Rewrite from scratch. if(!action_checks(target) || get_dist(chassis, target)>3) return if(get_dist(chassis, target)>2) return - set_ready_state(0) + set_ready_state(FALSE) if(do_after_cooldown(target)) if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1) var/obj/o = target diff --git a/code/game/mecha/equipment/tools/generator.dm b/code/game/mecha/equipment/tools/generator.dm index 396215131d..78a74bc0f8 100644 --- a/code/game/mecha/equipment/tools/generator.dm +++ b/code/game/mecha/equipment/tools/generator.dm @@ -6,9 +6,9 @@ equip_cooldown = 10 energy_drain = 0 range = MELEE - var/datum/global_iterator/pr_mech_generator var/coeff = 100 var/obj/item/stack/material/fuel + var/fuel_type = /obj/item/stack/material/phoron var/max_fuel = 150000 var/fuel_per_cycle_idle = 100 var/fuel_per_cycle_active = 500 @@ -16,25 +16,38 @@ equip_type = EQUIP_UTILITY -/obj/item/mecha_parts/mecha_equipment/generator/New() - ..() - init() - return +/obj/item/mecha_parts/mecha_equipment/generator/Initialize() + . = ..() + fuel = new fuel_type(src) + fuel.amount = 0 /obj/item/mecha_parts/mecha_equipment/generator/Destroy() - qdel(pr_mech_generator) - pr_mech_generator = null - ..() + qdel(fuel) + return ..() -/obj/item/mecha_parts/mecha_equipment/generator/proc/init() - fuel = new /obj/item/stack/material/phoron(src) - fuel.amount = 0 - pr_mech_generator = new /datum/global_iterator/mecha_generator(list(src),0) - pr_mech_generator.set_delay(equip_cooldown) - return +/obj/item/mecha_parts/mecha_equipment/generator/process() + if(!chassis) + set_ready_state(TRUE) + return PROCESS_KILL + if(fuel.amount<=0) + log_message("Deactivated - no fuel.") + set_ready_state(TRUE) + return PROCESS_KILL + var/cur_charge = chassis.get_charge() + if(isnull(cur_charge)) + set_ready_state(TRUE) + occupant_message("No powercell detected.") + log_message("Deactivated.") + return PROCESS_KILL + var/use_fuel = fuel_per_cycle_idle + if(cur_charge3\] - [pr_mech_generator.active()?"Dea":"A"]ctivate" + return "[output] \[[fuel]: [round(fuel.amount*fuel.perunit,0.1)] cm3\] - [(datum_flags & DF_ISPROCESSING)?"Dea":"A"]ctivate" return /obj/item/mecha_parts/mecha_equipment/generator/action(target) @@ -109,33 +124,6 @@ T.assume_air(GM) return -/datum/global_iterator/mecha_generator - -/datum/global_iterator/mecha_generator/process(var/obj/item/mecha_parts/mecha_equipment/generator/EG) - if(!EG.chassis) - stop() - EG.set_ready_state(1) - return 0 - if(EG.fuel.amount<=0) - stop() - EG.log_message("Deactivated - no fuel.") - EG.set_ready_state(1) - return 0 - var/cur_charge = EG.chassis.get_charge() - if(isnull(cur_charge)) - EG.set_ready_state(1) - EG.occupant_message("No powercell detected.") - EG.log_message("Deactivated.") - stop() - return 0 - var/use_fuel = EG.fuel_per_cycle_idle - if(cur_charge* [src.name] - [pr_repair_droid.active()?"Dea":"A"]ctivate" + return "* [src.name] - [(datum_flags & DF_ISPROCESSING)?"Dea":"A"]ctivate" /obj/item/mecha_parts/mecha_equipment/repair_droid/Topic(href, href_list) ..() if(href_list["toggle_repairs"]) chassis.cut_overlay(droid_overlay) - if(pr_repair_droid.toggle()) + if(datum_flags & DF_ISPROCESSING) + droid_overlay = new(src.icon, icon_state = "repair_droid") + STOP_PROCESSING(SSobj, src) + log_message("Deactivated.") + set_ready_state(TRUE) + else droid_overlay = new(src.icon, icon_state = "repair_droid_a") log_message("Activated.") - else - droid_overlay = new(src.icon, icon_state = "repair_droid") - log_message("Deactivated.") - set_ready_state(1) + START_PROCESSING(SSobj, src) chassis.add_overlay(droid_overlay) send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info()) return - -/datum/global_iterator/mecha_repair_droid - -/datum/global_iterator/mecha_repair_droid/process(var/obj/item/mecha_parts/mecha_equipment/repair_droid/RD as obj) - if(!RD.chassis) - stop() - RD.set_ready_state(1) - return - var/health_boost = RD.health_boost +/obj/item/mecha_parts/mecha_equipment/repair_droid/process() + if(!chassis) + set_ready_state(TRUE) + return PROCESS_KILL var/repaired = 0 - if(RD.chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) - health_boost *= -2 - else if(RD.chassis.hasInternalDamage() && prob(15)) - for(var/int_dam_flag in RD.repairable_damage) - if(RD.chassis.hasInternalDamage(int_dam_flag)) - RD.chassis.clearInternalDamage(int_dam_flag) + var/effective_boost = health_boost + if(chassis.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) + effective_boost *= -2 + else if(chassis.hasInternalDamage() && prob(15)) + for(var/int_dam_flag in repairable_damage) + if(chassis.hasInternalDamage(int_dam_flag)) + chassis.clearInternalDamage(int_dam_flag) repaired = 1 break - var/obj/item/mecha_parts/component/AC = RD.chassis.internal_components[MECH_ARMOR] - var/obj/item/mecha_parts/component/HC = RD.chassis.internal_components[MECH_HULL] + var/obj/item/mecha_parts/component/AC = chassis.internal_components[MECH_ARMOR] + var/obj/item/mecha_parts/component/HC = chassis.internal_components[MECH_HULL] var/damaged_armor = AC.integrity < AC.max_integrity var/damaged_hull = HC.integrity < HC.max_integrity - if(health_boost<0 || RD.chassis.health < initial(RD.chassis.health) || damaged_armor || damaged_hull) - RD.chassis.health += min(health_boost, initial(RD.chassis.health)-RD.chassis.health) + if(effective_boost<0 || chassis.health < initial(chassis.health) || damaged_armor || damaged_hull) + chassis.health += min(effective_boost, initial(chassis.health)-chassis.health) if(AC) - AC.adjust_integrity(round(health_boost * 0.5, 0.5)) + AC.adjust_integrity(round(effective_boost * 0.5, 0.5)) if(HC) - HC.adjust_integrity(round(health_boost * 0.5, 0.5)) + HC.adjust_integrity(round(effective_boost * 0.5, 0.5)) repaired = 1 if(repaired) - if(RD.chassis.use_power(RD.energy_drain)) - RD.set_ready_state(0) + if(chassis.use_power(energy_drain)) + set_ready_state(FALSE) else - stop() - RD.set_ready_state(1) - return + set_ready_state(TRUE) + return PROCESS_KILL else - RD.set_ready_state(1) + set_ready_state(TRUE) return \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/shield.dm b/code/game/mecha/equipment/tools/shield.dm index 497d670313..1111e4c419 100644 --- a/code/game/mecha/equipment/tools/shield.dm +++ b/code/game/mecha/equipment/tools/shield.dm @@ -70,11 +70,11 @@ if(chassis) my_shield.attack_self(chassis.occupant) if(my_shield.active) - set_ready_state(0) + set_ready_state(FALSE) step_delay = 4 log_message("Activated.") else - set_ready_state(1) + set_ready_state(TRUE) step_delay = 1 log_message("Deactivated.") diff --git a/code/game/mecha/equipment/tools/shield_omni.dm b/code/game/mecha/equipment/tools/shield_omni.dm index 9622ccc129..c85323ab7d 100644 --- a/code/game/mecha/equipment/tools/shield_omni.dm +++ b/code/game/mecha/equipment/tools/shield_omni.dm @@ -42,11 +42,11 @@ if(shields) shields.set_on(!shields.active) if(shields.active) - set_ready_state(0) + set_ready_state(FALSE) step_delay = 4 log_message("Activated.") else - set_ready_state(1) + set_ready_state(TRUE) step_delay = initial(step_delay) log_message("Deactivated.") diff --git a/code/game/mecha/equipment/tools/sleeper.dm b/code/game/mecha/equipment/tools/sleeper.dm index 861471b6ce..873c1361d2 100644 --- a/code/game/mecha/equipment/tools/sleeper.dm +++ b/code/game/mecha/equipment/tools/sleeper.dm @@ -8,20 +8,12 @@ range = MELEE equip_cooldown = 30 var/mob/living/carbon/human/occupant = null - var/datum/global_iterator/pr_mech_sleeper var/inject_amount = 5 required_type = list(/obj/mecha/medical) salvageable = 0 allow_duplicate = TRUE -/obj/item/mecha_parts/mecha_equipment/tool/sleeper/New() - ..() - pr_mech_sleeper = new /datum/global_iterator/mech_sleeper(list(src),0) - pr_mech_sleeper.set_delay(equip_cooldown) - return - /obj/item/mecha_parts/mecha_equipment/tool/sleeper/Destroy() - qdel(pr_mech_sleeper) for(var/atom/movable/AM in src) AM.forceMove(get_turf(src)) return ..() @@ -62,8 +54,8 @@ target.client.perspective = EYE_PERSPECTIVE target.client.eye = chassis */ - set_ready_state(0) - pr_mech_sleeper.start() + set_ready_state(FALSE) + START_PROCESSING(SSprocessing, src) occupant_message("[target] successfully loaded into [src]. Life support functions engaged.") chassis.visible_message("[chassis] loads [target] into [src].") log_message("[target] loaded. Life support functions engaged.") @@ -83,15 +75,15 @@ */ occupant.Stasis(0) occupant = null - pr_mech_sleeper.stop() - set_ready_state(1) + STOP_PROCESSING(SSprocessing, src) + set_ready_state(TRUE) return /obj/item/mecha_parts/mecha_equipment/tool/sleeper/detach() if(occupant) occupant_message("Unable to detach [src] - equipment occupied.") return - pr_mech_sleeper.stop() + STOP_PROCESSING(SSprocessing, src) return ..() /obj/item/mecha_parts/mecha_equipment/tool/sleeper/get_equip_info() @@ -217,18 +209,17 @@ return go_out()//and release him from the eternal prison. -/datum/global_iterator/mech_sleeper - -/datum/global_iterator/mech_sleeper/process(var/obj/item/mecha_parts/mecha_equipment/tool/sleeper/S) - if(!S.chassis) - S.set_ready_state(1) - return stop() - if(!S.chassis.has_charge(S.energy_drain)) - S.set_ready_state(1) - S.log_message("Deactivated.") - S.occupant_message("[src] deactivated - no power.") - return stop() - var/mob/living/carbon/M = S.occupant +/obj/item/mecha_parts/mecha_equipment/tool/sleeper/process() + ..() + if(!chassis) + set_ready_state(TRUE) + return PROCESS_KILL + if(!chassis.has_charge(energy_drain)) + set_ready_state(TRUE) + log_message("Deactivated.") + occupant_message("[src] deactivated - no power.") + return PROCESS_KILL + var/mob/living/carbon/M = occupant if(!M) return if(M.health > 0) @@ -242,6 +233,6 @@ M.Stun(2) if(M.reagents.get_reagent_amount("inaprovaline") < 5) M.reagents.add_reagent("inaprovaline", 5) - S.chassis.use_power(S.energy_drain) - S.update_equip_info() + chassis.use_power(energy_drain) + update_equip_info() return \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/syringe_gun.dm b/code/game/mecha/equipment/tools/syringe_gun.dm index 9023e9d039..8e26c5d9ae 100644 --- a/code/game/mecha/equipment/tools/syringe_gun.dm +++ b/code/game/mecha/equipment/tools/syringe_gun.dm @@ -17,17 +17,16 @@ origin_tech = list(TECH_MATERIAL = 3, TECH_BIO = 4, TECH_MAGNET = 4, TECH_DATA = 3) required_type = list(/obj/mecha/medical) -/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/New() - ..() +/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/Initialize() + . = ..() flags |= NOREACT syringes = new known_reagents = list("inaprovaline"="Inaprovaline","anti_toxin"="Dylovene") processed_reagents = new create_reagents(max_volume) - synth = new (list(src),0) /obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/detach() - synth.stop() + STOP_PROCESSING(SSfastprocess, src) return ..() /obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/critfail() @@ -58,7 +57,7 @@ if(reagents.total_volume<=0) occupant_message("No available reagents to load syringe with.") return - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) var/turf/trg = get_turf(target) var/obj/item/weapon/reagent_containers/syringe/S = syringes[1] @@ -122,7 +121,7 @@ m++ if(processed_reagents.len) message += " added to production" - synth.start() + START_PROCESSING(SSfastprocess, src) occupant_message(message) occupant_message("Reagent processing started.") log_message("Reagent processing started.") @@ -236,7 +235,7 @@ return 1 /obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/proc/add_known_reagent(r_id,r_name) - set_ready_state(0) + set_ready_state(FALSE) do_after_cooldown() if(!(r_id in known_reagents)) known_reagents += r_id @@ -257,22 +256,17 @@ update_equip_info() return -/datum/global_iterator/mech_synth - delay = 100 - -/datum/global_iterator/mech_synth/process(var/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/S) - if(!S.chassis) - return stop() - var/energy_drain = S.energy_drain*10 - if(!S.processed_reagents.len || S.reagents.total_volume >= S.reagents.maximum_volume || !S.chassis.has_charge(energy_drain)) - S.occupant_message("Reagent processing stopped.") - S.log_message("Reagent processing stopped.") - return stop() - var/amount = S.synth_speed / S.processed_reagents.len - for(var/reagent in S.processed_reagents) - S.reagents.add_reagent(reagent,amount) - S.chassis.use_power(energy_drain) - return 1 +/obj/item/mecha_parts/mecha_equipment/tool/syringe_gun/process() + if(!chassis) + return PROCESS_KILL + if(!processed_reagents.len || reagents.total_volume >= reagents.maximum_volume || !chassis.has_charge(energy_drain)) + occupant_message("Reagent processing stopped.") + log_message("Reagent processing stopped.") + return PROCESS_KILL + var/amount = synth_speed / processed_reagents.len + for(var/reagent in processed_reagents) + reagents.add_reagent(reagent,amount) + chassis.use_power(energy_drain) /obj/item/mecha_parts/mecha_equipment/crisis_drone name = "crisis dronebay" @@ -314,10 +308,6 @@ . = ..() drone_overlay = new(src.icon, icon_state = droid_state) -/obj/item/mecha_parts/mecha_equipment/crisis_drone/Destroy() - STOP_PROCESSING(SSobj, src) - ..() - /obj/item/mecha_parts/mecha_equipment/crisis_drone/attach(obj/mecha/M as obj) . = ..(M) if(chassis) @@ -457,10 +447,10 @@ if(chassis) enabled = !enabled if(enabled) - set_ready_state(0) + set_ready_state(FALSE) log_message("Activated.") else - set_ready_state(1) + set_ready_state(TRUE) log_message("Deactivated.") /obj/item/mecha_parts/mecha_equipment/crisis_drone/add_equip_overlay(obj/mecha/M as obj) diff --git a/code/game/mecha/equipment/tools/teleporter.dm b/code/game/mecha/equipment/tools/teleporter.dm index b77b1c3fdc..7ff3e6a036 100644 --- a/code/game/mecha/equipment/tools/teleporter.dm +++ b/code/game/mecha/equipment/tools/teleporter.dm @@ -13,7 +13,7 @@ if(!action_checks(target) || src.loc.z == 2) return var/turf/T = get_turf(target) if(T) - set_ready_state(0) + set_ready_state(FALSE) chassis.use_power(energy_drain) do_teleport(chassis, T, 4) do_after_cooldown() diff --git a/code/game/mecha/equipment/tools/wormhole.dm b/code/game/mecha/equipment/tools/wormhole.dm index eef3c6a52a..232193b98a 100644 --- a/code/game/mecha/equipment/tools/wormhole.dm +++ b/code/game/mecha/equipment/tools/wormhole.dm @@ -35,7 +35,7 @@ if(!target_turf) return chassis.use_power(energy_drain) - set_ready_state(0) + set_ready_state(FALSE) var/obj/effect/portal/P = new /obj/effect/portal(get_turf(target)) P.target = target_turf P.creator = null diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index ecb971dff1..89a38383dd 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -57,12 +57,12 @@ var/P = new projectile(projectile_turf) Fire(P, target, params) if(i == 1) - set_ready_state(0) + set_ready_state(FALSE) if(fire_cooldown) sleep(fire_cooldown) if(auto_rearm) projectiles = projectiles_per_shot -// set_ready_state(0) +// set_ready_state(FALSE) do_after_cooldown() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 78430c7402..027f2058ca 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -4,6 +4,10 @@ #define MECHA_INT_TANK_BREACH 8 #define MECHA_INT_CONTROL_LOST 16 +#define MECHA_PROC_MOVEMENT 1 +#define MECHA_PROC_DAMAGE 2 +#define MECHA_PROC_INT_TEMP 4 + #define MELEE 1 #define RANGED 2 @@ -92,18 +96,18 @@ var/list/operation_req_access = list() //Required access level for mecha operation var/list/internals_req_access = list(access_engine,access_robotics) //Required access level to open cell compartment - var/datum/global_iterator/pr_int_temp_processor //Normalizes internal air mixture temperature - var/datum/global_iterator/pr_inertial_movement //Controls intertial movement in spesss - var/datum/global_iterator/pr_give_air //Moves air from tank to cabin - var/datum/global_iterator/pr_internal_damage //Processes internal damage - - var/wreckage var/list/equipment = new //This lists holds what stuff you bolted onto your baby ride var/obj/item/mecha_parts/mecha_equipment/selected var/max_equip = 2 - var/datum/events/events + + // What direction to float in, if inertial movement is active. + var/float_direction = 0 + // Process() iterator count. + var/process_ticks = 0 + // These control what toggleable processes are executed within process(). + var/current_processes = MECHA_PROC_INT_TEMP //mechaequipt2 stuffs var/list/hull_equipment = new @@ -225,8 +229,6 @@ /obj/mecha/New() ..() - events = new - icon_state += "-open" add_radio() add_cabin() @@ -242,7 +244,6 @@ src.smoke_system.attach(src) add_cell() - add_iterators() removeVerb(/obj/mecha/verb/disconnect_from_port) log_message("[src.name] created.") loc.Entered(src) @@ -285,7 +286,7 @@ if(E.salvageable && prob(30)) WR.crowbar_salvage += E E.forceMove(WR) - E.equip_ready = 1 + E.equip_ready = TRUE else E.forceMove(loc) E.destroy() @@ -327,16 +328,122 @@ GLOB.mech_destroyed_roundstat++ - QDEL_NULL(pr_int_temp_processor) - QDEL_NULL(pr_inertial_movement) - QDEL_NULL(pr_give_air) - QDEL_NULL(pr_internal_damage) QDEL_NULL(spark_system) QDEL_NULL(minihud) mechas_list -= src //global mech list . = ..() +// The main process loop to replace the ancient global iterators. +// It's a bit hardcoded but I don't see anyone else adding stuff to +// mechas, and it's easy enough to modify. +/obj/mecha/process() + var/static/max_ticks = 16 + + if (current_processes & MECHA_PROC_MOVEMENT) + process_inertial_movement() + + if ((current_processes & MECHA_PROC_DAMAGE) && !(process_ticks % 2)) + process_internal_damage() + + if ((current_processes & MECHA_PROC_INT_TEMP) && !(process_ticks % 4)) + process_preserve_temp() + + if (!(process_ticks % 3)) + process_tank_give_air() + + // Max value is 16. So we let it run between [0, 16] with this. + process_ticks = (process_ticks + 1) % 17 + +// Normalizing cabin air temperature to 20 degrees celsius. +// Called every fourth process() tick (20 deciseconds). +/obj/mecha/proc/process_preserve_temp() + if (cabin_air && cabin_air.volume > 0) + var/delta = cabin_air.temperature - T20C + cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1))) + +// Handles internal air tank action. +// Called every third process() tick (15 deciseconds). +/obj/mecha/proc/process_tank_give_air() + if(internal_tank) + var/datum/gas_mixture/tank_air = internal_tank.return_air() + + var/release_pressure = internal_tank_valve + var/cabin_pressure = cabin_air.return_pressure() + var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2) + var/transfer_moles = 0 + + if(pressure_delta > 0) //cabin pressure lower than release pressure + if(tank_air.temperature > 0) + transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) + var/datum/gas_mixture/removed = tank_air.remove(transfer_moles) + cabin_air.merge(removed) + + else if(pressure_delta < 0) //cabin pressure higher than release pressure + var/datum/gas_mixture/t_air = get_turf_air() + pressure_delta = cabin_pressure - release_pressure + + if(t_air) + pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta) + if(pressure_delta > 0) //if location pressure is lower than cabin pressure + transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) + + var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles) + if(t_air) + t_air.merge(removed) + else //just delete the cabin gas, we're in space or some shit + qdel(removed) + +// Inertial movement in space. +// Called every process() tick (5 deciseconds). +/obj/mecha/proc/process_inertial_movement() + if(float_direction) + if(!step(src, float_direction) || check_for_support()) + stop_process(MECHA_PROC_MOVEMENT) + else + stop_process(MECHA_PROC_MOVEMENT) + return + +// Processes internal damage. +// Called every other process() tick (10 deciseconds). +/obj/mecha/proc/process_internal_damage() + if(!hasInternalDamage()) + stop_process(MECHA_PROC_DAMAGE) + return + + if(hasInternalDamage(MECHA_INT_FIRE)) + if(!hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5)) + clearInternalDamage(MECHA_INT_FIRE) + if(internal_tank) + if(internal_tank.return_pressure()>internal_tank.maximum_pressure && !(hasInternalDamage(MECHA_INT_TANK_BREACH))) + setInternalDamage(MECHA_INT_TANK_BREACH) + var/datum/gas_mixture/int_tank_air = internal_tank.return_air() + if(int_tank_air && int_tank_air.volume>0) //heat the air_contents + int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15)) + if(cabin_air && cabin_air.volume>0) + cabin_air.temperature = min(6000+T0C, cabin_air.temperature+rand(10,15)) + if(cabin_air.temperature>max_temperature/2) + take_damage(4/round(max_temperature/cabin_air.temperature,0.1),"fire") + + if(hasInternalDamage(MECHA_INT_TEMP_CONTROL)) + stop_process(MECHA_PROC_INT_TEMP) + + if(hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank + if(internal_tank) + var/datum/gas_mixture/int_tank_air = internal_tank.return_air() + var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10) + if(istype(loc, /turf/simulated)) + loc.assume_air(leaked_gas) + else + qdel(leaked_gas) + + if(hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) + if(get_charge()) + spark_system.start() + cell.charge -= min(20,cell.charge) + cell.maxcharge -= min(20,cell.maxcharge) + return + //////////////////////// ////// Helpers ///////// //////////////////////// @@ -375,12 +482,6 @@ radio.icon_state = icon_state radio.subspace_transmission = 1 -/obj/mecha/proc/add_iterators() - pr_int_temp_processor = new /datum/global_iterator/mecha_preserve_temp(list(src)) - pr_inertial_movement = new /datum/global_iterator/mecha_intertial_movement(null,0) - pr_give_air = new /datum/global_iterator/mecha_tank_give_air(list(src)) - pr_internal_damage = new /datum/global_iterator/mecha_internal_damage(list(src),0) - /obj/mecha/proc/do_after(delay as num) sleep(delay) if(src) @@ -695,7 +796,7 @@ /obj/mecha/proc/dyndomove(direction) if(!can_move) return 0 - if(src.pr_inertial_movement.active()) + if(current_processes & MECHA_PROC_MOVEMENT) return 0 if(!has_charge(step_energy_drain)) return 0 @@ -714,16 +815,7 @@ last_message = world.time return 0 - -/* -//A first draft of a check to stop mechs from moving fully. TBD when all thrusters modules are unified. - if(!thrusters && !src.pr_inertial_movement.active() && isspace(src.loc))//No thrsters, not drifting, in space - src.occupant_message("Error 543")//debug - return 0 -*/ - - - if(!thrusters && src.pr_inertial_movement.active()) //I think this mean 'if you try to move in space without thruster, u no move' + if(!thrusters && (current_processes & MECHA_PROC_MOVEMENT)) //I think this mean 'if you try to move in space without thruster, u no move' return 0 if(overload)//Check if you have leg overload @@ -783,7 +875,8 @@ use_power(step_energy_drain) if(istype(src.loc, /turf/space)) if(!src.check_for_support()) - src.pr_inertial_movement.start(list(src,direction)) + float_direction = direction + start_process(MECHA_PROC_MOVEMENT) src.log_message("Movement control lost. Inertial movement started.") if(do_after(get_step_delay())) can_move = 1 @@ -885,10 +978,8 @@ /obj/mecha/proc/setInternalDamage(int_dam_flag) - if(!pr_internal_damage) return - internal_damage |= int_dam_flag - pr_internal_damage.start() + start_process(MECHA_PROC_DAMAGE) log_append_to_last("Internal damage of type [int_dam_flag].",1) occupant << sound('sound/mecha/internaldmgalarm.ogg',volume=50) //Better sounding. return @@ -898,7 +989,7 @@ switch(int_dam_flag) if(MECHA_INT_TEMP_CONTROL) occupant_message("Life support system reactivated.") - pr_int_temp_processor.start() + start_process(MECHA_PROC_INT_TEMP) if(MECHA_INT_FIRE) occupant_message("Internal fire extinquished.") if(MECHA_INT_TANK_BREACH) @@ -2709,103 +2800,17 @@ return 1 -////////////////////////////////////////// -//////// Mecha global iterators //////// -////////////////////////////////////////// +///////////////////////////////////////// +//////// Mecha process() helpers //////// +///////////////////////////////////////// +/obj/mecha/proc/stop_process(process) + current_processes &= ~process - -/datum/global_iterator/mecha_preserve_temp //normalizing cabin air temperature to 20 degrees celsium - delay = 20 - - process(var/obj/mecha/mecha) - if(mecha.cabin_air && mecha.cabin_air.volume > 0) - var/delta = mecha.cabin_air.temperature - T20C - mecha.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1))) - return - -/datum/global_iterator/mecha_tank_give_air - delay = 15 - -/datum/global_iterator/mecha_tank_give_air/process(var/obj/mecha/mecha) - if(mecha.internal_tank) - var/datum/gas_mixture/tank_air = mecha.internal_tank.return_air() - var/datum/gas_mixture/cabin_air = mecha.cabin_air - - var/release_pressure = mecha.internal_tank_valve - var/cabin_pressure = cabin_air.return_pressure() - var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2) - var/transfer_moles = 0 - if(pressure_delta > 0) //cabin pressure lower than release pressure - if(tank_air.temperature > 0) - transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) - var/datum/gas_mixture/removed = tank_air.remove(transfer_moles) - cabin_air.merge(removed) - else if(pressure_delta < 0) //cabin pressure higher than release pressure - var/datum/gas_mixture/t_air = mecha.get_turf_air() - pressure_delta = cabin_pressure - release_pressure - if(t_air) - pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta) - if(pressure_delta > 0) //if location pressure is lower than cabin pressure - transfer_moles = pressure_delta*cabin_air.volume/(cabin_air.temperature * R_IDEAL_GAS_EQUATION) - var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles) - if(t_air) - t_air.merge(removed) - else //just delete the cabin gas, we're in space or some shit - qdel(removed) - else - return stop() - return - -/datum/global_iterator/mecha_intertial_movement //inertial movement in space - delay = 7 - -/datum/global_iterator/mecha_intertial_movement/process(var/obj/mecha/mecha as obj,direction) - if(direction) - if(!step(mecha, direction)||mecha.check_for_support()) - src.stop() - mecha.handle_equipment_movement() - else - src.stop() - return - -/datum/global_iterator/mecha_internal_damage // processing internal damage - -/datum/global_iterator/mecha_internal_damage/process(var/obj/mecha/mecha) - if(!mecha.hasInternalDamage()) - return stop() - if(mecha.hasInternalDamage(MECHA_INT_FIRE)) - if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5)) - mecha.clearInternalDamage(MECHA_INT_FIRE) - if(mecha.internal_tank) - if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH))) - mecha.setInternalDamage(MECHA_INT_TANK_BREACH) - var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air() - if(int_tank_air && int_tank_air.volume>0) //heat the air_contents - int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15)) - if(mecha.cabin_air && mecha.cabin_air.volume>0) - mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.temperature+rand(10,15)) - if(mecha.cabin_air.temperature>mecha.max_temperature/2) - mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.temperature,0.1),"fire") //The take_damage() proc handles armor values - if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum - mecha.pr_int_temp_processor.stop() - if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank - if(mecha.internal_tank) - var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air() - var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10) - if(mecha.loc && hascall(mecha.loc,"assume_air")) - mecha.loc.assume_air(leaked_gas) - else - qdel(leaked_gas) - if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) - if(mecha.get_charge()) - mecha.spark_system.start() - mecha.cell.charge -= min(20,mecha.cell.charge) - mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge) - return +/obj/mecha/proc/start_process(process) + current_processes |= process ///////////// - /obj/mecha/cloak() . = ..() if(occupant && occupant.client && cloaked_selfimage) diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index f9d4384271..f02d7f8e82 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -10,57 +10,57 @@ var/screen = 0 var/stored_data - attack_ai(var/mob/user as mob) - return src.attack_hand(user) +/obj/machinery/computer/mecha/attack_ai(var/mob/user as mob) + return src.attack_hand(user) - attack_hand(var/mob/user as mob) - if(..()) - return - user.set_machine(src) - var/dat = "[src.name]" - if(screen == 0) - dat += "

    Tracking beacons data

    " - for(var/obj/item/mecha_parts/mecha_tracking/TR in world) - var/answer = TR.get_mecha_info() - if(answer) - dat += {"
    [answer]
    - Send message
    - Show exosuit log | (EMP pulse)
    "} - - if(screen==1) - dat += "

    Log contents

    " - dat += "Return
    " - dat += "[stored_data]" - - dat += "(Refresh)
    " - dat += "" - - user << browse(dat, "window=computer;size=400x500") - onclose(user, "computer") +/obj/machinery/computer/mecha/attack_hand(var/mob/user as mob) + if(..()) return + user.set_machine(src) + var/dat = "[src.name]" + if(screen == 0) + dat += "

    Tracking beacons data

    " + for(var/obj/item/mecha_parts/mecha_tracking/TR in world) + var/answer = TR.get_mecha_info() + if(answer) + dat += {"
    [answer]
    + Send message
    + Show exosuit log | (EMP pulse)
    "} - Topic(href, href_list) - if(..()) - return - var/datum/topic_input/top_filter = new /datum/topic_input(href,href_list) - if(href_list["send_message"]) - var/obj/item/mecha_parts/mecha_tracking/MT = top_filter.getObj("send_message") - var/message = sanitize(input(usr,"Input message","Transmit message") as text) - var/obj/mecha/M = MT.in_mecha() - if(message && M) - M.occupant_message(message) - return - if(href_list["shock"]) - var/obj/item/mecha_parts/mecha_tracking/MT = top_filter.getObj("shock") - MT.shock() - if(href_list["get_log"]) - var/obj/item/mecha_parts/mecha_tracking/MT = top_filter.getObj("get_log") - stored_data = MT.get_mecha_log() - screen = 1 - if(href_list["return"]) - screen = 0 - src.updateUsrDialog() + if(screen==1) + dat += "

    Log contents

    " + dat += "Return
    " + dat += "[stored_data]" + + dat += "(Refresh)
    " + dat += "" + + user << browse(dat, "window=computer;size=400x500") + onclose(user, "computer") + return + +/obj/machinery/computer/mecha/Topic(href, href_list) + if(..()) return + var/datum/topic_input/top_filter = new /datum/topic_input(href,href_list) + if(href_list["send_message"]) + var/obj/item/mecha_parts/mecha_tracking/MT = top_filter.getObj("send_message") + var/message = sanitize(input(usr,"Input message","Transmit message") as text) + var/obj/mecha/M = MT.in_mecha() + if(message && M) + M.occupant_message(message) + return + if(href_list["shock"]) + var/obj/item/mecha_parts/mecha_tracking/MT = top_filter.getObj("shock") + MT.shock() + if(href_list["get_log"]) + var/obj/item/mecha_parts/mecha_tracking/MT = top_filter.getObj("get_log") + stored_data = MT.get_mecha_log() + screen = 1 + if(href_list["return"]) + screen = 0 + src.updateUsrDialog() + return @@ -71,58 +71,50 @@ icon_state = "motion2" origin_tech = list(TECH_DATA = 2, TECH_MAGNET = 2) - proc/get_mecha_info() - if(!in_mecha()) - return 0 - var/obj/mecha/M = src.loc - var/cell_charge = M.get_charge() - var/answer = {"Name: [M.name]
    - Integrity: [M.health/initial(M.health)*100]%
    - Cell charge: [isnull(cell_charge)?"Not found":"[M.cell.percent()]%"]
    - Airtank: [M.return_pressure()]kPa
    - Pilot: [M.occupant||"None"]
    - Location: [get_area(M)||"Unknown"]
    - Active equipment: [M.selected||"None"]"} - if(istype(M, /obj/mecha/working/ripley)) - var/obj/mecha/working/ripley/RM = M - answer += "Used cargo space: [RM.cargo.len/RM.cargo_capacity*100]%
    " - - return answer - - emp_act() - qdel(src) - return - - ex_act() - qdel(src) - return - - proc/in_mecha() - if(istype(src.loc, /obj/mecha)) - return src.loc +/obj/item/mecha_parts/mecha_tracking/proc/get_mecha_info() + if(!in_mecha()) return 0 + var/obj/mecha/M = src.loc + var/cell_charge = M.get_charge() + var/answer = {"Name: [M.name]
    + Integrity: [M.health/initial(M.health)*100]%
    + Cell charge: [isnull(cell_charge)?"Not found":"[M.cell.percent()]%"]
    + Airtank: [M.return_pressure()]kPa
    + Pilot: [M.occupant||"None"]
    + Location: [get_area(M)||"Unknown"]
    + Active equipment: [M.selected||"None"]"} + if(istype(M, /obj/mecha/working/ripley)) + var/obj/mecha/working/ripley/RM = M + answer += "Used cargo space: [RM.cargo.len/RM.cargo_capacity*100]%
    " - proc/shock() - var/obj/mecha/M = in_mecha() - if(M) - M.emp_act(4) - qdel(src) + return answer - proc/get_mecha_log() - if(!src.in_mecha()) - return 0 - var/obj/mecha/M = src.loc - return M.get_log_html() +/obj/item/mecha_parts/mecha_tracking/emp_act() + qdel(src) + return + +/obj/item/mecha_parts/mecha_tracking/ex_act() + qdel(src) + return + +/obj/item/mecha_parts/mecha_tracking/proc/in_mecha() + if(istype(src.loc, /obj/mecha)) + return src.loc + return 0 + +/obj/item/mecha_parts/mecha_tracking/proc/shock() + var/obj/mecha/M = in_mecha() + if(M) + M.emp_act(4) + qdel(src) + +/obj/item/mecha_parts/mecha_tracking/proc/get_mecha_log() + if(!src.in_mecha()) + return 0 + var/obj/mecha/M = src.loc + return M.get_log_html() /obj/item/weapon/storage/box/mechabeacons name = "Exosuit Tracking Beacons" - New() - ..() - new /obj/item/mecha_parts/mecha_tracking(src) - new /obj/item/mecha_parts/mecha_tracking(src) - new /obj/item/mecha_parts/mecha_tracking(src) - new /obj/item/mecha_parts/mecha_tracking(src) - new /obj/item/mecha_parts/mecha_tracking(src) - new /obj/item/mecha_parts/mecha_tracking(src) - new /obj/item/mecha_parts/mecha_tracking(src) + starts_with = list(/obj/item/mecha_parts/mecha_tracking = 7) diff --git a/code/game/mecha/mecha_parts.dm b/code/game/mecha/mecha_parts.dm index 74cb1e169c..e24bd04460 100644 --- a/code/game/mecha/mecha_parts.dm +++ b/code/game/mecha/mecha_parts.dm @@ -17,22 +17,22 @@ icon_state = "backbone" var/datum/construction/construct - attackby(obj/item/W as obj, mob/user as mob) - if(!construct || !construct.action(W, user)) - ..() - return +/obj/item/mecha_parts/chassis/attackby(obj/item/W as obj, mob/user as mob) + if(!construct || !construct.action(W, user)) + ..() + return - attack_hand() - return +/obj/item/mecha_parts/chassis/attack_hand() + return /////////// Ripley /obj/item/mecha_parts/chassis/ripley name = "Ripley Chassis" - New() - ..() - construct = new /datum/construction/mecha/ripley_chassis(src) +/obj/item/mecha_parts/chassis/ripley/New() + ..() + construct = new /datum/construction/mecha/ripley_chassis(src) /obj/item/mecha_parts/part/ripley_torso name="Ripley Torso" @@ -69,9 +69,9 @@ /obj/item/mecha_parts/chassis/gygax name = "Gygax Chassis" - New() - ..() - construct = new /datum/construction/mecha/gygax_chassis(src) +/obj/item/mecha_parts/chassis/gygax/New() + ..() + construct = new /datum/construction/mecha/gygax_chassis(src) /obj/item/mecha_parts/part/gygax_torso name="Gygax Torso" @@ -117,18 +117,18 @@ /obj/item/mecha_parts/chassis/serenity name = "Serenity Chassis" - New() - ..() - construct = new /datum/construction/mecha/serenity_chassis(src) +/obj/item/mecha_parts/chassis/serenity/New() + ..() + construct = new /datum/construction/mecha/serenity_chassis(src) //////////// Durand /obj/item/mecha_parts/chassis/durand name = "Durand Chassis" - New() - ..() - construct = new /datum/construction/mecha/durand_chassis(src) +/obj/item/mecha_parts/chassis/durand/New() + ..() + construct = new /datum/construction/mecha/durand_chassis(src) /obj/item/mecha_parts/part/durand_torso name="Durand Torso" @@ -172,9 +172,9 @@ /obj/item/mecha_parts/chassis/firefighter name = "Firefighter Chassis" - New() - ..() - construct = new /datum/construction/mecha/firefighter_chassis(src) +/obj/item/mecha_parts/chassis/firefighter/New() + ..() + construct = new /datum/construction/mecha/firefighter_chassis(src) /* /obj/item/mecha_parts/part/firefighter_torso name="Ripley-on-Fire Torso" @@ -203,9 +203,9 @@ name = "Phazon Chassis" origin_tech = list(TECH_MATERIAL = 7) - New() - ..() - construct = new /datum/construction/mecha/phazon_chassis(src) +/obj/item/mecha_parts/chassis/phazon/New() + ..() + construct = new /datum/construction/mecha/phazon_chassis(src) /obj/item/mecha_parts/part/phazon_torso name="Phazon Torso" @@ -255,9 +255,9 @@ /obj/item/mecha_parts/chassis/odysseus name = "Odysseus Chassis" - New() - ..() - construct = new /datum/construction/mecha/odysseus_chassis(src) +/obj/item/mecha_parts/chassis/odysseus/New() + ..() + construct = new /datum/construction/mecha/odysseus_chassis(src) /obj/item/mecha_parts/part/odysseus_head name="Odysseus Head" @@ -307,9 +307,9 @@ name = "Janus Chassis" origin_tech = list(TECH_MATERIAL = 7) - New() - ..() - construct = new /datum/construction/mecha/janus_chassis(src) +/obj/item/mecha_parts/chassis/janus/New() + ..() + construct = new /datum/construction/mecha/janus_chassis(src) /obj/item/mecha_parts/part/janus_torso name="Imperion Torso" diff --git a/code/game/mecha/mecha_wreckage.dm b/code/game/mecha/mecha_wreckage.dm index 9894784e15..7ca1e753fb 100644 --- a/code/game/mecha/mecha_wreckage.dm +++ b/code/game/mecha/mecha_wreckage.dm @@ -15,10 +15,10 @@ var/list/crowbar_salvage var/salvage_num = 5 - New() - ..() - crowbar_salvage = new - return +/obj/effect/decal/mecha_wreckage/New() + ..() + crowbar_salvage = new + return /obj/effect/decal/mecha_wreckage/ex_act(severity) if(severity < 2) @@ -80,20 +80,20 @@ name = "Gygax wreckage" icon_state = "gygax-broken" - New() - ..() - var/list/parts = list(/obj/item/mecha_parts/part/gygax_torso, - /obj/item/mecha_parts/part/gygax_head, - /obj/item/mecha_parts/part/gygax_left_arm, - /obj/item/mecha_parts/part/gygax_right_arm, - /obj/item/mecha_parts/part/gygax_left_leg, - /obj/item/mecha_parts/part/gygax_right_leg) - for(var/i=0;i<2;i++) - if(!isemptylist(parts) && prob(40)) - var/part = pick(parts) - welder_salvage += part - parts -= part - return +/obj/effect/decal/mecha_wreckage/gygax/New() + ..() + var/list/parts = list(/obj/item/mecha_parts/part/gygax_torso, + /obj/item/mecha_parts/part/gygax_head, + /obj/item/mecha_parts/part/gygax_left_arm, + /obj/item/mecha_parts/part/gygax_right_arm, + /obj/item/mecha_parts/part/gygax_left_leg, + /obj/item/mecha_parts/part/gygax_right_leg) + for(var/i=0;i<2;i++) + if(!isemptylist(parts) && prob(40)) + var/part = pick(parts) + welder_salvage += part + parts -= part + return /obj/effect/decal/mecha_wreckage/gygax/dark name = "Dark Gygax wreckage" @@ -128,38 +128,38 @@ name = "Ripley wreckage" icon_state = "ripley-broken" - New() - ..() - var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso, - /obj/item/mecha_parts/part/ripley_left_arm, - /obj/item/mecha_parts/part/ripley_right_arm, - /obj/item/mecha_parts/part/ripley_left_leg, - /obj/item/mecha_parts/part/ripley_right_leg) - for(var/i=0;i<2;i++) - if(!isemptylist(parts) && prob(40)) - var/part = pick(parts) - welder_salvage += part - parts -= part - return +/obj/effect/decal/mecha_wreckage/ripley/New() + ..() + var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso, + /obj/item/mecha_parts/part/ripley_left_arm, + /obj/item/mecha_parts/part/ripley_right_arm, + /obj/item/mecha_parts/part/ripley_left_leg, + /obj/item/mecha_parts/part/ripley_right_leg) + for(var/i=0;i<2;i++) + if(!isemptylist(parts) && prob(40)) + var/part = pick(parts) + welder_salvage += part + parts -= part + return /obj/effect/decal/mecha_wreckage/ripley/firefighter name = "Firefighter wreckage" icon_state = "firefighter-broken" - New() - ..() - var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso, - /obj/item/mecha_parts/part/ripley_left_arm, - /obj/item/mecha_parts/part/ripley_right_arm, - /obj/item/mecha_parts/part/ripley_left_leg, - /obj/item/mecha_parts/part/ripley_right_leg, - /obj/item/clothing/suit/fire) - for(var/i=0;i<2;i++) - if(!isemptylist(parts) && prob(40)) - var/part = pick(parts) - welder_salvage += part - parts -= part - return +/obj/effect/decal/mecha_wreckage/ripley/firefighter/New() + ..() + var/list/parts = list(/obj/item/mecha_parts/part/ripley_torso, + /obj/item/mecha_parts/part/ripley_left_arm, + /obj/item/mecha_parts/part/ripley_right_arm, + /obj/item/mecha_parts/part/ripley_left_leg, + /obj/item/mecha_parts/part/ripley_right_leg, + /obj/item/clothing/suit/fire) + for(var/i=0;i<2;i++) + if(!isemptylist(parts) && prob(40)) + var/part = pick(parts) + welder_salvage += part + parts -= part + return /obj/effect/decal/mecha_wreckage/ripley/deathripley name = "Death-Ripley wreckage" @@ -169,21 +169,21 @@ name = "Durand wreckage" icon_state = "durand-broken" - New() - ..() - var/list/parts = list( - /obj/item/mecha_parts/part/durand_torso, - /obj/item/mecha_parts/part/durand_head, - /obj/item/mecha_parts/part/durand_left_arm, - /obj/item/mecha_parts/part/durand_right_arm, - /obj/item/mecha_parts/part/durand_left_leg, - /obj/item/mecha_parts/part/durand_right_leg) - for(var/i=0;i<2;i++) - if(!isemptylist(parts) && prob(40)) - var/part = pick(parts) - welder_salvage += part - parts -= part - return +/obj/effect/decal/mecha_wreckage/durand/New() + ..() + var/list/parts = list( + /obj/item/mecha_parts/part/durand_torso, + /obj/item/mecha_parts/part/durand_head, + /obj/item/mecha_parts/part/durand_left_arm, + /obj/item/mecha_parts/part/durand_right_arm, + /obj/item/mecha_parts/part/durand_left_leg, + /obj/item/mecha_parts/part/durand_right_leg) + for(var/i=0;i<2;i++) + if(!isemptylist(parts) && prob(40)) + var/part = pick(parts) + welder_salvage += part + parts -= part + return /obj/effect/decal/mecha_wreckage/phazon name = "Phazon wreckage" @@ -194,21 +194,21 @@ name = "Odysseus wreckage" icon_state = "odysseus-broken" - New() - ..() - var/list/parts = list( - /obj/item/mecha_parts/part/odysseus_torso, - /obj/item/mecha_parts/part/odysseus_head, - /obj/item/mecha_parts/part/odysseus_left_arm, - /obj/item/mecha_parts/part/odysseus_right_arm, - /obj/item/mecha_parts/part/odysseus_left_leg, - /obj/item/mecha_parts/part/odysseus_right_leg) - for(var/i=0;i<2;i++) - if(!isemptylist(parts) && prob(40)) - var/part = pick(parts) - welder_salvage += part - parts -= part - return +/obj/effect/decal/mecha_wreckage/odysseus/New() + ..() + var/list/parts = list( + /obj/item/mecha_parts/part/odysseus_torso, + /obj/item/mecha_parts/part/odysseus_head, + /obj/item/mecha_parts/part/odysseus_left_arm, + /obj/item/mecha_parts/part/odysseus_right_arm, + /obj/item/mecha_parts/part/odysseus_left_leg, + /obj/item/mecha_parts/part/odysseus_right_leg) + for(var/i=0;i<2;i++) + if(!isemptylist(parts) && prob(40)) + var/part = pick(parts) + welder_salvage += part + parts -= part + return /obj/effect/decal/mecha_wreckage/odysseus/murdysseus icon_state = "murdysseus-broken" diff --git a/code/game/mecha/working/ripley.dm b/code/game/mecha/working/ripley.dm index a3a7d0e648..c7e9296991 100644 --- a/code/game/mecha/working/ripley.dm +++ b/code/game/mecha/working/ripley.dm @@ -25,6 +25,19 @@ icon_scale_x = 1.2 icon_scale_y = 1.2 +/obj/mecha/working/ripley/Move() + . = ..() + if(.) + collect_ore() + +/obj/mecha/working/ripley/proc/collect_ore() + if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in equipment) + var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in cargo + if(ore_box) + for(var/obj/item/weapon/ore/ore in range(1, src)) + if(ore.Adjacent(src) && ((get_dir(src, ore) & dir) || ore.loc == loc)) //we can reach it and it's in front of us? grab it! + ore.forceMove(ore_box) + /obj/mecha/working/ripley/Destroy() for(var/atom/movable/A in src.cargo) A.loc = loc diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm index 7c2e274644..5f980bfb3c 100644 --- a/code/game/objects/effects/decals/Cleanable/misc.dm +++ b/code/game/objects/effects/decals/Cleanable/misc.dm @@ -24,10 +24,9 @@ /obj/effect/decal/cleanable/greenglow - New() - ..() - spawn(1200)// 2 minutes - qdel(src) +/obj/effect/decal/cleanable/greenglow/New() + ..() + QDEL_IN(src, 2 MINUTES) /obj/effect/decal/cleanable/dirt name = "dirt" diff --git a/code/game/objects/effects/decals/Cleanable/tracks.dm b/code/game/objects/effects/decals/Cleanable/tracks.dm index 934068f25b..41f8e26891 100644 --- a/code/game/objects/effects/decals/Cleanable/tracks.dm +++ b/code/game/objects/effects/decals/Cleanable/tracks.dm @@ -24,10 +24,10 @@ var/global/list/image/fluidtrack_cache=list() var/crusty=0 var/image/overlay - New(_direction,_color,_wet) - src.direction=_direction - src.basecolor=_color - src.wet=_wet +/datum/fluidtrack/New(_direction,_color,_wet) + src.direction=_direction + src.basecolor=_color + src.wet=_wet /obj/effect/decal/cleanable/blood/tracks/reveal_blood() if(!fluorescent) @@ -72,86 +72,86 @@ var/global/list/image/fluidtrack_cache=list() * @param goingdir Direction tracks are going to (or 0). * @param bloodcolor Color of the blood when wet. */ - proc/AddTracks(var/list/DNA, var/comingdir, var/goingdir, var/bloodcolor="#A10808") - var/updated=0 - // Shift our goingdir 4 spaces to the left so it's in the GOING bitblock. - var/realgoing=goingdir<<4 +/obj/effect/decal/cleanable/blood/tracks/proc/AddTracks(var/list/DNA, var/comingdir, var/goingdir, var/bloodcolor="#A10808") + var/updated=0 + // Shift our goingdir 4 spaces to the left so it's in the GOING bitblock. + var/realgoing=goingdir<<4 - // Current bit - var/b=0 + // Current bit + var/b=0 - // When tracks will start to dry out - var/t=world.time + TRACKS_CRUSTIFY_TIME + // When tracks will start to dry out + var/t=world.time + TRACKS_CRUSTIFY_TIME - var/datum/fluidtrack/track + var/datum/fluidtrack/track - // Process 4 bits - for(var/bi=0;bi<4;bi++) - b=1<>4 + // Update ONLY the overlays that have changed. + for(var/datum/fluidtrack/track in stack) + var/stack_idx=setdirs["[track.direction]"] + var/state=coming_state + truedir=track.direction + if(truedir&240) // Check if we're in the GOING block + state=going_state + truedir=truedir>>4 - if(track.overlay) - track.overlay=null - var/image/I = image(icon, icon_state=state, dir=num2dir(truedir)) - I.color = track.basecolor + if(track.overlay) + track.overlay=null + var/image/I = image(icon, icon_state=state, dir=num2dir(truedir)) + I.color = track.basecolor - track.fresh=0 - track.overlay=I - stack[stack_idx]=track - overlays += I - updatedtracks=0 // Clear our memory of updated tracks. + track.fresh=0 + track.overlay=I + stack[stack_idx]=track + overlays += I + updatedtracks=0 // Clear our memory of updated tracks. /obj/effect/decal/cleanable/blood/tracks/footprints name = "wet footprints" diff --git a/code/game/objects/effects/decals/contraband.dm b/code/game/objects/effects/decals/contraband.dm deleted file mode 100644 index 150a9ee310..0000000000 --- a/code/game/objects/effects/decals/contraband.dm +++ /dev/null @@ -1,242 +0,0 @@ - -//########################## CONTRABAND ;3333333333333333333 -Agouri ################################################### - -/obj/item/weapon/contraband - name = "contraband item" - desc = "You probably shouldn't be holding this." - icon = 'icons/obj/contraband.dmi' - force = 0 - - -/obj/item/weapon/contraband/poster - name = "rolled-up poster" - desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface." - icon_state = "rolled_poster" - drop_sound = 'sound/items/drop/wrapper.ogg' - pickup_sound = 'sound/items/pickup/wrapper.ogg' - var/serial_number = null - - var/poster_type = /obj/structure/sign/poster - -/obj/item/weapon/contraband/poster/New(turf/loc, var/given_serial = 0) - if(!serial_number) - if(given_serial == 0) - serial_number = rand(1, poster_designs.len) - else - serial_number = given_serial - name += " - No. [serial_number]" - ..(loc) - -//Places the poster on a wall -/obj/item/weapon/contraband/poster/afterattack(var/atom/A, var/mob/user, var/adjacent, var/clickparams) - if (!adjacent) - return - - //must place on a wall and user must not be inside a closet/mecha/whatever - var/turf/W = A - if (!iswall(W) || !isturf(user.loc)) - to_chat(user, "You can't place this here!") - return - - var/placement_dir = get_dir(user, W) - if (!(placement_dir in cardinal)) - to_chat(user, "You must stand directly in front of the wall you wish to place that on.") - return - - //just check if there is a poster on or adjacent to the wall - var/stuff_on_wall = 0 - if (locate(/obj/structure/sign/poster) in W) - stuff_on_wall = 1 - - //crude, but will cover most cases. We could do stuff like check pixel_x/y but it's not really worth it. - for (var/dir in cardinal) - var/turf/T = get_step(W, dir) - if (locate(/obj/structure/sign/poster) in T) - stuff_on_wall = 1 - break - - if (stuff_on_wall) - to_chat(user, "There is already a poster there!") - return - - to_chat(user, "You start placing the poster on the wall...") //Looks like it's uncluttered enough. Place the poster. - - var/obj/structure/sign/poster/P = new poster_type(user.loc, placement_dir=get_dir(user, W), serial=serial_number, itemtype = src.type) - - flick("poster_being_set", P) - //playsound(W, 'sound/items/poster_being_created.ogg', 100, 1) //why the hell does placing a poster make printer sounds? - - var/oldsrc = src //get a reference to src so we can delete it after detaching ourselves - src = null - spawn(17) - if(!P) return - - if(iswall(W) && user && P.loc == user.loc) //Let's check if everything is still there - to_chat(user, "You place the poster!") - else - P.roll_and_drop(P.loc) - - qdel(oldsrc) //delete it now to cut down on sanity checks afterwards. Agouri's code supports rerolling it anyway - -//NT subtype -/obj/item/weapon/contraband/poster/nanotrasen - icon_state = "rolled_poster_nt" - poster_type = /obj/structure/sign/poster/nanotrasen - -/obj/item/weapon/contraband/poster/nanotrasen/New(turf/loc, var/given_serial = 0) - if(given_serial == 0) - serial_number = rand(1, NT_poster_designs.len) - else - serial_number = given_serial - ..(loc) - -//Selectable subtype -/obj/item/weapon/contraband/poster/custom - name = "rolled-up poly-poster" - desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface. This one is made from some kind of e-paper, and could display almost anything!" - poster_type = /obj/structure/sign/poster/custom - -/obj/item/weapon/contraband/poster/custom/New(turf/loc, var/given_serial = 0) - if(given_serial == 0) - serial_number = 1 //Decidedly unrandom - else - serial_number = given_serial - ..(loc) - -/obj/item/weapon/contraband/poster/custom/verb/select_poster() - set name = "Set Poster type" - set category = "Object" - set desc = "Click to choose a poster to display." - - var/mob/M = usr - var/list/options = list() - for(var/datum/poster/posteroption in poster_designs) - options[posteroption.listing_name] = posteroption - - var/choice = input(M,"Choose a poster!","Customize Poster") in options - if(src && choice && !M.stat && in_range(M,src)) - var serial = poster_designs.Find(options[choice]) - serial_number = serial - name = "rolled-up poly-poster - No.[serial]" - to_chat(M, "The poster is now: [choice].") - return 1 - - - -//############################## THE ACTUAL DECALS ########################### - -/obj/structure/sign/poster - name = "poster" - desc = "A large piece of space-resistant printed paper. " - 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 - - var/roll_type - var/poster_set = FALSE - -/obj/structure/sign/poster/New(var/newloc, var/placement_dir=null, var/serial=null, var/itemtype = /obj/item/weapon/contraband/poster) - ..(newloc) - - if(!serial) - serial = rand(1, poster_designs.len) //use a random serial if none is given - - if(!poster_set) - serial_number = serial - var/datum/poster/design = poster_designs[serial_number] - set_poster(design) - - if(itemtype || !roll_type) - roll_type = itemtype - - switch (placement_dir) - if (NORTH) - pixel_x = 0 - pixel_y = 32 - if (SOUTH) - pixel_x = 0 - pixel_y = -32 - if (EAST) - pixel_x = 32 - pixel_y = 0 - if (WEST) - pixel_x = -32 - pixel_y = 0 - -/obj/structure/sign/poster/Initialize() - . = ..() - if (poster_type) - var/path = text2path(poster_type) - var/datum/poster/design = new path - set_poster(design) - -/obj/structure/sign/poster/proc/set_poster(var/datum/poster/design) - name = "[initial(name)] - [design.name]" - desc = "[initial(desc)] [design.desc]" - icon_state = design.icon_state // poster[serial_number] - - poster_set = TRUE - -/obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(W.is_wirecutter()) - playsound(src, W.usesound, 100, 1) - if(ruined) - to_chat(user, "You remove the remnants of the poster.") - qdel(src) - else - to_chat(user, "You carefully remove the poster from the wall.") - roll_and_drop(user.loc) - return - -/obj/structure/sign/poster/attack_hand(mob/user as mob) - - if(ruined) - return - - if(alert("Do I want to rip the poster from the wall?","You think...","Yes","No") == "Yes") - - if(ruined || !user.Adjacent(src)) - return - - visible_message("[user] rips [src] in a single, decisive motion!" ) - playsound(src, 'sound/items/poster_ripped.ogg', 100, 1) - ruined = 1 - icon_state = "poster_ripped" - name = "ripped poster" - desc = "You can't make out anything from the poster's original print. It's ruined." - add_fingerprint(user) - -/obj/structure/sign/poster/proc/roll_and_drop(turf/newloc) - var/obj/item/weapon/contraband/poster/P = new roll_type(src, serial_number) - P.loc = newloc - src.loc = P - qdel(src) - -/datum/poster - // Name suffix. Poster - [name] - var/name="" - // Description suffix - var/desc="" - var/icon_state="" - var/listing_name="" - -// NT poster subtype. -/obj/structure/sign/poster/nanotrasen - roll_type = /obj/item/weapon/contraband/poster/nanotrasen - -/obj/structure/sign/poster/nanotrasen/New(var/newloc, var/placement_dir=null, var/serial=null, var/itemtype = /obj/item/weapon/contraband/poster/nanotrasen) - if(!serial) - serial = rand(1, NT_poster_designs.len) - - serial_number = serial - var/datum/poster/design = NT_poster_designs[serial_number] - set_poster(design) - - ..(newloc, placement_dir, serial, itemtype) - -//Non-Random Posters - -/obj/structure/sign/poster/custom - roll_type = /obj/item/weapon/contraband/poster/custom \ No newline at end of file diff --git a/code/game/objects/effects/decals/crayon.dm b/code/game/objects/effects/decals/crayon.dm index 55bb54b803..ca95bc2777 100644 --- a/code/game/objects/effects/decals/crayon.dm +++ b/code/game/objects/effects/decals/crayon.dm @@ -5,26 +5,26 @@ plane = DIRTY_PLANE anchored = 1 - New(location,main = "#FFFFFF",shade = "#000000",var/type = "rune") - ..() - loc = location +/obj/effect/decal/cleanable/crayon/New(location,main = "#FFFFFF",shade = "#000000",var/type = "rune") + ..() + loc = location - name = type - desc = "A [type] drawn in crayon." + name = type + desc = "A [type] drawn in crayon." - switch(type) - if("rune") - type = "rune[rand(1,6)]" - if("graffiti") - type = pick("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa") + switch(type) + if("rune") + type = "rune[rand(1,6)]" + if("graffiti") + type = pick("amyjon","face","matt","revolution","engie","guy","end","dwarf","uboa") - var/icon/mainOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]",2.1) - var/icon/shadeOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]s",2.1) + var/icon/mainOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]",2.1) + var/icon/shadeOverlay = new/icon('icons/effects/crayondecal.dmi',"[type]s",2.1) - mainOverlay.Blend(main,ICON_ADD) - shadeOverlay.Blend(shade,ICON_ADD) + mainOverlay.Blend(main,ICON_ADD) + shadeOverlay.Blend(shade,ICON_ADD) - overlays += mainOverlay - overlays += shadeOverlay + overlays += mainOverlay + overlays += shadeOverlay - add_hiddenprint(usr) \ No newline at end of file + add_hiddenprint(usr) \ No newline at end of file diff --git a/code/game/objects/effects/decals/posters/bs12.dm b/code/game/objects/effects/decals/posters/bs12.dm index 5c1c32d98b..6933031c5f 100644 --- a/code/game/objects/effects/decals/posters/bs12.dm +++ b/code/game/objects/effects/decals/posters/bs12.dm @@ -1,346 +1,347 @@ // baystation12 posters -/datum/poster/bay_1 - icon_state="bsposter1" - name = "PSA: Unlucky Space Explorer" - desc = "This grim PSA depicts a skeletal form within a space suit. Thousands die every year as a result of failing to follow EVA safety guidelines." - listing_name = "PSA - EVA Accidents" +// Base type needs to be defined or template types make random selection wonky +/decl/poster + var/icon_state="bsposter1" + var/name = "PSA: Unlucky Space Explorer" + var/desc = "This grim PSA depicts a skeletal form within a space suit. Thousands die every year as a result of failing to follow EVA safety guidelines." + var/listing_name = "PSA - EVA Accidents" -/datum/poster/bay_2 +/decl/poster/bay_2 icon_state="bsposter2" name = "PSA: Disobedient Drones" desc = "This PSA depicts the cold, unmoving stare of a particularly advanced AI. Contact information for the Emergent Intelligence Oversight is included." listing_name = "PSA - Emergent Drones" -/datum/poster/bay_3 +/decl/poster/bay_3 icon_state="bsposter3" name = "PSA: Corporate Espionage" desc = "This PSA warns of the dangers of trusting your co-workers with sensitive department information. They may be spying for a rival corporation, or worse!" listing_name = "PSA - Corporate Espionage" -/datum/poster/bay_4 +/decl/poster/bay_4 icon_state="bsposter4" name = "Keep Calm" desc = "An incredibly vague message, presented in a classic form. Someone has scribbled an O over the A on the poster." listing_name = "PSA - Keep Calm" -/datum/poster/bay_5 +/decl/poster/bay_5 icon_state="bsposter5" name = "PSA: Saboteurs!" desc = "A company PSA reminding employees to keep an eye out for suspicious activity, and report it immediately." listing_name = "PSA - Saboteur" -/datum/poster/bay_6 +/decl/poster/bay_6 icon_state="bsposter6" name = "Eradicator XV" desc = "An ad for the fifteenth installment in the Eradicator movie franchise, about a violent robotic uprising hellbent on wiping out humanity." listing_name = "Ad - Eradicator XV" -/datum/poster/bay_7 +/decl/poster/bay_7 icon_state="bsposter7" name = "Wasteland: Battle for Earth" desc = "This action movie ad shows a couple of ragged post-apocalyptic gunmen, one male and one female, on top of a mound of rubble." listing_name = "Ad - Battle for Earth" -/datum/poster/bay_8 +/decl/poster/bay_8 icon_state="bsposter8" name = "Pinup Girl Cindy" desc = "This is a vintage 2450s pin-up of NanoTrasen's PR girl, Cindy, in a particularly feminine pose." listing_name = "Pin-up - Cindi" -/datum/poster/bay_9 +/decl/poster/bay_9 icon_state="bsposter9" name = "Pinup Girl Amy" desc = "This pin-up is of Amy, one of NanoTrasen's most popular PR models." listing_name = "Pin-up - Amy" -/datum/poster/bay_10 +/decl/poster/bay_10 icon_state="bsposter10" name = "Don't Panic" desc = "This ad for Vey-Medical anxiety pills depicts some sort of star in a grimace. The \"Don't Panic\" is written in big, friendly letters." listing_name = "Ad - Don't panic." -/datum/poster/bay_11 +/decl/poster/bay_11 icon_state="bsposter11" name = "Underwater Living" desc = "This immigration poster encourages you to move to Earth;s premiere underwater city, Atlantis. One bedroom apartments start at half your salary." listing_name = "Ad - Atlantis" -/datum/poster/bay_12 +/decl/poster/bay_12 icon_state="bsposter12" name = "Beware Rogue AI" desc = "This ad for the Emergent Intelligence Oversight Recruitment Division depicts a menacing AI and asks if you're a bad enough dude to take it on." listing_name = "Recruitment - EIO" -/datum/poster/bay_13 +/decl/poster/bay_13 icon_state="bsposter13" name = "Become A User of the Arcane Arts" desc = "This ad for popular Virtual Reality online game 'Wiz Online' depicts a wizard, casting a spell. You can't really make out if it's an actual photograph or a computer-generated image. Incredible graphics!" listing_name = "Ad - Wiz Online" -/datum/poster/bay_14 +/decl/poster/bay_14 icon_state="bsposter14" name = "Levitating Skull" desc = "This tacky ad is a portrait of the flying enchanted skull, Bones. Its adventures along with its fabled companion are showing now on a broadcast service near you!" listing_name = "Ad - Bones Adventures" -/datum/poster/bay_15 +/decl/poster/bay_15 icon_state="bsposter15" name = "Augmented Legend" desc = "This ad for Ward-Takahashi cybernetic implants shows obviously augmented individual, gazing towards the sky. Is your body augmented?" listing_name = "Ad - Ward-Takahashi Augments" -/datum/poster/bay_16 +/decl/poster/bay_16 icon_state="bsposter16" name = "Snow Crash" desc = "This particular one depicts nothing remarkable other than a rather mesmerising pattern of monitor static. You think it's an ad for something, but you're not sure what." listing_name = "Ad - Snow Crash" -/datum/poster/bay_17 +/decl/poster/bay_17 icon_state="bsposter17" name = "Pinup Girl Val" desc = "Luscious Val McNeil, the vertically challenged Legal Extraordinaire, winner of Miss Space two years running and favoured pinup girl of Lawyers Weekly." listing_name = "Pin-up - Val" -/datum/poster/bay_18 +/decl/poster/bay_18 icon_state="bsposter18" name = "Derpman, Enforcer of the State" desc = "An ad for Centauri Provisions donuts. Officer Derpman is here to protect and serve... your donuts! A generously proportioned man, he teaches you the value of hiding your snacks." listing_name = "Ad - Officer Derpman Donuts" -/datum/poster/bay_19 +/decl/poster/bay_19 icon_state="bsposter19" name = "Respect an Unathi" desc = "This poster depicts a sharply dressed Unathi receiving a prestigious award. It appears to espouse greater co-operation and harmony between humanity and the Unathi." listing_name = "PSA - Unathi" -/datum/poster/bay_20 +/decl/poster/bay_20 icon_state="bsposter20" name = "Skrell Tourism" desc = "This tourism poster depicts a mysteriously inscrutable, alien scene. Numerous Skrell can be seen conversing amidst great, crystalline towers rising above crashing waves." listing_name = "Ad - Skrellian Tourism" -/datum/poster/bay_21 +/decl/poster/bay_21 icon_state="bsposter21" name = "Join the Fuzz!" desc = "It's a nice recruitment poster of a white haired Chinese woman that says; \"Big Guns, Hot Women, Good Times. Security. We get it done.\"" listing_name = "Recruitment - NanoTrasen Security - Pinup" -/datum/poster/bay_22 +/decl/poster/bay_22 icon_state="bsposter22" name = "Looking for a career with excitement?" desc = "A recruitment poster starring a dark haired woman with glasses and a purple shirt that has \"Got Brains? Got Talent? Not afraid of electric flying monsters that want to suck the soul out of you? Then Xenobiology could use someone like you!\" written on the bottom." listing_name = "Recruitment - Xenobiology" -/datum/poster/bay_23 +/decl/poster/bay_23 icon_state="bsposter23" name = "Safety first: because electricity doesn't wait!" desc = "A safety poster starring a clueless looking redhead with frazzled hair. \"Every year, hundreds of NT employees expose themselves to electric shock. Play it safe. Avoid suspicious doors after electrical storms, and always wear protection when doing electric maintenance.\"" listing_name = "Safety - Electric Shock" -/datum/poster/bay_24 +/decl/poster/bay_24 icon_state="bsposter24" name = "Responsible medbay habits, No #259" desc = "A poster with a nervous looking geneticist on it states; \"Friends Tell Friends They're Clones. It can cause severe and irreparable emotional trauma if a person is not properly informed of their recent demise. Always follow your contractual obligation and inform them of their recent rejuvenation.\"" listing_name = "Medical - Clone Disclosure" -/datum/poster/bay_25 +/decl/poster/bay_25 icon_state="bsposter25" name = "Irresponsible medbay habits, No #2" desc = "This is a safety poster starring a perverted looking naked doctor. \"Sexual harassment is never okay. REPORT any acts of sexual deviance or harassment that disrupt a healthy working environment.\"" listing_name = "Medical - Sexual Harassment" -/datum/poster/bay_26 +/decl/poster/bay_26 icon_state="bsposter26" name = "The Men We Knew" desc = "This movie poster depicts a group of soldiers fighting a large mech, it seems to be some kind of movie set during the Hegemony War." listing_name = "Ad - Men We Knew" -/datum/poster/bay_27 +/decl/poster/bay_27 icon_state="bsposter27" name = "Plastic Sheep Can't Scream" desc = "This is a movie poster for an upcoming horror movie, featuring a frightening looking robotic creature." listing_name = "Ad - Plastic Sheep Can't Scream" -/datum/poster/bay_28 +/decl/poster/bay_28 icon_state="bsposter28" name = "The Stars Know Love" desc = "This is a movie poster. A bleeding woman is shown drawing a heart in her blood on the window of space ship, it seems to be a romantic drama." listing_name = "Ad - The Stars Know Love" -/datum/poster/bay_29 +/decl/poster/bay_29 icon_state="bsposter29" name = "Winter Is Coming" desc = "On the poster is a frighteningly large wolf, he warns: \"Only YOU can keep yourself from freezing this winter!\". Below is the logo of NanoThreads clothing." listing_name = "Ad - Cold-weather Gear" -/datum/poster/bay_30 +/decl/poster/bay_30 icon_state="bsposter30" name = "Ambrosia Vulgaris" desc = "It's an ad for getting absolutely shitfaced on psychadelics. Just looking at this poster makes you feel a little bit dizzy. Use responsibly." listing_name = "Ad - Ambrosia Vulgaris" -/datum/poster/bay_31 +/decl/poster/bay_31 icon_state="bsposter31" name = "Donut Panic" desc = "This is an advertisement for Donut Panic, the bi-monthly periodical for donut lovers galaxy-wide." listing_name = "Ad - Donuts Panic" -/datum/poster/bay_32 +/decl/poster/bay_32 icon_state="bsposter32" name = "Eat!" desc = "A NanoPastures poster depicting a synthmeat hamburger. The poster COMMANDS you to consume the hamburger." listing_name = "Ad - Hamburger" -/datum/poster/bay_33 +/decl/poster/bay_33 icon_state="bsposter33" name = "Tools, tools, tools!" desc = "Xion Manufacturing reminds you: Never trust an off-brand tool. " listing_name = "Ad - Xion Tools" -/datum/poster/bay_34 +/decl/poster/bay_34 icon_state="bsposter34" name = "Power Up!" desc = "NanoTrasen are leaders in Phoron-based supermatter power! High reward, higher risk!" listing_name = "Ad - Phoron Power" -/datum/poster/bay_35 +/decl/poster/bay_35 icon_state="bsposter35" name = "Kendrick" desc = "This is a poster depicting the pet and mascot of the science department, and national corporate ambassador for slime-based science solutions.." listing_name = "Ad - Slime Science" -/datum/poster/bay_36 +/decl/poster/bay_36 icon_state="bsposter36" name = "Fancy Borg" desc = "A poster depicting a cyborg dressed to the nines. An ad for cybernetics enthusiast magazine, Borg Fancy." listing_name = "Ad - Borg Fancy A" -/datum/poster/bay_37 +/decl/poster/bay_37 icon_state="bsposter37" name = "Fancier Borg" desc = "A poster depicting a cyborg dressed to the nines. An ad for cybernetics enthusiast magazine, Borg Fancy. This is even fancier than the other poster." listing_name = "Ad - Borg Fancy B" -/datum/poster/bay_38 +/decl/poster/bay_38 icon_state="bsposter38" name = "Toaster Love" desc = "This is a poster of a toaster containing two slices of bread. The word LOVE is written in big pink letters underneath. An ad for a cybernetics 'enthusiast' magazine. " listing_name = "Ad - Toaster Love" -/datum/poster/bay_39 +/decl/poster/bay_39 icon_state="bsposter39" name = "Responsible medbay habits, No #91" desc = "A safety poster with a chemist holding a vial. \"Always wear safety gear while handling dangerous chemicals, even if it concerns only small amounts.\"" listing_name = "Safety - Chemicals" -/datum/poster/bay_40 +/decl/poster/bay_40 icon_state="bsposter40" name = "Agreeable work environment" desc = "This poster depicts a young woman in a stylish dress. \"Try to aim for a pleasant atmosphere in the workspace. A friendly word can do more than forms in triplicate.\"" listing_name = "PSA - Agreeable Work Environment" -/datum/poster/bay_41 +/decl/poster/bay_41 icon_state="bsposter41" name = "Professional work environment" desc = "A safety poster featuring a green haired woman in a shimmering blue dress. \"As an Internal Affairs Agent, your job is to create a fair and agreeable work environment for the crewmembers, as discreetly and professionally as possible.\"" listing_name = "Recruitment - Internal Affairs" -/datum/poster/bay_42 +/decl/poster/bay_42 icon_state="bsposter42" name = "Engineering pinup" desc = "This is pin-up poster. A half-naked girl with white hair, toned muscles and stunning blue eyes looks back at you from the poster. Her welding helmet, tattoos and grey jumpsuit hanging around her waist gives a bit of a rugged feel." listing_name = "Pin-up - Engineer" -/datum/poster/bay_43 +/decl/poster/bay_43 icon_state="bsposter43" name = "Responsible medbay habits, No #3" desc = "A safety poster with a purple-haired surgeon. She looks a bit cross. \"Let the surgeons do their work. NEVER replace or remove a surgery tool from where the surgeon put it.\"" listing_name = "Safety - Surgical Tools" -/datum/poster/bay_44 +/decl/poster/bay_44 icon_state="bsposter44" name = "Time for a drink?" desc = "This poster for a brand for \"Tajaran-style\" rum produced by Gilthari Exports depicts a friendly-looking Tajaran holding a tray of drinks." listing_name = "Ad - Rarkajar Rum" -/datum/poster/bay_45 +/decl/poster/bay_45 icon_state="bsposter45" name = "Responsible engineering habits, No #1" desc = "A safety poster featuring a blue haired engineer. \"When repairing a machine or construction, always aim for long-term solutions.\"" listing_name = "Safety - No Shortcut Fixes" -/datum/poster/bay_46 +/decl/poster/bay_46 icon_state="bsposter46" name = "Inspirational lawyer" desc = "An inspirational poster depicting a Skrellian lawyer. He seems to be shouting something, while pointing fiercely to the right. It's an ad for a NanoTrasen subsidiary law firm." listing_name = "Ad - NanoTrasen Law" -/datum/poster/bay_47 +/decl/poster/bay_47 icon_state="bsposter47" name = "Security pinup" desc = "This is a pin-up poster. A dark skinned white haired girl poses in the sunlight wearing a tank top with her stomach exposed. The text on the poster states \"M, Succubus of Security.\" and a lipstick mark stains the top right corner, as if kissed by the model herself." listing_name = "Pin-up - Security" -/datum/poster/bay_48 +/decl/poster/bay_48 icon_state="bsposter48" name = "Remote Drones 4 U" desc = "This is an ad for a fairly basic model of drone produced by Grayson Manufactories Ltd. for use in hazardous environments." listing_name = "Ad - Grayson Drones" -/datum/poster/bay_49 +/decl/poster/bay_49 icon_state="bsposter49" name = "Engineering recruitment" desc = "This is a poster showing an engineer relaxing by a computer, the text states \"Living the life! Join Engineering today!\"" listing_name = "Recruitment - Engineering" -/datum/poster/bay_50 +/decl/poster/bay_50 icon_state="bsposter50" name = "Pinup Girl Cindy Kate" desc = "This particular one is of Cindy Kate, a seductive virtual performer well known among less savoury exonet circles." listing_name = "Pin-up - Cindi-Kate" -/datum/poster/bay_51 +/decl/poster/bay_51 icon_state="bsposter51" name = "space tourism poster" desc = "This is a poster produced by the Visit Space Society. This one is targeted at planet-dwellers, suggesting they generally visit space." listing_name = "Tourism - Space" -/datum/poster/bay_52 +/decl/poster/bay_52 icon_state="bsposter52" name = "fire safety poster" desc = "This is a poster reminding you of what you should do if you are on fire, or if you are at a dance party." listing_name = "Safety - Stop Drop and Roll" -/datum/poster/bay_53 +/decl/poster/bay_53 icon_state="bsposter53" name = "fire extinguisher poster" desc = "This is a poster reminding you of what you should use to put out a fire." listing_name = "Safety - Fire Extinguishers" -/datum/poster/bay_54 +/decl/poster/bay_54 icon_state="bsposter54" name = "firefighter poster" desc = "This is a poster of a particularly stern looking firefighter. The caption reads, \"Only you can prevent space fires.\"" listing_name = "Safety - Prevent Fires" -/datum/poster/bay_55 +/decl/poster/bay_55 icon_state="bsposter55" name = "Binma tourism poster" desc = "This is a poster produced by the Visit Space Society. This one suggests you visit the exotic garden world of Binma, and try not to get eaten." listing_name = "Tourism - Binma" -/datum/poster/bay_56 +/decl/poster/bay_56 icon_state="bsposter56" name = "Mars appreciation poster" desc = "This is a poster produced by the Visit Space Society. This one suggests you visit historic Mars. Come for the domes, stay for the monuments to hubris!" -/datum/poster/bay_57 +/decl/poster/bay_57 icon_state="bsposter57" name = "space carp warning poster" desc = "This poster tells of the dangers of space carp infestations." listing_name = "Safety - Carp" -/datum/poster/bay_58 +/decl/poster/bay_58 icon_state="bsposter58" name = "space carp information poster" desc = "This poster showcases an old spacer saying on the dangers of migrant space carp." diff --git a/code/game/objects/effects/decals/posters/polarisposters.dm b/code/game/objects/effects/decals/posters/polarisposters.dm index bbd2db75fe..3d18d0cc4f 100644 --- a/code/game/objects/effects/decals/posters/polarisposters.dm +++ b/code/game/objects/effects/decals/posters/polarisposters.dm @@ -1,52 +1,52 @@ -/datum/poster/pol_1 +/decl/poster/pol_1 icon_state="polposter1" name = "Safety!" desc = "A poster advising you to learn how to put on your internals at a moment's notice." listing_name = "Safety - Internals" -/datum/poster/pol_2 +/decl/poster/pol_2 icon_state="polposter2" name = "Safety!" desc = "A blue and white colored poster. This one advises you to wear your safety goggles when handling chemicals." listing_name = "Safety - Goggles" -/datum/poster/pol_3 +/decl/poster/pol_3 icon_state="polposter3" name = "Safety!" desc = "A safety poster instructing you to comply with the authorities, especially in an emergency." listing_name = "Safety - Follow Instruction" -/datum/poster/pol_4 +/decl/poster/pol_4 icon_state="polposter4" name = "Clean Hands Save Lives" desc = "A safety poster reminding you to wash your hands." listing_name = "Safety - Hand Washing" -/datum/poster/pol_5 +/decl/poster/pol_5 icon_state="polposter5" name = "Help!" desc = "This poster depicts a man helping another man get up." listing_name = "Safety - Help Others" -/datum/poster/pol_6 +/decl/poster/pol_6 icon_state="polposter6" name = "Walk!" desc = "This poster depicts a man walking, presumably to encourage you not to run in the halls." listing_name = "Safety - No Running" -/datum/poster/pol_7 +/decl/poster/pol_7 icon_state="polposter7" name = "Place your signs!" desc = "A safety poster reminding custodial staff to place wet floor signs where needed. This reminder's rarely heeded." listing_name = "Safety - Wet Floor Signs" -/datum/poster/pol_8 +/decl/poster/pol_8 icon_state="polposter8" name = "Safety!" desc = "An advertisement / safety poster for EVA training and certification. Training is available at your local Central Command." listing_name = "Safety - EVA Training" -/datum/poster/pol_9 +/decl/poster/pol_9 icon_state="poster10" //Recycling this icon name = "Airlock Maintenance Reference" desc = "This poster appears to be reference material for maintenance personnel, instructing to always wear insulated gloves, that wirecutters and \ @@ -54,49 +54,49 @@ wire codes." listing_name = "Safety - Airlock Maintenance" -/datum/poster/pol_10 +/decl/poster/pol_10 icon_state="polposter9" name = "orchid" desc = "This poster appears strangely familiar, depicting the flower of a tree native to the planet Earth." listing_name = "General - Orchid" -/datum/poster/pol_11 +/decl/poster/pol_11 icon_state="polposter10" name = "firefighter pinup" desc = "A buff firefighter with his shirt off. Maybe he's trying to raise awareness about fire safety, but you're a little distracted." listing_name = "Pin-up - Firefighter" -/datum/poster/pol_12 +/decl/poster/pol_12 icon_state="polposter11" name = "CHUCK" desc = "With the budget Cyber Solutions 'Chuck' model work drone, your days of menial labour are numbered! \"With Cyber Solutions, there's always someone beside you, helping you. You know their face. You know my face.\"" listing_name = "Ad - Chuck" -/datum/poster/pol_13 +/decl/poster/pol_13 icon_state="polposter12" name = "New You" desc = "An ad for Kaleidoscope Cosmetics. \"The common factor in all your failed relationships is you. Fix it with affordable gene therapy!\"" listing_name = "Ad - Kaleidoscope" -/datum/poster/pol_14 +/decl/poster/pol_14 icon_state="polposter13" name = "Take a Taxi" desc = "An ad for the Major Bill's Transportation drone-operated taxi service operating in most major cities throughout Solar space." listing_name = "Ad - Taxi" -/datum/poster/pol_15 +/decl/poster/pol_15 icon_state="polposter14" name = "Adopt A Teshpet" desc = "An ad for definitively racist virtual pet game, Teshpets." listing_name = "Ad - Teshpets" -/datum/poster/pol_16 +/decl/poster/pol_16 icon_state="polposter15" name = "Train and Fight" desc = "This poster of sweaty, near-naked wrestlers is the most masculine thing you've ever seen. You can barely tell where one man ends and the other begins. Always seek manliness!" listing_name = "Pinup - Wrestling" -/datum/poster/nt_3 +/decl/poster/nt_3 icon_state = "ntposter03" name = "Mechatronic Safety" desc = "This poster displays three cutting-edge gygaxes standing in line in front of a man in plain clothes.\ @@ -104,25 +104,25 @@ The image seems important." listing_name = "Safety - Mech Operation" -/datum/poster/nt_4 +/decl/poster/nt_4 icon_state = "ntposter04" name = "Beware Aetotheans" desc = "This poster displays a distinctly hostile-looking red Promethean in a black coat. The fine-print around the edges warns the reader about the dangers posed by Almachi Prometheans." listing_name = "Safety - Aetothean Danger" -/datum/poster/nt_5 +/decl/poster/nt_5 icon_state = "ntposter05" name = "Promethean" desc = "This poster displays a friendly-looking green Promethean in a labcoat. The fine-print around the edges talks about the benefits Prometheans give in laboratories." listing_name = "Safety - Prometheans" -/datum/poster/nt_6 +/decl/poster/nt_6 icon_state = "ntposter06" name = "NanoTrasen" desc = "This poster showcases an NT emblem. There is writing in the ring around the inner points, probably some sort of slogan no one bothers to memorize." listing_name = "Ad - NanoTrasen" -/datum/poster/nt_7 +/decl/poster/nt_7 icon_state = "ntposter07" name = "SolGov" desc = "This poster showcases an SCG emblem. The outer ring reads,\ @@ -130,62 +130,62 @@ Solar Confederate Government." listing_name = "Political - SolGov" -/datum/poster/nt_8 +/decl/poster/nt_8 icon_state = "ntposter08" name = "wildlife hazard" desc = "This SifGov poster warns against attempting to kill a fully grown giant spider or other hostile life-form alone." listing_name = "Safety - Spiders" // A new subset of poster datum for ONLY 'Internal' NanoTrasen posters, given to Security. -/datum/poster/nanotrasen +/decl/poster/nanotrasen icon_state = "polposter1" name = "Safety!" desc = "A poster advising you to learn how to put on your internals at a moment's notice." listing_name = "Safety - Internals" -/datum/poster/nanotrasen/pol_2 +/decl/poster/nanotrasen/pol_2 icon_state="polposter2" name = "Safety!" desc = "A blue and white colored poster. This one advises you to wear your safety goggles when handling chemicals." listing_name = "Safety - Goggles" -/datum/poster/nanotrasen/pol_3 +/decl/poster/nanotrasen/pol_3 icon_state="polposter3" name = "Safety!" desc = "A safety poster instructing you to comply with the authorities, especially in an emergency." listing_name = "Safety - Follow Instruction" -/datum/poster/nanotrasen/pol_4 +/decl/poster/nanotrasen/pol_4 icon_state="polposter4" name = "Clean Hands Save Lives" desc = "A safety poster reminding you to wash your hands." listing_name = "Safety - Hand Washing" -/datum/poster/nanotrasen/pol_5 +/decl/poster/nanotrasen/pol_5 icon_state="polposter5" name = "Help!" desc = "This poster depicts a man helping another man get up." listing_name = "Safety - Help Others" -/datum/poster/nanotrasen/pol_6 +/decl/poster/nanotrasen/pol_6 icon_state="polposter6" name = "Walk!" desc = "This poster depicts a man walking, presumably to encourage you not to run in the halls." listing_name = "Safety - No Running" -/datum/poster/nanotrasen/pol_7 +/decl/poster/nanotrasen/pol_7 icon_state="polposter7" name = "Place your signs!" desc = "A safety poster reminding custodial staff to place wet floor signs where needed. This reminder's rarely heeded." listing_name = "Safety - Wet Floor Signs" -/datum/poster/nanotrasen/pol_8 +/decl/poster/nanotrasen/pol_8 icon_state="polposter8" name = "Safety!" desc = "An advertisement / safety poster for EVA training and certification. Training is available at your local Central Command." listing_name = "Safety - EVA Training" -/datum/poster/nanotrasen/pol_9 +/decl/poster/nanotrasen/pol_9 icon_state="poster10" name = "Airlock Maintenance Reference" desc = "This poster appears to be reference material for maintenance personnel, instructing to always wear insulated gloves, that wirecutters and \ @@ -193,97 +193,97 @@ wire codes." listing_name = "Safety - Airlock Maintenance" -/datum/poster/nanotrasen/pol_10 +/decl/poster/nanotrasen/pol_10 icon_state="polposter9" name = "orchid" desc = "This poster suggests a feeling of peace. It depicts the flower of a tree native to the planet Earth." listing_name = "General - Orchid" -/datum/poster/nanotrasen/bay_9 +/decl/poster/nanotrasen/bay_9 icon_state="bsposter9" name = "Pinup Girl Amy" desc = "This particular one is of Amy, the nymphomaniac urban legend of deep space. How this photograph came to be is not known." listing_name = "Pin-up - Amy" -/datum/poster/nanotrasen/bay_21 +/decl/poster/nanotrasen/bay_21 icon_state="bsposter21" name = "Join the Fuzz!" desc = "It's a nice recruitment poster of a white haired Chinese woman that says; \"Big Guns, Hot Women, Good Times. Security. We get it done.\"" listing_name = "Recruitment - NanoTrasen Security - Pinup" -/datum/poster/nanotrasen/bay_22 +/decl/poster/nanotrasen/bay_22 icon_state="bsposter22" name = "Looking for a career with excitement?" desc = "A recruitment poster starring a dark haired woman with glasses and a purple shirt that has \"Got Brains? Got Talent? Not afraid of electric flying monsters that want to suck the soul out of you? Then Xenobiology could use someone like you!\" written on the bottom." listing_name = "Recruitment - Xenobiology" -/datum/poster/nanotrasen/bay_23 +/decl/poster/nanotrasen/bay_23 icon_state="bsposter23" name = "Safety first: because electricity doesn't wait!" desc = "A safety poster starring a clueless looking redhead with frazzled hair. \"Every year, hundreds of NT employees expose themselves to electric shock. Play it safe. Avoid suspicious doors after electrical storms, and always wear protection when doing electric maintenance.\"" listing_name = "Safety - Electric Shock" -/datum/poster/nanotrasen/bay_24 +/decl/poster/nanotrasen/bay_24 icon_state="bsposter24" name = "Responsible medbay habits, No #259" desc = "A poster with a nervous looking geneticist on it states; \"Friends Tell Friends They're Clones. It can cause severe and irreparable emotional trauma if a person is not properly informed of their recent demise. Always follow your contractual obligation and inform them of their recent rejuvenation.\"" listing_name = "Medical - Clone Disclosure" -/datum/poster/nanotrasen/bay_25 +/decl/poster/nanotrasen/bay_25 icon_state="bsposter25" name = "Irresponsible medbay habits, No #2" desc = "This is a safety poster starring a perverted looking naked doctor. \"Sexual harassment is never okay. REPORT any acts of sexual deviance or harassment that disrupt a healthy working environment.\"" listing_name = "Medical - Sexual Harassment" -/datum/poster/nanotrasen/bay_49 +/decl/poster/nanotrasen/bay_49 icon_state="bsposter49" name = "Engineering recruitment" desc = "This is a poster showing an engineer relaxing by a computer, the text states \"Living the life! Join Engineering today!\"" listing_name = "Recruitment - Engineering" -/datum/poster/nanotrasen/bay_52 +/decl/poster/nanotrasen/bay_52 icon_state="bsposter52" name = "fire safety poster" desc = "This is a poster reminding you of what you should do if you are on fire, or if you are at a dance party." listing_name = "Safety - Stop Drop And Roll" -/datum/poster/nanotrasen/bay_53 +/decl/poster/nanotrasen/bay_53 icon_state="bsposter53" name = "fire extinguisher poster" desc = "This is a poster reminding you of what you should use to put out a fire." listing_name = "Safety - Extinguishers" -/datum/poster/nanotrasen/bay_54 +/decl/poster/nanotrasen/bay_54 icon_state="bsposter54" name = "firefighter poster" desc = "This is a poster of a particularly stern looking firefighter. The caption reads, \"Only you can prevent space fires.\"" listing_name = "Safety - Prevent Fires" -/datum/poster/nanotrasen/bay_57 +/decl/poster/nanotrasen/bay_57 icon_state="bsposter57" name = "space carp warning poster" desc = "This poster tells of the dangers of space carp infestations." listing_name = "Safety - Carp" -/datum/poster/nanotrasen/bay_58 +/decl/poster/nanotrasen/bay_58 icon_state="bsposter58" name = "space carp information poster" desc = "This poster showcases an old spacer saying on the dangers of migrant space carp." listing_name = "Safety - Carp Information" -/datum/poster/nanotrasen/nt_1 +/decl/poster/nanotrasen/nt_1 icon_state = "ntposter01" name = "Security recruitment" desc = "This poster showcases an NT security guard in an excited pose, with a small blurb about the importance of Security." listing_name = "Recruitment - NanoTrasen Security - Importance" -/datum/poster/nanotrasen/nt_2 +/decl/poster/nanotrasen/nt_2 icon_state = "ntposter02" name = "Security recruitment" desc = "This poster showcases an NT security guard in an excited pose, with a small blurb about Security Employee benefits." listing_name = "Recruitment - NanoTrasen Security - Benefits" -/datum/poster/nanotrasen/nt_3 +/decl/poster/nanotrasen/nt_3 icon_state = "ntposter03" name = "Mechatronic Safety" desc = "This poster displays three cutting-edge gygaxes standing in line in front of a man in plain clothes.\ @@ -291,25 +291,25 @@ The image seems important." listing_name = "Safety - Mech Operation" -/datum/poster/nanotrasen/nt_4 +/decl/poster/nanotrasen/nt_4 icon_state = "ntposter04" name = "Beware Aetotheans" desc = "This poster displays a distinctly hostile-looking red Promethean in a black coat. The fine-print around the edges warns the reader about the dangers posed by Almachi Prometheans." listing_name = "Safety - Aetothean Danger" -/datum/poster/nanotrasen/nt_5 +/decl/poster/nanotrasen/nt_5 icon_state = "ntposter05" name = "Promethean" desc = "This poster displays a friendly-looking green Promethean in a labcoat. The fine-print around the edges talks about the benefits Prometheans give in laboratories." listing_name = "Safety - Prometheans" -/datum/poster/nanotrasen/nt_6 +/decl/poster/nanotrasen/nt_6 icon_state = "ntposter06" name = "NanoTrasen" desc = "This poster showcases an NT emblem. There is writing in the ring around the inner points, probably some sort of slogan no one bothers to memorize." listing_name = "Ad - NanoTrasen" -/datum/poster/nanotrasen/nt_7 +/decl/poster/nanotrasen/nt_7 icon_state = "ntposter07" name = "SolGov" desc = "This poster showcases an SCG emblem. The outer ring reads,\ @@ -317,13 +317,13 @@ Solar Confederate Government." listing_name = "Political - SolGov" -/datum/poster/nanotrasen/nt_8 +/decl/poster/nanotrasen/nt_8 icon_state = "ntposter08" name = "wildlife hazard" desc = "This poster warns against attempting to kill a fully grown giant spider or other hostile life-form alone." listing_name = "Safety - Spiders" -/datum/poster/nanotrasen/nt_9 +/decl/poster/nanotrasen/nt_9 icon_state = "ntposter09" name = "Regulations and You" desc = "This SifGov poster showcases an NT security guard reading from her PDA. The blurb advocates for the reader to keep corporate regulations in mind at all times, as an emergency can occur at any time." diff --git a/code/game/objects/effects/decals/posters/posters.dm b/code/game/objects/effects/decals/posters/posters.dm new file mode 100644 index 0000000000..8046cf439a --- /dev/null +++ b/code/game/objects/effects/decals/posters/posters.dm @@ -0,0 +1,206 @@ +/proc/get_poster_decl(var/path = null, var/exact = TRUE) + if(ispath(path)) + if(exact) + return decls_repository.get_decl(path) + else + var/list/L = decls_repository.get_decls_of_type(path) + return L[pick(L)] + return null + +/obj/item/poster + name = "rolled-up poster" + desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface." + icon = 'icons/obj/contraband.dmi' + icon_state = "rolled_poster" + drop_sound = 'sound/items/drop/wrapper.ogg' + pickup_sound = 'sound/items/pickup/wrapper.ogg' + force = 0 + var/decl/poster/poster_decl = null + var/poster_type = /obj/structure/sign/poster + +/obj/item/poster/Initialize(var/mapload, var/decl/poster/poster_decl = null) + if(ispath(src.poster_decl)) + src.poster_decl = get_poster_decl(src.poster_decl, TRUE) + else if(istype(poster_decl)) + src.poster_decl = poster_decl + else if(ispath(poster_decl)) + src.poster_decl = get_poster_decl(poster_decl, TRUE) + else + src.poster_decl = get_poster_decl(/decl/poster, FALSE) + + name += " - No. [src.poster_decl.name]" + return ..() + +//Places the poster on a wall +/obj/item/poster/afterattack(var/atom/A, var/mob/user, var/adjacent, var/clickparams) + if(!adjacent) + return FALSE + + //must place on a wall and user must not be inside a closet/mecha/whatever + var/turf/W = A + if(!iswall(W) || !isturf(user.loc)) + to_chat(user, "You can't place this here!") + return FALSE + + var/placement_dir = get_dir(user, W) + if(!(placement_dir in cardinal)) + to_chat(user, "You must stand directly in front of the wall you wish to place that on.") + return FALSE + + //just check if there is a poster on or adjacent to the wall + var/stuff_on_wall = 0 + if(locate(/obj/structure/sign/poster) in W) + stuff_on_wall = 1 + + //crude, but will cover most cases. We could do stuff like check pixel_x/y but it's not really worth it. + for (var/dir in cardinal) + var/turf/T = get_step(W, dir) + if (locate(/obj/structure/sign/poster) in T) + stuff_on_wall = 1 + break + + if(stuff_on_wall) + to_chat(user, "There is already a poster there!") + return FALSE + + to_chat(user, "You start placing the poster on the wall...") //Looks like it's uncluttered enough. Place the poster. + + var/obj/structure/sign/poster/P = new poster_type(user.loc, get_dir(user, W), src) + + if(do_after(user, 17)) //Let's check if everything is still there + to_chat(user, "You place the poster!") + qdel(src) + return TRUE + + P.roll_and_drop(P.loc) + qdel(src) + return FALSE + +//NT subtype +/obj/item/poster/nanotrasen + icon_state = "rolled_poster_nt" + poster_type = /obj/structure/sign/poster/nanotrasen + +/obj/item/poster/nanotrasen/Initialize(turf/loc, var/decl/poster/P = null) + if(!ispath(src.poster_decl) && !ispath(P) && !istype(P)) + src.poster_decl = get_poster_decl(/decl/poster/nanotrasen, FALSE) + return ..() + +//Selectable subtype +/obj/item/poster/custom + name = "rolled-up poly-poster" + desc = "The poster comes with its own automatic adhesive mechanism, for easy pinning to any vertical surface. This one is made from some kind of e-paper, and could display almost anything!" + poster_type = /obj/structure/sign/poster/custom + +/obj/item/poster/custom/verb/select_poster() + set name = "Set Poster type" + set category = "Object" + set desc = "Click to choose a poster to display." + + var/mob/M = usr + var/list/options = list() + for(var/decl/poster/posteroption in decls_repository.get_decls_of_type(/decl/poster)) + options[posteroption.listing_name] = posteroption + + var/choice = input(M,"Choose a poster!","Customize Poster") in options + if(src && choice && !M.stat && in_range(M,src)) + poster_decl = options[choice] + name = "rolled-up poly-poster - No.[poster_decl.icon_state]" + to_chat(M, "The poster is now: [choice].") + + + +//############################## THE ACTUAL DECALS ########################### + +/obj/structure/sign/poster + name = "poster" + desc = "A large piece of space-resistant printed paper. " + icon = 'icons/obj/contraband.dmi' + anchored = 1 + var/decl/poster/poster_decl = null + var/target_poster_decl_path = /decl/poster + var/roll_type = /obj/item/poster + var/ruined = FALSE + +// This stuff needs to go in new() for the the flick() to look right while it's being placed +/obj/structure/sign/poster/New(var/newloc, var/placement_dir = null, var/obj/item/poster/P = null) + if(placement_dir) + dir = placement_dir + + switch (dir) + if (NORTH) + pixel_x = 0 + pixel_y = 32 + if (SOUTH) + pixel_x = 0 + pixel_y = -32 + if (EAST) + pixel_x = 32 + pixel_y = 0 + if (WEST) + pixel_x = -32 + pixel_y = 0 + + flick("poster_being_set", src) + return ..() + + +/obj/structure/sign/poster/Initialize(var/newloc, var/placement_dir = null, var/obj/item/poster/P = null) + if(ispath(src.poster_decl)) + src.poster_decl = get_poster_decl(src.poster_decl, TRUE) + else if(istype(P)) + src.poster_decl = P.poster_decl + roll_type = P.type + else if(ispath(P)) + src.poster_decl = get_poster_decl(P, TRUE) + else + src.poster_decl = get_poster_decl(target_poster_decl_path, FALSE) + + name = "[initial(name)] - [poster_decl.name]" + desc = "[initial(desc)] [poster_decl.desc]" + icon_state = poster_decl.icon_state + + return ..() + +/obj/structure/sign/poster/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(W.is_wirecutter()) + playsound(src, W.usesound, 100, 1) + if(ruined) + to_chat(user, "You remove the remnants of the poster.") + qdel(src) + else + to_chat(user, "You carefully remove the poster from the wall.") + roll_and_drop(get_turf(user)) + return + +/obj/structure/sign/poster/attack_hand(mob/user as mob) + + if(ruined) + return + + if(alert("Do I want to rip the poster from the wall?","You think...","Yes","No") == "Yes") + + if(ruined || !user.Adjacent(src)) + return + + visible_message("[user] rips [src] in a single, decisive motion!" ) + playsound(src, 'sound/items/poster_ripped.ogg', 100, 1) + ruined = TRUE + icon_state = "poster_ripped" + name = "ripped poster" + desc = "You can't make out anything from the poster's original print. It's ruined." + add_fingerprint(user) + +/obj/structure/sign/poster/proc/roll_and_drop(turf/newloc) + var/obj/item/poster/P = new roll_type(newloc, poster_decl) + P.loc = newloc + qdel(src) + +// NT poster subtype. +/obj/structure/sign/poster/nanotrasen + roll_type = /obj/item/poster/nanotrasen + target_poster_decl_path = /decl/poster/nanotrasen + +// Non-Random Posters +/obj/structure/sign/poster/custom + roll_type = /obj/item/poster/custom \ No newline at end of file diff --git a/code/game/objects/effects/decals/posters/tgposters.dm b/code/game/objects/effects/decals/posters/tgposters.dm index 50d615efa0..c1800fe40f 100644 --- a/code/game/objects/effects/decals/posters/tgposters.dm +++ b/code/game/objects/effects/decals/posters/tgposters.dm @@ -1,50 +1,50 @@ // /tg/ posters. -/datum/poster/tg_1 +/decl/poster/tg_1 name = "Free Tonto" desc = "A framed shred of a much larger flag, colors bled together and faded from age." icon_state="poster1" -/datum/poster/tg_2 +/decl/poster/tg_2 name = "Atmosia Declaration of Independence" desc = "A relic of a failed rebellion" icon_state="poster2" -/datum/poster/tg_3 +/decl/poster/tg_3 name = "Fun Police" desc = "A poster condemning the station's security forces." icon_state="poster3" -/datum/poster/tg_4 +/decl/poster/tg_4 name = "Lusty Xeno" desc = "A heretical poster depicting the titular star of an equally heretical book." icon_state="poster4" -/datum/poster/tg_5 +/decl/poster/tg_5 name = "Mercenary Recruitment Poster" desc = "See the galaxy! Shatter corrupt megacorporations! Join today!" icon_state="poster5" -/datum/poster/tg_6 +/decl/poster/tg_6 name = "Clown" desc = "Honk." icon_state="poster6" -/datum/poster/tg_7 +/decl/poster/tg_7 name = "Smoke" desc = "A poster depicting a carton of cigarettes." icon_state="poster7" -/datum/poster/tg_8 +/decl/poster/tg_8 name = "Grey Tide" desc = "A rebellious poster symbolizing assistant solidarity." icon_state="poster8" -/datum/poster/tg_9 +/decl/poster/tg_9 name = "Missing Gloves" desc = "This poster is about the uproar that followed NanoTrasen's financial cuts towards insulated-glove purchases." icon_state="poster9" -/datum/poster/tg_10 +/decl/poster/tg_10 name = "Hacking Guide" desc = "This poster details the internal workings of the common NanoTrasen airlock." icon_state="poster10" \ 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 0ec3f40036..ff95105356 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -20,22 +20,22 @@ would spawn and follow the beaker, even if it is carried or thrown. var/atom/holder var/setup = 0 - proc/set_up(n = 3, c = 0, turf/loc) - if(n > 10) - n = 10 - number = n - cardinals = c - location = loc - setup = 1 +/datum/effect/effect/system/proc/set_up(n = 3, c = 0, turf/loc) + if(n > 10) + n = 10 + number = n + cardinals = c + location = loc + setup = 1 - proc/attach(atom/atom) - holder = atom +/datum/effect/effect/system/proc/attach(atom/atom) + holder = atom - proc/start() +/datum/effect/effect/system/proc/start() - Destroy() - holder = null - return ..() +/datum/effect/effect/system/Destroy() + holder = null + return ..() ///////////////////////////////////////////// // GENERIC STEAM SPREAD SYSTEM @@ -58,32 +58,30 @@ steam.start() -- spawns the effect icon_state = "extinguish" density = 0 -/datum/effect/effect/system/steam_spread +/datum/effect/effect/system/steam_spread/set_up(n = 3, c = 0, turf/loc) + if(n > 10) + n = 10 + number = n + cardinals = c + location = loc - set_up(n = 3, c = 0, turf/loc) - if(n > 10) - n = 10 - number = n - cardinals = c - location = loc - - start() - var/i = 0 - for(i=0, i 10) - n = 10 - number = n - cardinals = c - if(istype(loca, /turf/)) - location = loca - else - location = get_turf(loca) +/datum/effect/effect/system/spark_spread/set_up(n = 3, c = 0, loca) + if(n > 10) + n = 10 + number = n + cardinals = c + if(istype(loca, /turf/)) + location = loca + else + location = get_turf(loca) - start() - var/i = 0 - for(i=0, i 20) - return - spawn(0) - if(holder) - src.location = get_turf(holder) - var/obj/effect/effect/sparks/sparks = new /obj/effect/effect/sparks(src.location) - src.total_sparks++ - var/direction - if(src.cardinals) - direction = pick(cardinal) - else - direction = pick(alldirs) - for(i=0, i 20) + return + spawn(0) + if(holder) + src.location = get_turf(holder) + var/obj/effect/effect/sparks/sparks = new /obj/effect/effect/sparks(src.location) + src.total_sparks++ + var/direction + if(src.cardinals) + direction = pick(cardinal) + else + direction = pick(alldirs) + for(i=0, iThe solution violently explodes.") + for(var/mob/M in viewers(1, location)) + if (prob (50 * amount)) + to_chat(M, "The explosion knocks you down.") + M.Weaken(rand(1,5)) return + else + var/devst = -1 + var/heavy = -1 + var/light = -1 + var/flash = -1 - start() - if (amount <= 2) - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread() - s.set_up(2, 1, location) - s.start() + // Clamp all values to fractions of max_explosion_range, following the same pattern as for tank transfer bombs + if (round(amount/12) > 0) + devst = devst + amount/12 - for(var/mob/M in viewers(5, location)) - to_chat(M, "The solution violently explodes.") - for(var/mob/M in viewers(1, location)) - if (prob (50 * amount)) - to_chat(M, "The explosion knocks you down.") - M.Weaken(rand(1,5)) - return - else - var/devst = -1 - var/heavy = -1 - var/light = -1 - var/flash = -1 + if (round(amount/6) > 0) + heavy = heavy + amount/6 - // Clamp all values to fractions of max_explosion_range, following the same pattern as for tank transfer bombs - if (round(amount/12) > 0) - devst = devst + amount/12 + if (round(amount/3) > 0) + light = light + amount/3 - if (round(amount/6) > 0) - heavy = heavy + amount/6 + if (flashing && flashing_factor) + flash = (amount/4) * flashing_factor - if (round(amount/3) > 0) - light = light + amount/3 + for(var/mob/M in viewers(8, location)) + to_chat(M, "The solution violently explodes.") - if (flashing && flashing_factor) - flash = (amount/4) * flashing_factor - - for(var/mob/M in viewers(8, location)) - to_chat(M, "The solution violently explodes.") - - explosion( - location, - round(min(devst, BOMBCAP_DVSTN_RADIUS)), - round(min(heavy, BOMBCAP_HEAVY_RADIUS)), - round(min(light, BOMBCAP_LIGHT_RADIUS)), - round(min(flash, BOMBCAP_FLASH_RADIUS)) - ) + explosion( + location, + round(min(devst, BOMBCAP_DVSTN_RADIUS)), + round(min(heavy, BOMBCAP_HEAVY_RADIUS)), + round(min(light, BOMBCAP_LIGHT_RADIUS)), + round(min(flash, BOMBCAP_FLASH_RADIUS)) + ) diff --git a/code/game/objects/effects/gibs.dm b/code/game/objects/effects/gibs.dm index e33da567f3..717bcac74e 100644 --- a/code/game/objects/effects/gibs.dm +++ b/code/game/objects/effects/gibs.dm @@ -9,47 +9,47 @@ var/fleshcolor //Used for gibbed humans. var/bloodcolor //Used for gibbed humans. - New(location, var/datum/dna/MobDNA, var/fleshcolor, var/bloodcolor) - ..() +/obj/effect/gibspawner/New(location, var/datum/dna/MobDNA, var/fleshcolor, var/bloodcolor) + ..() - if(fleshcolor) src.fleshcolor = fleshcolor - if(bloodcolor) src.bloodcolor = bloodcolor - Gib(loc,MobDNA) + if(fleshcolor) src.fleshcolor = fleshcolor + if(bloodcolor) src.bloodcolor = bloodcolor + Gib(loc,MobDNA) - proc/Gib(atom/location, var/datum/dna/MobDNA = null) - if(gibtypes.len != gibamounts.len || gibamounts.len != gibdirections.len) - to_world("Gib list length mismatch!") - return +/obj/effect/gibspawner/proc/Gib(atom/location, var/datum/dna/MobDNA = null) + if(gibtypes.len != gibamounts.len || gibamounts.len != gibdirections.len) + to_world("Gib list length mismatch!") + return - var/obj/effect/decal/cleanable/blood/gibs/gib = null + var/obj/effect/decal/cleanable/blood/gibs/gib = null - if(sparks) - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread() - s.set_up(2, 1, get_turf(location)) // Not sure if it's safe to pass an arbitrary object to set_up, todo - s.start() + if(sparks) + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread() + s.set_up(2, 1, get_turf(location)) // Not sure if it's safe to pass an arbitrary object to set_up, todo + s.start() - for(var/i = 1, i<= gibtypes.len, i++) - if(gibamounts[i]) - for(var/j = 1, j<= gibamounts[i], j++) - var/gibType = gibtypes[i] - gib = new gibType(location) + for(var/i = 1, i<= gibtypes.len, i++) + if(gibamounts[i]) + for(var/j = 1, j<= gibamounts[i], j++) + var/gibType = gibtypes[i] + gib = new gibType(location) - // Apply human species colouration to masks. - if(fleshcolor) - gib.fleshcolor = fleshcolor - if(bloodcolor) - gib.basecolor = bloodcolor + // Apply human species colouration to masks. + if(fleshcolor) + gib.fleshcolor = fleshcolor + if(bloodcolor) + gib.basecolor = bloodcolor - gib.update_icon() + gib.update_icon() - gib.blood_DNA = list() - if(MobDNA) - gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.b_type - else if(istype(src, /obj/effect/gibspawner/human)) // Probably a monkey - gib.blood_DNA["Non-human DNA"] = "A+" - if(istype(location,/turf/)) - var/list/directions = gibdirections[i] - if(directions.len) - gib.streak(directions) + gib.blood_DNA = list() + if(MobDNA) + gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.b_type + else if(istype(src, /obj/effect/gibspawner/human)) // Probably a monkey + gib.blood_DNA["Non-human DNA"] = "A+" + if(istype(location,/turf/)) + var/list/directions = gibdirections[i] + if(directions.len) + gib.streak(directions) - qdel(src) + qdel(src) diff --git a/code/game/objects/effects/map_effects/portal.dm b/code/game/objects/effects/map_effects/portal.dm index 2e3b101d3b..183d66252c 100644 --- a/code/game/objects/effects/map_effects/portal.dm +++ b/code/game/objects/effects/map_effects/portal.dm @@ -277,7 +277,8 @@ when portals are shortly lived, or when portals are made to be obvious with spec for(var/thing in mobs_to_relay) var/mob/mob = thing - var/message = mob.combine_message(message_pieces, verb, M) + var/list/combined = mob.combine_message(message_pieces, verb, M) + var/message = combined["formatted"] var/name_used = M.GetVoice() var/rendered = null rendered = "[name_used] [message]" diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 60396e1082..e32d951a99 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -8,9 +8,10 @@ icon='icons/effects/beam.dmi' icon_state="b_beam" var/tmp/atom/BeamSource - New() - ..() - spawn(10) qdel(src) + +/obj/effect/overlay/beam/New() + ..() + spawn(10) qdel(src) /obj/effect/overlay/palmtree_r name = "Palm tree" diff --git a/code/game/objects/effects/spawners/gibspawner.dm b/code/game/objects/effects/spawners/gibspawner.dm index b145b77ed2..af84a15d42 100644 --- a/code/game/objects/effects/spawners/gibspawner.dm +++ b/code/game/objects/effects/spawners/gibspawner.dm @@ -1,27 +1,26 @@ -/obj/effect/gibspawner - generic - gibtypes = list(/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs/core) - gibamounts = list(2,2,1) +/obj/effect/gibspawner/generic + gibtypes = list(/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs/core) + gibamounts = list(2,2,1) - New() - gibdirections = list(list(WEST, NORTHWEST, SOUTHWEST, NORTH),list(EAST, NORTHEAST, SOUTHEAST, SOUTH), list()) - ..() +/obj/effect/gibspawner/generic/New() + gibdirections = list(list(WEST, NORTHWEST, SOUTHWEST, NORTH),list(EAST, NORTHEAST, SOUTHEAST, SOUTH), list()) + ..() - human - gibtypes = list(/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs/down,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs/core) - gibamounts = list(1,1,1,1,1,1,1) +/obj/effect/gibspawner/human + gibtypes = list(/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs/down,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs,/obj/effect/decal/cleanable/blood/gibs/core) + gibamounts = list(1,1,1,1,1,1,1) - New() - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list()) - gibamounts[6] = pick(0,1,2) - ..() +/obj/effect/gibspawner/human/New() + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list()) + gibamounts[6] = pick(0,1,2) + ..() - robot - sparks = 1 - gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/robot/up,/obj/effect/decal/cleanable/blood/gibs/robot/down,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot/limb) - gibamounts = list(1,1,1,1,1,1) +/obj/effect/gibspawner/robot + sparks = 1 + gibtypes = list(/obj/effect/decal/cleanable/blood/gibs/robot/up,/obj/effect/decal/cleanable/blood/gibs/robot/down,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot,/obj/effect/decal/cleanable/blood/gibs/robot/limb) + gibamounts = list(1,1,1,1,1,1) - New() - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs) - gibamounts[6] = pick(0,1,2) - ..() \ No newline at end of file +/obj/effect/gibspawner/robot/New() + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs) + gibamounts[6] = pick(0,1,2) + ..() \ No newline at end of file diff --git a/code/game/objects/effects/spawners/graffiti.dm b/code/game/objects/effects/spawners/graffiti.dm new file mode 100644 index 0000000000..afac11f4f1 --- /dev/null +++ b/code/game/objects/effects/spawners/graffiti.dm @@ -0,0 +1,28 @@ +/obj/effect/graffitispawner + name = "old scrawling" + icon = 'icons/effects/map_effects.dmi' + icon_state = "graffiti" + + var/graffiti_type // The text string for the desired icon state of your graffiti. + + // If the effect's color is not set, it will be chosen at random. + var/color_secondary // The hexcode for the desired secondary color of your graffiti. If blank, it will inherit this effect's color. + +/obj/effect/graffitispawner/Initialize() + ..() + + if(!color) + color = rgb(rand(1,255),rand(1,255),rand(1,255)) + + if(!color_secondary) + color_secondary = color + + if(!graffiti_type) + graffiti_type = pick("rune", "graffiti", "left", "right", "up", "down") + + var/turf/T = get_turf(src) + var/obj/effect/decal/cleanable/crayon/C = new(T, color, color_secondary, graffiti_type) + + C.name = name + + qdel(src) diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 70e42a72a7..3cebb3082b 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -33,57 +33,57 @@ var/nostop = 0 // if 1: will only be stopped by teleporters var/list/affecting = list() - Trigger(var/atom/A) - if(!A || !istype(A, /atom/movable)) +/obj/effect/step_trigger/thrower/Trigger(var/atom/A) + if(!A || !istype(A, /atom/movable)) + return + var/atom/movable/AM = A + var/curtiles = 0 + var/stopthrow = 0 + for(var/obj/effect/step_trigger/thrower/T in orange(2, src)) + if(AM in T.affecting) return - var/atom/movable/AM = A - var/curtiles = 0 - var/stopthrow = 0 - for(var/obj/effect/step_trigger/thrower/T in orange(2, src)) - if(AM in T.affecting) - return - if(ismob(AM)) - var/mob/M = AM - if(immobilize) - M.canmove = 0 + if(ismob(AM)) + var/mob/M = AM + if(immobilize) + M.canmove = 0 - affecting.Add(AM) - while(AM && !stopthrow) - if(tiles) - if(curtiles >= tiles) - break - if(AM.z != src.z) + affecting.Add(AM) + while(AM && !stopthrow) + if(tiles) + if(curtiles >= tiles) break + if(AM.z != src.z) + break - curtiles++ + curtiles++ - sleep(speed) + sleep(speed) - // Calculate if we should stop the process - if(!nostop) - for(var/obj/effect/step_trigger/T in get_step(AM, direction)) - if(T.stopper && T != src) - stopthrow = 1 - else - for(var/obj/effect/step_trigger/teleporter/T in get_step(AM, direction)) - if(T.stopper) - stopthrow = 1 + // Calculate if we should stop the process + if(!nostop) + for(var/obj/effect/step_trigger/T in get_step(AM, direction)) + if(T.stopper && T != src) + stopthrow = 1 + else + for(var/obj/effect/step_trigger/teleporter/T in get_step(AM, direction)) + if(T.stopper) + stopthrow = 1 - if(AM) - var/predir = AM.dir - step(AM, direction) - if(!facedir) - AM.set_dir(predir) + if(AM) + var/predir = AM.dir + step(AM, direction) + if(!facedir) + AM.set_dir(predir) - affecting.Remove(AM) + affecting.Remove(AM) - if(ismob(AM)) - var/mob/M = AM - if(immobilize) - M.canmove = 1 + if(ismob(AM)) + var/mob/M = AM + if(immobilize) + M.canmove = 1 /* Stops things thrown by a thrower, doesn't do anything */ @@ -154,11 +154,11 @@ var/teleport_y_offset = 0 var/teleport_z_offset = 0 - Trigger(var/atom/movable/A) - if(teleport_x && teleport_y && teleport_z) - if(teleport_x_offset && teleport_y_offset && teleport_z_offset) - var/turf/T = locate(rand(teleport_x, teleport_x_offset), rand(teleport_y, teleport_y_offset), rand(teleport_z, teleport_z_offset)) - A.forceMove(T) +/obj/effect/step_trigger/teleporter/random/Trigger(var/atom/movable/A) + if(teleport_x && teleport_y && teleport_z) + if(teleport_x_offset && teleport_y_offset && teleport_z_offset) + var/turf/T = locate(rand(teleport_x, teleport_x_offset), rand(teleport_y, teleport_y_offset), rand(teleport_z, teleport_z_offset)) + A.forceMove(T) /* Teleporter that sends objects stepping on it to a specific landmark. */ diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index 3d97946bd4..3c5afc9715 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -4,7 +4,7 @@ // #define EMPDEBUG 10 -proc/empulse(turf/epicenter, first_range, second_range, third_range, fourth_range, log=0) +/proc/empulse(turf/epicenter, first_range, second_range, third_range, fourth_range, log=0) if(!epicenter) return if(!istype(epicenter, /turf)) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index ac09fc6570..659db0ca01 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -1,6 +1,6 @@ //TODO: Flash range does nothing currently -proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = UP|DOWN, shaped) +/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = UP|DOWN, shaped) var/multi_z_scalar = config.multi_z_explosion_scalar spawn(0) var/start = world.timeofday @@ -107,6 +107,6 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa defer_powernet_rebuild = 0 return 1 -proc/secondaryexplosion(turf/epicenter, range) +/proc/secondaryexplosion(turf/epicenter, range) for(var/turf/tile in range(range, epicenter)) tile.ex_act(2) diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 191fb01d47..400820f49f 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -13,7 +13,7 @@ var/list/explosion_turfs = list() var/explosion_in_progress = 0 -proc/explosion_rec(turf/epicenter, power) +/proc/explosion_rec(turf/epicenter, power) var/loopbreak = 0 while(explosion_in_progress) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 4432229b6d..966a48141b 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -269,6 +269,7 @@ R.hud_used.update_robot_modules_display() /obj/item/attackby(obj/item/weapon/W as obj, mob/user as mob) + . = ..() if(istype(W, /obj/item/weapon/storage)) var/obj/item/weapon/storage/S = W if(S.use_to_pickup) diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index b49ee7a70f..2c045e1e87 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -7,26 +7,17 @@ icon_state = "bodybag_folded" w_class = ITEMSIZE_SMALL - attack_self(mob/user) - var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc) - R.add_fingerprint(user) - qdel(src) +/obj/item/bodybag/attack_self(mob/user) + var/obj/structure/closet/body_bag/R = new /obj/structure/closet/body_bag(user.loc) + R.add_fingerprint(user) + qdel(src) /obj/item/weapon/storage/box/bodybags name = "body bags" desc = "This box contains body bags." icon_state = "bodybags" - New() - ..() - new /obj/item/bodybag(src) - new /obj/item/bodybag(src) - new /obj/item/bodybag(src) - new /obj/item/bodybag(src) - new /obj/item/bodybag(src) - new /obj/item/bodybag(src) - new /obj/item/bodybag(src) - + starts_with = list(/obj/item/bodybag = 7) /obj/structure/closet/body_bag name = "body bag" diff --git a/code/game/objects/items/devices/communicator/messaging.dm b/code/game/objects/items/devices/communicator/messaging.dm index 2b4e0bcdd4..4fb1474750 100644 --- a/code/game/objects/items/devices/communicator/messaging.dm +++ b/code/game/objects/items/devices/communicator/messaging.dm @@ -134,7 +134,7 @@ if(choice) var/obj/item/device/communicator/chosen_communicator = choice var/mob/observer/dead/O = src - var/text_message = sanitize(input(src, "What do you want the message to say?")) as message + var/text_message = sanitize(input(src, "What do you want the message to say?") as message) if(text_message && O.exonet) O.exonet.send_message(chosen_communicator.exonet.address, "text", text_message) diff --git a/code/game/objects/items/devices/communicator/phone.dm b/code/game/objects/items/devices/communicator/phone.dm index 3f13df8825..95d1a58174 100644 --- a/code/game/objects/items/devices/communicator/phone.dm +++ b/code/game/objects/items/devices/communicator/phone.dm @@ -232,7 +232,8 @@ var/list/mobs_to_relay = in_range["mobs"] for(var/mob/mob in mobs_to_relay) - var/message = mob.combine_message(message_pieces, verb, M) + var/list/combined = mob.combine_message(message_pieces, verb, M) + var/message = combined["formatted"] var/name_used = M.GetVoice() var/rendered = null rendered = "[bicon(src)] [name_used] [message]" diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index 2a8af751e0..f2e971d90e 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -454,7 +454,7 @@ return playsound(src, 'sound/machines/defib_charge.ogg', 50, 0) - audible_message("\The [src] lets out a steadily rising hum...") + audible_message("\The [src] lets out a steadily rising hum...", runemessage = "whines") if(!do_after(user, chargetime, H)) return @@ -521,7 +521,7 @@ H.setBrainLoss(brain_damage) /obj/item/weapon/shockpaddles/proc/make_announcement(var/message, var/msg_class) - audible_message("\The [src] [message]", "\The [src] vibrates slightly.") + audible_message("\The [src] [message]", "\The [src] vibrates slightly.", runemessage = "buzz") /obj/item/weapon/shockpaddles/emag_act(mob/user) if(safety) diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index 32c9d75959..86602094c1 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -31,12 +31,13 @@ /obj/item/device/megaphone/proc/do_broadcast(var/mob/living/user, var/message) if(emagged) if(insults) - user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[pick(insultmsg)]\"") + var/insult = pick(insultmsg) + user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[insult]\"", runemessage = insult) insults-- else to_chat(user, "*BZZZZzzzzzt*") else - user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[message]\"") + user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[message]\"", runemessage = message) /obj/item/device/megaphone/attack_self(var/mob/living/user) var/message = sanitize(input(user, "Shout a message?", "Megaphone", null) as text) @@ -131,7 +132,8 @@ /obj/item/device/megaphone/super/do_broadcast(var/mob/living/user, var/message) if(emagged) if(insults) - user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[pick(insultmsg)]\"") + var/insult = pick(insultmsg) + user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[insult]\"", runemessage = insult) if(broadcast_size >= 11) var/turf/T = get_turf(user) playsound(src, 'sound/items/AirHorn.ogg', 100, 1) @@ -160,4 +162,4 @@ qdel(src) return else - user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[message]\"") + user.audible_message("[user.GetVoice()][user.GetAltName()] broadcasts, \"[message]\"", runemessage = message) diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index 837c6616f7..18fc293542 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -29,6 +29,7 @@ var/obj/machinery/connectable //Used to connect machinery. var/weakref_wiring //Used to store weak references for integrated circuitry. This is now the Omnitool. toolspeed = 1 + tool_qualities = list(TOOL_MULTITOOL) /obj/item/device/multitool/attack_self(mob/living/user) var/choice = alert("What do you want to do with \the [src]?","Multitool Menu", "Switch Mode", "Clear Buffers", "Cancel") diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index d49de71ae1..cbd9586630 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -28,13 +28,6 @@ GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/device/radio/beacon) src.add_fingerprint(usr) return - -/obj/item/device/radio/beacon/bacon //Probably a better way of doing this, I'm lazy. - proc/digest_delay() - spawn(600) - qdel(src) - - // SINGULO BEACON SPAWNER /obj/item/device/radio/beacon/syndicate diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 88a040de46..6f8e1c0229 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -148,7 +148,7 @@ var/global/list/default_medbay_channels = list( return tgui_interact(user) -/obj/item/device/radio/ui_interact(mob/user, ui_key, datum/nanoui/ui, force_open, datum/nano_ui/master_ui, datum/topic_state/state) +/obj/item/device/radio/ui_interact(mob/user, ui_key, datum/nanoui/ui, force_open, datum/nanoui/master_ui, datum/topic_state/state) log_runtime(EXCEPTION("Warning: [user] attempted to call ui_interact on radio [src] [type]. This is deprecated. Please update the caller to tgui_interact.")) /obj/item/device/radio/Topic(href, href_list) diff --git a/code/game/objects/items/devices/taperecorder.dm b/code/game/objects/items/devices/taperecorder.dm index bdb35fb643..4e5032b6b9 100644 --- a/code/game/objects/items/devices/taperecorder.dm +++ b/code/game/objects/items/devices/taperecorder.dm @@ -258,13 +258,13 @@ var/playedmessage = mytape.storedinfo[i] if (findtextEx(playedmessage,"*",1,2)) //remove marker for action sounds playedmessage = copytext(playedmessage,2) - T.audible_message("Tape Recorder: [playedmessage]") + T.audible_message("Tape Recorder: [playedmessage]", runemessage = playedmessage) if(mytape.storedinfo.len < i+1) playsleepseconds = 1 sleep(10) T = get_turf(src) - T.audible_message("Tape Recorder: End of recording.") + T.audible_message("Tape Recorder: End of recording.", runemessage = "click") break else playsleepseconds = mytape.timestamp[i+1] - mytape.timestamp[i] @@ -272,7 +272,7 @@ if(playsleepseconds > 14) sleep(10) T = get_turf(src) - T.audible_message("Tape Recorder: Skipping [playsleepseconds] seconds of silence") + T.audible_message("Tape Recorder: Skipping [playsleepseconds] seconds of silence", runemessage = "tape winding") playsleepseconds = 1 sleep(10 * playsleepseconds) @@ -282,7 +282,7 @@ if(emagged) var/turf/T = get_turf(src) - T.audible_message("Tape Recorder: This tape recorder will self-destruct in... Five.") + T.audible_message("Tape Recorder: This tape recorder will self-destruct in... Five.", runemessage = "beep beep") sleep(10) T = get_turf(src) T.audible_message("Tape Recorder: Four.") diff --git a/code/game/objects/items/devices/text_to_speech.dm b/code/game/objects/items/devices/text_to_speech.dm index f3feacd86e..e962124022 100644 --- a/code/game/objects/items/devices/text_to_speech.dm +++ b/code/game/objects/items/devices/text_to_speech.dm @@ -24,5 +24,6 @@ var/message = sanitize(input(user,"Choose a message to relay to those around you.") as text|null) if(message) - var/obj/item/device/text_to_speech/O = src - audible_message("[bicon(O)] \The [O.name] states, \"[message]\"") + audible_message("[bicon(src)] \The [src.name] states, \"[message]\"", runemessage = "synthesized speech") + if(ismob(loc)) + loc.audible_message("", runemessage = "\[TTS Voice\] [message]") diff --git a/code/game/objects/items/devices/whistle.dm b/code/game/objects/items/devices/whistle.dm index cf8cebeec1..54ed540475 100644 --- a/code/game/objects/items/devices/whistle.dm +++ b/code/game/objects/items/devices/whistle.dm @@ -33,12 +33,12 @@ if(isnull(insults)) playsound(src, 'sound/voice/halt.ogg', 100, 1, vary = 0) - user.audible_message("[user]'s [name] rasps, \"[use_message]\"", "\The [user] holds up \the [name].") + user.audible_message("[user]'s [name] rasps, \"[use_message]\"", "\The [user] holds up \the [name].", runemessage = "\[TTS Voice\] [use_message]") else if(insults > 0) playsound(src, 'sound/voice/binsult.ogg', 100, 1, vary = 0) // Yes, it used to show the transcription of the sound clip. That was a) inaccurate b) immature as shit. - user.audible_message("[user]'s [name] gurgles something indecipherable and deeply offensive.", "\The [user] holds up \the [name].") + user.audible_message("[user]'s [name] gurgles something indecipherable and deeply offensive.", "\The [user] holds up \the [name].", runemessage = "\[TTS Voice\] #&@&^%(*") insults-- else to_chat(user, "*BZZZZZZZZT*") diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 6c1afb2c83..06b0e9edce 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -67,10 +67,10 @@ icon_state = "healthhud" icon = 'icons/obj/clothing/glasses.dmi' - New() - ..() - hud = new /obj/item/clothing/glasses/hud/health(src) - return +/obj/item/borg/sight/hud/med/New() + ..() + hud = new /obj/item/clothing/glasses/hud/health(src) + return /obj/item/borg/sight/hud/sec @@ -78,7 +78,7 @@ icon_state = "securityhud" icon = 'icons/obj/clothing/glasses.dmi' - New() - ..() - hud = new /obj/item/clothing/glasses/hud/security(src) - return +/obj/item/borg/sight/hud/sec/New() + ..() + hud = new /obj/item/clothing/glasses/hud/security(src) + return diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm index 982236f43c..60194ee2c5 100644 --- a/code/game/objects/items/shooting_range.dm +++ b/code/game/objects/items/shooting_range.dm @@ -9,75 +9,75 @@ var/icon/virtualIcon var/list/bulletholes = list() - Destroy() - // if a target is deleted and associated with a stake, force stake to forget - for(var/obj/structure/target_stake/T in view(3,src)) - if(T.pinned_target == src) - T.pinned_target = null - T.density = 1 - break - ..() // delete target +/obj/item/target/Destroy() + // if a target is deleted and associated with a stake, force stake to forget + for(var/obj/structure/target_stake/T in view(3,src)) + if(T.pinned_target == src) + T.pinned_target = null + T.density = 1 + break + ..() // delete target - Moved(atom/old_loc, direction, forced = FALSE) - . = ..() - // After target moves, check for nearby stakes. If associated, move to target - for(var/obj/structure/target_stake/M in view(3,src)) - if(M.density == 0 && M.pinned_target == src) - M.forceMove(loc) +/obj/item/target/Moved(atom/old_loc, direction, forced = FALSE) + . = ..() + // After target moves, check for nearby stakes. If associated, move to target + for(var/obj/structure/target_stake/M in view(3,src)) + if(M.density == 0 && M.pinned_target == src) + M.forceMove(loc) - // This may seem a little counter-intuitive but I assure you that's for a purpose. - // Stakes are the ones that carry targets, yes, but in the stake code we set - // a stake's density to 0 meaning it can't be pushed anymore. Instead of pushing - // the stake now, we have to push the target. + // This may seem a little counter-intuitive but I assure you that's for a purpose. + // Stakes are the ones that carry targets, yes, but in the stake code we set + // a stake's density to 0 meaning it can't be pushed anymore. Instead of pushing + // the stake now, we have to push the target. - attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W - if(WT.remove_fuel(0, user)) - overlays.Cut() - to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.") - return +/obj/item/target/attackby(obj/item/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if(WT.remove_fuel(0, user)) + overlays.Cut() + to_chat(usr, "You slice off [src]'s uneven chunks of aluminum and scorch marks.") + return - attack_hand(mob/user as mob) - // taking pinned targets off! - var/obj/structure/target_stake/stake - for(var/obj/structure/target_stake/T in view(3,src)) - if(T.pinned_target == src) - stake = T - break +/obj/item/target/attack_hand(mob/user as mob) + // taking pinned targets off! + var/obj/structure/target_stake/stake + for(var/obj/structure/target_stake/T in view(3,src)) + if(T.pinned_target == src) + stake = T + break - if(stake) - if(stake.pinned_target) - stake.density = 1 - density = 0 - layer = OBJ_LAYER + if(stake) + if(stake.pinned_target) + stake.density = 1 + density = 0 + layer = OBJ_LAYER - loc = user.loc - if(ishuman(user)) - if(!user.get_active_hand()) - user.put_in_hands(src) - to_chat(user, "You take the target out of the stake.") - else - src.loc = get_turf(user) + loc = user.loc + if(ishuman(user)) + if(!user.get_active_hand()) + user.put_in_hands(src) to_chat(user, "You take the target out of the stake.") + else + src.loc = get_turf(user) + to_chat(user, "You take the target out of the stake.") - stake.pinned_target = null - return + stake.pinned_target = null + return - else - ..() + else + ..() - syndicate - icon_state = "target_s" - desc = "A shooting target that looks like a hostile agent." - hp = 2600 // i guess syndie targets are sturdier? - alien - icon_state = "target_q" - desc = "A shooting target with a threatening silhouette." - hp = 2350 // alium onest too kinda +/obj/item/target/syndicate + icon_state = "target_s" + desc = "A shooting target that looks like a hostile agent." + hp = 2600 // i guess syndie targets are sturdier? +/obj/item/target/alien + icon_state = "target_q" + desc = "A shooting target with a threatening silhouette." + hp = 2350 // alium onest too kinda /obj/item/target/bullet_act(var/obj/item/projectile/Proj) var/p_x = Proj.p_x + pick(0,0,0,0,0,-1,1) // really ugly way of coding "sometimes offset Proj.p_x!" @@ -160,21 +160,21 @@ var/b2y1 = 0 var/b2y2 = 0 - New(var/obj/item/target/Target, var/pixel_x = 0, var/pixel_y = 0) - if(!Target) return +/datum/bullethole/New(var/obj/item/target/Target, var/pixel_x = 0, var/pixel_y = 0) + if(!Target) return - // Randomize the first box - b1x1 = pixel_x - pick(1,1,1,1,2,2,3,3,4) - b1x2 = pixel_x + pick(1,1,1,1,2,2,3,3,4) - b1y = pixel_y - if(prob(35)) - b1y += rand(-4,4) + // Randomize the first box + b1x1 = pixel_x - pick(1,1,1,1,2,2,3,3,4) + b1x2 = pixel_x + pick(1,1,1,1,2,2,3,3,4) + b1y = pixel_y + if(prob(35)) + b1y += rand(-4,4) - // Randomize the second box - b2x = pixel_x - if(prob(35)) - b2x += rand(-4,4) - b2y1 = pixel_y + pick(1,1,1,1,2,2,3,3,4) - b2y2 = pixel_y - pick(1,1,1,1,2,2,3,3,4) + // Randomize the second box + b2x = pixel_x + if(prob(35)) + b2x += rand(-4,4) + b2y1 = pixel_y + pick(1,1,1,1,2,2,3,3,4) + b2y2 = pixel_y - pick(1,1,1,1,2,2,3,3,4) - Target.bulletholes.Add(src) + Target.bulletholes.Add(src) diff --git a/code/game/objects/items/toys/toys.dm b/code/game/objects/items/toys/toys.dm index 654c153b35..9fc8d42d09 100644 --- a/code/game/objects/items/toys/toys.dm +++ b/code/game/objects/items/toys/toys.dm @@ -164,90 +164,90 @@ var/bullets = 5 drop_sound = 'sound/items/drop/gun.ogg' - examine(mob/user) - . = ..() - if(bullets && get_dist(user, src) <= 2) - . += "It is loaded with [bullets] foam darts!" +/obj/item/toy/crossbow/examine(mob/user) + . = ..() + if(bullets && get_dist(user, src) <= 2) + . += "It is loaded with [bullets] foam darts!" - attackby(obj/item/I as obj, mob/user as mob) - if(istype(I, /obj/item/toy/ammo/crossbow)) - if(bullets <= 4) - user.drop_item() - qdel(I) - bullets++ - to_chat(user, "You load the foam dart into the crossbow.") - else - to_chat(usr, "It's already fully loaded.") +/obj/item/toy/crossbow/attackby(obj/item/I as obj, mob/user as mob) + if(istype(I, /obj/item/toy/ammo/crossbow)) + if(bullets <= 4) + user.drop_item() + qdel(I) + bullets++ + to_chat(user, "You load the foam dart into the crossbow.") + else + to_chat(usr, "It's already fully loaded.") - afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) - if(!isturf(target.loc) || target == user) return - if(flag) return +/obj/item/toy/crossbow/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) + if(!isturf(target.loc) || target == user) return + if(flag) return - if (locate (/obj/structure/table, src.loc)) - return - else if (bullets) - var/turf/trg = get_turf(target) - var/obj/effect/foam_dart_dummy/D = new/obj/effect/foam_dart_dummy(get_turf(src)) - bullets-- - D.icon_state = "foamdart" - D.name = "foam dart" - playsound(src, 'sound/items/syringeproj.ogg', 50, 1) + if (locate (/obj/structure/table, src.loc)) + return + else if (bullets) + var/turf/trg = get_turf(target) + var/obj/effect/foam_dart_dummy/D = new/obj/effect/foam_dart_dummy(get_turf(src)) + bullets-- + D.icon_state = "foamdart" + D.name = "foam dart" + playsound(src, 'sound/items/syringeproj.ogg', 50, 1) - for(var/i=0, i<6, i++) - if (D) - if(D.loc == trg) break - step_towards(D,trg) + for(var/i=0, i<6, i++) + if (D) + if(D.loc == trg) break + step_towards(D,trg) - for(var/mob/living/M in D.loc) - if(!istype(M,/mob/living)) continue - if(M == user) continue - for(var/mob/O in viewers(world.view, D)) - O.show_message(text("\The [] was hit by the foam dart!", M), 1) - new /obj/item/toy/ammo/crossbow(M.loc) - qdel(D) - return - - for(var/atom/A in D.loc) - if(A == user) continue - if(A.density) - new /obj/item/toy/ammo/crossbow(A.loc) - qdel(D) - - sleep(1) - - spawn(10) - if(D) - new /obj/item/toy/ammo/crossbow(D.loc) + for(var/mob/living/M in D.loc) + if(!istype(M,/mob/living)) continue + if(M == user) continue + for(var/mob/O in viewers(world.view, D)) + O.show_message(text("\The [] was hit by the foam dart!", M), 1) + new /obj/item/toy/ammo/crossbow(M.loc) qdel(D) + return - return - else if (bullets == 0) - user.Weaken(5) - for(var/mob/O in viewers(world.view, user)) - O.show_message(text("\The [] realized they were out of ammo and starting scrounging for some!", user), 1) + for(var/atom/A in D.loc) + if(A == user) continue + if(A.density) + new /obj/item/toy/ammo/crossbow(A.loc) + qdel(D) + + sleep(1) + + spawn(10) + if(D) + new /obj/item/toy/ammo/crossbow(D.loc) + qdel(D) + + return + else if (bullets == 0) + user.Weaken(5) + for(var/mob/O in viewers(world.view, user)) + O.show_message(text("\The [] realized they were out of ammo and starting scrounging for some!", user), 1) - attack(mob/M as mob, mob/user as mob) - src.add_fingerprint(user) +/obj/item/toy/crossbow/attack(mob/M as mob, mob/user as mob) + src.add_fingerprint(user) // ******* Check - if (src.bullets > 0 && M.lying) + if (src.bullets > 0 && M.lying) - for(var/mob/O in viewers(M, null)) - if(O.client) - O.show_message(text("\The [] casually lines up a shot with []'s head and pulls the trigger!", user, M), 1, "You hear the sound of foam against skull", 2) - O.show_message(text("\The [] was hit in the head by the foam dart!", M), 1) + for(var/mob/O in viewers(M, null)) + if(O.client) + O.show_message(text("\The [] casually lines up a shot with []'s head and pulls the trigger!", user, M), 1, "You hear the sound of foam against skull", 2) + O.show_message(text("\The [] was hit in the head by the foam dart!", M), 1) - playsound(src, 'sound/items/syringeproj.ogg', 50, 1) - new /obj/item/toy/ammo/crossbow(M.loc) - src.bullets-- - else if (M.lying && src.bullets == 0) - for(var/mob/O in viewers(M, null)) - if (O.client) O.show_message(text("\The [] casually lines up a shot with []'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!", user, M), 1, "You hear someone fall", 2) - user.Weaken(5) - return + playsound(src, 'sound/items/syringeproj.ogg', 50, 1) + new /obj/item/toy/ammo/crossbow(M.loc) + src.bullets-- + else if (M.lying && src.bullets == 0) + for(var/mob/O in viewers(M, null)) + if (O.client) O.show_message(text("\The [] casually lines up a shot with []'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!", user, M), 1, "You hear someone fall", 2) + user.Weaken(5) + return /obj/item/toy/ammo/crossbow name = "foam dart" @@ -285,21 +285,21 @@ w_class = ITEMSIZE_SMALL attack_verb = list("attacked", "struck", "hit") - attack_self(mob/user as mob) - src.active = !( src.active ) - if (src.active) - to_chat(user, "You extend the plastic blade with a quick flick of your wrist.") - playsound(src, 'sound/weapons/saberon.ogg', 50, 1) - src.item_state = "[icon_state]_blade" - src.w_class = ITEMSIZE_LARGE - else - to_chat(user, "You push the plastic blade back down into the handle.") - playsound(src, 'sound/weapons/saberoff.ogg', 50, 1) - src.item_state = "[icon_state]" - src.w_class = ITEMSIZE_SMALL - update_icon() - src.add_fingerprint(user) - return +/obj/item/toy/sword/attack_self(mob/user as mob) + src.active = !( src.active ) + if (src.active) + to_chat(user, "You extend the plastic blade with a quick flick of your wrist.") + playsound(src, 'sound/weapons/saberon.ogg', 50, 1) + src.item_state = "[icon_state]_blade" + src.w_class = ITEMSIZE_LARGE + else + to_chat(user, "You push the plastic blade back down into the handle.") + playsound(src, 'sound/weapons/saberoff.ogg', 50, 1) + src.item_state = "[icon_state]" + src.w_class = ITEMSIZE_SMALL + update_icon() + src.add_fingerprint(user) + return /obj/item/toy/sword/update_icon() . = ..() @@ -365,15 +365,15 @@ w_class = ITEMSIZE_TINY drop_sound = null - throw_impact(atom/hit_atom) - ..() - var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread - s.set_up(3, 1, src) - s.start() - new /obj/effect/decal/cleanable/ash(src.loc) - src.visible_message("The [src.name] explodes!","You hear a snap!") - playsound(src, 'sound/effects/snap.ogg', 50, 1) - qdel(src) +/obj/item/toy/snappop/throw_impact(atom/hit_atom) + ..() + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(3, 1, src) + s.start() + new /obj/effect/decal/cleanable/ash(src.loc) + src.visible_message("The [src.name] explodes!","You hear a snap!") + playsound(src, 'sound/effects/snap.ogg', 50, 1) + qdel(src) /obj/item/toy/snappop/Crossed(atom/movable/H as mob|obj) if(H.is_incorporeal()) diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm index 1099459688..7fbbe38981 100644 --- a/code/game/objects/items/uav.dm +++ b/code/game/objects/items/uav.dm @@ -293,7 +293,8 @@ for(var/wr_master in masters) var/weakref/wr = wr_master var/mob/master = wr.resolve() - var/message = master.combine_message(message_pieces, verb, M) + var/list/combined = master.combine_message(message_pieces, verb, M) + var/message = combined["formatted"] var/rendered = "UAV received: [name_used] [message]" master.show_message(rendered, 2) diff --git a/code/game/objects/items/weapons/autopsy.dm b/code/game/objects/items/weapons/autopsy.dm index 5f5a2c25a9..7868d2d3ab 100644 --- a/code/game/objects/items/weapons/autopsy.dm +++ b/code/game/objects/items/weapons/autopsy.dm @@ -30,14 +30,14 @@ var/hits = 0 var/time_inflicted = 0 - proc/copy() - var/datum/autopsy_data/W = new() - W.weapon = weapon - W.pretend_weapon = pretend_weapon - W.damage = damage - W.hits = hits - W.time_inflicted = time_inflicted - return W +/datum/autopsy_data/proc/copy() + var/datum/autopsy_data/W = new() + W.weapon = weapon + W.pretend_weapon = pretend_weapon + W.damage = damage + W.hits = hits + W.time_inflicted = time_inflicted + return W /obj/item/weapon/autopsy_scanner/proc/add_data(var/obj/item/organ/external/O) if(!O.autopsy_data.len && !O.trace_chemicals.len) return diff --git a/code/game/objects/items/weapons/chewables.dm b/code/game/objects/items/weapons/chewables.dm index 7e38782092..186263897b 100644 --- a/code/game/objects/items/weapons/chewables.dm +++ b/code/game/objects/items/weapons/chewables.dm @@ -25,7 +25,7 @@ if(wrapped) add_overlay("[initial(icon_state)]_wrapper") -obj/item/clothing/mask/chewable/Initialize() +/obj/item/clothing/mask/chewable/Initialize() . = ..() flags |= NOREACT // so it doesn't react until you light it create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15 @@ -47,7 +47,7 @@ obj/item/clothing/mask/chewable/Initialize() STOP_PROCESSING(SSprocessing, src) ..() -obj/item/clothing/mask/chewable/Destroy() +/obj/item/clothing/mask/chewable/Destroy() . = ..() STOP_PROCESSING(SSprocessing, src) @@ -135,6 +135,9 @@ obj/item/clothing/mask/chewable/Destroy() throwforce = 2 slot_flags = SLOT_BELT starts_with = list(/obj/item/clothing/mask/chewable/tobacco = 6) + +/obj/item/weapon/storage/chewables/Initialize() + . = ..() make_exact_fit() //Tobacco Tins @@ -259,4 +262,4 @@ obj/item/clothing/mask/chewable/Destroy() /obj/item/clothing/mask/chewable/candy/pocky/Initialize() . = ..() - reagents.add_reagent("chocolate" = 10) \ No newline at end of file + reagents.add_reagent("chocolate", 10) \ No newline at end of file diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 9a14014ea7..b025a133a4 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -584,10 +584,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM deactivation_sound = 'sound/items/zippo_off.ogg' /obj/item/weapon/flame/lighter/random - New() - icon_state = "lighter-[pick("r","c","y","g")]" - item_state = icon_state - base_state = icon_state +/obj/item/weapon/flame/lighter/random/New() + icon_state = "lighter-[pick("r","c","y","g")]" + item_state = icon_state + base_state = icon_state /obj/item/weapon/flame/lighter/attack_self(mob/living/user) if(!base_state) diff --git a/code/game/objects/items/weapons/circuitboards/machinery/research.dm b/code/game/objects/items/weapons/circuitboards/machinery/research.dm index 5342ee5220..02dfbd6354 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/research.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/research.dm @@ -2,7 +2,7 @@ #error T_BOARD macro is not defined but we need it! #endif -obj/item/weapon/circuitboard/rdserver +/obj/item/weapon/circuitboard/rdserver name = T_BOARD("R&D server") build_path = /obj/machinery/r_n_d/server/core board_type = new /datum/frame/frame_types/machine @@ -11,7 +11,7 @@ obj/item/weapon/circuitboard/rdserver /obj/item/stack/cable_coil = 2, /obj/item/weapon/stock_parts/scanning_module = 1) -obj/item/weapon/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob) +/obj/item/weapon/circuitboard/rdserver/attackby(obj/item/I as obj, mob/user as mob) if(I.is_screwdriver()) playsound(src, I.usesound, 50, 1) user.visible_message("\The [user] adjusts the jumper on \the [src]'s access protocol pins.", "You adjust the jumper on the access protocol pins.") diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 3c17549d25..ce63436094 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -141,262 +141,240 @@ desc = "This will make you big and strong, but give you a bad skin condition." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = HULKBLOCK - ..() + +/obj/item/weapon/dnainjector/hulkmut/New() + block = HULKBLOCK + ..() /obj/item/weapon/dnainjector/antihulk name = "\improper DNA injector (Anti-Hulk)" desc = "Cures green skin." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = HULKBLOCK - ..() + +/obj/item/weapon/dnainjector/antihulk/New() + block = HULKBLOCK + ..() /obj/item/weapon/dnainjector/xraymut name = "\improper DNA injector (Xray)" desc = "Finally you can see what the Site Manager does." datatype = DNA2_BUF_SE value = 0xFFF - //block = 8 - New() - block = XRAYBLOCK - ..() + +/obj/item/weapon/dnainjector/xraymut/New() + block = XRAYBLOCK + ..() /obj/item/weapon/dnainjector/antixray name = "\improper DNA injector (Anti-Xray)" desc = "It will make you see harder." datatype = DNA2_BUF_SE value = 0x001 - //block = 8 - New() - block = XRAYBLOCK - ..() + +/obj/item/weapon/dnainjector/antixray/New() + block = XRAYBLOCK + ..() /obj/item/weapon/dnainjector/firemut name = "\improper DNA injector (Fire)" desc = "Gives you fire." datatype = DNA2_BUF_SE value = 0xFFF - //block = 10 - New() - block = FIREBLOCK - ..() + +/obj/item/weapon/dnainjector/firemut/New() + block = FIREBLOCK + ..() /obj/item/weapon/dnainjector/antifire name = "\improper DNA injector (Anti-Fire)" desc = "Cures fire." datatype = DNA2_BUF_SE value = 0x001 - //block = 10 - New() - block = FIREBLOCK - ..() + +/obj/item/weapon/dnainjector/antifire/New() + block = FIREBLOCK + ..() /obj/item/weapon/dnainjector/telemut name = "\improper DNA injector (Tele.)" desc = "Super brain man!" datatype = DNA2_BUF_SE value = 0xFFF - //block = 12 - New() - block = TELEBLOCK - ..() + +/obj/item/weapon/dnainjector/telemut/New() + block = TELEBLOCK + ..() /obj/item/weapon/dnainjector/antitele name = "\improper DNA injector (Anti-Tele.)" desc = "Will make you not able to control your mind." datatype = DNA2_BUF_SE value = 0x001 - //block = 12 - New() - block = TELEBLOCK - ..() + +/obj/item/weapon/dnainjector/antitele/New() + block = TELEBLOCK + ..() /obj/item/weapon/dnainjector/nobreath name = "\improper DNA injector (No Breath)" desc = "Hold your breath and count to infinity." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = NOBREATHBLOCK - ..() + +/obj/item/weapon/dnainjector/nobreath/New() + block = NOBREATHBLOCK + ..() /obj/item/weapon/dnainjector/antinobreath name = "\improper DNA injector (Anti-No Breath)" desc = "Hold your breath and count to 100." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = NOBREATHBLOCK - ..() + +/obj/item/weapon/dnainjector/antinobreath/New() + block = NOBREATHBLOCK + ..() /obj/item/weapon/dnainjector/remoteview name = "\improper DNA injector (Remote View)" desc = "Stare into the distance for a reason." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = REMOTEVIEWBLOCK - ..() + +/obj/item/weapon/dnainjector/remoteview/New() + block = REMOTEVIEWBLOCK + ..() /obj/item/weapon/dnainjector/antiremoteview name = "\improper DNA injector (Anti-Remote View)" desc = "Cures green skin." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = REMOTEVIEWBLOCK - ..() + +/obj/item/weapon/dnainjector/antiremoteview/New() + block = REMOTEVIEWBLOCK + ..() /obj/item/weapon/dnainjector/regenerate name = "\improper DNA injector (Regeneration)" desc = "Healthy but hungry." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = REGENERATEBLOCK - ..() + +/obj/item/weapon/dnainjector/regenerate/New() + block = REGENERATEBLOCK + ..() /obj/item/weapon/dnainjector/antiregenerate name = "\improper DNA injector (Anti-Regeneration)" desc = "Sickly but sated." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = REGENERATEBLOCK - ..() + +/obj/item/weapon/dnainjector/antiregenerate/New() + block = REGENERATEBLOCK + ..() /obj/item/weapon/dnainjector/runfast name = "\improper DNA injector (Increase Run)" desc = "Running Man." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = INCREASERUNBLOCK - ..() + +/obj/item/weapon/dnainjector/runfast/New() + block = INCREASERUNBLOCK + ..() /obj/item/weapon/dnainjector/antirunfast name = "\improper DNA injector (Anti-Increase Run)" desc = "Walking Man." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = INCREASERUNBLOCK - ..() + +/obj/item/weapon/dnainjector/antirunfast/New() + block = INCREASERUNBLOCK + ..() /obj/item/weapon/dnainjector/morph name = "\improper DNA injector (Morph)" desc = "A total makeover." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = MORPHBLOCK - ..() + +/obj/item/weapon/dnainjector/morph/New() + block = MORPHBLOCK + ..() /obj/item/weapon/dnainjector/antimorph name = "\improper DNA injector (Anti-Morph)" desc = "Cures identity crisis." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = MORPHBLOCK - ..() -/* No COLDBLOCK on bay -/obj/item/weapon/dnainjector/cold - name = "\improper DNA injector (Cold)" - desc = "Feels a bit chilly." - datatype = DNA2_BUF_SE - value = 0xFFF - //block = 2 - New() - block = COLDBLOCK - ..() - -/obj/item/weapon/dnainjector/anticold - name = "\improper DNA injector (Anti-Cold)" - desc = "Feels room-temperature." - datatype = DNA2_BUF_SE - value = 0x001 - //block = 2 - New() - block = COLDBLOCK - ..() -*/ +/obj/item/weapon/dnainjector/antimorph/New() + block = MORPHBLOCK + ..() /obj/item/weapon/dnainjector/noprints name = "\improper DNA injector (No Prints)" desc = "Better than a pair of budget insulated gloves." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = NOPRINTSBLOCK - ..() + +/obj/item/weapon/dnainjector/noprints/New() + block = NOPRINTSBLOCK + ..() /obj/item/weapon/dnainjector/antinoprints name = "\improper DNA injector (Anti-No Prints)" desc = "Not quite as good as a pair of budget insulated gloves." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = NOPRINTSBLOCK - ..() + +/obj/item/weapon/dnainjector/antinoprints/New() + block = NOPRINTSBLOCK + ..() /obj/item/weapon/dnainjector/insulation name = "\improper DNA injector (Shock Immunity)" desc = "Better than a pair of real insulated gloves." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = SHOCKIMMUNITYBLOCK - ..() + +/obj/item/weapon/dnainjector/insulation/New() + block = SHOCKIMMUNITYBLOCK + ..() /obj/item/weapon/dnainjector/antiinsulation name = "\improper DNA injector (Anti-Shock Immunity)" desc = "Not quite as good as a pair of real insulated gloves." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = SHOCKIMMUNITYBLOCK - ..() + +/obj/item/weapon/dnainjector/antiinsulation/New() + block = SHOCKIMMUNITYBLOCK + ..() /obj/item/weapon/dnainjector/midgit name = "\improper DNA injector (Small Size)" desc = "Makes you shrink." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = SMALLSIZEBLOCK - ..() + +/obj/item/weapon/dnainjector/midgit/New() + block = SMALLSIZEBLOCK + ..() /obj/item/weapon/dnainjector/antimidgit name = "\improper DNA injector (Anti-Small Size)" desc = "Makes you grow. But not too much." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = SMALLSIZEBLOCK - ..() + +/obj/item/weapon/dnainjector/antimidgit/New() + block = SMALLSIZEBLOCK + ..() ///////////////////////////////////// /obj/item/weapon/dnainjector/antiglasses @@ -404,197 +382,197 @@ desc = "Toss away those glasses!" datatype = DNA2_BUF_SE value = 0x001 - //block = 1 - New() - block = GLASSESBLOCK - ..() + +/obj/item/weapon/dnainjector/antiglasses/New() + block = GLASSESBLOCK + ..() /obj/item/weapon/dnainjector/glassesmut name = "\improper DNA injector (Glasses)" desc = "Will make you need dorkish glasses." datatype = DNA2_BUF_SE value = 0xFFF - //block = 1 - New() - block = GLASSESBLOCK - ..() + +/obj/item/weapon/dnainjector/glassesmut/New() + block = GLASSESBLOCK + ..() /obj/item/weapon/dnainjector/epimut name = "\improper DNA injector (Epi.)" desc = "Shake shake shake the room!" datatype = DNA2_BUF_SE value = 0xFFF - //block = 3 - New() - block = HEADACHEBLOCK - ..() + +/obj/item/weapon/dnainjector/epimut/New() + block = HEADACHEBLOCK + ..() /obj/item/weapon/dnainjector/antiepi name = "\improper DNA injector (Anti-Epi.)" desc = "Will fix you up from shaking the room." datatype = DNA2_BUF_SE value = 0x001 - //block = 3 - New() - block = HEADACHEBLOCK - ..() + +/obj/item/weapon/dnainjector/antiepi/New() + block = HEADACHEBLOCK + ..() /obj/item/weapon/dnainjector/anticough name = "\improper DNA injector (Anti-Cough)" desc = "Will stop that awful noise." datatype = DNA2_BUF_SE value = 0x001 - //block = 5 - New() - block = COUGHBLOCK - ..() + +/obj/item/weapon/dnainjector/anticough/New() + block = COUGHBLOCK + ..() /obj/item/weapon/dnainjector/coughmut name = "\improper DNA injector (Cough)" desc = "Will bring forth a sound of horror from your throat." datatype = DNA2_BUF_SE value = 0xFFF - //block = 5 - New() - block = COUGHBLOCK - ..() + +/obj/item/weapon/dnainjector/coughmut/New() + block = COUGHBLOCK + ..() /obj/item/weapon/dnainjector/clumsymut name = "\improper DNA injector (Clumsy)" desc = "Makes clumsy minions." datatype = DNA2_BUF_SE value = 0xFFF - //block = 6 - New() - block = CLUMSYBLOCK - ..() + +/obj/item/weapon/dnainjector/clumsymut/New() + block = CLUMSYBLOCK + ..() /obj/item/weapon/dnainjector/anticlumsy name = "\improper DNA injector (Anti-Clumy)" desc = "Cleans up confusion." datatype = DNA2_BUF_SE value = 0x001 - //block = 6 - New() - block = CLUMSYBLOCK - ..() + +/obj/item/weapon/dnainjector/anticlumsy/New() + block = CLUMSYBLOCK + ..() /obj/item/weapon/dnainjector/antitour name = "\improper DNA injector (Anti-Tour.)" desc = "Will cure tourrets." datatype = DNA2_BUF_SE value = 0x001 - //block = 7 - New() - block = TWITCHBLOCK - ..() + +/obj/item/weapon/dnainjector/antitour/New() + block = TWITCHBLOCK + ..() /obj/item/weapon/dnainjector/tourmut name = "\improper DNA injector (Tour.)" desc = "Gives you a nasty case off tourrets." datatype = DNA2_BUF_SE value = 0xFFF - //block = 7 - New() - block = TWITCHBLOCK - ..() + +/obj/item/weapon/dnainjector/tourmut/New() + block = TWITCHBLOCK + ..() /obj/item/weapon/dnainjector/stuttmut name = "\improper DNA injector (Stutt.)" desc = "Makes you s-s-stuttterrr" datatype = DNA2_BUF_SE value = 0xFFF - //block = 9 - New() - block = NERVOUSBLOCK - ..() + +/obj/item/weapon/dnainjector/stuttmut/New() + block = NERVOUSBLOCK + ..() /obj/item/weapon/dnainjector/antistutt name = "\improper DNA injector (Anti-Stutt.)" desc = "Fixes that speaking impairment." datatype = DNA2_BUF_SE value = 0x001 - //block = 9 - New() - block = NERVOUSBLOCK - ..() + +/obj/item/weapon/dnainjector/antistutt/New() + block = NERVOUSBLOCK + ..() /obj/item/weapon/dnainjector/blindmut name = "\improper DNA injector (Blind)" desc = "Makes you not see anything." datatype = DNA2_BUF_SE value = 0xFFF - //block = 11 - New() - block = BLINDBLOCK - ..() + +/obj/item/weapon/dnainjector/blindmut/New() + block = BLINDBLOCK + ..() /obj/item/weapon/dnainjector/antiblind name = "\improper DNA injector (Anti-Blind)" desc = "ITS A MIRACLE!!!" datatype = DNA2_BUF_SE value = 0x001 - //block = 11 - New() - block = BLINDBLOCK - ..() + +/obj/item/weapon/dnainjector/antiblind/New() + block = BLINDBLOCK + ..() /obj/item/weapon/dnainjector/deafmut name = "\improper DNA injector (Deaf)" desc = "Sorry, what did you say?" datatype = DNA2_BUF_SE value = 0xFFF - //block = 13 - New() - block = DEAFBLOCK - ..() + +/obj/item/weapon/dnainjector/deafmut/New() + block = DEAFBLOCK + ..() /obj/item/weapon/dnainjector/antideaf name = "\improper DNA injector (Anti-Deaf)" desc = "Will make you hear once more." datatype = DNA2_BUF_SE value = 0x001 - //block = 13 - New() - block = DEAFBLOCK - ..() + +/obj/item/weapon/dnainjector/antideaf/New() + block = DEAFBLOCK + ..() /obj/item/weapon/dnainjector/hallucination name = "\improper DNA injector (Halluctination)" desc = "What you see isn't always what you get." datatype = DNA2_BUF_SE value = 0xFFF - //block = 2 - New() - block = HALLUCINATIONBLOCK - ..() + +/obj/item/weapon/dnainjector/hallucination/New() + block = HALLUCINATIONBLOCK + ..() /obj/item/weapon/dnainjector/antihallucination name = "\improper DNA injector (Anti-Hallucination)" desc = "What you see is what you get." datatype = DNA2_BUF_SE value = 0x001 - //block = 2 - New() - block = HALLUCINATIONBLOCK - ..() + +/obj/item/weapon/dnainjector/antihallucination/New() + block = HALLUCINATIONBLOCK + ..() /obj/item/weapon/dnainjector/h2m name = "\improper DNA injector (Human > Monkey)" desc = "Will make you a flea bag." datatype = DNA2_BUF_SE value = 0xFFF - //block = 14 - New() - block = MONKEYBLOCK - ..() + +/obj/item/weapon/dnainjector/h2m/New() + block = MONKEYBLOCK + ..() /obj/item/weapon/dnainjector/m2h name = "\improper DNA injector (Monkey > Human)" desc = "Will make you...less hairy." datatype = DNA2_BUF_SE value = 0x001 - //block = 14 - New() - block = MONKEYBLOCK - ..() + +/obj/item/weapon/dnainjector/m2h/New() + block = MONKEYBLOCK + ..() diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index cd48a4a78a..665c1171f6 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -77,7 +77,7 @@ /obj/item/weapon/lipstick/random, /obj/item/weapon/grenade/smokebomb, /obj/item/weapon/corncob, - /obj/item/weapon/contraband/poster/custom, + /obj/item/poster/custom, /obj/item/weapon/book/manual/barman_recipes, /obj/item/weapon/book/manual/chef_recipes, /obj/item/weapon/bikehorn, diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index e1464bd124..8538980b9c 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -19,152 +19,144 @@ var/mob/living/carbon/occupant = null var/injecting = 0 - proc - go_out() - put_mob(mob/living/carbon/M as mob) - implant(var/mob/M) - add_implants() +/obj/machinery/implantchair/New() + ..() + add_implants() - New() - ..() - add_implants() +/obj/machinery/implantchair/attack_hand(mob/user as mob) + user.set_machine(src) + var/health_text = "" + if(src.occupant) + if(src.occupant.health <= -100) + health_text = "Dead" + else if(src.occupant.health < 0) + health_text = "[round(src.occupant.health,0.1)]" + else + health_text = "[round(src.occupant.health,0.1)]" + + var/dat ="Implanter Status
    " + + dat +="Current occupant: [src.occupant ? "
    Name: [src.occupant]
    Health: [health_text]
    " : "None"]
    " + dat += "Implants: [src.implant_list.len ? "[implant_list.len]" : "Replenish"]
    " + if(src.occupant) + dat += "[src.ready ? "Implant" : "Recharging"]
    " + user.set_machine(src) + user << browse(dat, "window=implant") + onclose(user, "implant") - attack_hand(mob/user as mob) - user.set_machine(src) - var/health_text = "" - if(src.occupant) - if(src.occupant.health <= -100) - health_text = "Dead" - else if(src.occupant.health < 0) - health_text = "[round(src.occupant.health,0.1)]" - else - health_text = "[round(src.occupant.health,0.1)]" - - var/dat ="Implanter Status
    " - - dat +="Current occupant: [src.occupant ? "
    Name: [src.occupant]
    Health: [health_text]
    " : "None"]
    " - dat += "Implants: [src.implant_list.len ? "[implant_list.len]" : "Replenish"]
    " - if(src.occupant) - dat += "[src.ready ? "Implant" : "Recharging"]
    " - user.set_machine(src) - user << browse(dat, "window=implant") - onclose(user, "implant") - - - Topic(href, href_list) - if((get_dist(src, usr) <= 1) || istype(usr, /mob/living/silicon/ai)) - if(href_list["implant"]) - if(src.occupant) - injecting = 1 - go_out() - ready = 0 - spawn(injection_cooldown) - ready = 1 - - if(href_list["replenish"]) +/obj/machinery/implantchair/Topic(href, href_list) + if((get_dist(src, usr) <= 1) || istype(usr, /mob/living/silicon/ai)) + if(href_list["implant"]) + if(src.occupant) + injecting = 1 + go_out() ready = 0 - spawn(replenish_cooldown) - add_implants() + spawn(injection_cooldown) ready = 1 - src.updateUsrDialog() - src.add_fingerprint(usr) - return + if(href_list["replenish"]) + ready = 0 + spawn(replenish_cooldown) + add_implants() + ready = 1 - - attackby(var/obj/item/weapon/G as obj, var/mob/user as mob) - if(istype(G, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/grab = G - if(!ismob(grab.affecting)) - return - if(grab.affecting.has_buckled_mobs()) - to_chat(user, span("warning", "\The [grab.affecting] has other entities attached to them. Remove them first.")) - return - var/mob/M = grab.affecting - if(put_mob(M)) - qdel(G) src.updateUsrDialog() - return - - - go_out(var/mob/M) - if(!( src.occupant )) - return - if(M == occupant) // so that the guy inside can't eject himself -Agouri - return - if (src.occupant.client) - src.occupant.client.eye = src.occupant.client.mob - src.occupant.client.perspective = MOB_PERSPECTIVE - src.occupant.loc = src.loc - if(injecting) - implant(src.occupant) - injecting = 0 - src.occupant = null - icon_state = "implantchair" - return - - - put_mob(mob/living/carbon/M as mob) - if(!iscarbon(M)) - to_chat(usr, "\The [src] cannot hold this!") - return - if(src.occupant) - to_chat(usr, "\The [src] is already occupied!") - return - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src - M.stop_pulling() - M.loc = src - src.occupant = M src.add_fingerprint(usr) - icon_state = "implantchair_on" - return 1 - - - implant(var/mob/M) - if (!istype(M, /mob/living/carbon)) - return - if(!implant_list.len) return - for(var/obj/item/weapon/implant/loyalty/imp in implant_list) - if(!imp) continue - if(istype(imp, /obj/item/weapon/implant/loyalty)) - for (var/mob/O in viewers(M, null)) - O.show_message("\The [M] has been implanted by \the [src].", 1) - - if(imp.handle_implant(M, BP_TORSO)) - imp.post_implant(M) - - implant_list -= imp - break return - add_implants() - for(var/i=0, i\The [src] cannot hold this!") + return + if(src.occupant) + to_chat(usr, "\The [src] is already occupied!") + return + if(M.client) + M.client.perspective = EYE_PERSPECTIVE + M.client.eye = src + M.stop_pulling() + M.loc = src + src.occupant = M + src.add_fingerprint(usr) + icon_state = "implantchair_on" + return 1 + + +/obj/machinery/implantchair/proc/implant(var/mob/M) + if (!istype(M, /mob/living/carbon)) + return + if(!implant_list.len) return + for(var/obj/item/weapon/implant/loyalty/imp in implant_list) + if(!imp) continue + if(istype(imp, /obj/item/weapon/implant/loyalty)) + for (var/mob/O in viewers(M, null)) + O.show_message("\The [M] has been implanted by \the [src].", 1) + + if(imp.handle_implant(M, BP_TORSO)) + imp.post_implant(M) + + implant_list -= imp + break + return + + +/obj/machinery/implantchair/proc/add_implants() + for(var/i=0, i- + - [case.imp:id] + + + +
    "} else - return ..() + dat += "The implant casing is empty." + else + dat += "Please insert an implant casing!" + user << browse(dat, "window=implantpad") + onclose(user, "implantpad") + return + + +/obj/item/weapon/implantpad/Topic(href, href_list) + ..() + if (usr.stat) return + if ((usr.contents.Find(src)) || ((in_range(src, usr) && istype(src.loc, /turf)))) + usr.set_machine(src) + if (href_list["tracking_id"]) + var/obj/item/weapon/implant/tracking/T = src.case.imp + T.id += text2num(href_list["tracking_id"]) + T.id = min(1000, T.id) + T.id = max(1, T.id) - - attackby(obj/item/weapon/implantcase/C as obj, mob/user as mob) - ..() - if(istype(C, /obj/item/weapon/implantcase)) - if(!( src.case )) - user.drop_item() - C.loc = src - src.case = C + if (istype(src.loc, /mob)) + attack_self(src.loc) else - return - src.update() - return - - - attack_self(mob/user as mob) - user.set_machine(src) - var/dat = "Implant Mini-Computer:
    " - if (src.case) - if(src.case.imp) - if(istype(src.case.imp, /obj/item/weapon/implant)) - dat += src.case.imp.get_data() - if(istype(src.case.imp, /obj/item/weapon/implant/tracking)) - dat += {"ID (1-100): - - - - [case.imp:id] - + - +
    "} - else - dat += "The implant casing is empty." - else - dat += "Please insert an implant casing!" - user << browse(dat, "window=implantpad") - onclose(user, "implantpad") - return - - - Topic(href, href_list) - ..() - if (usr.stat) - return - if ((usr.contents.Find(src)) || ((in_range(src, usr) && istype(src.loc, /turf)))) - usr.set_machine(src) - if (href_list["tracking_id"]) - var/obj/item/weapon/implant/tracking/T = src.case.imp - T.id += text2num(href_list["tracking_id"]) - T.id = min(1000, T.id) - T.id = max(1, T.id) - - if (istype(src.loc, /mob)) - attack_self(src.loc) - else - for(var/mob/M in viewers(1, src)) - if (M.client) - src.attack_self(M) - src.add_fingerprint(usr) - else - usr << browse(null, "window=implantpad") - return + for(var/mob/M in viewers(1, src)) + if (M.client) + src.attack_self(M) + src.add_fingerprint(usr) + else + usr << browse(null, "window=implantpad") return + return diff --git a/code/game/objects/items/weapons/material/chainsaw.dm b/code/game/objects/items/weapons/material/chainsaw.dm index 8ba5f20695..93526c2ac0 100644 --- a/code/game/objects/items/weapons/material/chainsaw.dm +++ b/code/game/objects/items/weapons/material/chainsaw.dm @@ -1,4 +1,4 @@ -obj/item/weapon/chainsaw +/obj/item/weapon/chainsaw name = "chainsaw" desc = "Vroom vroom." icon_state = "chainsaw0" @@ -12,7 +12,7 @@ obj/item/weapon/chainsaw var/active_force = 55 var/inactive_force = 10 -obj/item/weapon/chainsaw/New() +/obj/item/weapon/chainsaw/New() var/datum/reagents/R = new/datum/reagents(max_fuel) reagents = R R.my_atom = src @@ -20,13 +20,13 @@ obj/item/weapon/chainsaw/New() START_PROCESSING(SSobj, src) ..() -obj/item/weapon/chainsaw/Destroy() +/obj/item/weapon/chainsaw/Destroy() STOP_PROCESSING(SSobj, src) if(reagents) qdel(reagents) ..() -obj/item/weapon/chainsaw/proc/turnOn(mob/user as mob) +/obj/item/weapon/chainsaw/proc/turnOn(mob/user as mob) if(on) return visible_message("You start pulling the string on \the [src].", "[usr] starts pulling the string on the [src].") @@ -49,7 +49,7 @@ obj/item/weapon/chainsaw/proc/turnOn(mob/user as mob) else to_chat(user, "You fumble with the string.") -obj/item/weapon/chainsaw/proc/turnOff(mob/user as mob) +/obj/item/weapon/chainsaw/proc/turnOff(mob/user as mob) if(!on) return to_chat(user, "You switch the gas nozzle on the chainsaw, turning it off.") attack_verb = list("bluntly hit", "beat", "knocked") @@ -60,13 +60,13 @@ obj/item/weapon/chainsaw/proc/turnOff(mob/user as mob) on = 0 update_icon() -obj/item/weapon/chainsaw/attack_self(mob/user as mob) +/obj/item/weapon/chainsaw/attack_self(mob/user as mob) if(!on) turnOn(user) else turnOff(user) -obj/item/weapon/chainsaw/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity) +/obj/item/weapon/chainsaw/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity) if(!proximity) return ..() if(on) @@ -98,7 +98,7 @@ obj/item/weapon/chainsaw/afterattack(atom/A as mob|obj|turf|area, mob/user as mo else to_chat(user, "Don't move while you're refilling the chainsaw.") -obj/item/weapon/chainsaw/process() +/obj/item/weapon/chainsaw/process() if(!on) return if(on) @@ -109,20 +109,20 @@ obj/item/weapon/chainsaw/process() to_chat(usr, "\The [src] sputters to a stop!") turnOff() -obj/item/weapon/chainsaw/proc/get_fuel() +/obj/item/weapon/chainsaw/proc/get_fuel() return reagents.get_reagent_amount("fuel") -obj/item/weapon/chainsaw/examine(mob/user) +/obj/item/weapon/chainsaw/examine(mob/user) . = ..() if(max_fuel && get_dist(user, src) == 0) . += "The [src] feels like it contains roughtly [get_fuel()] units of fuel left." -obj/item/weapon/chainsaw/suicide_act(mob/user) +/obj/item/weapon/chainsaw/suicide_act(mob/user) var/datum/gender/TU = gender_datums[user.get_visible_gender()] to_chat(viewers(user), "[user] is lying down and pulling the chainsaw into [TU.him], it looks like [TU.he] [TU.is] trying to commit suicide!") return(BRUTELOSS) -obj/item/weapon/chainsaw/update_icon() +/obj/item/weapon/chainsaw/update_icon() if(on) icon_state = "chainsaw1" item_state = "chainsaw1" diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm index e52b2add28..ea16a3be20 100644 --- a/code/game/objects/items/weapons/material/kitchen.dm +++ b/code/game/objects/items/weapons/material/kitchen.dm @@ -11,12 +11,11 @@ thrown_force_divisor = 1 origin_tech = list(TECH_MATERIAL = 1) attack_verb = list("attacked", "stabbed", "poked") - sharp = 1 - edge = 1 + sharp = TRUE + edge = TRUE force_divisor = 0.1 // 6 when wielded with hardness 60 (steel) thrown_force_divisor = 0.25 // 5 when thrown with weight 20 (steel) - var/loaded //Descriptive string for currently loaded food object. - var/scoop_food = 1 + var/weakref/loaded //Weakref for currently loaded food object. /obj/item/weapon/material/kitchen/utensil/New() ..() @@ -25,6 +24,15 @@ create_reagents(5) return +/obj/item/weapon/material/kitchen/utensil/update_icon() + . = ..() + cut_overlays() + var/obj/item/weapon/reagent_containers/food/snacks/eaten = loaded?.resolve() + if(eaten) + var/image/I = new(icon, "loadedfood") + I.color = eaten.filling_color + add_overlay(I) + /obj/item/weapon/material/kitchen/utensil/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M)) return ..() @@ -37,30 +45,32 @@ else return ..() - if (reagents.total_volume > 0) + if (loaded && reagents.total_volume > 0) + var/atom/movable/eaten = loaded?.resolve() reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST) - if(M == user) - if(!M.can_eat(loaded)) - return - M.visible_message("\The [user] eats some [loaded] from \the [src].") - else - user.visible_message("\The [user] begins to feed \the [M]!") - if(!(M.can_force_feed(user, loaded) && do_mob(user, M, 5 SECONDS))) - return - M.visible_message("\The [user] feeds some [loaded] to \the [M] with \the [src].") - playsound(src,'sound/items/eatfood.ogg', rand(10,40), 1) - overlays.Cut() + if(eaten) + if(M == user) + if(!M.can_eat(eaten)) + return + M.visible_message(SPAN_NOTICE("\The [user] eats some of \the [eaten] with \the [src].")) + else + user.visible_message(SPAN_WARNING("\The [user] begins to feed \the [M]!")) + if(!(M.can_force_feed(user, eaten) && do_mob(user, M, 5 SECONDS))) + return + M.visible_message(SPAN_NOTICE("\The [user] feeds some of \the [eaten] to \the [M] with \the [src].")) + playsound(src,'sound/items/eatfood.ogg', rand(10,40), 1) + update_icon() return else - to_chat(user, "You don't have anything on \the [src].") //if we have help intent and no food scooped up DON'T STAB OURSELVES WITH THE FORK + to_chat(user, SPAN_WARNING("You don't have anything on \the [src].")) //if we have help intent and no food scooped up DON'T STAB OURSELVES WITH THE FORK return /obj/item/weapon/material/kitchen/utensil/fork name = "fork" desc = "It's a fork. Sure is pointy." icon_state = "fork" - sharp = 1 - edge = 0 + sharp = TRUE + edge = FALSE /obj/item/weapon/material/kitchen/utensil/fork/plastic default_material = "plastic" @@ -70,8 +80,8 @@ desc = "It's a spoon. You can see your own upside-down face in it." icon_state = "spoon" attack_verb = list("attacked", "poked") - edge = 0 - sharp = 0 + edge = FALSE + sharp = FALSE force_divisor = 0.1 //2 when wielded with weight 20 (steel) /obj/item/weapon/material/kitchen/utensil/spoon/plastic diff --git a/code/game/objects/items/weapons/material/material_armor.dm b/code/game/objects/items/weapons/material/material_armor.dm index 96496d2f8f..b1c07bea1c 100644 --- a/code/game/objects/items/weapons/material/material_armor.dm +++ b/code/game/objects/items/weapons/material/material_armor.dm @@ -288,7 +288,9 @@ Protectiveness | Armor % /obj/item/weapon/material/armor_plating/insert unbreakable = FALSE - + name = "plate insert" + desc = "used to craft armor plates for a plate carrier. Trim with a welder for light armor or add a second for heavy armor" + /obj/item/weapon/material/armor_plating/attackby(var/obj/O, mob/user) if(istype(O, /obj/item/stack/cable_coil)) var/obj/item/stack/cable_coil/S = O diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm index 8e1699c800..a52202e33b 100644 --- a/code/game/objects/items/weapons/paint.dm +++ b/code/game/objects/items/weapons/paint.dm @@ -18,53 +18,53 @@ var/global/list/cached_icons = list() flags = OPENCONTAINER var/paint_type = "red" - afterattack(turf/simulated/target, mob/user, proximity) - if(!proximity) return - if(istype(target) && reagents.total_volume > 5) - user.visible_message("\The [target] has been splashed with something by [user]!") - reagents.trans_to_turf(target, 5) - else - return ..() +/obj/item/weapon/reagent_containers/glass/paint/afterattack(turf/simulated/target, mob/user, proximity) + if(!proximity) return + if(istype(target) && reagents.total_volume > 5) + user.visible_message("\The [target] has been splashed with something by [user]!") + reagents.trans_to_turf(target, 5) + else + return ..() - New() - if(paint_type && length(paint_type) > 0) - name = paint_type + " " + name - ..() - reagents.add_reagent("water", volume*3/5) - reagents.add_reagent("plasticide", volume/5) - if(paint_type == "white") //why don't white crayons exist - reagents.add_reagent("aluminum", volume/5) - else if (paint_type == "black") - reagents.add_reagent("carbon", volume/5) - else - reagents.add_reagent("marker_ink_[paint_type]", volume/5) - reagents.handle_reactions() +/obj/item/weapon/reagent_containers/glass/paint/New() + if(paint_type && length(paint_type) > 0) + name = paint_type + " " + name + ..() + reagents.add_reagent("water", volume*3/5) + reagents.add_reagent("plasticide", volume/5) + if(paint_type == "white") //why don't white crayons exist + reagents.add_reagent("aluminum", volume/5) + else if (paint_type == "black") + reagents.add_reagent("carbon", volume/5) + else + reagents.add_reagent("marker_ink_[paint_type]", volume/5) + reagents.handle_reactions() - red - icon_state = "paint_red" - paint_type = "red" +/obj/item/weapon/reagent_containers/glass/paint/red + icon_state = "paint_red" + paint_type = "red" - yellow - icon_state = "paint_yellow" - paint_type = "yellow" +/obj/item/weapon/reagent_containers/glass/paint/yellow + icon_state = "paint_yellow" + paint_type = "yellow" - green - icon_state = "paint_green" - paint_type = "green" +/obj/item/weapon/reagent_containers/glass/paint/green + icon_state = "paint_green" + paint_type = "green" - blue - icon_state = "paint_blue" - paint_type = "blue" +/obj/item/weapon/reagent_containers/glass/paint/blue + icon_state = "paint_blue" + paint_type = "blue" - purple - icon_state = "paint_violet" - paint_type = "purple" +/obj/item/weapon/reagent_containers/glass/paint/purple + icon_state = "paint_violet" + paint_type = "purple" - black - icon_state = "paint_black" - paint_type = "black" +/obj/item/weapon/reagent_containers/glass/paint/black + icon_state = "paint_black" + paint_type = "black" - white - icon_state = "paint_white" - paint_type = "white" +/obj/item/weapon/reagent_containers/glass/paint/white + icon_state = "paint_white" + paint_type = "white" diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm index b10caa3610..b3fbc758b3 100644 --- a/code/game/objects/items/weapons/storage/lockbox.dm +++ b/code/game/objects/items/weapons/storage/lockbox.dm @@ -17,44 +17,44 @@ var/icon_broken = "lockbox+b" - attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/weapon/card/id)) - if(src.broken) - to_chat(user, "It appears to be broken.") +/obj/item/weapon/storage/lockbox/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/card/id)) + if(src.broken) + to_chat(user, "It appears to be broken.") + return + if(src.allowed(user)) + src.locked = !( src.locked ) + if(src.locked) + src.icon_state = src.icon_locked + to_chat(user, "You lock \the [src]!") + close_all() return - if(src.allowed(user)) - src.locked = !( src.locked ) - if(src.locked) - src.icon_state = src.icon_locked - to_chat(user, "You lock \the [src]!") - close_all() - return - else - src.icon_state = src.icon_closed - to_chat(user, "You unlock \the [src]!") - return else - to_chat(user, "Access Denied") - else if(istype(W, /obj/item/weapon/melee/energy/blade)) - if(emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying.")) - var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() - spark_system.set_up(5, 0, src.loc) - spark_system.start() - playsound(src, 'sound/weapons/blade1.ogg', 50, 1) - playsound(src, "sparks", 50, 1) - if(!locked) - ..() + src.icon_state = src.icon_closed + to_chat(user, "You unlock \the [src]!") + return else - to_chat(user, "It's locked!") - return + to_chat(user, "Access Denied") + else if(istype(W, /obj/item/weapon/melee/energy/blade)) + if(emag_act(INFINITY, user, W, "The locker has been sliced open by [user] with an energy blade!", "You hear metal being sliced and sparks flying.")) + var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() + spark_system.set_up(5, 0, src.loc) + spark_system.start() + playsound(src, 'sound/weapons/blade1.ogg', 50, 1) + playsound(src, "sparks", 50, 1) + if(!locked) + ..() + else + to_chat(user, "It's locked!") + return - show_to(mob/user as mob) - if(locked) - to_chat(user, "It's locked!") - else - ..() - return +/obj/item/weapon/storage/lockbox/show_to(mob/user as mob) + if(locked) + to_chat(user, "It's locked!") + else + ..() + return /obj/item/weapon/storage/lockbox/emag_act(var/remaining_charges, var/mob/user, var/emag_source, var/visual_feedback = "", var/audible_feedback = "") if(!broken) diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 64de9b68a2..62a81bd74d 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -264,11 +264,11 @@ var/obj/item/sample_object var/number - New(obj/item/sample as obj) - if(!istype(sample)) - qdel(src) - sample_object = sample - number = 1 +/datum/numbered_display/New(obj/item/sample as obj) + if(!istype(sample)) + qdel(src) + sample_object = sample + number = 1 //This proc determins the size of the inventory to be displayed. Please touch it only if you know what you're doing. /obj/item/weapon/storage/proc/orient2hud(mob/user as mob) diff --git a/code/game/objects/items/weapons/surgery_tools.dm b/code/game/objects/items/weapons/surgery_tools.dm index 15bb7cd0e5..5cb906bb74 100644 --- a/code/game/objects/items/weapons/surgery_tools.dm +++ b/code/game/objects/items/weapons/surgery_tools.dm @@ -73,11 +73,11 @@ attack_verb = list("drilled") drop_sound = 'sound/items/drop/accessory.ogg' - suicide_act(mob/user) - var/datum/gender/TU = gender_datums[user.get_visible_gender()] - to_chat(viewers(user),pick("\The [user] is pressing \the [src] to [TU.his] temple and activating it! It looks like [TU.hes] trying to commit suicide.", - "\The [user] is pressing \the [src] to [TU.his] chest and activating it! It looks like [TU.hes] trying to commit suicide.")) - return (BRUTELOSS) +/obj/item/weapon/surgical/surgicaldrill/suicide_act(mob/user) + var/datum/gender/TU = gender_datums[user.get_visible_gender()] + to_chat(viewers(user),pick("\The [user] is pressing \the [src] to [TU.his] temple and activating it! It looks like [TU.hes] trying to commit suicide.", + "\The [user] is pressing \the [src] to [TU.his] chest and activating it! It looks like [TU.hes] trying to commit suicide.")) + return (BRUTELOSS) /* * Scalpel @@ -99,12 +99,12 @@ attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") drop_sound = 'sound/items/drop/knife.ogg' - suicide_act(mob/user) - var/datum/gender/TU = gender_datums[user.get_visible_gender()] - to_chat(viewers(user),pick("\The [user] is slitting [TU.his] wrists with the [src.name]! It looks like [TU.hes] trying to commit suicide.", \ - "\The [user] is slitting [TU.his] throat with the [src.name]! It looks like [TU.hes] trying to commit suicide.", \ - "\The [user] is slitting [TU.his] stomach open with the [src.name]! It looks like [TU.hes] trying to commit seppuku.")) - return (BRUTELOSS) +/obj/item/weapon/surgical/scalpel/suicide_act(mob/user) + var/datum/gender/TU = gender_datums[user.get_visible_gender()] + to_chat(viewers(user),pick("\The [user] is slitting [TU.his] wrists with the [src.name]! It looks like [TU.hes] trying to commit suicide.", \ + "\The [user] is slitting [TU.his] throat with the [src.name]! It looks like [TU.hes] trying to commit suicide.", \ + "\The [user] is slitting [TU.his] stomach open with the [src.name]! It looks like [TU.hes] trying to commit seppuku.")) + return (BRUTELOSS) /* * Researchable Scalpels diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 70cbe8fb0a..100619b4d4 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -1,5 +1,3 @@ -#define TANK_MAX_RELEASE_PRESSURE (3*ONE_ATMOSPHERE) -#define TANK_DEFAULT_RELEASE_PRESSURE 21 #define TANK_IDEAL_PRESSURE 1015 //Arbitrary. var/list/global/tank_gauge_cache = list() diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 98332cca42..be45bfa822 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -12,10 +12,10 @@ drop_sound = 'sound/items/drop/sword.ogg' pickup_sound = 'sound/items/pickup/sword.ogg' - suicide_act(mob/user) - var/datum/gender/T = gender_datums[user.get_visible_gender()] - to_chat(viewers(user),"[user] is impaling [T.himself] with the [src.name]! It looks like [T.he] [T.is] trying to commit suicide.") - return (BRUTELOSS|FIRELOSS) +/obj/item/weapon/nullrod/suicide_act(mob/user) + var/datum/gender/T = gender_datums[user.get_visible_gender()] + to_chat(viewers(user),"[user] is impaling [T.himself] with the [src.name]! It looks like [T.he] [T.is] trying to commit suicide.") + return (BRUTELOSS|FIRELOSS) /obj/item/weapon/nullrod/attack(mob/M as mob, mob/living/user as mob) //Paste from old-code to decult with a null rod. diff --git a/code/game/objects/random/misc.dm b/code/game/objects/random/misc.dm index 0a08a83c33..f133c164ce 100644 --- a/code/game/objects/random/misc.dm +++ b/code/game/objects/random/misc.dm @@ -259,10 +259,8 @@ spawn_nothing_percentage = 50 /obj/random/contraband/item_to_spawn() return pick(prob(6);/obj/item/weapon/storage/pill_bottle/tramadol, - prob(8);/obj/item/weapon/haircomb, prob(4);/obj/item/weapon/storage/pill_bottle/happy, prob(4);/obj/item/weapon/storage/pill_bottle/zoom, - prob(10);/obj/item/weapon/contraband/poster/custom, prob(4);/obj/item/weapon/material/butterfly, prob(6);/obj/item/weapon/material/butterflyblade, prob(6);/obj/item/weapon/material/butterflyhandle, diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm index 376ee1e65a..1d71064953 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -195,7 +195,7 @@ if(prob(50)) starts_with += /obj/item/weapon/storage/backpack/dufflebag/sec if(prob(30)) - starts_with += /obj/item/weapon/contraband/poster/nanotrasen + starts_with += /obj/item/poster/nanotrasen return ..() /obj/structure/closet/secure_closet/security/cargo/Initialize() @@ -269,11 +269,11 @@ GLOBAL_LIST_BOILERPLATE(all_brig_closets, /obj/structure/closet/secure_closet/br anchored = 1 starts_with = list( - /obj/item/weapon/contraband/poster/nanotrasen, - /obj/item/weapon/contraband/poster/nanotrasen, - /obj/item/weapon/contraband/poster/nanotrasen, - /obj/item/weapon/contraband/poster/nanotrasen, - /obj/item/weapon/contraband/poster/nanotrasen) + /obj/item/poster/nanotrasen, + /obj/item/poster/nanotrasen, + /obj/item/poster/nanotrasen, + /obj/item/poster/nanotrasen, + /obj/item/poster/nanotrasen) /obj/structure/closet/secure_closet/courtroom name = "courtroom locker" diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 2cc53ff821..e3a53a4e20 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -224,10 +224,11 @@ destroyed = 1 icon_state = "grille-b" density = 0 - New() - ..() - health = rand(-5, -1) //In the destroyed but not utterly threshold. - healthcheck() //Send this to healthcheck just in case we want to do something else with it. + +/obj/structure/grille/broken/New() + ..() + health = rand(-5, -1) //In the destroyed but not utterly threshold. + healthcheck() //Send this to healthcheck just in case we want to do something else with it. /obj/structure/grille/cult name = "cult grille" diff --git a/code/game/objects/structures/holoplant.dm b/code/game/objects/structures/holoplant.dm index bf2365a7b1..dbd39361d6 100644 --- a/code/game/objects/structures/holoplant.dm +++ b/code/game/objects/structures/holoplant.dm @@ -46,12 +46,12 @@ return plant = prepare_icon(emagged ? "emagged" : null) - overlays += plant + overlays = list(plant) set_light(2) update_use_power(USE_POWER_ACTIVE) /obj/machinery/holoplant/proc/deactivate() - overlays -= plant + overlays.Cut() QDEL_NULL(plant) set_light(0) update_use_power(USE_POWER_OFF) @@ -66,16 +66,16 @@ /obj/machinery/holoplant/proc/flicker() interference = TRUE spawn(0) - overlays -= plant + overlays.Cut() set_light(0) sleep(rand(2,4)) - overlays += plant + overlays = list(plant) set_light(2) sleep(rand(2,4)) - overlays -= plant + overlays.Cut() set_light(0) sleep(rand(2,4)) - overlays += plant + overlays = list(plant) set_light(2) interference = FALSE diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm index 3e58a93850..8a6377d0fe 100644 --- a/code/game/objects/structures/inflatable.dm +++ b/code/game/objects/structures/inflatable.dm @@ -247,9 +247,9 @@ icon = 'icons/obj/inflatable.dmi' icon_state = "folded_wall_torn" - attack_self(mob/user) - to_chat(user, "The inflatable wall is too torn to be inflated!") - add_fingerprint(user) +/obj/item/inflatable/torn/attack_self(mob/user) + to_chat(user, "The inflatable wall is too torn to be inflated!") + add_fingerprint(user) /obj/item/inflatable/door/torn name = "torn inflatable door" @@ -257,9 +257,9 @@ icon = 'icons/obj/inflatable.dmi' icon_state = "folded_door_torn" - attack_self(mob/user) - to_chat(user, "The inflatable door is too torn to be inflated!") - add_fingerprint(user) +/obj/item/inflatable/door/torn/attack_self(mob/user) + to_chat(user, "The inflatable door is too torn to be inflated!") + add_fingerprint(user) /obj/item/weapon/storage/briefcase/inflatable name = "inflatable barrier box" @@ -268,13 +268,4 @@ w_class = ITEMSIZE_NORMAL max_storage_space = ITEMSIZE_COST_NORMAL * 7 can_hold = list(/obj/item/inflatable) - - New() - ..() - new /obj/item/inflatable/door(src) - new /obj/item/inflatable/door(src) - new /obj/item/inflatable/door(src) - new /obj/item/inflatable(src) - new /obj/item/inflatable(src) - new /obj/item/inflatable(src) - new /obj/item/inflatable(src) + starts_with = list(/obj/item/inflatable/door = 3, /obj/item/inflatable = 4) diff --git a/code/game/objects/structures/loot_piles.dm b/code/game/objects/structures/loot_piles.dm index 8e0979d322..bf90038f11 100644 --- a/code/game/objects/structures/loot_piles.dm +++ b/code/game/objects/structures/loot_piles.dm @@ -253,8 +253,8 @@ Loot piles can be depleted, if loot_depleted is turned on. Note that players wh /obj/item/stack/rods{amount = 5}, /obj/item/stack/material/steel{amount = 5}, /obj/item/stack/material/cardboard{amount = 5}, - /obj/item/weapon/contraband/poster, - /obj/item/weapon/contraband/poster/custom, + /obj/item/poster, + /obj/item/poster/custom, /obj/item/weapon/newspaper, /obj/item/weapon/paper/crumpled, /obj/item/weapon/paper/crumpled/bloody diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index a9815a4070..22af69d08b 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -163,7 +163,7 @@ FLOOR SAFES return -obj/structure/safe/ex_act(severity) +/obj/structure/safe/ex_act(severity) return //FLOOR SAFES diff --git a/code/game/objects/structures/salvageable.dm b/code/game/objects/structures/salvageable.dm index 201b203acc..18fe7ad080 100644 --- a/code/game/objects/structures/salvageable.dm +++ b/code/game/objects/structures/salvageable.dm @@ -80,7 +80,7 @@ /obj/item/weapon/stock_parts/capacitor/adv = 30, /obj/item/weapon/computer_hardware/network_card/advanced = 20 ) -obj/structure/salvageable/computer/Initialize() +/obj/structure/salvageable/computer/Initialize() . = ..() icon_state = "computer[rand(0,7)]" @@ -136,7 +136,7 @@ obj/structure/salvageable/computer/Initialize() /obj/item/stack/material/silver{amount = 10} = 30 ) -obj/structure/salvageable/implant_container/Initialize() +/obj/structure/salvageable/implant_container/Initialize() . = ..() icon_state = "implant_container[rand(0,1)]" @@ -164,7 +164,7 @@ obj/structure/salvageable/implant_container/Initialize() /obj/item/weapon/computer_hardware/network_card/advanced = 20 ) -obj/structure/salvageable/data/Initialize() +/obj/structure/salvageable/data/Initialize() . = ..() icon_state = "data[rand(0,1)]" @@ -194,7 +194,7 @@ obj/structure/salvageable/data/Initialize() /obj/item/weapon/computer_hardware/network_card/advanced = 20 ) -obj/structure/salvageable/server/Initialize() +/obj/structure/salvageable/server/Initialize() . = ..() icon_state = "server[rand(0,1)]" @@ -219,7 +219,7 @@ obj/structure/salvageable/server/Initialize() /obj/item/weapon/computer_hardware/hard_drive/advanced = 40 ) -obj/structure/salvageable/personal/Initialize() +/obj/structure/salvageable/personal/Initialize() . = ..() icon_state = "personal[rand(0,12)]" new /obj/structure/table/reinforced (loc) @@ -234,7 +234,7 @@ obj/structure/salvageable/personal/Initialize() /obj/item/weapon/computer_hardware/hard_drive/cluster = 50 ) -obj/structure/salvageable/bliss/Initialize() +/obj/structure/salvageable/bliss/Initialize() . = ..() icon_state = "bliss[rand(0,1)]" diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm index ca1f311073..6053d26ea2 100644 --- a/code/game/objects/structures/transit_tubes.dm +++ b/code/game/objects/structures/transit_tubes.dm @@ -56,7 +56,7 @@ // When destroyed by explosions, properly handle contents. -obj/structure/ex_act(severity) +/obj/structure/ex_act(severity) switch(severity) if(1.0) for(var/atom/movable/AM in contents) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 400b997dc5..57734b929c 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -9,7 +9,7 @@ */ -obj/structure/windoor_assembly +/obj/structure/windoor_assembly name = "windoor assembly" icon = 'icons/obj/doors/windoor.dmi' icon_state = "l_windoor_assembly01" @@ -27,12 +27,12 @@ obj/structure/windoor_assembly var/state = "01" //How far the door assembly has progressed in terms of sprites var/step = null //How far the door assembly has progressed in terms of steps -obj/structure/windoor_assembly/secure +/obj/structure/windoor_assembly/secure name = "secure windoor assembly" secure = "secure_" icon_state = "l_secure_windoor_assembly01" -obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) +/obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) ..() if(constructed) state = "01" @@ -46,7 +46,7 @@ obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0) update_nearby_tiles(need_rebuild=1) -obj/structure/windoor_assembly/Destroy() +/obj/structure/windoor_assembly/Destroy() density = 0 update_nearby_tiles() ..() diff --git a/code/game/periodic_news.dm b/code/game/periodic_news.dm index b3c9c9d69f..a3d89313c5 100644 --- a/code/game/periodic_news.dm +++ b/code/game/periodic_news.dm @@ -2,131 +2,120 @@ // Uses BYOND's type system to put everything into a nice format /datum/news_announcement - var - round_time // time of the round at which this should be announced, in seconds - message // body of the message - author = "NanoTrasen Editor" - can_be_redacted = 0 - message_type = "Story" - channel_name = null + var/round_time // time of the round at which this should be announced, in seconds + var/message // body of the message + var/author = "NanoTrasen Editor" + var/can_be_redacted = 0 + var/message_type = "Story" + var/channel_name = null - New() // I'm sorry... - ..() - channel_name = "The [using_map.starsys_name] Times" +/datum/news_announcement/New() // I'm sorry... + ..() + channel_name = "The [using_map.starsys_name] Times" - revolution_inciting_event +/datum/news_announcement/revolution_inciting_event/paycuts_suspicion + round_time = 60*10 + message = {"Reports have leaked that NanoTrasen is planning to put paycuts into + effect on many of its Research Stations in Tau Ceti. Apparently these research + stations haven't been able to yield the expected revenue, and thus adjustments + have to be made."} + author = "Unauthorized" - paycuts_suspicion - round_time = 60*10 - message = {"Reports have leaked that NanoTrasen is planning to put paycuts into - effect on many of its Research Stations in Tau Ceti. Apparently these research - stations haven't been able to yield the expected revenue, and thus adjustments - have to be made."} - author = "Unauthorized" +/datum/news_announcement/revolution_inciting_event/paycuts_confirmation + round_time = 60*40 + message = {"Earlier rumours about paycuts on Research Stations in the Tau Ceti system have + been confirmed. Shockingly, however, the cuts will only affect lower tier + personnel. Heads of Staff will, according to our sources, not be affected."} + author = "Unauthorized" - paycuts_confirmation - round_time = 60*40 - message = {"Earlier rumours about paycuts on Research Stations in the Tau Ceti system have - been confirmed. Shockingly, however, the cuts will only affect lower tier - personnel. Heads of Staff will, according to our sources, not be affected."} - author = "Unauthorized" +/datum/news_announcement/revolution_inciting_event/human_experiments + round_time = 60*90 + message = {"Unbelievable reports about human experimentation have reached our ears. According + to a refugee from one of the Tau Ceti Research Stations, their station, in order + to increase revenue, has refactored several of their facilities to perform experiments + on live humans, including virology research, genetic manipulation, and \"feeding them + to the slimes to see what happens\". Allegedly, these test subjects were neither + humanified monkeys nor volunteers, but rather unqualified staff that were forced into + the experiments, and reported to have died in a \"work accident\" by NanoTrasen."} + author = "Unauthorized" - human_experiments - round_time = 60*90 - message = {"Unbelievable reports about human experimentation have reached our ears. According - to a refugee from one of the Tau Ceti Research Stations, their station, in order - to increase revenue, has refactored several of their facilities to perform experiments - on live humans, including virology research, genetic manipulation, and \"feeding them - to the slimes to see what happens\". Allegedly, these test subjects were neither - humanified monkeys nor volunteers, but rather unqualified staff that were forced into - the experiments, and reported to have died in a \"work accident\" by NanoTrasen."} - author = "Unauthorized" +/datum/news_announcement/bluespace_research/announcement + round_time = 60*20 + message = {"The new field of research trying to explain several interesting spacetime oddities, + also known as \"Bluespace Research\", has reached new heights. Of the several + hundred space stations now orbiting in Tau Ceti, fifteen are now specially equipped + to experiment with and research Bluespace effects. Rumours have it some of these + stations even sport functional \"travel gates\" that can instantly move a whole research + team to an alternate reality."} - bluespace_research - - announcement - round_time = 60*20 - message = {"The new field of research trying to explain several interesting spacetime oddities, - also known as \"Bluespace Research\", has reached new heights. Of the several - hundred space stations now orbiting in Tau Ceti, fifteen are now specially equipped - to experiment with and research Bluespace effects. Rumours have it some of these - stations even sport functional \"travel gates\" that can instantly move a whole research - team to an alternate reality."} - - random_junk - - cheesy_honkers +/datum/news_announcement/random_junk/cheesy_honkers author = "Assistant Editor Carl Ritz" channel_name = "The Gibson Gazette" message = {"Do cheesy honkers increase risk of having a miscarriage? Several health administrations say so!"} round_time = 60 * 15 - net_block - author = "Assistant Editor Carl Ritz" - channel_name = "The Gibson Gazette" - message = {"Several corporations banding together to block access to 'wetskrell.nt', site administrators - claiming violation of net laws."} - round_time = 60 * 50 +/datum/news_announcement/random_junk/net_block + author = "Assistant Editor Carl Ritz" + channel_name = "The Gibson Gazette" + message = {"Several corporations banding together to block access to 'wetskrell.nt', site administrators + claiming violation of net laws."} + round_time = 60 * 50 - found_ssd - author = "Doctor Eric Hanfield" +/datum/news_announcement/random_junk/found_ssd + author = "Doctor Eric Hanfield" - message = {"Several people have been found unconscious at their terminals. It is thought that it was due - to a lack of sleep or of simply migraines from staring at the screen too long. Camera footage - reveals that many of them were playing games instead of working and their pay has been docked - accordingly."} - round_time = 60 * 90 + message = {"Several people have been found unconscious at their terminals. It is thought that it was due + to a lack of sleep or of simply migraines from staring at the screen too long. Camera footage + reveals that many of them were playing games instead of working and their pay has been docked + accordingly."} + round_time = 60 * 90 - lotus_tree +/datum/news_announcement/lotus_tree/explosions + author = "Reporter Leland H. Howards" - explosions - author = "Reporter Leland H. Howards" + message = {"The newly-christened civillian transport Lotus Tree suffered two very large explosions near the + bridge today, and there are unconfirmed reports that the death toll has passed 50. The cause of + the explosions remain unknown, but there is speculation that it might have something to do with + the recent change of regulation in the Moore-Lee Corporation, a major funder of the ship, when M-L + announced that they were officially acknowledging inter-species marriage and providing couples + with marriage tax-benefits."} + round_time = 60 * 30 - message = {"The newly-christened civillian transport Lotus Tree suffered two very large explosions near the - bridge today, and there are unconfirmed reports that the death toll has passed 50. The cause of - the explosions remain unknown, but there is speculation that it might have something to do with - the recent change of regulation in the Moore-Lee Corporation, a major funder of the ship, when M-L - announced that they were officially acknowledging inter-species marriage and providing couples - with marriage tax-benefits."} - round_time = 60 * 30 +/datum/news_announcement/food_riots/breaking_news + author = "Reporter Ro'kii Ar-Raqis" + message = {"Breaking news: Food riots have broken out throughout the Refuge asteroid colony in the Tenebrae + Lupus system. This comes only hours after NanoTrasen officials announced they will no longer trade with the + colony, citing the increased presence of \"hostile factions\" on the colony has made trade too dangerous to + continue. NanoTrasen officials have not given any details about said factions. More on that at the top of + the hour."} + round_time = 60 * 10 - food_riots - - breaking_news - author = "Reporter Ro'kii Ar-Raqis" - message = {"Breaking news: Food riots have broken out throughout the Refuge asteroid colony in the Tenebrae - Lupus system. This comes only hours after NanoTrasen officials announced they will no longer trade with the - colony, citing the increased presence of \"hostile factions\" on the colony has made trade too dangerous to - continue. NanoTrasen officials have not given any details about said factions. More on that at the top of - the hour."} - round_time = 60 * 10 - - more - author = "Reporter Ro'kii Ar-Raqis" - message = {"More on the Refuge food riots: The Refuge Council has condemned NanoTrasen's withdrawal from - the colony, claiming \"there has been no increase in anti-NanoTrasen activity\", and \"\[the only] reason - NanoTrasen withdrew was because the \[Tenebrae Lupus] system's Phoron deposits have been completely mined out. - We have little to trade with them now\". NanoTrasen officials have denied these allegations, calling them - \"further proof\" of the colony's anti-NanoTrasen stance. Meanwhile, Refuge Security has been unable to quell - the riots. More on this at 6."} - round_time = 60 * 60 +/datum/news_announcement/food_riots/more + author = "Reporter Ro'kii Ar-Raqis" + message = {"More on the Refuge food riots: The Refuge Council has condemned NanoTrasen's withdrawal from + the colony, claiming \"there has been no increase in anti-NanoTrasen activity\", and \"\[the only] reason + NanoTrasen withdrew was because the \[Tenebrae Lupus] system's Phoron deposits have been completely mined out. + We have little to trade with them now\". NanoTrasen officials have denied these allegations, calling them + \"further proof\" of the colony's anti-NanoTrasen stance. Meanwhile, Refuge Security has been unable to quell + the riots. More on this at 6."} + round_time = 60 * 60 var/global/list/newscaster_standard_feeds = list(/datum/news_announcement/bluespace_research, /datum/news_announcement/lotus_tree, /datum/news_announcement/random_junk, /datum/news_announcement/food_riots) -proc/process_newscaster() +/proc/process_newscaster() check_for_newscaster_updates(ticker.mode.newscaster_announcements) var/global/tmp/announced_news_types = list() -proc/check_for_newscaster_updates(type) +/proc/check_for_newscaster_updates(type) for(var/subtype in typesof(type)-type) var/datum/news_announcement/news = new subtype() if(news.round_time * 10 <= world.time && !(subtype in announced_news_types)) announced_news_types += subtype announce_newscaster_news(news) -proc/announce_newscaster_news(datum/news_announcement/news) +/proc/announce_newscaster_news(datum/news_announcement/news) var/datum/feed_channel/sendto for(var/datum/feed_channel/FC in news_network.network_channels) if(FC.channel_name == news.channel_name) diff --git a/code/game/response_team.dm b/code/game/response_team.dm index 480d89c61b..2e1edabf89 100644 --- a/code/game/response_team.dm +++ b/code/game/response_team.dm @@ -40,7 +40,7 @@ var/silent_ert = 0 log_admin("[key_name(usr)] used Dispatch Response Team.") trigger_armed_response_team(1) -client/verb/JoinResponseTeam() +/client/verb/JoinResponseTeam() set name = "Join Response Team" set category = "IC" @@ -64,7 +64,7 @@ client/verb/JoinResponseTeam() to_chat(usr, "You need to be an observer or new player to use this.") // returns a number of dead players in % -proc/percentage_dead() +/proc/percentage_dead() var/total = 0 var/deadcount = 0 for(var/mob/living/carbon/human/H in mob_list) @@ -76,7 +76,7 @@ proc/percentage_dead() else return round(100 * deadcount / total) // counts the number of antagonists in % -proc/percentage_antagonists() +/proc/percentage_antagonists() var/total = 0 var/antagonists = 0 for(var/mob/living/carbon/human/H in mob_list) @@ -89,7 +89,7 @@ proc/percentage_antagonists() // Increments the ERT chance automatically, so that the later it is in the round, // the more likely an ERT is to be able to be called. -proc/increment_ert_chance() +/proc/increment_ert_chance() while(send_emergency_team == 0) // There is no ERT at the time. if(get_security_level() == "green") ert_base_chance += 1 @@ -108,7 +108,7 @@ proc/increment_ert_chance() sleep(600 * 3) // Minute * Number of Minutes -proc/trigger_armed_response_team(var/force = 0) +/proc/trigger_armed_response_team(var/force = 0) if(!can_call_ert && !force) return if(send_emergency_team) diff --git a/code/game/trader_visit.dm b/code/game/trader_visit.dm index 1fa78fdf21..1c358ded97 100644 --- a/code/game/trader_visit.dm +++ b/code/game/trader_visit.dm @@ -34,7 +34,7 @@ var/can_call_traders = 1 log_admin("[key_name(usr)] used Dispatch Beruang Trader Ship.") trigger_trader_visit() -client/verb/JoinTraders() +/client/verb/JoinTraders() set name = "Join Trader Visit" set category = "IC" @@ -54,7 +54,7 @@ client/verb/JoinTraders() else to_chat(usr, "You need to be an observer or new player to use this.") -proc/trigger_trader_visit() +/proc/trigger_trader_visit() if(!can_call_traders) return if(send_beruang) diff --git a/code/game/turfs/flooring/flooring_premade.dm b/code/game/turfs/flooring/flooring_premade.dm index 411d639415..05be706493 100644 --- a/code/game/turfs/flooring/flooring_premade.dm +++ b/code/game/turfs/flooring/flooring_premade.dm @@ -426,8 +426,6 @@ icon_state = "snowyplayingdrift" initial_flooring = /decl/flooring/snow/plating/drift -#define FOOTSTEP_SPRITE_AMT 2 - // TODO: Move foortprints to a datum-component signal so they can actually be applied to other turf types, like sand, or mud /turf/simulated/floor/snow/Entered(atom/A) if(isliving(A)) diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index 437912b4d2..3f817eefb1 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -14,9 +14,9 @@ var/image/turf_image var/list/decals - New(var/location = null, var/turf/simulated/shuttle/turf) - ..(null) - my_turf = turf +/obj/landed_holder/New(var/location = null, var/turf/simulated/shuttle/turf) + ..(null) + my_turf = turf /obj/landed_holder/proc/land_on(var/turf/T) //Gather destination information diff --git a/code/game/turfs/simulated/wall_attacks.dm b/code/game/turfs/simulated/wall_attacks.dm index 148c8f9874..3a1e1224f5 100644 --- a/code/game/turfs/simulated/wall_attacks.dm +++ b/code/game/turfs/simulated/wall_attacks.dm @@ -1,6 +1,3 @@ -#define ZONE_BLOCKED 2 -#define AIR_BLOCKED 1 - //Interactions /turf/simulated/wall/proc/toggle_open(var/mob/user) @@ -37,9 +34,6 @@ can_open = WALL_CAN_OPEN update_icon() -#undef ZONE_BLOCKED -#undef AIR_BLOCKED - /turf/simulated/wall/proc/update_air() if(!air_master) return diff --git a/code/game/turfs/simulated/water.dm b/code/game/turfs/simulated/water.dm index f54d6cc491..2e4b25f33f 100644 --- a/code/game/turfs/simulated/water.dm +++ b/code/game/turfs/simulated/water.dm @@ -195,7 +195,7 @@ var/list/shoreline_icon_cache = list() desc = "This water smells pretty acrid." var/poisonlevel = 10 -turf/simulated/floor/water/contaminated/Entered(atom/movable/AM, atom/oldloc) +/turf/simulated/floor/water/contaminated/Entered(atom/movable/AM, atom/oldloc) ..() if(istype(AM, /mob/living)) var/mob/living/L = AM diff --git a/code/game/turfs/snow/snow.dm b/code/game/turfs/snow/snow.dm index a8ccd5b63b..465f1cb183 100644 --- a/code/game/turfs/snow/snow.dm +++ b/code/game/turfs/snow/snow.dm @@ -11,8 +11,6 @@ temperature = TN60C var/list/crossed_dirs = list() -#define FOOTSTEP_SPRITE_AMT 2 - /turf/snow/Entered(atom/A) if(ismob(A)) var/mdir = "[A.dir]" diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 9cacb36eaf..704b37b6d7 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -93,7 +93,7 @@ step(user.pulling, get_dir(user.pulling.loc, src)) return 1 -turf/attackby(obj/item/weapon/W as obj, mob/user as mob) +/turf/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/storage)) var/obj/item/weapon/storage/S = W if(S.use_to_pickup && S.collection_mode) diff --git a/code/game/vehicles/vehicle.dm b/code/game/vehicles/vehicle.dm index 4088528b35..1250c7d961 100644 --- a/code/game/vehicles/vehicle.dm +++ b/code/game/vehicles/vehicle.dm @@ -44,40 +44,25 @@ var/list/operation_req_access = list()//required access level for mecha operation var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment - //var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature //In airtight.dm you go -Agouri - var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss - - //var/datum/global_iterator/pr_give_air //moves air from tank to cabin //Y-you too -Agouri - - var/datum/global_iterator/pr_internal_damage //processes internal damage - - var/wreckage var/list/equipment = new var/obj/selected //var/max_equip = 3 - var/datum/events/events -/obj/vehicle/New() - ..() - events = new +/obj/vehicle/Initialize() + . = ..() icon_state += "-unmanned" add_radio() - //add_cabin() //No cabin for non-airtights spark_system.set_up(2, 0, src) spark_system.attach(src) add_cell() - add_iterators() - removeVerb(/obj/mecha/verb/disconnect_from_port) removeVerb(/atom/movable/verb/pull) log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.") - loc.Entered(src) - return //################ Helpers ########################################################### @@ -89,26 +74,12 @@ /obj/vehicle/proc/addVerb(verb_path) verbs += verb_path -/*/obj/vehicle/proc/add_airtank() //In airtight.dm -Agouri - internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src) - return internal_tank*/ - /obj/vehicle/proc/add_cell(var/obj/item/weapon/cell/C=null) if(C) C.forceMove(src) cell = C return - cell = new(src) - cell.charge = 15000 - cell.maxcharge = 15000 - -/*/obj/vehicle/proc/add_cabin() //In airtight.dm -Agouri - cabin_air = new - cabin_air.temperature = T20C - cabin_air.volume = 200 - cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature) - cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature) - return cabin_air*/ + cell = new /obj/item/weapon/cell/mech(src) /obj/vehicle/proc/add_radio() radio = new(src) @@ -117,12 +88,6 @@ radio.icon_state = icon_state radio.subspace_transmission = 1 -/obj/vehicle/proc/add_iterators() - pr_inertial_movement = new /datum/global_iterator/vehicle_intertial_movement(null,0) - //pr_internal_damage = new /datum/global_iterator/vehicle_internal_damage(list(src),0) - //pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src)) //In airtight.dm's add_airtight_iterators -Agouri - //pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src) //Same here -Agouri - /obj/vehicle/proc/check_for_support() if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src))) return 1 @@ -136,55 +101,3 @@ log.len++ log[log.len] = list("time"=world.timeofday,"message"="[red?"":null][message][red?"":null]") return log.len - - - -//################ Global Iterator Datums ###################################### - - -/datum/global_iterator/vehicle_intertial_movement //inertial movement in space - delay = 7 - - process(var/obj/vehicle/V as obj, direction) - if(direction) - if(!step(V, direction)||V.check_for_support()) - src.stop() - else - src.stop() - return - - -/datum/global_iterator/mecha_internal_damage // processing internal damage - - process(var/obj/mecha/mecha) - if(!mecha.hasInternalDamage()) - return stop() - if(mecha.hasInternalDamage(MECHA_INT_FIRE)) - if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5)) - mecha.clearInternalDamage(MECHA_INT_FIRE) - if(mecha.internal_tank) - if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH))) - mecha.setInternalDamage(MECHA_INT_TANK_BREACH) - var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air() - if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents - int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15)) - if(mecha.cabin_air && mecha.cabin_air.return_volume()>0) - mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15)) - if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2) - mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire") - if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum - mecha.pr_int_temp_processor.stop() - if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank - if(mecha.internal_tank) - var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air() - var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10) - if(mecha.loc && hascall(mecha.loc,"assume_air")) - mecha.loc.assume_air(leaked_gas) - else - qdel(leaked_gas) - if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT)) - if(mecha.get_charge()) - mecha.spark_system.start() - mecha.cell.charge -= min(20,mecha.cell.charge) - mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge) - return \ No newline at end of file diff --git a/code/game/world.dm b/code/game/world.dm index 5906125992..81078f642e 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -1,6 +1,7 @@ #define RECOMMENDED_VERSION 501 /world/New() + world_startup_time = world.timeofday to_world_log("Map Loading Complete") changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently @@ -553,7 +554,7 @@ var/failed_old_db_connections = 0 to_world_log("Feedback database connection established.") return 1 -proc/setup_database_connection() +/proc/setup_database_connection() if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. return 0 @@ -578,7 +579,7 @@ proc/setup_database_connection() return . //This proc ensures that the connection to the feedback database (global variable dbcon) is established -proc/establish_db_connection() +/proc/establish_db_connection() if(failed_db_connections > FAILED_DB_CONNECTION_CUTOFF) return 0 @@ -598,7 +599,7 @@ proc/establish_db_connection() return 1 //These two procs are for the old database, while it's being phased out. See the tgstation.sql file in the SQL folder for more information. -proc/setup_old_database_connection() +/proc/setup_old_database_connection() if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to conenct anymore. return 0 @@ -623,7 +624,7 @@ proc/setup_old_database_connection() return . //This proc ensures that the connection to the feedback database (global variable dbcon) is established -proc/establish_old_db_connection() +/proc/establish_old_db_connection() if(failed_old_db_connections > FAILED_DB_CONNECTION_CUTOFF) return 0 diff --git a/code/global_init.dm b/code/global_init.dm index c3f8056d95..9dfec91c01 100644 --- a/code/global_init.dm +++ b/code/global_init.dm @@ -21,6 +21,7 @@ var/global/datum/global_init/init = new () error_log = file("[log_path]-error.log") debug_log = file("[log_path]-debug.log") debug_log << "[log_end]\n[log_end]\nStarting up. [time_stamp()][log_end]\n---------------------[log_end]" + decls_repository = new() load_configuration() makeDatumRefLists() diff --git a/code/js/byjax.dm b/code/js/byjax.dm index c776b8ac77..bf9d778989 100644 --- a/code/js/byjax.dm +++ b/code/js/byjax.dm @@ -34,7 +34,7 @@ callback_args - arguments for callback function Be sure to include required js functions in your page, or it'll raise an exception. */ -proc/send_byjax(receiver, control_id, target_element, new_content=null, callback=null, list/callback_args=null) +/proc/send_byjax(receiver, control_id, target_element, new_content=null, callback=null, list/callback_args=null) if(receiver && target_element && control_id) // && winexists(receiver, control_id)) var/list/argums = list(target_element, new_content) if(callback) diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 3e4339af7c..315940d5c4 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -1,6 +1,6 @@ //Either pass the mob you wish to ban in the 'banned_mob' attribute, or the banckey, banip and bancid variables. If both are passed, the mob takes priority! If a mob is not passed, banckey is the minimum that needs to be passed! banip and bancid are optional. -datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null, var/banip = null, var/bancid = null) +/datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0, var/banckey = null, var/banip = null, var/bancid = null) if(!check_rights(R_MOD,0) && !check_rights(R_BAN)) return @@ -87,7 +87,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "") +/datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "") if(!check_rights(R_BAN)) return @@ -151,7 +151,7 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "") DB_ban_unban_by_id(ban_id) -datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null) +/datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null) if(!check_rights(R_BAN)) return @@ -207,7 +207,7 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null) to_chat(usr, "Cancelled") return -datum/admins/proc/DB_ban_unban_by_id(var/id) +/datum/admins/proc/DB_ban_unban_by_id(var/id) if(!check_rights(R_BAN)) return diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index e28c4fd570..ae48fa934b 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -1,6 +1,6 @@ #ifndef OVERRIDE_BAN_SYSTEM //Blocks an attempt to connect before even creating our client datum thing. -world/IsBanned(key,address,computer_id) +/world/IsBanned(key,address,computer_id) if(ckey(key) in admin_datums) return ..() @@ -81,5 +81,4 @@ world/IsBanned(key,address,computer_id) message_admins("[key] has logged in with a blank ip in the ban check.") return ..() //default pager ban stuff #endif -#undef OVERRIDE_BAN_SYSTEM diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 72e77caf1f..94c305a7e5 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -20,7 +20,7 @@ var/global/floorIsLava = 0 var/msg = rendered to_chat(C,msg) -proc/admin_notice(var/message, var/rights) +/proc/admin_notice(var/message, var/rights) for(var/mob/M in mob_list) if(check_rights(rights, 0, M)) to_chat(M,message) @@ -1572,7 +1572,7 @@ proc/admin_notice(var/message, var/rights) P.adminbrowse() -datum/admins/var/obj/item/weapon/paper/admin/faxreply // var to hold fax replies in +/datum/admins/var/obj/item/weapon/paper/admin/faxreply // var to hold fax replies in /datum/admins/proc/faxCallback(var/obj/item/weapon/paper/admin/P, var/obj/machinery/photocopier/faxmachine/destination) var/customname = input(src.owner, "Pick a title for the report", "Title") as text|null diff --git a/code/modules/admin/admin_attack_log.dm b/code/modules/admin/admin_attack_log.dm index 4c5b1b481e..fb85a7db1c 100644 --- a/code/modules/admin/admin_attack_log.dm +++ b/code/modules/admin/admin_attack_log.dm @@ -3,11 +3,11 @@ /mob/var/attack_log = list( ) /mob/var/dialogue_log = list( ) -proc/log_and_message_admins(var/message as text, var/mob/user = usr) +/proc/log_and_message_admins(var/message as text, var/mob/user = usr) log_admin(user ? "[key_name(user)] [message]" : "EVENT [message]") message_admins(user ? "[key_name_admin(user)] [message]" : "EVENT [message]") -proc/log_and_message_admins_many(var/list/mob/users, var/message) +/proc/log_and_message_admins_many(var/list/mob/users, var/message) if(!users || !users.len) return @@ -18,7 +18,7 @@ proc/log_and_message_admins_many(var/list/mob/users, var/message) log_admin("[english_list(user_keys)] [message]") message_admins("[english_list(user_keys)] [message]") /* Old procs -proc/admin_attack_log(var/mob/attacker, var/mob/victim, var/attacker_message, var/victim_message, var/admin_message) +/proc/admin_attack_log(var/mob/attacker, var/mob/victim, var/attacker_message, var/victim_message, var/admin_message) if(victim) victim.attack_log += text("\[[time_stamp()]\] [key_name(attacker)] - [victim_message]") if(attacker) @@ -26,14 +26,14 @@ proc/admin_attack_log(var/mob/attacker, var/mob/victim, var/attacker_message, va msg_admin_attack("[key_name(attacker)] [admin_message] [key_name(victim)] (INTENT: [attacker? uppertext(attacker.a_intent) : "N/A"]) (JMP)") -proc/admin_attacker_log_many_victims(var/mob/attacker, var/list/mob/victims, var/attacker_message, var/victim_message, var/admin_message) +/proc/admin_attacker_log_many_victims(var/mob/attacker, var/list/mob/victims, var/attacker_message, var/victim_message, var/admin_message) if(!victims || !victims.len) return for(var/mob/victim in victims) admin_attack_log(attacker, victim, attacker_message, victim_message, admin_message) -proc/admin_inject_log(mob/attacker, mob/victim, obj/item/weapon, reagents, amount_transferred, violent=0) +/proc/admin_inject_log(mob/attacker, mob/victim, obj/item/weapon, reagents, amount_transferred, violent=0) if(violent) violent = "violently " else diff --git a/code/modules/admin/admin_report.dm b/code/modules/admin/admin_report.dm index 40a96cb100..6a6a5d241e 100644 --- a/code/modules/admin/admin_report.dm +++ b/code/modules/admin/admin_report.dm @@ -3,7 +3,7 @@ // they can only be read by admins and moderators. // a single admin report -datum/admin_report/var +/datum//admin_report/var ID // the ID of the report body // the content of the report author // key of the author @@ -13,7 +13,7 @@ datum/admin_report/var offender_key // store the key of the offender offender_cid // store the cid of the offender -datum/report_topic_handler +/datum//report_topic_handler Topic(href,href_list) ..() var/client/C = locate(href_list["client"]) @@ -31,7 +31,7 @@ world/New() report_topic_handler = new // add a new news datums -proc/make_report(body, author, okey, cid) +/proc/make_report(body, author, okey, cid) var/savefile/Reports = new("data/reports.sav") var/list/reports var/lastID @@ -57,7 +57,7 @@ proc/make_report(body, author, okey, cid) Reports["lastID"] << lastID // load the reports from disk -proc/load_reports() +/proc/load_reports() var/savefile/Reports = new("data/reports.sav") var/list/reports @@ -68,7 +68,7 @@ proc/load_reports() return reports // check if there are any unhandled reports -client/proc/unhandled_reports() +/client/proc/unhandled_reports() if(!src.holder) return 0 var/list/reports = load_reports() @@ -80,7 +80,7 @@ client/proc/unhandled_reports() return 0 // checks if the player has an unhandled report against him -client/proc/is_reported() +/client/proc/is_reported() var/list/reports = load_reports() for(var/datum/admin_report/N in reports) if(!N.done) @@ -90,7 +90,7 @@ client/proc/is_reported() return 0 // display only the reports that haven't been handled -client/proc/display_admin_reports() +/client/proc/display_admin_reports() set category = "Admin" set name = "Display Admin Reports" if(!src.holder) return @@ -118,7 +118,7 @@ client/proc/display_admin_reports() usr << browse(output, "window=news;size=600x400") -client/proc/Report(mob/M as mob in world) +/client/proc/Report(mob/M as mob in world) set category = "Admin" if(!src.holder) return @@ -136,7 +136,7 @@ client/proc/Report(mob/M as mob in world) spawn(1) display_admin_reports() -client/proc/mark_report_done(ID as num) +/client/proc/mark_report_done(ID as num) if(!src.holder || src.holder.level < 0) return @@ -157,7 +157,7 @@ client/proc/mark_report_done(ID as num) Reports["reports"] << reports -client/proc/edit_report(ID as num) +/client/proc/edit_report(ID as num) if(!src.holder || src.holder.level < 0) to_chat(src, "You tried to modify the news, but you're not an admin!") return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 39a0c7a697..92b65f3d10 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -323,8 +323,7 @@ var/message = sanitize(input("What do you want the message to be?", "Make Sound") as text|null) if(!message) return - for (var/mob/V in hearers(O)) - V.show_message(message, 2) + O.audible_message(message) log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z]. make a sound") message_admins("[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. make a sound.", 1) feedback_add_details("admin_verb","MS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 13272a1ca7..eeab15eb8c 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -60,7 +60,7 @@ if rights_required == 0, then it simply checks if they are an admin. if it doesn't return 1 and show_msg=1 it will prints a message explaining why the check has failed generally it would be used like so: -proc/admin_proc() +/proc/admin_proc() if(!check_rights(R_ADMIN)) return to_world("you have enough rights!") diff --git a/code/modules/admin/player_notes.dm b/code/modules/admin/player_notes.dm index dee9a69366..61da1e8ef8 100644 --- a/code/modules/admin/player_notes.dm +++ b/code/modules/admin/player_notes.dm @@ -4,11 +4,11 @@ /* #define NOTESFILE "data/player_notes.sav" //where the player notes are saved -datum/admins/proc/notes_show(var/ckey) +/datum/admins/proc/notes_show(var/ckey) usr << browse("Player Notes[notes_gethtml(ckey)]","window=player_notes;size=700x400") -datum/admins/proc/notes_gethtml(var/ckey) +/datum/admins/proc/notes_gethtml(var/ckey) var/savefile/notesfile = new(NOTESFILE) if(!notesfile) return "Error: Cannot access [NOTESFILE]" if(ckey) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index af63e7b136..c3b3f193f2 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1940,13 +1940,13 @@ PlayerNotesFilter() return -mob/living/proc/can_centcom_reply() +/mob/living/proc/can_centcom_reply() return 0 -mob/living/carbon/human/can_centcom_reply() +/mob/living/carbon/human/can_centcom_reply() return istype(l_ear, /obj/item/device/radio/headset) || istype(r_ear, /obj/item/device/radio/headset) -mob/living/silicon/ai/can_centcom_reply() +/mob/living/silicon/ai/can_centcom_reply() return common_radio != null && !check_unable(2) /atom/proc/extra_admin_link() diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index 7f9e02b769..fa623f5aaa 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -66,115 +66,117 @@ /obj/effect/bmode/builddir icon_state = "build" screen_loc = "NORTH,WEST" - Click() - switch(dir) - if(NORTH) - set_dir(EAST) - if(EAST) - set_dir(SOUTH) - if(SOUTH) - set_dir(WEST) - if(WEST) - set_dir(NORTHWEST) - if(NORTHWEST) - set_dir(NORTH) - return 1 + +/obj/effect/bmode/builddir/Click() + switch(dir) + if(NORTH) + set_dir(EAST) + if(EAST) + set_dir(SOUTH) + if(SOUTH) + set_dir(WEST) + if(WEST) + set_dir(NORTHWEST) + if(NORTHWEST) + set_dir(NORTH) + return 1 /obj/effect/bmode/buildhelp icon = 'icons/misc/buildmode.dmi' icon_state = "buildhelp" screen_loc = "NORTH,WEST+1" - Click() - switch(master.cl.buildmode) - if(BUILDMODE_BASIC) - to_chat(usr, "***********************************************************
    \ - Left Mouse Button = Construct / Upgrade
    \ - Right Mouse Button = Deconstruct / Delete / Downgrade
    \ - Left Mouse Button + ctrl = R-Window
    \ - Left Mouse Button + alt = Airlock

    \ - Use the button in the upper left corner to
    \ - change the direction of built objects.
    \ - ***********************************************************
    ") +/obj/effect/bmode/buildhelp/Click() + switch(master.cl.buildmode) - if(BUILDMODE_ADVANCED) - to_chat(usr, "***********************************************************
    \ - Right Mouse Button on buildmode button = Set object type
    \ - Middle Mouse Button on buildmode button= On/Off object type saying
    \ - Middle Mouse Button on turf/obj = Capture object type
    \ - Left Mouse Button on turf/obj = Place objects
    \ - Right Mouse Button = Delete objects
    \ - Mouse Button + ctrl = Copy object type

    \ - Use the button in the upper left corner to
    \ - change the direction of built objects.
    \ - ***********************************************************
    ") + if(BUILDMODE_BASIC) + to_chat(usr, "***********************************************************
    \ + Left Mouse Button = Construct / Upgrade
    \ + Right Mouse Button = Deconstruct / Delete / Downgrade
    \ + Left Mouse Button + ctrl = R-Window
    \ + Left Mouse Button + alt = Airlock

    \ + Use the button in the upper left corner to
    \ + change the direction of built objects.
    \ + ***********************************************************
    ") - if(BUILDMODE_EDIT) - to_chat(usr, "***********************************************************
    \ - Right Mouse Button on buildmode button = Select var(type) & value
    \ - Left Mouse Button on turf/obj/mob = Set var(type) & value
    \ - Right Mouse Button on turf/obj/mob = Reset var's value
    \ - ***********************************************************
    ") + if(BUILDMODE_ADVANCED) + to_chat(usr, "***********************************************************
    \ + Right Mouse Button on buildmode button = Set object type
    \ + Middle Mouse Button on buildmode button= On/Off object type saying
    \ + Middle Mouse Button on turf/obj = Capture object type
    \ + Left Mouse Button on turf/obj = Place objects
    \ + Right Mouse Button = Delete objects
    \ + Mouse Button + ctrl = Copy object type

    \ + Use the button in the upper left corner to
    \ + change the direction of built objects.
    \ + ***********************************************************
    ") - if(BUILDMODE_THROW) - to_chat(usr, "***********************************************************
    \ - Left Mouse Button on turf/obj/mob = Select
    \ - Right Mouse Button on turf/obj/mob = Throw
    \ - ***********************************************************
    ") + if(BUILDMODE_EDIT) + to_chat(usr, "***********************************************************
    \ + Right Mouse Button on buildmode button = Select var(type) & value
    \ + Left Mouse Button on turf/obj/mob = Set var(type) & value
    \ + Right Mouse Button on turf/obj/mob = Reset var's value
    \ + ***********************************************************
    ") - if(BUILDMODE_ROOM) - to_chat(usr, "***********************************************************
    \ - Left Mouse Button on turf = Select as point A
    \ - Right Mouse Button on turf = Select as point B
    \ - Right Mouse Button on buildmode button = Change floor/wall type
    \ - ***********************************************************
    ") + if(BUILDMODE_THROW) + to_chat(usr, "***********************************************************
    \ + Left Mouse Button on turf/obj/mob = Select
    \ + Right Mouse Button on turf/obj/mob = Throw
    \ + ***********************************************************
    ") - if(BUILDMODE_LADDER) - to_chat(usr, "***********************************************************
    \ - Left Mouse Button on turf = Set as upper ladder loc
    \ - Right Mouse Button on turf = Set as lower ladder loc
    \ - ***********************************************************
    ") + if(BUILDMODE_ROOM) + to_chat(usr, "***********************************************************
    \ + Left Mouse Button on turf = Select as point A
    \ + Right Mouse Button on turf = Select as point B
    \ + Right Mouse Button on buildmode button = Change floor/wall type
    \ + ***********************************************************
    ") - if(BUILDMODE_CONTENTS) - to_chat(usr, "***********************************************************
    \ - Left Mouse Button on turf/obj/mob = Select
    \ - Right Mouse Button on turf/obj/mob = Move into selection
    \ - ***********************************************************
    ") + if(BUILDMODE_LADDER) + to_chat(usr, "***********************************************************
    \ + Left Mouse Button on turf = Set as upper ladder loc
    \ + Right Mouse Button on turf = Set as lower ladder loc
    \ + ***********************************************************
    ") - if(BUILDMODE_LIGHTS) - to_chat(usr, "***********************************************************
    \ - Left Mouse Button on turf/obj/mob = Make it glow
    \ - Right Mouse Button on turf/obj/mob = Reset glowing
    \ - Right Mouse Button on buildmode button = Change glow properties
    \ - ***********************************************************
    ") + if(BUILDMODE_CONTENTS) + to_chat(usr, "***********************************************************
    \ + Left Mouse Button on turf/obj/mob = Select
    \ + Right Mouse Button on turf/obj/mob = Move into selection
    \ + ***********************************************************
    ") - if(BUILDMODE_AI) - to_chat(usr, "***********************************************************
    \ - Left Mouse Button drag box = Select only mobs in box
    \ - Left Mouse Button drag box + shift = Select additional mobs in area
    \ - Left Mouse Button on non-mob = Deselect all mobs
    \ - Left Mouse Button on AI mob = Select/Deselect mob
    \ - Left Mouse Button + alt on AI mob = Toggle hostility on mob
    \ - Left Mouse Button + shift on AI mob = Toggle AI (also resets)
    \ - Left Mouse Button + ctrl on AI mob = Copy mob faction
    \ - Right Mouse Button + ctrl on any mob = Paste mob faction copied with Left Mouse Button + shift
    \ - Right Mouse Button on enemy mob = Command selected mobs to attack mob
    \ - Right Mouse Button on allied mob = Command selected mobs to follow mob
    \ - Right Mouse Button + shift on any mob = Command selected mobs to follow mob regardless of faction
    \ - Note: The following also reset the mob's home position:
    \ - Right Mouse Button on tile = Command selected mobs to move to tile (will cancel if enemies are seen)
    \ - Right Mouse Button + shift on tile = Command selected mobs to reposition to tile (will not be inturrupted by enemies)
    \ - Right Mouse Button + alt on obj/turfs = Command selected mobs to attack obj/turf
    \ - ***********************************************************
    ") - return 1 + if(BUILDMODE_LIGHTS) + to_chat(usr, "***********************************************************
    \ + Left Mouse Button on turf/obj/mob = Make it glow
    \ + Right Mouse Button on turf/obj/mob = Reset glowing
    \ + Right Mouse Button on buildmode button = Change glow properties
    \ + ***********************************************************
    ") + + if(BUILDMODE_AI) + to_chat(usr, "***********************************************************
    \ + Left Mouse Button drag box = Select only mobs in box
    \ + Left Mouse Button drag box + shift = Select additional mobs in area
    \ + Left Mouse Button on non-mob = Deselect all mobs
    \ + Left Mouse Button on AI mob = Select/Deselect mob
    \ + Left Mouse Button + alt on AI mob = Toggle hostility on mob
    \ + Left Mouse Button + shift on AI mob = Toggle AI (also resets)
    \ + Left Mouse Button + ctrl on AI mob = Copy mob faction
    \ + Right Mouse Button + ctrl on any mob = Paste mob faction copied with Left Mouse Button + shift
    \ + Right Mouse Button on enemy mob = Command selected mobs to attack mob
    \ + Right Mouse Button on allied mob = Command selected mobs to follow mob
    \ + Right Mouse Button + shift on any mob = Command selected mobs to follow mob regardless of faction
    \ + Note: The following also reset the mob's home position:
    \ + Right Mouse Button on tile = Command selected mobs to move to tile (will cancel if enemies are seen)
    \ + Right Mouse Button + shift on tile = Command selected mobs to reposition to tile (will not be inturrupted by enemies)
    \ + Right Mouse Button + alt on obj/turfs = Command selected mobs to attack obj/turf
    \ + ***********************************************************
    ") + return 1 /obj/effect/bmode/buildquit icon_state = "buildquit" screen_loc = "NORTH,WEST+3" - Click() - togglebuildmode(master.cl.mob) - return 1 +/obj/effect/bmode/buildquit/Click() + togglebuildmode(master.cl.mob) + return 1 /obj/effect/bmode/buildholder density = 0 diff --git a/code/modules/admin/verbs/lightning_strike.dm b/code/modules/admin/verbs/lightning_strike.dm index 0975db9d07..6153884f59 100644 --- a/code/modules/admin/verbs/lightning_strike.dm +++ b/code/modules/admin/verbs/lightning_strike.dm @@ -95,6 +95,5 @@ C.ear_deaf += 10 to_chat(L, span("danger", "Lightning struck nearby, and the thunderclap is deafening!")) -#undef GROUNDING_ROD_RANGE #undef LIGHTNING_ZAP_RANGE #undef LIGHTNING_POWER diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index e6bda9b409..033302838b 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -28,9 +28,9 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) icon = 'icons/480x480.dmi' icon_state = "25percent" - New() - src.pixel_x = -224 - src.pixel_y = -224 +/obj/effect/debugging/camera_range/New() + src.pixel_x = -224 + src.pixel_y = -224 /obj/effect/debugging/marker icon = 'icons/turf/areas.dmi' diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 60f1640cdd..7df6891ce7 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -76,7 +76,7 @@ var/list/sounds_cache = list() M << 'bananaphone.ogg' -client/proc/space_asshole() +/client/proc/space_asshole() set category = "Fun" set name = "Space Asshole" @@ -87,7 +87,7 @@ client/proc/space_asshole() M << 'sound/music/space_asshole.ogg' -client/proc/honk_theme() +/client/proc/honk_theme() set category = "Fun" set name = "Honk" diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index c3abd0ae8a..df56aecc8d 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -161,7 +161,7 @@ feedback_add_details("admin_verb","GOD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0) +/proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0) if(automute) if(!config.automute_on) return diff --git a/code/modules/ai/ai_holder_combat_unseen.dm b/code/modules/ai/ai_holder_combat_unseen.dm index ae6743832f..6f6fbac567 100644 --- a/code/modules/ai/ai_holder_combat_unseen.dm +++ b/code/modules/ai/ai_holder_combat_unseen.dm @@ -16,6 +16,8 @@ var/obj/O = find_escape_route() if(istype(O)) return give_destination(get_turf(O), 0, TRUE) + else + return find_target() else return find_target() else @@ -91,4 +93,4 @@ return pick(closest_escape) return null - \ No newline at end of file + diff --git a/code/modules/alarm/alarm.dm b/code/modules/alarm/alarm.dm index 30de8cc560..e5a958873d 100644 --- a/code/modules/alarm/alarm.dm +++ b/code/modules/alarm/alarm.dm @@ -135,5 +135,3 @@ /mob/living/silicon/robot/syndicate/get_alarm_cameras() return list() - -#undef ALARM_LOSS_DELAY diff --git a/code/modules/assembly/igniter.dm b/code/modules/assembly/igniter.dm index 5344d4b15b..a53fbad0ec 100644 --- a/code/modules/assembly/igniter.dm +++ b/code/modules/assembly/igniter.dm @@ -3,7 +3,7 @@ desc = "A small electronic device able to ignite combustable substances." icon_state = "igniter" origin_tech = list(TECH_MAGNET = 1) - matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 50, "waste" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 500, MAT_GLASS = 50) secured = 1 wires = WIRE_RECEIVE diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 853f2f230b..b9a8302aa1 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -5,7 +5,7 @@ desc = "Emits a visible or invisible beam and is triggered when the beam is interrupted." icon_state = "infrared" origin_tech = list(TECH_MAGNET = 2) - matter = list(DEFAULT_WALL_MATERIAL = 1000, "glass" = 500, "waste" = 100) + matter = list(DEFAULT_WALL_MATERIAL = 1000, MAT_GLASS = 500) wires = WIRE_PULSE diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 6ea9dfdff7..7dc4ac7166 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -3,7 +3,7 @@ desc = "A handy little spring-loaded trap for catching pesty rodents." icon_state = "mousetrap" origin_tech = list(TECH_COMBAT = 1) - matter = list(DEFAULT_WALL_MATERIAL = 100, "waste" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 100) var/armed = 0 diff --git a/code/modules/assembly/proximity.dm b/code/modules/assembly/proximity.dm index c13bba9f86..566ba320e4 100644 --- a/code/modules/assembly/proximity.dm +++ b/code/modules/assembly/proximity.dm @@ -3,7 +3,7 @@ desc = "Used for scanning and alerting when someone enters a certain proximity." icon_state = "prox" origin_tech = list(TECH_MAGNET = 1) - matter = list(DEFAULT_WALL_MATERIAL = 800, "glass" = 200, "waste" = 50) + matter = list(DEFAULT_WALL_MATERIAL = 800, MAT_GLASS = 200) wires = WIRE_PULSE secured = 0 diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index e98ff5372c..91cea6b775 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -4,7 +4,7 @@ icon_state = "signaller" item_state = "signaler" origin_tech = list(TECH_MAGNET = 1) - matter = list(DEFAULT_WALL_MATERIAL = 1000, "glass" = 200, "waste" = 100) + matter = list(DEFAULT_WALL_MATERIAL = 1000, MAT_GLASS = 200) wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE secured = TRUE diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index fa8b783815..babf362921 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -3,7 +3,7 @@ desc = "Used to time things. Works well with contraptions which has to count down. Tick tock." icon_state = "timer" origin_tech = list(TECH_MAGNET = 1) - matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 50, "waste" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 500, MAT_GLASS = 50) wires = WIRE_PULSE diff --git a/code/modules/assembly/voice.dm b/code/modules/assembly/voice.dm index 8990e01d63..e0d383e223 100644 --- a/code/modules/assembly/voice.dm +++ b/code/modules/assembly/voice.dm @@ -3,7 +3,7 @@ desc = "A small electronic device able to record a voice sample, and send a signal when that sample is repeated." icon_state = "voice" origin_tech = list(TECH_MAGNET = 1) - matter = list(DEFAULT_WALL_MATERIAL = 500, "glass" = 50, "waste" = 10) + matter = list(DEFAULT_WALL_MATERIAL = 500, MAT_GLASS = 50) var/listening = 0 var/recorded //the activation message diff --git a/code/modules/awaymissions/exile.dm b/code/modules/awaymissions/exile.dm index b22114649d..ef19bb0c49 100644 --- a/code/modules/awaymissions/exile.dm +++ b/code/modules/awaymissions/exile.dm @@ -15,12 +15,12 @@ name = "exile" desc = "Prevents you from returning from away missions" - get_data() - var/dat = {" +/obj/item/weapon/implant/exile/get_data() + var/dat = {" Implant Specifications:
    Name: [using_map.company_name] Employee Exile Implant
    Implant Details: The onboard gateway system has been modified to reject entry by individuals containing this implant
    "} - return dat + return dat /obj/item/weapon/implantcase/exile name = "Glass Case- 'Exile'" @@ -29,23 +29,13 @@ icon_state = "implantcase-r" - New() - src.imp = new /obj/item/weapon/implant/exile( src ) - ..() - return +/obj/item/weapon/implantcase/exile/New() + src.imp = new /obj/item/weapon/implant/exile( src ) + ..() + return /obj/structure/closet/secure_closet/exile name = "Exile Implants" req_access = list(access_hos) - - New() - ..() - sleep(2) - new /obj/item/weapon/implanter/exile(src) - new /obj/item/weapon/implantcase/exile(src) - new /obj/item/weapon/implantcase/exile(src) - new /obj/item/weapon/implantcase/exile(src) - new /obj/item/weapon/implantcase/exile(src) - new /obj/item/weapon/implantcase/exile(src) - return \ No newline at end of file + starts_with = list(/obj/item/weapon/implanter/exile = 1, /obj/item/weapon/implantcase/exile = 5) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index bd88744d70..37b8eaca27 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -48,7 +48,7 @@ -obj/machinery/gateway/centerstation/process() +/obj/machinery/gateway/centerstation/process() if(stat & (NOPOWER)) if(active) toggleoff() return diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index c9b32e5593..a295b56793 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -1,4 +1,4 @@ -proc/createRandomZlevel() +/proc/createRandomZlevel() if(awaydestinations.len) //crude, but it saves another var! return diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index a62ce12017..2fc1587e81 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -74,3 +74,6 @@ var/connection_realtime ///world.timeofday they connected var/connection_timeofday + + // Runechat messages + var/list/seen_messages diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index a43a2eab78..01cb03446c 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -345,7 +345,6 @@ var/DBQuery/query_accesslog = dbcon.NewQuery("INSERT INTO `erro_connection_log`(`id`,`datetime`,`serverip`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),'[serverip]','[sql_ckey]','[sql_ip]','[sql_computerid]');") query_accesslog.Execute() -#undef TOPIC_SPAM_DELAY #undef UPLOAD_LIMIT #undef MIN_CLIENT_VERSION @@ -375,17 +374,17 @@ //Precache the client with all other assets slowly, so as to not block other browse() calls addtimer(CALLBACK(GLOBAL_PROC, /proc/getFilesSlow, src, SSassets.preload, FALSE), 5 SECONDS) -mob/proc/MayRespawn() +/mob/proc/MayRespawn() return 0 -client/proc/MayRespawn() +/client/proc/MayRespawn() if(mob) return mob.MayRespawn() // Something went wrong, client is usually kicked or transfered to a new mob at this point return 0 -client/verb/character_setup() +/client/verb/character_setup() set name = "Character Setup" set category = "Preferences" if(prefs) diff --git a/code/modules/client/preference_setup/general/01_basic.dm b/code/modules/client/preference_setup/general/01_basic.dm index ad74d42922..14a516a999 100644 --- a/code/modules/client/preference_setup/general/01_basic.dm +++ b/code/modules/client/preference_setup/general/01_basic.dm @@ -1,8 +1,8 @@ -datum/preferences +/datum/preferences var/biological_gender = MALE var/identifying_gender = MALE -datum/preferences/proc/set_biological_gender(var/gender) +/datum/preferences/proc/set_biological_gender(var/gender) biological_gender = gender identifying_gender = gender @@ -140,7 +140,7 @@ datum/preferences/proc/set_biological_gender(var/gender) return TOPIC_REFRESH else if(href_list["metadata"]) - var/new_metadata = sanitize(input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , pref.metadata)) as message|null + var/new_metadata = sanitize(input(user, "Enter any information you'd like others to see, such as Roleplay-preferences:", "Game Preference" , pref.metadata) as message|null) if(new_metadata && CanUseTopic(user)) pref.metadata = new_metadata return TOPIC_REFRESH diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 0be1b3b44e..e711742287 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -339,6 +339,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O character.set_gender(pref.biological_gender) // Destroy/cyborgize organs and limbs. + character.synthetic = null //Clear the existing var. for(var/name in list(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG, BP_GROIN, BP_TORSO)) var/status = pref.organ_data[name] var/obj/item/organ/external/O = character.organs_by_name[name] diff --git a/code/modules/client/preference_setup/global/setting_datums.dm b/code/modules/client/preference_setup/global/setting_datums.dm index 0308200feb..25ac9dbaee 100644 --- a/code/modules/client/preference_setup/global/setting_datums.dm +++ b/code/modules/client/preference_setup/global/setting_datums.dm @@ -253,6 +253,32 @@ var/list/_client_preferences_by_type enabled_description = "Show" disabled_description = "Hide" +/datum/client_preference/runechat_mob + description = "Runechat (Mobs)" + key = "RUNECHAT_MOB" + enabled_description = "Show" + disabled_description = "Hide" + +/datum/client_preference/runechat_obj + description = "Runechat (Objs)" + key = "RUNECHAT_OBJ" + enabled_description = "Show" + disabled_description = "Hide" + +/datum/client_preference/runechat_border + description = "Runechat Message Border" + key = "RUNECHAT_BORDER" + enabled_description = "Show" + disabled_description = "Hide" + enabled_by_default = FALSE + +/datum/client_preference/runechat_long_messages + description = "Runechat Message Length" + key = "RUNECHAT_LONG" + enabled_description = "ERP KING" + disabled_description = "Normie" + enabled_by_default = FALSE + /datum/client_preference/status_indicators/toggled(mob/preference_mob, enabled) . = ..() if(preference_mob && preference_mob.plane_holder) diff --git a/code/modules/client/preference_setup/loadout/loadout_suit.dm b/code/modules/client/preference_setup/loadout/loadout_suit.dm index 9c7da40222..3f79abe352 100644 --- a/code/modules/client/preference_setup/loadout/loadout_suit.dm +++ b/code/modules/client/preference_setup/loadout/loadout_suit.dm @@ -98,7 +98,7 @@ display_name = "trenchcoat, grey" path = /obj/item/clothing/suit/storage/trench/grey -datum/gear/suit/duster +/datum/gear/suit/duster display_name = "cowboy duster" path = /obj/item/clothing/suit/storage/duster diff --git a/code/modules/client/preference_setup/occupation/occupation.dm b/code/modules/client/preference_setup/occupation/occupation.dm index d962d64b9e..99c0d04685 100644 --- a/code/modules/client/preference_setup/occupation/occupation.dm +++ b/code/modules/client/preference_setup/occupation/occupation.dm @@ -1,8 +1,3 @@ -//used for pref.alternate_option -#define GET_RANDOM_JOB 0 -#define BE_ASSISTANT 1 -#define RETURN_TO_LOBBY 2 - /datum/category_item/player_setup_item/occupation name = "Occupation" sort_order = 1 diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index da851e162e..3200e1e192 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -2,7 +2,7 @@ var/list/preferences_datums = list() -datum/preferences +/datum/preferences //doohickeys for savefiles var/path var/default_slot = 1 //Holder so it doesn't default to slot 1, rather the last one used diff --git a/code/modules/client/preferences_spawnpoints.dm b/code/modules/client/preferences_spawnpoints.dm index 1736c9ca7d..88c9fcb007 100644 --- a/code/modules/client/preferences_spawnpoints.dm +++ b/code/modules/client/preferences_spawnpoints.dm @@ -15,25 +15,25 @@ var/list/spawntypes = list() var/announce_channel = "Common" var/allowed_mob_types = JOB_SILICON|JOB_CARBON - proc/check_job_spawning(job) - if(restrict_job && !(job in restrict_job)) - return 0 +/datum/spawnpoint/proc/check_job_spawning(job) + if(restrict_job && !(job in restrict_job)) + return 0 - if(disallow_job && (job in disallow_job)) - return 0 + if(disallow_job && (job in disallow_job)) + return 0 - var/datum/job/J = SSjob.get_job(job) - if(!J) // Couldn't find, admin shenanigans? Allow it - return 1 - - if(J.offmap_spawn && !(job in restrict_job)) - return 0 - - if(!(J.mob_type & allowed_mob_types)) - return 0 - + var/datum/job/J = SSjob.get_job(job) + if(!J) // Couldn't find, admin shenanigans? Allow it return 1 + if(J.offmap_spawn && !(job in restrict_job)) + return 0 + + if(!(J.mob_type & allowed_mob_types)) + return 0 + + return 1 + /datum/spawnpoint/proc/get_spawn_position() return get_turf(pick(turfs)) diff --git a/code/modules/client/ui_style.dm b/code/modules/client/ui_style.dm index 84c8055d9f..bcf580bd47 100644 --- a/code/modules/client/ui_style.dm +++ b/code/modules/client/ui_style.dm @@ -49,7 +49,7 @@ var/global/list/all_tooltip_styles = list( if(!UI_style_new) return var/UI_style_alpha_new = input(usr, "Select a new alpha (transparency) parameter for your UI, between 50 and 255") as null|num - if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return + if(!UI_style_alpha_new || !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return var/UI_style_color_new = input(usr, "Choose your UI color. Dark colors are not recommended!") as color|null if(!UI_style_color_new) return diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm index e0c74b7e13..08854d0eee 100644 --- a/code/modules/client/verbs/who.dm +++ b/code/modules/client/verbs/who.dm @@ -7,57 +7,46 @@ var/list/Lines = list() - if(holder && (R_ADMIN & holder.rights || R_MOD & holder.rights)) - for(var/client/C in GLOB.clients) - var/entry = "\t[C.key]" - if(C.holder && C.holder.fakekey) - entry += " (as [C.holder.fakekey])" - entry += " - Playing as [C.mob.real_name]" - switch(C.mob.stat) - if(UNCONSCIOUS) - entry += " - Unconscious" - if(DEAD) - if(isobserver(C.mob)) - var/mob/observer/dead/O = C.mob - if(O.started_as_observer) - entry += " - Observing" - else - entry += " - DEAD" + for(var/client/C in GLOB.clients) + if(!check_rights_for(src, R_ADMIN|R_MOD)) + Lines += "\t[C.holder?.fakekey || C.key]" + continue + var/entry = "\t[C.key]" + if(C.holder?.fakekey) + entry += " (as [C.holder.fakekey])" + entry += " - Playing as [C.mob.real_name]" + switch(C.mob.stat) + if(UNCONSCIOUS) + entry += " - Unconscious" + if(DEAD) + if(isobserver(C.mob)) + var/mob/observer/dead/O = C.mob + if(O.started_as_observer) + entry += " - Observing" else entry += " - DEAD" + else + entry += " - DEAD" - var/age - if(isnum(C.player_age)) - age = C.player_age - else - age = 0 + if(C.player_age != initial(C.player_age) && isnum(C.player_age)) // database is on + var/age = C.player_age + switch(age) + if(0 to 1) + age = "[age] days old" + if(1 to 10) + age = "[age] days old" + else + entry += " - [age] days old" - if(age <= 1) - age = "[age]" - else if(age < 10) - age = "[age]" + if(is_special_character(C.mob)) + entry += " - Antagonist" - entry += " - [age]" + if(C.is_afk()) + var/seconds = C.last_activity_seconds() + entry += " (AFK - [round(seconds / 60)] minutes, [seconds % 60] seconds)" - if(is_special_character(C.mob)) - entry += " - Antagonist" - - if(C.is_afk()) - var/seconds = C.last_activity_seconds() - entry += " (AFK - " - entry += "[round(seconds / 60)] minutes, " - entry += "[seconds % 60] seconds)" - - entry += " (?)" - Lines += entry - else - for(var/client/C in GLOB.clients) - var/entry - if(C.holder && C.holder.fakekey) - entry = C.holder.fakekey - else - entry = C.key - Lines += entry + entry += " (?)" + Lines += entry for(var/line in sortList(Lines)) msg += "[line]\n" @@ -77,100 +66,48 @@ var/num_admins_online = 0 var/num_devs_online = 0 var/num_event_managers_online = 0 - if(holder) - for(var/client/C in admins) - if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_EVENT & C.holder.rights)) //Used to determine who shows up in admin rows + for(var/client/C in admins) + var/temp = "" + var/category = R_ADMIN + if(check_rights(R_ADMIN, FALSE, C)) // admins + if(C.holder.fakekey && check_rights(R_ADMIN|R_MOD, FALSE, src)) // Only admins and mods can see stealthmins + continue + num_admins_online++ + else if(check_rights(R_MOD, FALSE, C)) // mods + category = R_MOD + num_mods_online++ + else if(check_rights(R_SERVER, FALSE, C)) // developers + category = R_SERVER + num_devs_online++ + else if(check_rights(R_EVENT, FALSE, C)) // event managers + category = R_EVENT + num_event_managers_online++ + + temp += "\t[C] is a [C.holder.rank]" + if(holder) + if(C.holder.fakekey) + temp += " (as [C.holder.fakekey])" - if(C.holder.fakekey && (!R_ADMIN & holder.rights && !R_MOD & holder.rights)) //Event Managerss can't see stealthmins - continue + if(isobserver(C.mob)) + temp += " - Observing" + else if(istype(C.mob,/mob/new_player)) + temp += " - Lobby" + else + temp += " - Playing" - msg += "\t[C] is a [C.holder.rank]" - - if(C.holder.fakekey) - msg += " (as [C.holder.fakekey])" - - if(isobserver(C.mob)) - msg += " - Observing" - else if(istype(C.mob,/mob/new_player)) - msg += " - Lobby" - else - msg += " - Playing" - - if(C.is_afk()) - var/seconds = C.last_activity_seconds() - msg += " (AFK - " - msg += "[round(seconds / 60)] minutes, " - msg += "[seconds % 60] seconds)" - msg += "\n" - - num_admins_online++ - else if(R_MOD & C.holder.rights) //Who shows up in mod rows. - modmsg += "\t[C] is a [C.holder.rank]" - - if(isobserver(C.mob)) - modmsg += " - Observing" - else if(istype(C.mob,/mob/new_player)) - modmsg += " - Lobby" - else - modmsg += " - Playing" - - if(C.is_afk()) - var/seconds = C.last_activity_seconds() - modmsg += " (AFK - " - modmsg += "[round(seconds / 60)] minutes, " - modmsg += "[seconds % 60] seconds)" - modmsg += "\n" - num_mods_online++ - - else if(R_SERVER & C.holder.rights) - devmsg += "\t[C] is a [C.holder.rank]" - if(isobserver(C.mob)) - devmsg += " - Observing" - else if(istype(C.mob,/mob/new_player)) - devmsg += " - Lobby" - else - devmsg += " - Playing" - - if(C.is_afk()) - var/seconds = C.last_activity_seconds() - devmsg += "(AFK - " - devmsg += "[round(seconds / 60)] minutes, " - devmsg += "[seconds % 60] seconds)" - devmsg += "\n" - num_devs_online++ - - else if(R_EVENT & C.holder.rights) - eventMmsg += "\t[C] is a [C.holder.rank]" - if(isobserver(C.mob)) - eventMmsg += " - Observing" - else if(istype(C.mob,/mob/new_player)) - eventMmsg += " - Lobby" - else - eventMmsg += " - Playing" - - if(C.is_afk()) - var/seconds = C.last_activity_seconds() - eventMmsg += " (AFK - " - eventMmsg += "[round(seconds / 60)] minutes, " - eventMmsg += "[seconds % 60] seconds)" - eventMmsg += "\n" - num_event_managers_online++ - - else - for(var/client/C in admins) - if(R_ADMIN & C.holder.rights || (!R_MOD & C.holder.rights && !R_EVENT & C.holder.rights)) - if(!C.holder.fakekey) - msg += "\t[C] is a [C.holder.rank]\n" - num_admins_online++ - else if (R_MOD & C.holder.rights) - modmsg += "\t[C] is a [C.holder.rank]\n" - num_mods_online++ - else if (R_SERVER & C.holder.rights) - devmsg += "\t[C] is a [C.holder.rank]\n" - num_devs_online++ - else if (R_EVENT & C.holder.rights) - eventMmsg += "\t[C] is a [C.holder.rank]\n" - num_event_managers_online++ + if(C.is_afk()) + var/seconds = C.last_activity_seconds() + temp += " (AFK - [round(seconds / 60)] minutes, [seconds % 60] seconds)" + temp += "\n" + switch(category) + if(R_ADMIN) + msg += temp + if(R_MOD) + modmsg += temp + if(R_SERVER) + devmsg += temp + if(R_EVENT) + eventMmsg += temp if(config.admin_irc) to_chat(src, "Adminhelps are also sent to IRC. If no admins are available in game try anyway and an admin on IRC may see it and respond.") diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 36e672c7a4..9a20152848 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -731,13 +731,13 @@ /obj/item/clothing/suit/equipped(var/mob/user, var/slot) if(ishuman(user)) var/mob/living/carbon/human/H = user - if((taurized && !isTaurTail(H.tail_style)) || (!taurized && isTaurTail(H.tail_style))) + if((taurized && !istaurtail(H.tail_style)) || (!taurized && istaurtail(H.tail_style))) taurize(user) return ..() /obj/item/clothing/suit/proc/taurize(var/mob/living/carbon/human/Taur) - if(isTaurTail(Taur.tail_style)) + if(istaurtail(Taur.tail_style)) var/datum/sprite_accessory/tail/taur/taurtail = Taur.tail_style if(taurtail.suit_sprites && (get_worn_icon_state(slot_wear_suit_str) in cached_icon_states(taurtail.suit_sprites))) icon_override = taurtail.suit_sprites diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 49cf22bd9b..6bfd3248ac 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -500,19 +500,19 @@ BLIND // can't see anything enables_planes = list(VIS_FULLBRIGHT, VIS_CLOAKED) flash_protection = FLASH_PROTECTION_REDUCED - emp_act(severity) - if(istype(src.loc, /mob/living/carbon/human)) - var/mob/living/carbon/human/M = src.loc - to_chat(M, "The Optical Thermal Scanner overloads and blinds you!") - if(M.glasses == src) - M.Blind(3) - M.eye_blurry = 5 - // Don't cure being nearsighted - if(!(M.disabilities & NEARSIGHTED)) - M.disabilities |= NEARSIGHTED - spawn(100) - M.disabilities &= ~NEARSIGHTED - ..() +/obj/item/clothing/glasses/thermal/emp_act(severity) + if(istype(src.loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/M = src.loc + to_chat(M, "The Optical Thermal Scanner overloads and blinds you!") + if(M.glasses == src) + M.Blind(3) + M.eye_blurry = 5 + // Don't cure being nearsighted + if(!(M.disabilities & NEARSIGHTED)) + M.disabilities |= NEARSIGHTED + spawn(100) + M.disabilities &= ~NEARSIGHTED + ..() /obj/item/clothing/glasses/thermal/New() ..() diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index ec8e05670f..375a60b4c2 100644 --- a/code/modules/clothing/gloves/color.dm +++ b/code/modules/clothing/gloves/color.dm @@ -91,7 +91,7 @@ heat_protection = HANDS max_heat_protection_temperature = GLOVES_MAX_HEAT_PROTECTION_TEMPERATURE -obj/item/clothing/gloves/fingerless +/obj/item/clothing/gloves/fingerless desc = "A pair of gloves that don't actually cover the fingers." name = "fingerless gloves" icon_state = "fingerlessgloves" diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 6ef9ee2be6..2d5ab89b39 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -184,13 +184,13 @@ siemens_coefficient = 1.5 item_icons = list() - update_icon(var/mob/living/carbon/human/user) - if(!istype(user)) return - var/icon/ears = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") - ears.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) +/obj/item/clothing/head/kitty/update_icon(var/mob/living/carbon/human/user) + if(!istype(user)) return + var/icon/ears = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kitty") + ears.Blend(rgb(user.r_hair, user.g_hair, user.b_hair), ICON_ADD) - var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner") - ears.Blend(earbit, ICON_OVERLAY) + var/icon/earbit = new/icon("icon" = 'icons/mob/head.dmi', "icon_state" = "kittyinner") + ears.Blend(earbit, ICON_OVERLAY) /obj/item/clothing/head/richard name = "chicken mask" diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 996b2a9761..07b934e5ee 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -48,7 +48,7 @@ wizard_garb = 1 -obj/item/clothing/shoes/sandal/clogs +/obj/item/clothing/shoes/sandal/clogs name = "plastic clogs" desc = "A pair of plastic clog shoes." icon_state = "clogs" diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 189986d429..b827532da4 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -119,7 +119,7 @@ item_state = icon_state wires = new(src) - if((!req_access || !req_access.len) && (!req_one_access || !req_one_access.len)) + if(!LAZYLEN(req_access) && !LAZYLEN(req_one_access)) locked = 0 spark_system = new() diff --git a/code/modules/clothing/spacesuits/rig/rig_attackby.dm b/code/modules/clothing/spacesuits/rig/rig_attackby.dm index 67080dd1e0..395484d53a 100644 --- a/code/modules/clothing/spacesuits/rig/rig_attackby.dm +++ b/code/modules/clothing/spacesuits/rig/rig_attackby.dm @@ -17,7 +17,7 @@ to_chat(user, "It looks like the locking system has been shorted out.") return - if((!req_access || !req_access.len) && (!req_one_access || !req_one_access.len)) + if(!LAZYLEN(req_access) && !LAZYLEN(req_one_access)) locked = 0 to_chat(user, "\The [src] doesn't seem to have a locking mechanism.") return @@ -190,8 +190,8 @@ /obj/item/weapon/rig/emag_act(var/remaining_charges, var/mob/user) if(!subverted) - req_access.Cut() - req_one_access.Cut() + LAZYCLEARLIST(req_access) + LAZYCLEARLIST(req_one_access) locked = 0 subverted = 1 to_chat(user, "You short out the access protocol for the suit.") diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 154c8f7751..239accf6d8 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -251,13 +251,13 @@ body_parts_covered = UPPER_TORSO|ARMS flags_inv = HIDETIE|HIDEHOLSTER -obj/item/clothing/suit/kimono +/obj/item/clothing/suit/kimono name = "kimono" desc = "A traditional Japanese kimono." icon_state = "kimono" addblends = "kimono_a" -obj/item/clothing/suit/kamishimo +/obj/item/clothing/suit/kamishimo name = "kamishimo" desc = "Traditional Japanese menswear." icon_state = "kamishimo" diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm index 115e7c14e5..b962e88e67 100644 --- a/code/modules/clothing/suits/storage.dm +++ b/code/modules/clothing/suits/storage.dm @@ -31,53 +31,55 @@ /obj/item/clothing/suit/storage/toggle flags_inv = HIDEHOLSTER var/open = 0 //0 is closed, 1 is open, -1 means it won't be able to toggle - verb/toggle() - set name = "Toggle Coat Buttons" - set category = "Object" - set src in usr - if(!usr.canmove || usr.stat || usr.restrained()) - return 0 - if(open == 1) //Will check whether icon state is currently set to the "open" or "closed" state and switch it around with a message to the user - open = 0 - icon_state = initial(icon_state) - flags_inv = HIDETIE|HIDEHOLSTER - to_chat(usr, "You button up the coat.") - else if(open == 0) - open = 1 - icon_state = "[icon_state]_open" - flags_inv = HIDEHOLSTER - to_chat(usr, "You unbutton the coat.") - else //in case some goofy admin switches icon states around without switching the icon_open or icon_closed - to_chat(usr, "You attempt to button-up the velcro on your [src], before promptly realising how silly you are.") - return - update_clothing_icon() //so our overlays update +/obj/item/clothing/suit/storage/toggle/verb/toggle() + set name = "Toggle Coat Buttons" + set category = "Object" + set src in usr + if(!usr.canmove || usr.stat || usr.restrained()) + return 0 + + if(open == 1) //Will check whether icon state is currently set to the "open" or "closed" state and switch it around with a message to the user + open = 0 + icon_state = initial(icon_state) + flags_inv = HIDETIE|HIDEHOLSTER + to_chat(usr, "You button up the coat.") + else if(open == 0) + open = 1 + icon_state = "[icon_state]_open" + flags_inv = HIDEHOLSTER + to_chat(usr, "You unbutton the coat.") + else //in case some goofy admin switches icon states around without switching the icon_open or icon_closed + to_chat(usr, "You attempt to button-up the velcro on your [src], before promptly realising how silly you are.") + return + update_clothing_icon() //so our overlays update /obj/item/clothing/suit/storage/hooded/toggle flags_inv = HIDEHOLSTER var/open = 0 //0 is closed, 1 is open, -1 means it won't be able to toggle - verb/toggle() - set name = "Toggle Coat Buttons" - set category = "Object" - set src in usr - if(!usr.canmove || usr.stat || usr.restrained()) - return 0 - if(open == 1) //Will check whether icon state is currently set to the "open" or "closed" state and switch it around with a message to the user - open = 0 - icon_state = initial(icon_state) - flags_inv = HIDETIE|HIDEHOLSTER - to_chat(usr, "You button up the coat.") - else if(open == 0) - open = 1 - icon_state = "[icon_state]_open" - flags_inv = HIDEHOLSTER - to_chat(usr, "You unbutton the coat.") - else //in case some goofy admin switches icon states around without switching the icon_open or icon_closed - to_chat(usr, "You attempt to button-up the velcro on your [src], before promptly realising how silly you are.") - return - update_clothing_icon() //so our overlays update +/obj/item/clothing/suit/storage/hooded/toggle/verb/toggle() + set name = "Toggle Coat Buttons" + set category = "Object" + set src in usr + if(!usr.canmove || usr.stat || usr.restrained()) + return 0 + + if(open == 1) //Will check whether icon state is currently set to the "open" or "closed" state and switch it around with a message to the user + open = 0 + icon_state = initial(icon_state) + flags_inv = HIDETIE|HIDEHOLSTER + to_chat(usr, "You button up the coat.") + else if(open == 0) + open = 1 + icon_state = "[icon_state]_open" + flags_inv = HIDEHOLSTER + to_chat(usr, "You unbutton the coat.") + else //in case some goofy admin switches icon states around without switching the icon_open or icon_closed + to_chat(usr, "You attempt to button-up the velcro on your [src], before promptly realising how silly you are.") + return + update_clothing_icon() //so our overlays update //New Vest 4 pocket storage and badge toggles, until suit accessories are a thing. @@ -90,21 +92,22 @@ /obj/item/clothing/suit/storage/vest var/icon_badge var/icon_nobadge - verb/toggle() - set name ="Adjust Badge" - set category = "Object" - set src in usr - if(!usr.canmove || usr.stat || usr.restrained()) - return 0 - if(icon_state == icon_badge) - icon_state = icon_nobadge - to_chat(usr, "You conceal \the [src]'s badge.") - else if(icon_state == icon_nobadge) - icon_state = icon_badge - to_chat(usr, "You reveal \the [src]'s badge.") - else - to_chat(usr, "\The [src] does not have a badge.") - return - update_clothing_icon() +/obj/item/clothing/suit/storage/vest/verb/toggle() + set name ="Adjust Badge" + set category = "Object" + set src in usr + if(!usr.canmove || usr.stat || usr.restrained()) + return 0 + + if(icon_state == icon_badge) + icon_state = icon_nobadge + to_chat(usr, "You conceal \the [src]'s badge.") + else if(icon_state == icon_nobadge) + icon_state = icon_badge + to_chat(usr, "You reveal \the [src]'s badge.") + else + to_chat(usr, "\The [src] does not have a badge.") + return + update_clothing_icon() diff --git a/code/modules/clothing/under/accessories/armor.dm b/code/modules/clothing/under/accessories/armor.dm index e20fac493a..032830294c 100644 --- a/code/modules/clothing/under/accessories/armor.dm +++ b/code/modules/clothing/under/accessories/armor.dm @@ -395,7 +395,7 @@ // Helmet Covers ///////////////// -obj/item/clothing/accessory/armor/helmcover +/obj/item/clothing/accessory/armor/helmcover name = "helmet cover" desc = "A fabric cover for armored helmets." icon_override = 'icons/mob/ties.dmi' diff --git a/code/modules/clothing/under/accessories/badges.dm b/code/modules/clothing/under/accessories/badges.dm index 085279c424..75e8dc8e4d 100644 --- a/code/modules/clothing/under/accessories/badges.dm +++ b/code/modules/clothing/under/accessories/badges.dm @@ -109,15 +109,10 @@ /obj/item/weapon/storage/box/holobadge name = "holobadge box" desc = "A box claiming to contain holobadges." - New() - new /obj/item/clothing/accessory/badge/holo(src) - new /obj/item/clothing/accessory/badge/holo(src) - new /obj/item/clothing/accessory/badge/holo(src) - new /obj/item/clothing/accessory/badge/holo(src) - new /obj/item/clothing/accessory/badge/holo/cord(src) - new /obj/item/clothing/accessory/badge/holo/cord(src) - ..() - return + starts_with = list( + /obj/item/clothing/accessory/badge/holo = 4, + /obj/item/clothing/accessory/badge/holo/cord = 2 + ) /obj/item/clothing/accessory/badge/holo/warden name = "warden's holobadge" @@ -140,16 +135,14 @@ /obj/item/weapon/storage/box/holobadge/hos name = "holobadge box" desc = "A box claiming to contain holobadges." - New() - new /obj/item/clothing/accessory/badge/holo(src) - new /obj/item/clothing/accessory/badge/holo(src) - new /obj/item/clothing/accessory/badge/holo/warden(src) - new /obj/item/clothing/accessory/badge/holo/detective(src) - new /obj/item/clothing/accessory/badge/holo/detective(src) - new /obj/item/clothing/accessory/badge/holo/hos(src) - new /obj/item/clothing/accessory/badge/holo/cord(src) - ..() - return + starts_with = list( + /obj/item/clothing/accessory/badge/holo = 2, + /obj/item/clothing/accessory/badge/holo/warden = 1, + /obj/item/clothing/accessory/badge/holo/detective = 2, + /obj/item/clothing/accessory/badge/holo/hos = 1, + /obj/item/clothing/accessory/badge/holo/cord = 1 + + ) // Synthmorph bag / Corporation badges. Primarily used on the robobag, but can be worn. Default is NT. diff --git a/code/modules/compass/compass_waypoint.dm b/code/modules/compass/compass_waypoint.dm index 2895d90096..24f9978bb8 100644 --- a/code/modules/compass/compass_waypoint.dm +++ b/code/modules/compass/compass_waypoint.dm @@ -25,6 +25,3 @@ M.Translate(0, (name ? COMPASS_LABEL_OFFSET-4 : COMPASS_LABEL_OFFSET)) M.Turn(ATAN2(cy-y, cx-x)+180) compass_overlay.transform = M - -#undef COMPASS_PERIOD -#undef COMPASS_INTERVAL diff --git a/code/modules/compass/^compass.dm b/code/modules/compass/~compass.dm similarity index 100% rename from code/modules/compass/^compass.dm rename to code/modules/compass/~compass.dm diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 5e85c0123c..aadafb9b66 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -190,7 +190,7 @@ // Check for required access. var/obj/item/weapon/card/id/current_id = M.wear_id - if(citem.req_access && citem.req_access > 0) + if(citem.req_access && citem.req_access > 0) // These are numbers, not lists if(!(istype(current_id) && (citem.req_access in current_id.access))) log_debug("Custom Item: [key_name(M)] Does not have required access.") continue diff --git a/code/modules/detectivework/forensics.dm b/code/modules/detectivework/forensics.dm index 7bb68feb34..3f6dc119d0 100644 --- a/code/modules/detectivework/forensics.dm +++ b/code/modules/detectivework/forensics.dm @@ -5,12 +5,12 @@ //This is the output of the stringpercent(print) proc, and means about 80% of //the print must be there for it to be complete. (Prints are 32 digits) var/const/FINGERPRINT_COMPLETE = 6 -proc/is_complete_print(var/print) +/proc/is_complete_print(var/print) return stringpercent(print) <= FINGERPRINT_COMPLETE -atom/var/list/suit_fibers +/atom/var/list/suit_fibers -atom/proc/add_fibers(mob/living/carbon/human/M) +/atom/proc/add_fibers(mob/living/carbon/human/M) if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves)) var/obj/item/clothing/gloves/G = M.gloves if(G.transfer_blood) //bloodied gloves transfer blood to touched objects diff --git a/code/modules/economy/Events.dm b/code/modules/economy/Events.dm index 9ce263cd17..1b14f0b78c 100644 --- a/code/modules/economy/Events.dm +++ b/code/modules/economy/Events.dm @@ -26,16 +26,16 @@ if(INDUSTRIAL_ACCIDENT) dearer_goods = list(EMERGENCY, BIOMEDICAL, ROBOTICS) if(BIOHAZARD_OUTBREAK) - dearer_goods = list(BIOMEDICAL, GAS) + dearer_goods = list(BIOMEDICAL, GASEOUS) if(PIRATES) dearer_goods = list(SECURITY, MINERALS) if(CORPORATE_ATTACK) dearer_goods = list(SECURITY, MAINTENANCE) if(ALIEN_RAIDERS) dearer_goods = list(BIOMEDICAL, ANIMALS) - cheaper_goods = list(GAS, MINERALS) + cheaper_goods = list(GASEOUS, MINERALS) if(AI_LIBERATION) - dearer_goods = list(EMERGENCY, GAS, MAINTENANCE) + dearer_goods = list(EMERGENCY, GASEOUS, MAINTENANCE) if(MOURNING) cheaper_goods = list(MINERALS, MAINTENANCE) if(CULT_CELL_REVEALED) diff --git a/code/modules/economy/Events_Mundane.dm b/code/modules/economy/Events_Mundane.dm index 9c6a428852..29f1457fd2 100644 --- a/code/modules/economy/Events_Mundane.dm +++ b/code/modules/economy/Events_Mundane.dm @@ -1,129 +1,4 @@ -/* /datum/event/mundane_news - endWhen = 10 - -/datum/event/mundane_news/announce() - var/datum/trade_destination/affected_dest = pickweight(weighted_mundaneevent_locations) - var/event_type = 0 - if(affected_dest.viable_mundane_events.len) - event_type = pick(affected_dest.viable_mundane_events) - - if(!event_type) - return - - var/author = "The "+using_map.starsys_name+" Times" - var/channel = author - - //see if our location has custom event info for this event - var/body = affected_dest.get_custom_eventstring() - if(!body) - body = "" - switch(event_type) - if(RESEARCH_BREAKTHROUGH) - body = "A major breakthough in the field of [pick("phoron research","super-compressed materials","nano-augmentation","bluespace research","volatile power manipulation")] \ - was announced [pick("yesterday","a few days ago","last week","earlier this month")] by a private firm on [affected_dest.name]. \ - [using_map.company_name] declined to comment as to whether this could impinge on profits." - - if(ELECTION) - body = "The pre-selection of an additional candidates was announced for the upcoming [pick("supervisors council","advisory board","governership","board of inquisitors")] \ - election on [affected_dest.name] was announced earlier today, \ - [pick("media mogul","web celebrity", "industry titan", "superstar", "famed chef", "popular gardener", "ex-army officer", "multi-billionaire")] \ - [random_name(pick(MALE,FEMALE))]. In a statement to the media they said '[pick("My only goal is to help the [pick("sick","poor","children")]",\ - "I will maintain my company's record profits","I believe in our future","We must return to our moral core","Just like... chill out dudes")]'." - - if(RESIGNATION) - body = "[using_map.company_name] regretfully announces the resignation of [pick("Sector Admiral","Division Admiral","Ship Admiral","Vice Admiral")] [random_name(pick(MALE,FEMALE))]." - if(prob(25)) - var/locstring = pick("Segunda","Salusa","Cepheus","Andromeda","Gruis","Corona","Aquila","Asellus") + " " + pick("I","II","III","IV","V","VI","VII","VIII") - body += " In a ceremony on [affected_dest.name] this afternoon, they will be awarded the \ - [pick("Red Star of Sacrifice","Purple Heart of Heroism","Blue Eagle of Loyalty","Green Lion of Ingenuity")] for " - if(prob(33)) - body += "their actions at the Battle of [pick(locstring,"REDACTED")]." - else if(prob(50)) - body += "their contribution to the colony of [locstring]." - else - body += "their loyal service over the years." - else if(prob(33)) - body += " They are expected to settle down in [affected_dest.name], where they have been granted a handsome pension." - else if(prob(50)) - body += " The news was broken on [affected_dest.name] earlier today, where they cited reasons of '[pick("health","family","REDACTED")]'" - else - body += " Administration Aerospace wishes them the best of luck in their retirement ceremony on [affected_dest.name]." - - if(CELEBRITY_DEATH) - body = "It is with regret today that we announce the sudden passing of the " - if(prob(33)) - body += "[pick("distinguished","decorated","veteran","highly respected")] \ - [pick("Ship's Captain","Vice Admiral","Colonel","Lieutenant Colonel")] " - else if(prob(50)) - body += "[pick("award-winning","popular","highly respected","trend-setting")] \ - [pick("comedian","singer/songwright","artist","playwright","TV personality","model")] " - else - body += "[pick("successful","highly respected","ingenious","esteemed")] \ - [pick("academic","Professor","Doctor","Scientist")] " - - body += "[random_name(pick(MALE,FEMALE))] on [affected_dest.name] [pick("last week","yesterday","this morning","two days ago","three days ago")]\ - [pick(". Assassination is suspected, but the perpetrators have not yet been brought to justice",\ - " due to mercenary infiltrators (since captured)",\ - " during an industrial accident",\ - " due to [pick("heart failure","kidney failure","liver failure","brain hemorrhage")]")]" - - if(BARGAINS) - body += "BARGAINS! BARGAINS! BARGAINS! Commerce Control on [affected_dest.name] wants you to know that everything must go! Across all retail centres, \ - all goods are being slashed, and all retailors are onboard - so come on over for the \[shopping\] time of your life." - - if(SONG_DEBUT) - body += "[pick("Singer","Singer/songwriter","Saxophonist","Pianist","Guitarist","TV personality","Star")] [random_name(pick(MALE,FEMALE))] \ - announced the debut of their new [pick("single","album","EP","label")] '[pick("Everyone's","Look at the","Baby don't eye those","All of those","Dirty nasty")] \ - [pick("roses","three stars","starships","nanobots","cyborgs","Skrell","Sren'darr")] \ - [pick("on Venus","on Reade","on Moghes","in my hand","slip through my fingers","die for you","sing your heart out","fly away")]' \ - with [pick("pre-puchases available","a release tour","cover signings","a launch concert")] on [affected_dest.name]." - - if(MOVIE_RELEASE) - body += "From the [pick("desk","home town","homeworld","mind")] of [pick("acclaimed","award-winning","popular","stellar")] \ - [pick("playwright","author","director","actor","TV star")] [random_name(pick(MALE,FEMALE))] comes the latest sensation: '\ - [pick("Deadly","The last","Lost","Dead")] [pick("Starships","Warriors","outcasts","Tajarans","Unathi","Skrell")] \ - [pick("of","from","raid","go hunting on","visit","ravage","pillage","destroy")] \ - [pick("Moghes","Earth","Biesel","Meralar","Rarkajar","the Void","the Edge of Space")]'.\ - . Own it on webcast today, or visit the galactic premier on [affected_dest.name]!" - - if(BIG_GAME_HUNTERS) - body += "Game hunters on [affected_dest.name] " - if(prob(33)) - body += "were surprised when an unusual species experts have since identified as \ - [pick("a subclass of mammal","a divergent abhuman species","an intelligent species of lemur","organic/cyborg hybrids")] turned up. Believed to have been brought in by \ - [pick("alien smugglers","early colonists","mercenary raiders","unwitting tourists")], this is the first such specimen discovered in the wild." - else if(prob(50)) - body += "were attacked by a vicious [pick("nas'r","diyaab","samak","predator which has not yet been identified")]\ - . Officials urge caution, and locals are advised to stock up on armaments." - else - body += "brought in an unusually [pick("valuable","rare","large","vicious","intelligent")] [pick("mammal","predator","farwa","samak")] for inspection \ - [pick("today","yesterday","last week")]. Speculators suggest they may be tipped to break several records." - - if(GOSSIP) - body += "[pick("TV host","Webcast personality","Superstar","Model","Actor","Singer")] [random_name(pick(MALE,FEMALE))] " - if(prob(33)) - body += "and their partner announced the birth of their [pick("first","second","third")] child on [affected_dest.name] early this morning. \ - Doctors say the child is well, and the parents are considering " - if(prob(50)) - body += capitalize(pick(first_names_female)) - else - body += capitalize(pick(first_names_male)) - body += " for the name." - else if(prob(50)) - body += "announced their [pick("split","break up","marriage","engagement")] with [pick("TV host","webcast personality","superstar","model","actor","singer")] \ - [random_name(pick(MALE,FEMALE))] at [pick("a society ball","a new opening","a launch","a club")] on [affected_dest.name] yesterday, pundits are shocked." - else - body += "is recovering from plastic surgery in a clinic on [affected_dest.name] for the [pick("second","third","fourth")] time, reportedly having made the decision in response to " - body += "[pick("unkind comments by an ex","rumours started by jealous friends",\ - "the decision to be dropped by a major sponsor","a disasterous interview on [using_map.starsys_name] Tonight")]." - if(TOURISM) - body += "Tourists are flocking to [affected_dest.name] after the surprise announcement of [pick("major shopping bargains by a wily retailer",\ - "a huge new ARG by a popular entertainment company","a secret tour by popular artiste [random_name(pick(MALE,FEMALE))]")]. \ - The [using_map.starsys_name] Times is offering discount tickets for two to see [random_name(pick(MALE,FEMALE))] live in return for eyewitness reports and up to the minute coverage." - - news_network.SubmitArticle(body, author, channel, null, 1) -*/ /datum/event/trivial_news endWhen = 10 @@ -140,7 +15,7 @@ "Pens proclaim pencils obsolete, 'lead is dead'.",\ "Rock and paper sues scissors for discrimination.",\ "Steak tell-all book reveals he never liked sitting by potato.",\ - "Woodchuck stops counting how many times hes chucked 'Never again'.",\ + "Woodchuck stops counting how many times he�s chucked 'Never again'.",\ "[affected_dest.name] clerk first person able to pronounce '@*$%!'.",\ "[affected_dest.name] delis serving boiled paperback dictionaries, 'Adjectives chewy' customers declare.",\ "[affected_dest.name] weather deemed 'boring'; meteors and rad storms to be imported.",\ @@ -156,8 +31,8 @@ "Skrell marries computer; wedding attended by 100 modems.",\ "Chef reports successfully using harmonica as cheese grater.",\ "[using_map.company_name] invents handkerchief that says 'Bless you' after sneeze.",\ - "Clone accused of posing for other cloness school photo.",\ - "Clone accused of stealing other cloness employee of the month award.",\ + "Clone accused of posing for other clones�s school photo.",\ + "Clone accused of stealing other clones�s employee of the month award.",\ "Woman robs station with hair dryer; crewmen love new style.",\ "This space for rent.",\ "[affected_dest.name] Baker Wins Pickled Crumpet Toss Three Years Running",\ diff --git a/code/modules/economy/TradeDestinations.dm b/code/modules/economy/TradeDestinations.dm index fbe4003e81..8225e34efc 100644 --- a/code/modules/economy/TradeDestinations.dm +++ b/code/modules/economy/TradeDestinations.dm @@ -11,7 +11,7 @@ var/list/weighted_mundaneevent_locations = list() var/can_shuttle_here = 0 //one day crew from the station will be able to travel to this destination var/list/viable_random_events = list() var/list/temp_price_change[BIOMEDICAL] - var/list/viable_mundane_events = list() + var/mundane_probability = 0 /datum/trade_destination/proc/get_custom_eventstring(var/event_type) return null @@ -24,7 +24,7 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(SECURITY_BREACH, CORPORATE_ATTACK, AI_LIBERATION) - viable_mundane_events = list(ELECTION, RESIGNATION, CELEBRITY_DEATH) + mundane_probability = 3 /datum/trade_destination/nohio name = "New Ohio" @@ -33,7 +33,7 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(SECURITY_BREACH, CULT_CELL_REVEALED, BIOHAZARD_OUTBREAK, PIRATES, ALIEN_RAIDERS) - viable_mundane_events = list(RESEARCH_BREAKTHROUGH, RESEARCH_BREAKTHROUGH, BARGAINS, GOSSIP) + mundane_probability = 4 /datum/trade_destination/sophia name = "Sophia" @@ -42,7 +42,7 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(INDUSTRIAL_ACCIDENT, PIRATES, CORPORATE_ATTACK) - viable_mundane_events = list(RESEARCH_BREAKTHROUGH, RESEARCH_BREAKTHROUGH) + mundane_probability = 2 /datum/trade_destination/jade name = "Jade" @@ -51,7 +51,7 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(PIRATES, INDUSTRIAL_ACCIDENT) - viable_mundane_events = list(TOURISM) + mundane_probability = 1 /datum/trade_destination/sif name = "Sif" @@ -60,7 +60,7 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING) - viable_mundane_events = list(BARGAINS, GOSSIP, SONG_DEBUT, MOVIE_RELEASE, ELECTION, TOURISM, RESIGNATION, CELEBRITY_DEATH) + mundane_probability = 8 /datum/trade_destination/mars name = "Mars" @@ -69,7 +69,7 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(RIOTS, INDUSTRIAL_ACCIDENT, BIOHAZARD_OUTBREAK, CULT_CELL_REVEALED, FESTIVAL, MOURNING) - viable_mundane_events = list(ELECTION, TOURISM, RESIGNATION) + mundane_probability = 3 /datum/trade_destination/nisp name = "Nisp" @@ -78,7 +78,7 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(WILD_ANIMAL_ATTACK, CULT_CELL_REVEALED, FESTIVAL, MOURNING, ANIMAL_RIGHTS_RAID, ALIEN_RAIDERS) - viable_mundane_events = list(ELECTION, TOURISM, BIG_GAME_HUNTERS, RESIGNATION) + mundane_probability = 4 /datum/trade_destination/abelsrest name = "Abel's Rest" @@ -87,4 +87,4 @@ var/list/weighted_mundaneevent_locations = list() willing_to_buy = list() willing_to_sell = list() viable_random_events = list(WILD_ANIMAL_ATTACK, CULT_CELL_REVEALED, FESTIVAL, MOURNING, ANIMAL_RIGHTS_RAID, ALIEN_RAIDERS) - viable_mundane_events = list(ELECTION, TOURISM, BIG_GAME_HUNTERS, RESIGNATION) + mundane_probability = 4 diff --git a/code/modules/economy/cash.dm b/code/modules/economy/cash.dm index 924fdfb6d7..b54df3cfc1 100644 --- a/code/modules/economy/cash.dm +++ b/code/modules/economy/cash.dm @@ -141,7 +141,7 @@ desc = "It's worth 1000 Thalers." worth = 1000 -proc/spawn_money(var/sum, spawnloc, mob/living/carbon/human/human_user as mob) +/proc/spawn_money(var/sum, spawnloc, mob/living/carbon/human/human_user as mob) var/obj/item/weapon/spacecash/SC = new (spawnloc) SC.set_worth(sum) @@ -157,9 +157,10 @@ proc/spawn_money(var/sum, spawnloc, mob/living/carbon/human/human_user as mob) drop_sound = 'sound/items/drop/card.ogg' pickup_sound = 'sound/items/pickup/card.ogg' var/owner_name = "" //So the ATM can set it so the EFTPOS can put a valid name on transactions. - attack_self() return //Don't act - attackby() return //like actual - update_icon() return //space cash + +/obj/item/weapon/spacecash/ewallet/attack_self() return //Don't act +/obj/item/weapon/spacecash/ewallet/attackby() return //like actual +/obj/item/weapon/spacecash/ewallet/update_icon() return //space cash /obj/item/weapon/spacecash/ewallet/examine(mob/user) . = ..() diff --git a/code/modules/economy/economy_misc.dm b/code/modules/economy/economy_misc.dm index 4dce5a62a8..a44c7c03fd 100644 --- a/code/modules/economy/economy_misc.dm +++ b/code/modules/economy/economy_misc.dm @@ -3,7 +3,6 @@ #define WILD_ANIMAL_ATTACK 2 #define INDUSTRIAL_ACCIDENT 3 #define BIOHAZARD_OUTBREAK 4 -#define WARSHIPS_ARRIVE 5 #define PIRATES 6 #define CORPORATE_ATTACK 7 #define ALIEN_RAIDERS 8 @@ -14,37 +13,15 @@ #define ANIMAL_RIGHTS_RAID 13 #define FESTIVAL 14 -#define RESEARCH_BREAKTHROUGH 15 -#define BARGAINS 16 -#define SONG_DEBUT 17 -#define MOVIE_RELEASE 18 -#define BIG_GAME_HUNTERS 19 -#define ELECTION 20 -#define GOSSIP 21 -#define TOURISM 22 -#define CELEBRITY_DEATH 23 -#define RESIGNATION 24 - -#define DEFAULT 1 - -#define ADMINISTRATIVE 2 -#define CLOTHING 3 -#define SECURITY 4 -#define SPECIAL_SECURITY 5 - -#define FOOD 6 -#define ANIMALS 7 - -#define MINERALS 8 - -#define EMERGENCY 9 -#define GAS 10 -#define MAINTENANCE 11 -#define ELECTRICAL 12 -#define ROBOTICS 13 -#define BIOMEDICAL 14 - -#define GEAR_EVA 15 +#define SECURITY 1 +#define FOOD 2 +#define ANIMALS 3 +#define MINERALS 4 +#define EMERGENCY 5 +#define GASEOUS 6 +#define MAINTENANCE 7 +#define ROBOTICS 8 +#define BIOMEDICAL 9 //---- The following corporations are friendly with NanoTrasen and loosely enable trade and travel: @@ -86,7 +63,7 @@ var/global/economy_init = 0 for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination) var/datum/trade_destination/D = new loc_type weighted_randomevent_locations[D] = D.viable_random_events.len - weighted_mundaneevent_locations[D] = D.viable_mundane_events.len + weighted_mundaneevent_locations[D] = D.mundane_probability create_station_account() diff --git a/code/modules/economy/price_list.dm b/code/modules/economy/price_list.dm index b6b2b6e1b0..23ce932f06 100644 --- a/code/modules/economy/price_list.dm +++ b/code/modules/economy/price_list.dm @@ -980,9 +980,8 @@ /obj/item/weapon/reagent_containers/food/snacks/dionaroast price_tag = 25 -/obj/item/pizzabox - get_item_cost() - return get_item_cost(pizza) +/obj/item/pizzabox/get_item_cost() + return get_item_cost(pizza) //***************// diff --git a/code/modules/emotes/definitions/audible.dm b/code/modules/emotes/definitions/audible.dm index 15f547b9e8..c233cc1ccc 100644 --- a/code/modules/emotes/definitions/audible.dm +++ b/code/modules/emotes/definitions/audible.dm @@ -12,7 +12,7 @@ emote_message_radio_synthetic = emote_message_synthetic_3p /decl/emote/audible/deathgasp_alien - key = "deathgasp" + key = "adeathgasp" emote_message_3p = "lets out a waning guttural screech, green blood bubbling from its maw." /decl/emote/audible/whimper @@ -29,7 +29,7 @@ emote_message_3p = "scretches." /decl/emote/audible/choke - key ="choke" + key = "choke" emote_message_3p = "chokes." conscious = FALSE @@ -63,7 +63,7 @@ emote_message_3p = "boops." /decl/emote/audible/beep - key = "beep" + key = "bbeep" emote_message_3p = "You beep." emote_message_3p = "beeps." emote_sound = 'sound/machines/twobeep.ogg' @@ -133,18 +133,18 @@ emote_message_3p = "grunts." /decl/emote/audible/bug_hiss - key ="hiss" + key = "bhiss" emote_message_3p_target = "hisses at TARGET." emote_message_3p = "hisses." emote_sound = 'sound/voice/BugHiss.ogg' /decl/emote/audible/bug_buzz - key ="buzz" + key = "bbuzz" emote_message_3p = "buzzes its wings." emote_sound = 'sound/voice/BugBuzz.ogg' /decl/emote/audible/bug_chitter - key ="chitter" + key = "chitter" emote_message_3p = "chitters." emote_sound = 'sound/voice/Bug.ogg' @@ -213,7 +213,7 @@ emote_sound = 'sound/voice/teshsqueak.ogg' // Copyright CC BY 3.0 InspectorJ (freesound.org) for the source audio. /decl/emote/audible/teshchirp - key = "chirp" + key = "tchirp" emote_message_1p = "You chirp!" emote_message_3p = "chirps!" emote_message_1p_target = "You chirp at TARGET!" diff --git a/code/modules/emotes/definitions/audible_scream.dm b/code/modules/emotes/definitions/audible_scream.dm index 00ed9c29fc..71cf73cd45 100644 --- a/code/modules/emotes/definitions/audible_scream.dm +++ b/code/modules/emotes/definitions/audible_scream.dm @@ -9,7 +9,7 @@ return "You [H.species.scream_verb_1p]!" . = ..() -/decl/emote/audible/cough/get_emote_message_3p(var/atom/user, var/atom/target, var/extra_params) +/decl/emote/audible/scream/get_emote_message_3p(var/atom/user, var/atom/target, var/extra_params) if(ishuman(user)) var/mob/living/carbon/human/H = user return "[H.species.scream_verb_3p]!" diff --git a/code/modules/emotes/definitions/slimes.dm b/code/modules/emotes/definitions/slimes.dm index bde5b580aa..65f50b069d 100644 --- a/code/modules/emotes/definitions/slimes.dm +++ b/code/modules/emotes/definitions/slimes.dm @@ -12,21 +12,21 @@ return ..() && isslime(user) /decl/emote/slime/pout - key = "pout" + key = "mpout" mood = "pout" /decl/emote/slime/sad - key = "sad" + key = "msad" mood = "sad" /decl/emote/slime/angry - key = "angry" + key = "mangry" mood = "angry" /decl/emote/slime/frown - key = "frown" + key = "mfrown" mood = "mischevous" /decl/emote/slime/smile - key = "smile" + key = "msmile" mood = ":3" diff --git a/code/modules/emotes/definitions/visible.dm b/code/modules/emotes/definitions/visible.dm index fa19ac257a..d37058626d 100644 --- a/code/modules/emotes/definitions/visible.dm +++ b/code/modules/emotes/definitions/visible.dm @@ -1,5 +1,5 @@ /decl/emote/visible - key ="tail" + key = "tail" emote_message_3p = "waves USER_THEIR tail." message_type = VISIBLE_MESSAGE @@ -9,48 +9,48 @@ emote_message_3p = "scratches." /decl/emote/visible/drool - key ="drool" + key = "drool" emote_message_3p = "drools." conscious = FALSE /decl/emote/visible/nod - key ="nod" + key = "nod" emote_message_3p_target = "nods USER_THEIR head at TARGET." emote_message_3p = "nods USER_THEIR head." /decl/emote/visible/sway - key ="sway" + key = "sways" emote_message_3p = "sways around dizzily." /decl/emote/visible/sulk - key ="sulk" + key = "sulk" emote_message_3p = "sulks down sadly." /decl/emote/visible/dance - key ="dance" + key = "dance" check_restraints = TRUE emote_message_3p = "dances around happily." /decl/emote/visible/roll - key ="roll" + key = "roll" check_restraints = TRUE emote_message_3p = "rolls." /decl/emote/visible/shake - key ="shake" + key = "shake" emote_message_3p = "shakes USER_THEIR head." /decl/emote/visible/jump - key ="jump" + key = "jump" emote_message_3p = "jumps!" /decl/emote/visible/shiver - key ="shiver" + key = "shiver" emote_message_3p = "shivers." conscious = FALSE /decl/emote/visible/collapse - key ="collapse" + key = "collapse" emote_message_3p = "collapses!" /decl/emote/visible/collapse/do_extra(var/mob/user) @@ -216,7 +216,7 @@ emote_message_3p = "vibrates!" /decl/emote/visible/deathgasp_robot - key = "deathgasp" + key = "rdeathgasp" emote_message_3p = "shudders violently for a moment, then becomes motionless, USER_THEIR eyes slowly darkening." /decl/emote/visible/handshake diff --git a/code/modules/emotes/emote_define.dm b/code/modules/emotes/emote_define.dm index c0a480346b..443afab09c 100644 --- a/code/modules/emotes/emote_define.dm +++ b/code/modules/emotes/emote_define.dm @@ -103,11 +103,14 @@ var/global/list/emotes_by_key if(target) use_1p = replace_target_tokens(use_1p, target) use_1p = "[capitalize(replace_user_tokens(use_1p, user))]" - var/use_3p = get_emote_message_3p(user, target, extra_params) - if(use_3p) + var/prefinal_3p + var/use_3p + var/raw_3p = get_emote_message_3p(user, target, extra_params) + if(raw_3p) if(target) - use_3p = replace_target_tokens(use_3p, target) - use_3p = "\The [user] [replace_user_tokens(use_3p, user)]" + raw_3p = replace_target_tokens(raw_3p, target) + prefinal_3p = replace_user_tokens(raw_3p, user) + use_3p = "\The [user] [prefinal_3p]" var/use_radio = get_radio_message(user) if(use_radio) if(target) @@ -124,12 +127,12 @@ var/global/list/emotes_by_key if(isliving(user)) var/mob/living/L = user if(L.silent) - M.visible_message(message = "[user] opens their mouth silently!", self_message = "You cannot say anything!", blind_message = emote_message_impaired) + M.visible_message(message = "[user] opens their mouth silently!", self_message = "You cannot say anything!", blind_message = emote_message_impaired, runemessage = "opens their mouth silently!") return else - M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range, radio_message = use_radio) + M.audible_message(message = use_3p, self_message = use_1p, deaf_message = emote_message_impaired, hearing_distance = use_range, radio_message = use_radio, runemessage = prefinal_3p) else - M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range) + M.visible_message(message = use_3p, self_message = use_1p, blind_message = emote_message_impaired, range = use_range, runemessage = prefinal_3p) do_extra(user, target) do_sound(user) diff --git a/code/modules/emotes/emote_mob.dm b/code/modules/emotes/emote_mob.dm index f315fd69c4..ca3392ad39 100644 --- a/code/modules/emotes/emote_mob.dm +++ b/code/modules/emotes/emote_mob.dm @@ -71,14 +71,15 @@ return if(!use_emote.mob_can_use(src)) - to_chat(src, SPAN_WARNING("You cannot use the emote '[act]'. Type say *help for a list of usable emotes.")) + to_chat(src, SPAN_WARNING("You cannot use the emote '[act]'. Type say *help for a list of usable emotes.")) return if(m_type != use_emote.message_type && use_emote.conscious && stat != CONSCIOUS) return if(use_emote.message_type == AUDIBLE_MESSAGE && is_muzzled()) - audible_message("\The [src] [use_emote.emote_message_muffled || "makes a muffled sound."]") + var/muffle_message = use_emote.emote_message_muffled || "makes a muffled sound." + audible_message("\The [src] [muffle_message]", runemessage = "[muffle_message]") return next_emote = world.time + use_emote.emote_delay @@ -141,7 +142,7 @@ subtext = html_encode(subtext) // Store the player's name in a nice bold, naturalement nametext = "[emoter]" - return pretext + nametext + subtext + return list("pretext" = pretext, "nametext" = nametext, "subtext" = subtext) /mob/proc/custom_emote(var/m_type = VISIBLE_MESSAGE, var/message, var/range = world.view) @@ -155,8 +156,14 @@ else input = message + var/list/formatted + var/runemessage if(input) - message = format_emote(src, message) + formatted = format_emote(src, message) + message = formatted["pretext"] + formatted["nametext"] + formatted["subtext"] + runemessage = formatted["subtext"] + // This is just personal preference (but I'm objectively right) that custom emotes shouldn't have periods at the end in runechat + runemessage = replacetext(runemessage,".","",length(runemessage),length(runemessage)+1) else return @@ -184,6 +191,7 @@ if(isobserver(M)) message = "[src] ([ghost_follow_link(src, M)]) [input]" M.show_message(message, m_type) + M.create_chat_message(src, "[runemessage]", FALSE, list("emote"), (m_type == AUDIBLE_MESSAGE)) for(var/obj in o_viewers) var/obj/O = obj diff --git a/code/modules/events/viral_infection.dm b/code/modules/events/viral_infection.dm index d24e774ed8..9bcad8837d 100644 --- a/code/modules/events/viral_infection.dm +++ b/code/modules/events/viral_infection.dm @@ -1,9 +1,9 @@ //var/global/list/event_viruses = list() // so that event viruses are kept around for admin logs, rather than being GCed -datum/event/viral_infection +/datum/event/viral_infection var/list/viruses = list() -datum/event/viral_infection/setup() +/datum/event/viral_infection/setup() announceWhen = rand(0, 3000) endWhen = announceWhen + 1 @@ -18,7 +18,7 @@ datum/event/viral_infection/setup() D.makerandom(strength) viruses += D -datum/event/viral_infection/announce() +/datum/event/viral_infection/announce() var/level if (severity == EVENT_LEVEL_MUNDANE) return @@ -30,7 +30,7 @@ datum/event/viral_infection/announce() if (severity == EVENT_LEVEL_MAJOR || prob(60)) command_announcement.Announce("Confirmed outbreak of level [level] biohazard aboard \the [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", new_sound = 'sound/AI/outbreak5.ogg') -datum/event/viral_infection/start() +/datum/event/viral_infection/start() if(!viruses.len) return var/list/candidates = list() //list of candidate keys diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index f0e942ab4f..5d399bdfe3 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -18,7 +18,7 @@ var/list/dreams = list( "unintelligible writings","a Fleet ship", ) -mob/living/carbon/proc/dream() +/mob/living/carbon/proc/dream() dreaming = 1 spawn(0) @@ -31,8 +31,8 @@ mob/living/carbon/proc/dream() dreaming = 0 return -mob/living/carbon/proc/handle_dreams() +/mob/living/carbon/proc/handle_dreams() if(client && !dreaming && prob(5)) dream() -mob/living/carbon/var/dreaming = 0 +/mob/living/carbon/var/dreaming = 0 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 51cf85b6a2..5fac3debd7 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -11,7 +11,7 @@ Gunshots/explosions/opening doors/less rare audio (done) */ -mob/living/carbon/var +/mob/living/carbon/var image/halimage image/halbody obj/halitem @@ -19,7 +19,7 @@ mob/living/carbon/var handling_hal = 0 hal_crit = 0 -mob/living/carbon/proc/handle_hallucinations() +/mob/living/carbon/proc/handle_hallucinations() if(handling_hal) return handling_hal = 1 while(client && hallucination > 20) @@ -211,7 +211,7 @@ mob/living/carbon/proc/handle_hallucinations() return start_txt + mocktxt + end_txt + "
    " -proc/check_panel(mob/M) +/proc/check_panel(mob/M) if (istype(M, /mob/living/carbon/human) || istype(M, /mob/living/silicon/ai)) if(M.hallucination < 15) return 1 @@ -241,87 +241,89 @@ proc/check_panel(mob/M) var/health = 100 - attackby(var/obj/item/weapon/P as obj, mob/user as mob) +/obj/effect/fake_attacker/attackby(var/obj/item/weapon/P as obj, mob/user as mob) + step_away(src,my_target,2) + for(var/mob/M in oviewers(world.view,my_target)) + to_chat(M, "[my_target] flails around wildly.") + my_target.show_message("[src] has been attacked by [my_target] ", 1) //Lazy. + + src.health -= P.force + + + return + +/obj/effect/fake_attacker/Crossed(var/mob/M, somenumber) + if(M == my_target) step_away(src,my_target,2) - for(var/mob/M in oviewers(world.view,my_target)) - to_chat(M, "[my_target] flails around wildly.") - my_target.show_message("[src] has been attacked by [my_target] ", 1) //Lazy. + if(prob(30)) + for(var/mob/O in oviewers(world.view , my_target)) + to_chat(O, "[my_target] stumbles around.") - src.health -= P.force +/obj/effect/fake_attacker/New() + ..() + QDEL_IN(src, 30 SECONDS) + step_away(src,my_target,2) + spawn attack_loop() + +/obj/effect/fake_attacker/Destroy() + if(my_target) + my_target.hallucinations -= src + return ..() - return - - Crossed(var/mob/M, somenumber) - if(M == my_target) - step_away(src,my_target,2) - if(prob(30)) - for(var/mob/O in oviewers(world.view , my_target)) - to_chat(O, "[my_target] stumbles around.") - - New() - ..() - spawn(300) - if(my_target) - my_target.hallucinations -= src - qdel(src) - step_away(src,my_target,2) - spawn attack_loop() +/obj/effect/fake_attacker/proc/updateimage() +// qdel(src.currentimage) - proc/updateimage() - // qdel(src.currentimage) + if(src.dir == NORTH) + qdel(src.currentimage) + src.currentimage = new /image(up,src) + else if(src.dir == SOUTH) + qdel(src.currentimage) + src.currentimage = new /image(down,src) + else if(src.dir == EAST) + qdel(src.currentimage) + src.currentimage = new /image(right,src) + else if(src.dir == WEST) + qdel(src.currentimage) + src.currentimage = new /image(left,src) + my_target << currentimage - if(src.dir == NORTH) - qdel(src.currentimage) - src.currentimage = new /image(up,src) - else if(src.dir == SOUTH) - qdel(src.currentimage) - src.currentimage = new /image(down,src) - else if(src.dir == EAST) - qdel(src.currentimage) - src.currentimage = new /image(right,src) - else if(src.dir == WEST) - qdel(src.currentimage) - src.currentimage = new /image(left,src) - my_target << currentimage - - - proc/attack_loop() - while(1) - sleep(rand(5,10)) - if(src.health < 0) - collapse() - continue - if(get_dist(src,my_target) > 1) - src.set_dir(get_dir(src,my_target)) - step_towards(src,my_target) - updateimage() - else - if(prob(15)) - if(weapon_name) - my_target << sound(pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')) - my_target.show_message("[my_target] has been attacked with [weapon_name] by [src.name] ", 1) - my_target.halloss += 8 - if(prob(20)) my_target.eye_blurry += 3 - if(prob(33)) - if(!locate(/obj/effect/overlay) in my_target.loc) - fake_blood(my_target) - else - my_target << sound(pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')) - my_target.show_message("[src.name] has punched [my_target]!", 1) - my_target.halloss += 4 - if(prob(33)) - if(!locate(/obj/effect/overlay) in my_target.loc) - fake_blood(my_target) - +/obj/effect/fake_attacker/proc/attack_loop() + while(1) + sleep(rand(5,10)) + if(src.health < 0) + collapse() + continue + if(get_dist(src,my_target) > 1) + src.set_dir(get_dir(src,my_target)) + step_towards(src,my_target) + updateimage() + else if(prob(15)) - step_away(src,my_target,2) + if(weapon_name) + my_target << sound(pick('sound/weapons/genhit1.ogg', 'sound/weapons/genhit2.ogg', 'sound/weapons/genhit3.ogg')) + my_target.show_message("[my_target] has been attacked with [weapon_name] by [src.name] ", 1) + my_target.halloss += 8 + if(prob(20)) my_target.eye_blurry += 3 + if(prob(33)) + if(!locate(/obj/effect/overlay) in my_target.loc) + fake_blood(my_target) + else + my_target << sound(pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')) + my_target.show_message("[src.name] has punched [my_target]!", 1) + my_target.halloss += 4 + if(prob(33)) + if(!locate(/obj/effect/overlay) in my_target.loc) + fake_blood(my_target) - proc/collapse() - collapse = 1 - updateimage() + if(prob(15)) + step_away(src,my_target,2) + +/obj/effect/fake_attacker/proc/collapse() + collapse = 1 + updateimage() /proc/fake_blood(var/mob/target) var/obj/effect/overlay/O = new/obj/effect/overlay(target.loc) diff --git a/code/modules/flufftext/TextFilters.dm b/code/modules/flufftext/TextFilters.dm index bc133a83b8..ff6a44c3dc 100644 --- a/code/modules/flufftext/TextFilters.dm +++ b/code/modules/flufftext/TextFilters.dm @@ -1,6 +1,6 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 -proc/Intoxicated(phrase) +/proc/Intoxicated(phrase) phrase = html_decode(phrase) var/leng=length(phrase) var/counter=length(phrase) @@ -23,7 +23,7 @@ proc/Intoxicated(phrase) newphrase+="[newletter]";counter-=1 return newphrase -proc/NewStutter(phrase,stunned) +/proc/NewStutter(phrase,stunned) phrase = html_decode(phrase) var/list/split_phrase = splittext(phrase," ") //Split it up into words. @@ -59,10 +59,10 @@ proc/NewStutter(phrase,stunned) return sanitize(jointext(split_phrase," ")) -proc/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness. +/proc/Stagger(mob/M,d) //Technically not a filter, but it relates to drunkenness. step(M, pick(d,turn(d,90),turn(d,-90))) -proc/Ellipsis(original_msg, chance = 50) +/proc/Ellipsis(original_msg, chance = 50) if(chance <= 0) return "..." if(chance >= 100) return original_msg diff --git a/code/modules/food/drinkingglass/glass_boxes.dm b/code/modules/food/drinkingglass/glass_boxes.dm index 2cd035843d..4573a5520f 100644 --- a/code/modules/food/drinkingglass/glass_boxes.dm +++ b/code/modules/food/drinkingglass/glass_boxes.dm @@ -2,92 +2,82 @@ name = "glassware box" desc = "A box of assorted glassware" can_hold = list(/obj/item/weapon/reagent_containers/food/drinks/glass2) - New() - ..() - new /obj/item/weapon/reagent_containers/food/drinks/glass2/square(src) - new /obj/item/weapon/reagent_containers/food/drinks/glass2/rocks(src) - new /obj/item/weapon/reagent_containers/food/drinks/glass2/shake(src) - new /obj/item/weapon/reagent_containers/food/drinks/glass2/cocktail(src) - new /obj/item/weapon/reagent_containers/food/drinks/glass2/shot(src) - new /obj/item/weapon/reagent_containers/food/drinks/glass2/pint(src) - new /obj/item/weapon/reagent_containers/food/drinks/glass2/mug(src) - new /obj/item/weapon/reagent_containers/food/drinks/glass2/wine(src) - new /obj/item/weapon/reagent_containers/food/drinks/metaglass(src) - new /obj/item/weapon/reagent_containers/food/drinks/metaglass/metapint(src) + starts_with = list( + /obj/item/weapon/reagent_containers/food/drinks/glass2/square, + /obj/item/weapon/reagent_containers/food/drinks/glass2/rocks, + /obj/item/weapon/reagent_containers/food/drinks/glass2/shake, + /obj/item/weapon/reagent_containers/food/drinks/glass2/cocktail, + /obj/item/weapon/reagent_containers/food/drinks/glass2/shot, + /obj/item/weapon/reagent_containers/food/drinks/glass2/pint, + /obj/item/weapon/reagent_containers/food/drinks/glass2/mug, + /obj/item/weapon/reagent_containers/food/drinks/glass2/wine, + /obj/item/weapon/reagent_containers/food/drinks/metaglass, + /obj/item/weapon/reagent_containers/food/drinks/metaglass/metapint + ) /obj/item/weapon/storage/box/glasses name = "box of glasses" - var/glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2 can_hold = list(/obj/item/weapon/reagent_containers/food/drinks/glass2) - New() - ..() - - for(var/i = 1 to 7) - new glass_type(src) + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2 = 7) /obj/item/weapon/storage/box/glasses/square name = "box of half-pint glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/square + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/square = 7) /obj/item/weapon/storage/box/glasses/rocks name = "box of rocks glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/rocks + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/rocks = 7) /obj/item/weapon/storage/box/glasses/shake name = "box of milkshake glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/shake + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/shake = 7) /obj/item/weapon/storage/box/glasses/cocktail name = "box of cocktail glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/cocktail + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/cocktail = 7) /obj/item/weapon/storage/box/glasses/shot name = "box of shot glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/shot + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/shot = 7) /obj/item/weapon/storage/box/glasses/pint name = "box of pint glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/pint + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/pint = 7) /obj/item/weapon/storage/box/glasses/mug name = "box of glass mugs" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/mug + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/mug = 7) /obj/item/weapon/storage/box/glasses/wine name = "box of wine glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/glass2/wine + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/glass2/wine = 7) /obj/item/weapon/storage/box/glasses/meta name = "box of half-pint metamorphic glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/metaglass + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/metaglass = 7) /obj/item/weapon/storage/box/glasses/meta/metapint name = "box of metamorphic pint glasses" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/metaglass/metapint + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/metaglass/metapint = 7) /obj/item/weapon/storage/box/glass_extras name = "box of cocktail garnishings" - var/extra_type = /obj/item/weapon/glass_extra can_hold = list(/obj/item/weapon/glass_extra) storage_slots = 14 - New() - ..() - - for(var/i = 1 to 14) - new extra_type(src) + starts_with = list(/obj/item/weapon/glass_extra = 14) /obj/item/weapon/storage/box/glass_extras/straws name = "box of straws" - extra_type = /obj/item/weapon/glass_extra/straw + starts_with = list(/obj/item/weapon/glass_extra/straw = 14) /obj/item/weapon/storage/box/glass_extras/sticks name = "box of drink sticks" - extra_type = /obj/item/weapon/glass_extra/stick + starts_with = list(/obj/item/weapon/glass_extra/stick = 14) /obj/item/weapon/storage/box/glasses/coffeecup name = "box of coffee cups" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/cup + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/cup = 7) /obj/item/weapon/storage/box/glasses/coffeemug name = "box of coffee mugs" - glass_type = /obj/item/weapon/reagent_containers/food/drinks/britcup \ No newline at end of file + starts_with = list(/obj/item/weapon/reagent_containers/food/drinks/britcup = 7) \ No newline at end of file diff --git a/code/modules/food/food/drinks/bottle.dm b/code/modules/food/food/drinks/bottle.dm index 1f7beec6b9..124240d906 100644 --- a/code/modules/food/food/drinks/bottle.dm +++ b/code/modules/food/food/drinks/bottle.dm @@ -12,7 +12,8 @@ var/obj/item/weapon/reagent_containers/glass/rag/rag = null var/rag_underlay = "rag" - on_reagent_change() return // To suppress price updating. Bottles have their own price tags. + +/obj/item/weapon/reagent_containers/food/drinks/bottle/on_reagent_change() return // To suppress price updating. Bottles have their own price tags. /obj/item/weapon/reagent_containers/food/drinks/bottle/Initialize() . = ..() diff --git a/code/modules/food/food/drinks/drinkingglass.dm b/code/modules/food/food/drinks/drinkingglass.dm index 7324dc8ad8..78e3c74775 100644 --- a/code/modules/food/food/drinks/drinkingglass.dm +++ b/code/modules/food/food/drinks/drinkingglass.dm @@ -10,47 +10,39 @@ center_of_mass = list("x"=16, "y"=10) matter = list("glass" = 500) - on_reagent_change() - /*if(reagents.reagent_list.len > 1 ) - icon_state = "glass_brown" - name = "Glass of Hooch" - desc = "Two or more drinks, mixed together."*/ - /*else if(reagents.reagent_list.len == 1) - for(var/datum/reagent/R in reagents.reagent_list) - switch(R.id)*/ - if (reagents.reagent_list.len > 0) - var/datum/reagent/R = reagents.get_master_reagent() +/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/on_reagent_change() + if (!length(reagents?.reagent_list)) + icon_state = "glass_empty" + name = "glass" + desc = "Your standard drinking glass." + center_of_mass = list("x"=16, "y"=10) + return + var/datum/reagent/R = reagents.get_master_reagent() - if(R.glass_icon_state) - icon_state = R.glass_icon_state - else - icon_state = "glass_brown" + if(R.glass_icon_state) + icon_state = R.glass_icon_state + else + icon_state = "glass_brown" - if(R.glass_name) - name = R.glass_name - else - name = "Glass of.. what?" + if(R.glass_name) + name = R.glass_name + else + name = "Glass of.. what?" - if(R.glass_desc) - desc = R.glass_desc - else - desc = "You can't really tell what this is." + if(R.glass_desc) + desc = R.glass_desc + else + desc = "You can't really tell what this is." - if(R.glass_center_of_mass) - center_of_mass = R.glass_center_of_mass - else - center_of_mass = list("x"=16, "y"=10) + if(R.glass_center_of_mass) + center_of_mass = R.glass_center_of_mass + else + center_of_mass = list("x"=16, "y"=10) - if(R.price_tag) - price_tag = R.price_tag - else - price_tag = null - else - icon_state = "glass_empty" - name = "glass" - desc = "Your standard drinking glass." - center_of_mass = list("x"=16, "y"=10) - return + if(R.price_tag) + price_tag = R.price_tag + else + price_tag = null /obj/item/weapon/reagent_containers/food/drinks/cup name = "coffee cup" @@ -60,54 +52,48 @@ volume = 30 center_of_mass = list("x"=16, "y"=16) - on_reagent_change() - if (reagents.reagent_list.len > 0) - var/datum/reagent/R = reagents.get_master_reagent() +/obj/item/weapon/reagent_containers/food/drinks/cup/on_reagent_change() + if (!length(reagents?.reagent_list)) + icon_state = "cup_empty" + name = "coffee cup" + desc = "The container of oriental luxuries." + center_of_mass = list("x"=16, "y"=16) + return + var/datum/reagent/R = reagents.get_master_reagent() - if(R.cup_icon_state) - icon_state = R.cup_icon_state - else - icon_state = "cup_brown" + if(R.cup_icon_state) + icon_state = R.cup_icon_state + else + icon_state = "cup_brown" - if(R.cup_name) - name = R.cup_name - else - name = "Cup of.. what?" + if(R.cup_name) + name = R.cup_name + else + name = "Cup of.. what?" - if(R.cup_desc) - desc = R.cup_desc - else - desc = "You can't really tell what this is." + if(R.cup_desc) + desc = R.cup_desc + else + desc = "You can't really tell what this is." - if(R.cup_center_of_mass) - center_of_mass = R.cup_center_of_mass - else - center_of_mass = list("x"=16, "y"=16) + if(R.cup_center_of_mass) + center_of_mass = R.cup_center_of_mass + else + center_of_mass = list("x"=16, "y"=16) - if(R.price_tag) - price_tag = R.price_tag - else - price_tag = null - - else - icon_state = "cup_empty" - name = "coffee cup" - desc = "The container of oriental luxuries." - center_of_mass = list("x"=16, "y"=16) - return + if(R.price_tag) + price_tag = R.price_tag + else + price_tag = null // for /obj/machinery/vending/sovietsoda -/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda - New() - ..() - reagents.add_reagent("sodawater", 50) - on_reagent_change() +/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/soda/New() + ..() + reagents.add_reagent("sodawater", 50) -/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola - New() - ..() - reagents.add_reagent("cola", 50) - on_reagent_change() +/obj/item/weapon/reagent_containers/food/drinks/drinkingglass/cola/New() + ..() + reagents.add_reagent("cola", 50) /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass name = "shot glass" @@ -119,20 +105,20 @@ /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/shotglass/on_reagent_change() overlays.Cut() + name = "shot glass" - if(reagents.total_volume) - var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1") + if(!reagents.total_volume) + return + var/image/filling = image('icons/obj/reagentfillings.dmi', src, "[icon_state]1") - switch(reagents.total_volume) - if(0 to 3) filling.icon_state = "[icon_state]1" - if(4 to 7) filling.icon_state = "[icon_state]5" - if(8 to INFINITY) filling.icon_state = "[icon_state]12" + switch(reagents.total_volume) + if(0 to 3) filling.icon_state = "[icon_state]1" + if(4 to 7) filling.icon_state = "[icon_state]5" + if(8 to INFINITY) filling.icon_state = "[icon_state]12" - filling.color += reagents.get_color() - overlays += filling - name = "shot glass of " + reagents.get_master_reagent_name() //No matter what, the glass will tell you the reagent's name. Might be too abusable in the future. - else - name = "shot glass" + filling.color += reagents.get_color() + overlays += filling + name += " of [reagents.get_master_reagent_name()]" //No matter what, the glass will tell you the reagent's name. Might be too abusable in the future. /obj/item/weapon/reagent_containers/food/drinks/drinkingglass/fitnessflask name = "fitness shaker" @@ -174,5 +160,4 @@ reagents.add_reagent("nutriment", 30) reagents.add_reagent("iron", 10) reagents.add_reagent("protein", 15) - reagents.add_reagent("water", 45) - on_reagent_change() \ No newline at end of file + reagents.add_reagent("water", 45) \ No newline at end of file diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index 856952dad6..ffc8070254 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -27,7 +27,7 @@ /obj/item/weapon/reagent_containers/food/snacks/Initialize() . = ..() if(nutriment_amt) - reagents.add_reagent("nutriment",(nutriment_amt*2),nutriment_desc) + reagents.add_reagent("nutriment",nutriment_amt,nutriment_desc) //Placeholder for effect that trigger on eating that aren't tied to reagents. /obj/item/weapon/reagent_containers/food/snacks/proc/On_Consume(var/mob/M) @@ -160,32 +160,26 @@ // Eating with forks if(istype(W,/obj/item/weapon/material/kitchen/utensil)) var/obj/item/weapon/material/kitchen/utensil/U = W - if(U.scoop_food) - if(!U.reagents) - U.create_reagents(5) + if(!U.reagents) + U.create_reagents(5) - if (U.reagents.total_volume > 0) - to_chat(user, "You already have something on your [U].") - return - - user.visible_message( \ - "[user] scoops up some [src] with \the [U]!", \ - "You scoop up some [src] with \the [U]!" \ - ) - - src.bitecount++ - U.overlays.Cut() - U.loaded = "[src]" - var/image/I = new(U.icon, "loadedfood") - I.color = src.filling_color - U.overlays += I - - reagents.trans_to_obj(U, min(reagents.total_volume,5)) - - if (reagents.total_volume <= 0) - qdel(src) + if (U.reagents.total_volume > 0) + to_chat(user, "You already have something on your [U].") return + user.visible_message( \ + "[user] scoops up some [src] with \the [U]!", \ + "You scoop up some [src] with \the [U]!" \ + ) + + bitecount++ + + reagents.trans_to_obj(U, min(reagents.total_volume,5)) + + if (reagents.total_volume <= 0) + qdel(src) + return + if (is_sliceable()) //these are used to allow hiding edge items in food that is not on a table/tray var/can_slice_here = isturf(src.loc) && ((locate(/obj/structure/table) in src.loc) || (locate(/obj/machinery/optable) in src.loc) || (locate(/obj/item/weapon/tray) in src.loc)) @@ -262,15 +256,15 @@ // the bites. No more contained reagents = no more bites. //Here is an example of the new formatting for anyone who wants to add more food items. -///obj/item/weapon/reagent_containers/food/snacks/xenoburger //Identification path for the object. -// name = "Xenoburger" //Name that displays in the UI. -// desc = "Smells caustic. Tastes like heresy." //Duh -// icon_state = "xburger" //Refers to an icon in food.dmi -// Initialize() //Don't mess with this. (We use Initialize now instead of New()) -// . = ..() //Same here. -// reagents.add_reagent("xenomicrobes", 10) //This is what is in the food item. you may copy/paste -// reagents.add_reagent("nutriment", 2) // this line of code for all the contents. -// bitesize = 3 //This is the amount each bite consumes. +///obj/item/weapon/reagent_containers/food/snacks/xenoburger //Identification path for the object. +// name = "Xenoburger" //Name that displays in the UI. +// desc = "Smells caustic. Tastes like heresy." //Duh +// icon_state = "xburger" //Refers to an icon in food.dmi +// nutriment_amt = 2 //How much nutriment to add. +// bitesize = 3 //This is the amount each bite consumes. +///obj/item/weapon/reagent_containers/food/snacks/xenoburger/Initialize() //Don't mess with this. (We use Initialize now instead of New()) +// . = ..() //Same here. +// reagents.add_reagent("xenomicrobes", 10) //This is what is in the food item. you may copy/paste this line of code for all the contents. @@ -284,12 +278,12 @@ center_of_mass = list("x"=17, "y"=11) nutriment_amt = 8 nutriment_desc = list("apples" = 3,"salad" = 5) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/aesirsalad/Initialize() . = ..() reagents.add_reagent("doctorsdelight", 8) reagents.add_reagent("tricordrazine", 8) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/candy/donor name = "Donor Candy" @@ -297,11 +291,11 @@ trash = /obj/item/trash/candy nutriment_amt = 9 nutriment_desc = list("candy" = 10) + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/candy/donor/Initialize() . = ..() reagents.add_reagent("sugar", 3) - bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/candy_corn name = "candy corn" @@ -312,11 +306,11 @@ center_of_mass = list("x"=14, "y"=10) nutriment_amt = 4 nutriment_desc = list("candy corn" = 4) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/candy_corn/Initialize() . = ..() reagents.add_reagent("sugar", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/chocolatebar //not a vending item name = "Chocolate Bar" @@ -326,12 +320,12 @@ center_of_mass = list("x"=15, "y"=15) nutriment_amt = 2 nutriment_desc = list("chocolate" = 5) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/chocolatebar/Initialize() . = ..() reagents.add_reagent("sugar", 2) reagents.add_reagent("coco", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/chocolatepiece name = "chocolate piece" @@ -364,12 +358,12 @@ center_of_mass = list("x"=16, "y"=13) nutriment_amt = 3 nutriment_desc = list("chocolate" = 5) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/chocolateegg/Initialize() . = ..() reagents.add_reagent("sugar", 2) reagents.add_reagent("coco", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/donut name = "donut" @@ -386,12 +380,12 @@ desc = "Goes great with Robust Coffee." icon_state = "donut1" nutriment_amt = 3 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/donut/normal/Initialize() . = ..() - reagents.add_reagent("nutriment", 3) + reagents.add_reagent("nutriment", 3, nutriment_desc) reagents.add_reagent("sprinkles", 1) - src.bitesize = 3 if(prob(30)) src.icon_state = "donut2" src.overlay_state = "box-donut2" @@ -405,15 +399,15 @@ icon_state = "donut1" filling_color = "#ED11E6" nutriment_amt = 2 + bitesize = 10 /obj/item/weapon/reagent_containers/food/snacks/donut/chaos/Initialize() . = ..() reagents.add_reagent("sprinkles", 1) - bitesize = 10 var/chaosselect = pick(1,2,3,4,5,6,7,8,9,10) switch(chaosselect) if(1) - reagents.add_reagent("nutriment", 3) + reagents.add_reagent("nutriment", 3, nutriment_desc) if(2) reagents.add_reagent("capsaicin", 3) if(3) @@ -445,12 +439,12 @@ filling_color = "#ED1169" center_of_mass = list("x"=16, "y"=11) nutriment_amt = 3 + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/donut/jelly/Initialize() . = ..() reagents.add_reagent("sprinkles", 1) reagents.add_reagent("berryjuice", 5) - bitesize = 5 if(prob(30)) src.icon_state = "jdonut2" src.overlay_state = "box-donut2" @@ -464,12 +458,12 @@ filling_color = "#ED1169" center_of_mass = list("x"=16, "y"=11) nutriment_amt = 3 + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/donut/poisonberry/Initialize() . = ..() reagents.add_reagent("sprinkles", 1) reagents.add_reagent("poisonberryjuice", 5) - bitesize = 5 if(prob(30)) src.icon_state = "jdonut2" src.overlay_state = "box-donut2" @@ -483,12 +477,12 @@ filling_color = "#ED1169" center_of_mass = list("x"=16, "y"=11) nutriment_amt = 3 + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/donut/slimejelly/Initialize() . = ..() reagents.add_reagent("sprinkles", 1) reagents.add_reagent("slimejelly", 5) - bitesize = 5 if(prob(30)) src.icon_state = "jdonut2" src.overlay_state = "box-donut2" @@ -502,12 +496,12 @@ filling_color = "#ED1169" center_of_mass = list("x"=16, "y"=11) nutriment_amt = 3 + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/donut/cherryjelly/Initialize() . = ..() reagents.add_reagent("sprinkles", 1) reagents.add_reagent("cherryjelly", 5) - bitesize = 5 if(prob(30)) src.icon_state = "jdonut2" src.overlay_state = "box-donut2" @@ -587,13 +581,13 @@ icon_state = "friedegg" filling_color = "#FFDF78" center_of_mass = list("x"=16, "y"=14) + bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/friedegg/Initialize() . = ..() reagents.add_reagent("protein", 3) reagents.add_reagent("sodiumchloride", 1) reagents.add_reagent("blackpepper", 1) - bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/boiledegg name = "Boiled egg" @@ -612,12 +606,12 @@ icon_state = "appendix" filling_color = "#E00D34" center_of_mass = list("x"=16, "y"=16) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/organ/Initialize() . = ..() reagents.add_reagent("protein", rand(3,5)) reagents.add_reagent("toxin", rand(1,3)) - src.bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/tofu name = "Tofu" @@ -627,10 +621,7 @@ center_of_mass = list("x"=17, "y"=10) nutriment_amt = 3 nutriment_desc = list("tofu" = 3, "goeyness" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/tofu/Initialize() - . = ..() - src.bitesize = 3 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/tofurkey name = "Tofurkey" @@ -640,11 +631,11 @@ center_of_mass = list("x"=16, "y"=8) nutriment_amt = 12 nutriment_desc = list("turkey" = 3, "tofu" = 5, "goeyness" = 4) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/tofurkey/Initialize() . = ..() reagents.add_reagent("stoxin", 3) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/stuffing name = "Stuffing" @@ -654,9 +645,6 @@ center_of_mass = list("x"=16, "y"=10) nutriment_amt = 3 nutriment_desc = list("dryness" = 2, "bread" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/stuffing/Initialize() - . = ..() bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/carpmeat @@ -665,6 +653,7 @@ icon_state = "fishfillet" filling_color = "#FFDEFE" center_of_mass = list("x"=17, "y"=13) + bitesize = 6 var/toxin_type = "carpotoxin" var/toxin_amount = 3 @@ -673,7 +662,6 @@ . = ..() reagents.add_reagent("protein", 3) reagents.add_reagent(toxin_type, toxin_amount) - src.bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/carpmeat/sif desc = "A fillet of sivian fish meat." @@ -696,11 +684,11 @@ icon_state = "fishfingers" filling_color = "#FFDEFE" center_of_mass = list("x"=16, "y"=13) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/fishfingers/Initialize() . = ..() reagents.add_reagent("protein", 4) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/zestfish name = "Zesty Fish" @@ -708,11 +696,11 @@ icon_state = "zestfish" filling_color = "#FFDEFE" center_of_mass = list("x"=16, "y"=13) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/zestfish/Initialize() . = ..() reagents.add_reagent("protein", 4) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice name = "huge mushroom slice" @@ -722,11 +710,11 @@ center_of_mass = list("x"=17, "y"=16) nutriment_amt = 3 nutriment_desc = list("raw" = 2, "mushroom" = 2) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/hugemushroomslice/Initialize() . = ..() reagents.add_reagent("psilocybin", 3) - src.bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/tomatomeat name = "tomato slice" @@ -736,10 +724,7 @@ center_of_mass = list("x"=17, "y"=16) nutriment_amt = 3 nutriment_desc = list("raw" = 2, "tomato" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/tomatomeat/Initialize() - . = ..() - src.bitesize = 6 + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/bearmeat name = "bear meat" @@ -747,12 +732,12 @@ icon_state = "bearmeat" filling_color = "#DB0000" center_of_mass = list("x"=16, "y"=10) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/bearmeat/Initialize() . = ..() reagents.add_reagent("protein", 12) reagents.add_reagent("hyperzine", 5) - src.bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/xenomeat name = "xenomeat" @@ -760,12 +745,12 @@ icon_state = "xenomeat" filling_color = "#43DE18" center_of_mass = list("x"=16, "y"=10) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/xenomeat/Initialize() . = ..() reagents.add_reagent("protein", 6) reagents.add_reagent("pacid",6) - src.bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/xenomeat/spidermeat // Substitute for recipes requiring xeno meat. name = "spider meat" @@ -773,12 +758,12 @@ icon_state = "xenomeat" filling_color = "#43DE18" center_of_mass = list("x"=16, "y"=10) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/xenomeat/spidermeat/Initialize() . = ..() reagents.add_reagent("spidertoxin",6) reagents.remove_reagent("pacid",6) - src.bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/meatball name = "meatball" @@ -786,11 +771,11 @@ icon_state = "meatball" filling_color = "#DB0000" center_of_mass = list("x"=16, "y"=16) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/meatball/Initialize() . = ..() reagents.add_reagent("protein", 3) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sausage name = "Sausage" @@ -798,11 +783,11 @@ icon_state = "sausage" filling_color = "#DB0000" center_of_mass = list("x"=16, "y"=16) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sausage/Initialize() . = ..() reagents.add_reagent("protein", 6) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/donkpocket name = "Donk-pocket" @@ -811,23 +796,21 @@ icon_state = "donkpocket" filling_color = "#DEDEAB" center_of_mass = list("x"=16, "y"=10) - var/warm - var/list/heated_reagents + nutriment_amt = 2 + nutriment_desc = list("heartiness" = 1, "dough" = 2) + var/warm = FALSE + var/list/heated_reagents = list("tricordrazine" = 5) /obj/item/weapon/reagent_containers/food/snacks/donkpocket/Initialize() . = ..() - reagents.add_reagent("nutriment", 2) reagents.add_reagent("protein", 2) - warm = 0 - heated_reagents = list("tricordrazine" = 5) - /obj/item/weapon/reagent_containers/food/snacks/donkpocket/proc/heat() warm = 1 for(var/reagent in heated_reagents) reagents.add_reagent(reagent, heated_reagents[reagent]) bitesize = 6 - name = "Warm " + name + name = "warm [name]" cooltime() /obj/item/weapon/reagent_containers/food/snacks/donkpocket/proc/cooltime() @@ -862,12 +845,12 @@ icon_state = "brainburger" filling_color = "#F2B6EA" center_of_mass = list("x"=15, "y"=11) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/brainburger/Initialize() . = ..() reagents.add_reagent("protein", 6) reagents.add_reagent("alkysine", 6) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/ghostburger name = "Ghost Burger" @@ -877,9 +860,6 @@ center_of_mass = list("x"=16, "y"=11) nutriment_desc = list("buns" = 3, "spookiness" = 3) nutriment_amt = 2 - -/obj/item/weapon/reagent_containers/food/snacks/ghostburger/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/human @@ -892,11 +872,11 @@ desc = "A bloody burger." icon_state = "hburger" center_of_mass = list("x"=16, "y"=11) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/human/burger/Initialize() . = ..() reagents.add_reagent("protein", 6) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cheeseburger name = "cheeseburger" @@ -918,11 +898,11 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 3 nutriment_desc = list("bun" = 2) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/monkeyburger/Initialize() . = ..() reagents.add_reagent("protein", 3) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/fishburger name = "Fillet -o- Carp Sandwich" @@ -930,11 +910,11 @@ icon_state = "fishburger" filling_color = "#FFDEFE" center_of_mass = list("x"=16, "y"=10) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/fishburger/Initialize() . = ..() reagents.add_reagent("protein", 6) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/tofuburger name = "Tofu Burger" @@ -944,9 +924,6 @@ center_of_mass = list("x"=16, "y"=10) nutriment_amt = 6 nutriment_desc = list("bun" = 2, "pseudo-soy meat" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/tofuburger/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/roburger @@ -957,9 +934,6 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 2 nutriment_desc = list("bun" = 2, "metal" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/roburger/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/roburgerbig @@ -969,9 +943,6 @@ filling_color = "#CCCCCC" volume = 100 center_of_mass = list("x"=16, "y"=11) - -/obj/item/weapon/reagent_containers/food/snacks/roburgerbig/Initialize() - . = ..() bitesize = 0.1 /obj/item/weapon/reagent_containers/food/snacks/xenoburger @@ -980,11 +951,11 @@ icon_state = "xburger" filling_color = "#43DE18" center_of_mass = list("x"=16, "y"=11) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/xenoburger/Initialize() . = ..() reagents.add_reagent("protein", 8) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/clownburger name = "Clown Burger" @@ -994,23 +965,17 @@ center_of_mass = list("x"=17, "y"=12) nutriment_amt = 6 nutriment_desc = list("bun" = 2, "clown shoe" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/clownburger/Initialize() - . = ..() bitesize = 2 + /obj/item/weapon/reagent_containers/food/snacks/mimeburger name = "Mime Burger" desc = "Its taste defies language." icon_state = "mimeburger" filling_color = "#FFFFFF" center_of_mass = list("x"=16, "y"=11) - nutriment_amt = 6 + nutriment_amt = 12 nutriment_desc = list("bun" = 2, "face paint" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/mimeburger/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/omelette @@ -1020,11 +985,11 @@ trash = /obj/item/trash/plate filling_color = "#FFF9A8" center_of_mass = list("x"=16, "y"=13) + bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/omelette/Initialize() . = ..() reagents.add_reagent("protein", 8) - bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/muffin name = "Muffin" @@ -1034,10 +999,6 @@ center_of_mass = list("x"=17, "y"=4) nutriment_amt = 6 nutriment_desc = list("sweetness" = 3, "muffin" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/muffin/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/pie @@ -1050,11 +1011,11 @@ center_of_mass = list("x"=16, "y"=13) nutriment_amt = 4 nutriment_desc = list("pie" = 3, "cream" = 2) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/pie/Initialize() . = ..() reagents.add_reagent("banana",5) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/pie/throw_impact(atom/hit_atom) . = ..() @@ -1070,9 +1031,6 @@ center_of_mass = list("x"=16, "y"=13) nutriment_amt = 4 nutriment_desc = list("sweetness" = 2, "pie" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/berryclafoutis/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/berryclafoutis/berry/Initialize() @@ -1092,9 +1050,6 @@ center_of_mass = list("x"=15, "y"=11) nutriment_amt = 8 nutriment_desc = list("waffle" = 8) - -/obj/item/weapon/reagent_containers/food/snacks/waffles/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/eggplantparm @@ -1106,9 +1061,6 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 6 nutriment_desc = list("cheese" = 3, "eggplant" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/eggplantparm/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/soylentgreen @@ -1118,11 +1070,11 @@ trash = /obj/item/trash/waffles filling_color = "#B8E6B5" center_of_mass = list("x"=15, "y"=11) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/soylentgreen/Initialize() . = ..() reagents.add_reagent("protein", 10) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/soylenviridians name = "Soylen Virdians" @@ -1133,9 +1085,6 @@ center_of_mass = list("x"=15, "y"=11) nutriment_amt = 10 nutriment_desc = list("some sort of protein" = 10) //seasoned VERY well. - -/obj/item/weapon/reagent_containers/food/snacks/soylenviridians/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/meatpie @@ -1145,11 +1094,11 @@ trash = /obj/item/trash/plate filling_color = "#948051" center_of_mass = list("x"=16, "y"=13) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/meatpie/Initialize() . = ..() reagents.add_reagent("protein", 10) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/tofupie name = "Tofu-pie" @@ -1160,9 +1109,6 @@ center_of_mass = list("x"=16, "y"=13) nutriment_amt = 10 nutriment_desc = list("tofu" = 2, "pie" = 8) - -/obj/item/weapon/reagent_containers/food/snacks/tofupie/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/amanita_pie @@ -1173,12 +1119,12 @@ center_of_mass = list("x"=17, "y"=9) nutriment_amt = 5 nutriment_desc = list("sweetness" = 3, "mushroom" = 3, "pie" = 2) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/amanita_pie/Initialize() . = ..() reagents.add_reagent("amatoxin", 3) reagents.add_reagent("psilocybin", 1) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/plump_pie name = "plump pie" @@ -1188,17 +1134,15 @@ center_of_mass = list("x"=17, "y"=9) nutriment_amt = 8 nutriment_desc = list("heartiness" = 2, "mushroom" = 3, "pie" = 3) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/plump_pie/Initialize() . = ..() if(prob(10)) name = "exceptional plump pie" desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump pie!" - reagents.add_reagent("nutriment", 8) + reagents.add_reagent("nutriment", 8, nutriment_desc) reagents.add_reagent("tricordrazine", 5) - bitesize = 2 - else - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/xemeatpie name = "Xeno-pie" @@ -1207,11 +1151,11 @@ trash = /obj/item/trash/plate filling_color = "#43DE18" center_of_mass = list("x"=16, "y"=13) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/xemeatpie/Initialize() . = ..() reagents.add_reagent("protein", 10) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/wingfangchu name = "Wing Fang Chu" @@ -1220,11 +1164,11 @@ trash = /obj/item/trash/snack_bowl filling_color = "#43DE18" center_of_mass = list("x"=17, "y"=9) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/wingfangchu/Initialize() . = ..() reagents.add_reagent("protein", 6) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/human/kabob name = "-kabob" @@ -1233,11 +1177,11 @@ trash = /obj/item/stack/rods filling_color = "#A85340" center_of_mass = list("x"=17, "y"=15) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/human/kabob/Initialize() . = ..() reagents.add_reagent("protein", 8) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/monkeykabob name = "Meat-kabob" @@ -1246,11 +1190,11 @@ trash = /obj/item/stack/rods filling_color = "#A85340" center_of_mass = list("x"=17, "y"=15) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/monkeykabob/Initialize() . = ..() reagents.add_reagent("protein", 8) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/tofukabob name = "Tofu-kabob" @@ -1258,15 +1202,11 @@ desc = "Vegan meat, on a stick." trash = /obj/item/stack/rods filling_color = "#FFFEE0" - + bitesize = 2 center_of_mass = list("x"=17, "y"=15) nutriment_amt = 8 nutriment_desc = list("tofu" = 3, "metal" = 1) -/obj/item/weapon/reagent_containers/food/snacks/tofukabob/Initialize() - . = ..() - bitesize = 2 - /obj/item/weapon/reagent_containers/food/snacks/cubancarp name = "Cuban Carp" desc = "A sandwich that burns your tongue and then leaves it numb!" @@ -1276,12 +1216,12 @@ center_of_mass = list("x"=12, "y"=5) nutriment_amt = 3 nutriment_desc = list("toasted bread" = 3) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cubancarp/Initialize() . = ..() reagents.add_reagent("protein", 3) reagents.add_reagent("capsaicin", 3) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/popcorn name = "Popcorn" @@ -1293,12 +1233,12 @@ center_of_mass = list("x"=16, "y"=8) nutriment_amt = 2 nutriment_desc = list("popcorn" = 3) + bitesize = 0.1 //This snack is supposed to be eaten for a long time. /obj/item/weapon/reagent_containers/food/snacks/popcorn/Initialize() . = ..() unpopped = rand(1,10) - bitesize = 0.1 //this snack is supposed to be eating during looooong time. And this it not dinner food! --rastaf0 /obj/item/weapon/reagent_containers/food/snacks/popcorn/On_Consume() if(prob(unpopped)) //lol ...what's the point? @@ -1314,11 +1254,11 @@ center_of_mass = list("x"=16, "y"=10) nutriment_amt = 3 nutriment_desc = list("baked potato" = 3) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/loadedbakedpotato/Initialize() . = ..() reagents.add_reagent("protein", 3) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/fries name = "Space Fries" @@ -1329,9 +1269,6 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 4 nutriment_desc = list("fresh fries" = 4) - -/obj/item/weapon/reagent_containers/food/snacks/fries/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/bangersandmash @@ -1343,11 +1280,11 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 4 nutriment_desc = list("fluffy potato" = 3, "sausage" = 2) + bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/bangersandmash/Initialize() . = ..() reagents.add_reagent("protein", 3) - bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/cheesymash name = "Cheesy Mashed Potato" @@ -1358,11 +1295,11 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 4 nutriment_desc = list("cheesy potato" = 4) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cheesymash/Initialize() . = ..() reagents.add_reagent("protein", 3) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/blackpudding name = "Black Pudding" @@ -1370,12 +1307,12 @@ icon_state = "blackpudding" filling_color = "#FF0000" center_of_mass = list("x"=16, "y"=7) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/blackpudding/Initialize() . = ..() reagents.add_reagent("protein", 2) reagents.add_reagent("blood", 5) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/soydope name = "Soy Dope" @@ -1386,9 +1323,6 @@ center_of_mass = list("x"=16, "y"=10) nutriment_amt = 2 nutriment_desc = list("slime" = 2, "soy" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/soydope/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/spagetti @@ -1399,9 +1333,6 @@ center_of_mass = list("x"=16, "y"=16) nutriment_amt = 1 nutriment_desc = list("noodles" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/spagetti/Initialize() - . = ..() bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/cheesyfries @@ -1413,11 +1344,11 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 4 nutriment_desc = list("fresh fries" = 3, "cheese" = 3) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cheesyfries/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/fortunecookie name = "Fortune cookie" @@ -1427,9 +1358,6 @@ center_of_mass = list("x"=15, "y"=14) nutriment_amt = 3 nutriment_desc = list("fortune cookie" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/fortunecookie/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/badrecipe @@ -1438,12 +1366,12 @@ icon_state = "badrecipe" filling_color = "#211F02" center_of_mass = list("x"=16, "y"=12) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/badrecipe/Initialize() . = ..() reagents.add_reagent("toxin", 1) reagents.add_reagent("carbon", 3) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/meatsteak name = "Meat steak" @@ -1500,9 +1428,6 @@ center_of_mass = list("x"=16, "y"=10) nutriment_amt = 5 nutriment_desc = list("poppy seeds" = 2, "pretzel" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/poppypretzel/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/meatballsoup @@ -1607,25 +1532,25 @@ var/mysteryselect = pick(1,2,3,4,5,6,7,8,9,10) switch(mysteryselect) if(1) - reagents.add_reagent("nutriment", 6) + reagents.add_reagent("nutriment", 6, nutriment_desc) reagents.add_reagent("capsaicin", 3) reagents.add_reagent("tomatojuice", 2) if(2) - reagents.add_reagent("nutriment", 6) + reagents.add_reagent("nutriment", 6, nutriment_desc) reagents.add_reagent("frostoil", 3) reagents.add_reagent("tomatojuice", 2) if(3) - reagents.add_reagent("nutriment", 5) + reagents.add_reagent("nutriment", 5, nutriment_desc) reagents.add_reagent("water", 5) reagents.add_reagent("tricordrazine", 5) if(4) - reagents.add_reagent("nutriment", 5) + reagents.add_reagent("nutriment", 5, nutriment_desc) reagents.add_reagent("water", 10) if(5) - reagents.add_reagent("nutriment", 2) + reagents.add_reagent("nutriment", 2, nutriment_desc) reagents.add_reagent("banana", 10) if(6) - reagents.add_reagent("nutriment", 6) + reagents.add_reagent("nutriment", 6, nutriment_desc) reagents.add_reagent("blood", 10) if(7) reagents.add_reagent("slimejelly", 10) @@ -1634,10 +1559,10 @@ reagents.add_reagent("carbon", 10) reagents.add_reagent("toxin", 10) if(9) - reagents.add_reagent("nutriment", 5) + reagents.add_reagent("nutriment", 5, nutriment_desc) reagents.add_reagent("tomatojuice", 10) if(10) - reagents.add_reagent("nutriment", 6) + reagents.add_reagent("nutriment", 6, nutriment_desc) reagents.add_reagent("tomatojuice", 5) reagents.add_reagent("imidazoline", 5) @@ -1780,9 +1705,6 @@ filling_color = "#D505FF" nutriment_amt = 6 nutriment_desc = list("magic" = 3, "buns" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/spellburger/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/bigbiteburger @@ -1963,9 +1885,6 @@ center_of_mass = list("x"=16, "y"=8) nutriment_amt = 1 nutriment_desc = list("toasted bread" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/jelliedtoast/cherry/Initialize() @@ -1984,9 +1903,6 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 5 nutriment_desc = list("buns" = 5) - -/obj/item/weapon/reagent_containers/food/snacks/jellyburger/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/jellyburger/slime/Initialize() @@ -2019,9 +1935,6 @@ center_of_mass = list("x"=16, "y"=10) nutriment_amt = 8 nutriment_desc = list("soy" = 4, "tomato" = 4) - -/obj/item/weapon/reagent_containers/food/snacks/stewedsoymeat/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/boiledspagetti @@ -2033,9 +1946,6 @@ center_of_mass = list("x"=16, "y"=10) nutriment_amt = 2 nutriment_desc = list("noodles" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/boiledrice @@ -2047,9 +1957,6 @@ center_of_mass = list("x"=17, "y"=11) nutriment_amt = 2 nutriment_desc = list("rice" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/boiledrice/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/ricepudding @@ -2061,9 +1968,6 @@ center_of_mass = list("x"=17, "y"=11) nutriment_amt = 4 nutriment_desc = list("rice" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/ricepudding/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/kudzudonburi @@ -2162,9 +2066,6 @@ center_of_mass = list("x"=15, "y"=13) nutriment_amt = 3 nutriment_desc = list("apple" = 3, "caramel" = 3, "sweetness" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/candiedapple/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/applepie @@ -2175,9 +2076,6 @@ center_of_mass = list("x"=16, "y"=13) nutriment_amt = 4 nutriment_desc = list("sweetness" = 2, "apple" = 2, "pie" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/applepie/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cherrypie @@ -2188,9 +2086,6 @@ center_of_mass = list("x"=16, "y"=11) nutriment_amt = 4 nutriment_desc = list("sweetness" = 2, "cherry" = 2, "pie" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/cherrypie/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/twobread @@ -2202,9 +2097,6 @@ center_of_mass = list("x"=15, "y"=12) nutriment_amt = 2 nutriment_desc = list("sourness" = 2, "bread" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/twobread/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/jellysandwich @@ -2216,9 +2108,6 @@ center_of_mass = list("x"=16, "y"=8) nutriment_amt = 2 nutriment_desc = list("bread" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/jellysandwich/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/jellysandwich/slime/Initialize() @@ -2290,9 +2179,6 @@ center_of_mass = list("x"=17, "y"=10) nutriment_amt = 8 nutriment_desc = list("mushroom" = 8, "milk" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/mushroomsoup/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/plumphelmetbiscuit @@ -2310,9 +2196,7 @@ if(prob(10)) name = "exceptional plump helmet biscuit" desc = "Microwave is taken by a fey mood! It has cooked an exceptional plump helmet biscuit!" - reagents.add_reagent("nutriment", 8) - else - reagents.add_reagent("nutriment", 5) + reagents.add_reagent("nutriment", 3, nutriment_desc) /obj/item/weapon/reagent_containers/food/snacks/chawanmushi name = "chawanmushi" @@ -2351,9 +2235,6 @@ center_of_mass = list("x"=17, "y"=11) nutriment_amt = 8 nutriment_desc = list("salad" = 2, "tomato" = 2, "carrot" = 2, "apple" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/tossedsalad/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/validsalad @@ -2433,11 +2314,11 @@ center_of_mass = list("x"=19, "y"=9) nutriment_desc = list("bread" = 10) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/meatbread/Initialize() . = ..() reagents.add_reagent("protein", 20) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/meatbread name = "meatbread slice" @@ -2462,11 +2343,11 @@ center_of_mass = list("x"=16, "y"=9) nutriment_desc = list("bread" = 10) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/xenomeatbread/Initialize() . = ..() reagents.add_reagent("protein", 20) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/xenomeatbread name = "xenomeatbread slice" @@ -2492,11 +2373,11 @@ center_of_mass = list("x"=16, "y"=9) nutriment_desc = list("bread" = 10) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/bananabread/Initialize() . = ..() reagents.add_reagent("banana", 20) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/bananabread name = "Banana-nut bread slice" @@ -2521,9 +2402,6 @@ center_of_mass = list("x"=16, "y"=9) nutriment_desc = list("tofu" = 10) nutriment_amt = 10 - -/obj/item/weapon/reagent_containers/food/snacks/sliceable/tofubread/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/tofubread @@ -2609,11 +2487,11 @@ center_of_mass = list("x"=16, "y"=10) nutriment_desc = list("cake" = 10, "cream" = 10, "cheese" = 15) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesecake/Initialize() . = ..() reagents.add_reagent("protein", 15) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/cheesecake name = "Cheese Cake slice" @@ -2638,11 +2516,11 @@ center_of_mass = list("x"=16, "y"=10) nutriment_desc = list("cake" = 10, "peanuts" = 15) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/peanutcake/Initialize() . = ..() reagents.add_reagent("protein", 5) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/peanutcake name = "Peanut Cake slice" @@ -2790,11 +2668,11 @@ center_of_mass = list("x"=16, "y"=10) nutriment_desc = list("cheese" = 10) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesewheel/Initialize() . = ..() reagents.add_reagent("protein", 10) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cheesewedge name = "Cheese wedge" @@ -2814,11 +2692,11 @@ center_of_mass = list("x"=16, "y"=10) nutriment_desc = list("cake" = 10, "sweetness" = 10) nutriment_amt = 20 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/sliceable/birthdaycake/Initialize() . = ..() reagents.add_reagent("sprinkles", 10) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/slice/birthdaycake name = "Birthday Cake slice" @@ -2843,9 +2721,6 @@ center_of_mass = list("x"=16, "y"=9) nutriment_desc = list("bread" = 6) nutriment_amt = 6 - -/obj/item/weapon/reagent_containers/food/snacks/sliceable/bread/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/bread @@ -2872,11 +2747,11 @@ center_of_mass = list("x"=16, "y"=9) nutriment_desc = list("bread" = 6, "cream" = 3, "cheese" = 3) nutriment_amt = 5 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/creamcheesebread/Initialize() . = ..() reagents.add_reagent("protein", 15) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/creamcheesebread name = "Cream Cheese Bread slice" @@ -2976,12 +2851,12 @@ center_of_mass = list("x"=16, "y"=11) nutriment_desc = list("pizza crust" = 10, "tomato" = 10, "cheese" = 15) nutriment_amt = 35 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/margherita/Initialize() . = ..() reagents.add_reagent("protein", 5) reagents.add_reagent("tomatojuice", 6) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/margherita name = "Margherita slice" @@ -3035,12 +2910,12 @@ center_of_mass = list("x"=16, "y"=11) nutriment_desc = list("pizza crust" = 10, "tomato" = 10, "cheese" = 15) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/meatpizza/Initialize() . = ..() reagents.add_reagent("protein", 34) reagents.add_reagent("tomatojuice", 6) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/meatpizza name = "Meatpizza slice" @@ -3063,11 +2938,11 @@ center_of_mass = list("x"=16, "y"=11) nutriment_desc = list("pizza crust" = 10, "tomato" = 10, "cheese" = 5, "mushroom" = 10) nutriment_amt = 35 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/mushroompizza/Initialize() . = ..() reagents.add_reagent("protein", 5) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/mushroompizza name = "Mushroompizza slice" @@ -3119,13 +2994,13 @@ center_of_mass = list("x"=16, "y"=11) nutriment_desc = list("stale pizza crust" = 10, "moldy tomato" = 10, "moldy cheese" = 5) nutriment_amt = 10 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/oldpizza/Initialize() . = ..() reagents.add_reagent("protein", 5) reagents.add_reagent("tomatojuice", 6) reagents.add_reagent("mold", 8) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/slice/oldpizza name = "moldy pizza slice" @@ -3336,11 +3211,11 @@ center_of_mass = list("x"=16, "y"=7) nutriment_amt = 6 nutriment_desc = list("a chorus of flavor" = 6) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/dionaroast/Initialize() . = ..() reagents.add_reagent("radium", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/dough name = "dough" @@ -3371,12 +3246,13 @@ icon_state = "flat dough" slice_path = /obj/item/weapon/reagent_containers/food/snacks/doughslice slices_num = 3 + nutriment_amt = 3 + nutriment_desc = list("raw dough" = 3) center_of_mass = list("x"=16, "y"=16) /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough/Initialize() . = ..() reagents.add_reagent("protein", 1) - reagents.add_reagent("nutriment", 3) /obj/item/weapon/reagent_containers/food/snacks/doughslice name = "dough slice" @@ -3390,9 +3266,6 @@ nutriment_amt = 1 nutriment_desc = list("uncooked dough" = 1) -/obj/item/weapon/reagent_containers/food/snacks/doughslice/Initialize() - . = ..() - /obj/item/weapon/reagent_containers/food/snacks/bun name = "bun" desc = "A base for any self-respecting burger." @@ -3403,9 +3276,6 @@ nutriment_amt = 4 nutriment_desc = "bun" -/obj/item/weapon/reagent_containers/food/snacks/bun/Initialize() - . = ..() - /obj/item/weapon/reagent_containers/food/snacks/bun/attackby(obj/item/weapon/W as obj, mob/user as mob) // Bun + meatball = burger if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/meatball)) @@ -3459,9 +3329,6 @@ nutriment_amt = 8 nutriment_desc = list("bun" = 8) -/obj/item/weapon/reagent_containers/food/snacks/bunbun/Initialize() - . = ..() - /obj/item/weapon/reagent_containers/food/snacks/taco name = "taco" desc = "Take a bite!" @@ -3540,9 +3407,6 @@ nutriment_amt = 3 nutriment_desc = list("bread" = 3) -/obj/item/weapon/reagent_containers/food/snacks/flatbread/Initialize() - . = ..() - // potato + knife = raw sticks /obj/item/weapon/reagent_containers/food/snacks/grown/attackby(obj/item/weapon/W, mob/user) if(seed && seed.kitchen_tag && seed.kitchen_tag == "potato" && istype(W,/obj/item/weapon/material/knife)) @@ -3566,9 +3430,6 @@ nutriment_amt = 3 nutriment_desc = list("raw potato" = 3) -/obj/item/weapon/reagent_containers/food/snacks/rawsticks/Initialize() - . = ..() - /obj/item/weapon/reagent_containers/food/snacks/rawsunflower name = "sunflower seeds" desc = "Raw sunflower seeds, alright. They look too damaged to plant." @@ -3579,9 +3440,6 @@ nutriment_amt = 1 nutriment_desc = list("starch" = 3) -/obj/item/weapon/reagent_containers/food/snacks/rawsunflower/Initialize() - . = ..() - /obj/item/weapon/reagent_containers/food/snacks/frostbelle name = "frostbelle bud" desc = "A frostbelle flower from Sif. Its petals shimmer with an inner light." @@ -3709,9 +3567,6 @@ center_of_mass = list("x"=17, "y"=16) nutriment_amt = 6 nutriment_desc = list("bread" = 2, "sweetness" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/tastybread/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/skrellsnacks @@ -3725,9 +3580,6 @@ center_of_mass = list("x"=15, "y"=12) nutriment_amt = 10 nutriment_desc = list("mushroom" = 5, "salt" = 5) - -/obj/item/weapon/reagent_containers/food/snacks/skrellsnacks/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/unajerky @@ -3754,11 +3606,11 @@ filling_color = "#FFDEFE" icon_state = "sashimi" nutriment_amt = 6 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/sashimi/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/benedict name = "eggs benedict" @@ -3766,11 +3618,12 @@ filling_color = "#FFDF78" icon_state = "benedict" nutriment_amt = 4 + nutriment_desc = list("bread" = 2, "bacon" = 2, "egg" = 2) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/benedict/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/beans name = "baked beans" @@ -3779,9 +3632,6 @@ icon_state = "beans" nutriment_amt = 4 nutriment_desc = list("beans" = 4) - -/obj/item/weapon/reagent_containers/food/snacks/beans/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sugarcookie @@ -3791,9 +3641,6 @@ icon_state = "sugarcookie" nutriment_amt = 5 nutriment_desc = list("sweetness" = 4, "cookie" = 1) - -/obj/item/weapon/reagent_containers/food/snacks/sugarcookie/Initialize() - . = ..() bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/berrymuffin @@ -3804,10 +3651,6 @@ center_of_mass = list("x"=17, "y"=4) nutriment_amt = 6 nutriment_desc = list("sweetness" = 2, "muffin" = 2, "berries" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/berrymuffin/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/berrymuffin/berry/Initialize() @@ -3826,21 +3669,15 @@ center_of_mass = list("x"=17, "y"=4) nutriment_amt = 6 nutriment_desc = list("spookiness" = 4, "muffin" = 1, "berries" = 1) - -/obj/item/weapon/reagent_containers/food/snacks/ghostmuffin/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/ghostmuffin/berry/Initialize() . = ..() reagents.add_reagent("berryjuice", 3) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/ghostmuffin/poison/Initialize() . = ..() reagents.add_reagent("poisonberryjuice", 3) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/eggroll name = "egg roll" @@ -3850,12 +3687,11 @@ center_of_mass = list("x"=17, "y"=4) nutriment_amt = 4 nutriment_desc = list("egg" = 4) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/eggroll/Initialize() . = ..() - reagents.add_reagent("nutriment", 6) reagents.add_reagent("protein", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/devilledegg name = "devilled eggs" @@ -3869,7 +3705,6 @@ /obj/item/weapon/reagent_containers/food/snacks/devilledegg/Initialize() . = ..() - reagents.add_reagent("nutriment", 6) reagents.add_reagent("capsaicin", 2) /obj/item/weapon/reagent_containers/food/snacks/fruitsalad @@ -3879,10 +3714,6 @@ filling_color = "#FF3867" nutriment_amt = 10 nutriment_desc = list("fruit" = 10) - -/obj/item/weapon/reagent_containers/food/snacks/fruitsalad/Initialize() - . = ..() - reagents.add_reagent("nutriment", 10) bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/flowerchildsalad @@ -3892,10 +3723,6 @@ filling_color = "#FF3867" nutriment_amt = 10 nutriment_desc = list("bittersweet" = 10) - -/obj/item/weapon/reagent_containers/food/snacks/flowerchildsalad/Initialize() - . = ..() - reagents.add_reagent("nutriment", 10) bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/rosesalad @@ -3903,13 +3730,12 @@ desc = "A fragrant salad." icon_state = "rosesalad" filling_color = "#FF3867" - nutriment_amt = 5 + nutriment_amt = 10 nutriment_desc = list("bittersweet" = 10, "iron" = 5) bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/rosesalad/Initialize() . = ..() - reagents.add_reagent("nutriment", 10) reagents.add_reagent("stoxin", 2) /obj/item/weapon/reagent_containers/food/snacks/eggbowl @@ -3920,23 +3746,18 @@ filling_color = "#FFFBDB" nutriment_amt = 6 nutriment_desc = list("rice" = 2, "egg" = 4) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/eggbowl/Initialize() . = ..() - reagents.add_reagent("nutriment", 6) reagents.add_reagent("protein", 4) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/tortilla name = "tortilla" desc = "The base for all your burritos." icon_state = "tortilla" - nutriment_amt = 1 - nutriment_desc = list("bread" = 1) - -/obj/item/weapon/reagent_containers/food/snacks/tortilla/Initialize() - . = ..() - reagents.add_reagent("nutriment", 2) + nutriment_amt = 2 + nutriment_desc = list("bread" = 2) bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cubannachos @@ -3949,7 +3770,6 @@ /obj/item/weapon/reagent_containers/food/snacks/cubannachos/Initialize() . = ..() - reagents.add_reagent("nutriment", 5) reagents.add_reagent("capsaicin", 4) /obj/item/weapon/reagent_containers/food/snacks/curryrice @@ -3962,7 +3782,6 @@ /obj/item/weapon/reagent_containers/food/snacks/curryrice/Initialize() . = ..() - reagents.add_reagent("nutriment", 5) reagents.add_reagent("capsaicin", 4) /obj/item/weapon/reagent_containers/food/snacks/piginblanket @@ -3971,25 +3790,11 @@ icon_state = "piginblanket" nutriment_amt = 6 nutriment_desc = list("meat" = 3, "pastry" = 3) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/piginblanket/Initialize() . = ..() - reagents.add_reagent("nutriment", 6) reagents.add_reagent("protein", 4) - bitesize = 3 - -/obj/item/weapon/reagent_containers/food/snacks/piginblanket - name = "pig in a blanket" - desc = "A sausage embedded in soft, fluffy pastry. Free this pig from its blanket prison by eating it." - icon_state = "piginblanket" - nutriment_amt = 6 - nutriment_desc = list("meat" = 3, "pastry" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/piginblanket/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) - reagents.add_reagent("protein", 4) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/wormsickly name = "sickly worm" @@ -4057,63 +3862,46 @@ name = "plain bagel" desc = "This bread's got chutzpah!" icon_state = "bagelplain" - nutriment_amt = 3 - nutriment_desc = list("bread" = 1) + nutriment_amt = 6 + nutriment_desc = list("bread" = 6) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/bagelplain/Initialize() - . = ..() - reagents.add_reagent("nutriment", 3) - /obj/item/weapon/reagent_containers/food/snacks/bagelsunflower name = "sunflower seed bagel" desc = "This bread's got chutzpah - and sunflower seeds!" icon_state = "bagelsunflower" - nutriment_amt = 4 - nutriment_desc = list("bread" = 1, "sunflower seeds" = 1) + nutriment_amt = 7 + nutriment_desc = list("bread" = 4, "sunflower seeds" = 3) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/bagelsunflower/Initialize() - . = ..() - reagents.add_reagent("nutriment", 3) - /obj/item/weapon/reagent_containers/food/snacks/bagelcheese name = "cheese bagel" desc = "This bread's got cheese n' chutzpah!" icon_state = "bagelcheese" - nutriment_amt = 4 - nutriment_desc = list("bread" = 1, "cheese" = 1) + nutriment_amt = 8 + nutriment_desc = list("bread" = 4, "cheese" = 4) bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/bagelcheese/Initialize() . = ..() reagents.add_reagent("protein", 4) - reagents.add_reagent("nutriment", 4) /obj/item/weapon/reagent_containers/food/snacks/bagelraisin name = "cinnamon raisin bagel" desc = "This bread's got... Raisins!" icon_state = "bagelraisin" - nutriment_amt = 5 - nutriment_desc = list("bread" = 1, "sweetness" = 1) + nutriment_amt = 8 + nutriment_desc = list("bread" = 4, "sweetness" = 4) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/bagelraisin/Initialize() - . = ..() - reagents.add_reagent("nutriment", 3) - /obj/item/weapon/reagent_containers/food/snacks/bagelpoppy name = "poppy seed bagel" desc = "This bread's got Chutzpah, and poppy seeds!" icon_state = "bagelpoppy" - nutriment_amt = 5 + nutriment_amt = 6 nutriment_desc = list("bread" = 1, "sweetness" = 1) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/bagelpoppy/Initialize() - . = ..() - reagents.add_reagent("nutriment", 3) - /obj/item/weapon/reagent_containers/food/snacks/bageleverything name = "everything bagel" desc = "Mmm... Immeasurably unfathomable!" @@ -4389,9 +4177,6 @@ nutriment_amt = 4 nutriment_desc = list("soggy fries" = 4) center_of_mass = list("x"=16, "y"=11) - -/obj/item/weapon/reagent_containers/food/snacks/microchips/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/ovenchips @@ -4404,9 +4189,6 @@ nutriment_amt = 4 nutriment_desc = list("crisp, dry fries" = 4) center_of_mass = list("x"=16, "y"=11) - -/obj/item/weapon/reagent_containers/food/snacks/ovenchips/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza/crunch @@ -4444,12 +4226,12 @@ filling_color = "#Ef1479" center_of_mass = list("x"=16, "y"=12) do_coating_prefix = 0 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/funnelcake/Initialize() . = ..() reagents.add_reagent("batter", 10) reagents.add_reagent("sugar", 5) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/spreads name = "nutri-spread" @@ -5141,11 +4923,11 @@ icon_state = "carneburrito" nutriment_amt = 6 nutriment_desc = list("tortilla" = 3, "meat" = 3) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/meatburrito/Initialize() . = ..() reagents.add_reagent("protein", 6) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cheeseburrito name = "Cheese burrito" @@ -5153,12 +4935,11 @@ icon_state = "cheeseburrito" nutriment_amt = 6 nutriment_desc = list("tortilla" = 3, "cheese" = 3) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cheeseburrito/Initialize() . = ..() - reagents.add_reagent("nutriment", 6) reagents.add_reagent("protein", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/burrito_cheese_spicy name = "spicy cheese burrito" @@ -5180,12 +4961,11 @@ icon_state = "fuegoburrito" nutriment_amt = 6 nutriment_desc = list("chilli peppers" = 5, "tortilla" = 1) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/fuegoburrito/Initialize() . = ..() - reagents.add_reagent("nutriment", 6) reagents.add_reagent("capsaicin", 4) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/breakfast_wrap name = "breakfast burrito" @@ -5314,11 +5094,11 @@ nutriment_amt = 8 nutriment_desc = list("savory meat and rice" = 8) center_of_mass = list("x"=16, "y"=8) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/redcurry/Initialize() . = ..() reagents.add_reagent("protein", 7) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/greencurry name = "green curry" @@ -5331,12 +5111,12 @@ nutriment_amt = 12 nutriment_desc = list("tofu and rice" = 12) center_of_mass = list("x"=16, "y"=8) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/greencurry/Initialize() . = ..() reagents.add_reagent("protein", 1) reagents.add_reagent("capsaicin", 2) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/yellowcurry name = "yellow curry" @@ -5349,11 +5129,11 @@ nutriment_amt = 13 nutriment_desc = list("rice and potatoes" = 13) center_of_mass = list("x"=16, "y"=8) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/yellowcurry/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/bearburger name = "bearburger" @@ -5362,11 +5142,11 @@ icon_state = "bearburger" filling_color = "#5d5260" center_of_mass = list("x"=15, "y"=11) + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/bearburger/Initialize() . = ..() reagents.add_reagent("protein", 4) //So spawned burgers will not be empty I guess? - bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/bearchili name = "bear chili" @@ -5379,6 +5159,7 @@ nutriment_amt = 3 nutriment_desc = list("dark, hearty chili" = 3) center_of_mass = list("x"=15, "y"=9) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/bearchili/Initialize() . = ..() @@ -5386,7 +5167,6 @@ reagents.add_reagent("capsaicin", 3) reagents.add_reagent("tomatojuice", 2) reagents.add_reagent("hyperzine", 5) - bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/bearstew name = "bear stew" @@ -5398,6 +5178,7 @@ nutriment_amt = 6 nutriment_desc = list("hearty stew" = 6) center_of_mass = list("x"=16, "y"=5) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/bearstew/Initialize() . = ..() @@ -5406,7 +5187,6 @@ reagents.add_reagent("tomatojuice", 5) reagents.add_reagent("imidazoline", 5) reagents.add_reagent("water", 5) - bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/bibimbap name = "bibimbap bowl" @@ -5418,11 +5198,11 @@ nutriment_amt = 10 nutriment_desc = list("egg" = 5, "vegetables" = 5) center_of_mass = list("x"=15, "y"=9) + bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/bibimbap/Initialize() . = ..() reagents.add_reagent("protein", 10) - bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/lomein name = "lo mein" @@ -5435,11 +5215,11 @@ nutriment_amt = 8 nutriment_desc = list("noodles" = 6, "sesame sauce" = 2) center_of_mass = list("x"=16, "y"=10) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/lomein/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/friedrice name = "fried rice" @@ -5452,9 +5232,6 @@ nutriment_amt = 7 nutriment_desc = list("rice" = 7) center_of_mass = list("x"=17, "y"=11) - -/obj/item/weapon/reagent_containers/food/snacks/friedrice/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/chickenfillet @@ -5466,11 +5243,11 @@ nutriment_amt = 4 nutriment_desc = list("breading" = 4) center_of_mass = list("x"=16, "y"=16) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/chickenfillet/Initialize() . = ..() reagents.add_reagent("protein", 8) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/chickennoodlesoup name = "chicken noodle soup" @@ -5482,12 +5259,12 @@ nutriment_amt = 6 nutriment_desc = list("warm soup" = 6) center_of_mass = list("x"=16, "y"=5) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/chickennoodlesoup/Initialize() . = ..() reagents.add_reagent("protein", 4) reagents.add_reagent("water", 5) - bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/chilicheesefries name = "chili cheese fries" @@ -5500,12 +5277,12 @@ nutriment_amt = 8 nutriment_desc = list("hearty, cheesy fries" = 8) center_of_mass = list("x"=16, "y"=11) + bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/chilicheesefries/Initialize() . = ..() reagents.add_reagent("protein", 2) reagents.add_reagent("capsaicin", 2) - bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/friedmushroom name = "fried mushroom" @@ -5516,11 +5293,11 @@ nutriment_amt = 4 nutriment_desc = list("alcoholic mushrooms" = 4) center_of_mass = list("x"=16, "y"=11) + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/friedmushroom/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/pisanggoreng name = "pisang goreng" @@ -5533,11 +5310,11 @@ nutriment_amt = 8 nutriment_desc = list("sweet bananas" = 8) center_of_mass = list("x"=16, "y"=11) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/pisanggoreng/Initialize() . = ..() reagents.add_reagent("protein", 1) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/meatbun name = "meat and leaf bun" @@ -5548,10 +5325,10 @@ nutriment_amt = 5 nutriment_desc = list("fried meat" = 5) center_of_mass = list("x"=16, "y"=11) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/meatbun/Initialize() . = ..() - bitesize = 2 reagents.add_reagent("protein", 4) /obj/item/weapon/reagent_containers/food/snacks/spicedmeatbun @@ -5563,11 +5340,11 @@ nutriment_amt = 5 nutriment_desc = list("char sui" = 5) center_of_mass = list("x"=16, "y"=11) + bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/spicedmeatbun/Initialize() . = ..() reagents.add_reagent("protein", 3) - bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/custardbun name = "custard bun" @@ -5578,11 +5355,11 @@ nutriment_desc = list("egg custard" = 6) filling_color = "#ebedc2" center_of_mass = list("x"=16, "y"=11) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/custardbun/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/chickenmomo name = "chicken momo" @@ -5595,11 +5372,11 @@ nutriment_amt = 9 nutriment_desc = list("spiced chicken" = 9) center_of_mass = list("x"=15, "y"=9) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/chickenmomo/Initialize() . = ..() reagents.add_reagent("protein", 6) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/veggiemomo name = "veggie momo" @@ -5612,11 +5389,11 @@ nutriment_amt = 13 nutriment_desc = list("spiced vegetables" = 13) center_of_mass = list("x"=15, "y"=9) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/veggiemomo/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/risotto name = "risotto" @@ -5629,11 +5406,11 @@ nutriment_amt = 9 nutriment_desc = list("savory rice" = 6, "cream" = 3) center_of_mass = list("x"=15, "y"=9) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/risotto/Initialize() . = ..() reagents.add_reagent("protein", 1) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/risottoballs name = "risotto balls" @@ -5646,9 +5423,6 @@ nutriment_amt = 1 nutriment_desc = list("batter" = 1) center_of_mass = list("x"=15, "y"=9) - -/obj/item/weapon/reagent_containers/food/snacks/risottoballs/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/honeytoast @@ -5661,9 +5435,6 @@ nutriment_amt = 1 nutriment_desc = list("sweet, crunchy bread" = 1) center_of_mass = list("x"=16, "y"=9) - -/obj/item/weapon/reagent_containers/food/snacks/honeytoast/Initialize() - . = ..() bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/poachedegg @@ -5676,12 +5447,12 @@ nutriment_amt = 1 nutriment_desc = list("egg" = 1) center_of_mass = list("x"=16, "y"=14) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/poachedegg/Initialize() . = ..() reagents.add_reagent("protein", 3) reagents.add_reagent("blackpepper", 1) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/ribplate name = "plate of ribs" @@ -5693,6 +5464,7 @@ nutriment_amt = 6 nutriment_desc = list("barbecue" = 6) center_of_mass = list("x"=16, "y"=13) + bitesize = 4 /obj/item/weapon/reagent_containers/food/snacks/ribplate/Initialize() . = ..() @@ -5700,7 +5472,6 @@ reagents.add_reagent("triglyceride", 2) reagents.add_reagent("blackpepper", 1) reagents.add_reagent("honey", 5) - bitesize = 4 //Sliceables @@ -5781,11 +5552,11 @@ nutriment_amt = 8 nutriment_desc = list("fudge" = 8) center_of_mass = list("x"=15, "y"=9) + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/sliceable/brownies/Initialize() . = ..() reagents.add_reagent("protein", 2) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/browniesslice name = "brownie" @@ -5818,6 +5589,7 @@ nutriment_amt = 8 nutriment_desc = list("fudge" = 8) center_of_mass = list("x"=15, "y"=9) + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/sliceable/cosmicbrownies/Initialize() . = ..() @@ -5826,7 +5598,6 @@ reagents.add_reagent("bicaridine", 1) reagents.add_reagent("kelotane", 1) reagents.add_reagent("toxin", 1) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cosmicbrowniesslice name = "cosmic brownie" @@ -5863,12 +5634,10 @@ desc = "A crème caramel of astronomical size." icon = 'icons/obj/food.dmi' icon_state = "gigapuddi" - trash = /obj/item/trash/plate - -/obj/item/weapon/reagent_containers/food/snacks/gigapuddi/New() - ..() - reagents.add_reagent("nutriment", 20) + nutriment_amt = 20 + nutriment_desc = list("caramel" = 20) bitesize = 2 + trash = /obj/item/trash/plate /obj/item/weapon/reagent_containers/food/snacks/gigapuddi/happy desc = "A crème caramel of astronomical size, made with extra love." @@ -5887,14 +5656,15 @@ slice_path = /obj/item/weapon/reagent_containers/food/snacks/bucheslice slices_num = 5 w_class = 2 + nutriment_amt = 20 + nutriment_desc = list("spongy cake" = 20) + bitesize = 3 trash = /obj/item/trash/tray -/obj/item/weapon/reagent_containers/food/snacks/sliceable/buchedenoel/New() - ..() - reagents.add_reagent("nutriment", 20) +/obj/item/weapon/reagent_containers/food/snacks/sliceable/buchedenoel/Initialize() + . = ..() reagents.add_reagent("sugar", 9) reagents.add_reagent("coco", 5) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/bucheslice name = "\improper Buche de Noel slice" @@ -5912,15 +5682,16 @@ slice_path = /obj/item/weapon/reagent_containers/food/snacks/turkeyslice slices_num = 6 w_class = 2 + nutriment_amt = 20 + nutriment_desc = list("turkey" = 20) + bitesize = 5 trash = /obj/item/trash/tray -/obj/item/weapon/reagent_containers/food/snacks/sliceable/turkey/New() - ..() - reagents.add_reagent("nutriment", 20) +/obj/item/weapon/reagent_containers/food/snacks/sliceable/turkey/Initialize() + . = ..() reagents.add_reagent("blackpepper", 1) reagents.add_reagent("sodiumchloride", 1) reagents.add_reagent("cornoil", 1) - bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/turkeyslice name = "turkey drumstick" @@ -5937,12 +5708,13 @@ slices_num = 10 icon = 'icons/obj/food.dmi' icon_state = "suppermatter" + nutriment_amt = 48 + nutriment_desc = list("pure power" = 48) + bitesize = 12 w_class = 2 -/obj/item/weapon/reagent_containers/food/snacks/sliceable/suppermatter/New() - ..() - reagents.add_reagent("nutriment", 48) - bitesize = 12 +/obj/item/weapon/reagent_containers/food/snacks/sliceable/suppermatter/Initialize() + . = ..() set_light(1.4,2,"#FFFF00") /obj/item/weapon/reagent_containers/food/snacks/suppermattershard @@ -5953,8 +5725,8 @@ bitesize = 3 trash = null -/obj/item/weapon/reagent_containers/food/snacks/suppermattershard/New() - ..() +/obj/item/weapon/reagent_containers/food/snacks/suppermattershard/Initialize() + . = ..() set_light(1.4,1.4,"#FFFF00") /obj/item/weapon/reagent_containers/food/snacks/sliceable/excitingsuppermatter @@ -5964,12 +5736,13 @@ slices_num = 10 icon = 'icons/obj/food.dmi' icon_state = "excitingsuppermatter" + nutriment_amt = 60 + nutriment_desc = list("pure, indescribable power" = 60) + bitesize = 12 w_class = 2 -/obj/item/weapon/reagent_containers/food/snacks/sliceable/excitingsuppermatter/New() - ..() - reagents.add_reagent("nutriment", 60) - bitesize = 12 +/obj/item/weapon/reagent_containers/food/snacks/sliceable/excitingsuppermatter/Initialize() + . = ..() set_light(1.4,2,"#FF0000") /obj/item/weapon/reagent_containers/food/snacks/excitingsuppermattershard @@ -5980,8 +5753,8 @@ bitesize = 4 trash = null -/obj/item/weapon/reagent_containers/food/snacks/excitingsuppermattershard/New() - ..() +/obj/item/weapon/reagent_containers/food/snacks/excitingsuppermattershard/Initialize() + . = ..() set_light(1.4,1.4,"#FF0000") /obj/item/weapon/reagent_containers/food/snacks/omurice @@ -5990,10 +5763,8 @@ icon = 'icons/obj/food.dmi' icon_state = "omurice" trash = /obj/item/trash/plate - -/obj/item/weapon/reagent_containers/food/snacks/omurice/New() - ..() - reagents.add_reagent("nutriment", 8) + nutriment_amt = 8 + nutriment_desc = list("rice" = 4, "egg" = 4) bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/omurice/heart @@ -6010,10 +5781,8 @@ icon = 'icons/obj/food.dmi' icon_state = "cinnamonbun" trash = null - -/obj/item/weapon/reagent_containers/food/snacks/cinnamonbun/New() - ..() - reagents.add_reagent("nutriment", 8) + nutriment_amt = 8 + nutriment_desc = list("cinnamon sugar" = 4, "frosting" = 4) bitesize = 1 ////////////////////Candy Vend Items/////////////////////////////////////////////////////////////// @@ -6094,12 +5863,12 @@ trash = /obj/item/trash/candy/proteinbar nutriment_amt = 9 nutriment_desc = list("candy" = 1, "protein" = 8) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/candy/proteinbar/Initialize() . = ..() reagents.add_reagent("protein", 4) reagents.add_reagent("sugar", 4) - bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/candy/gummy name = "\improper AlliCo Gummies" @@ -6109,16 +5878,12 @@ icon_state = "candy_gums" trash = /obj/item/trash/candy/gums nutriment_amt = 5 - nutriment_desc = list("sugar" = 1, "artificial fruit flavour" = 1) + nutriment_desc = list("artificial fruit flavour" = 2) + bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/candy/gummy/Initialize() . = ..() reagents.add_reagent("sugar", 5) - bitesize = 1 - -/obj/item/weapon/reagent_containers/food/snacks/cookiesnack/Initialize() - . = ..() - bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/cookiesnack name = "Carps Ahoy! miniature cookies" @@ -6130,9 +5895,6 @@ filling_color = "#DBC94F" nutriment_amt = 3 nutriment_desc = list("sweetness" = 1, "stale cookie" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/cookiesnack/Initialize() - . = ..() bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/fruitbar @@ -6142,14 +5904,13 @@ icon = 'icons/obj/food_snacks.dmi' icon_state = "fruitbar" trash = /obj/item/trash/candy/fruitbar - nutriment_amt = 9 + nutriment_amt = 13 nutriment_desc = list("apricot" = 2, "sugar" = 2, "dates" = 2, "cranberry" = 2, "apple" = 2) + bitesize = 6 /obj/item/weapon/reagent_containers/food/snacks/candy/proteinbar/Initialize() . = ..() - reagents.add_reagent("nutriment", 4) reagents.add_reagent("sugar", 4) - bitesize = 6 ////////////////////Candy Bars (1-10)/////////////////////////////////////////////////////////////// @@ -6163,11 +5924,11 @@ nutriment_amt = 4 nutriment_desc = list("stale chocolate" = 2, "nougat" = 1, "caramel" = 1) w_class = 1 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb01/Initialize() . = ..() reagents.add_reagent("sugar", 1) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb02 name = "\improper Hundred-Thousand Thaler Bar" @@ -6179,11 +5940,11 @@ nutriment_amt = 4 nutriment_desc = list("chocolate" = 2, "caramel" = 1, "puffed rice" = 1) w_class = 1 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb02/Initialize() . = ..() reagents.add_reagent("sugar", 1) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb03 name = "\improper Aerostat Bar" @@ -6195,11 +5956,11 @@ nutriment_amt = 4 nutriment_desc = list("chocolate" = 4) w_class = 1 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb03/Initialize() . = ..() reagents.add_reagent("sugar", 1) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb04 name = "\improper Lars' Saltlakris" @@ -6211,11 +5972,11 @@ nutriment_amt = 4 nutriment_desc = list("chocolate" = 2, "salt = 1", "licorice" = 1) w_class = 1 + bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb04/Initialize() . = ..() reagents.add_reagent("sugar", 1) - bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/cb05 name = "\improper Andromeda Bar" @@ -6227,11 +5988,11 @@ nutriment_amt = 3 nutriment_desc = list("milk chocolate" = 2) w_class = 1 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb05/Initialize() . = ..() reagents.add_reagent("sugar", 3) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb06 name = "\improper Mocha Crunch" @@ -6243,11 +6004,11 @@ nutriment_amt = 4 nutriment_desc = list("chocolate" = 2, "coffee" = 1, "vanilla wafer" = 1) w_class = 1 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb06/Initialize() . = ..() reagents.add_reagent("sugar", 1) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb07 name = "\improper TaroMilk Bar" @@ -6259,11 +6020,11 @@ nutriment_amt = 4 nutriment_desc = list("chocolate" = 2, "taro" = 2) w_class = 1 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb07/Initialize() . = ..() reagents.add_reagent("sugar", 1) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb08 name = "\improper Cronk Bar" @@ -6275,11 +6036,11 @@ nutriment_amt = 3 nutriment_desc = list("chocolate" = 2, "malt puffs" = 1) w_class = 1 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb08/Initialize() . = ..() reagents.add_reagent("sugar", 2) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb09 name = "\improper Kaju Mamma! Bar" @@ -6291,12 +6052,12 @@ nutriment_amt = 6 nutriment_desc = list("peanuts" = 3, "condensed milk" = 1, "cashews" = 2) w_class = 1 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb09/Initialize() . = ..() reagents.add_reagent("sugar", 1) reagents.add_reagent("milk", 1) - bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb10 name = "\improper Shantak Bar" @@ -6308,10 +6069,10 @@ nutriment_amt = 5 nutriment_desc = list("chocolate" = 2, "caramel" = 1, "peanuts" = 1, "nougat" = 1) w_class = 1 + bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/cb10/Initialize() . = ..() - bitesize = 3 reagents.add_reagent("sugar", 1) reagents.add_reagent("protein", 1) @@ -6328,9 +6089,6 @@ center_of_mass = list("x"=15, "y"=15) nutriment_amt = 3 nutriment_desc = list("salt" = 1, "chips" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/chips/Initialize() - . = ..() bitesize = 1 /obj/item/weapon/reagent_containers/food/snacks/chips/bbq @@ -6354,9 +6112,6 @@ center_of_mass = list("x"=17, "y"=16) nutriment_amt = 6 nutriment_desc = list("bread" = 2, "sweetness" = 3) - -/obj/item/weapon/reagent_containers/food/snacks/tastybread/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/skrellsnacks @@ -6370,9 +6125,6 @@ center_of_mass = list("x"=15, "y"=12) nutriment_amt = 10 nutriment_desc = list("mushroom" = 5, "salt" = 5) - -/obj/item/weapon/reagent_containers/food/snacks/skrellsnacks/Initialize() - . = ..() bitesize = 3 /obj/item/weapon/reagent_containers/food/snacks/sosjerky @@ -6521,10 +6273,6 @@ nutriment_desc = list("dried raisins" = 6) nutriment_amt = 6 -/obj/item/weapon/reagent_containers/food/snacks/no_raisin/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) - ///obj/item/weapon/reagent_containers/food/snacks/spacetwinkie (Commented out to replace with packaged version 04/14/2021) // name = "Spacer Snack Cake" // icon = 'icons/obj/food_snacks.dmi' @@ -6550,9 +6298,6 @@ center_of_mass = list("x"=15, "y"=9) nutriment_amt = 4 nutriment_desc = list("cheese" = 5, "chips" = 2) - -/obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers/Initialize() - . = ..() bitesize = 2 /obj/item/weapon/reagent_containers/food/snacks/syndicake @@ -6916,13 +6661,9 @@ filling_color = "#ff6633" center_of_mass = "x=15;y=9" nutriment_desc = list("beans" = 1, "tomato sauce" = 1) - nutriment_amt = 10 + nutriment_amt = 15 bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/canned/beef/Initialize() - .=..() - reagents.add_reagent("nutriment", 5) - ///obj/item/weapon/reagent_containers/food/snacks/canned/tomato (NEED TO SEE HOW TO CHANGE EATING SOUND) // name = "tomato soup" // icon_state = "tomato" @@ -6949,12 +6690,12 @@ trash = /obj/item/trash/spinach filling_color = "#003300" center_of_mass = "x=15;y=9" + nutriment_amt = 5 nutriment_desc = list("soggy" = 1, "vegetable" = 1) bitesize = 5 /obj/item/weapon/reagent_containers/food/snacks/canned/spinach/Initialize() .=..() - reagents.add_reagent("nutriment", 5) reagents.add_reagent("adrenaline", 5) reagents.add_reagent("hyperzine", 5) reagents.add_reagent("iron", 5) @@ -7065,13 +6806,10 @@ //trash = /obj/item/trash/lunacakewrap //need to add code that drops trash but keeps -open state filling_color = "#ffffff" center_of_mass = "x=15;y=9" + nutriment_amt = 6 nutriment_desc = list("sweetness" = 4, "vanilla" = 1) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/packaged/lunacake/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) - /obj/item/weapon/reagent_containers/food/snacks/packaged/darklunacake name = "\improper Dark Lunar Cake" icon_state = "mooncake" @@ -7079,13 +6817,10 @@ //trash = /obj/item/trash/mooncakewrap //need to add code that drops trash but keeps -open state filling_color = "#ffffff" center_of_mass = "x=15;y=9" + nutriment_amt = 6 nutriment_desc = list("sweetness" = 4, "chocolate" = 1) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/packaged/darklunacake/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) - /obj/item/weapon/reagent_containers/food/snacks/packaged/mochicake name = "\improper Mochi Cake" icon_state = "mochicake" @@ -7093,13 +6828,10 @@ //trash = /obj/item/trash/mochicakewrap //need to add code that drops trash but keeps -open state filling_color = "#ffffff" center_of_mass = "x=15;y=9" + nutriment_amt = 6 nutriment_desc = list("sweetness" = 4, "rice" = 1) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/packaged/mochicake/Initialize() - . = ..() - reagents.add_reagent("nutriment", 6) - //////////////Advanced Package Foods////////////// /obj/item/weapon/reagent_containers/food/snacks/packaged/spacetwinkie //ADDED 04/14/2021 @@ -7111,6 +6843,7 @@ trash = /obj/item/trash/spacer_cake_wrap filling_color = "#FFE591" center_of_mass = list("x"=15, "y"=11) + nutriment_amt = 6 nutriment_desc = list("sweetness" = 4, "cake" = 2) bitesize = 2 @@ -7126,13 +6859,10 @@ trash = /obj/item/trash/genration filling_color = "#FFFFFF" center_of_mass = list("x"=15, "y"=11) + nutriment_amt = 3 nutriment_desc = list("chalk" = 6) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/packaged/genration/Initialize() - . = ..() - reagents.add_reagent("nutriment", 3) - /obj/item/weapon/reagent_containers/food/snacks/packaged/meatration //ADDED 04/20/2021 name = "meat ration" icon = 'icons/obj/food_canned.dmi' @@ -7141,6 +6871,7 @@ trash = /obj/item/trash/meatration filling_color = "#FFFFFF" center_of_mass = list("x"=15, "y"=11) + nutriment_amt = 6 nutriment_desc = list("chalk" = 3, "meat" = 3) bitesize = 2 @@ -7156,13 +6887,10 @@ trash = /obj/item/trash/vegration filling_color = "#FFFFFF" center_of_mass = list("x"=15, "y"=11) + nutriment_amt = 3 nutriment_desc = list("sadness" = 3, "veggie" = 3) bitesize = 2 -/obj/item/weapon/reagent_containers/food/snacks/packaged/vegration/Initialize() - . = ..() - reagents.add_reagent("nutriment", 3) - /obj/item/weapon/reagent_containers/food/snacks/packaged/sweetration //ADDED 04/20/2021 (Contraband Item) name = "desert ration" icon = 'icons/obj/food_canned.dmi' diff --git a/code/modules/food/food/thecake.dm b/code/modules/food/food/thecake.dm index 3387699962..0b45d1eeb6 100644 --- a/code/modules/food/food/thecake.dm +++ b/code/modules/food/food/thecake.dm @@ -1,8 +1,8 @@ // Chaos cake /datum/recipe/chaoscake_layerone - reagents = list("flour" = 300,"milk" = 200, "sugar" = 100, "egg" = 30) - fruit = list("poisonberries" = 15, "cherries" = 15) + reagents = list("flour" = 30,"milk" = 20, "sugar" = 10, "egg" = 9) + fruit = list("poisonberries" = 2, "cherries" = 2) items = list( /obj/item/weapon/reagent_containers/food/snacks/meat/, /obj/item/weapon/reagent_containers/food/snacks/meat/, @@ -12,8 +12,8 @@ result = /obj/structure/chaoscake /datum/recipe/chaoscake_layertwo - reagents = list("flour" = 300, "milk" = 200, "sugar" = 100, "egg" = 30, ) - fruit = list("vanilla" = 15, "banana" = 15) + reagents = list("flour" = 30, "milk" = 20, "sugar" = 10, "egg" = 9, ) + fruit = list("vanilla" = 2, "banana" = 2) items = list( /obj/item/weapon/reagent_containers/food/snacks/dough, /obj/item/weapon/reagent_containers/food/snacks/dough, @@ -23,8 +23,8 @@ result = /obj/item/weapon/chaoscake_layer /datum/recipe/chaoscake_layerthree - reagents = list("flour" = 240, "milk" = 150, "sugar" = 80, "egg" = 24, "deathbell" = 100) - fruit = list("grapes" = 30) + reagents = list("flour" = 25, "milk" = 15, "sugar" = 10, "egg" = 6, "deathbell" = 10) + fruit = list("grapes" = 3) items = list( /obj/item/weapon/reagent_containers/food/snacks/dough, /obj/item/weapon/reagent_containers/food/snacks/dough, @@ -33,8 +33,8 @@ result = /obj/item/weapon/chaoscake_layer/three /datum/recipe/chaoscake_layerfour - reagents = list("flour" = 240, "milk" = 150, "sugar" = 80, "egg" = 24, "milkshake" = 300) - fruit = list("rice" = 30) + reagents = list("flour" = 25, "milk" = 15, "sugar" = 10, "egg" = 6, "milkshake" = 30) + fruit = list("rice" = 3) items = list( /obj/item/weapon/reagent_containers/food/snacks/dough, /obj/item/weapon/reagent_containers/food/snacks/dough, @@ -43,14 +43,14 @@ result = /obj/item/weapon/chaoscake_layer/four /datum/recipe/chaoscake_layerfive - reagents = list("flour" = 180, "milk" = 100, "sugar" = 60, "egg" = 18, "blood" = 300) - fruit = list("tomato" = 20) + reagents = list("flour" = 20, "milk" = 10, "sugar" = 10, "egg" = 6, "blood" = 30) + fruit = list("tomato" = 2) items = list() //supposed to be made with lobster, still has to be ported. result = /obj/item/weapon/chaoscake_layer/five /datum/recipe/chaoscake_layersix - reagents = list("flour" = 180, "milk" = 100, "sugar" = 60, "egg" = 18, "sprinkles" = 10) - fruit = list("apple" = 30) + reagents = list("flour" = 20, "milk" = 10, "sugar" = 10, "egg" = 6, "sprinkles" = 5) + fruit = list("apple" = 2) items = list( /obj/item/weapon/reagent_containers/food/snacks/dough, /obj/item/weapon/reagent_containers/food/snacks/dough, @@ -62,8 +62,8 @@ result = /obj/item/weapon/chaoscake_layer/six /datum/recipe/chaoscake_layerseven - reagents = list("flour" = 120, "milk" = 50, "sugar" = 40, "egg" = 12, "devilskiss" = 200) - fruit = list("potato" = 10) + reagents = list("flour" = 15, "milk" = 10, "sugar" = 5, "egg" = 3, "devilskiss" = 20) + fruit = list("potato" = 1) items = list( /obj/item/weapon/reagent_containers/food/snacks/dough, /obj/item/weapon/reagent_containers/food/snacks/dough, @@ -72,8 +72,8 @@ result = /obj/item/weapon/chaoscake_layer/seven /datum/recipe/chaoscake_layereight - reagents = list("flour" = 120, "milk" = 50, "sugar" = 40, "egg" = 12, "cream" = 200) - fruit = list("lemon" = 10) + reagents = list("flour" = 15, "milk" = 10, "sugar" = 5, "egg" = 3, "cream" = 20) + fruit = list("lemon" = 1) items = list( /obj/item/weapon/reagent_containers/food/snacks/dough, /obj/item/weapon/reagent_containers/food/snacks/dough, @@ -82,8 +82,8 @@ result = /obj/item/weapon/chaoscake_layer/eight /datum/recipe/chaoscake_layernine - reagents = list("water" = 100, "blood" = 100) - fruit = list("goldapple" = 50) + reagents = list("water" = 10, "blood" = 10) + fruit = list("goldapple" = 1) items = list() result = /obj/item/weapon/chaoscake_layer/nine diff --git a/code/modules/food/kitchen/icecream.dm b/code/modules/food/kitchen/icecream.dm index 2b53b657ce..49ea08e6e8 100644 --- a/code/modules/food/kitchen/icecream.dm +++ b/code/modules/food/kitchen/icecream.dm @@ -188,8 +188,8 @@ ice_creamed = 1 #undef ICECREAM_VANILLA -#undef FLAVOUR_CHOCOLATE -#undef FLAVOUR_STRAWBERRY -#undef FLAVOUR_BLUE +#undef ICECREAM_CHOCOLATE +#undef ICECREAM_STRAWBERRY +#undef ICECREAM_BLUE #undef CONE_WAFFLE #undef CONE_CHOC \ No newline at end of file diff --git a/code/modules/food/recipe.dm b/code/modules/food/recipe.dm index 28970d21e2..faf621e66c 100644 --- a/code/modules/food/recipe.dm +++ b/code/modules/food/recipe.dm @@ -314,20 +314,18 @@ // When exact is false, extraneous ingredients are ignored // When exact is true, extraneous ingredients will fail the recipe -// In both cases, the full complement of required inredients is still needed +// In both cases, the full set of required ingredients is still needed /proc/select_recipe(var/list/datum/recipe/available_recipes, var/obj/obj as obj, var/exact) - var/list/datum/recipe/possible_recipes = list() + var/highest_count = 0 + var/count = 0 for (var/datum/recipe/recipe in available_recipes) if(!recipe.check_reagents(obj.reagents, exact) || !recipe.check_items(obj, exact) || !recipe.check_fruit(obj, exact)) continue - possible_recipes |= recipe - if (!possible_recipes.len) - return null - else if (possible_recipes.len == 1) - return possible_recipes[1] - else //okay, let's select the most complicated recipe - sortTim(possible_recipes, /proc/cmp_recipe_complexity_dsc) - return possible_recipes[1] + // Taken from cmp_recipe_complexity_dsc, but is way faster. + count = LAZYLEN(recipe.items) + LAZYLEN(recipe.reagents) + LAZYLEN(recipe.fruit) + if(count >= highest_count) + highest_count = count + . = recipe // Both of these are just placeholders to allow special behavior for mob holders, but you can do other things in here later if you feel like it. /datum/recipe/proc/before_cook(obj/container) // Called Before the Microwave starts delays and cooking stuff diff --git a/code/modules/food/recipes_microwave.dm b/code/modules/food/recipes_microwave.dm index 39e73a9b1e..ff69fab758 100644 --- a/code/modules/food/recipes_microwave.dm +++ b/code/modules/food/recipes_microwave.dm @@ -49,13 +49,15 @@ I said no! /obj/item/weapon/reagent_containers/food/snacks/meatball ) result = /obj/item/weapon/reagent_containers/food/snacks/donkpocket //SPECIAL - proc/warm_up(var/obj/item/weapon/reagent_containers/food/snacks/donkpocket/being_cooked) - being_cooked.heat() - make_food(var/obj/container as obj) - . = ..(container) - for (var/obj/item/weapon/reagent_containers/food/snacks/donkpocket/D in .) - if (!D.warm) - warm_up(D) + +/datum/recipe/donkpocket/proc/warm_up(var/obj/item/weapon/reagent_containers/food/snacks/donkpocket/being_cooked) + being_cooked.heat() + +/datum/recipe/donkpocket/make_food(var/obj/container as obj) + . = ..(container) + for (var/obj/item/weapon/reagent_containers/food/snacks/donkpocket/D in .) + if (!D.warm) + warm_up(D) /datum/recipe/donkpocket/warm reagents = list() //This is necessary since this is a child object of the above recipe and we don't want donk pockets to need flour diff --git a/code/modules/genetics/side_effects.dm b/code/modules/genetics/side_effects.dm index 25d8ba32e6..498aff20d0 100644 --- a/code/modules/genetics/side_effects.dm +++ b/code/modules/genetics/side_effects.dm @@ -5,77 +5,66 @@ var/effect // description of what happens when not treated var/duration = 0 // delay between start() and finish() - proc/start(mob/living/carbon/human/H) - // start the side effect, this should give some cue as to what's happening, - // such as gasping. These cues need to be unique among side-effects. +/datum/genetics/side_effect/proc/start(mob/living/carbon/human/H) + // start the side effect, this should give some cue as to what's happening, + // such as gasping. These cues need to be unique among side-effects. - proc/finish(mob/living/carbon/human/H) - // Finish the side-effect. This should first check whether the cure has been - // applied, and if not, cause bad things to happen. +/datum/genetics/side_effect/proc/finish(mob/living/carbon/human/H) + // Finish the side-effect. This should first check whether the cure has been + // applied, and if not, cause bad things to happen. /datum/genetics/side_effect/genetic_burn name = "Genetic Burn" symptom = "Subject's skin turns unusualy red." treatment = "Inject small dose of dexalin." effect = "Subject's skin burns." - duration = 10*30 + duration = 30 SECONDS - start(mob/living/carbon/human/H) - H.custom_emote(VISIBLE_MESSAGE, "starts turning very red..") +/datum/genetics/side_effect/genetic_burn/start(mob/living/carbon/human/H) + H.custom_emote(VISIBLE_MESSAGE, "starts turning very red..") - finish(mob/living/carbon/human/H) - if(!H.reagents.has_reagent("dexalin")) - for(var/organ_name in BP_ALL) - var/obj/item/organ/external/E = H.get_organ(organ_name) - E.take_damage(0, 5, 0) +/datum/genetics/side_effect/genetic_burn/finish(mob/living/carbon/human/H) + if(H.reagents.has_reagent("dexalin")) + return + for(var/organ_name in BP_ALL) + var/obj/item/organ/external/E = H.get_organ(organ_name) + E.take_damage(0, 5, 0) /datum/genetics/side_effect/bone_snap name = "Bone Snap" symptom = "Subject's limbs tremble notably." treatment = "Inject small dose of bicaridine." effect = "Subject's bone breaks." - duration = 10*60 + duration = 60 SECONDS - start(mob/living/carbon/human/H) - H.custom_emote(VISIBLE_MESSAGE, "'s limbs start shivering uncontrollably.") +/datum/genetics/side_effect/bone_snap/start(mob/living/carbon/human/H) + H.custom_emote(VISIBLE_MESSAGE, "'s limbs start shivering uncontrollably.") - finish(mob/living/carbon/human/H) - if(!H.reagents.has_reagent("bicaridine")) - var/organ_name = pick(BP_ALL) - var/obj/item/organ/external/E = H.get_organ(organ_name) - E.take_damage(20, 0, 0) - E.fracture() - -/*/datum/genetics/side_effect/monkey - name = "Monkey" - symptom = "Subject starts drooling uncontrollably." - treatment = "Inject small dose of dylovene." - effect = "Subject turns into monkey." - duration = 10*90 - - start(mob/living/carbon/human/H) - H.custom_emote(VISIBLE_MESSAGE, "has drool running down from [H.gender == MALE ? "his" : H.gender == FEMALE ? "her" : "their"] mouth.") - - finish(mob/living/carbon/human/H) - if(!H.reagents.has_reagent("anti_toxin")) - H.monkeyize()**/ +/datum/genetics/side_effect/bone_snap/finish(mob/living/carbon/human/H) + if(H.reagents.has_reagent("bicaridine")) + return + var/organ_name = pick(BP_ALL) + var/obj/item/organ/external/E = H.get_organ(organ_name) + E.take_damage(20, 0, 0) + E.fracture() /datum/genetics/side_effect/confuse name = "Confuse" symptom = "Subject starts drooling uncontrollably." treatment = "Inject small dose of dylovene." effect = "Subject becomes confused." - duration = 10*30 + duration = 30 SECONDS - start(mob/living/carbon/human/H) - var/datum/gender/T = gender_datums[H.get_visible_gender()] - H.custom_emote(VISIBLE_MESSAGE, "has drool running down from [T.his] mouth.") +/datum/genetics/side_effect/confuse/start(mob/living/carbon/human/H) + var/datum/gender/T = gender_datums[H.get_visible_gender()] + H.custom_emote(VISIBLE_MESSAGE, "has drool running down from [T.his] mouth.") - finish(mob/living/carbon/human/H) - if(!H.reagents.has_reagent("anti_toxin")) - H.Confuse(100) +/datum/genetics/side_effect/confuse/finish(mob/living/carbon/human/H) + if(H.reagents.has_reagent("anti_toxin")) + return + H.Confuse(100) -proc/trigger_side_effect(mob/living/carbon/human/H) +/proc/trigger_side_effect(mob/living/carbon/human/H) spawn if(!istype(H)) return var/tp = pick(typesof(/datum/genetics/side_effect) - /datum/genetics/side_effect) diff --git a/code/modules/ghosttrap/trap.dm b/code/modules/ghosttrap/trap.dm index d31b0bffb5..5de81594a9 100644 --- a/code/modules/ghosttrap/trap.dm +++ b/code/modules/ghosttrap/trap.dm @@ -3,12 +3,12 @@ var/list/ghost_traps -proc/get_ghost_trap(var/trap_key) +/proc/get_ghost_trap(var/trap_key) if(!ghost_traps) populate_ghost_traps() return ghost_traps[trap_key] -proc/populate_ghost_traps() +/proc/populate_ghost_traps() ghost_traps = list() for(var/traptype in typesof(/datum/ghosttrap)) var/datum/ghosttrap/G = new traptype diff --git a/code/modules/holodeck/HolodeckObjects.dm b/code/modules/holodeck/HolodeckObjects.dm index f064d32223..5b1d3a82af 100644 --- a/code/modules/holodeck/HolodeckObjects.dm +++ b/code/modules/holodeck/HolodeckObjects.dm @@ -142,10 +142,10 @@ item_state = "boxing" special_attack_type = /datum/unarmed_attack/holopugilism -datum/unarmed_attack/holopugilism +/datum/unarmed_attack/holopugilism sparring_variant_type = /datum/unarmed_attack/holopugilism -datum/unarmed_attack/holopugilism/unarmed_override(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/zone) +/datum/unarmed_attack/holopugilism/unarmed_override(var/mob/living/carbon/human/user,var/mob/living/carbon/human/target,var/zone) user.do_attack_animation(src) var/damage = rand(0, 9) if(!damage) diff --git a/code/modules/holomap/generate_holomap.dm b/code/modules/holomap/generate_holomap.dm index e4917e0ba0..9978416424 100644 --- a/code/modules/holomap/generate_holomap.dm +++ b/code/modules/holomap/generate_holomap.dm @@ -48,27 +48,23 @@ // Generates the "base" holomap for one z-level, showing only the physical structure of walls and paths. /datum/controller/subsystem/holomaps/proc/generateHoloMinimap(var/zLevel = 1) - // Save these values now to avoid a bazillion array lookups - var/offset_x = HOLOMAP_PIXEL_OFFSET_X(zLevel) - var/offset_y = HOLOMAP_PIXEL_OFFSET_Y(zLevel) - // Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime var/icon/canvas = icon(HOLOMAP_ICON, "blank") - if(world.maxx + offset_x > canvas.Width()) - crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) + holomap_offset_x ([offset_x]) must be <= [canvas.Width()]") - if(world.maxy + offset_y > canvas.Height()) - crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) + holomap_offset_y ([offset_y]) must be <= [canvas.Height()]") + if(world.maxx > canvas.Width()) + crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]") + if(world.maxy > canvas.Height()) + crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]") for(var/x = 1 to world.maxx) for(var/y = 1 to world.maxy) var/turf/tile = locate(x, y, zLevel) if(tile && tile.loc:holomapAlwaysDraw()) if(IS_ROCK(tile)) - canvas.DrawBox(HOLOMAP_ROCK, x + offset_x, y + offset_y) + canvas.DrawBox(HOLOMAP_ROCK, x, y) if(IS_OBSTACLE(tile)) - canvas.DrawBox(HOLOMAP_OBSTACLE, x + offset_x, y + offset_y) + canvas.DrawBox(HOLOMAP_OBSTACLE, x, y) else if(IS_PATH(tile)) - canvas.DrawBox(HOLOMAP_PATH, x + offset_x, y + offset_y) + canvas.DrawBox(HOLOMAP_PATH, x, y) // Check sleeping after each row to avoid *completely* destroying the server CHECK_TICK return canvas @@ -78,16 +74,12 @@ // Leshana: I'm guessing this map will get overlayed on top of the base map at runtime? We'll see. // Wait, seems we actually blend the area map on top of it right now! Huh. /datum/controller/subsystem/holomaps/proc/generateStationMinimap(var/zLevel) - // Save these values now to avoid a bazillion array lookups - var/offset_x = HOLOMAP_PIXEL_OFFSET_X(zLevel) - var/offset_y = HOLOMAP_PIXEL_OFFSET_Y(zLevel) - // Sanity checks - Better to generate a helpful error message now than have DrawBox() runtime var/icon/canvas = icon(HOLOMAP_ICON, "blank") - if(world.maxx + offset_x > canvas.Width()) - crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) + holomap_offset_x ([offset_x]) must be <= [canvas.Width()]") - if(world.maxy + offset_y > canvas.Height()) - crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) + holomap_offset_y ([offset_y]) must be <= [canvas.Height()]") + if(world.maxx > canvas.Width()) + crash_with("Minimap for z=[zLevel] : world.maxx ([world.maxx]) must be <= [canvas.Width()]") + if(world.maxy > canvas.Height()) + crash_with("Minimap for z=[zLevel] : world.maxy ([world.maxy]) must be <= [canvas.Height()]") for(var/x = 1 to world.maxx) for(var/y = 1 to world.maxy) @@ -95,7 +87,7 @@ if(tile && tile.loc) var/area/areaToPaint = tile.loc if(areaToPaint.holomap_color) - canvas.DrawBox(areaToPaint.holomap_color, x + offset_x, y + offset_y) + canvas.DrawBox(areaToPaint.holomap_color, x, y) // Save this nice area-colored canvas in case we want to layer it or something I guess extraMiniMaps["[HOLOMAP_EXTRA_STATIONMAPAREAS]_[zLevel]"] = canvas @@ -129,13 +121,17 @@ var/icon/small_map = icon(HOLOMAP_ICON, "blank") // For each zlevel in turn, overlay them on top of each other for(var/zLevel in zlevels) + var/offset_x = HOLOMAP_PIXEL_OFFSET_X(zLevel) || 1 + var/offset_y = HOLOMAP_PIXEL_OFFSET_Y(zLevel) || 1 + var/icon/z_terrain = icon(holoMiniMaps[zLevel]) - z_terrain.Blend(HOLOMAP_HOLOFIER, ICON_MULTIPLY) - big_map.Blend(z_terrain, ICON_OVERLAY) - small_map.Blend(z_terrain, ICON_OVERLAY) + z_terrain.Blend(HOLOMAP_HOLOFIER, ICON_MULTIPLY, offset_x, offset_y) + big_map.Blend(z_terrain, ICON_OVERLAY, offset_x, offset_y) + small_map.Blend(z_terrain, ICON_OVERLAY, offset_x, offset_y) + var/icon/z_areas = extraMiniMaps["[HOLOMAP_EXTRA_STATIONMAPAREAS]_[zLevel]"] - big_map.Blend(z_areas, ICON_OVERLAY) - small_map.Blend(z_areas, ICON_OVERLAY) + big_map.Blend(z_areas, ICON_OVERLAY, offset_x, offset_y) + small_map.Blend(z_areas, ICON_OVERLAY, offset_x, offset_y) // Then scale and rotate to make the actual small map we will use small_map.Scale(WORLD_ICON_SIZE, WORLD_ICON_SIZE) diff --git a/code/modules/holomap/mapper.dm b/code/modules/holomap/mapper.dm new file mode 100644 index 0000000000..a068c752eb --- /dev/null +++ b/code/modules/holomap/mapper.dm @@ -0,0 +1,444 @@ +/obj/item/device/mapping_unit + name = "mapping unit" + desc = "A portable mapping unit, capable of locating other similar units on a map. Also has a short-range sonar mapping system." + icon_state = "mapping_unit" + item_state = null + w_class = ITEMSIZE_SMALL + + //Holomap stuff + var/marker_prefix = "basic" + var/base_prefix = "basic" + var/map_color = null + var/mapper_filter = HOLOMAP_FILTER_STATIONMAP + + var/list/prefix_update_head + var/list/prefix_update_rig + + // These are local because they are different for every holochip. + // The maps and icons are all pixel_x and pixel_y'd so we're in the center. + var/list/map_image_cache = list() + var/list/icon_image_cache = list() + + var/pinging = FALSE + var/updating = FALSE + var/global/icon/mask_icon + var/obj/screen/mapper/extras_holder/extras_holder + var/hud_frame_hint + + var/datum/mini_hud/mapper/hud_datum + var/obj/screen/movable/mapper_holder/hud_item + + var/obj/item/weapon/cell/cell + var/cell_type = /obj/item/weapon/cell/device + var/power_usage = 0.5 // Usage per map scan (doubled for ping mode) + var/uses_power = 1 // If it uses power at all + + var/list/debug_mappers_list + var/list/debug_beacons_list + +/obj/item/device/mapping_unit/deathsquad + name = "deathsquad mapping unit" + icon_state = "mapping_unit_ds" + marker_prefix = "ds" + mapper_filter = HOLOMAP_FILTER_DEATHSQUAD + //map_color = "#0B74B4" + hud_frame_hint = "_ds" + +/obj/item/device/mapping_unit/operative + name = "nuclear operative mapping unit" + icon_state = "mapping_unit_op" + marker_prefix = "op" + mapper_filter = HOLOMAP_FILTER_NUKEOPS + //map_color = "#13B40B" + hud_frame_hint = "_op" + +/obj/item/device/mapping_unit/ert + name = "emergency response team mapping unit" + icon_state = "mapping_unit_ert" + marker_prefix = "ert" + mapper_filter = HOLOMAP_FILTER_ERT + //map_color = "#5FFF28" + hud_frame_hint = "_ert" + + prefix_update_head = list( + "/obj/item/clothing/head/helmet/ert/command" = "ertc", + "/obj/item/clothing/head/helmet/ert/security" = "erts", + "/obj/item/clothing/head/helmet/ert/engineer" = "erte", + "/obj/item/clothing/head/helmet/ert/medical" = "ertm", + ) + + prefix_update_rig = list( + "/obj/item/weapon/rig/ert" = "ertc", + "/obj/item/weapon/rig/ert/security" = "erts", + "/obj/item/weapon/rig/ert/engineer" = "erte", + "/obj/item/weapon/rig/ert/medical" = "ertm" + ) + +/obj/item/device/mapping_unit/Initialize() + . = ..() + base_prefix = marker_prefix + + if(!mask_icon) + mask_icon = icon('icons/effects/64x64.dmi', "mapper_mask") + + extras_holder = new() + + var/obj/screen/mapper/marker/mark = new() + mark.icon = 'icons/effects/64x64.dmi' + mark.icon_state = "mapper_none" + mark.layer = 10 + icon_image_cache["bad"] = mark + + var/obj/screen/mapper/map/tmp = new() + var/icon/canvas = icon(HOLOMAP_ICON, "blank") + canvas.Crop(1,1,world.maxx,world.maxy) + canvas.DrawBox("#A7BE97",1,1,world.maxx,world.maxy) + tmp.icon = icon + map_image_cache["bad"] = tmp + + if(uses_power && cell_type) + cell = new cell_type(src) + + debug_mappers_list = mapping_units + debug_beacons_list = mapping_beacons + +/obj/item/device/mapping_unit/Destroy() + mapping_units -= src + + last_run() + + map_image_cache.Cut() + icon_image_cache.Cut() + qdel_null(extras_holder) + + return ..() + +/obj/item/device/mapping_unit/dropped(mob/dropper) + if(loc != dropper) // Not just a juggle + hide_device() + +/obj/item/device/mapping_unit/attack_self(mob/user) + if(user.stat != CONSCIOUS) + return + + if(!ishuman(user)) + to_chat(user, "Only humanoids can use this device.") + return + + var/mob/living/carbon/human/H = user + + if(!ishuman(loc) || user != loc) + to_chat(H, "This device needs to be on your person.") + + if(hud_datum?.main_hud) + hide_device() + to_chat(H, "You put \the [src] away.") + else + show_device(H) + to_chat(H, "You hold \the [src] where you can see it.") + +/obj/item/device/mapping_unit/attack_hand(mob/user) + if(cell && user.get_inactive_hand() == src) // click with empty off hand + to_chat(user,"You eject \the [cell] from \the [src].") + user.put_in_hands(cell) + cell = null + if(updating) + stop_updates() + else + return ..() + +/obj/item/device/mapping_unit/attackby(obj/W, mob/user) + if(istype(W,cell_type) && !cell) + cell = W + cell.update_icon() //Why doesn't a cell do this already? :| + user.unEquip(cell) + cell.forceMove(src) + to_chat(user,"You insert \the [cell] into \the [src].") + + +/obj/item/device/mapping_unit/proc/first_run(mob/user) + hud_datum = new(user.hud_used, src) + hud_item = hud_datum.screenobjs[1] + +/obj/item/device/mapping_unit/proc/show_device(mob/user) + if(!hud_datum) + first_run(user) + else + hud_datum.apply_to_hud(user.hud_used) + +/obj/item/device/mapping_unit/proc/start_updates() + mapping_units += src + updating = TRUE + START_PROCESSING(SSobj, src) + process() + + + +/obj/item/device/mapping_unit/proc/stop_updates() + mapping_units -= src + STOP_PROCESSING(SSobj, src) + updating = FALSE + if(hud_item) + hud_item.off(FALSE) + +/obj/item/device/mapping_unit/proc/hide_device() + hud_datum.unapply_to_hud() + +/obj/item/device/mapping_unit/proc/last_run() + stop_updates() + if(!QDELETED(hud_datum)) + qdel(hud_datum) + hud_datum = null + hud_item = null + + +/obj/item/device/mapping_unit/process() + if(!updating || (uses_power && !cell)) + stop_updates() + return + + if(uses_power) + var/power_to_use = pinging ? power_usage*2 : power_usage + if(cell.use(power_to_use) != power_to_use) // we weren't able to use our full power_usage amount! + visible_message("\The [src] flickers before going dull.") + stop_updates() + return + + if(!hud_item || !hud_datum) + log_error("Mapping device tried to update with missing hud_item or hud_datum") + stop_updates() + last_run() + return + + update_holomap() + +#define HOLOMAP_ERROR 0 +#define HOLOMAP_YOU 1 +#define HOLOMAP_OTHER 2 +#define HOLOMAP_DEAD 3 + +/obj/item/device/mapping_unit/proc/update_holomap() + var/turf/T = get_turf(src) + if(!T)//nullspace begone! + stop_updates() + return + + var/T_x = T.x // Used many times, just grab it to avoid derefs + var/T_y = T.y + var/T_z = T.z + + var/obj/screen/mapper/map/bgmap + var/list/extras = list() + + var/map_cache_key = "[T_z]" + var/badmap = FALSE + if(!pinging && using_map && !(T_z in using_map.mappable_levels)) + map_cache_key = "bad" + badmap = TRUE + + // Cache miss + if(!(map_cache_key in map_image_cache)) + var/mutable_appearance/map_app = new() + map_app.appearance_flags = PIXEL_SCALE + map_app.plane = PLANE_HOLOMAP + map_app.layer = HUD_LAYER + map_app.color = map_color + + if(!SSholomaps.holoMiniMaps[T_z]) + var/obj/screen/mapper/map/baddo = map_image_cache["bad"] + map_app.icon = icon(baddo.icon) + badmap = TRUE + // SSholomaps did map it and we're allowed to see it + else + map_app.icon = icon(SSholomaps.holoMiniMaps[T.z]) + + // Apply markers + for(var/marker in holomap_markers) + var/datum/holomap_marker/holomarker = holomap_markers[marker] + if(holomarker.z == T_z && holomarker.filter & mapper_filter) + var/image/markerImage = image(holomarker.icon,holomarker.id) + markerImage.plane = FLOAT_PLANE + markerImage.layer = FLOAT_LAYER + markerImage.appearance_flags = RESET_COLOR|PIXEL_SCALE + markerImage.pixel_x = holomarker.x+holomarker.offset_x + markerImage.pixel_y = holomarker.y+holomarker.offset_y + map_app.overlays += markerImage + + var/obj/screen/mapper/map/tmp = new() + tmp.appearance = map_app + map_image_cache[map_cache_key] = tmp + + bgmap = map_image_cache[map_cache_key] + + // The holomap moves around, the user is always in the center. This slides the holomap. + var/offset_x = bgmap.offset_x + var/offset_y = bgmap.offset_y + extras_holder.pixel_x = bgmap.pixel_x = -1*T_x + offset_x + extras_holder.pixel_y = bgmap.pixel_y = -1*T_y + offset_y + + // Populate other mapper icons + for(var/hc in mapping_units) + var/obj/item/device/mapping_unit/HC = hc + if(HC.mapper_filter != mapper_filter) + continue + var/mob_indicator = HOLOMAP_ERROR + var/turf/TU = get_turf(HC) + // Mapper not on a turf or elsewhere + if(!TU || (TU.z != T_z)) + continue + + // We're the marker + if(HC == src) + mob_indicator = HOLOMAP_YOU + + // The marker is held by a borg + else if(isrobot(HC.loc)) + var/mob/living/silicon/robot/R = HC.loc + if(R.stat == DEAD) + mob_indicator = HOLOMAP_DEAD + else + mob_indicator = HOLOMAP_OTHER + + // The marker is worn by a human + else if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.stat == DEAD) + mob_indicator = HOLOMAP_DEAD + else + mob_indicator = HOLOMAP_OTHER + + // It's not attached to anything useful + else + mob_indicator = HOLOMAP_DEAD + + // Ask it to update it's icon based on helmet (or whatever) + HC.update_marker() + + // Generate the icon and apply it to the list of images to show the client + if(mob_indicator != HOLOMAP_ERROR) + + // This is so specific because the icons are pixel_x and pixel_y only relative to OUR view of where THEY are relative to us + var/marker_cache_key = "\ref[HC]_[HC.marker_prefix]_[mob_indicator]" + + if(!(marker_cache_key in icon_image_cache)) + var/obj/screen/mapper/marker/mark = new() + mark.icon_state = "[HC.marker_prefix][mob_indicator]" + icon_image_cache[marker_cache_key] = mark + switch(mob_indicator) + if(HOLOMAP_YOU) + mark.layer = 3 // Above the other markers + if(HOLOMAP_DEAD) + mark.layer = 2 + else + mark.layer = 1 + + var/obj/screen/mapper/marker/mark = icon_image_cache[marker_cache_key] + handle_marker(mark,TU.x,TU.y) + extras += mark + + // Marker beacon items + for(var/hb in mapping_beacons) + var/obj/item/device/holomap_beacon/HB = hb + if(HB.mapper_filter != mapper_filter) + continue + + var/turf/TB = get_turf(HB) + // Marker beacon not on a turf or elsewhere + if(!TB || (TB.z != T_z)) + continue + + var/marker_cache_key = "\ref[HB]_marker" + if(!(marker_cache_key in icon_image_cache)) + var/obj/screen/mapper/marker/mark = new() + mark.icon_state = "beacon" + mark.layer = 1 + icon_image_cache[marker_cache_key] = mark + + var/obj/screen/mapper/marker/mark = icon_image_cache[marker_cache_key] + handle_marker(mark,TB.x,TB.y) + extras += mark + + if(badmap) + var/obj/O = icon_image_cache["bad"] + O.pixel_x = T_x - offset_x + O.pixel_y = T_y - offset_y + extras += O + + extras_holder.filters = filter(type = "alpha", icon = mask_icon, x = T_x-(offset_x*0.5), y = T_y-(offset_y*0.5)) + extras_holder.vis_contents = extras + + hud_item.update(bgmap, extras_holder, badmap ? FALSE : pinging) + +/obj/item/device/mapping_unit/proc/update_marker() + marker_prefix = base_prefix + if (prefix_update_head) + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + var/obj/item/helmet = H.get_equipped_item(slot_head) + if(helmet && ("[helmet.type]" in prefix_update_head)) + marker_prefix = prefix_update_head["[helmet.type]"] + return + if (prefix_update_rig) + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + var/obj/item/weapon/rig = H.get_rig() + if(rig && ("[rig.type]" in prefix_update_rig)) + marker_prefix = prefix_update_rig["[rig.type]"] + return + +/obj/item/device/mapping_unit/proc/handle_marker(var/atom/movable/marker,var/TU_x,var/TU_y) + marker.pixel_x = TU_x - 8 //16x16 icons, so to center. + marker.pixel_y = TU_y - 8 + animate(marker, alpha = 0, time = 5, easing = SINE_EASING) + animate(alpha = 255, time = 2, easing = SINE_EASING) + +/obj/item/device/holomap_beacon + name = "holomap beacon" + desc = "When active, the beacon will show itself on mapping units of the same type." + icon_state = "holochip" + w_class = ITEMSIZE_TINY + var/mapper_filter = HOLOMAP_FILTER_STATIONMAP + var/in_list = FALSE + +/obj/item/device/holomap_beacon/Initialize() + . = ..() + if(in_list) // mapped in turned on + in_list = TRUE + mapping_beacons += src + icon_state = initial(icon_state) + in_list ? "_on" : "" + +/obj/item/device/holomap_beacon/attack_self(mob/user) + if(!in_list) + in_list = TRUE + mapping_beacons += src + else + in_list = FALSE + mapping_beacons -= src + icon_state = "[initial(icon_state)][in_list ? "_on" : ""]" + to_chat(user,SPAN_NOTICE("The [src] is now [in_list ? "broadcasting" : "disabled"].")) + +/obj/item/device/holomap_beacon/Destroy() + if(in_list) + mapping_beacons -= src + return ..() + +/obj/item/device/holomap_beacon/deathsquad + name = "deathsquad holomap beacon" + icon_state = "holochip_ds" + mapper_filter = HOLOMAP_FILTER_DEATHSQUAD + +/obj/item/device/holomap_beacon/operative + name = "operative holomap beacon" + icon_state = "holochip_op" + mapper_filter = HOLOMAP_FILTER_NUKEOPS + +/obj/item/device/holomap_beacon/ert + name = "ert holomap beacon" + icon_state = "holochip_ert" + mapper_filter = HOLOMAP_FILTER_ERT + + +#undef HOLOMAP_ERROR +#undef HOLOMAP_YOU +#undef HOLOMAP_OTHER +#undef HOLOMAP_DEAD diff --git a/code/modules/holomap/station_holomap.dm b/code/modules/holomap/station_holomap.dm index 93cf76017d..dc15dabb46 100644 --- a/code/modules/holomap/station_holomap.dm +++ b/code/modules/holomap/station_holomap.dm @@ -240,9 +240,29 @@ origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 2) req_components = list() -// TODO -// //Portable holomaps, currently AI/Borg/MoMMI only +/datum/holomap_marker + var/x + var/y + var/z + var/offset_x = -8 + var/offset_y = -8 + var/filter + var/id // used for icon_state of the marker on maps + var/icon = 'icons/holomap_markers.dmi' + var/color //used by path rune markers -// TODO -// OHHHH YEAH - STRATEGIC HOLOMAP! NICE! -// It will need to wait until later tho. +/obj/effect/landmark/holomarker + delete_me = TRUE + + var/filter = HOLOMAP_FILTER_STATIONMAP + var/id = "generic" + +/obj/effect/landmark/holomarker/Initialize() + . = ..() + var/datum/holomap_marker/holomarker = new() + holomarker.id = id + holomarker.filter = filter + holomarker.x = src.x + holomarker.y = src.y + holomarker.z = src.z + holomap_markers["[id]_\ref[src]"] = holomarker diff --git a/code/modules/hydroponics/seed_storage.dm b/code/modules/hydroponics/seed_storage.dm index 2c26ac8394..66273144b7 100644 --- a/code/modules/hydroponics/seed_storage.dm +++ b/code/modules/hydroponics/seed_storage.dm @@ -523,7 +523,7 @@ if(lockdown) to_chat(user, "\The [src]'s control panel thunks, as its cover retracts.") lockdown = 0 - if(req_access || req_one_access) + if(LAZYLEN(req_access) || LAZYLEN(req_one_access)) req_access = list() req_one_access = list() to_chat(user, "\The [src]'s access mechanism shorts out.") diff --git a/code/modules/integrated_electronics/subtypes/lists.dm b/code/modules/integrated_electronics/subtypes/lists.dm index 943141b071..8c62404e05 100644 --- a/code/modules/integrated_electronics/subtypes/lists.dm +++ b/code/modules/integrated_electronics/subtypes/lists.dm @@ -144,7 +144,7 @@ push_data() activate_pin(2) -obj/item/integrated_circuit/list/len +/obj/item/integrated_circuit/list/len name = "len circuit" desc = "This circuit will give length of the list." inputs = list( diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm index 2473209dfa..330b1e0778 100644 --- a/code/modules/integrated_electronics/subtypes/output.dm +++ b/code/modules/integrated_electronics/subtypes/output.dm @@ -134,7 +134,7 @@ text = get_pin_data(IC_INPUT, 1) if(!isnull(text)) var/obj/O = assembly ? loc : assembly - audible_message("[bicon(O)] \The [O.name] states, \"[text]\"") + audible_message("[bicon(O)] \The [O.name] states, \"[text]\"", runemessage = text) /obj/item/integrated_circuit/output/text_to_speech/advanced name = "advanced text-to-speech circuit" diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm index 6bb1fc9939..576edff4a5 100644 --- a/code/modules/library/lib_items.dm +++ b/code/modules/library/lib_items.dm @@ -128,36 +128,36 @@ Book Cart End /obj/structure/bookcase/manuals/medical name = "Medical Manuals bookcase" - New() - ..() - new /obj/item/weapon/book/manual/medical_cloning(src) - new /obj/item/weapon/book/manual/medical_diagnostics_manual(src) - new /obj/item/weapon/book/manual/medical_diagnostics_manual(src) - new /obj/item/weapon/book/manual/medical_diagnostics_manual(src) - update_icon() +/obj/structure/bookcase/manuals/medical/New() + ..() + new /obj/item/weapon/book/manual/medical_cloning(src) + new /obj/item/weapon/book/manual/medical_diagnostics_manual(src) + new /obj/item/weapon/book/manual/medical_diagnostics_manual(src) + new /obj/item/weapon/book/manual/medical_diagnostics_manual(src) + update_icon() /obj/structure/bookcase/manuals/engineering name = "Engineering Manuals bookcase" - New() - ..() - new /obj/item/weapon/book/manual/engineering_construction(src) - new /obj/item/weapon/book/manual/engineering_particle_accelerator(src) - new /obj/item/weapon/book/manual/engineering_hacking(src) - new /obj/item/weapon/book/manual/engineering_guide(src) - new /obj/item/weapon/book/manual/atmospipes(src) - new /obj/item/weapon/book/manual/engineering_singularity_safety(src) - new /obj/item/weapon/book/manual/evaguide(src) - update_icon() +/obj/structure/bookcase/manuals/engineering/New() + ..() + new /obj/item/weapon/book/manual/engineering_construction(src) + new /obj/item/weapon/book/manual/engineering_particle_accelerator(src) + new /obj/item/weapon/book/manual/engineering_hacking(src) + new /obj/item/weapon/book/manual/engineering_guide(src) + new /obj/item/weapon/book/manual/atmospipes(src) + new /obj/item/weapon/book/manual/engineering_singularity_safety(src) + new /obj/item/weapon/book/manual/evaguide(src) + update_icon() /obj/structure/bookcase/manuals/research_and_development name = "R&D Manuals bookcase" - New() - ..() - new /obj/item/weapon/book/manual/research_and_development(src) - update_icon() +/obj/structure/bookcase/manuals/research_and_development/New() + ..() + new /obj/item/weapon/book/manual/research_and_development(src) + update_icon() /* @@ -383,26 +383,26 @@ Book Cart End var/obj/item/weapon/book/book // Currently scanned book var/mode = 0 // 0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory - attack_self(mob/user as mob) - mode += 1 - if(mode > 3) - mode = 0 - to_chat(user, "[src] Status Display:") - var/modedesc - switch(mode) - if(0) - modedesc = "Scan book to local buffer." - if(1) - modedesc = "Scan book to local buffer and set associated computer buffer to match." - if(2) - modedesc = "Scan book to local buffer, attempt to check in scanned book." - if(3) - modedesc = "Scan book to local buffer, attempt to add book to general inventory." - else - modedesc = "ERROR" - to_chat(user, " - Mode [mode] : [modedesc]") - if(src.computer) - to_chat(user, "Computer has been associated with this unit.") +/obj/item/weapon/barcodescanner/attack_self(mob/user as mob) + mode += 1 + if(mode > 3) + mode = 0 + to_chat(user, "[src] Status Display:") + var/modedesc + switch(mode) + if(0) + modedesc = "Scan book to local buffer." + if(1) + modedesc = "Scan book to local buffer and set associated computer buffer to match." + if(2) + modedesc = "Scan book to local buffer, attempt to check in scanned book." + if(3) + modedesc = "Scan book to local buffer, attempt to add book to general inventory." else - to_chat(user, "No associated computer found. Only local scans will function properly.") - to_chat(user, "\n") \ No newline at end of file + modedesc = "ERROR" + to_chat(user, " - Mode [mode] : [modedesc]") + if(src.computer) + to_chat(user, "Computer has been associated with this unit.") + else + to_chat(user, "No associated computer found. Only local scans will function properly.") + to_chat(user, "\n") \ No newline at end of file diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 6757added4..196a27ba20 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -11,7 +11,7 @@ /* * Borrowbook datum */ -datum/borrowbook // Datum used to keep track of who has borrowed what when and for how long. +/datum/borrowbook // Datum used to keep track of who has borrowed what when and for how long. var/bookname var/mobname var/getdate diff --git a/code/modules/lighting/__lighting_docs.dm b/code/modules/lighting/__lighting_docs.dm index 8ef93935e9..049bfe6c88 100644 --- a/code/modules/lighting/__lighting_docs.dm +++ b/code/modules/lighting/__lighting_docs.dm @@ -54,7 +54,7 @@ turf: (lighting_turf.dm) - Create lighting overlays for this turf -atom/movable/lighting_overlay: (lighting_overlay.dm) +/atom/movable/lighting_overlay: (lighting_overlay.dm) - var/lum_r, var/lum_g, var/lum_b; lumcounts of each colour - var/needs_update; set on update_lumcount, checked by lighting process diff --git a/code/modules/maps/fromdmp.dm b/code/modules/maps/fromdmp.dm index af75aa3d99..4c5b62a310 100644 --- a/code/modules/maps/fromdmp.dm +++ b/code/modules/maps/fromdmp.dm @@ -5,10 +5,10 @@ by Lummox JR */ -mob/verb/Convert(filename as file) +/mob/verb/Convert(filename as file) dmp2swapmap(filename) -proc/d2sm_prepmap(filename) +/proc/d2sm_prepmap(filename) var/txt = file2text(filename) if(!txt) return var/i,j @@ -23,7 +23,7 @@ proc/d2sm_prepmap(filename) i=findText(txt,"\\\n",i) return txt -proc/dmp2swapmap(filename) +/proc/dmp2swapmap(filename) //var/txt = file2text(filename) //if(!txt) return var/txt = d2sm_prepmap(filename) @@ -187,7 +187,7 @@ proc/dmp2swapmap(filename) to_chat(F, "\t\t\t[x]") to_chat(F, codes[pick(codes)]) */ -proc/d2sm_ParseCommaList(txt) +/proc/d2sm_ParseCommaList(txt) var/list/L=new var/i,ch for(i=1,i<=length(txt),++i) @@ -205,7 +205,7 @@ proc/d2sm_ParseCommaList(txt) if(i>1) L+=copytext(txt,1,i) return L -proc/d2sm_MatchBrace(txt, i, which) +/proc/d2sm_MatchBrace(txt, i, which) if(which==40) ++which else which+=2 var/j,ch @@ -216,7 +216,7 @@ proc/d2sm_MatchBrace(txt, i, which) j=d2sm_MatchBrace(txt,j,ch) if(!j) return 0 -proc/d2sm_ConvertType(tt,tabs="") +/proc/d2sm_ConvertType(tt,tabs="") var/i=findText(tt,"{") if(!i) return "[tabs]type = [tt]\n" .="[tabs]type = [copytext(tt,1,i)]\n" @@ -225,7 +225,7 @@ proc/d2sm_ConvertType(tt,tabs="") for(var/pair in L) .="[.][tabs][pair]\n" -proc/d2sm_Contents(list/conts,n,tabs="") +/proc/d2sm_Contents(list/conts,n,tabs="") .="[tabs]contents = list(" var/i for(i=0,i2 ? SEE_INVISIBLE_LEVEL_ONE : see_invisible_default - var/tmp/glasses_processed = 0 + var/glasses_processed = 0 var/obj/item/weapon/rig/rig = get_rig() if(istype(rig) && rig.visor && !looking_elsewhere) if(!rig.helmet || (head && rig.helmet == head)) diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index 21e19f68d4..905bd3b564 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -235,7 +235,7 @@ base_color = "#333333" reagent_tag = IS_TAJARA - allergens = COFFEE + allergens = ALLERGEN_COFFEE move_trail = /obj/effect/decal/cleanable/blood/tracks/paw @@ -333,7 +333,7 @@ breath_heat_level_3 = 1350 //Default 1250 reagent_tag = IS_SKRELL - allergens = MEAT|FISH|DAIRY|EGGS + allergens = ALLERGEN_MEAT|ALLERGEN_FISH|ALLERGEN_DAIRY|ALLERGEN_EGGS has_limbs = list( BP_TORSO = list("path" = /obj/item/organ/external/chest), diff --git a/code/modules/mob/living/carbon/human/species/xenomorphs/xenomorphs.dm b/code/modules/mob/living/carbon/human/species/xenomorphs/xenomorphs.dm index 50f4ce9cc5..eae90e0476 100644 --- a/code/modules/mob/living/carbon/human/species/xenomorphs/xenomorphs.dm +++ b/code/modules/mob/living/carbon/human/species/xenomorphs/xenomorphs.dm @@ -1,4 +1,4 @@ -proc/create_new_xenomorph(var/alien_caste,var/target) +/proc/create_new_xenomorph(var/alien_caste,var/target) target = get_turf(target) if(!target || !alien_caste) return diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 648fe1dd91..1b4bf3c92f 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -63,7 +63,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() #define MUTATIONS_LAYER 1 //Mutations like fat, and lasereyes #define SKIN_LAYER 2 //Skin things added by a call on species #define BLOOD_LAYER 3 //Bloodied hands/feet/anything else -#define DAMAGE_LAYER 4 //Injury overlay sprites like open wounds +#define MOB_DAM_LAYER 4 //Injury overlay sprites like open wounds #define SURGERY_LAYER 5 //Overlays for open surgical sites #define UNDERWEAR_LAYER 6 //Underwear/bras/etc #define SHOES_LAYER_ALT 7 //Shoe-slot item (when set to be under uniform via verb) @@ -91,7 +91,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() #define TAIL_LAYER_ALT 29 //Modified tail-sprite layer. Tend to be larger. #define MODIFIER_EFFECTS_LAYER 30 //Effects drawn by modifiers #define FIRE_LAYER 31 //'Mob on fire' overlay layer -#define WATER_LAYER 32 //'Mob submerged' overlay layer +#define MOB_WATER_LAYER 32 //'Mob submerged' overlay layer #define TARGETED_LAYER 33 //'Aimed at' overlay layer #define TOTAL_LAYERS 33//<---- KEEP THIS UPDATED, should always equal the highest number here, used to initialize a list. ////////////////////////////////// @@ -158,7 +158,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(QDESTROYING(src)) return - remove_layer(DAMAGE_LAYER) + remove_layer(MOB_DAM_LAYER) // first check whether something actually changed about damage appearance var/damage_appearance = "" @@ -174,7 +174,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() previous_damage_appearance = damage_appearance - var/image/standing_image = image(icon = species.damage_overlays, icon_state = "00", layer = BODY_LAYER+DAMAGE_LAYER) + var/image/standing_image = image(icon = species.damage_overlays, icon_state = "00", layer = BODY_LAYER+MOB_DAM_LAYER) // blend the individual damage states with our icons for(var/obj/item/organ/external/O in organs) @@ -195,8 +195,8 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() standing_image.overlays += DI - overlays_standing[DAMAGE_LAYER] = standing_image - apply_layer(DAMAGE_LAYER) + overlays_standing[MOB_DAM_LAYER] = standing_image + apply_layer(MOB_DAM_LAYER) //BASE MOB SPRITE /mob/living/carbon/human/update_icons_body() @@ -1058,18 +1058,18 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() if(QDESTROYING(src)) return - remove_layer(WATER_LAYER) + remove_layer(MOB_WATER_LAYER) var/depth = check_submerged() if(!depth || lying) return var/atom/A = loc // We'd better be swimming and on a turf - var/image/I = image(icon = 'icons/mob/submerged.dmi', icon_state = "human_swimming_[depth]", layer = BODY_LAYER+WATER_LAYER) //TODO: Improve + var/image/I = image(icon = 'icons/mob/submerged.dmi', icon_state = "human_swimming_[depth]", layer = BODY_LAYER+MOB_WATER_LAYER) //TODO: Improve I.color = A.color - overlays_standing[WATER_LAYER] = I + overlays_standing[MOB_WATER_LAYER] = I - apply_layer(WATER_LAYER) + apply_layer(MOB_WATER_LAYER) /mob/living/carbon/human/proc/update_surgery() if(QDESTROYING(src)) @@ -1148,7 +1148,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() return image(tail_s) //If you have a custom tail selected - if(tail_style && !(wear_suit && wear_suit.flags_inv & HIDETAIL && !isTaurTail(tail_style))) + if(tail_style && !(wear_suit && wear_suit.flags_inv & HIDETAIL && !istaurtail(tail_style))) var/icon/tail_s = new/icon("icon" = tail_style.icon, "icon_state" = wagging && tail_style.ani_state ? tail_style.ani_state : tail_style.icon_state) if(tail_style.do_colouration) tail_s.Blend(rgb(src.r_tail, src.g_tail, src.b_tail), tail_style.color_blend_mode) @@ -1176,7 +1176,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() tail_s.Blend(overlay, ICON_OVERLAY) qdel(overlay) - if(isTaurTail(tail_style)) + if(istaurtail(tail_style)) var/datum/sprite_accessory/tail/taur/taurtype = tail_style if(taurtype.can_ride && !riding_datum) riding_datum = new /datum/riding/taur(src) @@ -1201,7 +1201,7 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() //Human Overlays Indexes///////// #undef MUTATIONS_LAYER #undef SKIN_LAYER -#undef DAMAGE_LAYER +#undef MOB_DAM_LAYER #undef SURGERY_LAYER #undef UNDERWEAR_LAYER #undef SHOES_LAYER_ALT @@ -1221,7 +1221,6 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon() #undef EYES_LAYER #undef FACEMASK_LAYER #undef HEAD_LAYER -#undef COLLAR_LAYER #undef HANDCUFF_LAYER #undef LEGCUFF_LAYER #undef L_HAND_LAYER diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index a522ca2a06..1d66ec017c 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -1,60 +1,65 @@ var/list/department_radio_keys = list( - ":r" = "right ear", ".r" = "right ear", - ":l" = "left ear", ".l" = "left ear", - ":i" = "intercom", ".i" = "intercom", - ":h" = "department", ".h" = "department", - ":+" = "special", ".+" = "special", //activate radio-specific special functions - ":c" = "Command", ".c" = "Command", - ":n" = "Science", ".n" = "Science", - ":m" = "Medical", ".m" = "Medical", - ":e" = "Engineering", ".e" = "Engineering", - ":k" = "Response Team", ".k" = "Response Team", - ":s" = "Security", ".s" = "Security", - ":w" = "whisper", ".w" = "whisper", - ":t" = "Mercenary", ".t" = "Mercenary", - ":x" = "Raider", ".x" = "Raider", - ":u" = "Supply", ".u" = "Supply", - ":v" = "Service", ".v" = "Service", - ":p" = "AI Private", ".p" = "AI Private", - ":y" = "Explorer", ".y" = "Explorer", + ":r" = "right ear", ".r" = "right ear", + ":l" = "left ear", ".l" = "left ear", + ":i" = "intercom", ".i" = "intercom", + ":h" = "department", ".h" = "department", + ":+" = "special", ".+" = "special", //activate radio-specific special functions + ":c" = "Command", ".c" = "Command", + ":n" = "Science", ".n" = "Science", + ":m" = "Medical", ".m" = "Medical", + ":e" = "Engineering", ".e" = "Engineering", + ":k" = "Response Team", ".k" = "Response Team", + ":s" = "Security", ".s" = "Security", + ":w" = "whisper", ".w" = "whisper", + ":t" = "Mercenary", ".t" = "Mercenary", + ":x" = "Raider", ".x" = "Raider", + ":u" = "Supply", ".u" = "Supply", + ":v" = "Service", ".v" = "Service", + ":p" = "AI Private", ".p" = "AI Private", + ":y" = "Explorer", ".y" = "Explorer", - ":R" = "right ear", ".R" = "right ear", - ":L" = "left ear", ".L" = "left ear", - ":I" = "intercom", ".I" = "intercom", - ":H" = "department", ".H" = "department", - ":C" = "Command", ".C" = "Command", - ":N" = "Science", ".N" = "Science", - ":M" = "Medical", ".M" = "Medical", - ":E" = "Engineering", ".E" = "Engineering", - ":k" = "Response Team", ".k" = "Response Team", - ":S" = "Security", ".S" = "Security", - ":W" = "whisper", ".W" = "whisper", - ":T" = "Mercenary", ".T" = "Mercenary", - ":X" = "Raider", ".X" = "Raider", - ":U" = "Supply", ".U" = "Supply", - ":V" = "Service", ".V" = "Service", - ":P" = "AI Private", ".P" = "AI Private", - ":Y" = "Explorer", ".Y" = "Explorer", + ":R" = "right ear", ".R" = "right ear", + ":L" = "left ear", ".L" = "left ear", + ":I" = "intercom", ".I" = "intercom", + ":H" = "department", ".H" = "department", + ":C" = "Command", ".C" = "Command", + ":N" = "Science", ".N" = "Science", + ":M" = "Medical", ".M" = "Medical", + ":E" = "Engineering", ".E" = "Engineering", + ":k" = "Response Team", ".k" = "Response Team", + ":S" = "Security", ".S" = "Security", + ":W" = "whisper", ".W" = "whisper", + ":T" = "Mercenary", ".T" = "Mercenary", + ":X" = "Raider", ".X" = "Raider", + ":U" = "Supply", ".U" = "Supply", + ":V" = "Service", ".V" = "Service", + ":P" = "AI Private", ".P" = "AI Private", + ":Y" = "Explorer", ".Y" = "Explorer", - //kinda localization -- rastaf0 - //same keys as above, but on russian keyboard layout. This file uses cp1251 as encoding. - ":�" = "right ear", ".�" = "right ear", - ":�" = "left ear", ".�" = "left ear", - ":�" = "intercom", ".�" = "intercom", - ":�" = "department", ".�" = "department", - ":�" = "Command", ".�" = "Command", - ":�" = "Science", ".�" = "Science", - ":�" = "Medical", ".�" = "Medical", - ":�" = "Engineering", ".�" = "Engineering", - ":�" = "Security", ".�" = "Security", - ":�" = "whisper", ".�" = "whisper", - ":�" = "Mercenary", ".�" = "Mercenary", - ":�" = "Supply", ".�" = "Supply", + // Cyrillic characters on the same keys on the Russian QWERTY (phonetic) layout + ":к" = "right ear", ".к" = "right ear", + ":д" = "left ear", ".д" = "left ear", + ":ш" = "intercom", ".ш" = "intercom", + ":р" = "department", ".р" = "department", + ":+" = "special", ".+" = "special", //activate radio-specific special functions + ":с" = "Command", ".с" = "Command", + ":т" = "Science", ".т" = "Science", + ":ь" = "Medical", ".ь" = "Medical", + ":у" = "Engineering", ".у" = "Engineering", + ":л" = "Response Team", ".л" = "Response Team", + ":ы" = "Security", ".ы" = "Security", + ":ц" = "whisper", ".ц" = "whisper", + ":е" = "Mercenary", ".е" = "Mercenary", + ":ч" = "Raider", ".ч" = "Raider", + ":г" = "Supply", ".г" = "Supply", + ":м" = "Service", ".м" = "Service", + ":з" = "AI Private", ".з" = "AI Private", + ":н" = "Explorer", ".н" = "Explorer" ) var/list/channel_to_radio_key = new -proc/get_radio_key_from_channel(var/channel) +/proc/get_radio_key_from_channel(var/channel) var/key = channel_to_radio_key[channel] if(!key) for(var/radio_key in department_radio_keys) @@ -324,16 +329,17 @@ proc/get_radio_key_from_channel(var/channel) if(M && src) //If we still exist, when the spawn processes var/dst = get_dist(get_turf(M),get_turf(src)) + var/runechat_enabled = M.client?.is_preference_enabled(/datum/client_preference/runechat_mob) if(dst <= message_range || (M.stat == DEAD && !forbid_seeing_deadchat)) //Inside normal message range, or dead with ears (handled in the view proc) - if(M.client) + if(M.client && !runechat_enabled) var/image/I1 = listening[M] || speech_bubble images_to_clients[I1] |= M.client M << I1 M.hear_say(message_pieces, verb, italics, src, speech_sound, sound_vol) if(whispering && !isobserver(M)) //Don't even bother with these unless whispering if(dst > message_range && dst <= w_scramble_range) //Inside whisper scramble range - if(M.client) + if(M.client && !runechat_enabled) var/image/I2 = listening[M] || speech_bubble images_to_clients[I2] |= M.client M << I2 diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index fc4de6e0be..b40bc24a67 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1,990 +1,991 @@ -#define AI_CHECK_WIRELESS 1 -#define AI_CHECK_RADIO 2 - -var/list/ai_verbs_default = list( - // /mob/living/silicon/ai/proc/ai_recall_shuttle, - /mob/living/silicon/ai/proc/ai_emergency_message, - /mob/living/silicon/ai/proc/ai_goto_location, - /mob/living/silicon/ai/proc/ai_remove_location, - /mob/living/silicon/ai/proc/ai_hologram_change, - /mob/living/silicon/ai/proc/ai_network_change, - /mob/living/silicon/ai/proc/ai_statuschange, - /mob/living/silicon/ai/proc/ai_store_location, - /mob/living/silicon/ai/proc/control_integrated_radio, - /mob/living/silicon/ai/proc/pick_icon, - /mob/living/silicon/ai/proc/sensor_mode, - /mob/living/silicon/ai/proc/show_laws_verb, - /mob/living/silicon/ai/proc/toggle_acceleration, - /mob/living/silicon/ai/proc/toggle_hologram_movement, - /mob/living/silicon/ai/proc/ai_announcement, - /mob/living/silicon/ai/proc/ai_call_shuttle, - /mob/living/silicon/ai/proc/ai_camera_track, - /mob/living/silicon/ai/proc/ai_camera_list, - /mob/living/silicon/ai/proc/ai_roster, - /mob/living/silicon/ai/proc/ai_checklaws, - /mob/living/silicon/ai/proc/toggle_camera_light, - /mob/living/silicon/ai/proc/take_image, - /mob/living/silicon/ai/proc/view_images, - /mob/living/silicon/ai/proc/toggle_multicam_verb, - /mob/living/silicon/ai/proc/add_multicam_verb -) - -//Not sure why this is necessary... -/proc/AutoUpdateAI(obj/subject) - var/is_in_use = 0 - if (subject!=null) - for(var/A in ai_list) - var/mob/living/silicon/ai/M = A - if ((M.client && M.machine == subject)) - is_in_use = 1 - subject.attack_ai(M) - return is_in_use - - -/mob/living/silicon/ai - name = "AI" - icon = 'icons/mob/AI.dmi'// - icon_state = "ai" - anchored = 1 // -- TLE - density = 1 - status_flags = CANSTUN|CANPARALYSE|CANPUSH - shouldnt_see = list(/mob/observer/eye, /obj/effect/rune) - var/list/network = list(NETWORK_DEFAULT) - var/obj/machinery/camera/camera = null - var/aiRestorePowerRoutine = 0 - var/viewalerts = 0 - var/icon/holo_icon//Default is assigned when AI is created. - var/list/connected_robots = list() - var/obj/item/device/pda/ai/aiPDA = null - var/obj/item/device/communicator/aiCommunicator = null - var/obj/item/device/multitool/aiMulti = null - var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null - 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 = "" - var/control_disabled = 0 - var/datum/announcement/priority/announcement - var/obj/machinery/ai_powersupply/psupply = null // Backwards reference to AI's powersupply object. - var/hologram_follow = 1 //This is used for the AI eye, to determine if a holopad's hologram should follow it or not. - var/is_dummy = 0 //Used to prevent dummy AIs from spawning with communicators. - //NEWMALF VARIABLES - var/malfunctioning = 0 // Master var that determines if AI is malfunctioning. - var/datum/malf_hardware/hardware = null // Installed piece of hardware. - var/datum/malf_research/research = null // Malfunction research datum. - var/obj/machinery/power/apc/hack = null // APC that is currently being hacked. - var/list/hacked_apcs = null // List of all hacked APCs - var/APU_power = 0 // If set to 1 AI runs on APU power - var/hacking = 0 // Set to 1 if AI is hacking APC, cyborg, other AI, or running system override. - var/system_override = 0 // Set to 1 if system override is initiated, 2 if succeeded. - var/hack_can_fail = 1 // If 0, all abilities have zero chance of failing. - var/hack_fails = 0 // This increments with each failed hack, and determines the warning message text. - var/errored = 0 // Set to 1 if runtime error occurs. Only way of this happening i can think of is admin fucking up with varedit. - var/bombing_core = 0 // Set to 1 if core auto-destruct is activated - var/bombing_station = 0 // Set to 1 if station nuke auto-destruct is activated - var/override_CPUStorage = 0 // Bonus/Penalty CPU Storage. For use by admins/testers. - var/override_CPURate = 0 // Bonus/Penalty CPU generation rate. For use by admins/testers. - - var/datum/ai_icon/selected_sprite // The selected icon set - var/custom_sprite = 0 // Whether the selected icon is custom - var/carded - - // Multicam Vars - var/multicam_allowed = TRUE - var/multicam_on = FALSE - var/obj/screen/movable/pic_in_pic/ai/master_multicam - var/list/multicam_screens = list() - var/list/all_eyes = list() - var/max_multicams = 6 - - can_be_antagged = TRUE - -/mob/living/silicon/ai/proc/add_ai_verbs() - src.verbs |= ai_verbs_default - src.verbs |= silicon_subsystems - -/mob/living/silicon/ai/proc/remove_ai_verbs() - src.verbs -= ai_verbs_default - src.verbs -= silicon_subsystems - -/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0) - announcement = new() - announcement.title = "A.I. Announcement" - announcement.announcement_type = "A.I. Announcement" - announcement.newscast = 1 - - var/list/possibleNames = ai_names - - var/pickedName = null - while(!pickedName) - pickedName = pick(ai_names) - for (var/mob/living/silicon/ai/A in mob_list) - if (A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop - possibleNames -= pickedName - pickedName = null - - if(!is_dummy) - aiPDA = new/obj/item/device/pda/ai(src) - SetName(pickedName) - anchored = 1 - canmove = 0 - density = 1 - loc = loc - - if(!is_dummy) - aiCommunicator = new /obj/item/device/communicator/integrated(src) - - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) - - proc_holder_list = new() - - if(L) - if (istype(L, /datum/ai_laws)) - laws = L - else - laws = new using_map.default_law_type - - aiMulti = new(src) - aiRadio = new(src) - common_radio = aiRadio - aiRadio.myAi = src - additional_law_channels["Binary"] = "#b" - additional_law_channels["Holopad"] = ":h" - - aiCamera = new/obj/item/device/camera/siliconcam/ai_camera(src) - - if (istype(loc, /turf)) - add_ai_verbs(src) - - //Languages - add_language("Robot Talk", 1) - add_language(LANGUAGE_GALCOM, 1) - add_language(LANGUAGE_SOL_COMMON, 1) - add_language(LANGUAGE_UNATHI, 1) - add_language(LANGUAGE_SIIK, 1) - add_language(LANGUAGE_AKHANI, 1) - add_language(LANGUAGE_SKRELLIAN, 1) - add_language(LANGUAGE_SKRELLIANFAR, 0) - add_language(LANGUAGE_TRADEBAND, 1) - add_language(LANGUAGE_GUTTER, 1) - add_language(LANGUAGE_EAL, 1) - add_language(LANGUAGE_SCHECHI, 1) - add_language(LANGUAGE_SIGN, 1) - add_language(LANGUAGE_ROOTLOCAL, 1) - add_language(LANGUAGE_TERMINUS, 1) - add_language(LANGUAGE_ZADDAT, 1) - - if(!safety)//Only used by AIize() to successfully spawn an AI. - if (!B)//If there is no player/brain inside. - empty_playable_ai_cores += new/obj/structure/AIcore/deactivated(loc)//New empty terminal. - qdel(src)//Delete AI. - return - else - if (B.brainmob.mind) - B.brainmob.mind.transfer_to(src) - - on_mob_init() - - spawn(5) - new /obj/machinery/ai_powersupply(src) - - ai_list += src - ..() - return - -/mob/living/silicon/ai/proc/on_mob_init() - to_chat(src, "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).") - to_chat(src, "To look at other parts of the station, click on yourself to get a camera menu.") - to_chat(src, "While observing through a camera, you can use most (networked) devices which you can see, such as computers, APCs, intercoms, doors, etc.") - to_chat(src, "To use something, simply click on it.") - to_chat(src, "Use say #b to speak to your cyborgs through binary. Use say :h to speak from an active holopad.") - to_chat(src, "For department channels, use the following say commands:") - - var/radio_text = "" - for(var/i = 1 to common_radio.channels.len) - var/channel = common_radio.channels[i] - var/key = get_radio_key_from_channel(channel) - radio_text += "[key] - [channel]" - if(i != common_radio.channels.len) - radio_text += ", " - - to_chat(src,radio_text) - - if (malf && !(mind in malf.current_antagonists)) - show_laws() - to_chat(src, "These laws may be changed by other players, or by you being the traitor.") - - job = "AI" - setup_icon() - -/mob/living/silicon/ai/Destroy() - ai_list -= src - - QDEL_NULL(announcement) - QDEL_NULL(eyeobj) - QDEL_NULL(psupply) - QDEL_NULL(aiPDA) - QDEL_NULL(aiCommunicator) - QDEL_NULL(aiMulti) - QDEL_NULL(aiRadio) - QDEL_NULL(aiCamera) - hack = null - - return ..() - -/mob/living/silicon/ai/Stat() - ..() - if(statpanel("Status")) - if(!stat) // Make sure we're not unconscious/dead. - stat(null, text("System integrity: [(health+100)/2]%")) - stat(null, text("Connected synthetics: [connected_robots.len]")) - for(var/mob/living/silicon/robot/R in connected_robots) - var/robot_status = "Nominal" - if(R.shell) - robot_status = "AI SHELL" - else if(R.stat || !R.client) - robot_status = "OFFLINE" - else if(!R.cell || R.cell.charge <= 0) - robot_status = "DEPOWERED" - //Name, Health, Battery, Module, Area, and Status! Everything an AI wants to know about its borgies! - stat(null, text("[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \ - Module: [R.modtype] | Loc: [get_area_name(R, TRUE)] | Status: [robot_status]")) - stat(null, text("AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]")) //Count of total AI shells - else - stat(null, text("Systems nonfunctional")) - - -/mob/living/silicon/ai/proc/setup_icon() - var/file = file2text("config/custom_sprites.txt") - var/lines = splittext(file, "\n") - - for(var/line in lines) - // split & clean up - var/list/Entry = splittext(line, ":") - for(var/i = 1 to Entry.len) - Entry[i] = trim(Entry[i]) - - if(Entry.len < 2) - continue; - - if(Entry[1] == src.ckey && Entry[2] == src.real_name) - icon = CUSTOM_ITEM_SYNTH - custom_sprite = 1 - selected_sprite = new/datum/ai_icon("Custom", "[src.ckey]-ai", "4", "[ckey]-ai-crash", "#FFFFFF", "#FFFFFF", "#FFFFFF") - else - selected_sprite = default_ai_icon - updateicon() - -/mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view()) - set popup_menu = 0 - set src = usr.contents - return 0 - -/mob/living/silicon/ai/SetName(pickedName as text) - ..() - announcement.announcer = pickedName - if(eyeobj) - eyeobj.name = "[pickedName] (AI Eye)" - - // Set ai pda name - if(aiPDA) - aiPDA.ownjob = "AI" - aiPDA.owner = pickedName - aiPDA.name = pickedName + " (" + aiPDA.ownjob + ")" - - if(aiCommunicator) - aiCommunicator.register_device(src.name) - -/* - The AI Power supply is a dummy object used for powering the AI since only machinery should be using power. - The alternative was to rewrite a bunch of AI code instead here we are. -*/ -/obj/machinery/ai_powersupply - name="Power Supply" - 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 = USE_POWER_ACTIVE - power_channel = EQUIP - var/mob/living/silicon/ai/powered_ai = null - invisibility = 100 - -/obj/machinery/ai_powersupply/New(var/mob/living/silicon/ai/ai=null) - powered_ai = ai - powered_ai.psupply = src - if(istype(powered_ai,/mob/living/silicon/ai/announcer)) //Don't try to get a loc for a nullspace announcer mob, just put it into it - forceMove(powered_ai) - else - forceMove(powered_ai.loc) - - ..() - use_power(1) // Just incase we need to wake up the power system. - -/obj/machinery/ai_powersupply/Destroy() - . = ..() - powered_ai = null - -/obj/machinery/ai_powersupply/process() - if(!powered_ai || powered_ai.stat == DEAD) - qdel(src) - return - if(powered_ai.psupply != src) // For some reason, the AI has different powersupply object. Delete this one, it's no longer needed. - qdel(src) - return - if(powered_ai.APU_power) - update_use_power(USE_POWER_OFF) - return - if(!powered_ai.anchored) - loc = powered_ai.loc - update_use_power(USE_POWER_OFF) - use_power(50000) // Less optimalised but only called if AI is unwrenched. This prevents usage of wrenching as method to keep AI operational without power. Intellicard is for that. - if(powered_ai.anchored) - update_use_power(USE_POWER_ACTIVE) - -/mob/living/silicon/ai/proc/pick_icon() - set category = "AI Settings" - set name = "Set AI Core Display" - if(stat || aiRestorePowerRoutine) - return - - if (!custom_sprite) - var/new_sprite = input("Select an icon!", "AI", selected_sprite) as null|anything in ai_icons - if(new_sprite) selected_sprite = new_sprite - updateicon() - -// this verb lets the ai see the stations manifest -/mob/living/silicon/ai/proc/ai_roster() - set category = "AI Commands" - set name = "Show Crew Manifest" - show_station_manifest() - -/mob/living/silicon/ai/var/message_cooldown = 0 -/mob/living/silicon/ai/proc/ai_announcement() - set category = "AI Commands" - set name = "Make Station Announcement" - if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) - return - - if(message_cooldown) - to_chat(src, "Please allow one minute to pass between announcements.") - return - var/input = input(usr, "Please write a message to announce to the station crew.", "A.I. Announcement") - if(!input) - return - - if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) - return - - announcement.Announce(input) - message_cooldown = 1 - spawn(600)//One minute cooldown - message_cooldown = 0 - -/mob/living/silicon/ai/proc/ai_call_shuttle() - set category = "AI Commands" - set name = "Call Emergency Shuttle" - if(check_unable(AI_CHECK_WIRELESS)) - return - - var/confirm = alert("Are you sure you want to call the shuttle?", "Confirm Shuttle Call", "Yes", "No") - - if(check_unable(AI_CHECK_WIRELESS)) - return - - if(confirm == "Yes") - call_shuttle_proc(src) - - // hack to display shuttle timer - if(emergency_shuttle.online()) - post_status(src, "shuttle", user = src) - -/mob/living/silicon/ai/proc/ai_recall_shuttle() - set category = "AI Commands" - set name = "Recall Emergency Shuttle" - - if(check_unable(AI_CHECK_WIRELESS)) - return - - var/confirm = alert("Are you sure you want to recall the shuttle?", "Confirm Shuttle Recall", "Yes", "No") - if(check_unable(AI_CHECK_WIRELESS)) - return - - if(confirm == "Yes") - cancel_call_proc(src) - -/mob/living/silicon/ai/var/emergency_message_cooldown = 0 - -/mob/living/silicon/ai/proc/ai_emergency_message() - set category = "AI Commands" - set name = "Send Emergency Message" - - if(check_unable(AI_CHECK_WIRELESS)) - return - if(emergency_message_cooldown) - to_chat(usr, "Arrays recycling. Please stand by.") - return - var/input = sanitize(input(usr, "Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) - if(!input) - return - CentCom_announce(input, usr) - to_chat(usr, "Message transmitted.") - log_game("[key_name(usr)] has made an IA [using_map.boss_short] announcement: [input]") - emergency_message_cooldown = 1 - spawn(300) - emergency_message_cooldown = 0 -/mob/living/silicon/ai/check_eye(var/mob/user as mob) - if (!camera) - return -1 - return 0 - -/mob/living/silicon/ai/restrained() - return 0 - -/mob/living/silicon/ai/emp_act(severity) - disconnect_shell("Disconnected from remote shell due to ionic interfe%*@$^___") - if (prob(30)) - view_core() - ..() - -/mob/living/silicon/ai/Topic(href, href_list) - if(usr != src) - return - if(..()) - return - if (href_list["mach_close"]) - if (href_list["mach_close"] == "aialerts") - viewalerts = 0 - var/t1 = text("window=[]", href_list["mach_close"]) - unset_machine() - src << browse(null, t1) - if (href_list["switchcamera"]) - switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras - if (href_list["showalerts"]) - subsystem_alarm_monitor() - //Carn: holopad requests - if (href_list["jumptoholopad"]) - var/obj/machinery/hologram/holopad/H = locate(href_list["jumptoholopad"]) - if(stat == CONSCIOUS) - if(H) - H.attack_ai(src) //may as well recycle - else - to_chat(src, "Unable to locate the holopad.") - - if (href_list["track"]) - var/mob/target = locate(href_list["track"]) in mob_list - - if(target && (!istype(target, /mob/living/carbon/human) || html_decode(href_list["trackname"]) == target:get_face_name())) - ai_actual_track(target) - else - to_chat(src, "System error. Cannot locate [html_decode(href_list["trackname"])].") - return - - if(href_list["trackbot"]) - var/mob/living/bot/target = locate(href_list["trackbot"]) in mob_list - if(target) - ai_actual_track(target) - else - to_chat(src, "Target is not on or near any active cameras on the station.") - return - - if(href_list["open"]) - var/mob/target = locate(href_list["open"]) in mob_list - if(target) - open_nearest_door(target) - - return - -/mob/living/silicon/ai/proc/camera_visibility(mob/observer/eye/aiEye/moved_eye) - cameranet.visibility(moved_eye, client, all_eyes) - -/mob/living/silicon/ai/forceMove(atom/destination) - . = ..() - if(.) - end_multicam() - -/mob/living/silicon/ai/reset_view(atom/A) - if(camera) - camera.set_light(0) - if(istype(A,/obj/machinery/camera)) - camera = A - if(A != GLOB.ai_camera_room_landmark) - end_multicam() - . = ..() - if(.) - if(!A && isturf(loc) && eyeobj) - end_multicam() - client.eye = eyeobj - client.perspective = MOB_PERSPECTIVE - if(istype(A,/obj/machinery/camera)) - if(camera_light_on) A.set_light(AI_CAMERA_LUMINOSITY) - else A.set_light(0) - - -/mob/living/silicon/ai/proc/switchCamera(var/obj/machinery/camera/C) - if (!C || stat == DEAD) //C.can_use()) - return 0 - - if(!src.eyeobj) - view_core() - return - // ok, we're alive, camera is good and in our network... - eyeobj.setLoc(get_turf(C)) - //machine = src - - return 1 - -/mob/living/silicon/ai/cancel_camera() - set category = "AI Commands" - set name = "Cancel Camera View" - view_core() - -//Replaces /mob/living/silicon/ai/verb/change_network() in ai.dm & camera.dm -//Adds in /mob/living/silicon/ai/proc/ai_network_change() instead -//Addition by Mord_Sith to define AI's network change ability -/mob/living/silicon/ai/proc/get_camera_network_list() - if(check_unable()) - return - - var/list/cameralist = new() - for (var/obj/machinery/camera/C in cameranet.cameras) - if(!C.can_use()) - continue - var/list/tempnetwork = difflist(C.network,restricted_camera_networks,1) - for(var/i in tempnetwork) - cameralist[i] = i - - cameralist = sortAssoc(cameralist) - return cameralist - -/mob/living/silicon/ai/proc/ai_network_change(var/network in get_camera_network_list()) - set category = "AI Commands" - set name = "Jump To Network" - unset_machine() - - if(!network) - return - - if(!eyeobj) - view_core() - return - - src.network = network - - for(var/obj/machinery/camera/C in cameranet.cameras) - if(!C.can_use()) - continue - if(network in C.network) - eyeobj.setLoc(get_turf(C)) - break - to_chat(src, "Switched to [network] camera network.") -//End of code by Mord_Sith - -/mob/living/silicon/ai/proc/ai_statuschange() - set category = "AI Settings" - set name = "AI Status" - - if(check_unable(AI_CHECK_WIRELESS)) - return - - set_ai_status_displays(src) - return - -//I am the icon meister. Bow fefore me. //>fefore -/mob/living/silicon/ai/proc/ai_hologram_change() - set name = "Change Hologram" - set desc = "Change the default hologram available to AI to something else." - set category = "AI Settings" - - if(check_unable()) - return - - var/input - var/choice = alert("Would you like to select a hologram based on a (visible) crew member, switch to unique avatar, or load your character from your character slot?",,"Crew Member","Unique","My Character") - - switch(choice) - if("Crew Member") //A seeable crew member (or a dog) - var/list/targets = trackable_mobs() - if(targets.len) - input = input("Select a crew member:") as null|anything in targets //The definition of "crew member" is a little loose... - //This is torture, I know. If someone knows a better way... - if(!input) return - var/new_holo = getHologramIcon(getCompoundIcon(targets[input])) - qdel(holo_icon) - holo_icon = new_holo - - else - alert("No suitable records found. Aborting.") - - if("My Character") //Loaded character slot - if(!client || !client.prefs) return - var/mob/living/carbon/human/dummy/dummy = new () - //This doesn't include custom_items because that's ... hard. - client.prefs.dress_preview_mob(dummy) - sleep(1 SECOND) //Strange bug in preview code? Without this, certain things won't show up. Yay race conditions? - dummy.regenerate_icons() - - var/new_holo = getHologramIcon(getCompoundIcon(dummy)) - qdel(holo_icon) - qdel(dummy) - holo_icon = new_holo - - else //A premade from the dmi - var/icon_list[] = list( - "default", - "floating face", - "singularity", - "drone", - "carp", - "spider", - "bear", - "slime", - "ian", - "runtime", - "poly", - "pun pun", - "male human", - "female human", - "male unathi", - "female unathi", - "male tajaran", - "female tajaran", - "male tesharii", - "female tesharii", - "male skrell", - "female skrell" - ) - input = input("Please select a hologram:") as null|anything in icon_list - if(input) - qdel(holo_icon) - switch(input) - if("default") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) - if("floating face") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo2")) - if("singularity") - holo_icon = getHologramIcon(icon('icons/obj/singularity.dmi',"singularity_s1")) - if("drone") - holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"drone0")) - if("carp") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo4")) - if("spider") - holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"nurse")) - if("bear") - holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"brownbear")) - if("slime") - holo_icon = getHologramIcon(icon('icons/mob/slimes.dmi',"cerulean adult slime")) - if("ian") - holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"corgi")) - if("runtime") - holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"cat")) - if("poly") - holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"parrot_fly")) - if("pun pun") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"punpun")) - if("male human") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holohumm")) - if("female human") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holohumf")) - if("male unathi") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holounam")) - if("female unathi") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holounaf")) - if("male tajaran") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotajm")) - if("female tajaran") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotajf")) - if("male tesharii") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotesm")) - if("female tesharii") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotesf")) - if("male skrell") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holoskrm")) - if("female skrell") - holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holoskrf")) - -//Toggles the luminosity and applies it by re-entereing the camera. -/mob/living/silicon/ai/proc/toggle_camera_light() - set name = "Toggle Camera Light" - set desc = "Toggles the light on the camera the AI is looking through." - set category = "AI Commands" - if(check_unable()) - return - - camera_light_on = !camera_light_on - to_chat(src, "Camera lights [camera_light_on ? "activated" : "deactivated"].") - if(!camera_light_on) - if(camera) - camera.set_light(0) - camera = null - else - lightNearbyCamera() - - - -// Handled camera lighting, when toggled. -// It will get the nearest camera from the eyeobj, lighting it. - -/mob/living/silicon/ai/proc/lightNearbyCamera() - if(camera_light_on && camera_light_on < world.timeofday) - if(src.camera) - var/obj/machinery/camera/camera = near_range_camera(src.eyeobj) - if(camera && src.camera != camera) - src.camera.set_light(0) - if(!camera.light_disabled) - src.camera = camera - src.camera.set_light(AI_CAMERA_LUMINOSITY) - else - src.camera = null - else if(isnull(camera)) - src.camera.set_light(0) - src.camera = null - else - var/obj/machinery/camera/camera = near_range_camera(src.eyeobj) - if(camera && !camera.light_disabled) - src.camera = camera - src.camera.set_light(AI_CAMERA_LUMINOSITY) - camera_light_on = world.timeofday + 1 * 20 // Update the light every 2 seconds. - - -/mob/living/silicon/ai/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/device/aicard)) - - var/obj/item/device/aicard/card = W - card.grab_ai(src, user) - - else if(W.is_wrench()) - if(user == deployed_shell) - to_chat(user, "The shell's subsystems resist your efforts to tamper with your bolts.") - return - if(anchored) - playsound(src, W.usesound, 50, 1) - user.visible_message("\The [user] starts to unbolt \the [src] from the plating...") - if(!do_after(user,40 * W.toolspeed)) - user.visible_message("\The [user] decides not to unbolt \the [src].") - return - user.visible_message("\The [user] finishes unfastening \the [src]!") - anchored = 0 - return - else - playsound(src, W.usesound, 50, 1) - user.visible_message("\The [user] starts to bolt \the [src] to the plating...") - if(!do_after(user,40 * W.toolspeed)) - user.visible_message("\The [user] decides not to bolt \the [src].") - return - user.visible_message("\The [user] finishes fastening down \the [src]!") - anchored = 1 - return - else - return ..() - -/mob/living/silicon/ai/proc/control_integrated_radio() - set name = "Radio Settings" - set desc = "Allows you to change settings of your radio." - set category = "AI Settings" - - if(check_unable(AI_CHECK_RADIO)) - return - - to_chat(src, "Accessing Subspace Transceiver control...") - if (src.aiRadio) - src.aiRadio.interact(src) - -/mob/living/silicon/ai/proc/sensor_mode() - set name = "Set Sensor Augmentation" - set category = "AI Settings" - set desc = "Augment visual feed with internal sensor overlays" - toggle_sensor_mode() - -/mob/living/silicon/ai/proc/toggle_hologram_movement() - set name = "Toggle Hologram Movement" - set category = "AI Settings" - set desc = "Toggles hologram movement based on moving with your virtual eye." - - hologram_follow = !hologram_follow - to_chat(usr, "Your hologram will [hologram_follow ? "follow" : "no longer follow"] you now.") - - -/mob/living/silicon/ai/proc/check_unable(var/flags = 0, var/feedback = 1) - if(stat == DEAD) - if(feedback) - to_chat(src, "You are dead!") - return 1 - - if(aiRestorePowerRoutine) - if(feedback) - to_chat(src, "You lack power!") - return 1 - - if((flags & AI_CHECK_WIRELESS) && src.control_disabled) - if(feedback) - to_chat(src, "Wireless control is disabled!") - return 1 - if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi) - if(feedback) - to_chat(src, "System Error - Transceiver Disabled!") - return 1 - return 0 - -/mob/living/silicon/ai/proc/is_in_chassis() - return istype(loc, /turf) - -/mob/living/silicon/ai/proc/open_nearest_door(mob/living/target) // Rykka ports AI opening doors - if(!istype(target)) - return - - if(target && ai_actual_track(target)) - var/obj/machinery/door/airlock/A = null - - var/dist = -1 - for(var/obj/machinery/door/airlock/D in range(3, target)) - if(!D.density) - continue - - var/curr_dist = get_dist(D, target) - - if(dist < 0) - dist = curr_dist - A = D - else if(dist > curr_dist) - dist = curr_dist - A = D - - if(istype(A)) - switch(alert(src, "Do you want to open \the [A] for [target]?", "Doorknob_v2a.exe", "Yes", "No")) - if("Yes") - A.AIShiftClick() - to_chat(src, "You open \the [A] for [target].") - else - to_chat(src, "You deny the request.") - else - to_chat(src, "Unable to locate an airlock near [target].") - - else - to_chat(src, "Target is not on or near any active cameras on the station.") - -/mob/living/silicon/ai/ex_act(var/severity) - if(severity == 1.0) - qdel(src) - return - ..() - -/mob/living/silicon/ai/updateicon() - if(!selected_sprite) selected_sprite = default_ai_icon - - if(stat == DEAD) - icon_state = selected_sprite.dead_icon - set_light(3, 1, selected_sprite.dead_light) - else if(aiRestorePowerRoutine) - icon_state = selected_sprite.nopower_icon - set_light(1, 1, selected_sprite.nopower_light) - else - icon_state = selected_sprite.alive_icon - set_light(1, 1, selected_sprite.alive_light) - -// Pass lying down or getting up to our pet human, if we're in a rig. -/mob/living/silicon/ai/lay_down() - set name = "Rest" - set category = "IC" - - resting = 0 - var/obj/item/weapon/rig/rig = src.get_rig() - if(rig) - rig.force_rest(src) - -/mob/living/silicon/ai/is_sentient() - // AI cores don't store what brain was used to build them so we're just gonna assume they can think to some degree. - // If that is ever fixed please update this proc. - return TRUE - - -/mob/living/silicon/ai/handle_track(message, verb = "says", mob/speaker = null, speaker_name, hard_to_hear) - if(hard_to_hear) - return - - var/jobname // the mob's "job" - var/mob/living/carbon/human/impersonating //The crew member being impersonated, if any. - var/changed_voice - - if(ishuman(speaker)) - var/mob/living/carbon/human/H = speaker - - if(H.wear_mask && istype(H.wear_mask,/obj/item/clothing/mask/gas/voice)) - changed_voice = 1 - var/list/impersonated = new() - var/mob/living/carbon/human/I = impersonated[speaker_name] - - if(!I) - for(var/mob/living/carbon/human/M in mob_list) - if(M.real_name == speaker_name) - I = M - impersonated[speaker_name] = I - break - - // If I's display name is currently different from the voice name and using an agent ID then don't impersonate - // as this would allow the AI to track I and realize the mismatch. - if(I && !(I.name != speaker_name && I.wear_id && istype(I.wear_id,/obj/item/weapon/card/id/syndicate))) - impersonating = I - jobname = impersonating.get_assignment() - else - jobname = "Unknown" - else - jobname = H.get_assignment() - - else if(iscarbon(speaker)) // Nonhuman carbon mob - jobname = "No id" - else if(isAI(speaker)) - jobname = "AI" - else if(isrobot(speaker)) - jobname = "Cyborg" - else if(istype(speaker, /mob/living/silicon/pai)) - jobname = "Personal AI" - else - jobname = "Unknown" - - var/track = "" - if(changed_voice) // They have a fake name - if(impersonating) // And we found a mob with that name above, track them instead - track = "[speaker_name] ([jobname])" - track += "\[OPEN\]" // Rykka ports AI opening doors - else // We couldn't find a mob with their fake name, don't track at all - track = "[speaker_name] ([jobname])" - else // Not faking their name - if(istype(speaker, /mob/living/bot)) // It's a bot, and no fake name! (That'd be kinda weird.) :p - track = "[speaker_name] ([jobname])" - else // It's not a bot, and no fake name! - track = "[speaker_name] ([jobname])" - track += "\[OPEN\]" // Rykka ports AI opening doors - - return track // Feed variable back to AI - -/mob/living/silicon/ai/proc/relay_speech(mob/living/M, list/message_pieces, verb) - var/message = combine_message(message_pieces, verb, M) - var/name_used = M.GetVoice() - //This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only. - var/rendered = "Relayed Speech: [name_used] [message]" - show_message(rendered, 2) - -/mob/living/silicon/ai/proc/toggle_multicam_verb() - set name = "Toggle Multicam" - set category = "AI Commands" - toggle_multicam() - -/mob/living/silicon/ai/proc/add_multicam_verb() - set name = "Add Multicam Viewport" - set category = "AI Commands" - drop_new_multicam() - -//Special subtype kept around for global announcements -/mob/living/silicon/ai/announcer - is_dummy = 1 - -/mob/living/silicon/ai/announcer/Initialize() - . = ..() - mob_list -= src - living_mob_list -= src - dead_mob_list -= src - ai_list -= src - silicon_mob_list -= src - -/mob/living/silicon/ai/announcer/Life() - return - -#undef AI_CHECK_WIRELESS -#undef AI_CHECK_RADIO +#define AI_CHECK_WIRELESS 1 +#define AI_CHECK_RADIO 2 + +var/list/ai_verbs_default = list( + // /mob/living/silicon/ai/proc/ai_recall_shuttle, + /mob/living/silicon/ai/proc/ai_emergency_message, + /mob/living/silicon/ai/proc/ai_goto_location, + /mob/living/silicon/ai/proc/ai_remove_location, + /mob/living/silicon/ai/proc/ai_hologram_change, + /mob/living/silicon/ai/proc/ai_network_change, + /mob/living/silicon/ai/proc/ai_statuschange, + /mob/living/silicon/ai/proc/ai_store_location, + /mob/living/silicon/ai/proc/control_integrated_radio, + /mob/living/silicon/ai/proc/pick_icon, + /mob/living/silicon/ai/proc/sensor_mode, + /mob/living/silicon/ai/proc/show_laws_verb, + /mob/living/silicon/ai/proc/toggle_acceleration, + /mob/living/silicon/ai/proc/toggle_hologram_movement, + /mob/living/silicon/ai/proc/ai_announcement, + /mob/living/silicon/ai/proc/ai_call_shuttle, + /mob/living/silicon/ai/proc/ai_camera_track, + /mob/living/silicon/ai/proc/ai_camera_list, + /mob/living/silicon/ai/proc/ai_roster, + /mob/living/silicon/ai/proc/ai_checklaws, + /mob/living/silicon/ai/proc/toggle_camera_light, + /mob/living/silicon/ai/proc/take_image, + /mob/living/silicon/ai/proc/view_images, + /mob/living/silicon/ai/proc/toggle_multicam_verb, + /mob/living/silicon/ai/proc/add_multicam_verb +) + +//Not sure why this is necessary... +/proc/AutoUpdateAI(obj/subject) + var/is_in_use = 0 + if (subject!=null) + for(var/A in ai_list) + var/mob/living/silicon/ai/M = A + if ((M.client && M.machine == subject)) + is_in_use = 1 + subject.attack_ai(M) + return is_in_use + + +/mob/living/silicon/ai + name = "AI" + icon = 'icons/mob/AI.dmi'// + icon_state = "ai" + anchored = 1 // -- TLE + density = 1 + status_flags = CANSTUN|CANPARALYSE|CANPUSH + shouldnt_see = list(/mob/observer/eye, /obj/effect/rune) + var/list/network = list(NETWORK_DEFAULT) + var/obj/machinery/camera/camera = null + var/aiRestorePowerRoutine = 0 + var/viewalerts = 0 + var/icon/holo_icon//Default is assigned when AI is created. + var/list/connected_robots = list() + var/obj/item/device/pda/ai/aiPDA = null + var/obj/item/device/communicator/aiCommunicator = null + var/obj/item/device/multitool/aiMulti = null + var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null + 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 = "" + var/control_disabled = 0 + var/datum/announcement/priority/announcement + var/obj/machinery/ai_powersupply/psupply = null // Backwards reference to AI's powersupply object. + var/hologram_follow = 1 //This is used for the AI eye, to determine if a holopad's hologram should follow it or not. + var/is_dummy = 0 //Used to prevent dummy AIs from spawning with communicators. + //NEWMALF VARIABLES + var/malfunctioning = 0 // Master var that determines if AI is malfunctioning. + var/datum/malf_hardware/hardware = null // Installed piece of hardware. + var/datum/malf_research/research = null // Malfunction research datum. + var/obj/machinery/power/apc/hack = null // APC that is currently being hacked. + var/list/hacked_apcs = null // List of all hacked APCs + var/APU_power = 0 // If set to 1 AI runs on APU power + var/hacking = 0 // Set to 1 if AI is hacking APC, cyborg, other AI, or running system override. + var/system_override = 0 // Set to 1 if system override is initiated, 2 if succeeded. + var/hack_can_fail = 1 // If 0, all abilities have zero chance of failing. + var/hack_fails = 0 // This increments with each failed hack, and determines the warning message text. + var/errored = 0 // Set to 1 if runtime error occurs. Only way of this happening i can think of is admin fucking up with varedit. + var/bombing_core = 0 // Set to 1 if core auto-destruct is activated + var/bombing_station = 0 // Set to 1 if station nuke auto-destruct is activated + var/override_CPUStorage = 0 // Bonus/Penalty CPU Storage. For use by admins/testers. + var/override_CPURate = 0 // Bonus/Penalty CPU generation rate. For use by admins/testers. + + var/datum/ai_icon/selected_sprite // The selected icon set + var/custom_sprite = 0 // Whether the selected icon is custom + var/carded + + // Multicam Vars + var/multicam_allowed = TRUE + var/multicam_on = FALSE + var/obj/screen/movable/pic_in_pic/ai/master_multicam + var/list/multicam_screens = list() + var/list/all_eyes = list() + var/max_multicams = 6 + + can_be_antagged = TRUE + +/mob/living/silicon/ai/proc/add_ai_verbs() + src.verbs |= ai_verbs_default + src.verbs |= silicon_subsystems + +/mob/living/silicon/ai/proc/remove_ai_verbs() + src.verbs -= ai_verbs_default + src.verbs -= silicon_subsystems + +/mob/living/silicon/ai/New(loc, var/datum/ai_laws/L, var/obj/item/device/mmi/B, var/safety = 0) + announcement = new() + announcement.title = "A.I. Announcement" + announcement.announcement_type = "A.I. Announcement" + announcement.newscast = 1 + + var/list/possibleNames = ai_names + + var/pickedName = null + while(!pickedName) + pickedName = pick(ai_names) + for (var/mob/living/silicon/ai/A in mob_list) + if (A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop + possibleNames -= pickedName + pickedName = null + + if(!is_dummy) + aiPDA = new/obj/item/device/pda/ai(src) + SetName(pickedName) + anchored = 1 + canmove = 0 + density = 1 + loc = loc + + if(!is_dummy) + aiCommunicator = new /obj/item/device/communicator/integrated(src) + + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) + + proc_holder_list = new() + + if(L) + if (istype(L, /datum/ai_laws)) + laws = L + else + laws = new using_map.default_law_type + + aiMulti = new(src) + aiRadio = new(src) + common_radio = aiRadio + aiRadio.myAi = src + additional_law_channels["Binary"] = "#b" + additional_law_channels["Holopad"] = ":h" + + aiCamera = new/obj/item/device/camera/siliconcam/ai_camera(src) + + if (istype(loc, /turf)) + add_ai_verbs(src) + + //Languages + add_language("Robot Talk", 1) + add_language(LANGUAGE_GALCOM, 1) + add_language(LANGUAGE_SOL_COMMON, 1) + add_language(LANGUAGE_UNATHI, 1) + add_language(LANGUAGE_SIIK, 1) + add_language(LANGUAGE_AKHANI, 1) + add_language(LANGUAGE_SKRELLIAN, 1) + add_language(LANGUAGE_SKRELLIANFAR, 0) + add_language(LANGUAGE_TRADEBAND, 1) + add_language(LANGUAGE_GUTTER, 1) + add_language(LANGUAGE_EAL, 1) + add_language(LANGUAGE_SCHECHI, 1) + add_language(LANGUAGE_SIGN, 1) + add_language(LANGUAGE_ROOTLOCAL, 1) + add_language(LANGUAGE_TERMINUS, 1) + add_language(LANGUAGE_ZADDAT, 1) + + if(!safety)//Only used by AIize() to successfully spawn an AI. + if (!B)//If there is no player/brain inside. + empty_playable_ai_cores += new/obj/structure/AIcore/deactivated(loc)//New empty terminal. + qdel(src)//Delete AI. + return + else + if (B.brainmob.mind) + B.brainmob.mind.transfer_to(src) + + on_mob_init() + + spawn(5) + new /obj/machinery/ai_powersupply(src) + + ai_list += src + ..() + return + +/mob/living/silicon/ai/proc/on_mob_init() + to_chat(src, "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).") + to_chat(src, "To look at other parts of the station, click on yourself to get a camera menu.") + to_chat(src, "While observing through a camera, you can use most (networked) devices which you can see, such as computers, APCs, intercoms, doors, etc.") + to_chat(src, "To use something, simply click on it.") + to_chat(src, "Use say #b to speak to your cyborgs through binary. Use say :h to speak from an active holopad.") + to_chat(src, "For department channels, use the following say commands:") + + var/radio_text = "" + for(var/i = 1 to common_radio.channels.len) + var/channel = common_radio.channels[i] + var/key = get_radio_key_from_channel(channel) + radio_text += "[key] - [channel]" + if(i != common_radio.channels.len) + radio_text += ", " + + to_chat(src,radio_text) + + if (malf && !(mind in malf.current_antagonists)) + show_laws() + to_chat(src, "These laws may be changed by other players, or by you being the traitor.") + + job = "AI" + setup_icon() + +/mob/living/silicon/ai/Destroy() + ai_list -= src + + QDEL_NULL(announcement) + QDEL_NULL(eyeobj) + QDEL_NULL(psupply) + QDEL_NULL(aiPDA) + QDEL_NULL(aiCommunicator) + QDEL_NULL(aiMulti) + QDEL_NULL(aiRadio) + QDEL_NULL(aiCamera) + hack = null + + return ..() + +/mob/living/silicon/ai/Stat() + ..() + if(statpanel("Status")) + if(!stat) // Make sure we're not unconscious/dead. + stat(null, text("System integrity: [(health+100)/2]%")) + stat(null, text("Connected synthetics: [connected_robots.len]")) + for(var/mob/living/silicon/robot/R in connected_robots) + var/robot_status = "Nominal" + if(R.shell) + robot_status = "AI SHELL" + else if(R.stat || !R.client) + robot_status = "OFFLINE" + else if(!R.cell || R.cell.charge <= 0) + robot_status = "DEPOWERED" + //Name, Health, Battery, Module, Area, and Status! Everything an AI wants to know about its borgies! + stat(null, text("[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \ + Module: [R.modtype] | Loc: [get_area_name(R, TRUE)] | Status: [robot_status]")) + stat(null, text("AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]")) //Count of total AI shells + else + stat(null, text("Systems nonfunctional")) + + +/mob/living/silicon/ai/proc/setup_icon() + var/file = file2text("config/custom_sprites.txt") + var/lines = splittext(file, "\n") + + for(var/line in lines) + // split & clean up + var/list/Entry = splittext(line, ":") + for(var/i = 1 to Entry.len) + Entry[i] = trim(Entry[i]) + + if(Entry.len < 2) + continue; + + if(Entry[1] == src.ckey && Entry[2] == src.real_name) + icon = CUSTOM_ITEM_SYNTH + custom_sprite = 1 + selected_sprite = new/datum/ai_icon("Custom", "[src.ckey]-ai", "4", "[ckey]-ai-crash", "#FFFFFF", "#FFFFFF", "#FFFFFF") + else + selected_sprite = default_ai_icon + updateicon() + +/mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view()) + set popup_menu = 0 + set src = usr.contents + return 0 + +/mob/living/silicon/ai/SetName(pickedName as text) + ..() + announcement.announcer = pickedName + if(eyeobj) + eyeobj.name = "[pickedName] (AI Eye)" + + // Set ai pda name + if(aiPDA) + aiPDA.ownjob = "AI" + aiPDA.owner = pickedName + aiPDA.name = pickedName + " (" + aiPDA.ownjob + ")" + + if(aiCommunicator) + aiCommunicator.register_device(src.name) + +/* + The AI Power supply is a dummy object used for powering the AI since only machinery should be using power. + The alternative was to rewrite a bunch of AI code instead here we are. +*/ +/obj/machinery/ai_powersupply + name="Power Supply" + 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 = USE_POWER_ACTIVE + power_channel = EQUIP + var/mob/living/silicon/ai/powered_ai = null + invisibility = 100 + +/obj/machinery/ai_powersupply/New(var/mob/living/silicon/ai/ai=null) + powered_ai = ai + powered_ai.psupply = src + if(istype(powered_ai,/mob/living/silicon/ai/announcer)) //Don't try to get a loc for a nullspace announcer mob, just put it into it + forceMove(powered_ai) + else + forceMove(powered_ai.loc) + + ..() + use_power(1) // Just incase we need to wake up the power system. + +/obj/machinery/ai_powersupply/Destroy() + . = ..() + powered_ai = null + +/obj/machinery/ai_powersupply/process() + if(!powered_ai || powered_ai.stat == DEAD) + qdel(src) + return + if(powered_ai.psupply != src) // For some reason, the AI has different powersupply object. Delete this one, it's no longer needed. + qdel(src) + return + if(powered_ai.APU_power) + update_use_power(USE_POWER_OFF) + return + if(!powered_ai.anchored) + loc = powered_ai.loc + update_use_power(USE_POWER_OFF) + use_power(50000) // Less optimalised but only called if AI is unwrenched. This prevents usage of wrenching as method to keep AI operational without power. Intellicard is for that. + if(powered_ai.anchored) + update_use_power(USE_POWER_ACTIVE) + +/mob/living/silicon/ai/proc/pick_icon() + set category = "AI Settings" + set name = "Set AI Core Display" + if(stat || aiRestorePowerRoutine) + return + + if (!custom_sprite) + var/new_sprite = input("Select an icon!", "AI", selected_sprite) as null|anything in ai_icons + if(new_sprite) selected_sprite = new_sprite + updateicon() + +// this verb lets the ai see the stations manifest +/mob/living/silicon/ai/proc/ai_roster() + set category = "AI Commands" + set name = "Show Crew Manifest" + show_station_manifest() + +/mob/living/silicon/ai/var/message_cooldown = 0 +/mob/living/silicon/ai/proc/ai_announcement() + set category = "AI Commands" + set name = "Make Station Announcement" + if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) + return + + if(message_cooldown) + to_chat(src, "Please allow one minute to pass between announcements.") + return + var/input = input(usr, "Please write a message to announce to the station crew.", "A.I. Announcement") + if(!input) + return + + if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) + return + + announcement.Announce(input) + message_cooldown = 1 + spawn(600)//One minute cooldown + message_cooldown = 0 + +/mob/living/silicon/ai/proc/ai_call_shuttle() + set category = "AI Commands" + set name = "Call Emergency Shuttle" + if(check_unable(AI_CHECK_WIRELESS)) + return + + var/confirm = alert("Are you sure you want to call the shuttle?", "Confirm Shuttle Call", "Yes", "No") + + if(check_unable(AI_CHECK_WIRELESS)) + return + + if(confirm == "Yes") + call_shuttle_proc(src) + + // hack to display shuttle timer + if(emergency_shuttle.online()) + post_status(src, "shuttle", user = src) + +/mob/living/silicon/ai/proc/ai_recall_shuttle() + set category = "AI Commands" + set name = "Recall Emergency Shuttle" + + if(check_unable(AI_CHECK_WIRELESS)) + return + + var/confirm = alert("Are you sure you want to recall the shuttle?", "Confirm Shuttle Recall", "Yes", "No") + if(check_unable(AI_CHECK_WIRELESS)) + return + + if(confirm == "Yes") + cancel_call_proc(src) + +/mob/living/silicon/ai/var/emergency_message_cooldown = 0 + +/mob/living/silicon/ai/proc/ai_emergency_message() + set category = "AI Commands" + set name = "Send Emergency Message" + + if(check_unable(AI_CHECK_WIRELESS)) + return + if(emergency_message_cooldown) + to_chat(usr, "Arrays recycling. Please stand by.") + return + var/input = sanitize(input(usr, "Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) + if(!input) + return + CentCom_announce(input, usr) + to_chat(usr, "Message transmitted.") + log_game("[key_name(usr)] has made an IA [using_map.boss_short] announcement: [input]") + emergency_message_cooldown = 1 + spawn(300) + emergency_message_cooldown = 0 +/mob/living/silicon/ai/check_eye(var/mob/user as mob) + if (!camera) + return -1 + return 0 + +/mob/living/silicon/ai/restrained() + return 0 + +/mob/living/silicon/ai/emp_act(severity) + disconnect_shell("Disconnected from remote shell due to ionic interfe%*@$^___") + if (prob(30)) + view_core() + ..() + +/mob/living/silicon/ai/Topic(href, href_list) + if(usr != src) + return + if(..()) + return + if (href_list["mach_close"]) + if (href_list["mach_close"] == "aialerts") + viewalerts = 0 + var/t1 = text("window=[]", href_list["mach_close"]) + unset_machine() + src << browse(null, t1) + if (href_list["switchcamera"]) + switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras + if (href_list["showalerts"]) + subsystem_alarm_monitor() + //Carn: holopad requests + if (href_list["jumptoholopad"]) + var/obj/machinery/hologram/holopad/H = locate(href_list["jumptoholopad"]) + if(stat == CONSCIOUS) + if(H) + H.attack_ai(src) //may as well recycle + else + to_chat(src, "Unable to locate the holopad.") + + if (href_list["track"]) + var/mob/target = locate(href_list["track"]) in mob_list + + if(target && (!istype(target, /mob/living/carbon/human) || html_decode(href_list["trackname"]) == target:get_face_name())) + ai_actual_track(target) + else + to_chat(src, "System error. Cannot locate [html_decode(href_list["trackname"])].") + return + + if(href_list["trackbot"]) + var/mob/living/bot/target = locate(href_list["trackbot"]) in mob_list + if(target) + ai_actual_track(target) + else + to_chat(src, "Target is not on or near any active cameras on the station.") + return + + if(href_list["open"]) + var/mob/target = locate(href_list["open"]) in mob_list + if(target) + open_nearest_door(target) + + return + +/mob/living/silicon/ai/proc/camera_visibility(mob/observer/eye/aiEye/moved_eye) + cameranet.visibility(moved_eye, client, all_eyes) + +/mob/living/silicon/ai/forceMove(atom/destination) + . = ..() + if(.) + end_multicam() + +/mob/living/silicon/ai/reset_view(atom/A) + if(camera) + camera.set_light(0) + if(istype(A,/obj/machinery/camera)) + camera = A + if(A != GLOB.ai_camera_room_landmark) + end_multicam() + . = ..() + if(.) + if(!A && isturf(loc) && eyeobj) + end_multicam() + client.eye = eyeobj + client.perspective = MOB_PERSPECTIVE + if(istype(A,/obj/machinery/camera)) + if(camera_light_on) A.set_light(AI_CAMERA_LUMINOSITY) + else A.set_light(0) + + +/mob/living/silicon/ai/proc/switchCamera(var/obj/machinery/camera/C) + if (!C || stat == DEAD) //C.can_use()) + return 0 + + if(!src.eyeobj) + view_core() + return + // ok, we're alive, camera is good and in our network... + eyeobj.setLoc(get_turf(C)) + //machine = src + + return 1 + +/mob/living/silicon/ai/cancel_camera() + set category = "AI Commands" + set name = "Cancel Camera View" + view_core() + +//Replaces /mob/living/silicon/ai/verb/change_network() in ai.dm & camera.dm +//Adds in /mob/living/silicon/ai/proc/ai_network_change() instead +//Addition by Mord_Sith to define AI's network change ability +/mob/living/silicon/ai/proc/get_camera_network_list() + if(check_unable()) + return + + var/list/cameralist = new() + for (var/obj/machinery/camera/C in cameranet.cameras) + if(!C.can_use()) + continue + var/list/tempnetwork = difflist(C.network,restricted_camera_networks,1) + for(var/i in tempnetwork) + cameralist[i] = i + + cameralist = sortAssoc(cameralist) + return cameralist + +/mob/living/silicon/ai/proc/ai_network_change(var/network in get_camera_network_list()) + set category = "AI Commands" + set name = "Jump To Network" + unset_machine() + + if(!network) + return + + if(!eyeobj) + view_core() + return + + src.network = network + + for(var/obj/machinery/camera/C in cameranet.cameras) + if(!C.can_use()) + continue + if(network in C.network) + eyeobj.setLoc(get_turf(C)) + break + to_chat(src, "Switched to [network] camera network.") +//End of code by Mord_Sith + +/mob/living/silicon/ai/proc/ai_statuschange() + set category = "AI Settings" + set name = "AI Status" + + if(check_unable(AI_CHECK_WIRELESS)) + return + + set_ai_status_displays(src) + return + +//I am the icon meister. Bow fefore me. //>fefore +/mob/living/silicon/ai/proc/ai_hologram_change() + set name = "Change Hologram" + set desc = "Change the default hologram available to AI to something else." + set category = "AI Settings" + + if(check_unable()) + return + + var/input + var/choice = alert("Would you like to select a hologram based on a (visible) crew member, switch to unique avatar, or load your character from your character slot?",,"Crew Member","Unique","My Character") + + switch(choice) + if("Crew Member") //A seeable crew member (or a dog) + var/list/targets = trackable_mobs() + if(targets.len) + input = input("Select a crew member:") as null|anything in targets //The definition of "crew member" is a little loose... + //This is torture, I know. If someone knows a better way... + if(!input) return + var/new_holo = getHologramIcon(getCompoundIcon(targets[input])) + qdel(holo_icon) + holo_icon = new_holo + + else + alert("No suitable records found. Aborting.") + + if("My Character") //Loaded character slot + if(!client || !client.prefs) return + var/mob/living/carbon/human/dummy/dummy = new () + //This doesn't include custom_items because that's ... hard. + client.prefs.dress_preview_mob(dummy) + sleep(1 SECOND) //Strange bug in preview code? Without this, certain things won't show up. Yay race conditions? + dummy.regenerate_icons() + + var/new_holo = getHologramIcon(getCompoundIcon(dummy)) + qdel(holo_icon) + qdel(dummy) + holo_icon = new_holo + + else //A premade from the dmi + var/icon_list[] = list( + "default", + "floating face", + "singularity", + "drone", + "carp", + "spider", + "bear", + "slime", + "ian", + "runtime", + "poly", + "pun pun", + "male human", + "female human", + "male unathi", + "female unathi", + "male tajaran", + "female tajaran", + "male tesharii", + "female tesharii", + "male skrell", + "female skrell" + ) + input = input("Please select a hologram:") as null|anything in icon_list + if(input) + qdel(holo_icon) + switch(input) + if("default") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) + if("floating face") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo2")) + if("singularity") + holo_icon = getHologramIcon(icon('icons/obj/singularity.dmi',"singularity_s1")) + if("drone") + holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"drone0")) + if("carp") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo4")) + if("spider") + holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"nurse")) + if("bear") + holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"brownbear")) + if("slime") + holo_icon = getHologramIcon(icon('icons/mob/slimes.dmi',"cerulean adult slime")) + if("ian") + holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"corgi")) + if("runtime") + holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"cat")) + if("poly") + holo_icon = getHologramIcon(icon('icons/mob/animal.dmi',"parrot_fly")) + if("pun pun") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"punpun")) + if("male human") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holohumm")) + if("female human") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holohumf")) + if("male unathi") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holounam")) + if("female unathi") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holounaf")) + if("male tajaran") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotajm")) + if("female tajaran") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotajf")) + if("male tesharii") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotesm")) + if("female tesharii") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holotesf")) + if("male skrell") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holoskrm")) + if("female skrell") + holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holoskrf")) + +//Toggles the luminosity and applies it by re-entereing the camera. +/mob/living/silicon/ai/proc/toggle_camera_light() + set name = "Toggle Camera Light" + set desc = "Toggles the light on the camera the AI is looking through." + set category = "AI Commands" + if(check_unable()) + return + + camera_light_on = !camera_light_on + to_chat(src, "Camera lights [camera_light_on ? "activated" : "deactivated"].") + if(!camera_light_on) + if(camera) + camera.set_light(0) + camera = null + else + lightNearbyCamera() + + + +// Handled camera lighting, when toggled. +// It will get the nearest camera from the eyeobj, lighting it. + +/mob/living/silicon/ai/proc/lightNearbyCamera() + if(camera_light_on && camera_light_on < world.timeofday) + if(src.camera) + var/obj/machinery/camera/camera = near_range_camera(src.eyeobj) + if(camera && src.camera != camera) + src.camera.set_light(0) + if(!camera.light_disabled) + src.camera = camera + src.camera.set_light(AI_CAMERA_LUMINOSITY) + else + src.camera = null + else if(isnull(camera)) + src.camera.set_light(0) + src.camera = null + else + var/obj/machinery/camera/camera = near_range_camera(src.eyeobj) + if(camera && !camera.light_disabled) + src.camera = camera + src.camera.set_light(AI_CAMERA_LUMINOSITY) + camera_light_on = world.timeofday + 1 * 20 // Update the light every 2 seconds. + + +/mob/living/silicon/ai/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/device/aicard)) + + var/obj/item/device/aicard/card = W + card.grab_ai(src, user) + + else if(W.is_wrench()) + if(user == deployed_shell) + to_chat(user, "The shell's subsystems resist your efforts to tamper with your bolts.") + return + if(anchored) + playsound(src, W.usesound, 50, 1) + user.visible_message("\The [user] starts to unbolt \the [src] from the plating...") + if(!do_after(user,40 * W.toolspeed)) + user.visible_message("\The [user] decides not to unbolt \the [src].") + return + user.visible_message("\The [user] finishes unfastening \the [src]!") + anchored = 0 + return + else + playsound(src, W.usesound, 50, 1) + user.visible_message("\The [user] starts to bolt \the [src] to the plating...") + if(!do_after(user,40 * W.toolspeed)) + user.visible_message("\The [user] decides not to bolt \the [src].") + return + user.visible_message("\The [user] finishes fastening down \the [src]!") + anchored = 1 + return + else + return ..() + +/mob/living/silicon/ai/proc/control_integrated_radio() + set name = "Radio Settings" + set desc = "Allows you to change settings of your radio." + set category = "AI Settings" + + if(check_unable(AI_CHECK_RADIO)) + return + + to_chat(src, "Accessing Subspace Transceiver control...") + if (src.aiRadio) + src.aiRadio.interact(src) + +/mob/living/silicon/ai/proc/sensor_mode() + set name = "Set Sensor Augmentation" + set category = "AI Settings" + set desc = "Augment visual feed with internal sensor overlays" + toggle_sensor_mode() + +/mob/living/silicon/ai/proc/toggle_hologram_movement() + set name = "Toggle Hologram Movement" + set category = "AI Settings" + set desc = "Toggles hologram movement based on moving with your virtual eye." + + hologram_follow = !hologram_follow + to_chat(usr, "Your hologram will [hologram_follow ? "follow" : "no longer follow"] you now.") + + +/mob/living/silicon/ai/proc/check_unable(var/flags = 0, var/feedback = 1) + if(stat == DEAD) + if(feedback) + to_chat(src, "You are dead!") + return 1 + + if(aiRestorePowerRoutine) + if(feedback) + to_chat(src, "You lack power!") + return 1 + + if((flags & AI_CHECK_WIRELESS) && src.control_disabled) + if(feedback) + to_chat(src, "Wireless control is disabled!") + return 1 + if((flags & AI_CHECK_RADIO) && src.aiRadio.disabledAi) + if(feedback) + to_chat(src, "System Error - Transceiver Disabled!") + return 1 + return 0 + +/mob/living/silicon/ai/proc/is_in_chassis() + return istype(loc, /turf) + +/mob/living/silicon/ai/proc/open_nearest_door(mob/living/target) // Rykka ports AI opening doors + if(!istype(target)) + return + + if(target && ai_actual_track(target)) + var/obj/machinery/door/airlock/A = null + + var/dist = -1 + for(var/obj/machinery/door/airlock/D in range(3, target)) + if(!D.density) + continue + + var/curr_dist = get_dist(D, target) + + if(dist < 0) + dist = curr_dist + A = D + else if(dist > curr_dist) + dist = curr_dist + A = D + + if(istype(A)) + switch(alert(src, "Do you want to open \the [A] for [target]?", "Doorknob_v2a.exe", "Yes", "No")) + if("Yes") + A.AIShiftClick() + to_chat(src, "You open \the [A] for [target].") + else + to_chat(src, "You deny the request.") + else + to_chat(src, "Unable to locate an airlock near [target].") + + else + to_chat(src, "Target is not on or near any active cameras on the station.") + +/mob/living/silicon/ai/ex_act(var/severity) + if(severity == 1.0) + qdel(src) + return + ..() + +/mob/living/silicon/ai/updateicon() + if(!selected_sprite) selected_sprite = default_ai_icon + + if(stat == DEAD) + icon_state = selected_sprite.dead_icon + set_light(3, 1, selected_sprite.dead_light) + else if(aiRestorePowerRoutine) + icon_state = selected_sprite.nopower_icon + set_light(1, 1, selected_sprite.nopower_light) + else + icon_state = selected_sprite.alive_icon + set_light(1, 1, selected_sprite.alive_light) + +// Pass lying down or getting up to our pet human, if we're in a rig. +/mob/living/silicon/ai/lay_down() + set name = "Rest" + set category = "IC" + + resting = 0 + var/obj/item/weapon/rig/rig = src.get_rig() + if(rig) + rig.force_rest(src) + +/mob/living/silicon/ai/is_sentient() + // AI cores don't store what brain was used to build them so we're just gonna assume they can think to some degree. + // If that is ever fixed please update this proc. + return TRUE + + +/mob/living/silicon/ai/handle_track(message, verb = "says", mob/speaker = null, speaker_name, hard_to_hear) + if(hard_to_hear) + return + + var/jobname // the mob's "job" + var/mob/living/carbon/human/impersonating //The crew member being impersonated, if any. + var/changed_voice + + if(ishuman(speaker)) + var/mob/living/carbon/human/H = speaker + + if(H.wear_mask && istype(H.wear_mask,/obj/item/clothing/mask/gas/voice)) + changed_voice = 1 + var/list/impersonated = new() + var/mob/living/carbon/human/I = impersonated[speaker_name] + + if(!I) + for(var/mob/living/carbon/human/M in mob_list) + if(M.real_name == speaker_name) + I = M + impersonated[speaker_name] = I + break + + // If I's display name is currently different from the voice name and using an agent ID then don't impersonate + // as this would allow the AI to track I and realize the mismatch. + if(I && !(I.name != speaker_name && I.wear_id && istype(I.wear_id,/obj/item/weapon/card/id/syndicate))) + impersonating = I + jobname = impersonating.get_assignment() + else + jobname = "Unknown" + else + jobname = H.get_assignment() + + else if(iscarbon(speaker)) // Nonhuman carbon mob + jobname = "No id" + else if(isAI(speaker)) + jobname = "AI" + else if(isrobot(speaker)) + jobname = "Cyborg" + else if(istype(speaker, /mob/living/silicon/pai)) + jobname = "Personal AI" + else + jobname = "Unknown" + + var/track = "" + if(changed_voice) // They have a fake name + if(impersonating) // And we found a mob with that name above, track them instead + track = "[speaker_name] ([jobname])" + track += "\[OPEN\]" // Rykka ports AI opening doors + else // We couldn't find a mob with their fake name, don't track at all + track = "[speaker_name] ([jobname])" + else // Not faking their name + if(istype(speaker, /mob/living/bot)) // It's a bot, and no fake name! (That'd be kinda weird.) :p + track = "[speaker_name] ([jobname])" + else // It's not a bot, and no fake name! + track = "[speaker_name] ([jobname])" + track += "\[OPEN\]" // Rykka ports AI opening doors + + return track // Feed variable back to AI + +/mob/living/silicon/ai/proc/relay_speech(mob/living/M, list/message_pieces, verb) + var/list/combined = combine_message(message_pieces, verb, M) + var/message = combined["formatted"] + var/name_used = M.GetVoice() + //This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only. + var/rendered = "Relayed Speech: [name_used] [message]" + show_message(rendered, 2) + +/mob/living/silicon/ai/proc/toggle_multicam_verb() + set name = "Toggle Multicam" + set category = "AI Commands" + toggle_multicam() + +/mob/living/silicon/ai/proc/add_multicam_verb() + set name = "Add Multicam Viewport" + set category = "AI Commands" + drop_new_multicam() + +//Special subtype kept around for global announcements +/mob/living/silicon/ai/announcer + is_dummy = 1 + +/mob/living/silicon/ai/announcer/Initialize() + . = ..() + mob_list -= src + living_mob_list -= src + dead_mob_list -= src + ai_list -= src + silicon_mob_list -= src + +/mob/living/silicon/ai/announcer/Life() + return + +#undef AI_CHECK_WIRELESS +#undef AI_CHECK_RADIO 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 80e10fd196..bbb8093331 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -264,7 +264,7 @@ drop_item() -obj/item/weapon/gripper/proc/drop_item() +/obj/item/weapon/gripper/proc/drop_item() if(!wrapped) //There's some weirdness with items being lost inside the arm. Trying to fix all cases. ~Z for(var/obj/item/thing in src.contents) diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index f4bebe8f89..01989fb4da 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -1,125 +1,125 @@ -/mob/living/silicon/robot/handle_message_mode(message_mode, message, verb, speaking, used_radios) - ..() - if(message_mode) - if(!is_component_functioning("radio")) - to_chat(src, "Your radio isn't functional at this time.") - return 0 - if(message_mode == "general") - message_mode = null - return radio.talk_into(src,message,message_mode,verb,speaking) - -/mob/living/silicon/speech_bubble_appearance() - return "synthetic" - -/mob/living/silicon/ai/handle_message_mode(message_mode, message, verb, speaking, used_radios) - ..() - if(message_mode == "department") - return holopad_talk(message, verb, speaking) - else if(message_mode) - if (aiRadio.disabledAi || aiRestorePowerRoutine || stat) - to_chat(src, "System Error - Transceiver Disabled.") - return 0 - if(message_mode == "general") - message_mode = null - return aiRadio.talk_into(src,message,message_mode,verb,speaking) - -/mob/living/silicon/pai/handle_message_mode(message_mode, message, verb, speaking, used_radios) - ..() - if(message_mode) - if(message_mode == "general") - message_mode = null - return radio.talk_into(src,message,message_mode,verb,speaking) - -/mob/living/silicon/say_quote(var/text) - var/ending = copytext(text, length(text)) - - if (ending == "?") - return speak_query - else if (ending == "!") - return speak_exclamation - - return speak_statement - -#define IS_AI 1 -#define IS_ROBOT 2 -#define IS_PAI 3 - -/mob/living/silicon/say_understands(var/other, var/datum/language/speaking = null) - //These only pertain to common. Languages are handled by mob/say_understands() - if(!speaking) - if(iscarbon(other)) - return TRUE - if(issilicon(other)) - return TRUE - if(isbrain(other)) - return TRUE - return ..() - -//For holopads only. Usable by AI. -/mob/living/silicon/ai/proc/holopad_talk(list/message_pieces, verb) - log_say("(HPAD) [multilingual_to_message(message_pieces)]",src) - - var/obj/machinery/hologram/holopad/T = src.holo - if(T && T.masters[src])//If there is a hologram and its master is the user. - var/list/listeners = get_mobs_and_objs_in_view_fast(get_turf(T), world.view) - var/list/listening = listeners["mobs"] - var/list/listening_obj = listeners["objs"] - for(var/mob/M in listening) - M.hear_holopad_talk(message_pieces, verb, src) - for(var/obj/O in listening_obj) - if(O == T) //Don't recieve your own speech - continue - O.hear_talk(src, message_pieces, verb) - /*Radios "filter out" this conversation channel so we don't need to account for them. - This is another way of saying that we won't bother dealing with them.*/ - to_chat(src, "Holopad transmitted, [real_name] [combine_message(message_pieces, verb, src)]") - else - to_chat(src, "No holopad connected.") - return 0 - return 1 - -/mob/living/silicon/ai/proc/holopad_emote(var/message) //This is called when the AI uses the 'me' verb while using a holopad. - message = trim(message) - - if(!message) - return - - var/obj/machinery/hologram/holopad/T = src.holo - if(T && T.masters[src]) - var/rendered = "[name] [message]" - to_chat(src, "Holopad action relayed, [real_name] [message]") - - var/obj/effect/overlay/hologram = T.masters[src] - var/list/in_range = get_mobs_and_objs_in_view_fast(get_turf(hologram), world.view, 2) //Emotes are displayed from the hologram, not the pad - var/list/m_viewers = in_range["mobs"] - var/list/o_viewers = in_range["objs"] - - for(var/mob/M in m_viewers) - spawn(0) - if(M) - M.show_message(rendered, 2) - - for(var/obj/O in o_viewers) - if(O == T) - continue - spawn(0) - if(O) - O.see_emote(src, message) - - log_emote("(HPAD) [message]", src) - - else //This shouldn't occur, but better safe then sorry. - to_chat(src, "No holopad connected.") - return 0 - return 1 - -/mob/living/silicon/ai/emote(var/act, var/m_type, var/message) - var/obj/machinery/hologram/holopad/T = holo - if(T && T.masters[src]) //Is the AI using a holopad? - . = holopad_emote(message) - else //Emote normally, then. - . = ..() - -#undef IS_AI -#undef IS_ROBOT -#undef IS_PAI +/mob/living/silicon/robot/handle_message_mode(message_mode, message, verb, speaking, used_radios) + ..() + if(message_mode) + if(!is_component_functioning("radio")) + to_chat(src, "Your radio isn't functional at this time.") + return 0 + if(message_mode == "general") + message_mode = null + return radio.talk_into(src,message,message_mode,verb,speaking) + +/mob/living/silicon/speech_bubble_appearance() + return "synthetic" + +/mob/living/silicon/ai/handle_message_mode(message_mode, message, verb, speaking, used_radios) + ..() + if(message_mode == "department") + return holopad_talk(message, verb, speaking) + else if(message_mode) + if (aiRadio.disabledAi || aiRestorePowerRoutine || stat) + to_chat(src, "System Error - Transceiver Disabled.") + return 0 + if(message_mode == "general") + message_mode = null + return aiRadio.talk_into(src,message,message_mode,verb,speaking) + +/mob/living/silicon/pai/handle_message_mode(message_mode, message, verb, speaking, used_radios) + ..() + if(message_mode) + if(message_mode == "general") + message_mode = null + return radio.talk_into(src,message,message_mode,verb,speaking) + +/mob/living/silicon/say_quote(var/text) + var/ending = copytext(text, length(text)) + + if (ending == "?") + return speak_query + else if (ending == "!") + return speak_exclamation + + return speak_statement + +#define IS_AI 1 +#define IS_ROBOT 2 +#define IS_PAI 3 + +/mob/living/silicon/say_understands(var/other, var/datum/language/speaking = null) + //These only pertain to common. Languages are handled by mob/say_understands() + if(!speaking) + if(iscarbon(other)) + return TRUE + if(issilicon(other)) + return TRUE + if(isbrain(other)) + return TRUE + return ..() + +//For holopads only. Usable by AI. +/mob/living/silicon/ai/proc/holopad_talk(list/message_pieces, verb) + log_say("(HPAD) [multilingual_to_message(message_pieces)]",src) + + var/obj/machinery/hologram/holopad/T = src.holo + if(T && T.masters[src])//If there is a hologram and its master is the user. + var/list/listeners = get_mobs_and_objs_in_view_fast(get_turf(T), world.view) + var/list/listening = listeners["mobs"] + var/list/listening_obj = listeners["objs"] + for(var/mob/M in listening) + M.hear_holopad_talk(message_pieces, verb, src) + for(var/obj/O in listening_obj) + if(O == T) //Don't recieve your own speech + continue + O.hear_talk(src, message_pieces, verb) + /*Radios "filter out" this conversation channel so we don't need to account for them. + This is another way of saying that we won't bother dealing with them.*/ + var/list/combined = combine_message(message_pieces, verb, src) + to_chat(src, "Holopad transmitted, [real_name] [combined["formatted"]]") + else + to_chat(src, "No holopad connected.") + return 0 + return 1 + +/mob/living/silicon/ai/proc/holopad_emote(var/message) //This is called when the AI uses the 'me' verb while using a holopad. + message = trim(message) + + if(!message) + return + + var/obj/machinery/hologram/holopad/T = src.holo + if(T && T.masters[src]) + var/rendered = "[name] [message]" + to_chat(src, "Holopad action relayed, [real_name] [message]") + var/obj/effect/overlay/hologram = T.masters[src] + var/list/in_range = get_mobs_and_objs_in_view_fast(get_turf(hologram), world.view, 2) //Emotes are displayed from the hologram, not the pad + var/list/m_viewers = in_range["mobs"] + var/list/o_viewers = in_range["objs"] + + for(var/mob/M in m_viewers) + spawn(0) + if(M) + M.show_message(rendered, 2) + + for(var/obj/O in o_viewers) + if(O == T) + continue + spawn(0) + if(O) + O.see_emote(src, message) + + log_emote("(HPAD) [message]", src) + + else //This shouldn't occur, but better safe then sorry. + to_chat(src, "No holopad connected.") + return 0 + return 1 + +/mob/living/silicon/ai/emote(var/act, var/m_type, var/message) + var/obj/machinery/hologram/holopad/T = holo + if(T && T.masters[src]) //Is the AI using a holopad? + . = holopad_emote(message) + else //Emote normally, then. + . = ..() + +#undef IS_AI +#undef IS_ROBOT +#undef IS_PAI diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index fe6d09df70..7ab2333838 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -76,7 +76,7 @@ // message is the message output to anyone who can see e.g. "[src] does something!" // self_message (optional) is what the src mob sees e.g. "You do something!" // blind_message (optional) is what blind people will hear e.g. "You hear something!" -/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null, var/range = world.view) +/mob/visible_message(var/message, var/self_message, var/blind_message, var/list/exclude_mobs = null, var/range = world.view, var/runemessage) if(self_message) if(LAZYLEN(exclude_mobs)) exclude_mobs |= src @@ -86,7 +86,9 @@ // Transfer messages about what we are doing to upstairs if(shadow) shadow.visible_message(message, self_message, blind_message, exclude_mobs, range) - . = ..(message, blind_message, exclude_mobs, range) // Really not ideal that atom/visible_message has different arg numbering :( + if(isnull(runemessage)) + runemessage = -1 + . = ..(message, blind_message, exclude_mobs, range, runemessage) // Really not ideal that atom/visible_message has different arg numbering :( // Returns an amount of power drawn from the object (-1 if it's not viable). // If drain_check is set it will not actually drain power, just return a value. @@ -101,7 +103,7 @@ // self_message (optional) is what the src mob hears. // deaf_message (optional) is what deaf people will see. // hearing_distance (optional) is the range, how many tiles away the message can be heard. -/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/radio_message) +/mob/audible_message(var/message, var/deaf_message, var/hearing_distance, var/self_message, var/radio_message, var/runemessage) var/range = hearing_distance || world.view var/list/hear = get_mobs_and_objs_in_view_fast(get_turf(src),range,remote_ghosts = FALSE) @@ -109,6 +111,9 @@ var/list/hearing_mobs = hear["mobs"] var/list/hearing_objs = hear["objs"] + if(isnull(runemessage)) + runemessage = -1 // Symmetry with mob/audible_message, despite the fact this one doesn't call parent. Maybe it should! + if(radio_message) for(var/obj in hearing_objs) var/obj/O = obj @@ -124,6 +129,8 @@ if(self_message && M==src) msg = self_message M.show_message(msg, AUDIBLE_MESSAGE, deaf_message, VISIBLE_MESSAGE) + if(runemessage != -1) + M.create_chat_message(src, "[runemessage || message]", FALSE, list("emote"), audible = FALSE) /mob/proc/findname(msg) for(var/mob/M in mob_list) @@ -842,7 +849,7 @@ /mob/proc/embedded_needs_process() return (embedded.len > 0) -mob/proc/yank_out_object() +/mob/proc/yank_out_object() set category = "Object" set name = "Yank out object" set desc = "Remove an embedded item at the cost of bleeding and pain." diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 7c1034a77d..7e255be821 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -42,7 +42,7 @@ /mob/living/carbon/human/isMonkey() return istype(species, /datum/species/monkey) -proc/isdeaf(A) +/proc/isdeaf(A) if(istype(A, /mob)) var/mob/M = A return (M.sdisabilities & DEAF) || M.ear_deaf @@ -57,24 +57,24 @@ proc/isdeaf(A) /mob/proc/is_cloaked() return FALSE -proc/hasorgans(A) // Fucking really?? +/proc/hasorgans(A) // Fucking really?? return ishuman(A) -proc/iscuffed(A) +/proc/iscuffed(A) if(istype(A, /mob/living/carbon)) var/mob/living/carbon/C = A if(C.handcuffed) return 1 return 0 -proc/hassensorlevel(A, var/level) +/proc/hassensorlevel(A, var/level) var/mob/living/carbon/human/H = A if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = H.w_uniform return U.sensor_mode >= level return 0 -proc/getsensorlevel(A) +/proc/getsensorlevel(A) var/mob/living/carbon/human/H = A if(istype(H) && istype(H.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = H.w_uniform @@ -190,7 +190,7 @@ proc/getsensorlevel(A) for(var/datum/multilingual_say_piece/S in message_pieces) . += new /datum/multilingual_say_piece(S.speaking, stars(S.message)) -proc/slur(phrase) +/proc/slur(phrase) phrase = html_decode(phrase) var/leng=length(phrase) var/counter=length(phrase) @@ -237,7 +237,7 @@ proc/slur(phrase) return sanitize(t) -proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added +/proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added /* Turn text into complete gibberish! */ var/returntext = "" for(var/i = 1, i <= length(t), i++) @@ -364,7 +364,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT) else hud_used.action_intent.icon_state = I_HELP -proc/is_blind(A) +/proc/is_blind(A) if(istype(A, /mob/living/carbon)) var/mob/living/carbon/C = A if(C.sdisabilities & BLIND || C.blinded) diff --git a/code/modules/mob/new_player/sprite_accessories_taur.dm b/code/modules/mob/new_player/sprite_accessories_taur.dm index dad54ed188..3bc5225bb5 100644 --- a/code/modules/mob/new_player/sprite_accessories_taur.dm +++ b/code/modules/mob/new_player/sprite_accessories_taur.dm @@ -47,7 +47,7 @@ /mob/living/carbon/human/buckle_mob(mob/living/M, forced = FALSE, check_loc = TRUE) if(forced) return ..() // Skip our checks - if(!isTaurTail(tail_style)) + if(!istaurtail(tail_style)) return FALSE else var/datum/sprite_accessory/tail/taur/taurtype = tail_style @@ -68,7 +68,7 @@ var/mob/living/carbon/human/H = M - if(isTaurTail(H.tail_style)) + if(istaurtail(H.tail_style)) to_chat(src,"Too many legs. TOO MANY LEGS!!") return FALSE diff --git a/code/modules/modular_computers/file_system/programs/command/comm.dm b/code/modules/modular_computers/file_system/programs/command/comm.dm index a2079ad494..01db6036e9 100644 --- a/code/modules/modular_computers/file_system/programs/command/comm.dm +++ b/code/modules/modular_computers/file_system/programs/command/comm.dm @@ -31,11 +31,11 @@ var/list/comm_message_listeners = list() //We first have to initialize list then var/datum/comm_message_listener/global_message_listener = new //May be used by admins var/last_message_id = 0 -proc/get_comm_message_id() +/proc/get_comm_message_id() last_message_id = last_message_id + 1 return last_message_id -proc/post_comm_message(var/message_title, var/message_text) +/proc/post_comm_message(var/message_title, var/message_text) var/list/message = list() message["id"] = get_comm_message_id() message["title"] = message_title diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index 0f67e3b604..4aaa658468 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -246,7 +246,7 @@ return data -obj/machinery/lapvend/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/machinery/lapvend/attackby(obj/item/weapon/W as obj, mob/user as mob) var/obj/item/weapon/card/id/I = W.GetID() // Awaiting payment state if(state == 2) diff --git a/code/modules/multiz/_stubs.dm b/code/modules/multiz/_stubs.dm index 4c6e63cb7e..a9d1d456b1 100644 --- a/code/modules/multiz/_stubs.dm +++ b/code/modules/multiz/_stubs.dm @@ -9,8 +9,8 @@ // FOR THE LOVE OF GOD USE THESE. DO NOT FUCKING SPAGHETTIFY THIS. // Use the Has*() functions if you ONLY need to check. // If you need to do something, use Get*(). -HasAbove(var/z) -HasBelow(var/z) +/HasAbove(var/z) +/HasBelow(var/z) // These give either the turf or null. -GetAbove(var/atom/atom) -GetBelow(var/atom/atom) \ No newline at end of file +/GetAbove(var/atom/atom) +/GetBelow(var/atom/atom) \ No newline at end of file diff --git a/code/modules/multiz/basic.dm b/code/modules/multiz/basic.dm index 92bfe2a480..36464b421e 100644 --- a/code/modules/multiz/basic.dm +++ b/code/modules/multiz/basic.dm @@ -45,7 +45,7 @@ var/list/z_levels = list()// Each bit re... haha just kidding this is a list of for(var/level = z, HasAbove(level), level++) . |= level+1 -proc/AreConnectedZLevels(var/zA, var/zB) +/proc/AreConnectedZLevels(var/zA, var/zB) return zA == zB || (zB in GetConnectedZlevels(zA)) /proc/get_zstep(ref, dir) diff --git a/code/modules/multiz/disabled.dm b/code/modules/multiz/disabled.dm index b91fb78931..b5b41bd138 100644 --- a/code/modules/multiz/disabled.dm +++ b/code/modules/multiz/disabled.dm @@ -1,10 +1,10 @@ -proc/HasAbove(var/z) +/proc/HasAbove(var/z) return 0 -proc/HasBelow(var/z) +/proc/HasBelow(var/z) return 0 // These give either the turf or null. -proc/GetAbove(var/turf/turf) +/proc/GetAbove(var/turf/turf) return null -proc/GetBelow(var/turf/turf) +/proc/GetBelow(var/turf/turf) return null \ No newline at end of file diff --git a/code/modules/multiz/ladders.dm b/code/modules/multiz/ladders.dm index ca9c0546d5..d016477f8c 100644 --- a/code/modules/multiz/ladders.dm +++ b/code/modules/multiz/ladders.dm @@ -98,7 +98,7 @@ "You begin climbing [direction] \the [src]!", "You hear the grunting and clanging of a metal ladder being used.") - target_ladder.audible_message("You hear something coming [direction] \the [src]") + target_ladder.audible_message("You hear something coming [direction] \the [src]", runemessage = "clank clank") if(do_after(M, climb_time, src)) var/turf/T = get_turf(target_ladder) diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index ab0be6db78..2c03515434 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -59,7 +59,7 @@ if(lattice) var/pull_up_time = max(5 SECONDS + (src.movement_delay() * 10), 1) to_chat(src, "You grab \the [lattice] and start pulling yourself upward...") - destination.audible_message("You hear something climbing up \the [lattice].") + destination.audible_message("You hear something climbing up \the [lattice].", runemessage = "clank clang") if(do_after(src, pull_up_time)) to_chat(src, "You pull yourself up.") else @@ -74,7 +74,7 @@ if(!destination?.Enter(src, old_dest)) to_chat(src, "There's something in the way up above in that direction, try another.") return 0 - destination.audible_message("You hear something climbing up \the [catwalk].") + destination.audible_message("You hear something climbing up \the [catwalk].", runemessage = "clank clang") if(do_after(src, pull_up_time)) to_chat(src, "You pull yourself up.") else diff --git a/code/modules/multiz/pipes.dm b/code/modules/multiz/pipes.dm index 0bc21f07eb..83b7bd8125 100644 --- a/code/modules/multiz/pipes.dm +++ b/code/modules/multiz/pipes.dm @@ -1,7 +1,7 @@ //////////////////////////// // parent class for pipes // //////////////////////////// -obj/machinery/atmospherics/pipe/zpipe +/obj/machinery/atmospherics/pipe/zpipe icon = 'icons/obj/structures.dmi' icon_state = "up" @@ -56,13 +56,13 @@ obj/machinery/atmospherics/pipe/zpipe invisibility = i ? 101 : 0 update_icon() -obj/machinery/atmospherics/pipe/zpipe/process() +/obj/machinery/atmospherics/pipe/zpipe/process() if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle ..() else . = PROCESS_KILL -obj/machinery/atmospherics/pipe/zpipe/check_pressure(pressure) +/obj/machinery/atmospherics/pipe/zpipe/check_pressure(pressure) var/datum/gas_mixture/environment = loc.return_air() var/pressure_difference = pressure - environment.return_pressure() @@ -77,7 +77,7 @@ obj/machinery/atmospherics/pipe/zpipe/check_pressure(pressure) else return 1 -obj/machinery/atmospherics/pipe/zpipe/proc/burst() +/obj/machinery/atmospherics/pipe/zpipe/proc/burst() src.visible_message("\The [src] bursts!"); playsound(src, 'sound/effects/bang.ogg', 25, 1) var/datum/effect/effect/system/smoke_spread/smoke = new @@ -85,27 +85,27 @@ obj/machinery/atmospherics/pipe/zpipe/proc/burst() smoke.start() qdel(src) // NOT qdel. -obj/machinery/atmospherics/pipe/zpipe/proc/normalize_dir() +/obj/machinery/atmospherics/pipe/zpipe/proc/normalize_dir() if(dir == (NORTH|SOUTH)) set_dir(NORTH) else if(dir == (EAST|WEST)) set_dir(EAST) -obj/machinery/atmospherics/pipe/zpipe/Destroy() +/obj/machinery/atmospherics/pipe/zpipe/Destroy() if(node1) node1.disconnect(src) if(node2) node2.disconnect(src) . = ..() -obj/machinery/atmospherics/pipe/zpipe/pipeline_expansion() +/obj/machinery/atmospherics/pipe/zpipe/pipeline_expansion() return list(node1, node2) -obj/machinery/atmospherics/pipe/zpipe/update_icon() +/obj/machinery/atmospherics/pipe/zpipe/update_icon() color = pipe_color return -obj/machinery/atmospherics/pipe/zpipe/disconnect(obj/machinery/atmospherics/reference) +/obj/machinery/atmospherics/pipe/zpipe/disconnect(obj/machinery/atmospherics/reference) if(reference == node1) if(istype(node1, /obj/machinery/atmospherics/pipe)) qdel(parent) @@ -120,14 +120,14 @@ obj/machinery/atmospherics/pipe/zpipe/disconnect(obj/machinery/atmospherics/refe ///////////////////////// // the elusive up pipe // ///////////////////////// -obj/machinery/atmospherics/pipe/zpipe/up +/obj/machinery/atmospherics/pipe/zpipe/up icon = 'icons/obj/structures.dmi' icon_state = "up" name = "upwards pipe" desc = "A pipe segment to connect upwards." -obj/machinery/atmospherics/pipe/zpipe/up/atmos_init() +/obj/machinery/atmospherics/pipe/zpipe/up/atmos_init() normalize_dir() var/node1_dir @@ -157,14 +157,14 @@ obj/machinery/atmospherics/pipe/zpipe/up/atmos_init() // and the down pipe // /////////////////////// -obj/machinery/atmospherics/pipe/zpipe/down +/obj/machinery/atmospherics/pipe/zpipe/down icon = 'icons/obj/structures.dmi' icon_state = "down" name = "downwards pipe" desc = "A pipe segment to connect downwards." -obj/machinery/atmospherics/pipe/zpipe/down/atmos_init() +/obj/machinery/atmospherics/pipe/zpipe/down/atmos_init() normalize_dir() var/node1_dir @@ -194,7 +194,7 @@ obj/machinery/atmospherics/pipe/zpipe/down/atmos_init() // supply/scrubbers // /////////////////////// -obj/machinery/atmospherics/pipe/zpipe/up/scrubbers +/obj/machinery/atmospherics/pipe/zpipe/up/scrubbers icon_state = "up-scrubbers" name = "upwards scrubbers pipe" desc = "A scrubbers pipe segment to connect upwards." @@ -204,7 +204,7 @@ obj/machinery/atmospherics/pipe/zpipe/up/scrubbers icon_connect_type = "-scrubbers" color = PIPE_COLOR_RED -obj/machinery/atmospherics/pipe/zpipe/up/supply +/obj/machinery/atmospherics/pipe/zpipe/up/supply icon_state = "up-supply" name = "upwards supply pipe" desc = "A supply pipe segment to connect upwards." @@ -214,7 +214,7 @@ obj/machinery/atmospherics/pipe/zpipe/up/supply icon_connect_type = "-supply" color = PIPE_COLOR_BLUE -obj/machinery/atmospherics/pipe/zpipe/up/fuel +/obj/machinery/atmospherics/pipe/zpipe/up/fuel icon_state = "up-fuel" name = "upwards fuel pipe" desc = "A fuel pipe segment to connect upwards." @@ -224,7 +224,7 @@ obj/machinery/atmospherics/pipe/zpipe/up/fuel icon_connect_type = "-fuel" color = PIPE_COLOR_YELLOW -obj/machinery/atmospherics/pipe/zpipe/up/aux +/obj/machinery/atmospherics/pipe/zpipe/up/aux icon_state = "up-aux" name = "upwards aux pipe" desc = "A aux pipe segment to connect upwards." @@ -234,7 +234,7 @@ obj/machinery/atmospherics/pipe/zpipe/up/aux icon_connect_type = "-aux" color = PIPE_COLOR_CYAN -obj/machinery/atmospherics/pipe/zpipe/down/scrubbers +/obj/machinery/atmospherics/pipe/zpipe/down/scrubbers icon_state = "down-scrubbers" name = "downwards scrubbers pipe" desc = "A scrubbers pipe segment to connect downwards." @@ -244,7 +244,7 @@ obj/machinery/atmospherics/pipe/zpipe/down/scrubbers icon_connect_type = "-scrubbers" color = PIPE_COLOR_RED -obj/machinery/atmospherics/pipe/zpipe/down/supply +/obj/machinery/atmospherics/pipe/zpipe/down/supply icon_state = "down-supply" name = "downwards supply pipe" desc = "A supply pipe segment to connect downwards." @@ -254,7 +254,7 @@ obj/machinery/atmospherics/pipe/zpipe/down/supply icon_connect_type = "-supply" color = PIPE_COLOR_BLUE -obj/machinery/atmospherics/pipe/zpipe/down/fuel +/obj/machinery/atmospherics/pipe/zpipe/down/fuel icon_state = "down-fuel" name = "downwards fuel pipe" desc = "A fuel pipe segment to connect downwards." @@ -264,7 +264,7 @@ obj/machinery/atmospherics/pipe/zpipe/down/fuel icon_connect_type = "-fuel" color = PIPE_COLOR_YELLOW -obj/machinery/atmospherics/pipe/zpipe/down/aux +/obj/machinery/atmospherics/pipe/zpipe/down/aux icon_state = "down-aux" name = "upwards aux pipe" desc = "A aux pipe segment to connect upwards." diff --git a/code/modules/news/newspaper.dm b/code/modules/news/newspaper.dm index 330e505d51..86a1149169 100644 --- a/code/modules/news/newspaper.dm +++ b/code/modules/news/newspaper.dm @@ -19,7 +19,7 @@ drop_sound = 'sound/items/drop/wrapper.ogg' pickup_sound = 'sound/items/pickup/wrapper.ogg' -obj/item/weapon/newspaper/attack_self(mob/user as mob) +/obj/item/weapon/newspaper/attack_self(mob/user as mob) if(ishuman(user)) var/mob/living/carbon/human/human_user = user var/dat @@ -27,7 +27,7 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) switch(screen) if(0) //Cover dat+="
    The Griffon
    " - dat+="
    [using_map.company_name]-standard newspaper, for use on [using_map.company_name] Space Facilities

    " + dat+="
    [using_map.company_name]-standard newspaper, for use on [using_map.company_name]� Space Facilities

    " if(isemptylist(news_content)) if(important_message) dat+="Contents:
      **Important Security Announcement** \[page [pages+2]\]
    " @@ -99,7 +99,7 @@ obj/item/weapon/newspaper/attack_self(mob/user as mob) else to_chat(user, "The paper is full of intelligible symbols!") -obj/item/weapon/newspaper/Topic(href, href_list) +/obj/item/weapon/newspaper/Topic(href, href_list) var/mob/living/U = usr ..() if((src in U.contents) || (istype(loc, /turf) && in_range(src, U))) @@ -130,7 +130,7 @@ obj/item/weapon/newspaper/Topic(href, href_list) if(istype(src.loc, /mob)) attack_self(src.loc) -obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) +/obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/pen)) if(scribble_page == curr_page) to_chat(user, "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?") diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 76a4194b54..87739a3e4e 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -304,7 +304,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5 return D return res -proc/blood_incompatible(donor,receiver,donor_species,receiver_species) +/proc/blood_incompatible(donor,receiver,donor_species,receiver_species) if(!donor || !receiver) return 0 if(donor_species && receiver_species) @@ -327,7 +327,7 @@ proc/blood_incompatible(donor,receiver,donor_species,receiver_species) //AB is a universal receiver. return 0 -proc/blood_splatter(var/target,var/datum/reagent/blood/source,var/large) +/proc/blood_splatter(var/target,var/datum/reagent/blood/source,var/large) var/obj/effect/decal/cleanable/blood/B var/decal_type = /obj/effect/decal/cleanable/blood/splatter diff --git a/code/modules/organs/internal/organ_internal.dm b/code/modules/organs/internal/_organ_internal.dm similarity index 100% rename from code/modules/organs/internal/organ_internal.dm rename to code/modules/organs/internal/_organ_internal.dm diff --git a/code/modules/organs/internal/appendix.dm b/code/modules/organs/internal/appendix.dm index 047602ec4b..1166e3d689 100644 --- a/code/modules/organs/internal/appendix.dm +++ b/code/modules/organs/internal/appendix.dm @@ -1,5 +1,3 @@ -#define PROCESS_ACCURACY 10 - /obj/item/organ/internal/appendix name = "appendix" icon_state = "appendix" diff --git a/code/modules/organs/internal/eyes.dm b/code/modules/organs/internal/eyes.dm index 69e6e21872..6045037bff 100644 --- a/code/modules/organs/internal/eyes.dm +++ b/code/modules/organs/internal/eyes.dm @@ -1,5 +1,3 @@ -#define PROCESS_ACCURACY 10 - /obj/item/organ/internal/eyes name = "eyeballs" icon_state = "eyes" diff --git a/code/modules/organs/internal/heart.dm b/code/modules/organs/internal/heart.dm index 9f015bcdc9..02ff5f21d2 100644 --- a/code/modules/organs/internal/heart.dm +++ b/code/modules/organs/internal/heart.dm @@ -1,5 +1,3 @@ -#define PROCESS_ACCURACY 10 - /obj/item/organ/internal/heart name = "heart" icon_state = "heart-on" diff --git a/code/modules/organs/internal/kidneys.dm b/code/modules/organs/internal/kidneys.dm index 2378c0fe99..daf9954b03 100644 --- a/code/modules/organs/internal/kidneys.dm +++ b/code/modules/organs/internal/kidneys.dm @@ -1,5 +1,3 @@ -#define PROCESS_ACCURACY 10 - /obj/item/organ/internal/kidneys name = "kidneys" icon_state = "kidneys" diff --git a/code/modules/organs/internal/liver.dm b/code/modules/organs/internal/liver.dm index c23467466a..b26c864609 100644 --- a/code/modules/organs/internal/liver.dm +++ b/code/modules/organs/internal/liver.dm @@ -1,5 +1,3 @@ -#define PROCESS_ACCURACY 10 - /obj/item/organ/internal/liver name = "liver" icon_state = "liver" diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index 34d2c258b6..8ec76a36d0 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -1,5 +1,3 @@ -#define PROCESS_ACCURACY 10 - /obj/item/organ/internal/lungs name = "lungs" icon_state = "lungs" diff --git a/code/modules/organs/pain.dm b/code/modules/organs/pain.dm index ffc9a6149b..1d374ab7f0 100644 --- a/code/modules/organs/pain.dm +++ b/code/modules/organs/pain.dm @@ -1,14 +1,14 @@ -mob/proc/flash_pain() +/mob/proc/flash_pain() flick("pain",pain) -mob/var/list/pain_stored = list() -mob/var/last_pain_message = "" -mob/var/next_pain_time = 0 +/mob/var/list/pain_stored = list() +/mob/var/last_pain_message = "" +/mob/var/next_pain_time = 0 // message is the custom message to be displayed // power decides how much painkillers will stop the message // force means it ignores anti-spam timer -mob/living/carbon/proc/custom_pain(message, power, force) +/mob/living/carbon/proc/custom_pain(message, power, force) if(!message || stat || !can_feel_pain() || chem_effects[CE_PAINKILLER] > power) return 0 message = "[message]" @@ -21,7 +21,7 @@ mob/living/carbon/proc/custom_pain(message, power, force) to_chat(src,message) next_pain_time = world.time + (100-power) -mob/living/carbon/human/proc/handle_pain() +/mob/living/carbon/human/proc/handle_pain() if(stat) return diff --git a/code/modules/organs/wound.dm b/code/modules/organs/wound.dm index dd7f5dcf89..164307ba68 100644 --- a/code/modules/organs/wound.dm +++ b/code/modules/organs/wound.dm @@ -53,169 +53,169 @@ var/tmp/list/desc_list = list() var/tmp/list/damage_list = list() - New(var/damage) +/datum/wound/New(var/damage) - created = world.time + created = world.time - // reading from a list("stage" = damage) is pretty difficult, so build two separate - // lists from them instead - for(var/V in stages) - desc_list += V - damage_list += stages[V] + // reading from a list("stage" = damage) is pretty difficult, so build two separate + // lists from them instead + for(var/V in stages) + desc_list += V + damage_list += stages[V] - src.damage = damage + src.damage = damage - // initialize with the appropriate stage - src.init_stage(damage) + // initialize with the appropriate stage + src.init_stage(damage) - bleed_timer += damage + bleed_timer += damage // returns 1 if there's a next stage, 0 otherwise - proc/init_stage(var/initial_damage) - current_stage = stages.len +/datum/wound/proc/init_stage(var/initial_damage) + current_stage = stages.len - while(src.current_stage > 1 && src.damage_list[current_stage-1] <= initial_damage / src.amount) - src.current_stage-- + while(src.current_stage > 1 && src.damage_list[current_stage-1] <= initial_damage / src.amount) + src.current_stage-- - src.min_damage = damage_list[current_stage] - src.desc = desc_list[current_stage] + src.min_damage = damage_list[current_stage] + src.desc = desc_list[current_stage] - // the amount of damage per wound - proc/wound_damage() - return src.damage / src.amount +// the amount of damage per wound +/datum/wound/proc/wound_damage() + return src.damage / src.amount - proc/can_autoheal() - if(is_treated()) - return TRUE - if(src.wound_damage() <= autoheal_cutoff) - if(created + 10 MINUTES > world.time) // Wounds don't autoheal for ten minutes if not bandaged. - return FALSE - return TRUE +/datum/wound/proc/can_autoheal() + if(is_treated()) + return TRUE + if(src.wound_damage() <= autoheal_cutoff) + if(created + 10 MINUTES > world.time) // Wounds don't autoheal for ten minutes if not bandaged. + return FALSE + return TRUE - // checks whether the wound has been appropriately treated - proc/is_treated() - if(damage_type == BRUISE || damage_type == CUT || damage_type == PIERCE) - return bandaged - else if(damage_type == BURN) - return salved +// checks whether the wound has been appropriately treated +/datum/wound/proc/is_treated() + if(damage_type == BRUISE || damage_type == CUT || damage_type == PIERCE) + return bandaged + else if(damage_type == BURN) + return salved - // Checks whether other other can be merged into src. - proc/can_merge(var/datum/wound/other) - if (other.type != src.type) return 0 - if (other.current_stage != src.current_stage) return 0 - if (other.damage_type != src.damage_type) return 0 - if (!(other.can_autoheal()) != !(src.can_autoheal())) return 0 - if (!(other.bandaged) != !(src.bandaged)) return 0 - if (!(other.clamped) != !(src.clamped)) return 0 - if (!(other.salved) != !(src.salved)) return 0 - if (!(other.disinfected) != !(src.disinfected)) return 0 - //if (other.germ_level != src.germ_level) return 0 - return 1 +// Checks whether other other can be merged into src. +/datum/wound/proc/can_merge(var/datum/wound/other) + if (other.type != src.type) return 0 + if (other.current_stage != src.current_stage) return 0 + if (other.damage_type != src.damage_type) return 0 + if (!(other.can_autoheal()) != !(src.can_autoheal())) return 0 + if (!(other.bandaged) != !(src.bandaged)) return 0 + if (!(other.clamped) != !(src.clamped)) return 0 + if (!(other.salved) != !(src.salved)) return 0 + if (!(other.disinfected) != !(src.disinfected)) return 0 + //if (other.germ_level != src.germ_level) return 0 + return 1 - proc/merge_wound(var/datum/wound/other) - src.damage += other.damage - src.amount += other.amount - src.bleed_timer += other.bleed_timer - src.germ_level = max(src.germ_level, other.germ_level) - src.created = max(src.created, other.created) //take the newer created time - - // checks if wound is considered open for external infections - // untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger - proc/infection_check() - if (damage < 10) //small cuts, tiny bruises, and moderate burns shouldn't be infectable. - return 0 - if (is_treated() && damage < 25) //anything less than a flesh wound (or equivalent) isn't infectable if treated properly - return 0 - if (disinfected) - germ_level = 0 //reset this, just in case - return 0 - - if (damage_type == BRUISE && !bleeding()) //bruises only infectable if bleeding - return 0 - - var/dam_coef = round(damage/10) - switch (damage_type) - if (BRUISE) - return prob(dam_coef*5) - if (BURN) - return prob(dam_coef*10) - if (CUT) - return prob(dam_coef*20) +/datum/wound/proc/merge_wound(var/datum/wound/other) + src.damage += other.damage + src.amount += other.amount + src.bleed_timer += other.bleed_timer + src.germ_level = max(src.germ_level, other.germ_level) + src.created = max(src.created, other.created) //take the newer created time +// checks if wound is considered open for external infections +// untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger +/datum/wound/proc/infection_check() + if (damage < 10) //small cuts, tiny bruises, and moderate burns shouldn't be infectable. + return 0 + if (is_treated() && damage < 25) //anything less than a flesh wound (or equivalent) isn't infectable if treated properly + return 0 + if (disinfected) + germ_level = 0 //reset this, just in case return 0 - proc/bandage() - bandaged = 1 + if (damage_type == BRUISE && !bleeding()) //bruises only infectable if bleeding + return 0 - proc/salve() - salved = 1 + var/dam_coef = round(damage/10) + switch (damage_type) + if (BRUISE) + return prob(dam_coef*5) + if (BURN) + return prob(dam_coef*10) + if (CUT) + return prob(dam_coef*20) - proc/disinfect() - disinfected = 1 + return 0 - // heal the given amount of damage, and if the given amount of damage was more - // than what needed to be healed, return how much heal was left - // set @heals_internal to also heal internal organ damage - proc/heal_damage(amount, heals_internal = 0) - if(src.internal && !heals_internal) - // heal nothing - return amount +/datum/wound/proc/bandage() + bandaged = 1 - var/healed_damage = min(src.damage, amount) - amount -= healed_damage - src.damage -= healed_damage +/datum/wound/proc/salve() + salved = 1 - while(src.wound_damage() < damage_list[current_stage] && current_stage < src.desc_list.len) - current_stage++ - desc = desc_list[current_stage] - src.min_damage = damage_list[current_stage] +/datum/wound/proc/disinfect() + disinfected = 1 - // return amount of healing still leftover, can be used for other wounds +// heal the given amount of damage, and if the given amount of damage was more +// than what needed to be healed, return how much heal was left +// set @heals_internal to also heal internal organ damage +/datum/wound/proc/heal_damage(amount, heals_internal = 0) + if(src.internal && !heals_internal) + // heal nothing return amount - // opens the wound again - proc/open_wound(damage) - src.damage += damage - bleed_timer += damage + var/healed_damage = min(src.damage, amount) + amount -= healed_damage + src.damage -= healed_damage - while(src.current_stage > 1 && src.damage_list[current_stage-1] <= src.damage / src.amount) - src.current_stage-- + while(src.wound_damage() < damage_list[current_stage] && current_stage < src.desc_list.len) + current_stage++ + desc = desc_list[current_stage] + src.min_damage = damage_list[current_stage] - src.desc = desc_list[current_stage] - src.min_damage = damage_list[current_stage] + // return amount of healing still leftover, can be used for other wounds + return amount - // returns whether this wound can absorb the given amount of damage. - // this will prevent large amounts of damage being trapped in less severe wound types - proc/can_worsen(damage_type, damage) - if (src.damage_type != damage_type) - return 0 //incompatible damage types +// opens the wound again +/datum/wound/proc/open_wound(damage) + src.damage += damage + bleed_timer += damage - if (src.amount > 1) - return 0//merged wounds cannot be worsened. + while(src.current_stage > 1 && src.damage_list[current_stage-1] <= src.damage / src.amount) + src.current_stage-- - //with 1.5*, a shallow cut will be able to carry at most 30 damage, - //37.5 for a deep cut - //52.5 for a flesh wound, etc. - var/max_wound_damage = 1.5*src.damage_list[1] - if (src.damage + damage > max_wound_damage) - return 0 + src.desc = desc_list[current_stage] + src.min_damage = damage_list[current_stage] - return 1 +// returns whether this wound can absorb the given amount of damage. +// this will prevent large amounts of damage being trapped in less severe wound types +/datum/wound/proc/can_worsen(damage_type, damage) + if (src.damage_type != damage_type) + return 0 //incompatible damage types - proc/bleeding() - if (src.internal) - return 0 // internal wounds don't bleed in the sense of this function + if (src.amount > 1) + return 0//merged wounds cannot be worsened. - if (current_stage > max_bleeding_stage) - return 0 + //with 1.5*, a shallow cut will be able to carry at most 30 damage, + //37.5 for a deep cut + //52.5 for a flesh wound, etc. + var/max_wound_damage = 1.5*src.damage_list[1] + if (src.damage + damage > max_wound_damage) + return 0 - if (bandaged||clamped) - return 0 + return 1 - if (bleed_timer <= 0 && wound_damage() <= bleed_threshold) - return 0 //Bleed timer has run out. Once a wound is big enough though, you'll need a bandage to stop it +/datum/wound/proc/bleeding() + if (src.internal) + return 0 // internal wounds don't bleed in the sense of this function - return 1 + if (current_stage > max_bleeding_stage) + return 0 + + if (bandaged||clamped) + return 0 + + if (bleed_timer <= 0 && wound_damage() <= bleed_threshold) + return 0 //Bleed timer has run out. Once a wound is big enough though, you'll need a bandage to stop it + + return 1 /** WOUND DEFINITIONS **/ @@ -295,7 +295,7 @@ max_bleeding_stage = 3 stages = list("big gaping wound" = 60, "healing gaping wound" = 40, "large blood soaked clot" = 25, "large angry scar" = 10, "large straight scar" = 0) -datum/wound/cut/massive +/datum/wound/cut/massive max_bleeding_stage = 3 stages = list("massive wound" = 70, "massive healing wound" = 50, "massive blood soaked clot" = 25, "massive angry scar" = 10, "massive jagged scar" = 0) @@ -327,7 +327,7 @@ datum/wound/cut/massive stages = list("big gaping hole" = 50, "healing gaping hole" = 20, "large blood soaked clot" = 15, "large angry scar" = 10, "large round scar" = 0) damage_type = PIERCE -datum/wound/puncture/massive +/datum/wound/puncture/massive max_bleeding_stage = 3 stages = list("massive wound" = 60, "massive healing wound" = 30, "massive blood soaked clot" = 25, "massive angry scar" = 10, "massive jagged scar" = 0) damage_type = PIERCE diff --git a/code/modules/overmap/ships/engines/gas_thruster.dm b/code/modules/overmap/ships/engines/gas_thruster.dm index fd689fb990..111b3ef0a2 100644 --- a/code/modules/overmap/ships/engines/gas_thruster.dm +++ b/code/modules/overmap/ships/engines/gas_thruster.dm @@ -151,7 +151,7 @@ if(!is_on()) return 0 if(!check_fuel() || (use_power_oneoff(charge_per_burn) < charge_per_burn) || check_blockage()) - audible_message(src,"[src] coughs once and goes silent!") + audible_message(src,"[src] coughs once and goes silent!", runemessage = "sputtercough") update_use_power(USE_POWER_OFF) return 0 diff --git a/code/modules/overmap/spacetravel.dm b/code/modules/overmap/spacetravel.dm index cc793d214b..0c0d4fd01f 100644 --- a/code/modules/overmap/spacetravel.dm +++ b/code/modules/overmap/spacetravel.dm @@ -32,7 +32,7 @@ if(can_die()) qdel(src) -proc/get_deepspace(x,y) +/proc/get_deepspace(x,y) var/turf/unsimulated/map/overmap_turf = locate(x,y,global.using_map.overmap_z) if(!istype(overmap_turf)) CRASH("Attempt to get deepspace at ([x],[y]) which is not on overmap: [overmap_turf]") @@ -75,7 +75,7 @@ proc/get_deepspace(x,y) return FALSE // return isnull(client) && !key && stat == DEAD // Allows bodies that players have ghosted from to be deleted - Ater -proc/overmap_spacetravel(var/turf/space/T, var/atom/movable/A) +/proc/overmap_spacetravel(var/turf/space/T, var/atom/movable/A) if (!T || !A) return diff --git a/code/modules/overmap/turfs.dm b/code/modules/overmap/turfs.dm index 916a8f4159..6647d16a4d 100644 --- a/code/modules/overmap/turfs.dm +++ b/code/modules/overmap/turfs.dm @@ -91,7 +91,7 @@ var/list/moving_levels = list() //Proc to 'move' stars in spess //yes it looks ugly, but it should only fire when state actually change. //null direction stops movement -proc/toggle_move_stars(zlevel, direction) +/proc/toggle_move_stars(zlevel, direction) if(!zlevel) return diff --git a/code/modules/paperwork/adminpaper.dm b/code/modules/paperwork/adminpaper.dm index 04b47377dd..7b89c8dda2 100644 --- a/code/modules/paperwork/adminpaper.dm +++ b/code/modules/paperwork/adminpaper.dm @@ -71,7 +71,7 @@ generateFooter() updateDisplay() -obj/item/weapon/paper/admin/proc/updateDisplay() +/obj/item/weapon/paper/admin/proc/updateDisplay() usr << browse("[name][headerOn ? header : ""][info_links][stamps][footerOn ? footer : ""][interactions]", "window=[name];can_close=0") diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 39f91401d0..5d554b05d3 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -71,21 +71,21 @@ playsound(loc, "sound/machines/copier.ogg", 100, 1) sleep(11) copy(copyitem) - audible_message("You can hear [src] whirring as it finishes printing.") - playsound(loc, "sound/machines/buzzbeep.ogg", 30) + audible_message("You can hear [src] whirring as it finishes printing.", runemessage = "whirr") + playsound(src, "sound/machines/buzzbeep.ogg", 30) else if (istype(copyitem, /obj/item/weapon/photo)) playsound(loc, "sound/machines/copier.ogg", 100, 1) sleep(11) photocopy(copyitem) - audible_message("You can hear [src] whirring as it finishes printing.") - playsound(loc, "sound/machines/buzzbeep.ogg", 30) + audible_message("You can hear [src] whirring as it finishes printing.", runemessage = "whirr") + playsound(src, "sound/machines/buzzbeep.ogg", 30) else if (istype(copyitem, /obj/item/weapon/paper_bundle)) sleep(11) playsound(loc, "sound/machines/copier.ogg", 100, 1) var/obj/item/weapon/paper_bundle/B = bundlecopy(copyitem) sleep(11*B.pages.len) - audible_message("You can hear [src] whirring as it finishes printing.") - playsound(loc, "sound/machines/buzzbeep.ogg", 30) + audible_message("You can hear [src] whirring as it finishes printing.", runemessage = "whirr") + playsound(src, "sound/machines/buzzbeep.ogg", 30) else to_chat(user, "\The [copyitem] can't be copied by [src].") playsound(loc, "sound/machines/buzz-two.ogg", 100) diff --git a/code/modules/paperwork/silicon_photography.dm b/code/modules/paperwork/silicon_photography.dm index b33b325648..dd00694df7 100644 --- a/code/modules/paperwork/silicon_photography.dm +++ b/code/modules/paperwork/silicon_photography.dm @@ -139,7 +139,7 @@ deletepicture(src) -obj/item/device/camera/siliconcam/proc/getsource() +/obj/item/device/camera/siliconcam/proc/getsource() if(istype(src.loc, /mob/living/silicon/ai)) return src diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index 2b7b881b09..ff9ca236c7 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -1,5 +1,5 @@ //like orange but only checks north/south/east/west for one step -proc/cardinalrange(var/center) +/proc/cardinalrange(var/center) var/list/things = list() for(var/direction in cardinal) var/turf/T = get_step(center, direction) @@ -194,7 +194,7 @@ proc/cardinalrange(var/center) throwforce = 5 throw_speed = 1 throw_range = 2 - matter = list(DEFAULT_WALL_MATERIAL = 100, "waste" = 2000) + matter = list(DEFAULT_WALL_MATERIAL = 100) /obj/item/device/am_shielding_container/attackby(var/obj/item/I, var/mob/user) if(istype(I, /obj/item/device/multitool) && istype(src.loc,/turf)) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index b5eeaa9305..1a4c854634 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -264,7 +264,7 @@ var/list/possible_cable_coil_colours = list( qdel(src) return -obj/structure/cable/proc/cableColor(var/colorC) +/obj/structure/cable/proc/cableColor(var/colorC) var/color_n = "#DD0000" if(colorC) color_n = colorC diff --git a/code/modules/power/fusion/fusion_reactions.dm b/code/modules/power/fusion/fusion_reactions.dm index 88117f8164..b49fa564bc 100644 --- a/code/modules/power/fusion/fusion_reactions.dm +++ b/code/modules/power/fusion/fusion_reactions.dm @@ -14,7 +14,7 @@ var/list/fusion_reactions /decl/fusion_reaction/proc/handle_reaction_special(var/obj/effect/fusion_em_field/holder) return 0 -proc/get_fusion_reaction(var/p_react, var/s_react, var/m_energy) +/proc/get_fusion_reaction(var/p_react, var/s_react, var/m_energy) if(!fusion_reactions) fusion_reactions = list() for(var/rtype in typesof(/decl/fusion_reaction) - /decl/fusion_reaction) diff --git a/code/modules/power/generator_type2.dm b/code/modules/power/generator_type2.dm deleted file mode 100644 index a52675b706..0000000000 --- a/code/modules/power/generator_type2.dm +++ /dev/null @@ -1,141 +0,0 @@ -/obj/machinery/power/generator_type2 - name = "thermoelectric generator" - desc = "It's a high efficiency thermoelectric generator." - icon_state = "teg" - anchored = 1 - density = 1 - use_power = USE_POWER_OFF - - var/obj/machinery/atmospherics/unary/generator_input/input1 - var/obj/machinery/atmospherics/unary/generator_input/input2 - - var/lastgen = 0 - var/lastgenlev = -1 - - -/obj/machinery/power/generator_type2/Initialize() - . = ..() - input1 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, 90)) - input2 = locate(/obj/machinery/atmospherics/unary/generator_input) in get_step(src,turn(dir, -90)) - if(!input1 || !input2) - stat |= BROKEN - updateicon() - -/obj/machinery/power/generator_type2/proc/updateicon() - - if(stat & (NOPOWER|BROKEN)) - overlays.Cut() - else - overlays.Cut() - - if(lastgenlev != 0) - overlays += image('icons/obj/power.dmi', "teg-op[lastgenlev]") - -#define GENRATE 800 // generator output coefficient from Q - - -/obj/machinery/power/generator_type2/process() - if(!input1 || !input2) - return - - var/datum/gas_mixture/air1 = input1.return_exchange_air() - var/datum/gas_mixture/air2 = input2.return_exchange_air() - - - lastgen = 0 - - if(air1 && air2) - var/datum/gas_mixture/hot_air = air1 - var/datum/gas_mixture/cold_air = air2 - if(hot_air.temperature < cold_air.temperature) - hot_air = air2 - cold_air = air1 - - var/hot_air_heat_capacity = hot_air.heat_capacity() - var/cold_air_heat_capacity = cold_air.heat_capacity() - - var/delta_temperature = hot_air.temperature - cold_air.temperature - - if(delta_temperature > 1 && cold_air_heat_capacity > 0.01 && hot_air_heat_capacity > 0.01) - var/efficiency = (1 - cold_air.temperature/hot_air.temperature)*0.65 //65% of Carnot efficiency - - var/energy_transfer = delta_temperature*hot_air_heat_capacity*cold_air_heat_capacity/(hot_air_heat_capacity+cold_air_heat_capacity) - - var/heat = energy_transfer*(1-efficiency) - lastgen = energy_transfer*efficiency - - hot_air.temperature = hot_air.temperature - energy_transfer/hot_air_heat_capacity - cold_air.temperature = cold_air.temperature + heat/cold_air_heat_capacity - - //to_world("POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]") - - if(input1.network) - input1.network.update = 1 - - if(input2.network) - input2.network.update = 1 - - add_avail(lastgen) - // update icon overlays only if displayed level has changed - - var/genlev = max(0, min( round(11*lastgen / 100000), 11)) - if(genlev != lastgenlev) - lastgenlev = genlev - updateicon() - - src.updateDialog() - - -/obj/machinery/power/generator_type2/attack_ai(mob/user) - if(stat & (BROKEN|NOPOWER)) return - interact(user) - - -/obj/machinery/power/generator_type2/attack_hand(mob/user) - add_fingerprint(user) - if(stat & (BROKEN|NOPOWER)) return - interact(user) - - -/obj/machinery/power/generator_type2/interact(mob/user) - if ( (get_dist(src, user) > 1 ) && (!istype(user, /mob/living/silicon/ai))) - user.unset_machine() - user << browse(null, "window=teg") - return - - user.set_machine(src) - - var/t = "
    Thermo-Electric Generator
    " - - t += "Output : [round(lastgen)] W

    " - - t += "Cold loop
    " - t += "Temperature: [round(input1.air_contents.temperature, 0.1)] K
    " - t += "Pressure: [round(input1.air_contents.return_pressure(), 0.1)] kPa
    " - - t += "Hot loop
    " - t += "Temperature: [round(input2.air_contents.temperature, 0.1)] K
    " - t += "Pressure: [round(input2.air_contents.return_pressure(), 0.1)] kPa
    " - - t += "

    Close" - - t += "
    " - user << browse(t, "window=teg;size=460x300") - onclose(user, "teg") - return 1 - - -/obj/machinery/power/generator_type2/Topic(href, href_list) - ..() - - if( href_list["close"] ) - usr << browse(null, "window=teg") - usr.unset_machine() - return 0 - - return 1 - - -/obj/machinery/power/generator_type2/power_change() - ..() - updateicon() \ No newline at end of file diff --git a/code/modules/projectiles/guns/energy/phase.dm b/code/modules/projectiles/guns/energy/phase.dm index 18290c3946..5c4628fe23 100644 --- a/code/modules/projectiles/guns/energy/phase.dm +++ b/code/modules/projectiles/guns/energy/phase.dm @@ -41,7 +41,7 @@ charge_cost = 400 recharge_time = 7 -obj/item/weapon/gun/energy/phasegun/rifle +/obj/item/weapon/gun/energy/phasegun/rifle name = "phase rifle" desc = "The RayZar EW31 Orion is a specialist energy weapon, intended for use against hostile wildlife." icon_state = "phaserifle" diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 7877cac713..0f911adc28 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -160,7 +160,7 @@ projectile_type = /obj/item/projectile/animate charge_cost = 240 */ -obj/item/weapon/gun/energy/staff/focus +/obj/item/weapon/gun/energy/staff/focus name = "mental focus" desc = "An artifact that channels the will of the user into destructive bolts of force. If you aren't careful with it, you might poke someone's brain out." icon = 'icons/obj/wizard.dmi' diff --git a/code/modules/projectiles/guns/magnetic/bore.dm b/code/modules/projectiles/guns/magnetic/bore.dm index 897a43d888..eea444fbf6 100644 --- a/code/modules/projectiles/guns/magnetic/bore.dm +++ b/code/modules/projectiles/guns/magnetic/bore.dm @@ -208,7 +208,7 @@ /obj/item/weapon/gun/magnetic/matfed/phoronbore/process() if(generator_state && !mat_storage) - audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out.")) + audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out."), runemessage = "goes quiet") soundloop.stop() generator_state = GEN_OFF @@ -258,12 +258,12 @@ soundloop.start() time_started = world.time cell?.use(100) - audible_message(SPAN_NOTICE("\The [src] starts chugging."),SPAN_NOTICE("A motor noise starts up.")) + audible_message(SPAN_NOTICE("\The [src] starts chugging."),SPAN_NOTICE("A motor noise starts up."), runemessage = "whirr") generator_state = GEN_IDLE else if(generator_state > GEN_OFF && time_started + 3 SECONDS < world.time) soundloop.stop() - audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out.")) + audible_message(SPAN_NOTICE("\The [src] goes quiet."),SPAN_NOTICE("A motor noise cuts out."), runemessage = "goes quiet") generator_state = GEN_OFF /obj/item/weapon/gun/magnetic/matfed/phoronbore/loaded diff --git a/code/modules/projectiles/guns/magnetic/magnetic.dm b/code/modules/projectiles/guns/magnetic/magnetic.dm index 1b13bd8f8c..12d00c63ac 100644 --- a/code/modules/projectiles/guns/magnetic/magnetic.dm +++ b/code/modules/projectiles/guns/magnetic/magnetic.dm @@ -284,7 +284,7 @@ visible_message("\The [src] begins to rattle, its acceleration chamber collapsing in on itself!") removable_components = FALSE spawn(15) - audible_message("\The [src]'s power supply begins to overload as the device crumples!") //Why are you still holding this? + audible_message("\The [src]'s power supply begins to overload as the device crumples!", runemessage = "VWRRRRRRRR") //Why are you still holding this? playsound(src, 'sound/effects/grillehit.ogg', 10, 1) var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread() var/turf/T = get_turf(src) diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm index acfd06426c..85f9077cfb 100644 --- a/code/modules/projectiles/guns/projectile/revolver.dm +++ b/code/modules/projectiles/guns/projectile/revolver.dm @@ -81,7 +81,7 @@ max_shells = 7 -obj/item/weapon/gun/projectile/revolver/detective45/verb/rename_gun() +/obj/item/weapon/gun/projectile/revolver/detective45/verb/rename_gun() set name = "Name Gun" set category = "Object" set desc = "Rename your gun. If you're the Detective." diff --git a/code/modules/projectiles/targeting/targeting_overlay.dm b/code/modules/projectiles/targeting/targeting_overlay.dm index a7d069fad4..cea545ce25 100644 --- a/code/modules/projectiles/targeting/targeting_overlay.dm +++ b/code/modules/projectiles/targeting/targeting_overlay.dm @@ -92,7 +92,7 @@ STOP_PROCESSING(SSobj, src) return ..() -obj/aiming_overlay/proc/update_aiming_deferred() +/obj/aiming_overlay/proc/update_aiming_deferred() set waitfor = 0 sleep(0) update_aiming() diff --git a/code/modules/random_map/drop/drop_types.dm b/code/modules/random_map/drop/drop_types.dm index f426fa5ebc..4d8c31a749 100644 --- a/code/modules/random_map/drop/drop_types.dm +++ b/code/modules/random_map/drop/drop_types.dm @@ -96,7 +96,7 @@ var/global/list/datum/supply_drop_loot/supply_drop /obj/item/weapon/grenade/empgrenade, /obj/item/weapon/material/knife/tacknife/combatknife) -datum/supply_drop_loot/riot +/datum/supply_drop_loot/riot name = "Riot Gear" container = /obj/structure/largecrate /datum/supply_drop_loot/riot/New() diff --git a/code/modules/reagents/machinery/dispenser/cartridge_presets.dm b/code/modules/reagents/machinery/dispenser/cartridge_presets.dm index 21b321ad34..672356551b 100644 --- a/code/modules/reagents/machinery/dispenser/cartridge_presets.dm +++ b/code/modules/reagents/machinery/dispenser/cartridge_presets.dm @@ -1,108 +1,197 @@ -/obj/item/weapon/reagent_containers/chem_disp_cartridge - small - volume = CARTRIDGE_VOLUME_SMALL +/obj/item/weapon/reagent_containers/chem_disp_cartridge/small + volume = CARTRIDGE_VOLUME_SMALL - medium - volume = CARTRIDGE_VOLUME_MEDIUM +/obj/item/weapon/reagent_containers/chem_disp_cartridge/medium + volume = CARTRIDGE_VOLUME_MEDIUM - // Multiple - water spawn_reagent = "water" - sugar spawn_reagent = "sugar" +// Multiple +/obj/item/weapon/reagent_containers/chem_disp_cartridge/water + spawn_reagent = "water" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/sugar + spawn_reagent = "sugar" - // Chemistry - hydrogen spawn_reagent = "hydrogen" - lithium spawn_reagent = "lithium" - carbon spawn_reagent = "carbon" - nitrogen spawn_reagent = "nitrogen" - oxygen spawn_reagent = "oxygen" - fluorine spawn_reagent = "fluorine" - sodium spawn_reagent = "sodium" - aluminum spawn_reagent = "aluminum" - silicon spawn_reagent = "silicon" - phosphorus spawn_reagent = "phosphorus" - sulfur spawn_reagent = "sulfur" - chlorine spawn_reagent = "chlorine" - potassium spawn_reagent = "potassium" - iron spawn_reagent = "iron" - copper spawn_reagent = "copper" - mercury spawn_reagent = "mercury" - radium spawn_reagent = "radium" - ethanol spawn_reagent = "ethanol" - sacid spawn_reagent = "sacid" - tungsten spawn_reagent = "tungsten" - calcium spawn_reagent = "calcium" +// Chemistry +/obj/item/weapon/reagent_containers/chem_disp_cartridge/hydrogen + spawn_reagent = "hydrogen" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/lithium + spawn_reagent = "lithium" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/carbon + spawn_reagent = "carbon" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/nitrogen + spawn_reagent = "nitrogen" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/oxygen + spawn_reagent = "oxygen" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/fluorine + spawn_reagent = "fluorine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/sodium + spawn_reagent = "sodium" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/aluminum + spawn_reagent = "aluminum" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/silicon + spawn_reagent = "silicon" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/phosphorus + spawn_reagent = "phosphorus" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/sulfur + spawn_reagent = "sulfur" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/chlorine + spawn_reagent = "chlorine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/potassium + spawn_reagent = "potassium" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/iron + spawn_reagent = "iron" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/copper + spawn_reagent = "copper" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/mercury + spawn_reagent = "mercury" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/radium + spawn_reagent = "radium" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/ethanol + spawn_reagent = "ethanol" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/sacid + spawn_reagent = "sacid" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/tungsten + spawn_reagent = "tungsten" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/calcium + spawn_reagent = "calcium" - // Bar, alcoholic - beer spawn_reagent = "beer" - kahlua spawn_reagent = "kahlua" - whiskey spawn_reagent = "whiskey" - wine spawn_reagent = "wine" - vodka spawn_reagent = "vodka" - gin spawn_reagent = "gin" - rum spawn_reagent = "rum" - tequila spawn_reagent = "tequilla" - vermouth spawn_reagent = "vermouth" - cognac spawn_reagent = "cognac" - ale spawn_reagent = "ale" - mead spawn_reagent = "mead" - bitters spawn_reagent = "bitters" - cider spawn_reagent = "cider" +// Bar, alcoholic +/obj/item/weapon/reagent_containers/chem_disp_cartridge/beer + spawn_reagent = "beer" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/kahlua + spawn_reagent = "kahlua" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/whiskey + spawn_reagent = "whiskey" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/wine + spawn_reagent = "wine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/vodka + spawn_reagent = "vodka" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/gin + spawn_reagent = "gin" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/rum + spawn_reagent = "rum" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/tequila + spawn_reagent = "tequilla" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/vermouth + spawn_reagent = "vermouth" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/cognac + spawn_reagent = "cognac" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/ale + spawn_reagent = "ale" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/mead + spawn_reagent = "mead" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/bitters + spawn_reagent = "bitters" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/cider + spawn_reagent = "cider" - // Bar, soft - ice spawn_reagent = "ice" - tea spawn_reagent = "tea" - icetea spawn_reagent = "icetea" - cola spawn_reagent = "cola" - smw spawn_reagent = "spacemountainwind" - dr_gibb spawn_reagent = "dr_gibb" - spaceup spawn_reagent = "space_up" - tonic spawn_reagent = "tonic" - sodawater spawn_reagent = "sodawater" - lemon_lime spawn_reagent = "lemon_lime" - orange spawn_reagent = "orangejuice" - lime spawn_reagent = "limejuice" - watermelon spawn_reagent = "watermelonjuice" - lemon spawn_reagent = "lemonjuice" +// Bar, soft +/obj/item/weapon/reagent_containers/chem_disp_cartridge/ice + spawn_reagent = "ice" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/tea + spawn_reagent = "tea" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/icetea + spawn_reagent = "icetea" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/cola + spawn_reagent = "cola" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/smw + spawn_reagent = "spacemountainwind" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/dr_gibb + spawn_reagent = "dr_gibb" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/spaceup + spawn_reagent = "space_up" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/tonic + spawn_reagent = "tonic" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/sodawater + spawn_reagent = "sodawater" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/lemon_lime + spawn_reagent = "lemon_lime" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/orange + spawn_reagent = "orangejuice" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/lime + spawn_reagent = "limejuice" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/watermelon + spawn_reagent = "watermelonjuice" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/lemon + spawn_reagent = "lemonjuice" - // Bar, coffee - coffee spawn_reagent = "coffee" - cafe_latte spawn_reagent = "cafe_latte" - soy_latte spawn_reagent = "soy_latte" - hot_coco spawn_reagent = "hot_coco" - milk spawn_reagent = "milk" - cream spawn_reagent = "cream" - mint spawn_reagent = "mint" - berry spawn_reagent = "berryjuice" - greentea spawn_reagent = "greentea" - decaf spawn_reagent = "decaf" +// Bar, coffee +/obj/item/weapon/reagent_containers/chem_disp_cartridge/coffee + spawn_reagent = "coffee" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/cafe_latte + spawn_reagent = "cafe_latte" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/soy_latte + spawn_reagent = "soy_latte" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/hot_coco + spawn_reagent = "hot_coco" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/milk + spawn_reagent = "milk" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/cream + spawn_reagent = "cream" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/mint + spawn_reagent = "mint" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/berry + spawn_reagent = "berryjuice" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/greentea + spawn_reagent = "greentea" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/decaf + spawn_reagent = "decaf" - // ERT - inaprov spawn_reagent = "inaprovaline" - ryetalyn spawn_reagent = "ryetalyn" - paracetamol spawn_reagent = "paracetamol" - tramadol spawn_reagent = "tramadol" - oxycodone spawn_reagent = "oxycodone" - sterilizine spawn_reagent = "sterilizine" - leporazine spawn_reagent = "leporazine" - kelotane spawn_reagent = "kelotane" - dermaline spawn_reagent = "dermaline" - dexalin spawn_reagent = "dexalin" - dexalin/small volume = CARTRIDGE_VOLUME_SMALL // For the medicine cartridge crate, so it's not too easy to get large amounts of dexalin - dexalin_p spawn_reagent = "dexalinp" - tricord spawn_reagent = "tricordrazine" - dylovene spawn_reagent = "anti_toxin" - synaptizine spawn_reagent = "synaptizine" - hyronalin spawn_reagent = "hyronalin" - arithrazine spawn_reagent = "arithrazine" - alkysine spawn_reagent = "alkysine" - imidazoline spawn_reagent = "imidazoline" - peridaxon spawn_reagent = "peridaxon" - bicaridine spawn_reagent = "bicaridine" - hyperzine spawn_reagent = "hyperzine" - rezadone spawn_reagent = "rezadone" - spaceacillin spawn_reagent = "spaceacillin" - ethylredox spawn_reagent = "ethylredoxrazine" - sleeptox spawn_reagent = "stoxin" - chloral spawn_reagent = "chloralhydrate" - cryoxadone spawn_reagent = "cryoxadone" - clonexadone spawn_reagent = "clonexadone" +// ERT +/obj/item/weapon/reagent_containers/chem_disp_cartridge/inaprov + spawn_reagent = "inaprovaline" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/ryetalyn + spawn_reagent = "ryetalyn" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/paracetamol + spawn_reagent = "paracetamol" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/tramadol + spawn_reagent = "tramadol" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/oxycodone + spawn_reagent = "oxycodone" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/sterilizine + spawn_reagent = "sterilizine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/leporazine + spawn_reagent = "leporazine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/kelotane + spawn_reagent = "kelotane" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/dermaline + spawn_reagent = "dermaline" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/dexalin + spawn_reagent = "dexalin" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/dexalin/small + volume = CARTRIDGE_VOLUME_SMALL // For the medicine cartridge crate, so it's not too easy to get large amounts of dexalin +/obj/item/weapon/reagent_containers/chem_disp_cartridge/dexalin_p + spawn_reagent = "dexalinp" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/tricord + spawn_reagent = "tricordrazine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/dylovene + spawn_reagent = "anti_toxin" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/synaptizine + spawn_reagent = "synaptizine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/hyronalin + spawn_reagent = "hyronalin" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/arithrazine + spawn_reagent = "arithrazine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/alkysine + spawn_reagent = "alkysine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/imidazoline + spawn_reagent = "imidazoline" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/peridaxon + spawn_reagent = "peridaxon" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/bicaridine + spawn_reagent = "bicaridine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/hyperzine + spawn_reagent = "hyperzine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/rezadone + spawn_reagent = "rezadone" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/spaceacillin + spawn_reagent = "spaceacillin" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/ethylredox + spawn_reagent = "ethylredoxrazine" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/sleeptox + spawn_reagent = "stoxin" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/chloral + spawn_reagent = "chloralhydrate" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/cryoxadone + spawn_reagent = "cryoxadone" +/obj/item/weapon/reagent_containers/chem_disp_cartridge/clonexadone + spawn_reagent = "clonexadone" diff --git a/code/modules/reagents/machinery/dispenser/supply.dm b/code/modules/reagents/machinery/dispenser/supply.dm index 30b1c3c0f6..984d7786a8 100644 --- a/code/modules/reagents/machinery/dispenser/supply.dm +++ b/code/modules/reagents/machinery/dispenser/supply.dm @@ -147,27 +147,23 @@ group = "Reagents" #define SEC_PACK(_tname, _type, _name, _cname, _cost, _access)\ - datum/supply_pack/dispenser_cartridges{\ - _tname {\ - name = _name ;\ - containername = _cname ;\ - containertype = /obj/structure/closet/crate/secure;\ - access = list( _access );\ - cost = _cost ;\ - contains = list( _type , _type );\ - group = "Reagent Cartridges"\ - }\ + /datum/supply_pack/dispenser_cartridges/##_tname {\ + name = _name ;\ + containername = _cname ;\ + containertype = /obj/structure/closet/crate/secure;\ + access = list( _access );\ + cost = _cost ;\ + contains = list( _type , _type );\ + group = "Reagent Cartridges"\ } #define PACK(_tname, _type, _name, _cname, _cost)\ - datum/supply_pack/dispenser_cartridges{\ - _tname {\ - name = _name ;\ - containername = _cname ;\ - containertype = /obj/structure/closet/crate;\ - cost = _cost ;\ - contains = list( _type , _type );\ - group = "Reagent Cartridges"\ - }\ + /datum/supply_pack/dispenser_cartridges/##_tname {\ + name = _name ;\ + containername = _cname ;\ + containertype = /obj/structure/closet/crate;\ + cost = _cost ;\ + contains = list( _type , _type );\ + group = "Reagent Cartridges"\ } // Chemistry-restricted (raw reagents excluding sugar/water) diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 204bf34552..3b38e7d60f 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -311,7 +311,7 @@ var/image/lid = image(icon, src, "lid_[initial(icon_state)]") overlays += lid -obj/item/weapon/reagent_containers/glass/bucket/wood +/obj/item/weapon/reagent_containers/glass/bucket/wood desc = "An old wooden bucket." name = "wooden bucket" icon = 'icons/obj/janitor.dmi' diff --git a/code/modules/reagents/reagents/_reagents.dm b/code/modules/reagents/reagents/_reagents.dm index 9ab8b125da..3ffb7e58e5 100644 --- a/code/modules/reagents/reagents/_reagents.dm +++ b/code/modules/reagents/reagents/_reagents.dm @@ -26,7 +26,7 @@ var/affects_dead = 0 // Does this chem process inside a corpse? var/affects_robots = 0 // Does this chem process inside a Synth? - var/allergen_type = GENERIC // What potential allergens does this contain? + var/allergen_type // What potential allergens does this contain? var/allergen_factor = 1 // If the potential allergens are mixed and low-volume, they're a bit less dangerous. Needed for drinks because they're a single reagent compared to food which contains multiple seperate reagents. var/cup_icon_state = null diff --git a/code/modules/reagents/reagents/food_drinks.dm b/code/modules/reagents/reagents/food_drinks.dm index 2fbaf6bb8a..5cbbd0bc8a 100644 --- a/code/modules/reagents/reagents/food_drinks.dm +++ b/code/modules/reagents/reagents/food_drinks.dm @@ -116,7 +116,7 @@ icon_raw = "batter_raw" icon_cooked = "batter_cooked" coated_adj = "battered" - allergen_type = GRAINS | EGGS //Made with flour(grain), and eggs(eggs) + allergen_type = ALLERGEN_GRAINS | ALLERGEN_EGGS //Made with flour(grain), and eggs(eggs) /datum/reagent/nutriment/coating/beerbatter name = "beer batter mix" @@ -127,7 +127,7 @@ icon_raw = "batter_raw" icon_cooked = "batter_cooked" coated_adj = "beer-battered" - allergen_type = GRAINS | EGGS //Made with flour(grain), eggs(eggs), and beer(grain) + allergen_type = ALLERGEN_GRAINS | ALLERGEN_EGGS //Made with flour(grain), eggs(eggs), and beer(grain) /datum/reagent/nutriment/coating/beerbatter/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -231,7 +231,7 @@ id = "cornoil" description = "An oil derived from various types of corn." reagent_state = LIQUID - allergen_type = VEGETABLE //Corn is a vegetable + allergen_type = ALLERGEN_VEGETABLE //Corn is a vegetable /datum/reagent/nutriment/triglyceride/oil/peanut name = "Peanut Oil" @@ -241,7 +241,7 @@ taste_mult = 0.3 nutriment_factor = 15 color = "#4F3500" - allergen_type = SEEDS //Peanut oil would come from peanuts, hence seeds. + allergen_type = ALLERGEN_SEEDS //Peanut oil would come from peanuts, hence seeds. // Aurora Cooking Port Insertion End @@ -258,7 +258,7 @@ id = "protein" taste_description = "some sort of meat" color = "#440000" - allergen_type = MEAT //"Animal protein" implies it comes from animals, therefore meat. + allergen_type = ALLERGEN_MEAT //"Animal protein" implies it comes from animals, therefore meat. /datum/reagent/nutriment/protein/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) switch(alien) @@ -274,35 +274,35 @@ id = "tofu" color = "#fdffa8" taste_description = "tofu" - allergen_type = BEANS //Made from soy beans + allergen_type = ALLERGEN_BEANS //Made from soy beans /datum/reagent/nutriment/protein/seafood name = "seafood protein" id = "seafood" color = "#f5f4e9" taste_description = "fish" - allergen_type = FISH //I suppose the fish allergy likely refers to seafood in general. + allergen_type = ALLERGEN_FISH //I suppose the fish allergy likely refers to seafood in general. /datum/reagent/nutriment/protein/cheese name = "cheese" id = "cheese" color = "#EDB91F" taste_description = "cheese" - allergen_type = DAIRY //Cheese is made from dairy + allergen_type = ALLERGEN_DAIRY //Cheese is made from dairy /datum/reagent/nutriment/protein/egg name = "egg yolk" id = "egg" taste_description = "egg" color = "#FFFFAA" - allergen_type = EGGS //Eggs contain egg + allergen_type = ALLERGEN_EGGS //Eggs contain egg /datum/reagent/nutriment/protein/murk name = "murkfin protein" id = "murk_protein" taste_description = "mud" color = "#664330" - allergen_type = FISH //Murkfin is fish + allergen_type = ALLERGEN_FISH //Murkfin is fish /datum/reagent/nutriment/honey name = "Honey" @@ -340,7 +340,7 @@ taste_description = "unmistakably mayonnaise" nutriment_factor = 10 color = "#FFFFFF" - allergen_type = EGGS //Mayo is made from eggs + allergen_type = ALLERGEN_EGGS //Mayo is made from eggs /datum/reagent/nutriment/yeast name = "Yeast" @@ -358,7 +358,7 @@ reagent_state = SOLID nutriment_factor = 1 color = "#FFFFFF" - allergen_type = GRAINS //Flour is made from grain + allergen_type = ALLERGEN_GRAINS //Flour is made from grain /datum/reagent/nutriment/flour/touch_turf(var/turf/simulated/T) if(!istype(T, /turf/space)) @@ -372,7 +372,7 @@ taste_mult = 1.3 nutriment_factor = 1 color = "#482000" - allergen_type = COFFEE //Again, coffee contains coffee + allergen_type = ALLERGEN_COFFEE //Again, coffee contains coffee /datum/reagent/nutriment/tea name = "Tea Powder" @@ -399,7 +399,7 @@ description = "Dehydrated, powdered juice of some kind." taste_mult = 1.3 nutriment_factor = 1 - allergen_type = FRUIT //I suppose it's implied here that the juice is from dehydrated fruit. + allergen_type = ALLERGEN_FRUIT //I suppose it's implied here that the juice is from dehydrated fruit. /datum/reagent/nutriment/instantjuice/grape name = "Grape Juice Powder" @@ -438,7 +438,7 @@ reagent_state = LIQUID nutriment_factor = 2 color = "#792300" - allergen_type = BEANS //Soy (beans) + allergen_type = ALLERGEN_BEANS //Soy (beans) /datum/reagent/nutriment/ketchup @@ -449,7 +449,7 @@ reagent_state = LIQUID nutriment_factor = 5 color = "#731008" - allergen_type = FRUIT //Tomatoes are a fruit. + allergen_type = ALLERGEN_FRUIT //Tomatoes are a fruit. /datum/reagent/nutriment/barbecue name = "Barbeque Sauce" @@ -479,7 +479,7 @@ reagent_state = LIQUID nutriment_factor = 1 color = "#801E28" - allergen_type = FRUIT //Cherries are fruits + allergen_type = ALLERGEN_FRUIT //Cherries are fruits /datum/reagent/nutriment/peanutbutter name = "Peanut Butter" @@ -490,7 +490,7 @@ reagent_state = LIQUID nutriment_factor = 30 color = "#4F3500" - allergen_type = SEEDS //Peanuts(seeds) + allergen_type = ALLERGEN_SEEDS //Peanuts(seeds) /datum/reagent/nutriment/vanilla name = "Vanilla Extract" @@ -536,7 +536,7 @@ reagent_state = LIQUID nutriment_factor = 2 color = "#899613" - allergen_type = DAIRY //incase anyone is dumb enough to drink it - it does contain milk! + allergen_type = ALLERGEN_DAIRY //incase anyone is dumb enough to drink it - it does contain milk! /datum/reagent/nutriment/sprinkles name = "Sprinkles" @@ -893,7 +893,7 @@ glass_name = "banana juice" glass_desc = "The raw essence of a banana. HONK!" - allergen_type = FRUIT //Bananas are fruit + allergen_type = ALLERGEN_FRUIT //Bananas are fruit /datum/reagent/drink/juice/berry name = "Berry Juice" @@ -904,7 +904,7 @@ glass_name = "berry juice" glass_desc = "Berry juice. Or maybe it's jam. Who cares?" - allergen_type = FRUIT //Berries are fruit + allergen_type = ALLERGEN_FRUIT //Berries are fruit /datum/reagent/drink/juice/pineapple name = "Pineapple Juice" @@ -915,7 +915,7 @@ glass_name = "pineapple juice" glass_desc = "Pineapple juice. Or maybe it's spineapple. Who cares?" - allergen_type = FRUIT //Pineapples are fruit + allergen_type = ALLERGEN_FRUIT //Pineapples are fruit /datum/reagent/drink/juice/carrot name = "Carrot juice" @@ -926,7 +926,7 @@ glass_name = "carrot juice" glass_desc = "It is just like a carrot but without crunching." - allergen_type = VEGETABLE //Carrots are vegetables + allergen_type = ALLERGEN_VEGETABLE //Carrots are vegetables /datum/reagent/drink/juice/carrot/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -942,7 +942,7 @@ glass_name = "grape juice" glass_desc = "It's grrrrrape!" - allergen_type = FRUIT //Grapes are fruit + allergen_type = ALLERGEN_FRUIT //Grapes are fruit /datum/reagent/drink/juice/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -976,7 +976,7 @@ glass_name = "lemon juice" glass_desc = "Sour..." - allergen_type = FRUIT //Lemons are fruit + allergen_type = ALLERGEN_FRUIT //Lemons are fruit /datum/reagent/drink/juice/apple @@ -989,7 +989,7 @@ glass_name = "apple juice" glass_desc = "An earth favorite." - allergen_type = FRUIT //Apples are fruit + allergen_type = ALLERGEN_FRUIT //Apples are fruit /datum/reagent/drink/juice/lime name = "Lime Juice" @@ -1001,7 +1001,7 @@ glass_name = "lime juice" glass_desc = "A glass of sweet-sour lime juice" - allergen_type = FRUIT //Limes are fruit + allergen_type = ALLERGEN_FRUIT //Limes are fruit /datum/reagent/drink/juice/lime/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1018,7 +1018,7 @@ glass_name = "orange juice" glass_desc = "Vitamins! Yay!" - allergen_type = FRUIT //Oranges are fruit + allergen_type = ALLERGEN_FRUIT //Oranges are fruit /datum/reagent/drink/orangejuice/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1048,7 +1048,7 @@ glass_name = "potato juice" glass_desc = "Juice from a potato. Bleh." - allergen_type = VEGETABLE //Potatoes are vegetables + allergen_type = ALLERGEN_VEGETABLE //Potatoes are vegetables /datum/reagent/drink/juice/tomato name = "Tomato Juice" @@ -1060,7 +1060,7 @@ glass_name = "tomato juice" glass_desc = "Are you sure this is tomato juice?" - allergen_type = FRUIT //Yes tomatoes are a fruit + allergen_type = ALLERGEN_FRUIT //Yes tomatoes are a fruit /datum/reagent/drink/juice/tomato/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1077,7 +1077,7 @@ glass_name = "watermelon juice" glass_desc = "Delicious juice made from watermelon." - allergen_type = FRUIT //Watermelon is a fruit + allergen_type = ALLERGEN_FRUIT //Watermelon is a fruit // Everything else @@ -1094,7 +1094,7 @@ cup_icon_state = "cup_cream" cup_name = "cup of milk" cup_desc = "White and nutritious goodness!" - allergen_type = DAIRY //Milk is dairy + allergen_type = ALLERGEN_DAIRY //Milk is dairy /datum/reagent/drink/milk/chocolate name = "Chocolate Milk" @@ -1130,7 +1130,7 @@ cup_icon_state = "cup_cream" cup_name = "cup of cream" cup_desc = "Ewwww..." - allergen_type = DAIRY //Cream is dairy + allergen_type = ALLERGEN_DAIRY //Cream is dairy /datum/reagent/drink/milk/soymilk name = "Soy Milk" @@ -1145,7 +1145,7 @@ cup_icon_state = "cup_cream" cup_name = "cup of milk" cup_desc = "White and nutritious goodness!" - allergen_type = BEANS //Would be made from soy beans + allergen_type = ALLERGEN_BEANS //Would be made from soy beans /datum/reagent/drink/tea name = "Tea" @@ -1230,7 +1230,7 @@ cup_name = "cup of lemon tea" cup_desc = "A tasty mixture of lemon and tea. It's apparently good for you!" - allergen_type = FRUIT //Made with lemon juice + allergen_type = ALLERGEN_FRUIT //Made with lemon juice /datum/reagent/drink/tea/limetea name = "Lime Tea" @@ -1244,7 +1244,7 @@ cup_name = "cup of lime tea" cup_desc = "A tasty mixture of lime and tea. It's apparently good for you!" - allergen_type = FRUIT //Made with lime juice + allergen_type = ALLERGEN_FRUIT //Made with lime juice /datum/reagent/drink/tea/orangetea name = "Orange Tea" @@ -1258,7 +1258,7 @@ cup_name = "cup of orange tea" cup_desc = "A tasty mixture of orange and tea. It's apparently good for you!" - allergen_type = FRUIT //Made with orange juice + allergen_type = ALLERGEN_FRUIT //Made with orange juice /datum/reagent/drink/tea/berrytea name = "Berry Tea" @@ -1272,7 +1272,7 @@ cup_name = "cup of berry tea" cup_desc = "A tasty mixture of berries and tea. It's apparently good for you!" - allergen_type = FRUIT //Made with berry juice + allergen_type = ALLERGEN_FRUIT //Made with berry juice /datum/reagent/drink/greentea name = "Green Tea" @@ -1319,7 +1319,7 @@ glass_name = "coffee" glass_desc = "Don't drop it, or you'll send scalding liquid and glass shards everywhere." - allergen_type = COFFEE //Apparently coffee contains coffee + allergen_type = ALLERGEN_COFFEE //Apparently coffee contains coffee /datum/reagent/drink/coffee/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) if(alien == IS_DIONA) @@ -1387,7 +1387,7 @@ cup_icon_state = "cup_latte" cup_name = "cup of soy latte" cup_desc = "A nice and refreshing beverage while you are reading." - allergen_type = COFFEE|BEANS //Soy(beans) and coffee + allergen_type = ALLERGEN_COFFEE|ALLERGEN_BEANS //Soy(beans) and coffee /datum/reagent/drink/coffee/soy_latte/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1407,7 +1407,7 @@ cup_icon_state = "cup_latte" cup_name = "cup of cafe latte" cup_desc = "A nice and refreshing beverage while you are reading." - allergen_type = COFFEE|DAIRY //Cream and coffee + allergen_type = ALLERGEN_COFFEE|ALLERGEN_DAIRY //Cream and coffee /datum/reagent/drink/coffee/cafe_latte/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1428,7 +1428,7 @@ glass_name = "decaf coffee" glass_desc = "Basically just brown, bitter water." - allergen_type = COFFEE //Decaf coffee would still likely trigger allergy symptoms. + allergen_type = ALLERGEN_COFFEE //Decaf coffee would still likely trigger allergy symptoms. /datum/reagent/drink/hot_coco name = "Hot Chocolate" @@ -1472,7 +1472,7 @@ glass_name = "grape soda" glass_desc = "Looks like a delicious drink!" glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with grape juice + allergen_type = ALLERGEN_FRUIT //Made with grape juice /datum/reagent/drink/soda/tonic name = "Tonic Water" @@ -1500,7 +1500,7 @@ glass_name = "lemonade" glass_desc = "Oh the nostalgia..." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with lemon juice + allergen_type = ALLERGEN_FRUIT //Made with lemon juice /datum/reagent/drink/soda/melonade name = "Melonade" @@ -1513,7 +1513,7 @@ glass_name = "melonade" glass_desc = "Oh the.. nostalgia?" glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with watermelon juice + allergen_type = ALLERGEN_FRUIT //Made with watermelon juice /datum/reagent/drink/soda/appleade name = "Appleade" @@ -1526,7 +1526,7 @@ glass_name = "appleade" glass_desc = "Applejuice, improved." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with apple juice + allergen_type = ALLERGEN_FRUIT //Made with apple juice /datum/reagent/drink/soda/pineappleade name = "Pineappleade" @@ -1539,7 +1539,7 @@ glass_name = "pineappleade" glass_desc = "Pineapple, juiced up." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with pineapple juice + allergen_type = ALLERGEN_FRUIT //Made with pineapple juice /datum/reagent/drink/soda/kiraspecial name = "Kira Special" @@ -1552,7 +1552,7 @@ glass_name = "Kira Special" glass_desc = "Long live the guy who everyone had mistaken for a girl. Baka!" glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made from orange and lime juice + allergen_type = ALLERGEN_FRUIT //Made from orange and lime juice /datum/reagent/drink/soda/brownstar name = "Brown Star" @@ -1564,7 +1564,7 @@ glass_name = "Brown Star" glass_desc = "It's not what it sounds like..." - allergen_type = FRUIT //Made with orangejuice and cola + allergen_type = ALLERGEN_FRUIT //Made with orangejuice and cola /datum/reagent/drink/milkshake name = "Milkshake" @@ -1576,7 +1576,7 @@ glass_name = "milkshake" glass_desc = "Glorious brainfreezing mixture." - allergen_type = DAIRY //Made with dairy products + allergen_type = ALLERGEN_DAIRY //Made with dairy products /datum/reagent/milkshake/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1609,7 +1609,7 @@ glass_name = "Chocolate Milkshake" glass_desc = "A refreshing chocolate milkshake, just like mom used to make." - allergen_type = DAIRY //Made with dairy products + allergen_type = ALLERGEN_DAIRY //Made with dairy products /datum/reagent/drink/milkshake/berryshake name = "Berry Milkshake" @@ -1621,7 +1621,7 @@ glass_name = "Berry Milkshake" glass_desc = "A refreshing berry milkshake, just like mom used to make." - allergen_type = FRUIT|DAIRY //Made with berry juice and dairy products + allergen_type = ALLERGEN_FRUIT|ALLERGEN_DAIRY //Made with berry juice and dairy products /datum/reagent/drink/milkshake/coffeeshake name = "Coffee Milkshake" @@ -1636,7 +1636,7 @@ glass_name = "Coffee Milkshake" glass_desc = "An energizing coffee milkshake, perfect for hot days at work.." - allergen_type = DAIRY|COFFEE //Made with coffee and dairy products + allergen_type = ALLERGEN_DAIRY|ALLERGEN_COFFEE //Made with coffee and dairy products /datum/reagent/drink/milkshake/coffeeshake/overdose(var/mob/living/carbon/M, var/alien) M.make_jittery(5) @@ -1650,7 +1650,7 @@ glass_name = "Peanut Milkshake" glass_desc = "Savory cream in an ice-cold stature." - allergen_type = SEEDS|DAIRY //Made with peanutbutter(seeds) and dairy products + allergen_type = ALLERGEN_SEEDS|ALLERGEN_DAIRY //Made with peanutbutter(seeds) and dairy products /datum/reagent/drink/rewriter name = "Rewriter" @@ -1662,7 +1662,7 @@ glass_name = "Rewriter" glass_desc = "The secret of the sanctuary of the Libarian..." - allergen_type = FRUIT|COFFEE //Made with space mountain wind (Fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_COFFEE //Made with space mountain wind (Fruit) /datum/reagent/drink/rewriter/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1727,7 +1727,7 @@ glass_name = "Space Mountain Wind" glass_desc = "Space Mountain Wind. As you know, there are no mountains in space, only wind." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Fruit allergens because citrus is implied to come from limes/lemons + allergen_type = ALLERGEN_FRUIT //Fruit allergens because citrus is implied to come from limes/lemons /datum/reagent/drink/soda/dr_gibb name = "Dr. Gibb" @@ -1752,7 +1752,7 @@ glass_name = "Space-up" glass_desc = "Space-up. It helps keep your cool." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT + allergen_type = ALLERGEN_FRUIT /datum/reagent/drink/soda/lemon_lime name = "Lemon-Lime" @@ -1765,7 +1765,7 @@ glass_name = "lemon lime soda" glass_desc = "A tangy substance made of 0.5% natural citrus!" glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with lemon and lime juice + allergen_type = ALLERGEN_FRUIT //Made with lemon and lime juice /datum/reagent/drink/soda/gingerale name = "Ginger Ale" @@ -1822,7 +1822,7 @@ glass_name = "roy rogers" glass_desc = "I'm a cowboy, on a steel horse I ride" glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with lemon lime + allergen_type = ALLERGEN_FRUIT //Made with lemon lime /datum/reagent/drink/collins_mix name = "Collins Mix" @@ -1835,7 +1835,7 @@ glass_name = "collins mix" glass_desc = "Best hope it isn't a hoax." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with lemon lime + allergen_type = ALLERGEN_FRUIT //Made with lemon lime /datum/reagent/drink/arnold_palmer name = "Arnold Palmer" @@ -1848,7 +1848,7 @@ glass_name = "arnold palmer" glass_desc = "Tastes just like the old man." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with lemonade + allergen_type = ALLERGEN_FRUIT //Made with lemonade /datum/reagent/drink/doctor_delight name = "The Doctor's Delight" @@ -1861,7 +1861,7 @@ glass_name = "The Doctor's Delight" glass_desc = "A healthy mixture of juices, guaranteed to keep you healthy until the next toolboxing takes place." - allergen_type = FRUIT|DAIRY //Made from several fruit juices, and cream. + allergen_type = ALLERGEN_FRUIT|ALLERGEN_DAIRY //Made from several fruit juices, and cream. /datum/reagent/drink/doctor_delight/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -1970,7 +1970,7 @@ glass_name = "Dream Cream" glass_desc = "A smoothy, silky mix of honey and dairy." - allergen_type = DAIRY //Made using dairy + allergen_type = ALLERGEN_DAIRY //Made using dairy /datum/reagent/drink/soda/vilelemon name = "Vile Lemon" @@ -1982,7 +1982,7 @@ glass_name = "Vile Lemon" glass_desc = "A sour, fizzy drink with lemonade and lemonlime." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made from lemonade + allergen_type = ALLERGEN_FRUIT //Made from lemonade /datum/reagent/drink/entdraught name = "Ent's Draught" @@ -1993,7 +1993,7 @@ glass_name = "Ent's Draught" glass_desc = "You can almost smell the tranquility emanating from this." - //allergen_type = FRUIT Sorry to break the news, chief. Honey is not a fruit. + //allergen_type = ALLERGEN_FRUIT Sorry to break the news, chief. Honey is not a fruit. /datum/reagent/drink/lovepotion name = "Love Potion" @@ -2004,7 +2004,7 @@ glass_name = "Love Potion" glass_desc = "Love me tender, love me sweet." - allergen_type = FRUIT|DAIRY //Made from cream(dairy) and berryjuice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_DAIRY //Made from cream(dairy) and berryjuice(fruit) /datum/reagent/drink/oilslick name = "Oil Slick" @@ -2017,7 +2017,7 @@ glass_name = "Oil Slick" glass_desc = "A concoction that should probably be in an engine, rather than your stomach." glass_icon = DRINK_ICON_NOISY - allergen_type = VEGETABLE //Made from corn oil + allergen_type = ALLERGEN_VEGETABLE //Made from corn oil /datum/reagent/drink/slimeslammer name = "Slick Slimes Slammer" @@ -2030,7 +2030,7 @@ glass_name = "Slick Slime Slammer" glass_desc = "A concoction that should probably be in an engine, rather than your stomach. Still." glass_icon = DRINK_ICON_NOISY - allergen_type = VEGETABLE|SEEDS //Made from corn oil and peanutbutter + allergen_type = ALLERGEN_VEGETABLE|ALLERGEN_SEEDS //Made from corn oil and peanutbutter /datum/reagent/drink/eggnog name = "Eggnog" @@ -2041,7 +2041,7 @@ glass_name = "Eggnog" glass_desc = "You can't egg-nore the holiday cheer all around you" - allergen_type = DAIRY|EGGS //Eggnog is made with dairy and eggs. + allergen_type = ALLERGEN_DAIRY|ALLERGEN_EGGS //Eggnog is made with dairy and eggs. /datum/reagent/drink/nuclearwaste name = "Nuclear Waste" @@ -2055,7 +2055,7 @@ glass_desc = "Sadly, no super powers." glass_icon = DRINK_ICON_NOISY glass_special = list(DRINK_FIZZ) - allergen_type = VEGETABLE //Made from oilslick, so has the same allergens. + allergen_type = ALLERGEN_VEGETABLE //Made from oilslick, so has the same allergens. /datum/reagent/drink/nuclearwaste/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -2081,7 +2081,7 @@ glass_desc = "A pitiful sludge that looks vaguely like a soda.. if you look at it a certain way." glass_icon = DRINK_ICON_NOISY glass_special = list(DRINK_FIZZ) - allergen_type = VEGETABLE //Made from corn oil + allergen_type = ALLERGEN_VEGETABLE //Made from corn oil /datum/reagent/drink/sodaoil/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -2111,7 +2111,7 @@ glass_name = "mojito" glass_desc = "Mint, bubbly water, and citrus, made for sailing." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with lime juice + allergen_type = ALLERGEN_FRUIT //Made with lime juice /datum/reagent/drink/sexonthebeach name = "Virgin Sex On The Beach" @@ -2122,7 +2122,7 @@ glass_name = "sex on the beach" glass_desc = "A secret combination of orange juice and pomegranate." - allergen_type = FRUIT //Made with orange juice + allergen_type = ALLERGEN_FRUIT //Made with orange juice /datum/reagent/drink/driverspunch name = "Driver's Punch" @@ -2134,7 +2134,7 @@ glass_name = "driver`s punch" glass_desc = "A fruity punch!" glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with appleade and orange juice + allergen_type = ALLERGEN_FRUIT //Made with appleade and orange juice /datum/reagent/drink/mintapplesparkle name = "Mint Apple Sparkle" @@ -2146,7 +2146,7 @@ glass_name = "mint apple sparkle" glass_desc = "Delicious appleade with a touch of mint." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with appleade + allergen_type = ALLERGEN_FRUIT //Made with appleade /datum/reagent/drink/berrycordial name = "Berry Cordial" @@ -2158,7 +2158,7 @@ glass_name = "berry cordial" glass_desc = "How berry cordial of you." glass_icon = DRINK_ICON_NOISY - allergen_type = FRUIT //Made with berry and lemonjuice + allergen_type = ALLERGEN_FRUIT //Made with berry and lemonjuice /datum/reagent/drink/tropicalfizz name = "Tropical Fizz" @@ -2171,7 +2171,7 @@ glass_desc = "One sip and you're in the bahamas." glass_icon = DRINK_ICON_NOISY glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made with several fruit juices + allergen_type = ALLERGEN_FRUIT //Made with several fruit juices /datum/reagent/drink/fauxfizz name = "Faux Fizz" @@ -2184,7 +2184,7 @@ glass_desc = "One sip and you're in the bahamas... maybe." glass_icon = DRINK_ICON_NOISY glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //made with several fruit juices + allergen_type = ALLERGEN_FRUIT //made with several fruit juices /* Alcohol */ @@ -2214,7 +2214,7 @@ glass_name = "ale" glass_desc = "A freezing pint of delicious ale" - allergen_type = GRAINS //Barley is grain + allergen_type = ALLERGEN_GRAINS //Barley is grain /datum/reagent/ethanol/beer name = "Beer" @@ -2228,7 +2228,7 @@ glass_name = "beer" glass_desc = "A freezing pint of beer" - allergen_type = GRAINS //Made from grains + allergen_type = ALLERGEN_GRAINS //Made from grains /datum/reagent/ethanol/beer/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -2248,7 +2248,7 @@ glass_name = "lite beer" glass_desc = "A freezing pint of lite beer" - allergen_type = GRAINS //Made from grains + allergen_type = ALLERGEN_GRAINS //Made from grains /datum/reagent/ethanol/bluecuracao name = "Blue Curacao" @@ -2262,7 +2262,7 @@ glass_name = "blue curacao" glass_desc = "Exotically blue, fruity drink, distilled from oranges." - allergen_type = FRUIT //Made from oranges(fruit) + allergen_type = ALLERGEN_FRUIT //Made from oranges(fruit) /datum/reagent/ethanol/cognac name = "Cognac" @@ -2276,7 +2276,7 @@ glass_name = "cognac" glass_desc = "Damn, you feel like some kind of French aristocrat just by holding this." - allergen_type = FRUIT //Cognac is made from wine which is made from grapes. + allergen_type = ALLERGEN_FRUIT //Cognac is made from wine which is made from grapes. /datum/reagent/ethanol/deadrum name = "Deadrum" @@ -2318,12 +2318,12 @@ glass_name = "gin" glass_desc = "A crystal clear glass of Griffeater gin." - allergen_type = FRUIT //Made from juniper berries + allergen_type = ALLERGEN_FRUIT //Made from juniper berries //Base type for alchoholic drinks containing coffee /datum/reagent/ethanol/coffee overdose = 45 - allergen_type = COFFEE //Contains coffee or is made from coffee + allergen_type = ALLERGEN_COFFEE //Contains coffee or is made from coffee /datum/reagent/ethanol/coffee/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) if(alien == IS_DIONA) @@ -2375,7 +2375,7 @@ glass_name = "melon liquor" glass_desc = "A relatively sweet and fruity 46 proof liquor." - allergen_type = FRUIT //Made from watermelons + allergen_type = ALLERGEN_FRUIT //Made from watermelons /datum/reagent/ethanol/melonspritzer name = "Melon Spritzer" @@ -2389,7 +2389,7 @@ glass_desc = "Melons: Citrus style." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made from watermelon juice, apple juice, and lime juice + allergen_type = ALLERGEN_FRUIT //Made from watermelon juice, apple juice, and lime juice /datum/reagent/ethanol/rum name = "Rum" @@ -2425,7 +2425,7 @@ glass_name = "sex on the beach" glass_desc = "A concoction of vodka and a secret combination of orange juice and pomegranate." - allergen_type = FRUIT //Made from orange juice + allergen_type = ALLERGEN_FRUIT //Made from orange juice /datum/reagent/ethanol/tequila name = "Tequila" @@ -2470,7 +2470,7 @@ glass_name = "vermouth" glass_desc = "You wonder why you're even drinking this straight." - allergen_type = FRUIT //Vermouth is made from wine which is made from grapes(fruit) + allergen_type = ALLERGEN_FRUIT //Vermouth is made from wine which is made from grapes(fruit) /datum/reagent/ethanol/vodka name = "Vodka" @@ -2483,7 +2483,7 @@ glass_name = "vodka" glass_desc = "The glass contain wodka. Xynta." - allergen_type = GRAINS //Vodka is made from grains + allergen_type = ALLERGEN_GRAINS //Vodka is made from grains /datum/reagent/ethanol/vodka/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -2500,7 +2500,7 @@ glass_name = "whiskey" glass_desc = "The silky, smokey whiskey goodness inside the glass makes the drink look very classy." - allergen_type = GRAINS //Whiskey is also made from grain. + allergen_type = ALLERGEN_GRAINS //Whiskey is also made from grain. /datum/reagent/ethanol/wine name = "Wine" @@ -2513,7 +2513,7 @@ glass_name = "wine" glass_desc = "A very classy looking drink." - allergen_type = FRUIT //Wine is made from grapes (fruit) + allergen_type = ALLERGEN_FRUIT //Wine is made from grapes (fruit) /datum/reagent/ethanol/wine/champagne name = "Champagne" @@ -2525,7 +2525,7 @@ glass_name = "champagne" glass_desc = "An even classier looking drink." - allergen_type = FRUIT //Still wine, and still made from grapes (fruit) + allergen_type = ALLERGEN_FRUIT //Still wine, and still made from grapes (fruit) /datum/reagent/ethanol/cider name = "Cider" @@ -2539,7 +2539,7 @@ glass_desc = "The second most Irish drink." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made from fruit + allergen_type = ALLERGEN_FRUIT //Made from fruit // Cocktails @@ -2556,7 +2556,7 @@ glass_name = "Acid Spit" glass_desc = "A drink from the company archives. Made from live aliens." - allergen_type = FRUIT //Made from wine (fruit) + allergen_type = ALLERGEN_FRUIT //Made from wine (fruit) /datum/reagent/ethanol/alliescocktail name = "Allies Cocktail" @@ -2569,7 +2569,7 @@ glass_name = "Allies cocktail" glass_desc = "A drink made from your allies." - allergen_type = GRAINS|FRUIT //Made from vodka(grain) as well as martini(vermouth(fruit) and gin(fruit)) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from vodka(grain) as well as martini(vermouth(fruit) and gin(fruit)) /datum/reagent/ethanol/aloe name = "Aloe" @@ -2582,7 +2582,7 @@ glass_name = "Aloe" glass_desc = "Very, very, very good." - allergen_type = FRUIT|DAIRY|GRAINS //Made from cream(dairy), whiskey(grains), and watermelon juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_DAIRY|ALLERGEN_GRAINS //Made from cream(dairy), whiskey(grains), and watermelon juice(fruit) /datum/reagent/ethanol/amasec name = "Amasec" @@ -2596,7 +2596,7 @@ glass_name = "Amasec" glass_desc = "Always handy before combat!" - allergen_type = FRUIT|GRAINS //Made from wine(fruit) and vodka(grains) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from wine(fruit) and vodka(grains) /datum/reagent/ethanol/andalusia name = "Andalusia" @@ -2609,7 +2609,7 @@ glass_name = "Andalusia" glass_desc = "A nice, strange named drink." - allergen_type = GRAINS|FRUIT //Made from whiskey(grains) and lemonjuice (fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from whiskey(grains) and lemonjuice (fruit) /datum/reagent/ethanol/antifreeze name = "Anti-freeze" @@ -2624,7 +2624,7 @@ glass_name = "Anti-freeze" glass_desc = "The ultimate refreshment." - allergen_type = GRAINS|DAIRY //Made from vodka(grains) and cream(dairy) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_DAIRY //Made from vodka(grains) and cream(dairy) /datum/reagent/ethanol/atomicbomb name = "Atomic Bomb" @@ -2639,7 +2639,7 @@ glass_name = "Atomic Bomb" glass_desc = "We cannot take legal responsibility for your actions after imbibing." - allergen_type = COFFEE|DAIRY|FRUIT|GRAINS //Made from b52 which contains kahlua(coffee), cognac(fruit), and irish cream(Whiskey(grains),cream(dairy)) + allergen_type = ALLERGEN_COFFEE|ALLERGEN_DAIRY|ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from b52 which contains kahlua(coffee), cognac(fruit), and irish cream(Whiskey(grains),cream(dairy)) /datum/reagent/ethanol/coffee/b52 name = "B-52" @@ -2653,7 +2653,7 @@ glass_name = "B-52" glass_desc = "Kahlua, Irish cream, and cognac. You will get bombed." - allergen_type = COFFEE|DAIRY|FRUIT|GRAINS //Made from kahlua(coffee), cognac(fruit), and irish cream(Whiskey(grains),cream(dairy)) + allergen_type = ALLERGEN_COFFEE|ALLERGEN_DAIRY|ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from kahlua(coffee), cognac(fruit), and irish cream(Whiskey(grains),cream(dairy)) /datum/reagent/ethanol/bahama_mama name = "Bahama mama" @@ -2666,7 +2666,7 @@ glass_name = "Bahama Mama" glass_desc = "Tropical cocktail." - allergen_type = FRUIT //Made from orange juice and lime juice + allergen_type = ALLERGEN_FRUIT //Made from orange juice and lime juice /datum/reagent/ethanol/bananahonk name = "Banana Mama" @@ -2680,7 +2680,7 @@ glass_name = "Banana Honk" glass_desc = "A drink from Banana Heaven." - allergen_type = FRUIT|DAIRY //Made from banana juice(fruit) and cream(dairy) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_DAIRY //Made from banana juice(fruit) and cream(dairy) /datum/reagent/ethanol/barefoot name = "Barefoot" @@ -2693,7 +2693,7 @@ glass_name = "Barefoot" glass_desc = "Barefoot and pregnant." - allergen_type = DAIRY|FRUIT //Made from berry juice (fruit), cream(dairy), and vermouth(fruit) + allergen_type = ALLERGEN_DAIRY|ALLERGEN_FRUIT //Made from berry juice (fruit), cream(dairy), and vermouth(fruit) /datum/reagent/ethanol/beepsky_smash name = "Beepsky Smash" @@ -2708,7 +2708,7 @@ glass_name = "Beepsky Smash" glass_desc = "Heavy, hot and strong. Just like the Iron fist of the LAW." - allergen_type = FRUIT|GRAINS //Made from whiskey(grains), and limejuice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from whiskey(grains), and limejuice(fruit) /datum/reagent/ethanol/beepsky_smash/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -2726,7 +2726,7 @@ glass_name = "bilk" glass_desc = "A brew of milk and beer. For those alcoholics who fear osteoporosis." - allergen_type = GRAINS|DAIRY //Made from milk(dairy) and beer(grains) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_DAIRY //Made from milk(dairy) and beer(grains) /datum/reagent/ethanol/black_russian name = "Black Russian" @@ -2739,7 +2739,7 @@ glass_name = "Black Russian" glass_desc = "For the lactose-intolerant. Still as classy as a White Russian." - allergen_type = COFFEE|GRAINS //Made from vodka(grains) and kahlua(coffee) + allergen_type = ALLERGEN_COFFEE|ALLERGEN_GRAINS //Made from vodka(grains) and kahlua(coffee) /datum/reagent/ethanol/bloody_mary name = "Bloody Mary" @@ -2752,7 +2752,7 @@ glass_name = "Bloody Mary" glass_desc = "Tomato juice, mixed with Vodka and a lil' bit of lime. Tastes like liquid murder." - allergen_type = GRAINS|FRUIT //Made from vodka (grains), tomato juice(fruit), and lime juice(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from vodka (grains), tomato juice(fruit), and lime juice(fruit) /datum/reagent/ethanol/booger name = "Booger" @@ -2765,7 +2765,7 @@ glass_name = "Booger" glass_desc = "Ewww..." - allergen_type = DAIRY|FRUIT //Made from cream(dairy), banana juice(fruit), and watermelon juice(fruit) + allergen_type = ALLERGEN_DAIRY|ALLERGEN_FRUIT //Made from cream(dairy), banana juice(fruit), and watermelon juice(fruit) /datum/reagent/ethanol/coffee/brave_bull //Since it's under the /coffee subtype, it already has coffee allergens. name = "Brave Bull" @@ -2790,7 +2790,7 @@ glass_name = "Changeling Sting" glass_desc = "A stingy drink." - allergen_type = FRUIT|GRAINS //Made from screwdriver(vodka(grains), orange juice(fruit)), lime juice(fruit), and lemon juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from screwdriver(vodka(grains), orange juice(fruit)), lime juice(fruit), and lemon juice(fruit) /datum/reagent/ethanol/martini name = "Classic Martini" @@ -2803,7 +2803,7 @@ glass_name = "classic martini" glass_desc = "Damn, the bartender even stirred it, not shook it." - allergen_type = FRUIT //Made from gin(fruit) and vermouth(fruit) + allergen_type = ALLERGEN_FRUIT //Made from gin(fruit) and vermouth(fruit) /datum/reagent/ethanol/cuba_libre name = "Cuba Libre" @@ -2827,7 +2827,7 @@ glass_name = "Demons' Blood" glass_desc = "Just looking at this thing makes the hair on the back of your neck stand up." - allergen_type = FRUIT //Made from space mountain wind(fruit) + allergen_type = ALLERGEN_FRUIT //Made from space mountain wind(fruit) /datum/reagent/ethanol/devilskiss name = "Devils Kiss" @@ -2839,7 +2839,7 @@ glass_name = "Devil's Kiss" glass_desc = "Creepy time!" - allergen_type = COFFEE //Made from kahlua (Coffee) + allergen_type = ALLERGEN_COFFEE //Made from kahlua (Coffee) /datum/reagent/ethanol/driestmartini name = "Driest Martini" @@ -2852,7 +2852,7 @@ glass_name = "Driest Martini" glass_desc = "Only for the experienced. You think you see sand floating in the glass." - allergen_type = FRUIT //Made from gin(fruit) + allergen_type = ALLERGEN_FRUIT //Made from gin(fruit) /datum/reagent/ethanol/ginfizz name = "Gin Fizz" @@ -2865,7 +2865,7 @@ glass_name = "gin fizz" glass_desc = "Refreshingly lemony, deliciously dry." - allergen_type = FRUIT //Made from gin(fruit) and lime juice(fruit) + allergen_type = ALLERGEN_FRUIT //Made from gin(fruit) and lime juice(fruit) /datum/reagent/ethanol/grog name = "Grog" @@ -2890,7 +2890,7 @@ glass_name = "Erika Surprise" glass_desc = "The surprise is, it's green!" - allergen_type = GRAINS|FRUIT //Made from ale (grains), lime juice (fruit), whiskey(grains), banana juice(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from ale (grains), lime juice (fruit), whiskey(grains), banana juice(fruit) /datum/reagent/ethanol/gargle_blaster name = "Pan-Galactic Gargle Blaster" @@ -2906,7 +2906,7 @@ glass_name = "Pan-Galactic Gargle Blaster" glass_desc = "Does... does this mean that Arthur and Ford are on the station? Oh joy." - allergen_type = FRUIT|GRAINS //Made from vodka(grains), gin(fruit), whiskey(grains), cognac(fruit), and lime juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from vodka(grains), gin(fruit), whiskey(grains), cognac(fruit), and lime juice(fruit) /datum/reagent/ethanol/gintonic name = "Gin and Tonic" @@ -2919,7 +2919,7 @@ glass_name = "gin and tonic" glass_desc = "A mild but still great cocktail. Drink up, like a true Englishman." - allergen_type = FRUIT //Made from gin(fruit) + allergen_type = ALLERGEN_FRUIT //Made from gin(fruit) /datum/reagent/ethanol/goldschlager name = "Goldschlager" @@ -2933,7 +2933,7 @@ glass_name = "Goldschlager" glass_desc = "100 proof that teen girls will drink anything with gold in it." - allergen_type = GRAINS //Made from vodka(grains) + allergen_type = ALLERGEN_GRAINS //Made from vodka(grains) /datum/reagent/ethanol/hippies_delight name = "Hippies' Delight" @@ -2948,7 +2948,7 @@ glass_name = "Hippie's Delight" glass_desc = "A drink enjoyed by people during the 1960's." - allergen_type = FRUIT|GRAINS //Made from gargle blaster which contains vodka(grains), gin(fruit), whiskey(grains), cognac(fruit), and lime juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from gargle blaster which contains vodka(grains), gin(fruit), whiskey(grains), cognac(fruit), and lime juice(fruit) //Also, yes. Mushrooms produce psilocybin; however, it's also still just a chemical compound, and not necessarily going to trigger a fungi allergy. /datum/reagent/ethanol/hooch @@ -2976,7 +2976,7 @@ glass_name = "iced beer" glass_desc = "A beer so frosty, the air around it freezes." glass_special = list(DRINK_ICE) - allergen_type = GRAINS //Made from beer(grains) + allergen_type = ALLERGEN_GRAINS //Made from beer(grains) /datum/reagent/ethanol/irishcarbomb name = "Irish Car Bomb" @@ -2989,7 +2989,7 @@ glass_name = "Irish Car Bomb" glass_desc = "An irish car bomb." - allergen_type = DAIRY|GRAINS //Made from ale(grains) and irish cream(whiskey(grains), cream(dairy)) + allergen_type = ALLERGEN_DAIRY|ALLERGEN_GRAINS //Made from ale(grains) and irish cream(whiskey(grains), cream(dairy)) /datum/reagent/ethanol/coffee/irishcoffee name = "Irish Coffee" @@ -3002,7 +3002,7 @@ glass_name = "Irish coffee" glass_desc = "Coffee and alcohol. More fun than a Mimosa to drink in the morning." - allergen_type = COFFEE|DAIRY|GRAINS //Made from Coffee(coffee) and irish cream(whiskey(grains), cream(dairy)) + allergen_type = ALLERGEN_COFFEE|ALLERGEN_DAIRY|ALLERGEN_GRAINS //Made from Coffee(coffee) and irish cream(whiskey(grains), cream(dairy)) /datum/reagent/ethanol/irish_cream name = "Irish Cream" @@ -3015,7 +3015,7 @@ glass_name = "Irish cream" glass_desc = "It's cream, mixed with whiskey. What else would you expect from the Irish?" - allergen_type = DAIRY|GRAINS //Made from cream(dairy) and whiskey(grains) + allergen_type = ALLERGEN_DAIRY|ALLERGEN_GRAINS //Made from cream(dairy) and whiskey(grains) /datum/reagent/ethanol/longislandicedtea name = "Long Island Iced Tea" @@ -3028,7 +3028,7 @@ glass_name = "Long Island iced tea" glass_desc = "The liquor cabinet, brought together in a delicious mix. Intended for middle-aged alcoholic women only." - allergen_type = GRAINS|FRUIT //Made from vodka(grains) and gin(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from vodka(grains) and gin(fruit) /datum/reagent/ethanol/manhattan name = "Manhattan" @@ -3041,7 +3041,7 @@ glass_name = "Manhattan" glass_desc = "The Detective's undercover drink of choice. He never could stomach gin..." - allergen_type = GRAINS|FRUIT //Made from whiskey(grains), and vermouth(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from whiskey(grains), and vermouth(fruit) /datum/reagent/ethanol/manhattan_proj name = "Manhattan Project" @@ -3054,7 +3054,7 @@ glass_name = "Manhattan Project" glass_desc = "A scientist's drink of choice, for thinking how to blow up the station." - allergen_type = GRAINS|FRUIT //Made from manhattan which is made from whiskey(grains), and vermouth(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from manhattan which is made from whiskey(grains), and vermouth(fruit) /datum/reagent/ethanol/manly_dorf name = "The Manly Dorf" @@ -3067,7 +3067,7 @@ glass_name = "The Manly Dorf" glass_desc = "A manly concotion made from Ale and Beer. Intended for true men only." - allergen_type = GRAINS //Made from beer(grains) and ale(grains) + allergen_type = ALLERGEN_GRAINS //Made from beer(grains) and ale(grains) /datum/reagent/ethanol/margarita name = "Margarita" @@ -3080,7 +3080,7 @@ glass_name = "margarita" glass_desc = "On the rocks with salt on the rim. Arriba~!" - allergen_type = FRUIT //Made from lime juice(fruit) + allergen_type = ALLERGEN_FRUIT //Made from lime juice(fruit) /datum/reagent/ethanol/mead name = "Mead" @@ -3121,7 +3121,7 @@ glass_icon = DRINK_ICON_NOISY glass_special = list("neuroright") - allergen_type = FRUIT|GRAINS //Made from gargle blaster which is made from vodka(grains), gin(fruit), whiskey(grains), cognac(fruit), and lime juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from gargle blaster which is made from vodka(grains), gin(fruit), whiskey(grains), cognac(fruit), and lime juice(fruit) /datum/reagent/ethanol/neurotoxin/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -3149,7 +3149,7 @@ glass_name = "???" glass_desc = "A black ichor with an oily purple sheer on top. Are you sure you should drink this?" - allergen_type = FRUIT //Made from berries which are fruit + allergen_type = ALLERGEN_FRUIT //Made from berries which are fruit /datum/reagent/ethanol/pwine/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -3188,7 +3188,7 @@ glass_name = "Sbiten" glass_desc = "A spicy mix of Vodka and Spice. Very hot." - allergen_type = GRAINS //Made from vodka(grains) + allergen_type = ALLERGEN_GRAINS //Made from vodka(grains) /datum/reagent/ethanol/screwdrivercocktail name = "Screwdriver" @@ -3201,7 +3201,7 @@ glass_name = "Screwdriver" glass_desc = "A simple, yet superb mixture of Vodka and orange juice. Just the thing for the tired engineer." - allergen_type = FRUIT|GRAINS //Made from vodka(grains) and orange juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from vodka(grains) and orange juice(fruit) /datum/reagent/ethanol/silencer name = "Silencer" @@ -3215,7 +3215,7 @@ glass_name = "Silencer" glass_desc = "A drink from mime Heaven." - allergen_type = DAIRY //Made from cream (dairy) + allergen_type = ALLERGEN_DAIRY //Made from cream (dairy) /datum/reagent/ethanol/singulo name = "Singulo" @@ -3228,7 +3228,7 @@ glass_name = "Singulo" glass_desc = "A blue-space beverage." - allergen_type = GRAINS|FRUIT //Made from vodka(grains) and wine(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from vodka(grains) and wine(fruit) /datum/reagent/ethanol/snowwhite name = "Snow White" @@ -3241,7 +3241,7 @@ glass_name = "Snow White" glass_desc = "A cold refreshment." - allergen_type = COFFEE|FRUIT //made from Pineapple juice(fruit), lemon_lime(fruit), and kahlua(coffee) + allergen_type = ALLERGEN_COFFEE|ALLERGEN_FRUIT //made from Pineapple juice(fruit), lemon_lime(fruit), and kahlua(coffee) /datum/reagent/ethanol/suidream name = "Sui Dream" @@ -3254,7 +3254,7 @@ glass_name = "Sui Dream" glass_desc = "A froofy, fruity, and sweet mixed drink. Understanding the name only brings shame." - allergen_type = FRUIT //Made from blue curacao(fruit) and melon liquor(fruit) + allergen_type = ALLERGEN_FRUIT //Made from blue curacao(fruit) and melon liquor(fruit) /datum/reagent/ethanol/syndicatebomb name = "Syndicate Bomb" @@ -3267,7 +3267,7 @@ glass_name = "Syndicate Bomb" glass_desc = "Tastes like terrorism!" - allergen_type = GRAINS //Made from beer(grain) and whiskeycola(whiskey(grain)) + allergen_type = ALLERGEN_GRAINS //Made from beer(grain) and whiskeycola(whiskey(grain)) /datum/reagent/ethanol/tequilla_sunrise name = "Tequila Sunrise" @@ -3292,7 +3292,7 @@ glass_name = "Three Mile Island iced tea" glass_desc = "A glass of this is sure to prevent a meltdown." - allergen_type = GRAINS|FRUIT //Made from long island iced tea(vodka(grains) and gin(fruit)) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from long island iced tea(vodka(grains) and gin(fruit)) /datum/reagent/ethanol/toxins_special name = "Toxins Special" @@ -3308,7 +3308,7 @@ glass_name = "Toxins Special" glass_desc = "Whoah, this thing is on fire!" - allergen_type = FRUIT //Made from vermouth(fruit) + allergen_type = ALLERGEN_FRUIT //Made from vermouth(fruit) /datum/reagent/ethanol/vodkamartini name = "Vodka Martini" @@ -3321,7 +3321,7 @@ glass_name = "vodka martini" glass_desc ="A bastardization of the classic martini. Still great." - allergen_type = GRAINS|FRUIT //made from vodka(grains) and vermouth(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //made from vodka(grains) and vermouth(fruit) /datum/reagent/ethanol/vodkatonic name = "Vodka and Tonic" @@ -3334,7 +3334,7 @@ glass_name = "vodka and tonic" glass_desc = "For when a gin and tonic isn't Russian enough." - allergen_type = GRAINS //Made from vodka(grains) + allergen_type = ALLERGEN_GRAINS //Made from vodka(grains) /datum/reagent/ethanol/white_russian name = "White Russian" @@ -3347,7 +3347,7 @@ glass_name = "White Russian" glass_desc = "A very nice looking drink. But that's just, like, your opinion, man." - allergen_type = COFFEE|GRAINS|DAIRY //Made from black russian(vodka(grains), kahlua(coffee)) and cream(dairy) + allergen_type = ALLERGEN_COFFEE|ALLERGEN_GRAINS|ALLERGEN_DAIRY //Made from black russian(vodka(grains), kahlua(coffee)) and cream(dairy) /datum/reagent/ethanol/whiskey_cola name = "Whiskey Cola" @@ -3360,7 +3360,7 @@ glass_name = "whiskey cola" glass_desc = "An innocent-looking mixture of cola and Whiskey. Delicious." - allergen_type = GRAINS //Made from whiskey(grains) + allergen_type = ALLERGEN_GRAINS //Made from whiskey(grains) /datum/reagent/ethanol/whiskeysoda name = "Whiskey Soda" @@ -3373,7 +3373,7 @@ glass_name = "whiskey soda" glass_desc = "Ultimate refreshment." - allergen_type = GRAINS //Made from whiskey(grains) + allergen_type = ALLERGEN_GRAINS //Made from whiskey(grains) /datum/reagent/ethanol/specialwhiskey // I have no idea what this is and where it comes from name = "Special Blend Whiskey" @@ -3386,7 +3386,7 @@ glass_name = "special blend whiskey" glass_desc = "Just when you thought regular station whiskey was good... This silky, amber goodness has to come along and ruin everything." - allergen_type = GRAINS //Whiskey(grains) + allergen_type = ALLERGEN_GRAINS //Whiskey(grains) /datum/reagent/ethanol/unathiliquor name = "Redeemer's Brew" @@ -3424,7 +3424,7 @@ glass_name = "Sake Bomb" glass_desc = "Some sake mixed into a pint of beer." - allergen_type = GRAINS //Made from beer(grains) + allergen_type = ALLERGEN_GRAINS //Made from beer(grains) /datum/reagent/ethanol/tamagozake name = "Tamagozake" @@ -3437,7 +3437,7 @@ glass_name = "Tamagozake" glass_desc = "An egg cracked into sake and sugar." - allergen_type = EGGS //Made with eggs + allergen_type = ALLERGEN_EGGS //Made with eggs /datum/reagent/ethanol/ginzamary name = "Ginza Mary" @@ -3450,7 +3450,7 @@ glass_name = "Ginza Mary" glass_desc = "Tomato juice, vodka, and sake make something not quite completely unlike a Bloody Mary." - allergen_type = FRUIT|GRAINS //Made from vodka(grains) and tomatojuice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from vodka(grains) and tomatojuice(fruit) /datum/reagent/ethanol/tokyorose name = "Tokyo Rose" @@ -3463,7 +3463,7 @@ glass_name = "Tokyo Rose" glass_desc = "It's kinda pretty!" - allergen_type = FRUIT //Made from berryjuice + allergen_type = ALLERGEN_FRUIT //Made from berryjuice /datum/reagent/ethanol/saketini name = "Saketini" @@ -3476,7 +3476,7 @@ glass_name = "Saketini" glass_desc = "What are you doing drinking this outside of New Kyoto?" - allergen_type = FRUIT //Made from gin(fruit) + allergen_type = ALLERGEN_FRUIT //Made from gin(fruit) /datum/reagent/ethanol/coffee/elysiumfacepunch name = "Elysium Facepunch" @@ -3489,7 +3489,7 @@ glass_name = "Elysium Facepunch" glass_desc = "A loathesome cocktail favored by Heaven's skeleton shift workers." - allergen_type = COFFEE|FRUIT //Made from kahlua(Coffee) and lemonjuice(fruit) + allergen_type = ALLERGEN_COFFEE|ALLERGEN_FRUIT //Made from kahlua(Coffee) and lemonjuice(fruit) /datum/reagent/ethanol/erebusmoonrise name = "Erebus Moonrise" @@ -3502,7 +3502,7 @@ glass_name = "Erebus Moonrise" glass_desc = "A deeply alcoholic mix, popular in Nyx." - allergen_type = GRAINS //Made from whiskey(grains) and Vodka(grains) + allergen_type = ALLERGEN_GRAINS //Made from whiskey(grains) and Vodka(grains) /datum/reagent/ethanol/balloon name = "Balloon" @@ -3515,7 +3515,7 @@ glass_name = "Balloon" glass_desc = "A strange drink invented in the aerostats of Venus." - allergen_type = DAIRY|FRUIT //Made from blue curacao(fruit) and cream(dairy) + allergen_type = ALLERGEN_DAIRY|ALLERGEN_FRUIT //Made from blue curacao(fruit) and cream(dairy) /datum/reagent/ethanol/natunabrandy name = "Natuna Brandy" @@ -3529,7 +3529,7 @@ glass_desc = "On Natuna, they do the best with what they have." glass_special = list(DRINK_FIZZ) - allergen_type = GRAINS //Made from beer(grains) + allergen_type = ALLERGEN_GRAINS //Made from beer(grains) /datum/reagent/ethanol/euphoria name = "Euphoria" @@ -3542,7 +3542,7 @@ glass_name = "Euphoria" glass_desc = "Invented by a Eutopian marketing team, this is one of the most expensive cocktails in existence." - allergen_type = GRAINS|FRUIT //Made from specialwhiskey(grain) and cognac(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from specialwhiskey(grain) and cognac(fruit) /datum/reagent/ethanol/xanaducannon name = "Xanadu Cannon" @@ -3555,7 +3555,7 @@ glass_name = "Xanadu Cannon" glass_desc = "Common in the entertainment districts of Titan." - allergen_type = GRAINS //Made from ale(grain) + allergen_type = ALLERGEN_GRAINS //Made from ale(grain) /datum/reagent/ethanol/debugger name = "Debugger" @@ -3567,7 +3567,7 @@ glass_name = "Debugger" glass_desc = "From Shelf. Not for human consumption." - allergen_type = VEGETABLE //Made from corn oil(vegetable) + allergen_type = ALLERGEN_VEGETABLE //Made from corn oil(vegetable) /datum/reagent/ethanol/spacersbrew name = "Spacer's Brew" @@ -3580,7 +3580,7 @@ glass_name = "Spacer's Brew" glass_desc = "Ethanol and orange soda. A common emergency drink on frontier colonies." - allergen_type = FRUIT //Made from brownstar(orange juice(fruit)) + allergen_type = ALLERGEN_FRUIT //Made from brownstar(orange juice(fruit)) /datum/reagent/ethanol/binmanbliss name = "Binman Bliss" @@ -3604,7 +3604,7 @@ glass_name = "Chrysanthemum" glass_desc = "An exotic cocktail from New Kyoto." - allergen_type = FRUIT //Made from melon liquor(fruit) + allergen_type = ALLERGEN_FRUIT //Made from melon liquor(fruit) /datum/reagent/ethanol/bitters name = "Bitters" @@ -3628,7 +3628,7 @@ glass_name = "Soemmer Fire" glass_desc = "A painfully hot mixed drink, for when you absolutely need to hurt right now." - allergen_type = GRAINS|FRUIT //Made from manhattan(whiskey(grains), vermouth(fruit)) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from manhattan(whiskey(grains), vermouth(fruit)) /datum/reagent/drink/soemmerfire/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -3647,7 +3647,7 @@ glass_name = "Wine Brandy" glass_desc = "A very classy looking after-dinner drink." - allergen_type = FRUIT //Made from wine, which is made from fruit + allergen_type = ALLERGEN_FRUIT //Made from wine, which is made from fruit /datum/reagent/ethanol/morningafter name = "Morning After" @@ -3660,7 +3660,7 @@ glass_name = "Morning After" glass_desc = "The finest hair of the dog, coming up!" - allergen_type = GRAINS|COFFEE //Made from sbiten(vodka(grain)) and coffee(coffee) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_COFFEE //Made from sbiten(vodka(grain)) and coffee(coffee) /datum/reagent/ethanol/vesper name = "Vesper" @@ -3673,7 +3673,7 @@ glass_name = "Vesper" glass_desc = "A dry martini, ice cold and well shaken." - allergen_type = FRUIT|GRAINS //Made from wine(fruit), vodka(grain), and gin(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from wine(fruit), vodka(grain), and gin(fruit) /datum/reagent/ethanol/rotgut name = "Rotgut Fever Dream" @@ -3686,7 +3686,7 @@ glass_name = "Rotgut Fever Dream" glass_desc = "Why are you doing this to yourself?" - allergen_type = GRAINS //Made from whiskey(grains) and vodka(grains) + allergen_type = ALLERGEN_GRAINS //Made from whiskey(grains) and vodka(grains) /datum/reagent/ethanol/voxdelight name = "Vox's Delight" @@ -3719,7 +3719,7 @@ glass_name = "Screaming Viking" glass_desc = "A boozy, citrus-packed brew." - allergen_type = FRUIT|GRAINS //Made from martini(gin(fruit), vermouth(fruit)), vodka tonic(vodka(grain)), and lime juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from martini(gin(fruit), vermouth(fruit)), vodka tonic(vodka(grain)), and lime juice(fruit) /datum/reagent/ethanol/robustin name = "Robustin" @@ -3732,7 +3732,7 @@ glass_name = "Robustin" glass_desc = "A bootleg brew of all the worst things on station." - allergen_type = GRAINS|DAIRY //Made from antifreeze(vodka(grains),cream(dairy)) and vodka(grains) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_DAIRY //Made from antifreeze(vodka(grains),cream(dairy)) and vodka(grains) /datum/reagent/ethanol/virginsip name = "Virgin Sip" @@ -3745,7 +3745,7 @@ glass_name = "Virgin Sip" glass_desc = "A perfect martini, watered down and ruined." - allergen_type = FRUIT //Made from driest martini(gin(fruit)) + allergen_type = ALLERGEN_FRUIT //Made from driest martini(gin(fruit)) /datum/reagent/ethanol/jellyshot name = "Jelly Shot" @@ -3758,7 +3758,7 @@ glass_name = "Jelly Shot" glass_desc = "A thick and vibrant alcoholic gel, perfect for the night life." - allergen_type = FRUIT|GRAINS //Made from cherry jelly(fruit), and vodka(grains) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from cherry jelly(fruit), and vodka(grains) /datum/reagent/ethanol/slimeshot name = "Named Bullet" @@ -3771,7 +3771,7 @@ glass_name = "Named Bullet" glass_desc = "A thick slime jelly shot. You can feel your death approaching." - allergen_type = GRAINS //Made from vodka(grains) + allergen_type = ALLERGEN_GRAINS //Made from vodka(grains) /datum/reagent/drink/slimeshot/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -3790,7 +3790,7 @@ glass_name = "Clover Club" glass_desc = "A light and refreshing raspberry cocktail." - allergen_type = FRUIT //Made from berry juice(fruit), lemon juice(fruit), and gin(fruit) + allergen_type = ALLERGEN_FRUIT //Made from berry juice(fruit), lemon juice(fruit), and gin(fruit) /datum/reagent/ethanol/negroni name = "Negroni" @@ -3803,7 +3803,7 @@ glass_name = "Negroni" glass_desc = "A dark, complicated blend, perfect for relaxing nights by the fire." - allergen_type = FRUIT //Made from gin(fruit) and vermouth(fruit) + allergen_type = ALLERGEN_FRUIT //Made from gin(fruit) and vermouth(fruit) /datum/reagent/ethanol/whiskeysour name = "Whiskey Sour" @@ -3816,7 +3816,7 @@ glass_name = "Whiskey Sour" glass_desc = "A smokey, refreshing lemoned whiskey." - allergen_type = GRAINS|FRUIT //Made from whiskey(grains) and lemon juice(fruit) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_FRUIT //Made from whiskey(grains) and lemon juice(fruit) /datum/reagent/ethanol/oldfashioned name = "Old Fashioned" @@ -3829,7 +3829,7 @@ glass_name = "Old Fashioned" glass_desc = "A classic mix of whiskey and sugar... simple and direct." - allergen_type = GRAINS //Made from whiskey(grains) + allergen_type = ALLERGEN_GRAINS //Made from whiskey(grains) /datum/reagent/ethanol/daiquiri name = "Daiquiri" @@ -3842,7 +3842,7 @@ glass_name = "Daiquiri" glass_desc = "Refeshing rum and citrus. Time for a tropical get away." - allergen_type = FRUIT //Made from lime juice(fruit) + allergen_type = ALLERGEN_FRUIT //Made from lime juice(fruit) /datum/reagent/ethanol/mojito name = "Mojito" @@ -3856,7 +3856,7 @@ glass_desc = "Minty rum and citrus, made for sailing." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made from lime juice(fruit) + allergen_type = ALLERGEN_FRUIT //Made from lime juice(fruit) /datum/reagent/ethanol/paloma name = "Paloma" @@ -3870,7 +3870,7 @@ glass_desc = "Tequila and citrus, iced just right..." glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made from orange juice(fruit) + allergen_type = ALLERGEN_FRUIT //Made from orange juice(fruit) /datum/reagent/ethanol/piscosour name = "Pisco Sour" @@ -3883,7 +3883,7 @@ glass_name = "Pisco Sour" glass_desc = "South American bliss, served ice cold." - allergen_type = FRUIT //Made from wine brandy(fruit), and lemon juice(fruit) + allergen_type = ALLERGEN_FRUIT //Made from wine brandy(fruit), and lemon juice(fruit) /datum/reagent/ethanol/coldfront name = "Cold Front" @@ -3898,7 +3898,7 @@ glass_name = "Cold Front" glass_desc = "Minty, rich, and painfully cold. It's a blizzard in a cup." - allergen_type = COFFEE //Made from iced coffee(coffee) + allergen_type = ALLERGEN_COFFEE //Made from iced coffee(coffee) /datum/reagent/ethanol/mintjulep name = "Mint Julep" @@ -3935,7 +3935,7 @@ glass_desc = "The glass is barely able to contain the wodka. Xynta." glass_special = list(DRINK_FIZZ) - allergen_type = GRAINS //Made from vodka(grain) + allergen_type = ALLERGEN_GRAINS //Made from vodka(grain) /datum/reagent/ethanol/godka/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() @@ -3965,7 +3965,7 @@ glass_desc = "A very pious looking drink." glass_icon = DRINK_ICON_NOISY - allergen_type = FRUIT //Made from grapes(fruit) + allergen_type = ALLERGEN_FRUIT //Made from grapes(fruit) /datum/reagent/ethanol/holy_mary name = "Holy Mary" @@ -3978,7 +3978,7 @@ glass_name = "Holy Mary" glass_desc = "Angel's Ichor, mixed with Vodka and a lil' bit of lime. Tastes like liquid ascension." - allergen_type = FRUIT|GRAINS //Made from vodka(grain), holy wine(fruit), and lime juice(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from vodka(grain), holy wine(fruit), and lime juice(fruit) /datum/reagent/ethanol/angelswrath name = "Angels Wrath" @@ -3994,7 +3994,7 @@ glass_icon = DRINK_ICON_NOISY glass_special = list(DRINK_FIZZ) - allergen_type = FRUIT //Made from space mountain wind(fruit), and holy wine(fruit) + allergen_type = ALLERGEN_FRUIT //Made from space mountain wind(fruit), and holy wine(fruit) /datum/reagent/ethanol/angelskiss name = "Angels Kiss" @@ -4007,7 +4007,7 @@ glass_name = "Angel's Kiss" glass_desc = "Miracle time!" - allergen_type = FRUIT|COFFEE //Made from holy wine(fruit), and kahlua(coffee) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_COFFEE //Made from holy wine(fruit), and kahlua(coffee) /datum/reagent/ethanol/ichor_mead name = "Ichor Mead" @@ -4020,7 +4020,7 @@ glass_name = "Ichor Mead" glass_desc = "A trip to Valhalla." - allergen_type = FRUIT //Made from holy wine(fruit) + allergen_type = ALLERGEN_FRUIT //Made from holy wine(fruit) /datum/reagent/ethanol/schnapps_pep name = "Peppermint Schnapps" @@ -4044,7 +4044,7 @@ glass_name = "peach schnapps" glass_desc = "A glass of peach schnapps. It seems like it'd be better, mixed." - allergen_type = FRUIT //Made from peach(fruit) + allergen_type = ALLERGEN_FRUIT //Made from peach(fruit) /datum/reagent/ethanol/schnapps_lem name = "Lemonade Schnapps" @@ -4057,7 +4057,7 @@ glass_name = "lemonade schnapps" glass_desc = "A glass of lemonade schnapps. It seems like it'd be better, mixed." - allergen_type = FRUIT //Made from lemons(fruit) + allergen_type = ALLERGEN_FRUIT //Made from lemons(fruit) /datum/reagent/ethanol/jager name = "Schuss Konig" @@ -4081,7 +4081,7 @@ glass_name = "fusionnaire" glass_desc = "A relatively new cocktail, mostly served in the bars of NanoTrasen owned stations." - allergen_type = FRUIT|GRAINS //Made from lemon juice(fruit), vodka(grains), and lemon schnapps(fruit) + allergen_type = ALLERGEN_FRUIT|ALLERGEN_GRAINS //Made from lemon juice(fruit), vodka(grains), and lemon schnapps(fruit) /datum/reagent/ethanol/deathbell name = "Deathbell" @@ -4097,7 +4097,7 @@ glass_name = "Deathbell" glass_desc = "The perfect blend of the most alcoholic things a bartender can get their hands on." - allergen_type = GRAINS|DAIRY|FRUIT //Made from antifreeze(vodka(grains),cream(dairy)), gargleblaster(vodka(grains),gin(fruit),whiskey(grains),cognac(fruit),lime juice(fruit)), and syndicate bomb(beer(grain),whiskeycola(whiskey(grain))) + allergen_type = ALLERGEN_GRAINS|ALLERGEN_DAIRY|ALLERGEN_FRUIT //Made from antifreeze(vodka(grains),cream(dairy)), gargleblaster(vodka(grains),gin(fruit),whiskey(grains),cognac(fruit),lime juice(fruit)), and syndicate bomb(beer(grain),whiskeycola(whiskey(grain))) /datum/reagent/ethanol/deathbell/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) ..() diff --git a/code/modules/reagents/reagents/toxins.dm b/code/modules/reagents/reagents/toxins.dm index 0ea989228a..dde7bf21a9 100644 --- a/code/modules/reagents/reagents/toxins.dm +++ b/code/modules/reagents/reagents/toxins.dm @@ -946,7 +946,7 @@ metabolism = REM * 0.5 overdose = REAGENTS_OVERDOSE -datum/reagent/talum_quem/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) +/datum/reagent/talum_quem/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) if(alien == IS_DIONA) return diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index d30920cd85..c40fc18ab9 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -590,146 +590,146 @@ // initialize a holder from the contents of a disposal unit - proc/init(var/obj/machinery/disposal/D, var/datum/gas_mixture/flush_gas) - gas = flush_gas// transfer gas resv. into holder object -- let's be explicit about the data this proc consumes, please. +/obj/structure/disposalholder/proc/init(var/obj/machinery/disposal/D, var/datum/gas_mixture/flush_gas) + gas = flush_gas// transfer gas resv. into holder object -- let's be explicit about the data this proc consumes, please. - //Check for any living mobs trigger hasmob. - //hasmob effects whether the package goes to cargo or its tagged destination. - for(var/mob/living/M in D) - if(M && M.stat != 2 && !istype(M,/mob/living/silicon/robot/drone)) - hasmob = 1 + //Check for any living mobs trigger hasmob. + //hasmob effects whether the package goes to cargo or its tagged destination. + for(var/mob/living/M in D) + if(M && M.stat != 2 && !istype(M,/mob/living/silicon/robot/drone)) + hasmob = 1 - //Checks 1 contents level deep. This means that players can be sent through disposals... - //...but it should require a second person to open the package. (i.e. person inside a wrapped locker) - for(var/obj/O in D) - if(O.contents) - for(var/mob/living/M in O.contents) - if(M && M.stat != 2 && !istype(M,/mob/living/silicon/robot/drone)) - hasmob = 1 + //Checks 1 contents level deep. This means that players can be sent through disposals... + //...but it should require a second person to open the package. (i.e. person inside a wrapped locker) + for(var/obj/O in D) + if(O.contents) + for(var/mob/living/M in O.contents) + if(M && M.stat != 2 && !istype(M,/mob/living/silicon/robot/drone)) + hasmob = 1 - // now everything inside the disposal gets put into the holder - // note AM since can contain mobs or objs - for(var/atom/movable/AM in D) - AM.forceMove(src) - if(istype(AM, /obj/structure/bigDelivery) && !hasmob) - var/obj/structure/bigDelivery/T = AM - src.destinationTag = T.sortTag - if(istype(AM, /obj/item/smallDelivery) && !hasmob) - var/obj/item/smallDelivery/T = AM - src.destinationTag = T.sortTag - //Drones can mail themselves through maint. - if(istype(AM, /mob/living/silicon/robot/drone)) - var/mob/living/silicon/robot/drone/drone = AM - src.destinationTag = drone.mail_destination + // now everything inside the disposal gets put into the holder + // note AM since can contain mobs or objs + for(var/atom/movable/AM in D) + AM.forceMove(src) + if(istype(AM, /obj/structure/bigDelivery) && !hasmob) + var/obj/structure/bigDelivery/T = AM + src.destinationTag = T.sortTag + if(istype(AM, /obj/item/smallDelivery) && !hasmob) + var/obj/item/smallDelivery/T = AM + src.destinationTag = T.sortTag + //Drones can mail themselves through maint. + if(istype(AM, /mob/living/silicon/robot/drone)) + var/mob/living/silicon/robot/drone/drone = AM + src.destinationTag = drone.mail_destination - // start the movement process - // argument is the disposal unit the holder started in - proc/start(var/obj/machinery/disposal/D) - if(!D.trunk) - D.expel(src) // no trunk connected, so expel immediately - return - - forceMove(D.trunk) - active = 1 - set_dir(DOWN) - spawn(1) - move() // spawn off the movement process - +// start the movement process +// argument is the disposal unit the holder started in +/obj/structure/disposalholder/proc/start(var/obj/machinery/disposal/D) + if(!D.trunk) + D.expel(src) // no trunk connected, so expel immediately return - // movement process, persists while holder is moving through pipes - proc/move() - var/obj/structure/disposalpipe/last - while(active) - sleep(1) // was 1 - if(!loc) return // check if we got GC'd + forceMove(D.trunk) + active = 1 + set_dir(DOWN) + spawn(1) + move() // spawn off the movement process - if(hasmob && prob(3)) - for(var/mob/living/H in src) - if(!istype(H,/mob/living/silicon/robot/drone)) //Drones use the mailing code to move through the disposal system, - H.take_overall_damage(20, 0, "Blunt Trauma")//horribly maim any living creature jumping down disposals. c'est la vie + return - var/obj/structure/disposalpipe/curr = loc - last = curr - curr = curr.transfer(src) +// movement process, persists while holder is moving through pipes +/obj/structure/disposalholder/proc/move() + var/obj/structure/disposalpipe/last + while(active) + sleep(1) // was 1 + if(!loc) return // check if we got GC'd - if(!loc) return //side effects + if(hasmob && prob(3)) + for(var/mob/living/H in src) + if(!istype(H,/mob/living/silicon/robot/drone)) //Drones use the mailing code to move through the disposal system, + H.take_overall_damage(20, 0, "Blunt Trauma")//horribly maim any living creature jumping down disposals. c'est la vie - if(!curr) - last.expel(src, loc, dir) + var/obj/structure/disposalpipe/curr = loc + last = curr + curr = curr.transfer(src) - // - if(!(count--)) - active = 0 - return + if(!loc) return //side effects + + if(!curr) + last.expel(src, loc, dir) + + // + if(!(count--)) + active = 0 + return - // find the turf which should contain the next pipe - proc/nextloc() - return get_step(loc,dir) +// find the turf which should contain the next pipe +/obj/structure/disposalholder/proc/nextloc() + return get_step(loc,dir) - // find a matching pipe on a turf - proc/findpipe(var/turf/T) +// find a matching pipe on a turf +/obj/structure/disposalholder/proc/findpipe(var/turf/T) - if(!T) - return null - - var/fdir = turn(dir, 180) // flip the movement direction - for(var/obj/structure/disposalpipe/P in T) - if(fdir & P.dpdir) // find pipe direction mask that matches flipped dir - return P - // if no matching pipe, return null + if(!T) return null - // merge two holder objects - // used when a a holder meets a stuck holder - proc/merge(var/obj/structure/disposalholder/other) - for(var/atom/movable/AM in other) - AM.forceMove(src) // move everything in other holder to this one - if(ismob(AM)) - var/mob/M = AM - if(M.client) // if a client mob, update eye to follow this holder - M.client.eye = src + var/fdir = turn(dir, 180) // flip the movement direction + for(var/obj/structure/disposalpipe/P in T) + if(fdir & P.dpdir) // find pipe direction mask that matches flipped dir + return P + // if no matching pipe, return null + return null - qdel(other) +// merge two holder objects +// used when a a holder meets a stuck holder +/obj/structure/disposalholder/proc/merge(var/obj/structure/disposalholder/other) + for(var/atom/movable/AM in other) + AM.forceMove(src) // move everything in other holder to this one + if(ismob(AM)) + var/mob/M = AM + if(M.client) // if a client mob, update eye to follow this holder + M.client.eye = src + + qdel(other) - proc/settag(var/new_tag) +/obj/structure/disposalholder/proc/settag(var/new_tag) + destinationTag = new_tag + +/obj/structure/disposalholder/proc/setpartialtag(var/new_tag) + if(partialTag == new_tag) destinationTag = new_tag - - proc/setpartialtag(var/new_tag) - if(partialTag == new_tag) - destinationTag = new_tag - partialTag = "" - else - partialTag = new_tag + partialTag = "" + else + partialTag = new_tag - // called when player tries to move while in a pipe - relaymove(mob/user as mob) +// called when player tries to move while in a pipe +/obj/structure/disposalholder/relaymove(mob/user as mob) - if(!istype(user,/mob/living)) - return + if(!istype(user,/mob/living)) + return - var/mob/living/U = user + var/mob/living/U = user - if (U.stat || U.last_special <= world.time) - return + if (U.stat || U.last_special <= world.time) + return - U.last_special = world.time+100 + U.last_special = world.time+100 - if (src.loc) - for (var/mob/M in hearers(src.loc.loc)) - to_chat(M, "CLONG, clong!") + if (src.loc) + for (var/mob/M in hearers(src.loc.loc)) + to_chat(M, "CLONG, clong!") - playsound(src, 'sound/effects/clang.ogg', 50, 0, 0) + playsound(src, 'sound/effects/clang.ogg', 50, 0, 0) // called to vent all gas in holder to a location - proc/vent_gas(var/atom/location) - location.assume_air(gas) // vent all gas to turf - return +/obj/structure/disposalholder/proc/vent_gas(var/atom/location) + location.assume_air(gas) // vent all gas to turf + return /obj/structure/disposalholder/Destroy() qdel(gas) @@ -754,275 +754,276 @@ var/base_icon_state // initial icon state on map var/sortType = "" var/subtype = 0 - // new pipe, set the icon_state as on map - New() - ..() - base_icon_state = icon_state - return + +// new pipe, set the icon_state as on map +/obj/structure/disposalpipe/New() + ..() + base_icon_state = icon_state + return - // pipe is deleted - // ensure if holder is present, it is expelled - Destroy() - var/obj/structure/disposalholder/H = locate() in src - if(H) - // holder was present - H.active = 0 - var/turf/T = src.loc - if(T.density) - // deleting pipe is inside a dense turf (wall) - // this is unlikely, but just dump out everything into the turf in case - - for(var/atom/movable/AM in H) - AM.forceMove(T) - AM.pipe_eject(0) - qdel(H) - ..() - return - - // otherwise, do normal expel from turf - if(H) - expel(H, T, 0) - ..() - - // returns the direction of the next pipe object, given the entrance dir - // by default, returns the bitmask of remaining directions - proc/nextdir(var/fromdir) - return dpdir & (~turn(fromdir, 180)) - - // transfer the holder through this pipe segment - // overriden for special behaviour - // - proc/transfer(var/obj/structure/disposalholder/H) - var/nextdir = nextdir(H.dir) - H.set_dir(nextdir) - var/turf/T = H.nextloc() - var/obj/structure/disposalpipe/P = H.findpipe(T) - - if(P) - // find other holder in next loc, if inactive merge it with current - var/obj/structure/disposalholder/H2 = locate() in P - if(H2 && !H2.active) - H.merge(H2) - - H.forceMove(P) - else // if wasn't a pipe, then set loc to turf - H.forceMove(T) - return null - - return P - - - // update the icon_state to reflect hidden status - proc/update() +// pipe is deleted +// ensure if holder is present, it is expelled +/obj/structure/disposalpipe/Destroy() + var/obj/structure/disposalholder/H = locate() in src + if(H) + // holder was present + H.active = 0 var/turf/T = src.loc - hide(!T.is_plating() && !istype(T,/turf/space)) // space never hides pipes + if(T.density) + // deleting pipe is inside a dense turf (wall) + // this is unlikely, but just dump out everything into the turf in case - // hide called by levelupdate if turf intact status changes - // change visibility status and force update of icon - hide(var/intact) - invisibility = intact ? 101: 0 // hide if floor is intact - updateicon() - - // update actual icon_state depending on visibility - // if invisible, append "f" to icon_state to show faded version - // this will be revealed if a T-scanner is used - // if visible, use regular icon_state - proc/updateicon() -/* if(invisibility) //we hide things with alpha now, no need for transparent icons - icon_state = "[base_icon_state]f" - else - icon_state = base_icon_state*/ - icon_state = base_icon_state - return - - - // expel the held objects into a turf - // called when there is a break in the pipe - proc/expel(var/obj/structure/disposalholder/H, var/turf/T, var/direction) - if(!istype(H)) + for(var/atom/movable/AM in H) + AM.forceMove(T) + AM.pipe_eject(0) + qdel(H) + ..() return - // Empty the holder if it is expelled into a dense turf. - // Leaving it intact and sitting in a wall is stupid. - if(T.density) + // otherwise, do normal expel from turf + if(H) + expel(H, T, 0) + ..() + +// returns the direction of the next pipe object, given the entrance dir +// by default, returns the bitmask of remaining directions +/obj/structure/disposalpipe/proc/nextdir(var/fromdir) + return dpdir & (~turn(fromdir, 180)) + +// transfer the holder through this pipe segment +// overriden for special behaviour +// +/obj/structure/disposalpipe/proc/transfer(var/obj/structure/disposalholder/H) + var/nextdir = nextdir(H.dir) + H.set_dir(nextdir) + var/turf/T = H.nextloc() + var/obj/structure/disposalpipe/P = H.findpipe(T) + + if(P) + // find other holder in next loc, if inactive merge it with current + var/obj/structure/disposalholder/H2 = locate() in P + if(H2 && !H2.active) + H.merge(H2) + + H.forceMove(P) + else // if wasn't a pipe, then set loc to turf + H.forceMove(T) + return null + + return P + + +// update the icon_state to reflect hidden status +/obj/structure/disposalpipe/proc/update() + var/turf/T = src.loc + hide(!T.is_plating() && !istype(T,/turf/space)) // space never hides pipes + +// hide called by levelupdate if turf intact status changes +// change visibility status and force update of icon +/obj/structure/disposalpipe/hide(var/intact) + invisibility = intact ? 101: 0 // hide if floor is intact + updateicon() + +// update actual icon_state depending on visibility +// if invisible, append "f" to icon_state to show faded version +// this will be revealed if a T-scanner is used +// if visible, use regular icon_state +/obj/structure/disposalpipe/proc/updateicon() +/* if(invisibility) //we hide things with alpha now, no need for transparent icons + icon_state = "[base_icon_state]f" + else + icon_state = base_icon_state*/ + icon_state = base_icon_state + return + + +// expel the held objects into a turf +// called when there is a break in the pipe +/obj/structure/disposalpipe/proc/expel(var/obj/structure/disposalholder/H, var/turf/T, var/direction) + if(!istype(H)) + return + + // Empty the holder if it is expelled into a dense turf. + // Leaving it intact and sitting in a wall is stupid. + if(T.density) + for(var/atom/movable/AM in H) + AM.loc = T + AM.pipe_eject(0) + qdel(H) + return + + + if(!T.is_plating() && istype(T,/turf/simulated/floor)) //intact floor, pop the tile + var/turf/simulated/floor/F = T + F.break_tile() + new /obj/item/stack/tile(H) // add to holder so it will be thrown with other stuff + + var/turf/target + if(direction) // direction is specified + if(istype(T, /turf/space)) // if ended in space, then range is unlimited + target = get_edge_target_turf(T, direction) + else // otherwise limit to 10 tiles + target = get_ranged_target_turf(T, direction, 10) + + playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0) + if(H) for(var/atom/movable/AM in H) - AM.loc = T + AM.forceMove(T) + AM.pipe_eject(direction) + spawn(1) + if(AM) + AM.throw_at(target, 100, 1) + H.vent_gas(T) + qdel(H) + + else // no specified direction, so throw in random direction + + playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0) + if(H) + for(var/atom/movable/AM in H) + target = get_offset_target_turf(T, rand(5)-rand(5), rand(5)-rand(5)) + + AM.forceMove(T) + AM.pipe_eject(0) + spawn(1) + if(AM) + AM.throw_at(target, 5, 1) + + H.vent_gas(T) // all gas vent to turf + qdel(H) + + return + +// call to break the pipe +// will expel any holder inside at the time +// then delete the pipe +// remains : set to leave broken pipe pieces in place +/obj/structure/disposalpipe/proc/broken(var/remains = 0) + if(remains) + for(var/D in cardinal) + if(D & dpdir) + var/obj/structure/disposalpipe/broken/P = new(src.loc) + 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 + if(H) + // holder was present + H.active = 0 + var/turf/T = src.loc + if(T.density) + // broken pipe is inside a dense turf (wall) + // this is unlikely, but just dump out everything into the turf in case + + for(var/atom/movable/AM in H) + AM.forceMove(T) AM.pipe_eject(0) qdel(H) return - - if(!T.is_plating() && istype(T,/turf/simulated/floor)) //intact floor, pop the tile - var/turf/simulated/floor/F = T - F.break_tile() - new /obj/item/stack/tile(H) // add to holder so it will be thrown with other stuff - - var/turf/target - if(direction) // direction is specified - if(istype(T, /turf/space)) // if ended in space, then range is unlimited - target = get_edge_target_turf(T, direction) - else // otherwise limit to 10 tiles - target = get_ranged_target_turf(T, direction, 10) - - playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0) - if(H) - for(var/atom/movable/AM in H) - AM.forceMove(T) - AM.pipe_eject(direction) - spawn(1) - if(AM) - AM.throw_at(target, 100, 1) - H.vent_gas(T) - qdel(H) - - else // no specified direction, so throw in random direction - - playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0) - if(H) - for(var/atom/movable/AM in H) - target = get_offset_target_turf(T, rand(5)-rand(5), rand(5)-rand(5)) - - AM.forceMove(T) - AM.pipe_eject(0) - spawn(1) - if(AM) - AM.throw_at(target, 5, 1) - - H.vent_gas(T) // all gas vent to turf - qdel(H) - - return - - // call to break the pipe - // will expel any holder inside at the time - // then delete the pipe - // remains : set to leave broken pipe pieces in place - proc/broken(var/remains = 0) - if(remains) - for(var/D in cardinal) - if(D & dpdir) - var/obj/structure/disposalpipe/broken/P = new(src.loc) - 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 + // otherwise, do normal expel from turf if(H) - // holder was present - H.active = 0 - var/turf/T = src.loc - if(T.density) - // broken pipe is inside a dense turf (wall) - // this is unlikely, but just dump out everything into the turf in case + expel(H, T, 0) - for(var/atom/movable/AM in H) - AM.forceMove(T) - AM.pipe_eject(0) - qdel(H) - return - - // otherwise, do normal expel from turf - if(H) - expel(H, T, 0) - - spawn(2) // delete pipe after 2 ticks to ensure expel proc finished - qdel(src) + spawn(2) // delete pipe after 2 ticks to ensure expel proc finished + qdel(src) - // pipe affected by explosion - ex_act(severity) +// pipe affected by explosion +/obj/structure/disposalpipe/ex_act(severity) - switch(severity) - if(1.0) - broken(0) - return - if(2.0) - health -= rand(5,15) - healthcheck() - return - if(3.0) - health -= rand(0,15) - healthcheck() - return + switch(severity) + if(1.0) + broken(0) + return + if(2.0) + health -= rand(5,15) + healthcheck() + return + if(3.0) + health -= rand(0,15) + healthcheck() + return // test health for brokenness - proc/healthcheck() - if(health < -2) - broken(0) - else if(health<1) - broken(1) - return +/obj/structure/disposalpipe/proc/healthcheck() + if(health < -2) + broken(0) + else if(health<1) + broken(1) + return //attack by item //weldingtool: unfasten and convert to obj/disposalconstruct - attackby(var/obj/item/I, var/mob/user) +/obj/structure/disposalpipe/attackby(var/obj/item/I, var/mob/user) - var/turf/T = src.loc - if(!T.is_plating()) - return // prevent interaction with T-scanner revealed pipes - src.add_fingerprint(user) - if(istype(I, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/W = I + var/turf/T = src.loc + if(!T.is_plating()) + return // prevent interaction with T-scanner revealed pipes + src.add_fingerprint(user) + if(istype(I, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/W = I - if(W.remove_fuel(0,user)) - playsound(src, W.usesound, 50, 1) - // check if anything changed over 2 seconds - var/turf/uloc = user.loc - var/atom/wloc = W.loc - to_chat(user, "Slicing the disposal pipe.") - sleep(30) - if(!W.isOn()) return - if(user.loc == uloc && wloc == W.loc) - welded() - else - to_chat(user, "You must stay still while welding the pipe.") + if(W.remove_fuel(0,user)) + playsound(src, W.usesound, 50, 1) + // check if anything changed over 2 seconds + var/turf/uloc = user.loc + var/atom/wloc = W.loc + to_chat(user, "Slicing the disposal pipe.") + sleep(30) + if(!W.isOn()) return + if(user.loc == uloc && wloc == W.loc) + welded() else - to_chat(user, "You need more welding fuel to cut the pipe.") - return + to_chat(user, "You must stay still while welding the pipe.") + else + to_chat(user, "You need more welding fuel to cut the pipe.") + return // called when pipe is cut with welder - proc/welded() +/obj/structure/disposalpipe/proc/welded() - var/obj/structure/disposalconstruct/C = new (src.loc) - switch(base_icon_state) - if("pipe-s") - C.ptype = 0 - if("pipe-c") - C.ptype = 1 - if("pipe-j1") - C.ptype = 2 - if("pipe-j2") - C.ptype = 3 - if("pipe-y") - C.ptype = 4 - if("pipe-t") - C.ptype = 5 - if("pipe-j1s") - C.ptype = 9 - C.sortType = sortType - if("pipe-j2s") - C.ptype = 10 - C.sortType = sortType + var/obj/structure/disposalconstruct/C = new (src.loc) + switch(base_icon_state) + if("pipe-s") + C.ptype = 0 + if("pipe-c") + C.ptype = 1 + if("pipe-j1") + C.ptype = 2 + if("pipe-j2") + C.ptype = 3 + if("pipe-y") + C.ptype = 4 + if("pipe-t") + C.ptype = 5 + if("pipe-j1s") + C.ptype = 9 + C.sortType = sortType + if("pipe-j2s") + C.ptype = 10 + C.sortType = sortType ///// Z-Level stuff - if("pipe-u") - C.ptype = 11 - if("pipe-d") - C.ptype = 12 + if("pipe-u") + C.ptype = 11 + if("pipe-d") + C.ptype = 12 ///// Z-Level stuff - if("pipe-tagger") - C.ptype = 13 - if("pipe-tagger-partial") - C.ptype = 14 - C.subtype = src.subtype - src.transfer_fingerprints_to(C) - C.set_dir(dir) - C.density = 0 - C.anchored = 1 - C.update() + if("pipe-tagger") + C.ptype = 13 + if("pipe-tagger-partial") + C.ptype = 14 + C.subtype = src.subtype + src.transfer_fingerprints_to(C) + C.set_dir(dir) + C.density = 0 + C.anchored = 1 + C.update() - qdel(src) + qdel(src) // pipe is deleted // ensure if holder is present, it is expelled @@ -1060,116 +1061,116 @@ /obj/structure/disposalpipe/segment icon_state = "pipe-s" - New() - ..() - if(icon_state == "pipe-s") - dpdir = dir | turn(dir, 180) - else - dpdir = dir | turn(dir, -90) +/obj/structure/disposalpipe/segment/New() + ..() + if(icon_state == "pipe-s") + dpdir = dir | turn(dir, 180) + else + dpdir = dir | turn(dir, -90) - update() - return + update() + return ///// Z-Level stuff /obj/structure/disposalpipe/up icon_state = "pipe-u" - New() - ..() - dpdir = dir - update() - return +/obj/structure/disposalpipe/up/New() + ..() + dpdir = dir + update() + return - nextdir(var/fromdir) - var/nextdir - if(fromdir == 11) - nextdir = dir +/obj/structure/disposalpipe/up/nextdir(var/fromdir) + var/nextdir + if(fromdir == 11) + nextdir = dir + else + nextdir = 12 + return nextdir + +/obj/structure/disposalpipe/up/transfer(var/obj/structure/disposalholder/H) + var/nextdir = nextdir(H.dir) + H.set_dir(nextdir) + + var/turf/T + var/obj/structure/disposalpipe/P + + if(nextdir == 12) + T = GetAbove(src) + if(!T) + H.forceMove(loc) + return else - nextdir = 12 - return nextdir + for(var/obj/structure/disposalpipe/down/F in T) + P = F - transfer(var/obj/structure/disposalholder/H) - var/nextdir = nextdir(H.dir) - H.set_dir(nextdir) + else + T = get_step(src.loc, H.dir) + P = H.findpipe(T) - var/turf/T - var/obj/structure/disposalpipe/P + if(P) + // find other holder in next loc, if inactive merge it with current + var/obj/structure/disposalholder/H2 = locate() in P + if(H2 && !H2.active) + H.merge(H2) - if(nextdir == 12) - T = GetAbove(src) - if(!T) - H.forceMove(loc) - return - else - for(var/obj/structure/disposalpipe/down/F in T) - P = F + H.forceMove(P) + else // if wasn't a pipe, then set loc to turf + H.forceMove(T) + return null - else - T = get_step(src.loc, H.dir) - P = H.findpipe(T) - - if(P) - // find other holder in next loc, if inactive merge it with current - var/obj/structure/disposalholder/H2 = locate() in P - if(H2 && !H2.active) - H.merge(H2) - - H.forceMove(P) - else // if wasn't a pipe, then set loc to turf - H.forceMove(T) - return null - - return P + return P /obj/structure/disposalpipe/down icon_state = "pipe-d" - New() - ..() - dpdir = dir - update() - return +/obj/structure/disposalpipe/down/New() + ..() + dpdir = dir + update() + return - nextdir(var/fromdir) - var/nextdir - if(fromdir == 12) - nextdir = dir +/obj/structure/disposalpipe/down/nextdir(var/fromdir) + var/nextdir + if(fromdir == 12) + nextdir = dir + else + nextdir = 11 + return nextdir + +/obj/structure/disposalpipe/down/transfer(var/obj/structure/disposalholder/H) + var/nextdir = nextdir(H.dir) + H.dir = nextdir + + var/turf/T + var/obj/structure/disposalpipe/P + + if(nextdir == 11) + T = GetBelow(src) + if(!T) + H.forceMove(src.loc) + return else - nextdir = 11 - return nextdir + for(var/obj/structure/disposalpipe/up/F in T) + P = F - transfer(var/obj/structure/disposalholder/H) - var/nextdir = nextdir(H.dir) - H.dir = nextdir + else + T = get_step(src.loc, H.dir) + P = H.findpipe(T) - var/turf/T - var/obj/structure/disposalpipe/P + if(P) + // find other holder in next loc, if inactive merge it with current + var/obj/structure/disposalholder/H2 = locate() in P + if(H2 && !H2.active) + H.merge(H2) - if(nextdir == 11) - T = GetBelow(src) - if(!T) - H.forceMove(src.loc) - return - else - for(var/obj/structure/disposalpipe/up/F in T) - P = F + H.forceMove(P) + else // if wasn't a pipe, then set loc to turf + H.forceMove(T) + return null - else - T = get_step(src.loc, H.dir) - P = H.findpipe(T) - - if(P) - // find other holder in next loc, if inactive merge it with current - var/obj/structure/disposalholder/H2 = locate() in P - if(H2 && !H2.active) - H.merge(H2) - - H.forceMove(P) - else // if wasn't a pipe, then set loc to turf - H.forceMove(T) - return null - - return P + return P ///// Z-Level stuff /obj/structure/disposalpipe/junction/yjunction @@ -1179,45 +1180,45 @@ /obj/structure/disposalpipe/junction icon_state = "pipe-j1" - New() - ..() - if(icon_state == "pipe-j1") - dpdir = dir | turn(dir, -90) | turn(dir,180) - else if(icon_state == "pipe-j2") - dpdir = dir | turn(dir, 90) | turn(dir,180) - else // pipe-y - dpdir = dir | turn(dir,90) | turn(dir, -90) - update() - return +/obj/structure/disposalpipe/junction/New() + ..() + if(icon_state == "pipe-j1") + dpdir = dir | turn(dir, -90) | turn(dir,180) + else if(icon_state == "pipe-j2") + dpdir = dir | turn(dir, 90) | turn(dir,180) + else // pipe-y + dpdir = dir | turn(dir,90) | turn(dir, -90) + update() + return - // next direction to move - // if coming in from secondary dirs, then next is primary dir - // if coming in from primary dir, then next is equal chance of other dirs +// next direction to move +// if coming in from secondary dirs, then next is primary dir +// if coming in from primary dir, then next is equal chance of other dirs - nextdir(var/fromdir) - var/flipdir = turn(fromdir, 180) - if(flipdir != dir) // came from secondary dir - return dir // so exit through primary - else // came from primary - // so need to choose either secondary exit - var/mask = ..(fromdir) +/obj/structure/disposalpipe/junction/nextdir(var/fromdir) + var/flipdir = turn(fromdir, 180) + if(flipdir != dir) // came from secondary dir + return dir // so exit through primary + else // came from primary + // so need to choose either secondary exit + var/mask = ..(fromdir) - // find a bit which is set - var/setbit = 0 - if(mask & NORTH) - setbit = NORTH - else if(mask & SOUTH) - setbit = SOUTH - else if(mask & EAST) - setbit = EAST - else - setbit = WEST + // find a bit which is set + var/setbit = 0 + if(mask & NORTH) + setbit = NORTH + else if(mask & SOUTH) + setbit = SOUTH + else if(mask & EAST) + setbit = EAST + else + setbit = WEST - if(prob(50)) // 50% chance to choose the found bit or the other one - return setbit - else - return mask & (~setbit) + if(prob(50)) // 50% chance to choose the found bit or the other one + return setbit + else + return mask & (~setbit) /obj/structure/disposalpipe/tagger @@ -1226,46 +1227,46 @@ var/sort_tag = "" var/partial = 0 - proc/updatedesc() - desc = initial(desc) - if(sort_tag) - desc += "\nIt's tagging objects with the '[sort_tag]' tag." +/obj/structure/disposalpipe/tagger/proc/updatedesc() + desc = initial(desc) + if(sort_tag) + desc += "\nIt's tagging objects with the '[sort_tag]' tag." - proc/updatename() - if(sort_tag) - name = "[initial(name)] ([sort_tag])" +/obj/structure/disposalpipe/tagger/proc/updatename() + if(sort_tag) + name = "[initial(name)] ([sort_tag])" + else + name = initial(name) + +/obj/structure/disposalpipe/tagger/New() + . = ..() + dpdir = dir | turn(dir, 180) + if(sort_tag) GLOB.tagger_locations |= sort_tag + updatename() + updatedesc() + update() + +/obj/structure/disposalpipe/tagger/attackby(var/obj/item/I, var/mob/user) + if(..()) + return + + if(istype(I, /obj/item/device/destTagger)) + var/obj/item/device/destTagger/O = I + + if(O.currTag)// Tag set + sort_tag = O.currTag + playsound(src, 'sound/machines/twobeep.ogg', 100, 1) + to_chat(user, "Changed tag to '[sort_tag]'.") + updatename() + updatedesc() + +/obj/structure/disposalpipe/tagger/transfer(var/obj/structure/disposalholder/H) + if(sort_tag) + if(partial) + H.setpartialtag(sort_tag) else - name = initial(name) - - New() - . = ..() - dpdir = dir | turn(dir, 180) - if(sort_tag) GLOB.tagger_locations |= sort_tag - updatename() - updatedesc() - update() - - attackby(var/obj/item/I, var/mob/user) - if(..()) - return - - if(istype(I, /obj/item/device/destTagger)) - var/obj/item/device/destTagger/O = I - - if(O.currTag)// Tag set - sort_tag = O.currTag - playsound(src, 'sound/machines/twobeep.ogg', 100, 1) - to_chat(user, "Changed tag to '[sort_tag]'.") - updatename() - updatedesc() - - transfer(var/obj/structure/disposalholder/H) - if(sort_tag) - if(partial) - H.setpartialtag(sort_tag) - else - H.settag(sort_tag) - return ..() + H.settag(sort_tag) + return ..() /obj/structure/disposalpipe/tagger/partial //needs two passes to tag name = "partial package tagger" @@ -1282,103 +1283,105 @@ var/negdir = 0 var/sortdir = 0 - proc/updatedesc() - desc = initial(desc) - if(sortType) - desc += "\nIt's filtering objects with the '[sortType]' tag." +/obj/structure/disposalpipe/sortjunction/proc/updatedesc() + desc = initial(desc) + if(sortType) + desc += "\nIt's filtering objects with the '[sortType]' tag." - proc/updatename() - if(sortType) - name = "[initial(name)] ([sortType])" +/obj/structure/disposalpipe/sortjunction/proc/updatename() + if(sortType) + name = "[initial(name)] ([sortType])" + else + name = initial(name) + +/obj/structure/disposalpipe/sortjunction/proc/updatedir() + posdir = dir + negdir = turn(posdir, 180) + + if(icon_state == "pipe-j1s") + sortdir = turn(posdir, -90) + else if(icon_state == "pipe-j2s") + sortdir = turn(posdir, 90) + + dpdir = sortdir | posdir | negdir + +/obj/structure/disposalpipe/sortjunction/New() + . = ..() + if(sortType) GLOB.tagger_locations |= sortType + + updatedir() + updatename() + updatedesc() + update() + +/obj/structure/disposalpipe/sortjunction/attackby(var/obj/item/I, var/mob/user) + if(..()) + return + + if(istype(I, /obj/item/device/destTagger)) + var/obj/item/device/destTagger/O = I + + if(O.currTag)// Tag set + sortType = O.currTag + playsound(src, 'sound/machines/twobeep.ogg', 100, 1) + to_chat(user, "Changed filter to '[sortType]'.") + updatename() + updatedesc() + +/obj/structure/disposalpipe/sortjunction/proc/divert_check(var/checkTag) + return sortType == checkTag + +// next direction to move +// if coming in from negdir, then next is primary dir or sortdir +// if coming in from posdir, then flip around and go back to posdir +// if coming in from sortdir, go to posdir + +/obj/structure/disposalpipe/sortjunction/nextdir(var/fromdir, var/sortTag) + if(fromdir != sortdir) // probably came from the negdir + if(divert_check(sortTag)) + return sortdir else - name = initial(name) - - proc/updatedir() - posdir = dir - negdir = turn(posdir, 180) - - if(icon_state == "pipe-j1s") - sortdir = turn(posdir, -90) - else if(icon_state == "pipe-j2s") - sortdir = turn(posdir, 90) - - dpdir = sortdir | posdir | negdir - - New() - . = ..() - if(sortType) GLOB.tagger_locations |= sortType - - updatedir() - updatename() - updatedesc() - update() - - attackby(var/obj/item/I, var/mob/user) - if(..()) - return - - if(istype(I, /obj/item/device/destTagger)) - var/obj/item/device/destTagger/O = I - - if(O.currTag)// Tag set - sortType = O.currTag - playsound(src, 'sound/machines/twobeep.ogg', 100, 1) - to_chat(user, "Changed filter to '[sortType]'.") - updatename() - updatedesc() - - proc/divert_check(var/checkTag) - return sortType == checkTag - - // next direction to move - // if coming in from negdir, then next is primary dir or sortdir - // if coming in from posdir, then flip around and go back to posdir - // if coming in from sortdir, go to posdir - - nextdir(var/fromdir, var/sortTag) - if(fromdir != sortdir) // probably came from the negdir - if(divert_check(sortTag)) - return sortdir - else - return posdir - else // came from sortdir - // so go with the flow to positive direction return posdir + else // came from sortdir + // so go with the flow to positive direction + return posdir - transfer(var/obj/structure/disposalholder/H) - var/nextdir = nextdir(H.dir, H.destinationTag) - H.set_dir(nextdir) - var/turf/T = H.nextloc() - var/obj/structure/disposalpipe/P = H.findpipe(T) +/obj/structure/disposalpipe/sortjunction/transfer(var/obj/structure/disposalholder/H) + var/nextdir = nextdir(H.dir, H.destinationTag) + H.set_dir(nextdir) + var/turf/T = H.nextloc() + var/obj/structure/disposalpipe/P = H.findpipe(T) - if(P) - // find other holder in next loc, if inactive merge it with current - var/obj/structure/disposalholder/H2 = locate() in P - if(H2 && !H2.active) - H.merge(H2) + if(P) + // find other holder in next loc, if inactive merge it with current + var/obj/structure/disposalholder/H2 = locate() in P + if(H2 && !H2.active) + H.merge(H2) - H.forceMove(P) - else // if wasn't a pipe, then set loc to turf - H.forceMove(T) - return null + H.forceMove(P) + else // if wasn't a pipe, then set loc to turf + H.forceMove(T) + return null - return P + return P //a three-way junction that filters all wrapped and tagged items /obj/structure/disposalpipe/sortjunction/wildcard name = "wildcard sorting junction" desc = "An underfloor disposal pipe which filters all wrapped and tagged items." subtype = 1 - divert_check(var/checkTag) - return checkTag != "" + +/obj/structure/disposalpipe/sortjunction/wildcard/divert_check(var/checkTag) + return checkTag != "" //junction that filters all untagged items /obj/structure/disposalpipe/sortjunction/untagged name = "untagged sorting junction" desc = "An underfloor disposal pipe which filters all untagged items." subtype = 2 - divert_check(var/checkTag) - return checkTag == "" + +/obj/structure/disposalpipe/sortjunction/untagged/divert_check(var/checkTag) + return checkTag == "" /obj/structure/disposalpipe/sortjunction/flipped //for easier and cleaner mapping icon_state = "pipe-j2s" @@ -1492,18 +1495,17 @@ // i.e. will be treated as an empty turf desc = "A broken piece of disposal pipe." - New() - ..() - update() - return +/obj/structure/disposalpipe/broken/New() + ..() + update() + return - // called when welded - // for broken pipe, remove and turn into scrap - - welded() -// var/obj/item/scrap/S = new(src.loc) -// S.set_components(200,0,0) - qdel(src) +// called when welded +// for broken pipe, remove and turn into scrap +/obj/structure/disposalpipe/broken/welded() +// var/obj/item/scrap/S = new(src.loc) +// S.set_components(200,0,0) + qdel(src) // the disposal outlet machine diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 6e0b9e74b7..969526be79 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -14,100 +14,100 @@ var/label_x var/tag_x - attack_hand(mob/user as mob) - unwrap() +/obj/structure/bigDelivery/attack_hand(mob/user as mob) + unwrap() - proc/unwrap() - playsound(src, 'sound/items/package_unwrap.ogg', 50, 1) - // Destroy will drop our wrapped object on the turf, so let it. - qdel(src) +/obj/structure/bigDelivery/proc/unwrap() + playsound(src, 'sound/items/package_unwrap.ogg', 50, 1) + // Destroy will drop our wrapped object on the turf, so let it. + qdel(src) - attackby(obj/item/W as obj, mob/user as mob) - if(istype(W, /obj/item/device/destTagger)) - var/obj/item/device/destTagger/O = W - if(O.currTag) - if(src.sortTag != O.currTag) - to_chat(user, "You have labeled the destination as [O.currTag].") - if(!src.sortTag) - src.sortTag = O.currTag - update_icon() - else - src.sortTag = O.currTag - playsound(src, 'sound/machines/twobeep.ogg', 50, 1) +/obj/structure/bigDelivery/attackby(obj/item/W as obj, mob/user as mob) + if(istype(W, /obj/item/device/destTagger)) + var/obj/item/device/destTagger/O = W + if(O.currTag) + if(src.sortTag != O.currTag) + to_chat(user, "You have labeled the destination as [O.currTag].") + if(!src.sortTag) + src.sortTag = O.currTag + update_icon() else - to_chat(user, "The package is already labeled for [O.currTag].") + src.sortTag = O.currTag + playsound(src, 'sound/machines/twobeep.ogg', 50, 1) else - to_chat(user, "You need to set a destination first!") + to_chat(user, "The package is already labeled for [O.currTag].") + else + to_chat(user, "You need to set a destination first!") - else if(istype(W, /obj/item/weapon/pen)) - switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) - if("Title") - var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) - if(!str || !length(str)) - to_chat(user, " Invalid text.") - return - user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\ - "You title \the [src]: \"[str]\"",\ - "You hear someone scribbling a note.") - playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) - name = "[name] ([str])" - if(!examtext && !nameset) - nameset = 1 - update_icon() - else - nameset = 1 - if("Description") - var/str = sanitize(input(usr,"Label text?","Set label","")) - if(!str || !length(str)) - to_chat(user, "Invalid text.") - return - if(!examtext && !nameset) - examtext = str - update_icon() - else - examtext = str - user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\ - "You label \the [src]: \"[examtext]\"",\ - "You hear someone scribbling a note.") - playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) - return + else if(istype(W, /obj/item/weapon/pen)) + switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) + if("Title") + var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) + if(!str || !length(str)) + to_chat(user, " Invalid text.") + return + user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\ + "You title \the [src]: \"[str]\"",\ + "You hear someone scribbling a note.") + playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) + name = "[name] ([str])" + if(!examtext && !nameset) + nameset = 1 + update_icon() + else + nameset = 1 + if("Description") + var/str = sanitize(input(usr,"Label text?","Set label","")) + if(!str || !length(str)) + to_chat(user, "Invalid text.") + return + if(!examtext && !nameset) + examtext = str + update_icon() + else + examtext = str + user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\ + "You label \the [src]: \"[examtext]\"",\ + "You hear someone scribbling a note.") + playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) + return - update_icon() - overlays = new() - if(nameset || examtext) - var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") - if(icon_state == "deliverycloset") - I.pixel_x = 2 - if(label_y == null) - label_y = rand(-6, 11) - I.pixel_y = label_y - else if(icon_state == "deliverycrate") - if(label_x == null) - label_x = rand(-8, 6) - I.pixel_x = label_x - I.pixel_y = -3 - overlays += I - if(src.sortTag) - var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") - if(icon_state == "deliverycloset") - if(tag_x == null) - tag_x = rand(-2, 3) - I.pixel_x = tag_x - I.pixel_y = 9 - else if(icon_state == "deliverycrate") - if(tag_x == null) - tag_x = rand(-8, 6) - I.pixel_x = tag_x - I.pixel_y = -3 - overlays += I +/obj/structure/bigDelivery/update_icon() + overlays = new() + if(nameset || examtext) + var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") + if(icon_state == "deliverycloset") + I.pixel_x = 2 + if(label_y == null) + label_y = rand(-6, 11) + I.pixel_y = label_y + else if(icon_state == "deliverycrate") + if(label_x == null) + label_x = rand(-8, 6) + I.pixel_x = label_x + I.pixel_y = -3 + overlays += I + if(src.sortTag) + var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") + if(icon_state == "deliverycloset") + if(tag_x == null) + tag_x = rand(-2, 3) + I.pixel_x = tag_x + I.pixel_y = 9 + else if(icon_state == "deliverycrate") + if(tag_x == null) + tag_x = rand(-8, 6) + I.pixel_x = tag_x + I.pixel_y = -3 + overlays += I - examine(mob/user) - . = ..() - if(get_dist(user, src) <= 4) - if(sortTag) - . += "It is labeled \"[sortTag]\"" - if(examtext) - . += "It has a note attached which reads, \"[examtext]\"" +/obj/structure/bigDelivery/examine(mob/user) + . = ..() + if(get_dist(user, src) <= 4) + if(sortTag) + . += "It is labeled \"[sortTag]\"" + if(examtext) + . += "It has a note attached which reads, \"[examtext]\"" /obj/item/smallDelivery desc = "A small wrapped package." @@ -122,100 +122,100 @@ var/nameset = 0 var/tag_x - attack_self(mob/user as mob) - if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 - wrapped.loc = user.loc - if(ishuman(user)) - user.put_in_hands(wrapped) - else - wrapped.loc = get_turf(src) +/obj/item/smallDelivery/attack_self(mob/user as mob) + if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 + wrapped.loc = user.loc + if(ishuman(user)) + user.put_in_hands(wrapped) + else + wrapped.loc = get_turf(src) - qdel(src) - return + qdel(src) + return - attackby(obj/item/W as obj, mob/user as mob) - if(istype(W, /obj/item/device/destTagger)) - var/obj/item/device/destTagger/O = W - if(O.currTag) - if(src.sortTag != O.currTag) - to_chat(user, "You have labeled the destination as [O.currTag].") - if(!src.sortTag) - src.sortTag = O.currTag - update_icon() - else - src.sortTag = O.currTag - playsound(src, 'sound/machines/twobeep.ogg', 50, 1) +/obj/item/smallDelivery/attackby(obj/item/W as obj, mob/user as mob) + if(istype(W, /obj/item/device/destTagger)) + var/obj/item/device/destTagger/O = W + if(O.currTag) + if(src.sortTag != O.currTag) + to_chat(user, "You have labeled the destination as [O.currTag].") + if(!src.sortTag) + src.sortTag = O.currTag + update_icon() else - to_chat(user, "The package is already labeled for [O.currTag].") + src.sortTag = O.currTag + playsound(src, 'sound/machines/twobeep.ogg', 50, 1) else - to_chat(user, "You need to set a destination first!") + to_chat(user, "The package is already labeled for [O.currTag].") + else + to_chat(user, "You need to set a destination first!") - else if(istype(W, /obj/item/weapon/pen)) - switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) - if("Title") - var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) - if(!str || !length(str)) - to_chat(user, " Invalid text.") - return - user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\ - "You title \the [src]: \"[str]\"",\ - "You hear someone scribbling a note.") - playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) - name = "[name] ([str])" - if(!examtext && !nameset) - nameset = 1 - update_icon() - else - nameset = 1 + else if(istype(W, /obj/item/weapon/pen)) + switch(alert("What would you like to alter?",,"Title","Description", "Cancel")) + if("Title") + var/str = sanitizeSafe(input(usr,"Label text?","Set label",""), MAX_NAME_LEN) + if(!str || !length(str)) + to_chat(user, " Invalid text.") + return + user.visible_message("\The [user] titles \the [src] with \a [W], marking down: \"[str]\"",\ + "You title \the [src]: \"[str]\"",\ + "You hear someone scribbling a note.") + playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) + name = "[name] ([str])" + if(!examtext && !nameset) + nameset = 1 + update_icon() + else + nameset = 1 - if("Description") - var/str = sanitize(input(usr,"Label text?","Set label","")) - if(!str || !length(str)) - to_chat(user, "Invalid text.") - return - if(!examtext && !nameset) - examtext = str - update_icon() - else - examtext = str - user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\ - "You label \the [src]: \"[examtext]\"",\ - "You hear someone scribbling a note.") - playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) - return + if("Description") + var/str = sanitize(input(usr,"Label text?","Set label","")) + if(!str || !length(str)) + to_chat(user, "Invalid text.") + return + if(!examtext && !nameset) + examtext = str + update_icon() + else + examtext = str + user.visible_message("\The [user] labels \the [src] with \a [W], scribbling down: \"[examtext]\"",\ + "You label \the [src]: \"[examtext]\"",\ + "You hear someone scribbling a note.") + playsound(src, pick('sound/bureaucracy/pen1.ogg','sound/bureaucracy/pen2.ogg'), 20) + return - update_icon() - overlays = new() - if((nameset || examtext) && icon_state != "deliverycrate1") - var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") - if(icon_state == "deliverycrate5") - I.pixel_y = -1 - overlays += I - if(src.sortTag) - var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") - switch(icon_state) - if("deliverycrate1") - I.pixel_y = -5 - if("deliverycrate2") - I.pixel_y = -2 - if("deliverycrate3") - I.pixel_y = 0 - if("deliverycrate4") - if(tag_x == null) - tag_x = rand(0,5) - I.pixel_x = tag_x - I.pixel_y = 3 - if("deliverycrate5") - I.pixel_y = -3 - overlays += I +/obj/item/smallDelivery/update_icon() + overlays = new() + if((nameset || examtext) && icon_state != "deliverycrate1") + var/image/I = new/image('icons/obj/storage.dmi',"delivery_label") + if(icon_state == "deliverycrate5") + I.pixel_y = -1 + overlays += I + if(src.sortTag) + var/image/I = new/image('icons/obj/storage.dmi',"delivery_tag") + switch(icon_state) + if("deliverycrate1") + I.pixel_y = -5 + if("deliverycrate2") + I.pixel_y = -2 + if("deliverycrate3") + I.pixel_y = 0 + if("deliverycrate4") + if(tag_x == null) + tag_x = rand(0,5) + I.pixel_x = tag_x + I.pixel_y = 3 + if("deliverycrate5") + I.pixel_y = -3 + overlays += I - examine(mob/user) - . = ..() - if(get_dist(user, src) <= 4) - if(sortTag) - . += "It is labeled \"[sortTag]\"" - if(examtext) - . += "It has a note attached which reads, \"[examtext]\"" +/obj/item/smallDelivery/examine(mob/user) + . = ..() + if(get_dist(user, src) <= 4) + if(sortTag) + . += "It is labeled \"[sortTag]\"" + if(examtext) + . += "It has a note attached which reads, \"[examtext]\"" /obj/item/weapon/packageWrap name = "package wrapper" @@ -227,95 +227,95 @@ drop_sound = 'sound/items/drop/wrapper.ogg' - afterattack(var/obj/target as obj, mob/user as mob, proximity) - if(!proximity) return - if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete - return - if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \ - || istype(target, /obj/item/weapon/gift) || istype(target, /obj/item/weapon/evidencebag)) - return - if(target.anchored) - return - if(target in user) - return - if(user in target) //no wrapping closets that you are inside - it's not physically possible - return - - user.attack_log += text("\[[time_stamp()]\] Has used [src.name] on \ref[target]") - - - if (istype(target, /obj/item) && !(istype(target, /obj/item/weapon/storage) && !istype(target,/obj/item/weapon/storage/box))) - var/obj/item/O = target - if (src.amount > 1) - var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up! - if(!istype(O.loc, /turf)) - if(user.client) - user.client.screen -= O - P.wrapped = O - O.forceMove(P) - P.w_class = O.w_class - var/i = round(O.w_class) - if(i in list(1,2,3,4,5)) - P.icon_state = "deliverycrate[i]" - switch(i) - if(1) P.name = "tiny parcel" - if(3) P.name = "normal-sized parcel" - if(4) P.name = "large parcel" - if(5) P.name = "huge parcel" - if(i < 1) - P.icon_state = "deliverycrate1" - P.name = "tiny parcel" - if(i > 5) - P.icon_state = "deliverycrate5" - P.name = "huge parcel" - P.add_fingerprint(usr) - O.add_fingerprint(usr) - src.add_fingerprint(usr) - src.amount -= 1 - user.visible_message("\The [user] wraps \a [target] with \a [src].",\ - "You wrap \the [target], leaving [amount] units of paper on \the [src].",\ - "You hear someone taping paper around a small object.") - playsound(src, 'sound/items/package_wrap.ogg', 50, 1) - else if (istype(target, /obj/structure/closet/crate)) - var/obj/structure/closet/crate/O = target - if (src.amount > 3 && !O.opened) - var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc)) - P.icon_state = "deliverycrate" - P.wrapped = O - O.loc = P - src.amount -= 3 - user.visible_message("\The [user] wraps \a [target] with \a [src].",\ - "You wrap \the [target], leaving [amount] units of paper on \the [src].",\ - "You hear someone taping paper around a large object.") - playsound(src, 'sound/items/package_wrap.ogg', 50, 1) - else if(src.amount < 3) - to_chat(user, "You need more paper.") - else if (istype (target, /obj/structure/closet)) - var/obj/structure/closet/O = target - if (src.amount > 3 && !O.opened) - var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc)) - P.wrapped = O - O.sealed = 1 - O.loc = P - src.amount -= 3 - user.visible_message("\The [user] wraps \a [target] with \a [src].",\ - "You wrap \the [target], leaving [amount] units of paper on \the [src].",\ - "You hear someone taping paper around a large object.") - playsound(src, 'sound/items/package_wrap.ogg', 50, 1) - else if(src.amount < 3) - to_chat(user, "You need more paper.") - else - to_chat(user, "The object you are trying to wrap is unsuitable for the sorting machinery!") - if (src.amount <= 0) - new /obj/item/weapon/c_tube( src.loc ) - qdel(src) - return +/obj/item/weapon/packageWrap/afterattack(var/obj/target as obj, mob/user as mob, proximity) + if(!proximity) return + if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete + return + if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \ + || istype(target, /obj/item/weapon/gift) || istype(target, /obj/item/weapon/evidencebag)) + return + if(target.anchored) + return + if(target in user) + return + if(user in target) //no wrapping closets that you are inside - it's not physically possible return - examine(mob/user) - . = ..() - if(get_dist(user, src) <= 0) - . += "There are [amount] units of package wrap left!" + user.attack_log += text("\[[time_stamp()]\] Has used [src.name] on \ref[target]") + + + if (istype(target, /obj/item) && !(istype(target, /obj/item/weapon/storage) && !istype(target,/obj/item/weapon/storage/box))) + var/obj/item/O = target + if (src.amount > 1) + var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up! + if(!istype(O.loc, /turf)) + if(user.client) + user.client.screen -= O + P.wrapped = O + O.forceMove(P) + P.w_class = O.w_class + var/i = round(O.w_class) + if(i in list(1,2,3,4,5)) + P.icon_state = "deliverycrate[i]" + switch(i) + if(1) P.name = "tiny parcel" + if(3) P.name = "normal-sized parcel" + if(4) P.name = "large parcel" + if(5) P.name = "huge parcel" + if(i < 1) + P.icon_state = "deliverycrate1" + P.name = "tiny parcel" + if(i > 5) + P.icon_state = "deliverycrate5" + P.name = "huge parcel" + P.add_fingerprint(usr) + O.add_fingerprint(usr) + src.add_fingerprint(usr) + src.amount -= 1 + user.visible_message("\The [user] wraps \a [target] with \a [src].",\ + "You wrap \the [target], leaving [amount] units of paper on \the [src].",\ + "You hear someone taping paper around a small object.") + playsound(src, 'sound/items/package_wrap.ogg', 50, 1) + else if (istype(target, /obj/structure/closet/crate)) + var/obj/structure/closet/crate/O = target + if (src.amount > 3 && !O.opened) + var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc)) + P.icon_state = "deliverycrate" + P.wrapped = O + O.loc = P + src.amount -= 3 + user.visible_message("\The [user] wraps \a [target] with \a [src].",\ + "You wrap \the [target], leaving [amount] units of paper on \the [src].",\ + "You hear someone taping paper around a large object.") + playsound(src, 'sound/items/package_wrap.ogg', 50, 1) + else if(src.amount < 3) + to_chat(user, "You need more paper.") + else if (istype (target, /obj/structure/closet)) + var/obj/structure/closet/O = target + if (src.amount > 3 && !O.opened) + var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc)) + P.wrapped = O + O.sealed = 1 + O.loc = P + src.amount -= 3 + user.visible_message("\The [user] wraps \a [target] with \a [src].",\ + "You wrap \the [target], leaving [amount] units of paper on \the [src].",\ + "You hear someone taping paper around a large object.") + playsound(src, 'sound/items/package_wrap.ogg', 50, 1) + else if(src.amount < 3) + to_chat(user, "You need more paper.") + else + to_chat(user, "The object you are trying to wrap is unsuitable for the sorting machinery!") + if (src.amount <= 0) + new /obj/item/weapon/c_tube( src.loc ) + qdel(src) + return + return + +/obj/item/weapon/packageWrap/examine(mob/user) + . = ..() + if(get_dist(user, src) <= 0) + . += "There are [amount] units of package wrap left!" /obj/structure/bigDelivery/Destroy() if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0 @@ -339,30 +339,30 @@ item_state = "electronic" slot_flags = SLOT_BELT - proc/openwindow(mob/user as mob) - var/dat = "

    TagMaster 2.3

    " +/obj/item/device/destTagger/proc/openwindow(mob/user as mob) + var/dat = "

    TagMaster 2.3

    " - dat += "" - for(var/i = 1, i <= GLOB.tagger_locations.len, i++) - dat += "" + dat += "
    [GLOB.tagger_locations[i]]
    " + for(var/i = 1, i <= GLOB.tagger_locations.len, i++) + dat += "" - if (i%4==0) - dat += "" + if (i%4==0) + dat += "" - dat += "
    [GLOB.tagger_locations[i]]

    Current Selection: [currTag ? currTag : "None"]
    " + dat += "
    Current Selection: [currTag ? currTag : "None"]
    " - user << browse(dat, "window=destTagScreen;size=450x350") - onclose(user, "destTagScreen") + user << browse(dat, "window=destTagScreen;size=450x350") + onclose(user, "destTagScreen") - attack_self(mob/user as mob) - openwindow(user) - return +/obj/item/device/destTagger/attack_self(mob/user as mob) + openwindow(user) + return - Topic(href, href_list) - src.add_fingerprint(usr) - if(href_list["nextTag"] && (href_list["nextTag"] in GLOB.tagger_locations)) - src.currTag = href_list["nextTag"] - openwindow(usr) +/obj/item/device/destTagger/Topic(href, href_list) + src.add_fingerprint(usr) + if(href_list["nextTag"] && (href_list["nextTag"] in GLOB.tagger_locations)) + src.currTag = href_list["nextTag"] + openwindow(usr) /obj/machinery/disposal/deliveryChute name = "Delivery chute" @@ -372,94 +372,86 @@ var/c_mode = 0 - New() - ..() - spawn(5) - trunk = locate() in src.loc - if(trunk) - trunk.linked = src // link the pipe trunk to self +/obj/machinery/disposal/deliveryChute/Initialize() + . = ..() + trunk = locate() in src.loc + if(trunk) + trunk.linked = src // link the pipe trunk to self - interact() - return +/obj/machinery/disposal/deliveryChute/interact() + return +/obj/machinery/disposal/deliveryChute/update() + return + +/obj/machinery/disposal/deliveryChute/Bumped(var/atom/movable/AM) //Go straight into the chute + if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect) || istype(AM, /obj/mecha)) return + switch(dir) + if(NORTH) + if(AM.loc.y != src.loc.y+1) return + if(EAST) + if(AM.loc.x != src.loc.x+1) return + if(SOUTH) + if(AM.loc.y != src.loc.y-1) return + if(WEST) + if(AM.loc.x != src.loc.x-1) return + + if(istype(AM, /obj)) + var/obj/O = AM + O.loc = src + else if(istype(AM, /mob)) + var/mob/M = AM + M.loc = src + src.flush() + +/obj/machinery/disposal/deliveryChute/flush() + flushing = 1 + flick("intake-closing", src) + var/obj/structure/disposalholder/H = new() // virtual holder object which actually + // travels through the pipes. + air_contents = new() // new empty gas resv. + + sleep(10) + playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0) + sleep(5) // wait for animation to finish + + H.init(src) // copy the contents of disposer to holder + + H.start(src) // start the holder processing movement + flushing = 0 + // now reset disposal state + flush = 0 + if(mode == 2) // if was ready, + mode = 1 // switch to charging update() + return + +/obj/machinery/disposal/deliveryChute/attackby(var/obj/item/I, var/mob/user) + if(!I || !user) return - Bumped(var/atom/movable/AM) //Go straight into the chute - if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect) || istype(AM, /obj/mecha)) return - switch(dir) - if(NORTH) - if(AM.loc.y != src.loc.y+1) return - if(EAST) - if(AM.loc.x != src.loc.x+1) return - if(SOUTH) - if(AM.loc.y != src.loc.y-1) return - if(WEST) - if(AM.loc.x != src.loc.x-1) return - - if(istype(AM, /obj)) - var/obj/O = AM - O.loc = src - else if(istype(AM, /mob)) - var/mob/M = AM - M.loc = src - src.flush() - - flush() - flushing = 1 - flick("intake-closing", src) - var/obj/structure/disposalholder/H = new() // virtual holder object which actually - // travels through the pipes. - air_contents = new() // new empty gas resv. - - sleep(10) - playsound(src, 'sound/machines/disposalflush.ogg', 50, 0, 0) - sleep(5) // wait for animation to finish - - H.init(src) // copy the contents of disposer to holder - - H.start(src) // start the holder processing movement - flushing = 0 - // now reset disposal state - flush = 0 - if(mode == 2) // if was ready, - mode = 1 // switch to charging - update() + if(I.is_screwdriver()) + c_mode = !c_mode + playsound(src, I.usesound, 50, 1) + to_chat(user, "You [c_mode ? "remove" : "attach"] the screws around the power connection.") return - - attackby(var/obj/item/I, var/mob/user) - if(!I || !user) + if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1) + var/obj/item/weapon/weldingtool/W = I + if(!W.remove_fuel(0,user)) + to_chat(user, "You need more welding fuel to complete this task.") return - - if(I.is_screwdriver()) - if(c_mode==0) - c_mode=1 - playsound(src, I.usesound, 50, 1) - to_chat(user, "You remove the screws around the power connection.") - return - else if(c_mode==1) - c_mode=0 - playsound(src, I.usesound, 50, 1) - to_chat(user, "You attach the screws around the power connection.") - return - else if(istype(I, /obj/item/weapon/weldingtool) && c_mode==1) - var/obj/item/weapon/weldingtool/W = I - if(W.remove_fuel(0,user)) - playsound(src, W.usesound, 50, 1) - to_chat(user, "You start slicing the floorweld off the delivery chute.") - if(do_after(user,20 * W.toolspeed)) - if(!src || !W.isOn()) return - to_chat(user, "You sliced the floorweld off the delivery chute.") - var/obj/structure/disposalconstruct/C = new (src.loc) - C.ptype = 8 // 8 = Delivery chute - C.update() - C.anchored = 1 - C.density = 1 - qdel(src) - return - else - to_chat(user, "You need more welding fuel to complete this task.") - return + playsound(src, W.usesound, 50, 1) + to_chat(user, "You start slicing the floorweld off the delivery chute.") + if(do_after(user,20 * W.toolspeed)) + if(!src || !W.isOn()) return + to_chat(user, "You sliced the floorweld off the delivery chute.") + var/obj/structure/disposalconstruct/C = new (src.loc) + C.ptype = 8 // 8 = Delivery chute + C.update() + C.anchored = 1 + C.density = 1 + qdel(src) + return /obj/machinery/disposal/deliveryChute/Destroy() if(trunk) diff --git a/code/modules/research/designs/misc.dm b/code/modules/research/designs/misc.dm index 2ce34f3485..7ec9bad2fa 100644 --- a/code/modules/research/designs/misc.dm +++ b/code/modules/research/designs/misc.dm @@ -12,7 +12,7 @@ build_path = /obj/item/device/communicator sort_string = "TAAAA" -datum/design/item/general/laserpointer +/datum/design/item/general/laserpointer name = "laser pointer" desc = "Don't shine it in your eyes!" id = "laser_pointer" diff --git a/code/modules/research/designs/uncommented.dm b/code/modules/research/designs/uncommented.dm index 7bbf53571a..f83e3a685b 100644 --- a/code/modules/research/designs/uncommented.dm +++ b/code/modules/research/designs/uncommented.dm @@ -22,7 +22,7 @@ materials = list("glass" = 2000, "sacid" = 20) build_path = "/obj/item/weapon/circuitboard/rust_core_control" -datum/design/rust_fuel_control +/datum/design/rust_fuel_control name = "Circuit Design (RUST fuel controller)" desc = "Allows for the construction of circuit boards used to build a fuel injector control console for the RUST fusion engine." id = "rust_fuel_control" @@ -31,7 +31,7 @@ datum/design/rust_fuel_control materials = list("glass" = 2000, "sacid" = 20) build_path = "/obj/item/weapon/circuitboard/rust_fuel_control" -datum/design/rust_fuel_port +/datum/design/rust_fuel_port name = "Internal circuitry (RUST fuel port)" desc = "Allows for the construction of circuit boards used to build a fuel injection port for the RUST fusion engine." id = "rust_fuel_port" @@ -40,7 +40,7 @@ datum/design/rust_fuel_port materials = list("glass" = 2000, "sacid" = 20, "uranium" = 3000) build_path = "/obj/item/weapon/module/rust_fuel_port" -datum/design/rust_fuel_compressor +/datum/design/rust_fuel_compressor name = "Circuit Design (RUST fuel compressor)" desc = "Allows for the construction of circuit boards used to build a fuel compressor of the RUST fusion engine." id = "rust_fuel_compressor" @@ -49,7 +49,7 @@ datum/design/rust_fuel_compressor materials = list("glass" = 2000, "sacid" = 20, "phoron" = 3000, "diamond" = 1000) build_path = "/obj/item/weapon/module/rust_fuel_compressor" -datum/design/rust_core +/datum/design/rust_core name = "Internal circuitry (RUST tokamak core)" desc = "The circuit board that for a RUST-pattern tokamak fusion core." id = "pacman" @@ -58,7 +58,7 @@ datum/design/rust_core materials = list("glass" = 2000, "sacid" = 20, "phoron" = 3000, "diamond" = 2000) build_path = "/obj/item/weapon/circuitboard/rust_core" -datum/design/rust_injector +/datum/design/rust_injector name = "Internal circuitry (RUST tokamak core)" desc = "The circuit board that for a RUST-pattern particle accelerator." id = "pacman" diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 005c0f07d1..61a398566c 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -25,7 +25,8 @@ Note: Must be placed within 3 tiles of the R&D Console var/T = 0 for(var/obj/item/weapon/stock_parts/S in component_parts) T += S.rating - decon_mod = T * 0.1 + T *= 0.1 + decon_mod = clamp(T, 0, 1) /obj/machinery/r_n_d/destructive_analyzer/update_icon() if(panel_open) @@ -117,4 +118,4 @@ Note: Must be placed within 3 tiles of the R&D Console /obj/machinery/r_n_d/destructive_analyzer/proc/rped_ready() rped_recycler_ready = TRUE - playsound(get_turf(src), 'sound/machines/chime.ogg', 50, 1) \ No newline at end of file + playsound(get_turf(src), 'sound/machines/chime.ogg', 50, 1) diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm index bbcda60927..f6cf8c20a0 100644 --- a/code/modules/research/message_server.dm +++ b/code/modules/research/message_server.dm @@ -130,12 +130,12 @@ var/global/list/obj/machinery/message_server/message_servers = list() if(2) if(!Console.silent) playsound(Console, 'sound/machines/twobeep.ogg', 50, 1) - Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5) + Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5, runemessage = "beep! beep!") Console.message_log += "High Priority message from [sender]
    [authmsg]" else if(!Console.silent) playsound(Console, 'sound/machines/twobeep.ogg', 50, 1) - Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'Message from [sender]'"),,4) + Console.audible_message(text("[bicon(Console)] *The Requests Console beeps: 'Message from [sender]'"),,4, runemessage = "beep beep") Console.message_log += "Message from [sender]
    [authmsg]" Console.set_light(2) @@ -364,13 +364,13 @@ var/obj/machinery/blackbox_recorder/blackbox query_insert.Execute() // Sanitize inputs to avoid SQL injection attacks -proc/sql_sanitize_text(var/text) +/proc/sql_sanitize_text(var/text) text = replacetext(text, "'", "''") text = replacetext(text, ";", "") text = replacetext(text, "&", "") return text -proc/feedback_set(var/variable,var/value) +/proc/feedback_set(var/variable,var/value) if(!blackbox) return variable = sql_sanitize_text(variable) @@ -381,7 +381,7 @@ proc/feedback_set(var/variable,var/value) FV.set_value(value) -proc/feedback_inc(var/variable,var/value) +/proc/feedback_inc(var/variable,var/value) if(!blackbox) return variable = sql_sanitize_text(variable) @@ -392,7 +392,7 @@ proc/feedback_inc(var/variable,var/value) FV.inc(value) -proc/feedback_dec(var/variable,var/value) +/proc/feedback_dec(var/variable,var/value) if(!blackbox) return variable = sql_sanitize_text(variable) @@ -403,7 +403,7 @@ proc/feedback_dec(var/variable,var/value) FV.dec(value) -proc/feedback_set_details(var/variable,var/details) +/proc/feedback_set_details(var/variable,var/details) if(!blackbox) return variable = sql_sanitize_text(variable) @@ -415,7 +415,7 @@ proc/feedback_set_details(var/variable,var/details) FV.set_details(details) -proc/feedback_add_details(var/variable,var/details) +/proc/feedback_add_details(var/variable,var/details) if(!blackbox) return variable = sql_sanitize_text(variable) diff --git a/code/modules/scripting/AST/AST Nodes.dm b/code/modules/scripting/AST/AST Nodes.dm index 6853697ebf..1bc6eb5cd9 100644 --- a/code/modules/scripting/AST/AST Nodes.dm +++ b/code/modules/scripting/AST/AST Nodes.dm @@ -41,23 +41,20 @@ var /* Class: node */ -/node - proc - ToString() - return "[src.type]" +/node/proc/ToString() + return "[src.type]" /* Class: identifier */ /node/identifier - var - id_name + var/id_name - New(id) - .=..() - src.id_name=id +/node/identifier/New(id) + .=..() + src.id_name=id - ToString() - return id_name +/node/identifier/ToString() + return id_name /* Class: expression @@ -68,72 +65,64 @@ var See and for subtypes. */ /node/expression/operator - var - node/expression/exp - tmp - name - precedence + var/node/expression/exp + var/tmp/name + var/tmp/precedence - New() - .=..() - if(!src.name) src.name="[src.type]" +/node/expression/operator/New() + .=..() + if(!src.name) src.name="[src.type]" - ToString() - return "operator: [name]" +/node/expression/operator/ToString() + return "operator: [name]" /* Class: FunctionCall */ /node/expression/FunctionCall //Function calls can also be expressions or statements. - var - func_name - node/identifier/object - list/parameters=new + var/func_name + var/node/identifier/object + var/list/parameters = list() /* Class: literal */ /node/expression/value/literal - var - value + var/value - New(value) - .=..() - src.value=value +/node/expression/value/literal/New(value) + .=..() + src.value=value - ToString() - return src.value +/node/expression/value/literal/ToString() + return src.value /* Class: variable */ /node/expression/value/variable - var - node - object //Either a node/identifier or another node/expression/value/variable which points to the object - node/identifier - id + var/node/object //Either a node/identifier or another node/expression/value/variable which points to the object + var/node/identifier/id - New(ident) - .=..() - id=ident - if(istext(id))id=new(id) +/node/expression/value/variable/New(ident) + .=..() + id=ident + if(istext(id))id=new(id) - ToString() - return src.id.ToString() +/node/expression/value/variable/ToString() + return src.id.ToString() /* Class: reference */ /node/expression/value/reference - var - datum/value + var/datum/value - New(value) - .=..() - src.value=value +/node/expression/value/reference/New(value) + .=..() + src.value=value - ToString() - return "ref: [src.value] ([src.value.type])" \ No newline at end of file +/node/expression/value/reference/ToString() + return "ref: [src.value] ([src.value.type])" \ No newline at end of file diff --git a/code/modules/scripting/AST/Blocks.dm b/code/modules/scripting/AST/Blocks.dm index 18f408f1f1..c992d7b4fa 100644 --- a/code/modules/scripting/AST/Blocks.dm +++ b/code/modules/scripting/AST/Blocks.dm @@ -9,12 +9,10 @@ and not just in the global scope as in many languages. */ /node/BlockDefinition - var/list - statements = new - functions = new - initial_variables = new + var/list/statements = list() + var/list/functions = list() + var/list/initial_variables = list() - proc /* Proc: SetVar Defines a permanent variable. The variable will not be deleted when it goes out of scope. @@ -26,8 +24,8 @@ See Also: - */ - SetVar(name, value) - initial_variables[name]=value +/node/BlockDefinition/proc/SetVar(name, value) + initial_variables[name]=value /* @@ -35,14 +33,13 @@ A block object representing the global scope. */ // - GlobalBlock - New() - initial_variables["null"]=null - return ..() +/node/BlockDefinition/GlobalBlock/New() + initial_variables["null"]=null + return ..() /* Class: FunctionBlock A block representing a function body. */ // - FunctionBlock \ No newline at end of file +/node/BlockDefinition/FunctionBlock \ No newline at end of file diff --git a/code/modules/scripting/AST/Operators/Binary Operators.dm b/code/modules/scripting/AST/Operators/Binary Operators.dm index 8df19879cf..e191ba348c 100644 --- a/code/modules/scripting/AST/Operators/Binary Operators.dm +++ b/code/modules/scripting/AST/Operators/Binary Operators.dm @@ -16,48 +16,48 @@ Returns true if x = y. */ // - Equal - precedence=OOP_EQUAL +/node/expression/operator/binary/Equal + precedence=OOP_EQUAL /* Class: NotEqual Returns true if x and y aren't equal. */ // - NotEqual - precedence=OOP_EQUAL +/node/expression/operator/binary/NotEqual + precedence=OOP_EQUAL /* Class: Greater Returns true if x > y. */ // - Greater - precedence=OOP_COMPARE +/node/expression/operator/binary/Greater + precedence=OOP_COMPARE /* Class: Less Returns true if x < y. */ // - Less - precedence=OOP_COMPARE +/node/expression/operator/binary/Less + precedence=OOP_COMPARE /* Class: GreaterOrEqual Returns true if x >= y. */ // - GreaterOrEqual - precedence=OOP_COMPARE +/node/expression/operator/binary/GreaterOrEqual + precedence=OOP_COMPARE /* Class: LessOrEqual Returns true if x <= y. */ // - LessOrEqual - precedence=OOP_COMPARE +/node/expression/operator/binary/LessOrEqual + precedence=OOP_COMPARE ////////// Logical Operators ////////// @@ -67,24 +67,24 @@ Returns true if x and y are true. */ // - LogicalAnd - precedence=OOP_AND +/node/expression/operator/binary/LogicalAnd + precedence=OOP_AND /* Class: LogicalOr Returns true if x, y, or both are true. */ // - LogicalOr - precedence=OOP_OR +/node/expression/operator/binary/LogicalOr + precedence=OOP_OR /* Class: LogicalXor Returns true if either x or y but not both are true. */ // - LogicalXor //Not implemented in nS - precedence=OOP_OR +/node/expression/operator/binary/LogicalXor //Not implemented in nS + precedence=OOP_OR ////////// Bitwise Operators ////////// @@ -97,8 +97,8 @@ 011 & 110 = 010 */ // - BitwiseAnd - precedence=OOP_BIT +/node/expression/operator/binary/BitwiseAnd + precedence=OOP_BIT /* Class: BitwiseOr @@ -108,8 +108,8 @@ 011 | 110 = 111 */ // - BitwiseOr - precedence=OOP_BIT +/node/expression/operator/binary/BitwiseOr + precedence=OOP_BIT /* Class: BitwiseXor @@ -119,8 +119,8 @@ 011 xor 110 = 101 */ // - BitwiseXor - precedence=OOP_BIT +/node/expression/operator/binary/BitwiseXor + precedence=OOP_BIT ////////// Arithmetic Operators ////////// @@ -130,45 +130,45 @@ Returns the sum of x and y. */ // - Add - precedence=OOP_ADD +/node/expression/operator/binary/Add + precedence=OOP_ADD /* Class: Subtract Returns the difference of x and y. */ // - Subtract - precedence=OOP_ADD +/node/expression/operator/binary/Subtract + precedence=OOP_ADD /* Class: Multiply Returns the product of x and y. */ // - Multiply - precedence=OOP_MULTIPLY +/node/expression/operator/binary/Multiply + precedence=OOP_MULTIPLY /* Class: Divide Returns the quotient of x and y. */ // - Divide - precedence=OOP_MULTIPLY +/node/expression/operator/binary/Divide + precedence=OOP_MULTIPLY /* Class: Power Returns x raised to the power of y. */ // - Power - precedence=OOP_POW +/node/expression/operator/binary/Power + precedence=OOP_POW /* Class: Modulo Returns the remainder of x / y. */ // - Modulo - precedence=OOP_MULTIPLY +/node/expression/operator/binary/Modulo + precedence=OOP_MULTIPLY diff --git a/code/modules/scripting/AST/Operators/Unary Operators.dm b/code/modules/scripting/AST/Operators/Unary Operators.dm index 3a5f3ffb96..b49984ba18 100644 --- a/code/modules/scripting/AST/Operators/Unary Operators.dm +++ b/code/modules/scripting/AST/Operators/Unary Operators.dm @@ -16,8 +16,8 @@ !true = false and !false = true */ // - LogicalNot - name="logical not" +/node/expression/operator/unary/LogicalNot + name="logical not" /* Class: BitwiseNot @@ -27,25 +27,25 @@ ~10 (decimal 2) = 01 (decimal 1). */ // - BitwiseNot - name="bitwise not" +/node/expression/operator/unary/BitwiseNot + name="bitwise not" /* Class: Minus Returns -x. */ // - Minus - name="minus" +/node/expression/operator/unary/Minus + name="minus" /* Class: group A special unary operator representing a value in parentheses. */ // - group - precedence=OOP_GROUP +/node/expression/operator/unary/group + precedence=OOP_GROUP - New(node/expression/exp) - src.exp=exp - return ..() +/node/expression/operator/unary/New(node/expression/exp) + src.exp=exp + return ..() diff --git a/code/modules/scripting/AST/Statements.dm b/code/modules/scripting/AST/Statements.dm index e60fcb389c..eba7b71ae5 100644 --- a/code/modules/scripting/AST/Statements.dm +++ b/code/modules/scripting/AST/Statements.dm @@ -11,22 +11,20 @@ Represents a call to a function. */ // - FunctionCall - var - func_name - node/identifier/object - list/parameters=new +/node/statement/FunctionCall + var/func_name + var/node/identifier/object + var/list/parameters=list() /* Class: FunctionDefinition Defines a function. */ // - FunctionDefinition - var - func_name - list/parameters=new - node/BlockDefinition/FunctionBlock/block +/node/statement/FunctionDefinition + var/func_name + var/list/parameters=list() + var/node/BlockDefinition/FunctionBlock/block /* Class: VariableAssignment @@ -40,13 +38,10 @@ - */ // - VariableAssignment - var - node - identifier - object - var_name - expression/value +/node/statement/VariableAssignment + var/node/identifier/object + var/node/identifier/var_name + var/node/expression/value /* Class: VariableDeclaration @@ -56,67 +51,56 @@ - */ // - VariableDeclaration - var - node - identifier - object - var_name +/node/statement/VariableDeclaration + var/node/identifier/object + var/node/identifier/var_name /* Class: IfStatement */ // - IfStatement - var - node - BlockDefinition - block - else_block //may be null - expression/cond +/node/statement/IfStatement + var/node/BlockDefinition/block + var/node/BlockDefinition/else_block // may be null + var/node/expression/cond /* Class: WhileLoop Loops while a given condition is true. */ // - WhileLoop - var - node - BlockDefinition/block - expression/cond +/node/statement/WhileLoop + var/node/BlockDefinition/block + var/node/expression/cond /* Class: ForLoop Loops while test is true, initializing a variable, increasing the variable */ - ForLoop - var - node - BlockDefinition/block - expression/test - expression/init - expression/increment +/node/statement/ForLoop + var/node/BlockDefinition/block + var/node/expression/test + var/node/expression/init + var/node/expression/increment /* Class: BreakStatement Ends a loop. */ // - BreakStatement +/node/statement/BreakStatement /* Class: ContinueStatement Skips to the next iteration of a loop. */ // - ContinueStatement +/node/statement/ContinueStatement /* Class: ReturnStatement Ends the function and returns a value. */ // - ReturnStatement - var - node/expression/value \ No newline at end of file +/node/statement/ReturnStatement + var/node/expression/value \ No newline at end of file diff --git a/code/modules/scripting/Errors.dm b/code/modules/scripting/Errors.dm index 5b722d007c..8a47bf1c28 100644 --- a/code/modules/scripting/Errors.dm +++ b/code/modules/scripting/Errors.dm @@ -6,127 +6,117 @@ An error scanning or parsing the source code. */ /scriptError - var -/* - Var: message - A message describing the problem. -*/ - message - New(msg=null) - if(msg)message=msg + var/message /// A message describing the problem. +/scriptError/New(msg=null) + if(msg)message=msg - BadToken - message="Unexpected token: " - var/token/token - New(token/t) - token=t - if(t&&t.line) message="[t.line]: [message]" - if(istype(t))message+="[t.value]" - else message+="[t]" +/scriptError/BadToken + message="Unexpected token: " + var/token/token +/scriptError/BadToken/New(token/t) + token=t + if(t&&t.line) message="[t.line]: [message]" + if(istype(t))message+="[t.value]" + else message+="[t]" - InvalidID - parent_type=/scriptError/BadToken - message="Invalid identifier name: " +/scriptError/InvalidID + parent_type=/scriptError/BadToken + message="Invalid identifier name: " - ReservedWord - parent_type=/scriptError/BadToken - message="Identifer using reserved word: " +/scriptError/ReservedWord + parent_type=/scriptError/BadToken + message="Identifer using reserved word: " - BadNumber - parent_type=/scriptError/BadToken - message = "Bad number: " +/scriptError/BadNumber + parent_type=/scriptError/BadToken + message = "Bad number: " - BadReturn - var/token/token - message = "Unexpected return statement outside of a function." - New(token/t) - src.token=t +/scriptError/BadReturn + var/token/token + message = "Unexpected return statement outside of a function." +/scriptError/BadReturn/New(token/t) + src.token=t - EndOfFile - message = "Unexpected end of file." +/scriptError/EndOfFile + message = "Unexpected end of file." - ExpectedToken - message="Expected: '" - New(id, token/T) - if(T && T.line) message="[T.line]: [message]" - message+="[id]'. " - if(T)message+="Found '[T.value]'." +/scriptError/ExpectedToken + message="Expected: '" +/scriptError/ExpectedToken/New(id, token/T) + if(T && T.line) message="[T.line]: [message]" + message+="[id]'. " + if(T)message+="Found '[T.value]'." - UnterminatedComment - message="Unterminated multi-line comment statement: expected */" +/scriptError/UnterminatedComment + message="Unterminated multi-line comment statement: expected */" - DuplicateFunction - New(name, token/t) - message="Function '[name]' defined twice." +/scriptError/DuplicateFunction + message="Function defined twice." +/scriptError/DuplicateFunction/New(name, token/t) + message="Function '[name]' defined twice." /* Class: runtimeError An error thrown by the interpreter in running the script. */ /runtimeError - var - name -/* - Var: message - A basic description as to what went wrong. -*/ - message - stack/stack + var/name + var/message /// A basic description as to what went wrong. + var/stack/stack - proc -/* - Proc: ToString - Returns a description of the error suitable for showing to the user. -*/ - ToString() - . = "[name]: [message]" - if(!stack.Top()) return - .+="\nStack:" - while(stack.Top()) - var/node/statement/FunctionCall/stmt=stack.Pop() - . += "\n\t [stmt.func_name]()" +/** + * Proc: ToString + * Returns a description of the error suitable for showing to the user. + */ +/runtimeError/proc/ToString() + . = "[name]: [message]" + if(!stack.Top()) return + .+="\nStack:" + while(stack.Top()) + var/node/statement/FunctionCall/stmt=stack.Pop() + . += "\n\t [stmt.func_name]()" - TypeMismatch - name="TypeMismatchError" - New(op, a, b) - message="Type mismatch: '[a]' [op] '[b]'" +/runtimeError/TypeMismatch + name="TypeMismatchError" +/runtimeError/TypeMismatch/New(op, a, b) + message="Type mismatch: '[a]' [op] '[b]'" - UnexpectedReturn - name="UnexpectedReturnError" - message="Unexpected return statement." +/runtimeError/UnexpectedReturn + name="UnexpectedReturnError" + message="Unexpected return statement." - UnknownInstruction - name="UnknownInstructionError" - message="Unknown instruction type. This may be due to incompatible compiler and interpreter versions or a lack of implementation." +/runtimeError/UnknownInstruction + name="UnknownInstructionError" + message="Unknown instruction type. This may be due to incompatible compiler and interpreter versions or a lack of implementation." - UndefinedVariable - name="UndefinedVariableError" - New(variable) - message="Variable '[variable]' has not been declared." +/runtimeError/UndefinedVariable + name="UndefinedVariableError" +/runtimeError/UndefinedVariable/New(variable) + message="Variable '[variable]' has not been declared." - UndefinedFunction - name="UndefinedFunctionError" - New(function) - message="Function '[function]()' has not been defined." +/runtimeError/UndefinedFunction + name="UndefinedFunctionError" +/runtimeError/UndefinedFunction/New(function) + message="Function '[function]()' has not been defined." - DuplicateVariableDeclaration - name="DuplicateVariableError" - New(variable) - message="Variable '[variable]' was already declared." +/runtimeError/DuplicateVariableDeclaration + name="DuplicateVariableError" +/runtimeError/DuplicateVariableDeclaration/New(variable) + message="Variable '[variable]' was already declared." - IterationLimitReached - name="MaxIterationError" - message="A loop has reached its maximum number of iterations." +/runtimeError/IterationLimitReached + name="MaxIterationError" + message="A loop has reached its maximum number of iterations." - RecursionLimitReached - name="MaxRecursionError" - message="The maximum amount of recursion has been reached." +/runtimeError/RecursionLimitReached + name="MaxRecursionError" + message="The maximum amount of recursion has been reached." - DivisionByZero - name="DivideByZeroError" - message="Division by zero attempted." +/runtimeError/DivisionByZero + name="DivideByZeroError" + message="Division by zero attempted." - MaxCPU - name="MaxComputationalUse" - message="Maximum amount of computational cycles reached (>= 1000)." \ No newline at end of file +/runtimeError/MaxCPU + name="MaxComputationalUse" + message="Maximum amount of computational cycles reached (>= 1000)." \ No newline at end of file diff --git a/code/modules/scripting/IDE.dm b/code/modules/scripting/IDE.dm index 8adc021c4d..5b6ea4daf0 100644 --- a/code/modules/scripting/IDE.dm +++ b/code/modules/scripting/IDE.dm @@ -1,4 +1,4 @@ -client/verb/tcssave() +/client/verb/tcssave() set hidden = 1 if(mob.machine || issilicon(mob)) if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || issilicon(mob)) @@ -25,7 +25,7 @@ client/verb/tcssave() src << output("Failed to save: Unable to locate machine. (Back up your code before exiting the window!)", "tcserror") -client/verb/tcscompile() +/client/verb/tcscompile() set hidden = 1 if(mob.machine || issilicon(mob)) if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) )) @@ -76,7 +76,7 @@ client/verb/tcscompile() src << output(null, "tcserror") src << output("Failed to compile: Unable to locate machine. (Back up your code before exiting the window!)", "tcserror") -client/verb/tcsrun() +/client/verb/tcsrun() set hidden = 1 if(mob.machine || issilicon(mob)) if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) )) @@ -142,7 +142,7 @@ client/verb/tcsrun() src << output("Failed to run: Unable to locate machine. (Back up your code before exiting the window!)", "tcserror") -client/verb/exittcs() +/client/verb/exittcs() set hidden = 1 if(mob.machine || issilicon(mob)) if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) )) @@ -154,7 +154,7 @@ client/verb/exittcs() if(mob in Machine.viewingcode) Machine.viewingcode.Remove(mob) -client/verb/tcsrevert() +/client/verb/tcsrevert() set hidden = 1 if(mob.machine || issilicon(mob)) if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) )) @@ -183,7 +183,7 @@ client/verb/tcsrevert() src << output("Failed to revert: Unable to locate machine.", "tcserror") -client/verb/tcsclearmem() +/client/verb/tcsclearmem() set hidden = 1 if(mob.machine || issilicon(mob)) if((istype(mob.machine, /obj/machinery/computer/telecomms/traffic) && (mob.machine in view(1, mob))) || (issilicon(mob) && istype(mob.machine, /obj/machinery/computer/telecomms/traffic) )) diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm index 98052576d4..40efd55ba1 100644 --- a/code/modules/scripting/Implementations/Telecomms.dm +++ b/code/modules/scripting/Implementations/Telecomms.dm @@ -7,269 +7,275 @@ /n_Interpreter/TCS_Interpreter var/datum/TCS_Compiler/Compiler - HandleError(runtimeError/e) - Compiler.Holder.add_entry(e.ToString(), "Execution Error") +/n_Interpreter/TCS_Interpreter/HandleError(runtimeError/e) + Compiler.Holder.add_entry(e.ToString(), "Execution Error") /datum/TCS_Compiler var/n_Interpreter/TCS_Interpreter/interpreter var/obj/machinery/telecomms/server/Holder // the server that is running the code var/ready = 1 // 1 if ready to run code - /* -- Compile a raw block of text -- */ + /** Proc: Compile + * Compile a raw block of text into a program + * Returns: List of errors + */ - proc/Compile(code as message) - var/n_scriptOptions/nS_Options/options = new() - var/n_Scanner/nS_Scanner/scanner = new(code, options) - var/list/tokens = scanner.Scan() - var/n_Parser/nS_Parser/parser = new(tokens, options) - var/node/BlockDefinition/GlobalBlock/program = parser.Parse() +/datum/TCS_Compiler/proc/Compile(code as message) + var/n_scriptOptions/nS_Options/options = new() + var/n_Scanner/nS_Scanner/scanner = new(code, options) + var/list/tokens = scanner.Scan() + var/n_Parser/nS_Parser/parser = new(tokens, options) + var/node/BlockDefinition/GlobalBlock/program = parser.Parse() - var/list/returnerrors = list() + var/list/returnerrors = list() - returnerrors += scanner.errors - returnerrors += parser.errors - - if(returnerrors.len) - return returnerrors - - interpreter = new(program) - interpreter.persist = 1 - interpreter.Compiler= src + returnerrors += scanner.errors + returnerrors += parser.errors + if(returnerrors.len) return returnerrors + interpreter = new(program) + interpreter.persist = 1 + interpreter.Compiler= src + + return returnerrors + /* -- Execute the compiled code -- */ +/** Proc: Run + * Executes the compiled code. + * Arguments: + * var/datum/signal/signal - a telecomms signal + * Returns: None + */ +/datum/TCS_Compiler/proc/Run(var/datum/signal/signal) - proc/Run(var/datum/signal/signal) + if(!ready) + return - if(!ready) - return + if(!interpreter) + return - if(!interpreter) - return + interpreter.container = src - interpreter.container = src + interpreter.SetVar("PI" , 3.141592653) // value of pi + interpreter.SetVar("E" , 2.718281828) // value of e + interpreter.SetVar("SQURT2" , 1.414213562) // value of the square root of 2 + interpreter.SetVar("FALSE" , 0) // boolean shortcut to 0 + interpreter.SetVar("TRUE" , 1) // boolean shortcut to 1 - interpreter.SetVar("PI" , 3.141592653) // value of pi - interpreter.SetVar("E" , 2.718281828) // value of e - interpreter.SetVar("SQURT2" , 1.414213562) // value of the square root of 2 - interpreter.SetVar("FALSE" , 0) // boolean shortcut to 0 - interpreter.SetVar("TRUE" , 1) // boolean shortcut to 1 + interpreter.SetVar("NORTH" , NORTH) // NORTH (1) + interpreter.SetVar("SOUTH" , SOUTH) // SOUTH (2) + interpreter.SetVar("EAST" , EAST) // EAST (4) + interpreter.SetVar("WEST" , WEST) // WEST (8) - interpreter.SetVar("NORTH" , NORTH) // NORTH (1) - interpreter.SetVar("SOUTH" , SOUTH) // SOUTH (2) - interpreter.SetVar("EAST" , EAST) // EAST (4) - interpreter.SetVar("WEST" , WEST) // WEST (8) + // Channel macros + interpreter.SetVar("$common", PUB_FREQ) + interpreter.SetVar("$science", SCI_FREQ) + interpreter.SetVar("$command", COMM_FREQ) + interpreter.SetVar("$medical", MED_FREQ) + interpreter.SetVar("$engineering",ENG_FREQ) + interpreter.SetVar("$security", SEC_FREQ) + interpreter.SetVar("$supply", SUP_FREQ) + interpreter.SetVar("$explorer", EXP_FREQ) - // Channel macros - interpreter.SetVar("$common", PUB_FREQ) - interpreter.SetVar("$science", SCI_FREQ) - interpreter.SetVar("$command", COMM_FREQ) - interpreter.SetVar("$medical", MED_FREQ) - interpreter.SetVar("$engineering",ENG_FREQ) - interpreter.SetVar("$security", SEC_FREQ) - interpreter.SetVar("$supply", SUP_FREQ) - interpreter.SetVar("$explorer", EXP_FREQ) + // Signal data - // Signal data + interpreter.SetVar("$content", signal.data["message"]) + interpreter.SetVar("$freq" , signal.frequency) + interpreter.SetVar("$source" , signal.data["name"]) + interpreter.SetVar("$job" , signal.data["job"]) + interpreter.SetVar("$sign" , signal) + interpreter.SetVar("$pass" , !(signal.data["reject"])) // if the signal isn't rejected, pass = 1; if the signal IS rejected, pass = 0 - interpreter.SetVar("$content", signal.data["message"]) - interpreter.SetVar("$freq" , signal.frequency) - interpreter.SetVar("$source" , signal.data["name"]) - interpreter.SetVar("$job" , signal.data["job"]) - interpreter.SetVar("$sign" , signal) - interpreter.SetVar("$pass" , !(signal.data["reject"])) // if the signal isn't rejected, pass = 1; if the signal IS rejected, pass = 0 + // Set up the script procs - // Set up the script procs + /* + -> Send another signal to a server + @format: broadcast(content, frequency, source, job) - /* - -> Send another signal to a server - @format: broadcast(content, frequency, source, job) + @param content: Message to broadcast + @param frequency: Frequency to broadcast to + @param source: The name of the source you wish to imitate. Must be stored in stored_names list. + @param job: The name of the job. + */ + interpreter.SetProc("broadcast", "tcombroadcast", signal, list("message", "freq", "source", "job")) - @param content: Message to broadcast - @param frequency: Frequency to broadcast to - @param source: The name of the source you wish to imitate. Must be stored in stored_names list. - @param job: The name of the job. - */ - interpreter.SetProc("broadcast", "tcombroadcast", signal, list("message", "freq", "source", "job")) + /* + -> Store a value permanently to the server machine (not the actual game hosting machine, the ingame machine) + @format: mem(address, value) - /* - -> Store a value permanently to the server machine (not the actual game hosting machine, the ingame machine) - @format: mem(address, value) + @param address: The memory address (string index) to store a value to + @param value: The value to store to the memory address + */ + interpreter.SetProc("mem", "mem", signal, list("address", "value")) - @param address: The memory address (string index) to store a value to - @param value: The value to store to the memory address - */ - interpreter.SetProc("mem", "mem", signal, list("address", "value")) + /* + -> Delay code for a given amount of deciseconds + @format: sleep(time) - /* - -> Delay code for a given amount of deciseconds - @format: sleep(time) + @param time: time to sleep in deciseconds (1/10th second) + */ + interpreter.SetProc("sleep", /proc/delay) - @param time: time to sleep in deciseconds (1/10th second) - */ - interpreter.SetProc("sleep", /proc/delay) + /* + -> Replaces a string with another string + @format: replace(string, substring, replacestring) - /* - -> Replaces a string with another string - @format: replace(string, substring, replacestring) + @param string: the string to search for substrings (best used with $content$ constant) + @param substring: the substring to search for + @param replacestring: the string to replace the substring with - @param string: the string to search for substrings (best used with $content$ constant) - @param substring: the substring to search for - @param replacestring: the string to replace the substring with + */ + interpreter.SetProc("replace", /proc/string_replacetext) - */ - interpreter.SetProc("replace", /proc/string_replacetext) + /* + -> Locates an element/substring inside of a list or string + @format: find(haystack, needle, start = 1, end = 0) - /* - -> Locates an element/substring inside of a list or string - @format: find(haystack, needle, start = 1, end = 0) + @param haystack: the container to search + @param needle: the element to search for + @param start: the position to start in + @param end: the position to end in - @param haystack: the container to search - @param needle: the element to search for - @param start: the position to start in - @param end: the position to end in + */ + interpreter.SetProc("find", /proc/smartfind) - */ - interpreter.SetProc("find", /proc/smartfind) + /* + -> Finds the length of a string or list + @format: length(container) - /* - -> Finds the length of a string or list - @format: length(container) + @param container: the list or container to measure - @param container: the list or container to measure + */ + interpreter.SetProc("length", /proc/smartlength) - */ - interpreter.SetProc("length", /proc/smartlength) + /* -- Clone functions, carried from default BYOND procs --- */ - /* -- Clone functions, carried from default BYOND procs --- */ + // vector namespace + interpreter.SetProc("vector", /proc/n_list) + interpreter.SetProc("at", /proc/n_listpos) + interpreter.SetProc("copy", /proc/n_listcopy) + interpreter.SetProc("push_back", /proc/n_listadd) + interpreter.SetProc("remove", /proc/n_listremove) + interpreter.SetProc("cut", /proc/n_listcut) + interpreter.SetProc("swap", /proc/n_listswap) + interpreter.SetProc("insert", /proc/n_listinsert) - // vector namespace - interpreter.SetProc("vector", /proc/n_list) - interpreter.SetProc("at", /proc/n_listpos) - interpreter.SetProc("copy", /proc/n_listcopy) - interpreter.SetProc("push_back", /proc/n_listadd) - interpreter.SetProc("remove", /proc/n_listremove) - interpreter.SetProc("cut", /proc/n_listcut) - interpreter.SetProc("swap", /proc/n_listswap) - interpreter.SetProc("insert", /proc/n_listinsert) + interpreter.SetProc("pick", /proc/n_pick) + interpreter.SetProc("prob", /proc/prob_chance) + interpreter.SetProc("substr", /proc/docopytext) - interpreter.SetProc("pick", /proc/n_pick) - interpreter.SetProc("prob", /proc/prob_chance) - interpreter.SetProc("substr", /proc/docopytext) + // Donkie~ + // Strings + interpreter.SetProc("lower", /proc/n_lower) + interpreter.SetProc("upper", /proc/n_upper) + interpreter.SetProc("explode", /proc/string_explode) + interpreter.SetProc("repeat", /proc/n_repeat) + interpreter.SetProc("reverse", /proc/n_reverse) + interpreter.SetProc("tonum", /proc/n_str2num) - // Donkie~ - // Strings - interpreter.SetProc("lower", /proc/n_lower) - interpreter.SetProc("upper", /proc/n_upper) - interpreter.SetProc("explode", /proc/string_explode) - interpreter.SetProc("repeat", /proc/n_repeat) - interpreter.SetProc("reverse", /proc/n_reverse) - interpreter.SetProc("tonum", /proc/n_str2num) - - // Numbers - interpreter.SetProc("tostring", /proc/n_num2str) - interpreter.SetProc("sqrt", /proc/n_sqrt) - interpreter.SetProc("abs", /proc/n_abs) - interpreter.SetProc("floor", /proc/n_floor) - interpreter.SetProc("ceil", /proc/n_ceil) - interpreter.SetProc("round", /proc/n_round) - interpreter.SetProc("clamp", /proc/n_clamp) - interpreter.SetProc("inrange", /proc/n_inrange) - // End of Donkie~ + // Numbers + interpreter.SetProc("tostring", /proc/n_num2str) + interpreter.SetProc("sqrt", /proc/n_sqrt) + interpreter.SetProc("abs", /proc/n_abs) + interpreter.SetProc("floor", /proc/n_floor) + interpreter.SetProc("ceil", /proc/n_ceil) + interpreter.SetProc("round", /proc/n_round) + interpreter.SetProc("clamp", /proc/n_clamp) + interpreter.SetProc("inrange", /proc/n_inrange) + // End of Donkie~ - // Run the compiled code - interpreter.Run() + // Run the compiled code + interpreter.Run() - // Backwards-apply variables onto signal data - /* sanitize EVERYTHING. fucking players can't be trusted with SHIT */ + // Backwards-apply variables onto signal data + /* sanitize EVERYTHING. fucking players can't be trusted with SHIT */ - signal.data["message"] = interpreter.GetVar("$content") - signal.frequency = interpreter.GetVar("$freq") + signal.data["message"] = interpreter.GetVar("$content") + signal.frequency = interpreter.GetVar("$freq") - var/setname = "" - var/obj/machinery/telecomms/server/S = signal.data["server"] - if(interpreter.GetVar("$source") in S.stored_names) - setname = interpreter.GetVar("$source") - else - setname = "[interpreter.GetVar("$source")]" + var/setname = "" + var/obj/machinery/telecomms/server/S = signal.data["server"] + if(interpreter.GetVar("$source") in S.stored_names) + setname = interpreter.GetVar("$source") + else + setname = "[interpreter.GetVar("$source")]" - if(signal.data["name"] != setname) - signal.data["realname"] = setname - signal.data["name"] = setname - signal.data["job"] = interpreter.GetVar("$job") - signal.data["reject"] = !(interpreter.GetVar("$pass")) // set reject to the opposite of $pass + if(signal.data["name"] != setname) + signal.data["realname"] = setname + signal.data["name"] = setname + signal.data["job"] = interpreter.GetVar("$job") + signal.data["reject"] = !(interpreter.GetVar("$pass")) // set reject to the opposite of $pass - // If the message is invalid, just don't broadcast it! - if(signal.data["message"] == "" || !signal.data["message"]) - signal.data["reject"] = 1 + // If the message is invalid, just don't broadcast it! + if(signal.data["message"] == "" || !signal.data["message"]) + signal.data["reject"] = 1 /* -- Actual language proc code -- */ -datum/signal +/datum/signal/proc/mem(var/address, var/value) - proc/mem(var/address, var/value) - - if(istext(address)) - var/obj/machinery/telecomms/server/S = data["server"] - - if(!value && value != 0) - return S.memory[address] - - else - S.memory[address] = value - - - proc/tcombroadcast(var/message, var/freq, var/source, var/job) - - var/datum/signal/newsign = new + if(istext(address)) var/obj/machinery/telecomms/server/S = data["server"] - var/obj/item/device/radio/hradio = S.server_radio - if(!hradio) - error("[src] has no radio.") - return + if(!value && value != 0) + return S.memory[address] - if((!message || message == "") && message != 0) - message = "*beep*" - if(!source) - source = "[html_encode(uppertext(S.id))]" - hradio = new // sets the hradio as a radio intercom - if(!freq) - freq = PUB_FREQ - if(findtext(num2text(freq), ".")) // if the frequency has been set as a decimal - freq *= 10 // shift the decimal one place - - if(!job) - job = "?" - - newsign.data["mob"] = null - newsign.data["mobtype"] = /mob/living/carbon/human - if(source in S.stored_names) - newsign.data["name"] = source else - newsign.data["name"] = "[html_encode(uppertext(source))]" - newsign.data["realname"] = newsign.data["name"] - newsign.data["job"] = job - newsign.data["compression"] = 0 - newsign.data["message"] = message - newsign.data["type"] = 2 // artificial broadcast - if(!isnum(freq)) - freq = text2num(freq) - newsign.frequency = freq - - var/datum/radio_frequency/connection = radio_controller.return_frequency(freq) - newsign.data["connection"] = connection + S.memory[address] = value - newsign.data["radio"] = hradio - newsign.data["vmessage"] = message - newsign.data["vname"] = source - newsign.data["vmask"] = 0 - newsign.data["level"] = list() +/datum/signal/proc/tcombroadcast(var/message, var/freq, var/source, var/job) - var/pass = S.relay_information(newsign, "/obj/machinery/telecomms/hub") - if(!pass) - S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters + var/datum/signal/newsign = new + var/obj/machinery/telecomms/server/S = data["server"] + var/obj/item/device/radio/hradio = S.server_radio + + if(!hradio) + error("[src] has no radio.") + return + + if((!message || message == "") && message != 0) + message = "*beep*" + if(!source) + source = "[html_encode(uppertext(S.id))]" + hradio = new // sets the hradio as a radio intercom + if(!freq) + freq = PUB_FREQ + if(findtext(num2text(freq), ".")) // if the frequency has been set as a decimal + freq *= 10 // shift the decimal one place + + if(!job) + job = "?" + + newsign.data["mob"] = null + newsign.data["mobtype"] = /mob/living/carbon/human + if(source in S.stored_names) + newsign.data["name"] = source + else + newsign.data["name"] = "[html_encode(uppertext(source))]" + newsign.data["realname"] = newsign.data["name"] + newsign.data["job"] = job + newsign.data["compression"] = 0 + newsign.data["message"] = message + newsign.data["type"] = 2 // artificial broadcast + if(!isnum(freq)) + freq = text2num(freq) + newsign.frequency = freq + + var/datum/radio_frequency/connection = radio_controller.return_frequency(freq) + newsign.data["connection"] = connection + + + newsign.data["radio"] = hradio + newsign.data["vmessage"] = message + newsign.data["vname"] = source + newsign.data["vmask"] = 0 + newsign.data["level"] = list() + + var/pass = S.relay_information(newsign, "/obj/machinery/telecomms/hub") + if(!pass) + S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters diff --git a/code/modules/scripting/Implementations/_Logic.dm b/code/modules/scripting/Implementations/_Logic.dm index 5522d0e2aa..f1b828cbdf 100644 --- a/code/modules/scripting/Implementations/_Logic.dm +++ b/code/modules/scripting/Implementations/_Logic.dm @@ -137,7 +137,7 @@ /* //Makes a list where all indicies in a string is a seperate index in the list // JUST A HELPER DON'T ADD TO NTSCRIPT -proc/string_tolist(var/string) +/proc/string_tolist(var/string) var/list/L = new/list() var/i @@ -146,7 +146,7 @@ proc/string_tolist(var/string) return L -proc/string_explode(var/string, var/separator) +/proc/string_explode(var/string, var/separator) if(istext(string)) if(istext(separator) && separator == "") return string_tolist(string) @@ -165,11 +165,11 @@ proc/string_explode(var/string, var/separator) Just found out there was already a string explode function, did some benchmarking, and that function were a bit faster, sticking to that. */ -proc/string_explode(var/string, var/separator) +/proc/string_explode(var/string, var/separator) if(istext(string) && istext(separator)) return splittext(string, separator) -proc/n_repeat(var/string, var/amount) +/proc/n_repeat(var/string, var/amount) if(istext(string) && isnum(amount)) var/i var/newstring = "" @@ -182,7 +182,7 @@ proc/n_repeat(var/string, var/amount) return newstring -proc/n_reverse(var/string) +/proc/n_reverse(var/string) if(istext(string)) var/newstring = "" var/i @@ -194,44 +194,44 @@ proc/n_reverse(var/string) return newstring // I don't know if it's neccesary to make my own proc, but I think I have to to be able to check for istext. -proc/n_str2num(var/string) +/proc/n_str2num(var/string) if(istext(string)) return text2num(string) // Number shit -proc/n_num2str(var/num) +/proc/n_num2str(var/num) if(isnum(num)) return num2text(num) // Squareroot -proc/n_sqrt(var/num) +/proc/n_sqrt(var/num) if(isnum(num)) return sqrt(num) // Magnitude of num -proc/n_abs(var/num) +/proc/n_abs(var/num) if(isnum(num)) return abs(num) // Round down -proc/n_floor(var/num) +/proc/n_floor(var/num) if(isnum(num)) return round(num) // Round up -proc/n_ceil(var/num) +/proc/n_ceil(var/num) if(isnum(num)) return round(num)+1 // Round to nearest integer -proc/n_round(var/num) +/proc/n_round(var/num) if(isnum(num)) if(num-round(num)<0.5) return round(num) return n_ceil(num) // Clamps N between min and max -proc/n_clamp(var/num, var/min=-1, var/max=1) +/proc/n_clamp(var/num, var/min=-1, var/max=1) if(isnum(num)&&isnum(min)&&isnum(max)) if(num<=min) return min @@ -240,7 +240,7 @@ proc/n_clamp(var/num, var/min=-1, var/max=1) return num // Returns 1 if N is inbetween Min and Max -proc/n_inrange(var/num, var/min=-1, var/max=1) +/proc/n_inrange(var/num, var/min=-1, var/max=1) if(isnum(num)&&isnum(min)&&isnum(max)) return ((min <= num) && (num <= max)) // END OF BY DONKIE :( diff --git a/code/modules/scripting/Interpreter/Evaluation.dm b/code/modules/scripting/Interpreter/Evaluation.dm index 02cdc929c5..cfdc797ce4 100644 --- a/code/modules/scripting/Interpreter/Evaluation.dm +++ b/code/modules/scripting/Interpreter/Evaluation.dm @@ -1,169 +1,167 @@ /proc/isobject(x) - return (istype(x, /datum) || istype(x, /list) || istype(x, /savefile) || istype(x, /client) || (x==world)) + return !(isnum(x) || istext(x)) -/n_Interpreter - proc - Eval(node/expression/exp) - if(istype(exp, /node/expression/FunctionCall)) - return RunFunction(exp) - else if(istype(exp, /node/expression/operator)) - return EvalOperator(exp) - else if(istype(exp, /node/expression/value/literal)) - var/node/expression/value/literal/lit=exp - return lit.value - else if(istype(exp, /node/expression/value/reference)) - var/node/expression/value/reference/ref=exp - return ref.value - else if(istype(exp, /node/expression/value/variable)) - var/node/expression/value/variable/v=exp - if(!v.object) - return Eval(GetVariable(v.id.id_name)) - else - var/datum/D - if(istype(v.object, /node/identifier)) - D=GetVariable(v.object:id_name) - else - D=v.object - D=Eval(D) - if(!isobject(D)) - return null - if(!D.vars.Find(v.id.id_name)) - RaiseError(new/runtimeError/UndefinedVariable("[v.object.ToString()].[v.id.id_name]")) - return null - return Eval(D.vars[v.id.id_name]) - else if(istype(exp, /node/expression)) +/n_Interpreter/proc/Eval(node/expression/exp) + if(istype(exp, /node/expression/FunctionCall)) + return RunFunction(exp) + else if(istype(exp, /node/expression/operator)) + return EvalOperator(exp) + else if(istype(exp, /node/expression/value/literal)) + var/node/expression/value/literal/lit=exp + return lit.value + else if(istype(exp, /node/expression/value/reference)) + var/node/expression/value/reference/ref=exp + return ref.value + else if(istype(exp, /node/expression/value/variable)) + var/node/expression/value/variable/v=exp + if(!v.object) + return Eval(GetVariable(v.id.id_name)) + else + var/datum/D + if(istype(v.object, /node/identifier)) + D=GetVariable(v.object:id_name) + else + D=v.object + D=Eval(D) + if(!isobject(D)) + return null + if(!D.vars.Find(v.id.id_name)) + RaiseError(new/runtimeError/UndefinedVariable("[v.object.ToString()].[v.id.id_name]")) + return null + return Eval(D.vars[v.id.id_name]) + else if(istype(exp, /node/expression)) + RaiseError(new/runtimeError/UnknownInstruction()) + else + return exp + +/n_Interpreter/proc/EvalOperator(node/expression/operator/exp) + if(istype(exp, /node/expression/operator/binary)) + var/node/expression/operator/binary/bin=exp + switch(bin.type) + if(/node/expression/operator/binary/Equal) + return Equal(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/NotEqual) + return NotEqual(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Greater) + return Greater(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Less) + return Less(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/GreaterOrEqual) + return GreaterOrEqual(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/LessOrEqual) + return LessOrEqual(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/LogicalAnd) + return LogicalAnd(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/LogicalOr) + return LogicalOr(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/LogicalXor) + return LogicalXor(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/BitwiseAnd) + return BitwiseAnd(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/BitwiseOr) + return BitwiseOr(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/BitwiseXor) + return BitwiseXor(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Add) + return Add(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Subtract) + return Subtract(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Multiply) + return Multiply(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Divide) + return Divide(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Power) + return Power(Eval(bin.exp), Eval(bin.exp2)) + if(/node/expression/operator/binary/Modulo) + return Modulo(Eval(bin.exp), Eval(bin.exp2)) + else RaiseError(new/runtimeError/UnknownInstruction()) - else - return exp - - EvalOperator(node/expression/operator/exp) - if(istype(exp, /node/expression/operator/binary)) - var/node/expression/operator/binary/bin=exp - switch(bin.type) - if(/node/expression/operator/binary/Equal) - return Equal(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/NotEqual) - return NotEqual(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Greater) - return Greater(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Less) - return Less(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/GreaterOrEqual) - return GreaterOrEqual(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/LessOrEqual) - return LessOrEqual(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/LogicalAnd) - return LogicalAnd(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/LogicalOr) - return LogicalOr(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/LogicalXor) - return LogicalXor(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/BitwiseAnd) - return BitwiseAnd(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/BitwiseOr) - return BitwiseOr(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/BitwiseXor) - return BitwiseXor(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Add) - return Add(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Subtract) - return Subtract(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Multiply) - return Multiply(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Divide) - return Divide(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Power) - return Power(Eval(bin.exp), Eval(bin.exp2)) - if(/node/expression/operator/binary/Modulo) - return Modulo(Eval(bin.exp), Eval(bin.exp2)) - else - RaiseError(new/runtimeError/UnknownInstruction()) - else - switch(exp.type) - if(/node/expression/operator/unary/Minus) - return Minus(Eval(exp.exp)) - if(/node/expression/operator/unary/LogicalNot) - return LogicalNot(Eval(exp.exp)) - if(/node/expression/operator/unary/BitwiseNot) - return BitwiseNot(Eval(exp.exp)) - if(/node/expression/operator/unary/group) - return Eval(exp.exp) - else - RaiseError(new/runtimeError/UnknownInstruction()) + return + switch(exp.type) + if(/node/expression/operator/unary/Minus) + return Minus(Eval(exp.exp)) + if(/node/expression/operator/unary/LogicalNot) + return LogicalNot(Eval(exp.exp)) + if(/node/expression/operator/unary/BitwiseNot) + return BitwiseNot(Eval(exp.exp)) + if(/node/expression/operator/unary/group) + return Eval(exp.exp) + else + RaiseError(new/runtimeError/UnknownInstruction()) - //Binary// - //Comparison operators - Equal(a, b) return a==b - NotEqual(a, b) return a!=b //LogicalNot(Equal(a, b)) - Greater(a, b) return a>b - Less(a, b) return a=b - LessOrEqual(a, b) return a<=b - //Logical Operators - LogicalAnd(a, b) return a&&b - LogicalOr(a, b) return a||b - LogicalXor(a, b) return (a||b) && !(a&&b) - //Bitwise Operators - BitwiseAnd(a, b) return a&b - BitwiseOr(a, b) return a|b - BitwiseXor(a, b) return a^b - //Arithmetic Operators - Add(a, b) - if(istext(a)&&!istext(b)) b="[b]" - else if(istext(b)&&!istext(a)) a="[a]" - if(isobject(a) && !isobject(b)) - RaiseError(new/runtimeError/TypeMismatch("+", a, b)) - return null - else if(isobject(b) && !isobject(a)) - RaiseError(new/runtimeError/TypeMismatch("+", a, b)) - return null - return a+b - Subtract(a, b) - if(isobject(a) && !isobject(b)) - RaiseError(new/runtimeError/TypeMismatch("-", a, b)) - return null - else if(isobject(b) && !isobject(a)) - RaiseError(new/runtimeError/TypeMismatch("-", a, b)) - return null - return a-b - Divide(a, b) - if(isobject(a) && !isobject(b)) - RaiseError(new/runtimeError/TypeMismatch("/", a, b)) - return null - else if(isobject(b) && !isobject(a)) - RaiseError(new/runtimeError/TypeMismatch("/", a, b)) - return null - if(b==0) - RaiseError(new/runtimeError/DivisionByZero()) - return null - return a/b - Multiply(a, b) - if(isobject(a) && !isobject(b)) - RaiseError(new/runtimeError/TypeMismatch("*", a, b)) - return null - else if(isobject(b) && !isobject(a)) - RaiseError(new/runtimeError/TypeMismatch("*", a, b)) - return null - return a*b - Modulo(a, b) - if(isobject(a) && !isobject(b)) - RaiseError(new/runtimeError/TypeMismatch("%", a, b)) - return null - else if(isobject(b) && !isobject(a)) - RaiseError(new/runtimeError/TypeMismatch("%", a, b)) - return null - return a%b - Power(a, b) - if(isobject(a) && !isobject(b)) - RaiseError(new/runtimeError/TypeMismatch("**", a, b)) - return null - else if(isobject(b) && !isobject(a)) - RaiseError(new/runtimeError/TypeMismatch("**", a, b)) - return null - return a**b +//Binary// + //Comparison operators +/n_Interpreter/proc/Equal(a, b) return a==b +/n_Interpreter/proc/NotEqual(a, b) return a!=b //LogicalNot(Equal(a, b)) +/n_Interpreter/proc/Greater(a, b) return a>b +/n_Interpreter/proc/Less(a, b) return a=b +/n_Interpreter/proc/LessOrEqual(a, b) return a<=b + //Logical Operators +/n_Interpreter/proc/LogicalAnd(a, b) return a&&b +/n_Interpreter/proc/LogicalOr(a, b) return a||b +/n_Interpreter/proc/LogicalXor(a, b) return (a||b) && !(a&&b) + //Bitwise Operators +/n_Interpreter/proc/BitwiseAnd(a, b) return a&b +/n_Interpreter/proc/BitwiseOr(a, b) return a|b +/n_Interpreter/proc/BitwiseXor(a, b) return a^b + //Arithmetic Operators +/n_Interpreter/proc/Add(a, b) + if(istext(a)&&!istext(b)) b="[b]" + else if(istext(b)&&!istext(a)) a="[a]" + if(isobject(a) && !isobject(b)) + RaiseError(new/runtimeError/TypeMismatch("+", a, b)) + return null + else if(isobject(b) && !isobject(a)) + RaiseError(new/runtimeError/TypeMismatch("+", a, b)) + return null + return a+b +/n_Interpreter/proc/Subtract(a, b) + if(isobject(a) && !isobject(b)) + RaiseError(new/runtimeError/TypeMismatch("-", a, b)) + return null + else if(isobject(b) && !isobject(a)) + RaiseError(new/runtimeError/TypeMismatch("-", a, b)) + return null + return a-b +/n_Interpreter/proc/Divide(a, b) + if(isobject(a) && !isobject(b)) + RaiseError(new/runtimeError/TypeMismatch("/", a, b)) + return null + else if(isobject(b) && !isobject(a)) + RaiseError(new/runtimeError/TypeMismatch("/", a, b)) + return null + if(b==0) + RaiseError(new/runtimeError/DivisionByZero()) + return null + return a/b +/n_Interpreter/proc/Multiply(a, b) + if(isobject(a) && !isobject(b)) + RaiseError(new/runtimeError/TypeMismatch("*", a, b)) + return null + else if(isobject(b) && !isobject(a)) + RaiseError(new/runtimeError/TypeMismatch("*", a, b)) + return null + return a*b +/n_Interpreter/proc/Modulo(a, b) + if(isobject(a) && !isobject(b)) + RaiseError(new/runtimeError/TypeMismatch("%", a, b)) + return null + else if(isobject(b) && !isobject(a)) + RaiseError(new/runtimeError/TypeMismatch("%", a, b)) + return null + return a%b +/n_Interpreter/proc/Power(a, b) + if(isobject(a) && !isobject(b)) + RaiseError(new/runtimeError/TypeMismatch("**", a, b)) + return null + else if(isobject(b) && !isobject(a)) + RaiseError(new/runtimeError/TypeMismatch("**", a, b)) + return null + return a**b - //Unary// - Minus(a) return -a - LogicalNot(a) return !a - BitwiseNot(a) return ~a \ No newline at end of file +//Unary// +/n_Interpreter/proc/Minus(a) return -a +/n_Interpreter/proc/LogicalNot(a) return !a +/n_Interpreter/proc/BitwiseNot(a) return ~a \ No newline at end of file diff --git a/code/modules/scripting/Interpreter/Interaction.dm b/code/modules/scripting/Interpreter/Interaction.dm index f0b7c988d2..231281a0c9 100644 --- a/code/modules/scripting/Interpreter/Interaction.dm +++ b/code/modules/scripting/Interpreter/Interaction.dm @@ -6,9 +6,7 @@ Class: n_Interpreter Procedures allowing for interaction with the script that is being run by the interpreter object. */ - /n_Interpreter - proc /* Proc: Load @@ -17,22 +15,22 @@ Parameters: program - A object which represents the script's global scope. */ - Load(node/BlockDefinition/GlobalBlock/program) - ASSERT(program) - src.program = program - CreateGlobalScope() +/n_Interpreter/proc/Load(node/BlockDefinition/GlobalBlock/program) + ASSERT(program) + src.program = program + CreateGlobalScope() /* Proc: Run Runs the script. */ - Run() - cur_recursion = 0 // reset recursion - cur_statements = 0 // reset CPU tracking - alertadmins = 0 +/n_Interpreter/proc/Run() + cur_recursion = 0 // reset recursion + cur_statements = 0 // reset CPU tracking + alertadmins = 0 - ASSERT(src.program) - RunBlock(src.program) + ASSERT(src.program) + RunBlock(src.program) /* Proc: SetVar @@ -45,11 +43,11 @@ See Also: - */ - SetVar(name, value) - if(!istext(name)) - //CRASH("Invalid variable name") - return - AssignVariable(name, value) +/n_Interpreter/proc/SetVar(name, value) + if(!istext(name)) + //CRASH("Invalid variable name") + return + AssignVariable(name, value) /* Proc: SetProc @@ -61,40 +59,40 @@ object - (Optional) An object which will the be target of a function call. params - Only required if object is not null, a list of the names of parameters the proc takes. */ - SetProc(name, path, object=null, list/params=null) - if(!istext(name)) - //CRASH("Invalid function name") - return - if(!object) - globalScope.functions[name] = path - else - var/node/statement/FunctionDefinition/S = new() - S.func_name = name - S.parameters = params - S.block = new() - S.block.SetVar("src", object) - var/node/expression/FunctionCall/C = new() - C.func_name = path - C.object = new("src") - for(var/p in params) - C.parameters += new/node/expression/value/variable(p) - var/node/statement/ReturnStatement/R=new() - R.value=C - S.block.statements += R - globalScope.functions[name] = S +/n_Interpreter/proc/SetProc(name, path, object=null, list/params=null) + if(!istext(name)) + //CRASH("Invalid function name") + return + if(!object) + globalScope.functions[name] = path + return + var/node/statement/FunctionDefinition/S = new() + S.func_name = name + S.parameters = params + S.block = new() + S.block.SetVar("src", object) + var/node/expression/FunctionCall/C = new() + C.func_name = path + C.object = new("src") + for(var/p in params) + C.parameters += new/node/expression/value/variable(p) + var/node/statement/ReturnStatement/R=new() + R.value=C + S.block.statements += R + globalScope.functions[name] = S /* Proc: VarExists Checks whether a global variable with the specified name exists. */ - VarExists(name) - return globalScope.variables.Find(name) //convert to 1/0 first? +/n_Interpreter/proc/VarExists(name) + return globalScope.variables.Find(name) //convert to 1/0 first? /* Proc: ProcExists Checks whether a global function with the specified name exists. */ - ProcExists(name) - return globalScope.functions.Find(name) +/n_Interpreter/proc/ProcExists(name) + return globalScope.functions.Find(name) /* Proc: GetVar @@ -103,12 +101,12 @@ See Also: - */ - GetVar(name) - if(!VarExists(name)) - //CRASH("No variable named '[name]'.") - return - var/x = globalScope.variables[name] - return Eval(x) +/n_Interpreter/proc/GetVar(name) + if(!VarExists(name)) + //CRASH("No variable named '[name]'.") + return + var/x = globalScope.variables[name] + return Eval(x) /* Proc: CallProc @@ -118,19 +116,19 @@ See Also: - */ - CallProc(name, params[]=null) - if(!ProcExists(name)) - //CRASH("No function named '[name]'.") - return - var/node/statement/FunctionDefinition/func = globalScope.functions[name] - if(istype(func)) - var/node/statement/FunctionCall/stmt = new - stmt.func_name = func.func_name - stmt.parameters = params - return RunFunction(stmt) - else - return call(func)(arglist(params)) - //CRASH("Unknown function type '[name]'.") +/n_Interpreter/proc/CallProc(name, params[]=null) + if(!ProcExists(name)) + //CRASH("No function named '[name]'.") + return + var/node/statement/FunctionDefinition/func = globalScope.functions[name] + if(istype(func)) + var/node/statement/FunctionCall/stmt = new + stmt.func_name = func.func_name + stmt.parameters = params + return RunFunction(stmt) + else + return call(func)(arglist(params)) + //CRASH("Unknown function type '[name]'.") /* Event: HandleError @@ -139,4 +137,4 @@ See Also: - */ - HandleError(runtimeError/e) \ No newline at end of file +/n_Interpreter/proc/HandleError(runtimeError/e) \ No newline at end of file diff --git a/code/modules/scripting/Interpreter/Interpreter.dm b/code/modules/scripting/Interpreter/Interpreter.dm index 70849ffa15..efdf1f7651 100644 --- a/code/modules/scripting/Interpreter/Interpreter.dm +++ b/code/modules/scripting/Interpreter/Interpreter.dm @@ -14,301 +14,296 @@ #define BREAKING 2 #define CONTINUING 4 /n_Interpreter - var - scope - curScope - globalScope - node - BlockDefinition/program - statement/FunctionDefinition/curFunction - stack - scopes = new() - functions = new() + var/scope/curScope + var/scope/globalScope + var/node/BlockDefinition/program + var/node/statement/FunctionDefinition/curFunction + var/stack/scopes = new() + var/stack/functions = new() - datum/container // associated container for interpeter + var/datum/container // associated container for interpeter /* Var: status A variable indicating that the rest of the current block should be skipped. This may be set to any combination of . */ - status=0 - returnVal + var/status=0 + var/returnVal - max_statements=1000 // maximum amount of statements that can be called in one execution. this is to prevent massive crashes and exploitation - cur_statements=0 // current amount of statements called - alertadmins=0 // set to 1 if the admins shouldn't be notified of anymore issues - max_iterations=100 // max number of uninterrupted loops possible - max_recursion=50 // max recursions without returning anything (or completing the code block) - cur_recursion=0 // current amount of recursion + var/max_statements=1000 // maximum amount of statements that can be called in one execution. this is to prevent massive crashes and exploitation + var/cur_statements=0 // current amount of statements called + var/alertadmins=0 // set to 1 if the admins shouldn't be notified of anymore issues + var/max_iterations=100 // max number of uninterrupted loops possible + var/max_recursion=50 // max recursions without returning anything (or completing the code block) + var/cur_recursion=0 // current amount of recursion /* Var: persist If 0, global variables will be reset after Run() finishes. */ - persist=1 - paused=0 + var/persist=1 + var/paused=0 /* Constructor: New Calls with the given parameters. */ - New(node/BlockDefinition/GlobalBlock/program=null) - .=..() - if(program)Load(program) +/n_Interpreter/New(node/BlockDefinition/GlobalBlock/program=null) + .=..() + if(program)Load(program) - proc /* Proc: RaiseError Raises a runtime error. */ - RaiseError(runtimeError/e) - e.stack=functions.Copy() - e.stack.Push(curFunction) - src.HandleError(e) +/n_Interpreter/proc/RaiseError(runtimeError/e) + e.stack=functions.Copy() + e.stack.Push(curFunction) + src.HandleError(e) - CreateScope(node/BlockDefinition/B) - var/scope/S = new(B, curScope) - scopes.Push(curScope) - curScope = S - return S +/n_Interpreter/proc/CreateScope(node/BlockDefinition/B) + var/scope/S = new(B, curScope) + scopes.Push(curScope) + curScope = S + return S - CreateGlobalScope() - scopes.Clear() - var/scope/S = new(program, null) - globalScope = S - return S +/n_Interpreter/proc/CreateGlobalScope() + scopes.Clear() + var/scope/S = new(program, null) + globalScope = S + return S /* - Proc: RunBlock - Runs each statement in a block of code. +Proc: RunBlock +Runs each statement in a block of code. */ - RunBlock(node/BlockDefinition/Block, scope/scope = null) - var/is_global = istype(Block, /node/BlockDefinition/GlobalBlock) - if(!is_global) - if(scope) - curScope = scope +/n_Interpreter/proc/RunBlock(node/BlockDefinition/Block, scope/scope = null) + var/is_global = istype(Block, /node/BlockDefinition/GlobalBlock) + if(!is_global) + if(scope) + curScope = scope + else + CreateScope(Block) + else + if(!persist) + CreateGlobalScope() + curScope = globalScope + + if(cur_statements < max_statements) + + for(var/node/statement/S in Block.statements) + while(paused) sleep(10) + + cur_statements++ + if(cur_statements >= max_statements) + RaiseError(new/runtimeError/MaxCPU()) + + if(container && !alertadmins) + if(istype(container, /datum/TCS_Compiler)) + var/datum/TCS_Compiler/Compiler = container + var/obj/machinery/telecomms/server/Holder = Compiler.Holder + var/message = "Potential crash-inducing NTSL script detected at telecommunications server [Compiler.Holder] ([Holder.x], [Holder.y], [Holder.z])." + + alertadmins = 1 + message_admins(message, 1) + break + + if(istype(S, /node/statement/VariableAssignment)) + var/node/statement/VariableAssignment/stmt = S + var/name = stmt.var_name.id_name + if(!stmt.object) + // Below we assign the variable first to null if it doesn't already exist. + // This is necessary for assignments like +=, and when the variable is used in a function + // If the variable already exists in a different block, then AssignVariable will automatically use that one. + if(!IsVariableAccessible(name)) + AssignVariable(name, null) + AssignVariable(name, Eval(stmt.value)) else - CreateScope(Block) + var/datum/D = Eval(GetVariable(stmt.object.id_name)) + if(!D) return + D.vars[stmt.var_name.id_name] = Eval(stmt.value) + else if(istype(S, /node/statement/VariableDeclaration)) + //VariableDeclaration nodes are used to forcibly declare a local variable so that one in a higher scope isn't used by default. + var/node/statement/VariableDeclaration/dec=S + if(!dec.object) + AssignVariable(dec.var_name.id_name, null, curScope) + else + var/datum/D = Eval(GetVariable(dec.object.id_name)) + if(!D) return + D.vars[dec.var_name.id_name] = null + else if(istype(S, /node/statement/FunctionCall)) + RunFunction(S) + else if(istype(S, /node/statement/FunctionDefinition)) + //do nothing + else if(istype(S, /node/statement/WhileLoop)) + RunWhile(S) + else if(istype(S, /node/statement/IfStatement)) + RunIf(S) + else if(istype(S, /node/statement/ReturnStatement)) + if(!curFunction) + RaiseError(new/runtimeError/UnexpectedReturn()) + continue + status |= RETURNING + returnVal=Eval(S:value) + break + else if(istype(S, /node/statement/BreakStatement)) + status |= BREAKING + break + else if(istype(S, /node/statement/ContinueStatement)) + status |= CONTINUING + break else - if(!persist) - CreateGlobalScope() - curScope = globalScope + RaiseError(new/runtimeError/UnknownInstruction()) + if(status) + break - if(cur_statements < max_statements) - - for(var/node/statement/S in Block.statements) - while(paused) sleep(10) - - cur_statements++ - if(cur_statements >= max_statements) - RaiseError(new/runtimeError/MaxCPU()) - - if(container && !alertadmins) - if(istype(container, /datum/TCS_Compiler)) - var/datum/TCS_Compiler/Compiler = container - var/obj/machinery/telecomms/server/Holder = Compiler.Holder - var/message = "Potential crash-inducing NTSL script detected at telecommunications server [Compiler.Holder] ([Holder.x], [Holder.y], [Holder.z])." - - alertadmins = 1 - message_admins(message, 1) - break - - if(istype(S, /node/statement/VariableAssignment)) - var/node/statement/VariableAssignment/stmt = S - var/name = stmt.var_name.id_name - if(!stmt.object) - // Below we assign the variable first to null if it doesn't already exist. - // This is necessary for assignments like +=, and when the variable is used in a function - // If the variable already exists in a different block, then AssignVariable will automatically use that one. - if(!IsVariableAccessible(name)) - AssignVariable(name, null) - AssignVariable(name, Eval(stmt.value)) - else - var/datum/D = Eval(GetVariable(stmt.object.id_name)) - if(!D) return - D.vars[stmt.var_name.id_name] = Eval(stmt.value) - else if(istype(S, /node/statement/VariableDeclaration)) - //VariableDeclaration nodes are used to forcibly declare a local variable so that one in a higher scope isn't used by default. - var/node/statement/VariableDeclaration/dec=S - if(!dec.object) - AssignVariable(dec.var_name.id_name, null, curScope) - else - var/datum/D = Eval(GetVariable(dec.object.id_name)) - if(!D) return - D.vars[dec.var_name.id_name] = null - else if(istype(S, /node/statement/FunctionCall)) - RunFunction(S) - else if(istype(S, /node/statement/FunctionDefinition)) - //do nothing - else if(istype(S, /node/statement/WhileLoop)) - RunWhile(S) - else if(istype(S, /node/statement/IfStatement)) - RunIf(S) - else if(istype(S, /node/statement/ReturnStatement)) - if(!curFunction) - RaiseError(new/runtimeError/UnexpectedReturn()) - continue - status |= RETURNING - returnVal=Eval(S:value) - break - else if(istype(S, /node/statement/BreakStatement)) - status |= BREAKING - break - else if(istype(S, /node/statement/ContinueStatement)) - status |= CONTINUING - break - else - RaiseError(new/runtimeError/UnknownInstruction()) - if(status) - break - - curScope = scopes.Pop() + curScope = scopes.Pop() /* - Proc: RunFunction - Runs a function block or a proc with the arguments specified in the script. +Proc: RunFunction +Runs a function block or a proc with the arguments specified in the script. */ - RunFunction(node/statement/FunctionCall/stmt) - //Note that anywhere /node/statement/FunctionCall/stmt is used so may /node/expression/FunctionCall +/n_Interpreter/proc/RunFunction(node/statement/FunctionCall/stmt) + //Note that anywhere /node/statement/FunctionCall/stmt is used so may /node/expression/FunctionCall - // If recursion gets too high (max 50 nested functions) throw an error - if(cur_recursion >= max_recursion) - RaiseError(new/runtimeError/RecursionLimitReached()) - return 0 + // If recursion gets too high (max 50 nested functions) throw an error + if(cur_recursion >= max_recursion) + RaiseError(new/runtimeError/RecursionLimitReached()) + return 0 - var/node/statement/FunctionDefinition/def - if(!stmt.object) //A scope's function is being called, stmt.object is null - def = GetFunction(stmt.func_name) - else if(istype(stmt.object)) //A method of an object exposed as a variable is being called, stmt.object is a /node/identifier - var/O = GetVariable(stmt.object.id_name) //Gets a reference to the object which is the target of the function call. - if(!O) return //Error already thrown in GetVariable() - def = Eval(O) + var/node/statement/FunctionDefinition/def + if(!stmt.object) //A scope's function is being called, stmt.object is null + def = GetFunction(stmt.func_name) + else if(istype(stmt.object)) //A method of an object exposed as a variable is being called, stmt.object is a /node/identifier + var/O = GetVariable(stmt.object.id_name) //Gets a reference to the object which is the target of the function call. + if(!O) return //Error already thrown in GetVariable() + def = Eval(O) - if(!def) return + if(!def) return - cur_recursion++ // add recursion - if(istype(def)) - if(curFunction) functions.Push(curFunction) - var/scope/S = CreateScope(def.block) - for(var/i=1 to def.parameters.len) - var/val - if(stmt.parameters.len>=i) - val = stmt.parameters[i] - //else - // unspecified param - AssignVariable(def.parameters[i], new/node/expression/value/literal(Eval(val)), S) - curFunction=stmt - RunBlock(def.block, S) - //Handle return value - . = returnVal - status &= ~RETURNING - returnVal=null - curFunction=functions.Pop() - cur_recursion-- - else - cur_recursion-- - var/list/params=new - for(var/node/expression/P in stmt.parameters) - params+=list(Eval(P)) - if(isobject(def)) //def is an object which is the target of a function call - if( !hascall(def, stmt.func_name) ) - RaiseError(new/runtimeError/UndefinedFunction("[stmt.object.id_name].[stmt.func_name]")) - return - return call(def, stmt.func_name)(arglist(params)) - else //def is a path to a global proc - return call(def)(arglist(params)) + cur_recursion++ // add recursion + if(istype(def)) + if(curFunction) functions.Push(curFunction) + var/scope/S = CreateScope(def.block) + for(var/i=1 to def.parameters.len) + var/val + if(stmt.parameters.len>=i) + val = stmt.parameters[i] //else - // RaiseError(new/runtimeError/UnknownInstruction()) + // unspecified param + AssignVariable(def.parameters[i], new/node/expression/value/literal(Eval(val)), S) + curFunction=stmt + RunBlock(def.block, S) + //Handle return value + . = returnVal + status &= ~RETURNING + returnVal=null + curFunction=functions.Pop() + cur_recursion-- + else + cur_recursion-- + var/list/params=new + for(var/node/expression/P in stmt.parameters) + params+=list(Eval(P)) + if(isobject(def)) //def is an object which is the target of a function call + if( !hascall(def, stmt.func_name) ) + RaiseError(new/runtimeError/UndefinedFunction("[stmt.object.id_name].[stmt.func_name]")) + return + return call(def, stmt.func_name)(arglist(params)) + else //def is a path to a global proc + return call(def)(arglist(params)) + //else + // RaiseError(new/runtimeError/UnknownInstruction()) /* - Proc: RunIf - Checks a condition and runs either the if block or else block. +Proc: RunIf +Checks a condition and runs either the if block or else block. */ - RunIf(node/statement/IfStatement/stmt) - if(Eval(stmt.cond)) - RunBlock(stmt.block) - else if(stmt.else_block) - RunBlock(stmt.else_block) +/n_Interpreter/proc/RunIf(node/statement/IfStatement/stmt) + if(Eval(stmt.cond)) + RunBlock(stmt.block) + else if(stmt.else_block) + RunBlock(stmt.else_block) /* - Proc: RunWhile - Runs a while loop. +Proc: RunWhile +Runs a while loop. */ - RunWhile(node/statement/WhileLoop/stmt) - var/i=1 - while(Eval(stmt.cond) && Iterate(stmt.block, i++)) - continue - status &= ~BREAKING +/n_Interpreter/proc/RunWhile(node/statement/WhileLoop/stmt) + var/i=1 + while(Eval(stmt.cond) && Iterate(stmt.block, i++)) + continue + status &= ~BREAKING /* - Proc:Iterate - Runs a single iteration of a loop. Returns a value indicating whether or not to continue looping. +Proc:Iterate +Runs a single iteration of a loop. Returns a value indicating whether or not to continue looping. */ - Iterate(node/BlockDefinition/block, count) - RunBlock(block) - if(max_iterations > 0 && count >= max_iterations) - RaiseError(new/runtimeError/IterationLimitReached()) - return 0 - if(status & (BREAKING|RETURNING)) - return 0 - status &= ~CONTINUING - return 1 +/n_Interpreter/proc/Iterate(node/BlockDefinition/block, count) + RunBlock(block) + if(max_iterations > 0 && count >= max_iterations) + RaiseError(new/runtimeError/IterationLimitReached()) + return 0 + if(status & (BREAKING|RETURNING)) + return 0 + status &= ~CONTINUING + return 1 /* - Proc: GetFunction - Finds a function in an accessible scope with the given name. Returns a . +Proc: GetFunction +Finds a function in an accessible scope with the given name. Returns a . */ - GetFunction(name) - var/scope/S = curScope - while(S) - if(S.functions.Find(name)) - return S.functions[name] - S = S.parent - RaiseError(new/runtimeError/UndefinedFunction(name)) +/n_Interpreter/proc/GetFunction(name) + var/scope/S = curScope + while(S) + if(S.functions.Find(name)) + return S.functions[name] + S = S.parent + RaiseError(new/runtimeError/UndefinedFunction(name)) /* - Proc: GetVariable - Finds a variable in an accessible scope and returns its value. +Proc: GetVariable +Finds a variable in an accessible scope and returns its value. */ - GetVariable(name) - var/scope/S = curScope - while(S) - if(S.variables.Find(name)) - return S.variables[name] - S = S.parent - RaiseError(new/runtimeError/UndefinedVariable(name)) +/n_Interpreter/proc/GetVariable(name) + var/scope/S = curScope + while(S) + if(S.variables.Find(name)) + return S.variables[name] + S = S.parent + RaiseError(new/runtimeError/UndefinedVariable(name)) - GetVariableScope(name) //needed for when you reassign a variable in a higher scope - var/scope/S = curScope - while(S) - if(S.variables.Find(name)) - return S - S = S.parent +/n_Interpreter/proc/GetVariableScope(name) //needed for when you reassign a variable in a higher scope + var/scope/S = curScope + while(S) + if(S.variables.Find(name)) + return S + S = S.parent - IsVariableAccessible(name) - var/scope/S = curScope - while(S) - if(S.variables.Find(name)) - return TRUE - S = S.parent - return FALSE +/n_Interpreter/proc/IsVariableAccessible(name) + var/scope/S = curScope + while(S) + if(S.variables.Find(name)) + return TRUE + S = S.parent + return FALSE /* - Proc: AssignVariable - Assigns a value to a variable in a specific block. +Proc: AssignVariable +Assigns a value to a variable in a specific block. - Parameters: - name - The name of the variable to assign. - value - The value to assign to it. - S - The scope the variable resides in. If it is null, a scope with the variable already existing is found. If no scopes have a variable of the given name, the current scope is used. +Parameters: +name - The name of the variable to assign. +value - The value to assign to it. +S - The scope the variable resides in. If it is null, a scope with the variable already existing is found. If no scopes have a variable of the given name, the current scope is used. */ - AssignVariable(name, node/expression/value, scope/S=null) - if(!S) S = GetVariableScope(name) - if(!S) S = curScope - if(!S) S = globalScope - ASSERT(istype(S)) - if(istext(value) || isnum(value) || isnull(value)) value = new/node/expression/value/literal(value) - else if(!istype(value) && isobject(value)) value = new/node/expression/value/reference(value) - //TODO: check for invalid name - S.variables["[name]"] = value +/n_Interpreter/proc/AssignVariable(name, node/expression/value, scope/S=null) + if(!S) S = GetVariableScope(name) + if(!S) S = curScope + if(!S) S = globalScope + ASSERT(istype(S)) + if(istext(value) || isnum(value) || isnull(value)) value = new/node/expression/value/literal(value) + else if(!istype(value) && isobject(value)) value = new/node/expression/value/reference(value) + //TODO: check for invalid name + S.variables["[name]"] = value diff --git a/code/modules/scripting/Interpreter/Scope.dm b/code/modules/scripting/Interpreter/Scope.dm index 50da804707..d768e74bf1 100644 --- a/code/modules/scripting/Interpreter/Scope.dm +++ b/code/modules/scripting/Interpreter/Scope.dm @@ -2,17 +2,15 @@ Class: scope A runtime instance of a block. Used internally by the interpreter. */ -scope - var - scope/parent = null - node/BlockDefinition/block - list - functions - variables +/scope/ + var/scope/parent = null + var/node/BlockDefinition/block + var/list/functions + var/list/variables - New(node/BlockDefinition/B, scope/parent) - src.block = B - src.parent = parent - src.variables = B.initial_variables.Copy() - src.functions = B.functions.Copy() - .=..() \ No newline at end of file +/scope/New(node/BlockDefinition/B, scope/parent) + src.block = B + src.parent = parent + src.variables = B.initial_variables.Copy() + src.functions = B.functions.Copy() + .=..() \ No newline at end of file diff --git a/code/modules/scripting/Options.dm b/code/modules/scripting/Options.dm index c8ca1d5830..b113b857be 100644 --- a/code/modules/scripting/Options.dm +++ b/code/modules/scripting/Options.dm @@ -14,69 +14,87 @@ var/const //Ascii values of characters /* Class: n_scriptOptions */ -n_scriptOptions - proc - CanStartID(char) //returns true if the character can start a variable, function, or keyword name (by default letters or an underscore) - if(!isnum(char))char=text2ascii(char) - return (char in ascii_A to ascii_Z) || (char in ascii_a to ascii_z) || char==ascii_UNDERSCORE || char==ascii_DOLLAR +/n_scriptOptions/proc/CanStartID(char) //returns true if the character can start a variable, function, or keyword name (by default letters or an underscore) + if(!isnum(char))char=text2ascii(char) + return (char in ascii_A to ascii_Z) || (char in ascii_a to ascii_z) || char==ascii_UNDERSCORE || char==ascii_DOLLAR - IsValidIDChar(char) //returns true if the character can be in the body of a variable, function, or keyword name (by default letters, numbers, and underscore) - if(!isnum(char))char=text2ascii(char) - return CanStartID(char) || IsDigit(char) +/n_scriptOptions/proc/IsValidIDChar(char) //returns true if the character can be in the body of a variable, function, or keyword name (by default letters, numbers, and underscore) + if(!isnum(char))char=text2ascii(char) + return CanStartID(char) || IsDigit(char) - IsDigit(char) - if(!isnum(char))char=text2ascii(char) - return char in ascii_ZERO to ascii_NINE +/n_scriptOptions/proc/IsDigit(char) + if(!isnum(char))char=text2ascii(char) + return char in ascii_ZERO to ascii_NINE - IsValidID(id) //returns true if all the characters in the string are okay to be in an identifier name - if(!CanStartID(id)) //don't need to grab first char in id, since text2ascii does it automatically - return 0 - if(length(id)==1) return 1 - for(var/i=2 to length(id)) - if(!IsValidIDChar(copytext(id, i, i+1))) - return 0 - return 1 +/n_scriptOptions/proc/IsValidID(id) //returns true if all the characters in the string are okay to be in an identifier name + if(!CanStartID(id)) //don't need to grab first char in id, since text2ascii does it automatically + return 0 + if(length(id)==1) return 1 + for(var/i=2 to length(id)) + if(!IsValidIDChar(copytext(id, i, i+1))) + return 0 + return 1 /* Class: nS_Options An implementation of for the n_Script language. */ - nS_Options - var - list - symbols = list("(", ")", "\[", "]", ";", ",", "{", "}") //scanner - Characters that can be in symbols +/n_scriptOptions/nS_Options + var/list/symbols = list("(", ")", "\[", "]", ";", ",", "{", "}") //scanner - Characters that can be in symbols /* - Var: keywords - An associative list used by the parser to parse keywords. Indices are strings which will trigger the keyword when parsed and the - associated values are types of which the proc will be called. +Var: keywords +An associative list used by the parser to parse keywords. Indices are strings which will trigger the keyword when parsed and the +associated values are types of which the proc will be called. */ - keywords = list("if" = /n_Keyword/nS_Keyword/kwIf, "else" = /n_Keyword/nS_Keyword/kwElse, \ - "while" = /n_Keyword/nS_Keyword/kwWhile, "break" = /n_Keyword/nS_Keyword/kwBreak, \ - "continue" = /n_Keyword/nS_Keyword/kwContinue, \ - "return" = /n_Keyword/nS_Keyword/kwReturn, "def" = /n_Keyword/nS_Keyword/kwDef) + var/list/keywords = list( + "if" = /n_Keyword/nS_Keyword/kwIf, + "else" = /n_Keyword/nS_Keyword/kwElse, + "while" = /n_Keyword/nS_Keyword/kwWhile, + "break" = /n_Keyword/nS_Keyword/kwBreak, + "continue" = /n_Keyword/nS_Keyword/kwContinue, + "return" = /n_Keyword/nS_Keyword/kwReturn, + "def" = /n_Keyword/nS_Keyword/kwDef + ) - list - assign_operators=list("=" = null, "&=" = "&", - "|=" = "|", "`=" = "`", - "+=" = "+", "-=" = "-", - "*=" = "*", "/=" = "/", - "^=" = "^", - "%=" = "%") + var/list/assign_operators = list( + "=" = null, + "&=" = "&", + "|=" = "|", + "`=" = "`", + "+=" = "+", + "-=" = "-", + "*=" = "*", + "/=" = "/", + "^=" = "^", + "%=" = "%" + ) - unary_operators =list("!" = /node/expression/operator/unary/LogicalNot, "~" = /node/expression/operator/unary/BitwiseNot, - "-" = /node/expression/operator/unary/Minus) + var/list/unary_operators =list( + "!" = /node/expression/operator/unary/LogicalNot, + "~" = /node/expression/operator/unary/BitwiseNot, + "-" = /node/expression/operator/unary/Minus + ) - binary_operators=list("==" = /node/expression/operator/binary/Equal, "!=" = /node/expression/operator/binary/NotEqual, - ">" = /node/expression/operator/binary/Greater, "<" = /node/expression/operator/binary/Less, - ">=" = /node/expression/operator/binary/GreaterOrEqual,"<=" = /node/expression/operator/binary/LessOrEqual, - "&&" = /node/expression/operator/binary/LogicalAnd, "||" = /node/expression/operator/binary/LogicalOr, - "&" = /node/expression/operator/binary/BitwiseAnd, "|" = /node/expression/operator/binary/BitwiseOr, - "`" = /node/expression/operator/binary/BitwiseXor, "+" = /node/expression/operator/binary/Add, - "-" = /node/expression/operator/binary/Subtract, "*" = /node/expression/operator/binary/Multiply, - "/" = /node/expression/operator/binary/Divide, "^" = /node/expression/operator/binary/Power, - "%" = /node/expression/operator/binary/Modulo) + var/list/binary_operators=list( + "==" = /node/expression/operator/binary/Equal, + "!=" = /node/expression/operator/binary/NotEqual, + ">" = /node/expression/operator/binary/Greater, + "<" = /node/expression/operator/binary/Less, + ">=" = /node/expression/operator/binary/GreaterOrEqual, + "<=" = /node/expression/operator/binary/LessOrEqual, + "&&" = /node/expression/operator/binary/LogicalAnd, + "||" = /node/expression/operator/binary/LogicalOr, + "&" = /node/expression/operator/binary/BitwiseAnd, + "|" = /node/expression/operator/binary/BitwiseOr, + "`" = /node/expression/operator/binary/BitwiseXor, + "+" = /node/expression/operator/binary/Add, + "-" = /node/expression/operator/binary/Subtract, + "*" = /node/expression/operator/binary/Multiply, + "/" = /node/expression/operator/binary/Divide, + "^" = /node/expression/operator/binary/Power, + "%" = /node/expression/operator/binary/Modulo) - New() - .=..() - for(var/O in assign_operators+binary_operators+unary_operators) - if(!symbols.Find(O)) symbols+=O \ No newline at end of file +/n_scriptOptions/nS_Options/New() + .=..() + for(var/O in assign_operators+binary_operators+unary_operators) + if(!symbols.Find(O)) symbols+=O \ No newline at end of file diff --git a/code/modules/scripting/Parser/Expressions.dm b/code/modules/scripting/Parser/Expressions.dm index 14fa1b297c..eddfdbf679 100644 --- a/code/modules/scripting/Parser/Expressions.dm +++ b/code/modules/scripting/Parser/Expressions.dm @@ -19,294 +19,292 @@ Class: nS_Parser */ /n_Parser/nS_Parser - var /* Var: expecting A variable which keeps track of whether an operator or value is expected. It should be either or . See for more information. */ - expecting=VALUE + var/expecting=VALUE - proc /* Proc: Precedence Compares two operators, decides which is higher in the order of operations, and returns or . */ - Precedence(node/expression/operator/top, node/expression/operator/input) - if(istype(top)) - top=top.precedence - if(istype(input)) - input=input:precedence - if(top>=input) - return REDUCE - return SHIFT +/n_Parser/nS_Parser/proc/Precedence(node/expression/operator/top, node/expression/operator/input) + if(istype(top)) + top=top.precedence + if(istype(input)) + input=input:precedence + if(top>=input) + return REDUCE + return SHIFT /* - Proc: GetExpression - Takes a token expected to represent a value and returns an node. +Proc: GetExpression +Takes a token expected to represent a value and returns an node. */ - GetExpression(token/T) - if(!T) return - if(istype(T, /node/expression)) - return T - switch(T.type) - if(/token/word) - return new/node/expression/value/variable(T.value) - if(/token/accessor) - var/token/accessor/A=T - var/node/expression/value/variable/E//=new(A.member) - var/stack/S=new() - while(istype(A.object, /token/accessor)) - S.Push(A) - A=A.object - ASSERT(istext(A.object)) +/n_Parser/nS_Parser/proc/GetExpression(token/T) + if(!T) return + if(istype(T, /node/expression)) + return T + switch(T.type) + if(/token/word) + return new/node/expression/value/variable(T.value) + if(/token/accessor) + var/token/accessor/A=T + var/node/expression/value/variable/E//=new(A.member) + var/stack/S=new() + while(istype(A.object, /token/accessor)) + S.Push(A) + A=A.object + ASSERT(istext(A.object)) - while(A) - var/node/expression/value/variable/V=new() - V.id=new(A.member) - if(E) - V.object=E - else - V.object=new/node/identifier(A.object) - E=V - A=S.Pop() - return E + while(A) + var/node/expression/value/variable/V=new() + V.id=new(A.member) + if(E) + V.object=E + else + V.object=new/node/identifier(A.object) + E=V + A=S.Pop() + return E - if(/token/number, /token/string) - return new/node/expression/value/literal(T.value) + if(/token/number, /token/string) + return new/node/expression/value/literal(T.value) /* - Proc: GetOperator - Gets a path related to a token or string and returns an instance of the given type. This is used to get an instance of either a binary or unary - operator from a token. +Proc: GetOperator +Gets a path related to a token or string and returns an instance of the given type. This is used to get an instance of either a binary or unary +operator from a token. - Parameters: - O - The input value. If this is a token, O is reset to the token's value. - When O is a string and is in L, its associated value is used as the path to instantiate. - type - The desired type of the returned object. - L - The list in which to search for O. +Parameters: +O - The input value. If this is a token, O is reset to the token's value. + When O is a string and is in L, its associated value is used as the path to instantiate. +type - The desired type of the returned object. +L - The list in which to search for O. - See Also: - - - - +See Also: +- +- */ - GetOperator(O, type=/node/expression/operator, L[]) - if(istype(O, type)) return O //O is already the desired type - if(istype(O, /token)) O=O:value //sets O to text - if(istext(O)) //sets O to path - if(L.Find(O)) O=L[O] - else return null - if(ispath(O))O=new O //catches path from last check - else return null //Unknown type - return O +/n_Parser/nS_Parser/proc/GetOperator(O, type=/node/expression/operator, L[]) + if(istype(O, type)) return O //O is already the desired type + if(istype(O, /token)) O=O:value //sets O to text + if(istext(O)) //sets O to path + if(L.Find(O)) O=L[O] + else return null + if(ispath(O))O=new O //catches path from last check + else return null //Unknown type + return O /* - Proc: GetBinaryOperator - Uses to search for an instance of a binary operator type with which the given string is associated. For example, if - O is set to "+", an node is returned. +Proc: GetBinaryOperator +Uses to search for an instance of a binary operator type with which the given string is associated. For example, if +O is set to "+", an node is returned. - See Also: - - - - +See Also: +- +- */ - GetBinaryOperator(O) - return GetOperator(O, /node/expression/operator/binary, options.binary_operators) +/n_Parser/nS_Parser/proc/GetBinaryOperator(O) + return GetOperator(O, /node/expression/operator/binary, options.binary_operators) /* - Proc: GetUnaryOperator - Uses to search for an instance of a unary operator type with which the given string is associated. For example, if - O is set to "!", a node is returned. +Proc: GetUnaryOperator +Uses to search for an instance of a unary operator type with which the given string is associated. For example, if +O is set to "!", a node is returned. - See Also: - - - - +See Also: +- +- */ - GetUnaryOperator(O) - return GetOperator(O, /node/expression/operator/unary, options.unary_operators) +/n_Parser/nS_Parser/proc/GetUnaryOperator(O) + return GetOperator(O, /node/expression/operator/unary, options.unary_operators) /* - Proc: Reduce - Takes the operator on top of the opr stack and assigns its operand(s). Then this proc pushes the value of that operation to the top - of the val stack. +Proc: Reduce +Takes the operator on top of the opr stack and assigns its operand(s). Then this proc pushes the value of that operation to the top +of the val stack. */ - Reduce(stack/opr, stack/val) - var/node/expression/operator/O=opr.Pop() - if(!O) return - if(!istype(O)) - errors+=new/scriptError("Error reducing expression - invalid operator.") - return - //Take O and assign its operands, popping one or two values from the val stack - //depending on whether O is a binary or unary operator. - if(istype(O, /node/expression/operator/binary)) - var/node/expression/operator/binary/B=O - B.exp2=val.Pop() - B.exp =val.Pop() - val.Push(B) - else - O.exp=val.Pop() - val.Push(O) +/n_Parser/nS_Parser/proc/Reduce(stack/opr, stack/val) + var/node/expression/operator/O=opr.Pop() + if(!O) return + if(!istype(O)) + errors+=new/scriptError("Error reducing expression - invalid operator.") + return + //Take O and assign its operands, popping one or two values from the val stack + //depending on whether O is a binary or unary operator. + if(istype(O, /node/expression/operator/binary)) + var/node/expression/operator/binary/B=O + B.exp2=val.Pop() + B.exp =val.Pop() + val.Push(B) + else + O.exp=val.Pop() + val.Push(O) /* - Proc: EndOfExpression - Returns true if the current token represents the end of an expression. +Proc: EndOfExpression +Returns true if the current token represents the end of an expression. - Parameters: - end - A list of values to compare the current token to. +Parameters: +end - A list of values to compare the current token to. */ - EndOfExpression(end[]) - if(!curToken) - return 1 - if(istype(curToken, /token/symbol) && end.Find(curToken.value)) - return 1 - if(istype(curToken, /token/end) && end.Find(/token/end)) - return 1 - return 0 +/n_Parser/nS_Parser/proc/EndOfExpression(end[]) + if(!curToken) + return 1 + if(istype(curToken, /token/symbol) && end.Find(curToken.value)) + return 1 + if(istype(curToken, /token/end) && end.Find(/token/end)) + return 1 + return 0 /* - Proc: ParseExpression - Uses the Shunting-yard algorithm to parse expressions. +Proc: ParseExpression +Uses the Shunting-yard algorithm to parse expressions. - Notes: - - When an opening parenthesis is found, then is called to handle it. - - The variable helps distinguish unary operators from binary operators (for cases like the - operator, which can be either). +Notes: +- When an opening parenthesis is found, then is called to handle it. +- The variable helps distinguish unary operators from binary operators (for cases like the - operator, which can be either). - Articles: - - - - +Articles: +- +- - See Also: - - - - - - +See Also: +- +- +- */ - ParseExpression(list/end=list(/token/end), list/ErrChars=list("{", "}")) - var/stack/opr=new - var/stack/val=new - src.expecting=VALUE - while(TRUE) - if(EndOfExpression(end)) - break - if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value)) - errors+=new/scriptError/BadToken(curToken) - break +/n_Parser/nS_Parser/proc/ParseExpression(list/end=list(/token/end), list/ErrChars=list("{", "}")) + var/stack/opr=new + var/stack/val=new + src.expecting=VALUE + while(TRUE) + if(EndOfExpression(end)) + break + if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value)) + errors+=new/scriptError/BadToken(curToken) + break - if(index>tokens.len) //End of File - errors+=new/scriptError/EndOfFile() - break - var/token/ntok - if(index+1<=tokens.len) - ntok=tokens[index+1] + if(index>tokens.len) //End of File + errors+=new/scriptError/EndOfFile() + break + var/token/ntok + if(index+1<=tokens.len) + ntok=tokens[index+1] - if(istype(curToken, /token/symbol) && curToken.value=="(") //Parse parentheses expression - if(expecting!=VALUE) - errors+=new/scriptError/ExpectedToken("operator", curToken) - NextToken() - continue - val.Push(ParseParenExpression()) - else if(istype(curToken, /token/symbol)) //Operator found. - var/node/expression/operator/curOperator //Figure out whether it is unary or binary and get a new instance. - if(src.expecting==OPERATOR) - curOperator=GetBinaryOperator(curToken) - if(!curOperator) - errors+=new/scriptError/ExpectedToken("operator", curToken) - NextToken() - continue - else - curOperator=GetUnaryOperator(curToken) - if(!curOperator) //given symbol isn't a unary operator - errors+=new/scriptError/ExpectedToken("expression", curToken) - NextToken() - continue - - if(opr.Top() && Precedence(opr.Top(), curOperator)==REDUCE) //Check order of operations and reduce if necessary - Reduce(opr, val) - continue - opr.Push(curOperator) - src.expecting=VALUE - else if(ntok && ntok.value=="(" && istype(ntok, /token/symbol)\ - && istype(curToken, /token/word)) //Parse function call - var/token/preToken=curToken - var/old_expect=src.expecting - var/fex=ParseFunctionExpression() - if(old_expect!=VALUE) - errors+=new/scriptError/ExpectedToken("operator", preToken) - NextToken() - continue - val.Push(fex) - else if(istype(curToken, /token/keyword)) //inline keywords - var/n_Keyword/kw=options.keywords[curToken.value] - kw=new kw(inline=1) - if(kw) - if(!kw.Parse(src)) - return - else - errors+=new/scriptError/BadToken(curToken) - else if(istype(curToken, /token/end)) //semicolon found where it wasn't expected - errors+=new/scriptError/BadToken(curToken) + if(istype(curToken, /token/symbol) && curToken.value=="(") //Parse parentheses expression + if(expecting!=VALUE) + errors+=new/scriptError/ExpectedToken("operator", curToken) + NextToken() + continue + val.Push(ParseParenExpression()) + else if(istype(curToken, /token/symbol)) //Operator found. + var/node/expression/operator/curOperator //Figure out whether it is unary or binary and get a new instance. + if(src.expecting==OPERATOR) + curOperator=GetBinaryOperator(curToken) + if(!curOperator) + errors+=new/scriptError/ExpectedToken("operator", curToken) NextToken() continue - else - if(expecting!=VALUE) - errors+=new/scriptError/ExpectedToken("operator", curToken) - NextToken() - continue - val.Push(GetExpression(curToken)) - src.expecting=OPERATOR + else + curOperator=GetUnaryOperator(curToken) + if(!curOperator) //given symbol isn't a unary operator + errors+=new/scriptError/ExpectedToken("expression", curToken) + NextToken() + continue + + if(opr.Top() && Precedence(opr.Top(), curOperator)==REDUCE) //Check order of operations and reduce if necessary + Reduce(opr, val) + continue + opr.Push(curOperator) + src.expecting=VALUE + else if(ntok && ntok.value=="(" && istype(ntok, /token/symbol)\ + && istype(curToken, /token/word)) //Parse function call + var/token/preToken=curToken + var/old_expect=src.expecting + var/fex=ParseFunctionExpression() + if(old_expect!=VALUE) + errors+=new/scriptError/ExpectedToken("operator", preToken) NextToken() + continue + val.Push(fex) + else if(istype(curToken, /token/keyword)) //inline keywords + var/n_Keyword/kw=options.keywords[curToken.value] + kw=new kw(inline=1) + if(kw) + if(!kw.Parse(src)) + return + else + errors+=new/scriptError/BadToken(curToken) + else if(istype(curToken, /token/end)) //semicolon found where it wasn't expected + errors+=new/scriptError/BadToken(curToken) + NextToken() + continue + else + if(expecting!=VALUE) + errors+=new/scriptError/ExpectedToken("operator", curToken) + NextToken() + continue + val.Push(GetExpression(curToken)) + src.expecting=OPERATOR + NextToken() - while(opr.Top()) Reduce(opr, val) //Reduce the value stack completely - .=val.Pop() //Return what should be the last value on the stack - if(val.Top()) // - var/node/N=val.Pop() - errors+=new/scriptError("Error parsing expression. Unexpected value left on stack: [N.ToString()].") - return null + while(opr.Top()) Reduce(opr, val) //Reduce the value stack completely + .=val.Pop() //Return what should be the last value on the stack + if(val.Top()) // + var/node/N=val.Pop() + errors+=new/scriptError("Error parsing expression. Unexpected value left on stack: [N.ToString()].") + return null /* - Proc: ParseFunctionExpression - Parses a function call inside of an expression. +Proc: ParseFunctionExpression +Parses a function call inside of an expression. - See Also: - - +See Also: +- */ - ParseFunctionExpression() - var/node/expression/FunctionCall/exp=new - exp.func_name=curToken.value - NextToken() //skip function name - NextToken() //skip open parenthesis, already found - var/loops = 0 +/n_Parser/nS_Parser/proc/ParseFunctionExpression() + var/node/expression/FunctionCall/exp=new + exp.func_name=curToken.value + NextToken() //skip function name + NextToken() //skip open parenthesis, already found + var/loops = 0 - while(TRUE) - loops++ - if(loops>=1000) - CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;") + while(TRUE) + loops++ + if(loops>=1000) + CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;") - if(istype(curToken, /token/symbol) && curToken.value==")") - return exp - exp.parameters+=ParseParamExpression() - if(curToken.value==","&&istype(curToken, /token/symbol))NextToken() //skip comma - if(istype(curToken, /token/end)) //Prevents infinite loop... - errors+=new/scriptError/ExpectedToken(")") - return exp + if(istype(curToken, /token/symbol) && curToken.value==")") + return exp + exp.parameters+=ParseParamExpression() + if(curToken.value==","&&istype(curToken, /token/symbol))NextToken() //skip comma + if(istype(curToken, /token/end)) //Prevents infinite loop... + errors+=new/scriptError/ExpectedToken(")") + return exp /* - Proc: ParseParenExpression - Parses an expression that ends with a close parenthesis. This is used for parsing expressions inside of parentheses. +Proc: ParseParenExpression +Parses an expression that ends with a close parenthesis. This is used for parsing expressions inside of parentheses. - See Also: - - +See Also: +- */ - ParseParenExpression() - if(!CheckToken("(", /token/symbol)) - return - return new/node/expression/operator/unary/group(ParseExpression(list(")"))) +/n_Parser/nS_Parser/proc/ParseParenExpression() + if(!CheckToken("(", /token/symbol)) + return + return new/node/expression/operator/unary/group(ParseExpression(list(")"))) /* - Proc: ParseParamExpression - Parses an expression that ends with either a comma or close parenthesis. This is used for parsing the parameters passed to a function call. +Proc: ParseParamExpression +Parses an expression that ends with either a comma or close parenthesis. This is used for parsing the parameters passed to a function call. - See Also: - - +See Also: +- */ - ParseParamExpression() - return ParseExpression(list(",", ")")) \ No newline at end of file +/n_Parser/nS_Parser/proc/ParseParamExpression() + return ParseExpression(list(",", ")")) \ No newline at end of file diff --git a/code/modules/scripting/Parser/Keywords.dm b/code/modules/scripting/Parser/Keywords.dm index 94e6f41afe..cc68164877 100644 --- a/code/modules/scripting/Parser/Keywords.dm +++ b/code/modules/scripting/Parser/Keywords.dm @@ -12,16 +12,16 @@ var/const/KW_WARN = 3 //Warning var/const/Class: n_Keyword var/const/Represents a special statement in the code triggered by a keyword. */ -/n_Keyword - New(inline=0) - src.inline=inline - return ..() /* Var: inline 1 if the keyword is in an expression (e.g. the new keyword in many languages), 0 otherwise (such as the if and else keywords). */ +/n_Keyword var/inline +/n_Keyword/New(inline=FALSE) + src.inline=inline + return ..() /* Proc: Parse @@ -31,7 +31,7 @@ var/const/Represents a special statement in the code triggered by a keyword. parser - The parser that created this object. You can use the parameter to manipulate the parser in order to add statements and blocks to its AST. */ - proc/Parse(n_Parser/parser) +/n_Keyword/proc/Parse(n_Parser/parser) /* Class: nS_Keyword @@ -43,124 +43,116 @@ var/const/Represents a special statement in the code triggered by a keyword. proc. */ // - nS_Keyword - New(inline=0) - if(inline) - qdel(src) +/n_Keyword/nS_Keyword/New(inline=0) + if(inline) + qdel(src) - kwReturn - Parse(n_Parser/nS_Parser/parser) - .=KW_PASS - if(istype(parser.curBlock, /node/BlockDefinition/GlobalBlock)) - parser.errors+=new/scriptError/BadReturn(parser.curToken) - . = KW_WARN - var/node/statement/ReturnStatement/stmt=new - parser.NextToken() //skip 'return' token - stmt.value=parser.ParseExpression() - parser.curBlock.statements+=stmt +/n_Keyword/nS_Keyword/kwReturn/Parse(n_Parser/nS_Parser/parser) + .=KW_PASS + if(istype(parser.curBlock, /node/BlockDefinition/GlobalBlock)) + parser.errors+=new/scriptError/BadReturn(parser.curToken) + . = KW_WARN + var/node/statement/ReturnStatement/stmt=new + parser.NextToken() //skip 'return' token + stmt.value=parser.ParseExpression() + parser.curBlock.statements+=stmt - kwIf - Parse(n_Parser/nS_Parser/parser) - .=KW_PASS - var/node/statement/IfStatement/stmt=new - parser.NextToken() //skip 'if' token - stmt.cond=parser.ParseParenExpression() - if(!parser.CheckToken(")", /token/symbol)) - return KW_FAIL - if(!parser.CheckToken("{", /token/symbol, skip=0)) //Token needs to be preserved for parse loop, so skip=0 - return KW_ERR - parser.curBlock.statements+=stmt - stmt.block=new - parser.AddBlock(stmt.block) +/n_Keyword/nS_Keyword/kwIf/Parse(n_Parser/nS_Parser/parser) + .=KW_PASS + var/node/statement/IfStatement/stmt=new + parser.NextToken() //skip 'if' token + stmt.cond=parser.ParseParenExpression() + if(!parser.CheckToken(")", /token/symbol)) + return KW_FAIL + if(!parser.CheckToken("{", /token/symbol, skip=0)) //Token needs to be preserved for parse loop, so skip=0 + return KW_ERR + parser.curBlock.statements+=stmt + stmt.block=new + parser.AddBlock(stmt.block) - kwElse - Parse(n_Parser/nS_Parser/parser) - .=KW_PASS - var/list/L=parser.curBlock.statements - var/node/statement/IfStatement/stmt - if(L&&L.len) stmt=L[L.len] //Get the last statement in the current block - if(!stmt || !istype(stmt) || stmt.else_block) //Ensure that it is an if statement - parser.errors+=new/scriptError/ExpectedToken("if statement",parser.curToken) - return KW_FAIL - parser.NextToken() //skip 'else' token - if(!parser.CheckToken("{", /token/symbol, skip=0)) - return KW_ERR - stmt.else_block=new() - parser.AddBlock(stmt.else_block) +/n_Keyword/nS_Keyword/kwElse/Parse(n_Parser/nS_Parser/parser) + .=KW_PASS + var/list/L=parser.curBlock.statements + var/node/statement/IfStatement/stmt + if(L&&L.len) stmt=L[L.len] //Get the last statement in the current block + if(!stmt || !istype(stmt) || stmt.else_block) //Ensure that it is an if statement + parser.errors+=new/scriptError/ExpectedToken("if statement",parser.curToken) + return KW_FAIL + parser.NextToken() //skip 'else' token + if(!parser.CheckToken("{", /token/symbol, skip=0)) + return KW_ERR + stmt.else_block=new() + parser.AddBlock(stmt.else_block) - kwWhile - Parse(n_Parser/nS_Parser/parser) - .=KW_PASS - var/node/statement/WhileLoop/stmt=new - parser.NextToken() //skip 'while' token - stmt.cond=parser.ParseParenExpression() - if(!parser.CheckToken(")", /token/symbol)) - return KW_FAIL - if(!parser.CheckToken("{", /token/symbol, skip=0)) - return KW_ERR - parser.curBlock.statements+=stmt - stmt.block=new - parser.AddBlock(stmt.block) +/n_Keyword/nS_Keyword/kwWhile/Parse(n_Parser/nS_Parser/parser) + .=KW_PASS + var/node/statement/WhileLoop/stmt=new + parser.NextToken() //skip 'while' token + stmt.cond=parser.ParseParenExpression() + if(!parser.CheckToken(")", /token/symbol)) + return KW_FAIL + if(!parser.CheckToken("{", /token/symbol, skip=0)) + return KW_ERR + parser.curBlock.statements+=stmt + stmt.block=new + parser.AddBlock(stmt.block) - kwBreak - Parse(n_Parser/nS_Parser/parser) - .=KW_PASS - if(istype(parser.curBlock, /node/BlockDefinition/GlobalBlock)) - parser.errors+=new/scriptError/BadToken(parser.curToken) - . = KW_WARN - var/node/statement/BreakStatement/stmt=new - parser.NextToken() //skip 'break' token - parser.curBlock.statements+=stmt +/n_Keyword/nS_Keyword/kwBreak/Parse(n_Parser/nS_Parser/parser) + .=KW_PASS + if(istype(parser.curBlock, /node/BlockDefinition/GlobalBlock)) + parser.errors+=new/scriptError/BadToken(parser.curToken) + . = KW_WARN + var/node/statement/BreakStatement/stmt=new + parser.NextToken() //skip 'break' token + parser.curBlock.statements+=stmt - kwContinue - Parse(n_Parser/nS_Parser/parser) - .=KW_PASS - if(istype(parser.curBlock, /node/BlockDefinition/GlobalBlock)) - parser.errors+=new/scriptError/BadToken(parser.curToken) - . = KW_WARN - var/node/statement/ContinueStatement/stmt=new - parser.NextToken() //skip 'break' token - parser.curBlock.statements+=stmt +/n_Keyword/nS_Keyword/kwContinue/Parse(n_Parser/nS_Parser/parser) + .=KW_PASS + if(istype(parser.curBlock, /node/BlockDefinition/GlobalBlock)) + parser.errors+=new/scriptError/BadToken(parser.curToken) + . = KW_WARN + var/node/statement/ContinueStatement/stmt=new + parser.NextToken() //skip 'break' token + parser.curBlock.statements+=stmt - kwDef - Parse(n_Parser/nS_Parser/parser) - .=KW_PASS - var/node/statement/FunctionDefinition/def=new - parser.NextToken() //skip 'def' token - if(!parser.options.IsValidID(parser.curToken.value)) - parser.errors+=new/scriptError/InvalidID(parser.curToken) - return KW_FAIL - def.func_name=parser.curToken.value - parser.NextToken() - if(!parser.CheckToken("(", /token/symbol)) - return KW_FAIL - while(TRUE) //for now parameters can be separated by whitespace - they don't need a comma in between - if(istype(parser.curToken, /token/symbol)) - switch(parser.curToken.value) - if(",") - parser.NextToken() - if(")") - break - else - parser.errors+=new/scriptError/BadToken(parser.curToken) - return KW_ERR - - else if(istype(parser.curToken, /token/word)) - def.parameters+=parser.curToken.value - parser.NextToken() - else - parser.errors+=new/scriptError/InvalidID(parser.curToken) - return KW_ERR - if(!parser.CheckToken(")", /token/symbol)) - return KW_FAIL - - if(istype(parser.curToken, /token/end)) //Function prototype - parser.curBlock.statements+=def - else if(parser.curToken.value=="{" && istype(parser.curToken, /token/symbol)) - def.block = new - parser.curBlock.statements+=def - parser.curBlock.functions[def.func_name]=def - parser.AddBlock(def.block) +/n_Keyword/nS_Keyword/kwDef/Parse(n_Parser/nS_Parser/parser) + .=KW_PASS + var/node/statement/FunctionDefinition/def=new + parser.NextToken() //skip 'def' token + if(!parser.options.IsValidID(parser.curToken.value)) + parser.errors+=new/scriptError/InvalidID(parser.curToken) + return KW_FAIL + def.func_name=parser.curToken.value + parser.NextToken() + if(!parser.CheckToken("(", /token/symbol)) + return KW_FAIL + while(TRUE) //for now parameters can be separated by whitespace - they don't need a comma in between + if(istype(parser.curToken, /token/symbol)) + switch(parser.curToken.value) + if(",") + parser.NextToken() + if(")") + break else parser.errors+=new/scriptError/BadToken(parser.curToken) - return KW_FAIL + return KW_ERR + + else if(istype(parser.curToken, /token/word)) + def.parameters+=parser.curToken.value + parser.NextToken() + else + parser.errors+=new/scriptError/InvalidID(parser.curToken) + return KW_ERR + if(!parser.CheckToken(")", /token/symbol)) + return KW_FAIL + + if(istype(parser.curToken, /token/end)) //Function prototype + parser.curBlock.statements+=def + else if(parser.curToken.value=="{" && istype(parser.curToken, /token/symbol)) + def.block = new + parser.curBlock.statements+=def + parser.curBlock.functions[def.func_name]=def + parser.AddBlock(def.block) + else + parser.errors+=new/scriptError/BadToken(parser.curToken) + return KW_FAIL diff --git a/code/modules/scripting/Parser/Parser.dm b/code/modules/scripting/Parser/Parser.dm index fa7dd8789f..ab4d6805e7 100644 --- a/code/modules/scripting/Parser/Parser.dm +++ b/code/modules/scripting/Parser/Parser.dm @@ -6,18 +6,16 @@ An object that reads tokens and produces an AST (abstract syntax tree). */ /n_Parser - var + var/index = 1 /* Var: index The parser's current position in the token's list. */ - index = 1 - list /* Var: tokens A list of tokens in the source code generated by a scanner. */ - tokens = new + var/list/tokens = new /* Var: errors A list of fatal errors found by the parser. If there are any items in this list, then it is not safe to run the returned AST. @@ -25,41 +23,37 @@ See Also: - */ - errors = new + var/list/errors = new /* Var: warnings A list of non-fatal problems in the script. */ - warnings = new - token + var/list/warnings = new /* Var: curToken The token at in . */ - curToken - stack - blocks=new - node/BlockDefinition - GlobalBlock/global_block=new - curBlock + var/token/curToken + var/stack/blocks=new + var/node/BlockDefinition/GlobalBlock/global_block=new + var/node/BlockDefinition/curBlock - proc /* Proc: Parse Reads the tokens and returns the AST's node. Be sure to populate the tokens list before calling this procedure. */ - Parse() +/n_Parser/proc/Parse() /* Proc: NextToken Sets to the next token in the list, or null if there are no more tokens. */ - NextToken() - if(index>=tokens.len) - curToken=null - else - curToken=tokens[++index] - return curToken +/n_Parser/proc/NextToken() + if(index>=tokens.len) + curToken=null + else + curToken=tokens[++index] + return curToken /* Class: nS_Parser @@ -74,116 +68,115 @@ tokens - A list of tokens to parse. options - An object used for configuration. */ - New(tokens[], n_scriptOptions/options) - src.tokens=tokens - src.options=options - curBlock=global_block - return ..() +/n_Parser/nS_Parser/New(tokens[], n_scriptOptions/options) + src.tokens=tokens + src.options=options + curBlock=global_block + return ..() - Parse() - ASSERT(tokens) - for(,src.index<=src.tokens.len, src.index++) - curToken=tokens[index] - switch(curToken.type) - if(/token/keyword) - var/n_Keyword/kw=options.keywords[curToken.value] - kw=new kw() - if(kw) - if(!kw.Parse(src)) - return - if(/token/word) - var/token/ntok - if(index+1>tokens.len) - errors+=new/scriptError/BadToken(curToken) - continue - ntok=tokens[index+1] - if(!istype(ntok, /token/symbol)) - errors+=new/scriptError/BadToken(ntok) - continue - if(ntok.value=="(") - ParseFunctionStatement() - else if(options.assign_operators.Find(ntok.value)) - ParseAssignment() - else - errors+=new/scriptError/BadToken(ntok) - continue - if(!istype(curToken, /token/end)) - errors+=new/scriptError/ExpectedToken(";", curToken) - continue - if(/token/symbol) - if(curToken.value=="}") - if(!EndBlock()) - errors+=new/scriptError/BadToken(curToken) - continue - else - errors+=new/scriptError/BadToken(curToken) - continue - if(/token/end) - warnings+=new/scriptError/BadToken(curToken) +/n_Parser/nS_Parser/Parse() + ASSERT(tokens) + for(,src.index<=src.tokens.len, src.index++) + curToken=tokens[index] + switch(curToken.type) + if(/token/keyword) + var/n_Keyword/kw=options.keywords[curToken.value] + kw=new kw() + if(kw) + if(!kw.Parse(src)) + return + if(/token/word) + var/token/ntok + if(index+1>tokens.len) + errors+=new/scriptError/BadToken(curToken) continue + ntok=tokens[index+1] + if(!istype(ntok, /token/symbol)) + errors+=new/scriptError/BadToken(ntok) + continue + if(ntok.value=="(") + ParseFunctionStatement() + else if(options.assign_operators.Find(ntok.value)) + ParseAssignment() + else + errors+=new/scriptError/BadToken(ntok) + continue + if(!istype(curToken, /token/end)) + errors+=new/scriptError/ExpectedToken(";", curToken) + continue + if(/token/symbol) + if(curToken.value=="}") + if(!EndBlock()) + errors+=new/scriptError/BadToken(curToken) + continue else errors+=new/scriptError/BadToken(curToken) - return - return global_block - - proc - CheckToken(val, type, err=1, skip=1) - if(curToken.value!=val || !istype(curToken,type)) - if(err) - errors+=new/scriptError/ExpectedToken(val, curToken) - return 0 - if(skip)NextToken() - return 1 - - AddBlock(node/BlockDefinition/B) - blocks.Push(curBlock) - curBlock=B - - EndBlock() - if(curBlock==global_block) return 0 - curBlock=blocks.Pop() - return 1 - - ParseAssignment() - var/name=curToken.value - if(!options.IsValidID(name)) - errors+=new/scriptError/InvalidID(curToken) - return - NextToken() - var/t=options.binary_operators[options.assign_operators[curToken.value]] - var/node/statement/VariableAssignment/stmt=new() - stmt.var_name=new(name) - NextToken() - if(t) - stmt.value=new t() - stmt.value:exp=new/node/expression/value/variable(stmt.var_name) - stmt.value:exp2=ParseExpression() + continue + if(/token/end) + warnings+=new/scriptError/BadToken(curToken) + continue else - stmt.value=ParseExpression() + errors+=new/scriptError/BadToken(curToken) + return + return global_block + +/n_Parser/nS_Parser/proc/CheckToken(val, type, err=1, skip=1) + if(curToken.value!=val || !istype(curToken,type)) + if(err) + errors+=new/scriptError/ExpectedToken(val, curToken) + return 0 + if(skip)NextToken() + return 1 + +/n_Parser/nS_Parser/proc/AddBlock(node/BlockDefinition/B) + blocks.Push(curBlock) + curBlock=B + +/n_Parser/nS_Parser/proc/EndBlock() + if(curBlock==global_block) return 0 + curBlock=blocks.Pop() + return 1 + +/n_Parser/nS_Parser/proc/ParseAssignment() + var/name=curToken.value + if(!options.IsValidID(name)) + errors+=new/scriptError/InvalidID(curToken) + return + NextToken() + var/t=options.binary_operators[options.assign_operators[curToken.value]] + var/node/statement/VariableAssignment/stmt=new() + stmt.var_name=new(name) + NextToken() + if(t) + stmt.value=new t() + stmt.value:exp=new/node/expression/value/variable(stmt.var_name) + stmt.value:exp2=ParseExpression() + else + stmt.value=ParseExpression() + curBlock.statements+=stmt + +/n_Parser/nS_Parser/proc/ParseFunctionStatement() + if(!istype(curToken, /token/word)) + errors+=new/scriptError("Bad identifier in function call.") + return + var/node/statement/FunctionCall/stmt=new + stmt.func_name=curToken.value + NextToken() //skip function name + if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis + return + var/loops = 0 + while(TRUE) + loops++ + if(loops>=6000) + CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;") + + if(!curToken) + errors+=new/scriptError/EndOfFile() + return + if(istype(curToken, /token/symbol) && curToken.value==")") curBlock.statements+=stmt - - ParseFunctionStatement() - if(!istype(curToken, /token/word)) - errors+=new/scriptError("Bad identifier in function call.") - return - var/node/statement/FunctionCall/stmt=new - stmt.func_name=curToken.value - NextToken() //skip function name - if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis - return - var/loops = 0 - while(TRUE) - loops++ - if(loops>=6000) - CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;") - - if(!curToken) - errors+=new/scriptError/EndOfFile() - return - if(istype(curToken, /token/symbol) && curToken.value==")") - curBlock.statements+=stmt - NextToken() //Skip close parenthesis - return - var/node/expression/P=ParseParamExpression() - stmt.parameters+=P - if(istype(curToken, /token/symbol) && curToken.value==",") NextToken() \ No newline at end of file + NextToken() //Skip close parenthesis + return + var/node/expression/P=ParseParamExpression() + stmt.parameters+=P + if(istype(curToken, /token/symbol) && curToken.value==",") NextToken() \ No newline at end of file diff --git a/code/modules/scripting/Scanner/Scanner.dm b/code/modules/scripting/Scanner/Scanner.dm index 78c120a22e..919bb82a48 100644 --- a/code/modules/scripting/Scanner/Scanner.dm +++ b/code/modules/scripting/Scanner/Scanner.dm @@ -6,9 +6,7 @@ An object responsible for breaking up source code into tokens for use by the parser. */ /n_Scanner - var - code - list + var/code /* Var: errors A list of fatal errors found by the scanner. If there are any items in this list, then it is not safe to parse the returned tokens. @@ -16,33 +14,32 @@ See Also: - */ - errors = new + var/list/errors = new /* Var: warnings A list of non-fatal problems in the source code found by the scanner. */ - warnings = new + var/list/warnings = new - proc /* Proc: LoadCode Loads source code. */ - LoadCode(c) +/n_Scanner/proc/LoadCode(c) code=c /* Proc: LoadCodeFromFile Gets the code from a file and calls . */ - LoadCodeFromFile(f) +/n_Scanner/proc/LoadCodeFromFile(f) LoadCode(file2text(f)) /* Proc: Scan Runs the scanner and returns the resulting list of tokens. Ensure that has been called first. */ - Scan() +/n_Scanner/proc/Scan() /* Class: nS_Scanner @@ -50,20 +47,15 @@ */ /n_Scanner/nS_Scanner - var /* Variable: codepos The scanner's position in the source code. */ - codepos = 1 - line = 1 - linepos = 0 //column=codepos-linepos - n_scriptOptions/nS_Options/options - - commenting = 0 - // 1: single-line - // 2: multi-line - list + var/codepos = 1 + var/line = 1 + var/linepos = 0 //column=codepos-linepos + var/n_scriptOptions/nS_Options/options + var/commenting = 0 /// 1 is a single-line comment, 2 is a multi-line comment /* Variable: ignore A list of characters that are ignored by the scanner. @@ -71,7 +63,7 @@ Default Value: Whitespace */ - ignore = list(" ", "\t", "\n") //Don't add tokens for whitespace + var/list/ignore = list(" ", "\t", "\n") //Don't add tokens for whitespace /* Variable: end_stmt A list of characters that end a statement. Each item may only be one character long. @@ -79,7 +71,7 @@ Default Value: Semicolon */ - end_stmt = list(";") + var/list/end_stmt = list(";") /* Variable: string_delim A list of characters that can start and end strings. @@ -87,12 +79,12 @@ Default Value: Double and single quotes. */ - string_delim = list("\"", "'") + var/list/string_delim = list("\"", "'") /* Variable: delim A list of characters that denote the start of a new token. This list is automatically populated. */ - delim = new + var/list/delim = new /* Macro: COL @@ -106,45 +98,44 @@ code - The source code to tokenize. options - An object used to configure the scanner. */ - New(code, n_scriptOptions/nS_Options/options) - .=..() - ignore+= ascii2text(13) //Carriage return - delim += ignore + options.symbols + end_stmt + string_delim - src.options=options - LoadCode(code) +/n_Scanner/nS_Scanner/New(code, n_scriptOptions/nS_Options/options) + .=..() + ignore+= ascii2text(13) //Carriage return + delim += ignore + options.symbols + end_stmt + string_delim + src.options=options + LoadCode(code) - Scan() //Creates a list of tokens from source code - var/list/tokens=new - for(, src.codepos<=length(code), src.codepos++) +/n_Scanner/nS_Scanner/Scan() //Creates a list of tokens from source code + var/list/tokens=new + for(, src.codepos<=length(code), src.codepos++) - var/char=copytext(code, codepos, codepos+1) - if(char=="\n") - line++ - linepos=codepos + var/char=copytext(code, codepos, codepos+1) + if(char=="\n") + line++ + linepos=codepos - if(ignore.Find(char)) - continue - else if(char == "/") - ReadComment() - else if(end_stmt.Find(char)) - tokens+=new /token/end(char, line, COL) - else if(string_delim.Find(char)) - codepos++ //skip string delimiter - tokens+=ReadString(char) - else if(options.CanStartID(char)) - tokens+=ReadWord() - else if(options.IsDigit(char)) - tokens+=ReadNumber() - else if(options.symbols.Find(char)) - tokens+=ReadSymbol() + if(ignore.Find(char)) + continue + else if(char == "/") + ReadComment() + else if(end_stmt.Find(char)) + tokens+=new /token/end(char, line, COL) + else if(string_delim.Find(char)) + codepos++ //skip string delimiter + tokens+=ReadString(char) + else if(options.CanStartID(char)) + tokens+=ReadWord() + else if(options.IsDigit(char)) + tokens+=ReadNumber() + else if(options.symbols.Find(char)) + tokens+=ReadSymbol() - codepos=initial(codepos) - line=initial(line) - linepos=initial(linepos) - return tokens + codepos=initial(codepos) + line=initial(line) + linepos=initial(linepos) + return tokens - proc /* Proc: ReadString Reads a string in the source code into a token. @@ -152,131 +143,131 @@ Parameters: start - The character used to start the string. */ - ReadString(start) - var/buf - for(, codepos <= length(code), codepos++)//codepos to length(code)) - var/char=copytext(code, codepos, codepos+1) +/n_Scanner/nS_Scanner/proc/ReadString(start) + var/buf + for(, codepos <= length(code), codepos++)//codepos to length(code)) + var/char=copytext(code, codepos, codepos+1) + switch(char) + if("\\") //Backslash (\) encountered in string + codepos++ //Skip next character in string, since it was escaped by a backslash + char=copytext(code, codepos, codepos+1) switch(char) - if("\\") //Backslash (\) encountered in string - codepos++ //Skip next character in string, since it was escaped by a backslash - char=copytext(code, codepos, codepos+1) - switch(char) - if("\\") //Double backslash - buf+="\\" - if("n") //\n Newline - buf+="\n" - else - if(char==start) //\" Doublequote - buf+=start - else //Unknown escaped text - buf+=char - if("\n") - . = new/token/string(buf, line, COL) - errors+=new/scriptError("Unterminated string. Newline reached.", .) - line++ - linepos=codepos - break + if("\\") //Double backslash + buf+="\\" + if("n") //\n Newline + buf+="\n" else - if(char==start) //string delimiter found, end string - break - else - buf+=char //Just a normal character in a string - if(!.) return new/token/string(buf, line, COL) - -/* - Proc: ReadWord - Reads characters separated by an item in into a token. -*/ - ReadWord() - var/char=copytext(code, codepos, codepos+1) - var/buf - while(!delim.Find(char) && codepos<=length(code)) - buf+=char - char=copytext(code, ++codepos, codepos+1) - codepos-- //allow main Scan() proc to read the delimiter - if(options.keywords.Find(buf)) - return new /token/keyword(buf, line, COL) + if(char==start) //\" Doublequote + buf+=start + else //Unknown escaped text + buf+=char + if("\n") + . = new/token/string(buf, line, COL) + errors+=new/scriptError("Unterminated string. Newline reached.", .) + line++ + linepos=codepos + break else - return new /token/word(buf, line, COL) + if(char==start) //string delimiter found, end string + break + else + buf+=char //Just a normal character in a string + if(!.) return new/token/string(buf, line, COL) /* - Proc: ReadSymbol - Reads a symbol into a token. +Proc: ReadWord +Reads characters separated by an item in into a token. */ - ReadSymbol() - var/char=copytext(code, codepos, codepos+1) - var/buf - - while(options.symbols.Find(buf+char)) - buf+=char - if(++codepos>length(code)) break - char=copytext(code, codepos, codepos+1) - - codepos-- //allow main Scan() proc to read the next character - return new /token/symbol(buf, line, COL) +/n_Scanner/nS_Scanner/proc/ReadWord() + var/char=copytext(code, codepos, codepos+1) + var/buf + while(!delim.Find(char) && codepos<=length(code)) + buf+=char + char=copytext(code, ++codepos, codepos+1) + codepos-- //allow main Scan() proc to read the delimiter + if(options.keywords.Find(buf)) + return new /token/keyword(buf, line, COL) + else + return new /token/word(buf, line, COL) /* - Proc: ReadNumber - Reads a number into a token. +Proc: ReadSymbol +Reads a symbol into a token. */ - ReadNumber() - var/char=copytext(code, codepos, codepos+1) - var/buf - var/dec=0 +/n_Scanner/nS_Scanner/proc/ReadSymbol() + var/char=copytext(code, codepos, codepos+1) + var/buf - while(options.IsDigit(char) || (char=="." && !dec)) - if(char==".") dec=1 - buf+=char - codepos++ - char=copytext(code, codepos, codepos+1) - var/token/number/T=new(buf, line, COL) - if(isnull(text2num(buf))) - errors+=new/scriptError("Bad number: ", T) - T.value=0 - codepos-- //allow main Scan() proc to read the next character - return T + while(options.symbols.Find(buf+char)) + buf+=char + if(++codepos>length(code)) break + char=copytext(code, codepos, codepos+1) + + codepos-- //allow main Scan() proc to read the next character + return new /token/symbol(buf, line, COL) /* - Proc: ReadComment - Reads a comment and outputs the type of comment +Proc: ReadNumber +Reads a number into a token. +*/ +/n_Scanner/nS_Scanner/proc/ReadNumber() + var/char=copytext(code, codepos, codepos+1) + var/buf + var/dec=0 + + while(options.IsDigit(char) || (char=="." && !dec)) + if(char==".") dec=1 + buf+=char + codepos++ + char=copytext(code, codepos, codepos+1) + var/token/number/T=new(buf, line, COL) + if(isnull(text2num(buf))) + errors+=new/scriptError("Bad number: ", T) + T.value=0 + codepos-- //allow main Scan() proc to read the next character + return T + +/* +Proc: ReadComment +Reads a comment and outputs the type of comment */ - ReadComment() - var/char=copytext(code, codepos, codepos+1) - var/nextchar=copytext(code, codepos+1, codepos+2) - var/charstring = char+nextchar - var/comm = 1 - // 1: single-line comment - // 2: multi-line comment - var/expectedend = 0 +/n_Scanner/nS_Scanner/proc/ReadComment() + var/char=copytext(code, codepos, codepos+1) + var/nextchar=copytext(code, codepos+1, codepos+2) + var/charstring = char+nextchar + var/comm = 1 + // 1: single-line comment + // 2: multi-line comment + var/expectedend = 0 - if(charstring == "//" || charstring == "/*") - if(charstring == "/*") - comm = 2 // starts a multi-line comment + if(charstring == "//" || charstring == "/*") + if(charstring == "/*") + comm = 2 // starts a multi-line comment - while(comm) - if(++codepos>length(code)) break + while(comm) + if(++codepos>length(code)) break - if(expectedend) // ending statement expected... - char = copytext(code, codepos, codepos+1) - if(char == "/") // ending statement found - beak the comment - comm = 0 - break + if(expectedend) // ending statement expected... + char = copytext(code, codepos, codepos+1) + if(char == "/") // ending statement found - beak the comment + comm = 0 + break - if(comm == 2) - // multi-line comments are broken by ending statements - char = copytext(code, codepos, codepos+1) - if(char == "*") - expectedend = 1 - continue - else - char = copytext(code, codepos, codepos+1) - if(char == "\n") - comm = 0 - break + if(comm == 2) + // multi-line comments are broken by ending statements + char = copytext(code, codepos, codepos+1) + if(char == "*") + expectedend = 1 + continue + else + char = copytext(code, codepos, codepos+1) + if(char == "\n") + comm = 0 + break - if(expectedend) expectedend = 0 + if(expectedend) expectedend = 0 - if(comm == 2) - errors+=new/scriptError/UnterminatedComment() + if(comm == 2) + errors+=new/scriptError/UnterminatedComment() diff --git a/code/modules/scripting/Scanner/Tokens.dm b/code/modules/scripting/Scanner/Tokens.dm index 0c2a8a5cc7..5068e97c5a 100644 --- a/code/modules/scripting/Scanner/Tokens.dm +++ b/code/modules/scripting/Scanner/Tokens.dm @@ -9,30 +9,29 @@ var/line var/column - New(v, l=0, c=0) - value=v - line=l - column=c +/token/New(v, l=0, c=0) + value=v + line=l + column=c - string - symbol - word - keyword - number - New() - .=..() - if(!isnum(value)) - value=text2num(value) - ASSERT(!isnull(value)) - accessor - var/object - var/member +/token/string +/token/symbol +/token/word +/token/keyword +/token/number/New() + .=..() + if(!isnum(value)) + value=text2num(value) + ASSERT(!isnull(value)) +/token/accessor + var/object + var/member - New(object, member, l=0, c=0) - src.object=object - src.member=member - src.value="[object].[member]" //for debugging only - src.line=l - src.column=c +/token/accessor/New(object, member, l=0, c=0) + src.object=object + src.member=member + src.value="[object].[member]" //for debugging only + src.line=l + src.column=c - end +/token/end diff --git a/code/modules/scripting/stack.dm b/code/modules/scripting/stack.dm index be4147c7ec..3c7fa52ac7 100644 --- a/code/modules/scripting/stack.dm +++ b/code/modules/scripting/stack.dm @@ -1,23 +1,21 @@ /stack - var/list - contents=new - proc - Push(value) - contents+=value + var/list/contents=new +/stack/proc/Push(value) + contents+=value - Pop() - if(!contents.len) return null - . = contents[contents.len] - contents.len-- +/stack/proc/Pop() + if(!contents.len) return null + . = contents[contents.len] + contents.len-- - Top() //returns the item on the top of the stack without removing it - if(!contents.len) return null - return contents[contents.len] +/stack/proc/Top() //returns the item on the top of the stack without removing it + if(!contents.len) return null + return contents[contents.len] - Copy() - var/stack/S=new() - S.contents=src.contents.Copy() - return S +/stack/proc/Copy() + var/stack/S=new() + S.contents=src.contents.Copy() + return S - Clear() - contents.Cut() \ No newline at end of file +/stack/proc/Clear() + contents.Cut() \ No newline at end of file diff --git a/code/modules/shieldgen/directional_shield.dm b/code/modules/shieldgen/directional_shield.dm index d3d943297a..ebc4f51d3a 100644 --- a/code/modules/shieldgen/directional_shield.dm +++ b/code/modules/shieldgen/directional_shield.dm @@ -362,15 +362,15 @@ if((my_tool && loc != my_tool) && (my_mecha && loc != my_mecha)) forceMove(my_tool) if(active) - my_tool.set_ready_state(0) + my_tool.set_ready_state(FALSE) if(my_mecha.has_charge(my_tool.energy_drain * 50)) //Stops at around 1000 charge. my_mecha.use_power(my_tool.energy_drain) else destroy_shields() - my_tool.set_ready_state(1) + my_tool.set_ready_state(TRUE) my_tool.log_message("Power lost.") else - my_tool.set_ready_state(1) + my_tool.set_ready_state(TRUE) /obj/item/shield_projector/line/exosuit/attack_self(var/mob/living/user) if(active) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index e7d18fe128..aefcf82fb9 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -1,5 +1,5 @@ /datum/shuttle/autodock/ferry/escape_pod - var/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/arming_controller + var/datum/embedded_program/docking/simple/escape_pod_berth/arming_controller category = /datum/shuttle/autodock/ferry/escape_pod /datum/shuttle/autodock/ferry/escape_pod/New() @@ -19,7 +19,7 @@ CRASH("Could not find arming controller for escape pod \"[name]\", tag was '[arming_controller_tag]'.") //find the pod's own controller - var/datum/computer/file/embedded_program/docking/simple/prog = SSshuttles.docking_registry[docking_controller_tag] + var/datum/embedded_program/docking/simple/prog = SSshuttles.docking_registry[docking_controller_tag] var/obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/controller_master = prog.master if(!istype(controller_master)) CRASH("Escape pod \"[name]\" could not find it's controller master! docking_controller_tag=[docking_controller_tag]") @@ -44,12 +44,12 @@ //This controller goes on the escape pod itself /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod name = "escape pod controller" - program = /datum/computer/file/embedded_program/docking/simple + program = /datum/embedded_program/docking/simple var/datum/shuttle/autodock/ferry/escape_pod/pod /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) var/data[0] - var/datum/computer/file/embedded_program/docking/simple/docking_program = program // Cast to proper type + var/datum/embedded_program/docking/simple/docking_program = program // Cast to proper type data = list( "docking_status" = docking_program.get_docking_status(), @@ -88,15 +88,15 @@ //This controller is for the escape pod berth (station side) /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth name = "escape pod berth controller" - program = /datum/computer/file/embedded_program/docking/simple/escape_pod_berth + program = /datum/embedded_program/docking/simple/escape_pod_berth /obj/machinery/embedded_controller/radio/simple_docking_controller/escape_pod_berth/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1) var/data[0] - var/datum/computer/file/embedded_program/docking/simple/docking_program = program // Cast to proper type + var/datum/embedded_program/docking/simple/docking_program = program // Cast to proper type var/armed = null - if (istype(docking_program, /datum/computer/file/embedded_program/docking/simple/escape_pod_berth)) - var/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/P = docking_program + if (istype(docking_program, /datum/embedded_program/docking/simple/escape_pod_berth)) + var/datum/embedded_program/docking/simple/escape_pod_berth/P = docking_program armed = P.armed data = list( @@ -117,44 +117,44 @@ if (!emagged) to_chat(user, "You emag the [src], arming the escape pod!") emagged = 1 - if (istype(program, /datum/computer/file/embedded_program/docking/simple/escape_pod_berth)) - var/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/P = program + if (istype(program, /datum/embedded_program/docking/simple/escape_pod_berth)) + var/datum/embedded_program/docking/simple/escape_pod_berth/P = program if (!P.armed) P.arm() return 1 //A docking controller program for a simple door based docking port -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth +/datum/embedded_program/docking/simple/escape_pod_berth var/armed = 0 var/eject_delay = 10 //give latecomers some time to get out of the way if they don't make it onto the pod var/eject_time = null var/closing = 0 -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/proc/arm() +/datum/embedded_program/docking/simple/escape_pod_berth/proc/arm() if(!armed) armed = 1 open_door() -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/receive_user_command(command) +/datum/embedded_program/docking/simple/escape_pod_berth/receive_user_command(command) if (!armed) return TRUE // Eat all commands. return ..(command) -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/process() +/datum/embedded_program/docking/simple/escape_pod_berth/process() ..() if (eject_time && world.time >= eject_time && !closing) close_door() closing = 1 -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/prepare_for_docking() +/datum/embedded_program/docking/simple/escape_pod_berth/prepare_for_docking() return -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/ready_for_docking() +/datum/embedded_program/docking/simple/escape_pod_berth/ready_for_docking() return 1 -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/finish_docking() +/datum/embedded_program/docking/simple/escape_pod_berth/finish_docking() return //don't do anything - the doors only open when the pod is armed. -/datum/computer/file/embedded_program/docking/simple/escape_pod_berth/prepare_for_undocking() +/datum/embedded_program/docking/simple/escape_pod_berth/prepare_for_undocking() eject_time = world.time + eject_delay*10 diff --git a/code/modules/shuttles/landmarks.dm b/code/modules/shuttles/landmarks.dm index 62c8200ff5..c55e13ea97 100644 --- a/code/modules/shuttles/landmarks.dm +++ b/code/modules/shuttles/landmarks.dm @@ -12,7 +12,7 @@ //ID of the landmark var/landmark_tag //ID of the controller on the dock side (intialize to id_tag, becomes reference) - var/datum/computer/file/embedded_program/docking/docking_controller + var/datum/embedded_program/docking/docking_controller //Map of shuttle names to ID of controller used for this landmark for shuttles with multiple ones. var/list/special_dock_targets diff --git a/code/modules/shuttles/shuttle_autodock.dm b/code/modules/shuttles/shuttle_autodock.dm index aa59856b50..beb0bab011 100644 --- a/code/modules/shuttles/shuttle_autodock.dm +++ b/code/modules/shuttles/shuttle_autodock.dm @@ -1,5 +1,3 @@ -#define DOCK_ATTEMPT_TIMEOUT 200 //how long in ticks we wait before assuming the docking controller is broken or blown up. - // Subtype of shuttle that handles docking with docking controllers // Consists of code pulled down from the old /datum/shuttle and up from /datum/shuttle/ferry // Note: Since all known shuttles extend this type, this really could just be built into /datum/shuttle @@ -9,11 +7,11 @@ var/last_dock_attempt_time = 0 var/docking_controller_tag = null // ID of the controller on the shuttle (If multiple, this is the default one) - var/datum/computer/file/embedded_program/docking/shuttle_docking_controller // Controller on the shuttle (the one in use) + var/datum/embedded_program/docking/shuttle_docking_controller // Controller on the shuttle (the one in use) var/docking_codes var/tmp/obj/effect/shuttle_landmark/next_location //This is only used internally. - var/datum/computer/file/embedded_program/docking/active_docking_controller // Controller we are docked with (or trying to) + var/datum/embedded_program/docking/active_docking_controller // Controller we are docked with (or trying to) var/obj/effect/shuttle_landmark/landmark_transition //This variable is type-abused initially: specify the landmark_tag, not the actual landmark. var/move_time = 240 //the time spent in the transition area diff --git a/code/modules/shuttles/shuttle_ferry.dm b/code/modules/shuttles/shuttle_ferry.dm index cad706c800..24c00f0a6d 100644 --- a/code/modules/shuttles/shuttle_ferry.dm +++ b/code/modules/shuttles/shuttle_ferry.dm @@ -1,5 +1,3 @@ -#define DOCK_ATTEMPT_TIMEOUT 200 //how long in ticks we wait before assuming the docking controller is broken or blown up. - /datum/shuttle/autodock/ferry var/location = FERRY_LOCATION_STATION //0 = at area_station, 1 = at area_offsite var/direction = FERRY_GOING_TO_STATION //0 = going to station, 1 = going to offsite. diff --git a/code/modules/shuttles/shuttles_web.dm b/code/modules/shuttles/shuttles_web.dm index b134d0c1b8..fd13abe266 100644 --- a/code/modules/shuttles/shuttles_web.dm +++ b/code/modules/shuttles/shuttles_web.dm @@ -119,7 +119,7 @@ continue if(!H.shuttle_comp || !(get_area(H) in shuttle_area)) H.shuttle_comp = null - H.audible_message("\The [H] pings as it loses it's connection with the ship.") + H.audible_message("\The [H] pings as it loses it's connection with the ship.", runemessage = "ping") H.update_hud("discon") helmets -= H else diff --git a/code/modules/spells/construct_spells.dm b/code/modules/spells/construct_spells.dm index aac7592f33..15dfd3bd80 100644 --- a/code/modules/spells/construct_spells.dm +++ b/code/modules/spells/construct_spells.dm @@ -3,7 +3,7 @@ * Moved to game/gamemodes/cult/construct_spells.dm. Here for posterity. */ /* -proc/findNullRod(var/atom/target) +/proc/findNullRod(var/atom/target) if(istype(target,/obj/item/weapon/nullrod)) return 1 else if(target.contents) diff --git a/code/modules/turbolift/turbolift.dm b/code/modules/turbolift/turbolift.dm index 1caa898374..e0d13e570d 100644 --- a/code/modules/turbolift/turbolift.dm +++ b/code/modules/turbolift/turbolift.dm @@ -97,7 +97,7 @@ else // We failed to close the doors - probably, someone is blocking them; stop trying to move doors_closing = 0 open_doors() - control_panel_interior.audible_message("\The [current_floor.ext_panel] buzzes loudly.") + control_panel_interior.audible_message("\The [current_floor.ext_panel] buzzes loudly.", runemessage = "BUZZ") playsound(control_panel_interior, "sound/machines/buzz-two.ogg", 50, 1) return 0 diff --git a/code/modules/turbolift/turbolift_door.dm b/code/modules/turbolift/turbolift_door.dm index 79bf1d0c51..a979892abc 100644 --- a/code/modules/turbolift/turbolift_door.dm +++ b/code/modules/turbolift/turbolift_door.dm @@ -38,7 +38,7 @@ if(!moved) // nowhere to go.... LM.gib() else // the mob is too big to just move, so we need to give up what we're doing - audible_message("\The [src]'s motors grind as they quickly reverse direction, unable to safely close.") + audible_message("\The [src]'s motors grind as they quickly reverse direction, unable to safely close.", runemessage = "WRRRRR") cur_command = null // the door will just keep trying otherwise return 0 return ..() \ No newline at end of file diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index fe059b9e07..9f6cac4c65 100644 --- a/code/modules/vehicles/bike.dm +++ b/code/modules/vehicles/bike.dm @@ -28,8 +28,8 @@ var/datum/effect/effect/system/ion_trail_follow/ion var/kickstand = 1 -/obj/vehicle/bike/New() - ..() +/obj/vehicle/bike/Initialize() + . = ..() cell = new /obj/item/weapon/cell/high(src) ion = new /datum/effect/effect/system/ion_trail_follow() ion.set_up(src) diff --git a/code/modules/ventcrawl/ventcrawl_atmospherics.dm b/code/modules/ventcrawl/ventcrawl_atmospherics.dm index 1fd9dd077c..3ae52380d6 100644 --- a/code/modules/ventcrawl/ventcrawl_atmospherics.dm +++ b/code/modules/ventcrawl/ventcrawl_atmospherics.dm @@ -42,7 +42,16 @@ user.client.eye = target_move //if we don't do this, Byond only updates the eye every tick - required for smooth movement if(world.time > user.next_play_vent) user.next_play_vent = world.time+30 - playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3) + var/turf/T = get_turf(src) + playsound(T, 'sound/machines/ventcrawl.ogg', 50, 1, -3) + var/message = pick( + prob(90);"* clunk *", + prob(90);"* thud *", + prob(90);"* clatter *", + prob(1);"* *" + ) + T.runechat_message(message) + else if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && src.can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent user.remove_ventcrawl() @@ -73,7 +82,7 @@ /obj/machinery/atmospherics/pipe/manifold/isConnectable(var/obj/machinery/atmospherics/target) return (target == node3 || ..()) -obj/machinery/atmospherics/trinary/isConnectable(var/obj/machinery/atmospherics/target) +/obj/machinery/atmospherics/trinary/isConnectable(var/obj/machinery/atmospherics/target) return (target == node3 || ..()) /obj/machinery/atmospherics/pipe/manifold4w/isConnectable(var/obj/machinery/atmospherics/target) diff --git a/code/modules/virus2/admin.dm b/code/modules/virus2/admin.dm index 84e439e7ef..080674bd44 100644 --- a/code/modules/virus2/admin.dm +++ b/code/modules/virus2/admin.dm @@ -52,172 +52,172 @@ // this holds spawned viruses so that the "Info" links work after the proc exits var/list/spawned_viruses = list() - proc/select(mob/user, stage) - if(stage < 1 || stage > 4) return +/datum/virus2_editor/proc/select(mob/user, stage) + if(stage < 1 || stage > 4) return - var/list/L = list() + var/list/L = list() - for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect)) - var/datum/disease2/effect/f = e - if(initial(f.stage) <= stage) - L[initial(f.name)] = e + for(var/e in (typesof(/datum/disease2/effect) - /datum/disease2/effect)) + var/datum/disease2/effect/f = e + if(initial(f.stage) <= stage) + L[initial(f.name)] = e - var/datum/disease2/effect/Eff = s[stage] + var/datum/disease2/effect/Eff = s[stage] - var/C = input("Select effect for stage [stage]:", "Stage [stage]", initial(Eff.name)) as null|anything in L - if(!C) return - return L[C] + var/C = input("Select effect for stage [stage]:", "Stage [stage]", initial(Eff.name)) as null|anything in L + if(!C) return + return L[C] - proc/show_ui(mob/user) - var/H = {" -

    Virus2 Virus Editor


    - Effects:
    - "} - for(var/i = 1 to 4) - var/datum/disease2/effect/Eff = s[i] - H += {" - [initial(Eff.name)] - Chance: [s_chance[i]] - Multiplier: [s_multiplier[i]] -
    - "} +/datum/virus2_editor/proc/show_ui(mob/user) + var/H = {" +

    Virus2 Virus Editor


    + Effects:
    + "} + for(var/i = 1 to 4) + var/datum/disease2/effect/Eff = s[i] H += {" -
    - Infectable Species:
    - "} - var/f = 1 - for(var/k in GLOB.all_species) - var/datum/species/S = GLOB.all_species[k] - if(S.get_virus_immune()) - continue - if(!f) H += " | " - else f = 0 - H += "[k]" - H += {" - Reset -
    - Infection Chance: [infectionchance]
    - Spread Type: [spreadtype]
    - Speed: [speed]
    - Resistance: [resistance]
    -
    - "} - f = 1 - for(var/k in ALL_ANTIGENS) - if(!f) H += " | " - else f = 0 - H += "[k]" - H += {" - Reset -
    -
    - Initial infectee: [infectee ? infectee : "(choose)"] - RELEASE - "} + [initial(Eff.name)] + Chance: [s_chance[i]] + Multiplier: [s_multiplier[i]] +
    + "} + H += {" +
    + Infectable Species:
    + "} + var/f = 1 + for(var/k in GLOB.all_species) + var/datum/species/S = GLOB.all_species[k] + if(S.get_virus_immune()) + continue + if(!f) H += " | " + else f = 0 + H += "[k]" + H += {" + Reset +
    + Infection Chance: [infectionchance]
    + Spread Type: [spreadtype]
    + Speed: [speed]
    + Resistance: [resistance]
    +
    + "} + f = 1 + for(var/k in ALL_ANTIGENS) + if(!f) H += " | " + else f = 0 + H += "[k]" + H += {" + Reset +
    +
    + Initial infectee: [infectee ? infectee : "(choose)"] + RELEASE + "} - user << browse(H, "window=virus2edit") + user << browse(H, "window=virus2edit") - Topic(href, href_list) - switch(href_list["what"]) - if("effect") - var/stage = text2num(href_list["stage"]) - if(href_list["effect"]) - var/datum/disease2/effect/E = select(usr,stage) - if(!E) return - s[stage] = E - // set a default chance and multiplier of half the maximum (roughly average) - s_chance[stage] = max(1, round(initial(E.chance_maxm)/2)) - s_multiplier[stage] = max(1, round(initial(E.maxm)/2)) - else if(href_list["chance"]) - var/datum/disease2/effect/Eff = s[stage] - var/I = input("Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage]) as null|num - if(I == null || I < 0 || I > initial(Eff.chance_maxm)) return - s_chance[stage] = I - else if(href_list["multiplier"]) - var/datum/disease2/effect/Eff = s[stage] - var/I = input("Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage]) as null|num - if(I == null || I < 1 || I > initial(Eff.maxm)) return - s_multiplier[stage] = I - if("species") - if(href_list["toggle"]) - var/T = href_list["toggle"] - if(T in species) - species -= T +/datum/virus2_editor/Topic(href, href_list) + switch(href_list["what"]) + if("effect") + var/stage = text2num(href_list["stage"]) + if(href_list["effect"]) + var/datum/disease2/effect/E = select(usr,stage) + if(!E) return + s[stage] = E + // set a default chance and multiplier of half the maximum (roughly average) + s_chance[stage] = max(1, round(initial(E.chance_maxm)/2)) + s_multiplier[stage] = max(1, round(initial(E.maxm)/2)) + else if(href_list["chance"]) + var/datum/disease2/effect/Eff = s[stage] + var/I = input("Chance, per tick, of this effect happening (min 0, max [initial(Eff.chance_maxm)])", "Effect Chance", s_chance[stage]) as null|num + if(I == null || I < 0 || I > initial(Eff.chance_maxm)) return + s_chance[stage] = I + else if(href_list["multiplier"]) + var/datum/disease2/effect/Eff = s[stage] + var/I = input("Multiplier for this effect (min 1, max [initial(Eff.maxm)])", "Effect Multiplier", s_multiplier[stage]) as null|num + if(I == null || I < 1 || I > initial(Eff.maxm)) return + s_multiplier[stage] = I + if("species") + if(href_list["toggle"]) + var/T = href_list["toggle"] + if(T in species) + species -= T + else + species |= T + else if(href_list["reset"]) + species = list() + if(infectee) + if(!infectee.species || !(infectee.species.get_bodytype() in species)) + infectee = null + if("ichance") + var/I = input("Input infection chance", "Infection Chance", infectionchance) as null|num + if(!I) return + infectionchance = I + if("stype") + var/S = alert("Which spread type?", "Spread Type", "Contact", "Airborne", "Blood") + if(!S) return + spreadtype = S + if("speed") + var/S = input("Input speed", "Speed", speed) as null|num + if(!S) return + speed = S + if("antigen") + if(href_list["toggle"]) + var/T = href_list["toggle"] + if(length(T) != 1) return + if(T in antigens) + antigens -= T + else + antigens |= T + else if(href_list["reset"]) + antigens = list() + if("resistance") + var/S = input("Input % resistance to antibiotics", "Resistance", resistance) as null|num + if(!S) return + resistance = S + if("infectee") + var/list/candidates = list() + for(var/mob/living/carbon/G in living_mob_list) + if(G.stat != DEAD && G.species) + if(G.species.get_bodytype() in species) + candidates["[G.name][G.client ? "" : " (no client)"]"] = G else - species |= T - else if(href_list["reset"]) - species = list() - if(infectee) - if(!infectee.species || !(infectee.species.get_bodytype() in species)) - infectee = null - if("ichance") - var/I = input("Input infection chance", "Infection Chance", infectionchance) as null|num - if(!I) return - infectionchance = I - if("stype") - var/S = alert("Which spread type?", "Spread Type", "Contact", "Airborne", "Blood") - if(!S) return - spreadtype = S - if("speed") - var/S = input("Input speed", "Speed", speed) as null|num - if(!S) return - speed = S - if("antigen") - if(href_list["toggle"]) - var/T = href_list["toggle"] - if(length(T) != 1) return - if(T in antigens) - antigens -= T - else - antigens |= T - else if(href_list["reset"]) - antigens = list() - if("resistance") - var/S = input("Input % resistance to antibiotics", "Resistance", resistance) as null|num - if(!S) return - resistance = S - if("infectee") - var/list/candidates = list() - for(var/mob/living/carbon/G in living_mob_list) - if(G.stat != DEAD && G.species) - if(G.species.get_bodytype() in species) - candidates["[G.name][G.client ? "" : " (no client)"]"] = G - else - candidates["[G.name] ([G.species.get_bodytype()])[G.client ? "" : " (no client)"]"] = G - if(!candidates.len) - to_chat(usr, "No possible candidates found!") + candidates["[G.name] ([G.species.get_bodytype()])[G.client ? "" : " (no client)"]"] = G + if(!candidates.len) + to_chat(usr, "No possible candidates found!") - var/I = input("Choose initial infectee", "Infectee", infectee) as null|anything in candidates - if(!I || !candidates[I]) return - infectee = candidates[I] - species |= infectee.species.get_bodytype() - if("go") - if(!antigens.len) - var/a = alert("This disease has no antigens; it will be impossible to permanently immunise anyone without them.\ - It is strongly recommended to set at least one antigen. Do you want to go back and edit your virus?", "Antigens", "Yes", "Yes", "No") - if(a == "Yes") return - var/datum/disease2/disease/D = new - D.infectionchance = infectionchance - D.spreadtype = spreadtype - D.antigen = antigens - D.affected_species = species - D.speed = speed - D.resistance = resistance - for(var/i in 1 to 4) - var/datum/disease2/effectholder/E = new - var/Etype = s[i] - E.effect = new Etype() - E.effect.generate() - E.chance = s_chance[i] - E.multiplier = s_multiplier[i] - E.stage = i + var/I = input("Choose initial infectee", "Infectee", infectee) as null|anything in candidates + if(!I || !candidates[I]) return + infectee = candidates[I] + species |= infectee.species.get_bodytype() + if("go") + if(!antigens.len) + var/a = alert("This disease has no antigens; it will be impossible to permanently immunise anyone without them.\ + It is strongly recommended to set at least one antigen. Do you want to go back and edit your virus?", "Antigens", "Yes", "Yes", "No") + if(a == "Yes") return + var/datum/disease2/disease/D = new + D.infectionchance = infectionchance + D.spreadtype = spreadtype + D.antigen = antigens + D.affected_species = species + D.speed = speed + D.resistance = resistance + for(var/i in 1 to 4) + var/datum/disease2/effectholder/E = new + var/Etype = s[i] + E.effect = new Etype() + E.effect.generate() + E.chance = s_chance[i] + E.multiplier = s_multiplier[i] + E.stage = i - D.effects += E + D.effects += E - spawned_viruses += D + spawned_viruses += D - message_admins("[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus (Info)") - log_admin("[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus!") - infect_virus2(infectee, D, forced=1) + message_admins("[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus (Info)") + log_admin("[key_name_admin(usr)] infected [key_name_admin(infectee)] with a virus!") + infect_virus2(infectee, D, forced=1) - show_ui(usr) + show_ui(usr) diff --git a/code/modules/virus2/disease2.dm b/code/modules/virus2/disease2.dm index c9f437797e..08d52b1706 100644 --- a/code/modules/virus2/disease2.dm +++ b/code/modules/virus2/disease2.dm @@ -273,7 +273,7 @@ var/global/list/virusDB = list() virusDB["[uniqueID]"] = v return 1 -proc/virus2_lesser_infection() +/proc/virus2_lesser_infection() var/list/candidates = list() //list of candidate keys for(var/mob/living/carbon/human/G in player_list) @@ -286,7 +286,7 @@ proc/virus2_lesser_infection() infect_mob_random_lesser(candidates[1]) -proc/virus2_greater_infection() +/proc/virus2_greater_infection() var/list/candidates = list() //list of candidate keys for(var/mob/living/carbon/human/G in player_list) @@ -298,7 +298,7 @@ proc/virus2_greater_infection() infect_mob_random_greater(candidates[1]) -proc/virology_letterhead(var/report_name) +/proc/virology_letterhead(var/report_name) return {"

    [report_name]

    [station_name()] Virology Lab
    diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index 876d0d30b6..dd19e5e3f4 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -51,9 +51,9 @@ var/badness = 1 var/data = null // For semi-procedural effects; this should be generated in generate() if used - proc/activate(var/mob/living/carbon/mob,var/multiplier) - proc/deactivate(var/mob/living/carbon/mob) - proc/generate(copy_data) // copy_data will be non-null if this is a copy; it should be used to initialise the data for this effect if present +/datum/disease2/effect/proc/activate(var/mob/living/carbon/mob,var/multiplier) +/datum/disease2/effect/proc/deactivate(var/mob/living/carbon/mob) +/datum/disease2/effect/proc/generate(copy_data) // copy_data will be non-null if this is a copy; it should be used to initialise the data for this effect if present /datum/disease2/effect/invisible name = "Waiting Syndrome" diff --git a/code/modules/virus2/helpers.dm b/code/modules/virus2/helpers.dm index 64790fdfc5..18a8bb24e8 100644 --- a/code/modules/virus2/helpers.dm +++ b/code/modules/virus2/helpers.dm @@ -1,5 +1,5 @@ //Returns 1 if mob can be infected, 0 otherwise. -proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne") +/proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne") if (!istype(M)) return 0 @@ -56,7 +56,7 @@ proc/infection_check(var/mob/living/carbon/M, var/vector = "Airborne") return prob(protection) //Checks if table-passing table can reach target (5 tile radius) -proc/airborne_can_reach(turf/source, turf/target) +/proc/airborne_can_reach(turf/source, turf/target) var/obj/dummy = new(source) dummy.pass_flags = PASSTABLE diff --git a/code/modules/xenoarcheaology/effects/gravitational_waves.dm b/code/modules/xenoarcheaology/effects/gravitational_waves.dm index 8483d23d4b..6798eef64c 100644 --- a/code/modules/xenoarcheaology/effects/gravitational_waves.dm +++ b/code/modules/xenoarcheaology/effects/gravitational_waves.dm @@ -20,6 +20,6 @@ holder.visible_message("\The [holder] distorts as local gravity intensifies, and shifts toward it.") gravwave(get_turf(holder), effectrange, STAGE_TWO) -proc/gravwave(var/atom/target, var/pull_range = 7, var/pull_power = STAGE_TWO) +/proc/gravwave(var/atom/target, var/pull_range = 7, var/pull_power = STAGE_TWO) for(var/atom/A in oview(pull_range, target)) A.singularity_pull(target, pull_power) diff --git a/code/stylesheet.dm b/code/stylesheet.dm index 5ae2c9def1..2875eaf330 100644 --- a/code/stylesheet.dm +++ b/code/stylesheet.dm @@ -1,4 +1,4 @@ -client/script = {"